Skip to content

feat: Add Custom Cards stories section to Storybook#774

Open
sankalpjoshimp-afk wants to merge 3 commits into
mainfrom
feat/add-custom-card-stories
Open

feat: Add Custom Cards stories section to Storybook#774
sankalpjoshimp-afk wants to merge 3 commits into
mainfrom
feat/add-custom-card-stories

Conversation

@sankalpjoshimp-afk
Copy link
Copy Markdown
Contributor

Adds a new 'Custom Cards' sub-section under Components/Data Display/Card with Basic and WithButtons stories matching the Figma design. Features a Figma-faithful layout with icon container, eyebrow, title, secondary text, border, shadow, and interactive Storybook controls for all copy and icon.

Instructions

No need to keep instructions in the final PR description

  1. PR target branch should be against main
  2. PR title prefix should state semantic value for the change, usually feat:, fix: or chore:. Source.
  3. PR branch prefix should state the same as the above with a /, usually feat/, fix/ or chore/. Source.

Summary

  • {provide a thorough description of the changes}

Testing Plan

  • Was this tested locally? If not, explain why.
  • {explain how this has been tested, and what, if any, additional testing should be done}

Adds a new 'Custom Cards' sub-section under Components/Data Display/Card
with Basic and WithButtons stories matching the Figma design. Features a
Figma-faithful layout with icon container, eyebrow, title, secondary text,
border, shadow, and interactive Storybook controls for all copy and icon.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cursor
Copy link
Copy Markdown

cursor Bot commented Mar 31, 2026

PR Summary

Low Risk
Low risk: changes are limited to Storybook examples and contributor documentation, with no runtime component or data-handling logic impacted.

Overview
Adds a new Storybook "Custom Cards" subsection under Components/Data Display/Card with Basic and WithButtons stories, including configurable controls for icon choice, copy, and optional action buttons.

Updates CLAUDE.md to introduce a /simplify step and expand styling guidelines (mapping inline flex styles to Flex props, using Typography props over inline styles, and avoiding paste artifacts in Storybook args).

Reviewed by Cursor Bugbot for commit 8cbd48f. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 31, 2026

PR Preview Action v1.6.3

🚀 View preview at
https://mParticle.github.io/aquarium/pr-preview/pr-774/

Built to branch gh-pages at 2026-05-06 20:23 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@sankalpjoshimp-afk sankalpjoshimp-afk self-assigned this Mar 31, 2026
Comment thread src/components/data-display/Card/CardCustomCards.stories.tsx Outdated
Comment thread src/components/data-display/Card/CardCustomCards.stories.tsx Outdated
Replace raw <div style={{display:'flex',...}}> with <Flex>, move
Typography inline-style overrides to props (size/color/strong), and
fix 'Primary\n' arg artifact. Add a repo skill that codifies the same
checklist so designer-contributed stories get cleaned up automatically
next time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
export const Basic: Story = {
render: args => (
<ExampleStory title="A card with an icon, eyebrow label, title, and supporting secondary text.">
<CustomCard {...args} showButtons={false} />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded showButtons overrides Storybook controls in both stories

Medium Severity

Both Basic and WithButtons stories hardcode showButtons after the {...args} spread, so the explicit JSX prop always wins over whatever Storybook passes through args. The showButtons boolean control (registered in argTypes) renders in the Storybook panel but toggling it has no effect in either story. For WithButtons, the override is also redundant since showButtons: true is already set in args. The fix is to remove the hardcoded showButtons prop from both render functions and rely solely on args to drive the value.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 12ac31c. Configure here.

Move the Flex prop-mapping table, Typography prop-mapping table, and
story-args hygiene rules into CLAUDE.md's Styling Guidelines so they're
always loaded for /implement-ticket. Add a /simplify step to the
designer workflow as the polish checkpoint that enforces them. Remove
the designer-story-cleanup skill — it duplicated the existing /simplify
skill plus rules that now live in CLAUDE.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

There are 3 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8cbd48f. Configure here.

alignSelf: 'flex-start',
}}>
<Icon name={IconComponent} color="info" />
</Flex>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Icon container uses Flex instead of Center component

Low Severity

The icon container uses <Flex align="center"> to center the icon, but the PR reviewer (@nastyastavitskaya) explicitly requested replacing it with the <Center> component: "tell claude to replace it with Center component, I think it might be better (and that's what I typically use for this case)." The project's CLAUDE.md styling guidelines also recommend <Center> over flex-based centering. A <Center> component already exists in src/components/layout/Center/Center.tsx and is exported from the component index.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8cbd48f. Configure here.

gap={Margin}
style={{
background: ColorBgBase,
padding: MarginXl,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Margin tokens used for padding CSS properties

Low Severity

The padding CSS property uses MarginXl and Margin tokens instead of the semantically correct PaddingXl and Padding tokens. Dedicated padding tokens exist in src/styles/style.ts (Padding = '16px', PaddingXl = '32px') with identical values. While the rendered output is the same today, using the wrong semantic category makes the code misleading and fragile if token values ever diverge. No other component in the codebase uses margin tokens for padding.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 8cbd48f. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants