Skip to content

feat: Card component — all 10 integration surfaces - #239

Draft
tbielich with Copilot wants to merge 3 commits into
mainfrom
copilot/tbielich-ui-foundations-runtime-44
Draft

feat: Card component — all 10 integration surfaces#239
tbielich with Copilot wants to merge 3 commits into
mainfrom
copilot/tbielich-ui-foundations-runtime-44

Conversation

Copilot AI commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Baseline documentation change

Scope

Implements the Card component (Prio 2 Extended, issue #44) across all required integration surfaces. Card is a content container supporting image/media slots, header/body/footer structure, interactive (clickable) variant, horizontal and vertical layouts, and a selection state.

Tokens — 12 component-scoped tokens added to figma/exports/Patterns (UI).tokens.json:

  • Container background, border (default/selected/radius/size), text (default/subtle), padding (block/inline), gap, interactive hover/active backgrounds
  • All alias to existing Appearance (Modes) or Semantics (Brands) variables; --uif-card-border-radius uses the pre-existing Brand/Corner/Card token

CSS patternsrc/ui/patterns/card.css:

  • Slots: .uif-card-media, .uif-card-header, .uif-card-body, .uif-card-footer
  • Layout modifier: .horizontal (flex-direction row, media constrained to 40% inline)
  • Interactive variant: hover/active/focus-visible states via token references
  • Selection state: .is-selected applies brand border color at 2× weight

Nunjucks macroscard(), cardMedia(), cardHeader(), cardBody(), cardFooter() added to site/_includes/macros/ui.njk. Link cards (href set) use aria-current="true" for selected state; article cards use aria-selected="true".

{% call uif.card(layout="horizontal", interactive=true) %}
  {% call uif.cardMedia(src="/img/photo.jpg", alt="") %}{% endcall %}
  {% call uif.cardHeader() %}<strong>Title</strong>{% endcall %}
  {% call uif.cardBody() %}<p>Description.</p>{% endcall %}
  {% call uif.cardFooter() %}{{ uif.button("Action") }}{% endcall %}
{% endcall %}

Web Componentsrc/elements/ui-card.js registers uif-card, uif-card-media, uif-card-header, uif-card-body, uif-card-footer. Exported from src/elements/index.js and added to package.json exports map.

Docs + Playgroundsite/patterns/card.md covers anatomy, layout options, interactive/selection states, usage guidelines, keyboard interactions, and accessibility. site/patterns/card-playground.md exposes title, body, layout, interactive, selected, showMedia, and showFooter controls.

Code Connectschemas/web-card.figma.ts maps Layout, Interactive, and State Figma properties to CSS class composition.

Review checklist

  • Terminology is consistent with docs/terminology.md.
  • docs/canonical-reference-matrix.md is updated when new terms, rules, or canonical sources are introduced.
  • @ui-foundations-maintainers has been notified for review.
  • Ownership remains team-based; no person-specific or parallel ownership rule is introduced.
  • Changes preserve the Runtime/Vault authority boundary.
  • Relevant documentation and CI checks pass.

Copilot AI linked an issue Jul 24, 2026 that may be closed by this pull request
Copilot AI added 2 commits July 24, 2026 11:28
Adds the Card component (issue #44) across all 10 required surfaces:
- Component tokens (figma/exports/Patterns (UI).tokens.json)
- CSS pattern (src/ui/patterns/card.css) with media slot, header/body/footer, interactive variant, horizontal layout, selection state
- CSS index import (src/ui/index.css)
- Nunjucks macros: card(), cardMedia(), cardHeader(), cardBody(), cardFooter()
- Web Component: ui-card.js with UICard, UICardMedia, UICardHeader, UICardBody, UICardFooter
- Element exports (src/elements/index.js, package.json)
- Docs page (site/patterns/card.md)
- Playground page (site/patterns/card-playground.md)
- Playground renderer renderVanillaCard (site/assets/playground/renderers.js)
- Code Connect schema (schemas/web-card.figma.ts, schemas/web-card.ts)
- Regenerated naming contract and token dist files
- Remove inconsistent gap fallback values in card.css (token always defined)
- Fix aria semantics: remove redundant role="link" from <a> cards in macro
- Fix aria-pressed → aria-current="true" for selected link cards (macro + web component)
- Playground renderer code string uses aria-selected for <article> cards correctly
Copilot AI changed the title [WIP] Add card component for grouping related information feat: Card component — all 10 integration surfaces Jul 24, 2026
Copilot AI requested a review from tbielich July 24, 2026 11:32
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.

Component: Card

2 participants