feat(NavigationCard): Add navigation card built on CardFrame - #4063
Conversation
|
Tip All tests passed and all changes approved!🟢 UI Tests: 4 changes accepted as baselines |
markhigham
left a comment
There was a problem hiding this comment.
LGTM Some FYI comments.
-
Mixed grids with and without icons. The icon panel disappears entirely when no icon is passed, so a grid mixing both variants gets ragged left alignment and inconsistent card heights. If mixing is expected, the docs should say "don't," or the layout should reserve the space.
-
Text selection is dead. The stretched overlay sits over the description, so users can't select/copy the description text. For "Browse and download all received files" that's probably fine, but if descriptions ever carry
meaningful data (filenames, counts), it'll frustrate people. Worth deciding consciously.
|



Related issue
N/A
Overview
Adds a new
NavigationCardcomponent: a clickable card built on the existingCardFrameprimitive, with a themed icon panel, a title, an optional description and a chevron affordance. Intended for landing/home screens that link into the major areas of an app.Link to preview
N/A
Reason
Consuming apps have been hand-rolling bespoke "clickable card" navigation on their landing pages. This provides a single, accessible, tokenised component so those snowflakes can be replaced with a shared one.
Work carried out
NavigationCardbuilt onCardFrame, with a themed icon panel, title, optional description and chevron::afteron the supplied link, keeping a single element in the accessibility tree (icon and chevronaria-hidden)linkprop (mirrorsSidebarNavItem) so consumers pass their ownnext/link/ routerLink/<a>colorprop fromNAVIGATION_CARD_COLOR(action|success|warning|danger|neutral, defaultaction) driving icon panel, chevron and hover/focus statesValueOf),partials/with barrel,ComponentWithClass+ JSDoc props, registered in the package barrelComponents/Navigation Card(Defaultwith controls,WithoutIcon,Colours)jest-styled-components) — title/href, description, icon presence/absence, chevron, className pass-through, prop spread, link click, per-colour tintScreenshot
Developer notes
<button>: a real button can't live inside the card-wide link, so the whole card is the link and the chevron signals navigation.linkelement supplies the title text; its descendant anchor is styled and stretched — nocloneElementneeded.types,lintand the component test suite pass locally.