feat: add Storybook stories for pure components#7100
feat: add Storybook stories for pure components#7100talissoncosta wants to merge 3 commits intochore/design-system-tokensfrom
Conversation
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, reopen this pull request to trigger a review.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Docker builds report
|
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-16)Details
Playwright Test Results (oss - depot-ubuntu-latest-arm-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-16)Details
Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)Details
|
Infrastructure to unblock components in Storybook: - Webpack aliases: stub common/code-help and common/data/base/_data.js (CommonJS files that break ESM bundler), mock dompurify - Register globals in preview.js: Tooltip, Row, FormGroup - Extract tagColors to common/constants/tag-colours.ts (breaks Constants → store chain for ColourSelect consumers) - Add unit tests for convertToPConfidence and fromParam (11 tests) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix components to remove unnecessary dependencies that blocked Storybook rendering: - Checkbox: Utils.GUID() → Math.random() - StatItem: Utils.numberWithCommas() → toLocaleString(), IonIcon → Icon - Panel, PageTitle: add explicit Row import (was window global) - LabelWithTooltip: add explicit Tooltip import (was window global) - InfoMessage, AccordionCard, IdentifierString: IonIcon → Icon - WarningMessage: remove dead enabledButton prop and Constants import - Confidence: inline convertToPConfidence (remove Utils import) - Tabs: inline fromParam using URLSearchParams (remove Utils import) - ToggleChip: add Row import, inline Utils.colour() with Color lib - ColourSelect consumers (6 files): use extracted tagColors - Extract Loader from project-components.js to standalone Loader.tsx Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Stories organised into sidebar categories:
- Forms: Button, ButtonDropdown, Checkbox, CheckboxGroup, GhostInput,
Radio, Switch
- Feedback: Banner, EmptyState, InfoMessage, Loader, WarningMessage
- Navigation: Breadcrumb, NavSubLink, SidebarLink, Tabs
- Layout: AccordionCard, Card, FormGroup, PageTitle, Panel, Row
- Data Display: BooleanDotIndicator, ClearFilters, Confidence,
DropdownMenu, IdentifierString, LabelWithTooltip,
Logo, SettingTitle, StatItem, ToggleChip, Tooltip,
VCSProviderTag
- Modals: Modal (Alert, Header, CloseButton), ModalDefault
- Patterns: SettingRow, Skeleton
- Icons: Icons catalogue
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b5c3ac9 to
b347360
Compare
docs/if required so people know about the feature.Changes
Contributes to #6882
Add Storybook stories for 39 components organised into 8 sidebar categories. Fix components to remove unnecessary dependencies that blocked Storybook rendering.
Stories (39 components)
Component fixes
Utils.GUID()→Math.random()Utils.numberWithCommas()→toLocaleString(), IonIcon → IconRowimport (was window global)Tooltipimport (was window global)@ionic/reactdep)enabledButtonprop andConstantsimportconvertToPConfidence(4 lines, removes Utils)fromParamusingURLSearchParams(removes Utils)Rowimport, inlineUtils.colour()with Color libcommon/constants/tag-colours.tsproject-components.jstoLoader.tsx,currentColorinstead of#6633ffStorybook infrastructure
code-help.js,_data.js,dompurify.js— stub CommonJS modulespreview.jsconvertToPConfidence(5 tests),fromParam(6 tests)Coverage
How did you test this code?
npm run storybook— all stories render in light and dark modenpm run test:unit -- --testPathPatterns="convertToPConfidence|fromParam"— 11 tests passnpx eslint --fixpasses on all modified filesSmoke test before merge
Components were changed to remove dependencies. Verify in the app:
Storybook verification
npm run storybookand click through all 8 categories