fix(skeleton): complete atom review#167
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Reworks the Skeleton atom to match the repository's established 6-file atom pattern: typed CVA variants in types.ts, a useSkeleton hook for logic, a presentational Skeleton component, named exports, focused unit tests, and rewritten Storybook stories that showcase token-backed sizes/radii and parent-owned loading semantics.
Changes:
- Replaces free-form
width/heightprops with token-backedsizeandroundedCVA variants, and adds anariaHiddenprop (decorative by default) consistent with the Spacer atom. - Splits logic into
useSkeletonreturning a typedUseSkeletonReturn, and convertsSkeletonto a named export consumed via the barrel. - Adds
Skeleton.test.tsxcovering hook defaults/overrides and component a11y/className forwarding, plus new Storybook stories (Default, Sizes, Rounded, Composition) using design-system tokens.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/atoms/skeleton/types.ts | Introduces skeletonVariants CVA with size/rounded variants and a new SkeletonProps extending native div attributes minus children/className/aria-hidden. |
| src/components/atoms/skeleton/useSkeleton.ts | Hook now composes CVA classes with cn, defaults size/rounded/ariaHidden, and returns a typed shape. |
| src/components/atoms/skeleton/Skeleton.tsx | Becomes a named export, renders a single div with merged class and aria-hidden. |
| src/components/atoms/skeleton/index.ts | Switches barrel to named Skeleton export. |
| src/components/atoms/skeleton/Skeleton.test.tsx | New tests for hook defaults, className merging, native prop forwarding, and component a11y behavior. |
| src/components/atoms/skeleton/Skeleton.stories.tsx | Replaces fixed-pixel stories with token-driven Default/Sizes/Rounded/Composition stories and parent-owned role="status" example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #134
Type of change
Component checklist (skip if not applicable)
types.ts,use*.ts,Component.tsx,index.ts,*.stories.tsx)types.ts, not inlinetheme.cssanytypes — TypeScript strictHow to test
pnpm exec biome check src/components/atoms/skeleton/Skeleton.stories.tsx src/components/atoms/skeleton/Skeleton.tsx src/components/atoms/skeleton/index.ts src/components/atoms/skeleton/types.ts src/components/atoms/skeleton/useSkeleton.ts src/components/atoms/skeleton/Skeleton.test.tsxpnpm vitest run src/components/atoms/skeleton/Skeleton.test.tsxpnpm exec tsc --noEmitpnpm run storybookand reviewAtoms/Skeletonstories.Screenshots / recordings (if applicable)
Not attached.
Notes for reviewer
aria-hidden; the composition story demonstrates parent-owned loading semantics withrole="status"andaria-busy.