Closed kotAPI closed 1 week ago
[!WARNING]
Review failed
The pull request is closed.
The introduced files collectively implement a ToggleGroup
component in React, designed to handle both single and multiple toggle configurations. This feature includes managing active toggles via context, creating a toggle group root, and individual toggle items. The added stories help demonstrate the component's usage, including visual examples for both single and multiple toggles.
Files | Change Summaries |
---|---|
.../ToggleGroup.stories.js |
Introduced stories for ToggleGroup component, including templates for multiple and single toggle configurations. |
.../ToggleGroup.tsx |
Created the main ToggleGroup component with Root and Item properties referencing subcomponents. |
.../contexts/toggleContext.tsx |
Added a context for managing toggle functionalities. |
.../shards/ToggleGroupRoot.tsx |
Added ToggleGroupRoot component for managing groups of toggles with state management for active toggles. |
.../shards/ToggleItem.tsx |
Introduced ToggleItem component to handle individual toggle logic based on context-defined type ('single' or 'multiple'). |
sequenceDiagram
participant User
participant ToggleGroup
participant ToggleGroupRoot
participant ToggleItem
participant ToggleContext
User ->> ToggleGroup: Render Multiple Configuration
ToggleGroup ->> ToggleGroupRoot: Create Root Component
ToggleGroupRoot ->> ToggleItem: Create Items with Context
ToggleItem ->> ToggleContext: Update Active States
User ->> ToggleGroup: Toggle an Item
ToggleGroup ->> ToggleItem: Handle Toggle Action
ToggleItem ->> ToggleContext: Update Active States
In the garden of code, toggles dance,
With multiple ways to give them a chance.
Single or many, you choose the way,
To turn them on and off, and make them sway.
With stories to guide, and context to share,
Your toggles bloom with a rabbit's care. 🐇💻
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.64%. Comparing base (
1f00675
) to head (92df1e7
). Report is 2 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Summary by CodeRabbit
ToggleGroup
component for grouped toggle functionality.MoveIcon
component for enhanced visual representation.ToggleGroupRoot
andToggleItem
components to manage active toggles and handle toggling logic.