-
Notifications
You must be signed in to change notification settings - Fork 14
Add OkThSlider component #3048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
27
commits into
main
Choose a base branch
from
copilot/add-ok-component-for-fast-slider
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add OkThSlider component #3048
Changes from 6 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
016dd15
Add OK basic slider component
Copilot b0cb180
Add OK React slider wrapper
Copilot dbbf9a5
Scope slider to TestHub namespace
Copilot 3577776
Align slider visuals with switch
Copilot ae9ad82
Add slider value feedback
Copilot 8d2ec57
Refine slider thumb and labels
Copilot 26c2893
Keep slider value stable on hover
Copilot 10dd851
Make slider width responsive
Copilot 971f1dc
Make vertical slider height responsive
Copilot aa40e11
Document slider minimum length
Copilot 0d040d0
Match slider fill to pressed thumb
Copilot 63b7623
Minor fixes.
atmgrifter00 6176c12
Remove unused slider token import
Copilot 179c2e2
Show slider range labels while active
Copilot 3e5bf1f
Add slider coverage and CSS convention fixes
Copilot e628e36
Clarify disabled slider hover styles
Copilot b563e06
Address slider review clarity
Copilot 80ad2d9
Simplify slider test fixtures
Copilot e370db1
Combine slider orientation matrix states
Copilot e3860f3
Name slider matrix size
Copilot 00ca867
Disable Vite HMR in karma config to fix flaky test disconnects
Copilot dfea43a
Revert nimble-components test workaround
Copilot e93ac86
Matrix test label style fix
atmgrifter00 03fdb3f
Fix vertical slider.
atmgrifter00 4223a27
Add `showMinMax` and fix some styling issues.
atmgrifter00 bac0c01
Handling PR feedback.
atmgrifter00 18b1fa6
Merge branch 'main' into copilot/add-ok-component-for-fast-slider
atmgrifter00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
change/@ni-ok-components-235da122-2e5b-42cd-a1f9-52751ccbff2b.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "minor", | ||
| "comment": "Add the TestHub slider component", | ||
| "packageName": "@ni/ok-components", | ||
| "email": "198982749+Copilot@users.noreply.github.com", | ||
| "dependentChangeType": "none" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/@ni-ok-react-7f04b43d-439e-4848-b394-511e0909be4d.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
|
atmgrifter00 marked this conversation as resolved.
|
||
| "type": "minor", | ||
| "comment": "Add React wrapper for the TestHub slider", | ||
| "packageName": "@ni/ok-react", | ||
| "email": "198982749+Copilot@users.noreply.github.com", | ||
| "dependentChangeType": "patch" | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| import './slider'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| import { attr } from '@ni/fast-element'; | ||
| import { | ||
| DesignSystem, | ||
| Slider as FoundationSlider, | ||
| type SliderOptions | ||
| } from '@ni/fast-foundation'; | ||
| import { styles } from './styles'; | ||
| import { template } from './template'; | ||
|
|
||
| declare global { | ||
| interface HTMLElementTagNameMap { | ||
| 'ok-th-slider': Slider; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * A Nimble-styled slider control. | ||
| */ | ||
| export class Slider extends FoundationSlider { | ||
|
atmgrifter00 marked this conversation as resolved.
Outdated
|
||
| /** | ||
| * Whether the current value is displayed next to the thumb. | ||
| */ | ||
| @attr({ attribute: 'value-visible', mode: 'boolean' }) | ||
| public valueVisible = false; | ||
|
|
||
| /** @internal */ | ||
| public valueLabel?: HTMLSpanElement; | ||
|
|
||
| /** @internal */ | ||
| public override connectedCallback(): void { | ||
| super.connectedCallback(); | ||
| this.updateValueLabel(); | ||
| } | ||
|
|
||
| /** @internal */ | ||
| public override valueChanged(previous: string, next: string): void { | ||
| super.valueChanged(previous, next); | ||
| this.updateValueLabel(); | ||
| } | ||
|
|
||
| private updateValueLabel(): void { | ||
| if (this.valueLabel) { | ||
| this.valueLabel.textContent = this.value; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| const okThSlider = Slider.compose<SliderOptions>({ | ||
| baseName: 'th-slider', | ||
| baseClass: FoundationSlider, | ||
| template, | ||
| styles | ||
| }); | ||
|
|
||
| DesignSystem.getOrCreate().withPrefix('ok').register(okThSlider()); | ||
| export const sliderTag = 'ok-th-slider'; | ||
|
atmgrifter00 marked this conversation as resolved.
Outdated
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty much there. Question around accessing internal apis and gave some style feedback since was in the area but generally nimble owners won't be doing reviews of ok component content and focus on repo layout / infra.
Other repo layout considerations:
thcomponents, following ok ts / ok fv patterns:nimble/packages/storybook/src/docs/component-status.stories.ts
Line 34 in 76640ba
nimble/packages/react-workspace/react-client-app/src/components/App.tsx
Line 113 in 76640ba