feat(components): refresh core controls#16
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refreshes core control components with consistent code formatting, improved type safety, and comprehensive test coverage. The changes modernize the codebase by adopting single quotes, explicit type imports, and removing unused React imports while maintaining backward compatibility.
- Standardized code style across all core control components (toggle, tag, spinner, checkbox, button, badge, avatar, alert, etc.)
- Added unit tests for previously untested components (toggle, tag, spinner, checkbox, button-group, icon-button, badge, avatar, alert, spinner-overlay)
- Enhanced component APIs with optional props (SpinnerOverlay now accepts size, opacity, and className)
- Improved theming by replacing hardcoded colors with CSS variables in Spinner component
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/components/toggle/* | Code formatting, type imports, and added comprehensive test coverage |
| src/components/tag/* | Code formatting, type imports, and added test coverage |
| src/components/spinner/* | Replaced hardcoded SVG colors with CSS variables and added tests |
| src/components/spinner-overlay/* | Added configurable props (size, opacity, className) and test coverage |
| src/components/icon-button/* | Code formatting, type imports, and added test coverage |
| src/components/checkbox/* | Code formatting, type imports, and added test coverage |
| src/components/button/* | Code formatting, type imports, helper function extraction, and existing tests updated |
| src/components/button-group/* | Code formatting, type imports, and added test coverage |
| src/components/badge/* | Code formatting, type imports, and existing tests updated |
| src/components/avatar/* | Code formatting, removed unused import, and existing tests updated |
| src/components/alert/* | Code formatting, type imports, and existing tests updated |
| src/components/*/index.ts | Converted all index files from double to single quotes |
| src/components/*/stories.tsx | Migrated from @storybook/react to @storybook/react-vite, refactored state management |
| src/components/index.ts | Converted exports from double to single quotes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| type Story = StoryObj<typeof ButtonGroup> | ||
|
|
||
| export const Default: Story = { | ||
| render: () => ( | ||
| <ButtonGroup> | ||
| <ButtonGroup.Button type="button">Normal</ButtonGroup.Button> | ||
| <ButtonGroup.Button type="button" disabled> | ||
| Disabled | ||
| </ButtonGroup.Button> | ||
| <ButtonGroup.Button type="button" isActive> | ||
| Active | ||
| </ButtonGroup.Button> | ||
| <ButtonGroup.Button type="button" isActive disabled> | ||
| Active & Disabled | ||
| </ButtonGroup.Button> | ||
| <ButtonGroup.Button type="button">Button 1</ButtonGroup.Button> | ||
| </ButtonGroup> | ||
| ), | ||
| }; | ||
| render: ({ | ||
| normalLabel, | ||
| disabledLabel, | ||
| activeLabel, | ||
| activeDisabledLabel, | ||
| extraLabel, |
There was a problem hiding this comment.
The Story type on line 29 is typed as StoryObj, but the args defined in meta (lines 7-13) and used in the render function (lines 32-37) don't match the ButtonGroup component props. These are custom args only used by the story's render function. Consider creating a custom type for the story args or using StoryObj without a generic to avoid TypeScript type mismatches.
Overview
feat(components): refresh core controls
Changes