Skip to content

feat(card): align component with fusion design system - FE-7266#8073

Draft
DipperTheDan wants to merge 2 commits into
masterfrom
FE-7266_card-ds-audit
Draft

feat(card): align component with fusion design system - FE-7266#8073
DipperTheDan wants to merge 2 commits into
masterfrom
FE-7266_card-ds-audit

Conversation

@DipperTheDan

Copy link
Copy Markdown
Contributor

Proposed behaviour

Align component with Fusion Design System.

Current behaviour

Component is out of date with the latest Fusion Design System.

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in provided StackBlitz sandbox/Storybook
  • Add new Playwright test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

N/A

Testing instructions

Component should match designs and specs provided in the ticket.

}

const paddingSizes = {
none: "var(--spacing000)",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have used the old DS tokens here to conform with the other spacing values in the declaration. This component is being deprecated too.

@DipperTheDan DipperTheDan force-pushed the FE-7266_card-ds-audit branch from a315f35 to 6458f6b Compare July 10, 2026 13:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Warning

  • Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.

Pull request overview

Aligns the Card component implementation, styles, stories, and tests with the Fusion Design System by moving to new spacing/radius/depth tokens, introducing new API surface (cardType, header, draggableAccessory), and deprecating legacy subcomponents/props.

Changes:

  • Updated Card styling to use Fusion tokens (new spacing options, new roundness tokens/aliases, new depth tokens, updated content border-radius behavior with header/footer).
  • Added/updated APIs and examples (cardType, header, draggableAccessory, draggable layout row), and deprecated legacy pieces (CardRow, CardColumn, CardFooter variant, custom boxShadow props).
  • Refreshed Storybook stories/MDX docs and unit/Playwright tests to match the new design + behavior.

Reviewed changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/components/card/components.test-pw.tsx Updated Playwright component examples to new Card composition patterns (Box + Typography, new Button import).
src/components/card/card.test.tsx Updated and expanded unit tests for new roundness tokens, draggable accessory, cardType shadows, extra-small spacing behavior.
src/components/card/card.style.ts Migrated Card styling to Fusion tokens; added header-aware border radius logic and a draggable row style.
src/components/card/card.stories.tsx Reworked stories to match new layout and tokens; added new stories (without footer, spacing variants, draggable).
src/components/card/card.mdx Updated docs to reference new/added stories and updated roundness/draggable documentation.
src/components/card/card.config.ts Expanded allowed spacing values to include none and extra-small.
src/components/card/card.component.tsx Added cardType, header, draggableAccessory; updated defaults and draggable rendering structure.
src/components/card/card-test.stories.tsx Updated test stories and added focused-state stories for Chromatic coverage.
src/components/card/card-row/card-row.test.tsx Updated strict-context error message expectation.
src/components/card/card-row/card-row.style.ts Added support for none and extra-small spacing.
src/components/card/card-row/card-row.component.tsx Marked CardRow as deprecated.
src/components/card/card-footer/card-footer.test.tsx Updated strict-context error message expectation and roundness expectations.
src/components/card/card-footer/card-footer.style.ts Updated margin sizing and border-radius tokens to Fusion equivalents.
src/components/card/card-footer/card-footer.component.tsx Marked variant prop as deprecated.
src/components/card/card-column/card-column.component.tsx Marked CardColumn as deprecated.
src/components/card/internal/card.context.ts Updated roundness type/default and strict-context error message.
skills/carbon-react/index.md Content excluded by policy; not reviewed.
skills/carbon-react/components/card.md Content excluded by policy; not reviewed.
skills/carbon-react/components/card-row.md Content excluded by policy; not reviewed.
skills/carbon-react/components/card-footer.md Content excluded by policy; not reviewed.
skills/carbon-react/components/card-column.md Content excluded by policy; not reviewed.
Files excluded by content exclusion policy (5)
  • skills/carbon-react/components/card-column.md
  • skills/carbon-react/components/card-footer.md
  • skills/carbon-react/components/card-row.md
  • skills/carbon-react/components/card.md
  • skills/carbon-react/index.md

Comment thread src/components/card/card.style.ts
Comment thread src/components/card/card.style.ts
Comment thread src/components/card/card.style.ts
Comment thread src/components/card/card.style.ts
Comment thread src/components/card/components.test-pw.tsx Outdated
Comment thread src/components/card/__internal__/card.context.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants