-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Toggle Primitive, Toggle, ToggleGroup Refactor (#576)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a3b6ce6
commit f9a21a0
Showing
14 changed files
with
368 additions
and
100 deletions.
There are no files selected for viewing
This file contains 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 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 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 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; | ||
}; | ||
|
||
export const ToggleContext = createContext<ToggleContextType>({}); |
39 changes: 30 additions & 9 deletions
39
src/components/ui/ToggleGroup/fragments/ToggleGroupRoot.tsx
This file contains 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 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 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.