Skip to content

DSE-324 :: Card update FE#177

Open
diogo-filipe-costa wants to merge 13 commits intomainfrom
codex/dse-324-card-update
Open

DSE-324 :: Card update FE#177
diogo-filipe-costa wants to merge 13 commits intomainfrom
codex/dse-324-card-update

Conversation

@diogo-filipe-costa
Copy link
Contributor

@diogo-filipe-costa diogo-filipe-costa commented Mar 16, 2026

Description

This PR delivers DSE-324 Card family alignment with Figma across the toolkit, React component library, site examples, Storybook, and automated tests.

Release scope in this PR:

  • @ourfuturehealth/toolkit -> 4.5.0 (tag: toolkit-v4.5.0)
  • @ourfuturehealth/react-components -> 0.4.0 (tag: react-v0.4.0)
  • site/docs changes are included in-repo (no independently versioned release tag)

Ticket: DSE-324

Breaking Changes

  • None.
  • Deprecated toolkit compatibility paths remain available for warning-callout, do-dont-list, and legacy Card inputs.
  • React continues to expose the new Card family API only.

Key Changes

1) Toolkit Card family realignment

  • Updated the base card component to match the current Figma structure for:
    • basic cards
    • dismissible cards
    • success cards
    • clickable cards
    • clickable action cards
    • clickable numeric cards
  • Added first-class toolkit components for:
    • card-callout
    • card-do-dont
  • Preserved legacy toolkit compatibility wrappers for:
    • warning-callout
    • do-dont-list
    • legacy Card inputs such as clickable, feature, type, and HTML
  • Updated toolkit docs and examples so new work points to the current Card family APIs while legacy paths are clearly marked as deprecated

2) React Card family parity

  • Added React support for the Card family with:
    • Card
    • CardCallout
    • CardDoDont
  • Matched the toolkit DOM structure and class contract so React and toolkit render the same patterns
  • Added Storybook coverage for the full base Card set, including:
    • dismissible cards
    • dismissible cards with an image
    • success cards
    • clickable cards
    • clickable action cards
    • clickable numeric cards
    • keyboard navigation
  • Added unit and accessibility coverage for the Card family components
  • Bundled the toolkit icon sprite for React and Storybook consumers so Card icons render without a separately hosted sprite file

3) QA-driven design and interaction polish

  • Fixed Card tag stretching inside clickable action cards
  • Fixed dismissible Card heading overlap with the close button
  • Ensured dismissible cards with images keep the dismiss button aligned to the image area, matching Figma
  • Corrected Card / Do & Don’t label overlap so the navy label now sits into the spacer correctly
  • Tightened Card / Callout docs presentation spacing and Card / Do & Don’t example composition to better match the Figma examples
  • Removed misleading Storybook controls from showcase and behaviour-demo stories across the Card family

4) Documentation and release follow-up

  • Reworked Card-family docs so prop behaviour is clearer across Storybook docs, site docs, macro options, and toolkit READMEs
  • Clarified advanced props such as headingLevel, className, attributes, and ref
  • Added the new dismissible-with-image example route to the docs site and examples index
  • Applied the same Storybook/docs clarity pass to Button and ErrorSummary so the documentation standard is consistent across recent component work
  • Corrected package versions, changelog, upgrading guidance, install examples, and release-versioning docs so this branch is framed as the next release after 4.4.0 / 0.3.0
  • Updated the component workflow prompts so future component branches are expected to do the docs and Storybook UX pass during implementation, not only during late QA

Validation

  • npm test
  • pnpm lint
  • pnpm --filter=@ourfuturehealth/toolkit run build
  • pnpm --filter=@ourfuturehealth/react-components run build
  • pnpm --filter=site run build:eleventy
  • pnpm --filter=@ourfuturehealth/react-components run build:storybook
  • pnpm build
    • fails locally if the site dev watcher is running at the same time, because the site clean step races with writes into packages/site/dist
  • Manual QA on local docs/examples and Storybook for:
    • base Card variants
    • dismissible cards with and without images
    • Card / Callout variants
    • Card / Do & Don’t variants
    • Storybook controls behaviour and prop-doc clarity

Reviewer Focus

  • Toolkit / React parity for Card, Card / Callout, and Card / Do & Don’t
  • Dismissible Card behaviour, especially heading wrapping and image + dismiss positioning
  • Card / Do & Don’t label overlap and Figma alignment
  • Deprecated toolkit compatibility paths vs new recommended APIs
  • Release metadata consistency for toolkit 4.5.0 / react-components 0.4.0
  • Storybook/docs clarity and controls policy for Card-family stories

@netlify
Copy link

netlify bot commented Mar 16, 2026

Deploy Preview for ofh-design-system-docs ready!

Name Link
🔨 Latest commit b27c2dc
🔍 Latest deploy log https://app.netlify.com/projects/ofh-design-system-docs/deploys/69b963b75dc6bc0009fb2f15
😎 Deploy Preview https://deploy-preview-177--ofh-design-system-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR realigns the “Card” family across the toolkit, docs site, and React component library by introducing new Card subcomponents (Callout + Do/Don’t), updating legacy components to render via compatibility wrappers, and expanding the base Card API/markup to match newer designs.

Changes:

  • Added new toolkit components: card-callout and card-do-dont, and wired them into the global toolkit SCSS build.
  • Deprecated warning-callout and do-dont-list by turning them into wrappers that render the new Card family equivalents, plus updated docs/routes/examples accordingly.
  • Expanded Card (toolkit + React) markup/API to support richer variants (dismiss button, metadata rows, tags, action links) and added corresponding tests/stories/docs.

Reviewed changes

Copilot reviewed 93 out of 95 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/toolkit/ofh.scss Imports new Card family component styles into the toolkit bundle.
packages/toolkit/core/tools/_mixins.scss Adds Card-family-specific panel/label mixins used by new components.
packages/toolkit/components/warning-callout/template.njk Re-implements warning callout rendering via cardCallout (warning variant).
packages/toolkit/components/warning-callout/macro.njk Updates warningCallout() macro to wrap cardCallout.
packages/toolkit/components/warning-callout/_warning-callout.scss Removes legacy styles in favor of card-callout-provided styling.
packages/toolkit/components/warning-callout/README.md Deprecation + migration guidance from warning-callout to card-callout.
packages/toolkit/components/error-summary/README.md Clarifies “text vs html” override behavior in docs.
packages/toolkit/components/do-dont-list/template.njk Re-implements do/don’t list rendering via cardDoDont.
packages/toolkit/components/do-dont-list/macro.njk Updates list() macro to wrap cardDoDont.
packages/toolkit/components/do-dont-list/_do-dont-list.scss Converts to a deprecated wrapper with minimal layout spacing.
packages/toolkit/components/do-dont-list/README.md Deprecation + migration guidance from do-dont-list to card-do-dont.
packages/toolkit/components/card/template.njk Updates Card markup/API (variants, dismiss button, metadata, tag, actionLink, icon-aside).
packages/toolkit/components/card/card.test.js Adds click-proxy behavior tests for clickable cards.
packages/toolkit/components/card/card.scss Updates Card styling to match new layout, metadata, aside, and dismiss button.
packages/toolkit/components/card/card.js Hardens click proxy logic (primary link selection + interactive element exclusions).
packages/toolkit/components/card/README.md Rewrites docs to reflect new Card family API and deprecations.
packages/toolkit/components/card-do-dont/template.njk New toolkit Card / Do & Don’t template.
packages/toolkit/components/card-do-dont/macro.njk New cardDoDont() macro entrypoint.
packages/toolkit/components/card-do-dont/_card-do-dont.scss New styling using the new Card-family mixins.
packages/toolkit/components/card-do-dont/README.md New docs for Card / Do & Don’t and its Nunjucks API.
packages/toolkit/components/card-callout/template.njk New toolkit Card / Callout template.
packages/toolkit/components/card-callout/macro.njk New cardCallout() macro entrypoint.
packages/toolkit/components/card-callout/_card-callout.scss New styling for callout variants + legacy alias support.
packages/toolkit/components/card-callout/README.md New docs for Card / Callout and its Nunjucks API.
packages/toolkit/components/button/README.md Fixes docs URL + clarifies argument descriptions.
packages/site/views/sitemap.xml Adds new design-system component URLs for card-callout and card-do-dont.
packages/site/views/site-map.njk Adds new component links and removes legacy warning-callout/do-and-dont-lists links.
packages/site/views/examples/components/card/clickable-numeric-card.njk Adds new Card example page (clickable numeric variant).
packages/site/views/examples/components/card/clickable-action-card.njk Adds new Card example page (clickable action variant).
packages/site/views/examples/components/card/basic-success-card.njk Adds new Card example page (basic success with icon).
packages/site/views/examples/components/card/basic-dismissible-with-image-card.njk Adds new Card example page (dismissible + image).
packages/site/views/examples/components/card/basic-dismissible-card.njk Adds new Card example page (dismissible).
packages/site/views/examples/components/card-do-dont/index.njk Adds new examples entry for Card / Do & Don’t.
packages/site/views/examples/components/card-callout/index.njk Adds new examples entry for Card / Callout.
packages/site/views/examples.njk Updates examples index to include new Card examples and new Card family pages.
packages/site/views/design-system/styles/icons/index.njk Updates docs link target from legacy do-and-dont-lists to card-do-dont.
packages/site/views/design-system/patterns/help-users-decide-when-and-where-to-get-care/index.njk Updates references from warning-callout to card-callout.
packages/site/views/design-system/components/warning-callout/index.njk Converts legacy page into migration guidance pointing to Card / Callout.
packages/site/views/design-system/components/inset-text/index.njk Updates link target from warning-callout to card-callout.
packages/site/views/design-system/components/error-summary/macro-options.json Refines macro option descriptions for text/html behavior and attributes.
packages/site/views/design-system/components/error-summary/index.njk Adds guidance on when to use *Html options + idPrefix.
packages/site/views/design-system/components/do-and-dont-lists/index.njk Converts legacy page into migration guidance pointing to Card / Do & Don’t.
packages/site/views/design-system/components/card/macro-options.json Expands Card macro options to cover new API + deprecated compatibility inputs.
packages/site/views/design-system/components/card/index.njk Updates Card docs page content + adds new examples sections.
packages/site/views/design-system/components/card/group-quarter/index.njk Migrates quarter-card-group example to new numeric/actionLink API.
packages/site/views/design-system/components/card/clickable/index.njk Migrates clickable example to variant: "clickable".
packages/site/views/design-system/components/card/clickable-numeric/index.njk Adds design-system snippet for clickable numeric card.
packages/site/views/design-system/components/card/clickable-card-with-icon/index.njk Migrates icon usage to new icon prop API.
packages/site/views/design-system/components/card/clickable-action/index.njk Adds design-system snippet for clickable action card.
packages/site/views/design-system/components/card/card-with-icon/index.njk Migrates legacy helper to new card + icon API.
packages/site/views/design-system/components/card/basic-success/index.njk Adds design-system snippet for basic success card.
packages/site/views/design-system/components/card/basic-dismissible/index.njk Adds design-system snippet for basic dismissible card.
packages/site/views/design-system/components/card/basic-dismissible-with-image/index.njk Adds design-system snippet for dismissible card with image.
packages/site/views/design-system/components/card-do-dont/macro-options.json Adds macro-options docs for Card / Do & Don’t.
packages/site/views/design-system/components/card-do-dont/index.njk Adds new design-system component page for Card / Do & Don’t.
packages/site/views/design-system/components/card-do-dont/default/index.njk Adds default example content for Card / Do & Don’t docs page.
packages/site/views/design-system/components/card-callout/macro-options.json Adds macro-options docs for Card / Callout.
packages/site/views/design-system/components/card-callout/index.njk Adds new design-system component page for Card / Callout.
packages/site/views/design-system/components/card-callout/default/index.njk Adds default examples for all Card / Callout variants.
packages/site/views/design-system/components/buttons/macro-options.json Updates button macro option descriptions for clarity/consistency.
packages/site/views/design-system/components/button/index.njk Adds additional usage guidance copy.
packages/site/views/content/formatting-and-punctuation.njk Updates link to new Card / Do & Don’t docs page.
packages/site/views/content/a-to-z-of-nhs-health-writing.njk Updates link to new Card / Do & Don’t docs page.
packages/site/views/_includes/_side-nav.njk Updates side-nav structure to include new Card family component pages.
packages/react-components/vitest.shims.d.ts Adds vitest-axe type reference.
packages/react-components/tsconfig.json Includes vitest shim file in TS compilation.
packages/react-components/src/types/css-modules.d.ts Adds *.svg?url module typing for sprite imports.
packages/react-components/src/test/setup.ts Enables vitest-axe expect extensions in test setup.
packages/react-components/src/internal/ofhUtils.ts Adds shared utilities/types for Card family components (heading tags, class joining).
packages/react-components/src/internal/OfhTag.tsx Adds internal Tag implementation used by Card.
packages/react-components/src/internal/OfhIcon.tsx Adds internal Icon implementation using bundled toolkit sprite.
packages/react-components/src/index.ts Exports new React Card family components.
packages/react-components/src/components/ErrorSummary/ErrorSummary.stories.tsx Improves docs/controls policy and clarifies advanced props/overrides.
packages/react-components/src/components/CardDoDont/index.ts New export barrel for CardDoDont.
packages/react-components/src/components/CardDoDont/CardDoDont.tsx New React Card / Do & Don’t component implementation.
packages/react-components/src/components/CardDoDont/CardDoDont.test.tsx Adds unit + a11y tests for CardDoDont.
packages/react-components/src/components/CardDoDont/CardDoDont.stories.tsx Adds Storybook stories and docs for CardDoDont.
packages/react-components/src/components/CardCallout/index.ts New export barrel for CardCallout.
packages/react-components/src/components/CardCallout/CardCallout.tsx New React Card / Callout component implementation.
packages/react-components/src/components/CardCallout/CardCallout.test.tsx Adds unit + a11y tests for CardCallout.
packages/react-components/src/components/CardCallout/CardCallout.stories.tsx Adds Storybook stories and docs for CardCallout.
packages/react-components/src/components/Card/index.ts New export barrel for Card.
packages/react-components/src/components/Card/Card.tsx New React Card component implementation matching toolkit classes/behaviors.
packages/react-components/src/components/Card/Card.test.tsx Adds unit + interaction + a11y tests for Card.
packages/react-components/src/components/Card/Card.stories.tsx Adds comprehensive Storybook coverage for Card variants.
packages/react-components/src/components/Button/Button.stories.tsx Improves docs text + controls policy for non-interactive stories.
packages/react-components/README.md Updates install tag + usage docs to include new Card family exports.
docs/release-versioning-strategy.md Marks toolkit-v4.4.0 and react-v0.3.0 as released.
docs/prompts/component-validation-qa-template-prompt.md Adds new QA workflow prompt template.
docs/prompts/component-update-template-prompt.md Extends component update workflow with dependency audit + docs UX pass rules.
docs/prompts/component-pr-readiness-template-prompt.md Adds new PR-readiness workflow prompt template.
docs/prompts/README.md Documents prompt workflow ordering and purpose.
docs/consuming-react-components.md Updates installation tag + updates component list to include Card family.
UPGRADING.md Adds migration guidance for Card family realignment + updates install examples.
CHANGELOG.md Documents Card family realignment and React Card family additions.
Comments suppressed due to low confidence (1)

packages/toolkit/components/card/card.scss:196

  • Clickable-card hover/active styles now only target .ofh-card__primary-link, but the JS click proxy still supports .ofh-card__link as a fallback selector. This makes legacy markup (or custom headingHtml that only uses .ofh-card__link) lose the intended hover/active link styling. Consider including .ofh-card__link alongside .ofh-card__primary-link within the .ofh-card--clickable &:hover,&:active rules to keep styling consistent with the supported selectors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@diogo-filipe-costa diogo-filipe-costa marked this pull request as ready for review March 17, 2026 09:45
- add a solid background and circular radius to the dismiss button so it stays visible when overlapping images or other busy content
- consolidate the basic success and icon-led docs example into a single 'Basic card with icon' surface on the docs site
- rename the standalone example and Storybook story to match that generic card-with-icon pattern and note that it can support success or other icon-led cards
- keep the larger dismiss hit area for accessibility\n- apply the focus treatment to the visible dismiss icon instead of the padded button\n- preserve the intended 32px visual focus ring while the button target remains 48px
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants