Repository navigation
Conversation
Co-locate Rotation, ExpandInCollapseOut, and FadeInSlideOut stories into packages/gamut/src/Animation (behavior + a11y via play), and remove the old styleguide Animations folder. Also drop the now-empty Atoms About/AboutToC. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-locate Button atoms (ButtonExamples, CTAButton, FillButton, IconButton, StrokeButton, TextButton) as stories under Actions/Buttons, folding the old IconButton/TextButton node tests into play assertions. Add a variant argType + full variant/size matrix (with a labeled column) to the examples grid, and a storySort pinning Button Examples first in the folder. Remove the old styleguide Buttons folder and the Button __tests__. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-locate Badge, ProgressBar, RadialProgress, Shimmer, Spinner, and FeatureShimmer as stories under the Status category, with behavior/a11y assertions in play functions. Keep node tests only where a browser play can't reach: ProgressBar's useLogicalProperties width matrix and FeatureShimmer's reduced-motion hook mock (both co-located). Remove the old styleguide folders (Badge, ProgressBar, RadialProgress, FeatureShimmer, Loaders) and the Button-style __tests__ dirs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-locate the story under Navigation and move the href check into a play function. Remove the Jest test and the old styleguide story. Co-Authored-By: Grok 4.7 <noreply@x.ai> Co-authored-by: Cursor <cursoragent@cursor.com>
Co-locate both under Utilities, fold their Jest coverage into play functions, and remove the old styleguide stories and node tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-locate both under Containers. Fold the Card render tests and the Drawer expand/collapse tests into play functions, keep only the node-only useCardElevation logic, and add variant/shadow/borderRadius argTypes to Card. Remove the old styleguide stories. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-locate both under Actions and fold their Jest coverage into play functions (roles, callbacks, disabled states, aria-label), then remove the node tests and old styleguide stories. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-locate the story under Overlays and move the node tests out of __tests__ (PopoverContainer.test.tsx, hooks.test.tsx, testUtils.ts), excluding the test helper from the lib build. Disable FocusTrap autofocus in the catalog stories so the docs page no longer hijacks scroll, and remove the old styleguide story. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move the useCardElevation test to Card/Card.test.tsx to match the co-located convention used by the other migrated components. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Docgen read the root tsconfig, where strict function types make `variance.compose(...)` fail to type-check, so composed system props silently dropped out of most props tables. Point docgen at the gamut tsconfig instead. Add an argTypes enhancer that groups system props by prop family, summarizes their types as theme tokens, and gives them select or text controls. A custom docs page puts them in a "System props" tab next to the component's own props, and stops repeating the primary story under Stories. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@skillsoft/eslint-plugin-gamut
@skillsoft/gamut
@skillsoft/gamut-agent-tools
@skillsoft/gamut-icons
@skillsoft/gamut-illustrations
@skillsoft/gamut-patterns
@skillsoft/gamut-styles
@skillsoft/gamut-tests
@skillsoft/variance
commit: |
This branch has not been deployed
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.
Overview
System props (
m,p,bg,display,gap, …) were missing from the Storybook props tables of most components that accept them. This PR brings them back and shows them in a way that doesn't bury a component's own props.Why they were missing
Docgen (
react-docgen-typescript) was reading the root tsconfig, which hasstricton and so includesstrictFunctionTypes. Under that setting,variance.compose(...)fails to type-check. Docgen doesn't report the error. It drops the composed props, so a component built on composed system props showed only its own props.packages/gamut/tsconfig.jsonalready setsstrictFunctionTypes: false, somain.tsnow points docgen at that file.Making them readable
Once the props came back, a component like
Texthad dozens of system props in the same table as its own handful. Docgen also showed their types as rawScale<...>and csstype unions, which don't help anyone choose a value. Two changes deal with that.argTypes enhancer (
packages/.storybook/systemProps.ts, registered inpreview.tsasargTypesEnhancers):system.*group it comes from: Spacing, Flex & Grid, Layout, Positioning, Typography, Color, Background, Border, Shadow, List. Some groups overlap (spacecontainsmarginandpadding, and flex and grid item props are also inlayout), so the first group in the list wins.colors, the summary readstheme.colorsand the full list goes in the type detail. Props without a theme scale showCSS value.mxshowsmargin-left, margin-right (logical: margin-inline-start, margin-inline-end).argTypes(control, options, description, category) wins over the enhancer.Scale<...>, or csstype's(string & {})union where two groups both define the prop). A component that declares its own prop with a system prop name, like a numericzIndex, keeps its own entry.Docs page (
packages/.storybook/components/Elements/DocsPage.tsx, set asparameters.docs.page):Tabs. A component without system props gets the usual single table with no tabs.includePrimary={false}, so the primary story isn't repeated under the Stories heading.Known limitations
coreTheme. Other themes may define more or fewer tokens for the same scale, so the props table and select options always reflect Core.preview.ts, and that moves any prop with a story arg to the front. A story that sets a system prop arg (widthorheighton Shimmer, for example) shows that prop's section first. I couldn't find a clean way to fix this from an enhancer, and the comment onenhanceSystemPropssays so.DocsPagecopies Storybook's default page, so it won't pick up changes Storybook makes to the default in later versions.PR Checklist
Testing Instructions
yarn start:storybook.Typography/Text. The props table has "Props" and "System props" tabs. "Props" lists only Text's own props (as,variant,truncate, …).fontSizelists its tokens inline in the Type column and has a select control.colorshowstheme.colorswith the full token list in the detail.widthshowsCSS valueand has a text control.mx→margin-left, margin-right (logical: …).mt,bg,fontSize) and check that the primary story updates.🤖 Generated with Claude Code