-
-
Notifications
You must be signed in to change notification settings - Fork 53
Toggle Primitive, Toggle, ToggleGroup Refactor #576
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
02e9dd0
add: components to publish
kotAPI 9c2bf1e
fix: linting
kotAPI c954fa9
Delete TogglePrimitiveContext, update TogglePrimitiveRoot, and stories
kotAPI 5932ea3
Refactor Toggle component for better default handling
kotAPI 8ad0f27
Add support for disabled state in TogglePrimitive
kotAPI 72cf438
Refactor Toggle related components and styles
kotAPI ec81d70
Add keyboard navigation to toggle items in ToggleGroup
kotAPI 844fadb
Refactor batch item navigation with loop option
kotAPI f2b9520
Update ToggleGroupRoot to use loop flag for batch navigation
kotAPI b8a632f
Add aria-disabled attribute to TogglePrimitive button
kotAPI 2694fba
Refactor TogglePrimitive component for controlled state
kotAPI cae77cd
Add keyboard interaction handling to TogglePrimitive
kotAPI dc91df1
Add keyboard event handling in TogglePrimitive
kotAPI 1d0d724
Apply suggestions from code review
kotAPI cf35885
Update src/core/batches.ts
kotAPI f6680e6
Merge branch 'main' into pranay/toggle-primitive-refactor
kotAPI 972e3e7
Update TogglePrimitive test for key events handling
kotAPI 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
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 |
|---|---|---|
| @@ -1,3 +1,9 @@ | ||
| import { createContext } from 'react'; | ||
|
|
||
| export const ToggleContext = createContext({}); | ||
| export type ToggleContextType = { | ||
| type: 'single' | 'multiple'; | ||
| activeToggles: any[]; | ||
| setActiveToggles: (toggles: any[]) => void; | ||
| }; | ||
kotAPI marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| export const ToggleContext = createContext<ToggleContextType>({}); | ||
kotAPI marked this conversation as resolved.
Show resolved
Hide resolved
|
||
39 changes: 30 additions & 9 deletions
39
src/components/ui/ToggleGroup/fragments/ToggleGroupRoot.tsx
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
8 changes: 0 additions & 8 deletions
8
src/core/primitives/Toggle/contexts/TogglePrimitiveContext.tsx
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
src/core/primitives/Toggle/fragments/TogglePrimitiveRoot.tsx
This file was deleted.
Oops, something went wrong.
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.