# Picasso — full documentation Integrated Research's design system. Generated from the repo, which is the source of truth. Generated 2026-11-09. # Picasso documentation Picasso is Integrated Research's design system. This folder is the **source of truth** for everything written about it — the site, Storybook, the `llms*.txt` files and the Figma foundations pages are all renderings of what is here. ## Sections | Section | For | Contents | |---|---|---| | [Get started](get-started/) | everyone | Install, first component, how designers and engineers each enter the system | | [Foundations](foundations/) | designers, engineers | Grid, spacing, radius, typography, colour | | [Content](content/) | writers, designers, PMs, engineers | Voice, casing, errors, states, numbers, terminology | | [Components](components/) | engineers, designers | One page per component, **generated** from the component folder | | [Patterns](patterns/) | engineers, designers, PMs | Whole screens, and the definition of done a screen ships against | | [Contributing](contributing/) | contributors | How to add a component, and what "done" means | | [Releases](releases/) | everyone | How Picasso versions and what each category means | Component documentation is still **authored** next to the component — `button.tsx`, `button.stories.tsx`, `guidance.json` — so a change to the code and a change to its guidance land in the same diff. A doc in a separate folder drifts; a doc in the same folder gets reviewed. `docs/components/` is **generated** from those folders by `scripts/build-component-docs.mjs` and is not committed. It exists because the rule above had a cost: the site had no Components section at all, so searching it for a component name found passing mentions and never the component. Nothing in those pages is written — every line is lifted from `guidance.json`, the component's doc block, its props and its cva variants. Editing one is pointless; the next build overwrites it. ## Where a rule lives Five copies of a rule are zero copies of a rule. Each one has exactly one home: | Home | Role | |---|---| | **This folder + `guidance.json`** | ✅ **Source of truth** | | `AGENTS.md` | ✅ Source of truth for *how to write code here* | | Docs site | renders this folder | | Storybook | renders the stories this folder links to | | `llms.txt`, per-page `.md`, MCP | generated at build | | Figma foundations pages | designer-facing mirror — each says so on the page | | `ir-brand`, `ir-tone-of-voice` | ✅ Source of truth for **company** voice and brand, which outrank this system | If you find a rule stated in two places, one of them is wrong. Fix the source and delete the copy. ## How these pages are written **A page describes the system as it is.** Present tense, no history. What the rule is, where it applies, what to reach for — not what it replaced, not who decided it, not what it was before. - **No change history.** "The radius ladder moved from Tailwind's to shadcn's" belongs in `CHANGELOG.md`. The page says `rounded-md` is 8px. - **No decision record.** Which alternatives were weighed, and why this one won, is not what a reader needs at the moment they are reaching for a token. - **No status.** "Not settled yet", "nothing uses this one", "coming later" — a page that tracks its own progress goes stale the week after it is written. Open work is tracked where open work lives, not on the page. - **Keep the *why* that is an instruction.** "Floating outranks modal because a portalled menu has to clear the dialog that opened it" tells you where to put the next floating thing. That earns its place. "We chose GovTech's scale after comparing three" does not. A reader arrives mid-task with a question. Answer that question. **Link by file, the way GitHub does.** `[Colour](colour.md)` from a page in the same folder, `[Content](../content/)` for a section, `[AGENTS.md](../../AGENTS.md)` for a file outside `docs/`. The site rewrites each one to its page — or to the file on GitHub — when it builds, and a link to a page that does not exist fails the build. ## Direction of truth **The repo is the source of truth for the design system.** Figma is a consumer: it receives tokens and is reconciled to match the code. Component *behaviour* — which variants and states exist — still flows Figma → code. --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Accordion Sections that expand in place, for content most people will not need to read. ## Import ```tsx import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "@ir/ui"; ``` ## Watch out - Figma's axis is `Type` (FAQ | Default); here it is `variant`, because Radix's Root already owns `type` for single-versus-multiple open. The values keep Figma's names. ## Props Takes the props of the element it renders, and nothing of its own — styling is the component's business, not the caller's. ## Do and don't ### faq (plus/minus) for answers that appear; default (chevrons) for sections that unfold. **Don't** — Pick the icon pair by taste. This is the only thing the axis changes, and it is the only signal people get about what the control will do. ### Collapse what most people will skip — edge cases, detail, history. **Don't** — Hide the thing the page is about behind a closed section. Anything collapsed is not found, not read and not searchable on the page. That is the cost of every closed row. ### Say what is inside — the trigger is the only thing visible when closed. **Don't** — Write "More" or "Details" on the trigger. A closed accordion is a list of its own labels. If the labels say nothing, the list says nothing. ### Single for comparison-free reading, multiple when people cross-reference sections. **Don't** — Default to multiple open just to avoid choosing. Single keeps the page short; multiple keeps two answers side by side. Which one is right depends on the reading, not the component. ### Put the divider above each item after the first. **Don't** — Add a rule under the last item to close the list off. The rule separates items. A trailing one draws a line under nothing. ## Accessibility - Radix sets aria-expanded and aria-controls on the trigger and the region on the panel. Do not add your own. - The chevron is aria-hidden, so the trigger's text is its entire accessible name — a trigger with only an icon has none. - Focus is a 2px ring offset against bg/app. :focus-visible clears the browser outline globally, so a trigger without the ring has no focus indicator at all. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=1136-1487) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-accordion--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Alert Something the page needs to say about itself, in place — and that stays there. ## Import ```tsx import { Alert, AlertTitle, AlertDescription } from "@ir/ui"; ``` ## Watch out - The icon and the dismiss take `fg/neutral/emphasis`, the same ink as the title, in all four tones. That is Figma's spec, and it is why the tone has to be carried by the surface — do not tint the icon to compensate. - **The icon and the dismiss live inside the title row**, which is where Figma puts them, so they align with the title rather than floating against the middle of a two-line block. It also means an Alert with no `AlertTitle` has neither — again, Figma's shape, since both are children of the title row there. If a dismissible alert with no title is wanted, that is a change to the Figma component first. ## Variants | Axis | Options | Default | |---|---|---| | `variant` | `info` · `destructive` · `warning` · `success` | `info` | ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `icon` | `boolean` | | Hide the tone icon. Figma's `Icon` boolean. | | `onDismiss` | `() => void` | | Renders the dismiss control at the end of the title row. | | `dismissLabel` | `string` | | Label for the dismiss control — it is an ✕, so it needs words. | | `action` | `React.ReactNode` | | The trailing action, an xs Outline Button in Figma's `Action=Button`. | ## Do and don't ### Use Toast for a passing confirmation; keep Alert for a condition that is still true. **Don't** — Use an Alert for something that just happened and does not need to persist. An Alert stays on the page. If the thing it describes is over, it becomes a piece of furniture people learn to read past. ### Use a Dialog when the work genuinely cannot proceed. **Don't** — Use an Alert to ask a question that must be answered before continuing. An Alert can be ignored by design. A question that cannot be ignored needs a control that takes the focus. ### Match the tone to the state: success happened, warning is about to, destructive already went wrong, info is context. **Don't** — Reach for Destructive because the message feels important. Four tones only work while they differ. A page of red alerts carries exactly as much information as a page of grey ones. ### Say what happened and what happens next, and attach the action if there is one. **Don't** — State the problem and stop — "Connection failed." An alert that cannot be acted on is a notification. The description is where the reader finds out whether this is theirs to fix. ### Offer dismiss for something acknowledged; leave a live condition on the page until it clears. **Don't** — Let someone dismiss an alert describing a condition that is still true. Dismissing is a promise that the information is no longer needed. If the disk is still full, closing the notice only hides it. ### Show the one that matters, or summarise them into a single alert that links to the detail. **Don't** — Stack four alerts at the top of a page. A stack of alerts reads as a wall. Whichever is most urgent is the one least likely to be read. ### Keep the title to a short phrase and put the rest in the description. **Don't** — Write a title that wraps onto a second line. The title shares its row with the icon and the dismiss. A wrapping title pushes them apart and stops the row reading as one thing. ## Accessibility - No role by default, deliberately. role="alert" interrupts a screen reader mid-sentence — use it only for something that has just gone wrong, and role="status" for something that merely changed. - The leading icon is aria-hidden. Severity has to be in the words; colour and icon alone reach nobody using a screen reader. - The dismiss button's accessible name comes from dismissLabel. An X with no label announces nothing. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=79-8042) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-alert--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # App shell The frame every product screen starts from — rail, top bar, page padding. ## Import ```tsx import { AppShell, AppShellMain, AppShellHeader, AppShellContent } from "@ir/ui"; ``` ## Variants | Axis | Options | Default | |---|---|---| | `width` | `fluid` · `standard` · `reading` | `fluid` | ## Do and don't ### Keep it to the sidebar toggle and the breadcrumb; the page header lives in the content area. **Don't** — Put the page title, search and page actions in the top bar. The bar is 48 high and it is the same bar on every screen. Everything added to it competes with the breadcrumb, which is the one thing that tells you where you are. ### Default to expanded from lg (1024) up, and to collapsed only at md (768) where the content would drop under 720. **Don't** — Ship the rail collapsed to win back 208px. An icon-only rail is a memory test for anyone who does not already know the product. The width is worth more to the person than to the layout. ### Trust the named step — `xl:` is 1280 in the tokens, in Tailwind and in the class. **Don't** — Re-derive the breakpoint from a screen width quoted in a spec. IR's ladder used to be Tailwind's shifted up one, so `lg:` meant 1280 to a designer and 1024 to the browser. They are one ladder now, and the name is the thing to trust. ### Let a dashboard add columns as it widens. **Don't** — Stretch four tiles across a wide screen. A KPI tile stretched to 500 wide carries the same number in twice the space, and the eye has further to travel between them. On a fluid page the spare width becomes more tiles per row — an auto-fill grid with a 224 minimum — and charts go from one across to two at 768 of content and three at 1280. ### Cap forms and prose at the reading width. **Don't** — Let a field span the content area. A 1600-wide text field gives no sense of what length of answer is expected, and a line of prose that long is hard to track back to its start. width="reading" caps the column at 768 (size/content/reading). ### Keep capped content aligned to the rail. **Don't** — Centre capped content. Centring moves the start of every line as the window resizes, and breaks the alignment with the rail and the breadcrumb above it. Left-aligned, the page heading starts in the same place whether the page is fluid, standard or reading. ### Size dashboard grids to their container. **Don't** — Use viewport breakpoints inside the content area. The viewport does not know about the rail, the padding, a cap or a drawer. The same grid sits in a 976 column at 1280 with the rail open and a 1184 one with it collapsed. Use the @-variants (@3xl:, @7xl:); viewport breakpoints are for the shell — rail collapse and padding. ### Give charts a fixed height range. **Don't** — Lock a chart to an aspect ratio. An aspect ratio makes a chart grow taller as the screen widens, so on a 2560 monitor one chart fills the screen and pushes everything under it out of view. Width is where the extra time range goes; height stays between 240 and 320. ### Keep the scroll in the content area so the rail and the top bar stay put. **Don't** — Let the shell scroll as well as the page. Two scrollbars is the most common app-shell bug and the hardest to notice in a screenshot: the top bar slides away and the breadcrumb goes with it. ## Accessibility - AppShellMain is a plain <div>, never <main>. It contains the top bar, and chrome inside the main landmark both pollutes it and strips the <header> of its banner role — a <header> carries that role only when it is not inside main, aside, nav or section. - AppShellHeader is the <header> and therefore the page's banner; AppShellContent is the document's <main>. One of each per page. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000390-30130) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-app-shell--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Avatar A person or tenant, as a picture, initials or a generic mark. ## Import ```tsx import { Avatar, AvatarImage, AvatarFallback, AvatarStatus, AvatarGroup, AvatarAddButton } from "@ir/ui"; ``` ## Watch out - Note the ring is NOT what Figma uses for groups — every avatar in `Avatar group` is Border=False, so overlapping avatars have no separating edge at all. Followed as drawn; raised as an observation, because same-fill circles overlapping by 4–12px have nothing marking where one ends. - Figma's online dot has two gradient "Reflection" layers over the solid fill — a radial highlight and a linear sheen. Reproduced here as the flat fill only: the gradients need per-stop colour values, which is exactly what no-arbitrary-values refuses, and a gloss on an 10px dot is below the threshold where anyone can see it. Raised rather than quietly matched. ## Variants | Axis | Options | Default | |---|---|---| | `size` | `xs` · `sm` · `md` | `md` | | `variant` | `default` · `inverse` | `default` | | `size` | `default` · `inverse` | `md` | ## Props ### AvatarFallback | Prop | Type | Required | What it does | |---|---|---|---| | `icon` | `boolean` | | Show the generic person icon instead of initials. Figma's `Placeholder icon`. | ### AvatarStatus | Prop | Type | Required | What it does | |---|---|---|---| | `count` | `number` | | For type="count". | | `label` | `string` | | What the dot means, for anyone not looking at it. | ### AvatarGroup | Prop | Type | Required | What it does | |---|---|---|---| | `action` | `React.ReactNode` | | Trailing control, sat 8px clear of the stack. Usually AvatarAddButton. | | `ring` | `boolean` | | Ring every avatar in the group. Defaults to true, matching the file: without it, overlapping avatars have no edge and swallow each other's initials. | | `max` | `number` | | Show at most this many, then a "+N" avatar for the rest — which is exactly what the file draws at the end of a group. | ### AvatarAddButton | Prop | Type | Required | What it does | |---|---|---|---| | `label` | `string` | | What adding does. "Add" alone rarely says enough. | ## Do and don't ### Always give it initials or the generic person to fall back to. **Don't** — Render an avatar with only an image source. Profile pictures 404 more than anything else on a page. Without a fallback the layout collapses to an empty circle. ### Give AvatarStatus a label, and repeat the state in text nearby. **Don't** — Let the dot be the only thing saying someone is offline. A colour on a 10px dot is invisible to a screen reader and hard for anyone who does not know the convention. ### Wrap it in a real link or button with a name. **Don't** — Hang the only route to a profile off clicking the avatar. An avatar is an image. Nothing about it says it can be activated, and nothing announces where it goes. ### Put the name beside it; keep the avatar as recognition, not identification. **Don't** — Use initials alone in a list people scan to find someone. Two colleagues share initials more often than you would think, and initials do not disambiguate them. ### Pick the size from the row it sits in — xs in dense tables, md in headers. **Don't** — Mix avatar sizes down one list. The avatar sets the row's optical height. Changing it mid-list makes the whole list look misaligned. ### Cap with max and let the +N carry the rest. **Don't** — Stack twenty avatars because twenty people are on the incident. Past about five, the faces stop identifying anyone and the row just eats width. ## Accessibility - AvatarStatus carries role="img" with an aria-label — "online", "3 unread", or whatever label says. A dot that silently turns green tells a screen reader nothing. - The User fallback icon and the verified badge are both aria-hidden; the status wrapper's label is the only text in it. - The overflow "+N" button takes an explicit label. It is an icon and a number with no sentence of its own. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=375-427) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-avatar--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Badge A short, static label on a thing — a status, a count, a category. ## Import ```tsx import { Badge } from "@ir/ui"; ``` ## Watch out - **Outline ignores the colour.** All five colours render identically in Figma — neutral fill, neutral border, neutral text — so 40 of the 120 variants collapse to 8. That is the file's spec and it is kept here, but it means `<Badge variant="outline" color="danger">` is not a red badge and never was. Raised, not changed. - Neutral subtle takes `border/neutral/subtle` where every other colour takes `border/<c>/muted` — a quieter edge for the quiet colour. Also the file's spec. ## Variants | Axis | Options | Default | |---|---|---| | `color` | `neutral` · `success` · `warning` · `danger` · `info` | `neutral` | | `variant` | `subtle` · `emphasis` · `outline` | `subtle` | | `size` | `md` · `lg` | `md` | ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `asChild` | `boolean` | | Render as the child element, keeping Badge's styling. | | `dot` | `boolean` | | An 8px status dot before the label, in the matching status colour. | ## Do and don't ### Use Chip for something selectable and Button for something that acts. **Don't** — Make a badge clickable, or use one as a filter chip. A badge is a label on a thing, not a thing to press. Making one clickable gives it no focus ring, no hit area and no keyboard route. ### Keep the word — "Healthy", "Critical" — and add the dot if it helps. **Don't** — Signal status with colour and nothing else. Colour alone fails for anyone who cannot separate the hues, and a badge is small enough that the hue is all there is. The word is the signal; the colour reinforces it. ### Show the one that changes what the reader does next. **Don't** — Put three badges in a row on the same object. Badges are loud by design. Three of them compete, and the reader ends up scanning past all three. ### One or two words. Put the detail in the text beside it. **Don't** — Write a sentence in a badge. A badge does not wrap gracefully and cannot be read at a glance once it is longer than its container is wide. ### Keep emphasis for the exception, and subtle for the rest. **Don't** — Use emphasis badges everywhere because they read more clearly. The solid fill is the loudest thing on most surfaces. Used for every row it becomes the background, and the one that matters disappears into it. ### Use subtle for a quiet coloured badge; outline is deliberately neutral. **Don't** — Reach for outline expecting a quieter red or green. Outline renders identically for all five colours — neutral fill, neutral border, neutral text. Choosing it discards the colour rather than muting it. ## Accessibility - The dot is aria-hidden. A badge's meaning is its text — colour and dot are reinforcement, never the signal. - Badge is not a live region. A count that changes while the page is open announces nothing unless the surrounding component says so. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=383-41) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-badge--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Bar chart A measure compared across categories — calls per site, failures per cause, minutes per region. Grouped, or stacked when the parts make a whole. ## Import ```tsx import { BarChart } from "@ir/ui"; ``` ## Watch out - The bars are HTML, not SVG, and that is the point. The plot elsewhere is a 0–100 box stretched to its width, which is ideal for a line and wrong for a bar: stretching turns a 24px cap into whatever the container feels like and bends a 4px corner into an ellipse. As elements, a bar is capped at 24 exactly, its data-end is rounded 4 and its baseline end is square, and the 2px gap between touching marks is 2px. Only the gridlines stay SVG, and horizontal rules do not distort. - Bars start at zero, always. A bar says "this much", and a bar chart with a cut-off baseline says it at four times the size. `yMin` is not offered. - Stacked bars are for parts of a whole. Only the bottom segment and the total can be read along a common baseline; everything between floats. If the comparison people actually make is between the middle segments, group them instead. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `stacked` | `boolean` | | Parts of a whole, stacked on one baseline. Grouped when false. | | `yMax` | `number` | | Pin the top. The bottom is always zero. | | `label` | `string` | yes | Sentence for the table caption. | ## Do and don't ### Start every bar at zero. Use a line chart if the interesting range is a narrow band well above it. **Don't** — Cut the baseline to make a small difference look like a big one. A bar encodes its value as length, so a cut baseline multiplies the difference by whatever the author chose. There is no `yMin` on this component for exactly that reason. ### Stack only when the parts add to a total worth reading; group when the comparison is between the parts. **Don't** — Stack series people need to compare with each other. In a stack only the bottom segment and the grand total share a baseline. Every segment in between floats on the ones below it, so comparing two middles across columns is comparing two things that start in different places. ### Leave the 24 cap alone; the gap between groups is what separates them. **Don't** — Let bars grow to fill their slot, so a four-category chart is four slabs with no air. The space is doing work — it is what makes a group read as one thing and the next as another. A bar that fills its slot turns a chart into a wall. ### Let them truncate, or turn the chart on its side, or shorten the category names. **Don't** — Rotate category labels to 45° to fit them in. Angled text is measurably slower to read and the rotation grows with the category count, so the chart gets harder exactly as it gets busier. Truncation with the full name on hover keeps every label on one baseline. ## Accessibility - Like every chart here, the plot is `aria-hidden` and the numbers are carried by a visually-hidden table. - Each bar carries its own `title` — series, category and value — so a pointer can read one without a crosshair. - A missing value leaves the slot empty rather than drawing a zero-height bar, which would be indistinguishable from a real zero. - The 2px gap between touching bars is in the surface colour, so adjacent segments in a stack stay separable without a stroke. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000734-16) — structure from code, measurements from code. [Open in Storybook](/components/?path=/docs/components-bar-chart--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Bottom sheet A panel that rises from the bottom edge over a scrim — the phone-sized answer to a Select, a filter or a sort menu. ## Import ```tsx import { BottomSheet, BottomSheetTrigger, BottomSheetClose, BottomSheetContent, BottomSheetHeader, BottomSheetTitle, BottomSheetDescription, BottomSheetCloseButton, BottomSheetBody, BottomSheetItem, BottomSheetFooter } from "@ir/ui"; ``` ## Watch out - The drag is an addition, never the exit. A sheet whose only way out is a gesture is a sheet a keyboard or switch user cannot leave, so the close button is always drawn and the handle stays aria-hidden: it is an affordance for the gesture, not a control. - Not for navigation. A phone's main nav is full screen (SidebarMobile); a sheet is for one decision about the page beneath it. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `label` | `string` | | Accessible name for a sheet with no visible `BottomSheetTitle`. Mutually exclusive with it. | | `handle` | `boolean` | | The handle. On by default; it is the affordance for the drag, not a control. | | `drag` | `boolean` | | Drag the handle or header down to dismiss. On by default. | ## Do and don't ### Below md (768), open the same choices in a BottomSheet; keep the Popover from md up. **Don't** — Open an anchored Popover or Select menu from a 32-tall trigger on a phone. On the Clarion Endpoints page the anchored menus clipped against a 390 viewport and put 32-tall rows under a thumb. The sheet starts where the thumb already is. ### Collect ticks in a draft and commit on Apply, with the count — "Apply · 2". Clear sits beside it. **Don't** — Apply each tick live while the sheet is still covering the result. The list being filtered is under the scrim, so a live change is one nobody can see. It also matches Select's apply-not-live rule. ### Treat every way out except Apply as Cancel. **Don't** — Keep the draft when the sheet is dismissed with the scrim, Escape or the close button. Same rule as Select — a dismissal that half-commits leaves people unsure what is filtered. ### Draw the close button as well. The drag is a shortcut for a thumb; Escape, the scrim and the close button are the exits. **Don't** — Ship the drag as the way out, with nothing drawn to close the sheet. A gesture-only exit cannot be reached by a keyboard or by switch control, and nothing on screen tells anyone the panel can be dragged. The handle hints at it and stays aria-hidden, so the drag is an addition to the three exits rather than a replacement for them. ### Cap it (5/6 of the viewport) and scroll the body; leave the page peeking above. **Don't** — Let the sheet fill the screen. A sheet that covers everything reads as a new screen, and people stop expecting the scrim to take them back. ### Use BottomSheetItem — 48 tall, the whole row a label around the Checkbox or Radio. **Don't** — Reuse the 28–32 menu rows from the desktop Popover. Desktop menu rows are sized for a pointer. A thumb needs about 44, and a row that only reacts on its checkbox is a row people miss. ### Use SidebarMobile — the nav full screen — and keep sheets for one decision about the page beneath. **Don't** — Put the app's navigation in a bottom sheet. Navigation leaves the page; a sheet is about the page. Mixing them makes Apply and 'go somewhere' look the same. ## Accessibility - Built on Radix Dialog: modal, focus trapped, Escape and a scrim tap close it, focus returns to the trigger. - Give it a visible BottomSheetTitle, or `label` when there is none — never both. - The handle is aria-hidden: it hints at the drag, it is not a control. Everything the drag does is also reachable by keyboard. - The panel follows the finger under prefers-reduced-motion too — direct manipulation is not animation. On release the settle is instant and a dismissal is a short fade. - BottomSheetItem is a <label>, so the whole 48 row toggles the Checkbox or Radio inside it. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000659-233) — structure from code, measurements from code. [Open in Storybook](/components/?path=/docs/components-bottom-sheet--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Breadcrumb Where the current page sits in the hierarchy — every level but the last is a link. ## Import ```tsx import { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbEllipsis, BreadcrumbTrigger } from "@ir/ui"; ``` ## Watch out - The separator belongs to the item, not between items — and that is load-bearing, not incidental. The file gives the list a gap of 10 (md) and each item an internal gap of 6, so the space before a chevron is wider than the space after it. A separator placed between items as a sibling can only ever produce 10/10. Each item therefore carries its own **leading** chevron, hidden on the first item — which is exactly what the file does with its `Separator` boolean, off on the first item only. - Size changes the gap and nothing else. md and sm are both body/md at 14px and both 21 tall; only the list gap moves, 10 → 6. Built as drawn, and raised — a size axis that does not change type is unusual enough to be worth confirming. - Focus is drawn but not designed. All twelve BreadcrumbItem variants have a Focus state, and every one of them is pixel-identical to its Default — no ring, no underline, nothing. Only `Link` Hover differs from its Default at all. A link that cannot be seen when focused is a keyboard trap, so the code carries the system's standard focus ring regardless; Figma needs the same fix that the seven Tab focus variants got. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `separator` | `boolean` | | The leading chevron. On by default and hidden on the first item — Figma's `Separator`. | ## Do and don't ### Render it as the current page, with aria-current. **Don't** — Make the last crumb a link to the page you are already on. A link that goes nowhere wastes a tab stop and tells a screen-reader user the wrong thing about where they are. ### Collapse the middle into an ellipsis past four levels. **Don't** — Print all seven levels and let the row wrap. The first and last levels are what people orient by. The middle is only needed when someone goes looking. ### Show where this page sits in the structure. **Don't** — Show where the person has been. Breadcrumbs describe the hierarchy, not the journey. A trail that changes per visitor cannot be learned. ### Give it text only a screen reader hears. **Don't** — Leave the collapsed crumb as three dots and nothing else. An ellipsis is a shape. Without words it is a control nobody can name or explain. ### Use sm to tighten the gaps — both sizes are body/md at 14px. **Don't** — Reach for sm expecting smaller text in a dense context. Size moves the spacing only. If the type needs to shrink, that is a change to make in Figma first. ## Accessibility - The <nav> carries aria-label="Breadcrumb". That is what distinguishes it from every other nav on the page. - The current page takes aria-current="page" and is not a link. - Separators and the ellipsis glyph are aria-hidden, so the trail reads as a list of names rather than "slash" between each one. - The ellipsis ships an sr-only label, "Show hidden levels" by default. Replace the text, not the mechanism. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=2499-242) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-breadcrumb--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Button group Several buttons that belong to one decision, joined into a single control. ## Import ```tsx import { ButtonGroup } from "@ir/ui"; ``` ## Watch out - **Figma carries a `Variant` axis; this does not, on purpose.** In Figma the group has to restate Outline / Default / Secondary because a component cannot read what its children are. Here the children *are* Buttons and each one already carries its own variant, so a group-level variant could only duplicate or contradict them. The group owns the geometry; the buttons own their colour. Same divergence the theme-architecture note records for Input's `Type` axis — the code shape is the contract. ## Variants | Axis | Options | Default | |---|---|---| | `orientation` | `horizontal` · `vertical` | `horizontal` | ## Do and don't ### Use Radio, or a segmented control, when the choice persists. **Don't** — Use a ButtonGroup for a setting where one option stays selected. Nothing in a ButtonGroup stays pressed. If the control has to show which option is current, it is answering a question, not offering actions. ### Group actions that are variations of one job — Day, Week, Month. **Don't** — Join Save, Cancel and Delete because they sit next to each other. Joining two buttons says they are the same kind of thing. Cancel and Delete are not, and the shared edge makes the destructive one easier to hit by accident. ### Use Outline or Secondary for a set of peers, and keep primary for a split of one action. **Don't** — Fill a group with primary buttons so everything competes. A row of five primary buttons has no hierarchy left to offer. The solid treatment is for a group that is really one action plus its options. ### Give it an aria-label — "Zoom", "View as", "Export". **Don't** — Leave the group without a name. Read on their own, the buttons are six labels with nothing to say what they have in common. The group's name is what supplies it. ### Keep it to a handful, and move the rest behind a menu. **Don't** — Join eight buttons into one bar. A long joined bar stops reading as a set of choices and starts reading as a toolbar, where the shared edges are just noise. ### Give each an aria-label, and a tooltip if the icon is not obvious. **Don't** — Put bare icon buttons in the group and rely on the shape. An icon in a joined bar has no label beside it to borrow meaning from, so the name has to come from the button itself. ## Accessibility - role="group", so the set is announced as one thing — but it needs an aria-label: "Zoom", "View as", "Export". Without one a screen reader reads six buttons with nothing to say what they share. - Hover and focus lift a member to z-10 so its focus ring is not clipped by the neighbour's edge. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=667-1703) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-button-group--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Button Triggers an action. Verb first, naming the outcome. ## Import ```tsx import { Button } from "@ir/ui"; ``` ## Variants | Axis | Options | Default | |---|---|---| | `variant` | `default` · `neutral` · `secondary` · `destructive` · `outline` · `ghost` · `link` | `default` | | `size` | `xs` · `sm` · `md` · `lg` · `icon-xs` · `icon-sm` · `icon-md` · `icon-lg` | `md` | ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `asChild` | `boolean` | | Render as the child element, keeping Button's styling. | | `loading` | `boolean` | | Shows a spinner and disables the button. | ## Do and don't ### Keep Ghost transparent until hover. **Don't** — Give Ghost a resting background. A ghost with a resting fill reads as Outline, so the hierarchy between a primary and a tertiary action collapses and every toolbar looks equally important. ### Leave Link as text, coloured by fg/link/*. **Don't** — Put Link in a box — fill, border or radius. A link drawn as a button is ambiguous about whether it navigates or acts. fg/link carries it at 7.66:1 without a box. ### Underline on hover only. **Don't** — Underline Link at rest. textDecoration propagates across every node sharing a text style, so underlining Link in Figma underlines all 168 buttons. Colour distinguishes it; the underline is a hover affordance. ### Pass aria-label on every icon-* size. **Don't** — Ship an icon-only button with no accessible name. Screen readers announce nothing. The icon sizes have no text child by definition, so the label has to come from the attribute. ### Pick Size for height and touch target. **Don't** — Reach for a larger Size to get bigger text. Size changes height and padding; the label stays label/md. Resizing an instance to force a height is how 36 instances ended up off-scale. ### Leave it at its variant height. **Don't** — Set a Button to vertical HUG in Figma. Its vertical padding is inert, so a HUG instance collapses to 16–18px. This broke 22 instances once already. ### One primary; everything else a step quieter. **Don't** — Put two primary buttons side by side. Primary means “this is the next thing to do”. Two of them means neither is, and the reader has to work out the hierarchy the design was supposed to give them. ### Name the outcome — "Save changes", "Delete probe", "Export CSV". **Don't** — Label a button "Submit", "OK" or "Yes". The label is the only thing many people read before clicking. Two or three words; if it needs more, the explanation belongs above the button. ### Name the thing in both the button and the confirm. **Don't** — Use Destructive without a confirmation that restates what is lost. Destructive is a warning, not a safeguard. "Delete probe" then "Delete probe SYD-03? Its history is removed." ## Accessibility - Focus ring is border/focused at 2px with a 2px offset; never remove it. - loading sets aria-busy and disables the button — a busy button must not be activatable. - Disabled contrast is 2.24:1 by design. SC 1.4.3 exempts disabled controls; the low contrast is the signal. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=22-267) — structure from figma, measurements from shadcn. [Open in Storybook](/components/?path=/docs/components-button--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Calendar A month grid for picking a date or a span of them. ## Import ```tsx import { Calendar } from "@ir/ui"; ``` ## Watch out - The file puts the caption and the arrows in two different orders. `Calendar / Custom Cell Size` runs caption-then-arrows; `Calendar / Week Numbers` runs arrows-then-caption. Built caption-left with the arrows together on the right — the more common of the two and the one that keeps the arrows as a pair — and raised. - `Calendar / Custom Day Button` fills its Range Left and Right variants with `fg/on/primary-emphasis` — a foreground token used as a background. Not reproduced here: the same variants on the main Day Button use bg/primary/subtle, which is what a range's edge should be. ## Props Takes the props of the element it renders, and nothing of its own — styling is the component's business, not the caller's. ## Do and don't ### Say the rule near the calendar — "data is kept for 13 months". **Don't** — Grey out dates and leave people guessing why. A disabled day looks the same whether it is in the past, outside a retention window or already booked. Only words separate them. ### Show two months when the span is likely to cross one. **Don't** — Ask for a range in a single month view. Most ranges cross a month boundary, and paging back and forth loses the first end of the selection from view. ### Use a calendar for dates near today; use fields for anything far away. **Don't** — Use a calendar to capture a birth year. A grid is faster than typing for this month. It is much slower than typing for 1974. ### Keep today's subtle fill distinct from the selected day's solid one. **Don't** — Style today the same as the chosen day. They answer different questions — where am I, and what did I pick. Merged, the calendar appears to have chosen for you. ### Let the locale decide. **Don't** — Hardcode Sunday or Monday as the first column. People read the grid by shape as much as by number, and a week starting on the wrong day is misread rather than re-read. ## Accessibility - react-day-picker owns the grid semantics, the roving focus and arrow-key movement. Do not re-implement them. - Only the chevron glyph is overridden, and it is aria-hidden — the navigation buttons take their names from react-day-picker, so changing its locale changes them. - Disabled days keep pointer-events-none and fg/disabled but stay in the accessibility tree, which is what lets someone discover a date is unavailable rather than just failing to reach it. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=2506-3284) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-calendar--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Card A surface that holds one thing, and says so with a border and a little lift. ## Import ```tsx import { Card, CardHeader, CardTitle, CardDescription, CardHeaderText, CardAction, CardContent, CardFooter } from "@ir/ui"; ``` ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `size` | `Size` | | Figma's `Size`: `default` pads at 24, `sm` at 16. | ## Do and don't ### Give each its own card, or drop the card and use headings. **Don't** — Put three unrelated sections in one card because they share a screen. The border is a claim that everything inside belongs together. Used on a grab bag it stops meaning anything, and the page reads as boxes rather than content. ### Use a divider, a heading, or a plain bordered region inside. **Don't** — Nest a card inside a card. Two borders and two shadows say "unit" twice about the same content, and the inner one competes with the outer for the eye. ### Let the page be the page; use cards for the things on it. **Don't** — Wrap the whole page body in a card. A card that contains everything separates nothing. The lift is a comparison — it only reads against an unlifted surface. ### Title the card only when the content needs naming. **Don't** — Repeat the section heading as the card title. A card is allowed to be just content. A title that echoes the heading above it costs a line and adds nothing. ### Put per-card actions in the header, and the ones that finish the job in the footer. **Don't** — Scatter actions through the card — one in the header, two in the body, one in the footer. Two places is a pattern people can learn. Four is a search. ### Pair it with an outline. **Don't** — Pair a card's primary action with a secondary button. Secondary's fill is bg/app — the page background. Inside a card it reads as a hole punched through to the page behind, and it only looks like a filled button at all because the card under it is white. Outline is what it is already pretending to be, with a border that belongs to the card rather than a fill that belongs to the page. A dialog has room for a secondary; a card does not, and the Figma page agrees — twelve primary and three outline in card footers, and no secondary in any of them. ### Either the card is the target, or it holds targets — not both. **Don't** — Make the whole card a link and put buttons inside it. A click inside a clickable card is ambiguous to the person and genuinely ambiguous in the markup; nested interactive elements are also invalid for assistive technology. ### Use sm where cards repeat — a list, a grid, a sidebar — and default where one card carries a page. **Don't** — Use sm to fit more words into the same space. The size changes padding, not type. Shrinking the padding to win room makes the content feel crowded rather than compact. ## Accessibility - Every part of Card is a <div>, CardTitle included. A card that is a section of the page needs a real heading inside CardTitle, or the page outline skips straight past it. - Card has no role. If it is meant to be a landmark, the consumer adds role="region" and aria-labelledby pointing at its title. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=2579-33491) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-card--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Chart Something measured repeatedly, drawn against time — the workhorse chart: MOS per trunk, latency per site, calls per minute. ## Import ```tsx import { niceScale, ChartFrame, ChartYAxis, ChartXAxis, ChartGridLines, ChartThreshold, ChartLegend, ChartTable } from "@ir/ui"; ``` ## Watch out - Series colour follows the ENTITY, never its position in the filtered list. Pass a stable `id` per series and the colour is derived from it, so hiding one series in the legend does not repaint the others. - There is no second y-axis, and there never will be. Two measures of different scale are two charts, or one chart indexed to a common base. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `title` | `React.ReactNode` | | Names the chart. With one series this is what identifies it, so there is no legend. | | `subtitle` | `React.ReactNode` | | Sits under the title — the window, the unit, the caveat. | | `action` | `React.ReactNode` | | Top-end controls: a range picker, a menu. | ## Do and don't ### Give each series a stable `id` and pass the whole list; the chart keeps each series on the slot it was built with. **Don't** — Assign colours by position in the filtered list, so hiding one trunk repaints every trunk below it. People read a colour as a name. If filtering out Sydney turns Melbourne from purple to blue, every reading taken before the filter is now wrong, and nothing on screen says so. ### Pass `null`. The line breaks, and the table says "No data". **Don't** — Fill a missing reading with 0, so a trunk that stopped reporting draws a cliff to the floor. An endpoint going quiet and an endpoint scoring zero are different incidents with different responses. A line to the floor reports the second when the first happened. ### Fill one series; draw several as lines. **Don't** — Fill under several series at once and hope the overlaps read. Overlapping translucent fills are the chart that looks informative and answers nothing — no overlap can be read as a value, and the series drawn last looks the largest. The component refuses `area` past one series rather than drawing it badly. ### Two charts, or one chart with both measures indexed to a common base. **Don't** — Put latency and call count on one chart with a scale down each side. A dual axis lets whoever drew it decide where the lines cross, because the two scales are chosen independently. It is the single most common way a chart misleads, and there is no API for it here. ### Fold the tail into one "Other" series, or facet into small multiples. **Don't** — Generate a seventh colour when there are more series than slots. The palette has six slots, and it has six because three of the declared eight could not be told apart from the others — corporate blue sits 7° from brand blue, IR lime is outside the usable lightness band, and teal cannot clear blue in both modes. A generated hue lands wherever there is room, which is usually next to a colour already in use. Both alternatives are decisions about the data, so the chart warns rather than deciding silently. ### Render the data table visibly where exact values matter, and keep the chart for the shape. **Don't** — Rely on the hover crosshair as the only way to read a number. The crosshair is pointer-only. Someone navigating by keyboard, or reading the page without a pointer, gets the visually-hidden table — which is the right answer for a screen reader and no answer at all for a sighted keyboard user. ## Accessibility - The plot is `aria-hidden` and the numbers are carried by a visually-hidden table, so a screen reader gets the data rather than a shape it cannot see. - `label` is required and becomes the table's caption — it is what the chart is of, in a sentence. - A gap reads as "No data" in the table rather than as an empty cell, which would be indistinguishable from a cell that failed to render. - The legend is always present from two series up and never for one, where the title names the series. Swatches carry identity; the text stays in ink, because a light series colour is illegible as text. - Legend toggles are real buttons with `aria-pressed`, and the last visible series cannot be hidden. - ⚠️ The crosshair is pointer-only. There is no keyboard equivalent yet — see the Do and Don't. - Amber (slot 5) and IR red (slot 2) separate by only ΔE ~7 for protanopia and deuteranopia — inside the floor band, which is legal only with a second channel. The legend, the tooltip's series names and the data table are that channel; a chart stripped of all three should direct-label its lines. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000733-16) — structure from code, measurements from code. [Open in Storybook](/components/?path=/docs/components-chart--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Checkbox An independent yes/no. Several of them are several separate questions. ## Import ```tsx import { Checkbox } from "@ir/ui"; ``` ## Watch out - One departure from the Figma file: ## Variants | Axis | Options | Default | |---|---|---| | `size` | `sm` · `md` | `md` | ## Do and don't ### Use Radio for one-of-many, Checkbox for any-of-many. **Don't** — Use checkboxes for a choice where only one answer is allowed. A checkbox says each option is an independent question. If ticking one should untick another, the control is lying about the shape of the choice. ### Use Switch for an immediate change, Checkbox for something a Save button confirms. **Don't** — Use a Checkbox for something that takes effect immediately. A checkbox reads as a form value — it has been marked, not applied. A switch reads as a live setting. Getting these the wrong way round is how people click Save on a page that already saved. ### Derive it — indeterminate means some children are ticked, never a third thing to choose. **Don't** — Let someone click a parent checkbox into the indeterminate state. Indeterminate is a report, not an option. A three-way cycle on click leaves people unable to tell what they just asked for. ### Wrap it in Field, or pair it with a real label. **Don't** — Leave the label unassociated so only the 20px box is clickable. A 20px target is below every touch guideline, and the label is the part people aim at. Associating it makes the whole phrase clickable. ### Label the positive and let the tick mean yes — "Send notifications". **Don't** — Label it with a negative — "Do not send notifications". A ticked box next to a negative is a double negative, and people have to read it twice to work out what is on. ### Mute it, so disabled reads as disabled whether ticked or not. **Don't** — Leave a disabled checked box painted like a live one. A checked box at full strength invites a click that does nothing. This was a real defect in the Figma component, found while building this one. ## Accessibility - Radix renders a real button with role=checkbox and aria-checked, including "mixed" for indeterminate — the tri-state is announced, not just drawn. - Space toggles; the label is a click target once associated through Field. - aria-invalid colours the box and the focus ring together, so the failure does not depend on noticing one thin border. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=796-60) — structure from figma, measurements from shadcn. [Open in Storybook](/components/?path=/docs/components-checkbox--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Chip A compact token — a filter you toggle, a suggestion you take, or a value you remove. ## Import ```tsx import { Chip } from "@ir/ui"; ``` ## Variants | Axis | Options | Default | |---|---|---| | `selected` | `true` · `false` | — | ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `selected` | `boolean` | | Makes the chip a toggle: renders the check and sets `aria-pressed`. Leave it undefined for a chip that performs an action rather than holding a state — there is nothing to press-and-stay. | | `onRemove` | `() => void` | | Makes the chip a removable token — Figma's old Input chip. ⚠️ This changes the element. A chip is a `<button>` by default, and a button inside a button is invalid HTML that browsers silently unnest, so a removable chip renders as a `<span>` whose ✕ is the only control. That is also the right semantics: the token is not itself an action. | | `removeLabel` | `string` | | Names the ✕ for screen readers. Defaults to "Remove". | ## Do and don't ### Leave the check on — it is what carries selection. **Don't** — Signal that a chip is selected with the fill alone. On hover, focus and press a selected chip takes the same fill as an unselected one. Remove the check and three of the five states stop telling you anything. ### Use `selected` only for something that stays on; leave it off for a one-shot. **Don't** — Set `selected` on a chip that performs an action. `aria-pressed` promises a state that persists. On a chip that just runs a search, it announces a toggle that does not exist. ### Let the ✕ be the only control on it. **Don't** — Make a removable token clickable as a whole as well. A button inside a button is invalid HTML, and a token with two overlapping hit areas is a coin toss for anyone using a pointer imprecisely. ### Name the subject — "Remove probe-04". **Don't** — Ship a row of tokens whose controls are all called "Remove". A screen reader lists controls out of context. Twelve identical "Remove" buttons is twelve coin tosses. ### Use chips for values — filters, tokens, suggestions. Use a Button for a command. **Don't** — Reach for a chip because it is a smaller, rounder button. Chips read as things you are collecting or narrowing by. A verb in a pill just looks like a button that lost an argument with the grid. ### Use a Badge when the point is what something is, not what you are filtering by. **Don't** — Recolour a chip to carry status. Chip is deliberately one neutral ramp. Status lives in Badge, which has the tones and the semantics for it. ## Accessibility - A selectable chip sets aria-pressed — it is a toggle button, not a checkbox, so it announces "pressed" rather than "checked". - The remove button is a separate control with removeLabel as its aria-label: reachable by keyboard without activating the chip itself. - Disabled sets pointer-events-none on the chip and on its remove button, so neither is clickable while both stay readable. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=635-291) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-chip--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Date picker A field-shaped trigger that opens a calendar. ## Import ```tsx import { DatePicker } from "@ir/ui"; ``` ## Variants | Axis | Options | Default | |---|---|---| | `filled` | `true` · `false` | — | ## Do and don't ### Say "Pick a date", and let a real value look different. **Don't** — Show today's date as the placeholder. The only thing separating the two states is the text colour. A date-shaped placeholder reads as a value that has already been chosen. ### Use a format with the month in words. **Don't** — Render 03/04/2026. That date is in March for half the world and April for the other half, and nothing on screen says which. ### Pair it with a field when the range is wide. **Don't** — Make the calendar the only way in for a date far from today. A grid is the fast path for next Tuesday and the slow one for a date two years out. ### Wait for both ends. **Don't** — Close the popover as soon as the first date is clicked in range mode. Half a range is not an answer, and reopening to finish it loses the context of what was already picked. ### Put the rule in the field's description. **Don't** — Silently disable everything before a date. People try the date they want first. If it will not take, they need to know why before they start hunting. ## Accessibility - The trigger is a <button>, not a text input. There is no typed-date path — Enter or Space opens the calendar, which autofocuses, so focus lands where the next keystroke is expected. - The calendar icon is aria-hidden; the trigger's text is its accessible name, so an empty picker needs placeholder text that says what it selects. - In range mode the popover stays open after the first date, because a range is not a complete answer until both ends are in. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=2506-230) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-date-picker--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Dialog A modal for a focused task that interrupts the flow. ## Import ```tsx import { Dialog, DialogTrigger, DialogClose, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter } from "@ir/ui"; ``` ## Watch out - Dialog is NOT built on Overlay / Surface, unlike Popover and DropdownMenu. It shares the card treatment — bg/card, radius/xl, a 1px border/neutral/muted — but carries no shadow and no padding of its own; its three sections own their spacing instead. Written as its own card here rather than fighting the surface variant with overrides, and raised: if the intent is that a modal shares the floating card, the file should say so. The scrim IS shared — it is the same OverlayScrim. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `close` | `boolean` | | The close button in the title row. Off only for a dialog that must be answered. | ## Do and don't ### sm for confirmations, md for short forms, lg for multi-section work. **Don't** — Pick a width by eye. The file assigns each width a job. Anything bigger or longer belongs in a Drawer. ### Keep modals for work that genuinely cannot continue around them. **Don't** — Open a dialog for something the page could say inline. A modal takes the whole screen hostage. Spend that only where the interruption is the point. ### Say what will happen — Delete endpoint, Save changes. **Don't** — Label the buttons OK and Cancel. People read the button, not the paragraph. The verb is where the decision actually gets made. ### Primary last, on the right, paired with a secondary or an outline. **Don't** — Lead with the primary action, or pair it with a ghost button. The eye finishes at the right-hand edge, so that is where the commitment belongs — and a ghost beside it reads as a third-tier action rather than the way out. ### Leave the close on; drop it only when an answer is genuinely required. **Don't** — Remove the close from a dialog people might open by accident. Escape and the close are the same promise. Taking both away traps anyone who opened it by mistake. ### Advance the content in place, or finish the first task. **Don't** — Open a dialog from inside a dialog. Two focus traps and two Escape handlers, and nobody can tell which layer they are answering. ## Accessibility - Radix owns the focus trap, the Escape handler and the aria-modal wiring. A Dialog without a DialogTitle warns in development and leaves the dialog unnamed — give it one even when it is visually hidden. - The close button takes closeLabel as its aria-label; the X glyph is aria-hidden. - Its focus ring is offset against bg/card, not bg/app, because the button sits on the dialog surface. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000392-23689) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-dialog--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Direction DirectionProvider and useDirection: tells every component which way the page reads, for Arabic, Hebrew and Persian. ## Import ```tsx import { DirectionProvider, useDirection } from "@ir/ui"; ``` ## Watch out - `dir="rtl"` on `<html>` is necessary and not sufficient. CSS reads the attribute — logical properties, `.rtl-mirror`, the `rtl:` variant — but Radix does not look at the DOM. It reads direction from this provider, and without it the arrow keys in Tabs, Radio group, Slider and every menu stay left-to-right, and a submenu opens on the wrong side. Set both, once, at the root: ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `direction` | `Direction` | yes | Which way the page reads. Match the `dir` attribute on `<html>`. | ## Do and don't ### Set dir on <html> and wrap the app in DirectionProvider with the same value. **Don't** — Set dir="rtl" on the page and stop there. CSS reads the attribute; Radix reads the provider. With only the attribute the layout mirrors and the keyboard does not, so the arrow that points at the next tab moves to the previous one. ### Provide direction once, at the root, beside the theme. **Don't** — Wrap individual components in their own provider. A page reads one way. A provider halfway down the tree means a portalled menu and the button that opened it can disagree. ### Use a logical class (ps-, start-, border-s) or the rtl: variant, and keep the hook for geometry done in script. **Don't** — Call useDirection to choose between two classes. A logical class costs nothing and cannot disagree with the DOM. The hook is for pointer maths, swipe direction and third-party props that take a direction. ### Put ltr-island on the element that holds it. **Don't** — Let an IP address, a SIP trace, an ID or a metric take the page's direction. Inside right-to-left text the bidi algorithm reorders punctuation: -5% reads as 5%- and 10.0.0.1:5060 comes apart at the colon. ### Mirror what points along the reading direction — chevrons, arrows, panel toggles. Leave check marks, clocks, logos, media controls, charts' time axes and illustrations as they are. **Don't** — Mirror every icon and every picture. A clock running backwards is wrong in every language, and time on a chart runs left to right for everyone who reads monitoring data. ## Accessibility - Direction is half of what a screen reader needs; the other half is lang on <html>. Set both, or Arabic text is read with the wrong voice. - With the provider in place, arrow-key navigation in Tabs, Radio group, Slider and menus follows the visual order in both directions. - DirectionProvider renders no element of its own, so it cannot change the accessibility tree. ## Where it is drawn None — direction is a property of the page, not a component in the library [Open in Storybook](/components/?path=/docs/components-direction--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Distribution chart The shape of a spread rather than its average — latency, jitter, call duration. A mean of 80ms hides whether that is every call at 80 or half at 20 and half at 140. ## Import ```tsx import { DistributionChart } from "@ir/ui"; ``` ## Watch out - The bars touch. A histogram's bins are a continuous axis cut into pieces, so the 2px gap a BarChart puts between categories would be a lie here — there is nothing between 20–40ms and 40–60ms. Only the group edges breathe. - One hue, not six. Every bar is the same series, and the x position already carries the order. Colouring bins by their value would spend the identity channel re-encoding what the axis and the bar height both show. - A marker here is VERTICAL. On a bar chart a threshold is a count — "no more than 20 failures" — and runs across. On a histogram the number anyone cares about is on the measured axis — a p95, an SLA limit — so it runs down. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `values` | `readonly number[]` | yes | The raw samples. Binning is the component's job, not the caller's. | | `bins` | `number` | | How many buckets. The range is widened to round numbers, so the edges read. | | `min` | `number` | | Pin the measured axis. Useful when two distributions are compared. | | `format` | `(v: number) => string` | | Formats a value on the measured axis — "80ms", not "80". | | `xLabel` | `string` | | Names the measured axis for the table. | | `markers` | `readonly DistributionMarker[]` | | Vertical lines: a p95, an SLA limit. | | `label` | `string` | yes | Sentence for the table caption. | ## Do and don't ### Show the distribution, and mark the percentile the SLA is written against. **Don't** — Report a single average for a latency or jitter figure and move on. An average is one number standing in for a shape, and the shapes that matter most are the ones it flattens. A bimodal spread — most calls fine, a tail that is not — has the same mean as a tight one centred on the same value, and only one of them is an outage. ### Let them touch; only the plot edges breathe. **Don't** — Put the bar chart's gap between the bins. A histogram's x axis is continuous and cut into pieces. A gap says there is something between 20–40ms and 40–60ms, and there is not. The gap on a bar chart means the opposite — those categories really are separate things. ### Mark it down the measured axis, where the number anyone quotes actually lives. **Don't** — Draw the threshold across the chart, as a count. On a bar chart a threshold is a count — "no more than 20 failures". On a histogram the counts are incidental; the number in the SLA is on the other axis. A horizontal line here marks a bucket height nobody has an opinion about. ### One series, one colour. **Don't** — Colour the bins by their value so the chart runs through the series palette. Position already carries the order and height already carries the count. Spending the identity channel on a third copy of the same information leaves nothing to tell two distributions apart when they are shown side by side. ## Accessibility - The plot is `aria-hidden`; the bucket counts are carried by a visually-hidden table, one row per bucket with its range as the label. - Each bucket carries its own `title` — the range and the count — so a pointer can read one without a crosshair. - An empty bucket keeps its slot and draws nothing, so a gap in the middle of a spread is visible as a gap rather than closing up. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000764-16) — structure from code, measurements from code. [Open in Storybook](/components/?path=/docs/components-distribution-chart--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Drawer A side panel over a scrim for secondary work — filters, drilldowns, stepping through records. ## Import ```tsx import { Drawer, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerNav, DrawerActions, DrawerBack, DrawerPrevious, DrawerNext, DrawerCounter, DrawerExpand, DrawerCloseButton, DrawerHeading, DrawerIcon, DrawerTitleGroup, DrawerTitle, DrawerDescription, DrawerTabs, DrawerBody, DrawerFooter } from "@ir/ui"; ``` ## Watch out - The two rules are different tokens, as drawn. The header's bottom rule is border/neutral/**subtle**; the footer's top rule is border/neutral/**muted**. Followed rather than evened out, and raised — if the two rules are meant to match, the file is the place to settle it. - Heights run 4px taller than the Figma frames, and this is the Button offset, not a new departure. Figma draws the header's icon buttons at Ghost/icon-sm = 28 and the footer's at md = 32; code's Button is deliberately one step taller at every size (see button.tsx), so icon-sm is 32 and md is 36. Mapping by NAME rather than by pixel keeps a design reading straight into props, so the record header measures 49 rather than 45 and the footer 69 rather than 64. Both are padding-driven here — no fixed height to fight the button. ## Variants | Axis | Options | Default | |---|---|---| | `side` | `end` · `start` · `expanded` | `end` | | `type` | `record` · `title` | `record` | ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `label` | `string` | | The drawer's accessible name, for a drawer with **no** visible `DrawerTitle` — a record header carries a counter, not a title, so it needs one here. Rendered as a screen-reader-only title. ⚠️ Mutually exclusive with `DrawerTitle`. Both render a Radix Title, both Titles get the same id, and the hidden one wins the accessible name — so a drawer with a perfectly good visible title would announce itself as something else entirely. Warns in development. | ## Do and don't ### Use a Dialog for a focused interruption; a Drawer for work the page's context still matters to. **Don't** — Reach for a Drawer because the Dialog felt cramped. A drawer leaves the page visible on purpose. If the page behind is irrelevant, the modal was the right shape. ### Pick Default 480 or Wide 640 for a side panel; Expanded ignores size. **Don't** — Set size="wide" on an expanded drawer. The file draws five variants, not six — Expanded is already the wide one, inset 80 by 40. ### Pass `label` — "Endpoint 3 of 227: probe-04". **Don't** — Ship a record header with no accessible name because it shows a counter instead of a title. "3 of 227" is not a name. Someone arriving by screen reader gets a dialog that will not say what it is. ### One or the other — `label` for record headers, DrawerTitle everywhere else. **Don't** — Set `label` and render a DrawerTitle. Both render a title with the same id and the hidden one wins, so the visible title is silently ignored. ### Keep up and down — they move through the list behind the drawer. **Don't** — Swap the chevrons to left and right because the drawer came in from the right. The arrows describe what moves, and what moves is the selection in a vertical list, not the panel. ### Keep the commitment in the footer, where it stays put while the body scrolls. **Don't** — Scatter Apply and Reset through the body next to the fields they affect. The body scrolls and the footer does not. An action that scrolls out of reach is one people stop finding. ### Primary last, on the right, paired with a secondary or an outline. **Don't** — Lead with the primary action, or pair it with a ghost button. The eye finishes at the right-hand edge, so that is where the commitment belongs — and a ghost beside it reads as a third-tier action rather than the way out. ### Replace the content in place, or step with previous and next. **Don't** — Open a drawer from inside a drawer. Two focus traps and two Escape handlers, and nobody can tell which layer they are answering. ## Accessibility - Built on Radix Dialog, so it is a modal: focus is trapped, Escape closes, and the page behind is inert. - label renders an sr-only DialogTitle. Without it Radix has no accessible name for the drawer and warns in development, so pass it even when the header already shows the name visually. - Every header control — previous, next, expand, close — is an icon-only button taking its own label. The glyphs are all aria-hidden. - The divider between header controls is aria-hidden; it is a drawn line, not a separator anyone needs announced. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=975-94) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-drawer--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Dropdown menu Actions on a thing, opened from a control. ## Import ```tsx import { DropdownMenu, DropdownMenuTrigger, DropdownMenuGroup, DropdownMenuContent, DropdownMenuItem, DropdownMenuShortcut, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent } from "@ir/ui"; ``` ## Watch out - Two inconsistencies in the file, neither acted on: ## Variants | Axis | Options | Default | |---|---|---| | `variant` | `default` · `destructive` | `default` | ## Do and don't ### Use Select for values; menus are for actions. **Don't** — Use a dropdown menu to choose a value for a field. A menu does something when you pick a row. A select stores what you picked — different promises, different keyboard behaviour. ### Leave focus to do the work. **Don't** — Add a hover state to a menu row. Radix moves DOM focus on pointer-over as well as arrow keys, so one state covers both. A second one double-lights the row. ### Put them last, behind a separator. **Don't** — Scatter destructive actions through the list. The pointer travels down the list. A delete sitting mid-list is one slip away from the row above it. ### Only show keys that actually work from that screen. **Don't** — Show a shortcut the app has not bound. A printed shortcut is a promise. People try it once, and stop trusting the menu when it does nothing. ### Flatten, or open a dialog for the complicated case. **Don't** — Nest submenus more than one deep. Each level is another hover corridor to keep the pointer inside, and each one loses people. ## Accessibility - Radix supplies the menu and menuitem roles, typeahead and arrow-key movement. Do not add roles of your own. - Disabled items use data-[disabled] rather than the disabled attribute — they keep pointer-events-none and 50% opacity but stay in the menu, so their existence is still discoverable. - Hover and keyboard focus are one state here, because Radix drives both through data-highlighted. There is no separate :focus-visible treatment to add. - The submenu chevron is aria-hidden; the item's text is its name. - CheckboxItem and RadioItem are deliberately not wrapped — use Radix's directly when a menu needs them, and they bring their own menuitemcheckbox and menuitemradio semantics. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=1146-3028) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-dropdown-menu--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Empty state What a data component shows when it is working and has found nothing — a title, a reason, and the thing to do about it. ## Import ```tsx import { EmptyState } from "@ir/ui"; ``` ## Variants | Axis | Options | Default | |---|---|---| | `size` | `md` · `sm` | `md` | ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `title` | `React.ReactNode` | yes | One line, sentence case, no full stop. | | `description` | `React.ReactNode` | yes | Why it is empty and what would fill it. Required on purpose — see the component notes. | | `illustration` | `IllustrationName` | | The 160 drawing. `md` only; ignored at `sm`. | | `icon` | `React.ReactNode` | | A glyph instead of a drawing — the usual choice at `sm`. | | `action` | `React.ReactNode` | | What to do about it: one Button, or a ButtonGroup for two. | ## Do and don't ### Name what is missing and what would bring it back — "No alerts in the last 24 hours. Widen the time range to see older activity." **Don't** — Ship "No data." The whole component exists for this. A title with no reason leaves the reader unable to tell a working empty list from a broken one, which is why `description` is a required prop rather than an optional one. ### Empty asks for a change to the question; first use asks for setup and says what will appear once it is done. **Don't** — Use one state for both, so a product nobody has set up yet says "No endpoints match your filters". They need different actions. Offering "Clear filters" to someone who has never connected a source sends them looking for a filter that is not there — and implies they broke something. ### Draw what loaded and put an Alert above it naming what did not. **Don't** — Replace the chart with an empty state because one of four sources failed. Partial means there IS something to show. A centred block in place of the data hides the part that worked, which is the "never silently drop a source" rule inverted — now the working sources are the ones dropped. ### Show a Skeleton, and the empty state only once the answer is known to be nothing. **Don't** — Show an empty state while the request is still in flight. An empty state during a load is a wrong answer shown confidently. The guidance prefers a skeleton to a spinner because the layout is already known. ### Use `size="sm"` there — an icon, tighter padding, no drawing. `md` is for a page, a table body or a panel. **Don't** — Put the 160 drawing inside a chart frame or a popover. A drawing larger than the space it is explaining reads as a page that failed rather than a widget with nothing in it. `illustration` is ignored at `sm` so this cannot be got wrong by accident. ## Accessibility - A plain block of text in reading order — no role, so it does not announce itself on mount. - It is NOT a live region. A component that swaps a Skeleton for an empty state should announce that itself, where it knows the request finished; a role="status" here would also fire on first paint. - The illustration is drawn with `label={null}` and `interactive={false}`: the title beside it says the same thing, and nothing in an empty state should answer the pointer. - `icon` is aria-hidden. Everything it suggests is in the title and description. ## Where it is drawn Not drawn in Figma. Built in code first, from docs/content/empty-and-loading-states.md. `Error page` in the file is the nearest component and a different job — 404 and 500 are the app having failed. [Open in Storybook](/components/?path=/docs/components-empty-state--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Field Label, control and message, wired together. The wrapper every form control belongs in. ## Import ```tsx import { Field, FieldLabel, FieldControl, FieldOption, FieldDescription, FieldError } from "@ir/ui"; ``` ## Props ### Field | Prop | Type | Required | What it does | |---|---|---|---| | `invalid` | `boolean` | | Sets aria-invalid on the control and swaps the hint for the error. | | `disabled` | `boolean` | | Disables the control and dims the label and hint. | ### FieldLabel | Prop | Type | Required | What it does | |---|---|---|---| | `required` | `boolean` | | Renders the asterisk and sets required on the control. | | `help` | `React.ReactNode` | | Figma's `Help icon`: a (?) after the label that explains the field in a tooltip. For background — anything needed to answer belongs in the hint. | ### FieldControl | Prop | Type | Required | What it does | |---|---|---|---| | `required` | `boolean` | | Marks the control required, to pair with FieldLabel's asterisk. | ### FieldOption | Prop | Type | Required | What it does | |---|---|---|---| | `control` | `React.ReactElement` | yes | The control the row belongs to — a Checkbox, a Radio, a Switch. | | `children` | `React.ReactNode` | yes | The label. | | `description` | `React.ReactNode` | | A second line under the label. Outside the <label>, so it describes the control rather than becoming part of its name. | ## Do and don't ### Wrap them in Field. **Don't** — Lay out a label, an input and a hint by hand. Hand-laid fields are where htmlFor, aria-describedby and aria-invalid go missing — they are invisible when they are wrong, so nothing catches it. Field generates the ids and hangs the wiring off them. ### Pair every invalid state with a message that says what to do. **Don't** — Set invalid without rendering a FieldError. Invalid with no error leaves a red border and nothing else — and because the hint is swapped out, the field says less than it did when it was valid. ### Let the error replace the hint, and repeat any format detail the error needs. **Don't** — Try to show the hint and the error at once. A screen reader announcing a format hint and a failure together is noisier than announcing the failure. If the format still matters, say it in the error: "MOS is measured to one decimal. Use 3.6." ### Pass required to FieldLabel and FieldControl together. **Don't** — Mark required with an asterisk alone. The asterisk is aria-hidden, because a screen reader reading "star" is not information. aria-required is what carries the fact; the asterisk is its visual half. ### Mark whichever set is smaller — required, or optional. **Don't** — Asterisk every field in a form where all of them are required. A column of asterisks carries no information. If only two fields of twelve are optional, label those two. ### Use it to describe the expected shape — "Letters, digits and hyphens". **Don't** — Use the hint to warn — "Don't use spaces". A hint written as a prohibition reads as an error that has already happened, so people check whether they have done something wrong before they have typed anything. ### Pass disabled to Field. **Don't** — Disable the control and leave the label at full strength. A live-looking label above a dead control reads as a bug. Field dims the label and hint with the control, in one place. ### Use help for background, and the hint for anything needed to fill the field in. **Don't** — Put what someone needs to answer in the help tooltip. A tooltip is hidden until someone thinks to open it, and not at all on touch. The hint is always there. ### Use FieldOption. **Don't** — Lay a Checkbox or Radio beside its label by hand. A hand-laid row leaves the words dead: the control is 16px square, which is under the 24px floor (WCAG 2.2 AA, 2.5.8) and nowhere near a thumb. FieldOption wraps both in one <label>, so the whole row is the target without the control looking any different. ### Put it beside the row. **Don't** — Put a help button or a remove control inside an option row. The row is a <label>, so it forwards every click inside it to its control — a second button there would toggle the checkbox instead of doing its own job. FieldLabel's `help` sits outside the label for the same reason. ## Accessibility - The label is a real <label htmlFor>, so clicking it focuses the control and the hit target includes the text. - FieldError carries role="alert", so the failure is announced when it appears rather than when focus happens to reach the control. - aria-describedby points at the hint while valid and at the error while invalid — never at both, and never at a node that is not rendered. - The required asterisk is aria-hidden; aria-required on the control is what assistive tech reads. - The label names the control; a `description` is wired with aria-describedby instead, so a second line explains the option rather than becoming part of its name. - Row height is 24 everywhere and 44 under (pointer: coarse), so a thumb gets a 44px target without desktop density changing. See docs/foundations/responsive.md. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=705-2117) — structure from figma, measurements from shadcn. [Open in Storybook](/components/?path=/docs/components-field--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # File upload Pick a file, and show chosen files as rows with size and progress. ## Import ```tsx import { formatBytes, FileUploadItem, FileUpload } from "@ir/ui"; ``` ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `size` | `number` | | Bytes. Rendered with formatBytes. | | `progress` | `number` | | 0–100 while uploading; omit when done. | ## Do and don't ### Set accept and name the format and size limit in the hint — 'CSV, up to 10 MB'. **Don't** — Leave the accepted format to trial and error. The picker greys out wrong types, but nothing says why. People need the rule before they go looking. ### Render a FileUploadItem per file, with its size and a remove button. **Don't** — Show only a count once files are chosen. '3 files' cannot be checked. Rows let people spot the wrong one and take it out. ### Let FileUploadItem say Cancel while progress is running and Remove after. **Don't** — Use the same word for stopping an upload and removing a finished file. They have different consequences, and the button's name is what a screen reader announces. ## Accessibility - The native file input stays in the page (visually hidden), labelled by the whole field — so keyboard, accept filtering and form submission all behave natively. - Upload progress is a progressbar named 'Uploading <file>' with aria-valuenow. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000625-568) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-file-upload--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Heatmap One measure across two dimensions — endpoint by time. The fleet view: which hosts were bad, and when, in one picture. ## Import ```tsx import { Heatmap } from "@ir/ui"; ``` ## Watch out - This is the one chart in Picasso that colours by VALUE, and it is the only place the sequential scale belongs. A cell has no length and no height to encode with — colour is the only channel it has, which is exactly the case `chart/scale/1–5` exists for. Everywhere else, colour carries identity and `chart/1–6` are the slots. - Five bins, not a continuous gradient. Nobody reads a colour back to a number off a smooth ramp; they read it to a band. Banding it makes the legend honest and the scale discrete enough to match against. - Light runs light→dark and dark runs dark→light. In dark mode nothing can sit below the surface, so the quiet end has to be the dark end — a scale flipped by `invert()` would put the loudest cells nearest the background. - No data is not zero. A host that reported nothing is drawn as an empty outlined cell, never as the lowest bin, because "fine" and "we don't know" are different answers and only one of them is safe to ignore. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `x` | `readonly string[]` | yes | Column headings — time buckets, usually. | | `min` | `number` | | Pin the scale so two heatmaps can be compared. Defaults to the data. | | `stops` | `readonly number[]` | | Four boundaries cutting the range into five bins. Defaults to equal widths. Pass explicit stops when the thresholds mean something — an SLA band is not a fifth of the range. | | `lowLabel` | `string` | | What the colour means, at each end of the legend. | | `label` | `string` | yes | Sentence for the table caption. | ## Do and don't ### Draw it as an outlined empty cell. **Don't** — Draw a host that reported nothing as the lowest band. "Fine" and "we don't know" are different answers and only one of them is safe to ignore. A silent agent painted the same colour as a healthy one is the failure mode a fleet view exists to prevent. ### Cut the range into five bands and show them in the legend. **Don't** — Interpolate a smooth gradient across the cells. Nobody reads a colour back to a number off a continuous ramp; they read it to a band and then look for that band in the legend. Banding it makes the legend honest, and makes two cells of the same severity actually the same colour. ### Use chart/scale/1–5 — this is the one place colour means magnitude. **Don't** — Reach for chart/1–6 because they are the chart colours. The categorical slots are chosen to be maximally unlike each other, which is the opposite of what an ordered scale needs. A heatmap cell has no length and no height to encode with, so colour is its only channel, and it has to carry order. ### Let the dark mode scale run dark to light, from its own steps. **Don't** — Invert the light scale to get a dark one. Nothing can sit below the surface it is drawn on. In dark mode the quiet end has to be the dark end, so an inverted light scale puts the loudest cells nearest the background and the calmest ones shouting. ## Accessibility - The grid is `aria-hidden`; every value is carried by a visually-hidden table with row and column headers, and a missing value reads as the words "No data". - Each cell carries its own `title` — row, column and value — so a pointer can read one without a tooltip layer. - The legend's bands each carry their numeric range as visually-hidden text, so the mapping from colour to number is available without reading colour. - Row labels truncate with the full name on `title` rather than setting the chart's width. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000765-16) — structure from code, measurements from code. [Open in Storybook](/components/?path=/docs/components-heatmap--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Illustration Product spot illustrations that answer the pointer: lift for a list or a set, magnify for a field of things, sequence for steps that run in order. Ten drawings, recoloured by whichever brand they sit in. ## Import ```tsx import { alertAt, resultAt, widgetAt, magnify, Illustration } from "@ir/ui"; ``` ## Watch out - Two deliberate differences from the Spotkit files. The colours are Picasso semantics, not the `--il-*` preset, so the hairline is `border/neutral/emphasis` and the bars are `bg/layer/emphasis` — one step off the preset's in-between greys. And the glyphs are Lucide, not Phosphor, because Lucide is the only icon library here. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `name` | `IllustrationName` | yes | Which drawing. Each has one mechanic; see the component notes. | | `label` | `string \| null` | | What the picture shows, read by screen readers. `null` hides it from assistive tech — use it when a heading beside it says the same thing. | | `interactive` | `boolean` | | Answer the pointer. Turn off where the picture sits inside the product (an empty state) and should stay still. | | `active` | `boolean` | | Let a parent drive the response instead of the pointer — a list card that owns the hover for the whole card. When set, the picture stops listening: `true` plays the response (lift opens the next item, magnify swells around the flagged shape, sequence runs), `false` holds it at rest. Leave it unset for a picture that answers the pointer itself. | ## Do and don't ### Keep the flat Spotkit drawing and give it one of the three mechanics. **Don't** — Borrow another product's isometric or 3D drawing style to make a figure feel alive. What makes a figure feel alive is that it answers the pointer, not how it is drawn. IR's illustration rule excludes isometric and 3D art, and the mechanics carry across without it. ### Move the one accent: the open alert, the nearest endpoint, the check that is running. **Don't** — Light several shapes in the accent as the pointer passes, or let them accumulate. Spotkit allows the accent on two shapes at most. An accent that spreads stops meaning 'this one'. ### Listen on a layer that stays put, and work out which shape the pointer is on from where the shapes now are. **Don't** — Put the hover handler on the shape that moves. A shape that slides out from under the pointer ends the hover that moved it, and the figure flickers between two states at every edge. ### Say it in the heading and the sentence beside the picture; let the hover only reward a closer look. **Don't** — Show something on hover that the page does not say anywhere else. Nothing in the picture can be reached by keyboard or by touch without a pointer, so anything said only there is said to some people and not others. ### Pass interactive={false} in an empty state. In a list card, pass active from the card's own hover so the card drives the picture. **Don't** — Leave the hover response on for a picture inside the console — an empty state, a dialog — or let a picture in a card listen to the pointer itself. Inside the product a thing that moves under the pointer reads as a control. In a list card the card is the control, so the picture answers the card, never the pointer. ### Set active after the pointer has rested on the whole card for 120ms, and straight away on :focus-visible. Clear it on leave and blur. **Don't** — Set active the moment the pointer enters, or on mouseover of the picture alone. A pointer crossing a list on its way somewhere else should move nothing. The settle is what separates looking at a card from passing over it. ### Set data-brand on the root. The drawing's accent, tint and hairlines are semantics, so they follow the brand's ramp and the neutral's greys. **Don't** — Copy a drawing to recolour it for another brand, or pass it a colour. A brand is a ramp, not a fork. A drawing that needs a colour prop for a new brand is a drawing that has escaped the token system. ### Use transition-illustration for anything that slides, the spring constants in illustration.tsx for anything that swells, and step-end for anything that loops. **Don't** — Give a new drawing its own duration or easing. Three figures side by side read as one set because they move alike. A fourth curve is the first thing the eye picks out. ## Accessibility - The picture is role="img" with an aria-label naming the feature. With label={null} it is aria-hidden, for when the heading beside it already says the same thing. - The response is decoration. Nothing inside the picture is focusable and nothing is conveyed only by it, so a keyboard or screen-reader user misses nothing. In a list card the card takes focus, and focus sets active. - Under prefers-reduced-motion nothing travels: lift changes state without the slide, magnify moves the accent and leaves the radii alone, and sequence does not run. The drawing at rest already says what it means. - The glyphs inside are aria-hidden — the label speaks for the whole picture. ## Where it is drawn Illustration page — component set `Illustration` (node 40000783:32960): Name (ten drawings) × State (Rest, Active). Drawn from code; code is the source of truth [Open in Storybook](/components/?path=/docs/components-illustration--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Components 60 components. Each page is generated from the component's own folder — its `guidance.json`, its doc block and its props — so a change to the code and a change to this page land in the same commit. **53 of 60** are drawn in Figma; the rest were built in code first. **60** carry Do-and-Don't guidance. | Component | What it is for | In Figma | Guidance | |---|---|---|---| | [Accordion](/docs/components/accordion) | Sections that expand in place, for content most people will not need to read. | yes | 5 | | [Alert](/docs/components/alert) | Something the page needs to say about itself, in place — and that stays there. | yes | 7 | | [App shell](/docs/components/app-shell) | The frame every product screen starts from — rail, top bar, page padding. | yes | 9 | | [Avatar](/docs/components/avatar) | A person or tenant, as a picture, initials or a generic mark. | yes | 6 | | [Badge](/docs/components/badge) | A short, static label on a thing — a status, a count, a category. | yes | 6 | | [Bar chart](/docs/components/bar-chart) | A measure compared across categories — calls per site, failures per cause, minutes per region. Grouped, or stacked when the parts make a whole. | yes | 4 | | [Bottom sheet](/docs/components/bottom-sheet) | A panel that rises from the bottom edge over a scrim — the phone-sized answer to a Select, a filter or a sort menu. | yes | 7 | | [Breadcrumb](/docs/components/breadcrumb) | Where the current page sits in the hierarchy — every level but the last is a link. | yes | 5 | | [Button](/docs/components/button) | Triggers an action. Verb first, naming the outcome. | yes | 9 | | [Button group](/docs/components/button-group) | Several buttons that belong to one decision, joined into a single control. | yes | 6 | | [Calendar](/docs/components/calendar) | A month grid for picking a date or a span of them. | yes | 5 | | [Card](/docs/components/card) | A surface that holds one thing, and says so with a border and a little lift. | yes | 8 | | [Chart](/docs/components/chart) | Something measured repeatedly, drawn against time — the workhorse chart: MOS per trunk, latency per site, calls per minute. | yes | 6 | | [Checkbox](/docs/components/checkbox) | An independent yes/no. Several of them are several separate questions. | yes | 6 | | [Chip](/docs/components/chip) | A compact token — a filter you toggle, a suggestion you take, or a value you remove. | yes | 6 | | [Date picker](/docs/components/date-picker) | A field-shaped trigger that opens a calendar. | yes | 5 | | [Dialog](/docs/components/dialog) | A modal for a focused task that interrupts the flow. | yes | 6 | | [Direction](/docs/components/direction) | DirectionProvider and useDirection: tells every component which way the page reads, for Arabic, Hebrew and Persian. | yes | 5 | | [Distribution chart](/docs/components/distribution-chart) | The shape of a spread rather than its average — latency, jitter, call duration. A mean of 80ms hides whether that is every call at 80 or half at 20 and half at 140. | yes | 4 | | [Drawer](/docs/components/drawer) | A side panel over a scrim for secondary work — filters, drilldowns, stepping through records. | yes | 8 | | [Dropdown menu](/docs/components/dropdown-menu) | Actions on a thing, opened from a control. | yes | 5 | | [Empty state](/docs/components/empty-state) | What a data component shows when it is working and has found nothing — a title, a reason, and the thing to do about it. | code first | 5 | | [Field](/docs/components/field) | Label, control and message, wired together. The wrapper every form control belongs in. | yes | 10 | | [File upload](/docs/components/file-upload) | Pick a file, and show chosen files as rows with size and progress. | yes | 3 | | [Heatmap](/docs/components/heatmap) | One measure across two dimensions — endpoint by time. The fleet view: which hosts were bad, and when, in one picture. | yes | 4 | | [Illustration](/docs/components/illustration) | Product spot illustrations that answer the pointer: lift for a list or a set, magnify for a field of things, sequence for steps that run in order. Ten drawings, recoloured by whichever brand they sit in. | yes | 8 | | [Input](/docs/components/input) | A single-line text field. Always paired with a visible label. | yes | 7 | | [Input button](/docs/components/input-button) | A button dressed as a field, for things that open a picker — a date, a filter. | yes | 2 | | [Input group](/docs/components/input-group) | An input with things beside it — an icon, a unit, a spinner, a button. | yes | 5 | | [Kbd](/docs/components/kbd) | Shows a keyboard key or shortcut. Not interactive. | yes | 3 | | [Kpi tile](/docs/components/kpi-tile) | One headline number, with just enough around it to say what it is and whether it is a problem. | yes | 6 | | [List card](/docs/components/list-card) | A row in a list of things a person can open — a badge, a title and a meta line, with an illustration cropped into the trailing corner. | yes | 7 | | [Loader](/docs/components/loader) | Indeterminate wait indicators: spinner for in-console waits, fuse for brand moments, pulse for Iris thinking. | yes | 6 | | [Meter](/docs/components/meter) | A ten-segment bar for a value against a known ceiling. | yes | 4 | | [Number input](/docs/components/number-input) | A number with − / + steppers. For counts and small ranges. | yes | 3 | | [Otp](/docs/components/otp) | A one-time code, entered as one field behind a row of boxes. | yes | 7 | | [Overlay](/docs/components/overlay) | The floating card every anchored or modal panel is built on. | yes | 5 | | [Page footer](/docs/components/page-footer) | The actions that finish a page, under a rule at the end of it — PageHeader's other end. | code first | 4 | | [Page grid](/docs/components/page-grid) | The two grids a product page is made of — tiles that auto-fill, charts that step 1 → 2 → 3 on the content column. | code first | 4 | | [Page header](/docs/components/page-header) | The top of the content area — the page's name, what it is for, and the rule under both. | code first | 5 | | [Password input](/docs/components/password-input) | A password field with a show / hide toggle. | yes | 3 | | [Popover](/docs/components/popover) | A small panel of content or controls, anchored to what opened it. | yes | 5 | | [Progress](/docs/components/progress) | Work in flight, with an end — an upload, an import, a scan. | yes | 5 | | [Radio group](/docs/components/radio-group) | One of many. Unlike a checkbox, it cannot be unticked once ticked. | yes | 5 | | [Segmented control](/docs/components/segmented-control) | A choice that stays selected, as one control: two to five short options on a track, with the current one on a raised thumb. | yes | 5 | | [Select](/docs/components/select) | A searchable, multi-select filter. The trigger keeps its label and shows how many are chosen; nothing applies until Apply. | yes | 5 | | [Separator](/docs/components/separator) | A 1px rule dividing related groups inside one surface. | yes | 5 | | [Sidebar](/docs/components/sidebar) | The app's primary navigation rail — where you are, and what else there is. | yes | 11 | | [Skeleton](/docs/components/skeleton) | The shape of content that has not arrived yet. | yes | 5 | | [Slider](/docs/components/slider) | Pick a value, or a span of values, where the approximate position matters more than the number. | yes | 5 | | [Sparkline](/docs/components/sparkline) | A chart stripped to its shape — one series, no axes, no labels, sized to sit beside the number it summarises. | yes | 5 | | [Stepper](/docs/components/stepper) | Where someone is in a linear flow, and how much of it is left. | yes | 5 | | [Switch](/docs/components/switch) | An immediate change. Flipping it does the thing — nothing is waiting on a Save button. | yes | 6 | | [Table](/docs/components/table) | Rows of the same kind of thing, compared column by column. | yes | 7 | | [Tabs](/docs/components/tabs) | Switch between sibling views of the same object. | yes | 5 | | [Tags input](/docs/components/tags-input) | A field that turns entries into removable chips — hosts, emails, labels. | yes | 3 | | [Textarea](/docs/components/textarea) | For an answer longer than a line. Input's sibling; the same wiring, more room. | yes | 5 | | [Threshold slider](/docs/components/threshold-slider) | Two numbers that decide when a metric stops being fine — and the bands they create. | yes | 5 | | [Toast](/docs/components/toast) | Transient confirmation that something already happened. | yes | 6 | | [Tooltip](/docs/components/tooltip) | A short explanation attached to a control, on hover or focus. | yes | 5 | --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Input button A button dressed as a field, for things that open a picker — a date, a filter. ## Import ```tsx import { InputButton } from "@ir/ui"; ``` ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `icon` | `React.ReactNode` | | Leading icon — Calendar, Filter, … | | `value` | `React.ReactNode` | | What is chosen. Leave empty to show the placeholder. | | `adornment` | `React.ReactNode` | | Something between the value and the chevron — Select puts its count here. | | `hideChevron` | `boolean` | | Hide the trailing chevron. | ## Do and don't ### Use InputButton. **Don't** — Fake a picker trigger with a read-only input. A read-only input is announced as a text field that cannot be edited — the opposite of what it does. A button with aria-expanded says what it is. ### Pass value, and let placeholder render in the placeholder colour when it is empty. **Don't** — Show 'Select…' in the same colour as a chosen value. Empty and filled must be distinguishable at a glance, exactly as they are in an Input. ## Accessibility - A real <button>; set aria-expanded when it controls a popover (Radix triggers do this). The chevron turns with it. - The leading icon is aria-hidden. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000625-566) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-input-button--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Input group An input with things beside it — an icon, a unit, a spinner, a button. ## Import ```tsx import { InputGroup, InputGroupAddon, InputGroupText, InputGroupSpinner, InputGroupCheck, InputGroupTooltip, InputGroupInput } from "@ir/ui"; ``` ## Variants | Axis | Options | Default | |---|---|---| | `size` | `sm` · `md` | `md` | ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `align` | `"start" \| "end"` | | Which side of the input. Purely order — put the addon before or after the input. | ## Do and don't ### Let the group draw the box and keep the input bare. **Don't** — Put a border on the input inside the group. Only then does the focus ring surround the addons too. Draw it on the input and the ring stops at the icon. ### Put it in a trailing text addon, so it stays visible once there is a value. **Don't** — Write the unit into the placeholder — 'Threshold in ms'. A placeholder disappears exactly when the person needs to check what they typed. ### Leave icons out of the tab order; give real controls a label. **Don't** — Make a decorative icon focusable. Every stop in the tab order costs a keyboard user a keystroke. A search icon is not worth one. ### Set aria-invalid or disabled on the input; the group reads it. **Don't** — Pass invalid or disabled to the group as a prop. One source of truth. The thing that is invalid is the value, and the value lives in the input. ### Keep one thing per side, and move the rest out of the field. **Don't** — Stack a unit, a spinner and two buttons into one trailing slot. The field shrinks to fit whatever you put beside it, and a 60px input is not a field any more. ## Accessibility - The group is role="group" and the control inside it is bare. The group reads the inner control's aria-invalid and :disabled through :has(), so the border, the ring and the disabled tokens all follow the real control rather than a prop someone can forget. - This is where invalid lives for Input, Select, Textarea, Number and Password: has-[[aria-invalid=true]]:border-line-input-invalid on the group. The controls themselves add nothing. - Clicking the group focuses the control — but only when the click did not land on a button, link or another field, and only when the control is not disabled. - The spinner is role="status" with an sr-only label, so a busy field announces itself. The check mark has one too. - InputGroupInfo is an icon-only button; its label becomes the aria-label and the Info glyph is aria-hidden. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=958-666) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-input-group--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Input A single-line text field. Always paired with a visible label. ## Import ```tsx import { Input } from "@ir/ui"; ``` ## Watch out - One addition Figma does not have: a read-only treatment. Figma's State axis is Default · Hover · Focus · Filled · Invalid · Disabled, so a read-only field would render identically to an editable one — and this component's own guidance tells people to reach for readOnly instead of disabled. Advice that produces an ambiguous control is not advice, so read-only gets a resting surface and no hover response. Figma needs the matching state. ## Variants | Axis | Options | Default | |---|---|---| | `size` | `sm` · `md` | `md` | ## Do and don't ### Give every input a visible label, and use the placeholder for format. **Don't** — Use the placeholder as the label. A placeholder disappears the moment someone types, so the field loses its name exactly when they are checking their answer. It also fails on autofill, and most placeholder colours do not meet contrast. ### Show the shape of the answer — "SYD-03", "14:30 AEST". **Don't** — Write an instruction in the placeholder — "Enter the probe name". The label already says what the field is. The placeholder's one job is to remove ambiguity about format, which is where people actually get stuck. ### Set aria-invalid and render a message that says what to do. **Don't** — Signal an error with the red border alone. Colour is not available to everyone, and a red border does not say what is wrong. aria-invalid is what a screen reader announces; the border is what a sighted user sees. Both or neither. ### Use readOnly, or render it as text. **Don't** — Disable an input to display a value someone cannot change. A disabled input is skipped by keyboard navigation and often by screen readers, so the value becomes invisible. Disabled means "not available yet"; read-only means "yours to see, not to change". ### Use Select, or Combobox when the set is long. **Don't** — Use an Input when the answer is one of a known set. A free-text field invites typos the system then has to reconcile — this is how "tenant", "Tenant" and "tenat" end up as three values. ### Keep both — border/input/focused and the 2px ring. **Don't** — Remove the focus ring because the border already changes. A 1px border change is not a sufficient focus indicator, and in dark mode it is nearly invisible. The ring is what satisfies SC 2.4.7. ### Pick the size by density — sm in a table row or toolbar, md in a form. **Don't** — Reach for sm to fit more characters. Size changes height and text size, not width. Width comes from the layout, and a 32px field in a form reads as a filter rather than something to fill in. ## Accessibility - Every input needs a programmatic label — a <label htmlFor>, or aria-label when the label is genuinely visual chrome. - Invalid state is aria-invalid, not a prop, so assistive tech gets it at the same time as the border colour. - Do not use the native size attribute for width; it is measured in ex units and does not respond to the theme. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=720-2119) — structure from figma, measurements from shadcn. [Open in Storybook](/components/?path=/docs/components-input--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Kbd Shows a keyboard key or shortcut. Not interactive. ## Import ```tsx import { Kbd, KbdGroup } from "@ir/ui"; ``` ## Variants | Axis | Options | Default | |---|---|---| | `background` | `default` · `neutral` · `brand` · `opaque` · `on-emphasis` | `default` | ## Do and don't ### Keep Kbd on radius/sm. **Don't** — Round Kbd beyond radius/sm. At 20px tall, radius/lg (10px) turns a key cap into a pill and it stops reading as a key. ### Use On Emphasis only inside a filled surface, such as a primary Button. **Don't** — Use On Emphasis on a light surface. Its fill is 18% white over whatever is beneath it; on a light surface it disappears. ### One key per Kbd, wrapped in KbdGroup. **Don't** — Put a whole shortcut in one Kbd ("Ctrl+K"). Each key reads as its own cap, and KbdGroup renders as nested <kbd>, which is the semantic markup for a key combination. ## Accessibility - Renders <kbd>, so assistive tech can identify it as keyboard input. - Icon-only keys (e.g. ⌘) need a text alternative nearby or an aria-label on the Kbd. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=45-2487) — structure from figma, measurements from shadcn. [Open in Storybook](/components/?path=/docs/components-kbd--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Kpi tile One headline number, with just enough around it to say what it is and whether it is a problem. ## Import ```tsx import { KpiTile } from "@ir/ui"; ``` ## Watch out - It is NOT a Card, though it looks like one: Card has border/neutral/muted and shadow/xs, this has border/neutral/subtle and no shadow. A tile sits in a grid of its peers, so it is quieter than a card that stands alone. Faithful to the file — don't "fix" it to match Card. - Status does three things at once, which is Figma's design: it names the badge, colours the badge dot, and colours the meter. The badge is the part that matters — the file's description says it exists "so status never relies on colour alone", which is why the word is not optional when a status is set. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `label` | `React.ReactNode` | yes | What the number is. heading/sm, muted — the number is the loud part. | | `value` | `React.ReactNode` | yes | The headline number. metric/xl. | | `unit` | `React.ReactNode` | | Sits after the value in body/md — "/ 5", "ms", "%". | | `status` | `KpiStatus` | | `none` is the plain KPI. The rest add a badge and a meter. | | `statusLabel` | `string` | | Override the badge wording — the tone's own word is the default. | | `showStatusBadge` | `boolean` | | Hide the badge. Figma's `Show status badge`; think before using it. | | `meter` | `{ value: number; max?: number }` | | Lights the meter. Omit it and no meter is drawn. | | `action` | `React.ReactNode` | | Top-right control — a menu, usually. | | `comparison` | `React.ReactNode` | | Sits under the number: a comparison badge, a delta, a sparkline. | | `footer` | `React.ReactNode` | | Anything below — a progress bar, a footer link. | ## Do and don't ### One number per tile, or use a Card if they belong together. **Don't** — Put two or three numbers in one tile. The tile's whole layout is built to make one figure the loudest thing on it. A second number halves that and neither reads at a glance. ### Name the measure and its scope — "Network MOS", "Endpoints online". **Don't** — Label a tile "MOS" and leave the reader to work out whose. A dashboard is read in one pass. A label that needs the surrounding page to make sense fails the moment the tile is seen on its own. ### Use status where there is a threshold and a response. **Don't** — Set a status on a tile nobody would act on. A status badge is a claim that something needs attention. On a number that is merely interesting it trains people to ignore the badge everywhere. ### Put "4.0" in the value and "/ 5" in the unit. **Don't** — Write "4.0 / 5" as the value. The value is set in the metric face at 30px and the unit in body at 14px. Rolling them together makes the qualifier as loud as the figure. ### Use status unknown and an em dash for the value. **Don't** — Show 0 when a probe has stopped reporting. Zero is a measurement. A tile showing 0 for a dead probe is stating something false, and someone will act on it. ### Use them in a row or grid of peers, at equal width. **Don't** — Mix tile widths, or drop one tile into a page on its own. The quiet border and missing shadow are tuned for a set. A single tile on a page reads as an unfinished card. ## Accessibility - The meter is aria-hidden decoration. The number and the status badge are the accessible content — which is why the badge's word is not optional, and why status never relies on the meter's colour alone. - The label is a <div>, not a heading. A grid of tiles that should appear in the page outline needs headings supplied around them. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000388-23522) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-kpi-tile--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # List card A row in a list of things a person can open — a badge, a title and a meta line, with an illustration cropped into the trailing corner. ## Import ```tsx import { ListCard } from "@ir/ui"; ``` ## Watch out - **The card is the control, and that is what licenses the motion.** It is the one place a picture moves inside the console (see "List cards" in `docs/foundations/motion.md`). The picture listens to nothing: the card owns the hover and passes `active`, so a drawing can never answer a pointer the card is not answering. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `title` | `React.ReactNode` | yes | One line. Sentence case, no full stop. Truncates rather than wraps. | | `meta` | `React.ReactNode` | | The qualifying line — what it is, how many, when. Truncates. | | `badge` | `React.ReactNode` | | A short kind or status. Omit it rather than inventing one. | | `illustration` | `IllustrationName` | yes | Which drawing. Pick it for what it shows, not for how it moves. | | `asChild` | `boolean` | | Hand the row to a router link. Pass the link as the only child and leave it empty — the card's own content is slotted inside it: `<ListCard asChild …><Link href="/fleets/sydney" /></ListCard>`. | ## Do and don't ### Leave `interactive` alone and let the card pass `active`. **Don't** — Let the illustration answer the pointer itself inside a card. Two things listening to one pointer means the picture can play while the card is not highlighted, and a picture that responds reads as a control. The card is what opens; the picture answers the card. ### Let the 120ms dwell do its job — a pointer crossing a list on its way somewhere else moves nothing. **Don't** — Start the drawing the instant the pointer touches the row. A list is mostly crossed, not read. Firing on entry turns a scroll past six rows into six animations, which is the flicker that makes people turn motion off. ### Change the border and leave the card where it is. **Don't** — Add a shadow or a raise on hover. Rows sit a 2-gap apart, so a hover shadow lands on the card below — a visual artefact signalling something the border already says. Measured on Claude's own cards: border and background only, no movement at all. Not drawn: the wrong side needs a class the component refuses (a shadow, a wrapping title), and a mock-up would be a picture of something the library will not let you build. ### One line, truncated, with the full name available where the card opens. **Don't** — Let a long title wrap and push the row taller than its neighbours. A list is read by scanning down one edge. A row that grows breaks the rhythm the scan depends on, and the names that overflow are usually the ones that differ only at the end. Not drawn: the wrong side needs a class the component refuses (a shadow, a wrapping title), and a mock-up would be a picture of something the library will not let you build. ### Name the kind of thing this is — "Alert rule", "Fleet", "Report" — and put the count in the meta line. **Don't** — Put status prose in the badge — "3 sites need attention". The badge is how someone tells one row's type from another at a glance. A sentence there competes with the title and stops the column reading as a column. ### Choose it for what it depicts — a fleet of endpoints is `fleet-health`, a dependency run is `call-readiness`. **Don't** — Choose an illustration because you like how it moves. The mechanic follows the subject, not the other way round. A list where the picture does not match the thing teaches people the pictures are decoration, and then they stop looking at them. ### Leave the art `aria-hidden` — the card already has one accessible name. **Don't** — Give the illustration its own label as well as the title. A screen reader reading a row twice, once as a picture and once as a title, doubles the length of every list. The picture says nothing the title does not. ## Accessibility - One target and one accessible name: the anchor, named by its title and meta line. - The art is aria-hidden and the drawing takes `label={null}`. Nothing is said only by the picture. - Focus turns the picture on immediately — there is nothing to settle, because arriving by keyboard is already deliberate. - The focus ring is the system's: 2px `ring/focused` with a 2px offset on the app surface, so it reads against both the card and the page. - Under `prefers-reduced-motion` the rise and the colour transition are both off; the drawing holds at rest and still says what it means. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000781-117) — structure from figma, measurements from code. [Open in Storybook](/components/?path=/docs/components-list-card--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Loader Indeterminate wait indicators: spinner for in-console waits, fuse for brand moments, pulse for Iris thinking. ## Import ```tsx import { Loader } from "@ir/ui"; ``` ## Props Takes the props of the element it renders, and nothing of its own — styling is the component's business, not the caller's. ## Do and don't ### Use Skeleton when the shape is known; keep the spinner for small regions with nothing to stand in for. **Don't** — Put a spinner where you already know the layout that is coming. A skeleton promises the layout and stops the page jumping. A spinner only says 'wait'. ### Keep Fuse for app boot, the widget's first run and empty states — one on screen, at least 56px. **Don't** — Use Fuse for a table refresh or anywhere inside the console. It is slow, large and carries IR red, which means critical everywhere else in Clarion. It also repaints every frame. ### Name the work: "Bringing your fleet online", "Iris is thinking". **Don't** — Label it "Loading". The label is the only thing a screen reader hears, and 'Loading' tells the person nothing. ### Pass label={null} so it is announced once. **Don't** — Leave the label on when visible text beside the loader says the same thing. Hearing the same sentence twice reads as a bug. ### Rely on the show delay (Pulse waits 400ms by default; set delay for others). **Don't** — Show a loader for a wait that usually ends in 300ms. A loader that appears and vanishes reads as a glitch, not as work. ### Use the button's loading state. **Don't** — Put a Loader next to a button while it saves. The action and its progress belong in the same place. ## Accessibility - A loader with text is role="status" with aria-live="polite" and the text in an sr-only span. A loader without text is aria-hidden, because an unlabelled live region announces an interruption that says nothing. - Every animation stops under prefers-reduced-motion — but substitutes rather than deletes. Travel becomes a fade, because a spinner that simply stops looks broken rather than busy. - The SVG filter that gives Fuse its gooey merge is aria-hidden and its id is generated with useId, so two loaders on one page cannot collide. ## Where it is drawn Loader (Variant = Spinner · Fuse · Pulse) [Open in Storybook](/components/?path=/docs/components-loader--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Meter A ten-segment bar for a value against a known ceiling. ## Import ```tsx import { litSegments, Meter } from "@ir/ui"; ``` ## Watch out - Figma: "Decorative on its own — always pair with a visible value." So this is `aria-hidden` and carries no ARIA value of its own. The number beside it is what a screen reader reads, and duplicating it here would announce the same figure twice. If you ever use a Meter *without* a visible value, give it `role="meter"` and the aria-* attributes yourself — but the design says don't. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `max` | `number` | | The ceiling the value is measured against. MOS is out of 5. | ## Do and don't ### Always pair it with the number it represents. **Don't** — Show a meter on its own and expect it to carry the value. It moves in 20% steps, so it cannot tell you 3.4 from 3.9 — and it is hidden from screen readers, so on its own it says nothing at all. ### Use Progress for work in flight; a meter is for a reading. **Don't** — Use a meter for something that is completing — an upload, an import. Progress implies an end state and a direction. A meter is a measurement that can go back down. ### Use it where the maximum is real and known — MOS out of 5, a score out of 100. **Don't** — Use a meter for an unbounded number like calls per hour. The bar is a fraction of something. With an invented ceiling, the fill is an opinion rather than a measurement. ### Pass status unknown, so nothing lights and the value reads "—". **Don't** — Draw an empty-looking meter when there is no reading. A meter at zero says the measurement is zero. No reading and a reading of nothing are different facts. ## Accessibility - The meter is aria-hidden and carries no ARIA value of its own, because it is drawn beside a number that already says the value. - For a standalone meter with no visible number, give it role="meter" and the aria-value* attributes yourself. The component does not guess. - The unknown and neutral statuses are a colour difference only. If the distinction matters, the surrounding component has to say it in words. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=1462-1192) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-meter--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Number input A number with − / + steppers. For counts and small ranges. ## Import ```tsx import { NumberInput } from "@ir/ui"; ``` ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `onValueChange` | `(value: number \| null) => void` | | Called with the parsed, clamped number — or null when the field is empty. | ## Do and don't ### Use Input with inputMode='numeric'. **Don't** — Use it for things that are digits but not quantities — a port, a PIN, a phone number. Nobody increments a port. Steppers on an identifier invite an off-by-one that looks deliberate. ### Set min and max, so the steppers stop and blur clamps. **Don't** — Validate the range afterwards with an error message. A disabled + at the maximum says where the limit is before anyone hits it. ### Name the unit in the label — 'Timeout (seconds)'. **Don't** — Put the unit in the label only when the value is ambiguous. 3 what? Minutes and seconds differ by 60×, and the steppers make the number look precise. ## Accessibility - role=spinbutton with aria-valuenow / min / max — what a native number input would announce, without its scroll-wheel and 'e' problems. - ArrowUp/Down step, PageUp/Down step ×10, Home/End jump to the bounds. - The steppers are tabIndex -1: keyboard users have the arrows, and two extra tab stops per field is a tax on every form. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000625-565) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-number-input--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Otp A one-time code, entered as one field behind a row of boxes. ## Import ```tsx import { OtpInput, OtpSlot, OtpSeparator } from "@ir/ui"; ``` ## Watch out - No caret. Figma draws the active slot empty, with the ring and the focused border as the only marker, so that is what this renders — `input-otp` offers a fake caret and it is deliberately not used. The ring is strong enough to place you, but a blinking caret is the more usual signal and worth a decision. ## Variants | Axis | Options | Default | |---|---|---| | `size` | `sm` · `md` · `lg` | `md` | | `active` | `true` · `false` | — | | `invalid` | `true` · `false` | — | ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `size` | `OtpSize` | | Shadows the DOM `size` attribute, which on an `<input>` is a character count and means nothing here — the boxes are separate elements. Omitted from the underlying props rather than renamed, so the Figma axis keeps its name. | | `invalid` | `boolean` | | Mirrors the field family: sets `aria-invalid` as well as the treatment. | ## Do and don't ### Keep the single field this component is built on. **Don't** — Build the row as one input per digit. Six inputs are six tab stops, six paste targets and a pile of focus-shuffling code — and screen readers announce six unlabelled boxes instead of one code. ### Accept a pasted code and spread it across the slots. **Don't** — Block paste to keep the boxes tidy. The code arrives in another app. Pasting is how almost everyone enters it, and blocking it makes people retype from memory. ### Say what went wrong and offer a resend. **Don't** — Turn the boxes red and stop there. A wrong code is usually an expired one. Without a resend the only option is to start the whole flow again. ### Name the destination — "sent to •••• 4821". **Don't** — Ask for the code with no context. People check the wrong device otherwise, and there is no way to tell a delayed code from one sent somewhere they cannot reach. ### Show them. **Don't** — Mask the digits. A one-time code is short-lived and is being copied from another screen. Masking it removes the only way to check it was typed correctly. ### Use md below about 420 of column. **Don't** — Use size="lg" on a phone. Six lg slots are 56 each with an 8 gap, so the row needs 376 before any page padding — measured at 376 against a 360 column. md is 48 and fits at 328. The slots do not shrink on purpose: a code you cannot read is worse than one you have to scroll to. ### Drop to sm below md. **Don't** — Keep md on a phone and let the row scroll or spill. Six md boxes are 352 wide with their separator and gaps, and a 360 phone leaves 328 after its gutters. sm is 304. A code is checked against another screen while it is typed, so a row that scrolls hides the digits being compared. ## Accessibility - Active is a data state rather than :focus-visible, because the real focus lives on a single hidden input while the visible slot that should look active is a different element. - invalid sets aria-invalid on the input as well as the treatment, so the error reaches assistive technology and not only the eye. - A disabled field has no active slot at all — there is nothing to point at when nothing is editable. - The caret is aria-hidden. Position is conveyed by the input's own selection, not by the drawn bar. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=673-24) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-otp--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Overlay The floating card every anchored or modal panel is built on. ## Import ```tsx import { OverlaySurface, OverlayScrim } from "@ir/ui"; ``` ## Watch out - In Figma neither variant is attached to an effect *style* — both carry raw effects. The values are byte-identical to `shadow/md` and `shadow/lg` (same radii, offsets and alphas; only the two drop shadows are listed in the opposite order), so it looks right today and would silently stop matching if the shadow scale ever moved. Bound to the tokens here. Raised for the file. ## Variants | Axis | Options | Default | |---|---|---| | `density` | `compact` · `comfortable` | `compact` | ## Do and don't ### Change the surface, and let all of them move together. **Don't** — Restyle the panel inside Popover, Dropdown menu or Dialog. The file says so in as many words. Four near-identical floating cards is how a system stops looking like one system. ### Compact for rows, comfortable for prose. **Don't** — Use comfortable for a list of menu rows. Compact's 4px padding lets a row's own padding reach the edge; comfortable's 16 gives paragraphs room. ### Put overlaySurfaceVariants on the Content element itself. **Don't** — Wrap Radix's Content in a styled div. Radix positions and animates that node. A wrapper leaves the shadow behind when it moves and breaks the exit animation. ### Trap focus and label the panel; the scrim is decoration. **Don't** — Rely on dimming to say something is modal. A screen reader never sees the dimming. What makes a dialog modal is that nothing behind it can be reached. ### Save the scrim for dialogs and drawers. **Don't** — Dim the page behind a popover or a menu. A scrim says "finish this first". A menu you can dismiss by looking away is not making that demand. ## Accessibility - The scrim is aria-hidden. It is a dimming surface, not a control, and the dialog or drawer above it owns the modal semantics. - Overlay supplies no roles of its own. Everything built on it — Dialog, Drawer — brings its own Radix primitive and its own accessible name. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000241-48) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-overlay--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Page footer The actions that finish a page, under a rule at the end of it — PageHeader's other end. ## Import ```tsx import { PageFooter } from "@ir/ui"; ``` ## Props Takes the props of the element it renders, and nothing of its own — styling is the component's business, not the caller's. ## Do and don't ### Cancel first, the primary at the inline end. **Don't** — Lead with the primary and put Cancel after it. Dialog, Drawer and Card all put the primary at the end, so a person who has learned where Save is in one of them has learned it everywhere. Reversing it on page forms means the product disagrees with itself about which side finishes a job. ### Pair it with the secondary or the outline. **Don't** — Pair the primary with a ghost button. A ghost reads as a tertiary action, so Cancel stops looking like the other half of a pair and starts looking optional. Same ruling as Dialog and Drawer footers, 29 Sept. ### Keep it to the actions that finish the page. **Don't** — Park a record count, a last-saved time or a filter in it because there is room. The rule above it says everything over this line is the page and everything under it ends the page. Anything else in the row makes the reader check whether it is a control before they can act, which is the whole cost the rule was drawn to avoid. It is also the one pair here that cannot be drawn: the linter refuses justify-between on PageFooter, which is the rule doing its job. ### Keep the footer inside the content column, so it ends where the form ends. **Don't** — Right-align the buttons to the page on a fluid or standard page. A form page is width="reading", so the column caps at 768 and the buttons land a bounded distance from the last field. Put the footer outside that column on a 2560 monitor and the submit sits 1500px from the thing it submits. ## Accessibility - A plain <div>, not a <footer>: a footer element inside <main> is a generic element anyway, and the page's real contentinfo — if a product has one — is the shell's. - The rule is a border, so nothing is announced for a line that carries no meaning of its own. - Order in the DOM is order in the tab ring, and it is the order drawn: Cancel reached before the primary. Nothing is reordered visually. ## Where it is drawn Not drawn in Figma yet. Measured off the Ops Console provisioning portal's Create tenant and Provision product pages: a rule across the form column, the buttons flush to its end edge ~24 under it, primary last. DrawerFooter is the nearest drawn equivalent. [Open in Storybook](/components/?path=/docs/components-page-footer--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Page grid The two grids a product page is made of — tiles that auto-fill, charts that step 1 → 2 → 3 on the content column. ## Import ```tsx import { KpiRow, ChartGrid } from "@ir/ui"; ``` ## Props Takes the props of the element it renders, and nothing of its own — styling is the component's business, not the caller's. ## Do and don't ### Use KpiRow and ChartGrid. **Don't** — Write grid grid-cols-tiles gap-gutter, or grid-cols-1 @3xl:grid-cols-2 @7xl:grid-cols-3, by hand on a page. The rule used to live only in a sentence, so every product re-derived it and could drift without anyone noticing. A rule in a component is a rule that runs. ### Let the grid answer to its container. **Don't** — Reach for xl: or 2xl: inside the content column. The viewport knows nothing about the rail, the page padding, a width cap or an open drawer. The same grid gets 976 at a 1280 viewport with the rail open and 1184 with it collapsed, so a viewport breakpoint is wrong at the width the grid was actually given. ### Put it beside the grid. **Don't** — Put a table or a time series in a ChartGrid. Tables and time series take the full row at every width — they are not one of three columns, they are the row. A cell that must always span every column is not a cell. ### Give the chart a fixed height range, 240–320. **Don't** — Give the grid an aspect ratio so the charts scale with it. An aspect ratio makes a chart grow tall on a wide screen, which nobody asked for. The grid sets columns and gap; height is the chart's own business. ## Accessibility - Both are presentational containers — they add no role and no landmark, so the tiles and cards inside keep whatever semantics they came with. - Column count changes with the container, not with a media query, so a zoomed page reflows the same way a narrow one does. Reflow at 400% is a container question here, which is the point. ## Where it is drawn Not drawn in Figma. KpiRow and ChartGrid were built in code first; the reflow rule they implement is documented on the App shell page (section 'Content width — wide screens', 40000622:1068), which is a docs section rather than a component. [Open in Storybook](/components/?path=/docs/components-page-grid--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Page header The top of the content area — the page's name, what it is for, and the rule under both. ## Import ```tsx import { PageHeader } from "@ir/ui"; ``` ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `title` | `React.ReactNode` | yes | The page's name. Sentence case, no full stop. Renders the page's `h1`. | | `description` | `React.ReactNode` | | What the page is for, in a line or two. Capped at the reading width. Leave it out rather than restating the title. | | `divider` | `boolean` | | The rule under the header. On by default. | ## Do and don't ### One PageHeader at the top; sections below are headings, not page headers. **Don't** — Give every panel on the page its own PageHeader. The component renders the page's h1, and a page has one. A second one tells a screen reader the page started again, and visually it sets two things at 30px competing to be the name of the screen. Section titles are heading/lg on an h2. ### Leave the bar to the sidebar toggle and the breadcrumb, and name the page here. **Don't** — Put the page title in the 48 top bar next to the breadcrumb. The bar is the same 48 on every screen in the product. Everything added to it competes with the breadcrumb, which is the one thing that says where you are — and the title repeats what the last breadcrumb item already said. ### Say what is in scope and what changing it does — or leave the description out. **Don't** — Write "This page shows information about your notification settings." A description that restates the title costs a line and a reading pause and returns nothing. The ones worth having answer a question the title raises: what does this cover, when does it take effect, who does it reach. ### Nothing — it caps itself at the reading width, 768. **Don't** — Let the description run the width of a fluid dashboard. A fluid page hands the column 2256 at a 2560 monitor. A line of prose that long is hard to track back to its start, which is why width="reading" exists for forms; the cap is on the description so a dashboard does not have to choose between a wide grid and a readable sentence. ### divider={false} where the next thing already has a top edge. **Don't** — Keep the rule when a full-bleed table or a single card starts 24 below it. Two horizontal lines 24 apart with nothing between them read as a mistake rather than as structure. The rule is there to separate the page's name from the page; when the page starts with its own border, that separation is already drawn. ## Accessibility - The title is the page's <h1>, and the only one. Section titles below are <h2> at heading/lg. - PageHeader renders a <header>, but it sits inside AppShellContent's <main>, where <header> is a generic element rather than a second banner. The banner is AppShellHeader. Put PageHeader outside the content area and you get two banners. - The rule is a border on the header, not an <hr>, so nothing is announced for a line that carries no meaning of its own. ## Where it is drawn Not drawn in Figma yet. Built in code from the App shell Rules (40000390:30181), which place the page title and page actions in the page header inside the content area. The App shell page's own 'Page heading' is a text node standing in for this component. [Open in Storybook](/components/?path=/docs/components-page-header--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Password input A password field with a show / hide toggle. ## Import ```tsx import { PasswordInput } from "@ir/ui"; ``` ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `showLabel` | `string` | | Accessible names for the eye button, e.g. to localise. | ## Do and don't ### Use PasswordInput, which has the eye built in. **Don't** — Ship a password field without a way to see what was typed. Typing blind is the main cause of failed sign-ins and mistyped new passwords. Seeing it once fixes both. ### Set autoComplete='new-password' there. **Don't** — Leave autocomplete as current-password on a 'choose a password' field. It is the signal password managers use to offer a strong generated password instead of filling an old one. ### Let people reveal what they typed. **Don't** — Add a 'Confirm password' field. Retyping a password twice checks memory, not accuracy. The eye checks accuracy directly. ## Accessibility - The eye is a button with aria-pressed and a label that says what it will do: 'Show password' / 'Hide password'. - Autocorrect, autocapitalise and spellcheck are off, so a revealed password is not 'corrected'. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000625-564) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-password-input--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Popover A small panel of content or controls, anchored to what opened it. ## Import ```tsx import { Popover, PopoverTrigger, PopoverAnchor, PopoverContent, PopoverHeader, PopoverTitle, PopoverDescription, PopoverClose } from "@ir/ui"; ``` ## Watch out - `sideOffset` is 8, which Figma does not specify — a floating panel's distance from its trigger is not something a static frame can show. 8 matches what Select already uses for its menu. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `surface` | `boolean` | | Off for content that is already a surface of its own — a Calendar, say, which draws its own card, border and padding. Two cards nested inside each other produce a double border and doubled inset, and stripping the outer one from the call site is what `no-restyle` refuses (rightly), so it is a prop instead. Positioning, portalling and z-index stay; only the card goes. | ## Do and don't ### Use Tooltip for explaining, Popover for content you interact with. **Don't** — Use a popover for a one-line explanation on hover. A popover takes focus and waits to be dismissed. That is too much ceremony for a sentence. ### Use Dialog when the answer matters and the page must wait. **Don't** — Put a destructive confirmation in a popover. A popover closes when you click away, so "are you sure?" can be dismissed by accident. ### Add PopoverHeader with a title, or an aria-label on the content. **Don't** — Open a panel of controls with no title. Radix does not name a popover for you the way it does a dialog. Without one a screen reader announces an unnamed group. ### Let the trigger be the anchor, or use PopoverAnchor deliberately. **Don't** — Anchor to a container when a specific control opened it. A panel that appears away from the thing you clicked reads as unrelated to it. ### Put the second step in the same panel, or use a dialog. **Don't** — Open a popover from inside a popover. Stacked dismiss-on-outside-click layers make Escape ambiguous and strand focus. ## Accessibility - The panel points aria-labelledby and aria-describedby at its title and description, but only when those parts are actually present. A popover with neither is unnamed, which is correct for one that holds a single control. - Both ids come from useId, so two popovers on a page never collide. - Radix handles focus movement into the panel and back to the trigger on close; do not manage focus yourself. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=2298-11200) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-popover--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Progress Work in flight, with an end — an upload, an import, a scan. ## Import ```tsx import { Progress } from "@ir/ui"; ``` ## Watch out - The track was drawn on bg/neutral/subtle. That is neutral-50 in light — the app background itself, and one step off a white card — so the track vanished and the bar had no visible end: 40% read as a short bar, not as 40% of something. Corrected to bg/layer/emphasis: a translucent tint that reads the same on the page, on a card and in both modes, which is what a thin track needs — bg/neutral/muted (one step past subtle since 2 Oct) is still only 1.05 on the page in light. A resting track also should not borrow a state word like "pressed". Slider, Meter and File upload take the same token. Figma corrected to match. ## Variants | Axis | Options | Default | |---|---|---| | `variant` | `brand` · `neutral` | `brand` | ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `value` | `number \| null` | | 0–100. Leave undefined for work of unknown length — see the note below. | | `label` | `React.ReactNode` | | The left-hand label. Its presence is what draws the label row. | | `valueLabel` | `React.ReactNode` | | The right-hand label. Defaults to the percentage when a label is set. | ## Do and don't ### Use Meter for a measurement; Progress is for something finishing. **Don't** — Use a progress bar for a reading like MOS or disk usage. Progress implies a direction and an end. A value that can go back down reads as work being undone. ### Pass value={null} until you know, so it announces as indeterminate. **Don't** — Show 0% while waiting for the server to say how much there is. 0% is a claim that nothing has happened yet. Usually something has — you just cannot measure it. ### Show real progress, or an indeterminate bar, or nothing. **Don't** — Animate a bar to 90% and hold it there while you wait. A bar that stalls near the end is worse than no bar: it makes a promise about time and then visibly breaks it. ### Name the work, and give a count when you have one. **Don't** — Show a bare bar with no idea what it is doing. A percentage answers "how far", never "how long" or "of what". "420 of 1,000 endpoints" answers all three. ### Show one bar for the batch, and per-item state as text. **Don't** — Stack a progress bar per item in a list of fifty. Fifty animating bars are a texture, not information, and they cost more to render than the work being measured. ## Accessibility - Radix puts role="progressbar" and the aria-value* attributes on the root, and omits aria-valuenow when value is null — which is exactly how an indeterminate progress bar should read. - Pass null rather than 0 for work of unknown length. Zero means "started, nothing done"; null means "no idea", and they announce differently. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=2298-15158) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-progress--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Radio group One of many. Unlike a checkbox, it cannot be unticked once ticked. ## Import ```tsx import { RadioGroup, Radio } from "@ir/ui"; ``` ## Watch out - Figma's 1.5px border **cannot render in a browser.** Chrome floors a fractional border width to 1px, in plain CSS, at every pixel ratio (measured: `border:1.5px` and `border:1px` give identical layout and identical computed values at DPR 1 and 2). 1px is not a change from the spec — it is the only form the spec can take on the web. ## Variants | Axis | Options | Default | |---|---|---| | `size` | `sm` · `md` | `md` | ## Do and don't ### Either preselect a sensible default, or add an explicit "None" option. **Don't** — Offer a radio group with no default and no way to choose nothing. A radio cannot be unticked by the person who ticked it. Without a default or a None, someone who clicks by accident is stuck with a value they never wanted and no way back. ### Use Checkbox for any-of-many. **Don't** — Use a radio group for options that are not mutually exclusive. The control is a promise about the shape of the choice. A radio says picking this un-picks that, and if that is not true the form will fight people. ### Use a Switch, or a single Checkbox. **Don't** — Use two radios for on and off. "On / Off" as two radios takes twice the space to say the same thing, and makes the reader compare two labels to find the one difference. ### Use Select past about seven options. **Don't** — List fifteen radios. Radios are for a set you can take in at a glance and compare. Past that they are a list that happens to be circular, and a Select costs one click to show the same thing. ### Order them by what they mean — severity, frequency, or least to most. **Don't** — Order the options by how they arrived in the API. People read a radio group as a scale whether or not you intended one. An arbitrary order invites them to infer a ranking that is not there. ## Accessibility - Radix renders a real radiogroup: arrow keys move between options and wrap, and the group is a single tab stop. - The group needs a name — wrap it in a Field with a FieldLabel, or give the RadioGroup an aria-label. - aria-invalid goes on the item, and colours the border and focus ring together. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=798-32) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-radio-group--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Segmented control A choice that stays selected, as one control: two to five short options on a track, with the current one on a raised thumb. ## Import ```tsx import { SegmentedControl, SegmentedControlItem } from "@ir/ui"; ``` ## Props Takes the props of the element it renders, and nothing of its own — styling is the component's business, not the caller's. ## Do and don't ### Use a SegmentedControl when one option stays selected. **Don't** — Use a ButtonGroup with one button styled as selected. Nothing in a ButtonGroup stays pressed, so a faked selected state reads as two different buttons. The thumb on a track says one of these is the current value. ### Start with one option selected. **Don't** — Leave the control with nothing selected. It is a radio group: once something is chosen there is no way back to nothing, and an empty track looks broken rather than unanswered. ### Keep it to two to five short labels. Beyond that, use Select or a RadioGroup. **Don't** — Put six options, or labels that need a sentence, on one track. Every option shares one row. Past five, or with long labels, the segments get too narrow to read or the control overflows on a phone. ### Use Tabs when each option shows a different panel. **Don't** — Use it to switch between panels of different content. A segmented control sets a value and is announced as a radio group. Tabs own a panel each and are announced as tabs. The two look alike and promise different things. ### Give it an aria-label, or a visible label beside it: "Order", "View". **Don't** — Leave the control without a name. "Ascending, radio, 1 of 2" does not say what is being ordered. The group's name supplies it. ## Accessibility - role="radiogroup" with role="radio" items, so it is announced as one choice with a position: "Ascending, radio, 1 of 2". - One tab stop. Left and Right arrows move the selection, as in any radio group. - It needs a name: aria-label on the control, or aria-labelledby pointing at a visible label. - Selection is carried by the thumb and by the label's colour, not by colour alone. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000682-211) — structure from code, measurements from code. [Open in Storybook](/components/?path=/docs/components-segmented-control--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Select A searchable, multi-select filter. The trigger keeps its label and shows how many are chosen; nothing applies until Apply. ## Import ```tsx import { Select } from "@ir/ui"; ``` ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `onValueChange` | `(value: string[]) => void` | | Called once, on Apply (or Clear + Apply), with the new selection. | | `label` | `string` | yes | The trigger's label. It stays put when things are selected — the count says how many. | | `showDetail` | `boolean` | | Show each option's detail (or value) on the right. | ## Do and don't ### Keep the label ('Filter actions…') and let the count badge say how many. **Don't** — Replace the trigger's label with the chosen values. Three values will not fit a 240px trigger, and a truncated list reads as one value. The label says what the filter is; the count says it is on. ### Collect ticks in a draft and commit once on Apply. **Don't** — Apply each tick as it happens. Every tick in a filter re-queries the table behind it. Four live ticks are four reloads and a table jumping under the cursor. ### Treat closing without Apply as Cancel. **Don't** — Keep a half-finished draft after Escape or a click away. Someone who closes the menu without applying has changed their mind. Keeping the draft surprises them the next time they open it. ### Give options a group, and let search do the rest. **Don't** — Show 30 options as one flat list. Group labels turn scanning into skipping. Past about eight options, people search rather than scroll — the search box is focused on open for that reason. ### Use a RadioGroup or a ButtonGroup. **Don't** — Use Select for a choice of two or three. A menu hides the options behind a click. With three, showing them all is faster and needs no search. ## Accessibility - The search is a combobox that owns the list through aria-activedescendant, so focus never leaves it: ArrowUp/Down move, Enter ticks, Ctrl/⌘+Enter applies, Escape closes. - Options are role=option with aria-selected in an aria-multiselectable listbox. The checkbox is drawn, not a real control, so each row is announced once. - The count badge is aria-hidden; the trigger's name includes ', N selected' as text. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=1580-759) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-select--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Separator A 1px rule dividing related groups inside one surface. ## Import ```tsx import { Separator } from "@ir/ui"; ``` ## Props Takes the props of the element it renders, and nothing of its own — styling is the component's business, not the caller's. ## Do and don't ### Use it inside a surface, between sections of the same card or menu. **Don't** — Put a rule between two cards. Things that already have their own surface are already separated. A rule between them adds a line and no meaning. ### Use spacing, and add the rule only if the grouping is still unclear. **Don't** — Reach for a rule to create a gap. Whitespace groups as well as a line does and leaves the page quieter. A rule is for when space alone has stopped working. ### Leave it decorative unless the rule is the only boundary marker. **Don't** — Set decorative={false} on every rule so it is 'accessible'. Headings, lists and landmarks already carry the grouping. "Separator" announced between every section is noise, not access. ### Put it in a flex row, or give it a height. **Don't** — Drop a vertical rule into a block container and expect a line. It fills the height it is given. Given none, it is 1px wide and 0 tall — nothing at all. ### Rule between groups, and let rows sit on spacing alone. **Don't** — Rule every row of a list. A line per row turns a list into a table and makes the one meaningful boundary impossible to find. ## Accessibility - decorative defaults to true, so the separator is hidden from assistive technology. That is right for a line that only groups things visually. - Pass decorative={false} only when the line genuinely divides two things a screen reader should hear are separate. A role="separator" between every pair of sections is noise. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=2055-4783) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-separator--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Sidebar The app's primary navigation rail — where you are, and what else there is. ## Import ```tsx import { SidebarProvider, Sidebar, SidebarHeader, SidebarBrand, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupLabel, SidebarGroupAction, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarMenuLabel, SidebarMenuBadge, SidebarMenuSub, SidebarMenuSubItem, SidebarMenuSubButton, SidebarTrigger, SidebarInset } from "@ir/ui"; ``` ## Watch out - On `SidebarMenuSubItem`, Hover and Active are the same fill — bg/sidebar-hovered — so a selected sub-item is indistinguishable from one the pointer happens to be over. The parent button does not have this problem: its Active is bg/primary/subtle. Built as drawn, and raised. ## Variants | Axis | Options | Default | |---|---|---| | `ink` | `on-dark` · `on-light` | — | | `active` | `true` · `false` | — | ## Props ### SidebarProvider | Prop | Type | Required | What it does | |---|---|---|---| | `mobileOpen` | `boolean` | | The phone nav drawer's open state (Sidebar `mobile="drawer"`). | ### Sidebar | Prop | Type | Required | What it does | |---|---|---|---| | `mobile` | `"drawer" \| "fullscreen"` | | Figma: `Sidebar / Phone nav` 40000659:33057. `"drawer"`: below md the rail is not drawn inline — SidebarTrigger opens the same tree over the page instead, as a panel from the inline start with a strip of scrim left at the end. 44-tall items, a close on the brand, and picking an item closes it. From md up nothing changes. Opt-in for now; see guidance `phone-nav`. `"fullscreen"` is the old name for the same thing, from when the panel covered the whole screen. It still works. | | `mobileLabel` | `string` | | Accessible name of the phone nav dialog. | ### SidebarHeader | Prop | Type | Required | What it does | |---|---|---|---| | `closeLabel` | `string` | | The name of the close shown in the phone nav. "Close", not "Collapse": SidebarTrigger collapses the rail to 48 and this dismisses an overlay, so two buttons called the same thing would do two different things. | ### SidebarBrand | Prop | Type | Required | What it does | |---|---|---|---| | `image` | `string` | | The brand artwork. Covers the block; decorative, so it carries no name. | | `subtitle` | `React.ReactNode` | | A second line under the wordmark — Clarion's "powered by Iris". | | `mark` | `React.ReactNode` | | Shown instead of the wordmark when the rail is collapsed to 48. | ### SidebarMenuButton | Prop | Type | Required | What it does | |---|---|---|---| | `active` | `boolean` | | Marks the current page. Sets `aria-current` as well as the treatment. | ## Do and don't ### Keep the weight change and aria-current that come with `active`. **Don't** — Mark the current page with the background alone. Hover, focus and selection all tint the row. The weight is what still says which page you are on when the pointer is somewhere else. ### Default to labels; let people collapse it. **Don't** — Ship the collapsed rail as the default state. An icon-only rail is a memory test. It is a fine option for someone who already knows the product, and a poor starting point for someone who does not. ### Keep to one level, and use a page for anything deeper. **Don't** — Nest submenus inside submenus. The rail is narrow. Two levels of indent leave no room for the words, and the tree becomes something to navigate rather than navigation. ### Group them and label the groups. **Don't** — Put twelve items in one flat list. The labels are what make a long rail scannable — and they are the first thing that disappears when it collapses, which tells you how much work they were doing. ### Keep it to counts of things waiting. **Don't** — Use the badge slot for status words. A number in a nav row reads as "this many need you". A word reads as part of the label and makes the row ambiguous. ### Use <SidebarHeader variant="brand">. **Don't** — Cancel the header's padding with a class so the brand block can bleed. no-restyle refuses the class, and it should — padding is the header's own decision. The brand bleeds to three edges in both products, so the header offers that shape itself rather than being argued out of its own. ### Ship it with no image — the brand paints the rail's own surface. **Don't** — Hold a new brand back until someone draws its artwork. A brand with no asset reads as a quiet header, which is honest. An empty coloured box nobody designed is worse than no artwork at all. ### Supply the asset as drawn, and pass ink="on-light" when it is pale. **Don't** — Darken the artwork yourself, or restyle the block, to get the wordmark to read. On a token surface fg/on/* is solved by measurement; a bitmap has no value to solve against. So the block lays a scrim under the text and the artwork no longer decides whether the wordmark reads. The one thing the file still settles is polarity — light artwork takes dark ink and a pale scrim. ### Let size and weight carry the hierarchy. **Don't** — Dim the second line with opacity. There is no on-primary ink below emphasis to reach for, and opacity on text produces a contrast ratio nobody has measured. body/xs under heading/sm separates them without inventing a colour. ### Below md, set `mobile="drawer"`: the trigger opens the nav over the page as a panel from the inline start, with a strip of scrim left at the end edge to leave by. The header carries a 44 close, items are 44 tall, and picking one closes the nav. **Don't** — Show the rail inline on a phone, or squeeze the page beside a 256 rail. On the Clarion prototype the inline rail left a 390 phone with about 140 for the page. The icon-only rail is no answer either — below md it is the memory test this guidance already rules out. ### Move them into the phone nav's footer — Help & support, Dark theme as a Switch — and keep the bar to trigger, breadcrumb and account. **Don't** — Keep Help, theme and other global actions in a 48 top bar on a phone. Every icon in the bar costs the breadcrumb width; with three of them the workspace name truncated to a few letters. The nav is one tap away and has room. ## Accessibility - The active item sets aria-current="page" as well as the treatment, so "current" survives when colour does not. - The collapse toggle carries aria-expanded and an aria-label that changes with state — "Expand sidebar" or "Collapse sidebar" — because the icon alone never says which way it goes. - The PanelLeft glyph is aria-hidden; the button's label is its name. - Collapsing changes the rail's width at once, with no transition. Width is a layout property — animating it would re-lay out the page beside the rail on every frame — and Picasso moves transform and opacity only. - The brand header's image is decorative — empty alt and aria-hidden. The wordmark is the accessible text, so a brand header whose wordmark is itself artwork needs real text beside it or a label. - A scrim sits between the artwork and the text, so the wordmark's contrast comes from the component rather than from whatever the brand's file happens to contain. Removing it, or replacing the brand header's background, takes that guarantee with it. - Collapsed to 48 the wordmark is replaced by `mark`, so the mark has to still identify the product. A letter does; an abstract glyph on its own does not. - The brand header is not a control. If it should navigate home, the product wraps it in a link — it does not become one by sitting at the top. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=1137-443) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-sidebar--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Skeleton The shape of content that has not arrived yet. ## Import ```tsx import { Skeleton, SkeletonText } from "@ir/ui"; ``` ## Variants | Axis | Options | Default | |---|---|---| | `shape` | `block` · `circle` | `block` | ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `lines` | `number` | | How many lines to stand in for. | ## Do and don't ### Match the shape and count of what is actually coming. **Don't** — Show three generic grey bars where a table will land. A skeleton is a promise about the layout. Break it and the page jumps, which is worse than having shown nothing. ### Hide them (they already are) and announce the wait once on the region. **Don't** — Let a screen reader meet twelve skeleton blocks. Twelve empty boxes read out one at a time tells the person nothing about what is happening. ### Show them only past about half a second, or keep the old content in place. **Don't** — Flash skeletons for a request that usually takes 200ms. A skeleton that appears and vanishes reads as a glitch. Below the threshold, nothing at all is calmer. ### Use the button's loading state; save skeletons for content arriving. **Don't** — Use a skeleton for a submit, a save, or an action in flight. A skeleton says "this will be here shortly". An action has no shape to stand in for. ### Render the frame for real and skeleton only what is loading. **Don't** — Skeleton the nav, the page title and the buttons too. Chrome is already known at render time. Greying it out makes the whole page look broken rather than busy. ## Accessibility - Always aria-hidden. A skeleton is a picture of content, and a screen reader reading twelve grey boxes has been told nothing. - The container announces the wait once instead — aria-busy on the region, or a single polite live region saying "Loading dashboards". The skeletons stay silent underneath it. - The pulse stops under prefers-reduced-motion via motion-reduce:animate-none, and the test asserts it. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000533-20) — structure from figma, measurements from code. [Open in Storybook](/components/?path=/docs/components-skeleton--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Slider Pick a value, or a span of values, where the approximate position matters more than the number. ## Import ```tsx import { Slider } from "@ir/ui"; ``` ## Watch out - **The track is a correction.** It was drawn on bg/neutral/subtle-pressed, which in dark is neutral-800 — the card itself — so the track vanished on any card, and a resting track should not borrow a state word. It takes bg/layer/emphasis, the system's token for a neutral fill that must be seen on any surface; Progress and Meter use the same. Figma corrected. - **Disabled is a correction.** All three Types draw `State=Disabled` pixel-identical to `State=Default` — same fills, same strokes, same effects. A disabled control that looks live is the same defect as the seven Tab focus variants that showed no focus, so the code gives it the system's usual treatment (bg/disabled range, a muted thumb edge) and Figma is owed the fix. - Hover and Focus carry raw drop and inner shadows rather than binding `ring/focus`, so the ring here is the system's standard one rather than a reproduction of three unbound effects. Raised. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `thumbLabels` | `string[]` | | Names each thumb for screen readers — one per value. | ## Do and don't ### Put the number beside it, or let a field mirror it. **Don't** — Ship a slider with no readout of the value it is setting. A thumb on a track is an approximation. Anyone who needs the exact figure — and in a threshold they always do — cannot get it from the position. ### Use a slider for ranges people judge by feel; use a number input for exact values. **Don't** — Use a slider to enter a port number or a timeout in milliseconds. Hitting one value in a thousand by dragging is a pointer-accuracy test, and it is much worse on a touchscreen. ### Name them — Minimum and Maximum. **Don't** — Leave a range slider's two thumbs unlabelled. A screen reader announces two controls both called "slider", with no way to tell which end is which. ### Set a step that matches the precision the value actually has. **Don't** — Leave step at 1 on a 0–10000 range. Ten thousand keyboard presses to cross the track is not keyboard support. ### Let the disabled treatment show. **Don't** — Leave a disabled slider looking exactly like a live one. The file draws them identically today. People drag a control that cannot move and conclude the page is broken. ## Accessibility - Radix supplies role="slider", the aria-value* attributes and arrow, Page and Home/End keys on every thumb. - A range slider has two thumbs and therefore needs two names: pass thumbLabels, or both announce the same thing. - Disabled removes the hover and focus effects as well as the pointer. A disabled control that still looks live is the same defect as one that looks disabled and is not. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=1106-40) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-slider--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Sparkline A chart stripped to its shape — one series, no axes, no labels, sized to sit beside the number it summarises. ## Import ```tsx import { Sparkline } from "@ir/ui"; ``` ## Watch out - No crosshair, no tooltip, no hover. That is deliberate rather than missing: reading a value off a 24px-tall line is not possible, and a crosshair without an axis to read against is furniture pretending to be information. Values are the time-series chart's job; this is the shape. - One series only. There is no series axis and no legend, because two lines in 80 × 24 is two lines nobody can follow — and because the chart palette cannot currently tell eight series apart anyway. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `values` | `readonly (number \| null)[]` | yes | The series, oldest first. `null` is missing data and leaves a gap — it is never plotted as zero, which would invent a reading. | | `label` | `string \| null` | yes | What the shape says, in words, for anyone who cannot see it — "MOS over 24 hours, 4.4 falling to 4.1". `null` where the row or tile around it already says the same thing. Not optional: a label generated from the numbers would describe the data and not the point. | | `variant` | `"line" \| "area"` | | Line, or line with the area under it filled. | | `tone` | `SparklineTone` | | `primary` unless the thing is graded. A status tone is only for use where the status is also written down — a KpiTile badge, a table status cell — never as the only thing saying so. | | `min` | `number` | | Pin the low end of the scale. Defaults to the lowest value present. | | `max` | `number` | | Pin the high end. Defaults to the highest value present. | | `end` | `boolean` | | A dot on the newest point. On by default — it says which end is now. | | `threshold` | `number` | | A dashed rule across the plot: a threshold, a target, an SLA floor. | ## Do and don't ### Pass the same `min` and `max` to every sparkline in a column. **Don't** — Let every row scale to its own high and low, so a trunk wobbling by 0.1 draws the same mountain as one that fell by 2.0. A column of sparklines is read by comparing shapes. Auto-scaling each one independently makes every row look equally dramatic, which is the one thing the column was supposed to tell you apart. This is the most common way a sparkline lies. ### Pass `null` and leave the gap. A gap means nobody knows; the floor means someone measured zero. **Don't** — Plot a missing reading as 0, so a trunk that stopped reporting draws a cliff to the floor. An endpoint going quiet and an endpoint scoring zero are different incidents with different responses, and a line to the floor reports the second when the first happened. ### Keep the badge, the status cell or the icon that says "Critical", and let the tone agree with it. **Don't** — Turn the line red and leave it at that. Status colours are reserved and never travel alone — the same rule KpiTile already follows, for the same reason: colour is not readable by everyone and is gone entirely in a printout. ### Put it next to the value it summarises — a KpiTile's number, a table row's figure. **Don't** — Ship the line on its own as the reading. There is no axis, so the line carries direction and steadiness but no magnitude. On its own it says something changed and refuses to say from what to what. ### Use the time-series chart when the values matter, and keep this for the shape. **Don't** — Add a crosshair, a tooltip or ticks to make it readable point by point. A crosshair with no axis to read against is furniture pretending to be information, and a 24px-tall plot cannot resolve a value anyway. Growing a sparkline into a chart produces a bad chart rather than a good sparkline. ## Accessibility - `label` is required, and `null` is the explicit way to say the row or tile already names it — there is no default, because a label generated from the numbers would describe the data rather than the point. - With a label it is `role="img"`; with `label={null}` it is `aria-hidden` and nothing is said only by the picture. - The line is 2px at every rendered size (`vector-effect="non-scaling-stroke"`), so it does not thin out in a narrow column. - A status tone never carries the status alone — see the Do and Don't. - No hover, no focus, nothing interactive: there is nothing to read point by point and nothing to tab to. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000736-18) — structure from code, measurements from code. [Open in Storybook](/components/?path=/docs/components-sparkline--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Stepper Where someone is in a linear flow, and how much of it is left. ## Import ```tsx import { Stepper, StepperItem, StepperTrack, StepperIndicator, StepperSeparator, StepperContent, StepperTitle, StepperDescription } from "@ir/ui"; ``` ## Watch out - Figma's indicator axis is `Type` (Check | Number); here it is `indicator`, because the root is an `<ol>` and `type` is a real attribute on one — it sets list numbering. Fourth prop collision of the week. - At Complete both indicator types render the same check and differ only in fill: Check completes on bg/primary/emphasis, Number on bg/success/emphasis. One status, two colours, chosen by an axis that is about the indicator rather than the state. Built as drawn; raised. ## Props ### Stepper | Prop | Type | Required | What it does | |---|---|---|---| | `value` | `number` | | Index of the step in progress. Everything before it is complete. | | `indicator` | `StepperIndicator` | | Figma's `Type` axis, renamed — `type` on an `<ol>` sets list numbering. | | `layout` | `StepperLayout` | | Where each step's text sits relative to its indicator. | ### StepperItem | Prop | Type | Required | What it does | |---|---|---|---| | `status` | `StepStatus` | | Override the derived status for a step that failed or was skipped. | ## Do and don't ### Use it when the steps genuinely run in sequence. **Don't** — Use a stepper for a form people can fill in any order. A stepper promises an order. On a flow that has none it makes people hunt for a next button that was never the point. ### Keep it to three to five, and group the rest. **Don't** — Show nine steps across the top of a page. Past five the row stops reading as progress and starts reading as a warning about how long this will take. ### Icons-minimal in tight space, icons-connected for short flows, text-with-line when each step needs describing. **Don't** — Reach for the labelled layout inside a dialog. The five layouts exist because the same five steps need different amounts of room. The labels are the first thing to lose. ### Keep aria-current and the indicator's shape doing the work too. **Don't** — Rely on the fill alone to say which step is current. A completed step and a current one are both filled. The check, the dot and aria-current are what actually distinguish them. ### Use Progress for continuous work; a stepper counts discrete stages. **Don't** — Use a stepper to show a percentage. Steps are places a person stands. A percentage is a machine's estimate, and they do not mean the same thing. ## Accessibility - The current step sets aria-current="step". - The connectors and the state glyphs are aria-hidden — a completed step has to say "completed" in its text or its label, because a tick is a picture. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=1065-653) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-stepper--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Switch An immediate change. Flipping it does the thing — nothing is waiting on a Save button. ## Import ```tsx import { Switch } from "@ir/ui"; ``` ## Watch out - Figma draws the track border at **1.5px, which no browser can render** — Chrome floors a fractional border width to 1px, in plain CSS, at every pixel ratio (measured: `border:1.5px` and `border:1px` produce identical layout and identical computed values at DPR 1 and 2). So 1px is not a change from the Figma spec, it is the only form the spec can take on the web. ## Variants | Axis | Options | Default | |---|---|---| | `size` | `sm` · `md` | `md` | ## Do and don't ### Use Switch for an immediate change, Checkbox for a form value. **Don't** — Use a Switch for a value that a Save button confirms. A switch says the change has already happened. Putting one in a form makes people flip it, press Save, and wonder which of the two actually did the work. ### Apply each change as it is made, and say so if it takes a moment. **Don't** — Pair a panel of switches with Save and Cancel. Cancel cannot undo something that already took effect. If the change genuinely needs confirming, the control was never a switch. ### Use a radio group — one tab stop, arrows to move, one answer. **Don't** — Use two switches for two mutually exclusive options. Two switches can both be on. If that state is impossible, the control is lying about the shape of the question. ### Label the thing being switched — "Notifications" — and let on mean on. **Don't** — Label a switch "Notifications off" and flip the meaning with its state. A switch already carries the state. A negative label makes the on position mean off, which nobody reads correctly at a glance. ### Hold the new position, show that it is saving, and explain it if it fails. **Don't** — Flip the switch optimistically and let it snap back when the request fails. A control that moves by itself reads as a bug, and people stop trusting what the position tells them. ### Mute it, so it reads as a setting nobody can currently change. **Don't** — Leave a disabled ON switch at full colour. A live-looking switch invites a flip that does nothing, and no feedback follows to explain why. ## Accessibility - Radix supplies role="switch" and aria-checked. A switch is on or off now, not a value to be submitted — use Checkbox when it is the latter. - Invalid is a ring, not a border: aria-invalid:shadow-ring-focus-danger. A mark has no border to recolour, which is the rule for every control of this shape. - The track border goes transparent when the switch is on, and the focus ring is a separate layer that is unaffected. Border is decoration, ring is the indicator — keep them independent. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=1604-99) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-switch--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Table Rows of the same kind of thing, compared column by column. ## Import ```tsx import { Table, TableColGroup, TableCol, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, TableCaption } from "@ir/ui"; ``` ## Watch out - **Figma models the table as COLUMNS; this models it as rows.** In the file a table is built by placing `Table column` components side by side, each holding its own header and ten row slots, with a separate `Table row highlight` laid over the top to draw hover and selection across them. That is a sound way to author a table in Figma — it keeps a column's type consistent down its length — but it has no equivalent in HTML. - The card, toolbar and pagination bar around the table in Figma are NOT part of this component. That surface is a Card — same radius, same border, same fill — so it composes rather than being rebuilt here. The stories show it. ## Props ### Table | Prop | Type | Required | What it does | |---|---|---|---| | `size` | `Size` | | Figma's `Size`: md rows are 60 tall, sm rows 52. Headers are 40 in both. | ### TableRow | Prop | Type | Required | What it does | |---|---|---|---| | `selected` | `boolean` | | Draws the selected fill and sets aria-selected. | ## Do and don't ### Use a table when the reader needs to compare the same field across rows. **Don't** — Use a table to lay out a form or a set of cards. A table earns its density by making columns scannable. Used as a layout grid it inherits all the cost — the semantics, the scrolling, the alignment — and returns none of it. ### Use the Title + supporting cell to stack a second line inside one row. **Don't** — Split one record across two rows to fit more fields. Every row is one record, for a reader and for a screen reader. A record that spans two rows breaks selection, sorting and counting at once. ### Right-align numbers and set them in mono. **Don't** — Left-align numeric columns. Digits only line up by place value when they are right-aligned in a fixed-width face. Left-aligned figures cannot be compared down a column, which is the only reason they are in one. ### Head the column "MOS" and put the rest in a caption or a tooltip. **Don't** — Write "MOS (calculated hourly, 0–5)" in the column header. The header repeats in assistive technology on every cell in the column. A sentence there is read dozens of times. ### Set the selected state on the row, so it reads and looks selected. **Don't** — Track selection on the checkbox and leave the row unmarked. The thing being selected is the record, not the tick. A screen reader that hears "checked" without "selected" has to infer the connection. ### Say what would be here and how to get it — or that a filter is hiding it. **Don't** — Render a header with nothing under it. An empty table looks identical whether there is no data, no match, or a failed request, and the reader cannot tell which. ### Use sm when a table is a supporting panel, and md when it is the page. **Don't** — Reach for sm to squeeze in another column. Shrinking the row height does not create horizontal room. If columns do not fit, the answer is fewer columns or a scroll, not tighter rows. ## Accessibility - aria-selected belongs on the row, not on the checkbox inside it. The checkbox says what it does; the row says what it is. - Selection is a fill plus aria-selected, never the fill alone. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000377-22464) — structure from code, measurements from figma. [Open in Storybook](/components/?path=/docs/components-table--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Tabs Switch between sibling views of the same object. ## Import ```tsx import { Tabs, TabsList, TabsTrigger, TabsContent } from "@ir/ui"; ``` ## Watch out - One defect followed in code but not in the file: Figma's `Current=False, Type=Underline, State=Focus` is byte-identical to its Default — no ring, no indicator. Every other Focus variant carries `ring/focus`. A focus state that does not show focus is a keyboard trap, so the code rings every tab; the file wants the same fix. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `fullWidth` | `boolean` | | Stretch the tabs to fill the row. Figma's `Full width`. | ## Do and don't ### Use them for views of one object — an endpoint's Overview, Trunks, Alerts. **Don't** — Use tabs to move between different objects, or as page navigation. Tabs promise you are still looking at the same thing. Break that and people lose track of what they are on. ### Underline for page sections, Minimal inside a card or drawer, Brand/Gray/Border for compact toggles. **Don't** — Use a segmented control for page-level sections. The file assigns each type a place. Segmented styles read as a control; underline reads as structure. ### Switch to Line tabs past about six sections, or when labels are long. **Don't** — Cram nine long labels into a horizontal row. Horizontal tabs that wrap or scroll hide their own options, which defeats the point of showing them all. ### Use Stepper for order, tabs for free movement. **Don't** — Use tabs for a sequence someone must complete in order. Tabs say "look wherever you like". A sequence needs to say "finish this first". ### Give the panel a stable minimum height where the content varies. **Don't** — Let the panel resize the page as you move between tabs. The tabs move under the pointer if the page reflows, and the next click lands on the wrong one. ## Accessibility - Radix supplies the tablist, tab and tabpanel roles and arrow-key movement between tabs. - The panel is focusable and carries its own ring, so keyboard users reach the content after the tab strip rather than tabbing through every tab first. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=966-33657) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-tabs--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Tags input A field that turns entries into removable chips — hosts, emails, labels. ## Import ```tsx import { InputChip, TagsInput } from "@ir/ui"; ``` ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `validate` | `(tag: string) => boolean` | | Return false to refuse a tag; it stays in the field for correcting. | ## Do and don't ### Say so in the hint — 'Separate hosts with a comma'. **Don't** — Assume people know Enter or a comma makes a tag. Nothing on screen explains the gesture, and a typed value that never becomes a chip looks saved but is not. ### Use validate, which leaves the entry in the field, and show why in the error. **Don't** — Silently drop an entry that is not allowed. A value that vanishes reads as accepted. Left in place, it can be corrected. ### Use Select. **Don't** — Use tags for choosing from a known list. Free text invites typos in things that should be exact. Tags are for values the system cannot list. ## Accessibility - Each chip's × is a button named 'Remove <tag>'. - Backspace in the empty field removes the last tag; Enter, comma and paste add. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=40000625-567) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-tags-input--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Textarea For an answer longer than a line. Input's sibling; the same wiring, more room. ## Import ```tsx import { Textarea } from "@ir/ui"; ``` ## Variants | Axis | Options | Default | |---|---|---| | `size` | `sm` · `md` | `md` | ## Do and don't ### Set a minimum and let the field grow. **Don't** — Fix the height and let content scroll inside it. A box that cannot grow is why people write three words where they meant three sentences — they cannot see what they have written, so they stop. field-sizing-content does this without JavaScript. ### Keep resize-y. **Don't** — Leave the browser default resize, which drags both ways. A textarea dragged wider breaks the column it sits in, and nobody has ever needed a wider one. Vertical is the axis people actually want. ### Use Input. **Don't** — Use a Textarea for a name, an ID or a threshold. The size of the box is a promise about the length of the answer. A three-line box under "Probe name" invites a paragraph, and then something downstream has to truncate it. ### State the limit, and show the count as it approaches. **Don't** — Enforce maxLength silently. A field that stops accepting characters without explanation reads as broken. If the limit matters enough to enforce, it matters enough to say. ### Let read-only drop the resize handle along with the editing. **Don't** — Leave a read-only textarea draggable. A resize handle is an affordance for editing. On a field nobody can edit it is a control that does nothing, which is worse than no control. ## Accessibility - Wrap it in Field so the label, hint and error are wired — Textarea takes the same FieldControl as Input. - aria-invalid rather than a prop, so the failure reaches assistive tech at the same moment the border turns red. - field-sizing-content is Chrome-only today; elsewhere the minimum height plus the native resize handle is the fallback, which is what people already expect. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=711-2070) — structure from figma, measurements from shadcn. [Open in Storybook](/components/?path=/docs/components-textarea--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Threshold slider Two numbers that decide when a metric stops being fine — and the bands they create. ## Import ```tsx import { ThresholdSlider } from "@ir/ui"; ``` ## Watch out - The two Figma sets disagree on the thumb colour. The preset gallery binds `status/warning` and `status/critical`; the state set binds `bg/warning/emphasis` and `bg/danger/emphasis`, which are warning-500 and (in dark) danger-500 — different values. `status/*` wins here: it is the family that has a `healthy` member, it is what both sets use for the bands, and it makes each thumb the colour of the boundary it sits on, which is the whole point of the control. ## Props | Prop | Type | Required | What it does | |---|---|---|---| | `warning` | `number` | yes | The value at which the metric stops being healthy. | | `critical` | `number` | yes | The value at which it stops being merely worrying. | | `format` | `(value: number) => string` | | How a value is written — units, decimals. Defaults to `String`. | ## Do and don't ### Put the thresholds in the order the metric means and let the bands follow. **Don't** — Add a `direction` prop, or flip the bands by hand. `critical < warning` is what "low is bad" means. A separate flag is a second source of truth that can disagree with the numbers, and the disagreement is invisible until someone is paged. ### Keep the Critical and Warning labels above the thumbs. **Don't** — Rely on the red, amber and green bands to say which is which. The bands are three hues along one bar, which is the hardest case for anyone with a red-green deficiency. The label over each thumb is what survives; the colour reinforces it. ### Bound each thumb by its twin, and say so with aria-valuemin and aria-valuemax. **Don't** — Let one threshold pass the other, or clamp silently to the track ends. Crossed thresholds invert the bands and mean nothing. A screen reader that is told the range is 0–100 when the real bound is 85 gives an answer the control will not honour. And when they do meet, the label that survives is the critical one: there is no warning band at the boundary, so crossing it skips warning entirely and the number is the critical limit. ### Pass `format` so −80 reads as −80 dBm and 70 as 70%. **Don't** — Show bare numbers and put the unit in the field label. Thresholds get read out of context — in a summary, an alert, a screen reader. A number with no unit is a number someone has to go and look up. ### Keep it for setting the two boundaries; show the live reading elsewhere. **Don't** — Use it to report where a metric currently sits. It is a configuration control. Putting the current value on the same bar makes the thing you are editing and the thing you are watching look like one control. ## Accessibility - Two thumbs, each role="slider" with its own aria-label, aria-valuenow and an aria-valuetext that is the formatted value — "-80 dBm", not "-80". - Each thumb's aria-valuemin and aria-valuemax are bounded by its twin as well as by the track, so the announced range always matches what the thumb can actually do. - Disabled sets aria-disabled and tabIndex -1 but leaves the thumbs in the accessibility tree. A disabled control is still something you may need to read. - Arrow keys move by step, Page by ten steps, Home and End to the bounds. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=1751-104) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-threshold-slider--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Toast Transient confirmation that something already happened. ## Import ```tsx import { ToastProvider, ToastViewport, Toast, ToastBody, ToastIcon, ToastContent, ToastTitle, ToastDescription, ToastAction, ToastClose } from "@ir/ui"; ``` ## Watch out - Figma's `Style` axis is `appearance` here, because `style` is a DOM prop and a component that spreads onto a div cannot own the name. Values keep Figma's: Emphasis fills with the tone, Subtle tints it. - **One correction.** On an Emphasis toast the file paints the dismiss ✕ with `fg/on/primary-emphasis` while the tone icon and both text lines use `fg/on/{tone}-emphasis`. For three tones that happens to be the same white and nobody would notice — but `fg/on/warning-emphasis` is neutral-950 where `fg/on/primary-emphasis` is white, so a **Warning Emphasis** toast in light mode draws a white ✕ on a light surface. The close follows its own toast's on-colour here. Same class as the wrong-family tokens the audit already cleared; Figma needs it too. - Raised, not acted on: the action Button instance overrides the radius to radius/lg (10) where every one of Button's 294 variants is radius/md (8), and its border is border/neutral/subtle where code's Outline is border/neutral/muted. The code Button is used as-is. ## Props Takes the props of the element it renders, and nothing of its own — styling is the component's business, not the caller's. ## Do and don't ### Toast what already happened; use an Alert for what still needs doing. **Don't** — Put something the person must act on in a toast. A toast leaves. Anything that disappears on a timer cannot be the only place a required action lives. ### Subtle by default; Emphasis when the tone must carry across a busy screen. **Don't** — Reach for Emphasis because the message feels important. A screen where everything is saturated has no hierarchy left for the one thing that genuinely is urgent. ### "Endpoint probe-04 deleted." **Don't** — "Success!" People read the toast to confirm the thing they just did. The object and the verb are the whole message. ### Offer Undo in the action slot for anything destructive. **Don't** — Toast a deletion and leave. The moment right after a mistake is the only moment someone can still fix it cheaply. ### Toast the operation once — "12 endpoints archived". **Don't** — Fire one toast per item in a bulk operation. Twelve stacked cards cover the screen and outlive their own usefulness, and every one is read aloud in turn. ### Keep Destructive for failures and losses. **Don't** — Use Destructive for a routine save that happened to be a delete. If the loud tone is used for ordinary outcomes, nothing is left to mark the outcomes that matter. ## Accessibility - Radix Toast owns the live region, the swipe-to-dismiss and the timing. The viewport is rendered once, near the end of the document. - The close button takes label as its aria-label; the X and the status icon are both aria-hidden. - A toast carries an action or a close, never both — two ways out of the same message is one more decision than it is worth. - It slides in from the edge its viewport sits on and leaves the same way; under prefers-reduced-motion it fades in and out instead. It still follows a swipe there: following a finger is not animation. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=94-59093) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-toast--docs) --- {/* Generated by scripts/build-component-docs.mjs — do not edit. The source is the component folder: guidance.json, the doc block and the props. Change those. */} # Tooltip A short explanation attached to a control, on hover or focus. ## Import ```tsx import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from "@ir/ui"; ``` ## Props Takes the props of the element it renders, and nothing of its own — styling is the component's business, not the caller's. ## Do and don't ### Put it in the field's hint, where it is always visible. **Don't** — Put something the person needs in order to finish the task in a tooltip. A tooltip is invisible until you go looking for it, and on touch it may never appear at all. ### Use a Popover for anything interactive. **Don't** — Put links, buttons or a form inside a tooltip. A tooltip closes when the pointer leaves, so nothing inside it can reliably be clicked. ### Give the button an aria-label, and use the tooltip for the extra detail. **Don't** — Rely on a tooltip to name an icon-only button. A tooltip describes; it does not name. A control with no accessible name is unusable without one. ### One sentence, up to about two lines. **Don't** — Write a paragraph. It sits over the content the person is reading, and it leaves as soon as they move. ### Say what saving will do, or say nothing. **Don't** — Tooltip a 'Save' button with 'Save'. A tooltip that repeats the label teaches people that tooltips are not worth opening. ## Accessibility - Radix points the trigger's aria-describedby at the content, so the tooltip describes the control rather than naming it. - A tooltip is never the only place something is said. It does not appear on touch, and it is not reachable as content — an icon-only button still needs its own aria-label. - The 300ms default delay is on the Provider. Lowering it per-tooltip makes a toolbar flicker as the pointer crosses it. ## Where it is drawn [Figma](https://www.figma.com/design/v61McMI1fYNAN8DonhNjHQ/?node-id=426-8325) — structure from figma, measurements from figma. [Open in Storybook](/components/?path=/docs/components-tooltip--docs) --- # Content Picasso inherits IR's brand voice. This section covers what changes when that voice has to work inside a product — casing, errors, states, numbers and terminology. **Where this section and IR's brand guidance differ, the brand guidance wins.** Its scope is the company's voice; this section's scope is a UI string. | Page | Answers | |---|---| | [Principles and register](principles-and-register.md) | Why product copy sounds different from marketing copy | | [Casing](casing.md) | Sentence case everywhere, except proper nouns | | [Errors](errors.md) | What broke, then what to do | | [Empty and loading states](empty-and-loading-states.md) | The three states every data component needs | | [Numbers, units and time](numbers-units-and-time.md) | Formatting the thing the product is actually about | | [Buttons and labels](buttons-and-labels.md) | Verb first, name the outcome | | [Terminology](terminology.md) | One word per concept | --- # Buttons and labels > ✗ **Don't** — "Submit" · "OK" · "Click here to export your data as a CSV file" > > ✓ **Do** — "Save changes" · "Delete probe" · "Export CSV" **Buttons.** Say what happens: Save changes, Export CSV, Acknowledge alert. Never "Submit" or "OK" alone. **Destructive actions.** Name the thing and the consequence: Delete probe. Pair it with a confirmation that restates what is lost. **Cancel means abandon.** If the control only closes a panel, say Close. Do not use Cancel for both. **Length.** Two or three words. If a button needs more, the explanation belongs above it, not inside it. See also: [Button guidance](../../packages/ui/src/components/button/guidance.json). --- # Casing **Sentence case everywhere, except proper nouns.** Buttons, labels, hints, headings, menu items, tabs, table headers, badges, empty states and errors. > ✗ **Don't** — "Export Csv" · "View All Alerts" · "TENANT NAME" as a column header > > ✓ **Do** — "Export CSV" · "View all alerts" · "Tenant name" There is no uppercase exception for table column headers. ## Proper nouns Clarion, Iris, Prognosis, Collaborate, Transact, Infrastructure, IR. First mention takes the prefix — IR Collaborate, then Collaborate. **Fixed forms.** UC & CC, HPE NonStop, Real-time Payments. Vendor and protocol names as the vendor writes them: SIP, RTP, MOS, SBC, Teams, Webex. The lowercase wordmarks are graphics, never copy. The product's pre-rename name never appears in a string, file name or alt text. ## The one exception `label/xs` is uppercase with wide tracking. Use it as an **eyebrow or overline** only — chrome that must not read as data. Never on a button. ## Marketing surfaces Brand CTA strings keep their title case: Get a Demo, Contact Us, Watch Video. Product UI does not. A Picasso Button placed on a marketing page takes the brand string. --- # Empty and loading states Writing one state and leaving the other two to the framework is how "No data." ships. Two components exist to put this copy in: **`EmptyState`** takes a `title` and a required `description` — required precisely so the second sentence cannot be skipped — plus an optional illustration, icon and action. **`Skeleton`** is the loading case. Reach for them rather than inventing a one-off; a bare string in a `div` is how the three states drift apart. > ✗ **Don't** — "No data." > > ✓ **Do** — "No alerts in the last 24 hours. Widen the time range to see older activity." **Empty.** Say why it is empty and what would fill it. **First use.** Different from empty. Say what will appear once something is set up, and link to the setup. **Loading.** Prefer a skeleton to a spinner with copy. If a wait can exceed ten seconds, say what is happening. **Partial.** If some data failed, show what loaded and name what did not. Never silently drop a source. --- # Errors Two lines, in that order. > ✗ **Don't** — "You entered an invalid query." > > ✓ **Do** — "No results match these filters. Clear the date range to widen the search." **Line one is the fact.** What broke, and what it affects. Name the thing, not the layer it failed in. **Line two is the action.** What the reader can do now, or who can. If there is nothing to do, say what happens next and when. **Never blame the reader.** The filter returned nothing; the person did not fail. Avoid "you entered", "invalid" and "illegal". **No dead ends.** An error with no next step is an unfinished error. --- # Numbers, units and time > ✗ **Don't** — "three trunks" · "1.2GB" · "45ms" · "2:15pm" · "MOS 3.60000" > > ✓ **Do** — "3 trunks" · "1.2 GB" · "45 ms" · "14:15 AEST" · "MOS 3.6" **Numerals always.** Use digits, including one to nine. **Units.** A space between value and unit: 1.2 GB, 45 ms, 12 kbps. Percentages close up: 99.95%. **Precision.** Match precision to the decision. MOS to one decimal, packet loss to two, counts whole. Do not pad with zeros. **Time.** 24-hour clock with an explicit timezone. Relative under an hour, absolute after. **Ranges.** En dash, no spaces: 09:00–17:00. --- # Principles and register ## The three principles, applied to a UI **Solve problems for people, not processors.** Write about the situation someone is in, not the system that produced it. Use the words they already use. **Cool, calm and objective.** State what happened. No alarm, no apology, no exclamation marks. **Proactive, not reactive.** Lead with what someone can do next, not with what the product just did. > ✗ **Don't** — "Oops! We couldn't load your data. Please try again later." > > ✓ **Do** — "Couldn't reach the Sydney probe. Retrying every 30 seconds." ## Register Same voice, less of it. Brand and product are not two personalities — they are one personality at two volumes. > ✗ **Don't** — "Uh oh! Something's not quite right — but don't worry, we're on it." > > ✓ **Do** — "MOS dropped below 3.6 on 12 trunks." **Why it differs.** Brand copy persuades someone who chose to read it. A UI string informs someone in the middle of a task, often during an incident. **What stays.** Plain words, active voice, "you" and "yours", and the most important thing first. **What goes.** Benefit framing, reassurance, exclamation marks, and explaining the reader's own domain back to them. **Who is reading.** Usually an engineer who knows UC and CC better than we do. Explain our concepts, never theirs. --- # Terminology > ✗ **Don't** — a screen that says "tenant" in the header, "customer" in the table and "org" in the filter. > > ✓ **Do** — one term, chosen once, used in all three. **Pick one and hold it.** tenant, customer, organisation and site are not interchangeable. Choose one per concept and use only that word. **Explain our concepts.** Say what Clarion means by a probe, a threshold, a fleet. These are ours, so they need defining. **Never explain theirs.** Assume SIP, jitter, MOS, SBC and packet loss need no gloss. ## One word has no answer yet **Tenant**, **customer** and **organisation** all appear, and none of them is the agreed word. Do not pick one in a draft — use whichever the surrounding screen already uses, and flag it in review so the choice is made once rather than per screen. --- # Contributing | Page | | |---|---| | [Adding a component](adding-a-component.md) | The full walkthrough, Button as the worked example | | [How Figma maps to code](figma-to-code-mapping.md) | The four places the two cannot share a shape, and the rule for each | | [Component checklist](component-checklist.md) | What "done" means — copy it into the PR | | [Reporting off-system output](reporting-off-system-output.md) | When an agent writes code that breaks the rules | ## One component per pull request Components land one at a time, in dependency order, each reviewable on its own. A PR that adds three components cannot be reviewed — it can only be approved. ## Before you start Read [`AGENTS.md`](../../AGENTS.md). It is short, and it is what `npm run lint` enforces. --- # Adding a component Every component is five files in one folder: ``` packages/ui/src/components/button/ button.tsx the component button.stories.tsx the rendered examples, including Do / Don't button.test.tsx the rules, enforced guidance.json the Do / Don't pairs as data index.ts re-export ``` Guidance lives **beside the code**, not in a docs folder, so a change to the component and a change to its rules land in the same diff. ## 1. Read the Figma component first Structure comes from Figma: which variants, sizes and states exist, and which semantic token each one uses. **Mirror the names exactly** so a design reads straight into props. Button's `Variant`, `Size` and `State` axes are its props. Four things do not read straight across — a `Type` axis that is really several components, a continuous value, a presence boolean, and several sets that are one component. [How Figma maps to code](./figma-to-code-mapping.md) has the rule for each. ## 2. Take shadcn's measurements Heights, padding, gaps and radius come from shadcn — that is what "shadcn base except colours" means. Where Figma and shadcn disagree on a measurement, shadcn wins and Figma is reconciled to match. Say so in the component's doc block, with the numbers: ``` * ⚠️ These disagree on height. Figma is 24/28/32/36; shadcn is 28/32/36/40. * We take shadcn's, so every button is one step taller than the current * Figma component. Deliberate, and Figma is reconciled to match. ``` An undocumented deliberate difference reads as a bug to the next person. ## 3. Write the component ```tsx const buttonVariants = cva(base, { variants: { variant: {...}, size: {...} }, compoundVariants: [...], defaultVariants: { variant: "default", size: "md" }, }); ``` Radix for behaviour, `cva` for variants, `cn` for merging. `forwardRef`, `asChild` via Radix `Slot`, and a `data-slot` attribute for styling hooks. **Order matters inside cva.** Variants are applied before sizes, and compound variants after both. If a variant needs to win over a size — Link stripping its box, say — it has to be a compound variant, or the size block overrides it. ## 4. Write `guidance.json` Do / Don't pairs, each with a `why`. **Draw them from real defects**, not invented ones — the audit is full of them, and a rule with a real failure attached is one people remember: ```json { "id": "ghost-resting-fill", "dont": "Give Ghost a resting background.", "do": "Keep Ghost transparent until hover.", "why": "A ghost with a resting fill reads as Outline, so the hierarchy between a primary and a tertiary action collapses.", "source": "Found on 168 buttons in the Figma library — audit §17.2" } ``` Add an `a11y` array in the same file for what the `.tsx` cannot be read for — a deliberate absence (Alert ships no `role` on purpose), a decision made elsewhere (Skeleton is `aria-hidden` because the container announces the wait), or a number with a reason (Button's disabled contrast is 2.24:1, which SC 1.4.3 exempts). It is published to `/llms-components.txt`, so a component that says nothing there is one a model will guess about. ## 5. Render the guidance as a story A Do / Don't pair written only in JSON goes stale silently. Rendered as a story, it breaks when the component does. ## 6. Test the rules, not the framework Do not test that React renders. Test the things that went wrong: ```tsx it("keeps ghost transparent at rest", () => { ... }); it("gives link no box at any size", () => { ... }); it("marks a loading button busy and blocks activation", () => { ... }); ``` Button's tests found three real defects the first time they ran. That is what they are for. ## 7. Verify before claiming ```bash npm run type-check npm test npm run build-storybook ``` Then **look at it** — light and dark, every variant and size. A class name that Tailwind never emitted fails silently; the build stays green and the button renders unstyled. ## 8. Reconcile Figma — in the same session **Every correction made in the repo goes back into Figma.** Not "eventually", not on a sweep later: in the same session, while you still know what changed and why. This is the half of the direction-of-truth rule that is easy to skip, because the code works without it. But a Figma component that still shows the old behaviour is not a stale document — it is a second, contradicting answer, and designers will keep building against it. Every hour it stays wrong, more instances inherit it. What counts as a correction to push: | In the repo | In Figma | |---|---| | A state Figma does not have (read-only, say) | add the variant | | A token swapped for a more correct one | rebind the affected variants | | A measurement taken from shadcn over Figma's | update the frames, and say so in the doc block | | A defect fixed (a fill that should not be there) | fix it in every variant, not just the one you noticed | Then add a **Figma impact** line to the entry under `## Unreleased` in `CHANGELOG.md`, so the release says what a designer will see when they accept the library update. There are no changesets — see [Releases](../releases/). **Prefer a variable rebind to a literal.** A hand-typed value in Figma matches the repo today and drifts the next time either side moves — that is how the focus ring ended up hand-typed at a value the palette no longer held. --- # Component checklist ```markdown ## Structure - [ ] Variants, sizes and states mirror the Figma component's names - [ ] Measurements are shadcn's; any deliberate difference is noted in the doc block - [ ] `forwardRef`, `asChild`, and a `data-slot` attribute - [ ] Exported from `packages/ui/src/index.ts` ## Tokens - [ ] No raw hex, no Tailwind palette colours, no `bg-[var(...)]` - [ ] No hard-coded corner — radius comes from `rounded-*` - [ ] Spacing lands on the 4pt grid (or a 2pt half-step) - [ ] Every utility used actually emits CSS — check the built stylesheet ## Content - [ ] Every string is sentence case - [ ] Button labels are verb-first and name the outcome - [ ] Empty, loading and error copy exist where the component can be in those states ## Accessibility - [ ] Focus ring is `border/focused`, 2px with a 2px offset, and is never removed - [ ] Icon-only variants require an accessible name - [ ] Keyboard behaviour matches the Radix primitive's - [ ] Storybook's a11y addon passes - [ ] `guidance.json` has an `a11y` array saying what the `.tsx` cannot be read for ## Proof - [ ] `guidance.json` with Do / Don't pairs drawn from real defects - [ ] No bare `z-50` — a layer utility, or a new rung in `layer/*` - [ ] A rendered Do / Don't story - [ ] Tests covering the defects the rules exist to prevent - [ ] `type-check`, `test` and `build-storybook` all pass - [ ] Looked at in light and dark, at every size ## Reconcile Figma - [ ] Every correction made here has been pushed back into Figma, in this session - [ ] New states exist as variants, not just in code - [ ] Pushed as variable bindings, not hand-typed values ## Release - [ ] An entry under `## Unreleased` in `CHANGELOG.md`, with a **Figma impact** line ``` --- # How Figma maps to code Most of a component reads straight across: a Figma `Variant`, `Size` or `State` axis is a prop of the same name. Four things cannot, because Figma and the browser model them differently. Each has one rule, decided on 1 October 2026. Follow them when you build a component and when you write its Code Connect mapping, so the two say the same thing. ## 1. One Figma set is one code component If code has separate components, Figma has separate sets. A `Type` axis that switches between things code exports under different names is not allowed. Input is the worked example. It was one set with seven Types; it is now six sets, one per export: | Figma set | Code | |---|---| | `Input` | `Input` | | `Password input` | `PasswordInput` | | `Number input` | `NumberInput` | | `Input button` | `InputButton` | | `Tags input` | `TagsInput` | | `File upload` | `FileUpload` | When a set has to be split, **move the variants, do not rebuild them**. Lift each variant out of the set and combine the lifted ones into a new set. The component nodes and their keys survive, so every instance keeps pointing at the same thing and keeps its overrides. An axis is still right when it changes paint inside one component. When the values differ only by what is present, it is booleans instead: `Input button` had `Type` = Button | Select trigger until 2 Oct 2026, and the two differed by an icon and a count badge, so it is now one set with a swappable `Icon` and a `Show Badge number` toggle — the same call as Chip. ## 2. A continuous value is a number in code Progress, Meter and Slider take a number. Figma cannot draw a continuum, so it draws steps — Progress has `Percent` = 0% | 25% | 50% | 75% | 100%. The steps are examples of the number, not an enum. In a mapping, each drawn step becomes that value: `Percent=50%` maps to `value={50}`. Never add a prop whose only job is to mirror Figma's steps. ## 3. A Figma boolean is a child in code Figma toggles presence with a boolean: Input's `Leading`, Card's `Card Footer`, Card / Header's `Show actions`. Code composes with children and slots, because a boolean that toggles a hardcoded child cannot hold anything but that child. In a mapping, the boolean decides whether the child is rendered. `Card Footer=true` renders ``; `false` renders nothing. Do not add a `showFooter` prop to match the file, and do not convert Figma's booleans to slots to match the code — each side keeps its own idiom and the mapping is where they meet. A boolean can change presence. Only a variant can change paint. ## 4. Several Figma sets can map to one component, through a prop Tabs is three sets in Figma — `_Tab button base`, `Horizontal tabs` and `Vertical tabs` — and one `Tabs` in code. Both wrappers map to `Tabs`, with `orientation="horizontal"` or `"vertical"`; the base maps to `TabsTrigger`. The sets stay separate in Figma because the matrix is sparse: Horizontal has no Line type and Vertical has no Underline. Merging them would add an axis with holes in it. This is the one case where rule 1 bends, and it bends only when the difference is a single prop on one component. --- # Reporting off-system output When an agent produces off-system code — a raw hex, a Title Case button, a toast carrying both an action and a close — **that is not the agent failing. It is a gap in `llms.txt`, `AGENTS.md` or a component's `guidance.json`.** So the fix belongs in the source, not in a one-off correction to that session. ## How to report it Open an issue with: 1. **The prompt**, verbatim 2. **What it produced** 3. **Which rule it broke**, and where that rule is written down — or that it is not written down anywhere The third line is the useful one. "The agent used `#007FAB`" is a bug report about a model. "`llms-tokens.txt` does not exist, so there was nothing to resolve the brand colour against" is a bug report about this system, and it is fixable. ## What gets fixed | Symptom | Fix belongs in | |---|---| | Wrong token, or a raw value | `llms-tokens.txt` — publish the resolved table | | Wrong component for the job | `llms-components.txt`, or the component's description | | Right component, wrong usage | that component's `guidance.json` | | Broke a repo convention | `AGENTS.md` | | Off-voice copy | [Content](../content/) | --- # Foundations | Page | What it covers | |---|---| | [Tokens, brands and Figma sync](tokens-and-brands.md) | How a token is built, how a brand chooses, how Figma is kept matching | | [Grid, spacing and radius](grid-spacing-and-radius.md) | A 4pt grid with 2pt half-steps, and one knob for every corner | | [Typography](typography.md) | Five roles, 21 steps, three weight tiers | | [Colour](colour.md) | Three semantic families, one utility word each | | [Elevation](elevation.md) | Five shadow steps and six layers | | [Motion](motion.md) | What animates, and what deliberately does not | | [Right-to-left](rtl.md) | Arabic, Hebrew and Persian: what mirrors, what must not, and how to set it up | | [Icons](icons.md) | Lucide, sized by the parent, hidden unless it is the label | | [Accessibility](accessibility.md) | WCAG 2.1 AA as a build gate | Every number on these pages comes from `packages/tokens/`. If one disagrees with a token, the token is right and this page is stale — raise it. --- # Accessibility ## The gate is 2.1 AA, and it runs in CI `npm test` measures **every on-colour pair in the system, in both modes, for every brand** — 24 pairs per brand — and fails the build below 4.5:1. Body text is checked on `bg/app` and `bg/card`. The focus ring is checked at 3:1, because a focus indicator is a UI component and SC 1.4.11 asks for 3:1 rather than 4.5:1. A brand's ramp and its on-colours are generated, so the gate is what proves the generator right. It also asserts that it found 24 pairs: a token renamed out of coverage is a gate that passes while checking nothing. A brand colour is never rejected for being light. `fg/on/*-emphasis` is measured per brand and per mode: white where white carries, `palette/neutral/950` where it does not. The gate only fires when neither ink reaches 4.5:1 on that surface — see [Colour](colour.md). The standard is WCAG 2.1, not APCA. **Comply with 2.1, and where 2.1 says pass and the screen says otherwise, darken.** Never the reverse — the eye overrides upward only. ## Focus is a ring, and the ring is the only indicator `packages/tokens/theme.css` sets `:focus-visible { outline: none }` globally. That means a component with no `shadow-ring-focus` has **no visible focus at all** — there is no browser outline underneath to fall back on. ```tsx "outline-none focus-visible:shadow-ring-focus" ``` `shadow-ring-focus` is two rings: 2px of the page background, then 2px of brand. The inner ring is the offset, and it is what makes the indicator read on a card, on a toolbar, and on a coloured surface alike. See [Elevation](elevation.md) for why it lives in the shadow namespace. Keep the ring independent of the border. Switch is the pattern: its track border goes transparent when the switch is on, and the focus ring is a separate layer that is unaffected. The border is decoration; the ring is the indicator. ## Invalid: boxes take a border, marks take a ring | Control | Treatment | |---|---| | Input, Select, Textarea, Number, Password — anything in an `InputGroup` | `has-[[aria-invalid=true]]:border-line-input-invalid` on the group | | Checkbox, Radio, Switch | `aria-invalid:shadow-ring-focus-danger` | A box already has a border, so invalid recolours it. A mark has no border to recolour, so it gets a ring instead — and a checked checkbox keeps its fill while the ring carries the error. One mechanism per shape, decided once. ## Disabled contrast is 2.24:1 on purpose SC 1.4.3 exempts disabled controls, and the low contrast **is** the signal. Do not "fix" a disabled state to 4.5:1; it would then read as available. ## Motion Every animation honours `prefers-reduced-motion` — and honouring it means substituting, not deleting. A spinner that stops spinning looks broken. See [Motion](motion.md). ## Icons Decorative icons take `aria-hidden`. An icon-only button takes `aria-label`, because the icon sizes have no text child by definition and a screen reader announces nothing without it. See [Icons](icons.md). ## Per-component notes live with the component Each component's `guidance.json` carries an `a11y` array — the things an agent or a reviewer cannot infer from the `.tsx`. Button's says the focus ring is never removed, that `loading` sets `aria-busy` and must not stay activatable, and why its disabled contrast is 2.24:1. Those notes are published to `/llms-components.txt`, so they reach a model writing code as well as a person reading Storybook. **A component is not finished until its `a11y` array says something true.** --- # Colour ## Never a raw value ```tsx // ✗ never className="bg-[#007FAB] text-[#121926]" className="bg-blue-600" // no Tailwind palette colours className="bg-[var(--bg-primary-emphasis)]" // the escape hatch is not needed // ✓ always className="bg-surface-primary-emphasis text-content-neutral-emphasis" ``` **Never use a `palette/*` value in a component.** Palette exists to feed semantics; semantics are what components consume. ## Three families, three words Tailwind v4's `--color-*` namespace feeds `bg-`, `text-` and `border-` from one pool, so the three token families would collide on a shared name. Each gets a word that reads correctly with its own prefix: | Token family | Utility word | Example | |---|---|---| | `bg/*` (69) | **surface** | `hover:bg-surface-danger-subtle-hovered` | | `fg/*` (31) | **content** | `text-content-on-primary-emphasis` | | `border/*` (21) | **line** | `border-line-input-invalid` | | `status/*` (5) | status | `text-status-critical` | | `chart/1–6` | chart | `fill-chart-3` | Every semantic has a utility. **If you reach for `bg-[var(...)]`, the bridge is missing an entry** — add it to `packages/tokens/theme.css` rather than escaping. ## The chart series palette `chart/1–6` is a **series** palette, not a brand palette. They are different jobs: a brand palette is chosen so the colours belong together, a series palette so they can be told apart. IR's brand colours do not automatically do the second. Six slots, in fixed order — brand blue, IR red, indigo, IR purple, amber, pink. **The order is fixed and never cycled.** A seventh series is not a generated hue: fold the tail into one "Other", or use small multiples. Three colours are deliberately *not* series slots, and all three are still colours you can use elsewhere: | Colour | Why not a series | |---|---| | IR corporate blue | 7° from brand blue on the hue wheel — the same colour to anyone reading a chart | | IR lime | 20° from lime, and at L 0.85 it is outside the usable band in both modes; it has no in-range step | | teal | cannot clear blue in both light and dark at once | The steps come from `palette/vis/*`, which is referenced by `chart/*` and nothing else — so those ramps are tuned to pass the categorical checks rather than to match a brand swatch exactly. The whole set is validated in both modes against every pair, not just adjacent ones. Two residual warnings, both deliberate and both covered by the chart components: - **Amber and IR red separate by only ΔE ~7 under protanopia and deuteranopia.** That is inside the floor band, which is legal only with a second channel. The chart components always draw a legend from two series up, always carry a data table, and name every series in the tooltip. If you build a chart that does none of those and uses both slots, direct-label the lines. - **IR purple and pink fall below 3:1 against the dark card** (2.38 and 2.82). Same cover: a visible legend and a table. They clear 3:1 on the app surface. ## The chart scale `chart/1–6` carry **identity**. `chart/scale/1–5` carry **magnitude**, and the two never mix: the categorical slots are chosen to be maximally unlike each other, which is the opposite of what an ordered scale needs. One hue, five bands, from IR corporate blue. That hue was free: it had been a series slot until the re-step found it 7° from brand blue — the same colour to anyone reading a chart — so it carries no categorical job, it is the same in every brand, and it is not a status colour. | | Light | Dark | |---|---|---| | `chart/scale/1` | `ir-corporateblue/200` | `ir-corporateblue/950` | | `chart/scale/2` | `/400` | `/700` | | `chart/scale/3` | `/600` | `/500` | | `chart/scale/4` | `/800` | `/300` | | `chart/scale/5` | `/950` | `/50` | **Light runs light to dark; dark runs dark to light.** Nothing can sit below the surface it is drawn on, so in dark mode the quiet end has to be the dark end. A scale flipped from the light one would put the loudest cells nearest the background and the calmest ones shouting. The bands were picked by measuring, not by eye: the most even lightness spread the ramp allows, subject to the quietest band staying separable from the card behind it. Light lands on min adjacent ΔE 14.0 with the lowest band ΔE 13.1 from white; dark on min adjacent ΔE 17.7 with the lowest band ΔE 10.5 from the card. **Five bands, not a gradient.** Nobody reads a colour back to a number off a smooth ramp; they read it to a band and look that band up. Banding makes the legend honest and makes two cells of the same severity the same colour. Only `Heatmap` uses this today, and it is the one chart that colours by value — a cell has no length or height to encode with, so colour is the only channel it has. Anywhere a mark has a length, the length carries the magnitude and colour goes back to carrying identity. ## How a token is named ``` bg / danger / subtle / hovered │ │ │ └── state: hovered · pressed · (none = resting) │ │ └── prominence: emphasis · subtle · muted │ └── intent: primary · neutral · danger · success · warning · info └── family ``` `fg/on/` is the foreground guaranteed to pass contrast on that surface — `text-content-on-primary-emphasis` sits on `bg-surface-primary-emphasis`. ## The neutral ramp runs subtle → muted → emphasis Prominence is contrast: **subtle** is the quietest fill, **muted** is one palette step stronger, **emphasis** is the solid. `bg/neutral` has the same shape as `bg/primary`, `bg/danger` and the other status ramps (50 → 100 → 600 there; 50 → 100 → 800 here), and hover and pressed are one and two steps further on. | Light | rest | hover | pressed | |---|---|---|---| | `bg/neutral/subtle` | 50 | 100 | 200 | | `bg/neutral/muted` | 100 | 200 | 300 | | `bg/neutral/emphasis` | 800 | 900 | 950 | | `bg/sidebar` | 100 | 200 | 300 | | Dark | rest | hover | pressed | |---|---|---|---| | `bg/neutral/subtle` | 800 | 700 | 600 | | `bg/neutral/muted` | 700 | 600 | 500 | | `bg/neutral/emphasis` | 100 | 50 | white | | `bg/sidebar` | 950 | 900 | 800 | Until 2 Oct 2026 light `muted` was white and dark ran 950 then 900 — muted was lighter than subtle in light, and in dark the order ran away from contrast. **What each step is seen on.** The page is neutral-50 in light and 900 in dark; a card is white and 800. | | on the page | on a card | |---|---|---| | `subtle`, light | matches it (1.00) | faint (1.05) | | `subtle`, dark | shows (1.21) | matches it (1.00) | | `muted` | shows in both themes | shows in both themes | | every hover and pressed | shows | shows | So `subtle` matches one surface in each theme and shows on the other; `muted` is the first step that is seen everywhere. Before the change nine hover and pressed states were invisible on one surface in dark (a ghost button's hover on a card, a menu item's focus and a table row's hover on the page); none are now. **A resting fill that has to be seen takes `muted`.** Secondary Button, the subtle neutral Badge, Avatar's fallback, Kbd, the active Tab, a read-only Input or Textarea, the Table header, Select's count, File upload's icon tile and the Stepper's current number all rest on `bg/neutral/muted`, so they show on the page and on a card in both themes (1.08 / 1.12 in light, 1.71 / 1.42 in dark). Secondary Button hovers and presses along the muted ladder. Two things follow and are accepted: an active Tab is the same fill as a hovered one, and a Table header is the same fill as a hovered row — text weight and position tell them apart. The Stepper's *incomplete* number stays on `subtle`: its text is `fg/neutral/subtle`, which on the muted fill falls to 2.2:1 in dark. `subtle` is left for hover (`subtle-hovered`, `-pressed`) on things that are transparent or card-coloured at rest. **A fill that should match the card takes `bg/card`**, not a neutral step. The outline Button, a selected Chip, the outline Badge, the Avatar add button and the Stepper's empty indicator all rest on `bg/card` and hover through `bg/neutral/subtle-hovered` and `-pressed`. Light is pixel-identical to before. **Anything on the sidebar takes `bg/sidebar-hovered` and `bg/sidebar-pressed`**, never the neutral pair. The rail is neutral-100 in light, which is what `bg/neutral/subtle-hovered` and `bg/neutral/muted` resolve to — a hover that equals its surface cannot render. ## Tracks and skeletons take `bg/layer/*` `bg/layer/*` is a translucent tint of the ink colour (white in dark), so it runs in contrast order and reads the same on the page, on a card and on a tinted panel. It is for neutral fills that are part of a picture rather than a control: tracks, empty segments, skeletons, wells. | Contrast with what is behind it | subtle | muted | emphasis | |---|---|---|---| | Light | 1.08 | 1.17 | 1.34 | | Dark | 1.14–1.17 | 1.33–1.38 | 1.75–1.80 | Thin things take `emphasis` (Progress, Slider and File upload tracks, Meter's empty segments); large areas take `muted` (Skeleton). **Never use a state token for a resting fill.** `-hovered` and `-pressed` describe an action. If a pressed token is the only one that shows, the element wants `bg/neutral/muted` or `bg/layer/*`. ## Dark mode is free Semantics alias primitives, and **dark mode overrides semantics** while the theme axes override *primitives*. That asymmetry is what lets five axes and two modes compose by cascade instead of being authored as ten sets. A component that uses semantic utilities gets dark mode without a single `dark:` class. ## Brands Picasso is multi-brand: a brand supplies its own brand and accent ramps and inherits everything else. ## A surface does not have to carry white `fg/on/*` is measured, never chosen. For every `bg//emphasis`, the build asks which ink reaches 4.5:1 on it and writes that one: white where white carries, `palette/neutral/950` where it does not. | Surface | `fg/on/*-emphasis` becomes | At | |---|---|---| | `#007FAB` | white | 4.54:1 | | `#F59E0B` | neutral-950 | 9:1 | | `#A3E635` | neutral-950 | 12.82:1 | | `#FFD60A` | neutral-950 | 13.69:1 | So a brand colour is never rejected for being light. It gets dark ink, and the button is still a button. This is the one semantic that may differ per brand — everything else aliases a primitive, so re-pointing `--palette-brand-600` carries the whole system with it. **If a brand seems to need some other semantic overridden, the ramp is wrong.** A generated ramp rarely needs the flip at the steps a button is painted with: lightness comes from a fixed ladder, so 600–950 land dark enough to hold white whatever the hue, and the base colour contributes hue and chroma. The flip is what carries a **pinned** ramp — eleven stops supplied by Marketing, where any value is possible — the lighter steps, and status colours like amber. The one real failure is a surface that neither ink reaches: white below 4.5:1 *and* neutral-950 below 4.5:1. That colour has to move, and `npm test` says so. `npm test` measures every on-colour pair against its own surface, in both modes, for every brand — so a ramp that drifts a step lighter fails the build rather than an audit. See `AGENTS.md` → Adding a brand. ## ⚠️ Unresolved: the brand ramp **All eleven brand stops disagree between Figma and the repo**, and the repo is probably right — IR's own note records `brand.600` as `#007FAB`, the repo's value. Until Marketing settles it, treat published brand hexes as provisional. Everything else in this page is stable. --- # Elevation Picasso separates two things most systems bundle together. **Shadow** says how far a surface sits off the page. **Layer** says what covers what. A component usually needs one or the other, and a few need both. ## Layers Six rungs. Every one of them is a token in `core.json` under `layer/*`, and a utility in `theme.css`. ![The six Picasso layers, from the page at 0 up to notification at 3200](/diagrams/foundations/elevation-layers.svg) | Token | Value | Utility | |---|---|---| | `layer/base` | 0 | — the page is already 0 | | `layer/raised` | 100 | `z-raised` | | `layer/overlay` | 800 | `z-overlay` | | `layer/modal` | 1600 | `z-modal` | | `layer/floating` | 2000 | `z-floating` | | `layer/notification` | 3200 | `z-notification` | The gaps are the point: anything that needs to sit between two rungs has room to, without renumbering what is already there. ### Floating outranks modal A tooltip, popover, select menu or dropdown is portalled to the document body. One opened from inside a dialog is no longer inside it, so it has to carry a layer that clears the dialog — otherwise the menu you just opened is behind the thing you opened it from. Floating is therefore above modal, not below it. ### The scrim is below the thing it dims `overlay` at 800 sits under `modal` at 1600, so a dialog covers its own scrim by number rather than by which of them the browser paints first. ### Reaching a layer Use the utility. `z-[1600]` is refused by `no-arbitrary-values`, and a bare `z-50` is a number outside the system. A rung that does not exist yet is added to `layer/*` in `core.json` and given an `@utility` in `theme.css`; Tailwind has no `--z-index-*` namespace, so layer utilities are written out rather than generated from the theme. ## Shadows Five steps. Each is two drop layers and an inset, generated from `_shadow/*` in `light.json` and `dark.json`. Figma's effect styles bind to the same colours. | Step | Carries | |---|---| | `shadow-xs` | Card, Kbd, Slider — a resting surface lifted off the page | | `shadow-sm` | Switch, Tabs, ThresholdSlider — a small raised affordance | | `shadow-md` | DropdownMenu, Select, Toast, Overlay | | `shadow-lg` | Drawer, Popover, Overlay | | `shadow-xl` | The deepest step, for a surface above all of those | Overlay appears twice because its variants carry different depth, and Dialog takes its shadow from Overlay rather than setting one. Four more belong to the embeddable widget — `shadow-widget-panel`, `-notification`, `-screen`, `-smooth`. They carry that product's depth rather than the system's. ### Light and dark carry depth differently In light mode a shadow is a drop shadow: near-black at 4–12% over two layers, with the inset fully transparent. In dark mode the drop layers run at 40–60% of pure black, and the inset becomes a visible white top highlight — from `#FFFFFF0A` at `xs` to `#FFFFFF14` at `xl`. Depth in dark mode is carried as much by the lit top edge as by the shadow beneath. The token knows both. A hand-written shadow does not. ### Focus rings share the namespace A focus ring is a composite too, so it lives with the shadows: `shadow-ring-focus`, `shadow-ring-focus-danger`, `shadow-ring-focus-inset`. `ring-focus` is two rings. The inner 2px is the page background — neutral-50 in light, neutral-900 in dark — and the outer 2px is brand. The inner ring is the offset, and it is what makes the indicator read on a card, a toolbar and a coloured surface alike. Which control takes a ring and which takes a border is in [Accessibility](accessibility.md). ## Where the values are `layer/*` in `packages/tokens/tokens/core.json`; `_shadow/*` and `shadow/*` in `light.json` and `dark.json`; the utilities in `packages/tokens/theme.css`. Resolved values for both modes are in `/llms-tokens.txt`. --- # Grid, spacing and radius ## The grid **Picasso is a 4pt grid with 2pt half-steps.** Legal values are every multiple of 4, plus 2, 6, 10 and 14. Anything else — 5, 13, 18 — is drift. ## Spacing The primitive scale is **Tailwind's, unmodified**: `--space-1` is `0.25rem` and the ladder runs 0 → 96. Engineering inherits it for free, and Tailwind's own `--spacing` is fed from that single number, so every `px-`, `gap-`, `h-` and `w-` utility derives from one value. ```css --spacing: var(--space-1); /* 0.25rem */ ``` Every ladder step is also a **named** Tailwind key (`p-4` reads `--space-4`), so a brand or preset can move the whole ladder at once. The spacing presets — `compact` ×0.875 and `relaxed` ×1.25 — scale every step and round it to the 2px grid (`space/4` is 14 · 16 · 20px). See [Tokens, brands and Figma sync](tokens-and-brands.md). **Do not pick from all 35 steps.** Eight do the real work: | Step | px | Used for | |---|---|---| | `0.5` | 2 | hairline offsets | | `1` | 4 | tightly related lines — label to hint | | `1.5` | 6 | icon to label inside a small control | | `2` | 8 | icon to label, inside a control | | `3` | 12 | control padding | | `4` | 16 | between labelled groups, container padding | | `6` | 24 | page gutters | | `8` | 32 | between page sections | `space/36`–`space/96` (144–384px) are layout measurements, not component spacing. They stay in the repo and are scoped out of Figma's pickers. ## Radius **Radius is one knob.** `--radius` drives all eight steps proportionally, so a theme changes one number rather than eight. ```css :root { --radius: 0.625rem; } /* 10px */ [data-radius="sharp"] { --radius: 0; } [data-radius="subtle"] { --radius: 0.375rem; } /* 6px */ [data-radius="rounded"] { --radius: 1rem; } /* 16px */ ``` At the default theme that resolves to: | Utility | Derivation | px | Used by | |---|---|---|---| | `rounded-xs` | `--radius × 0.2` | 2 | nested elements inside a control | | `rounded-sm` | `× 0.6` | 6 | checkbox, small indicators | | **`rounded-md`** | `× 0.8` | **8** | **Button, Input, Select, Tabs, Chip** | | `rounded-lg` | `× 1` | 10 | — | | `rounded-xl` | `× 1.4` | 14 | Card, Dialog, Popover, Drawer | | `rounded-2xl` | `× 1.6` | 16 | marketing blocks | | `rounded-3xl` | `× 2.4` | 24 | — | | `rounded-4xl` | `× 3.2` | 32 | — | | `rounded-full` | — | — | Badge, Avatar, Switch track, status dot | **Never hard-code a corner.** A literal `rounded-[8px]` survives the default theme and breaks every other one. > ⚠️ This ladder is **shadcn's**, not Tailwind's. Tailwind's is 2/4/6/8/12/16; > ours derives from the single `--radius` knob, which is what makes radius > themeable. The Figma `radius/*` variables carry the same eight numbers. --- # Icons ## One library **Lucide, and nothing else.** A second icon library means two stroke weights, two grid sizes and two ideas of what a chevron looks like, and the seam shows in every toolbar. In Figma the library is the `Lucide Icon/*` component set, and the name maps straight through: `Lucide Icon/AArrowDown` is ``. There is nothing to translate. ## The parent sets the size Icons are sized by the component that holds them, not by the icon: ```tsx // ✓ the control owns the size "inline-flex items-center gap-2 [&_svg]:size-4" // ✗ not on each icon ``` Three sizes, and that is the whole scale: | Size | px | Where | |---|---|---| | `size-4` | 16 | The default — buttons, menu items, inputs, almost everything | | `size-3.5` | 14 | Dense controls where 16 crowds the text | | `size-3` | 12 | Inline marks inside a small control | A size outside this set is outside the system. ## Stroke weight is Lucide's, with one exception Never set `strokeWidth` — except on a check mark, which takes `strokeWidth={3}`. At 12–16px a tick drawn at Lucide's default 2 reads as a smudge rather than a confirmation, and it is the one glyph where that matters. ## Every icon is hidden unless it is the label ```tsx // decorative — the text beside it already says this // the only thing there — the button needs a name ``` A screen reader announcing "image" between every menu item and its text is noise. An icon-only button with no `aria-label` announces nothing at all. Both are in [Accessibility](accessibility.md). ## Direction Icons that encode direction — chevrons, arrows, back and forward — mirror in RTL. Clocks, check marks, logos and media controls do not: a clock running backwards is wrong in every locale, and a play triangle points at the timeline, not at the reading order. The mechanism is `.rtl-mirror`, defined in `packages/tokens/theme.css`: ```css [dir="rtl"] .rtl-mirror { transform: scaleX(-1); } ``` Put it on the icon itself, not on a wrapper — the transform mirrors the glyph, not the space around it. An Accordion chevron, a Breadcrumb separator and a Drawer's back arrow all take it. --- # Motion, before and after The rules in [Motion](motion.md) are easier to believe when you can watch them. Each one here is a pair: the wrong way on the left, what Picasso does on the right, and one button that plays both at once. Turn on **Slow motion** to run both sides five times longer. Most of these differences are a few frames long, and that is the point — they are felt before they are seen. Three of the left-hand sides are not invented. They are what Picasso itself did until 7 October 2026, and they are marked. Reading this on GitHub, the examples do not play. They are on the docs site, and in Storybook under **Foundations / Motion before and after**. ## Data does not move for style **Before** — `Count-up over 1.2s, bars grow over 800ms`. **Now** — `No animation`. The value is there when the tile is. This is the first question for anything that might move — should it move at all — and for data the answer is no. Someone opens a dashboard to read a number: is the fleet healthy, how many trunks are down. For the first second, a tile that counts up shows numbers that are not true. A quarter of a second in, the example reads about 780 trunks reporting; the answer is 1,284. On a monitoring console it is worse than slow, because here movement means change. A bar that is growing reads as a metric that is rising. And it does not happen once: it replays on every load, every filter and every refresh, to someone who is on this screen all day. So charts, KPI tiles, sparklines and meters appear with their values, and a value that updates changes at once. ## Nothing starts slowly **Before** — `In 200ms cubic-bezier(0, 0, 0.2, 1), out 150ms cubic-bezier(0.4, 0, 1, 1)`. Picasso's Dialog did this until 7 October 2026. **Now** — `animate-dialog-in, animate-dialog-out`. Both decelerate on `motion/easing/out`: 200ms in, 150ms out. Watch the first moment after Close. The old closing curve was an ease-in: it starts slowly and leaves at speed. That sounds right for something going away, and it is wrong for a reason you can measure. A third of the way through its time, the old close had covered about a sixth of the distance. The new one has covered seven eighths. Those first frames are the ones that matter. They come straight after the click or the Escape, when the person is looking at the dialog and waiting for it to answer. An ease-in spends them barely moving, so the dialog seems to hesitate before it goes. Leaving still feels quicker than arriving. It does that by taking the shorter step — 150ms against 200 — not by accelerating. There is no ease-in anywhere in the system now, and a test fails if one is added. ## Nothing appears from nothing **Before** — `scale(0) to scale(1)`. **Now** — `animate-popover-in: scale(0.96) and a fade`. Both sides take the same 150ms on the same curve. The only difference is where they start. From zero, the panel passes through every size on its way to full size, so what the eye follows is the growing — a shape flying outwards — and the words inside cannot be read until it stops. Closing is the same in reverse: the menu shrinks to a dot, and the dot is where the eye is left. From 96%, the panel is already its own shape in its own place. The fade does the arriving. The scale is only there to give it a direction. ## An anchored panel grows from its trigger **Before** — `transform-origin: center`. **Now** — `transform-origin at the trigger`. On a real component that is the origin Radix publishes, such as `origin-(--radix-popover-content-transform-origin)`. This one is small on purpose. Four percent of a menu is a few pixels, so turn on slow motion to see it. From its centre, a menu appears beside its button. From the corner nearest the trigger, it comes out of the button. That is what ties a panel to the control that opened it, and it matters most in a toolbar or a table, where several similar buttons each have a menu of their own. It applies to Popover, Dropdown menu, Select's menu and Tooltip. A Dialog is the exception: it is centred on the page and anchored to nothing, so it scales from its centre. ## 300 is the ceiling **Before** — `500ms ease-in-out, both ways`. **Now** — `animate-drawer-in-end, animate-drawer-out-end`. 300ms in and 200ms out, on `motion/easing/drawer`. Half a second each way is a second of waiting for every look, and a drawer is opened dozens of times in a shift. The curve does more than the number. A tenth of a second in, the slow drawer has moved about 8% of the way. The Picasso drawer has moved 88%, because the sheet curve covers most of the distance at once and spends the rest settling. It can be read almost as soon as it is asked for. Nothing in the interface takes longer than 300ms. The scale has three durations — 150, 200 and 300 — and it is closed: a request for a fourth is a request to make something slower. ## Only transform and opacity move **Before** — `transition: width 200ms`. Picasso's Sidebar did this from 2 to 7 October 2026. **Now** — `No transition`. The rail changes width at once. Each example counts how many times the page beside the rail changed size. Animated, it is about twelve — once for every frame of the transition. Changed at once, it is one. In the example the page is four empty boxes, so twelve resizes cost nothing. In Clarion it is charts and tables. Every one of those resizes is every chart measuring itself and drawing again, twelve times, for a transition nobody asked to watch. `transform` and `opacity` do not touch layout, which is why everything else that moves in Picasso moves on those two. There is no transform that makes a rail narrower without squashing what is in it, so the rail does not animate. The one exception is the Accordion's height. Nothing else opens a row, the height is measured rather than guessed, and it is kept to 200ms. ## A press, not a hover **Before** — `hover: scale(1.05), nothing on press`. **Now** — `transition-press, active:scale-97`. Hover changes colour; a press scales the control to 97%. There is no play button here. Move across each button, then press and hold it. Hover is not a decision. On a dense screen the pointer crosses a dozen controls on its way to the one it wants, and each of them would twitch as it passed. A control that grows also moves its own edges under the pointer and leans into its neighbours. And a finger has no hover at all. A press is a decision, and it deserves an answer. The button gives 3% for as long as it is held, and the label and icon go with it — that is what makes it read as a press and not as a colour change. `Button` and a pressable `Chip` do this. A text link does not, and neither does a button inside a `ButtonGroup`, where one member pulling away from its neighbours looks like the group coming apart. ## Reduced motion is a fade **Before** — `No animation`. Picasso did this until 7 October 2026: every surface appeared and vanished at once. **Now** — `A 150ms fade, in place`. Both sides show what someone who has asked for reduced motion sees. The setting asks for less movement. It does not ask for less information. Sliding and scaling are what cause trouble, and a change in opacity is not movement. A drawer that is simply there, with nothing connecting it to what opened it, is harder to follow than one that fades in where it will sit. So every named animation carries its own reduced-motion version, and in it the travel and the scale are replaced by a short fade. Because it is built into the animation, a component cannot forget it. Two things stay as they were. Following a finger is not animation, so a dragged sheet still tracks the pointer. And the Loader substitutes rather than stops, because a spinner that does not spin looks broken. ## How these are built The right-hand side of every pair is the real named animation from `@ir/tokens/theme.css`, on the same `data-state` that Radix sets. It cannot drift from what ships. The left-hand side cannot be written as a class, and that is the linter doing its job: an ease-in, a 500ms duration and an animated width are all refused. They live in `packages/ui/.storybook/motion-specimens.css` as `data-specimen` rules — in Storybook only, never in the package, and never somewhere a component can reach for them. If your system asks for reduced motion, the left-hand examples stay still and the right-hand ones fade. A page about motion honours the setting it describes. The rules themselves, the tokens and the full list of named animations are in [Motion](motion.md). --- # Motion IR's products are consoles. Someone runs one for a shift, and opens the same drawer dozens of times before lunch. So motion here has one job: make the interface feel like it heard you, and then get out of the way. Picasso animates five things: surfaces that open and close; a press; colour; the Loader; and illustrations. Everything else changes at once — and for most of the interface, that is the right answer. Each rule on this page can be watched, wrong way beside right, in [Motion, before and after](motion-before-and-after.md). ## Should it move at all? Decide this first. It is allowed to end the conversation. **How often is it seen in a working day?** | Seen | Decision | |---|---| | Hundreds of times: a keyboard shortcut, moving through a table, switching pages | Nothing moves — not a short animation, none | | Dozens of times: a hover, a toggle, a filter chip, a tab | Colour only, or a change small enough to be felt rather than seen | | Now and then: a dialog, a drawer, a toast, a sheet | A named animation | | Rarely: first run, an empty state, a long job finishing | The one place a longer or warmer moment is allowed | Anything a keyboard triggers is in the first row, whatever it is. **What is it for?** It has to be one of four things: *feedback* (the interface heard the press), *where it came from* (a panel grows from its trigger, a toast leaves by the edge it arrived at), *what changed* (a row opened, a switch moved), or *bridging a jump* (something would otherwise appear with no connection to what caused it). "It looks good" is not one of them. **Is anyone reading it?** Data does not move for style. A chart does not draw itself in, a KPI does not count up, a table row does not slide. ### What does not move, and why Each of these was considered and turned down. | Not animated | Why | |---|---| | Charts, KPI tiles, sparklines, meters | Someone is reading the number | | The Sidebar's rail changing width | Width is a layout property: the page beside it would re-lay out on every frame | | Sidebar items, table rows, calendar days | Seen hundreds of times a day | | Tabs and the Segmented control | Navigation and view switches, used all day — colour only | | KPI rows and chart grids arriving | The dashboard is the product, not an entrance | | Anything on hover, beyond colour | A control that lifts or grows under the pointer is noise at this density | ## The scale Three durations and four curves, as tokens (`motion/*` in `core.json`, emitted as `--motion-*`). The scale is closed: a request for a fourth duration is a request to make something slower. | Token | Value | For | |---|---|---| | `motion/duration/fast` | 150ms | Small things, and leaving: a press, a popover or tooltip both ways, a dialog closing. Every fade that stands in for travel under reduced motion | | `motion/duration/base` | 200ms | Arriving: a scrim, a dialog, an accordion row. A drawer, toast or sheet leaving | | `motion/duration/slow` | 300ms | A surface travelling its own length: a drawer, toast or sheet sliding in. The ceiling | | `motion/easing/out` | `cubic-bezier(0.23, 1, 0.32, 1)` | The default — arriving, leaving, a press | | `motion/easing/in-out` | `cubic-bezier(0.77, 0, 0.175, 1)` | Something already on screen that moves or changes shape | | `motion/easing/drawer` | `cubic-bezier(0.32, 0.72, 0, 1)` | A sheet sliding from an edge. Illustrations' lift uses it too | | `motion/easing/settle` | `cubic-bezier(0.3, 1.35, 0.5, 1)` | A dragged surface coming back to where it was | `motion/easing/enter` and `exit` are deprecated. Both now equal `out`, and both go in the next major release. The curves are stronger than the CSS keywords of the same names, and that is deliberate: the keyword `ease-out` barely decelerates, so nothing reads as intended. Tailwind's own `ease-out` and `ease-in-out` classes are re-pointed at the tokens, so a class that says `ease-out` means the system's. ## The rules **Nothing starts slowly.** Arriving and leaving both decelerate on `easing/out`. There is no ease-in anywhere: a curve that starts slowly holds back the first frames, which are the ones someone is watching. Leaving feels quicker because it takes the shorter step, not because it accelerates. **Nothing appears from nothing.** A surface scales from 96% with a fade, never from zero. **An anchored panel grows from its trigger.** Popover, Dropdown menu, Select's menu and Tooltip point `transform-origin` at the origin Radix publishes (`origin-(--radix-popover-content-transform-origin)` and its siblings), so a menu opening below-left of its button grows from that corner. A Dialog is centred and scales from its centre — it is not anchored to anything. **Only `transform` and `opacity` move.** Never `width`, `height`, `margin`, `padding`, `top` or `left`: they re-lay out the page on every frame, and the page is charts. The Accordion's height is the one exception — nothing else opens a row, Radix measures the height so it never animates to `auto`, and it is kept short. **Keyframes for what mounts, transitions for what stays.** Radix removes a closing surface on `animationend` and does not wait for a transition, so everything that opens and closes is a keyframe animation that holds its last frame. Anything that stays on the page and changes state — a switch, a pressed button, a progress bar — is a transition, because a transition can be interrupted halfway and carry on from where it is. **It travels its own length.** `translateX(100%)`, never a pixel count. **Hover is colour.** Nothing changes size or position on hover. ## The named animations A component never states a duration or a curve. `theme.css` composes the tokens into named animations, and the component asks for one: | Utility | Used by | Timing | |---|---|---| | `animate-fade-in` · `-out` | The scrim behind Dialog, Drawer and Bottom sheet | base in · fast out | | `animate-dialog-in` · `-out` | Dialog, and the expanded Drawer | fade and scale from 96%: base in · fast out | | `animate-popover-in` · `-out` | Popover, Dropdown menu and its submenus, Select's menu, Tooltip | fade and scale from 96%, from the trigger: fast both ways | | `animate-drawer-in-end` · `-out-end` (and `-start`) | Side Drawer, the Sidebar's phone nav | slide from its edge, the other way in RTL: slow in · base out, on `easing/drawer` | | `animate-sheet-in` · `-out` | Bottom sheet | slide from the bottom edge: slow in · base out, on `easing/drawer` | | `animate-toast-in` · `-out` | Toast | fade and slide from the inline end: slow in · base out | | `animate-accordion-down` · `-up` | Accordion content | height and a fade, to the height Radix measures: base in · fast out | Applied on Radix's `data-state`, with no `motion-safe:` in front: ```tsx "data-[state=open]:animate-dialog-in data-[state=closed]:animate-dialog-out" ``` The anchored surfaces take the fast step both ways. They are small and open under the pointer, so anything longer reads as lag. Three details the table does not show: - **A Tooltip animates its delayed open only.** Moving along a row of triggers, Radix opens the next tooltip at once; a fade on each would make the row feel slower. - **A Toast follows a swipe.** It tracks the finger, carries on from where it is let go and settles back if the swipe is abandoned. In RTL the slide mirrors in CSS and `ToastProvider` turns the swipe round from the direction provider. - **A Bottom sheet follows a drag.** Released past a quarter of the panel, or thrown, it goes; short of that it comes back on `easing/settle` (`transition-settle`), which overshoots a couple of percent so the return reads as weight. To add one: a `@keyframes` and an `@utility` in `theme.css`, built only from the tokens, with its reduced-motion branch inside it. Then this table, the list in `packages/ui/src/__tests__/motion.test.ts`, and the changelog. ## The press A pressable control gives a little under the pointer. `Button` and an interactive `Chip` scale to 97% while they are held down, and the label and icon go with them — that is what makes it read as a press rather than a colour change. ```tsx "transition-press motion-safe:active:scale-97" ``` `transition-press` is the colours a control already animated, plus `scale`, on the fast step. It names its properties: Tailwind's bare `transition` animates eighteen of them. Not everything pressable presses. A text link does not shrink. A Button inside a `ButtonGroup` does not either — one member pulling away from its neighbours reads as the group coming apart. Tabs, sidebar items and table rows are navigation, and answer with colour. ## Things that move in place A switch's knob, a chevron turning, a progress bar. These are transitions on `transform`, and they state a curve but not a duration — the default is the fast step: ```tsx "transition-transform ease-out motion-reduce:transition-none" // a knob, a chevron "transition-transform ease-linear motion-reduce:transition-none" // a bar reporting progress ``` Progress is linear because it is reporting something; progress does not ease. A dragged surface returning to rest is the third: ```tsx "motion-safe:transition-settle" // a sheet let go short of the threshold ``` `transition-settle` transitions `translate` — not `transform` — on the base step and `easing/settle`. The two compose rather than conflict, which is what lets a dragged panel keep its offset while an exit animation drives `transform`; transitioning `transform` here animates nothing at all. It sits under `motion-safe:` rather than carrying `motion-reduce:transition-none`, because the drag itself still tracks the finger under reduced motion and only the release is switched off. ## Reduced motion Reduced motion means gentler, not absent. A surface that simply appears, with no connection to what opened it, is harder to follow, not easier. So every named animation carries its own `prefers-reduced-motion` branch, and under it travel and scale are replaced by a fade on the fast step. A drawer does not slide; it fades in where it will sit. A dialog does not scale; it fades. That is why a component writes no `motion-safe:` on them — the substitution is part of the animation, and cannot be forgotten. What that leaves to the component: - **A transition carries `motion-reduce:transition-none`.** The knob changes sides without travelling. - **A press scale sits under `motion-safe:`.** The pressed colour still answers. - **Following a finger is not animation.** A dragged sheet and a swiped toast track the pointer under reduced motion too; only the settle is switched off. - **The Loader substitutes rather than stops.** A spinner that does not spin looks broken, so travel becomes a slow cross-fade. ## In Figma Nothing moves on canvas. Figma carries the motion tokens as variables — the durations as numbers in milliseconds, the curves as strings — hidden from pickers. A static frame cannot show a transition, so the tokens are the spec, and a motion change has no Figma impact beyond a variable's value. ## Colour transitions A control with a hover or focus colour carries `transition-colors` and nothing else. It states no duration and no curve: `theme.css` sets Tailwind's defaults to `motion/duration/fast` and `ease`, the curve for a colour change. Tabs, Sidebar, Calendar and every input do this. ## The Loader The one piece of authored motion. Its seven utilities are declared in `packages/tokens/theme.css` rather than in `@ir/ui`, because the package ships no CSS of its own and every consuming app already imports the tokens: | Utility | Timing | |---|---| | `animate-loader-turn` | 3s linear, infinite | | `animate-loader-reach` | 1.5s `cubic-bezier(0.45, 0, 0.55, 1)`, infinite | | `animate-loader-fade` | 1.8s ease-in-out, alternating | | `animate-loader-pulse-l` · `-m` · `-r` | 1.3s ease-in-out, infinite | | `animate-loader-pulse-fade` | 1.4s ease-in-out, alternating | The two Fuse periods — 3s and 1.5s — are out of phase on purpose, so the gesture never lines up with itself. In Pulse, the outer dots swell as they spread while the middle swells as they close; three dots scaling together is a bounce, which is a different component. Skeleton pulses through Tailwind's own `animate-pulse`. ## Illustrations Product illustrations answer the pointer. It is the one place Picasso moves something because a person pointed at it. On marketing pages and in docs the picture listens to the pointer itself. Inside the console it stays still — an empty state takes `interactive={false}` — with one exception, the list card, below. There are three mechanics, one per kind of response. A drawing carries one. | Mechanic | What happens | Timing | |---|---|---| | **Lift** | A discrete change. The gap follows the pointer and shapes slide to make room. | `transition-illustration`: 600ms on `motion/easing/drawer`, 50ms stagger | | **Magnify** | A continuous one. Each shape swells by its distance from the pointer. | A spring per shape: stiffness 170, damping 22, mass 1 | | **Sequence** | A stepped loop while the pointer is over the picture. One shape is lit at a time. | `animate-illustration-check`: 2.4s `step-end`, a quarter each · `animate-illustration-flow`: 0.9s linear | | Mechanic | Drawings | Reach for it when the picture shows | |---|---|---| | **Lift** | `issue-alerts` · `search-results` · `dashboards` | A list or a set where one item is the point: alerts, results, widgets | | **Magnify** | `fleet-health` · `topology` · `team-access` | A field of many: endpoints, systems and their links, who can do what | | **Sequence** | `call-readiness` · `activity-log` · `integrations` · `assistant` | Steps in order feeding one answer: checks, a history, a connection, a question | Lift and sequence are CSS, declared in `packages/tokens/theme.css` beside the Loader's. Magnify is a spring, which cannot be written as a transition, so it runs in `illustration.tsx` and writes one attribute per shape per frame. Three rules hold all of them together: - **The layer that listens never moves.** Hover is read from a still, transparent layer and resolved against where the shapes now are. A handler on a shape that slides out from under the pointer flickers at every edge. - **One accent, and it moves.** The open alert, the nearest endpoint, the check that is running. It never spreads to several shapes. - **Nothing is said only on hover.** The picture is decoration; the heading beside it carries the meaning. Under reduced motion nothing travels. Lift changes state without the slide, magnify moves the accent and leaves the sizes alone, and sequence does not run — the drawing at rest already says what it means. ### List cards A list card is a row in a list of things a person can open — an alert rule, a fleet, a saved search — with an illustration cropped into its trailing corner. It is the one place a picture moves inside the console, and it is allowed because the card, not the picture, is the control: the card is what opens, and the picture answers the card. - **The card owns the hover.** The picture listens to nothing; the card passes `active` and the drawing plays its own response — lift opens the next item, magnify swells around the flagged shape, sequence runs. - **It waits for the pointer to settle.** `active` turns on after the pointer has rested on the card for 120ms, so a pointer crossing a list on its way somewhere else moves nothing. Leaving turns it off at once. - **Keyboard focus turns it on straight away.** `:focus-visible` on the card sets `active`; blur clears it. - **The card itself only changes colour.** Its border takes `border/primary/muted` on hover. The picture rises 4 inward and 8 up inside its crop, on `transition-illustration`; the card does not move. - **The rise mirrors with the crop.** In RTL the picture sits in the card's start corner, so the inward rise takes an `rtl:` twin with the sign turned. The drawing itself never mirrors. - **Nothing is said only by the picture.** The card's title, badge and meta carry the meaning, so the picture is `label={null}`. Under reduced motion the card still recolours, the picture does not rise, and the drawing changes state without travelling — the same fallbacks as above. ## Outside the scale The Loader's and the illustrations' timings are authored for those two things and are not part of the scale: `transition-illustration` on a Dialog is as off-system as `duration-300`. So a component that wants motion uses one of the named animations above, `transition-press`, `transition-colors` or `transition-transform` — or does without, and says which in a comment. Do not reach for `duration-300` or an arbitrary `ease-[…]`: the linter refuses the arbitrary value, and a bare Tailwind duration is a number outside the system. If a new surface needs to move, add a named animation to `theme.css` built from the `motion/*` tokens. ## Building and checking motion Three skills in `.agents/skills` carry these rules for an agent: `ir-motion` builds, `ir-motion-review` reviews a diff or the whole repo, and `ir-motion-opportunities` looks for places that should move and turns down the ones that should not. `packages/ui/src/__tests__/motion.test.ts` is the part a machine can check: no curve that starts slowly, nothing over 300ms, no layout property, and a reduced-motion branch on every named animation. jsdom cannot play an animation. Before calling motion done, run it in a browser, slow it down five times, turn on reduced motion, and set `dir="rtl"` if anything travels sideways. --- Picasso makes two promises about width, and they are not the same promise. **Desktop, 768 and up.** Every component fits any container in this range. A page can put anything in any column at any width the ladder reaches, and nothing runs past its box. This is the contract the library is built to. **Phone, 360 to 767.** A narrower contract that named components honour and declare. It is not assumed: a component is phone-ready when it says so, and `BottomSheet` and the sidebar's phone nav exist because specific products needed it. Anything that has not claimed the phone contract may still work — it is simply not promised. 360 is the floor because it is the narrowest viewport in common use. Below it, nothing is guaranteed. ### The phone canvases Four widths to draw at, as `screen/mobile/*`. They are **canvases, not breakpoints** — below `md` (768) there is one layout, so a phone has no breakpoints to name. They are deliberately off Tailwind's t-shirt ladder, because `lg` has to mean 1024 wherever it appears; these say where they sit in the range instead. | Token | Width | What it is | |---|---|---| | `screen/mobile/min` | 360 | The floor, and the width every `Narrow` story is cut from — 328 after gutters. Nothing may break here; it is not a size to design at | | `screen/mobile/small` | 375 | iPhone SE and the iOS baseline — the iOS case to check, not a second floor | | `screen/mobile/base` | 390 | **The canvas to design at.** iPhone 14/15, modern Android mid-range | | `screen/mobile/max` | 428 | The ceiling — Pro Max, large Android. Past this a phone layout stops growing rather than stretching | The breakpoints are `screen/desktop/*`, which do carry Tailwind's names and values, so `lg:` means the same thing in a token file, a Figma page name and a class name. ## The shell answers to the viewport; everything else answers to its container This is the rule that makes the rest work. The rail, the page padding and the phone nav are the shell's, and they read the viewport. A component inside the content column reads the column — `@3xl` and `@7xl`, never `xl` or `2xl` — because the column already has the rail, the padding, a width cap and any open drawer taken off it. A component that reads the viewport is wrong at the width it is actually given. ## The baseline **Nothing scrolls the page sideways.** Content that cannot fit gets its own scroller, wraps, or stacks. A table is the common case: the scroller belongs on the table's own container, so the page stays still and the header row stays where the reader left it. **Nothing is pinned wider than its container.** A fixed width — `w-96`, `shrink-0` on a row of slots — is a promise that the box will always be at least that wide, and on a phone it will not be. Fixed widths belong inside a scroller or below 360. **An anchored panel becomes a sheet.** Popover, Select and DropdownMenu position against an edge, and on a phone the edge is the viewport, so they clip. Below `md` the phone form is `BottomSheet`: it rises from the bottom edge, so its choices sit where a thumb already is. **Targets are 24 at minimum, 44 where a thumb is the pointer.** 24×24 is the floor (WCAG 2.2 AA, 2.5.8); 44 is what a thumb actually wants. Where the control is smaller than the row it sits in — a 16px checkbox in a 32px row — the row is the target, so the label wraps the control rather than sitting beside it. A 16px box with nothing around it is a miss, not a tap. **Spacing and type do not shrink.** The page gutter is 16 below `xl`, which includes every phone width, and the type ramp is the same ramp. A narrow screen gets fewer columns, not smaller text. **A row with fixed geometry takes a smaller size step, it does not scroll.** Six OTP boxes at `md` are 48 each: 288, plus a 16 separator and six 8 gaps is 352, against the 328 a 360 phone leaves after its gutters. `sm` is 304 and fits. Where a component offers size steps, the phone takes the step that fits — adding a scroller to a field people type into hides the digits they are checking. **Inputs stay 14, and iOS zooms on focus.** Safari on iOS zooms the page when a field under 16px takes focus, and Picasso's inputs are 14 (`sm` is 13). This is accepted. A larger text step for coarse pointers would change every form's height on a phone, and that was judged the worse trade. Do not raise the size in a product to stop it, and never disable zoom to hide it. **The rail is not on a phone.** Below `md` the sidebar is not a 48px strip — a strip of icons spends the one dimension there is least of. The trigger opens the same tree as a drawer over the page, from the inline start, with a strip of scrim left at the end edge to leave by. ## Claiming the phone contract A component is phone-ready when all of the following hold, measured rather than assumed: - it fits a 360 container with nothing past the right edge - every interactive target meets 24, and 44 where it is the primary action - anything anchored has a sheet form below `md` - its stories include a narrow case, so the next change is measured too --- # Right-to-left Picasso supports Arabic, Hebrew and Persian. A page in one of them reads from the right, and nearly everything follows: the sidebar is on the right, a drawer opens from the left, a switch turns on toward the left. The approach is shadcn's (January 2026), with the parts their CLI does at install time done here once, in the source. ## Setting it up Two things, set once at the root. Neither works without the other. ```tsx {children} ``` - **`dir` on ``** is what CSS reads: logical properties, `.rtl-mirror` and Tailwind's `rtl:` variant. On ``, so content in a portal — a menu, a dialog, a toast — gets it too. - **`DirectionProvider`** is what Radix reads. It does not look at the DOM. Without the provider the layout mirrors and the keyboard does not: the arrow that points at the next tab moves to the previous one. - **`lang`** picks the voice a screen reader uses, and switches letter-spacing off for Arabic script. In Storybook the toolbar's **Direction** control sets both for every story. ## The rules ### Logical properties, always `ps-4`, not `pl-4`. `start-0`, not `left-0`. `border-s`, `rounded-e-md`, `text-start`. They render the same left-to-right, which is why the physical ones creep back in. `picasso/no-physical-properties` refuses them; a genuine physical need is a disabled line with the reason beside it. A prop that names a place is logical too. Drawer's `side` is `start` or `end`, not `left` or `right`. ### What a logical class cannot reach | Thing | Mechanism | |---|---| | An icon that points along the reading direction | `rtl-mirror` on the icon | | A translate (Switch knob, Progress fill) | an `rtl:` twin with the sign turned: `translate-x-4 rtl:-translate-x-4` | | A keyframe that travels sideways (Drawer, Toast) | multiply by `--direction-sign`, which is 1 or -1 | | A gradient with a direction | `bg-linear-to-r rtl:bg-linear-to-l` | | Geometry done in script (pointer position, arrow keys, a swipe) | `useDirection()` | `useDirection()` is for script. To choose between two classes, use a logical class or `rtl:` instead — it cannot disagree with the DOM. ### Scales mirror Low is at the inline start. Slider, Threshold slider, Progress, Meter and File upload all fill from the right in Arabic, and the arrow key that points along the scale increases the value. ### Technical text does not A metric, an IP address, a SIP trace, an ID and a one-time code read left to right in every locale, in Latin digits. Inside right-to-left text the bidi algorithm reorders punctuation: `-5%` reads as `5%-` and `10.0.0.1:5060` comes apart at the colon. Put `ltr-island` on the element that holds the value: ```tsx 10.0.4.12:5060 ``` KPI tile, Progress, Table's numeric cells, Number input, OTP, Input group text and Threshold slider's readings already carry it. A numeric column is right-aligned in every locale, heading included: the units digit is on the right in Arabic and Hebrew too, as it is in a spreadsheet. ### Some things never mirror - Check marks, clocks, logos and media controls. - **A chart's time axis.** Time runs left to right for everyone who reads monitoring data. The legend, tooltip and labels around the chart follow the page. - Illustrations. ### Calendars are Gregorian Dates are Gregorian in every locale, because the product's timestamps are. The grid mirrors, and the week starts where the locale says: pass a date-fns `locale` to Calendar and Saturday or Sunday follows from it. ## Type Inter and JetBrains Mono have no Arabic or Hebrew glyphs. Every font stack, sans and mono, carries **Noto Sans Arabic** and **Noto Sans Hebrew** straight after the family itself, so those scripts look the same on every OS. Noto Sans Arabic covers Persian. **Noto Sans** is also in the library as a sans a brand can choose, for one family across all three scripts. `@ir/ui` ships no fonts. An app that serves these languages loads them: ```css @import "@fontsource/noto-sans-arabic/arabic-400.css"; @import "@fontsource/noto-sans-arabic/arabic-500.css"; @import "@fontsource/noto-sans-arabic/arabic-600.css"; @import "@fontsource/noto-sans-hebrew/hebrew-400.css"; @import "@fontsource/noto-sans-hebrew/hebrew-500.css"; @import "@fontsource/noto-sans-hebrew/hebrew-600.css"; ``` A browser fetches a fallback face only when the text on the page needs it, so an English page never downloads them. **Letter-spacing is zero for Arabic script.** The letters join, and any tracking pulls the joins apart. Under `lang="ar"`, `fa`, `ur`, `ps` or `ckb` the tracking tokens are zero and every type role follows. Hebrew is not joined and keeps its tracking. Uppercase does nothing in any of the three. ## Checking a component 1. Turn the Storybook **Direction** control to right-to-left and look. 2. Does anything point the wrong way, slide the wrong way, or sit outside its own box? 3. Use the keyboard: do the arrow keys follow what you see? 4. Is there a number, an address or a code in it? It should read exactly as it does in English. 5. `src/__tests__/rtl.test.tsx` holds the rules. A new directional icon fails there until it is mirrored or listed with the reason it must not be. ## Not done yet - Built-in strings are English: "Warning threshold", "Collapse sidebar", "Show hidden levels". A product can override most through props; there is no translation layer. - Arabic at 11 and 12px has not been checked for legibility or line height. - No Jalali or Hebrew calendar. --- # Tokens, brands and Figma sync ## The one rule **The repo is the source of truth for every token.** Figma follows it. A change can *start* in Figma, but it only counts once it is exported back into the repo and reviewed as a git diff — otherwise the next sync overwrites it. ``` packages/tokens/tokens/*.json ──npm run check──▶ dist/tokens.css → code ▲ └▶ dist/figma.json → Picasso Sync ▶ Figma │ │ └──── npm run figma:import ◀── .figma-export.json ◀── Picasso Export ◀───┘ ``` ## Two layers, the same in code and Figma | Layer | Figma collection | Modes | Holds | |---|---|---|---| | **Primitives** | `Primitives` | one per brand — `Clarion` · `Vantage` · … | colour ramps, type sizes, weights and families, spacing, radius, breakpoints | | **Semantic** | `Semantic` | `Light` · `Dark` | `bg` · `fg` · `border` · `status` · `chart`, plus the colours behind rings and shadows | Semantics point at primitives (`bg/primary/emphasis` → `palette/brand/600`), so the two switches are independent: **any frame can be any brand in either mode.** Text styles (`shared/text/*`) and effect styles (`ring/*`, `shadow/*`) sit on top, bound to those variables. > Line height (%) and letter spacing (em) live only inside the text styles — > Figma variables cannot hold either. Everything else is a variable. ## A brand is a set of choices Each brand is one small file, `packages/tokens/tokens/brands//brand.json`. It picks one option per axis from `presets.json`; the build turns the choices into that brand's primitives. | Choice | Options | Becomes | |---|---|---| | `colour.base` | any hex (optionally a pinned 11-stop `colour.ramp`) | `palette/brand/*` — generated in OKLCH, 600–950 solved for white text | | `neutral` | `cool` · `warm` | `palette/neutral/*` | | `radius` | `sharp` · `subtle` · `default` · `rounded` | `radius/base`; every radius step is a multiple of it | | `spacing` | `compact` ×0.875 · `default` · `relaxed` ×1.25 | the whole `space/*` ladder, each step rounded to the 2px grid | | `type` | a sans and a mono family | `type/family/*` | ```json { "name": "Vantage", "colour": { "base": "#7C3AED" }, "neutral": "warm", "radius": "rounded", "spacing": "default", "type": { "sans": "Manrope", "mono": "JetBrains Mono" } } ``` **Everything else is shared** — status ramps, vis colours, the type scale and every semantic. A brand whose colour is red does not make errors green. The one semantic a brand may change is **the ink on its emphasis surfaces** (`fg/on/*-emphasis`): white where it passes 4.5:1, the darkest neutral where it does not. It is measured, never chosen. In Figma it goes through internal `_on/*/light|dark` primitives, because Semantic's modes are Light/Dark only. ## Adding a brand ```bash cd packages/tokens npm run brand:new -- vantage --name Vantage --base "#7C3AED" \ --neutral warm --radius rounded --spacing default --sans Manrope --mono "JetBrains Mono" npm run check ``` The whole process, including switching a product onto the brand, is in [Create a brand and apply Picasso](../get-started/new-brand.md). Then run **Picasso Sync** in Picasso with `dist/figma.json`. The brand appears as a new mode of the Primitives collection. No components are copied or changed. A font not listed in `presets.json` gets a generic fallback stack and Inter's style names — add it to `presets.json` if its Figma style names differ (Manrope says `SemiBold`, Inter says `Semi Bold`). ## Previewing a brand **In Figma:** select a frame → **Layer** in the right panel → the variable-mode button → set **Primitives** to the brand and **Semantic** to Light or Dark. Nested frames inherit it. The *Brand modes (demo)* page shows all four combinations side by side. **In code:** `data-brand` on ``, with `class="dark"` independent of it. On `` and not on a wrapper — semantics are declared on `:root`, so a nested `data-brand` re-points the brand's primitives inside it but not the semantics already resolved above it. Figma has no such limit: any frame can be any brand. ```html ``` ## The Picasso Sync plugin A Figma plugin in `packages/figma-sync`. It reads the `figma.json` you choose — it has no network access and never talks to the repo — and makes the open file match it. **Install once** — Figma **desktop app** (the browser cannot load local plugins): Figma menu → **Plugins → Development → Import plugin from manifest…** → `packages/figma-sync/manifest.json`. **Run** — Plugins → Development → **Picasso Sync** → choose `packages/tokens/dist/figma.json`. | Button | Does | |---|---| | **Check** | Lists every difference — new, changed, extra, problems. Changes nothing. | | **Sync** | Makes the file match. Never deletes. | | **Sync + remove extras** | Also deletes variables and styles the repo no longer has (asks for a second click). | | **Export** (pick a brand) | Downloads that brand as `.figma-export.json` for `npm run figma:import`. Changes nothing. | What **Sync** does, in order: 1. Applies known renames (e.g. `_type/style/inter-*` → `sans-*`) so existing bindings survive. 2. Makes sure Primitives has one mode per brand and Semantic has Light and Dark. 3. Creates missing variables, then sets every value in every mode. **Aliases stay aliases.** Sets each variable's scope and description. 4. Sets each text style's font, size, line height, tracking and case, and binds it to the family, size and style variables. 5. Rebuilds each effect style's layers and binds every layer's colour to its `_shadow/*` or `_ring/*` variable. What it does **not** do: - **Edit components or layers.** They already point at the variables. - **Bring Figma edits back on its own.** Sync is one way; the way back is Export + `npm run figma:import`. - **Publish.** Publish Picasso as usual afterwards. Two things to know: - **Matching is by name.** Renaming a token creates a new variable and leaves the old one as an *extra*, with layers still bound to it. Planned renames go in the plugin's rename list. - **Fonts come from your computer.** Run the plugin in the desktop app so it can use locally installed fonts. ## Bringing a Figma change back to the repo When a change is easier to make in Figma — a semantic re-pointed, a type size nudged, a brand's ramp tuned by eye — export it instead of re-typing it. 1. In Picasso: **Picasso Sync → Export a brand**, pick the brand, **Export**. You get `.figma-export.json` in Downloads. 2. In `packages/tokens`: `npm run figma:import -- ~/Downloads/.figma-export.json` (add `--dry-run` to only list what would change). 3. Review `git diff`, then `npm run check`. The import compares the export with what the repo would generate for that brand and writes each difference to the file that owns it: | Changed in Figma | Lands in | |---|---| | `palette/brand/*` | the brand's `colour.ramp` (pinned; dropped if it equals the generated ramp) | | `palette/neutral/*`, `radius/base`, `space/*` | the brand's `neutral` / `radius` / `spacing` — **must match a preset** | | `type/family/*` | the brand's `type` | | any other primitive | `core.json` — **shared, so every brand changes**, and it says so | | a Semantic value | `light.json` / `dark.json` | | a text style | `core.json` `shared.text` — line height and tracking must be existing tokens | | an effect style's geometry | the shadow/ring composite in `light.json` and `dark.json` | | a brand that is not in the repo yet | a new `brands//brand.json` | **It refuses — and writes nothing — when a change breaks the model:** - a single radius step edited (steps are `radius/base` × multiplier — change the base) - a neutral ramp, radius base or spacing ladder that matches no preset (add a preset first) - `fg/on/*-emphasis` edited (it is measured by contrast — change the ramp) - a new variable or style (decide by hand whether it is shared or per brand) Exporting a brand nobody has touched reports *Figma matches the repo — nothing to import*, which is also a quick way to confirm the two are in step. ## Proving parity `npm run check` fails when: - light and dark do not define the same tokens - a brand's structure differs from Clarion's (a library swap or mode switch would drop bindings) - a shared primitive differs between brands - Clarion's hand-authored on-colours disagree with contrast measurement - the radius multipliers in `theme.css` drift from `core.json` Contrast tests (`packages/ui`) run for every brand. To prove Figma and the repo are identical, `packages/figma-sync/fingerprint.cjs` hashes every variable, text style and effect style — from `figma.json`, and (its `FIGMA` half) from the live file. Equal hashes, equal systems. ## Where things live | File | What | |---|---| | `tokens/core.json` | Primitives every brand shares; the radius ladder as multiples of `radius.base` | | `tokens/presets.json` | The menu: radius bases, spacing multipliers and ladder, neutral ramps, fonts | | `tokens/brands//brand.json` | One brand's choices | | `tokens/light.json` · `dark.json` | Semantics, shared by every brand | | `build/brands.mjs` | Choices → primitives, on-colour measurement, Figma export | | `dist/tokens.css` | Default brand in `:root`, every brand as `[data-brand]`, then the preset axes | | `dist/figma.json` | Every brand, for the plugin | | `build/figma-import.mjs` | Figma export → repo files, with the refusal rules | | `packages/figma-sync/` | The plugin and the fingerprint | --- # Typography **Inter** for everything, **JetBrains Mono** for `code` and `metric`, and **Oswald** for the wordmark. All three carry full fallback stacks — including Noto Sans Arabic and Hebrew — so never ship `font-family: Inter` alone. Three families, three tokens: `type/family/sans`, `/mono` and `/display`. The display family is the wordmark's alone. It is **not** `heading/display`, which is the 36px step of the Inter ramp and has nothing to do with Oswald — the two share a word and nothing else. **Tailwind's own size scale is cleared.** There is one vocabulary, and `text-md` is **14px**, not Tailwind's 16px `text-base`. Size and line height both come from the composite token, so `text-body-md` sets family, size, weight, leading and tracking together. ## The wordmark The one place the display family appears. `text-wordmark` is a composite step like any other — display family, `2xl`, Semi Bold, `snug` leading, `wide` tracking, uppercase — and the App shell's sidebar is its only consumer. ```tsx Clarion ``` It is deliberately not a size on the Inter ramp: a wordmark is a piece of identity, not a heading, and giving it its own step stops it drifting when the heading scale changes. ## Three weight tiers Size alone does not separate the roles — `heading/xs` and `body/lg` are both 16px. Weight is what distinguishes them: | Tier | Weight | | |---|---|---| | Body | Regular 400 | prose | | Label | Medium 500 | UI chrome | | **Heading** | **Semi Bold 600** | structure | Headings are Semi Bold at every step. Dark mode thins type, and Picasso ships a product people run dark during incidents — Medium goes soft where Semi Bold holds. ## The ramp ### Headings — six steps, each with a role | Style | Size | Leading | Role | |---|---|---|---| | `heading/display` | 36 | 120% | Marketing surface, empty-state hero. Once per screen at most. | | `heading/xl` | 30 | 120% | **Page title** | | `heading/lg` | 24 | 120% | **Section title** | | `heading/md` | 20 | 135% | **Card, panel and dialog title** | | `heading/sm` | 18 | 135% | **Subsection** | | `heading/xs` | 16 | 135% | **Dense panel heading, table group header** | The ramp was never the problem — nothing told anyone which step was a page title, so `xs` and `sm` did page-title work while the middle three starved. The roles are the fix. `display`, `xl` and `lg` carry **−2% tracking**; below 20px tracking is 0. ### Body — Regular, 150% leading `lg` 16 · `md` 14 · `sm` 13 · `xs` 12 ### Label — Medium | Style | Size | Leading | |---|---|---| | `label/lg` | 14 | 135% | | `label/md` | 13 | 135% | | `label/sm` | 12 | 135% | | `label/xs` | 11 | 135%, **uppercase**, +4% tracking | `label/xs` is the **eyebrow / overline** — the single sanctioned uppercase style, for chrome that must not read as data. Never on a button. See [Casing](../content/casing.md). ### Metric — JetBrains Mono, 100% leading | Style | Size | Weight | |---|---|---| | `metric/xl` | 30 | Semi Bold | | `metric/lg` | 24 | Semi Bold | | `metric/md` | 18 | Semi Bold | | `metric/sm` | 14 | **Medium** | A hero KPI number should read as a number. `sm` stays Medium because Semi Bold mono at 14px goes muddy — the asymmetry is deliberate. ### Code — Regular, 150% leading `md` 14 · `sm` 13 · `xs` 12 ## Line height is a ratio, never a pixel value | Leading | | Applied to | |---|---|---| | `none` | 100% | all `metric/*` | | `tight` | 120% | `heading/display`, `xl`, `lg` | | `snug` | 135% | `heading/md`, `sm`, `xs`, all `label/*` | | `default` | 150% | all `body/*`, all `code/*` | | `relaxed` | 165% | reserved for long-form | > ⚠️ **Figma cannot hold these as variables.** Binding a variable to > `lineHeight` or `letterSpacing` forces the unit to pixels — a `150%` ratio > becomes `150px`. So Figma keeps them as unbound percentage literals, and the > export must never write `lineHeight`, `letterSpacing` or `fontFamily` back. --- # Get started Picasso has three audiences who enter it from different ends. - **[For engineers](engineers.md)** — install, import, theme, and the rules the linter enforces - **[For designers](designers.md)** — the Figma library, what it is authoritative for, and what it is not - **[For agents](agents.md)** — the MCP server, and what to keep in your own repo - **[Create a brand and apply Picasso](new-brand.md)** — a new brand in one file, and switching a product onto it Both read [Foundations](../foundations/) and [Content](../content/). Those are the parts of the system that are neither code nor Figma. --- # For agents An agent writing IR product UI without Picasso invents a hex, invents a radius, and rebuilds a component that already exists. Stopping that is a loop, not a document. ![A rule's path: authored beside the component, built into the catalogue, published on the deployment, consulted by an agent, gated by lint, reviewed by a human, and corrected back into the guidance](/diagrams/get-started/agents-path.svg) ## The whole path **1. Authored.** A component's rules live in its own folder — `guidance.json`, the doc comment above the component, the Do/Don't stories — so guidance and code are reviewed in the same diff. Colour lives in `packages/tokens`. Prose lives in `docs/`. Figma is reconciled to all three. **2. Built.** `npm run build:llms` reads those sources once and writes two shapes of the same thing: five `llms*.txt` files for an agent that reads, and `catalogue.json` for one that queries. One run, so they cannot disagree. **3. Published.** `npm run build:site` puts the docs, Storybook, the five text files and the MCP endpoint on one deployment. **4. Consulted.** Either by asking the server, or by reading `node_modules/@ir/ui/src` — the package ships source, including every `guidance.json`. Which one depends on where the agent is sitting; see [Server or source](#server-or-source) below. **5. Gated.** `@ir/eslint-config` fails the build on a raw hex, a restyled component, or a page with no width. This is the step that decides what actually lands, because an agent that read nothing is caught here too. **6. Reviewed.** A human reads the diff. If something off-system still got through, the fix goes back to step 1 — the component's `guidance.json` — not into the product repo. A local fix is a rule that exists in one codebase and nowhere else, which is how a design system stops being one. ## The server One line of config, and the agent can ask Picasso questions: ``` https://ir-picasso.vercel.app/api/mcp ``` Read-only, no key, no sign-in. The same endpoint works from anything that speaks MCP. **Claude Code** — in the repo you are working in: ```bash claude mcp add --transport http picasso https://ir-picasso.vercel.app/api/mcp ``` **Cursor** — `.cursor/mcp.json`: ```json { "mcpServers": { "picasso": { "url": "https://ir-picasso.vercel.app/api/mcp" } } } ``` **VS Code / Copilot** — `.vscode/mcp.json`: ```json { "servers": { "picasso": { "type": "http", "url": "https://ir-picasso.vercel.app/api/mcp" } } } ``` ### What it can ask | Tool | Answers | |---|---| | `search_picasso` | "is there a component for this?" — ranked matches across components, pages and tokens, each with a URL | | `get_component` | the import, every prop and its type, the variants and defaults, the pitfalls the source warns about, the do/don't pairs, the accessibility rules | | `get_tokens` | the resolved colour table — every token, its utility, and the hex it lands on in light and dark | | `get_doc` | a documentation page in full, including `AGENTS.md` | `get_component` takes a name, a slug or an export, so `TableCol` finds the table. `get_tokens` takes a family (`bg`, `fg`, `border`, `status`, `chart`) or a substring, because the whole table is 137 rows and an agent rarely needs all of them. ## Server or source `@ir/ui` ships source, not a bundle: every component `.tsx`, every `guidance.json`, every story is in `node_modules/@ir/ui/src`. So an agent in a product repo can read the design system off local disk, and that is often the better answer — it is the implementation rather than a summary, it is the version actually installed rather than a deployment, and it costs no network hop. Reach for the server when: | | | |---|---| | **There is no repo** | A question asked in a chat, a design tool, or a browser agent. One URL, no install, no npm auth. | | **A colour is involved** | On disk, `tokens.css` is `var()` chains across `:root`, `.dark` and each `data-brand` scope. An agent has to resolve them itself and gets it wrong. `get_tokens` returns the hex, already resolved for both themes. | | **The component is not known yet** | "Is there something for this?" is a ranked search over 60 written summaries. A grep over `node_modules` finds the word, not the right component. | And one that is not about capability at all: **a tool in the tool list prompts the lookup.** Files in `node_modules` do not advertise themselves, and the common failure is not an agent reading the wrong source — it is an agent reading nothing. If your repo has the package, say so in its own `AGENTS.md`. Pointing at `node_modules/@ir/ui/src/components//guidance.json` gets most of this for free. ### Why not just the text files `llms-full.txt` is most of a megabyte: an agent that loads it has spent its context before writing a line. The server is a variable cost — twenty lines about the component in hand. Both come out of the same catalogue in the same run, so neither can tell you something the other denies. ## The files For a tool that cannot speak MCP, or for a one-off paste into a prompt: | File | Contents | |---|---| | [`/llms.txt`](https://ir-picasso.vercel.app/llms.txt) | index — one line per page | | [`/llms-components.txt`](https://ir-picasso.vercel.app/llms-components.txt) | every component: API, pitfalls, do/don't | | [`/llms-tokens.txt`](https://ir-picasso.vercel.app/llms-tokens.txt) | the resolved token table | | [`/llms-foundations.txt`](https://ir-picasso.vercel.app/llms-foundations.txt) | foundations and content rules | | [`/llms-full.txt`](https://ir-picasso.vercel.app/llms-full.txt) | all of it | Any docs page also returns its own markdown — add `.md` to the URL. ## What still belongs in your repo The server tells an agent what Picasso has. It does not tell it what your product has decided. Keep the project's own `AGENTS.md` or `CLAUDE.md` saying: - which Picasso version the product is on - that raw hex, raw radius and raw spacing are lint errors here, not matters of taste - where the product's own patterns live And install `@ir/eslint-config`, because a rule an agent can read is a rule an agent can also forget. See [For engineers](engineers.md). --- # For designers The Figma library is `Picasso` (`v61McMI1fYNAN8DonhNjHQ`). ## What Figma decides **Component behaviour.** Which variants, sizes, states, slots and properties exist — and what each one is for. A component is designed in Figma first, and the code mirrors its names so a design reads straight into props. ## What Figma follows **Every token value.** Colour, typography, spacing and radius are authored in the repo and flow into Figma. If a value disagrees, the repo is right. This reverses how the library worked until September 2026, and it exists to stop the same number being maintained twice. ## What this means day to day - **Do not fix a token value in Figma.** It will be overwritten by the next export. Raise it instead — the fix belongs in `packages/tokens/`. - **Do change a component's variants in Figma.** That is the design decision, and code follows. - **The foundations pages in Figma are a mirror** of [Foundations](../foundations/). Each says so on the page. ## Where the numbers come from | Foundation | Authored in | Figma variable | |---|---|---| | Colour | repo | `palette/*`, `bg/*`, `fg/*`, `border/*` | | Typography | repo | `type/*` + 21 text styles | | Spacing | repo | `space/*` | | Radius | repo | `radius/*` | ⚠️ Binding a Figma variable to `lineHeight` or `letterSpacing` **forces the unit to pixels** — a 150% ratio becomes 150px. Those two stay as unbound percentages on purpose. Do not "tidy" them into variables. --- # For engineers ## Install ```bash npm install npm run build:tokens # generates packages/tokens/dist/tokens.css npm run storybook # component library at :6006 ``` ## Import order matters ```css @import "tailwindcss"; @import "@ir/tokens/tokens.css"; /* primitives + semantics (generated) */ @import "@ir/tokens/themes.css"; /* theme axes — override primitives */ @import "@ir/tokens/theme.css"; /* Tailwind bridge */ ``` Miss `themes.css` and `--radius` is undefined, so every corner silently falls back to 0 and all five theme axes go inert. Nothing errors — it just looks wrong. `theme.css` carries `@theme` and `@custom-variant` directives, so it must be imported inside the Tailwind-processed stylesheet, not as a plain JS import. ## Use a component ```tsx import { Button } from "@ir/ui"; ``` ## Theme A brand, plus independent axes, plus dark mode — all attributes on ``: ```html ``` | Attribute | Values | |---|---| | `data-brand` | `clarion` (default) · any brand in `tokens/brands/` | | `data-radius` | `sharp` · `subtle` · `default` · `rounded` | | `data-neutral` | `cool` · `warm` | | `data-type` | `default` · `system` · `compact` | | `data-spacing` | `compact` · `default` · `relaxed` | | `class="dark"` | dark mode | Set them on ``, not on a wrapper: semantic colours are resolved at the root, so a `data-brand` further down changes the raw brand colours there but not the semantics components use. Creating a brand and switching a product onto it, step by step: [Create a brand and apply Picasso](new-brand.md). A brand sets the defaults for the axes; an explicit axis beats it. Storybook's toolbar drives the axes, so every story is a live preview. How brands and presets are defined: [Tokens, brands and Figma sync](../foundations/tokens-and-brands.md). ## The rules `AGENTS.md` has the full set and `npm run lint` enforces them. The short version: semantic utilities only, never a raw hex, never a hard-coded corner, sentence case, and Lucide for icons. --- # Create a brand and apply Picasso A brand in Picasso is **one small file of choices**, not a copy of the system. Every product that uses Picasso picks a brand with one attribute, and every component — buttons, charts, illustrations — follows it. This page has two halves. **[Create a brand](#create-a-brand)** happens once, in this repo. **[Apply Picasso to a product](#apply-picasso-to-a-product)** happens in each product that uses it. ## Before you start: do not fork It is tempting to copy the repo and edit the theme for a new brand. It works on day one and costs you every day after: each fix, each new component and each new illustration then has to be made twice, and within a few months the two copies disagree. A design system exists to stop exactly that. A brand lives **inside** Picasso, beside the others: ``` packages/tokens/tokens/brands/ clarion/brand.json ← the default vantage/brand.json /brand.json ``` ## What a brand can change | Changes per brand | Stays the same in every brand | |---|---| | The brand colour, and the 11-step ramp generated from it | Danger, warning, success and info — they are meaning, not identity | | Cool or warm greys | The type scale, and what each text style is for | | Corner style: sharp · subtle · default · rounded | Every semantic token and what it is for | | Spacing: compact · default · relaxed | Component shapes, layouts and behaviour | | Fonts: a sans, a mono and an optional display face | Illustration drawings, icons and motion | | The ink on emphasis surfaces — measured, never chosen | Chart series colours | The last row on the left is the only semantic a brand may change, and it is not a choice: the build puts white text on the brand's emphasis colour where it passes 4.5:1 and the darkest neutral where it does not. ## Create a brand ### 1. Generate the brand file ```bash cd packages/tokens npm run brand:new -- northwind --name Northwind --base "#0F766E" \ --neutral warm --radius subtle --spacing default \ --sans Inter --mono "JetBrains Mono" ``` | Option | Values | Default | |---|---|---| | `` | lowercase, letters, digits and hyphens — it becomes `data-brand=""` | required | | `--base` | the brand colour as `#RRGGBB` | required | | `--name` | how the brand is written in Figma and docs | the id, capitalised | | `--neutral` | `cool` · `warm` | `cool` | | `--radius` | `sharp` · `subtle` · `default` · `rounded` | `default` | | `--spacing` | `compact` · `default` · `relaxed` | `default` | | `--sans` · `--mono` · `--display` | a font family | Inter · JetBrains Mono · none | This writes `tokens/brands//brand.json` and nothing else. **Never write or edit a `[data-brand]` block in CSS by hand** — it is generated, and a nudged value cannot be regenerated. If Marketing supplies exact colour stops, add them to `brand.json` as `colour.ramp` to pin the ramp instead of generating it. A font that is not listed in `presets.json` gets a generic fallback stack and a warning. Add it to `presets.json` if its Figma style names differ from Inter's (Manrope says `SemiBold`, Inter says `Semi Bold`). ### 2. Build and check it ```bash npm run check # in packages/tokens: builds tokens.css and figma.json, runs parity checks cd ../.. && npm test # contrast: every on-colour pair, both modes, every brand ``` `npm test` is the accessibility gate. If a pair fails, **fix the ramp, not the semantic** — usually by choosing a slightly deeper base colour or pinning a `colour.ramp`. A brand that needs a semantic overridden is a bug report against the ramp. ### 3. Look at it ```bash npm run storybook ``` Set **Brand** in the toolbar to your brand, then go through: - **Foundations / Colour** — the generated ramp, light and dark. - **Components / Illustration / Follows the brand** and **All drawings** — the tint inside the drawings. The contrast test checks text, not tints, so a very pale or very dark base colour is the one thing to judge by eye. - **Button, Badge, Alert, Switch** — the emphasis surfaces and their ink. - Each again with **Theme: dark**. ### 4. Bring Figma in step Run **Picasso Sync** in the Picasso Figma file with `packages/tokens/dist/figma.json`. The brand appears as a new mode of the **Primitives** collection. Set a frame's Primitives mode to it to preview. No Figma component is copied or changed. ### 5. Record it Add the brand under **Added** in `CHANGELOG.md`, with its **Figma impact** line ("new Primitives mode, synced"). A new brand is additive, so it is a minor version — but it still needs a version before a product can install it. ## Apply Picasso to a product ### 1. Install both packages Add `@ir/tokens` and `@ir/ui` to the product — from the registry once Picasso is published, or from the repo's git URL until then. `@ir/ui` ships its **source**, not a build, so the product's bundler compiles it and Tailwind must scan it. ### 2. Import the CSS, in this order In the product's main stylesheet — the one Tailwind processes: ```css @import "tailwindcss"; @import "@ir/tokens/tokens.css"; /* primitives, semantics, every brand */ @import "@ir/tokens/themes.css"; /* theme axes */ @import "@ir/tokens/theme.css"; /* the Tailwind bridge: bg-surface-*, text-content-* … */ @source "../node_modules/@ir/ui/src"; /* so Tailwind generates the components' classes */ ``` The order is load-bearing. Without `themes.css`, every corner silently falls back to 0. Without the `@source` line, components render unstyled. Neither throws an error. `theme.css` carries Tailwind directives, so it must be imported here, inside the processed stylesheet — not as a plain JavaScript import. ### 3. Choose the brand on `` ```html ``` Leave `data-brand` off for Clarion, the default. Add `class="dark"` for dark mode — it is independent of the brand. ⚠️ **On ``, not on a wrapper.** Semantic colours are worked out once, at the root. A `data-brand` on an inner element changes the raw brand colours inside it, but the semantics that components actually use — `bg-surface-primary-*`, `text-content-primary-*` — have already been resolved above it, so they stay on the root's brand. One product, one brand, set once at the top. The other axes can be set the same way, and an explicit axis beats the brand's own choice: | Attribute | Values | |---|---| | `data-brand` | `clarion` (default) · any id in `tokens/brands/` | | `data-neutral` | `cool` · `warm` | | `data-radius` | `sharp` · `subtle` · `default` · `rounded` | | `data-spacing` | `compact` · `default` · `relaxed` | | `data-type` | `default` · `system` · `compact` | | `class="dark"` | dark mode | ### 4. Load the brand's fonts Picasso names the font families; it does not ship the font files to products. Load the brand's sans and mono in the product — self-hosted with `@fontsource/` rather than from an outside font host, so a product used inside IR's network does not silently fall back to the system font. ### 5. Use components as normal ```tsx import { Button, EmptyState, Illustration } from "@ir/ui"; } /> ``` Nothing above mentions the brand. That is the point: components ask for roles — primary, tint, hairline — and the brand on `` decides what those are. ### If the product keeps its own copy of `tokens.css` Some products vendor a copy of `tokens.css` instead of importing it from the package. They do not see a new brand, or any token change, until that copy is replaced. Re-copy it from `packages/tokens/dist/tokens.css` after every `build:tokens`, in every product that keeps one. ## Checklist **Creating a brand** - [ ] `npm run brand:new` — not a hand-written CSS block - [ ] `npm run check` passes - [ ] `npm test` passes — the contrast gate - [ ] Looked at Colour, Illustration and the emphasis components in Storybook, light and dark - [ ] Picasso Sync run; the brand is a Primitives mode in Figma - [ ] `CHANGELOG.md` entry with its Figma impact, and a version **Applying it to a product** - [ ] `@ir/tokens` and `@ir/ui` installed at the version that has the brand - [ ] The four imports, in order, plus `@source` for `@ir/ui` - [ ] `data-brand` on `` - [ ] The brand's fonts loaded - [ ] Any vendored `tokens.css` re-copied ## When it looks wrong | You see | Usually because | |---|---| | Square corners everywhere | `themes.css` is not imported, so `--radius` is undefined | | Components with no styling at all | Tailwind is not scanning `@ir/ui/src` — the `@source` line is missing or points at the wrong folder | | The old brand's colour, or no change at all | `data-brand` is on a wrapper instead of ``, or the product's `tokens.css` is a stale copy | | Part of a page in the new brand and part in the old | `data-brand` on an inner element — see step 3 | | The system font instead of the brand's | The font files are not loaded in the product | | Errors turned the brand colour | Something used `primary` where it meant `danger`. Status colours never change per brand | Related: [Tokens, brands and Figma sync](../foundations/tokens-and-brands.md) · [Colour](../foundations/colour.md) · [For engineers](engineers.md) --- # Patterns A component page answers "how does this Button behave". A pattern answers the question people actually arrive with: "how do I build this screen". Each one names the components, the width mode and the decisions already taken, so the next screen of that kind starts from the answer rather than from a blank page. | Page | | |---|---| | [Definition of done](definition-of-done.md) | The bar every screen ships against — what is checked automatically, and what you check | | [Form page](form-page.md) | A page whose job is to be filled in and submitted | A screen with no pattern here is not off-system — it is a pattern nobody has written down yet. Build it from components, then raise it in the Design System forum so the next one does not have to be worked out again. --- # Definition of done A screen is done when it meets the bar below. Engineers and agents ship against the same list; neither gets a shorter one. Meeting it makes a screen ready for **design review**, not a replacement for it. The list catches what can be stated as a rule. Review is for what cannot — whether this is the right screen, and whether it reads well. ## Checked for you These fail the build. Nobody has to remember them. | Check | Where it runs | What it refuses | |---|---|---| | `shadcn/no-raw-colors` | lint | a hex, an `rgb()`, a palette colour that is not a token | | `shadcn/no-arbitrary-values` | lint | `bg-[var(--…)]` and every other `[…]` value | | `shadcn/no-inline-styles` | lint | `style={{ … }}` | | `shadcn/no-restyle` | lint | a class put on a Picasso component from outside | | `shadcn/no-unknown-classes` | lint | a class no stylesheet declares | | `picasso/no-physical-properties` | lint | `pl-4` where `ps-4` is meant | | `picasso/no-raw-page-title` | lint | a hand-written `

` instead of `PageHeader` | | `picasso/require-content-width` | lint | an `AppShellContent` that has not said which width it is | | Token contrast | `npm test` | any on-colour pair under 4.5:1, in either mode, for any brand | The lint rules come from `@ir/eslint-config` — `product()` in an app. Its README, in `packages/eslint-config/`, covers setup and for the two ways to break a rule on purpose. ⚠️ The package is not published yet, so today these run in the Picasso repo and not in a product's own CI. A rule broken with a line disable carries its reason in the comment. A disable with no reason is not done. ## Checked by you Nothing automates these yet. They are not optional for that. **Built from the system** - [ ] Every control is a Picasso component. Anything that is not is either raised in the Design System forum or recorded with a reason. - [ ] The page uses a [pattern](README.md) where one exists, and follows it. - [ ] The width mode was chosen, not defaulted — `fluid` for dashboards and tables, `standard` for detail and settings, `reading` for forms and prose. **States** - [ ] Empty, loading and error exist wherever the screen can be in them — see [Empty and loading states](../content/empty-and-loading-states.md) and [Errors](../content/errors.md). - [ ] A missing value and a zero are shown differently. **Copy** - [ ] Sentence case everywhere, column headers included. See [Casing](../content/casing.md). - [ ] Buttons start with a verb and name the outcome. See [Buttons and labels](../content/buttons-and-labels.md). - [ ] Product terms match [Terminology](../content/terminology.md). **Accessibility** - [ ] The whole flow works from the keyboard, in order, with the focus ring visible at every stop. - [ ] Every input sits in a `Field`, so its label, hint and error are wired by the component rather than by hand. - [ ] Every icon-only button has an accessible name. - [ ] Storybook's a11y panel, or axe in the browser, reports nothing on the screen's states. **Looked at, not just tested** The test suite runs in jsdom, which has no layout engine — it cannot see size, position, overflow or wrapping. A green suite says nothing about what rendered. - [ ] Opened at **360**, **768** and **1280**, and at **2560** for a `fluid` page. - [ ] In light **and** dark. - [ ] In RTL, if the product ships a right-to-left locale. ## Moving the line Every item under *Checked by you* is a candidate for automation. When one becomes a check that fails the build, it moves to the table above, and this page gets shorter. --- # Form page A page whose job is to be filled in and submitted. Create a tenant, provision a product, change notification settings. A form inside a dialog or a drawer is not this pattern — those have their own footers. This is for a form that is the whole page. ## The shape 1. **`AppShellContent width="reading"`** — the column caps at 768, left-aligned to the rail. 2. **`PageHeader`** — the page's only `h1`, an optional description, a rule. 3. **Fields**, each in a `Field`, stacked with the page gutter between them. 4. **`PageFooter`** — a rule, then the actions at the inline end, primary last. ```tsx import { AppShellContent, Button, Field, FieldControl, FieldDescription, FieldLabel, Input, PageFooter, PageHeader, } from "@ir/ui";
First name Last name
Tenant name Letters, digits and hyphens.
``` ## The rules **The width goes on the page, not on the form.** With `width="reading"`, the header rule, the fields and the footer rule all start and end on the same two edges at every width. Cap only the form inside a fluid page and the header rule runs the full width over a 768 footer rule, which reads as a T. **768, not a number of your own.** A form column narrower or wider than `reading` is a fourth width every page author then has to choose between with no rule to decide it. If a form genuinely needs a different width, raise it. **The title comes from `PageHeader`.** It is `heading/xl`, the page-title step, and the lint rule `picasso/no-raw-page-title` refuses a hand-written `

`. **Two fields side by side sit a gutter apart.** `gap-gutter`, the same gap as every other grid on the page. Closer than that and a First name / Last name pair reads as one control. The pair is a container query (`@xl:`), so it answers to the column, not the window. **Every input is in a `Field`.** The label, hint and error are wired to the control by the component. When a field is invalid, `invalid` on the `Field` swaps the hint for a `FieldError` — see [Errors](../content/errors.md) for what the message says. **Primary last, paired with outline or secondary.** Cancel first, the primary at the inline end — the same order as Dialog, Drawer and Card, so Save is in the same place everywhere. Never a ghost Cancel: it reads as optional. The primary's label names the outcome — *Create tenant*, not *Submit*. **The footer ends where the form ends.** `PageFooter` sits inside the column, so on a 2560 monitor the submit is still a bounded distance from the last field. ## At 360 The rail collapses, the column is 328 wide, side-by-side fields stack, and two buttons still fit on one row. If a third button arrives or a label is long, the row wraps and the primary stays last. ## Not covered yet **Long forms.** `PageFooter` does not stick. If a form is long enough that its actions end up screens below the first field, raise it in the Design System forum before building a sticky bar or splitting it into steps — there is no rule for it yet. **A form page that needs more than its fields** — tabs across the top, a table of existing records under the form, a side-by-side preview. The cap then moves off the page and onto the form. Raise it before building. ## Related - [App shell](../components/app-shell.md) — the three width modes - [Page header](../components/page-header.md) · [Page footer](../components/page-footer.md) · [Field](../components/field.md) - [Definition of done](definition-of-done.md) --- # Releases ## One version, three surfaces Picasso ships through three surfaces that can drift apart: - the **Figma library** — designers consume it by accepting a library update - **`@ir/tokens`** - **`@ir/ui`** **They publish together under one version number**, and the Figma library's publish description carries the same version string. A changelog that only versions the npm packages leaves designers with no idea what changed in their file — and designers are the majority of the audience today. ## Categories | Category | Meaning | |---|---| | ⚠️ **Breaking** | API change — a variant renamed, a component or token removed | | **Added** | a new component, token, variant or slot | | ⚠️ **Changed (visual)** | renders differently, **breaks no build** | | **Fixed** | a defect, with no intended visual change | | **Deprecated** | still works, removal version named | **"Changed (visual)" is the category that matters most.** A design system's most disruptive changes usually break nothing at build time — they just make every screen look different, and someone has to be told before they pull. ## Every release carries a Figma impact line Engineers ask "will this break my build". Designers ask "what happens to my file when I accept the update". Only one of those is answered by a normal changelog. > **Figma impact** — 460 Button instances change their label size. Accept the > library update on a branch and review before merging. ## Versioning | | | |---|---| | **Major** | an API break — a component, variant, prop or token removed or renamed | | **Minor** | something added, **or any visual change** | | **Patch** | a fix with no visual change | **A visual change is minor, never patch.** Patch implies "safe to take without looking", and a visual change never is. ## How a release actually happens As of 2.0.0: 1. Land the work, with its `CHANGELOG.md` entry under `## Unreleased` — including its **Figma impact** line. 2. Move `## Unreleased` to `## — ` and set the same version in `packages/tokens` and `packages/ui`. 3. Tag `v` and push the tag. `.github/workflows/release.yml` then refuses the tag if it disagrees with either package, runs the full check, cuts the GitHub release notes from that changelog section, and publishes — but only once an `NPM_TOKEN` secret exists, so adding the secret is the decision to publish rather than something that happens by surprise on the first tag. `.github/workflows/ci.yml` runs the same checks on every push and pull request, including the Storybook and docs-site builds, because the guidance ratchet and the generated component pages only fail at build time. ### Changesets — not installed Earlier drafts of this page described a changeset per PR with a non-standard `figma-impact` field. That was never built, and the changelog has been written by hand since. It is worth reconsidering when more than one person is landing changes: the reason for changesets is that a changelog written from memory on release day omits exactly the visual changes nobody flagged at the time, and that failure mode arrives with the second contributor, not the first. --- # AGENTS.md — working in Picasso Rules for any agent or human writing code here. Violations are caught by `npm run lint` (`@shadcn/lint` on ESLint), but knowing them beats being told. --- ## 1. Direction of truth **This repo is the source of truth for tokens.** Figma is a consumer of them: it receives tokens and is reconciled to match the code. Component *behaviour* — which variants and states exist — flows Figma → code: build what Figma draws. Do not "fix" a value on either side without checking which side is actually right. --- ## 2. Colour — never a raw value ```tsx // ✗ never className="bg-[#007FAB] text-[#121926]" className="bg-blue-600 text-slate-900" // no Tailwind palette colours className="bg-[var(--bg-primary-emphasis)]" // the escape hatch is not needed // ✓ always className="bg-surface-primary-emphasis text-content-neutral-emphasis" ``` Each token family has a utility word that reads correctly with its own prefix, because Tailwind's `--color-*` namespace feeds `bg-`, `text-` and `border-` from one pool and the three families would otherwise collide: | Token | Utility | Example | |---|---|---| | `bg/*` (69) | **surface** | `bg-surface-danger-subtle-hovered` | | `fg/*` (31) | **content** | `text-content-on-primary-emphasis` | | `border/*` (21) | **line** | `border-line-input-invalid` | | `status/*` (5) | status | `text-status-critical` | | `chart/1–8` | chart | `fill-chart-3` | Every semantic has a utility — **if you reach for `bg-[var(...)]`, the bridge is missing an entry.** Add it to `packages/tokens/theme.css`, don't escape. **Never use a `palette/*` value in a component.** Palette is for semantics only. --- ## 3. Spacing and radius **Picasso is a 4pt grid with 2pt half-steps.** Legal: every multiple of 4, plus 2, 6, 10, 14. Anything else (5, 18, `p-[13px]`) is drift. **Radius is one knob.** `--radius` drives all eight steps proportionally; never hard-code a corner. `rounded-md` is 8px, `rounded-lg` 10px at the default. **Z-index is a token.** `z-raised` · `z-overlay` · `z-modal` · `z-floating` · `z-notification` — never a bare `z-50` and never `z-[1600]`. The scale and why floating outranks modal are in `docs/foundations/elevation.md`. --- ## 4. Typography **Tailwind's own scale is cleared — there is one vocabulary.** `text-md` is **14px**, not Tailwind's `text-base` 16px. Sizes and their line heights both come from the ramp, so a utility cannot drift off it. `2xs 11 · xs 12 · sm 13 · md 14 · lg 16 · xl 18 · 2xl 20 · 3xl 24 · 4xl 30 · 5xl 36` Roles, not sizes, decide which to use: | Role | Weight | Use for | |---|---|---| | `body/*` | Regular | prose, descriptions | | `label/*` | Medium | controls, form labels, table headers, tabs | | `heading/*` | **Semi Bold** | titles only — `xl` page, `lg` section, `md` card/dialog | | `metric/*` | Medium, mono | numbers people read as data | | `code/*` | Regular, mono | SIP traces, log payloads, IDs | ⚠️ **A control label is never a `heading/*`.** Tab labels, menu items, table column headers and buttons take `label/*`. `label/xs` is uppercase — it is an **eyebrow/overline only**, never a button. --- ## 5. Copy **Sentence case everywhere, except proper nouns.** - Proper nouns: Clarion · Iris · Prognosis · Collaborate · Transact · Infrastructure · IR - First mention takes the prefix — "IR Collaborate", then "Collaborate" - Fixed forms: "UC & CC" · "HPE NonStop" · "Real-time Payments" - Vendor/protocol names as the vendor writes them: SIP · RTP · MOS · SBC · Teams · Webex - ⚠️ **Never the pre-rename product name** (Clarity) in any string, filename or alt text **Errors: fact first, then action.** Never blame the reader. ``` ✗ "You entered an invalid query." ✓ "No results match these filters. Clear the date range to widen the search." ``` **Numbers:** digits always (`3 trunks`); space before units (`1.2 GB`, `45 ms`); percentages close up (`99.95%`); 24-hour time with an explicit timezone. **Buttons:** verb first, name the outcome. Never "Submit" or "OK" alone. **Every data component needs empty, loading and error copy** — not just the success state. --- ## 6. RTL Product ships to multiple regions. **Logical properties only.** ```tsx // ✗ // ✓ pl-4 pr-2 ps-4 pe-2 ml-auto ms-auto left-0 start-0 text-left text-start ``` Icons that encode direction (chevrons, arrows, back/forward) mirror via `.rtl-mirror`. Clocks, checkmarks, logos and media controls do not. Arabic, Hebrew and Persian are supported; the whole of it is in `docs/foundations/rtl.md`. What a class swap does not cover: - **A place in a prop is logical too** — `side="end"`, never `side="right"`. - **A translate has no logical form.** Give it an `rtl:` twin with the sign turned (`translate-x-4 rtl:-translate-x-4`); a keyframe multiplies by `--direction-sign`. - **Script that measures** — pointer position, arrow keys, a swipe — reads `useDirection()`. Radix reads the same provider, not the DOM. - **Technical text stays left-to-right**: put `ltr-island` on a metric, an IP address, an ID, a code. Digits are Latin in every locale. - **Never mirror** a chart's time axis, a check mark, a clock, a logo or an illustration. `picasso/no-physical-properties` catches the classes; `src/__tests__/rtl.test.tsx` holds the rest. --- ## 7. Motion Most things do not move. Decide that first — `docs/foundations/motion.md` has the test — and when something does, ask for a named animation: ```tsx // ✗ never className="transition-all duration-300 ease-in" className="transition-[width]" // a layout property, and arbitrary className="hover:scale-105" // hover is colour // ✓ always className="data-[state=open]:animate-dialog-in data-[state=closed]:animate-dialog-out" className="transition-press motion-safe:active:scale-97" className="transition-transform ease-out motion-reduce:transition-none" ``` - **No duration and no curve in a component.** They are tokens (`motion/*`), composed into named animations in `packages/tokens/theme.css`. - **Only `transform` and `opacity` move.** Accordion height is the one exception. - **Nothing starts slowly** — there is no ease-in — and nothing scales from zero. - **Data does not move for style.** Charts, KPIs and table rows change at once. - **Reduced motion is a fade, not nothing.** The named animations carry it themselves, so they take no `motion-safe:`; a transition you write takes `motion-reduce:transition-none`. `src/__tests__/motion.test.ts` holds the system to this. --- ## 8. Component architecture shadcn conventions throughout: **Radix primitive + `cva` variants + `cn()`**. Icons are **Lucide** — no other icon library. - One folder per component: `component.tsx`, `component.stories.tsx`, `guidance.json` - Export from `src/index.ts` as it lands - Prefer a `slot` or `children` over a boolean that toggles a hardcoded child - A boolean can change **presence**; only a variant can change **paint** --- ## 9. Don'ts — real defects found in the Figma library, do not reproduce - A ghost button with a resting fill — it reads as an outline button and the hierarchy between primary and tertiary collapses - A toast or alert with **both** an action and a close - An `fg/*` token used as a stroke or fill (use `border/*` or `bg/*`) - A `-hovered` or `-pressed` token on a resting state - A `Status` enum **and** a `Show status badge` boolean — two controls for one thing - One variant at a different radius from its siblings - An axis whose options are additive rather than exclusive — that is booleans --- ## 10. Component order Build in dependency order. Button is nested in Alert, Toast, Dialog, Drawer, Table toolbar and Sidebar — doing it late means rebuilding everything twice. ``` tokens/theme → Button · Input · Field · Separator · Badge · Skeleton → Checkbox · Radio · Switch · Select · Textarea · Tooltip · Popover → DropdownMenu · Dialog · Drawer · Toast · Tabs · Accordion · Card → Table · Sidebar · Calendar · KPI Tile · charts → still to build: Command · Log viewer · Metrics ``` Everything above the last line is built. A label is `FieldLabel`, not a component of its own. --- ## 11. Commands ```bash npm run build:tokens # regenerate dist/tokens.css — run after ANY token change npm run storybook # :6006 npm run lint # design system rules npm run type-check npm test ``` **After changing a token, rebuild.** `dist/tokens.css` is generated; never edit it. --- ## Adding a brand Picasso is multi-brand. A brand brings its own ramps; everything else is inherited, and that is deliberate. **A brand is a preset, not a sixth axis.** It sets defaults for radius, type and spacing; an explicit `data-radius` still overrides it. That works by CSS source order, so in `themes.css` **brand blocks sit above the axis blocks** — load-bearing, not cosmetic. **Constrain the surface; do not flip the ink.** Generate the ramp so the emphasis step carries white text, rather than generating freely and flipping `fg/on/*` to dark when it fails. A system where a primary button has white text in one brand and dark text in another has two different-looking primary buttons, and every screenshot, doc and habit diverges with it. Constrain the ramp and only the hue changes. `build/ramp.mjs` does this: for the steps that carry text it solves lightness down until relative luminance clears 0.1833. **OKLCH lightness is not WCAG luminance** — luminance weights green at 0.7152 and blue at 0.0722, so a fixed L lands one hue at 4.61 and another at 4.48. Solve, do not tabulate. **Keep the flip for what cannot be constrained.** Two cases, and only two: a colour that must stay recognisable (amber cannot be darkened enough to carry white and still read as a warning), and dark mode, which deliberately paints with a lighter step. Everywhere else a flip means the ramp is wrong. **Only `fg/on/*` may differ per brand.** Every other semantic aliases a primitive, so re-pointing the primitive carries the whole system. If a brand needs some other semantic overridden, fix the ramp — that is a bug report against the ramp, not a new override. Without this, brand three arrives with nine overrides and brand four with fifteen. **Colour and radius move freely; typography and spacing need a reason.** Colour is nearly free because semantics alias primitives. Type and spacing change *layout*, so every screen has to be re-checked per brand. That cost is real and it multiplies. **Never per brand:** `danger`, `success`, `warning`, `info`. A brand whose colour is red does not make errors green. These are meaning, not identity. **Generated, committed, never hand-edited.** `node build/brand.mjs --brand "#RRGGBB"` emits the block and prints the contrast evidence. A hand-edited ramp cannot be regenerated, and the first nudged stop silently desynchronises the on-colours. **WCAG 2.1 AA is the gate; the eye overrides upward only.** 2.1 mis-ranks saturated colours and APCA models it better, but APCA is not a standard and not what an accessibility obligation names. So: comply with 2.1, and where 2.1 says pass and the screen says otherwise, darken. Never the reverse. `npm test` enforces the floor — every on-colour pair, both modes. --- ## Documentation Prose about the system lives in `docs/`, not in this file. This file is *how to write code here*; `docs/` is *what the system is*. - Copy rules — casing, errors, empty states, numbers, button labels — are in `docs/content/`. Follow them when you write any user-facing string. - Foundations — the grid, the radius ladder, the type ramp, the shadow steps and the layer scale, motion, icons and accessibility — are in `docs/foundations/`. - Adding a component: `docs/contributing/adding-a-component.md`, and copy `docs/contributing/component-checklist.md` into the PR. ## Skills `.agents/skills` holds IR's own skills for work in this repo and in the products that use it. `.claude/skills` links to the same files. | Skill | For | |---|---| | `ir-motion` | Building anything that moves | | `ir-motion-review` | Reviewing motion in a diff, a component or the repo | | `ir-motion-opportunities` | Finding where motion belongs, and where it does not | | `ir-mobile-web` | Making an app behave on a real phone | | `ir-stress-test-ui` | Finding what a component does with real data | | `ir-pick-ui-library` | Deciding what to build with, and whether to add a dependency | They follow `docs/`. Where a skill and a doc disagree, the doc is right and the skill needs fixing. **If you produced off-system code, the docs failed, not you.** Say which rule you broke and where it was written down — or that it was not. See `docs/contributing/reporting-off-system-output.md`. --- # Changelog Picasso versions Figma, `@ir/tokens` and `@ir/ui` together. See [docs/releases](docs/releases/) for what each category means. ## Unreleased **Figma impact** — a new **Illustration** page under Foundations, with an `Illustration` component set: `Name` (the ten drawings) × `State` (`Rest`, `Active` — what a list card shows while it passes `active`). Every colour is a Semantic variable, so the drawings follow the Primitives brand mode and Light/Dark. Not yet published. Known gap: the raised-card shadow is a raw effect at its light value, as there is no shadow token for it. The motion between the two states has no Figma counterpart; the tokens and `docs/foundations/motion.md` are the spec. ### Added - **An MCP server, so an agent can ask Picasso questions instead of loading it.** `https://ir-picasso.vercel.app/api/mcp` — read-only, unauthenticated, the same endpoint for Claude Code, Cursor and Copilot. Four tools: `search_picasso` (ranked matches across components, pages and tokens, each with a URL), `get_component` (import, props with types, variants and defaults, the pitfalls lifted from the component's own source, the do/don't pairs, the a11y rules), `get_tokens` (the resolved table, filterable by family or substring), `get_doc` (a page in full, `AGENTS.md` included). **Why a server when the `llms*.txt` files already exist:** the files are a fixed cost. `llms-full.txt` is 586KB, so an agent that loads it has spent its context before writing a line, and an agent that loads nothing invents a hex. The server is a variable cost — twenty lines about the one component in hand. It answers out of `apps/site/public/catalogue.json`, which `scripts/build-llms.mjs` now writes in the same run as the five text files, from the same component sources and the same compiled `tokens.css`. One run, two shapes: the server cannot describe a different library than the docs do. The route imports that file rather than reading `packages/ui/src/components` at request time, because a route handler is traced and bundled and a directory it only reads at runtime would not be deployed with it. The catalogue leaves out the generated component pages — they are the same guidance the component entries carry, and including both made every search return each component twice. `dev:site` now runs `build:tokens` and `build:llms` first, so the route has its catalogue in local dev too, where Storybook is never built. **Nothing here reaches a database or a private repo**, so there is nothing to protect; the day that changes, `route.ts` is the one file that grows an auth wrapper. **No Figma impact.** - **PageFooter, and the form-page layout it completes.** The actions that finish a page, under a rule at the end of it — PageHeader's other end, so a form page is: the page's name and a rule, the fields, a rule and the actions. The buttons sit at the **inline end of the content column**, not of the page: a form page is `width="reading"`, so the column caps at 768 and the submit stays a bounded distance from the last field however wide the monitor is. Right-aligning to the page would put it 1,448px away at 2560. `gap-3` and the rule come from DrawerFooter, which is the same job in a panel; the 24 above the actions is the page gutter, so it steps to 16 below xl with everything else. It does not stick — a form whose actions are three screens down wants splitting or a sticky bar, and neither is built. Measured in Chromium at 360, 768, 1024, 1280, 1440 and 2560: the header rule and the footer rule share both edges at every width, the primary is flush with the rule's end, the column is 768 from 1280 up with all the spare width on the end side (1,448 of it at 2560), and at a 360 phone with the rail collapsed the two buttons still fit one row inside a 280 column. **Figma impact** — new `Page footer` component (976 × 61: rule, 24, a 36 button row) beside Page header; that page is now `Page header & footer`. Not yet published. **The width question this settles:** Ops Console caps its form pages at 720. Picasso already had `reading` at 768 for exactly that job, and Ee's call was to use it rather than mint a fourth width — two caps 48px apart would mean every page author choosing between them with no rule to tell them which. - **PageHeader.** The first thing on a page, inside the content area: the page's name as the `h1` at `heading/xl`, an optional line on what the page is for, and the rule under both. The App shell Rules have put the page title in the page header since 1 October without there being one to put it in, so every page hand-rolled `

` — three decisions re-made per page and free to drift. The description caps at the reading width (768) whatever the page's own width mode is, so a fluid dashboard does not have to choose between a wide grid and a readable sentence. The rule is on by default and comes off with `divider={false}` where the next thing already has a top edge. No actions, meta or tabs slot yet: each is its own wrapping decision on a narrow column, and adding one later is additive. The App shell's three page stories use it instead of their own headings. Measured in Chromium at 360, 1280 and 2560 — Inter 30/600 on a 36 line, description 768 on a 2448 column and the full 264 on a narrow one, 8 between title and description, 16 and a 1px rule under. **Figma impact** — not drawn yet; the App shell page's `Page heading` text node stands in for it. - **ListCard.** A row in a list of things a person can open — a badge, a title and a meta line, with an Illustration cropped into the trailing corner on a brand circle. The card owns the hover and passes `active`, so the picture never answers a pointer the card is not answering: it waits 120ms for the pointer to settle, turns on at once for keyboard focus, and the card itself only changes colour. **It does not lift** — rows sit a 2-gap apart, so a hover shadow would land on the card below. Below a 448 card the art column drops 160 → 112, answering the card's own width rather than the viewport. `asChild` hands the row to a router link. - **Seven Illustration drawings.** `search-results`, `dashboards` (lift), `topology`, `team-access` (magnify), `activity-log`, `integrations` and `assistant` (sequence) join `issue-alerts`, `fleet-health` and `call-readiness`. They are drawn to the same Spotkit rules — one 0.5 hairline, a panel and its ghost, bars for text, one accent — and cover the empty states and lists a console keeps needing: no results, no dashboards, nothing mapped, only you on the team, no activity, no integrations, ask Iris. `illustrationMechanic` exports which mechanic each one carries. - **`active` on Illustration.** A parent can drive the response instead of the pointer: lift opens the next item, magnify swells around the flagged shape and sequence runs. When it is set the picture stops listening to the pointer. Built for list cards, which own the hover for the whole card. - **List cards in the motion foundations.** `docs/foundations/motion.md` now documents the one place a picture moves inside the console: a list card passes `active` once the pointer has settled for 120ms, or at once on keyboard focus, and the card itself only changes colour. - **"Create a brand and apply Picasso"** in Get started. One page for both halves of the job: making a brand (the Theming page or `brand:new`, `check`, the contrast gate, Picasso Sync, a version) and switching a product onto it (the imports, `@source`, `data-brand`, fonts, vendored `tokens.css`), with a checklist and what to look at when it looks wrong. The Theming page's README tab links to it and gains the last two steps. - **A Brand axis on the Storybook toolbar**, beside Radius, Neutral, Type and Spacing, so any story can be checked under Vantage. ### Fixed - **The App shell's top bar drew its breadcrumb as text.** All ten Figma variants held a text node named `Breadcrumb` whose content read "Page title" — a label for the wrong thing, standing in for a component the file already has. Each variant now carries a real `Breadcrumb` instance at `Size=sm`, and the component description says the bar holds the sidebar toggle and that instance and nothing else. The code was already right. **Figma impact** — `Layout / App shell` changed in all ten variants; not yet published. - **The Illustration story built its own list card.** "In a list card" was a sketch written before `ListCard` existed, and its `grid-cols-[minmax(0,1fr)_9rem]` was the one `no-arbitrary-values` error on `main` — enough to fail the release workflow's lint gate. The story renders the real component now, so there is one list card to drift from rather than two. - **ThresholdSlider named the wrong limit when the thumbs met.** Setting warning and critical to the same number leaves no warning band: either side of the boundary a metric is healthy or critical, never warning. The control dropped the critical label and kept the warning one, so it named a state it could not be in. The critical label survives now, and the critical thumb is raised over its twin so the ring you see is the colour of the boundary you are reading. Measured in Chromium: warning band 0px, `elementFromPoint` at the boundary returns the critical thumb. - **The docs said `data-brand` works on any element.** It works on ``. Semantics are declared on `:root`, so a `data-brand` on an inner element re-points the brand's primitives inside it but not the semantics components use — part of a page would keep the old brand. Corrected in For engineers, Tokens, brands and Figma sync, the Theming page and the `themes.css` header. Behaviour is unchanged; making brands nestable would mean emitting the semantics under each `[data-brand]` too. **Figma impact** — none; in Figma any frame can be any brand. The three existing drawings render as before. Their lift and magnify code now runs through shared hooks, and the original tests pass unchanged. ## 2.0.0 — 8 October 2026 The first published version. The number is **2** because the Figma library already calls itself v2, and Picasso versions Figma, `@ir/tokens` and `@ir/ui` together — so the packages move to meet the library rather than the library being renumbered to meet them. There is no 1.x: nothing was ever published under one. It is a **major** rather than a 2.1 because the chart series palette is a breaking change. Shipping that as a minor would let a consumer pinning `^2.0.0` pick it up expecting nothing to break, and their chart colours would move underneath them. Everything below shipped before there was anything to ship against, so the ⚠️ Breaking entries describe changes made against unreleased `main` rather than against a version anyone is running — they are kept because they are the history of why the API reads the way it does. **Figma impact** — the library and the packages share this version, and the Figma library's publish description should carry `2.0.0`. The display font, `motion/easing/settle` and the renamed phone canvases are synced; the chart palette's two removals and five changes are applied, and the Colours page's documentation of them corrected. `@ir/ui` ships TypeScript source rather than a build, so a consumer needs a bundler that compiles TS and JSX and scans `node_modules/@ir/ui/src` for Tailwind classes. ### Added - **`DistributionChart` and `Heatmap`, and a sequential colour scale.** The two charts the backlog was still missing. **`DistributionChart`** shows the shape of a spread rather than its average — the case being a mean of 90ms that is actually two clumps at 25 and 140, which is an outage wearing an average's clothes. It bins raw samples itself, on the same nice-number scale the axes use, so a bucket runs 20–40 and not 17.3–39.1. The bars touch, because a histogram's axis is continuous and the BarChart gap would claim there is something between two adjacent buckets. Markers run **down** the measured axis: on a bar chart a threshold is a count, but the number anyone quotes about latency is on the other axis. A marker off the scale is not drawn at all — clamping an SLA of 150 onto a 100ms axis draws a line saying the limit is 100, which is a wrong answer rather than a missing one — and it warns in development saying to pin `max`. **`Heatmap`** is endpoint × time, the fleet view. A host that reported nothing is an outlined empty cell, never the lowest band: "fine" and "we don't know" are different answers and only one is safe to ignore. Five bands rather than a gradient, because a colour is read back to a band and then looked up. **`chart/scale/1–5`** is the sequential scale, from IR corporate blue — a hue the palette re-step freed when it turned out to sit 7° from brand blue. It is brand-independent and not a status colour. Light runs light→dark, dark runs dark→light, because nothing can sit below the surface it is drawn on. The bands were chosen by scoring every combination for the most even lightness spread subject to the quietest band staying separable from its card: light lands on min adjacent ΔE 14.0, dark on 17.7. `palette/vis/ir-corporateblue` becomes a full 11-step ramp in the process, which also fixes its 500 and 600 having been the same hex. **Code impact** — both are new; nothing changes. **Figma impact** — done: the sync added five `chart/scale/*` variables and eight `ir-corporateblue` steps and corrected `400` and `600`, and both charts are drawn on the Charts page as `Chart / Distribution` and `Chart / Heatmap`, with the notes frame updated — it still said IR corporate blue was “not a series slot”, which is true but no longer the whole story now that it is the scale's hue. - **The sync plugin checks node bindings, not just variable definitions.** It could report "no changes" on a file whose swatches pointed at variables it had itself deleted, because both sides of the diff agreed and nobody asked the nodes. Figma keeps a deleted variable **resolvable by id** after dropping it from the local set, so an orphaned binding still answers with its old name and looks alive. Check now walks every page it can reach, reports each dangling binding with a place it is used, and `inSync` is false while any exist. Prune refuses to remove a variable that nodes still bind to, naming one, rather than silently orphaning them. A binding carrying a library-key prefix is reported separately as a remote subscription: identical symptom, different fault, and a different fix. **Figma impact** — none; the plugin only reads more than it did. **Every page is `loadAsync`-ed before it is read.** This is not a nicety. In a dynamic-page document `findAll` on a partially-loaded page returns a PARTIAL list and does **not** throw — measured on Picasso, the Colours page gave 2,492 nodes unloaded and 3,598 loaded. A first version of this sweep guarded with `try`/`catch` and treated "did not throw" as "fully read", and three consecutive runs over an unchanged file reported 8, 73 and 0 dangling bindings. A partial read that calls itself clean is the exact failure the sweep exists to catch, so it had been reimplemented inside its own fix. Names are resolved from the collected map **after** the traversal, never inside it: an `await` per node lets Figma unload the page mid-sweep, and the remainder reads as empty. Found once it could actually see: **73 bindings across 9 dead variables** — `fontFamilies/*`, `fontWeights/*`, `fontSize/1` and `letterSpacing/1` from the pre-rename type system, `light/fg/on/primary-emphasis` from before the mode-prefix was dropped, and dead duplicates of `space/2`, `space/4` and `palette/vis/lime/600` that still exist under the same names. 64 were the Log viewer's badges. All rebound to their live equivalents with no visual change; `letterSpacing` was unbound rather than rebound, because tracking is deliberately not a Figma variable — text styles carry `letterSpacingPercent` directly. - **A `Narrow` story for every component, and the ratchet that keeps it that way.** Every component owes one — 328px, a 360 phone minus its gutters — and it was enforced nowhere, so 41 of 55 had drifted without one. All 41 are written; `narrow.test.ts` held the debt while it shrank and now holds the floor, so the next component to arrive without one fails there rather than starting the drift again. **Figma impact** — none. All 58 Narrow stories are measured in a real browser at 360px — none scrolls the page sideways. That sweep found every layout fix in this release; the test suite was green throughout, because jsdom has no layout engine. Three stories are deliberately not 328px boxes. `AppShell`, `Sidebar` and `PageGrid` answer to the **viewport**, not a container, so framing them in a box would measure the box. `input-group` and `slider` pin 320 through a file-level decorator, which is stricter than the floor, and say so. - **A Colour foundations story.** The two chart palettes side by side, each swatch printing the colour it actually resolved to in this mode and brand. Both of this system's worst colour faults were invisible on screen — deleted variables that kept rendering their last value, and two series slots ΔE 4.3 apart — and a page that prints the resolved value is the cheapest guard against either. **Figma impact** — none. - **A Typography foundations story.** The three families, the five roles and the weight tiers, rendered rather than described — with a **Follows the brand** story that prints each step's computed family, because the bug it guards against (every `text-*` step frozen to Inter) showed nothing on screen at all. **Figma impact** — none. - **Motion, before and after — a docs page you can play.** `docs/foundations/motion-before-and-after.md` shows eight motion rules as pairs: the wrong way beside what Picasso does, one button that plays both, and a switch that slows both five times. Three of the wrong sides are Picasso's own history — the ease-in close, the Sidebar's width transition and reduced motion as "off". The examples are stories under **Foundations / Motion before and after**, embedded in the page through a new `Story` component on the site that sizes its frame to the story. The right-hand side of every pair is the real named animation; the wrong ones live in `packages/ui/.storybook/motion-specimens.css` as `data-specimen` rules, in Storybook only, because the linter refuses them in a class. A test holds the pairs, the stories, the specimens and the page to each other. **Figma impact** — none. - **The charts are drawn in Figma**, on a new Charts page beside the other data-display pages: `Chart / Time series`, `Chart / Bar`, and `Chart / Sparkline` as a Tone variant set. Every colour is a variable, so the brand and light/dark follow the file, and each carries a description pointing at its code component. A notes frame beside them says what the drawings are and are not. **Held:** the frame and its fixed height, the furniture — horizontal-only gridlines, both axes, the legend, the dashed threshold — and the series colours. **Not held, because it is behaviour:** the scale that ends on round numbers worked out from the data, the gap that breaks a line rather than diving to the floor, the hover crosshair, hiding a series without repainting the others, and the data table that is how a screen reader gets numbers rather than a shape. They are anatomy to compose a dashboard from, not a specification of the data. - **A press.** `Button` and an interactive `Chip` scale to 97% while held down, taking the label and icon with them, on `motion/duration/fast` (`transition-press` with `motion-safe:active:scale-97`). Not a text link, not a Button inside a `ButtonGroup`, and not under reduced motion, where the pressed colour answers alone. `transition-press` names the properties it animates — the colours a control already animated, plus `scale`. **Figma impact** — none; nothing moves on canvas. - **Three curves: `motion/easing/out`, `in-out` and `drawer`.** `cubic-bezier(0.23, 1, 0.32, 1)` for anything arriving, leaving or pressed; `cubic-bezier(0.77, 0, 0.175, 1)` for something already on screen that moves; `cubic-bezier(0.32, 0.72, 0, 1)` for a sheet sliding from an edge. Tailwind's own `ease-out` and `ease-in-out` classes now resolve to the first two, and `ease-drawer` to the third. `transition-illustration` reads `easing/drawer` rather than restating the same curve. **Figma impact** — three hidden STRING variables on the next sync. - **Motion as a build gate.** `src/__tests__/motion.test.ts` reads `theme.css` and `core.json` and fails on a curve that starts slowly, a duration over 300ms, a keyframe or transition on a layout property, a named animation built from a number rather than a token, and a named animation with no reduced-motion branch. `docs/foundations/motion.md` opens with the question that comes before all of it — should this move at all — and lists what was turned down. **Figma impact** — none. - **A written decision: inputs stay 14px on a phone.** iOS zooms the page when a field under 16px takes focus. Accepted rather than fixed, because a larger step for coarse pointers changes every form's height on a phone. In `docs/foundations/responsive.md`. **Figma impact** — none. - **IR's skills, in `.agents/skills`** (linked from `.claude/skills`): `ir-motion`, `ir-motion-review`, `ir-motion-opportunities`, `ir-mobile-web`, `ir-stress-test-ui` and `ir-pick-ui-library`. They carry the rules in `docs/` for an agent working here or in a product that uses Picasso. `AGENTS.md` gains a Motion section and a table of the skills. **Figma impact** — none. ### ⚠️ Breaking - **The chart series palette is `chart/1–6`, not `1–8`, and the order has changed.** Eight series colours were declared and only three could actually be told apart — validated, not judged by eye: `chart/1` (brand blue) and `chart/4` (IR corporate blue) were ΔE 4.3 apart in normal vision, which is one line drawn twice. Teal sat ΔE 9.6 from brand, indigo 10.8 from IR purple, and IR lime was outside the usable lightness band at every step bar one, where it collided with `vis-lime`. The floor is 15. The order is now brand blue, IR red, indigo, IR purple, amber, pink. **Code impact** — `chart-7` and `chart-8` no longer exist, and `chart-2`, `3` and `4` are different colours than before. **Figma impact** — a sync removes two variables and changes five. Three colours are deliberately no longer series slots and remain colours: IR corporate blue (7° from brand blue on the hue wheel — no step fixes that), IR lime (20° from lime and far too light), and teal (cannot clear blue in both modes at once). A series palette and a brand palette are different jobs: one is chosen so colours belong together, the other so they can be told apart. ### ⚠️ Changed (visual) - **`palette/vis/*` re-stepped for IR red, indigo, IR purple, amber and pink.** Those ramps are referenced by `chart/*` and nothing else, so they are now tuned to pass the categorical checks rather than to match a brand swatch exactly. Brand blue is untouched — `chart/1` is `palette/brand/500` in both modes, the same value it has always been — because half the system reads that ramp. Each changed ramp's 600 was regenerated so it stays darker than its 500. The whole set is validated in **both modes against every pair**, which is a much harder constraint than either mode alone and is what caps it at six. Two warnings remain and are covered by what the chart components already do: amber and IR red separate by only ΔE ~7 under protanopia and deuteranopia, and IR purple and pink fall below 3:1 on the dark card. The legend is always drawn from two series up, every series is named in the tooltip, and a data table always ships — see `docs/foundations/colour.md`. - **The Loader's lead stroke is brand blue rather than IR corporate blue.** It was bound to `chart-4`, which used to be corporate blue and is now IR purple. Rebound to `chart-1`, `chart-4` and `chart-2` so it keeps its blue-leads, purple, red reading — only the blue changes, and only from one blue to another. The Loader is not a chart and arguably should not ride the series palette at all; that is left for when something else needs the same treatment. - **Everything that opens or closes decelerates, both ways.** Closing used an ease-in (`cubic-bezier(0.4, 0, 1, 1)`), which starts slowly — so a dialog hesitated for the first frames after Escape. Arriving and leaving are now both on `easing/out`, and leaving is quicker because it takes the shorter step. The new curve is also stronger than the one it replaces (`cubic-bezier(0, 0, 0.2, 1)`): a popover is most of the way open in the first 50ms. Durations are unchanged. **Drawer**, **Bottom sheet** and the Sidebar's phone nav slide on `easing/drawer`. **Figma impact** — none. - **Reduced motion is a fade, not nothing.** Under `prefers-reduced-motion` every surface used to appear and vanish at once. Each named animation now carries its own reduced branch: travel and scale are replaced by a 150ms fade, so a drawer still arrives, it just does not slide. Because the branch is inside the utility, components no longer write `motion-safe:` on a named animation — `data-[state=open]:animate-dialog-in` is the whole of it. **Code impact** — a consumer that copied the old `motion-safe:data-[state=open]:animate-…` pattern still works, and gets no animation at all under reduced motion; drop the prefix to get the fade. **Figma impact** — none. - **The Sidebar's rail changes width at once again.** It had a 200ms width transition. Width is a layout property, so the page beside the rail — charts and tables — re-laid out on every frame. The `transition-rail` utility is removed with it; nothing else used it. **Figma impact** — none. - **An Accordion row fades as it opens.** The fade rides on the height, so the text no longer appears at full strength in a row that is still two pixels tall. Under reduced motion the row fades in at full height. **Figma impact** — none. - **Colour transitions run on `ease`.** `theme.css` sets Tailwind's default transition to `motion/duration/fast` and `ease`, so every bare `transition-colors` is on the tokens. The duration is the same 150ms; the curve was Tailwind's `cubic-bezier(0.4, 0, 0.2, 1)`. **Figma impact** — none. - **A Switch's knob, a Progress bar and the Input button's chevron state a curve and no number.** The knob and chevron are on `ease-out`; Progress and File upload's bar are linear, because a bar reporting progress does not ease. All four stop travelling under reduced motion. The Switch's `duration-150` is gone — the default is the token. **Figma impact** — none. ### Fixed - **A fresh clone shipped no tokens.** `packages/tokens/dist/` is gitignored and nothing rebuilt it on install, so `@ir/tokens/tokens.css` — the package's main consumable — did not resolve. The release workflow runs `build:tokens` before publishing, so a tagged release was always fine; **installing from a git URL was not**, which is the first thing a team does before a registry exists. `@ir/tokens` now has a `prepare` script, which npm runs on install-from-git and before publish. Verified by cloning the repo fresh: `dist/` absent before, present after. **Figma impact** — none. - **The App shell left a 360 phone 104px of content.** `mobile="drawer"` is opt-in, and nothing in the shell's own stories opted in — so at 360 the 256 rail was still drawn inline, taking 71% of the viewport, wrapping body text to about a word a line and clipping the breadcrumb. The shell and sidebar stories now pass it, and say in the story why. Found by screenshotting the `Narrow` story; the overflow sweep passed it, because an ancestor's `overflow-hidden` meant nothing technically overflowed — the content was simply unusable. **Figma impact** — none. Worth a decision separately: **opt-in is the wrong default.** A shell that needs a prop to be usable on a phone will be shipped without it. - **A chart's screen-reader table scrolled the page sideways on a phone.** The table carried `sr-only` itself, and a `` sizes to its content and ignores that rule's `width: 1px` — so the "hidden" table was a real 428px element, 68px wider than a 360 viewport. The wrapper carries `sr-only` now and clips it. Caught by measuring in a browser at 360; every test passed throughout, because jsdom has no layout. **Figma impact** — none. - **A Sparkline's end dot hung outside its own box.** The dot is centred on the last reading, which in a sparkline is always at `x: 100%`, so half the 8px dot plus its 2px ring — 6px — sat outside the component and scrolled the page. `--spark-x` is clamped to keep the dot and its ring inside. The cost is up to 6px of position at the extremes; the dot marks the latest value rather than measuring it, so being fully visible is worth more than sitting exactly on the endpoint. **Figma impact** — none. ### Deprecated - **`motion/easing/enter` and `motion/easing/exit`**, with the `ease-enter` and `ease-exit` classes that read them. Both now equal `easing/out`; use that. Removed in the next major release. **Figma impact** — the two variables stay until then, with the new value. --- **Everything below was written for an 0.1.0 that was tagged but never pushed or published.** It is the same release, so it is kept here under 2.0.0 rather than split across a version no consumer ever saw. The repeated category headings from here down are that fold, not two releases. ### ⚠️ Breaking - **`screen/mobile/*` is `min` / `small` / `base` / `max`, not `sm` / `md` / `lg` / `xl`.** The group's own description sets the rule — `lg:` means the same thing in a token file, a Figma page name and a class name — and the group broke it, because `screen/mobile/lg` was 390 while `screen/desktop/lg` is 1024. Below `md` (768) there is one layout, so a phone has no breakpoints to name, only widths to draw at; the new names say where each sits in the range: 320 the floor, 375 the small one, 390 the canvas to design at, 428 the ceiling. **Code impact** — none; nothing in the repo read these tokens. **Figma impact** — the four renames are in the sync plugin's `PICASSO_RENAMES`, which runs before matching, so a frame bound to one keeps its binding. Without that the sync would have created four variables and orphaned four. The group description also referred to a `screen/canvas/*` group that has never existed; it now describes the two that do. Documented in the breakpoints story, which covered `screen/desktop/*` and had never mentioned the canvases. - **The phone floor is 360, not 320.** Writing the canvases down showed that nothing had ever been checked at the floor: every `Narrow` story is 328 — a 360 phone minus its gutters — and 360 was not on the ladder at all, while 320 (iPhone SE 1 era) sat there as a floor no story and no overflow sweep ever measured. `screen/mobile/min` is 360, which is both the commonest Android viewport and what the sweep already measures, so the ladder and the stories now describe the same phone. 375 stays as the iOS case to check rather than a second floor. **Code impact** — none; nothing reads these tokens, and no story width changes. **Figma impact** — a sync updates one FLOAT. - **`SidebarHeader`'s brand variant is `brand`, not `plate`.** Nobody outside this repo knew what a "plate" was — including the design system's own owner, which is the test a name has to pass. **Code impact** — replace `variant="plate"` with `variant="brand"`; TypeScript refuses the old value. Nothing renders differently. The prose follows the same rule: the block is "the brand", the thing it sits in is "the header". **Figma impact** — the phone nav's `Brand plate · 80` frame is renamed with it. - **Drawer's `side` is `start` / `end`, not `left` / `right`.** `end` is the default and is where `right` was in a left-to-right page; in Arabic, Hebrew and Persian it is the left, opposite the sidebar. **Code impact** — replace `side="right"` with `side="end"` and `side="left"` with `side="start"`; TypeScript refuses the old values. `data-side` and the motion utilities (`animate-drawer-in-end`, `-out-end`, `-in-start`, `-out-start`) are renamed to match. **Figma impact** — applied the same day: the Drawer's variant axis `Type` = Right | Left | Expanded is now `Side` = End | Start | Expanded. The five variants were renamed in place, so every component key and every instance carried across; a design that overrides the axis shows the new names on update. The page's own copy and the set's description say the same. Drawer / Header keeps its own `Type` axis (Record | Title). ### Added - **A spring — `motion/easing/settle` — and the bottom sheet drags.** The handle and the header follow the finger downward. Released past a quarter of the panel (floor 64px), or thrown faster than 0.5px/ms having travelled at least 48, the sheet goes; short of that it settles back. Dragging up is resisted rather than refused: the panel gives 24px and stops. `drag={false}` opts out. **Code impact** — none required; every existing sheet gets it. **Figma impact** — a sync adds one hidden `motion/easing/settle` STRING variable; Figma draws no motion. The token is `cubic-bezier(0.3, 1.35, 0.5, 1)` — about 4% past the target at 58% of the duration, measured at 3.3px on an 80px drag, with six frames past the resting line. It is deliberately a curve and **not** stiffness/damping: a physics spring is velocity-aware and only JS can run one, while every other motion token here is something CSS takes straight. A gentler overshoot was tried first and rejected — at 2% it is sub-pixel at the distances a thumb actually drags, which would have left the curve indistinguishable from `easing/enter` and not worth having. Use it with `duration/base`; there is no settle duration. Two things worth knowing about the implementation. The offset rides on the `translate` property, not `transform`: they compose, so a dragged panel keeps its offset while `animate-sheet-out` animates `transform`, and the sheet leaves from where the finger left it instead of jumping back to the edge first. `transition-settle` therefore transitions `translate` — transitioning `transform` animates nothing at all, which is how the first version shipped past a passing test suite and was caught only by measuring the rendered result. And the panel follows the finger under `prefers-reduced-motion` too, because direct manipulation is not animation; only the release is instant. The guidance pair that said the handle is decoration named the exact blocker this removes — “a drag needs motion that follows the finger, which the motion tokens (fixed durations) do not describe” — and is rewritten as `drag-is-not-the-exit`: the close button is still always drawn, the handle is still `aria-hidden`, and the drag is an addition to Escape, the scrim and the close button rather than a replacement for any of them. - **A display font role, and one step that uses it: `text-wordmark`.** A brand can now name a third family in its `brand.json` — `type.display` — alongside `sans` and `mono`. Clarion names Oswald; the wordmark in the rail's brand header, and the single letter it crops to on the 48 rail, are set in it: 20px, semibold, uppercase, tracked out, because a condensed display face set in caps closes up at UI sizes. The role is optional and a brand that names none inherits its sans, so `type/family/display` always resolves and no component branches on whether a brand has one — Vantage names none and its wordmark is Manrope. **Code impact** — none required; `SidebarBrand` picks the new step up on its own. `font-display` is available as a Tailwind utility, and `npm run brand:new` takes an optional `--display`. The wordmark's `children` stay sentence case in code: the step carries the uppercase. **Figma impact** — a sync adds a `type/family/display` variable per brand, a `shared/text/wordmark` text style and the `_type/style/display-semibold` helper it binds. The wordmark text in the `Sidebar / SidebarHeader` set is hand-styled Oswald today and should be rebound to the new text style; the drawn result does not change. Unlike sans and mono, the display family does **not** swap under `data-type="system"` — a product's display face is its mark, not a UI preference, so it stays put when the rest goes native. - **A theme builder at `/theming`.** Paste or drop a `brand.json` or a `tokens.css`, or start from a colour, and the five axes — brand, neutral ramp, radius, typography, spacing — are editable in place beside a preview of real Picasso components, not swatches. The eleven-stop brand ramp is editable stop by stop; editing one makes the ramp the brand's own rather than a generated one. What comes back out is the same `brand.json` the importer reads, so a value typed here and the same value imported from a file cannot be understood two different ways. **Figma impact** — none; it reads and writes the repo's own format. - **Four more typefaces in the builder, self-hosted:** Figtree, DM Sans, Public Sans and IBM Plex Mono, through `@fontsource`. Self-hosted rather than linked, so a preview is the real face on every machine and the page does not depend on a font CDN. - **`KpiRow` and `ChartGrid`** — the two layouts every console page was rebuilding by hand. `KpiRow` is the tile row; `ChartGrid` takes `max={2}` or `max={3}` and steps down through its own container's width, not the viewport's, so a grid inside a narrowed panel folds when the panel does. - **`docs/foundations/responsive.md`** — the two contracts (the shell answers to the viewport, everything else answers to its container) and six baseline rules for a phone. Ten components that pinned their demo width from 384 to 960 now carry a **Narrow** story at 328, a 360 viewport minus its gutters, so the overflow sweep has something to measure. - **Right-to-left: Arabic, Hebrew and Persian.** `docs/foundations/rtl.md` is the whole of it. - **`DirectionProvider` and `useDirection`** — Radix reads direction from a provider, not the DOM; without it the layout mirrors and the arrow keys do not. Storybook's toolbar has a **Direction** control that sets both. - **Scales mirror.** Progress and File upload fill from the inline start; Threshold slider draws, measures the pointer and reads the arrow keys from the inline start, as Radix's Slider does. - **Switch's knob travels to the inline end.** In RTL it used to slide out of its own track. - **Toast is swiped away toward the edge it came from** — `ToastProvider` sets Radix's `swipeDirection` from the direction. - **Calendar** hands the direction to its grid. - **Icons mirror**: Breadcrumb's separator, Dropdown menu's submenu chevron and the Sidebar trigger now carry `rtl-mirror`. The Sidebar brand scrim fades from the inline start. - **`ltr-island`** — a utility for technical text, which reads left to right in every locale. On KPI tile's figure, Progress's value, Table's numeric cells, Number input, OTP, Input group text and Threshold slider's readings. A numeric column is right-aligned in every locale. - **`--direction-sign`** (1 or -1) for keyframes that travel sideways. - **Letter-spacing is zero under an Arabic-script `lang`.** - A test that fails when a directional icon is added without `rtl-mirror`. - **Noto Sans, Noto Sans Arabic and Noto Sans Hebrew.** Every font stack, sans and mono, carries the Arabic and Hebrew faces after the family itself, so those scripts look the same on every OS. Noto Sans is a selectable sans in the theme builder. Code only — nothing changes in Figma. - **`SegmentedControl`** — a choice that stays selected, as one control: a muted track with the current option on a raised thumb. `SegmentedControl` and `SegmentedControlItem`, `size="sm" | "md"` (32 / 36, Button's and Input's heights) and `fullWidth`. It is a radio group — one option always selected, arrow keys move it — so it is not a ButtonGroup (actions, nothing stays pressed) and not Tabs (panels). The Bottom sheet's Sort story now uses it for Ascending / Descending, where it had borrowed a ButtonGroup with a Secondary button standing in for "selected". **Figma impact** — new `Segmented control` set (`Size` × `Full width`) and its `_Segment` part, on a new page under Forms; the mobile Sort sheet uses it. - **Motion tokens, and the first three things that use them.** `motion/duration/fast` 150ms, `base` 200ms, `slow` 300ms, and `motion/easing/enter` and `exit`. **Dialog** fades and scales in, **Drawer** slides in from its edge (the expanded one scales like a Dialog), their scrim fades, and **Accordion** rows open to their measured height. Arriving takes the longer step and decelerates; leaving takes the shorter and accelerates. All of it sits under `motion-safe:`, so reduced motion gets no animation. Components ask for a named animation (`animate-dialog-in`, …) and never state a duration or curve. **Figma impact** — five `motion/*` variables in Primitives, hidden from pickers; nothing moves on canvas. - **Motion for everything else that opens, closes or changes size.** **Popover**, **Dropdown menu** (and its submenus), **Select**'s menu and **Tooltip** fade and scale from the corner nearest their trigger (`animate-popover-in` · `-out`, fast both ways — they are small and open under the pointer, so the base step reads as lag). A Tooltip only animates its delayed open; the instant open Radix gives the next trigger along a row stays instant. **Toast** slides in from the edge its viewport sits on (the right; the left under `dir="rtl"`) and leaves the same way (`animate-toast-in` · `-out`), and now follows a swipe: it tracks the finger, carries on from where it is let go, and settles back if the swipe is abandoned. Radix's `swipeDirection` is physical, so an RTL app passes `swipeDirection="left"` to `ToastProvider`. **Bottom sheet** rises from the bottom edge and drops back (`animate-sheet-in` · `-out`); Toast and Bottom sheet take the Drawer's timing, slow in and base out. The **Sidebar**'s rail changes width over `motion/duration/base` (`transition-rail`). All of it sits under `motion-safe:`; under reduced motion everything is instant, and a Toast still follows the finger because that is not animation. No new tokens. **Figma impact** — none; nothing moves on canvas. - **`npm run format` and `npm run format:check`**, scoped to `packages/ui/src`, with Prettier declared as a dev dependency. All of `packages/ui/src` is now formatted, so a format-on-save no longer drags unrelated lines into a diff. **Figma impact** — none. - **An `Invalid` story for Select and Password input, and a test each for Select, Number input and Password input.** The treatment was already there (`aria-invalid` turns the border to `border/input/invalid`); nothing showed it or guarded it. **Figma impact** — none; Figma already draws all three. - **`Illustration` — product spot illustrations that answer the pointer.** Three drawings, redrawn from the Spotkit spots on Picasso semantics with Lucide glyphs: `issue-alerts`, `fleet-health`, `call-readiness`. Each carries one mechanic — **lift** (the gap follows the pointer), **magnify** (each shape swells by its distance from the pointer, on a spring) and **sequence** (steps light one at a time while hovered). `interactive={false}` keeps a picture still for use inside the product. **Not in Figma yet** — built in code first. - **Illustration motion in `@ir/tokens/theme.css`:** `transition-illustration`, `animate-illustration-check`, `animate-illustration-flow` and `illustration-float`. Motion is now three things — colour, the Loader and illustrations — and `docs/foundations/motion.md` says where the third stops: outside the console, and never as a duration scale for controls. ### Fixed - **Every `text-*` step now follows the brand, the density and the type theme. None of them did.** `[data-brand]`, `[data-type="compact"]` and `[data-type="system"]` each redeclare the `--type-*` primitives, and not one of those redeclarations reached a single typography step: `font-sans` tracked the brand while `text-body-md` — which nearly every component uses — stayed Inter at the default ramp, so switching brand changed the colours and left the type alone, the compact density changed nothing, and the system type theme was inert. Two causes, both in the token build. A typography token's `$value` is an object, so `value/ir/css-var-references` (which filters for strings) skipped it and the format emitted the default brand's resolved literals. Emitting the reference instead is not enough either: a `var()` inside a custom property is substituted where the property is *declared*, so `--text-body-md-font-family: var(--type-family-sans)` on `:root` computes to Inter there and inherits as Inter. The indirection now sits in the utility — `font-family: var(--text-body-md-font-family, var(--type-family-sans))` — which resolves at the element. The step's own variable is left undeclared and is the override slot: unset it falls back to the primitive; set on any scope it wins. **Code impact** — none, and nothing changes at the default brand and density, where the values were already correct. The `--text-*-font-family` / `-font-size` / `-font-weight` / `-line-height` / `-letter-spacing` declarations no longer appear in `:root`; nothing in the repo read them. The Arabic and Hebrew tracking kill-switch still collapses as it did. **Figma impact** — none; Figma binds each text style to the variables directly and was never affected. - **The theme builder previewed a new brand's wordmark in Clarion's Oswald.** It writes the preview's custom properties by hand rather than through `brandLayer()`, and had no `--type-family-display`, so the wordmark kept the default brand's display face while every other step followed the chosen family. It now sets the display family to the chosen sans, which is what the build generates for a `brand.json` that names no display face — the preview and the export agree again. Combined with the fix above, changing the font in the builder is visible for the first time. - **Every touch target meets the floor: 202 were under it, now none are.** WCAG 2.2 AA (2.5.8) sets 24×24, with a spacing exception — a 24px circle on the target must not reach another target's. Where a control is smaller than the row it sits in, the row is the target; where it stands alone, an expanded hit area reaches out from it. Those areas are pseudo-elements, so they are invisible to `getBoundingClientRect`; they were verified by walking `elementFromPoint` outward from each centre. Slider and Threshold slider needed their own insets — a negative inset resolves against the padding box, so a 3px border on a 16px thumb leaves only 10px to grow from, and the first attempt produced an 18×38 target. - **`FieldOption` is one target.** The control and its text now sit inside one `