feat(Flag): add Flag component (#DS-1405)#417
Conversation
|
Visit the preview URL for this PR (updated for commit 08df406): https://react-koobiq-next--prs-417-lhufgriw.web.app (expires Sun, 19 Jul 2026 14:59:51 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: fc29847d4a9e5cb1adf458c76a9b681c76e2eeff |
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Flag component to the @koobiq/react-components library as a lightweight presentational wrapper for consumer-provided flag graphics, along with Storybook documentation/examples and tests. It also adds country-flag-icons as a dev dependency to support the Flag docs and stories.
Changes:
- Added new
Flagcomponent (TSX + types) and exported it from the components barrel. - Added styling for shape/shadow/empty states via CSS Modules.
- Added Vitest tests plus Storybook stories and MDX documentation for the new component.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Locks the added country-flag-icons dependency and related metadata updates. |
| package.json | Adds country-flag-icons to devDependencies for docs/stories usage. |
| packages/components/src/components/index.ts | Re-exports Flag from the components barrel. |
| packages/components/src/components/Flag/index.ts | Adds the component’s local barrel exports. |
| packages/components/src/components/Flag/types.ts | Defines Flag prop types and prop value unions. |
| packages/components/src/components/Flag/Flag.tsx | Implements the polymorphic Flag component and its accessibility behavior. |
| packages/components/src/components/Flag/Flag.module.css | Provides base layout + shape/shadow/empty styling for the component. |
| packages/components/src/components/Flag/Flag.test.tsx | Adds unit tests for rendering, polymorphism, data-attrs, and a11y behavior. |
| packages/components/src/components/Flag/Flag.stories.tsx | Adds Storybook stories demonstrating usage patterns and guidance. |
| packages/components/src/components/Flag/Flag.stories.module.css | Adds stylized story-only visuals (folds overlay). |
| packages/components/src/components/Flag/Flag.mdx | Adds MDX documentation page for the new component. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.