ochreui 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +150 -2
  3. package/cli/ochreui.mjs +502 -0
  4. package/mcp/core.mjs +126 -0
  5. package/mcp/docs.json +906 -0
  6. package/mcp/server.mjs +23 -0
  7. package/package.json +373 -3
  8. package/registry/agent-team.ts +350 -0
  9. package/registry/avatar.ts +300 -0
  10. package/registry/badge.ts +207 -0
  11. package/registry/breadcrumb.ts +435 -0
  12. package/registry/button.ts +238 -0
  13. package/registry/card.ts +221 -0
  14. package/registry/change-summary.ts +200 -0
  15. package/registry/checkbox.ts +204 -0
  16. package/registry/code-block.ts +332 -0
  17. package/registry/color-picker.ts +720 -0
  18. package/registry/comment-thread.ts +503 -0
  19. package/registry/context-menu.ts +281 -0
  20. package/registry/cover-flow.ts +623 -0
  21. package/registry/date-picker.ts +799 -0
  22. package/registry/decision-inbox.ts +340 -0
  23. package/registry/dialog.ts +577 -0
  24. package/registry/dropdown-menu.ts +864 -0
  25. package/registry/email-draft.ts +916 -0
  26. package/registry/empty-calendar.ts +199 -0
  27. package/registry/empty-state.ts +164 -0
  28. package/registry/enrichment-orbit.ts +164 -0
  29. package/registry/filter-menu.ts +541 -0
  30. package/registry/form-field.ts +308 -0
  31. package/registry/frost-cloud.ts +381 -0
  32. package/registry/ghosted-chat.ts +210 -0
  33. package/registry/glow-cloud.ts +402 -0
  34. package/registry/grid-background.ts +164 -0
  35. package/registry/hover-card.ts +401 -0
  36. package/registry/icon-button.ts +133 -0
  37. package/registry/index.json +2079 -0
  38. package/registry/integration-beam.ts +588 -0
  39. package/registry/integration-grid.ts +209 -0
  40. package/registry/kbd.ts +176 -0
  41. package/registry/layer-stack.ts +351 -0
  42. package/registry/lead-sourcing.ts +285 -0
  43. package/registry/logo-cluster.ts +239 -0
  44. package/registry/logo-marquee.ts +505 -0
  45. package/registry/message-actions.ts +833 -0
  46. package/registry/model-orbit.ts +583 -0
  47. package/registry/model-wheel.ts +372 -0
  48. package/registry/notification-stack.ts +301 -0
  49. package/registry/number-input.ts +552 -0
  50. package/registry/number-ticker.ts +261 -0
  51. package/registry/ochre.css +917 -0
  52. package/registry/otp-input.ts +704 -0
  53. package/registry/overlay.ts +312 -0
  54. package/registry/pagination.ts +362 -0
  55. package/registry/popover.ts +296 -0
  56. package/registry/profile-menu.ts +332 -0
  57. package/registry/progress-tracker.ts +291 -0
  58. package/registry/rating.ts +461 -0
  59. package/registry/reaction-bar.ts +322 -0
  60. package/registry/region-map.ts +537 -0
  61. package/registry/resizable.ts +489 -0
  62. package/registry/scroll-area.ts +271 -0
  63. package/registry/segmented-control.ts +433 -0
  64. package/registry/select.ts +769 -0
  65. package/registry/separator.ts +97 -0
  66. package/registry/shimmer-loader.ts +211 -0
  67. package/registry/side-folder.ts +152 -0
  68. package/registry/skeleton.ts +136 -0
  69. package/registry/skill/INSTRUCTIONS.md +11 -0
  70. package/registry/skill/SKILL.md +65 -0
  71. package/registry/skill/checklist.md +45 -0
  72. package/registry/skill/references/agent-team.md +105 -0
  73. package/registry/skill/references/avatar.md +88 -0
  74. package/registry/skill/references/badge.md +92 -0
  75. package/registry/skill/references/breadcrumb.md +99 -0
  76. package/registry/skill/references/button.md +82 -0
  77. package/registry/skill/references/card.md +111 -0
  78. package/registry/skill/references/catalog.md +114 -0
  79. package/registry/skill/references/change-summary.md +103 -0
  80. package/registry/skill/references/checkbox.md +105 -0
  81. package/registry/skill/references/code-block.md +109 -0
  82. package/registry/skill/references/color-picker.md +138 -0
  83. package/registry/skill/references/comment-thread.md +164 -0
  84. package/registry/skill/references/context-menu.md +205 -0
  85. package/registry/skill/references/cover-flow.md +128 -0
  86. package/registry/skill/references/date-picker.md +154 -0
  87. package/registry/skill/references/decision-inbox.md +126 -0
  88. package/registry/skill/references/dialog.md +155 -0
  89. package/registry/skill/references/dropdown-menu.md +144 -0
  90. package/registry/skill/references/email-draft.md +182 -0
  91. package/registry/skill/references/empty-calendar.md +74 -0
  92. package/registry/skill/references/empty-state.md +118 -0
  93. package/registry/skill/references/enrichment-orbit.md +71 -0
  94. package/registry/skill/references/filter-menu.md +143 -0
  95. package/registry/skill/references/form-field.md +118 -0
  96. package/registry/skill/references/frost-cloud.md +80 -0
  97. package/registry/skill/references/ghosted-chat.md +75 -0
  98. package/registry/skill/references/glow-cloud.md +84 -0
  99. package/registry/skill/references/grid-background.md +76 -0
  100. package/registry/skill/references/hover-card.md +125 -0
  101. package/registry/skill/references/icon-button.md +99 -0
  102. package/registry/skill/references/integration-beam.md +107 -0
  103. package/registry/skill/references/integration-grid.md +100 -0
  104. package/registry/skill/references/kbd.md +65 -0
  105. package/registry/skill/references/layer-stack.md +115 -0
  106. package/registry/skill/references/lead-sourcing.md +92 -0
  107. package/registry/skill/references/logo-cluster.md +92 -0
  108. package/registry/skill/references/logo-marquee.md +123 -0
  109. package/registry/skill/references/message-actions.md +146 -0
  110. package/registry/skill/references/model-orbit.md +106 -0
  111. package/registry/skill/references/model-wheel.md +84 -0
  112. package/registry/skill/references/notification-stack.md +138 -0
  113. package/registry/skill/references/number-input.md +117 -0
  114. package/registry/skill/references/number-ticker.md +73 -0
  115. package/registry/skill/references/otp-input.md +142 -0
  116. package/registry/skill/references/pagination.md +112 -0
  117. package/registry/skill/references/popover.md +143 -0
  118. package/registry/skill/references/profile-menu.md +123 -0
  119. package/registry/skill/references/progress-tracker.md +122 -0
  120. package/registry/skill/references/rating.md +111 -0
  121. package/registry/skill/references/reaction-bar.md +128 -0
  122. package/registry/skill/references/region-map.md +109 -0
  123. package/registry/skill/references/resizable.md +127 -0
  124. package/registry/skill/references/scroll-area.md +113 -0
  125. package/registry/skill/references/segmented-control.md +96 -0
  126. package/registry/skill/references/select.md +122 -0
  127. package/registry/skill/references/separator.md +69 -0
  128. package/registry/skill/references/shimmer-loader.md +83 -0
  129. package/registry/skill/references/side-folder.md +75 -0
  130. package/registry/skill/references/skeleton.md +95 -0
  131. package/registry/skill/references/smart-recommendation.md +132 -0
  132. package/registry/skill/references/spinner.md +84 -0
  133. package/registry/skill/references/switch.md +79 -0
  134. package/registry/skill/references/tab-overload.md +70 -0
  135. package/registry/skill/references/tag-input.md +126 -0
  136. package/registry/skill/references/team-invite.md +94 -0
  137. package/registry/skill/references/testimonial-wall.md +110 -0
  138. package/registry/skill/references/text-area.md +115 -0
  139. package/registry/skill/references/text-field.md +126 -0
  140. package/registry/skill/references/text-reveal.md +71 -0
  141. package/registry/skill/references/thinking-loader.md +87 -0
  142. package/registry/skill/references/time-picker.md +122 -0
  143. package/registry/skill/references/tips-panel.md +115 -0
  144. package/registry/skill/references/toggle-group.md +98 -0
  145. package/registry/skill/references/tool-call-card.md +151 -0
  146. package/registry/skill/references/tooltip.md +94 -0
  147. package/registry/skill/references/tree-view.md +172 -0
  148. package/registry/skill/theming.md +57 -0
  149. package/registry/smart-recommendation.ts +415 -0
  150. package/registry/spinner.ts +67 -0
  151. package/registry/switch.ts +146 -0
  152. package/registry/tab-overload.ts +211 -0
  153. package/registry/tag-input.ts +620 -0
  154. package/registry/team-invite.ts +248 -0
  155. package/registry/testimonial-wall.ts +521 -0
  156. package/registry/text-area.ts +432 -0
  157. package/registry/text-field.ts +415 -0
  158. package/registry/text-reveal.ts +175 -0
  159. package/registry/theme.ts +68 -0
  160. package/registry/thinking-loader.ts +302 -0
  161. package/registry/time-picker.ts +828 -0
  162. package/registry/tips-panel.ts +312 -0
  163. package/registry/toggle-group.ts +357 -0
  164. package/registry/tool-call-card.ts +578 -0
  165. package/registry/tooltip.ts +486 -0
  166. package/registry/tree-view.ts +454 -0
  167. package/styles/base.css +500 -0
  168. package/styles/tokens.css +415 -0
package/mcp/docs.json ADDED
@@ -0,0 +1,906 @@
1
+ {
2
+ "version": "0.0.1",
3
+ "setup": "# Setup\n\nAdd a component: `npx ochreui@latest add <name>` (also pnpm dlx, yarn dlx, bunx). It copies the component as one file into `src/app/ui/<name>.ts`, and the first time also copies `ochre.css` (tokens and shared classes) into `src/styles/`, lists it first in the `styles` of angular.json, and writes `ochre.json`. Import from the copied file, e.g. `./ui/<name>`.\nThe files belong to the app. `ochreui diff <name>` shows upstream changes; `ochreui update` updates files that weren't edited and keeps edited ones unless `--force`.\nManual: download `/registry/ochre.css` into `src/styles/` and list it first in `styles`, then copy `/registry/<name>.ts` into `src/app/ui/`.\nRequirements: Angular 22+, standalone components; works with zone.js, zoneless and SSR. No other dependencies.\n\nTheming: every visual value is a `--ui-*` CSS variable. Override them on `:root` (and under `[data-ui-theme='dark']` for colors).\nScopes on <html> or any container: `data-ui-theme=\"light|dark\"` (no attribute = follow the system), `data-ui-density=\"comfortable|compact\"`, `data-ui-look=\"flat|tray\"`.\n`UiTheme` (`npx ochreui@latest add theme`, then import from `./ui/theme`) is an injectable with signals `mode`, `density`, `look` and a `toggle()` method; it applies and remembers the choice.\n\n## ochreui rules\n\n- Add components with `npx ochreui@latest add <name>`. It copies one file to `src/app/ui/<name>.ts` (the path in `ochre.json`); import from there, e.g. `import { … } from './ui/<name>'`. `UiTheme` comes from `add theme`.\n- Add components to the standalone component's `imports`. Selectors start with `ui-`.\n- Inputs are signals: bind with `[input]=\"value\"`, and use `[(x)]` for model inputs.\n- Components never change your data. Handle their outputs and update your own signals with new arrays and objects.\n- Style with `--ui-*` tokens and the component's own `--ui-<component>-*` variables. Never use `::ng-deep`. Prefer inputs and variables over editing the copied file, so `ochreui update` can keep it current.\n- No hard-coded colors next to Ochre: use `var(--ui-text)`, `var(--ui-bg-surface)`, `var(--ui-accent)` and the other tokens.\n- Dark mode: set `data-ui-theme` on `<html>` or inject `UiTheme`. Don't write per-theme component styles.\n- Give icon-only controls an `aria-label`. Pass translated strings through the `labels` input.\n- Before using a component, read its API with the Ochre MCP server (`get_component`) or its JSON file.",
4
+ "components": [
5
+ {
6
+ "slug": "agent-team",
7
+ "name": "Agent Team",
8
+ "description": "A looping card illustration: a prompt types itself into a pill, a glow blooms, dashed lines draw down and three agents pop in, each with a status dot, a role and up to two tool discs.",
9
+ "category": "Illustrations",
10
+ "pro": false,
11
+ "entryPoint": "./ui/agent-team",
12
+ "selector": "ui-agent-team",
13
+ "url": "/ai/agent-team.json",
14
+ "markdown": "# Agent Team\n\nA looping card illustration: a prompt types itself into a pill, a glow blooms, dashed lines draw down and three agents pop in, each with a status dot, a role and up to two tool discs.\n\nAdd: `npx ochreui@latest add agent-team`\nImport: `import { UiAgentTeam } from './ui/agent-team';`\nSelector: `<ui-agent-team>`\nDocs: /components/agent-team\n\n## When to use\n- AI and automation products where one request staffs several agents or roles.\n- Feature cards and landing sections about delegation, teams or work across several tools.\n\n## When not to use\n- Real org charts or live agent status: it is a picture that loops by itself.\n- More or fewer than three agents: the layout is drawn for exactly three.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { AgentTeamMembers, UiAgentTeam } from './ui/agent-team';\n\n@Component({\n selector: 'app-agents-feature',\n imports: [UiAgentTeam],\n template: `\n <article>\n <ui-agent-team prompt=\"Set up a crew to clear my support queue\" [members]=\"team\" />\n <h3>One request, a whole team</h3>\n <p>Describe the job once. Three agents pick it up, each with its own role and the tools it needs.</p>\n </article>\n `,\n styles: `\n article { max-inline-size: 560px; border-radius: 16px; background: var(--ui-bg-canvas); box-shadow: 0 0 0 1px var(--ui-hairline); overflow: hidden; }\n ui-agent-team { inline-size: 100%; }\n h3 { margin: 0; padding: 0 24px 4px; font-size: 16px; }\n p { margin: 0; padding: 0 24px 24px; color: var(--ui-text-muted); }\n `,\n})\nexport class AgentsFeature {\n protected readonly team: AgentTeamMembers = [\n { role: 'Billing Analyst', tools: ['docs', 'search'] },\n { role: 'Refund Specialist', tools: ['crm', 'chat'] },\n { role: 'Account Lead', tools: ['mail', 'calendar'] },\n ];\n}\n```\n\n## Rules\n- Pass exactly three members; tools beyond two are ignored.\n- Keep the prompt to about 40 characters and roles to about 18.\n- Size it through the host's inline size (at most 560px); the height follows at 3 : 2.\n- The loop pauses off-screen and in hidden tabs and restarts from the beginning; reduced motion or --ui-motion-scale: 0 shows the finished scene, still.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `members` | `AgentTeamMembers` | required | Exactly three agents, inline start to end. |\n| `prompt` | `string \\| undefined` | labels.prompt | The request that types itself, about 40 characters; longer ones are clipped at the button and type for longer. |\n| `label` | `string \\| undefined` | labels.label(prompt, roles) | The one sentence screen readers hear; an empty string hides the scene from them. |\n| `labels` | `Partial<AgentTeamLabels>` | English | The default prompt and the label sentence, for translation. |\n\n## AgentTeamMember\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `role` | `string` | The role in the chip, one line; long roles end in an ellipsis. |\n| `avatar` | `string \\| undefined` | Image URL cropped to a circle; left out, one of three drawn avatars. |\n| `tools` | `readonly AgentTeamTool[] \\| undefined` | Up to two tool glyphs, drawn as overlapping discs. |\n\n## AgentTeamMembers\n\n`type AgentTeamMembers = readonly [AgentTeamMember, AgentTeamMember, AgentTeamMember]`\n\n## AgentTeamTool\n\n`type AgentTeamTool = 'mail' | 'chat' | 'crm' | 'calendar' | 'search' | 'docs'`\n\n## AgentTeamLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `prompt` | `string` | Used when prompt is left out. |\n| `label` | `(prompt: string, roles: readonly string[]) => string` | Used when label is left out. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-agent-team-surface` | `var(--ui-bg-surface)` | Pill, avatar ring and chip fill. |\n| `--ui-agent-team-ink` | `var(--ui-text)` | Prompt and role text. |\n| `--ui-agent-team-line` | `light-dark(var(--ui-border), var(--ui-border-strong))` | Dashed lines. |\n| `--ui-agent-team-accent` | `var(--ui-accent)` | Send button. |\n| `--ui-agent-team-dot` | `var(--ui-hue-green)` | Status dots; the halo is mixed from it. |\n| `--ui-agent-team-glow-a` | `pink, 26% (14% dark)` | Glow at the inline start. |\n| `--ui-agent-team-glow-b` | `violet, 26% (14% dark)` | Glow at the inline end. |\n| `--ui-agent-team-tool-bg` | `var(--ui-gray-0)` | Tool discs, white in both themes. |\n\n## Accessibility\n- Host role=img with one aria-label holding the prompt and the three roles; every child aria-hidden, photos alt=\"\".\n- label=\"\" drops the role and hides the scene (aria-hidden) when nearby text says the same.\n- No live region: typing is never announced. Nothing is focusable.\n- Forced colors: pill, avatars and chips get a CanvasText edge, the send button ButtonText, dots CanvasText, lines GrayText.\n",
15
+ "keywords": "Illustrations UiAgentTeam AgentTeamMember AgentTeamMembers AgentTeamTool AgentTeamLabels AI and automation products where one request staffs several agents or roles. Feature cards and landing sections about delegation, teams or work across several tools."
16
+ },
17
+ {
18
+ "slug": "avatar",
19
+ "name": "Avatar",
20
+ "description": "A person's picture or initials on their own soft color, a rounded square for workspaces, an agent's pixel mark, a status dot, and a group that overlaps and ends in +N.",
21
+ "category": "Data display",
22
+ "pro": false,
23
+ "entryPoint": "./ui/avatar",
24
+ "selector": "ui-avatar, ui-avatar-group",
25
+ "url": "/ai/avatar.json",
26
+ "markdown": "# Avatar\n\nA person's picture or initials on their own soft color, a rounded square for workspaces, an agent's pixel mark, a status dot, and a group that overlaps and ends in +N.\n\nAdd: `npx ochreui@latest add avatar`\nImport: `import { UiAvatar, UiAvatarGroup } from './ui/avatar';`\nSelector: `<ui-avatar, ui-avatar-group>`\nDocs: /components/avatar\n\n## When to use\n- A person next to their name: comments, members, assignees, the account menu.\n- A workspace, team or org: shape=\"square\".\n- An AI agent: kind=\"agent\", rippling while it works.\n- Who is involved when space is tight: ui-avatar-group with +N.\n\n## When not to use\n- A status with no person: use a badge.\n- A tool or app logo in running text: use an inline icon.\n- Choosing people: use a tag input or combobox.\n\n## Usage\n\n```ts\nimport { Component, input } from '@angular/core';\nimport { UiAvatar, UiAvatarGroup } from './ui/avatar';\n\nexport interface Reviewer {\n id: string;\n name: string;\n photo?: string;\n online: boolean;\n}\n\n@Component({\n selector: 'app-reviewers',\n imports: [UiAvatar, UiAvatarGroup],\n template: `\n <ui-avatar-group size=\"24\" [max]=\"4\" [attr.aria-label]=\"reviewers().length + ' reviewers'\">\n @for (r of reviewers(); track r.id) {\n <ui-avatar [seed]=\"r.id\" [name]=\"r.name\" [src]=\"r.photo\" [status]=\"r.online ? 'online' : undefined\" />\n }\n <ui-avatar kind=\"agent\" seed=\"agent_triage\" name=\"Triage bot\" />\n </ui-avatar-group>\n `,\n})\nexport class Reviewers {\n reviewers = input.required<Reviewer[]>();\n}\n```\n\n## Rules\n- Agents use kind=\"agent\" with the agent's id as seed, never initials or a robot icon.\n- Always pass a stable id as seed.\n- Hide avatars that sit next to a visible name (aria-hidden=\"true\").\n- Avatars must sit in the group's own content (plain wrappers like <a> are fine), not inside another component's template.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `name` | `string` | none | UiAvatar. Initials, spoken name and (without seed) the color. Without it: gray outline, aria-hidden. |\n| `src` | `string` | none | UiAvatar. Picture URL; initials show while loading and stay on failure. |\n| `size` | `20 \\| 24 \\| 32 \\| 40` | 32 | UiAvatar / UiAvatarGroup. The group's size wins inside a group. |\n| `shape` | `'circle' \\| 'square'` | circle (square for agents) | UiAvatar. |\n| `status` | `'online' \\| 'away' \\| 'busy'` | none | UiAvatar. Corner dot, appended to the spoken name. |\n| `kind` | `'person' \\| 'agent'` | 'person' | UiAvatar. agent draws a 3x3 pixel mark; src still wins. |\n| `seed` | `string` | name | UiAvatar. Source of color and pattern; pass a stable id. |\n| `color` | `string` | --ui-hue-blue | UiAvatar, agent only. Mark color. |\n| `working` | `boolean` | false | UiAvatar, agent only. Squares ripple. |\n| `statusLabels` | `Record<AvatarStatus, string>` | online/away/busy | UiAvatar. Spoken status words. |\n| `aria-hidden` | `boolean` | false | UiAvatar. Hide it next to a visible name; static or bound with [aria-hidden]. |\n| `aria-label` | `string` | none | UiAvatar. Replaces the spoken name and status. |\n| `max` | `number` | 4 | UiAvatarGroup. Avatars shown before +N (99+ above 99). |\n| `total` | `number` | none | UiAvatarGroup. Full count when only the first few are passed. |\n| `moreLabel` | `(n: number) => string` | n more | UiAvatarGroup. Spoken name of the +N chip. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-avatar-ring` | `--ui-bg-surface` | Gap around status dots and grouped avatars; set it to the background they sit on. |\n| `--ui-avatar-wave` | `1200ms` | One ripple of a working agent. Still with reduced motion. |\n\n## Accessibility\n- With a name: role=\"img\" and aria-label \"Name[, status]\"; initials, mark and dot are aria-hidden; img alt=\"\".\n- Next to a visible name, add aria-hidden=\"true\" or bind [aria-hidden] (not [attr.aria-hidden]).\n- ui-avatar-group is role=\"group\"; give it an aria-label with the total. The +N chip reads \"N more\".\n- Initials ≥ 4.5:1 and status dots ≥ 3:1 in light and dark; forced colors keep dot and mark.\n",
27
+ "keywords": "Data display UiAvatar UiAvatarGroup initialsOf AvatarSize AvatarShape AvatarStatus AvatarKind A person next to their name: comments, members, assignees, the account menu. A workspace, team or org: shape=\"square\". An AI agent: kind=\"agent\", rippling while it works. Who is involved when space is tight: ui-avatar-group with +N."
28
+ },
29
+ {
30
+ "slug": "badge",
31
+ "name": "Badge",
32
+ "description": "A small status label that carries color: seven soft tones, a leading dot or icon, a softly pulsing live dot, and a round count up to 99+.",
33
+ "category": "Data display",
34
+ "pro": false,
35
+ "entryPoint": "./ui/badge",
36
+ "selector": "ui-badge",
37
+ "url": "/ai/badge.json",
38
+ "markdown": "# Badge\n\nA small status label that carries color: seven soft tones, a leading dot or icon, a softly pulsing live dot, and a round count up to 99+.\n\nAdd: `npx ochreui@latest add badge`\nImport: `import { UiBadge, UiBadgeIcon } from './ui/badge';`\nSelector: `<ui-badge>`\nDocs: /components/badge\n\n## When to use\n- The state of a run, deploy or agent on a row or card.\n- A count next to a title or in a sidebar, capped at 99+.\n- A short kind or stage that is not a status (Beta, Draft): neutral or purple.\n- A highlight in your brand color, such as Recommended or New: accent.\n- Something running right now: the live dot.\n\n## When not to use\n- Anything clickable or removable: use a button or a tag input.\n- Summary text and counts in a page header: keep them gray.\n- A longer message about a state: use a notice or toast.\n- A person or agent: use an avatar.\n\n## Usage\n\n```ts\nimport { Component, input } from '@angular/core';\nimport { BadgeTone, UiBadge } from './ui/badge';\n\nexport type DeployState = 'building' | 'review' | 'live' | 'failed' | 'queued';\n\nconst BADGES: Record<DeployState, { tone: BadgeTone; text: string; dot?: boolean; live?: boolean }> = {\n building: { tone: 'info', text: 'Building', live: true },\n review: { tone: 'warning', text: 'Awaiting review', dot: true },\n live: { tone: 'success', text: 'Live' },\n failed: { tone: 'danger', text: 'Failed' },\n queued: { tone: 'neutral', text: 'Queued' },\n};\n\n@Component({\n selector: 'app-deploy-row',\n imports: [UiBadge],\n template: `\n @let badge = badges[state()];\n <div class=\"row\">\n <span class=\"title\">{{ service() }}</span>\n <ui-badge [tone]=\"badge.tone\" [dot]=\"!!badge.dot\" [live]=\"!!badge.live\">{{ badge.text }}</ui-badge>\n </div>\n `,\n styles: `\n .row { display: flex; align-items: center; gap: 12px; }\n .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n `,\n})\nexport class DeployRow {\n service = input.required<string>();\n state = input.required<DeployState>();\n protected readonly badges = BADGES;\n}\n```\n\n## Rules\n- Map states to tones once: running = info + live, waiting = warning + dot, done = success, failed = danger, queued = neutral.\n- Keep one colored badge per row.\n- Icons go in as <svg uiBadgeIcon>; with dot or live the dot wins.\n- Give counts a label when nearby text doesn't say what is counted.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `(content)` | `text` | none | One or two words; ends in … at the container's width. |\n| `tone` | `'neutral' \\| 'info' \\| 'success' \\| 'warning' \\| 'danger' \\| 'purple' \\| 'accent'` | 'neutral' | Soft tint with text in a deeper shade. info = running, success = done, warning = needs you, danger = failed, purple = a kind like Beta, accent = the brand indigo for a highlight like Recommended. |\n| `size` | `'sm' \\| 'md'` | 'sm' | sm 18px / 11px text; md 20px / 12px text. |\n| `dot` | `boolean` | false | A dot in the tone color before the text. |\n| `live` | `boolean` | false | The dot pulses softly; implies dot. |\n| `count` | `number` | none | Round count instead of text; locale-formatted, clamped at 0. NaN with nothing else renders nothing. |\n| `max` | `number` | 99 | Above it the count reads max+. |\n| `label` | `string` | none | What a count means, read instead of the number; or the state of a dot or icon with no text. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-badge-radius` | `4px (5px md); pill with data-ui-look=\"tray\"` | Corners of a text badge. Counts are always round. |\n| `--ui-badge-pulse` | `1800ms` | One live-dot cycle. Still with reduced motion. |\n\n## Accessibility\n- Plain text, no role; dot and icon are aria-hidden.\n- Color is never the only signal: the word carries the state.\n- label gives a count a spoken meaning (the visible number is aria-hidden), or names a dot or icon that has no text.\n- Every tone's text is ≥ 4.5:1 on its tint in light and dark, over the canvas, surface and tray backgrounds.\n- Forced colors: an outline and a visible dot.\n",
39
+ "keywords": "Data display UiBadge UiBadgeIcon BadgeTone BadgeSize The state of a run, deploy or agent on a row or card. A count next to a title or in a sidebar, capped at 99+. A short kind or stage that is not a status (Beta, Draft): neutral or purple. A highlight in your brand color, such as Recommended or New: accent. Something running right now: the live dot."
40
+ },
41
+ {
42
+ "slug": "breadcrumb",
43
+ "name": "Breadcrumb",
44
+ "description": "Where a page sits and the way back up: your own links in one quiet line, the current page last, a long middle folded into a \"…\" menu, and long names shortened with the full one on hover.",
45
+ "category": "Navigation",
46
+ "pro": false,
47
+ "entryPoint": "./ui/breadcrumb",
48
+ "selector": "ui-breadcrumb",
49
+ "url": "/ai/breadcrumb.json",
50
+ "markdown": "# Breadcrumb\n\nWhere a page sits and the way back up: your own links in one quiet line, the current page last, a long middle folded into a \"…\" menu, and long names shortened with the full one on hover.\n\nAdd: `npx ochreui@latest add breadcrumb`\nImport: `import { UiBreadcrumb, UiCrumb, UiCrumbIcon } from './ui/breadcrumb';`\nSelector: `<ui-breadcrumb>`\nDocs: /components/breadcrumb\n\n## When to use\n- Showing where a page sits in a hierarchy: workspace, project, folder, file.\n- Going back up several levels in one click.\n- Deep trails: the middle folds into \"…\" past maxItems, and on its own when the row is narrow.\n\n## When not to use\n- Paging through one list: use Pagination.\n- Switching views of the same level: use Segmented Control or tabs.\n- Steps of a flow done in order: use a stepper.\n- Picking another workspace from the trail: put a Dropdown Menu on that crumb.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { RouterLink } from '@angular/router';\nimport { UiBreadcrumb, UiCrumb, UiCrumbIcon } from './ui/breadcrumb';\n\n@Component({\n selector: 'app-file-header',\n imports: [UiBreadcrumb, UiCrumb, UiCrumbIcon, RouterLink],\n template: `\n <ui-breadcrumb>\n <a uiCrumb routerLink=\"/projects\">\n <svg uiCrumbIcon viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.25\"><path d=\"M2.5 9.5 4.5 3.5h7l2 6M2.5 9.5v3h11v-3z\" /></svg>\n Projects\n </a>\n <a uiCrumb routerLink=\"/projects/northwind\">Northwind</a>\n <a uiCrumb routerLink=\"/projects/northwind/brand-refresh\">Brand refresh</a>\n <span uiCrumb>Logo pack v3</span>\n </ui-breadcrumb>\n `,\n})\nexport class FileHeader {}\n```\n\n## Rules\n- Put each a[uiCrumb], button[uiCrumb] or span[uiCrumb] directly inside <ui-breadcrumb>, top level first; the last is the current page.\n- Use routerLink or href on anchors and (click) on buttons; folded rows link to the same href and follow the crumb itself.\n- Needs dropdown-menu.ts and overlay.ts next to breadcrumb.ts (the CLI adds them).\n- Icon-only crumbs need an aria-label; put uiCrumbIcon on a leading 14px glyph.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `maxItems` | `number` | 4 | Most crumbs shown, \"…\" included; past it the crumbs after the first fold into the menu. A narrow row folds more on its own. |\n| `separator` | `'slash' \\| 'chevron' \\| string` | null (slash in Clean, chevron in Classic) | Slash, 14px chevron mirrored in RTL, or any short text. |\n| `labels` | `Partial<BreadcrumbLabels>` | { nav: 'Breadcrumb', more: (n) => 'Show ' + n + ' more crumbs', menu: 'More crumbs' } | Landmark name, \"…\" button name, menu name. |\n| `label (UiCrumb)` | `string` | its text | The crumb's name in the \"…\" menu. |\n\n## BreadcrumbLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `nav` | `string` | Names the nav landmark. |\n| `more` | `(count: number) => string` | The \"…\" button's name, given how many crumbs it holds. |\n| `menu` | `string` | Names the menu of folded crumbs. |\n\n## BreadcrumbSeparator\n\n`type BreadcrumbSeparator = 'slash' | 'chevron' | (string & {})`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-breadcrumb-color` | `var(--ui-text-muted)` | Crumbs and the \"…\". |\n| `--ui-breadcrumb-color-current` | `var(--ui-text)` | Current page; crumbs on hover. |\n| `--ui-breadcrumb-separator` | `var(--ui-text-muted) at 45%, Classic 39%` | Separators (decorative, hidden from screen readers). |\n| `--ui-breadcrumb-max-label` | `200px` | Longest a crumb gets before \"…\"; the current page is not capped. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Crumbs and the \"…\"; the current page is skipped. |\n| Enter | Follows a crumb; on \"…\", opens the menu on its first row. |\n| ArrowDown | On \"…\", opens the menu; in it, next row, wrapping. |\n| ArrowUp | Previous row, wrapping. |\n| Home / End | First / last row. |\n| Escape | Closes the menu; focus back on \"…\". |\n\n## Accessibility\n- nav landmark named by labels.nav around an ol; one li per crumb.\n- Last crumb: aria-current=page, not a link, tabindex=-1; separators are CSS with empty alt text.\n- \"…\": aria-label with the count, aria-haspopup=menu, aria-expanded, aria-controls while open, title listing the folded names; opens a role=menu with menuitem rows.\n- After a crumb or a row is followed and the trail re-renders, focus moves to the new current page.\n- Labels have dir=auto; a title with the full name only while a label is cut.\n- Focus ring on :focus-visible only; forced colors: hovered crumbs underline, the active menu row uses Highlight, the panel keeps an edge.\n",
51
+ "keywords": "Navigation UiBreadcrumb UiCrumb UiCrumbIcon BreadcrumbLabels BreadcrumbSeparator Showing where a page sits in a hierarchy: workspace, project, folder, file. Going back up several levels in one click. Deep trails: the middle folds into \"…\" past maxItems, and on its own when the row is narrow."
52
+ },
53
+ {
54
+ "slug": "button",
55
+ "name": "Button",
56
+ "description": "Primary, secondary, ghost and destructive buttons with icons, three sizes, a shimmering loading state that stays focusable, and a width that glides when the label changes.",
57
+ "category": "Buttons",
58
+ "pro": false,
59
+ "entryPoint": "./ui/button",
60
+ "selector": "button[uiButton]",
61
+ "url": "/ai/button.json",
62
+ "markdown": "# Button\n\nPrimary, secondary, ghost and destructive buttons with icons, three sizes, a shimmering loading state that stays focusable, and a width that glides when the label changes.\n\nAdd: `npx ochreui@latest add button`\nImport: `import { UiButton, UiButtonIcon } from './ui/button';`\nSelector: `<button[uiButton]>`\nDocs: /components/button\n\n## When to use\n- Any action someone starts: submit a form, send a message, open a dialog.\n- Actions that take a moment: loading keeps the label in place, dimmed, while they run.\n\n## When not to use\n- Going to another page: use a link.\n- Switching between views: use a segmented control or tabs.\n\n## Usage\n\n```ts\nimport { Component, output, signal } from '@angular/core';\nimport { UiButton } from './ui/button';\n\n@Component({\n selector: 'app-publish-footer',\n imports: [UiButton],\n template: `\n <footer class=\"actions\">\n <button type=\"button\" uiButton variant=\"ghost\" (click)=\"cancel.emit()\">Cancel</button>\n <button type=\"button\" uiButton [loading]=\"publishing()\" (click)=\"publish()\">Publish</button>\n </footer>\n `,\n styles: `\n .actions { display: flex; justify-content: flex-end; gap: 8px; }\n `,\n})\nexport class PublishFooter {\n cancel = output();\n published = output();\n protected readonly publishing = signal(false);\n\n protected async publish() {\n this.publishing.set(true);\n await new Promise((done) => setTimeout(done, 1200));\n this.publishing.set(false);\n this.published.emit();\n }\n}\n```\n\n## Rules\n- Use <button uiButton>, never a div; set type=\"button\" outside forms.\n- Icons go in <svg uiButtonIcon> (before) or <svg uiButtonIconEnd> (after).\n- Announce the end of a loading action in your own aria-live region.\n- Use links, not buttons, for navigation.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `variant` | `'primary' \\| 'secondary' \\| 'ghost' \\| 'destructive'` | 'primary' | Dark chip, white with a hairline edge, text only, or light red for deleting. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | 'md' | 24/28/32px (touch 32/34/36); Classic 32/40/48px. |\n| `loading` | `boolean` | false | Spinner in place of the leading icon, shimmering label, aria-busy; clicks and submits ignored; stays focusable. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-button-radius` | `6px` | Corners; Classic 10/12/14px. |\n| `--ui-button-press` | `0.97` | Scale while held. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Enter or Space | Activates the button. |\n\n## Accessibility\n- The host is the native <button>: focus, keyboard and forms work natively; disabled leaves the tab order.\n- Loading sets aria-busy and aria-disabled, never disabled, so focus stays.\n- Icon-only buttons need aria-label; [uiButtonIcon] / [uiButtonIconEnd] icons are aria-hidden.\n- Labels ≥ 4.5:1 at rest and hover in light and dark; forced colors keep an outline.\n",
63
+ "keywords": "Buttons UiButton UiButtonIcon ButtonVariant ButtonSize Any action someone starts: submit a form, send a message, open a dialog. Actions that take a moment: loading keeps the label in place, dimmed, while they run."
64
+ },
65
+ {
66
+ "slug": "card",
67
+ "name": "Card",
68
+ "description": "The container every screen is built from: a header with an icon, a title, a quiet line and an action, then content and a quiet footer. Make the whole card one click target, or show it as the picked one of a few.",
69
+ "category": "Cards",
70
+ "pro": false,
71
+ "entryPoint": "./ui/card",
72
+ "selector": "[uiCard]",
73
+ "url": "/ai/card.json",
74
+ "markdown": "# Card\n\nThe container every screen is built from: a header with an icon, a title, a quiet line and an action, then content and a quiet footer. Make the whole card one click target, or show it as the picked one of a few.\n\nAdd: `npx ochreui@latest add card`\nImport: `import { UiCard, UiCardHeader, UiCardTitle, UiCardDescription, UiCardIcon, UiCardAction, UiCardContent, UiCardFooter, UiCardEnd, UiCardLink } from './ui/card';`\nSelector: `<[uiCard]>`\nDocs: /components/card\n\n## When to use\n- One self-contained thing: an agent, a project, an integration, with its name, a line and an action.\n- A settings group: title and note, fields, Save in the footer.\n- A grid of things to open: interactive, with a link as the title.\n- A few choices side by side: interactive, the picked one selected.\n\n## When not to use\n- Something floating above the page: use Popover or Dialog.\n- Rows of a long list: plain rows with hairlines.\n- Only a line between groups: use Separator.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiButton } from './ui/button';\nimport { UiCard, UiCardAction, UiCardContent, UiCardDescription, UiCardEnd, UiCardFooter, UiCardHeader, UiCardTitle } from './ui/card';\nimport { UiIconButton, UiIconButtonIcon } from './ui/icon-button';\n\n@Component({\n selector: 'app-release-notes-agent',\n imports: [UiCard, UiCardHeader, UiCardTitle, UiCardDescription, UiCardAction, UiCardContent, UiCardFooter, UiCardEnd, UiButton, UiIconButton, UiIconButtonIcon],\n template: `\n <section uiCard>\n <ui-card-header>\n <h3 uiCardTitle>Release notes writer</h3>\n <p uiCardDescription>Drafts notes from merged pull requests</p>\n <button type=\"button\" uiIconButton uiCardAction size=\"sm\" label=\"More for Release notes writer\">\n <svg uiIconButtonIcon viewBox=\"0 0 24 24\" fill=\"currentColor\"><circle cx=\"5.5\" cy=\"12\" r=\"1.5\" /><circle cx=\"12\" cy=\"12\" r=\"1.5\" /><circle cx=\"18.5\" cy=\"12\" r=\"1.5\" /></svg>\n </button>\n </ui-card-header>\n <p uiCardContent>The last draft covered 14 pull requests and 3 fixes.</p>\n <div uiCardFooter>\n <span>Idle · last run yesterday</span>\n <button type=\"button\" uiButton uiCardEnd variant=\"secondary\" size=\"sm\">Open</button>\n </div>\n </section>\n `,\n styles: `\n p { margin: 0; }\n `,\n})\nexport class ReleaseNotesAgent {}\n```\n\n## Rules\n- Put uiCard on your own element: section/article for page parts, li inside a ul of cards, div otherwise.\n- interactive needs an <a uiCardLink> or <button uiCardLink> inside uiCardTitle.\n- With selected, set aria-pressed (buttons) or aria-current (links) on the uiCardLink.\n- uiCardFooter goes last, as a direct child of the card; uiCardEnd pushes buttons to the end.\n- Don't add a second link that does the same thing as the title link.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `interactive` | `boolean` | false | The whole card is one click target: the uiCardLink in its title stretches over it. Deeper shadow on mouse hover only. |\n| `selected` | `boolean` | false | Shown as picked: grayer fill and firmer edge (Classic: darker tray). Also set aria-pressed or aria-current on the link. |\n| `aria-labelledby` | `string` | the title on section/article | A section or article card without aria-label is labelled by its title; your value is kept. |\n| `aria-label` | `string` | none | Your own name for the card, static or bound. A section or article card with one is not labelled by its title. |\n\n## Parts\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `ui-card-header` | `element` | Top row: [uiCardIcon], then title, description and extra content, then [uiCardAction]. |\n| `uiCardTitle` | `h2–h4, p` | The title (h2–h4, or p for choices). Gets an id unless given one. |\n| `uiCardDescription` | `any element` | Quiet line under the title; empty takes no room. |\n| `uiCardIcon` | `any element` | Icon, logo or avatar before the title. |\n| `uiCardAction` | `any element` | At the end of the title line, centred on it. |\n| `uiCardLink` | `a, button` | a or button in the title; covers an interactive card, carries its focus ring, described by the description. Keeps your aria-describedby=\"…\". |\n| `uiCardContent` | `any element` | The body. |\n| `uiCardFooter` | `any element` | Bottom row in small muted text, last in the card; on the tray in Classic. |\n| `uiCardEnd` | `any element` | Pushes a footer item, and what follows, to the end. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-card-radius` | `calc(var(--ui-radius-md) + 2px + 6px * var(--ui-look-tray))` | Corners: 10px; Classic 16px panel, tray adds 4px. |\n| `--ui-card-padding` | `var(--ui-space-4)` | Inner space. |\n| `--ui-card-gap` | `var(--ui-space-3)` | Space between header, content and footer. |\n| `--ui-card-bg` | `var(--ui-bg-surface)` | Fill. |\n| `--ui-card-bg-selected` | `color-mix(in srgb, var(--ui-bg-muted) 45%, var(--ui-bg-surface)); Classic color-mix(in srgb, var(--ui-text) 5%, var(--ui-tray-bg))` | Selected fill; in Classic the tray around the panel. |\n| `--ui-card-edge` | `color-mix(in srgb, var(--ui-bg-muted) 88%, var(--ui-bg-surface))` | Resting edge. On grey surfaces set --ui-card-edge: var(--ui-hairline). |\n| `--ui-card-edge-hover` | `color-mix(in srgb, var(--ui-text) 5%, var(--ui-bg-muted))` | Edge under a mouse on an interactive card. |\n| `--ui-card-edge-selected` | `color-mix(in srgb, var(--ui-text) 9%, var(--ui-bg-muted))` | Edge of a selected card. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Reaches an interactive card through its title link or button; ring around the whole card. Inner buttons follow. |\n| Enter | Opens the title link or presses its button. |\n| Space | Presses the title button. |\n\n## Accessibility\n- Title is a real heading (p in choice lists); section/article cards are labelled by it, so the name is read once.\n- One real link or button is the target, described by the description; no clickable div.\n- Other buttons stay separate targets above the stretched link.\n- Selected is also said with aria-pressed or aria-current; dev-mode warning when missing.\n- Forced colors: CanvasText edge on every card, 2px Highlight edge when selected.\n",
75
+ "keywords": "Cards UiCard UiCardHeader UiCardTitle UiCardDescription UiCardIcon UiCardAction UiCardContent UiCardFooter UiCardEnd UiCardLink One self-contained thing: an agent, a project, an integration, with its name, a line and an action. A settings group: title and note, fields, Save in the footer. A grid of things to open: interactive, with a link as the title. A few choices side by side: interactive, the picked one selected."
76
+ },
77
+ {
78
+ "slug": "change-summary",
79
+ "name": "Change Summary",
80
+ "description": "A small read-only card that says in words what moved since last time: one metric per row, each with a green, red or grey arrow on a soft tile, and the tone spoken for screen readers.",
81
+ "category": "Data display",
82
+ "pro": false,
83
+ "entryPoint": "./ui/change-summary",
84
+ "selector": "ui-change-summary",
85
+ "url": "/ai/change-summary.json",
86
+ "markdown": "# Change Summary\n\nA small read-only card that says in words what moved since last time: one metric per row, each with a green, red or grey arrow on a soft tile, and the tone spoken for screen readers.\n\nAdd: `npx ochreui@latest add change-summary`\nImport: `import { UiChangeSummary, UiChangeSummaryIcon } from './ui/change-summary';`\nSelector: `<ui-change-summary>`\nDocs: /components/change-summary\n\n## When to use\n- A short recap at the top of a dashboard or weekly report.\n- Saying in words what moved, next to the charts.\n\n## When not to use\n- Exact values compared over time: use a chart or a table.\n- More than about six metrics.\n- Nothing to report: use Empty State.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { MetricChange, UiChangeSummary } from './ui/change-summary';\n\n@Component({\n selector: 'app-weekly-recap',\n imports: [UiChangeSummary],\n template: `\n <ui-change-summary period=\"This week\" [changes]=\"changes\" />\n `,\n})\nexport class WeeklyRecap {\n protected readonly changes: MetricChange[] = [\n { label: 'Weekly signups', change: 'Up 12% to 2,480', tone: 'good' },\n { label: 'Refund requests', change: 'Down to 9 from 15', tone: 'good', direction: 'down' },\n { label: 'Median reply time', change: 'Up 18 min to 2 h 5 min', tone: 'bad', direction: 'up' },\n ];\n}\n```\n\n## Rules\n- Write the direction in the change text; the arrow is decorative.\n- Keep labels unique: rows are tracked by label.\n- Keep it to about six rows; for no data show Empty State instead.\n- Custom icon: <svg uiChangeSummaryIcon> inside the card.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `changes` | `readonly MetricChange[]` | required | One row per metric, in order. |\n| `title` | `string` | \"What's changed\" | Title; names the region. |\n| `period` | `string` | none | Quiet text at the end of the title line. |\n| `headingLevel` | `2 \\| 3 \\| 4 \\| 5 \\| 6` | none | Makes the title role=heading at this level; otherwise a paragraph. |\n| `animate` | `boolean` | true | Staggered fade-and-rise entrance of the rows. |\n| `labels` | `Partial<ChangeSummaryLabels>` | { good: 'good', bad: 'needs attention', neutral: '' } | Hidden words read after each change, per tone; empty says nothing. |\n\n## MetricChange\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `label` | `string` | The metric; one line, cut with … and a tooltip when it does not fit. |\n| `change` | `string` | What happened, direction in words; wraps, \\n breaks the line. |\n| `tone` | `ChangeTone` | Green, red or grey tile. |\n| `direction` | `ChangeDirection (optional)` | Arrow; defaults to up for good, down for bad, flat for neutral. |\n\n## ChangeTone\n\n`type ChangeTone = 'good' | 'bad' | 'neutral'`\n\n## ChangeDirection\n\n`type ChangeDirection = 'up' | 'down' | 'flat'`\n\n## ChangeSummaryLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `good` | `string` | Read after a good change. |\n| `bad` | `string` | Read after a bad change. |\n| `neutral` | `string` | Read after a neutral change. |\n\n## ChangeSummaryHeadingLevel\n\n`type ChangeSummaryHeadingLevel = 2 | 3 | 4 | 5 | 6`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-change-summary-good` | `color-mix(in srgb, var(--ui-success) 70%, var(--ui-hue-green))` | Good arrow. |\n| `--ui-change-summary-good-bg` | `var(--ui-success-soft)` | Good tile. |\n| `--ui-change-summary-bad` | `var(--ui-hue-red)` | Bad arrow. |\n| `--ui-change-summary-bad-bg` | `var(--ui-danger-soft)` | Bad tile. |\n| `--ui-change-summary-neutral` | `var(--ui-icon)` | Neutral arrow. |\n| `--ui-change-summary-neutral-bg` | `var(--ui-bg-muted)` | Neutral tile. |\n\n## Accessibility\n- Host role=region, aria-labelledby the visible title.\n- dl with dt/dd per change, so each change is read with its metric.\n- Tone spoken as hidden text after each change (labels); tiles and arrows aria-hidden.\n- Nothing focusable; dir=auto on title, period, labels and changes.\n- Forced colors: card and tiles keep an outline.\n",
87
+ "keywords": "Data display UiChangeSummary UiChangeSummaryIcon MetricChange ChangeTone ChangeDirection ChangeSummaryLabels ChangeSummaryHeadingLevel A short recap at the top of a dashboard or weekly report. Saying in words what moved, next to the charts."
88
+ },
89
+ {
90
+ "slug": "checkbox",
91
+ "name": "Checkbox",
92
+ "description": "A real checkbox with a label and a quiet second line, a some-of-them dash for Select all, an inline error and a card row. The check draws itself. Your own input inside, so every kind of Angular form just works.",
93
+ "category": "Inputs",
94
+ "pro": false,
95
+ "entryPoint": "./ui/checkbox",
96
+ "selector": "ui-checkbox",
97
+ "url": "/ai/checkbox.json",
98
+ "markdown": "# Checkbox\n\nA real checkbox with a label and a quiet second line, a some-of-them dash for Select all, an inline error and a card row. The check draws itself. Your own input inside, so every kind of Angular form just works.\n\nAdd: `npx ochreui@latest add checkbox`\nImport: `import { UiCheckbox, UiCheckboxInput } from './ui/checkbox';`\nSelector: `<ui-checkbox>`\nDocs: /components/checkbox\n\n## When to use\n- Yes/no choices saved with a form: terms, opt-ins, several items from a list.\n- Select all over a list, with a dash while only some are picked.\n\n## When not to use\n- A setting that applies at once: use Switch.\n- One choice among several: use radio buttons, Segmented Control or Select.\n\n## Usage\n\n```ts\nimport { Component, computed, signal } from '@angular/core';\nimport { UiCheckbox, UiCheckboxInput } from './ui/checkbox';\n\nconst REGIONS = ['Europe', 'North America', 'Asia Pacific'];\n\n@Component({\n selector: 'app-region-picker',\n imports: [UiCheckbox, UiCheckboxInput],\n template: `\n <fieldset>\n <legend>Deploy to</legend>\n <ui-checkbox label=\"All regions\">\n <input type=\"checkbox\" uiCheckbox [checked]=\"all()\" [indeterminate]=\"some()\" (change)=\"toggleAll()\" />\n </ui-checkbox>\n @for (region of regions; track region) {\n <ui-checkbox class=\"nested\" [label]=\"region\">\n <input type=\"checkbox\" uiCheckbox [checked]=\"picked().includes(region)\" (change)=\"toggle(region)\" />\n </ui-checkbox>\n }\n </fieldset>\n `,\n styles: `\n fieldset { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }\n legend { margin-bottom: 10px; padding: 0; font-weight: 500; }\n .nested { padding-inline-start: 26px; }\n @media (pointer: coarse) { .nested { padding-inline-start: 30px; } }\n `,\n})\nexport class RegionPicker {\n protected readonly regions = REGIONS;\n protected readonly picked = signal(['Europe']);\n protected readonly all = computed(() => this.picked().length === REGIONS.length);\n protected readonly some = computed(() => this.picked().length > 0 && !this.all());\n\n protected toggleAll() {\n this.picked.set(this.all() ? [] : [...REGIONS]);\n }\n\n protected toggle(region: string) {\n this.picked.update((list) => (list.includes(region) ? list.filter((r) => r !== region) : [...list, region]));\n }\n}\n```\n\n## Rules\n- Write type=\"checkbox\" yourself on <input uiCheckbox>: Angular forms match it in your template.\n- Bind checked with [formField], formControl, ngModel or [checked] + (change); disabled stays on the input.\n- Put [indeterminate] on the input, not on <ui-checkbox>.\n- Group related boxes in a <fieldset> with a <legend>.\n- Without a label, put aria-label on the input.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | none | Next to the box; clicking toggles. |\n| `description` | `string` | none | Quiet line under the label; the checkbox's description. |\n| `error` | `string \\| null` | none | Marks it invalid and shows the message under it. |\n| `variant` | `'plain' \\| 'card'` | 'plain' | card: a bordered row that toggles anywhere. |\n| `indeterminate` | `boolean` | false | On the input (uiCheckbox): a dash, read as mixed; kept through clicks. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-checkbox-edge` | `var(--ui-border-strong)` | Unchecked edge. Set var(--ui-border-input) for 3:1; prefers-contrast: more uses it. |\n| `--ui-checkbox-edge-hover` | `color-mix(in srgb, var(--ui-text) 35%, var(--ui-bg-surface))` | Unchecked edge on hover. |\n| `--ui-checkbox-fill` | `var(--ui-bg-neutral-solid)` | Checked and indeterminate fill. |\n| `--ui-checkbox-check` | `var(--ui-text-on-neutral)` | Check and dash. |\n| `--ui-checkbox-radius` | `4.5px (Classic 5px)` | Box corners. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Space | Checks or unchecks. |\n| Tab | Next checkbox; each its own stop, disabled ones skipped. |\n\n## Accessibility\n- Native checkbox inside its label; native submit, reset and validity.\n- Named by the label only (aria-labelledby), described by the description, then the error.\n- Error: aria-invalid, aria-describedby, and an aria-live polite region that is always in the page.\n- Indeterminate exposed as mixed.\n- Pale unchecked edge by default; --ui-checkbox-edge or prefers-contrast: more takes it to 3:1. Description ≥ 4.5:1; focus ring on :focus-visible only.\n- Forced colors: box edge kept, Highlight when checked.\n",
99
+ "keywords": "Inputs UiCheckbox UiCheckboxInput CheckboxVariant Yes/no choices saved with a form: terms, opt-ins, several items from a list. Select all over a list, with a dash while only some are picked."
100
+ },
101
+ {
102
+ "slug": "code-block",
103
+ "name": "Code Block",
104
+ "description": "Code to read and copy: a header with the file name or language and a copy button, optional line numbers, highlighted lines, long lines that scroll inside, and a small built-in colorizer for TypeScript, JSON, shell and Python.",
105
+ "category": "Text",
106
+ "pro": false,
107
+ "entryPoint": "./ui/code-block",
108
+ "selector": "ui-code-block",
109
+ "url": "/ai/code-block.json",
110
+ "markdown": "# Code Block\n\nCode to read and copy: a header with the file name or language and a copy button, optional line numbers, highlighted lines, long lines that scroll inside, and a small built-in colorizer for TypeScript, JSON, shell and Python.\n\nAdd: `npx ochreui@latest add code-block`\nImport: `import { UiCodeBlock } from './ui/code-block';`\nSelector: `<ui-code-block>`\nDocs: /components/code-block\n\n## When to use\n- Code someone will copy: an install command, a config file, an API call, a snippet an agent wrote.\n- Tool inputs and outputs, logs or JSON payloads that must keep their exact spacing.\n- Pointing at a few lines: highlightLines plus lineNumbers.\n\n## When not to use\n- One name or value in a sentence: inline <code>, or Kbd for shortcuts.\n- A secret copied once (an API key): a read-only Text Field with copyable.\n- Comparing two versions: a diff view.\n- A whole tool call with arguments and result: a tool call card.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiCodeBlock } from './ui/code-block';\n\nconst JOB = `import { defineJob } from \"./jobs\";\n\nexport const nightlyReport = defineJob({\n name: \"Nightly usage report\",\n schedule: \"0 3 * * *\",\n channels: [\"#ops\", \"#finance\"],\n // Retry before paging anyone\n retry: { attempts: 3, backoff: \"exp\" },\n notifyOnFailure: true,\n});\n`;\n\n@Component({\n selector: 'app-job-source',\n imports: [UiCodeBlock],\n template: `\n <ui-code-block language=\"ts\" filename=\"jobs/nightly-report.ts\" lineNumbers [highlightLines]=\"[8, 9]\" [code]=\"job\" />\n `,\n})\nexport class JobSource {\n protected readonly job = JOB;\n}\n```\n\n## Rules\n- Pass the code as a string in code, not as content; copy() copies it verbatim.\n- Set filename or language so the block and its scroll region have a name.\n- Highlighted lines are counted from 1.\n- class and style on <ui-code-block> land on the block.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `code` | `string` | required | The code, copied verbatim; one trailing newline is not drawn. |\n| `language` | `CodeBlockLanguage` | | ts/tsx/js/jsx, json, bash/sh/zsh, python are colored; others plain. Named in the header without a filename. |\n| `filename` | `string` | | Header text instead of the language; ellipsis plus tooltip when long. |\n| `lineNumbers` | `boolean` | false | Sticky, unselectable, aria-hidden line numbers. |\n| `highlightLines` | `readonly number[]` | [] | Lines to mark, from 1: tint plus a 2px start edge. Out-of-range ignored. |\n| `wrap` | `boolean` | false | Wrap long lines instead of scrolling sideways. |\n| `maxHeight` | `number \\| string \\| null` | null | Scroll inside past this height. Number = px, or any CSS length. |\n| `copyable` | `boolean` | true | The copy button. No button, filename or language: no header. |\n| `labels` | `Partial<CodeBlockLabels>` | {} | copy, copied, code, copyFailed. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `copied` | `string` | After a successful clipboard write, with the code. |\n\n## CodeBlockLabels\n\n`type CodeBlockLabels = { copy: string; copied: string; code: string; copyFailed: string }`\n\n## CodeBlockLanguage\n\n`type CodeBlockLanguage = ts | tsx | js | jsx | json | bash | sh | shell | zsh | python | py | (string & {})`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-code-block-radius` | `calc(var(--ui-radius-md) + 2px); 12px in Classic` | Outer corners. |\n| `--ui-code-block-bg` | `var(--ui-bg-surface); var(--ui-bg-subtle) in Classic` | The block behind the header. |\n| `--ui-code-block-well` | `var(--ui-bg-surface)` | Behind the code. |\n| `--ui-code-block-mark` | `color-mix(in srgb, var(--ui-info) 8%, transparent)` | Highlighted line tint. |\n| `--ui-code-block-mark-edge` | `color-mix(in srgb, var(--ui-info) 55%, var(--ui-code-block-well))` | 2px start edge of highlighted lines. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Copy button, then the code region only while it scrolls. |\n| Enter / Space | Copy (on the button). |\n| Arrow keys | Scroll the focused code (native). |\n\n## Accessibility\n- figure named by the file name or language only (aria-labelledby); pre > code inside.\n- Button label Copy code -> Copied, plus a polite role=status; on clipboard failure the code is selected and copyFailed is announced.\n- The scroller is role=region, tabindex=0 and named \"<name>, Code\" only while it overflows.\n- Line numbers aria-hidden and user-select: none; each line ends in a newline so selections keep blank lines.\n- Code is always dir=ltr; the name is dir=auto.\n- Focus rings on :focus-visible only; 36px touch hit area; forced colors keep edges and mark lines with Mark.\n",
111
+ "keywords": "Text UiCodeBlock CodeBlockLabels CodeBlockLanguage Code someone will copy: an install command, a config file, an API call, a snippet an agent wrote. Tool inputs and outputs, logs or JSON payloads that must keep their exact spacing. Pointing at a few lines: highlightLines plus lineNumbers."
112
+ },
113
+ {
114
+ "slug": "color-picker",
115
+ "name": "Color Picker",
116
+ "description": "A swatch button that opens a small color card: saturation and brightness, hue, optional opacity, a hex field that also reads rgb(), and named presets. The value is a lowercase hex string, with signal forms, reactive forms or ngModel; the panel puts the same card right in a form.",
117
+ "category": "Inputs",
118
+ "pro": false,
119
+ "entryPoint": "./ui/color-picker",
120
+ "selector": "button[uiColorPicker]",
121
+ "url": "/ai/color-picker.json",
122
+ "markdown": "# Color Picker\n\nA swatch button that opens a small color card: saturation and brightness, hue, optional opacity, a hex field that also reads rgb(), and named presets. The value is a lowercase hex string, with signal forms, reactive forms or ngModel; the panel puts the same card right in a form.\n\nAdd: `npx ochreui@latest add color-picker`\nImport: `import { UiColorPicker, UiColorPickerPanel, UiColorControl } from './ui/color-picker';`\nSelector: `<button[uiColorPicker]>`\nDocs: /components/color-picker\n\n## When to use\n- A color that belongs to something: an agent, a project, a label, a calendar.\n- Brand or theme settings where any color goes, with a few named presets.\n- The panel: the same card inside a form or settings page, without the button.\n\n## When not to use\n- A handful of fixed colors: a row of swatches or Toggle Group.\n- A color that stands for a status or a kind: use Select or Segmented Control.\n- Other small floating forms: use Popover.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form } from '@angular/forms/signals';\nimport { ColorPreset, UiColorPicker } from './ui/color-picker';\n\n@Component({\n selector: 'app-agent-color',\n imports: [UiColorPicker, FormField],\n template: `\n <span>Support triage</span>\n <button uiColorPicker label=\"Agent color\" align=\"end\" [presets]=\"presets\" [formField]=\"f.color\" (openChange)=\"!$event && save()\"></button>\n `,\n})\nexport class AgentColor {\n protected readonly presets: ColorPreset[] = [\n { value: '#2f7bf6', label: 'Harbor' },\n { value: '#12a594', label: 'Lagoon' },\n { value: '#e0a106', label: 'Saffron' },\n { value: '#8e4ec6', label: 'Iris' },\n ];\n private readonly model = signal({ color: '#8e4ec6' });\n protected readonly f = form(this.model);\n\n protected save() {\n console.log('Saved', this.model().color);\n }\n}\n```\n\n## Rules\n- Put uiColorPicker on your own <button>; leave its content empty, the picker draws it.\n- Bind [formField], formControl, ngModel or [(value)]; the value is a lowercase hex string.\n- With [formField], don't set name or disabled as attributes: the schema sets them.\n- valueChange fires on every drag step; save on (openChange) false.\n- Name ui-color-picker-panel with aria-label.\n- Don't wrap the picker button in a <label>: the label text would replace the hex in its name.\n- Needs overlay.ts next to color-picker.ts (the CLI adds it): the placement, Escape and outside-press layer shared by the floating components.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `value` | `string (model)` | '#2f7bf6' | Lowercase #rrggbb, or #rrggbbaa with alpha below 100%. Reads #rgb, uppercase and rgb(). [(value)] or a form binding. |\n| `open (UiColorPicker)` | `boolean (model)` | false | [(open)]. False on the button, a press outside, Escape or Tab out. True from the start opens without moving focus. |\n| `label (UiColorPicker)` | `string` | 'Color' | Names the button (\"Agent color: #8E4EC6\") and the card. |\n| `presets` | `(string \\| { value: string; label: string })[]` | [] | Round swatches; label is spoken and the tooltip, a plain string reads as its hex. |\n| `alpha` | `boolean` | false | Opacity slider and percentage; without it, incoming opacity is dropped. |\n| `showValue (UiColorPicker)` | `boolean` | true | Hex next to the swatch; off gives a square swatch-only button. |\n| `size (UiColorPicker)` | `'sm' \\| 'md'` | 'md' | 24/28px; Classic 28/32; touch 32/36, Classic 36/40. |\n| `side (UiColorPicker)` | `'bottom' \\| 'top'` | 'bottom' | Preferred side; flips when the other has more room. |\n| `align (UiColorPicker)` | `'start' \\| 'end'` | 'start' | Edges that line up (logical); switches when it would overflow. |\n| `name (UiColorPicker)` | `string` | none | Submits the hex through a hidden input; native form reset restores the first color. |\n| `aria-label (UiColorPicker)` | `string` | none | Replaces the spoken name (label + hex) on the button; the card keeps label. |\n| `disabled` | `boolean` | false | Dimmed and closed. With [formField] it comes from the schema. |\n| `labels` | `Partial<ColorPickerLabels>` | English | Spoken words: area, areaValue, hue, hueValue, hueNames, opacity, opacityValue, hex, presets. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `valueChange` | `string` | Every change, while dragging too. |\n| `openChange (UiColorPicker)` | `boolean` | Every change of open; false is the moment to save. |\n\n## ColorPickerLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `area` | `string` | Area name: \"Saturation and brightness\". |\n| `areaValue` | `string` | Area value text with {s} and {v}. |\n| `hue` | `string` | Hue slider name. |\n| `hueValue` | `string` | Hue value text with {h} and {name}. |\n| `hueNames` | `readonly string[]` | Nine names: red, orange, yellow, green, cyan, blue, purple, pink, red. |\n| `opacity` | `string` | Opacity slider name. |\n| `opacityValue` | `string` | Opacity value text with {a}. |\n| `hex` | `string` | Hex field name. |\n| `presets` | `string` | Preset group name. |\n\n## ColorHsva\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `h` | `number` | Hue, 0 to 360. |\n| `s` | `number` | Saturation, 0 to 100. |\n| `v` | `number` | Brightness, 0 to 100. |\n| `a` | `number` | Opacity, 0 to 100. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-color-picker-width` | `calc(256px + 8px * var(--ui-look-tray))` | Card and panel width. |\n| `--ui-color-picker-area-height` | `148px; Classic 152px; touch 168px` | Saturation and brightness area. |\n| `--ui-color-picker-swatch` | `20px; Classic 22px; touch 28px` | Preset size. |\n| `--ui-color-picker-thumb` | `12px; touch 16px` | Area thumb. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Enter / Space / ArrowDown | Button: opens, focus to the area; Enter or Space again closes. |\n| ArrowLeft / ArrowRight | Area: saturation ±1. Hue, opacity: ±1. |\n| ArrowUp / ArrowDown | Area: brightness ±1. Hue, opacity: ±1. |\n| Shift + arrows | Steps of 10. |\n| PageUp / PageDown | Brightness, hue or opacity ±10. |\n| Home / End | Area: saturation 0 / 100. Hue 0 / 360. Opacity 0 / 100. |\n| Enter (hex field) | Applies #rgb too; unreadable text sets aria-invalid. |\n| Arrows, Home / End (presets) | Move and select, wrapping. |\n| Escape | Closes; focus back on the button. |\n| Tab | Area, hue, opacity, hex, presets; tabbing out closes. |\n\n## Accessibility\n- Button named by label and hex, read once; aria-haspopup=dialog, aria-expanded, aria-controls while open.\n- Card: non-modal role=dialog named by the label. Focus moves in only on a user open.\n- Area: one role=slider for saturation, value text with brightness. Sliders are dir=ltr.\n- Hue value text names the color (\"272°, purple\").\n- Presets: radiogroup with roving tabindex, named by their labels.\n- Forced colors: color surfaces keep their colors, edges stay, the selected preset gets an outline.\n",
123
+ "keywords": "Inputs UiColorPicker UiColorPickerPanel UiColorControl ColorPreset ColorPickerLabels ColorHsva ColorPickerSize ColorPickerSide ColorPickerAlign A color that belongs to something: an agent, a project, a label, a calendar. Brand or theme settings where any color goes, with a few named presets. The panel: the same card inside a form or settings page, without the button."
124
+ },
125
+ {
126
+ "slug": "comment-thread",
127
+ "name": "Comment Thread",
128
+ "description": "One conversation on one thing, in a compact card: messages with /command chips, an assistant's status line that folds open what it did, a \"Thinking…\" row while it answers, and a reply field.",
129
+ "category": "Chat",
130
+ "pro": false,
131
+ "entryPoint": "./ui/comment-thread",
132
+ "selector": "ui-comment-thread",
133
+ "url": "/ai/comment-thread.json",
134
+ "markdown": "# Comment Thread\n\nOne conversation on one thing, in a compact card: messages with /command chips, an assistant's status line that folds open what it did, a \"Thinking…\" row while it answers, and a reply field.\n\nAdd: `npx ochreui@latest add comment-thread`\nImport: `import { UiCommentThread, UiThreadReply } from './ui/comment-thread';`\nSelector: `<ui-comment-thread>`\nDocs: /components/comment-thread\n\n## When to use\n- One conversation on a selection, a table cell or a line of code.\n- Showing what an assistant did after someone asked for a change.\n\n## When not to use\n- A feed of many separate comments: use a comments panel.\n- A full chat with attachments and a mention picker: use a chat composer.\n\n## Usage\n\n```ts\nimport { Component, inject, signal } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { firstValueFrom } from 'rxjs';\nimport { ThreadAuthor, ThreadMessage, UiCommentThread } from './ui/comment-thread';\n\nconst QUILL: ThreadAuthor = { id: 'quill', name: 'Quill', assistant: true };\n\n@Component({\n selector: 'app-cell-comment',\n imports: [UiCommentThread],\n template: `\n @if (open()) {\n <ui-comment-thread\n [(messages)]=\"messages\"\n [currentUser]=\"me\"\n [assistant]=\"quill\"\n [replyHandler]=\"ask\"\n closable\n (closed)=\"open.set(false)\"\n />\n }\n `,\n})\nexport class CellComment {\n private readonly http = inject(HttpClient);\n protected readonly open = signal(true);\n protected readonly quill = QUILL;\n protected readonly me: ThreadAuthor = { id: 'u_207', name: 'Jonas Weber', avatar: '/avatars/jonas.jpg' };\n protected readonly messages = signal<ThreadMessage[]>([\n {\n id: 'c1',\n author: { id: 'u_481', name: 'Nadia Haddad' },\n createdAt: '2026-12-03T09:12:00Z',\n text: '/edit Round the Q3 totals to whole euros.',\n },\n ]);\n\n // Only ask the assistant when the reply mentions it; otherwise the reply is just posted.\n protected readonly ask = (text: string) =>\n /@quill\\b/i.test(text) ? firstValueFrom(this.http.post<ThreadMessage>('/api/quill/answer', { text })) : undefined;\n}\n```\n\n## Rules\n- Bind [(messages)]; the thread appends replies and answers itself.\n- Give each message a unique id.\n- Return a promise from replyHandler to show the thinking row; return nothing to just post the reply.\n- Escape does not close the thread; handle (closed) to remove it.\n- For a form-bound draft, put <input uiThreadReply> inside and bind it with [formField], formControl or ngModel.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `messages` | `ThreadMessage[]` | [] | Conversation, oldest first. Two-way: replies and answers are appended. |\n| `currentUser` | `ThreadAuthor` | required | Author of replies typed here. |\n| `assistant` | `ThreadAuthor` | none | Shown thinking while an answer is pending; named in the placeholder. |\n| `replyHandler` | `(text: string) => ThreadMessage \\| Promise<ThreadMessage \\| void> \\| void` | none | Called with each reply. A returned message is posted; a promise shows Thinking… until it settles; a rejection shows a retry row. |\n| `thinking` | `boolean` | false | Two-way. True while an answer is pending. |\n| `title` | `string` | 'Comment' | Heading and region name. |\n| `closable` | `boolean` | false | Shows the close button. |\n| `staged` | `boolean` | true | First render: messages rise in, assistant replies 700ms later. false shows them at once. |\n| `labels` | `Partial<CommentThreadLabels>` | English | Every visible and spoken string. |\n| `placeholder (UiThreadReply)` | `string` | labels.placeholder | Placeholder of your own reply input. |\n| `aria-label (UiThreadReply)` | `string` | labels.reply | Name of your own reply input. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `reply` | `string` | Each reply, trimmed, right after it is posted. |\n| `closed` | `void` | Close pressed; remove the thread yourself. |\n| `messagesChange` | `ThreadMessage[]` | A reply or an answer was appended. |\n| `thinkingChange` | `boolean` | An answer started or stopped being pending. |\n\n## ThreadAuthor\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | `string` | Stable id. |\n| `name` | `string` | Shown next to the avatar. |\n| `avatar` | `string` | Picture URL; otherwise an initial, or a gradient mark for assistants. |\n| `assistant` | `boolean` | Marks the assistant. |\n\n## ThreadMessage\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | `string` | Unique; tracks the row. |\n| `author` | `ThreadAuthor` | Who wrote it. |\n| `createdAt` | `Date \\| string \\| number` | Shown relative (just now, 3min ago), exact in datetime and the tooltip. |\n| `text` | `string` | Plain text; line breaks kept. A leading /word becomes the command chip. |\n| `command` | `string` | Command chip, e.g. 'edit'. |\n| `status` | `ThreadStatus` | Status line under the message. |\n\n## ThreadStatus\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `label` | `string` | Status text. |\n| `tone` | `'success' \\| 'info' \\| 'warning' \\| 'danger'` | Disc color; default success. |\n| `details` | `string[]` | Folded lines; makes the status a button. |\n\n## CommentThreadLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `count` | `(n: number) => string` | '2 messages'. |\n| `close` | `string` | 'Close comment'. |\n| `messages` | `string` | Name of the message log. |\n| `reply` | `string` | Name of the reply field. |\n| `placeholder` | `(assistant?: string) => string` | 'Reply, or ask @Name…'. |\n| `send` | `string` | 'Send reply'. |\n| `thinking` | `string` | 'Thinking…'. |\n| `isThinking` | `(name: string) => string` | Spoken name of the thinking row. |\n| `justNow` | `string` | Under a minute. |\n| `ago` | `(n: number, unit: 'minute' \\| 'hour' \\| 'day') => string` | '3min ago'; older than a week shows the date. |\n| `failed` | `string` | Error row text. |\n| `retry` | `string` | Retry button. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-comment-thread-width` | `420px` | Card width; capped at the container. |\n| `--ui-comment-thread-list-min` | `290px (250px under 400px wide)` | Smallest list height. |\n| `--ui-comment-thread-list-max` | `340px (280px under 400px wide)` | List height before scrolling; locks to the current height after the first reply. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Enter | In the field: sends; focus stays. |\n| Enter / Space | On a status line: folds details open or shut. |\n| Tab | Close, message list (when it scrolls), status lines, field, Send (when enabled). |\n\n## Accessibility\n- Region named by its heading (aria-labelledby).\n- Messages are role=log: replies, the thinking row and answers are announced politely.\n- Thinking row named '<assistant> is thinking'.\n- Status lines: buttons with aria-expanded and aria-controls; folded details inert.\n- Message list takes focus only when it scrolls, so it can be scrolled from the keyboard; the log announces additions only.\n- Send is disabled while empty or pending; 44px hit areas on touch.\n- Forced colors: card edge and status disc kept; disabled send in GrayText.\n",
135
+ "keywords": "Chat UiCommentThread UiThreadReply ThreadAuthor ThreadMessage ThreadStatus ThreadTone ThreadReplyHandler ThreadTimeUnit CommentThreadLabels One conversation on a selection, a table cell or a line of code. Showing what an assistant did after someone asked for a change."
136
+ },
137
+ {
138
+ "slug": "context-menu",
139
+ "name": "Context Menu",
140
+ "description": "The menu a right-click opens, with its corner right at the pointer; a long press on touch and Shift F10 from the keyboard. Rows built for the element under the pointer, with icons, shortcuts, checks, red rows and submenus.",
141
+ "category": "Navigation",
142
+ "pro": false,
143
+ "entryPoint": "./ui/context-menu",
144
+ "selector": "[uiContextMenu]",
145
+ "url": "/ai/context-menu.json",
146
+ "markdown": "# Context Menu\n\nThe menu a right-click opens, with its corner right at the pointer; a long press on touch and Shift F10 from the keyboard. Rows built for the element under the pointer, with icons, shortcuts, checks, red rows and submenus.\n\nAdd: `npx ochreui@latest add context-menu`\nImport: `import { UiContextMenu, UiMenu, UiMenuItem, UiMenuItemCheckbox, UiMenuItemRadio, UiMenuGroup, UiMenuSeparator, UiMenuLabel, UiMenuIcon } from './ui/context-menu';`\nSelector: `<[uiContextMenu]>`\nDocs: /components/context-menu\n\n## When to use\n- Actions on the thing under the pointer (a file, a row, a message, a canvas shape) where people expect a right-click.\n- One menu for a whole list, built from the clicked element: its actions on a row, \"New file\" on the empty space.\n- A shortcut next to a visible way in: the same actions behind a ⋯ button or a toolbar.\n\n## When not to use\n- As the only way to reach an action: add a ⋯ button with the same menu.\n- A menu that opens from a button: use Dropdown Menu.\n- Searching across many commands: use a command menu.\n- A preview of what a link points to: use Hover Card.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { UiContextMenu, UiMenu, UiMenuIcon, UiMenuItem, UiMenuSeparator } from './ui/context-menu';\n\ninterface Doc {\n id: string;\n name: string;\n}\n\n@Component({\n selector: 'app-doc-list',\n imports: [UiContextMenu, UiMenu, UiMenuItem, UiMenuSeparator, UiMenuIcon],\n template: `\n <ul class=\"docs\" [uiContextMenu]=\"menu\">\n @for (d of docs(); track d.id) {\n <li><button type=\"button\" [attr.data-doc]=\"d.id\">{{ d.name }}</button></li>\n }\n </ul>\n <ng-template #menu let-target>\n @let doc = docOf(target);\n <ui-menu [aria-label]=\"doc ? 'Actions for ' + doc.name : 'List actions'\">\n @if (doc) {\n <button uiMenuItem shortcut=\"⌘O\" keys=\"Meta+O\" (selected)=\"open(doc)\">\n <svg uiMenuIcon viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"><path d=\"M13.5 4.5h6v6M19.5 4.5l-8 8M17.5 13.5v5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-11a1 1 0 0 1 1-1h5\" /></svg>\n Open\n </button>\n <button uiMenuItem (selected)=\"duplicate(doc)\">Duplicate</button>\n <ui-menu-separator />\n <button uiMenuItem danger (selected)=\"remove(doc)\">Delete</button>\n } @else {\n <button uiMenuItem shortcut=\"⌘N\" keys=\"Meta+N\" (selected)=\"create()\">New document</button>\n }\n </ui-menu>\n </ng-template>\n `,\n styles: `\n .docs { display: grid; gap: 2px; min-height: 160px; margin: 0; padding: 8px; list-style: none; }\n .docs button { width: 100%; padding: 8px; border: 0; border-radius: 8px; background: none; font: inherit; text-align: start; }\n .docs button:hover { background: var(--ui-bg-muted); }\n `,\n})\nexport class DocList {\n protected readonly docs = signal<Doc[]>([\n { id: 'plan', name: 'Q1 roadmap' },\n { id: 'retro', name: 'Launch retro notes' },\n ]);\n\n protected docOf(target: Element) {\n const id = target.closest('[data-doc]')?.getAttribute('data-doc');\n return this.docs().find((d) => d.id === id);\n }\n\n protected open(doc: Doc) {}\n protected duplicate(doc: Doc) {}\n protected remove(doc: Doc) {\n this.docs.update((all) => all.filter((d) => d !== doc));\n }\n protected create() {}\n}\n```\n\n## Rules\n- Put [uiContextMenu] on the area (a <ul>, a table wrapper, a canvas), not on an <li> or <tr>: the menu is rendered right after it.\n- The template holds one <ui-menu>; submenus are more <ui-menu> in the same template, referenced with [uiSubmenu].\n- Use let-target and closest() to build rows for the clicked element; render no rows to let the browser menu show.\n- Rows are your own <button> or <a> with uiMenuItem; radio rows sit in <ui-menu-group [(value)]>.\n- Shortcuts are display only: wire the keys yourself and pass keys=\"Meta+D\" for screen readers.\n- Offer the same actions behind a visible button, opened with openAt().\n- Export it as #ctx=\"uiContextMenu\": openAt(x, y, target?, focus?) opens it at a viewport point and returns false without rows; close() closes it.\n- Needs dropdown-menu.ts and overlay.ts next to context-menu.ts (the CLI adds them).\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `uiContextMenu` | `TemplateRef<ContextMenuContext>` | required | An <ng-template let-target> holding a <ui-menu> and its submenus, rendered right after the area for each opening. No rows for a target: the browser menu shows. |\n| `uiContextMenuDisabled` | `boolean` | false | Never opens; the browser menu shows. |\n| `longPress` | `number` | 500 | Touch hold before it opens, in ms; moving more than 10px cancels. |\n| `open` | `boolean` | false | Two-way [(open)]; true opens it at the area itself. |\n| `labels` | `Partial<ContextMenuLabels>` | { menu: 'Actions' } | The menu name when it has no title or aria-label. |\n| `title (UiMenu)` | `string` | none | Small grey heading above the rows; the menu’s name. |\n| `aria-label (UiMenu)` | `string` | none | Menu name when there is no title; else labels.menu. |\n| `width (UiMenu)` | `number \\| string` | none | Panel width (number = px). Default fits the rows, 168px (Classic 180px) to 320px. |\n| `labels (UiMenu)` | `Partial<MenuLabels>` | { empty: 'Nothing here yet' } | Visible strings. |\n| `id (UiMenu)` | `string` | generated | Panel id; the role=menu element is {id}-list. |\n| `disabled (rows)` | `boolean` | false | aria-disabled; faint, skipped by arrows and typeahead, inert on click. |\n| `danger (rows)` | `boolean` | false | Red label, icon and highlight. |\n| `keepOpen (rows)` | `boolean` | false | The menu stays open after the pick. |\n| `shortcut (rows)` | `string` | none | Shown at the end, hidden from screen readers, read left to right. Display only. |\n| `keys (rows)` | `string` | none | aria-keyshortcuts, such as Meta+D. |\n| `description (rows)` | `string` | none | Quiet second line; the row’s description. |\n| `textValue (rows)` | `string` | the row text | What typeahead matches. |\n| `uiSubmenu (rows)` | `UiMenu` | none | Opens that menu beside the row; adds the chevron. |\n| `checked (UiMenuItemCheckbox)` | `boolean` | false | Two-way [(checked)]; also [formField], formControl, ngModel. |\n| `value (UiMenuItemRadio)` | `unknown` | required | Checked when it equals the group value. |\n| `value (UiMenuGroup)` | `T` | undefined | The picked radio value. [(value)], [formField], formControl, ngModel. |\n| `label (UiMenuGroup)` | `string` | none | Small heading and the group’s name. |\n| `disabled (UiMenuGroup)` | `boolean` | false | Disables every row in the group. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `openChange` | `boolean` | Every change of open. |\n| `toggled` | `ContextMenuToggle` | { open, target } on every opening (again when a right-click moves it) and on close. |\n| `closed (UiMenu)` | `'select' \\| 'escape' \\| 'outside' \\| 'focus-out' \\| 'tab' \\| 'trigger'` | Why it closed, before open turns false. |\n| `selected (rows)` | `void` | Row clicked or picked with Enter or Space (not submenu rows). |\n| `checkedChange (UiMenuItemCheckbox)` | `boolean` | Every change of checked. |\n| `valueChange (UiMenuGroup)` | `T` | Every change of value. |\n\n## ContextMenuLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `menu` | `string` | The menu name when it has no title or aria-label. |\n\n## ContextMenuContext\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `$implicit` | `Element` | The element it opened on (let-target). |\n| `close` | `() => void` | Closes the menu. |\n\n## ContextMenuToggle\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `open` | `boolean` | Whether it is open. |\n| `target` | `Element \\| null` | The element it is about. |\n\n## MenuLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `empty` | `string` | Shown when the menu has no rows. |\n\n## Template: uiContextMenu\n\nThe menu, built for the element it opened on (let-target). Render no rows for a target and the browser menu shows. Context: `{ $implicit: Element; close: () => void }`.\n\n```html\n<ul [uiContextMenu]=\"menu\">…</ul>\n<ng-template #menu let-target>\n <ui-menu aria-label=\"File actions\">\n @if (target.closest('[data-file]')) {\n <button uiMenuItem (selected)=\"open(target)\">Open</button>\n }\n </ui-menu>\n</ng-template>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-menu-bg` | `var(--ui-bg-overlay)` | Panel fill. |\n| `--ui-menu-shadow` | `0.5px ring + soft drop (Classic: 1px ring + two drops)` | Ring and shadow. |\n| `--ui-menu-radius` | `12px (Classic 14px)` | Panel corners; rows stay concentric. |\n| `--ui-menu-pad` | `4px (Classic 5px)` | Space around the rows. |\n| `--ui-menu-min-width` | `168px (Classic 180px)` | Narrowest panel. |\n| `--ui-menu-max-width` | `320px` | Widest panel; labels truncate. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Shift+F10 / ContextMenu | On an element in the area: open at its start + 12px, halfway down, on the checked row, else the first. |\n| ArrowDown / ArrowUp | Next / previous row, wrapping; disabled skipped. |\n| Home / End | First / last row. |\n| Letters | Typeahead; the same letter again cycles. |\n| Enter / Space | Pick and close (unless keepOpen); on a submenu row, open it. |\n| ArrowRight / ArrowLeft | Open a submenu / go back; swapped in RTL. |\n| Escape | Close the innermost menu; focus to its row or where it was before. |\n| Tab | Close all; focus moves on from where it was. |\n\n## Accessibility\n- menuitem, menuitemcheckbox and menuitemradio with aria-checked; submenu rows with aria-haspopup, aria-expanded, aria-controls.\n- Pointer open focuses the menu element with no active row; keyboard open focuses the checked row or the first. Roving real focus; ring on :focus-visible only.\n- Shortcuts aria-hidden and dir=ltr, given as aria-keyshortcuts; the row name is the label only.\n- Danger ≥ 4.5:1 at rest and on its highlight; the danger icon stays red; chevron ≥ 3:1.\n- Forced colors: panel edge, visible separators, Highlight on the active row.\n- The area gets no ARIA: offer the same actions behind a visible ⋯ button.\n- Dev-mode warning for a menu without title or aria-label and for icon-only rows.\n",
147
+ "keywords": "Navigation UiContextMenu UiMenu UiMenuItem UiMenuItemCheckbox UiMenuItemRadio UiMenuGroup UiMenuSeparator UiMenuLabel UiMenuIcon MenuItem ContextMenuContext ContextMenuToggle ContextMenuLabels MenuSide MenuAlign MenuCloseReason MenuFocus MenuLabels Actions on the thing under the pointer (a file, a row, a message, a canvas shape) where people expect a right-click. One menu for a whole list, built from the clicked element: its actions on a row, \"New file\" on the empty space. A shortcut next to a visible way in: the same actions behind a ⋯ button or a toolbar."
148
+ },
149
+ {
150
+ "slug": "cover-flow",
151
+ "name": "Cover Flow",
152
+ "description": "A 3D row of covers: the front one faces you, the others turn away to each side over a soft reflection. Drag, flick, scroll sideways or use the keys, and a spring always lands it on a cover.",
153
+ "category": "Illustrations",
154
+ "pro": false,
155
+ "entryPoint": "./ui/cover-flow",
156
+ "selector": "ui-cover-flow",
157
+ "url": "/ai/cover-flow.json",
158
+ "markdown": "# Cover Flow\n\nA 3D row of covers: the front one faces you, the others turn away to each side over a soft reflection. Drag, flick, scroll sideways or use the keys, and a spring always lands it on a cover.\n\nAdd: `npx ochreui@latest add cover-flow`\nImport: `import { UiCoverFlow, UiCoverFlowCover, UiCoverFlowCaption } from './ui/cover-flow';`\nSelector: `<ui-cover-flow>`\nDocs: /components/cover-flow\n\n## When to use\n- Six to twenty pictures looked at one at a time: albums, trips, products, templates.\n- A showcase row that should feel physical: drag, flick, sideways trackpad scroll.\n\n## When not to use\n- Text-heavy slides or items compared side by side: use a carousel or a grid.\n- Large libraries: use a grid with a lightbox.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiCoverFlow, CoverFlowItem } from './ui/cover-flow';\n\n@Component({\n selector: 'app-new-releases',\n imports: [UiCoverFlow],\n template: `\n <ui-cover-flow label=\"New releases\" [items]=\"albums\" (selected)=\"open($event.item)\" />\n `,\n})\nexport class NewReleases {\n protected readonly albums: CoverFlowItem[] = [\n { id: 'tidewater', title: 'Tidewater', subtitle: 'The Lantern Rooms', image: '/covers/tidewater.jpg', alt: 'Waves at dusk' },\n { id: 'paper-moons', title: 'Paper Moons', subtitle: 'Odile Varga', image: '/covers/paper-moons.jpg', alt: 'Cut-paper moon on blue' },\n { id: 'low-orbit', title: 'Low Orbit', subtitle: 'Kestrel Unit', image: '/covers/low-orbit.jpg', alt: 'A satellite over clouds' },\n { id: 'saltgrass', title: 'Saltgrass', subtitle: 'June Okafor', image: '/covers/saltgrass.jpg', alt: 'Dune grass in wind' },\n { id: 'night-ferry', title: 'Night Ferry', subtitle: 'The Lantern Rooms', image: '/covers/night-ferry.jpg', alt: 'Ferry lights on water' },\n { id: 'quiet-hours', title: 'Quiet Hours', subtitle: 'Mara Lindqvist', image: '/covers/quiet-hours.jpg', alt: 'An empty reading room' },\n { id: 'copperline', title: 'Copperline', subtitle: 'Fen & Field', image: '/covers/copperline.jpg', alt: 'Copper wires on slate' },\n ];\n\n protected open(album: CoverFlowItem): void {\n console.log('Open', album.title);\n }\n}\n```\n\n## Rules\n- Give items stable ids and a label for the carousel.\n- Custom covers are <ng-template uiCoverFlowCover>, because each cover is stamped twice.\n- Images need alt; leave decorative art without text.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `items` | `CoverFlowItem[]` | required | The covers, in order. |\n| `index` | `number \\| undefined (model)` | middle cover | Two-way. The front cover; written as each cover passes the front, also mid-drag. |\n| `itemWidth` | `number` | 280 | Cover width in px; the row scales by clamp(width / (3.2 × itemWidth), 0.5, 1). |\n| `itemHeight` | `number` | 280 | Cover height in px. |\n| `angle` | `number` | 50 | How far side covers turn away, in degrees. |\n| `reflection` | `boolean` | true | Mirror the covers on the floor. |\n| `caption` | `boolean` | true | Title and subtitle of the front cover (polite live region). |\n| `controls` | `boolean` | true | Previous and next buttons beside the caption. |\n| `ticks` | `boolean` | true | Position ticks; a click jumps there. Out of the tab order. |\n| `sound` | `boolean` | false | A soft Web Audio click each time a new cover reaches the front. |\n| `label` | `string` | 'Cover flow' | Accessible name of the carousel. |\n| `labels` | `Partial<CoverFlowLabels>` | English | previous, next, show ('Show {title}'), position ('{n} of {total}: {title}'), carousel, slide. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `selected` | `{ item: CoverFlowItem; index: number }` | Click on the front cover, or Enter while the row has focus. |\n| `indexChange` | `number` | Part of [(index)]; fires as each cover reaches the front. |\n\n## CoverFlowItem\n\n`type CoverFlowItem = { id: string | number; title?: string; subtitle?: string; image?: string; alt?: string }`\n\n## CoverFlowLabels\n\n`type CoverFlowLabels = { carousel: string; slide: string; position: string; previous: string; next: string; show: string }`\n\n## CoverFlowContext\n\n`type CoverFlowContext = { $implicit: CoverFlowItem; index: number }`\n\n## Template: uiCoverFlowCover\n\nCustom art for every cover instead of image. Stamped twice (cover and reflection); 116 % of the cover width so it can drift. Context: `let-item let-i=\"index\"`.\n\n```html\n<ng-template uiCoverFlowCover let-item><app-art [seed]=\"item.id\" /></ng-template>\n```\n\n## Template: uiCoverFlowCaption\n\nReplaces the title and subtitle of the front cover. Context: `let-item let-i=\"index\"`.\n\n```html\n<ng-template uiCoverFlowCaption let-item let-i=\"index\"><strong>{{ item.title }}</strong></ng-template>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-cover-flow-veil` | `var(--ui-bg-canvas) at 24 % light / 50 % dark` | Wash over the side covers. |\n| `--ui-cover-flow-shadow` | `two-layer soft shadow` | Shadow of each cover. |\n| `--ui-cover-flow-floor` | `ink at 16 % light / 45 % dark` | Soft floor shadow under each cover. |\n| `--ui-cover-flow-ring` | `var(--ui-focus-ring)` | Ring around the front cover on keyboard focus. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Focuses the row, then Previous and Next; ticks are skipped. |\n| ← / → | Previous or next cover (mirrored in RTL); quick presses add up. |\n| Home / End | First or last cover. |\n| Enter | Selects the front cover. |\n\n## Accessibility\n- Region with aria-roledescription carousel, named by label; slides are groups named '5 of 10: Title', all but the front aria-hidden and inert.\n- Caption is a polite live region; Previous / Next are real buttons, disabled at the ends.\n- Keyboard focus rings the front cover in the focus-ring colour; subtitle uses --ui-text-muted.\n- Forced colors: covers keep an outline, reflections hide, ticks and focus use system colours.\n- Reduced motion or --ui-motion-scale: 0: covers jump, no drift, no caption or tick animation.\n",
159
+ "keywords": "Illustrations UiCoverFlow UiCoverFlowCover UiCoverFlowCaption CoverFlowItem CoverFlowLabels CoverFlowContext Six to twenty pictures looked at one at a time: albums, trips, products, templates. A showcase row that should feel physical: drag, flick, sideways trackpad scroll."
160
+ },
161
+ {
162
+ "slug": "date-picker",
163
+ "name": "Date Picker",
164
+ "description": "One day in a field with the Text Field's look: a month in a small card, today marked, out-of-range and ruled-out days still visible, full keyboard control and the locale's own week.",
165
+ "category": "Inputs",
166
+ "pro": false,
167
+ "entryPoint": "./ui/date-picker",
168
+ "selector": "ui-date-picker",
169
+ "url": "/ai/date-picker.json",
170
+ "markdown": "# Date Picker\n\nOne day in a field with the Text Field's look: a month in a small card, today marked, out-of-range and ruled-out days still visible, full keyboard control and the locale's own week.\n\nAdd: `npx ochreui@latest add date-picker`\nImport: `import { UiDatePicker, UiDatePickerTrigger, UiCalendar } from './ui/date-picker';`\nSelector: `<ui-date-picker>`\nDocs: /components/date-picker\n\n## When to use\n- One day in a form: a first run, a due date, a launch day, an expiry.\n- Settings rows next to Text Fields and Selects: same height, edge, label, hint and error.\n\n## When not to use\n- A start and an end, or comparing periods: use Date Range Picker.\n- A time of day: use Time Picker.\n- Birthdays and dates people know by heart: a Text Field is quicker.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form } from '@angular/forms/signals';\nimport { UiDatePicker, UiDatePickerTrigger } from './ui/date-picker';\n\n@Component({\n selector: 'app-export-schedule',\n imports: [UiDatePicker, UiDatePickerTrigger, FormField],\n template: `\n <ui-date-picker label=\"First export\" hint=\"Exports run on weekdays only.\">\n <button uiDatePicker [formField]=\"f.first\" [minDate]=\"today\" [isDateDisabled]=\"weekend\"></button>\n </ui-date-picker>\n <ui-date-picker label=\"Last export\" optional>\n <button uiDatePicker [formField]=\"f.last\" [minDate]=\"f.first().value()\" placeholder=\"No end date\"></button>\n </ui-date-picker>\n `,\n})\nexport class ExportSchedule {\n protected readonly today = new Date();\n protected readonly weekend = (d: Date) => d.getDay() === 0 || d.getDay() === 6;\n private readonly model = signal({ first: null as Date | null, last: null as Date | null });\n protected readonly f = form(this.model);\n}\n```\n\n## Rules\n- Put uiDatePicker on an empty <button> inside ui-date-picker.\n- Bind [formField], formControl(Name), ngModel or [(value)] on the button; the value is a Date at local midnight or null.\n- Use minDate / maxDate, not min / max; with [formField], set required and disabled in the schema.\n- name posts YYYY-MM-DD (toIsoDay), never toISOString().\n- Pass the error string you want shown; the field doesn't read form state itself.\n- Without a label, give the button an aria-label.\n- UiCalendar is the grid alone, for inline calendars and range pickers.\n- Needs overlay.ts next to date-picker.ts (the CLI adds it): the placement, Escape and outside-press layer shared by the floating components.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | none | Above the field; read with the chosen day as its name. Clicking focuses the field. |\n| `hint` | `string` | none | Quiet line under the field; the error replaces it. |\n| `error` | `string \\| null \\| undefined` | none | Invalid state: red edge, aria-invalid, message in place of the hint. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | 'md' | 28/32/36px; Classic 32/36/40; taller with 16px text on touch. |\n| `optional` | `boolean` | false | \"Optional\" after the label, also spoken. |\n| `labels` | `Partial<DatePickerLabels>` | English | Translations: optional, placeholder, previousMonth, nextMonth. |\n| `value (UiDatePickerTrigger)` | `Date \\| null` | null | Model. The chosen day at local midnight; null shows the placeholder. |\n| `open (UiDatePickerTrigger)` | `boolean` | false | Model. Whether the card shows; opening from code never moves focus. |\n| `minDate (UiDatePickerTrigger)` | `Date \\| null \\| undefined` | null | Earlier days can't be picked; the previous arrow stops at its month. |\n| `maxDate (UiDatePickerTrigger)` | `Date \\| null \\| undefined` | null | Later days can't be picked; ignored when before minDate. |\n| `isDateDisabled (UiDatePickerTrigger)` | `DateRule \\| null \\| undefined` | null | Rules out single days; they stay visible and focusable. |\n| `locale (UiDatePickerTrigger)` | `string \\| null \\| undefined` | LOCALE_ID | Names, digits, week start and the shown value. |\n| `weekStartsOn (UiDatePickerTrigger)` | `WeekDay \\| null \\| undefined` | the locale's | 0 = Sunday … 6 = Saturday. |\n| `today (UiDatePickerTrigger)` | `Date \\| null \\| undefined` | today | Where the today marker sits. |\n| `placeholder (UiDatePickerTrigger)` | `string` | labels.placeholder | Shown while no day is chosen. |\n| `name (UiDatePickerTrigger)` | `string` | none | Posts YYYY-MM-DD with a native form through a hidden input. |\n| `required (UiDatePickerTrigger)` | `boolean` | false | Sets aria-required; signal forms set it from the schema. |\n| `id (UiDatePickerTrigger)` | `string` | generated | The button id. |\n| `aria-describedby (UiDatePickerTrigger)` | `string` | none | Your own descriptions, merged with the hint or error. |\n| `value (UiCalendar)` | `Date \\| null` | null | Model. The chosen day; changes when a day is picked. |\n| `minDate, maxDate, isDateDisabled, locale, weekStartsOn, today (UiCalendar)` | `as above` | as above | The same bounds, rules and locale as the trigger. |\n| `labels (UiCalendar)` | `Partial<CalendarLabels>` | English | Translations: previousMonth, nextMonth. |\n| `id (UiCalendar)` | `string` | generated | Host id; the month title is `${id}-title`. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `valueChange (UiDatePickerTrigger)` | `Date \\| null` | When a day is picked. |\n| `openChange (UiDatePickerTrigger)` | `boolean` | When the card opens or closes. |\n| `valueChange (UiCalendar)` | `Date \\| null` | When a day is picked by click, Enter or Space. |\n\n## DatePickerLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `optional` | `string` | Tag after the label. |\n| `placeholder` | `string` | Default placeholder (\"Pick a date\"). |\n| `previousMonth` | `string` | Name of the previous-month arrow. |\n| `nextMonth` | `string` | Name of the next-month arrow. |\n\n## CalendarLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `previousMonth` | `string` | Name of the previous-month arrow. |\n| `nextMonth` | `string` | Name of the next-month arrow. |\n\n## DateRule\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `(date: Date) => boolean` | `function` | True rules the day out. |\n\n## WeekDay\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `0 \\| 1 \\| 2 \\| 3 \\| 4 \\| 5 \\| 6` | `number` | 0 is Sunday. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-text-field-edge` | `var(--ui-hairline)` | Resting edge, shared with Text Field and Select. |\n| `--ui-text-field-edge-hover` | `color-mix(in srgb, var(--ui-text) 18%, transparent)` | Edge on hover. |\n| `--ui-text-field-edge-focus` | `var(--ui-border-input)` | Edge while the card is open. |\n| `--ui-text-field-radius` | `7px; Classic 10px` | Field corners. |\n| `--ui-date-picker-radius` | `10px; Classic 16px` | Card corners. |\n| `--ui-date-picker-cell` | `32px; Classic 34px; touch 40px` | One day's cell; sets the card width. |\n| `--ui-date-picker-day` | `28px; Classic 30px; touch 36px` | The day inside the cell. |\n| `--ui-date-picker-selected-bg` | `var(--ui-bg-neutral-solid); Classic a sky blue mixed from var(--ui-hue-blue) (dark: var(--ui-info))` | Chosen day's chip. |\n| `--ui-date-picker-selected-fg` | `var(--ui-text-on-neutral)` | Chosen day's number. |\n| `--ui-date-picker-today` | `var(--ui-hue-blue), the today dot's blue; Classic var(--ui-text)` | Today's number. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Enter / Space / ↓ | On the field: opens on the chosen day, else today, else the nearest day in bounds. |\n| ← / → | Previous / next day; mirrored in RTL. |\n| ↑ / ↓ | Same weekday a week earlier / later. |\n| PageUp / PageDown | Same date a month earlier / later; Shift: a year. |\n| Home / End | First / last day of the locale's week. |\n| Enter / Space | On a day: picks, closes, focus back to the field; ruled-out days do nothing. |\n| Esc | Closes without a change; focus back to the field. |\n| Tab | Arrows, then the day tab stop, then out: the card closes. |\n\n## Accessibility\n- Button with aria-haspopup=dialog, named by label + chosen day (aria-labelledby), described by hint or error.\n- Non-modal dialog named by the month title (aria-live polite).\n- Grid with one roving tab stop; gridcells carry the full date once, aria-selected, aria-current=date, aria-disabled.\n- Ruled-out and out-of-range days stay focusable; Enter, Space and clicks do nothing on them.\n- Rings for the keyboard only, drawn inside the day, the chosen chip included.\n- Forced colors: field and card edges, Highlight chosen day, GrayText for days that can't be picked, today dot in CanvasText.\n",
171
+ "keywords": "Inputs UiDatePicker UiDatePickerTrigger UiCalendar DatePickerSize DatePickerLabels CalendarLabels DateRule WeekDay toIsoDay startOfDay One day in a form: a first run, a due date, a launch day, an expiry. Settings rows next to Text Fields and Selects: same height, edge, label, hint and error."
172
+ },
173
+ {
174
+ "slug": "decision-inbox",
175
+ "name": "Decision Inbox",
176
+ "description": "Open decisions in a small card, each with two quick answers. The chosen answer turns green, holds for a moment, then the row folds away until the card is all caught up.",
177
+ "category": "Feedback",
178
+ "pro": false,
179
+ "entryPoint": "./ui/decision-inbox",
180
+ "selector": "ui-decision-inbox",
181
+ "url": "/ai/decision-inbox.json",
182
+ "markdown": "# Decision Inbox\n\nOpen decisions in a small card, each with two quick answers. The chosen answer turns green, holds for a moment, then the row folds away until the card is all caught up.\n\nAdd: `npx ochreui@latest add decision-inbox`\nImport: `import { UiDecisionInbox } from './ui/decision-inbox';`\nSelector: `<ui-decision-inbox>`\nDocs: /components/decision-inbox\n\n## When to use\n- A dashboard or agent run that needs a quick yes or no from a person.\n- Approvals, renewals and alerts that one click settles.\n\n## When not to use\n- Decisions that need a form or a longer explanation: link to a page.\n- Notices without an answer: use a toast or an activity list.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { Decision, DecisionEvent, UiDecisionInbox } from './ui/decision-inbox';\n\n@Component({\n selector: 'app-approvals',\n imports: [UiDecisionInbox],\n template: `\n <ui-decision-inbox [decisions]=\"decisions()\" (decided)=\"save($event)\" />\n `,\n styles: `\n :host { display: block; max-width: 440px; }\n `,\n})\nexport class Approvals {\n protected readonly decisions = signal<Decision[]>([\n {\n id: 'renewal',\n title: 'Renew the analytics plan for the growth team?',\n detail: '8 seats · $2,400 per year · renews in 6 days',\n primary: 'Renew',\n secondary: 'Change seats',\n },\n ]);\n\n protected save({ decision, answer }: DecisionEvent) {\n console.log(decision.id, answer);\n this.decisions.update((list) => list.filter((d) => d.id !== decision.id));\n }\n}\n```\n\n## Rules\n- Give every decision a unique id, a title and both answer labels.\n- Save the answer in (decided). You may remove the decision from your array there; the card still confirms and folds it.\n- The card fills its container: give it a width or put it in a block layout.\n- Host styling (padding, corners, fill, edge) is inline: restyle through the --ui-decision-inbox-* variables, not CSS on the element.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `decisions` | `readonly Decision[]` | required | Open decisions, in order. Pass a new array when it changes. |\n| `labels` | `Partial<DecisionInboxLabels>` | English | Header count, done text, empty line and the spoken prefix, for translation. |\n| `headingLevel` | `number` | 3 | aria-level of the header heading. |\n| `hold` | `number` | 1100 | Milliseconds the confirmation stays before the row folds. Kept with reduced motion. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `decided` | `DecisionEvent` | { decision, answer } with answer 'primary' or 'secondary'. Fires once per decision, at the click. |\n\n## Decision\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | `string` | Unique within the list. |\n| `title` | `string` | The question. |\n| `detail` | `string?` | One quiet line: evidence or cost. |\n| `primary` | `string` | Label of the solid answer. |\n| `secondary` | `string` | Label of the outlined answer. |\n| `collapsed` | `boolean?` | Starts folded to its question; opens on click or after the decision before it folds. |\n\n## DecisionAnswer\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `(union)` | `'primary' \\| 'secondary'` | Which answer was picked. |\n\n## DecisionEvent\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `decision` | `Decision` | The answered decision. |\n| `answer` | `DecisionAnswer` | Which answer was picked. |\n\n## DecisionInboxLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `pending` | `(count: number) => string` | Header while decisions wait. Default \"1 needs your input\" / \"n need your input\". |\n| `done` | `string` | Header when none are left. Default \"All caught up\". |\n| `empty` | `string` | Quiet line under it. |\n| `answered` | `string` | Spoken before the chosen answer. Default \"Answered:\". |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-decision-inbox-radius` | `10px; Classic 16px` | Corners; in Classic the panel, with the tray 6px around it. |\n| `--ui-decision-inbox-pending` | `var(--ui-hue-amber); Classic orange darkened to 4.5:1` | Header icon while decisions wait; Classic header text too. |\n| `--ui-decision-inbox-confirm-fg` | `green darkened to 4.5:1 (light), var(--ui-hue-green) (dark)` | Chosen answer and the done check. |\n| `--ui-decision-inbox-confirm-bg` | `var(--ui-success-soft)` | Tint behind the chosen answer; none in Classic. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Moves between answers and folded decisions. |\n| Enter Space | Picks the focused answer, or opens and closes a folded decision. |\n\n## Accessibility\n- A region named by its header, which is a heading (headingLevel). Each answer pair is a group named by its question.\n- One polite, atomic announcement per answer: \"Answered: <label>. <header>\".\n- Focus moves to the confirmation, then to the next waiting decision when the row folds, then to the empty line.\n- Folding rows are inert. Coloured text is darkened to 4.5:1; forced colors give the answers a ButtonText edge.\n",
183
+ "keywords": "Feedback UiDecisionInbox Decision DecisionAnswer DecisionEvent DecisionInboxLabels A dashboard or agent run that needs a quick yes or no from a person. Approvals, renewals and alerts that one click settles."
184
+ },
185
+ {
186
+ "slug": "dialog",
187
+ "name": "Dialog",
188
+ "description": "A modal window on a dimmed backdrop: a fixed header and footer around content that scrolls, focus kept inside, a sheet on phones, and an alert dialog that confirms before something can't be undone.",
189
+ "category": "Feedback",
190
+ "pro": false,
191
+ "entryPoint": "./ui/dialog",
192
+ "selector": "ui-dialog",
193
+ "url": "/ai/dialog.json",
194
+ "markdown": "# Dialog\n\nA modal window on a dimmed backdrop: a fixed header and footer around content that scrolls, focus kept inside, a sheet on phones, and an alert dialog that confirms before something can't be undone.\n\nAdd: `npx ochreui@latest add dialog`\nImport: `import { UiDialog, UiAlertDialog, UiDialogTrigger, UiDialogClose } from './ui/dialog';`\nSelector: `<ui-dialog>`\nDocs: /components/dialog\n\n## When to use\n- A task that needs full attention first: editing, inviting people, connecting an account.\n- A confirmation before something irreversible: use ui-alert-dialog.\n- Content that opens over the page and returns to the same place on close.\n\n## When not to use\n- A short form next to its button: use Popover.\n- A list of actions: use Dropdown Menu.\n- Searching and running commands: use Command Menu.\n- A status after an action: use a toast (an undo is often kinder than a confirm).\n- Nothing to show yet: use Empty State.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form, required } from '@angular/forms/signals';\nimport { UiButton } from './ui/button';\nimport { UiDialog, UiDialogClose, UiDialogTrigger } from './ui/dialog';\nimport { UiInput, UiTextField } from './ui/text-field';\n\n@Component({\n selector: 'app-edit-report',\n imports: [UiButton, UiDialog, UiDialogClose, UiDialogTrigger, UiTextField, UiInput, FormField],\n template: `\n <button type=\"button\" uiButton variant=\"secondary\" [uiDialogTrigger]=\"edit\">Edit</button>\n <ui-dialog #edit [(open)]=\"editing\" heading=\"Edit report\" description=\"Changes apply from the next send.\">\n <form id=\"edit-report\" (submit)=\"save($event)\">\n <ui-text-field label=\"Name\">\n <input uiInput [formField]=\"f.name\" />\n </ui-text-field>\n </form>\n <div uiDialogFooter>\n <button type=\"button\" uiButton variant=\"secondary\" uiDialogClose>Cancel</button>\n <button type=\"submit\" form=\"edit-report\" uiButton [disabled]=\"f().invalid()\">Save</button>\n </div>\n </ui-dialog>\n `,\n})\nexport class EditReport {\n protected readonly editing = signal(false);\n private readonly model = signal({ name: 'Weekly revenue summary' });\n protected readonly f = form(this.model, (p) => {\n required(p.name);\n });\n\n protected save(event: Event) {\n event.preventDefault();\n this.editing.set(false);\n }\n}\n```\n\n## Rules\n- Use heading, not title, for the dialog title.\n- Put footer buttons in an element marked uiDialogFooter; use uiDialogClose for Cancel.\n- contained needs a parent with position: relative.\n- If the trigger is removed (e.g. after deleting), move focus in (closed).\n- Requires button.ts (ui-alert-dialog uses uiButton) and overlay.ts (the Escape and outside-press layer shared with popovers and menus) next to dialog.ts; the CLI adds both.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `open` | `boolean` | false | Shows it. Two-way [(open)]; turns false when the person closes it. |\n| `heading` | `string` | none | Title and accessible name. Or project [uiDialogHeading]. |\n| `description` | `string` | none | Quiet line under the title (aria-describedby). Or project [uiDialogDescription]. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | 'md' | 400, 480 or 720px wide, never wider than the window. |\n| `width` | `number \\| string` | none | Any width instead of a size (number = px). |\n| `closeOnBackdrop` | `boolean` | true | A press on the dim closes it; when off the card pulses. |\n| `closeButton` | `boolean` | true | The × in the corner. |\n| `contained` | `boolean` | false | Covers its nearest positioned parent instead of the window. |\n| `initialFocus` | `HTMLElement \\| ElementRef<HTMLElement> \\| null` | none | Gets focus on open. Default: [autofocus], first control in content, then footer, else the card. Never the ×. |\n| `busy` | `boolean` | false | Escape, the dim, the × and uiDialogClose do nothing; aria-busy set; labels.busy announced. |\n| `role` | `'dialog' \\| 'alertdialog'` | 'dialog' | ui-alert-dialog sets alertdialog. |\n| `id` | `string` | generated | The native dialog's id (aria-controls). |\n| `labels` | `Partial<DialogLabels>` | { close: 'Close', busy: 'Working…' } | The ×'s name and the busy announcement. |\n| `uiDialogTrigger (UiDialogTrigger)` | `UiDialog \\| UiAlertDialog` | required | On the button: opens it, sets aria-haspopup, aria-expanded and aria-controls, gets focus back. |\n| `cancelLabel (UiAlertDialog)` | `string` | 'Cancel' | The safe button, focused on open. |\n| `confirmLabel (UiAlertDialog)` | `string` | 'Confirm' | The button that goes ahead. |\n| `danger (UiAlertDialog)` | `boolean` | false | Confirm turns destructive. |\n| `action (UiAlertDialog)` | `() => unknown` | none | Called on confirm. A returned promise keeps it open and busy; resolve closes, reject stays open and emits failed. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `openChange` | `boolean` | Every change of open. |\n| `closed` | `'escape' \\| 'backdrop' \\| 'close-button' \\| 'action' \\| 'cancel' \\| 'confirm'` | After it closed and focus went back. Move focus here if the trigger is gone. |\n| `confirmed (UiAlertDialog)` | `void` | Confirm pressed, before a returned promise settles. |\n| `failed (UiAlertDialog)` | `unknown` | The action's promise rejected or it threw; stays open. |\n\n## DialogSize\n\n`type DialogSize = 'sm' | 'md' | 'lg'`\n\n## DialogCloseReason\n\n`type DialogCloseReason = 'escape' | 'backdrop' | 'close-button' | 'action' | 'cancel' | 'confirm'`\n\n## DialogLabels\n\n`type DialogLabels = { close: string; busy: string }`\n\n## Template: uiDialogFooter\n\nMarks the footer: a wrapper whose buttons line up at the end, or a single button. Context: `none`.\n\n```html\n<div uiDialogFooter>\n <button uiButton variant=\"secondary\" uiDialogClose>Cancel</button>\n <button uiButton>Save</button>\n</div>\n```\n\n## Template: uiDialogHeading / uiDialogDescription\n\nRich heading or description instead of the string inputs. Context: `none`.\n\n```html\n<span uiDialogHeading>Delete <b>3 reports</b>?</span>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-dialog-scrim` | `color-mix(in srgb, var(--ui-bg-scrim) 40%, transparent)` | The dim behind the card. |\n| `--ui-dialog-radius` | `14px (Classic 20px, inner panel 16px)` | Card corners. |\n| `--ui-dialog-shadow` | `var(--ui-shadow-lg)` | Card ring and drop shadow. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab / Shift+Tab | Moves through the controls inside and goes round. |\n| Escape | Closes (alert: cancels). A popover or menu inside closes first. Ignored while busy. |\n| Enter | Activates the focused button (the safe one first in an alert); in a field, submits your form. |\n\n## Accessibility\n- Native <dialog> with showModal(): page inert, top layer; contained mode adds aria-modal and its own Tab loop.\n- Named by the heading (aria-labelledby), described by the description; ui-alert-dialog has role=alertdialog.\n- Focus goes to [autofocus] or the first control, never the ×, and returns to the trigger on close.\n- Busy: confirm keeps focus with aria-busy, cancel is aria-disabled (not disabled), dialog has aria-busy and a polite live region.\n- A refused press on the dim keeps focus; the × has one name (aria-label, no title).\n- Forced colors: 2px card edge.\n",
195
+ "keywords": "Feedback UiDialog UiAlertDialog UiDialogTrigger UiDialogClose DialogSize DialogCloseReason DialogLabels A task that needs full attention first: editing, inviting people, connecting an account. A confirmation before something irreversible: use ui-alert-dialog. Content that opens over the page and returns to the same place on close."
196
+ },
197
+ {
198
+ "slug": "dropdown-menu",
199
+ "name": "Dropdown Menu",
200
+ "description": "Actions and choices behind any button: icons, shortcuts, checks, red rows and submenus, with a gliding highlight, typeahead and the full menu keyboard. Your own buttons and links are the rows.",
201
+ "category": "Navigation",
202
+ "pro": false,
203
+ "entryPoint": "./ui/dropdown-menu",
204
+ "selector": "ui-menu",
205
+ "url": "/ai/dropdown-menu.json",
206
+ "markdown": "# Dropdown Menu\n\nActions and choices behind any button: icons, shortcuts, checks, red rows and submenus, with a gliding highlight, typeahead and the full menu keyboard. Your own buttons and links are the rows.\n\nAdd: `npx ochreui@latest add dropdown-menu`\nImport: `import { UiMenu, UiMenuTrigger, UiMenuItem, UiMenuItemCheckbox, UiMenuItemRadio, UiMenuGroup, UiMenuSeparator, UiMenuLabel, UiMenuIcon } from './ui/dropdown-menu';`\nSelector: `<ui-menu>`\nDocs: /components/dropdown-menu\n\n## When to use\n- Actions on one thing behind a ⋯ button: open, duplicate, move, delete.\n- A short choice that changes the view at once (sort, density), shown with a check.\n- Account and workspace menus with a header and submenus.\n\n## When not to use\n- Picking a value for a form field: use Select.\n- Searching many commands or pages: use a command menu.\n- A short form or explanation next to a button: use Popover.\n- Filters with several groups and counts: use Filter Menu.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { UiButton } from './ui/button';\nimport { UiMenu, UiMenuGroup, UiMenuIcon, UiMenuItem, UiMenuItemRadio, UiMenuSeparator, UiMenuTrigger } from './ui/dropdown-menu';\n\n@Component({\n selector: 'app-report-actions',\n imports: [UiButton, UiMenu, UiMenuTrigger, UiMenuItem, UiMenuItemRadio, UiMenuGroup, UiMenuSeparator, UiMenuIcon],\n template: `\n <button type=\"button\" uiButton variant=\"secondary\" [uiMenuTrigger]=\"actions\">Actions</button>\n <ui-menu #actions align=\"end\">\n <button uiMenuItem shortcut=\"⌘D\" keys=\"Meta+D\" (selected)=\"duplicate()\">\n <svg uiMenuIcon viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"><path d=\"M8.5 8.5h11v11h-11zM15.5 8.5v-4h-11v11h4\" /></svg>\n Duplicate\n </button>\n <button uiMenuItem [uiSubmenu]=\"folders\">Move to</button>\n <ui-menu-separator />\n <button uiMenuItem danger (selected)=\"remove()\">Delete report</button>\n </ui-menu>\n <ui-menu #folders>\n <ui-menu-group [(value)]=\"folder\">\n <button uiMenuItemRadio value=\"finance\">Finance</button>\n <button uiMenuItemRadio value=\"sales\">Sales</button>\n <button uiMenuItemRadio value=\"archive\">Archive</button>\n </ui-menu-group>\n </ui-menu>\n `,\n})\nexport class ReportActions {\n protected readonly folder = signal('finance');\n\n protected duplicate() {}\n protected remove() {}\n}\n```\n\n## Rules\n- Write <ui-menu> right after its trigger; a submenu is another <ui-menu> referenced with [uiSubmenu].\n- Rows are your own <button> or <a> with uiMenuItem; checkbox and radio rows are <button> only.\n- Put radio rows in <ui-menu-group [(value)]>; mark row icons with uiMenuIcon.\n- Give the trigger a name (text or aria-label), or give the menu a title or aria-label.\n- Shortcuts are display only: wire the keys yourself and pass keys=\"Meta+D\" for screen readers.\n- Needs overlay.ts next to dropdown-menu.ts (the CLI adds it): the placement, Escape and outside-press layer shared by the floating components.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `open` | `boolean` | false | Shows it. Two-way [(open)]; the trigger also opens and closes it. |\n| `side` | `'bottom' \\| 'top'` | 'bottom' | Preferred side; flips to the side with more room. |\n| `align` | `'start' \\| 'end'` | 'start' | Edges that line up (logical in RTL); switches when it would stick out. |\n| `offset` | `number` | 6 | Gap to the trigger in px. |\n| `title` | `string` | none | Small grey heading above the rows; the menu’s name. |\n| `width` | `number \\| string` | none | Panel width (number = px). Default fits the rows, 168px (Classic 180px) to 320px. |\n| `aria-label` | `string` | none | Menu name when there is no title; else the trigger names it. |\n| `labels` | `Partial<MenuLabels>` | { empty: 'Nothing here yet' } | Visible strings. |\n| `id` | `string` | generated | Panel id; the role=menu element is {id}-list. |\n| `uiMenuTrigger (UiMenuTrigger)` | `UiMenu` | required | On the button: toggles on click, opens with Enter, Space, ↓ (checked row, else first) and ↑ (last); sets aria-haspopup, aria-expanded, aria-controls and an id. |\n| `disabled (rows)` | `boolean` | false | aria-disabled; faint, skipped by arrows and typeahead, inert on click. |\n| `danger (rows)` | `boolean` | false | Red label, icon and highlight. |\n| `keepOpen (rows)` | `boolean` | false | The menu stays open after the pick. |\n| `shortcut (rows)` | `string` | none | Shown at the end, hidden from screen readers. Display only. |\n| `keys (rows)` | `string` | none | aria-keyshortcuts, such as Meta+D. |\n| `description (rows)` | `string` | none | Quiet second line; the row’s description. |\n| `textValue (rows)` | `string` | the row text | What typeahead matches. |\n| `uiSubmenu (rows)` | `UiMenu` | none | Opens that menu beside the row; adds the chevron. |\n| `checked (UiMenuItemCheckbox)` | `boolean` | false | Two-way [(checked)]; also [formField], formControl, ngModel. |\n| `value (UiMenuItemRadio)` | `unknown` | required | Checked when it equals the group value. |\n| `value (UiMenuGroup)` | `T` | undefined | The picked radio value. [(value)], [formField], formControl, ngModel. |\n| `label (UiMenuGroup)` | `string` | none | Small heading and the group’s name. |\n| `disabled (UiMenuGroup)` | `boolean` | false | Disables every row in the group. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `openChange` | `boolean` | Every change of open. |\n| `closed` | `'select' \\| 'escape' \\| 'outside' \\| 'focus-out' \\| 'tab' \\| 'trigger'` | Why it closed, before open turns false. |\n| `selected (rows)` | `void` | Row clicked or picked with Enter or Space (not submenu rows). |\n| `checkedChange (UiMenuItemCheckbox)` | `boolean` | Every change of checked. |\n| `valueChange (UiMenuGroup)` | `T` | Every change of value. |\n\n## MenuLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `empty` | `string` | Shown when the menu has no rows. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-menu-bg` | `var(--ui-bg-overlay)` | Panel fill. |\n| `--ui-menu-shadow` | `0.5px ring + soft drop (Classic: 1px ring + two drops)` | Ring and shadow. |\n| `--ui-menu-radius` | `12px (Classic 14px)` | Panel corners; rows stay concentric. |\n| `--ui-menu-pad` | `4px (Classic 5px)` | Space around the rows. |\n| `--ui-menu-min-width` | `168px (Classic 180px)` | Narrowest panel. |\n| `--ui-menu-max-width` | `320px` | Widest panel; labels truncate. |\n| `--ui-menu-trigger-w` | `set while open` | The trigger’s width, for width=\"var(--ui-menu-trigger-w)\". |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Enter / Space / ArrowDown | On the trigger: open on the checked row (radio or checkbox), else the first row. |\n| ArrowUp | On the trigger: open on the last row. |\n| ArrowDown / ArrowUp | Next / previous row, wrapping; disabled skipped. |\n| Home / End | First / last row. |\n| Letters | Typeahead; the same letter again cycles. |\n| Enter / Space | Pick and close (unless keepOpen); on a submenu row, open it. |\n| ArrowRight / ArrowLeft | Open a submenu / go back; swapped in RTL. |\n| Escape | Close the innermost menu; focus to its row or the trigger. |\n| Tab | Close all; focus moves on from the trigger. |\n\n## Accessibility\n- Menu-button pattern: aria-haspopup, aria-expanded, aria-controls; menuitem, menuitemcheckbox and menuitemradio with aria-checked.\n- Roving real focus over tabindex=-1 rows; ring on :focus-visible only.\n- Shortcuts aria-hidden, given as aria-keyshortcuts; the row name is the label only.\n- Pointer open focuses the menu element with no active row; keyboard open focuses the checked row (radio or checkbox) or the first.\n- Title ≥ 4.5:1; danger ≥ 4.5:1 at rest and on its highlight and red in every state; shortcuts and chevron ≈ 3:1 (shortcuts are also aria-keyshortcuts).\n- Forced colors: panel edge, visible separators, Highlight on the active row.\n- Dev-mode warning for a nameless menu and icon-only rows.\n",
207
+ "keywords": "Navigation UiMenu UiMenuTrigger UiMenuItem UiMenuItemCheckbox UiMenuItemRadio UiMenuGroup UiMenuSeparator UiMenuLabel UiMenuIcon MenuItem MenuSide MenuAlign MenuCloseReason MenuFocus MenuLabels MenuHost MENU_HOST Actions on one thing behind a ⋯ button: open, duplicate, move, delete. A short choice that changes the view at once (sort, density), shown with a check. Account and workspace menus with a header and submenus."
208
+ },
209
+ {
210
+ "slug": "email-draft",
211
+ "name": "Email Draft",
212
+ "description": "An email an agent wrote, for a person to check before it goes out: pick the recipient and the tone, edit the text in place, drop or re-add the attachment, then send or discard it, with Undo.",
213
+ "category": "Cards",
214
+ "pro": false,
215
+ "entryPoint": "./ui/email-draft",
216
+ "selector": "ui-email-draft",
217
+ "url": "/ai/email-draft.json",
218
+ "markdown": "# Email Draft\n\nAn email an agent wrote, for a person to check before it goes out: pick the recipient and the tone, edit the text in place, drop or re-add the attachment, then send or discard it, with Undo.\n\nAdd: `npx ochreui@latest add email-draft`\nImport: `import { UiEmailDraft, UiEmailDraftButton, UiEmailDraftTo } from './ui/email-draft';`\nSelector: `<ui-email-draft>`\nDocs: /components/email-draft\n\n## When to use\n- An agent wrote an email and a person approves it: payment reminders, renewals, follow-ups.\n- A review queue of outreach, one card per invoice, deal or ticket.\n\n## When not to use\n- Writing a long email from scratch: use a full editor.\n- Messages sent without review: an activity row is enough.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { DraftContact, DraftTone, EmailDraftPayload, EmailDraftState, UiEmailDraft } from './ui/email-draft';\n\nconst hi = (c: DraftContact) => c.greeting ?? c.name.split(' ')[0];\n\n@Component({\n selector: 'app-invoice-reminder',\n imports: [UiEmailDraft],\n template: `\n <ui-email-draft\n reference=\"INV-2041\"\n status=\"Due in 3 days\"\n amount=\"€1,240\"\n account=\"Harbor & Co\"\n agent=\"Billing agent\"\n [contacts]=\"contacts\"\n [tones]=\"tones\"\n [(attachment)]=\"file\"\n [link]=\"{ label: 'View invoice', href: '/invoices/2041' }\"\n [(state)]=\"state\"\n [error]=\"error()\"\n (send)=\"deliver($event)\"\n />\n `,\n})\nexport class InvoiceReminder {\n protected readonly contacts: DraftContact[] = [\n { name: 'Maya Chen', email: 'maya@harborco.com' },\n { name: 'Accounts payable', email: 'ap@harborco.com', greeting: 'team', initials: 'AP' },\n ];\n protected readonly tones: DraftTone[] = [\n { id: 'friendly', label: 'Friendly', body: (c) => `Hi ${hi(c)}, a quick note that invoice 2041 for €1,240 is due this Friday:` },\n { id: 'brief', label: 'Brief', body: (c) => `Hi ${hi(c)}, invoice 2041 is due on Friday:` },\n { id: 'formal', label: 'Formal', body: (c) => `Dear ${c.name}, payment of €1,240 for invoice 2041 is due on Friday:` },\n ];\n protected readonly file = signal<string | null>('Invoice-2041.pdf');\n protected readonly state = signal<EmailDraftState>('draft');\n protected readonly error = signal<string | null>(null);\n\n protected async deliver(email: EmailDraftPayload) {\n this.error.set(null);\n const res = await fetch('/api/emails', { method: 'POST', body: JSON.stringify(email) }).catch(() => null);\n if (res?.ok) {\n this.state.set('sent');\n } else {\n this.state.set('draft');\n this.error.set('The email could not be sent. Check your connection and try again.');\n }\n }\n}\n```\n\n## Rules\n- Send sets state to 'sending' and emits; you set 'sent' after delivery, or 'draft' plus error on failure.\n- Bind [(state)] (or update state yourself), otherwise the card stays on 'sending'.\n- Undo is never time-limited; delay real delivery and cancel on (undo) if Undo must stop the email.\n- Ship your own tone texts; there are no defaults.\n- Not a form control: read the payload from (send) or bind [(body)], [(to)] and [(attachment)].\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `reference` | `string` | none | What the email is about; also names the card. |\n| `account` | `string` | none | Account or company under the reference. |\n| `amount` | `string` | none | Formatted amount at the end of the header. |\n| `status` | `string` | none | Chip after the reference. |\n| `statusTone` | `'neutral' \\| 'info' \\| 'success' \\| 'warning' \\| 'danger'` | 'warning' | Chip colour. |\n| `agent` | `string` | none | Who wrote the draft, in the last row. |\n| `contacts` | `DraftContact[]` | required | People the email can go to. |\n| `to` | `DraftContact \\| null` | null | Two-way. The recipient; null means the first contact. |\n| `tones` | `DraftTone[]` | [] | Text versions; the tone buttons hide when empty. |\n| `tone` | `string \\| null` | null | Two-way. Pressed tone; the first when there is no body; null after a hand edit. |\n| `body` | `string` | '' | Two-way. The email text; a pressed tone rewrites it when the recipient changes. |\n| `attachment` | `string \\| null` | null | Two-way. Attached file name; removing keeps the name to add it back. |\n| `attachable` | `string \\| null` | null | A file that can be attached when the draft starts without one. |\n| `link` | `DraftLink \\| null` | null | Link after the text; sent in the payload, not in body. |\n| `state` | `'draft' \\| 'sending' \\| 'sent' \\| 'discarded'` | 'draft' | Two-way. Send sets 'sending'; set 'sent' on success or 'draft' with error on failure. |\n| `error` | `string \\| null` | null | Failed-send message with Retry; cleared by the next edit or send. |\n| `submitShortcut` | `boolean` | true | ⌘ Enter / Ctrl Enter in the text sends. |\n| `labels` | `Partial<EmailDraftLabels>` | English | Every visible and spoken string. |\n| `aria-label` | `string` | none | Card name when there is no reference. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `send` | `EmailDraftPayload` | Send, Retry or the shortcut. state is now 'sending'. |\n| `discard` | `void` | Discard pressed; the card shows the discarded receipt with Undo. |\n| `undo` | `'sent' \\| 'discarded'` | Undo pressed; recipient, text, tone and attachment are restored. |\n\n## DraftContact\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `name` | `string` | Shown in the recipient button and list. |\n| `email` | `string` | Address. |\n| `initials` | `string?` | Avatar letters; default from the name. |\n| `greeting` | `string?` | How tone bodies address them (\"team\"). Not read by the component. |\n\n## DraftTone\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | `string` | Unique id. |\n| `label` | `string` | Button text. |\n| `body` | `(to: DraftContact) => string` | The text written for that recipient. |\n\n## DraftLink\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `label` | `string` | Link text. |\n| `href` | `string` | Target. |\n\n## EmailDraftPayload\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `to` | `DraftContact` | Recipient. |\n| `body` | `string` | Final text. |\n| `attachment` | `string \\| null` | Attached file, if any. |\n| `tone` | `string \\| null` | Pressed tone; null when edited by hand. |\n| `link` | `DraftLink \\| null` | The link input. |\n\n## EmailDraftLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `to, recipient, tone, edit, body, clickToEdit` | `string` | \"To\", list name, tone group name, Edit button, field name, text tooltip. |\n| `attach, remove` | `(file: string) => string` | \"Attach {file}\", \"Remove {file}\". |\n| `shortcut` | `(key: string) => string` | Hint; key is ⌘ on Apple devices, Ctrl elsewhere. |\n| `emptyHint` | `string` | Replaces the hint while the text is empty: \"Write the email to send it\". |\n| `discard, send, sending, undo, retry` | `string` | Button texts. |\n| `sentTo, with, discarded, restored` | `string` | Receipt and announcement pieces. |\n| `ready, sentChip, discardedChip` | `string` | State chip texts. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-email-draft-max` | `calc(480px + 40px * var(--ui-look-tray))` | Widest the card grows (Classic 520px). |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Enter Space ↓ ↑ | On the recipient: opens the list on the current person (↑ starts at the last). |\n| ↓ ↑ Home End, letters | In the list: move; typing jumps to a name. |\n| Enter Space | In the list: pick and return to the recipient button. |\n| Esc | Closes the list, or leaves the text and focuses Edit. |\n| ⌘ Enter / Ctrl Enter | In the text: sends. |\n| Tab | Recipient, attachment, link, tones, Edit, Discard, Send; Undo after sending. |\n\n## Accessibility\n- role=group named by reference and account; the recipient button is named \"To\" plus the person.\n- Recipient: aria-haspopup=listbox button and a listbox with aria-activedescendant, arrows, Home/End and typeahead.\n- Tones are aria-pressed toggles in a named group; Edit is a separate aria-pressed toggle; the field has aria-keyshortcuts.\n- Focus moves deliberately on every swap: list close, edit exit, attachment remove/add, send, discard, undo.\n- While the text is empty, Send is aria-disabled and described by the hint, which says why.\n- One persistent role=status region announces sending, sent, discarded, restored and errors.\n- Forced colors: buttons keep edges; pressed tone and highlighted person use Highlight.\n",
219
+ "keywords": "Cards UiEmailDraft UiEmailDraftButton UiEmailDraftTo EMAIL_DRAFT_LABELS DraftContact DraftTone DraftLink EmailDraftPayload EmailDraftState EmailDraftStatusTone EmailDraftLabels An agent wrote an email and a person approves it: payment reminders, renewals, follow-ups. A review queue of outreach, one card per invoice, deal or ticket."
220
+ },
221
+ {
222
+ "slug": "empty-calendar",
223
+ "name": "Empty Calendar",
224
+ "description": "A small drawing of three calendar cards marked empty, fanned out over a soft warm-to-cool glow. The placeholder lines pulse, the glow breathes, and each card lifts or slides out when you hover it.",
225
+ "category": "Illustrations",
226
+ "pro": false,
227
+ "entryPoint": "./ui/empty-calendar",
228
+ "selector": "ui-empty-calendar",
229
+ "url": "/ai/empty-calendar.json",
230
+ "markdown": "# Empty Calendar\n\nA small drawing of three calendar cards marked empty, fanned out over a soft warm-to-cool glow. The placeholder lines pulse, the glow breathes, and each card lifts or slides out when you hover it.\n\nAdd: `npx ochreui@latest add empty-calendar`\nImport: `import { UiEmptyCalendar } from './ui/empty-calendar';`\nSelector: `<ui-empty-calendar>`\nDocs: /components/empty-calendar\n\n## When to use\n- Problem cards about an empty pipeline or no meetings booked.\n- Bento grids and feature cards that want a small drawing above the text.\n\n## When not to use\n- Showing a real schedule: the cards only hold placeholder lines.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiEmptyCalendar } from './ui/empty-calendar';\n\n@Component({\n selector: 'app-pipeline-card',\n imports: [UiEmptyCalendar],\n template: `\n <article>\n <ui-empty-calendar />\n <h3>No meetings on the books</h3>\n <p>Leads go cold while follow-ups wait in someone's inbox. Booking links fix that.</p>\n </article>\n `,\n styles: `\n article { max-inline-size: 360px; padding: 8px 8px 20px; border-radius: 16px; background: var(--ui-bg-canvas); box-shadow: inset 0 0 0 1px var(--ui-hairline); }\n h3 { margin: 4px 12px 0; color: var(--ui-text); font-size: 15px; line-height: 22px; font-weight: 600; }\n p { margin: 4px 12px 0; color: var(--ui-text-muted); font-size: 13px; line-height: 20px; }\n `,\n})\nexport class PipelineCard {}\n```\n\n## Rules\n- 3 : 2, min(560px, 100%) wide by default: set width or max-width with your own class.\n- Set label=\"\" when a heading next to it already says the same thing.\n- Keep translated labels about as short as the defaults; the badge grows and the icon follows the button text.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | a sentence describing the empty cards | What screen readers hear. \"\" hides the drawing from them (decorative). |\n| `labels` | `Partial<EmptyCalendarLabels>` | {} | Default label and the drawn words: title, badge (shown in capitals), action. |\n\n## EmptyCalendarLabels\n\n`type EmptyCalendarLabels = { label: string; title: string; badge: string; action: string }`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-empty-calendar-card` | `var(--ui-bg-surface)` | Card fill; lines and button are mixed from it. |\n| `--ui-empty-calendar-badge-bg` | `var(--ui-hue-orange) at 6% (18% dark) on the card` | Badge fill. |\n| `--ui-empty-calendar-badge-text` | `var(--ui-hue-orange), softened in light mode` | Badge text. |\n| `--ui-empty-calendar-glow-1` | `var(--ui-hue-orange)` | Glow, left. Drawn faint. |\n| `--ui-empty-calendar-glow-2` | `var(--ui-hue-pink)` | Glow, middle. |\n| `--ui-empty-calendar-glow-3` | `var(--ui-hue-purple) mixed with blue` | Glow, right. |\n\n## Accessibility\n- One role=img named by label; the SVG and its words are aria-hidden.\n- label=\"\" makes it decorative: aria-hidden, no role.\n- Soft text inside the drawing is decorative, never the only place that says something.\n- Nothing focusable; hover is decoration.\n- The drawing stays left to right in RTL pages.\n",
231
+ "keywords": "Illustrations UiEmptyCalendar EmptyCalendarLabels Problem cards about an empty pipeline or no meetings booked. Bento grids and feature cards that want a small drawing above the text."
232
+ },
233
+ {
234
+ "slug": "empty-state",
235
+ "name": "Empty State",
236
+ "description": "What a list, table or panel shows while it has nothing: an icon on a soft tile, a title, one quiet line and the first step. Framed, or bare to fill a panel.",
237
+ "category": "Feedback",
238
+ "pro": false,
239
+ "entryPoint": "./ui/empty-state",
240
+ "selector": "ui-empty-state",
241
+ "url": "/ai/empty-state.json",
242
+ "markdown": "# Empty State\n\nWhat a list, table or panel shows while it has nothing: an icon on a soft tile, a title, one quiet line and the first step. Framed, or bare to fill a panel.\n\nAdd: `npx ochreui@latest add empty-state`\nImport: `import { UiEmptyState, UiEmptyStateIcon, UiEmptyStateHeading, UiEmptyStateText } from './ui/empty-state';`\nSelector: `<ui-empty-state>`\nDocs: /components/empty-state\n\n## When to use\n- A list, table or board with nothing yet: say what will appear and offer the first step.\n- A search or filter that matched nothing, with a button that clears it.\n- A panel or page with nothing selected: use it bare.\n\n## When not to use\n- While data is loading: use Skeleton, then the empty state if it stays empty.\n- Errors or a failed load: say what went wrong, with a retry.\n- A first-run checklist with several steps.\n\n## Usage\n\n```ts\nimport { Component, input, output } from '@angular/core';\nimport { UiButton, UiButtonIcon } from './ui/button';\nimport { UiEmptyState, UiEmptyStateIcon } from './ui/empty-state';\n\nexport interface Webhook {\n id: string;\n url: string;\n}\n\n@Component({\n selector: 'app-webhook-list',\n imports: [UiEmptyState, UiEmptyStateIcon, UiButton, UiButtonIcon],\n template: `\n @if (hooks().length) {\n <ul>\n @for (hook of hooks(); track hook.id) {\n <li>{{ hook.url }}</li>\n }\n </ul>\n } @else {\n <ui-empty-state heading=\"No webhooks yet\" text=\"Endpoints you add here get a POST each time a run finishes or fails.\">\n <svg uiEmptyStateIcon viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.9\" stroke-linecap=\"round\">\n <circle cx=\"12\" cy=\"12\" r=\"2.25\" />\n <path d=\"M7.4 7.4a6.5 6.5 0 0 0 0 9.2M16.6 7.4a6.5 6.5 0 0 1 0 9.2M4.2 4.2a11 11 0 0 0 0 15.6M19.8 4.2a11 11 0 0 1 0 15.6\" />\n </svg>\n <button uiButton variant=\"secondary\" size=\"sm\" type=\"button\" (click)=\"add.emit()\">\n <svg uiButtonIcon viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\">\n <path d=\"M8 3.5v9M3.5 8h9\" />\n </svg>\n Add endpoint\n </button>\n </ui-empty-state>\n }\n `,\n})\nexport class WebhookList {\n readonly hooks = input<Webhook[]>([]);\n readonly add = output();\n}\n```\n\n## Rules\n- Show it in place of the list, only once loading has finished.\n- One short title and one line of text; the first step as a small secondary button.\n- Use bare + tall inside a panel with a height; framed inside a page or a list area.\n- Put uiEmptyStateHeading / uiEmptyStateText on a <span>, never a <p>.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `heading` | `string` | none | What is empty: \"No webhooks yet\". Needed unless uiEmptyStateHeading is projected. |\n| `headingLevel` | `2 \\| 3 \\| 4 \\| 5 \\| 6` | none | Makes the title role=heading at this level; otherwise a paragraph. |\n| `text` | `string` | none | One line on what will show up here or how to get there; balanced when it wraps. |\n| `icon` | `boolean` | true | Shows the tile with the projected svg[uiEmptyStateIcon], or a document glyph. false leaves it out. |\n| `bare` | `boolean` | false | No frame and no padding. |\n| `tall` | `boolean` | false | min-height 100% and centred; the parent needs a height. |\n| `(content)` | `elements` | none | Anything else is the actions row: centred, gap 8px, wraps. |\n\n## EmptyStateHeadingLevel\n\n`type EmptyStateHeadingLevel = 2 | 3 | 4 | 5 | 6`\n\n## Template: uiEmptyStateIcon\n\nYour icon on the tile: 18px (Classic 20px), aria-hidden, focusable=false. Context: `none`.\n\n```html\n<svg uiEmptyStateIcon viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.9\">…</svg>\n```\n\n## Template: uiEmptyStateHeading / uiEmptyStateText\n\nRich title or text instead of the string inputs. Put them on a <span>. Context: `none`.\n\n```html\n<span uiEmptyStateText>Press <kbd>N</kbd> to start one.</span>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-empty-state-bg` | `var(--ui-bg-subtle); with data-ui-look=\"tray\" none in light, a 60% var(--ui-bg-surface) wash in dark` | Frame fill. |\n| `--ui-empty-state-edge` | `a 0.5px ring (6% text in light, var(--ui-hairline) in dark); var(--ui-border) 1px dashed with data-ui-look=\"tray\"` | Frame edge colour. |\n| `--ui-empty-state-radius` | `12px; 16px with data-ui-look=\"tray\"` | Frame corners. |\n| `--ui-empty-state-measure` | `430px` | Widest text line. |\n\n## Accessibility\n- Only the icon tile is aria-hidden; title, text and actions are read in order.\n- Takes no focus; Tab goes to the actions.\n- After a search or filter, put role=status on a wrapper that stays mounted, not on the empty state.\n- headingLevel makes the title reachable by heading navigation.\n- Title and text have dir=auto.\n- Forced colors: the frame and tile keep a 1px system-colour border.\n- Dev-mode warning when there is no heading.\n",
243
+ "keywords": "Feedback UiEmptyState UiEmptyStateIcon UiEmptyStateHeading UiEmptyStateText EmptyStateHeadingLevel A list, table or board with nothing yet: say what will appear and offer the first step. A search or filter that matched nothing, with a button that clears it. A panel or page with nothing selected: use it bare."
244
+ },
245
+ {
246
+ "slug": "enrichment-orbit",
247
+ "name": "Enrichment Orbit",
248
+ "description": "A calm card illustration: a record tile inside two thin rings, with colour comets running around them in opposite directions and three upright data nodes orbiting the outer ring.",
249
+ "category": "Illustrations",
250
+ "pro": false,
251
+ "entryPoint": "./ui/enrichment-orbit",
252
+ "selector": "ui-enrichment-orbit",
253
+ "url": "/ai/enrichment-orbit.json",
254
+ "markdown": "# Enrichment Orbit\n\nA calm card illustration: a record tile inside two thin rings, with colour comets running around them in opposite directions and three upright data nodes orbiting the outer ring.\n\nAdd: `npx ochreui@latest add enrichment-orbit`\nImport: `import { UiEnrichmentOrbit } from './ui/enrichment-orbit';`\nSelector: `<ui-enrichment-orbit>`\nDocs: /components/enrichment-orbit\n\n## When to use\n- A step or feature card about enriching, scoring or syncing data around one central record.\n- Bento grids that need a calm illustration that keeps moving.\n\n## When not to use\n- Next to content where constant motion would distract.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiEnrichmentOrbit } from './ui/enrichment-orbit';\n\n@Component({\n selector: 'app-enrich-card',\n imports: [UiEnrichmentOrbit],\n template: `\n <article class=\"card\">\n <ui-enrichment-orbit label=\"A contact record with three data sources orbiting it\" />\n <h3>Fill in every contact</h3>\n <p>Job title, company size and location arrive from three sources and land on one record.</p>\n </article>\n `,\n styles: `\n .card {\n box-sizing: border-box; inline-size: min(360px, 100%); padding: 8px 8px 20px;\n border-radius: 16px; background: var(--ui-bg-surface); box-shadow: inset 0 0 0 1px var(--ui-hairline);\n }\n h3 { margin: 4px 12px 0; color: var(--ui-text); font-size: 15px; line-height: 22px; font-weight: 600; }\n p { margin: 4px 12px 0; color: var(--ui-text-muted); font-size: 13px; line-height: 20px; }\n `,\n})\nexport class EnrichCard {}\n```\n\n## Rules\n- 3 : 2 box, inline-size min(560px, 100%); set another width with your own class.\n- Comets 7 s per turn (outer clockwise, inner counter-clockwise), nodes 22 s clockwise, linear.\n- Pauses off-screen and in hidden tabs and restarts the loop when back.\n- Reduced motion or --ui-motion-scale: 0: still pose, nodes at 0/120/240 degrees, comets at the top.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | 'A record tile with data nodes orbiting around it' | Accessible name (role=img). Empty hides it from assistive tech. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-enrichment-orbit-ring` | `light-dark(border tinted indigo, --ui-border-strong)` | Ring colour; the inner ring is drawn at 45%. |\n| `--ui-enrichment-orbit-face` | `light-dark(--ui-bg-surface, surface + 5% text)` | Tile and node face. |\n| `--ui-enrichment-orbit-ink` | `var(--ui-text)` | Mark in the tile. |\n| `--ui-enrichment-orbit-glyph` | `var(--ui-text-muted)` | Node glyphs, drawn at 55%. |\n| `--ui-enrichment-orbit-comet-1` | `coral` | Warm end of the comets. |\n| `--ui-enrichment-orbit-comet-2` | `violet` | Middle of the comets. |\n| `--ui-enrichment-orbit-comet-3` | `blue` | Cool end of the comets. |\n\n## Accessibility\n- Host role=img with aria-label from label; the SVG is aria-hidden and not focusable.\n- Empty label: aria-hidden host, no role.\n",
255
+ "keywords": "Illustrations UiEnrichmentOrbit A step or feature card about enriching, scoring or syncing data around one central record. Bento grids that need a calm illustration that keeps moving."
256
+ },
257
+ {
258
+ "slug": "filter-menu",
259
+ "name": "Filter Menu",
260
+ "description": "Grouped checkbox filters in one card: a removable chip per pick, Clear all, groups that fold away and one tab stop for the whole list. The value is picked ids per group, with signal forms, reactive forms, ngModel or [(value)].",
261
+ "category": "Inputs",
262
+ "pro": false,
263
+ "entryPoint": "./ui/filter-menu",
264
+ "selector": "ui-filter-menu",
265
+ "url": "/ai/filter-menu.json",
266
+ "markdown": "# Filter Menu\n\nGrouped checkbox filters in one card: a removable chip per pick, Clear all, groups that fold away and one tab stop for the whole list. The value is picked ids per group, with signal forms, reactive forms, ngModel or [(value)].\n\nAdd: `npx ochreui@latest add filter-menu`\nImport: `import { UiFilterMenu } from './ui/filter-menu';`\nSelector: `<ui-filter-menu>`\nDocs: /components/filter-menu\n\n## When to use\n- Narrowing a list, table or board by a few groups of known options.\n- Side panels and popovers where several filters stay visible at once.\n\n## When not to use\n- One choice from a short list: use Segmented Control or Select.\n- Free-text search, dates or numeric ranges.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form } from '@angular/forms/signals';\nimport { FilterGroup, FilterValue, UiFilterMenu } from './ui/filter-menu';\n\n@Component({\n selector: 'app-issue-filters',\n imports: [UiFilterMenu, FormField],\n template: `<ui-filter-menu [groups]=\"groups\" [formField]=\"f.filters\" />`,\n})\nexport class IssueFilters {\n protected readonly groups: FilterGroup[] = [\n {\n id: 'status',\n label: 'Status',\n options: [\n { id: 'todo', label: 'Todo' },\n { id: 'in-progress', label: 'In progress' },\n { id: 'done', label: 'Done' },\n ],\n },\n {\n id: 'priority',\n label: 'Priority',\n chipPrefix: 'Priority: ',\n options: [\n { id: 'urgent', label: 'Urgent' },\n { id: 'high', label: 'High' },\n { id: 'low', label: 'Low' },\n ],\n },\n ];\n private readonly model = signal<{ filters: FilterValue }>({ filters: { status: ['in-progress'] } });\n protected readonly f = form(this.model);\n}\n```\n\n## Rules\n- Bind [formField], formControl, formControlName, ngModel or [(value)]; the value is { [groupId]: optionId[] }.\n- With [formField], don't set disabled: the form sets it.\n- Use heading, not title, for the visible title.\n- Leave open unset to start with the first group open; [(open)] controls it.\n- Translate every visible and spoken word through labels.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `groups` | `FilterGroup[]` | required | Groups top to bottom: { id, label, options: { id, label }[], chipPrefix? }. |\n| `value` | `FilterValue` | {} | Picked option ids per group id; option order, empty groups left out, unknown ids kept. |\n| `open` | `string[] \\| undefined` | the first group | Ids of the open groups; two-way with [(open)]. |\n| `heading` | `string` | 'Filters' | Title on top; names the menu. |\n| `hints` | `boolean` | true | Keyboard hint row; always hidden on touch. |\n| `disabled` | `boolean` | false | Disables every control; forms set it too. |\n| `labels` | `Partial<FilterMenuLabels>` | English | Words shown and announced, for translation. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `valueChange` | `FilterValue` | After every pick, removal and Clear all. Not on writes from code. |\n| `openChange` | `string[]` | When a group opens or closes. |\n| `touch` | `void` | When focus leaves the menu. |\n\n## FilterGroup\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | `string` | Key in the value. |\n| `label` | `string` | Header text. |\n| `options` | `FilterOption[]` | { id, label } rows. |\n| `chipPrefix` | `string` | Optional text before this group's chips. |\n\n## FilterValue\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `[groupId]` | `readonly string[]` | Picked option ids. |\n\n## FilterMenuLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `heading` | `string` | Title. |\n| `clearAll` | `string` | Clear all button. |\n| `remove` | `(chip: string) => string` | Chip remove button name. |\n| `more` | `(count: number, chips: readonly string[]) => string` | Name of the +N button. |\n| `less` | `string` | +N button while all chips show. |\n| `picked` | `(count: number) => string` | \"1 filter\" in a header. |\n| `options` | `(count: number) => string` | Header description, \"4 options\". |\n| `navigate` | `string` | Hint row. |\n| `select` | `string` | Hint row. |\n| `cleared` | `string` | Announced after Clear all. |\n| `added` | `(chip: string) => string` | Announced after a pick. |\n| `removed` | `(chip: string) => string` | Announced after a removal. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-filter-menu-width` | `400px` | Widest the card grows; Classic adds its 20px tray. |\n| `--ui-filter-menu-radius` | `10px (Classic 20px)` | Card corners. |\n| `--ui-filter-menu-fill` | `var(--ui-hue-blue) (Classic var(--ui-bg-neutral-solid))` | Checked box fill. |\n| `--ui-checkbox-edge` | `color-mix(in srgb, var(--ui-text) 26%, transparent)` | Unchecked box edge, shared with Checkbox; var(--ui-border-input) gives 3:1. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Clear all, chip remove buttons, then the list as one stop. |\n| ↓ / ↑ | Next / previous row among headers and open options; no wrap. |\n| Enter / Space | Toggles an option; opens or closes a group. |\n| → | Opens a group; on an open one, moves to its first option. |\n| ← | Closes the group from its header or an option. |\n| Home / End | First / last row. |\n| Letters | Next row starting with the typed text. |\n\n## Accessibility\n- role=group named by the title; headers have aria-expanded; options are role=checkbox.\n- Closed groups are inert; headers described as \"4 options, 1 filter\".\n- Chip remove buttons named \"Remove <chip>\"; +N is a button with aria-expanded.\n- One role=status announcement per change.\n- Focus moves to the next chip or the list, never to the page.\n- Inset focus ring; forced colors keep edges and Highlight for checked; mirrors in RTL.\n",
267
+ "keywords": "Inputs UiFilterMenu FilterGroup FilterOption FilterValue FilterMenuLabels Narrowing a list, table or board by a few groups of known options. Side panels and popovers where several filters stay visible at once."
268
+ },
269
+ {
270
+ "slug": "form-field",
271
+ "name": "Form Field",
272
+ "description": "The label, a required mark or Optional, and one line for the hint, the error and a count, around any control that has none of its own: a native select, a date input, a segmented control, a rating. Your control stays yours, so every kind of Angular form just works.",
273
+ "category": "Inputs",
274
+ "pro": false,
275
+ "entryPoint": "./ui/form-field",
276
+ "selector": "ui-form-field",
277
+ "url": "/ai/form-field.json",
278
+ "markdown": "# Form Field\n\nThe label, a required mark or Optional, and one line for the hint, the error and a count, around any control that has none of its own: a native select, a date input, a segmented control, a rating. Your control stays yours, so every kind of Angular form just works.\n\nAdd: `npx ochreui@latest add form-field`\nImport: `import { UiFormField, UiFieldControl } from './ui/form-field';`\nSelector: `<ui-form-field>`\nDocs: /components/form-field\n\n## When to use\n- A control with no label, hint or error of its own: native select, date/time/color/file/range input, Segmented Control, Toggle Group, Rating, radio group, custom picker.\n- Forms that mix kinds of controls, so labels and messages line up.\n\n## When not to use\n- Text Field, Text Area or Number Input: use their own label, hint and error.\n- A single checkbox or switch: use Checkbox or Switch.\n- Several fields under one heading: use fieldset and legend.\n\n## Usage\n\n```ts\nimport { Component, computed, signal } from '@angular/core';\nimport { FormField, form, maxLength, required } from '@angular/forms/signals';\nimport { UiFieldControl, UiFormField } from './ui/form-field';\n\n@Component({\n selector: 'app-workflow-form',\n imports: [UiFormField, UiFieldControl, FormField],\n template: `\n <form class=\"fields\" novalidate (submit)=\"$event.preventDefault()\">\n <ui-form-field label=\"Workflow name\" [counter]=\"f.name().value().length + '/40'\">\n <input uiFieldControl [formField]=\"f.name\" autocomplete=\"off\" />\n </ui-form-field>\n <ui-form-field label=\"Runner\" hint=\"Large runners finish sooner and bill per minute.\">\n <select uiFieldControl [formField]=\"f.runner\">\n <option value=\"small\">Small, 2 vCPU</option>\n <option value=\"medium\">Medium, 4 vCPU</option>\n <option value=\"large\">Large, 8 vCPU</option>\n </select>\n </ui-form-field>\n <ui-form-field label=\"Monthly cap\" hint=\"In US dollars. Runs pause once it is reached.\" [error]=\"capError()\">\n <input uiFieldControl inputmode=\"decimal\" [formField]=\"f.cap\" />\n </ui-form-field>\n <ui-form-field label=\"Instructions\" optional [counter]=\"f.notes().value().length + '/280'\">\n <textarea uiFieldControl rows=\"2\" [formField]=\"f.notes\"></textarea>\n </ui-form-field>\n </form>\n `,\n styles: `\n .fields { display: flex; flex-direction: column; gap: 16px; max-width: 360px; }\n `,\n})\nexport class WorkflowForm {\n private readonly model = signal({ name: 'Weekly invoice digest', runner: 'medium', cap: '650', notes: '' });\n protected readonly f = form(this.model, (p) => {\n required(p.name);\n maxLength(p.name, 40);\n maxLength(p.notes, 280);\n });\n protected readonly capError = computed(() =>\n Number(this.model().cap) > 500 ? 'Your plan allows up to $500 a month.' : null,\n );\n}\n```\n\n## Rules\n- Put uiFieldControl on the control; bind it with [formField], formControl or ngModel as usual.\n- Do not wrap Text Field, Text Area, Number Input, Checkbox or Switch.\n- With [formField], required, disabled and readonly come from the schema; do not write them.\n- Non-native controls are named by the field label (aria-labelledby); leave out their own aria-label.\n- counter is a string you build, e.g. f.notes().value().length + \"/280\".\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | none | Above the control; clicking focuses it. |\n| `hint` | `string` | none | Quiet line under the control; the error replaces it. |\n| `error` | `string \\| boolean \\| null \\| undefined` | none | Invalid state: red edge on native controls, aria-invalid, message in place of the hint. true = invalid with no message. |\n| `required` | `boolean` | false | Required mark and aria-required. The mark also shows when the control is required (native required, schema required()). Never writes required on the control. |\n| `optional` | `boolean` | false | \"Optional\" after the label, also heard by screen readers. |\n| `counter` | `string` | none | Text at the end of the message line, e.g. \"12/280\". You build it. |\n| `for` | `string` | none | Id of a control you cannot mark with uiFieldControl. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | 'md' | Native inputs and selects 28, 32 or 36px; Classic +4; touch +6 (md 38) with 16px text. |\n| `labels` | `Partial<FormFieldLabels>` | English | Words to translate: optional, required (the mark). |\n| `aria-describedby (uiFieldControl)` | `string` | none | Your own descriptions, kept alongside the hint, error and counter. Set it as aria-describedby=\"…\", not [attr.aria-describedby]. |\n\n## FormFieldLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `optional` | `string` | Tag after the label, also inside the label for screen readers. |\n| `required` | `string` | The required mark (default *), hidden from screen readers. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-form-field-gap` | `calc(var(--ui-space-1-5) + 1px * var(--ui-look-tray))` | Gap between label, control and message line. |\n| `--ui-form-field-required` | `var(--ui-text-muted)` | Required mark colour. |\n| `--ui-text-field-edge` | `var(--ui-hairline)` | Resting edge of native controls (shared with Text Field). |\n| `--ui-text-field-edge-hover` | `color-mix(in srgb, var(--ui-text) 18%, transparent)` | Edge on hover. |\n| `--ui-text-field-edge-focus` | `var(--ui-border-input)` | Edge while focused, ≥ 3:1. |\n| `--ui-text-field-radius` | `7px (Classic 10px)` | Corners of native controls. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Control to control; label, hint and count are not stops. |\n| Other keys | Handled by the control itself. |\n\n## Accessibility\n- label for on input, select, textarea; aria-labelledby on other controls.\n- Hint or error and count in aria-describedby; the message line is a polite live region.\n- Required mark aria-hidden; aria-required on the control. Optional is part of the name.\n- Muted text ≥ 4.5:1; focus edge ≥ 3:1.\n- Forced colors: native controls keep an edge and a Highlight focus outline.\n",
279
+ "keywords": "Inputs UiFormField UiFieldControl FormFieldSize FormFieldLabels A control with no label, hint or error of its own: native select, date/time/color/file/range input, Segmented Control, Toggle Group, Rating, radio group, custom picker. Forms that mix kinds of controls, so labels and messages line up."
280
+ },
281
+ {
282
+ "slug": "frost-cloud",
283
+ "name": "Frost Cloud",
284
+ "description": "A frosted white cloud mascot with cut-out eyes on a blue or red-orange sky: it floats, breathes, glances around, blinks, follows the pointer and bounces with a wink when pressed.",
285
+ "category": "Illustrations",
286
+ "pro": false,
287
+ "entryPoint": "./ui/frost-cloud",
288
+ "selector": "ui-frost-cloud",
289
+ "url": "/ai/frost-cloud.json",
290
+ "markdown": "# Frost Cloud\n\nA frosted white cloud mascot with cut-out eyes on a blue or red-orange sky: it floats, breathes, glances around, blinks, follows the pointer and bounces with a wink when pressed.\n\nAdd: `npx ochreui@latest add frost-cloud`\nImport: `import { UiFrostCloud } from './ui/frost-cloud';`\nSelector: `<ui-frost-cloud>`\nDocs: /components/frost-cloud\n\n## When to use\n- A friendly face for an assistant, an AI feature or a cloud product: app icon, empty state, feature card.\n- Landing pages that want a calm, living mascot instead of a static logo.\n\n## When not to use\n- Sizes under about 48 px.\n- Brands far from blue or orange.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiFrostCloud } from './ui/frost-cloud';\n\n@Component({\n selector: 'app-helper-card',\n imports: [UiFrostCloud],\n template: `\n <article>\n <ui-frost-cloud class=\"art\" color=\"orange\" label=\"Nimbus, the helper for this workspace\" />\n <h3>Say hello to Nimbus</h3>\n <p>Ask about your files, your calendar or the last meeting.</p>\n </article>\n `,\n styles: `\n article {\n box-sizing: border-box; inline-size: min(320px, 100%); overflow: hidden;\n border-radius: 18px; background: var(--ui-bg-surface); box-shadow: inset 0 0 0 1px var(--ui-hairline);\n }\n .art { inline-size: 100%; }\n h3 { margin: 16px 20px 4px; color: var(--ui-text); font-size: 16px; line-height: 24px; font-weight: 600; }\n p { margin: 0 20px 20px; color: var(--ui-text-muted); font-size: 14px; line-height: 20px; }\n `,\n})\nexport class HelperCard {}\n```\n\n## Rules\n- Square, min(380px, 100%) by default; set width and height through your class and the sky fills the box, cloud centred up to 380px.\n- Orange defaults come from data-color=orange on the host; the hooks override both colours.\n- Runs only on screen in a visible tab and resumes where it stopped; reduced motion or --ui-motion-scale: 0 keeps it fully still and ignores presses.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `color` | `FrostCloudColor` | 'blue' | Blue-to-cyan or red-to-orange sky; haze and eyes follow. |\n| `background` | `boolean` | true | Paint the sky over the whole box; off, a soft coloured edge on your surface. |\n| `followPointer` | `boolean` | true | Eyes follow the pointer while it is over the box. |\n| `label` | `string \\| null \\| undefined` | undefined | Accessible name; defaults to a short description. Empty string: aria-hidden decoration. |\n\n## FrostCloudColor\n\n`type FrostCloudColor = 'blue' | 'orange'`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-frost-cloud-sky-top` | `light-dark(#2577ea, #165ac9)` | Sky top. |\n| `--ui-frost-cloud-sky-bottom` | `light-dark(#4ac7f5, #2aa5e5)` | Sky bottom. |\n| `--ui-frost-cloud-sky-glow` | `light-dark(rgb(120 215 252 / 0.5), rgb(96 192 246 / 0.45))` | Soft light behind the cloud. |\n| `--ui-frost-cloud-tint` | `#a2d1f6` | Lower-body haze; edge glow without a sky. |\n| `--ui-frost-cloud-eye` | `#5ccaf9` | Eye colour (top a step deeper). |\n| `--ui-frost-cloud-shadow` | `light-dark(#1a66c8, #0b3f96)` | Ground shadow. |\n\n## Accessibility\n- Host role=img with one aria-label; the SVG is aria-hidden.\n- Not focusable; pressing only animates.\n- Empty label: aria-hidden, no role.\n- forced-color-adjust: none keeps the sky in forced colors.\n",
291
+ "keywords": "Illustrations UiFrostCloud FrostCloudColor A friendly face for an assistant, an AI feature or a cloud product: app icon, empty state, feature card. Landing pages that want a calm, living mascot instead of a static logo."
292
+ },
293
+ {
294
+ "slug": "ghosted-chat",
295
+ "name": "Ghosted Chat",
296
+ "description": "A small card illustration: three chat messages seen and never answered. They arrive one by one, a red shine runs through the last one, and on hover a thumbs-down reply pops in.",
297
+ "category": "Illustrations",
298
+ "pro": false,
299
+ "entryPoint": "./ui/ghosted-chat",
300
+ "selector": "ui-ghosted-chat",
301
+ "url": "/ai/ghosted-chat.json",
302
+ "markdown": "# Ghosted Chat\n\nA small card illustration: three chat messages seen and never answered. They arrive one by one, a red shine runs through the last one, and on hover a thumbs-down reply pops in.\n\nAdd: `npx ochreui@latest add ghosted-chat`\nImport: `import { UiGhostedChat } from './ui/ghosted-chat';`\nSelector: `<ui-ghosted-chat>`\nDocs: /components/ghosted-chat\n\n## When to use\n- A problem card about outreach that gets ignored, or messages read and never answered.\n- Bento grids and feature cards that want a small picture above their title and text.\n\n## When not to use\n- As a real chat: the messages are a fixed drawing.\n- Below about 220px wide, where the message text gets too small to read.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiGhostedChat } from './ui/ghosted-chat';\n\n@Component({\n selector: 'app-outreach-card',\n imports: [UiGhostedChat],\n template: `\n <article>\n <ui-ghosted-chat />\n <h3>Cold outreach goes nowhere</h3>\n <p>Your messages get opened, then sit there. No reply, no next step, no idea why.</p>\n </article>\n `,\n styles: `\n article { max-inline-size: 360px; }\n h3 { margin: 16px 0 0; font-size: 16px; line-height: 1.4; font-weight: 600; }\n p { margin: 6px 0 0; color: var(--ui-text-muted); font-size: 14px; line-height: 1.5; }\n `,\n})\nexport class OutreachCard {}\n```\n\n## Rules\n- Width up to 560px from its container, height at 3:2; the whole drawing scales, nothing reflows.\n- Enters once when a third of it is in view. Call replay() on the instance (#chat, then (click)=\"chat.replay()\") to play it again.\n- The shine waits off-screen and in hidden tabs, and starts over when it comes back.\n- Reduced motion or --ui-motion-scale: 0: everything in place at once, no shine, instant hover.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | 'A one-sided chat: three messages seen, none answered' | What screen readers hear for the whole picture. Empty hides the picture from them. |\n| `labels` | `Partial<GhostedChatLabels>` | {} | The texts in the drawing: status, first, second, last and receipt. Keep them about as long as the defaults. |\n\n## GhostedChatLabels\n\n`type GhostedChatLabels = { status: string; first: string; second: string; last: string; receipt: string }`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-ghosted-chat-bubble` | `var(--ui-bg-surface)` | Message fill. |\n| `--ui-ghosted-chat-ink` | `var(--ui-text)` | Text of the last message; the first two use it a little softer. |\n| `--ui-ghosted-chat-status` | `var(--ui-text-muted)` | The status line and the receipt. |\n| `--ui-ghosted-chat-reply` | `a deep blue` | The reply bubble that pops in on hover. |\n| `--ui-ghosted-chat-shine` | `var(--ui-hue-red)` | The shine that runs through the last message. |\n\n## Accessibility\n- One image named by label; the drawing inside is aria-hidden, so nothing is read twice.\n- label=\"\" hides the whole picture from screen readers.\n- Not focusable; the hover reply is decoration only and never shows on touch screens.\n- Forced colours: outlined bubbles in system colours, and the hover fade still works.\n- The scene always reads left to right, also on right-to-left pages.\n",
303
+ "keywords": "Illustrations UiGhostedChat GhostedChatLabels A problem card about outreach that gets ignored, or messages read and never answered. Bento grids and feature cards that want a small picture above their title and text."
304
+ },
305
+ {
306
+ "slug": "glow-cloud",
307
+ "name": "Glow Cloud",
308
+ "description": "A small living mascot: a glowing cloud with pill eyes on a red-to-orange or blue-to-cyan sky that floats, looks around, blinks, follows the mouse and bounces with a wink when pressed.",
309
+ "category": "Illustrations",
310
+ "pro": false,
311
+ "entryPoint": "./ui/glow-cloud",
312
+ "selector": "ui-glow-cloud",
313
+ "url": "/ai/glow-cloud.json",
314
+ "markdown": "# Glow Cloud\n\nA small living mascot: a glowing cloud with pill eyes on a red-to-orange or blue-to-cyan sky that floats, looks around, blinks, follows the mouse and bounces with a wink when pressed.\n\nAdd: `npx ochreui@latest add glow-cloud`\nImport: `import { UiGlowCloud } from './ui/glow-cloud';`\nSelector: `<ui-glow-cloud>`\nDocs: /components/glow-cloud\n\n## When to use\n- A friendly face for an assistant, an AI feature or a cloud product: app icon, empty state, feature card.\n- Landing pages that want a calm living mascot instead of a static logo.\n\n## When not to use\n- Below about 48px, where the glow and eyes get lost.\n- Brands far from blue or orange.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiGlowCloud } from './ui/glow-cloud';\n\n@Component({\n selector: 'app-assistant-card',\n imports: [UiGlowCloud],\n template: `\n <article>\n <ui-glow-cloud color=\"blue\" class=\"art\" />\n <h3>Say hello to Nimbus</h3>\n <p>Your workspace helper drafts replies, sorts the inbox and keeps notes from every call.</p>\n </article>\n `,\n styles: `\n article { box-sizing: border-box; inline-size: min(320px, 100%); padding: 12px 12px 20px; border-radius: 20px; background: var(--ui-bg-surface); box-shadow: inset 0 0 0 1px var(--ui-hairline); }\n .art { inline-size: 100%; border-radius: 12px; }\n h3 { margin: 16px 8px 4px; color: var(--ui-text); font-size: 16px; line-height: 24px; font-weight: 600; }\n p { margin: 0 8px; color: var(--ui-text-muted); font-size: 14px; line-height: 20px; }\n `,\n})\nexport class AssistantCard {}\n```\n\n## Rules\n- Square, min(380px, 100%) by default; the drawing is min(380px, 78%) of the width, centred.\n- To fill a box, set width and height and aspect-ratio: auto in your class.\n- Script-driven motion: 5.7s float cycle, random glances and blinks, mouse follow, bounce and wink on press.\n- Runs only on screen in a visible tab and carries on from the same pose; reduced motion or --ui-motion-scale: 0 keeps it fully still, with no press reaction.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `color` | `GlowCloudColor` | 'orange' | Red-to-orange or blue-to-cyan sky; the body follows. |\n| `background` | `boolean` | true | Fill the box with the sky; false leaves the cloud on your own background. |\n| `followPointer` | `boolean` | true | Eyes, lean and highlight follow the mouse over the host. Never on touch. |\n| `label` | `string \\| null \\| undefined` | undefined | Accessible name; defaults to a short description. Empty string: aria-hidden decoration. |\n\n## GlowCloudColor\n\n`type GlowCloudColor = 'blue' | 'orange'`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-glow-cloud-sky-top` | `deep red / deep blue (deeper in dark)` | Sky colour at the top. |\n| `--ui-glow-cloud-sky-bottom` | `warm orange / light cyan` | Sky colour at the bottom. |\n| `--ui-glow-cloud-bloom` | `soft peach / cyan light` | Glow behind the cloud, up and right of centre. |\n| `--ui-glow-cloud-body` | `#f4512f / #00a0ff (orange / blue)` | Centre of the glowing body. |\n| `--ui-glow-cloud-body-mid` | `#fb7b48 / #19b2ff (orange / blue)` | Middle of the body. |\n| `--ui-glow-cloud-rim` | `#ffbd8e / #6dd4ff (orange / blue)` | Outer edge of the body, inside the white glow. |\n| `--ui-glow-cloud-shine` | `#ffb398 / #9fe0ff (orange / blue)` | Highlight on the top lobe. |\n| `--ui-glow-cloud-eye` | `#fff8f3 / #f3faff (orange / blue)` | The eyes. |\n| `--ui-glow-cloud-eye-low` | `#ffe5d6 / #d6ecff (orange / blue)` | Lower half of each eye. |\n| `--ui-glow-cloud-eye-rim` | `#eda48c / #8fbdea (orange / blue)` | Thin rim around each eye. |\n| `--ui-glow-cloud-shadow` | `#a4230e / #14408c (orange / blue)` | Ground shadow. |\n\n## Accessibility\n- Host role=img with one aria-label; the SVG is aria-hidden and not focusable.\n- Empty label: host aria-hidden, purely decorative.\n- Not focusable; a press only animates.\n- Motion pauses off-screen, in hidden tabs and with reduced motion (or --ui-motion-scale: 0).\n- Forced colors: sky and cloud keep their colours (forced-color-adjust: none).\n",
315
+ "keywords": "Illustrations UiGlowCloud GlowCloudColor A friendly face for an assistant, an AI feature or a cloud product: app icon, empty state, feature card. Landing pages that want a calm living mascot instead of a static logo."
316
+ },
317
+ {
318
+ "slug": "grid-background",
319
+ "name": "Grid Background",
320
+ "description": "A fine line grid that drifts slowly behind your content, fades out toward the edges and is uncovered once by a circle growing from the centre when it first comes into view.",
321
+ "category": "Motion",
322
+ "pro": false,
323
+ "entryPoint": "./ui/grid-background",
324
+ "selector": "ui-grid-background",
325
+ "url": "/ai/grid-background.json",
326
+ "markdown": "# Grid Background\n\nA fine line grid that drifts slowly behind your content, fades out toward the edges and is uncovered once by a circle growing from the centre when it first comes into view.\n\nAdd: `npx ochreui@latest add grid-background`\nImport: `import { UiGridBackground } from './ui/grid-background';`\nSelector: `<ui-grid-background>`\nDocs: /components/grid-background\n\n## When to use\n- Hero sections and feature headers that want a quiet, technical backdrop.\n- Empty states and panels that look too flat on a plain fill.\n\n## When not to use\n- Behind dense text or data tables.\n- Several moving backgrounds on one screen: one per view.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiButton } from './ui/button';\nimport { UiGridBackground } from './ui/grid-background';\n\n@Component({\n selector: 'app-launch-hero',\n imports: [UiGridBackground, UiButton],\n template: `\n <ui-grid-background class=\"hero\" [size]=\"48\" direction=\"diagonal\">\n <section>\n <h1>Release 3.0 is out</h1>\n <p>Scheduled runs, shared prompts and a faster editor, in one update.</p>\n <button uiButton>Read the changelog</button>\n </section>\n </ui-grid-background>\n `,\n styles: `\n .hero { min-block-size: 480px; border-radius: 20px; background: var(--ui-bg-surface); box-shadow: inset 0 0 0 1px var(--ui-hairline); }\n section { display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }\n h1 { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -0.03em; }\n p { max-inline-size: 340px; margin: 0 0 8px; color: var(--ui-text-muted); font-size: 15px; line-height: 1.5; }\n `,\n})\nexport class LaunchHero {}\n```\n\n## Rules\n- Project one element: it fills the box. Give the host a height through your class, or let the content size it.\n- Corners, fill and frame come from your own class.\n- Drift pauses off-screen and in hidden tabs; reduced motion: still, no reveal.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `size` | `number` | 48 | Cell size in px. |\n| `speed` | `number` | 3 | Seconds to drift one cell; 0 keeps it still. |\n| `direction` | `GridBackgroundDirection` | 'diagonal' | up, down, left, right or diagonal (top right to bottom left). Physical in RTL. |\n| `reveal` | `boolean` | true | Uncover with a circle from the centre, once, at 20% in view (or 20% of the viewport for tall boxes). |\n| `fade` | `number` | 70 | Edge fade end, % of the distance to the corners; full strength to 30% of it. |\n| `color` | `string \\| null` | null | Line colour for this grid; sets --ui-grid-background-line. |\n\n## GridBackgroundDirection\n\n`type GridBackgroundDirection = 'up' | 'down' | 'left' | 'right' | 'diagonal'`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-grid-background-line` | `color-mix(in srgb, var(--ui-text) 8%, transparent)` | Line colour; follows the theme. |\n\n## Accessibility\n- Grid layer aria-hidden with pointer-events: none.\n- Projected content on its own layer above, in reading order, interactive.\n- Forced colors: grid hidden.\n",
327
+ "keywords": "Motion UiGridBackground GridBackgroundDirection Hero sections and feature headers that want a quiet, technical backdrop. Empty states and panels that look too flat on a plain fill."
328
+ },
329
+ {
330
+ "slug": "hover-card",
331
+ "name": "Hover Card",
332
+ "description": "A preview card for what a link or a name points to. It opens after the pointer rests or keyboard focus stays, keeps open while the pointer travels into it, never opens on touch, and flips to stay on screen.",
333
+ "category": "Data display",
334
+ "pro": false,
335
+ "entryPoint": "./ui/hover-card",
336
+ "selector": "[uiHoverCard]",
337
+ "url": "/ai/hover-card.json",
338
+ "markdown": "# Hover Card\n\nA preview card for what a link or a name points to. It opens after the pointer rests or keyboard focus stays, keeps open while the pointer travels into it, never opens on touch, and flips to stay on screen.\n\nAdd: `npx ochreui@latest add hover-card`\nImport: `import { UiHoverCard, UiHoverCardPanel } from './ui/hover-card';`\nSelector: `<[uiHoverCard]>`\nDocs: /components/hover-card\n\n## When to use\n- A quick look at what a name or link refers to: a person, an agent, a file, a run.\n- Mentions in feeds, logs and tables, where the full page is one click away.\n\n## When not to use\n- An icon button's name or a one-line hint: use Tooltip.\n- Anything to act on, or a form: use Popover.\n- Information that exists only in the card: touch never shows it.\n- Actions on the item under the pointer: use Context Menu.\n\n## Usage\n\n```ts\nimport { Component, input } from '@angular/core';\nimport { UiHoverCard } from './ui/hover-card';\n\n@Component({\n selector: 'app-agent-name',\n imports: [UiHoverCard],\n template: `\n <a [href]=\"'/agents/' + id()\" [uiHoverCard]=\"card\" [uiHoverCardWidth]=\"288\">{{ name() }}</a>\n <ng-template #card>\n <div class=\"card\">\n <strong aria-hidden=\"true\">{{ name() }}</strong>\n <span class=\"meta\">{{ role() }} · {{ status() }}</span>\n <a [href]=\"'/agents/' + id()\">Open agent</a>\n </div>\n </ng-template>\n `,\n styles: `\n .card { display: grid; gap: 4px; }\n .meta { color: var(--ui-text-muted); font-size: 12px; line-height: 16px; }\n `,\n})\nexport class AgentName {\n id = input.required<string>();\n name = input.required<string>();\n role = input('');\n status = input('');\n}\n```\n\n## Rules\n- Put [uiHoverCard] on a focusable link or button with a name; it warns in dev mode otherwise.\n- Pass the content as an <ng-template>; use [uiHoverCardContext] to share one template across rows.\n- Everything in the card must also be on the page the link opens: touch never shows it.\n- Mark a title that repeats the trigger's text aria-hidden=\"true\".\n- Needs overlay.ts next to hover-card.ts (the CLI adds it): the placement, Escape and outside-press layer shared by the floating components.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `uiHoverCard` | `TemplateRef<unknown> \\| null \\| undefined` | undefined | What the card shows. Null or undefined: no card. |\n| `uiHoverCardContext` | `unknown` | undefined | Passed to the template as $implicit (let-item). |\n| `uiHoverCardSide` | `'bottom' \\| 'top' \\| 'right' \\| 'left'` | 'bottom' | Preferred side; flips to the side with more room. |\n| `uiHoverCardAlign` | `'start' \\| 'center' \\| 'end'` | 'start' | Edges that line up (logical in RTL); switches when it would stick out. |\n| `uiHoverCardOffset` | `number` | 8 | Gap to the trigger in px. |\n| `uiHoverCardOpenDelay` | `number` | 600 | Pointer rest or keyboard focus time before it opens, ms. |\n| `uiHoverCardCloseDelay` | `number` | 300 | Time it stays after the pointer leaves trigger, card and corridor, ms. |\n| `uiHoverCardWidth` | `number \\| string` | none | Card width (number = px). Default fits the content up to 320px. |\n| `uiHoverCardOpen` | `boolean` | false | Open state, two-way [(uiHoverCardOpen)]; true from code opens at once. Open on the first render, it closes once the pointer moves outside it and its trigger. |\n| `uiHoverCardDisabled` | `boolean` | false | Never opens. |\n| `uiHoverCardClass` | `string` | none | A class on the card. |\n| `uiHoverCardLabels` | `Partial<HoverCardLabels>` | {} | card(name): the card's spoken name from the trigger's (default: the trigger's name). |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `uiHoverCardOpenChange` | `boolean` | Every change of uiHoverCardOpen. |\n\n## HoverCardLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `card` | `(name: string) => string` | The card's spoken name, from the trigger's name. Default: the trigger's name, or \"Preview\" when it has none. |\n\n## Template: uiHoverCard\n\nThe card's content, created on open and destroyed on close. Context: `$implicit: uiHoverCardContext`.\n\n```html\n<a href=\"/runs/r-8841\" [uiHoverCard]=\"details\" [uiHoverCardContext]=\"run\">r-8841</a>\n<ng-template #details let-run>{{ run.agent }} · {{ run.cost }}</ng-template>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-hover-card-bg` | `var(--ui-popover-bg, var(--ui-bg-overlay))` | Fill. |\n| `--ui-hover-card-fg` | `var(--ui-popover-fg, var(--ui-text))` | Text. |\n| `--ui-hover-card-radius` | `12px (Classic 16px)` | Corners. |\n| `--ui-hover-card-padding` | `14px (Classic and touch 16px)` | Inner space. |\n| `--ui-hover-card-shadow` | `var(--ui-popover-shadow, var(--ui-shadow-md))` | Ring and drop shadow. |\n| `--ui-hover-card-width` | `max-content` | Width when uiHoverCardWidth is unset. |\n| `--ui-hover-card-max-width` | `320px` | Widest it grows on its own. |\n| `--ui-hover-card-drift` | `4px` | Glide distance on enter. |\n| `--ui-hover-card-from` | `0.97` | Starting scale on enter. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Focus that stays on the trigger opens it after the delay; Tab again moves into its links; Tab past them closes it. |\n| Shift+Tab | From the trigger closes it; from a link inside returns to the trigger. |\n| Escape | Closes it (focus back to the trigger if inside) and stops the event; when closed, Escape passes through. |\n| Enter | Follows the link. |\n\n## Accessibility\n- No ARIA is added to the trigger; it keeps its role, name and behavior.\n- The card is role=group, named after the trigger, and sits right after it in reading and Tab order.\n- Opens on :focus-visible focus after the delay, never after a mouse press or on touch.\n- Mark a card title that repeats the trigger's text aria-hidden so the name is heard once.\n- Forced colors keep a card edge; muted text in examples uses --ui-text-muted (4.5:1).\n",
339
+ "keywords": "Data display UiHoverCard UiHoverCardPanel HoverCardSide HoverCardAlign HoverCardLabels inHoverCorridor A quick look at what a name or link refers to: a person, an agent, a file, a run. Mentions in feeds, logs and tables, where the full page is one click away."
340
+ },
341
+ {
342
+ "slug": "icon-button",
343
+ "name": "Icon Button",
344
+ "description": "A square button that is only an icon: ghost, outlined or solid, two sizes, a pressed state for toggles, and its label as the tooltip.",
345
+ "category": "Buttons",
346
+ "pro": false,
347
+ "entryPoint": "./ui/icon-button",
348
+ "selector": "button[uiIconButton]",
349
+ "url": "/ai/icon-button.json",
350
+ "markdown": "# Icon Button\n\nA square button that is only an icon: ghost, outlined or solid, two sizes, a pressed state for toggles, and its label as the tooltip.\n\nAdd: `npx ochreui@latest add icon-button`\nImport: `import { UiIconButton, UiIconButtonIcon } from './ui/icon-button';`\nSelector: `<button[uiIconButton]>`\nDocs: /components/icon-button\n\n## When to use\n- Toolbar tools whose icon says it all.\n- Quiet actions under a message or on a row: ghost.\n- A tool that stays on: [(pressed)].\n\n## When not to use\n- Unclear icons or the page's main action: use Button.\n- Choosing between views: use Segmented Control.\n- Saved on/off settings: use Switch.\n\n## Usage\n\n```ts\nimport { Component, model, output } from '@angular/core';\nimport { UiIconButton, UiIconButtonIcon } from './ui/icon-button';\n\n@Component({\n selector: 'app-notes-toolbar',\n imports: [UiIconButton, UiIconButtonIcon],\n template: `\n <div class=\"tools\">\n <button type=\"button\" uiIconButton variant=\"secondary\" label=\"Search notes\" (click)=\"search.emit()\">\n <svg uiIconButtonIcon viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.9\" stroke-linecap=\"round\">\n <circle cx=\"11\" cy=\"11\" r=\"6.5\" />\n <path d=\"M20 20l-4.4-4.4\" />\n </svg>\n </button>\n <button type=\"button\" uiIconButton variant=\"secondary\" label=\"Unread only\" [(pressed)]=\"unreadOnly\">\n <svg uiIconButtonIcon viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.9\" stroke-linejoin=\"round\">\n <path d=\"M5 5.5h14A1.5 1.5 0 0 1 20.5 7v8a1.5 1.5 0 0 1-1.5 1.5h-9l-4.5 3.5v-3.5H5A1.5 1.5 0 0 1 3.5 15V7A1.5 1.5 0 0 1 5 5.5z\" />\n </svg>\n </button>\n <button type=\"button\" uiIconButton variant=\"primary\" label=\"New note\" (click)=\"create.emit()\">\n <svg uiIconButtonIcon viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.9\" stroke-linecap=\"round\">\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n </button>\n </div>\n `,\n styles: `\n .tools { display: flex; gap: 6px; }\n `,\n})\nexport class NotesToolbar {\n unreadOnly = model(false);\n search = output();\n create = output();\n}\n```\n\n## Rules\n- Always give a label that says what it does.\n- Keep a toggle's label stable; let pressed carry the state.\n- Put uiIconButtonIcon on the svg, drawn in currentColor.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | required | Accessible name and tooltip. |\n| `variant` | `'ghost' \\| 'secondary' \\| 'primary'` | 'ghost' | Icon only, white with a hairline edge, or dark chip. |\n| `size` | `'sm' \\| 'md'` | 'md' | 24/28px (icons 14/15); Classic 32/40px. |\n| `pressed` | `boolean \\| undefined (model)` | unset | Toggle: aria-pressed, gray fill, flips on click. [(pressed)]. |\n| `title` | `string` | label | Tooltip; \"\" removes it. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `pressedChange` | `boolean` | Emitted when a toggle flips. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-icon-button-press` | `0.94` | Scale while held (Classic 0.95). |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Enter or Space | Clicks it, or flips a toggle. |\n| Tab | Moves to the next control. |\n\n## Accessibility\n- Native <button>; label is aria-label and title.\n- Toggles expose aria-pressed true/false; plain buttons have none.\n- Icon (uiIconButtonIcon) is aria-hidden; announce label swaps like Copied in your own live region.\n- Rest icons ≥ 4.5:1; forced colors keep outlines and highlight pressed toggles.\n- Touch: invisible ring of 36x36 (Classic 42x42) takes the tap.\n",
351
+ "keywords": "Buttons UiIconButton UiIconButtonIcon IconButtonVariant IconButtonSize Toolbar tools whose icon says it all. Quiet actions under a message or on a row: ghost. A tool that stays on: [(pressed)]."
352
+ },
353
+ {
354
+ "slug": "integration-beam",
355
+ "name": "Integration Beam",
356
+ "description": "Your product as a dark hub between the tools it connects, joined by curved beams that carry pulses in from the senders and out to the receivers. Hover or focus a tool to bring its beam forward, click or tap it to pause it.",
357
+ "category": "Illustrations",
358
+ "pro": false,
359
+ "entryPoint": "./ui/integration-beam",
360
+ "selector": "ui-integration-beam",
361
+ "url": "/ai/integration-beam.json",
362
+ "markdown": "# Integration Beam\n\nYour product as a dark hub between the tools it connects, joined by curved beams that carry pulses in from the senders and out to the receivers. Hover or focus a tool to bring its beam forward, click or tap it to pause it.\n\nAdd: `npx ochreui@latest add integration-beam`\nImport: `import { UiIntegrationBeam, UiBeamLogo } from './ui/integration-beam';`\nSelector: `<ui-integration-beam>`\nDocs: /components/integration-beam\n\n## When to use\n- A hero or integrations section showing your product between the tools a team uses.\n- A landing page where a calm self-running flow says \"we connect to these\".\n\n## When not to use\n- A real integration settings page: pausing saves nothing.\n- More than four tools per side: use a logo grid.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiIntegrationBeam } from './ui/integration-beam';\n\n@Component({\n selector: 'app-integrations-section',\n imports: [UiIntegrationBeam],\n template: `\n <section>\n <h2>Fits between the tools you already use</h2>\n <p>Messages, notes and mail come in; deals, tickets and files go out.</p>\n <ui-integration-beam />\n </section>\n `,\n styles: `\n section { max-inline-size: 640px; margin-inline: auto; padding: 48px 0; text-align: center; }\n h2 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; }\n p { margin: 6px 0 40px; color: var(--ui-text-muted); font-size: 15px; line-height: 22px; }\n `,\n})\nexport class IntegrationsSection {}\n```\n\n## Rules\n- Logos come from <ng-template uiBeamLogo=\"Name\"> with the exact tool or hub name.\n- At most four tools per side.\n- Pausing is visual only; read [(paused)] if the page needs it.\n- Below 460px of its own width the scene stacks vertically.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `left` | `BeamTool[]` | Chatline, Notebook, Mailroom | Senders: left of the hub, above it when stacked. |\n| `right` | `BeamTool[]` | Pipeline, Tracker, Vault | Receivers: right of the hub, below it when stacked. |\n| `center` | `BeamHub` | { name: 'Relay' } | Your product; neutral four-petal mark without a logo template. |\n| `label` | `string \\| null` | null | Group name; unset = \"{hub} connected to {tools}\". |\n| `labels` | `Partial<IntegrationBeamLabels>` | {} | Every shown or spoken string; {n} {total} {name} {hub} {tools} are filled in. |\n| `paused` | `string[]` | [] | Names of paused tools; two-way [(paused)]. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `pausedChange` | `string[]` | Emitted when a tool is paused or reconnected. |\n\n## BeamTool\n\n`type BeamTool = { name: string }`\n\n## BeamHub\n\n`type BeamHub = { name: string }`\n\n## IntegrationBeamLabels\n\n`type IntegrationBeamLabels = { connected: string; syncing: string; allPaused: string; paused: string; group: string; announcePaused: string; announceConnected: string }`\n\n## Template: uiBeamLogo\n\nLogo of the tool or hub whose name matches. Tools 28x28, hub 36x36 in currentColor (light on the dark hub). Unmatched names: built-in mark for the sample tools, else the initial. Context: `none`.\n\n```html\n<ng-template uiBeamLogo=\"Relay\">\n <svg viewBox=\"0 0 36 36\" fill=\"currentColor\">…</svg>\n</ng-template>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-integration-beam-line` | `light-dark(color-mix(in srgb, var(--ui-text) 12%, transparent), color-mix(in srgb, var(--ui-text) 7%, transparent))` | Resting beam colour. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Next tool, senders first; its beam comes forward and its name shows. |\n| Enter / Space | Pauses or reconnects the focused tool. |\n\n## Accessibility\n- role=group named after the hub and tools.\n- Each tool is a button named by the tool with aria-pressed (true = connected).\n- Toggles announced politely: \"{name} paused. N of M connected.\"\n- The status chip is visual only (no role=status); only real changes reach the one polite live region.\n- Beams, pulses, glows, logos and name labels are aria-hidden.\n- Forced colors: tiles, hub, chip and labels get a CanvasText edge; paused tiles dashed.\n",
363
+ "keywords": "Illustrations UiIntegrationBeam UiBeamLogo BeamTool BeamHub IntegrationBeamLabels A hero or integrations section showing your product between the tools a team uses. A landing page where a calm self-running flow says \"we connect to these\"."
364
+ },
365
+ {
366
+ "slug": "integration-grid",
367
+ "name": "Integration Grid",
368
+ "description": "A still wall of rounded app tiles, 7 / 9 / 7, around a larger, brighter centre tile with your product mark. The tiles fade gently toward the sides and a hovered logo grows.",
369
+ "category": "Illustrations",
370
+ "pro": false,
371
+ "entryPoint": "./ui/integration-grid",
372
+ "selector": "ui-integration-grid",
373
+ "url": "/ai/integration-grid.json",
374
+ "markdown": "# Integration Grid\n\nA still wall of rounded app tiles, 7 / 9 / 7, around a larger, brighter centre tile with your product mark. The tiles fade gently toward the sides and a hovered logo grows.\n\nAdd: `npx ochreui@latest add integration-grid`\nImport: `import { UiIntegrationGrid, UiIntegrationGridMark } from './ui/integration-grid';`\nSelector: `<ui-integration-grid>`\nDocs: /components/integration-grid\n\n## When to use\n- Integration sections and feature cards: works with the tools you use.\n- Landing pages that put your product at the centre of its ecosystem.\n\n## When not to use\n- A clickable list of integrations: the tiles are a picture, not links.\n- More than 22 logos (16 at 7 columns, 10 at 5): extras are dropped.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiIntegrationGrid, UiIntegrationGridMark } from './ui/integration-grid';\n\n@Component({\n selector: 'app-integrations-section',\n imports: [UiIntegrationGrid, UiIntegrationGridMark],\n template: `\n <section>\n <ui-integration-grid>\n <svg uiIntegrationGridMark viewBox=\"0 0 40 40\" aria-hidden=\"true\">\n <rect width=\"40\" height=\"40\" rx=\"10\" fill=\"#c2410c\" />\n <path d=\"M11 27V13l9 8 9-8v14\" fill=\"none\" stroke=\"#fff\" stroke-width=\"3.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n </svg>\n </ui-integration-grid>\n <h3>Plugs into the tools you already pay for</h3>\n <p>Two-way sync with 22 apps, set up in a few clicks and kept in step every minute.</p>\n </section>\n `,\n styles: `\n section { display: grid; justify-items: center; gap: 8px; max-inline-size: 760px; margin-inline: auto; text-align: center; }\n h3 { margin: 16px 0 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }\n p { max-inline-size: 420px; margin: 0; color: var(--ui-text-muted); font-size: 14px; line-height: 22px; }\n `,\n})\nexport class IntegrationsSection {}\n```\n\n## Rules\n- Import UiIntegrationGridMark with UiIntegrationGrid when you project a centre mark.\n- Each logo is one filled path in a 24×24 viewBox; use darkColor when its colour is too dark or light for dark mode.\n- Set the width with your own class; it caps at 760px and keeps its aspect ratio.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `logos` | `readonly IntegrationGridLogo[]` | INTEGRATION_GRID_LOGOS (22 sample marks) | { name, path, color?, darkColor? }, path in a 24×24 box; filled row by row around the centre. Extras dropped, missing ones leave empty tiles. |\n| `columns` | `5 \\| 7 \\| 9` | 9 | Tiles in the middle row; outer rows hold two fewer. Fewer columns: larger tiles, taller wall. |\n| `label` | `string` | generated | Accessible name. Unset: \"Integrates with\" + the names shown. \"\" hides it as decoration. |\n| `labels` | `Partial<IntegrationGridLabels>` | { integratesWith: \"Integrates with\" } | Words that start the generated label. |\n\n## IntegrationGridLogo\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `name` | `string` | Read out in the generated label. |\n| `path` | `string` | One filled SVG path in a 24×24 box. |\n| `color` | `string?` | Fill. Without it the logo follows the ink. |\n| `darkColor` | `string?` | Fill in dark mode. |\n\n## IntegrationGridLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `integratesWith` | `string` | Starts the generated label. Default \"Integrates with\". |\n\n## Template: uiIntegrationGridMark\n\nYour own <img> or <svg> in the centre tile, at 40% of its width and square. Without it, a neutral mark. Context: `none`.\n\n```html\n<ui-integration-grid>\n <img uiIntegrationGridMark src=\"/mark.svg\" alt=\"\" width=\"40\" height=\"40\" />\n</ui-integration-grid>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-integration-grid-face` | `var(--ui-bg-surface)` | Tile face; fades toward the sides. |\n| `--ui-integration-grid-line` | `color-mix(in srgb, var(--ui-text) 15%, transparent)` | Tile outline; fades slightly toward the sides. |\n| `--ui-integration-grid-centre-face` | `var(--ui-bg-overlay)` | Centre tile face. |\n| `--ui-integration-grid-centre-line` | `color-mix(in srgb, var(--ui-text) 16%, transparent)` | Centre tile outline. |\n| `--ui-integration-grid-ink` | `var(--ui-text)` | Logos without a colour and the default centre mark. |\n\n## Accessibility\n- One role=img named \"Integrates with\" + the logo names; tiles and SVGs aria-hidden.\n- label=\"\" makes it decorative (aria-hidden).\n- Forced colors: tiles keep a CanvasText outline; logos keep their colours.\n",
375
+ "keywords": "Illustrations UiIntegrationGrid UiIntegrationGridMark IntegrationGridLogo IntegrationGridColumns IntegrationGridLabels INTEGRATION_GRID_LOGOS Integration sections and feature cards: works with the tools you use. Landing pages that put your product at the centre of its ecosystem."
376
+ },
377
+ {
378
+ "slug": "kbd",
379
+ "name": "Kbd",
380
+ "description": "A chip for keyboard shortcuts: one key or a whole combo in one chip. mod becomes ⌘ on a Mac and Ctrl elsewhere, and screen readers hear the keys spelled out.",
381
+ "category": "Text",
382
+ "pro": false,
383
+ "entryPoint": "./ui/kbd",
384
+ "selector": "kbd[ui-kbd]",
385
+ "url": "/ai/kbd.json",
386
+ "markdown": "# Kbd\n\nA chip for keyboard shortcuts: one key or a whole combo in one chip. mod becomes ⌘ on a Mac and Ctrl elsewhere, and screen readers hear the keys spelled out.\n\nAdd: `npx ochreui@latest add kbd`\nImport: `import { UiKbd } from './ui/kbd';`\nSelector: `<kbd[ui-kbd]>`\nDocs: /components/kbd\n\n## When to use\n- Next to a menu item or a command, to show its shortcut.\n- On a help sheet or settings page that lists shortcuts.\n- When running text names a key.\n- Inside a tooltip or on a dark button: in the flat look the chip takes its colors from the text around it.\n\n## When not to use\n- A status or a count: use a badge.\n- Code, a shell command or a file path: use inline <code>.\n- Something people click or remove: use a button or a tag.\n- Touch-only screens.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiKbd } from './ui/kbd';\n\n@Component({\n selector: 'app-search-hint',\n imports: [UiKbd],\n template: `\n <span>Search</span>\n <kbd ui-kbd [keys]=\"['mod', 'k']\"></kbd>\n `,\n})\nexport class SearchHint {}\n```\n\n## Rules\n- Write mod, not cmd or ctrl, so each platform sees its own key.\n- List keys in the order they are pressed: modifiers first, then the main key.\n- Use <kbd ui-kbd> on a real kbd element; one chip per shortcut, never one per key and never a '+' between keys.\n- Show shortcuts in menus, tooltips and help sheets, not on every button.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `keys` | `string \\| string[]` | none | One key or a combo in one chip. Named keys: mod, cmd, ctrl, alt, shift, enter, esc, tab, space, backspace, delete, up, down, left, right, pageup, pagedown, home, end. Anything else is shown as written; single letters as capitals. |\n| `size` | `'sm' \\| 'md'` | 'sm' | sm for menus and running text, md for shortcut lists. |\n| `platform` | `'mac' \\| 'other'` | detected | Forces Mac symbols or Windows/Linux words. 'other' during server rendering. |\n| `(content)` | `text` | none | Shown as one plain key when keys is left out; ignored when keys is set. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-kbd-bg` | `faint wash of currentColor; --ui-bg-overlay with data-ui-look=\"tray\"` | Chip fill. |\n| `--ui-kbd-edge` | `faint ring of currentColor; --ui-border with data-ui-look=\"tray\"` | Chip ring. |\n\n## Accessibility\n- A real <kbd>, read in place within the sentence.\n- Glyphs are aria-hidden; visually hidden text spells the keys out (\"Command Shift A\").\n- Not focusable; the app handles the shortcut itself.\n- In forced-colors mode the chip gets a 1px system-color border.\n",
387
+ "keywords": "Text UiKbd KbdPlatform KbdSize KbdKey resolveKey Next to a menu item or a command, to show its shortcut. On a help sheet or settings page that lists shortcuts. When running text names a key. Inside a tooltip or on a dark button: in the flat look the chip takes its colors from the text around it."
388
+ },
389
+ {
390
+ "slug": "layer-stack",
391
+ "name": "Layer Stack",
392
+ "description": "An isometric stack of up to five plates beside a vertical list: the chosen entry lifts its plate out in the accent colour with an icon and a glow, while a card glides behind it. It steps by itself until someone picks.",
393
+ "category": "Illustrations",
394
+ "pro": false,
395
+ "entryPoint": "./ui/layer-stack",
396
+ "selector": "ui-layer-stack",
397
+ "url": "/ai/layer-stack.json",
398
+ "markdown": "# Layer Stack\n\nAn isometric stack of up to five plates beside a vertical list: the chosen entry lifts its plate out in the accent colour with an icon and a glow, while a card glides behind it. It steps by itself until someone picks.\n\nAdd: `npx ochreui@latest add layer-stack`\nImport: `import { UiLayerStack } from './ui/layer-stack';`\nSelector: `<ui-layer-stack>`\nDocs: /components/layer-stack\n\n## When to use\n- Explaining a product or platform built in layers, one entry per layer.\n- Feature sections that walk through capabilities one at a time with a picture that follows.\n\n## When not to use\n- More than five layers: it is drawn for five at most.\n- Navigation that swaps page content: use Tabs.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { LayerStackItem, UiLayerStack } from './ui/layer-stack';\n\n@Component({\n selector: 'app-platform-section',\n imports: [UiLayerStack],\n template: `\n <section>\n <h2>One platform, five layers</h2>\n <p>Each layer does one job. Pick one to see where it sits.</p>\n <ui-layer-stack [items]=\"layers\" />\n </section>\n `,\n styles: `\n section { max-inline-size: 640px; margin-inline: auto; }\n h2 { margin: 0 0 4px; font-size: 20px; }\n p { margin: 0 0 16px; color: var(--ui-text-muted); }\n ui-layer-stack { inline-size: 100%; }\n `,\n})\nexport class PlatformSection {\n protected readonly layers: LayerStackItem[] = [\n { title: 'Fired by any signal', hint: 'Triggers', icon: 'bolt' },\n { title: 'Fed by your own files', hint: 'Sources', icon: 'database' },\n { title: 'Linked to your toolset', hint: 'SDKs', icon: 'plug' },\n { title: 'Runs on every engine', hint: 'Gateway', icon: 'spark' },\n { title: 'Audited at each turn', hint: 'Feed', icon: 'pulse' },\n ];\n}\n```\n\n## Rules\n- Pass at most five items; titles of about 22 characters, hints of one short word.\n- Size it through the host's inline size (at most 560px); the height follows at 3 : 2.\n- Use (picked) for user choices; [(index)] also changes on autoplay steps.\n- Reduced motion or --ui-motion-scale: 0: no autoplay and instant changes.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `items` | `readonly LayerStackItem[]` | LAYER_STACK_ITEMS | Up to five entries, top layer first; any more are left out. |\n| `index` | `number (model)` | 0 | The chosen entry, two-way: follows autoplay steps and picks; clamped to the items. |\n| `interval` | `number` | 2600 | Time on each entry while it steps by itself, in ms. |\n| `label` | `string \\| undefined` | labels.list | The list's accessible name. |\n| `labels` | `Partial<LayerStackLabels>` | English | The list name and how each entry's name is built, for translation. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `picked` | `number` | The index the user picked by click, tap or key; never on autoplay steps. |\n\n## LayerStackItem\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `title` | `string` | Up to two lines: about 22 characters fit on one, longer or translated titles wrap to a second line, and only a third line would end in an ellipsis. |\n| `hint` | `string \\| undefined` | A short word at the end of the row. |\n| `icon` | `LayerStackIcon \\| undefined` | Glyph drawn flat on the chosen plate. |\n\n## LayerStackIcon\n\n`type LayerStackIcon = 'bolt' | 'database' | 'plug' | 'spark' | 'pulse'`\n\n## LayerStackLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `list` | `string` | The list name, used when label is left out (\"Layers\"). |\n| `tab` | `(title: string, hint: string \\| undefined) => string` | Each entry's accessible name (\"title, hint\"). |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-layer-stack-accent` | `var(--ui-accent)` | Chosen plate face, edge, outline, icon, glow and title. |\n| `--ui-layer-stack-face` | `surface 60% (ink 4% dark)` | Faces of the other plates. |\n| `--ui-layer-stack-edge` | `ink 9% (dark: half-opaque canvas with 5% ink)` | Edges of the other plates. |\n| `--ui-layer-stack-tray` | `light-dark(var(--ui-bg-subtle), color-mix(in srgb, var(--ui-bg-canvas) 65%, var(--ui-gray-1050)))` | Tray behind the list. |\n| `--ui-layer-stack-card` | `var(--ui-bg-surface)` | Card behind the chosen entry. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Focus the chosen entry; focus pauses autoplay. |\n| ArrowDown / ArrowUp | Next or previous entry, wrapping; autoplay stops. |\n| Home / End | First or last entry. |\n\n## Accessibility\n- role=tablist (vertical, named by label) of button role=tab with aria-selected and a roving tabindex; no tabpanels.\n- Each tab is named \"title, hint\" once; the SVG stack is aria-hidden.\n- Autoplay pauses on hover (not touch), focus, off-screen and in hidden tabs; stops for good after a pick.\n- Forced colors: the card behind the chosen row keeps a CanvasText outline; focus ring uses the focus-ring token.\n",
399
+ "keywords": "Illustrations UiLayerStack LayerStackItem LayerStackIcon LayerStackLabels LAYER_STACK_ITEMS Explaining a product or platform built in layers, one entry per layer. Feature sections that walk through capabilities one at a time with a picture that follows."
400
+ },
401
+ {
402
+ "slug": "lead-sourcing",
403
+ "name": "Lead Sourcing",
404
+ "description": "A small card illustration: an assistant tile linked by a thin line to a source app on each side, among four fading empty tiles. Every 3.6s a coloured shine runs along the line from left to right.",
405
+ "category": "Illustrations",
406
+ "pro": false,
407
+ "entryPoint": "./ui/lead-sourcing",
408
+ "selector": "ui-lead-sourcing",
409
+ "url": "/ai/lead-sourcing.json",
410
+ "markdown": "# Lead Sourcing\n\nA small card illustration: an assistant tile linked by a thin line to a source app on each side, among four fading empty tiles. Every 3.6s a coloured shine runs along the line from left to right.\n\nAdd: `npx ochreui@latest add lead-sourcing`\nImport: `import { UiLeadSourcing } from './ui/lead-sourcing';`\nSelector: `<ui-lead-sourcing>`\nDocs: /components/lead-sourcing\n\n## When to use\n- A step or feature card about gathering leads or data from a few sources.\n- Integration sections showing your product joined to two apps people already use.\n\n## When not to use\n- Suggesting integrations you do not offer: put your real sources in logos.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiLeadSourcing } from './ui/lead-sourcing';\n\n@Component({\n selector: 'app-prospecting-card',\n imports: [UiLeadSourcing],\n template: `\n <article>\n <ui-lead-sourcing />\n <h3>Leads from where you already work</h3>\n <p>Your assistant reads the inbox and the web, then hands you a short list of people worth a reply.</p>\n </article>\n `,\n styles: `\n article { box-sizing: border-box; inline-size: min(360px, 100%); padding: 8px 8px 20px; border-radius: 20px; background: var(--ui-bg-surface); box-shadow: inset 0 0 0 1px var(--ui-hairline); }\n ui-lead-sourcing { border-radius: 14px; background: var(--ui-bg-canvas); }\n h3 { margin: 16px 12px 4px; color: var(--ui-text); font-size: 16px; line-height: 24px; font-weight: 600; }\n p { margin: 0 12px; color: var(--ui-text-muted); font-size: 14px; line-height: 20px; }\n `,\n})\nexport class ProspectingCard {}\n```\n\n## Rules\n- Three logo slots in order left, centre, right; each path is one filled path in a 24×24 viewBox.\n- The shine runs only on screen in a visible tab and restarts from the left; reduced motion or --ui-motion-scale: 0 keeps it still.\n- Set the width with your own class; it caps at 560px and keeps 3:2.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `logos` | `readonly (LeadSourcingLogo \\| null)[]` | [] | Left, centre and right logos, { name, path, color?, darkColor? }, path in a 24×24 box. Empty or null slots keep the built-in glyphs. |\n| `label` | `string` | generated | Accessible name. Unset: built from labels and the logo names. \"\" hides it as decoration. |\n| `labels` | `Partial<LeadSourcingLabels>` | { scene: \"{center} linked to {left} and {right}, among empty tiles\", center: \"An assistant\", left: \"a mail app\", right: \"a search app\" } | Words of the generated label and the names of the built-in glyphs. |\n\n## LeadSourcingLogo\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `name` | `string` | Read out in the generated label. |\n| `path` | `string` | One filled SVG path in a 24×24 box. |\n| `color` | `string?` | Fill. Without it the logo follows the ink. |\n| `darkColor` | `string?` | Fill in dark mode. |\n\n## LeadSourcingLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `scene` | `string` | Generated label; {left}, {center} and {right} are filled with the names. |\n| `left` | `string` | Name of the built-in left glyph. Default \"a mail app\". |\n| `center` | `string` | Name of the built-in centre glyph. Default \"An assistant\". |\n| `right` | `string` | Name of the built-in right glyph. Default \"a search app\". |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-lead-sourcing-tile` | `var(--ui-bg-surface)` | Tile face. |\n| `--ui-lead-sourcing-edge` | `the text colour at 11% (15% dark)` | Tile outline. |\n| `--ui-lead-sourcing-lip` | `a deeper tone of the tile` | Band along each tile bottom edge. |\n| `--ui-lead-sourcing-line` | `the text colour at 11% (16% dark)` | Resting line. |\n| `--ui-lead-sourcing-ink` | `var(--ui-text)` | Built-in mono glyphs and logos without a colour. |\n| `--ui-lead-sourcing-glow-a` | `var(--ui-hue-pink)` | Glow and centre rim, left end. |\n| `--ui-lead-sourcing-glow-b` | `var(--ui-hue-purple)` | Glow and centre rim, right end. |\n| `--ui-lead-sourcing-shine-tail` | `coral` | Shine tail. |\n| `--ui-lead-sourcing-shine-mid` | `pink-white` | Shine middle. |\n| `--ui-lead-sourcing-shine-head` | `violet` | Shine head. |\n\n## Accessibility\n- One role=img with a generated or custom label; the SVG is aria-hidden.\n- label=\"\" makes it decorative (aria-hidden).\n- Forced colors: tiles get a CanvasText outline, the line GrayText; glow and shine hidden.\n",
411
+ "keywords": "Illustrations UiLeadSourcing LeadSourcingLogo LeadSourcingLabels A step or feature card about gathering leads or data from a few sources. Integration sections showing your product joined to two apps people already use."
412
+ },
413
+ {
414
+ "slug": "logo-cluster",
415
+ "name": "Logo Cluster",
416
+ "description": "Your mark on a large disc with seven logo discs bouncing out of it, then turning slowly around it with every logo upright. Hovering a logo grows it with a springy ease.",
417
+ "category": "Illustrations",
418
+ "pro": false,
419
+ "entryPoint": "./ui/logo-cluster",
420
+ "selector": "ui-logo-cluster",
421
+ "url": "/ai/logo-cluster.json",
422
+ "markdown": "# Logo Cluster\n\nYour mark on a large disc with seven logo discs bouncing out of it, then turning slowly around it with every logo upright. Hovering a logo grows it with a springy ease.\n\nAdd: `npx ochreui@latest add logo-cluster`\nImport: `import { UiLogoCluster, UiLogoClusterMark } from './ui/logo-cluster';`\nSelector: `<ui-logo-cluster>`\nDocs: /components/logo-cluster\n\n## When to use\n- Integration sections: works with the tools you already use.\n- Feature cards that want a lively picture around your own mark.\n\n## When not to use\n- The real list of your integrations: seven logos are a hint.\n- Where people need to read or click the logos.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiLogoCluster } from './ui/logo-cluster';\n\n@Component({\n selector: 'app-connect-card',\n imports: [UiLogoCluster],\n template: `\n <article class=\"card\">\n <ui-logo-cluster label=\"Our app in the middle of the tools it syncs with\" />\n <h3>Plays well with your stack</h3>\n <p>Docs, tickets and calendars stay in step, both ways, a minute after anything changes.</p>\n </article>\n `,\n styles: `\n .card {\n box-sizing: border-box; inline-size: min(360px, 100%); padding: 8px 8px 20px;\n border-radius: 16px; background: var(--ui-bg-surface); box-shadow: inset 0 0 0 1px var(--ui-hairline);\n }\n ui-logo-cluster { inline-size: 100%; }\n h3 { margin: 4px 12px 0; color: var(--ui-text); font-size: 15px; line-height: 22px; font-weight: 600; }\n p { margin: 4px 12px 0; color: var(--ui-text-muted); font-size: 13px; line-height: 20px; }\n `,\n})\nexport class ConnectCard {}\n```\n\n## Rules\n- Square, inline-size min(380px, 100%); set another width with your own class.\n- Entrance once at about a third visible: centre 420 ms, logos 520 ms each from 180 ms, 45 ms apart.\n- Ring turns clockwise once per 48 s from 800 ms, logos counter-rotate to stay upright; pauses off-screen and in hidden tabs and resumes from the same angle.\n- Hover (mouse only) grows a logo disc 1.12x in 260 ms with a springy ease and deepens its shadow.\n- Reduced motion or --ui-motion-scale: 0: everything in place, no turn, hover only deepens the shadow.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | 'The product mark with sample logos bouncing out around it' | Accessible name (role=img). Empty hides it from assistive tech. |\n| `logos` | `readonly LogoClusterLogo[]` | LOGO_CLUSTER_LOGOS (7 sample marks) | { name, path, color?, darkColor? }, path in a 24×24 box; clockwise from the top. First seven used; missing ones leave empty discs. |\n\n## LogoClusterLogo\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `name` | `string` | The logo name (not shown or read out). |\n| `path` | `string` | One filled SVG path in a 24×24 box. |\n| `color` | `string?` | Fill. Without it the logo follows the ink. |\n| `darkColor` | `string?` | Fill in dark mode. |\n\n## Template: uiLogoClusterMark\n\nYour own <img> or <svg> in the centre disc, 34% of its width, keeping its shape. Without it, a neutral mark. Context: `none`.\n\n```html\n<ui-logo-cluster>\n <img uiLogoClusterMark src=\"/mark.svg\" alt=\"\" />\n</ui-logo-cluster>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-logo-cluster-face` | `var(--ui-bg-overlay)` | Disc face. |\n| `--ui-logo-cluster-shadow` | `var(--ui-shadow-sm), 0 8px 20px -8px (scrim at 40%)` | Disc shadow, hairline ring included. |\n| `--ui-logo-cluster-shadow-hover` | `var(--ui-shadow-sm), 0 2px 4px -1px, 0 14px 28px -10px (scrim at 40%)` | Shadow of a hovered logo disc. |\n| `--ui-logo-cluster-ink` | `var(--ui-text)` | Logos without a colour and the default centre mark. |\n\n## Accessibility\n- Host role=img with aria-label from label; ring and centre are aria-hidden, SVGs not focusable.\n- Empty label: aria-hidden host, no role.\n- Sample logos are at least 3:1 on the disc in both themes; forced colors outline every disc.\n",
423
+ "keywords": "Illustrations UiLogoCluster UiLogoClusterMark LogoClusterLogo LOGO_CLUSTER_LOGOS Integration sections: works with the tools you already use. Feature cards that want a lively picture around your own mark."
424
+ },
425
+ {
426
+ "slug": "logo-marquee",
427
+ "name": "Logo Marquee",
428
+ "description": "The endless \"Trusted by\" strip: a seamless loop of logos that eases to a stop on hover or focus, scrubs with inertia, and lifts the hovered logo to its colour.",
429
+ "category": "Blocks",
430
+ "pro": false,
431
+ "entryPoint": "./ui/logo-marquee",
432
+ "selector": "ui-logo-marquee",
433
+ "url": "/ai/logo-marquee.json",
434
+ "markdown": "# Logo Marquee\n\nThe endless \"Trusted by\" strip: a seamless loop of logos that eases to a stop on hover or focus, scrubs with inertia, and lifts the hovered logo to its colour.\n\nAdd: `npx ochreui@latest add logo-marquee`\nImport: `import { UiLogoMarquee, UiLogo } from './ui/logo-marquee';`\nSelector: `<ui-logo-marquee>`\nDocs: /components/logo-marquee\n\n## When to use\n- A \"Trusted by\" strip under a hero or above pricing.\n- More customer, partner or integration logos than fit in one calm row.\n\n## When not to use\n- Three to five logos: a static centred row.\n- Logos people compare or click through: use a grid.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiLogo, UiLogoMarquee } from './ui/logo-marquee';\n\n@Component({\n selector: 'app-trusted-by',\n imports: [UiLogoMarquee, UiLogo],\n template: `\n <section class=\"trusted\">\n <p>Trusted by teams at</p>\n <ui-logo-marquee [rows]=\"2\" [speed]=\"36\" labels=\"beside\" label=\"Companies that use the product\">\n <ng-template uiLogo name=\"Kestro\">\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M12 2.5 22.5 21h-21Z\" /></svg>\n </ng-template>\n <ng-template uiLogo name=\"Tidel\" color=\"var(--ui-hue-blue)\">\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><rect x=\"2\" y=\"4\" width=\"20\" height=\"4\" rx=\"2\" /><rect x=\"5\" y=\"10\" width=\"17\" height=\"4\" rx=\"2\" /><rect x=\"8\" y=\"16\" width=\"14\" height=\"4\" rx=\"2\" /></svg>\n </ng-template>\n <ng-template uiLogo name=\"Lumora\" color=\"var(--ui-hue-amber)\" [scale]=\"0.9\">\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M14.5 2.3a10 10 0 1 0 7.2 12.2A8 8 0 0 1 14.5 2.3Z\" /></svg>\n </ng-template>\n <ng-template uiLogo name=\"Solvane\" color=\"var(--ui-hue-red)\">\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M11 2a9 9 0 0 0-9 9h9ZM13 2a9 9 0 0 1 9 9h-9ZM11 22a9 9 0 0 1-9-9h9ZM13 22a9 9 0 0 0 9-9h-9Z\" /></svg>\n </ng-template>\n <ng-template uiLogo name=\"Vantly\" color=\"var(--ui-hue-cyan)\">\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M2 4h5.5L12 13.5 16.5 4H22L12 21Z\" /></svg>\n </ng-template>\n <ng-template uiLogo name=\"Hexon\" color=\"var(--ui-hue-orange)\" href=\"/customers/hexon\">\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"m12 1.5 9.5 5.25v10.5L12 22.5l-9.5-5.25V6.75Zm0 4.2L6.3 8.85v6.3L12 18.3l5.7-3.15v-6.3Z\" /></svg>\n </ng-template>\n </ui-logo-marquee>\n </section>\n `,\n styles: `\n .trusted { display: grid; gap: 24px; }\n .trusted p { margin: 0; text-align: center; color: var(--ui-text-muted); font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; }\n `,\n})\nexport class TrustedBy {}\n```\n\n## Rules\n- Logos are <ng-template uiLogo>, because the loop stamps each one several times.\n- Give inline SVGs a viewBox and fill=\"currentColor\"; set color for the hover hue.\n- Put the caption outside the strip; use [(paused)] for a visible pause control.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `speed` | `number` | 40 | Pixels per second; the same pace at any width. |\n| `direction` | `LogoMarqueeDirection` | 'left' | First row travel; a second row runs the other way. Physical in RTL too. |\n| `rows` | `1 \\| 2` | 1 | Two rows split the logos alternately (1st, 3rd… / 2nd, 4th…). |\n| `gap` | `number` | 56 | Px between logos; × 0.62 when the strip is 520px wide or less. |\n| `pauseOnHover` | `boolean` | true | Ease to a stop under the mouse. Keyboard focus always stops it. |\n| `grayscale` | `boolean` | true | Muted logos; the hovered one lifts to its colour. Off: full colour, others dim on hover. |\n| `labels` | `LogoMarqueeLabels` | 'none' | Name beside the mark, below it, or for screen readers only. |\n| `label` | `string` | 'Logos of companies using the product' | Accessible name of the region. |\n| `paused` | `boolean (model)` | false | Two-way. Stops the strip; a touch tap toggles it. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `pausedChange` | `boolean` | Emitted when a touch tap toggles paused. |\n\n## LogoMarqueeDirection\n\n`type LogoMarqueeDirection = 'left' | 'right'`\n\n## LogoMarqueeLabels\n\n`type LogoMarqueeLabels = 'none' | 'below' | 'beside'`\n\n## Template: uiLogo\n\nOne logo per <ng-template>, in order. Inputs: name (required), color, scale (1), href, src. Inline SVG fills with currentColor; an empty template uses src, else a letter tile. Context: `none`.\n\n```html\n<ng-template uiLogo name=\"Tidel\" color=\"var(--ui-hue-blue)\" [scale]=\"0.9\" href=\"/customers/tidel\">\n <svg viewBox=\"0 0 24 24\" fill=\"currentColor\">…</svg>\n</ng-template>\n<ng-template uiLogo name=\"Kiteo\" src=\"/logos/kiteo.svg\" />\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-logo-marquee-ink` | `var(--ui-text-muted)` | Marks and names at rest. |\n| `--ui-logo-marquee-fade` | `min(20%, 168px); Classic min(14%, 120px)` | Soft fade width at each end. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Focuses the strip or each linked logo; the strip stops while focus is inside. |\n| ← / → | Glides the logos about 150px, then settles. |\n\n## Accessibility\n- Region named by label; one real list, loop copies aria-hidden with their links out of the tab order.\n- Hover, keyboard focus, a touch tap and the paused model stop the motion (WCAG 2.2.2).\n- One Tab stop without links; with links, each link is a stop and glides clear of the fade.\n- Rest ink is --ui-text-muted; hovered names go to --ui-text.\n- Forced colors: system text colours, fade kept. Reduced motion or --ui-motion-scale: 0: a still, centred, wrapping list.\n",
435
+ "keywords": "Blocks UiLogoMarquee UiLogo LogoMarqueeDirection LogoMarqueeLabels A \"Trusted by\" strip under a hero or above pricing. More customer, partner or integration logos than fit in one calm row."
436
+ },
437
+ {
438
+ "slug": "message-actions",
439
+ "name": "Message Actions",
440
+ "description": "The quiet row under an assistant answer: copy turns into a check, regenerate spins and unfolds a version switcher, thumbs pop and thumbs down asks what went wrong, and read aloud becomes a small equalizer. Faded until the message is hovered or focused.",
441
+ "category": "Chat",
442
+ "pro": false,
443
+ "entryPoint": "./ui/message-actions",
444
+ "selector": "ui-message-actions",
445
+ "url": "/ai/message-actions.json",
446
+ "markdown": "# Message Actions\n\nThe quiet row under an assistant answer: copy turns into a check, regenerate spins and unfolds a version switcher, thumbs pop and thumbs down asks what went wrong, and read aloud becomes a small equalizer. Faded until the message is hovered or focused.\n\nAdd: `npx ochreui@latest add message-actions`\nImport: `import { UiMessageActions, UiMessage, UiMessageText, UiMessageTip, UiMessageVersions, UiMessageFeedback } from './ui/message-actions';`\nSelector: `<ui-message-actions>`\nDocs: /components/message-actions\n\n## When to use\n- Under each assistant answer in a chat: copy, try again, rate, listen.\n- Where a model can answer more than once and people flip between answers.\n- Collecting feedback on answers with a reason, not only a thumb.\n\n## When not to use\n- Under the person's own messages: use edit and delete.\n- A long list of actions: keep these four, put the rest in a menu.\n- While the answer streams: show a stop button, then the bar.\n\n## Usage\n\n```ts\nimport { Component, computed, input, signal } from '@angular/core';\nimport { MessageFeedback, MessageVote, UiMessage, UiMessageActions, UiMessageText } from './ui/message-actions';\n\n@Component({\n selector: 'app-assistant-message',\n imports: [UiMessage, UiMessageActions, UiMessageText],\n template: `\n <!-- uiMessage lights the quiet bar while anything in the message is hovered or focused -->\n <article uiMessage>\n <p uiMessageText [version]=\"v()\">{{ versions()[v()] }}</p>\n <ui-message-actions [text]=\"versions()[v()]\" [versions]=\"versions()\" [(version)]=\"picked\"\n [vote]=\"votes()[v()] ?? null\" (regenerate)=\"retry()\" (feedback)=\"save($event)\" />\n </article>\n `,\n})\nexport class AssistantMessage {\n readonly versions = input.required<string[]>();\n protected readonly picked = signal<number | undefined>(undefined);\n protected readonly v = computed(() => this.picked() ?? this.versions().length - 1);\n protected readonly votes = signal<Record<number, MessageVote>>({});\n\n protected save({ kind, reason }: MessageFeedback): void {\n this.votes.update((all) => ({ ...all, [this.v()]: kind }));\n console.log('feedback', this.v(), kind, reason);\n }\n\n protected retry(): void {\n console.log('ask the model for another version');\n }\n}\n```\n\n## Rules\n- Put uiMessage on the wrapper of one answer so the quiet bar lights on hover and focus.\n- Keep versions per message; after regenerating, append the new text and the bar jumps to it.\n- feedback fires twice for thumbs down with a reason: upsert by message and version.\n- The bar does not speak: bind [(speaking)] and drive speechSynthesis yourself, or leave it unbound for a timed state.\n- With translated reasons, set otherReason to the one that opens the text field.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `text` | `string` | '' | Message text; Copy writes it, an unbound read aloud is timed by it. |\n| `actions` | `readonly MessageActionKey[]` | ['copy', 'regenerate', 'feedback', 'speak'] | Which actions show, in order; feedback is both thumbs. |\n| `versions` | `number \\| readonly string[]` | 1 | All versions or their count; from 2 the switcher unfolds. |\n| `version` | `number \\| undefined (model)` | undefined (newest) | Shown version, 0-based; jumps to each new version. |\n| `regenerating` | `boolean` | false | Spins the arrow, keeps the bar lit, ignores presses. |\n| `vote` | `'up' \\| 'down' \\| null (model)` | null | Vote on the shown version; cleared on Regenerate and new versions. |\n| `reasons` | `readonly string[]` | ['Not accurate', 'Too long', \"Didn't follow instructions\", 'Other'] | Quick reasons in the feedback row; single choice. |\n| `otherReason` | `string \\| null` | 'Other' | Reason that unfolds a text field whose words are sent. |\n| `speaking` | `boolean \\| undefined (model)` | undefined | Read aloud playing; bind to drive speech, unbound it stops on its own. |\n| `speakDuration` | `number (ms)` | max(2600, 60 × characters) | How long an unbound read aloud plays. |\n| `quiet` | `boolean` | true | Faded (0.6) until the message or bar is hovered or focused; never on touch. |\n| `label` | `string` | labels.bar | Accessible name of the bar. |\n| `labels` | `Partial<MessageActionsLabels>` | English | Every visible and spoken string. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `copied` | `string` | After a successful copy, with the text. |\n| `regenerate` | `void` | Regenerate pressed; add a version to versions. |\n| `feedback` | `MessageFeedback` | { kind } at once (null when taken back), then { kind: 'down', reason } on Send. |\n| `versionChange` | `number \\| undefined` | A version was picked or added. |\n| `voteChange` | `'up' \\| 'down' \\| null` | The vote changed. |\n| `speakingChange` | `boolean \\| undefined` | Read aloud started or stopped. |\n\n## MessageActionKey\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `(union)` | `'copy' \\| 'regenerate' \\| 'feedback' \\| 'speak'` | One action of the bar. |\n\n## MessageFeedback\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `kind` | `'up' \\| 'down' \\| null` | The vote. |\n| `reason` | `string` | Set on Send: the picked reason or the typed words. |\n\n## MessageActionsLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `bar, copy, copyTip, copied, copyFailed, regenerate, regenerateTip, writing, regenerating, versions, previous, next, good, bad, thanks, markedGood, markedBad, ask, close, send, sent, otherPlaceholder, otherLabel, read, stop, stopTip, reading, finished, stopped` | `string` | Names, tooltips, row texts and live announcements. |\n| `versionOf` | `(n: number, total: number) => string` | \"Version 2 of 3\". |\n\n## UiMessage\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `[uiMessage]` | `directive` | Marks one answer; hover or focus inside lights the bar. |\n\n## UiMessageText\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `version` | `unknown` | Changing it crossfades the text and eases the height. |\n| `busy` | `boolean` | Mutes the text and pulses it while a version is written. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-message-actions-quiet` | `0.6` | Bar opacity at rest. |\n| `--ui-message-actions-size` | `28px (Classic 30px, touch 36px)` | Button size. |\n| `--ui-message-actions-bars` | `var(--ui-info)` | Read-aloud equalizer colour. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Copy, Regenerate, version arrows, thumbs, Read aloud, then the open row: close, reasons, Send, field. |\n| Enter / Space | Presses an action, toggles a reason, sends. |\n| Enter in the field | Sends with the typed words. |\n| Esc | Closes the row from inside it or from thumbs down; focus to thumbs down; vote kept. |\n\n## Accessibility\n- role=group named by label; thumbs and Read aloud use aria-pressed; thumbs down has aria-expanded and aria-controls.\n- Tooltips are aria-hidden and also show on keyboard focus.\n- Polite live region: Copied, Regenerating, Version n of m, votes, Thanks for the feedback, reading states. Copy keeps its name.\n- End arrows use aria-disabled and stay focusable; the closed row and field are inert; focus returns to thumbs down when the row folds.\n- Forced colors: pressed and picked use Highlight; chips, Send, field and tooltips keep an edge.\n",
447
+ "keywords": "Chat UiMessageActions UiMessage UiMessageText UiMessageTip UiMessageVersions UiMessageFeedback MessageActionKey MessageVote MessageFeedback MessageActionsLabels Under each assistant answer in a chat: copy, try again, rate, listen. Where a model can answer more than once and people flip between answers. Collecting feedback on answers with a reason, not only a thumb."
448
+ },
449
+ {
450
+ "slug": "model-orbit",
451
+ "name": "Model Orbit",
452
+ "description": "A slanted model-gateway illustration: model makers on a tilted track around a hub, wired to it by blue beams with sparks running in; drag or use the arrow keys to turn it, point at a logo for its name.",
453
+ "category": "Illustrations",
454
+ "pro": false,
455
+ "entryPoint": "./ui/model-orbit",
456
+ "selector": "ui-model-orbit",
457
+ "url": "/ai/model-orbit.json",
458
+ "markdown": "# Model Orbit\n\nA slanted model-gateway illustration: model makers on a tilted track around a hub, wired to it by blue beams with sparks running in; drag or use the arrow keys to turn it, point at a logo for its name.\n\nAdd: `npx ochreui@latest add model-orbit`\nImport: `import { UiModelOrbit, UiModelOrbitLogo } from './ui/model-orbit';`\nSelector: `<ui-model-orbit>`\nDocs: /components/model-orbit\n\n## When to use\n- A hero or feature section about one gateway, router or SDK that reaches many AI models or providers.\n- Wide cards and landing sections that want a calm illustration with a little life in it.\n\n## When not to use\n- Small cards: it is wide (16 : 9) and the logos need room.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiModelOrbit } from './ui/model-orbit';\n\n@Component({\n selector: 'app-gateway-hero',\n imports: [UiModelOrbit],\n template: `\n <section class=\"hero\">\n <h2>One endpoint, every model</h2>\n <p>Route each request to the model that fits it, and switch providers without touching your code.</p>\n <ui-model-orbit class=\"orbit\" />\n </section>\n `,\n styles: `\n .hero { box-sizing: border-box; max-inline-size: 960px; margin-inline: auto; padding: 32px 16px; text-align: center; }\n h2 { margin: 0; color: var(--ui-text); font-size: 24px; line-height: 32px; font-weight: 600; }\n p { margin: 8px auto 0; max-inline-size: 460px; color: var(--ui-text-muted); font-size: 14px; line-height: 22px; }\n .orbit { margin: 8px auto 0; }\n `,\n})\nexport class GatewayHero {}\n```\n\n## Rules\n- 16 : 9 box, inline-size min(760px, 100%) on a 960 × 540 viewBox; set another width with your own class.\n- One root width of drag = 180° of turn; release glides with geometric decay, no snapping.\n- Tooltip only for mouse pointers on hover-capable devices; 140 ms fade and 4 px rise, removed instantly.\n- Sparks pause off-screen and in hidden tabs and restart from scratch when back.\n- Reduced motion or --ui-motion-scale: 0: no sparks, no glide, no tooltip animation.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `models` | `readonly ModelOrbitItem[]` | MODEL_ORBIT_DEFAULTS: eight invented makers (Aurelia … Pike) | Makers around the ring, evenly spaced, the first in front. Clamped to 12; with none only the track and hub are drawn. |\n| `numbers` | `boolean` | true | Shows the small zero-padded numbers beside the tiles. |\n| `draggable` | `boolean` | true | Drag sideways or press ←/→ (when focused) to turn the ring; it glides to a stop. Off: not focusable, normal cursor, ring fixed; sparks still run. |\n| `label` | `string` | 'A ring of AI model makers, each wired to a central hub – drag or use the arrow keys to spin it' | Accessible name (role=img). Empty makes it decorative: aria-hidden and not focusable. |\n\n## ModelOrbitItem\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `name` | `string` | Shown in the tooltip. |\n| `logo` | `string \\| undefined` | Image URL drawn in the 24 × 24 logo box. |\n\n## ModelOrbitLogoContext\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `$implicit` | `ModelOrbitItem` | The model of this tile. |\n| `index` | `number` | Its position in models. |\n\n## Template: uiModelOrbitLogo\n\nDraws every tile's logo in its 24 × 24 box, leaning back with the tile. A model with a logo URL uses the image instead. Context: `{ $implicit: ModelOrbitItem; index: number }`.\n\n```html\n<ui-model-orbit [models]=\"models\">\n <ng-template uiModelOrbitLogo let-model>\n <svg viewBox=\"0 0 24 24\">…</svg>\n </ng-template>\n</ui-model-orbit>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-model-orbit-beam` | `blue (--ui-blue-light; deeper mix in dark)` | Beams, thin rings and the hub mark. |\n| `--ui-model-orbit-spark` | `blue (brighter mix in dark)` | Sparks. |\n| `--ui-model-orbit-halo` | `blue at 15% (20% dark)` | Glow around the hub, fading to its edge. |\n| `--ui-model-orbit-track` | `text colour at 4% (5% dark)` | The tilted track. |\n| `--ui-model-orbit-tile` | `light-dark(--ui-bg-surface, canvas + 8% text)` | Tile fill. |\n| `--ui-model-orbit-hub` | `light-dark(--ui-bg-surface, darkened canvas)` | Hub puck. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Focuses the illustration (ring on :focus-visible only). |\n| ArrowLeft / ArrowRight | Turns the ring half a step (180°/n) at once; → moves the front tiles right. Not mirrored in RTL. |\n\n## Accessibility\n- Host role=img with aria-label from label, tabindex=0 when draggable; the SVG and tooltip are aria-hidden.\n- Empty label: aria-hidden host, no role, no tabindex.\n- Numbers use --ui-text-muted; forced colors give the tooltip a system border and background.\n",
459
+ "keywords": "Illustrations UiModelOrbit UiModelOrbitLogo ModelOrbitItem ModelOrbitLogoContext MODEL_ORBIT_DEFAULTS A hero or feature section about one gateway, router or SDK that reaches many AI models or providers. Wide cards and landing sections that want a calm illustration with a little life in it."
460
+ },
461
+ {
462
+ "slug": "model-wheel",
463
+ "name": "Model Wheel",
464
+ "description": "Model names on a turning drum: the middle row sits on a soft fill, the rows above and below bend away and fade, and every hold the next one rolls in from above on a spring. Drag or flick it; hovering holds it.",
465
+ "category": "Illustrations",
466
+ "pro": false,
467
+ "entryPoint": "./ui/model-wheel",
468
+ "selector": "ui-model-wheel",
469
+ "url": "/ai/model-wheel.json",
470
+ "markdown": "# Model Wheel\n\nModel names on a turning drum: the middle row sits on a soft fill, the rows above and below bend away and fade, and every hold the next one rolls in from above on a spring. Drag or flick it; hovering holds it.\n\nAdd: `npx ochreui@latest add model-wheel`\nImport: `import { UiModelWheel } from './ui/model-wheel';`\nSelector: `<ui-model-wheel>`\nDocs: /components/model-wheel\n\n## When to use\n- Feature cards about picking or routing between models, or bringing your own.\n- Landing pages showing the supported models in a calm, moving way.\n\n## When not to use\n- A real model picker: it reports no choice. Use Select or Segmented Control.\n- Long lists: about seven rows show at a time.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiModelWheel } from './ui/model-wheel';\n\n@Component({\n selector: 'app-models-card',\n imports: [UiModelWheel],\n template: `\n <article class=\"card\">\n <ui-model-wheel />\n <h3>Every model, one dashboard</h3>\n <p>Switch per task, compare answers side by side, and keep one bill.</p>\n </article>\n `,\n styles: `\n .card {\n box-sizing: border-box; inline-size: min(360px, 100%); padding: 0 0 20px;\n border-radius: 16px; background: var(--ui-bg-surface); box-shadow: inset 0 0 0 1px var(--ui-hairline);\n }\n ui-model-wheel { inline-size: 100%; }\n h3 { margin: 0 20px; color: var(--ui-text); font-size: 15px; line-height: 22px; font-weight: 600; }\n p { margin: 4px 20px 0; color: var(--ui-text-muted); font-size: 13px; line-height: 20px; }\n `,\n})\nexport class ModelsCard {}\n```\n\n## Rules\n- inline-size min(360px, 100%), block-size 308px: 7 rows of 44px, 20 degrees apart on a 124.76px radius, perspective 560px, opacity cos(angle)^1.6.\n- Turns one row down every hold ms on a spring (damping 0.69, 8 rad/s); the fill eases to the new name width over 420 ms.\n- Drag: 44px per row with a magnetic detent; release projects 0.14 s of velocity and springs (0.7, 13 rad/s) to the nearest row.\n- Pauses off-screen and in hidden tabs; a fresh hold on return.\n- Reduced motion or --ui-motion-scale: 0: no auto turn, release lands at once, fill instant.\n- Fewer than 8 models: rows fade out before the wrap at n x 10 degrees.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `models` | `readonly ModelWheelItem[]` | MODEL_WHEEL_DEFAULTS (8 sample models) | Rows from the top: { name, path, color?, darkColor?, viewBox? = '0 0 24 24' }, one path per mark; without a colour the mark follows the text. Use at least seven. |\n| `hold` | `number` | 1500 | Milliseconds a model rests in the middle. |\n| `label` | `string` | 'Model names rolling past on a drum, each one landing in the middle' | Accessible name (role=img). Empty hides it from assistive tech. |\n\n## ModelWheelItem\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `name` | `string` | Row text. |\n| `path` | `string` | One SVG path for the mark. |\n| `color` | `string (optional)` | Mark fill: any CSS colour. Left out, the mark follows the row's text colour. |\n| `darkColor` | `string (optional)` | Mark fill in dark mode. Default: color. |\n| `viewBox` | `string (optional)` | The mark's SVG viewBox. Default: '0 0 24 24'. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-model-wheel-fill` | `light-dark(var(--ui-bg-muted), color-mix(in srgb, var(--ui-bg-muted) 62%, var(--ui-bg-canvas)))` | Fill behind the middle row. |\n| `--ui-model-wheel-radius` | `var(--ui-radius-lg)` | Corners of the fill. |\n\n## Accessibility\n- Host role=img with aria-label from label; fill and drum aria-hidden, mark SVGs not focusable.\n- Empty label: aria-hidden host, no role.\n- Side rows use --ui-text-muted before the fade; sample marks are at least 3:1 on the page in both themes.\n- Mouse hover holds it; forced colors outline the fill.\n",
471
+ "keywords": "Illustrations UiModelWheel ModelWheelItem MODEL_WHEEL_DEFAULTS Feature cards about picking or routing between models, or bringing your own. Landing pages showing the supported models in a calm, moving way."
472
+ },
473
+ {
474
+ "slug": "notification-stack",
475
+ "name": "Notification Stack",
476
+ "description": "A small deck of notice cards: only the front one is readable, two blank edges peek out below it, and its × flicks it aside while the next card settles forward. Badge, title, text, one action and a faint corner drawing per card.",
477
+ "category": "Feedback",
478
+ "pro": false,
479
+ "entryPoint": "./ui/notification-stack",
480
+ "selector": "ui-notification-stack",
481
+ "url": "/ai/notification-stack.json",
482
+ "markdown": "# Notification Stack\n\nA small deck of notice cards: only the front one is readable, two blank edges peek out below it, and its × flicks it aside while the next card settles forward. Badge, title, text, one action and a faint corner drawing per card.\n\nAdd: `npx ochreui@latest add notification-stack`\nImport: `import { UiNotificationStack, UiNotice, UiNoticeAction } from './ui/notification-stack';`\nSelector: `<ui-notification-stack>`\nDocs: /components/notification-stack\n\n## When to use\n- A few announcements in one spot: releases, maintenance windows, invitations.\n- Toast-like messages that stay until closed.\n\n## When not to use\n- Messages that need an answer first: use Dialog.\n- Many notifications at once: past three or four, use an inbox or activity list.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { UiNotice, UiNotificationStack } from './ui/notification-stack';\n\n@Component({\n selector: 'app-whats-new',\n imports: [UiNotificationStack],\n template: `\n <ui-notification-stack [(notices)]=\"notices\" (dismissed)=\"markRead($event)\" (action)=\"open($event)\" />\n `,\n})\nexport class WhatsNew {\n protected readonly notices = signal<readonly UiNotice[]>([\n {\n id: 'maintenance',\n badge: 'Notice',\n title: 'Planned maintenance',\n text: 'Sync pauses on Saturday from 01:00 to 01:30 UTC. Nothing is lost.',\n action: { label: 'Status page', href: 'https://status.example.com', external: true },\n pattern: 'grid',\n },\n {\n id: 'shortcuts',\n badge: 'New',\n title: 'Keyboard shortcuts everywhere',\n text: 'Press ? on any page to see what you can do without the mouse.',\n action: { label: 'Show shortcuts' },\n pattern: 'rings',\n },\n ]);\n\n protected markRead(notice: UiNotice) {\n console.log('read', notice.id);\n }\n\n protected open(notice: UiNotice) {\n console.log('open', notice.id);\n }\n}\n```\n\n## Rules\n- Give every notice a unique id and a title.\n- Bind [(notices)] to keep your list in sync; with [notices] alone dismissed cards still leave the stack.\n- Only three cards render; keep the list short.\n- An action never dismisses; remove the notice yourself if it should.\n- Host width, colour and font are inline: set width with --ui-notification-stack-width, not CSS width on the element.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `notices` | `readonly UiNotice[] (model)` | [] | Cards, front first; [(notices)] gets the list back without a dismissed notice after its exit. |\n| `labels` | `Partial<NotificationStackLabels>` | English | Translations: region(count), dismiss(title), newTab, empty. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `dismissed` | `UiNotice` | The × was used; fires at the click, before the exit ends. |\n| `action` | `UiNotice` | The action was clicked (button or link); does not dismiss. |\n| `noticesChange` | `readonly UiNotice[]` | The list without the dismissed notice, about 350ms after the click. |\n\n## UiNotice\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | `string` | Unique within the stack. |\n| `title` | `string` | Heading; names the card and its × button. |\n| `badge` | `string` | Short small-caps word above the title. |\n| `text` | `string` | A line or two; line breaks kept. |\n| `action` | `UiNoticeAction` | One button, or a link with href. |\n| `pattern` | `NoticePattern` | Faint corner drawing; none by default. |\n\n## UiNoticeAction\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `label` | `string` | Button or link text. |\n| `href` | `string` | Makes it a link; without it a button that emits (action). |\n| `external` | `boolean` | New tab, trailing arrow and a spoken new-tab hint. |\n\n## NoticePattern\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `value` | `'rings' \\| 'grid' \\| 'rays' \\| 'none'` | Concentric rings, a grid with one tinted cell, or rays from the corner. |\n\n## NotificationStackLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `region` | `(count: number) => string` | Region name; default \"Notifications, 3\". |\n| `dismiss` | `(title: string) => string` | × button name; default \"Dismiss {title}\". |\n| `newTab` | `string` | Hidden hint after external links. |\n| `empty` | `string` | Announced when the last notice goes. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-notification-stack-width` | `380px` | Widest the stack gets; shrinks to its container. |\n| `--ui-notification-stack-radius` | `calc(var(--ui-radius-md) + 2px + 10px * tray)` | Card corners: 10, Classic 20. |\n| `--ui-notification-stack-peek` | `12px` | How far each back card shows below the one in front. |\n| `--ui-notification-stack-scale` | `0.05` | How much narrower each back card is per layer. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab / Shift+Tab | Front card: × then action; back cards skipped. |\n| Enter / Space | Dismisses, or runs the action. |\n\n## Accessibility\n- Region named with the count (\"Notifications, 3\"); each card an article named by its title.\n- Back and leaving cards are aria-hidden and inert.\n- After a dismiss focus moves to the next card's ×; when empty, to the stack, with a polite \"No more notifications\".\n- External links carry a hidden new-tab hint and rel=noopener noreferrer.\n- Forced colors: cards and badges keep an outline; drawings hidden.\n",
483
+ "keywords": "Feedback UiNotificationStack UiNotice UiNoticeAction NoticePattern NotificationStackLabels A few announcements in one spot: releases, maintenance windows, invitations. Toast-like messages that stay until closed."
484
+ },
485
+ {
486
+ "slug": "number-input",
487
+ "name": "Number Input",
488
+ "description": "One number with − and + that repeat while held, arrow and Page keys, bounds and a step, a unit, and locale formatting. It shows \"32,000\" while your form gets 32000, with signal forms, reactive forms or ngModel.",
489
+ "category": "Inputs",
490
+ "pro": false,
491
+ "entryPoint": "./ui/number-input",
492
+ "selector": "ui-number-input",
493
+ "url": "/ai/number-input.json",
494
+ "markdown": "# Number Input\n\nOne number with − and + that repeat while held, arrow and Page keys, bounds and a step, a unit, and locale formatting. It shows \"32,000\" while your form gets 32000, with signal forms, reactive forms or ngModel.\n\nAdd: `npx ochreui@latest add number-input`\nImport: `import { UiNumberInput, UiNumber, UiNumberInputPrefix } from './ui/number-input';`\nSelector: `<ui-number-input>`\nDocs: /components/number-input\n\n## When to use\n- Counts and amounts that change in steps: replicas, seats, limits, budgets.\n- Bounded settings where − / + beat typing.\n\n## When not to use\n- Phone or card numbers: use Text Field.\n- A few fixed values: use Segmented Control or Select.\n- A rough value on a range: use Slider.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form, max, min } from '@angular/forms/signals';\nimport { UiNumber, UiNumberInput } from './ui/number-input';\n\n@Component({\n selector: 'app-run-limits',\n imports: [UiNumberInput, UiNumber, FormField],\n template: `\n <ui-number-input label=\"Max tokens per run\" unit=\"tokens\" hint=\"The answer stops here.\">\n <input uiNumberInput [formField]=\"f.maxTokens\" step=\"1000\" />\n </ui-number-input>\n <ui-number-input label=\"Budget per run\" prefix=\"$\">\n <input uiNumberInput [formField]=\"f.budget\" step=\"5\" [format]=\"money\" />\n </ui-number-input>\n `,\n})\nexport class RunLimits {\n protected readonly money: Intl.NumberFormatOptions = { minimumFractionDigits: 2, maximumFractionDigits: 2 };\n private readonly model = signal({ maxTokens: 32000, budget: 25 });\n protected readonly f = form(this.model, (p) => {\n min(p.maxTokens, 1000);\n max(p.maxTokens, 200000);\n min(p.budget, 0);\n max(p.budget, 100);\n });\n}\n```\n\n## Rules\n- Put uiNumberInput on your own <input> inside ui-number-input; bind [formField], formControl, ngModel or [(value)].\n- With [formField], set bounds in the schema (min(), max()), not as attributes.\n- The form value is a number or null; the input shows it formatted.\n- Use name for native form submission; the visible input submits nothing.\n- Pass the error string you want shown; the field doesn't read form state itself.\n- With [formField], don't set name: signal forms set it from the field.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | none | Above the input; clicking focuses it. |\n| `hint` | `string` | none | Quiet line under the input; the error replaces it. |\n| `error` | `string \\| null \\| undefined` | none | Invalid state: red edge, aria-invalid, message in place of the hint. |\n| `prefix` | `string` | none | Quiet text before the value ($). Icons: uiNumberInputPrefix. |\n| `unit` | `string` | none | Quiet text after the value (tokens); part of the value text. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | 'md' | 28/32/36px; Classic 32/36/40; touch 36/40/44 with 16px text. |\n| `optional` | `boolean` | false | \"Optional\" after the label, also spoken. |\n| `labels` | `Partial<NumberInputLabels>` | English | Translations: optional, decrease, increase. |\n| `value (UiNumber)` | `number \\| null (model)` | null | The number; [(value)], [value] with (valueChange), or a form binding. |\n| `min / max (UiNumber)` | `number` | none | Bounds; typed values are clamped on commit. Signal forms: schema min()/max(). |\n| `step (UiNumber)` | `number` | 1 | Step size; steps land on multiples counted from min. |\n| `largeStep (UiNumber)` | `number` | step × 10 | Page Up / Page Down step. |\n| `format (UiNumber)` | `Intl.NumberFormatOptions` | up to 3 decimals | Display format; the value is rounded to what is shown. percent: 0.25 shows 25%. For money use prefix=\"$\" with fixed decimals, not style: 'currency'. |\n| `locale (UiNumber)` | `string` | LOCALE_ID | Display and typing locale. |\n| `name (UiNumber)` | `string` | none | Submits the plain number through a hidden input. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `valueChange (UiNumber)` | `number \\| null` | After a step, a commit (Enter, blur) or a native form reset; not when a form or [value] writes the number. |\n\n## NumberInputLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `optional` | `string` | Tag after the label. |\n| `decrease` | `string` | − button. |\n| `increase` | `string` | + button. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-text-field-edge` | `var(--ui-hairline)` | Resting edge (shared with Text Field). |\n| `--ui-text-field-edge-hover` | `text at 18%` | Hover edge. |\n| `--ui-text-field-edge-focus` | `var(--ui-border-input)` | Focused edge, ≥ 3:1. |\n| `--ui-text-field-radius` | `7px` | Corners (Classic 10px). |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| ↑ / ↓ | One step, onto the step grid. |\n| Page Up / Page Down | Large step. |\n| Home / End | Min / max when set. |\n| Enter | Commit: parse, clamp, format. |\n| Esc | Undo an uncommitted edit; stops there. |\n| Tab | Commit and move on; − and + are skipped. |\n\n## Accessibility\n- role=spinbutton with aria-valuenow/min/max and a value text with prefix and unit.\n- − / + named Decrease / Increase, aria-controls the input, aria-disabled at limits, tabindex -1.\n- inputmode numeric or decimal.\n- Hint/error in aria-describedby (merged with yours); error sets aria-invalid and is announced.\n- Text ≥ 4.5:1, focus edge ≥ 3:1; forced colors keep edge and focus outline.\n",
495
+ "keywords": "Inputs UiNumberInput UiNumber UiNumberInputPrefix NumberInputSize NumberInputLabels Counts and amounts that change in steps: replicas, seats, limits, budgets. Bounded settings where − / + beat typing."
496
+ },
497
+ {
498
+ "slug": "number-ticker",
499
+ "name": "Number Ticker",
500
+ "description": "Odometer numbers: every digit rolls to its new value, up or down, and the figure counts in from zero the first time it scrolls into view. Formatted with Intl.NumberFormat; size, weight and colour come from the text around it.",
501
+ "category": "Motion",
502
+ "pro": false,
503
+ "entryPoint": "./ui/number-ticker",
504
+ "selector": "ui-number-ticker",
505
+ "url": "/ai/number-ticker.json",
506
+ "markdown": "# Number Ticker\n\nOdometer numbers: every digit rolls to its new value, up or down, and the figure counts in from zero the first time it scrolls into view. Formatted with Intl.NumberFormat; size, weight and colour come from the text around it.\n\nAdd: `npx ochreui@latest add number-ticker`\nImport: `import { UiNumberTicker } from './ui/number-ticker';`\nSelector: `<ui-number-ticker>`\nDocs: /components/number-ticker\n\n## When to use\n- KPIs, prices and counters that change while people watch: dashboards, live stats.\n- Headline figures that should count in as they scroll into view.\n\n## When not to use\n- Dense tables of numbers: rolling digits everywhere is noise.\n- Values that change several times a second: the roll never settles.\n\n## Usage\n\n```ts\nimport { Component, input } from '@angular/core';\nimport { UiNumberTicker } from './ui/number-ticker';\n\n@Component({\n selector: 'app-revenue-kpi',\n imports: [UiNumberTicker],\n template: `\n <p class=\"label\">Net revenue</p>\n <p class=\"kpi\">\n <ui-number-ticker [value]=\"revenue()\" [format]=\"{ style: 'currency', currency: 'USD', maximumFractionDigits: 0 }\" />\n </p>\n `,\n styles: `\n .label { margin: 0; color: var(--ui-text-muted); font-size: 13px; }\n .kpi { margin: 4px 0 0; font-size: 36px; font-weight: 600; letter-spacing: -0.03em; }\n `,\n})\nexport class RevenueKpi {\n readonly revenue = input.required<number>();\n}\n```\n\n## Rules\n- Size, weight and colour come from the parent: style the element around it.\n- Use live=\"off\" when many tickers update together.\n- Not a form control: bind value with a plain input.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `value` | `number` | required | The number shown; changes roll to the new value. |\n| `format` | `Intl.NumberFormatOptions` | {} | Currency, percent, compact, fraction digits, sign display. |\n| `locale` | `string` | LOCALE_ID | Locale for Intl.NumberFormat, e.g. en-US or de-DE. |\n| `duration` | `number` | 900 | Length of one roll in ms. |\n| `delay` | `number` | 0 | Wait before the first count-in in ms. |\n| `live` | `'polite' \\| 'off'` | 'polite' | Announce the final value once per change, or stay quiet (dashboards). |\n\n## NumberTickerLive\n\n`type NumberTickerLive = 'polite' | 'off'`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-number-ticker-fade` | `20%` | Soft fade at the top and bottom of each digit window. |\n\n## Accessibility\n- Hidden text with the formatted value in a polite live region, announced once per change.\n- The digit columns are aria-hidden.\n- Digits stay left to right in RTL pages; right-to-left formatted output falls back to plain text.\n- Inherits the text colour, also in forced colors.\n",
507
+ "keywords": "Motion UiNumberTicker NumberTickerLive KPIs, prices and counters that change while people watch: dashboards, live stats. Headline figures that should count in as they scroll into view."
508
+ },
509
+ {
510
+ "slug": "otp-input",
511
+ "name": "OTP Input",
512
+ "description": "A verification code drawn as a row of boxes over one real input, so paste and SMS autofill fill it at once. A focus ring glides between the boxes; verifying shimmers, an error shakes and clears, and success turns into a Verified chip. A resend countdown is built in.",
513
+ "category": "Inputs",
514
+ "pro": false,
515
+ "entryPoint": "./ui/otp-input",
516
+ "selector": "ui-otp-input",
517
+ "url": "/ai/otp-input.json",
518
+ "markdown": "# OTP Input\n\nA verification code drawn as a row of boxes over one real input, so paste and SMS autofill fill it at once. A focus ring glides between the boxes; verifying shimmers, an error shakes and clears, and success turns into a Verified chip. A resend countdown is built in.\n\nAdd: `npx ochreui@latest add otp-input`\nImport: `import { UiOtpInput, UiOtp, UiOtpBoxes } from './ui/otp-input';`\nSelector: `<ui-otp-input>`\nDocs: /components/otp-input\n\n## When to use\n- Two-step sign-in, email or phone verification, confirming a sensitive change.\n- Short codes copied from an email or SMS: paste and autofill fill every box.\n\n## When not to use\n- Codes over about 8 characters, or free text: use Text Field.\n- Secrets that must stay hidden: the boxes show what is typed.\n\n## Usage\n\n```ts\nimport { Component, inject, signal } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport { Router } from '@angular/router';\nimport { FormField, form } from '@angular/forms/signals';\nimport { OtpStatus, UiOtp, UiOtpInput } from './ui/otp-input';\n\n@Component({\n selector: 'app-verify-email',\n imports: [UiOtpInput, UiOtp, FormField],\n template: `\n <h2>Check your inbox</h2>\n <p>We sent a six-digit code to {{ email }}.</p>\n <ui-otp-input separator align=\"center\" [status]=\"status()\" [error]=\"error()\" [resendIn]=\"30\"\n (completed)=\"verify($event)\" (resend)=\"sendCode()\">\n <input uiOtp [formField]=\"f.code\" autofocus />\n </ui-otp-input>\n `,\n})\nexport class VerifyEmail {\n private readonly http = inject(HttpClient);\n private readonly router = inject(Router);\n protected readonly email = 'jo@fernhill.studio';\n protected readonly status = signal<OtpStatus>('idle');\n protected readonly error = signal('');\n private readonly model = signal({ code: '' });\n protected readonly f = form(this.model);\n private triesLeft = 3;\n\n protected verify(code: string) {\n this.status.set('verifying');\n this.http.post('/api/verify-email', { code }).subscribe({\n next: () => {\n this.status.set('success');\n setTimeout(() => this.router.navigate(['/welcome']), 1200);\n },\n error: () => {\n this.triesLeft--;\n this.error.set(this.triesLeft > 0 ? `That code didn't work. ${this.triesLeft} left.` : 'Request a new code.');\n this.status.set('error');\n },\n });\n }\n\n protected sendCode() {\n this.triesLeft = 3;\n this.http.post('/api/send-email-code', {}).subscribe();\n }\n}\n```\n\n## Rules\n- Put <input uiOtp> inside <ui-otp-input>; bind it with [formField], formControl, formControlName or ngModel.\n- The app owns status: on (completed) set verifying, then success or error. The field goes quiet on the next keystroke by itself.\n- Set resendIn to show the resend line; (resend) fires when the button is pressed.\n- Without label, the input is named by labels.name plus the count; or set aria-label on the input.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `length` | `number` | 6 | How many boxes. |\n| `mode` | `'numeric' \\| 'alphanumeric'` | 'numeric' | Digits with the number pad, or letters and digits stored in capitals. |\n| `separator` | `boolean \\| number` | false | A dash between groups: bare = middle, a number = after that many boxes. |\n| `status` | `'idle' \\| 'verifying' \\| 'error' \\| 'success'` | 'idle' | Set by the app. verifying locks and shimmers; error shakes and shows the message; success morphs into the Verified chip. |\n| `error` | `string \\| null \\| undefined` | labels.error | Message while status is error, until the user types. |\n| `clearOnError` | `boolean` | true | Empties the boxes about 1 s after an error; typing cancels it. |\n| `resendIn` | `number` | none | Seconds before resend. Set it to show the countdown and the Resend button. |\n| `align` | `'start' \\| 'center'` | 'start' | Where the boxes and the lines under them sit. |\n| `label` | `string` | none | Visible label above the boxes; otherwise the input is named \"Verification code, 6 digits\". |\n| `hint` | `string` | none | Quiet line under the boxes; the error replaces it. |\n| `labels` | `Partial<OtpInputLabels>` | English | Translations: name, digits, characters, verifying, verified, error, noCode, resendIn, resend, canResend, resent. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `completed` | `string` | The user filled the last box (typing, paste or autofill). Not for values written by code. |\n| `resend` | `void` | Resend pressed; the countdown restarted and focus is back on the input. |\n\n## OtpInputLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `name` | `string` | Accessible name without a label. Default \"Verification code\". |\n| `digits` | `(n: number) => string` | Count added to the name in numeric mode: \"6 digits\". |\n| `characters` | `(n: number) => string` | Count in alphanumeric mode: \"8 characters\". |\n| `verifying` | `string` | Announced while verifying. |\n| `verified` | `string` | Success chip text, also announced. |\n| `error` | `string` | Default error message. |\n| `noCode` | `string` | Start of the resend line. |\n| `resendIn` | `string` | Before the countdown: \"Resend in\". |\n| `resend` | `string` | Resend button. |\n| `canResend` | `string` | Announced when the countdown ends. |\n| `resent` | `string` | Announced after Resend. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-otp-input-box` | `40px (Classic 48px)` | Widest box; boxes shrink to fit, digits stay ≥ 12px. |\n| `--ui-otp-input-radius` | `box width / 5` | Box corners. |\n| `--ui-otp-input-ring` | `var(--ui-focus-ring)` | Focus ring and caret, ≥ 3:1. |\n| `--ui-text-field-edge` | `var(--ui-hairline)` | Resting box edge, shared with Text Field. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| 0–9 | Fills the active box and moves on; replaces a filled box. Other keys ignored. |\n| Backspace | Empty box: deletes the previous one and moves back. Filled box: deletes it, later characters shift left. |\n| Delete | Deletes the active character; later ones shift left. |\n| ← → | Between filled boxes and the first empty one. |\n| Home / End | First box / first empty box. |\n| ⌘V or Ctrl+V | Pastes from the active box; spaces, dashes and overflow dropped. |\n| Tab | One stop for the whole field; then Resend when shown. |\n\n## Accessibility\n- One real input, one name (\"Verification code, 6 digits\"); the boxes are aria-hidden.\n- autocomplete=\"one-time-code\" and the number pad for SMS autofill.\n- One polite live region: verifying, the error, success, can resend, resent. Countdown ticks are silent.\n- Error: aria-invalid and aria-describedby to the message. Read-only while verifying and on success; focus stays on the input, also after Resend.\n- Ring and caret ≥ 3:1, text ≥ 4.5:1; forced colors keep box edges and the ring.\n",
519
+ "keywords": "Inputs UiOtpInput UiOtp UiOtpBoxes OtpStatus OtpMode OtpAlign OtpInputLabels Two-step sign-in, email or phone verification, confirming a sensitive change. Short codes copied from an email or SMS: paste and autofill fill every box."
520
+ },
521
+ {
522
+ "slug": "pagination",
523
+ "name": "Pagination",
524
+ "description": "Pages of a long list: Rows per page, the range (\"1–25 of 1,146\"), Previous and Next, and page numbers with … between them. Tabular numbers in fixed slots keep the row still from page 1 to 10,000.",
525
+ "category": "Navigation",
526
+ "pro": false,
527
+ "entryPoint": "./ui/pagination",
528
+ "selector": "ui-pagination",
529
+ "url": "/ai/pagination.json",
530
+ "markdown": "# Pagination\n\nPages of a long list: Rows per page, the range (\"1–25 of 1,146\"), Previous and Next, and page numbers with … between them. Tabular numbers in fixed slots keep the row still from page 1 to 10,000.\n\nAdd: `npx ochreui@latest add pagination`\nImport: `import { UiPagination } from './ui/pagination';`\nSelector: `<ui-pagination>`\nDocs: /components/pagination\n\n## When to use\n- Under a table or list that loads a page at a time: deploys, logs, eval cases, invoices.\n- When people want the size of the list and a jump to the first, last or a nearby page.\n- With pageSizes, when some people want more rows at once.\n\n## When not to use\n- A feed read top to bottom: load more on scroll.\n- Where a page sits in a hierarchy: use Breadcrumb.\n- A few views of the same thing: use Segmented Control.\n- A handful of rows: show them all.\n\n## Usage\n\n```ts\nimport { Component, input, signal } from '@angular/core';\nimport { UiPagination } from './ui/pagination';\n\n@Component({\n selector: 'app-invoices-footer',\n imports: [UiPagination],\n template: `\n <ui-pagination\n aria-label=\"Invoice pages\"\n [(page)]=\"page\"\n [(pageSize)]=\"pageSize\"\n [total]=\"total()\"\n [pageSizes]=\"[25, 50, 100]\"\n />\n `,\n})\nexport class InvoicesFooter {\n readonly total = input.required<number>();\n protected readonly page = signal(1);\n protected readonly pageSize = signal(25);\n}\n```\n\n## Rules\n- Bind [(page)]; set total (or pageCount when the row count is unknown).\n- Two paginations for one list: give each its own aria-label and set [announce]=\"false\" on one.\n- page is shown clamped but never written back; fix out-of-range pages yourself if you need to.\n- It needs its container's width: inside a shrink-to-fit parent, give it a width.\n- It is navigation, not a form control: no formField, formControl or ngModel.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `page` | `number (model, required)` | none | Page shown, from 1; shown clamped, written only when someone picks a page. |\n| `pageSize` | `number (model)` | 20 | Rows per page; a new size moves page to the page holding the first row on screen. |\n| `total` | `number` | none | All rows; drives the range (\"0 of 0\" when empty) and the page count. |\n| `pageCount` | `number` | none | Page count when the row count is unknown; range reads \"Page 3 of 12\". total wins. |\n| `pageSizes` | `number[]` | [] | Shows Rows per page, sorted, current size added. Needs total. |\n| `siblings` | `number` | 1 | Numbers each side of the current one; at most 2 × siblings + 5 slots. |\n| `compact` | `boolean` | false | Only the range and the arrows. |\n| `disabled` | `boolean` | false | While rows load: stays in place, dimmed, nothing pressable. |\n| `announce` | `boolean` | true | Polite live range. Turn off on the second pagination of one list. |\n| `locale` | `string` | LOCALE_ID | Number locale (grouping). |\n| `aria-label` | `string` | 'Pagination' | Names the landmark; say which list when a screen has two. |\n| `labels` | `Partial<PaginationLabels>` | English | Translations; {page} {from} {to} {total} {count} are filled in. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `pageChange` | `number` | From an arrow, a number or a size change; never for the current page, a dimmed arrow or while disabled. |\n| `pageSizeChange` | `number` | A size was picked; pageChange follows when the page moves. |\n\n## PaginationLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `landmark` | `string` | Landmark name without aria-label. 'Pagination'. |\n| `rowsPerPage` | `string` | 'Rows per page'. |\n| `previous` | `string` | 'Previous page'. |\n| `next` | `string` | 'Next page'. |\n| `page` | `string` | Number names. 'Page {page}'. |\n| `range` | `string` | With total. '{from}–{to} of {total}'. |\n| `pageOf` | `string` | With pageCount only. 'Page {page} of {count}'. |\n| `empty` | `string` | Total of 0. '{total} of {total}'. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-pagination-current-bg` | `rgb(from var(--ui-text) r g b / ≈7%, ≈10% dark)` | The current page's pill. |\n| `--ui-text-field-edge` | `var(--ui-hairline)` | Rows per page edge (shared with Text Field). |\n| `--ui-text-field-edge-hover` | `text at 18%` | That edge on hover. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Rows per page, the arrows, the numbers; gaps skipped. |\n| Enter / Space | Goes to that page; focus follows its number. Nothing on the current page or a dimmed arrow. |\n\n## Accessibility\n- The host has role=navigation and is named by aria-label (default 'Pagination').\n- A list of real buttons: Previous page, Page N, Next page; aria-current=page on the current one.\n- End arrows are aria-disabled (still focusable), not disabled.\n- The range is aria-live=polite, aria-atomic; the … gaps are aria-hidden.\n- Rows per page is a native select inside its label.\n- Focus ring only on :focus-visible, 2px outside; forced colors outline the current page and edge the select.\n",
531
+ "keywords": "Navigation UiPagination PaginationLabels Under a table or list that loads a page at a time: deploys, logs, eval cases, invoices. When people want the size of the list and a jump to the first, last or a nearby page. With pageSizes, when some people want more rows at once."
532
+ },
533
+ {
534
+ "slug": "popover",
535
+ "name": "Popover",
536
+ "description": "A small card attached to its trigger: a title, a quiet line and any content, such as a short form. It flips and shortens to stay on screen, closes on a press outside, Escape or Tab, and gives focus back to the trigger.",
537
+ "category": "Navigation",
538
+ "pro": false,
539
+ "entryPoint": "./ui/popover",
540
+ "selector": "ui-popover",
541
+ "url": "/ai/popover.json",
542
+ "markdown": "# Popover\n\nA small card attached to its trigger: a title, a quiet line and any content, such as a short form. It flips and shortens to stay on screen, closes on a press outside, Escape or Tab, and gives focus back to the trigger.\n\nAdd: `npx ochreui@latest add popover`\nImport: `import { UiPopover, UiPopoverTrigger, UiPopoverContent } from './ui/popover';`\nSelector: `<ui-popover>`\nDocs: /components/popover\n\n## When to use\n- A short form next to the button that asks for it: a schedule, an invite, a rename.\n- A few settings or an explanation that stays close to what it is about.\n- The base for your own floating panels (unstyled).\n\n## When not to use\n- A list of actions: use Dropdown Menu.\n- Picking a value for a form field: use Select.\n- Something that needs a decision first: use a dialog.\n- A status after an action: use a toast.\n- A short label on hover: use Tooltip.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, email, form, required } from '@angular/forms/signals';\nimport { UiButton } from './ui/button';\nimport { UiPopover, UiPopoverTrigger } from './ui/popover';\nimport { UiInput, UiTextField } from './ui/text-field';\n\n@Component({\n selector: 'app-share-report',\n imports: [UiButton, UiPopover, UiPopoverTrigger, UiTextField, UiInput, FormField],\n template: `\n <span class=\"anchor\">\n <button type=\"button\" uiButton variant=\"secondary\" [uiPopoverTrigger]=\"share\">Share</button>\n <ui-popover #share [(open)]=\"open\" align=\"end\" [width]=\"300\"\n title=\"Share the report\" description=\"They get an email with a link to this report.\">\n <form class=\"invite\" (submit)=\"send($event)\">\n <ui-text-field>\n <input uiInput type=\"email\" aria-label=\"Email address\" placeholder=\"name@company.com\" [formField]=\"f.email\" />\n </ui-text-field>\n <button type=\"submit\" uiButton>Send</button>\n </form>\n </ui-popover>\n </span>\n `,\n styles: `\n .anchor { display: inline-flex; }\n .invite { display: flex; gap: 8px; }\n .invite ui-text-field { flex: 1; }\n `,\n})\nexport class ShareReport {\n protected readonly open = signal(false);\n private readonly model = signal({ email: '' });\n protected readonly f = form(this.model, (p) => {\n required(p.email);\n email(p.email);\n });\n\n protected send(event: Event) {\n event.preventDefault();\n if (this.f().invalid()) return;\n this.model.set({ email: '' });\n this.open.set(false);\n }\n}\n```\n\n## Rules\n- Write <ui-popover> right after its trigger, inside an inline-flex wrapper, so Tab order and the default anchor work.\n- Bind [(open)]; set it false yourself when a form inside is done. Focus returns to the trigger.\n- Without a title, give it aria-label or aria-labelledby.\n- Use <ng-template uiPopoverContent> for content created only while open.\n- Needs overlay.ts next to popover.ts (the CLI adds it): the placement, Escape and outside-press layer shared by the floating components.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `open` | `boolean` | false | Shows it. Two-way [(open)]; turns false by itself when dismissed. |\n| `side` | `'bottom' \\| 'top' \\| 'right' \\| 'left'` | 'bottom' | Preferred side; flips to the side with more room. |\n| `align` | `'start' \\| 'center' \\| 'end'` | 'start' | Edges that line up (logical in RTL); switches when it would stick out. |\n| `offset` | `number` | 6 | Gap to the anchor in px. |\n| `anchor` | `HTMLElement \\| ElementRef<HTMLElement> \\| null` | null | What it attaches to. Default: the uiPopoverTrigger, else the parent element. |\n| `title` | `string` | none | Heading and accessible name (aria-labelledby). |\n| `description` | `string` | none | Quiet line under the title (aria-describedby). |\n| `width` | `number \\| string` | none | Card width (number = px). Default fits the content, never wider than the window. |\n| `focusOnOpen` | `boolean` | true | Focuses [autofocus], the first control or the card on open; never when open from the first render. |\n| `unstyled` | `boolean` | false | Placement, motion and closing only; your class draws it. |\n| `role` | `string` | 'dialog' | Card role; the trigger's aria-haspopup follows it. |\n| `id` | `string` | generated | Card id, used by aria-controls. |\n| `aria-labelledby` | `string` | none | Your own label when there is no title. |\n| `aria-describedby` | `string` | none | Your own descriptions, kept with the description. |\n| `uiPopoverTrigger (UiPopoverTrigger)` | `UiPopover` | required | On the button: toggles on click, sets aria-haspopup, aria-expanded and aria-controls. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `openChange` | `boolean` | Every change of open. |\n| `dismissed` | `'escape' \\| 'outside' \\| 'focus-out' \\| 'trigger'` | Why it closed by itself, before open turns false. |\n\n## Template: uiPopoverContent\n\nLazy content: created on open, destroyed on close. Context: `none`.\n\n```html\n<ui-popover #pop [(open)]=\"open\" title=\"Rename agent\">\n <ng-template uiPopoverContent>\n <form>…</form>\n </ng-template>\n</ui-popover>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-popover-bg` | `var(--ui-bg-overlay)` | Fill. |\n| `--ui-popover-fg` | `var(--ui-text)` | Text. |\n| `--ui-popover-radius` | `12px (Classic 16px)` | Corners. |\n| `--ui-popover-padding` | `14px (Classic 16px)` | Inner space. |\n| `--ui-popover-shadow` | `var(--ui-shadow-md)` | Ring and drop shadow. |\n| `--ui-popover-width` | `max-content` | Width when the width input is unset. |\n| `--ui-popover-drift` | `4px` | Glide distance on enter. |\n| `--ui-popover-from` | `0.96` | Starting scale on enter. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Enter / Space | On the trigger: opens and focuses the first control; again closes. |\n| Tab / Shift+Tab | Through the controls inside; leaving trigger and card closes it. |\n| Escape | Closes the innermost popover and returns focus to its trigger. |\n\n## Accessibility\n- Non-modal role=dialog named by the title, described by the description.\n- Trigger gets aria-haspopup, aria-expanded and aria-controls (while open).\n- Focus returns to the trigger on every close while focus was inside, also when a button inside closes it.\n- Without title or controls, the card takes focus and its body is the description.\n- Description ≥ 4.5:1; forced colors keep a card edge.\n",
543
+ "keywords": "Navigation UiPopover UiPopoverTrigger UiPopoverContent PopoverSide PopoverAlign PopoverDismiss A short form next to the button that asks for it: a schedule, an invite, a rename. A few settings or an explanation that stays close to what it is about. The base for your own floating panels (unstyled)."
544
+ },
545
+ {
546
+ "slug": "profile-menu",
547
+ "name": "Profile Menu",
548
+ "description": "The account card behind the avatar in an app header: who is signed in, the account actions as a keyboard-friendly menu, and an optional profile-setup bar with the next step.",
549
+ "category": "Navigation",
550
+ "pro": false,
551
+ "entryPoint": "./ui/profile-menu",
552
+ "selector": "ui-profile-menu",
553
+ "url": "/ai/profile-menu.json",
554
+ "markdown": "# Profile Menu\n\nThe account card behind the avatar in an app header: who is signed in, the account actions as a keyboard-friendly menu, and an optional profile-setup bar with the next step.\n\nAdd: `npx ochreui@latest add profile-menu`\nImport: `import { UiProfileMenu, UiProfileMenuItem } from './ui/profile-menu';`\nSelector: `<ui-profile-menu>`\nDocs: /components/profile-menu\n\n## When to use\n- The panel behind the avatar in an app header.\n- Nudging people to finish their profile next to their account actions.\n\n## When not to use\n- Long menus, submenus or checkable items: use a dropdown menu.\n- Onboarding with many explained steps: use a step checklist.\n\n## Usage\n\n```ts\nimport { Component, inject, signal } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { UiAvatar } from './ui/avatar';\nimport { UiProfileMenu, UiProfileMenuItem } from './ui/profile-menu';\n\n@Component({\n selector: 'app-account-card',\n imports: [UiProfileMenu, UiProfileMenuItem, UiAvatar],\n template: `\n <ui-profile-menu name=\"Noor Aziz\" email=\"noor.aziz@northwind.dev\" [setup]=\"setup()\" (continue)=\"openProfile()\">\n <ui-avatar uiProfileAvatar name=\"Noor Aziz\" src=\"/avatars/noor.jpg\" aria-hidden=\"true\" />\n <button uiProfileMenuItem (click)=\"router.navigate(['/settings'])\">\n <svg class=\"ui-icon\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"2.5\" /><circle cx=\"12\" cy=\"12\" r=\"6\" /><path d=\"M12 3v3M12 18v3M3 12h3M18 12h3\" /></svg>\n <span>Settings</span>\n </button>\n <button uiProfileMenuItem (click)=\"signOut()\">\n <svg class=\"ui-icon\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M10 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h4M15 8l4 4-4 4M19 12H9\" /></svg>\n <span>Log out</span>\n </button>\n </ui-profile-menu>\n `,\n})\nexport class AccountCard {\n protected readonly router = inject(Router);\n protected readonly setup = signal({ done: 3, total: 5, next: 'Add a profile photo' });\n\n protected openProfile() {\n this.router.navigate(['/profile']);\n }\n\n protected signOut() {\n this.router.navigate(['/sign-in']);\n }\n}\n```\n\n## Rules\n- Put uiProfileMenuItem on your own <button> or <a>, with an <svg> icon and a <span> label.\n- A trailing <span class=\"ui-badge\"> is info-toned unless it has a tone class.\n- Mark the avatar uiProfileAvatar and aria-hidden=\"true\"; do not wrap it in @if.\n- In a dropdown: call focusFirst() on open, close on (itemSelect) and Escape, return focus to the trigger.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `name` | `string` | required | Signed-in person; one line, ellipsis. |\n| `email` | `string` | none | Under the name; one line, ellipsis. |\n| `setup` | `ProfileSetup \\| null` | null | Setup progress; null or total 0 hides the block. |\n| `labels` | `Partial<ProfileMenuLabels>` | {} | Every visible and spoken string. |\n| `disabled (UiProfileMenuItem)` | `boolean` | false | Skipped by arrows and typeahead; aria-disabled on links. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `continue` | `void` | The next-step button was pressed. |\n| `itemSelect` | `HTMLElement` | An action was activated, after its own (click). Close a dropdown here. |\n\n## ProfileSetup\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `done` | `number` | Steps finished; clamped to 0…total. |\n| `total` | `number` | All steps; 0 hides the block. |\n| `next` | `string?` | The next step, on the button under the bar. Omit it to hide the button. |\n\n## ProfileMenuLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `menu` | `string` | The menu name (default Account). |\n| `setup` | `string` | Setup title and progress bar name (default Profile setup). |\n| `next` | `string` | Before the next step (default Next:). |\n| `progress` | `(done: number, total: number) => string` | Spoken value of the bar (default \"3 of 5 steps done\"). |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-profile-menu-width` | `260px (Classic 320px)` | Card width; shrinks with its container. |\n| `--ui-profile-menu-avatar` | `32px (Classic 40px)` | Avatar size. |\n| `--ui-profile-menu-bg` | `var(--ui-bg-surface)` | Card fill. |\n| `--ui-profile-menu-track` | `var(--ui-bg-muted)` | Progress track. |\n| `--ui-profile-menu-fill` | `var(--ui-accent)` | Progress fill, ≥ 3:1 on the track. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Into the menu on the last-used action; then the next-step button. |\n| ↓ / ↑ | Next / previous action, wrapping; disabled skipped. |\n| Home / End | First / last action. |\n| Letters | Next action whose label starts with them. |\n| Enter / Space | Activates the action, links included. |\n| Esc | Closes the enclosing dropdown, if it handles it. |\n\n## Accessibility\n- Actions are role=menu named Account, one Tab stop, visible focus ring.\n- Avatar hidden; name and email are plain text.\n- Progressbar in steps with aria-valuetext; visual count aria-hidden.\n- Touch: actions and next-step button ≥ 44px.\n- Forced colors: card edge, bar track and fill kept.\n",
555
+ "keywords": "Navigation UiProfileMenu UiProfileMenuItem ProfileSetup ProfileMenuLabels The panel behind the avatar in an app header. Nudging people to finish their profile next to their account actions."
556
+ },
557
+ {
558
+ "slug": "progress-tracker",
559
+ "name": "Progress Tracker",
560
+ "description": "An onboarding checklist card with a title, a done/total count and a thin progress bar. Ticking a step pops its dot, draws the tick, strikes the label and fills the bar; auto play can run the list by itself.",
561
+ "category": "Feedback",
562
+ "pro": false,
563
+ "entryPoint": "./ui/progress-tracker",
564
+ "selector": "ui-progress-tracker",
565
+ "url": "/ai/progress-tracker.json",
566
+ "markdown": "# Progress Tracker\n\nAn onboarding checklist card with a title, a done/total count and a thin progress bar. Ticking a step pops its dot, draws the tick, strikes the label and fills the bar; auto play can run the list by itself.\n\nAdd: `npx ochreui@latest add progress-tracker`\nImport: `import { UiProgressTracker, UiProgressStepIcon } from './ui/progress-tracker';`\nSelector: `<ui-progress-tracker>`\nDocs: /components/progress-tracker\n\n## When to use\n- Onboarding checklists for someone's first steps.\n- Short task lists where finishing one should feel rewarding.\n\n## When not to use\n- More than about eight steps: the card gets hard to scan.\n- Long step names: each step is one line with an ellipsis.\n- Steps that must happen in order: use a stepper.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { ProgressStep, ProgressStepToggle, UiProgressTracker } from './ui/progress-tracker';\n\n@Component({\n selector: 'app-onboarding',\n imports: [UiProgressTracker],\n template: `\n <ui-progress-tracker title=\"Set up your workspace\" [(steps)]=\"steps\" (stepToggle)=\"save($event)\" />\n `,\n})\nexport class Onboarding {\n protected readonly steps = signal<ProgressStep[]>([\n { id: 'repo', label: 'Connect a repository' },\n { id: 'alerts', label: 'Turn on build alerts' },\n { id: 'project', label: 'Create a first project', done: true },\n ]);\n\n protected save({ step, done }: ProgressStepToggle) {\n fetch(`/api/onboarding/${step.id}`, { method: 'PUT', body: JSON.stringify({ done }) });\n }\n}\n```\n\n## Rules\n- Give every step a unique id and a non-empty label.\n- Bind [(steps)] to a signal to keep the state; with one-way [steps] the card keeps its own copy.\n- Use autoPlay only for decorative or marketing cards, not for real task lists.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `steps` | `ProgressStep[]` | required | The steps, in order. Two-way with [(steps)]; each toggle writes a new array with a new object for that step. |\n| `title` | `string` | 'Getting started' | The heading above the bar. |\n| `level` | `number` | 3 | The title's heading level. |\n| `autoPlay` | `boolean` | false | Ticks open steps one by one, holds two intervals, resets to the starting state. Waits while off-screen or in a hidden tab. A click, key or focus inside stops it for good. |\n| `interval` | `number` | 2200 | Milliseconds between automatic ticks. |\n| `labels` | `Partial<ProgressTrackerLabels>` | English | The bar's spoken name (progress) and value (valueText, with {done} and {total}). |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `stepsChange` | `ProgressStep[]` | Every change, from a person or auto play. The other half of [(steps)]. |\n| `stepToggle` | `ProgressStepToggle` | { step, done } after someone ticks or unticks a step. Not emitted by auto play. |\n\n## ProgressStep\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | `string` | Unique; keeps the row in place when the array is replaced. |\n| `label` | `string` | One line, cut off with an ellipsis. The checkbox's name. |\n| `done` | `boolean?` | Ticked. |\n\n## ProgressStepToggle\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `step` | `ProgressStep` | The step as it now is. |\n| `done` | `boolean` | Its new state. |\n\n## ProgressTrackerLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `progress` | `string` | The bar's spoken name. Default 'Progress'. |\n| `valueText` | `string` | The bar's spoken value. Default '{done} of {total} done'. |\n\n## Template: uiProgressStepIcon\n\nAn icon between the dot and the label, 18px square. Context: `ProgressStep`.\n\n```html\n<ui-progress-tracker [(steps)]=\"steps\">\n <ng-template uiProgressStepIcon let-step>\n <img [src]=\"'/icons/' + step.id + '.svg'\" alt=\"\" />\n </ng-template>\n</ui-progress-tracker>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-progress-tracker-fill` | `blue (var(--ui-hue-blue), sky in dark); var(--ui-bg-neutral-solid) in Classic` | Bar fill and done dots. |\n| `--ui-progress-tracker-tick` | `var(--ui-bg-knob); var(--ui-text-on-neutral) in Classic` | The tick on a done dot. |\n| `--ui-progress-tracker-track` | `color-mix(in srgb, var(--ui-text) 6.5%, var(--ui-bg-surface)); 8% text in dark mode, 11% in dark Classic` | The bar's groove. |\n| `--ui-progress-tracker-ring` | `var(--ui-border-strong); var(--ui-border-input) in Classic` | An open dot's edge. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Next step; every step is a stop. |\n| Space / Enter | Ticks or unticks the focused step. |\n\n## Accessibility\n- Each step is a button with role=checkbox and aria-checked, named by its label.\n- The bar is a progressbar named 'Progress' with aria-valuetext '2 of 5 done'; the visible count is aria-hidden, so the title is read once.\n- Any pointer press, key press or focus inside stops auto play for good.\n- Forced colors: dots, ticks, bar and strike stay visible in system colours; done labels use GrayText.\n",
567
+ "keywords": "Feedback UiProgressTracker UiProgressStepIcon ProgressStep ProgressStepToggle ProgressTrackerLabels Onboarding checklists for someone's first steps. Short task lists where finishing one should feel rewarding."
568
+ },
569
+ {
570
+ "slug": "rating",
571
+ "name": "Rating",
572
+ "description": "Stars from 1 to any count, or a thumbs up / down pair for AI answers. Hover previews, a press sets and a second press clears, arrows move in one tab stop, and read-only stars show averages with halves. Works with signal forms, reactive forms and ngModel.",
573
+ "category": "Inputs",
574
+ "pro": false,
575
+ "entryPoint": "./ui/rating",
576
+ "selector": "ui-rating, ui-rating-thumbs",
577
+ "url": "/ai/rating.json",
578
+ "markdown": "# Rating\n\nStars from 1 to any count, or a thumbs up / down pair for AI answers. Hover previews, a press sets and a second press clears, arrows move in one tab stop, and read-only stars show averages with halves. Works with signal forms, reactive forms and ngModel.\n\nAdd: `npx ochreui@latest add rating`\nImport: `import { UiRating, UiRatingThumbs } from './ui/rating';`\nSelector: `<ui-rating, ui-rating-thumbs>`\nDocs: /components/rating\n\n## When to use\n- Thumbs up/down under an AI answer (ui-rating-thumbs).\n- Scoring a run, agent, template or reply with 1 to N stars.\n- Showing an average in a list: readonly, with half stars.\n\n## When not to use\n- Feedback next to copy/retry/share under a chat message: use Message Actions.\n- Named steps (Low/Medium/High): use Segmented Control or Toggle Group.\n- On/off: use Switch or Checkbox.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form, required } from '@angular/forms/signals';\nimport { UiRating } from './ui/rating';\n\n@Component({\n selector: 'app-run-review',\n imports: [UiRating, FormField],\n template: `\n <span id=\"run-score\">Rate this run</span>\n <ui-rating aria-labelledby=\"run-score\" [formField]=\"f.score\" />\n `,\n})\nexport class RunReview {\n private readonly model = signal({ score: null as number | null });\n protected readonly f = form(this.model, (p) => required(p.score));\n}\n```\n\n## Rules\n- Bind value with [formField], formControl, ngModel or [(value)].\n- With [formField], set the star count with the schema max(), not the max attribute; don't set name or disabled.\n- Interactive values are whole numbers 1..max or null; use readonly for fractional averages.\n- Always name an interactive group with aria-label or aria-labelledby.\n- Translate with valueLabel (stars) and labels.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `value` | `number \\| null (model)` | null | 1 to max, or null. Read-only: any number, drawn to the nearest half. |\n| `max` | `number` | 5 | Star count, 1 to 50, always on one line (never wraps). Signal forms: schema max(). |\n| `readonly` | `boolean` | false | Display only: role=img named by the value, halves, not focusable. |\n| `disabled` | `boolean` | false | --ui-disabled-opacity on the whole group, keeps its value, not focusable. Forms set it. |\n| `allowClear` | `boolean` | true | Pressing the chosen one again, or Delete, clears to null. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | 'md' (read-only stars: 'sm') | Stars 14/18/24px on 24/24/30px buttons (24px targets), gap 2; read-only no button, gap 1 (Classic +2); touch hit 32px. Thumbs 24/28/32px (Classic +4). |\n| `valueLabel` | `(value: number, max: number) => string` | \"{v} out of {max}\" | Stars only: each star's name and the read-only label. |\n| `labels` | `Partial<RatingLabels> \\| Partial<RatingThumbsLabels>` | English | Stars: group, none. Thumbs: up, down, group. |\n| `name` | `string` | none | Submits the value through a hidden input, empty when none; a native form reset restores the first value. Signal forms set it. |\n| `required / invalid` | `boolean` | false | aria-required / aria-invalid on the group. Signal forms set them. |\n| `value (UiRatingThumbs)` | `'up' \\| 'down' \\| null (model)` | null | The vote. |\n| `readonly (UiRatingThumbs)` | `boolean` | false | Shows the vote, focusable, can't change (aria-readonly). |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `valueChange` | `number \\| null, or ThumbsValue` | New value, or null when cleared: after a press, a key or a native reset; not on form or [value] writes. |\n| `touch` | `void` | Focus left the group. |\n\n## RatingLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `group` | `string` | Default group name (\"Rating\"). |\n| `none` | `string` | Read-only with no value (\"No rating\"). |\n\n## RatingThumbsLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `up` | `string` | \"Good response\". |\n| `down` | `string` | \"Bad response\". |\n| `group` | `string` | Default group name (\"Rate this response\"). |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-rating-fill` | `var(--ui-hue-amber)` | Filled star, one solid fill, no rim. |\n| `--ui-rating-empty` | `color-mix(in srgb, var(--ui-text) 15%, transparent)` | Empty star, a quiet solid fill; prefers-contrast: more uses --ui-border-input. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Into the chosen star/thumb (or the first), then out. |\n| → / ↑ | Stars: value + 1, up to max; from none, 1. |\n| ← / ↓ | Stars: value − 1, down to 1; from none, 1. RTL swaps ← and →. |\n| Home / End | 1 / max; thumbs: up / down. |\n| Arrows (thumbs) | The other thumb. |\n| Space / Enter | Choose the focused one; on the chosen one, clear. |\n| Delete / Backspace | Clear. |\n\n## Accessibility\n- role=radiogroup of role=radio buttons, one tab stop; stars named \"3 out of 5\", thumbs \"Good response\" / \"Bad response\".\n- Default group names \"Rating\" / \"Rate this response\"; give aria-label or aria-labelledby.\n- Read-only stars: one role=img named by the value (one decimal), not focusable.\n- Empty stars are a quiet solid fill; the value is always in the accessible name, hover darkens the hovered star and focus shows a ring.\n- aria-required / aria-invalid / aria-disabled on the group; forced colors: CanvasText outline, Highlight fill.\n",
579
+ "keywords": "Inputs UiRating UiRatingThumbs RatingSize RatingLabels RatingThumbsLabels ThumbsValue Thumbs up/down under an AI answer (ui-rating-thumbs). Scoring a run, agent, template or reply with 1 to N stars. Showing an average in a list: readonly, with half stars."
580
+ },
581
+ {
582
+ "slug": "reaction-bar",
583
+ "name": "Reaction Bar",
584
+ "description": "Like, comment, repost and share under a post, each a toggle with a public count. Icons pop and fill, only the digits that changed roll in, and the count glides to its new width.",
585
+ "category": "Buttons",
586
+ "pro": false,
587
+ "entryPoint": "./ui/reaction-bar",
588
+ "selector": "ui-reaction-bar",
589
+ "url": "/ai/reaction-bar.json",
590
+ "markdown": "# Reaction Bar\n\nLike, comment, repost and share under a post, each a toggle with a public count. Icons pop and fill, only the digits that changed roll in, and the count glides to its new width.\n\nAdd: `npx ochreui@latest add reaction-bar`\nImport: `import { UiReactionBar, UiReaction } from './ui/reaction-bar';`\nSelector: `<ui-reaction-bar>`\nDocs: /components/reaction-bar\n\n## When to use\n- Reactions under posts, comments or updates in a feed.\n- Any toggle with a public count: saves, upvotes.\n\n## When not to use\n- Actions that need a confirmation: a toggle flips on the first click.\n- One on/off setting with no count: use Switch or a toggle button.\n\n## Usage\n\n```ts\nimport { HttpClient } from '@angular/common/http';\nimport { Component, inject, input, linkedSignal } from '@angular/core';\nimport { ReactionKind, ReactionToggle, UiReaction, UiReactionBar } from './ui/reaction-bar';\n\nexport interface Post {\n id: string;\n likes: number;\n liked: boolean;\n comments: number;\n reposts: number;\n reposted: boolean;\n}\n\n@Component({\n selector: 'app-post-actions',\n imports: [UiReactionBar, UiReaction],\n template: `\n <ui-reaction-bar>\n <button uiReaction=\"like\" [(pressed)]=\"liked\" [(count)]=\"likes\" (toggled)=\"react('like', $event)\"></button>\n <button uiReaction=\"comment\" [count]=\"post().comments\"></button>\n <button uiReaction=\"repost\" [(pressed)]=\"reposted\" [(count)]=\"reposts\" (toggled)=\"react('repost', $event)\"></button>\n <button uiReaction=\"share\" [count]=\"0\"></button>\n </ui-reaction-bar>\n `,\n})\nexport class PostActions {\n readonly post = input.required<Post>();\n private readonly http = inject(HttpClient);\n protected readonly liked = linkedSignal(() => this.post().liked);\n protected readonly likes = linkedSignal<number | null>(() => this.post().likes);\n protected readonly reposted = linkedSignal(() => this.post().reposted);\n protected readonly reposts = linkedSignal<number | null>(() => this.post().reposts);\n\n protected react(kind: ReactionKind, e: ReactionToggle) {\n this.http.put(`/api/posts/${this.post().id}/reactions/${kind}`, { on: e.pressed }).subscribe();\n }\n}\n```\n\n## Rules\n- Put uiReaction on a native <button> inside <ui-reaction-bar>.\n- Bind [(pressed)] and [(count)]; save in (toggled). Use [count]=\"0\" for a count that starts hidden.\n- Custom kinds need label and their own <svg>; add a noun in labels.units.\n- Pop only on clicks; outside count changes roll without it.\n- Set optimistic=\"false\" when the server decides the state.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `aria-label (UiReactionBar)` | `string` | 'Reactions' | Group name. |\n| `labels (UiReactionBar)` | `Partial<ReactionLabels>` | English | Group name, action names, count nouns, spoken pattern; merged over the defaults. |\n| `format (UiReactionBar)` | `(n: number) => string` | locale grouping | Count text for every action, e.g. compact. |\n| `uiReaction` | `ReactionKind` | required | like \\| comment \\| repost \\| share draw their icon; other kinds show the projected <svg>. |\n| `pressed` | `boolean` | false | On/off as aria-pressed. Two-way [(pressed)]. |\n| `count` | `number \\| null` | null | Public count. 0 hides the number until a reaction; null = toggle without a count. Two-way [(count)]. |\n| `label` | `string` | the kind's name | Action name; needed for custom kinds. |\n| `format` | `(n: number) => string` | the bar's | Count text for this action. |\n| `optimistic` | `boolean` | true | Click flips pressed and ±1 count itself; false = only emits toggled. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `toggled (UiReaction)` | `ReactionToggle` | After a click, with the new pressed and count. |\n| `pressedChange (UiReaction)` | `boolean` | Two-way half of pressed. |\n| `countChange (UiReaction)` | `number \\| null` | Two-way half of count. |\n\n## ReactionLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `group` | `string` | Group name; default 'Reactions'. |\n| `names` | `Record<string, string>` | Action names by kind: Like, Comment, Repost, Share. |\n| `units` | `Record<string, Partial<Record<Intl.LDMLPluralRule, string>>>` | Count nouns by kind and plural category: { one: 'like', other: 'likes' }. |\n| `withCount` | `string` | Spoken name with a count; default '{name}, {count} {unit}'. |\n\n## ReactionToggle\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `pressed` | `boolean` | New state. |\n| `count` | `number \\| null` | New count; null for a toggle without a count. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-reaction-bar-on` | `light-dark(var(--ui-hue-blue), sky blue)` | Pressed colour of every action, Clean look. |\n| `--ui-reaction-bar-like` | `var(--ui-hue-pink)` | Pressed like, Classic look. |\n| `--ui-reaction-bar-comment` | `color-mix(in srgb, var(--ui-hue-cyan) 70%, var(--ui-hue-blue))` | Pressed comment, Classic look. |\n| `--ui-reaction-bar-repost` | `var(--ui-hue-purple)` | Pressed repost, Classic look. |\n| `--ui-reaction-bar-share` | `var(--ui-text)` | Pressed share and custom kinds, Classic look. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab / Shift+Tab | Next / previous action; each is a tab stop. |\n| Enter or Space | Toggles the focused action, same pop and roll as a click. |\n\n## Accessibility\n- Named role=group of native buttons with aria-pressed.\n- Each name carries the pluralised count: 'Like, 128 likes', 'Share, 1 share'.\n- Icons and rolling digits are aria-hidden: nothing read twice.\n- Digits stay left to right in RTL pages.\n- Forced colors: every action keeps an edge; pressed ones use Highlight.\n- Dev-mode warning when a custom kind has no label.\n",
591
+ "keywords": "Buttons UiReactionBar UiReaction ReactionKind ReactionLabels ReactionToggle Reactions under posts, comments or updates in a feed. Any toggle with a public count: saves, upvotes."
592
+ },
593
+ {
594
+ "slug": "region-map",
595
+ "name": "Region Map",
596
+ "description": "A quiet map of Morocco with a pastel band of light running around its border, and a corner menu that switches to the United States, China, India, Brazil or Japan, shown among fading neighbours.",
597
+ "category": "Illustrations",
598
+ "pro": false,
599
+ "entryPoint": "./ui/region-map",
600
+ "selector": "ui-region-map",
601
+ "url": "/ai/region-map.json",
602
+ "markdown": "# Region Map\n\nA quiet map of Morocco with a pastel band of light running around its border, and a corner menu that switches to the United States, China, India, Brazil or Japan, shown among fading neighbours.\n\nAdd: `npx ochreui@latest add region-map`\nImport: `import { UiRegionMap } from './ui/region-map';`\nSelector: `<ui-region-map>`\nDocs: /components/region-map\n\n## When to use\n- A service area, sales territory or market focus in Morocco.\n- A section about local presence or exclusive coverage in the United States, China, India, Brazil or Japan, next to a short text.\n\n## When not to use\n- Maps that need cities, states, labels or exact borders: the outlines are simplified and unlabelled.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiRegionMap } from './ui/region-map';\n\n@Component({\n selector: 'app-coverage',\n imports: [UiRegionMap],\n template: `\n <section class=\"coverage\">\n <ui-region-map />\n <h3>Next-day service across Morocco</h3>\n <p>Our technicians reach every site from Tangier to Dakhla within one working day.</p>\n </section>\n `,\n styles: `\n .coverage { inline-size: min(420px, 100%); margin-inline: auto; }\n ui-region-map { inline-size: 100%; }\n h3 { margin: 8px 0 0; color: var(--ui-text); font-size: 15px; line-height: 22px; font-weight: 600; }\n p { margin: 4px 0 0; color: var(--ui-text-muted); font-size: 13px; line-height: 20px; }\n `,\n})\nexport class Coverage {}\n```\n\n## Rules\n- 540 : 440 box, inline-size min(560px, 100%); menu scale clamp(0.62, width / 540, 1) from the top-left.\n- Band: 14 s linear loop, clockwise from the northernmost point, layers at 0 / -0.42 / -0.84 s, glow outside the region only.\n- Switch: old map 320 ms fade + grow to 1.04, new map 520 ms fade + 0.94 to 1; band restarts.\n- Menu: open 420 ms morph, rows 380 ms slide (+60) and 220 ms fade (+110); close 300 ms; highlight appear 160 ms, glide 190 ms.\n- Pauses off-screen and in hidden tabs (animation-play-state) and resumes the band from the same pose when back.\n- Reduced motion or --ui-motion-scale: 0 (also when set after load): band rests at its start; menu and switch instant; press scale kept.\n- Outlines simplified from Natural Earth (public domain); Morocco from the Moroccan point-of-view file, southern provinces included with no internal line.\n- Morocco is one closed outline (southern provinces included) among closed neighbour outlines, with no off-shore fragments, filling the box inside a small padding.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `region` | `RegionMapRegion` | 'ma' | Region shown: 'ma' \\| 'us' \\| 'cn' \\| 'in' \\| 'br' \\| 'jp'. model(): two-way with [(region)]; picking in the menu writes it. |\n| `showSwitcher` | `boolean` | true | Shows the region menu in the top-left corner. |\n| `label` | `string \\| ((region: RegionMapRegion) => string)` | labels.maps[region] | Accessible name of the map (role=img). Empty hides the map from assistive tech. |\n| `labels` | `RegionMapLabelsInput` | English | regions (menu text per region), maps (map name per region), list (listbox name), button (button name, {name} = region). |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `regionChange` | `RegionMapRegion` | Emits when a region is picked in the menu (from the region model). |\n\n## RegionMapRegion\n\n`type RegionMapRegion = 'ma' | 'us' | 'cn' | 'in' | 'br' | 'jp'`\n\n## RegionMapLabels\n\n`type RegionMapLabels = { regions: Record<RegionMapRegion, string>; maps: Record<RegionMapRegion, string>; list: string; button: string }`\n\n## RegionMapLabelsInput\n\n`type RegionMapLabelsInput = Partial<Pick<RegionMapLabels, 'list' | 'button'>> & { regions?: Partial<Record<RegionMapRegion, string>>; maps?: Partial<Record<RegionMapRegion, string>> }`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-region-map-fill` | `light-dark(surface at 55%, slate at 9%)` | Region fill. |\n| `--ui-region-map-line` | `light-dark(--ui-border-strong, text at 24%)` | Region borders. |\n| `--ui-region-map-neighbor` | `light-dark(--ui-border-strong, text at 20%)` | Neighbour borders and coastlines, drawn across the whole frame and faded with distance from the region and at the frame edges. |\n| `--ui-region-map-band-1` | `lavender` | Eastern end of the band. |\n| `--ui-region-map-band-2` | `pink` | Middle of the band. |\n| `--ui-region-map-band-3` | `peach` | Western end of the band. |\n| `--ui-region-map-panel-radius` | `16px` | Corners of the open menu. |\n| `--ui-region-map-row-radius` | `10px` | Corners of a menu row and its highlight. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Enter / Space | Button: open on the current region. List: pick the highlighted region, close, focus the button. |\n| ArrowDown / ArrowUp | Button: open. List: move one row, no wrap. |\n| Home / End | First / last region. |\n| Escape | Close and focus the button. |\n| Tab | Close and move on. |\n\n## Accessibility\n- Map: role=img with aria-label from label (follows the region); the SVG is aria-hidden and not focusable; empty label: aria-hidden map.\n- Button: aria-haspopup=listbox, aria-expanded, aria-controls, aria-label \"Region: <name>\".\n- Listbox with aria-activedescendant and options with aria-selected; focus moves into the list on open; no type-ahead.\n- Keyboard-driven: highlight shown on the selected row on open plus a 1px ring; forced colors: Highlight/HighlightText.\n- Button hit area at least 24px when the menu is scaled to 62%.\n- Forced colors: land outline CanvasText, neighbours GrayText, in light and dark alike.\n",
603
+ "keywords": "Illustrations UiRegionMap RegionMapRegion RegionMapLabels RegionMapLabelsInput A service area, sales territory or market focus in Morocco. A section about local presence or exclusive coverage in the United States, China, India, Brazil or Japan, next to a short text."
604
+ },
605
+ {
606
+ "slug": "resizable",
607
+ "name": "Resizable",
608
+ "description": "Panes side by side or stacked with a line between them to drag. Sizes in percent with a min and a max, panes that fold away and come back, and full keyboard control on the line.",
609
+ "category": "Data display",
610
+ "pro": false,
611
+ "entryPoint": "./ui/resizable",
612
+ "selector": "ui-resizable-group, ui-resizable-panel, ui-resizable-handle",
613
+ "url": "/ai/resizable.json",
614
+ "markdown": "# Resizable\n\nPanes side by side or stacked with a line between them to drag. Sizes in percent with a min and a max, panes that fold away and come back, and full keyboard control on the line.\n\nAdd: `npx ochreui@latest add resizable`\nImport: `import { UiResizableGroup, UiResizablePanel, UiResizableHandle } from './ui/resizable';`\nSelector: `<ui-resizable-group, ui-resizable-panel, ui-resizable-handle>`\nDocs: /components/resizable\n\n## When to use\n- A list or sidebar next to a work area whose width people choose: jobs and details, files and an editor.\n- An editor above its output or log: nest a vertical group in a pane.\n- A pane that folds away and comes back (drag past half its min, or Enter on the line).\n\n## When not to use\n- Two views people switch between: use Tabs or Segmented Control.\n- A panel that slides over the page for a moment: use Dialog or Popover.\n- Only scrolling inside a fixed box: use Scroll Area.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiResizableGroup, UiResizableHandle, UiResizablePanel } from './ui/resizable';\n\n@Component({\n selector: 'app-job-console',\n imports: [UiResizableGroup, UiResizablePanel, UiResizableHandle],\n template: `\n <div class=\"frame\">\n <ui-resizable-group>\n <ui-resizable-panel [defaultSize]=\"30\" [minSize]=\"20\" [maxSize]=\"50\" collapsible>\n <nav aria-label=\"Jobs\">Nightly orders export · Refresh price cache · Rebuild search index</nav>\n </ui-resizable-panel>\n <ui-resizable-handle withHandle aria-label=\"Resize the job list\" />\n <ui-resizable-panel [defaultSize]=\"70\" [minSize]=\"40\">\n <ui-resizable-group direction=\"vertical\">\n <ui-resizable-panel [defaultSize]=\"65\">\n <p>Copies yesterday's orders to the warehouse in batches of 500.</p>\n </ui-resizable-panel>\n <ui-resizable-handle aria-label=\"Resize the log\" />\n <ui-resizable-panel [defaultSize]=\"35\" [minSize]=\"15\" collapsible>\n <pre>02:00:11 Wrote batch 1 of 37</pre>\n </ui-resizable-panel>\n </ui-resizable-group>\n </ui-resizable-panel>\n </ui-resizable-group>\n </div>\n `,\n styles: `\n .frame { height: 480px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); overflow: hidden; }\n nav, p, pre { margin: 0; padding: 14px; }\n `,\n})\nexport class JobConsole {}\n```\n\n## Rules\n- Panels and handles alternate as direct children of <ui-resizable-group>; nest a whole group inside a panel for the other direction.\n- Give the group's parent a height; sizes are percentages.\n- A handle trades space only with its two neighbouring panes.\n- Store [(layout)] (e.g. localStorage) and pass it back; it is written once per user change.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `direction (UiResizableGroup)` | `'horizontal' \\| 'vertical'` | 'horizontal' | Side by side or stacked. The group fills its parent; give the parent a height. |\n| `keyboardStep (UiResizableGroup)` | `number` | 5 | Arrow step in %; Shift doubles it. |\n| `layout (UiResizableGroup)` | `number[] \\| undefined` | undefined | Two-way. Every size in %, written after each user change (not per pointer move). Wins over defaultSize at start; wrong length is ignored. |\n| `defaultSize (UiResizablePanel)` | `number` | none | Starting size in %. Panes without one share what is left; all scaled to 100. |\n| `minSize (UiResizablePanel)` | `number` | 0 | Smallest size in %; drags, arrows and Home stop here. |\n| `maxSize (UiResizablePanel)` | `number` | 100 | Largest size in %. |\n| `collapsible (UiResizablePanel)` | `boolean` | false | Snaps to collapsedSize past half its min; Enter on the next handle folds and restores it. |\n| `collapsedSize (UiResizablePanel)` | `number` | 0 | Folded size in %. 0 = hidden and inert; more keeps an icon rail. |\n| `collapsed (UiResizablePanel)` | `boolean` | false | Two-way. Set from code to fold or unfold with a glide. |\n| `id (UiResizablePanel)` | `string` | generated | Target of the handle's aria-controls. |\n| `withHandle (UiResizableHandle)` | `boolean` | false | A small grip on the line. |\n| `aria-label (UiResizableHandle)` | `string` | 'Resize' | What it resizes: \"Resize the job list\". |\n| `labels (UiResizableHandle)` | `Partial<ResizableLabels>` | { resize: 'Resize' } | Fallback name and the spoken size, for translation. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `layoutChange (UiResizableGroup)` | `number[]` | After each user change: pointerup, a key, Enter, double-click, reset() or [(collapsed)]. |\n| `resizing (UiResizableGroup)` | `boolean` | True when a drag starts, false when it ends. |\n| `collapsedChange (UiResizablePanel)` | `boolean` | When the pane folds or opens, by any means. |\n\n## ResizableDirection\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `'horizontal' \\| 'vertical'` | `union` | Group direction. |\n\n## ResizableLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `resize` | `string` | Handle name when it has no aria-label. |\n| `size` | `(percent: number) => string` | Optional. Spoken size; default \"34%\" in the app locale. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-resizable-line` | `color-mix(in srgb, var(--ui-text) 7%, var(--ui-bg-surface))` | Line at rest (8% in Classic); var(--ui-border-input) under prefers-contrast: more. |\n| `--ui-resizable-line-active` | `color-mix(in srgb, var(--ui-text) 24%, var(--ui-bg-surface))` | Line on hover after 120ms, and while dragging (25% in Classic). |\n| `--ui-resizable-hit` | `var(--ui-space-3)` | Grab strip across the line; var(--ui-space-6) on touch. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Next handle; a folded pane's content is skipped. |\n| ← / → (↑ / ↓ when stacked) | Move 5%; Shift 10%. Follow the screen in RTL. From a folded pane, away from the edge opens it to its min. |\n| Home | Pane before the line to its min. |\n| End | Pane before the line to its max; folds a collapsible pane after it. |\n| Enter | Fold or restore the collapsible neighbour; focus stays. |\n| Double-click | The pair back to its default sizes. |\n\n## Accessibility\n- Handle: focusable role=separator, aria-orientation across the group, aria-valuenow/min/max of the pane before it, aria-valuetext \"34%\", aria-controls that pane.\n- Name each handle with aria-label; dev-mode warning when missing.\n- A pane folded to 0 is inert.\n- Focus ring inside the 12px grab strip, keyboard only (not after a mouse or touch drag).\n- Forced colors: line CanvasText, grip edge CanvasText, ring Highlight.\n",
615
+ "keywords": "Data display UiResizableGroup UiResizablePanel UiResizableHandle ResizableDirection ResizableLabels A list or sidebar next to a work area whose width people choose: jobs and details, files and an editor. An editor above its output or log: nest a vertical group in a pane. A pane that folds away and comes back (drag past half its min, or Enter on the line)."
616
+ },
617
+ {
618
+ "slug": "scroll-area",
619
+ "name": "Scroll Area",
620
+ "description": "A box that scrolls the browser's own way with a slim bar of its own: it shows on hover and while scrolling, the thumb drags and widens under the pointer, the track pages, and soft fades mark the edges with more to see. Vertical, sideways or both.",
621
+ "category": "Data display",
622
+ "pro": false,
623
+ "entryPoint": "./ui/scroll-area",
624
+ "selector": "ui-scroll-area",
625
+ "url": "/ai/scroll-area.json",
626
+ "markdown": "# Scroll Area\n\nA box that scrolls the browser's own way with a slim bar of its own: it shows on hover and while scrolling, the thumb drags and widens under the pointer, the track pages, and soft fades mark the edges with more to see. Vertical, sideways or both.\n\nAdd: `npx ochreui@latest add scroll-area`\nImport: `import { UiScrollArea } from './ui/scroll-area';`\nSelector: `<ui-scroll-area>`\nDocs: /components/scroll-area\n\n## When to use\n- A fixed-height list, log or panel inside a card.\n- A row wider than its card (attachments, chips, tabs), scrolled sideways.\n- Where the native scrollbar looks out of place but scrolling must stay native.\n\n## When not to use\n- The page itself: keep the window's scrollbar.\n- A sortable, selectable table: a data table has its own scroller.\n- Code: a code block scrolls its own lines.\n- User-resizable panes: put a Scroll Area inside each pane.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiScrollArea } from './ui/scroll-area';\n\n@Component({\n selector: 'app-release-notes',\n imports: [UiScrollArea],\n template: `\n <ui-scroll-area maxHeight=\"240\" fade label=\"Release notes\">\n <ul class=\"notes\">\n @for (note of notes; track note.version) {\n <li><strong>{{ note.version }}</strong> {{ note.summary }}</li>\n }\n </ul>\n </ui-scroll-area>\n `,\n styles: `\n .notes { margin: 0; padding: 4px 16px; list-style: none; }\n .notes li { padding: 10px 0; }\n `,\n})\nexport class ReleaseNotes {\n protected readonly notes = [\n { version: '4.2.0', summary: 'Shared dashboards can be pinned to the sidebar.' },\n { version: '4.1.3', summary: 'CSV exports keep the column order you set.' },\n { version: '4.1.2', summary: 'Faster search across archived projects.' },\n { version: '4.1.0', summary: 'Two-factor sign-in with passkeys.' },\n { version: '4.0.4', summary: 'Fixed time zones in weekly reports.' },\n { version: '4.0.0', summary: 'A new editor, with comments on any line.' },\n { version: '3.9.1', summary: 'Webhooks retry for up to a day.' },\n { version: '3.9.0', summary: 'Audit log filters by person and action.' },\n ];\n}\n```\n\n## Rules\n- Give it a height to scroll in: maxHeight, a fixed block-size, or flex: 1 with min-block-size: 0 in a column.\n- Name it with label or labelledBy, not aria-label on the tag: the name goes on the inner scrolling element.\n- viewport() returns the scrolling element, for scrollTo, scrollTop or an IntersectionObserver root.\n- class, style and id on <ui-scroll-area> land on the outer box.\n- With orientation=\"horizontal\" the content keeps its natural width, so flex rows don't wrap. The area itself fills the width it is given and never widens its grid or flex parent.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `orientation` | `'vertical' \\| 'horizontal' \\| 'both'` | 'vertical' | Which way it scrolls; the other axis is clipped. |\n| `type` | `'hover' \\| 'scroll' \\| 'always'` | 'hover' | Bar shows on hover or while scrolling; only while scrolling; or always while it overflows. |\n| `fade` | `boolean` | false | Edge fades (24px, Classic 28px) where there is more to scroll; each shrinks to 0 at its end. |\n| `maxHeight` | `number \\| string` | none | Grows with its content up to this, then scrolls. Number = px, or any CSS length. |\n| `label` | `string` | none | Accessible name of the scroll region (on the scrolling element). |\n| `labelledBy` | `string` | none | Id of a visible heading that names the region, instead of label. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `scrolled` | `Event` | The scrolling element's native scroll event. |\n\n## ScrollAreaOrientation\n\n`type ScrollAreaOrientation = 'vertical' | 'horizontal' | 'both'`\n\n## ScrollAreaType\n\n`type ScrollAreaType = 'hover' | 'scroll' | 'always'`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-scroll-area-thumb` | `color-mix(in oklab, var(--ui-text) 22%, transparent); 24% in Classic` | Thumb at rest. |\n| `--ui-scroll-area-thumb-hover` | `color-mix(in oklab, var(--ui-text) 38%, transparent); 40% in Classic` | Thumb while the pointer is on its track. |\n| `--ui-scroll-area-thumb-active` | `color-mix(in oklab, var(--ui-text) 50%, transparent); 54% in Classic` | Thumb while dragged. |\n| `--ui-scroll-area-fade` | `24px; 28px in Classic` | Longest edge fade. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Reaches the box only while it overflows. |\n| Arrow keys | Scroll a little (native). |\n| Page Up / Page Down / Space | Scroll a page (native). |\n| Home / End | Start / end (native, vertical scrollers). |\n\n## Accessibility\n- Scrolling is native: wheel, touch, keys, find in page and scrollIntoView all work.\n- The scrolling element is a region named by label or labelledBy, and a Tab stop only while it overflows.\n- The drawn bar is aria-hidden; keyboard scrolling does the same job.\n- Keyboard-only inset focus ring, drawn on the outer box so the fades never hide it.\n- Forced colors: CanvasText thumb, Highlight while hovered or dragged.\n",
627
+ "keywords": "Data display UiScrollArea ScrollAreaOrientation ScrollAreaType A fixed-height list, log or panel inside a card. A row wider than its card (attachments, chips, tabs), scrolled sideways. Where the native scrollbar looks out of place but scrolling must stay native."
628
+ },
629
+ {
630
+ "slug": "segmented-control",
631
+ "name": "Segmented Control",
632
+ "description": "Two to six options, one picked, with an indicator that glides to the choice, its leading edge a little ahead, and can be dragged along the row. A tray, chips or an underline; icons, counts and badges; a radiogroup or a tablist that works with every kind of Angular form.",
633
+ "category": "Navigation",
634
+ "pro": false,
635
+ "entryPoint": "./ui/segmented-control",
636
+ "selector": "ui-segmented-control",
637
+ "url": "/ai/segmented-control.json",
638
+ "markdown": "# Segmented Control\n\nTwo to six options, one picked, with an indicator that glides to the choice, its leading edge a little ahead, and can be dragged along the row. A tray, chips or an underline; icons, counts and badges; a radiogroup or a tablist that works with every kind of Angular form.\n\nAdd: `npx ochreui@latest add segmented-control`\nImport: `import { UiSegmentedControl, UiSegment, UiSegmentCount } from './ui/segmented-control';`\nSelector: `<ui-segmented-control>`\nDocs: /components/segmented-control\n\n## When to use\n- Switching between a few views of the same content: list/board, ranges, page sections.\n- A small choice that applies at once, with every option in sight.\n\n## When not to use\n- More than six options or long labels: use Select or a menu.\n- A choice that counts only when a form is saved: use radio buttons.\n- One thing on or off: use Switch.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { UiSegment, UiSegmentCount, UiSegmentedControl } from './ui/segmented-control';\n\n@Component({\n selector: 'app-agent-sections',\n imports: [UiSegmentedControl, UiSegment, UiSegmentCount],\n template: `\n <ui-segmented-control aria-label=\"Agent sections\" kind=\"tabs\" [(value)]=\"section\">\n <button uiSegment value=\"overview\" id=\"tab-overview\" aria-controls=\"panel-overview\">Overview</button>\n <button uiSegment value=\"runs\" id=\"tab-runs\" aria-controls=\"panel-runs\">Runs</button>\n <button uiSegment value=\"alerts\" id=\"tab-alerts\" aria-controls=\"panel-alerts\">Alerts <span uiSegmentCount>3</span></button>\n </ui-segmented-control>\n <section id=\"panel-overview\" role=\"tabpanel\" aria-labelledby=\"tab-overview\" [hidden]=\"section() !== 'overview'\">…</section>\n <section id=\"panel-runs\" role=\"tabpanel\" aria-labelledby=\"tab-runs\" [hidden]=\"section() !== 'runs'\">…</section>\n <section id=\"panel-alerts\" role=\"tabpanel\" aria-labelledby=\"tab-alerts\" [hidden]=\"section() !== 'alerts'\">…</section>\n `,\n})\nexport class AgentSections {\n protected readonly section = signal<string | null>('overview');\n}\n```\n\n## Rules\n- Put uiSegment on your own <button> elements inside ui-segmented-control; give each a value.\n- Name the group with aria-label or aria-labelledby; icon-only options need aria-label.\n- Bind [(value)], [formField], formControl, formControlName or ngModel.\n- With [formField], don't set disabled or name: the form sets them.\n- With kind=\"tabs\", add aria-controls to each option and role=\"tabpanel\" panels.\n- valueChange fires once per choice (on release after a drag); value is null until someone picks.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `value` | `T \\| null (model)` | null | Picked value; null until chosen (first enabled option takes Tab). |\n| `variant` | `'tray' \\| 'buttons' \\| 'underline'` | 'tray' | Track with a pill; chips with a sliding fill; tabs with a sliding line. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | 'md' | 24/28/32px; Classic 26/30/36; options ≥ 40px on touch. |\n| `fullWidth` | `boolean` | false | Fills the container with equal options. |\n| `kind` | `'radio' \\| 'tabs'` | 'radio' | radiogroup, or tablist (aria-controls on each option). |\n| `disabled` | `boolean` | false | Disables every option; forms set it. |\n| `name` | `string` | none | Hidden input for native submission; a native form reset restores the first value. Signal forms set it. |\n| `value (UiSegment)` | `T` | required | The value this option picks. |\n| `disabled (UiSegment)` | `boolean` | false | Skipped by arrows and drag; still shows as picked if it holds the value. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `valueChange` | `T \\| null` | Once per choice: click/tap, arrow key, release after a drag, or a native reset with name. Not on writes from code or forms. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-segmented-track` | `ink at 6%` | Tray track. |\n| `--ui-segmented-pill` | `light-dark(var(--ui-bg-surface), var(--ui-bg-muted))` | Tray pill, lighter than the track in dark. |\n| `--ui-segmented-fill` | `ink at 8%` | buttons indicator. |\n| `--ui-segmented-line` | `var(--ui-text)` | underline indicator. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Into the picked option, then out: one stop. |\n| ← / → | Previous/next option, focused and picked, wrapping; mirrored in RTL. |\n| ↑ / ↓ | Same as ← / →; not with kind=\"tabs\". |\n| Home / End | First / last option. |\n| Enter / Space | Picks the focused option. |\n\n## Accessibility\n- radiogroup + radio with aria-checked, or tablist + tab with aria-selected; indicator aria-hidden.\n- Counts and badges are part of the option name; dev warning when the group or an icon-only option has no name.\n- Roving tabindex; disabled options skipped; disabled control sets aria-disabled.\n- Inactive labels and icons ≥ 4.5:1; picked label in full ink.\n- Forced colors: picked option in Highlight; focus outline kept.\n",
639
+ "keywords": "Navigation UiSegmentedControl UiSegment UiSegmentCount SegmentedVariant SegmentedSize SegmentedKind Switching between a few views of the same content: list/board, ranges, page sections. A small choice that applies at once, with every option in sight."
640
+ },
641
+ {
642
+ "slug": "select",
643
+ "name": "Select",
644
+ "description": "Pick one option in a field that looks exactly like a Text Field: icons and a quieter second line per option, a gliding highlight, type-ahead, and a list in the top layer that is never cut off. Works with signal forms, reactive forms, ngModel or [(value)].",
645
+ "category": "Inputs",
646
+ "pro": false,
647
+ "entryPoint": "./ui/select",
648
+ "selector": "ui-select",
649
+ "url": "/ai/select.json",
650
+ "markdown": "# Select\n\nPick one option in a field that looks exactly like a Text Field: icons and a quieter second line per option, a gliding highlight, type-ahead, and a list in the top layer that is never cut off. Works with signal forms, reactive forms, ngModel or [(value)].\n\nAdd: `npx ochreui@latest add select`\nImport: `import { UiSelect, UiSelectTrigger, UiOption, UiOptionIcon, UiSelectList } from './ui/select';`\nSelector: `<ui-select>`\nDocs: /components/select\n\n## When to use\n- One option from a short or medium list in a form: team, region, time zone, plan.\n- Settings rows next to Text Fields, with the same height, edge and focus.\n\n## When not to use\n- Two to four options that should stay visible: use Segmented Control.\n- Long searchable lists or several picks: use Combobox.\n- Actions rather than a value: use a menu.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form, required } from '@angular/forms/signals';\nimport { UiOption, UiSelect, UiSelectTrigger } from './ui/select';\n\n@Component({\n selector: 'app-deploy-settings',\n imports: [UiSelect, UiSelectTrigger, UiOption, FormField],\n template: `\n <ui-select label=\"Data region\" hint=\"Where your files and backups live.\">\n <button uiSelect [formField]=\"f.region\"></button>\n @for (r of regions; track r.id) {\n <ui-option [value]=\"r.id\" [description]=\"r.note\" [disabled]=\"r.soon\">{{ r.name }}</ui-option>\n }\n </ui-select>\n `,\n})\nexport class DeploySettings {\n protected readonly regions = [\n { id: 'fra', name: 'Frankfurt', note: 'Data stays in the EU', soon: false },\n { id: 'iad', name: 'Northern Virginia', note: 'Fastest for the Americas', soon: false },\n { id: 'gru', name: 'São Paulo', note: 'Opens in March', soon: true },\n ];\n private readonly model = signal({ region: 'fra' as string | null });\n protected readonly f = form(this.model, (p) => required(p.region));\n}\n```\n\n## Rules\n- Put uiSelect on an empty <button> inside ui-select, with ui-option elements next to it.\n- Bind [formField], formControl(Name), ngModel or [(value)] on the button.\n- With [formField], set required and disabled in the schema, not as attributes.\n- Object values need compareWith; name submits String(value) only.\n- Pass the error string you want shown; the field doesn't read form state itself.\n- Without a label, give the button an aria-label.\n- Needs overlay.ts next to select.ts (the CLI adds it): the placement, Escape and outside-press layer shared by the floating components.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | none | Above the field; names the field and the list. Clicking focuses the field without opening. |\n| `hint` | `string` | none | Quiet line under the field; the error replaces it. |\n| `error` | `string \\| null \\| undefined` | none | Invalid state: red edge, aria-invalid, message in place of the hint. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | 'md' | 28/32/36px; Classic 32/36/40; touch 34/38/42 with 16px text. |\n| `optional` | `boolean` | false | \"Optional\" after the label, also spoken. |\n| `labels` | `Partial<SelectLabels>` | English | Translations: optional, placeholder. |\n| `value (UiSelectTrigger)` | `T \\| null (model)` | null | The chosen value; null shows the placeholder. [(value)] or a form binding. |\n| `open (UiSelectTrigger)` | `boolean (model)` | false | Whether the list shows; [(open)] opens it from code. |\n| `placeholder (UiSelectTrigger)` | `string` | labels.placeholder | Shown while nothing is chosen. |\n| `compareWith (UiSelectTrigger)` | `(a: T, b: T) => boolean` | Object.is | Matches the value to an option, for object values. |\n| `name (UiSelectTrigger)` | `string` | none | Submits String(value) through a hidden input. |\n| `required (UiSelectTrigger)` | `boolean` | false | Sets aria-required; signal forms set it from the schema. |\n| `id (UiSelectTrigger)` | `string` | generated | Kept; the label's for points at it. |\n| `aria-describedby (UiSelectTrigger)` | `string` | none | Your own descriptions, kept alongside the hint or error. Set it as aria-describedby=\"…\", not [attr.aria-describedby]. |\n| `value (UiOption)` | `unknown` | none | What the form gets when it is picked. |\n| `description (UiOption)` | `string` | none | Quieter second line, read as the description. |\n| `disabled (UiOption)` | `boolean` | false | Dimmed; pointer, keys and type-ahead skip it. |\n| `textValue (UiOption)` | `string` | its text | What the field shows and type-ahead matches. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `valueChange (UiSelectTrigger)` | `T \\| null` | When another option is picked, by pointer, keys or type-ahead. |\n| `openChange (UiSelectTrigger)` | `boolean` | When the list opens or closes. |\n\n## SelectLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `optional` | `string` | Tag after the label. |\n| `placeholder` | `string` | Default placeholder (\"Choose…\"). |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-text-field-edge` | `var(--ui-hairline)` | Resting edge (shared with Text Field). |\n| `--ui-text-field-edge-hover` | `text at 18%` | Hover edge. |\n| `--ui-text-field-edge-focus` | `var(--ui-border-input)` | Edge while the list is open, ≥ 3:1. |\n| `--ui-text-field-radius` | `7px` | Corners (Classic 10px). |\n| `--ui-select-panel-max-height` | `288px` | Tallest the list gets before it scrolls. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| ↓ / ↑ | Closed: open on the chosen option. Open: move one option, no wrap, skipping disabled. |\n| Enter / Space | Open, or pick the active option and close. |\n| Home / End | First / last option while open. |\n| Page Up / Page Down | Same as Home / End. |\n| Letters | Type-ahead (0.65s buffer, Space joins it); a repeated letter cycles. Closed: picks directly. |\n| Esc | Close without changing; stops there. |\n| Tab | Close without picking and move on. |\n\n## Accessibility\n- button role=combobox aria-haspopup=listbox; focus stays on it, aria-activedescendant while open.\n- Named by the label only (no double read); aria-controls only while open.\n- Options: role=option, aria-selected, aria-disabled, named by the label and described by the second line.\n- The active row is the soft highlight, for pointer and keys alike; forced colors use Highlight.\n- Placeholder, hint and descriptions ≥ 4.5:1; focus ring on keyboard focus only; dev warning without a name.\n",
651
+ "keywords": "Inputs UiSelect UiSelectTrigger UiOption UiOptionIcon UiSelectList SelectSize SelectLabels One option from a short or medium list in a form: team, region, time zone, plan. Settings rows next to Text Fields, with the same height, edge and focus."
652
+ },
653
+ {
654
+ "slug": "separator",
655
+ "name": "Separator",
656
+ "description": "A thin line between groups of content: across a card, upright between tools, or with a word in the middle. Decorative by default, or a real separator for screen readers.",
657
+ "category": "Data display",
658
+ "pro": false,
659
+ "entryPoint": "./ui/separator",
660
+ "selector": "ui-separator",
661
+ "url": "/ai/separator.json",
662
+ "markdown": "# Separator\n\nA thin line between groups of content: across a card, upright between tools, or with a word in the middle. Decorative by default, or a real separator for screen readers.\n\nAdd: `npx ochreui@latest add separator`\nImport: `import { UiSeparator } from './ui/separator';`\nSelector: `<ui-separator>`\nDocs: /components/separator\n\n## When to use\n- Between groups inside a card, a list or a menu: above a footer, between settings sections.\n- Upright between groups of toolbar controls, or between stats in a header.\n- As a labelled break in a feed (Today, Earlier) or an \"or\" between two alternatives.\n\n## When not to use\n- Between every row of a list: spacing or a hairline on the rows is calmer.\n- Around content that already sits on its own card.\n- As a heading people navigate by: use a real heading.\n- Inside a dropdown menu: the menu draws its own dividers.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiSeparator } from './ui/separator';\n\n@Component({\n selector: 'app-run-stats',\n imports: [UiSeparator],\n template: `\n <div class=\"stats\">\n <span>12 runs</span>\n <ui-separator orientation=\"vertical\" />\n <span>1 failed</span>\n </div>\n `,\n styles: `\n .stats { display: flex; align-items: center; gap: 8px; }\n `,\n})\nexport class RunStats {}\n```\n\n## Rules\n- Spacing first, line second: add a separator only where spacing alone doesn't show the break.\n- Keep labels to one or two words; a sentence should be a heading.\n- A vertical separator needs a flex row with align-items: center and a gap around it.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `orientation` | `'horizontal' \\| 'vertical'` | 'horizontal' | Horizontal spans its container. Vertical is a short upright line centred in a flex row. |\n| `label` | `string` | none | A word or two in the middle of a horizontal line. Long text wraps; each side keeps at least 12px of line. On a vertical separator it is only the accessible name. Text projected into the element is used when label is not set. |\n| `decorative` | `boolean` | true | Hidden from assistive tech. Set false for role=\"separator\", named by the label. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-separator-color` | `--ui-hairline; --ui-border with data-ui-look=\"tray\"` | Line color. |\n| `--ui-separator-width` | `0.5px; 1px with data-ui-look=\"tray\"` | Line thickness. |\n| `--ui-separator-length` | `16px; 18px with data-ui-look=\"tray\"` | Height of a vertical separator. |\n\n## Accessibility\n- Decorative by default: role=\"none\", so it is skipped. A label stays readable as plain text; only the two lines are hidden.\n- With decorative set to false it is role=\"separator\", with aria-orientation=\"vertical\" when upright and the label as its name.\n- Never focusable.\n- In forced-colors mode the line uses the system text color.\n",
663
+ "keywords": "Data display UiSeparator SeparatorOrientation Between groups inside a card, a list or a menu: above a footer, between settings sections. Upright between groups of toolbar controls, or between stats in a header. As a labelled break in a feed (Today, Earlier) or an \"or\" between two alternatives."
664
+ },
665
+ {
666
+ "slug": "shimmer-loader",
667
+ "name": "Shimmer Loader",
668
+ "description": "Gray placeholder blocks that share one soft band of light pinned to the window, so every block on the page brightens in a single sweep, plus shimmering status text that stays real text.",
669
+ "category": "Motion",
670
+ "pro": false,
671
+ "entryPoint": "./ui/shimmer-loader",
672
+ "selector": "[uiShimmerBlock], [uiShimmerText]",
673
+ "url": "/ai/shimmer-loader.json",
674
+ "markdown": "# Shimmer Loader\n\nGray placeholder blocks that share one soft band of light pinned to the window, so every block on the page brightens in a single sweep, plus shimmering status text that stays real text.\n\nAdd: `npx ochreui@latest add shimmer-loader`\nImport: `import { UiShimmerBlock, UiShimmerText } from './ui/shimmer-loader';`\nSelector: `<[uiShimmerBlock], [uiShimmerText]>`\nDocs: /components/shimmer-loader\n\n## When to use\n- Placeholders shaped like the cards, rows or profiles on their way.\n- A shimmering status line while an answer or a long task is written.\n\n## When not to use\n- Waits under about 300ms: a flash of placeholders feels slower.\n- Measurable progress: use a progress bar.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiShimmerBlock, UiShimmerText } from './ui/shimmer-loader';\n\n@Component({\n selector: 'app-post-placeholder',\n imports: [UiShimmerBlock, UiShimmerText],\n template: `\n <div class=\"post\" aria-busy=\"true\" aria-label=\"Loading post\">\n <span uiShimmerBlock circle [width]=\"36\"></span>\n <div class=\"lines\">\n <span uiShimmerBlock [width]=\"120\" [height]=\"10\"></span>\n <span uiShimmerBlock [width]=\"80\" [height]=\"8\"></span>\n </div>\n </div>\n <p uiShimmerText class=\"status\">Writing a summary…</p>\n `,\n styles: `\n :host { display: grid; gap: 16px; }\n .post { display: flex; align-items: center; gap: 10px; }\n .lines { display: grid; gap: 6px; flex: 1; }\n .status { margin: 0; font-size: 14px; font-weight: 500; }\n `,\n})\nexport class PostPlaceholder {}\n```\n\n## Rules\n- Put uiShimmerBlock on an empty element (span); give it the size of the content it stands in for.\n- The consumer owns aria-busy on the container; blocks add none.\n- Font, size and weight of uiShimmerText come from your own styles.\n- Sweeps pause off-screen and in hidden tabs; blocks resume on one shared clock.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `width` | `number \\| string` | '100%' | UiShimmerBlock. Number = px, string = any CSS length; never wider than its parent. |\n| `height` | `number \\| string` | 12 | UiShimmerBlock. Number = px; ignored by circle. |\n| `radius` | `number \\| string` | 6 | UiShimmerBlock. Corner radius; number = px. |\n| `circle` | `boolean` | false | UiShimmerBlock. Round, width for both sides (avatars). |\n| `duration` | `number` | 2 | UiShimmerText. Seconds per pass of the band; 0 or less falls back to 2. |\n\n## ShimmerLength\n\n`type ShimmerLength = number | string`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-shimmer-loader-bg` | `light-dark(color-mix(in srgb, var(--ui-text) 8%, var(--ui-bg-surface)), color-mix(in srgb, var(--ui-text) 7%, var(--ui-bg-surface)))` | Block fill, about 1.18:1 against the surface. |\n| `--ui-shimmer-loader-sheen` | `light-dark(color-mix(in srgb, var(--ui-text) 1%, var(--ui-bg-surface)), color-mix(in srgb, var(--ui-text) 15%, var(--ui-bg-surface)))` | The passing light on blocks. |\n| `--ui-shimmer-loader-speed` | `2200ms` | One sweep of the block band. |\n| `--ui-shimmer-loader-radius` | `6px` | Block corners when radius is not set. |\n| `--ui-shimmer-loader-text` | `var(--ui-text-muted)` | Shimmer text at rest. |\n| `--ui-shimmer-loader-glint` | `light-dark(color-mix(in srgb, var(--ui-shimmer-loader-text) 9%, var(--ui-bg-surface)), var(--ui-text))` | The band in the text. |\n\n## Accessibility\n- Blocks are aria-hidden; put aria-busy=\"true\" on the loading container and set it to false when content arrives.\n- Shimmer text stays real text, read once; rest colour --ui-text-muted (4.5:1 or more).\n- No live region: wrap the text in role=\"status\" to announce label changes.\n- dir=\"auto\" on the text unless you set dir, so a trailing ellipsis stays at the end in RTL.\n- Forced colors: blocks get a GrayText outline, text turns plain CanvasText; reduced motion: flat grey blocks and plain text.\n",
675
+ "keywords": "Motion UiShimmerBlock UiShimmerText ShimmerLength Placeholders shaped like the cards, rows or profiles on their way. A shimmering status line while an answer or a long task is written."
676
+ },
677
+ {
678
+ "slug": "side-folder",
679
+ "name": "Side Folder",
680
+ "description": "A glassy blue folder standing on its side with three pages peeking out past its frosted front pocket. Point at it and the pocket swings toward you while each page slides further out.",
681
+ "category": "Illustrations",
682
+ "pro": false,
683
+ "entryPoint": "./ui/side-folder",
684
+ "selector": "ui-side-folder",
685
+ "url": "/ai/side-folder.json",
686
+ "markdown": "# Side Folder\n\nA glassy blue folder standing on its side with three pages peeking out past its frosted front pocket. Point at it and the pocket swings toward you while each page slides further out.\n\nAdd: `npx ochreui@latest add side-folder`\nImport: `import { UiSideFolder } from './ui/side-folder';`\nSelector: `<ui-side-folder>`\nDocs: /components/side-folder\n\n## When to use\n- Feature cards about files, uploads, storage or a knowledge base, and empty states for documents.\n- Bento grids that want a quiet, friendly picture above the text.\n\n## When not to use\n- Showing real files: the pages only carry placeholder lines.\n- Dark sections: the drawing is made for light surfaces and does not change in dark mode.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiSideFolder } from './ui/side-folder';\n\n@Component({\n selector: 'app-drive-card',\n imports: [UiSideFolder],\n template: `\n <article>\n <ui-side-folder />\n <h3>Shared drive</h3>\n <p>Keep every draft in one place.</p>\n </article>\n `,\n styles: `\n article { max-inline-size: 360px; padding: 8px 8px 20px; border-radius: 16px; background: var(--ui-bg-canvas); box-shadow: inset 0 0 0 1px var(--ui-hairline); }\n h3 { margin: 4px 12px 0; color: var(--ui-text); font-size: 15px; line-height: 22px; font-weight: 600; }\n p { margin: 4px 12px 0; color: var(--ui-text-muted); font-size: 13px; line-height: 20px; }\n `,\n})\nexport class DriveCard {}\n```\n\n## Rules\n- It is 3 : 2 and up to 560px wide by default: set another width with your own class.\n- Hover opens it only over the folder itself, and only on devices that can hover; touch screens see it closed.\n- Reduced motion or --ui-motion-scale: 0 makes the pose change instant.\n- Set label=\"\" when a heading next to it already says the same thing.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | a sentence describing the folder | What screen readers hear. \"\" hides the drawing from them (decorative). |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-side-folder-back` | `#56b5eb (sky blue)` | Back cover. |\n| `--ui-side-folder-back-sheen` | `rgb(255 255 255 / 0.2)` | Soft light across the top of the back cover. |\n| `--ui-side-folder-glass-1` | `rgb(104 196 246 / 0.5)` | Pocket glass at the top. Keep it translucent. |\n| `--ui-side-folder-glass-2` | `rgb(52 118 166 / 0.72)` | Pocket glass at the bottom, deeper. Keep it translucent. |\n| `--ui-side-folder-rim` | `rgb(255 255 255 / 0.32)` | Thin rim around the pocket. |\n| `--ui-side-folder-paper-1` | `#fff` | Paper at the top. |\n| `--ui-side-folder-paper-2` | `#ebf2f9` | Paper at the bottom. |\n| `--ui-side-folder-paper-edge` | `#d6dce3` | Paper outline. |\n| `--ui-side-folder-line` | `#dfe2e6` | Placeholder lines. |\n| `--ui-side-folder-shadow` | `rgb(36 118 186 / 0.2)` | Shadow under the folder; a glow on dark pages. |\n\n## Accessibility\n- One role=img named by label; the drawing is aria-hidden.\n- label=\"\" makes it decorative: aria-hidden, no role.\n- Nothing focusable; the hover effect is decoration.\n- forced-color-adjust: none keeps the drawing intact in forced colours.\n- The drawing stays left to right in RTL pages.\n",
687
+ "keywords": "Illustrations UiSideFolder Feature cards about files, uploads, storage or a knowledge base, and empty states for documents. Bento grids that want a quiet, friendly picture above the text."
688
+ },
689
+ {
690
+ "slug": "skeleton",
691
+ "name": "Skeleton",
692
+ "description": "Gray shapes sized like the content they stand in for, with a soft sheen across all of them at once. A Loading wrapper gives the area one busy status and fades in late, so fast loads never flash.",
693
+ "category": "Feedback",
694
+ "pro": false,
695
+ "entryPoint": "./ui/skeleton",
696
+ "selector": "ui-skeleton, ui-loading",
697
+ "url": "/ai/skeleton.json",
698
+ "markdown": "# Skeleton\n\nGray shapes sized like the content they stand in for, with a soft sheen across all of them at once. A Loading wrapper gives the area one busy status and fades in late, so fast loads never flash.\n\nAdd: `npx ochreui@latest add skeleton`\nImport: `import { UiSkeleton, UiLoading } from './ui/skeleton';`\nSelector: `<ui-skeleton, ui-loading>`\nDocs: /components/skeleton\n\n## When to use\n- A list, table, card or panel waiting for its data: the layout holds and nothing shifts when the data arrives.\n- Text, avatars, badges and buttons of known size: give each skeleton the size of what it replaces.\n- Wrap the skeletons of one area in ui-loading: one status for screen readers, no flash when the data is quick.\n\n## When not to use\n- One running action: use a spinner in the button or row.\n- An agent thinking or writing: use a thinking state.\n- Data that never arrived: show an empty state, not skeletons forever.\n\n## Usage\n\n```ts\nimport { Component, input } from '@angular/core';\nimport { UiLoading, UiSkeleton } from './ui/skeleton';\n\nexport interface Deploy {\n id: string;\n service: string;\n}\n\n@Component({\n selector: 'app-deploy-list',\n imports: [UiLoading, UiSkeleton],\n template: `\n @if (deploys(); as deploys) {\n <ul class=\"deploys\">\n @for (d of deploys; track d.id) {\n <li><span class=\"mark\"></span><span class=\"name\">{{ d.service }}</span></li>\n }\n </ul>\n } @else {\n <ui-loading class=\"deploys\" label=\"Loading deploys\">\n @for (w of [132, 148, 140]; track $index) {\n <div>\n <ui-skeleton width=\"16\" height=\"16\" radius=\"4\" />\n <ui-skeleton class=\"name\" line [width]=\"w\" height=\"10\" />\n </div>\n }\n </ui-loading>\n }\n `,\n styles: `\n .deploys { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }\n .deploys > * { display: flex; align-items: center; gap: 12px; }\n .mark { width: 16px; height: 16px; border-radius: 4px; background: var(--ui-accent); }\n .name { flex: 1; font-size: var(--ui-text-base); line-height: var(--ui-leading-base); }\n `,\n})\nexport class DeployList {\n deploys = input<Deploy[]>();\n}\n```\n\n## Rules\n- Always pair skeletons with ui-loading (or another announced loading message).\n- Size each skeleton like the content it replaces; use line for text bars so rows keep their height.\n- Put the real list's class on ui-loading.\n- Swap to the data at once, without a fade.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `width` | `number \\| string` | 100% | UiSkeleton. Number = px, string = any CSS length. Never wider than its parent. Left out, it fills the available space (also in a flex row); fixed widths don't shrink. |\n| `height` | `number \\| string` | 12 | UiSkeleton. Height of the shape. |\n| `radius` | `number \\| string` | --ui-radius-sm | UiSkeleton. Corner radius; \"50%\" with equal width and height makes a circle. |\n| `line` | `boolean \\| number \\| string` | off | UiSkeleton. Centres the shape in a box one text line tall (bare = 1lh of the current text, or a length; a number is px, 0 turns it off). Classes and styles on the element go to that box and override its layout. |\n| `label` | `string` | Loading | UiLoading. What is loading, for screen readers. |\n| `class` | `attribute` | none | UiLoading. Put the real layout's class on it. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-skeleton-bg` | `--ui-bg-placeholder` | Shape fill. Tuned for cards; set it a step darker on tinted surfaces. |\n| `--ui-skeleton-sheen` | `--ui-bg-placeholder-sheen` | The passing highlight. |\n| `--ui-skeleton-speed` | `1600ms` | One sheen cycle: a quick pass, then rest. No sheen with reduced motion. |\n| `--ui-skeleton-delay` | `150ms` | How long ui-loading stays invisible before fading in. Kept with reduced motion. |\n\n## Accessibility\n- Every shape is aria-hidden.\n- ui-loading is role=\"status\" with aria-busy=\"true\" and aria-label: a name when browsing. A status inserted already filled is not reliably announced; use a persistent live region to announce loading.\n- Remove ui-loading when the data arrives; do not flip aria-busy.\n- Nothing focusable inside ui-loading.\n- Forced colors: shapes get a GrayText border.\n",
699
+ "keywords": "Feedback UiSkeleton UiLoading SkeletonLength A list, table, card or panel waiting for its data: the layout holds and nothing shifts when the data arrives. Text, avatars, badges and buttons of known size: give each skeleton the size of what it replaces. Wrap the skeletons of one area in ui-loading: one status for screen readers, no flash when the data is quick."
700
+ },
701
+ {
702
+ "slug": "smart-recommendation",
703
+ "name": "Smart Recommendation",
704
+ "description": "A suggestion card that says what to do, why and how sure it is, with the other options one menu away and a one-click Accept with Undo.",
705
+ "category": "Cards",
706
+ "pro": false,
707
+ "entryPoint": "./ui/smart-recommendation",
708
+ "selector": "ui-smart-recommendation",
709
+ "url": "/ai/smart-recommendation.json",
710
+ "markdown": "# Smart Recommendation\n\nA suggestion card that says what to do, why and how sure it is, with the other options one menu away and a one-click Accept with Undo.\n\nAdd: `npx ochreui@latest add smart-recommendation`\nImport: `import { UiSmartRecommendation, UiRecommendationReason } from './ui/smart-recommendation';`\nSelector: `<ui-smart-recommendation>`\nDocs: /components/smart-recommendation\n\n## When to use\n- Suggesting the next step your app or assistant thinks is best, with a way out.\n- Settings people rarely revisit but should get a nudge on: backups, sync modes, plans.\n\n## When not to use\n- Choices with no clear favorite: show them side by side.\n- Changes that can't be undone: confirm in a dialog.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { Recommendation, UiSmartRecommendation } from './ui/smart-recommendation';\n\n@Component({\n selector: 'app-export-mode',\n imports: [UiSmartRecommendation],\n template: `\n <ui-smart-recommendation [options]=\"modes\" (accept)=\"save($event)\" (undo)=\"revert($event)\" />\n `,\n})\nexport class ExportMode {\n protected readonly modes: Recommendation[] = [\n { id: 'delta', label: 'Delta export', reason: 'Only 3% of records changed since Monday, so a delta export takes minutes.', signal: 3 },\n { id: 'full', label: 'Full export', reason: 'Rewrites every record. Needed after a schema change, but takes about an hour.', signal: 1 },\n ];\n\n protected save(mode: Recommendation) {\n console.log('Export mode set to', mode.id);\n }\n\n protected revert(mode: Recommendation) {\n console.log('Export mode reverted from', mode.id);\n }\n}\n```\n\n## Rules\n- Put the recommended option first; give every option a unique id.\n- Save the choice in (accept) and revert it in (undo). The component never lower-cases labels: pass labels.accept to change the wording.\n- The card is min(440px, 100%) wide: set --ui-smart-recommendation-width to change it.\n- Host styling (padding, corners, fill, edge) is inline: restyle through the --ui-smart-recommendation-* variables.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `options` | `readonly Recommendation[]` | required | Best first; the rest are alternatives. One option hides Alternatives; none renders nothing. |\n| `title` | `string` | 'Smart recommendation' | Card heading and region name. |\n| `labels` | `Partial<SmartRecommendationLabels>` | English | Every visible and spoken string, for translation. |\n| `open` | `boolean` | true | Two-way. Whether the reason shows; the header toggles it. |\n| `selected` | `string \\| undefined` | undefined | Two-way. Id of the option shown; unset or unknown shows the first. |\n| `accepted` | `boolean` | false | Two-way. True while the shown option is accepted and Undo is offered. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `accept` | `Recommendation` | The option shown, when Accept is pressed. |\n| `undo` | `Recommendation` | The same option, when Undo is pressed. |\n| `openChange` | `boolean` | Every change of open, when the header folds or unfolds the card. |\n| `selectedChange` | `string \\| undefined` | Every change of selected, when an option is picked in the menu. |\n| `acceptedChange` | `boolean` | Every change of accepted, on Accept and on Undo. |\n\n## Recommendation\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | `string` | Unique within the list. |\n| `label` | `string` | Name in the menu, the Accept button and the status, used as written. |\n| `reason` | `string` | Why, in a sentence or two. Use uiRecommendationReason for markup. |\n| `signal` | `RecommendationSignal` | 0 to 3: no, weak, moderate or strong signal. |\n\n## RecommendationSignal\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `(union)` | `0 \\| 1 \\| 2 \\| 3` | How sure the app is. |\n\n## SmartRecommendationLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `alternatives` | `string` | Default \"Alternatives\". |\n| `accept` | `(label: string) => string` | Default \"Accept {label}\". |\n| `accepted` | `(label: string) => string` | Default \"{label} accepted\"; shown and announced. |\n| `undo` | `string` | Default \"Undo\". |\n| `recommended` | `string` | Badge on the first option in the menu. Default \"Recommended\". |\n| `alternative` | `string` | Header badge while another option is shown. Default \"Alternative\". |\n| `signal` | `readonly [string, string, string, string]` | Words for signal 0 to 3. Default \"No signal\", \"Weak signal\", \"Moderate signal\", \"Strong signal\". |\n\n## Template: uiRecommendationReason\n\nRenders the reason with markup; bold text takes the card's ink. Context: `Recommendation`.\n\n```html\n<ui-smart-recommendation [options]=\"modes\">\n <ng-template uiRecommendationReason let-o>{{ o.reason }} <strong>{{ o.label }}</strong> is ready.</ng-template>\n</ui-smart-recommendation>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-smart-recommendation-width` | `440px` | Widest the card grows; it shrinks with its container. |\n| `--ui-smart-recommendation-radius` | `10px; Classic 16px` | Corners; in Classic the card, with the tray 6px around it. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Moves between header, Alternatives and Accept or Undo; inside the menu, closes it and moves on. |\n| Enter Space | Folds the card, opens the alternatives, picks an option, accepts or undoes. |\n| ArrowDown ArrowUp | On Alternatives, opens the menu on the first or last option; in the menu, moves with wrapping. |\n| Home End | First or last option in the menu. |\n| Escape | Closes the menu and returns focus to Alternatives. |\n\n## Accessibility\n- A region named by its title. The header is a button with aria-expanded and aria-controls; the folded reason is inert and hidden.\n- Alternatives opens a menu of menuitemradio items labelled by the button; each item is read with its signal words.\n- Focus moves into the menu, back to Alternatives after a pick, to Undo after Accept and to Accept after Undo. Accepting is announced politely.\n- Coloured text is darkened to 4.5:1; forced colors keep the edges of the card, buttons, menu and badges, and the bars keep the level.\n",
711
+ "keywords": "Cards UiSmartRecommendation UiRecommendationReason Recommendation RecommendationSignal SmartRecommendationLabels Suggesting the next step your app or assistant thinks is best, with a way out. Settings people rarely revisit but should get a nudge on: backups, sync modes, plans."
712
+ },
713
+ {
714
+ "slug": "spinner",
715
+ "name": "Spinner",
716
+ "description": "A small turning arc for work that is running now. A faint ring in the text color, any size, inside a button or a status row, announced only when it has a label.",
717
+ "category": "Feedback",
718
+ "pro": false,
719
+ "entryPoint": "./ui/spinner",
720
+ "selector": "ui-spinner",
721
+ "url": "/ai/spinner.json",
722
+ "markdown": "# Spinner\n\nA small turning arc for work that is running now. A faint ring in the text color, any size, inside a button or a status row, announced only when it has a label.\n\nAdd: `npx ochreui@latest add spinner`\nImport: `import { UiSpinner } from './ui/spinner';`\nSelector: `<ui-spinner>`\nDocs: /components/spinner\n\n## When to use\n- Work running now that finishes by itself: a run, a check, connecting, saving.\n- As a button's icon while its action runs.\n- As the status icon of a still-running row.\n\n## When not to use\n- A whole region waiting for data: use a skeleton.\n- An agent thinking or writing: use a thinking state.\n- Work whose length is known: show real progress.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { UiSpinner } from './ui/spinner';\n\n@Component({\n selector: 'app-connect-github',\n imports: [UiSpinner],\n template: `\n <button type=\"button\" class=\"connect\" [attr.aria-disabled]=\"connecting() || null\" (click)=\"connect()\">\n @if (connecting()) {\n <ui-spinner />\n Connecting\n } @else {\n Connect GitHub\n }\n </button>\n\n <p><ui-spinner [size]=\"12\" label=\"Checking domain\" /></p>\n `,\n styles: `\n .connect { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-inline-size: 140px; }\n `,\n})\nexport class ConnectGithub {\n connecting = signal(false);\n\n async connect() {\n if (this.connecting()) return;\n this.connecting.set(true);\n try {\n await fetch('/api/integrations/github', { method: 'POST' });\n } finally {\n this.connecting.set(false);\n }\n }\n}\n```\n\n## Rules\n- Color it with the CSS color property; it draws in currentColor.\n- In a button, swap the icon for the spinner and the text for an -ing verb, use aria-disabled (not disabled) and keep the button's width.\n- Only label it when no visible text next to it says what is running.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `size` | `number` | --ui-spinner-size (14px) | Width and height in px; the stroke scales with it. Invalid values fall back to the CSS default. |\n| `label` | `string` | none | Makes it role=\"status\" with this name. Without it the spinner is aria-hidden. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-spinner-speed` | `800ms; 750ms with data-ui-look=\"tray\"` | One full turn. Three times slower with reduced motion. |\n| `--ui-spinner-size` | `var(--ui-icon-sm) (14px)` | Width and height when size is not set. |\n| `color` | `inherited` | The spinner draws in currentColor. |\n\n## Accessibility\n- With a label: role=\"status\" and aria-label, so it has a name when browsing.\n- A status inserted already filled is not reliably announced: for announcements keep a persistent live region or set aria-busy on the updating area.\n- Without a label: aria-hidden, so nearby text carries the meaning.\n- Draws in currentColor, so it has the contrast of the surrounding text.\n",
723
+ "keywords": "Feedback UiSpinner Work running now that finishes by itself: a run, a check, connecting, saving. As a button's icon while its action runs. As the status icon of a still-running row."
724
+ },
725
+ {
726
+ "slug": "switch",
727
+ "name": "Switch",
728
+ "description": "An on/off setting that takes effect at once, with a label and a description, at the start or the end of the row. Your own checkbox inside, so every kind of Angular form just works.",
729
+ "category": "Inputs",
730
+ "pro": false,
731
+ "entryPoint": "./ui/switch",
732
+ "selector": "ui-switch",
733
+ "url": "/ai/switch.json",
734
+ "markdown": "# Switch\n\nAn on/off setting that takes effect at once, with a label and a description, at the start or the end of the row. Your own checkbox inside, so every kind of Angular form just works.\n\nAdd: `npx ochreui@latest add switch`\nImport: `import { UiSwitch, UiSwitchInput } from './ui/switch';`\nSelector: `<ui-switch>`\nDocs: /components/switch\n\n## When to use\n- A setting that applies at once: notifications, privacy, a feature.\n- Settings lists of on/off rows.\n\n## When not to use\n- Choices applied on submit, or agreeing to terms: use Checkbox.\n- More than two options: use Segmented Control or Select.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form } from '@angular/forms/signals';\nimport { UiSwitch, UiSwitchInput } from './ui/switch';\n\n@Component({\n selector: 'app-notification-settings',\n imports: [UiSwitch, UiSwitchInput, FormField],\n template: `\n <ui-switch label=\"Daily digest\" description=\"Approvals waiting, runs that finished or failed\" placement=\"end\">\n <input type=\"checkbox\" uiSwitch [formField]=\"f.digest\" />\n </ui-switch>\n <ui-switch label=\"Weekly usage report\" description=\"Credits spent and the busiest agents\" placement=\"end\">\n <input type=\"checkbox\" uiSwitch [formField]=\"f.weekly\" />\n </ui-switch>\n `,\n})\nexport class NotificationSettings {\n private readonly model = signal({ digest: true, weekly: false });\n protected readonly f = form(this.model);\n}\n```\n\n## Rules\n- Write type=\"checkbox\" yourself on <input uiSwitch>: Angular forms match it in your template.\n- Bind checked with [formField], formControl, ngModel or [checked] + (change); disabled stays on the input.\n- Without a label, put aria-label on the input.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | none | Setting name; clicking toggles. |\n| `description` | `string` | none | Quiet line under the label; the switch's description. |\n| `placement` | `'start' \\| 'end'` | 'start' | Switch before the text, or at the end of the row. |\n| `size` | `'sm' \\| 'md'` | 'md' | 32×20 or 26×16; touch 40×24 or 34×20. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-switch-track` | `color-mix(in srgb, var(--ui-text) 14%, var(--ui-bg-surface))` | Off track. Set var(--ui-border-input) for 3:1; prefers-contrast: more uses it. |\n| `--ui-switch-track-hover` | `color-mix(in srgb, var(--ui-text) 20%, var(--ui-bg-surface))` | Off track on hover. |\n| `--ui-switch-track-on` | `var(--ui-bg-neutral-solid)` | On track. |\n| `--ui-switch-thumb` | `var(--ui-bg-knob)` | Off thumb. |\n| `--ui-switch-thumb-on` | `var(--ui-text-on-neutral)` | On thumb. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Space | Toggles. |\n| Tab | Next switch; disabled ones skipped. |\n\n## Accessibility\n- Native checkbox with role=switch: on/off announced.\n- Named by the label only (aria-labelledby), described by the description.\n- Off track pale by default; --ui-switch-track or prefers-contrast: more takes it to 3:1; position also shows the state.\n- Hit area 6px past the track; the whole row toggles.\n- Forced colors: Canvas track with a CanvasText edge, Highlight when on, GrayText when disabled.\n",
735
+ "keywords": "Inputs UiSwitch UiSwitchInput SwitchSize SwitchPlacement A setting that applies at once: notifications, privacy, a feature. Settings lists of on/off rows."
736
+ },
737
+ {
738
+ "slug": "tab-overload",
739
+ "name": "Tab Overload",
740
+ "description": "A small card illustration: three overlapping browser windows full of softly pulsing placeholder blocks. The front window is lit with coloured dots and a warm glow; hovering a window behind moves the light to it.",
741
+ "category": "Illustrations",
742
+ "pro": false,
743
+ "entryPoint": "./ui/tab-overload",
744
+ "selector": "ui-tab-overload",
745
+ "url": "/ai/tab-overload.json",
746
+ "markdown": "# Tab Overload\n\nA small card illustration: three overlapping browser windows full of softly pulsing placeholder blocks. The front window is lit with coloured dots and a warm glow; hovering a window behind moves the light to it.\n\nAdd: `npx ochreui@latest add tab-overload`\nImport: `import { UiTabOverload } from './ui/tab-overload';`\nSelector: `<ui-tab-overload>`\nDocs: /components/tab-overload\n\n## When to use\n- A problem card about context switching, research spread over too many tabs, or copy-and-paste busywork.\n- Bento grids and feature cards that want a small picture above their title and text.\n\n## When not to use\n- To show real pages or screenshots: the windows only hold grey placeholder blocks.\n- Where the right and bottom edges must stay crisp: the scene fades out there on purpose.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiTabOverload } from './ui/tab-overload';\n\n@Component({\n selector: 'app-research-card',\n imports: [UiTabOverload],\n template: `\n <article>\n <ui-tab-overload />\n <h3>Research lives in forty tabs</h3>\n <p>Every answer means another window, another copy and paste, another lost thread.</p>\n </article>\n `,\n styles: `\n article { max-inline-size: 360px; }\n h3 { margin: 16px 0 0; font-size: 16px; line-height: 1.4; font-weight: 600; }\n p { margin: 6px 0 0; color: var(--ui-text-muted); font-size: 14px; line-height: 1.5; }\n `,\n})\nexport class ResearchCard {}\n```\n\n## Rules\n- Width up to 560px from its container, height at 3:2; the whole drawing scales, nothing reflows.\n- The front window is lit by default; hovering a window behind crossfades the light to it in 300ms (hover-capable pointers only).\n- The pulse (2.4s) waits off-screen and in hidden tabs, and starts over when it comes back.\n- Reduced motion or --ui-motion-scale: 0: blocks hold their light shade and the highlight swaps instantly.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | 'Three overlapping browser windows filled with placeholder blocks' | What screen readers hear for the whole picture. Empty hides the picture from them. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-tab-overload-bar` | `var(--ui-bg-subtle), near-black in dark mode` | Title bar of each window. |\n| `--ui-tab-overload-panel` | `var(--ui-bg-surface)` | The page inside each window. |\n| `--ui-tab-overload-edge` | `var(--ui-hairline)` | Window and page outlines. |\n| `--ui-tab-overload-dot` | `var(--ui-text) at 20%` | The grey title-bar dots of the windows behind. |\n| `--ui-tab-overload-block` | `var(--ui-bg-placeholder)` | Placeholder blocks, at the light end of the pulse. |\n| `--ui-tab-overload-pulse` | `the block a step darker` | The dark end of the pulse. |\n\n## Accessibility\n- One image named by label; the drawing inside is aria-hidden, so nothing is read twice.\n- label=\"\" hides the whole picture from screen readers.\n- Not focusable; the hover highlight is decoration only and never changes on touch screens.\n- Forced colours: windows outlined in system colours, the lit window edged in Highlight, no glow.\n",
747
+ "keywords": "Illustrations UiTabOverload A problem card about context switching, research spread over too many tabs, or copy-and-paste busywork. Bento grids and feature cards that want a small picture above their title and text."
748
+ },
749
+ {
750
+ "slug": "tag-input",
751
+ "name": "Tag Input",
752
+ "description": "Several short values in one field, each shown as a chip. Paste a whole list, check each value, flash duplicates, edit with Backspace and the arrows, and cap the count, with signal forms, reactive forms or ngModel.",
753
+ "category": "Inputs",
754
+ "pro": false,
755
+ "entryPoint": "./ui/tag-input",
756
+ "selector": "ui-tag-input",
757
+ "url": "/ai/tag-input.json",
758
+ "markdown": "# Tag Input\n\nSeveral short values in one field, each shown as a chip. Paste a whole list, check each value, flash duplicates, edit with Backspace and the arrows, and cap the count, with signal forms, reactive forms or ngModel.\n\nAdd: `npx ochreui@latest add tag-input`\nImport: `import { UiTagInput, UiTag } from './ui/tag-input';`\nSelector: `<ui-tag-input>`\nDocs: /components/tag-input\n\n## When to use\n- Several short values in one field: emails to invite, labels, keywords, domains, stop words.\n- Lists pasted from elsewhere: commas, semicolons and new lines become chips at once.\n\n## When not to use\n- Picking from a fixed list: use Combobox.\n- A single value: use Text Field.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form, maxLength } from '@angular/forms/signals';\nimport { UiTag, UiTagInput } from './ui/tag-input';\n\nconst EMAIL = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n\n@Component({\n selector: 'app-invite-teammates',\n imports: [UiTagInput, UiTag, FormField],\n template: `\n <ui-tag-input label=\"Invite teammates\" hint=\"Paste a list: commas, spaces or new lines.\" avatar>\n <input uiTagInput [formField]=\"f.emails\" placeholder=\"name@company.com\" inputmode=\"email\"\n splitOnSpace [normalize]=\"lower\" [validate]=\"isEmail\" />\n </ui-tag-input>\n `,\n})\nexport class InviteTeammates {\n protected readonly lower = (v: string) => v.trim().toLowerCase();\n protected readonly isEmail = (v: string) => EMAIL.test(v) || `“${v}” doesn't look like an email address.`;\n private readonly model = signal({ emails: ['lena@northwind.io'] });\n protected readonly f = form(this.model, (p) => maxLength(p.emails, 10));\n}\n```\n\n## Rules\n- Put uiTagInput on your own <input> inside ui-tag-input; bind [formField], formControl(Name), ngModel or [(value)].\n- The form value is string[]; the input text is only a draft.\n- With [formField], set the cap with maxLength() in the schema and let the field set name; do not write maxLength or name attributes.\n- Without signal forms, write maxLength=\"10\" and name=\"…\" on the input.\n- validate returns true or the message to show; normalize runs first.\n- Duplicates compare case-insensitively unless caseSensitive is set.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | none | Above the field; clicking focuses the input. |\n| `hint` | `string` | none | Quiet line under the field; a message replaces it. |\n| `error` | `string \\| null \\| undefined` | none | Invalid from outside: red edge, aria-invalid, message in place of the hint. |\n| `optional` | `boolean` | false | \"Optional\" after the label, also spoken. |\n| `avatar` | `boolean` | false | First-letter circle on every chip, for people. |\n| `labels` | `Partial<TagInputLabels>` | English | Translations; {tag} and {n} are replaced. |\n| `value (UiTag)` | `string[] (model)` | [] | The chips; [(value)] or a form binding. |\n| `validate (UiTag)` | `(tag: string) => true \\| string` | none | Check before adding; a message keeps the text in the field. |\n| `normalize (UiTag)` | `(tag: string) => string` | trim | Cleans a value before the check and duplicate test. |\n| `splitOnSpace (UiTag)` | `boolean` | false | Space also adds a chip. |\n| `caseSensitive (UiTag)` | `boolean` | false | Duplicates compare case-sensitively. |\n| `maxLength (UiTag)` | `number` | none | Cap on the chip count; shows n/cap. Signal forms: schema maxLength(). |\n| `maxlength (UiTag)` | `number` | none | Lower case: character limit for the typed value, kept on the input. |\n| `name (UiTag)` | `string` | none | Native form submission, one hidden input per chip. Signal forms set it. |\n| `placeholder (UiTag)` | `string` | \"Add…\" | While empty; \"Add more…\" after the first chip, none at the cap. |\n| `id / aria-describedby (UiTag)` | `string` | generated | Kept and merged with the field description. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `valueChange (UiTag)` | `string[]` | After a chip is added or removed. |\n| `added (UiTag)` | `string[]` | Values just added (several after a paste). |\n| `removed (UiTag)` | `string` | Value just removed. |\n\n## TagInputLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `optional` | `string` | Tag after the label. |\n| `add` | `string` | Placeholder with no chips and none of your own. |\n| `addMore` | `string` | Placeholder after the first chip. |\n| `remove` | `string` | Name of each ×, with {tag}. |\n| `added` | `string` | Announced after adding one, with {tag}. |\n| `addedMany` | `string` | Announced after a paste, with {n}. |\n| `removed` | `string` | Announced after removing, with {tag}. |\n| `duplicate` | `string` | Announced for a duplicate, with {tag}. |\n| `armed` | `string` | Announced after the first Backspace, with {tag}. |\n| `limit` | `string` | Message when the cap stops an addition, with {n}. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-text-field-edge` | `var(--ui-hairline)` | Resting edge (shared with Text Field). |\n| `--ui-text-field-edge-hover` | `text at 18%` | Hover edge. |\n| `--ui-text-field-edge-focus` | `var(--ui-border-input)` | Focused edge, ≥ 3:1. |\n| `--ui-text-field-radius` | `7px` | Corners (Classic 10px). |\n| `--ui-tag-input-max-height` | `156px (Classic 168px)` | Height after which the chips scroll. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Enter / , / ; | Add the draft as a chip. |\n| Space | Add, with splitOnSpace. |\n| Tab | Add and move on; stays when rejected. |\n| Backspace (empty field) | Select the last chip, then remove it. |\n| ← (→ in RTL) at the start | Focus the last chip. |\n| ← / → on a chip | Previous / next chip, then the field; mirrored in RTL. |\n| Home / End on a chip | First chip / the field. |\n| Backspace / Delete / Enter on a chip | Remove; focus the next chip or the field. |\n| Esc | Clear the draft and its message; on a chip, back to the field. |\n\n## Accessibility\n- Native input named by the label, described by the hint/message and a status region; rejection sets aria-invalid.\n- Each × is named \"Remove …\", tabindex -1, and is the chip's roving focus stop.\n- Adds, removals, duplicates and the Backspace selection are announced.\n- Never disabled at the cap, so focus never drops to the page.\n- Text ≥ 4.5:1, × and focus edge ≥ 3:1; forced colors keep the field edge and chip frames.\n",
759
+ "keywords": "Inputs UiTagInput UiTag TagInputLabels Several short values in one field: emails to invite, labels, keywords, domains, stop words. Lists pasted from elsewhere: commas, semicolons and new lines become chips at once."
760
+ },
761
+ {
762
+ "slug": "team-invite",
763
+ "name": "Team Invite",
764
+ "description": "A looping card illustration: a cursor drags a third avatar into an empty dashed slot next to two linked teammates; the line turns solid and the newcomer comes online.",
765
+ "category": "Illustrations",
766
+ "pro": false,
767
+ "entryPoint": "./ui/team-invite",
768
+ "selector": "ui-team-invite",
769
+ "url": "/ai/team-invite.json",
770
+ "markdown": "# Team Invite\n\nA looping card illustration: a cursor drags a third avatar into an empty dashed slot next to two linked teammates; the line turns solid and the newcomer comes online.\n\nAdd: `npx ochreui@latest add team-invite`\nImport: `import { UiTeamInvite } from './ui/team-invite';`\nSelector: `<ui-team-invite>`\nDocs: /components/team-invite\n\n## When to use\n- Feature cards about inviting people, sharing, collaboration or working together live.\n- Onboarding steps such as \"add your teammates\", where a small moving scene helps.\n\n## When not to use\n- A real member list or invite status: it is a picture that loops by itself.\n- Screens that must stay completely still: lean on reduced motion, or use a static image.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { TeamInviteAvatars, UiTeamInvite } from './ui/team-invite';\n\n@Component({\n selector: 'app-invite-feature',\n imports: [UiTeamInvite],\n template: `\n <article>\n <ui-team-invite [avatars]=\"team\" />\n <h3>Bring your team along</h3>\n <p>Send one link and new people land in the right workspace, ready to go.</p>\n </article>\n `,\n styles: `\n article { max-inline-size: 420px; border-radius: 16px; background: var(--ui-bg-canvas); box-shadow: 0 0 0 1px var(--ui-hairline); overflow: hidden; }\n ui-team-invite { inline-size: 100%; }\n h3 { margin: 0; padding: 0 24px 4px; font-size: 16px; }\n p { margin: 0; padding: 0 24px 24px; color: var(--ui-text-muted); }\n `,\n})\nexport class InviteFeature {\n protected readonly team: TeamInviteAvatars = [{ name: 'Nora' }, { name: 'Emil' }, { name: 'Ada' }];\n}\n```\n\n## Rules\n- Pass exactly three avatars: the two linked teammates, then the one being invited.\n- Use square portraits; they are cropped to a circle. Names go only into the screen-reader sentence.\n- Size it through the host inline size (at most 560px); the height follows at 3 : 2.\n- The loop pauses off-screen and in hidden tabs and restarts from the beginning; reduced motion or --ui-motion-scale: 0 shows the waiting scene, still.\n- The scene keeps its physical layout in right-to-left pages.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `avatars` | `TeamInviteAvatars` | required | Exactly three people: the two linked teammates, then the one being invited. |\n| `label` | `string \\| undefined` | labels.label(names) | The one sentence screen readers hear; an empty string hides the scene from them. |\n| `labels` | `Partial<TeamInviteLabels>` | English | The label sentence and the stand-ins for missing names, for translation. |\n\n## TeamInviteAvatar\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `src` | `string \\| undefined` | Square portrait URL cropped to a circle; left out, one of three drawn avatars. |\n| `name` | `string \\| undefined` | First name, heard in the label only. |\n\n## TeamInviteAvatars\n\n`type TeamInviteAvatars = readonly [TeamInviteAvatar, TeamInviteAvatar, TeamInviteAvatar]`\n\n## TeamInviteLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `unnamed` | `readonly [string, string, string]` | Stand-ins for missing names, in avatar order. |\n| `label` | `(names: readonly [string, string, string]) => string` | Used when label is left out. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-team-invite-surface` | `var(--ui-bg-surface)` | The ring around each avatar. |\n| `--ui-team-invite-line` | `light-dark(var(--ui-border), var(--ui-border-strong))` | The links and the dashed slot. |\n| `--ui-team-invite-plus` | `var(--ui-text-muted) at 35% (45% dark)` | The + in the empty slot. |\n| `--ui-team-invite-dot` | `color-mix(in srgb, var(--ui-hue-green) 55%, var(--ui-green-dark))` | Status dots; the halo is mixed from it. |\n| `--ui-team-invite-cursor` | `near-black navy (gray-1000 with a touch of indigo)` | The pointer fill, the same in both themes. |\n| `--ui-team-invite-cursor-edge` | `var(--ui-gray-0)` | The pointer outline, white in both themes. |\n\n## Accessibility\n- Host role=img with one aria-label naming the three people; every child aria-hidden, portraits alt=\"\" and draggable=false.\n- label=\"\" drops the role and hides the scene (aria-hidden) when nearby text says the same.\n- Nothing is focusable or interactive; no live region.\n- Forced colors: avatars get a CanvasText edge, links and + CanvasText, the dashed line and slot GrayText, dots CanvasText, the cursor CanvasText with a Canvas edge.\n",
771
+ "keywords": "Illustrations UiTeamInvite TeamInviteAvatar TeamInviteAvatars TeamInviteLabels Feature cards about inviting people, sharing, collaboration or working together live. Onboarding steps such as \"add your teammates\", where a small moving scene helps."
772
+ },
773
+ {
774
+ "slug": "testimonial-wall",
775
+ "name": "Testimonial Wall",
776
+ "description": "A landing-page wall of customer quotes in up to three columns that scroll endlessly in opposite directions. A column eases to a stop under the pointer, on keyboard focus or a touch hold, and the mouse can drag it and fling it.",
777
+ "category": "Blocks",
778
+ "pro": false,
779
+ "entryPoint": "./ui/testimonial-wall",
780
+ "selector": "ui-testimonial-wall",
781
+ "url": "/ai/testimonial-wall.json",
782
+ "markdown": "# Testimonial Wall\n\nA landing-page wall of customer quotes in up to three columns that scroll endlessly in opposite directions. A column eases to a stop under the pointer, on keyboard focus or a touch hold, and the mouse can drag it and fling it.\n\nAdd: `npx ochreui@latest add testimonial-wall`\nImport: `import { UiTestimonialWall } from './ui/testimonial-wall';`\nSelector: `<ui-testimonial-wall>`\nDocs: /components/testimonial-wall\n\n## When to use\n- A \"loved by\" section on a landing or pricing page with eight quotes or more.\n- Social proof that should feel alive but stop as soon as someone reads.\n\n## When not to use\n- Two or three quotes: place them side by side.\n- A single hero quote or a case study: use a still, larger layout.\n- Reviews people search or filter: use a list or a grid.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { Testimonial, UiTestimonialWall } from './ui/testimonial-wall';\n\n@Component({\n selector: 'app-customer-love',\n imports: [UiTestimonialWall],\n template: `\n <section>\n <p class=\"eyebrow\">Testimonials</p>\n <h2>Trusted by teams who keep things running</h2>\n <ui-testimonial-wall [items]=\"quotes\" [speed]=\"26\" label=\"What our customers say\" />\n </section>\n `,\n styles: `\n section { display: grid; gap: 6px; text-align: center; }\n .eyebrow { margin: 0; color: var(--ui-text-muted); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; }\n h2 { margin: 0 0 18px; font-size: 24px; font-weight: 500; }\n ui-testimonial-wall { --ui-testimonial-wall-height: 640px; text-align: start; }\n `,\n})\nexport class CustomerLove {\n // Two quotes per column at least; four or more reads best.\n protected readonly quotes: Testimonial[] = [\n { quote: 'Setup took one coffee. We have not looked back since.', name: 'Kwame Asante', role: 'Founder', company: 'Tidewell Freight', verified: true },\n { quote: 'Patients get their reminders and the front desk gets its evenings back.', name: 'Rafael Quintero', role: 'Head of Support', company: 'Pinecrest Clinics', rating: 5 },\n { quote: 'It feels like it was made by people who have worked a till on a Saturday.', name: 'Aiko Fujimura', role: 'Store Lead', company: 'Paperlantern Books', avatar: '/avatars/aiko.jpg' },\n { quote: 'Month-end close went from four days to a day and a half.', name: 'Tomasz Wrona', role: 'Finance Director', company: 'Brightwater Co-op', rating: 4 },\n { quote: 'Clear, quick and quiet. Exactly what I want from something I open fifty times a day.', name: 'Nadia Bensalem', role: 'Product Owner', company: 'Fernhill Energy' },\n { quote: 'I trust the numbers again.', name: 'Matteo Ferrante', role: 'Logistics Analyst', company: 'Northgate Haulage' },\n ];\n}\n```\n\n## Rules\n- Give at least two quotes per column, ideally four or more.\n- Set the height with --ui-testimonial-wall-height, not an input; the wall takes the container width.\n- Columns follow the wall width (740 / 480px), not the viewport.\n- Runs only on screen in a visible tab; mouse drag scrubs, touch swipes scroll the page.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `items` | `readonly Testimonial[]` | required | The quotes, dealt round-robin across the columns; none shows the empty note. |\n| `columns` | `1 \\| 2 \\| 3` | 3 | Most columns on a wide wall; 2 below 740px and 1 below 480px of the wall's own width; never more than the quotes. |\n| `speed` | `number` | 28 | px/s of column 1; column 2 runs x0.84 downward, column 3 x1.12 upward. 0 is still. |\n| `pauseOnHover` | `boolean` | true | The hovered column eases to a stop. Keyboard focus and touch hold always stop their column. |\n| `paused` | `boolean (model)` | false | Eases every column to a stop while true; bind [(paused)] to your own pause control. |\n| `label` | `string` | 'What customers say' | Accessible name of the region. |\n| `labels` | `Partial<TestimonialWallLabels>` | English | rated(n), verified, empty. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `pausedChange` | `boolean` | From the paused model, for [(paused)]. |\n\n## Testimonial\n\n`type Testimonial = { quote: string; name: string; role?: string; company?: string; avatar?: string; rating?: 1 | 2 | 3 | 4 | 5; verified?: boolean }`\n\n## TestimonialWallLabels\n\n`type TestimonialWallLabels = { rated: (stars: number) => string; verified: string; empty: string }`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-testimonial-wall-height` | `600px` | Wall height; reduced motion grows it to fit every quote. |\n| `--ui-testimonial-wall-fade` | `120px (Classic 96px)` | Soft fade at the top and bottom edges. |\n| `--ui-testimonial-wall-card-shadow` | `0 0 0 0.5px edge, 0 1px 1px -1px, 0 1px 2px` | Card edge at rest. |\n| `--ui-testimonial-wall-card-shadow-hover` | `0 0 0 0.5px edge, 0 2px 4px, 0 12px 24px -12px` | Card edge when lifted by hover or keyboard focus. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Next quote, down column 1 then column 2; its column stops and a partly hidden quote slides into view. |\n| Shift+Tab | Previous quote; leaving the wall lets every column run again. |\n\n## Accessibility\n- role=region named by label; one list per column; each quote a figure with blockquote and figcaption.\n- Each figure is named by the person's name only (aria-labelledby); verified is visually hidden text, read once.\n- Loop copies are aria-hidden and hold no tab stops, so every quote is read and focused once; they still take hover and drag.\n- Hover, keyboard focus (focus-visible) and touch hold stop their column; [(paused)] stops all.\n- Stars are one role=img with \"Rated n out of 5\"; avatars alt=\"\"; initials aria-hidden.\n- Reduced motion or --ui-motion-scale: 0: still masonry at natural height, no fade, no copies.\n- Forced colors: card and initials edges become CanvasText.\n",
783
+ "keywords": "Blocks UiTestimonialWall Testimonial TestimonialWallLabels A \"loved by\" section on a landing or pricing page with eight quotes or more. Social proof that should feel alive but stop as soon as someone reads."
784
+ },
785
+ {
786
+ "slug": "text-area",
787
+ "name": "Text Area",
788
+ "description": "Several lines of text with a label, hint and error in place. It grows with what you type, gives more room on request, counts characters, and sends on ⌘ Enter. Your own textarea inside, so every kind of Angular form just works.",
789
+ "category": "Inputs",
790
+ "pro": false,
791
+ "entryPoint": "./ui/text-area",
792
+ "selector": "ui-text-area",
793
+ "url": "/ai/text-area.json",
794
+ "markdown": "# Text Area\n\nSeveral lines of text with a label, hint and error in place. It grows with what you type, gives more room on request, counts characters, and sends on ⌘ Enter. Your own textarea inside, so every kind of Angular form just works.\n\nAdd: `npx ochreui@latest add text-area`\nImport: `import { UiTextArea, UiTextarea } from './ui/text-area';`\nSelector: `<ui-text-area>`\nDocs: /components/text-area\n\n## When to use\n- Several lines: descriptions, notes, release notes, feedback.\n- Prompts and instructions, with more room while editing.\n- Short messages sent with ⌘ Enter.\n\n## When not to use\n- One line: use Text Field.\n- A chat box with attachments and a send button: use Chat Composer.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form, maxLength } from '@angular/forms/signals';\nimport { UiTextArea, UiTextarea } from './ui/text-area';\n\n@Component({\n selector: 'app-workspace-context',\n imports: [UiTextArea, UiTextarea, FormField],\n template: `\n <ui-text-area\n label=\"Workspace context\"\n hint=\"Added to every chat in this workspace. ⌘ Enter saves.\"\n counter\n expandable\n [maxRows]=\"8\"\n submitShortcut\n (submitted)=\"save($event)\"\n >\n <textarea uiTextarea [formField]=\"f.context\"></textarea>\n </ui-text-area>\n `,\n})\nexport class WorkspaceContext {\n private readonly model = signal({ context: 'We sell refurbished laptops to schools in Portugal and Spain.' });\n protected readonly f = form(this.model, (p) => maxLength(p.context, 2000));\n\n protected save(text: string) {\n console.log('Saved', text.length, 'characters');\n }\n}\n```\n\n## Rules\n- Put uiTextarea on your own <textarea> inside ui-text-area and bind it with [formField], formControl or ngModel.\n- With [formField], set limits through the schema (maxLength()), not the maxlength attribute.\n- Pass the error string you want shown; the field doesn't read form state itself.\n- Don't set rows or a height yourself; use minRows, maxRows and expandedRows.\n- Keep your own descriptions with aria-describedby=\"…\" or [aria-describedby], not [attr.aria-describedby].\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | none | Above the field; clicking focuses the text. |\n| `hint` | `string` | none | Quiet line under the field; the error replaces it. |\n| `error` | `string \\| null \\| undefined` | none | Invalid state: red edge, aria-invalid, message in place of the hint. Signal forms: f.x().errors()[0]?.message. |\n| `optional` | `boolean` | false | \"Optional\" after the label, also spoken. |\n| `counter` | `boolean` | false | \"120/2,000\" from maxlength (signal forms: maxLength()). Darker at the limit, red over. |\n| `minRows` | `number` | 3 | Height while empty, in lines. |\n| `maxRows` | `number` | 10 | Grows up to this many lines, then scrolls. |\n| `expandable` | `boolean` | false | Corner button for more room. |\n| `expandedRows` | `number` | 16 | Lines while expanded, even when empty. |\n| `expanded` | `boolean (model)` | false | Expanded state; [(expanded)] to control it. |\n| `submitShortcut` | `boolean` | false | ⌘/Ctrl+Enter emits submitted; Enter alone is a new line. |\n| `labels` | `Partial<TextAreaLabels>` | English | Translations: optional, moreRoom, lessRoom. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `submitted` | `string` | The value on ⌘/Ctrl+Enter with submitShortcut, even when empty. |\n| `expandedChange` | `boolean` | After the corner button changed the room. |\n\n## TextAreaLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `optional` | `string` | Tag after the label. |\n| `moreRoom` | `string` | Corner button while compact. |\n| `lessRoom` | `string` | Corner button while expanded. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-text-field-edge` | `var(--ui-hairline)` | Resting edge (shared with Text Field). |\n| `--ui-text-field-edge-hover` | `text at 18%` | Hover edge. |\n| `--ui-text-field-edge-focus` | `var(--ui-border-input)` | Focused edge, ≥ 3:1. |\n| `--ui-text-area-radius` | `8px` | Corners (Classic 10px). |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Text, then its corner button. |\n| Enter | New line, always. |\n| ⌘/Ctrl+Enter | With submitShortcut, emits submitted. |\n| Enter or Space | On the corner button, toggles the room; focus stays. |\n\n## Accessibility\n- Native textarea with label for; otherwise aria-label on the textarea.\n- Hint/error and counter in aria-describedby (merged with yours); error sets aria-invalid and is announced.\n- Corner button: More room / Less room label, aria-controls the textarea.\n- aria-keyshortcuts with submitShortcut; ignored while an IME composes.\n- Text ≥ 4.5:1, focus edge ≥ 3:1; forced colors keep edge and focus outline.\n",
795
+ "keywords": "Inputs UiTextArea UiTextarea TextAreaLabels Several lines: descriptions, notes, release notes, feedback. Prompts and instructions, with more room while editing. Short messages sent with ⌘ Enter."
796
+ },
797
+ {
798
+ "slug": "text-field",
799
+ "name": "Text Field",
800
+ "description": "One input for every form: label, hint and error in place, prefix and suffix, a clear ×, show password, copy, and a character count. Your own input inside, so every kind of Angular form just works.",
801
+ "category": "Inputs",
802
+ "pro": false,
803
+ "entryPoint": "./ui/text-field",
804
+ "selector": "ui-text-field",
805
+ "url": "/ai/text-field.json",
806
+ "markdown": "# Text Field\n\nOne input for every form: label, hint and error in place, prefix and suffix, a clear ×, show password, copy, and a character count. Your own input inside, so every kind of Angular form just works.\n\nAdd: `npx ochreui@latest add text-field`\nImport: `import { UiTextField, UiInput, UiTextFieldPrefix, UiTextFieldSuffix } from './ui/text-field';`\nSelector: `<ui-text-field>`\nDocs: /components/text-field\n\n## When to use\n- Any one-line field: names, emails, URLs, amounts, search, passwords, keys.\n- Settings, sign-up and onboarding forms.\n\n## When not to use\n- Several lines: use Text Area.\n- A fixed list: use Select or Combobox.\n- Verification codes: use OTP Input.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form, maxLength, pattern, required } from '@angular/forms/signals';\nimport { UiInput, UiTextField } from './ui/text-field';\n\n@Component({\n selector: 'app-workspace-form',\n imports: [UiTextField, UiInput, FormField],\n template: `\n <form class=\"fields\" (submit)=\"save($event)\">\n <ui-text-field label=\"Workspace name\" counter clearable>\n <input uiInput [formField]=\"f.name\" />\n </ui-text-field>\n <ui-text-field label=\"Workspace URL\" prefix=\"northwind.app/\" hint=\"Lowercase letters, numbers and dashes.\" [error]=\"f.slug().errors()[0]?.message\">\n <input uiInput [formField]=\"f.slug\" spellcheck=\"false\" autocapitalize=\"none\" />\n </ui-text-field>\n <ui-text-field label=\"Password\">\n <input uiInput type=\"password\" [formField]=\"f.password\" autocomplete=\"new-password\" />\n </ui-text-field>\n <ui-text-field label=\"API key\" copyable>\n <input uiInput readonly [value]=\"apiKey\" />\n </ui-text-field>\n </form>\n `,\n styles: `\n .fields { display: flex; flex-direction: column; gap: 16px; max-width: 360px; }\n `,\n})\nexport class WorkspaceForm {\n protected readonly apiKey = 'nw_live_3fK8pQ2r';\n private readonly model = signal({ name: 'Northwind', slug: 'northwind', password: '' });\n protected readonly f = form(this.model, (p) => {\n required(p.name);\n maxLength(p.name, 32);\n pattern(p.slug, /^[a-z0-9-]*$/, { message: 'Only lowercase letters, numbers and dashes.' });\n });\n\n protected save(event: Event) {\n event.preventDefault();\n }\n}\n```\n\n## Rules\n- Put uiInput on your own <input> inside ui-text-field and bind it with [formField], formControl or ngModel.\n- With [formField], set limits through the schema (maxLength()), not the maxlength attribute.\n- Pass the error string you want shown; the field doesn't read form state itself.\n- Keep your own descriptions with aria-describedby=\"…\" or [aria-describedby], not [attr.aria-describedby].\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | none | Above the input; clicking focuses it. |\n| `hint` | `string` | none | Quiet line under the input; the error replaces it. |\n| `error` | `string \\| null \\| undefined` | none | Invalid state: red edge, aria-invalid, message in place of the hint. Signal forms: f.x().errors()[0]?.message. |\n| `prefix` | `string` | none | Text before the value, flush, cut at its start when long. Icons: uiTextFieldPrefix. |\n| `suffix` | `string` | none | Text after the value. Icons: uiTextFieldSuffix. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | 'md' | 28/32/36px; Classic 32/36/40; 6px taller with 16px text on touch. |\n| `optional` | `boolean` | false | \"Optional\" after the label, also spoken. |\n| `clearable` | `boolean` | false | × while there is a value, plus Escape; dispatches a native input event. |\n| `copyable` | `boolean` | false | Copy button that turns into a check; pair with readonly. |\n| `counter` | `boolean` | false | \"12/40\" from the input's maxlength (signal forms: maxLength()). |\n| `labels` | `Partial<TextFieldLabels>` | English | Translations: optional, clear, show, hide, copy, copied, pressToCopy. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `cleared` | `void` | After × or Escape emptied the field. |\n\n## TextFieldLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `optional` | `string` | Tag after the label. |\n| `clear` | `string` | Clear button. |\n| `show` | `string` | Show password button. |\n| `hide` | `string` | Hide password button. |\n| `copy` | `string` | Copy button. |\n| `copied` | `string` | Copy button and announcement after copying. |\n| `pressToCopy` | `string` | Announced when the clipboard is blocked and the text is selected instead. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-text-field-edge` | `var(--ui-hairline)` | Resting edge. |\n| `--ui-text-field-edge-hover` | `text at 18%` | Hover edge. |\n| `--ui-text-field-edge-focus` | `var(--ui-border-input)` | Focused edge, ≥ 3:1. |\n| `--ui-text-field-radius` | `7px` | Corners (Classic 10px). |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Input, then its show-password or copy button; × is skipped. |\n| Esc | Empties a clearable field with a value, before surrounding layers react. |\n| Enter or Space | Toggles show password, or copies. |\n\n## Accessibility\n- Native input with label for; otherwise aria-label on the input.\n- Hint/error and counter in aria-describedby (merged with yours); error sets aria-invalid and is announced.\n- Show password / Hide password label says what the button does next; Copied is announced in a status region.\n- dir=auto on value and message.\n- Text ≥ 4.5:1, focus edge ≥ 3:1; forced colors keep edge and focus outline.\n",
807
+ "keywords": "Inputs UiTextField UiInput UiTextFieldPrefix UiTextFieldSuffix TextFieldSize TextFieldLabels Any one-line field: names, emails, URLs, amounts, search, passwords, keys. Settings, sign-up and onboarding forms."
808
+ },
809
+ {
810
+ "slug": "text-reveal",
811
+ "name": "Text Reveal",
812
+ "description": "Text that arrives one word or letter at a time as it scrolls into view, each piece fading in out of a soft blur while rising into place. Put it on your own heading or paragraph.",
813
+ "category": "Motion",
814
+ "pro": false,
815
+ "entryPoint": "./ui/text-reveal",
816
+ "selector": "[uiTextReveal]",
817
+ "url": "/ai/text-reveal.json",
818
+ "markdown": "# Text Reveal\n\nText that arrives one word or letter at a time as it scrolls into view, each piece fading in out of a soft blur while rising into place. Put it on your own heading or paragraph.\n\nAdd: `npx ochreui@latest add text-reveal`\nImport: `import { UiTextReveal } from './ui/text-reveal';`\nSelector: `<[uiTextReveal]>`\nDocs: /components/text-reveal\n\n## When to use\n- Headlines and short intros on landing pages that should arrive as the reader scrolls.\n- One sentence to be read in order: a promise, a mission line, a quote.\n\n## When not to use\n- Long paragraphs or anything people must read at once.\n- Text that changes often, like live numbers: the reveal only plays on entering the view.\n\n## Usage\n\n```ts\nimport { Component } from '@angular/core';\nimport { UiTextReveal } from './ui/text-reveal';\n\n@Component({\n selector: 'app-pricing-intro',\n imports: [UiTextReveal],\n template: `\n <h2 uiTextReveal text=\"One plan, every agent included.\"></h2>\n <p uiTextReveal [delay]=\"260\" [stagger]=\"22\"\n text=\"Pay for the runs you make, not the seats you fill. Cancel whenever you like.\"></p>\n `,\n})\nexport class PricingIntro {}\n```\n\n## Rules\n- Leave the element empty; the text goes in the text input.\n- Exported as uiTextReveal: #r=\"uiTextReveal\" then (click)=\"r.replay()\" to play it again.\n- Starts on the first visible pixel and waits while the tab is hidden.\n- Keep it to headlines and one or two sentences; by=\"char\" only for short display text.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `text` | `string` | required | The text to reveal; runs of whitespace collapse to one space. |\n| `by` | `'word' \\| 'char'` | 'word' | Reveal word by word, or letter by letter (letters of a word never wrap apart). |\n| `stagger` | `number` | 40 | Milliseconds between two pieces. |\n| `delay` | `number` | 0 | Milliseconds before the first piece. |\n| `duration` | `number` | 700 | Milliseconds each piece takes to arrive. |\n| `once` | `boolean` | true | Reveal only the first time; false hides it again once out of view and replays on return. |\n\n## TextRevealBy\n\n`type TextRevealBy = 'word' | 'char'`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-text-reveal-rise` | `0.35em` | How far below its place each piece starts. |\n| `--ui-text-reveal-blur` | `8px` | How blurred each piece starts. |\n| `--ui-text-reveal-ease` | `cubic-bezier(0.2, 0.7, 0.2, 1)` | Curve shared by the fade, the blur and the rise. |\n\n## Accessibility\n- A visually hidden copy carries the text, read once from the first frame; the animated pieces are aria-hidden.\n- The host is your own element, so headings keep their level.\n- Real spaces between pieces: normal wrapping, words never break.\n- The hidden copy is not selectable, so copying gives the sentence once.\n- dir=auto on both copies keeps word order right in RTL pages.\n- Reduced motion: text shown at once, no animation, replay() does nothing.\n",
819
+ "keywords": "Motion UiTextReveal TextRevealBy Headlines and short intros on landing pages that should arrive as the reader scrolls. One sentence to be read in order: a promise, a mission line, a quote."
820
+ },
821
+ {
822
+ "slug": "thinking-loader",
823
+ "name": "Thinking Loader",
824
+ "description": "A small working chip for AI replies: eight fading rays and a shimmering label that rolls through phases, then settles on a check and how long it took.",
825
+ "category": "Chat",
826
+ "pro": false,
827
+ "entryPoint": "./ui/thinking-loader",
828
+ "selector": "ui-thinking-loader",
829
+ "url": "/ai/thinking-loader.json",
830
+ "markdown": "# Thinking Loader\n\nA small working chip for AI replies: eight fading rays and a shimmering label that rolls through phases, then settles on a check and how long it took.\n\nAdd: `npx ochreui@latest add thinking-loader`\nImport: `import { UiThinkingLoader } from './ui/thinking-loader';`\nSelector: `<ui-thinking-loader>`\nDocs: /components/thinking-loader\n\n## When to use\n- Between sending a prompt and the first streamed token.\n- Agent or pipeline steps you can name: searching, reading, calling a tool, writing.\n- Inline in a chat bubble or next to a button.\n\n## When not to use\n- When people need every step and its sources: show the steps.\n- Loading without phases: use Skeleton or Spinner.\n- Waits under half a second.\n\n## Usage\n\n```ts\nimport { Component, input } from '@angular/core';\nimport { UiThinkingLoader } from './ui/thinking-loader';\n\n@Component({\n selector: 'app-assistant-pending',\n imports: [UiThinkingLoader],\n template: `\n <ui-thinking-loader [phases]=\"phases\" [interval]=\"2200\" [done]=\"streaming()\" />\n `,\n})\nexport class AssistantPending {\n readonly streaming = input(false);\n protected readonly phases = ['Thinking', 'Searching the web', 'Reading sources', 'Writing response'];\n}\n```\n\n## Rules\n- Drive phase from real stream events; interval is a fallback.\n- Set done on the first token, then swap the loader for the message shortly after.\n- Keep phases to two to four words: the chip never wraps.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `phases` | `readonly string[]` | labels.phases | Labels to walk through, in order; two to four words each. |\n| `interval` | `number` | 2200 | Milliseconds per phase while phase is unset. The timer waits while the loader is off-screen or in a hidden tab. |\n| `phase` | `number \\| undefined` | undefined | Shows this index (clamped) and stops the timer; undefined resumes from it. |\n| `loop` | `boolean` | false | Start over after the last phase instead of holding it. |\n| `done` | `boolean` | false | Check and doneLabel in ink; back to false starts over (from phase when set) and resets the clock. |\n| `doneLabel` | `string \\| ((seconds: number) => string)` | labels.done | Label once done; a function gets whole seconds since start. |\n| `size` | `'sm' \\| 'md'` | 'md' | 32px / 13px label or 26px / 12px; Classic 34 or 28px. |\n| `variant` | `'pill' \\| 'plain'` | 'pill' | Chip with a hairline edge, or just rays and label. |\n| `labels` | `Partial<ThinkingLoaderLabels>` | English | Default phases and done(seconds) text, for translation. |\n\n## ThinkingLoaderLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `phases` | `readonly string[]` | Used when phases is left out or empty. |\n| `done` | `(seconds: number) => string` | Used when doneLabel is left out. |\n\n## ThinkingLoaderSize\n\n`type ThinkingLoaderSize = 'sm' | 'md'`\n\n## ThinkingLoaderVariant\n\n`type ThinkingLoaderVariant = 'pill' | 'plain'`\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-thinking-loader-bg` | `light-dark(var(--ui-bg-surface), var(--ui-bg-canvas))` | Chip fill. |\n| `--ui-thinking-loader-shadow` | `hairline ring + soft drop (Classic: 1px inset ring)` | Chip edge. |\n| `--ui-thinking-loader-radius` | `var(--ui-radius-md); Classic full` | Chip corners. |\n| `--ui-thinking-loader-ray` | `var(--ui-hue-blue); Classic var(--ui-text)` | Rays and check. |\n\n## Accessibility\n- role=status with aria-live=polite: each phase and the done label read once.\n- Leaving label aria-hidden while it rolls away; rays and check aria-hidden.\n- Working label --ui-text-muted (4.5:1+), done label --ui-text.\n- Forced colors: chip edge, CanvasText rays and check, no shimmer.\n- Reduced motion: rays still at 60%, no shimmer, labels switch at once.\n",
831
+ "keywords": "Chat UiThinkingLoader ThinkingLoaderLabels ThinkingLoaderSize ThinkingLoaderVariant Between sending a prompt and the first streamed token. Agent or pipeline steps you can name: searching, reading, calling a tool, writing. Inline in a chat bubble or next to a button."
832
+ },
833
+ {
834
+ "slug": "time-picker",
835
+ "name": "Time Picker",
836
+ "description": "A time of day you type or pick, in a field that looks exactly like a Text Field: tolerant typing (930, 9:30 pm, 21.30), a list every few minutes with a gliding highlight, 12 or 24 hours by locale, min and max. The form gets \"HH:mm\" with signal forms, reactive forms, ngModel or [(value)].",
837
+ "category": "Inputs",
838
+ "pro": false,
839
+ "entryPoint": "./ui/time-picker",
840
+ "selector": "ui-time-picker",
841
+ "url": "/ai/time-picker.json",
842
+ "markdown": "# Time Picker\n\nA time of day you type or pick, in a field that looks exactly like a Text Field: tolerant typing (930, 9:30 pm, 21.30), a list every few minutes with a gliding highlight, 12 or 24 hours by locale, min and max. The form gets \"HH:mm\" with signal forms, reactive forms, ngModel or [(value)].\n\nAdd: `npx ochreui@latest add time-picker`\nImport: `import { UiTimePicker, UiTimeInput, UiTimePickerList } from './ui/time-picker';`\nSelector: `<ui-time-picker>`\nDocs: /components/time-picker\n\n## When to use\n- A time of day in a form: when a job runs, when a digest goes out, quiet hours, a reminder.\n- Next to a date field, or alone in a settings row, with the Text Field's height, edge, label, hint and error.\n\n## When not to use\n- A day or a span of days: use a date picker or a date range picker.\n- A duration or a rhythm: use Number Input or Select.\n- Three or four fixed slots: use Segmented Control or Select.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form, required } from '@angular/forms/signals';\nimport { UiTimeInput, UiTimePicker } from './ui/time-picker';\n\n@Component({\n selector: 'app-digest-schedule',\n imports: [UiTimePicker, UiTimeInput, FormField],\n template: `\n <ui-time-picker label=\"Send the digest at\" hint=\"Weekdays only, in your time zone.\">\n <input uiTimePicker [formField]=\"f.sendAt\" />\n </ui-time-picker>\n `,\n})\nexport class DigestSchedule {\n private readonly model = signal({ sendAt: '09:30' as string | null });\n protected readonly f = form(this.model, (p) => required(p.sendAt));\n}\n```\n\n## Rules\n- Put uiTimePicker on an <input> inside ui-time-picker; leave type and role to the directive.\n- Bind [formField], formControl(Name), ngModel or [(value)] on the input; values are \"HH:mm\" strings or null.\n- With [formField], put min and max on <ui-time-picker> (NG8022 forbids them on the input) and check them with validate() in the schema.\n- Pass the error string you want shown; the field doesn't read form state itself.\n- Without a label, give the input an aria-label.\n- step is at least 5; all rows render.\n- Needs overlay.ts next to time-picker.ts (the CLI adds it): the placement, Escape and outside-press layer shared by the floating components.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `label` | `string` | none | Above the field; names the field, the list and the list button. Clicking focuses without opening. |\n| `hint` | `string` | none | Quiet line under the field; the error replaces it. |\n| `error` | `string \\| null \\| undefined` | none | Invalid state: red edge, aria-invalid, message in place of the hint. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | 'md' | 28/32/36px; Classic 32/36/40; touch 34/38/42 (Classic +2) with 16px text. |\n| `optional` | `boolean` | false | \"Optional\" after the label, also spoken. |\n| `min / max` | `string (\"HH:mm\")` | none | Limits used when the input has none; the way to set them with [formField]. |\n| `labels` | `Partial<TimePickerLabels>` | English | Translations: optional, showTimes. |\n| `value (UiTimeInput)` | `string \\| null (model)` | null | \"HH:mm\" on a 24-hour clock; null when empty. Changes on a pick or a commit, not per keystroke. |\n| `open (UiTimeInput)` | `boolean (model)` | false | Whether the list shows; [(open)] opens it from code. |\n| `step (UiTimeInput)` | `number` | 15 | Minutes between listed times, counted from min; at least 5. Any minute can be typed. |\n| `min (UiTimeInput)` | `string (\"HH:mm\")` | 00:00 | Earliest time; the list starts here and earlier typed times are put back. Not allowed with [formField]. |\n| `max (UiTimeInput)` | `string (\"HH:mm\")` | 23:59 | Latest time; ignored when before min. Not allowed with [formField]. |\n| `hourCycle (UiTimeInput)` | `12 \\| 24` | the locale's | 9:30 PM or 21:30. |\n| `locale (UiTimeInput)` | `string` | LOCALE_ID | Display locale; its own AM/PM words can be typed too. |\n| `placeholder (UiTimeInput)` | `string` | 9:00 in the field's format | Shown while empty. |\n| `name (UiTimeInput)` | `string` | none | Submits \"HH:mm\" through a hidden input. |\n| `required (UiTimeInput)` | `boolean` | false | Sets aria-required; signal forms set it from the schema. |\n| `id (UiTimeInput)` | `string` | generated | Kept; the label's for points at it. |\n| `aria-describedby (UiTimeInput)` | `string` | none | Your own descriptions, kept alongside the hint or error. Set it as aria-describedby=\"…\", not [attr.aria-describedby]. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `valueChange (UiTimeInput)` | `string \\| null` | When a time is picked or typed text is committed (Enter, Tab, leaving the field). |\n| `openChange (UiTimeInput)` | `boolean` | When the list opens or closes. |\n\n## TimePickerLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `optional` | `string` | Tag after the label. |\n| `showTimes` | `string` | Name of the list button (\"Show times\"), followed by the label. |\n\n## TimeRow\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `v` | `string` | \"HH:mm\". |\n| `m` | `number` | Minutes after midnight. |\n| `label` | `string` | As shown, e.g. \"9:30 AM\". |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-text-field-edge` | `var(--ui-hairline)` | Resting edge (shared with Text Field). |\n| `--ui-text-field-edge-hover` | `text at 18%` | Hover edge. |\n| `--ui-text-field-edge-focus` | `var(--ui-border-input)` | Edge while focused or open, ≥ 3:1. |\n| `--ui-text-field-radius` | `7px` | Corners (Classic 10px). |\n| `--ui-time-picker-list-max-height` | `264px` | Tallest the list gets before it scrolls. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| ↓ / ↑ | Closed: open on the chosen time or the next one from now, without moving. Open: move one row, no wrap. |\n| Page Down / Page Up | An hour later / earlier while open. |\n| Digits and letters | Type a time; the list opens and scrolls the partial reading just into view. |\n| Enter | Pick the highlighted row, or commit typed text; then close. Closed: commit typed text. |\n| Esc | Close and keep the text; again: put back the last good time. |\n| Tab | Commit typed text (or put it back) and move on; never picks the arrow-highlighted row. |\n\n## Accessibility\n- Editable combobox: input role=combobox aria-autocomplete=list; focus stays in the input; aria-activedescendant while open.\n- Field and listbox named by the label; the list button is tabindex=-1 and named \"Show times\" + the label.\n- Options: role=option, aria-selected only on the exact chosen time.\n- The active row is the soft highlight, for pointer, keys and typing alike; forced colors use Highlight.\n- Invalid or out-of-range text is put back on commit; dev warning without a name.\n",
843
+ "keywords": "Inputs UiTimePicker UiTimeInput UiTimePickerList TimePickerSize TimePickerLabels TimeRow parseTime A time of day in a form: when a job runs, when a digest goes out, quiet hours, a reminder. Next to a date field, or alone in a settings row, with the Text Field's height, edge, label, hint and error."
844
+ },
845
+ {
846
+ "slug": "tips-panel",
847
+ "name": "Tips Panel",
848
+ "description": "A card with a grid of short tips, one action each. Taking a tip swaps its button for a done line and tints it, the header counts what's done, and the list scrolls past a maximum height.",
849
+ "category": "Cards",
850
+ "pro": false,
851
+ "entryPoint": "./ui/tips-panel",
852
+ "selector": "ui-tips-panel",
853
+ "url": "/ai/tips-panel.json",
854
+ "markdown": "# Tips Panel\n\nA card with a grid of short tips, one action each. Taking a tip swaps its button for a done line and tints it, the header counts what's done, and the list scrolls past a maximum height.\n\nAdd: `npx ochreui@latest add tips-panel`\nImport: `import { UiTipsPanel, UiTip } from './ui/tips-panel';`\nSelector: `<ui-tips-panel>`\nDocs: /components/tips-panel\n\n## When to use\n- Pointing new users at features they haven't tried, one small action each.\n- A \"What's new\" or getting-started card on a dashboard or in a dialog.\n\n## When not to use\n- Steps that must happen in order or depend on each other: use a setup checklist.\n- A single announcement: a banner or a toast is lighter.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { UiKbd } from './ui/kbd';\nimport { UiTip, UiTipsPanel } from './ui/tips-panel';\n\n@Component({\n selector: 'app-getting-started',\n imports: [UiTipsPanel, UiTip, UiKbd],\n template: `\n @if (shown()) {\n <ui-tips-panel title=\"Getting started\" closable (closed)=\"shown.set(false)\">\n <ui-tip title=\"Jump anywhere\" action=\"Try it\" doneLabel=\"Got it\" (taken)=\"openSearch()\">\n Press <kbd ui-kbd [keys]=\"['mod', 'k']\"></kbd> to open any project, page or setting.\n </ui-tip>\n <ui-tip title=\"Move to Team\" action=\"See plans\" doneLabel=\"Opened\" primary (taken)=\"openPlans()\">\n Unlimited projects, guest access and a full year of history.\n </ui-tip>\n </ui-tips-panel>\n }\n `,\n})\nexport class GettingStarted {\n protected readonly shown = signal(true);\n\n protected openSearch() {\n console.log('open the command menu');\n }\n\n protected openPlans() {\n console.log('open the pricing page');\n }\n}\n```\n\n## Rules\n- Put only ui-tip elements directly inside ui-tips-panel; each needs a title and an action.\n- The tip's content is its description: text, a <kbd ui-kbd>, a link.\n- Run the action in (taken); bind [(done)] if the state must survive a reload.\n- Close hides the card itself (open = false). Remove it with @if in (closed), or bind [(open)] to show it again; either way move focus in (closed).\n- The card is min(720px, 100%) wide; columns follow its own width (3 > 560px, 2 > 380px, then 1).\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `title` | `string` | 'Tips' | Heading at the top of the card; names the region. |\n| `headingLevel` | `number` | 3 | aria-level of the heading. |\n| `closable` | `boolean` | false | Shows a Close button in the last row. |\n| `open` | `boolean (model)` | true | Whether the card is shown. Close sets it to false after the exit; bind [(open)] to show it again. |\n| `labels` | `Partial<TipsPanelLabels>` | English | Word after the count, spoken count, default done line and Close text. |\n| `title (UiTip)` | `string` | required | The tip in a few words. |\n| `action (UiTip)` | `string` | required | Button text: a verb such as \"Invite\". |\n| `doneLabel (UiTip)` | `string` | labels.defaultDone | Done line once taken, in the past tense. |\n| `primary (UiTip)` | `boolean` | false | Solid button, for the one tip you want noticed. |\n| `done (UiTip)` | `boolean (model)` | false | Whether the tip is taken. Bind [(done)] to keep it across visits; set from outside it shows without the pop. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `closed` | `void` | Fires once the card has faded out after Close. Move focus here: the Close button is gone. |\n| `openChange` | `boolean` | Every change of open, including the one Close makes after the exit. |\n| `taken (UiTip)` | `void` | Fires when the tip's button is pressed. Run the action here. |\n| `doneChange (UiTip)` | `boolean` | Every change of done, when the tip is taken. |\n\n## TipsPanelLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `done` | `string` | After the count: \"2/9 done\". Default 'done'. |\n| `count` | `(done: number, total: number) => string` | Spoken count. Default \"2 of 9 done\". |\n| `defaultDone` | `string` | Done line of a tip without doneLabel. Default 'Done'. |\n| `close` | `string` | Close button text. Default 'Close'. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-tips-panel-max-height` | `420px` | Most the list grows before it scrolls; header and Close row stay put. |\n| `--ui-tips-panel-radius` | `10px; Classic 22px` | Outer corners of the card. |\n| `--ui-tips-panel-done` | `green darkened to 4.5:1 (light); Classic blue darkened to 4.5:1 (light)` | Done line and its check. |\n| `--ui-tips-panel-done-bg` | `a faint grey wash` | Tint of a taken tip. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Moves through the tips' buttons in order, then to Close. |\n| Enter Space | Takes the focused tip, or closes the card. |\n\n## Accessibility\n- A region named by its heading (headingLevel); tips are a list of listitems, each action a real button.\n- The done line is role=status; the count is a polite, atomic live region that says \"2 of 9 done\" while the visible \"2/9 done\" is hidden from screen readers.\n- Taking a tip from the keyboard moves focus to its done line (no visible ring), so Tab continues from the same tip.\n- Close removes the focused button: move focus in (closed), for example to the control that opens the tips again.\n- The count and done lines read at 4.5:1 or more; forced colors give the card, tips and buttons visible edges.\n",
855
+ "keywords": "Cards UiTipsPanel UiTip TipsPanelLabels Pointing new users at features they haven't tried, one small action each. A \"What's new\" or getting-started card on a dashboard or in a dialog."
856
+ },
857
+ {
858
+ "slug": "toggle-group",
859
+ "name": "Toggle Group",
860
+ "description": "A row of toggle buttons with one tab stop: several on at once, or one that can be cleared. Text or icons, separate chips that wrap or a compact track that scrolls, with signal forms, reactive forms or ngModel.",
861
+ "category": "Buttons",
862
+ "pro": false,
863
+ "entryPoint": "./ui/toggle-group",
864
+ "selector": "ui-toggle-group",
865
+ "url": "/ai/toggle-group.json",
866
+ "markdown": "# Toggle Group\n\nA row of toggle buttons with one tab stop: several on at once, or one that can be cleared. Text or icons, separate chips that wrap or a compact track that scrolls, with signal forms, reactive forms or ngModel.\n\nAdd: `npx ochreui@latest add toggle-group`\nImport: `import { UiToggleGroup, UiToggle, UiToggleIcon } from './ui/toggle-group';`\nSelector: `<ui-toggle-group>`\nDocs: /components/toggle-group\n\n## When to use\n- Filters where several can be on at once: statuses, severities.\n- Formatting or view toolbars: bold / italic, columns, map layers.\n- One optional choice that can be none: type=\"single\".\n\n## When not to use\n- Exactly one view must always be picked: use Segmented Control.\n- One on/off setting: use Switch, or Icon Button with pressed.\n- Many options or long labels: use Select.\n- Choices applied on submit: use Checkbox.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { FormField, form } from '@angular/forms/signals';\nimport { UiToggle, UiToggleGroup } from './ui/toggle-group';\n\n@Component({\n selector: 'app-run-filters',\n imports: [UiToggleGroup, UiToggle, FormField],\n template: `\n <span id=\"run-status\">Show runs</span>\n <ui-toggle-group aria-labelledby=\"run-status\" [formField]=\"f.status\">\n <button uiToggle value=\"running\">Running</button>\n <button uiToggle value=\"waiting\">Waiting on you</button>\n <button uiToggle value=\"done\">Done</button>\n <button uiToggle value=\"failed\">Failed</button>\n </ui-toggle-group>\n `,\n})\nexport class RunFilters {\n private readonly model = signal({ status: ['running', 'waiting'] });\n protected readonly f = form(this.model);\n}\n```\n\n## Rules\n- Put uiToggle on your own <button> elements with a value; name the group with aria-label or aria-labelledby.\n- Bind [formField], formControl(Name), ngModel or [(value)]; multiple gives string[], single gives string | null.\n- Icon-only items need label; put uiToggleIcon on the svg, drawn in currentColor.\n- With [formField], disable through the schema, not the disabled attribute.\n- Exactly one always picked? Use Segmented Control instead.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `type` | `'multiple' \\| 'single'` | 'multiple' | Any number on (a list), or one or none (a string or null). |\n| `value` | `readonly string[] \\| string \\| null (model)` | null | List in item order, or string \\| null. Unknown values are kept. |\n| `variant` | `'chips' \\| 'track'` | 'chips' | Separate chips that wrap, or a track that scrolls with raised pressed items. |\n| `size` | `'sm' \\| 'md' \\| 'lg'` | 'md' | 24/28/32px; Classic +2; touch ≥ 36. Clean track items 4px shorter. |\n| `disabled` | `boolean` | false | Disables every item; no tab stop. |\n| `value (UiToggle)` | `string` | required | What the item stands for in the group's value. |\n| `label (UiToggle)` | `string` | none | Accessible name and tooltip; required for icon-only items. |\n| `disabled (UiToggle)` | `boolean` | false | Disables the item; arrows skip it. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `valueChange` | `readonly string[] \\| string \\| null` | After an item is pressed; not when a form or [value] writes the value. |\n| `touch` | `void` | When focus leaves the group. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-toggle-group-radius` | `6px (Classic 9px chips, 7px track items)` | Item corners; the track is 2px rounder. |\n| `--ui-toggle-group-track` | `var(--ui-bg-subtle)` | Track fill. |\n| `--ui-toggle-group-on` | `color-mix(in srgb, var(--ui-text) 8%, transparent)` | Pressed fill of a chip. |\n| `--ui-toggle-group-press` | `0.96` | Scale while held. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Enters once, on the last item used (first pressed at first); leaves in one step. |\n| → / ↓ | Focus to the next item, wrapping. Nothing toggles. |\n| ← / ↑ | Focus to the previous item. ← / → swap in RTL. |\n| Home / End | First / last item. |\n| Space / Enter | Toggles the focused item. |\n\n## Accessibility\n- role=group of native buttons with aria-pressed, single mode included.\n- Roving tabindex; arrows only move focus; disabled items skipped.\n- Icon-only items: label is aria-label and title; dev warning when the group or an item has no name.\n- Off text uses muted text (≥ 4.5:1); focus ring on keyboard focus only, inset on the track.\n- Forced colors: every item has an edge; pressed items use Highlight.\n",
867
+ "keywords": "Buttons UiToggleGroup UiToggle UiToggleIcon ToggleGroupType ToggleGroupVariant ToggleGroupSize ToggleGroupValue Filters where several can be on at once: statuses, severities. Formatting or view toolbars: bold / italic, columns, map layers. One optional choice that can be none: type=\"single\"."
868
+ },
869
+ {
870
+ "slug": "tool-call-card",
871
+ "name": "Tool Call Card",
872
+ "description": "One line per agent tool call, with a live timer and its status, that folds open to the highlighted arguments and result with copy buttons, Retry on errors, and a group that sums up the turn.",
873
+ "category": "Agents",
874
+ "pro": false,
875
+ "entryPoint": "./ui/tool-call-card",
876
+ "selector": "ui-tool-call-card, ui-tool-call-group",
877
+ "url": "/ai/tool-call-card.json",
878
+ "markdown": "# Tool Call Card\n\nOne line per agent tool call, with a live timer and its status, that folds open to the highlighted arguments and result with copy buttons, Retry on errors, and a group that sums up the turn.\n\nAdd: `npx ochreui@latest add tool-call-card`\nImport: `import { UiToolCallCard, UiToolCallGroup } from './ui/tool-call-card';`\nSelector: `<ui-tool-call-card, ui-tool-call-group>`\nDocs: /components/tool-call-card\n\n## When to use\n- Tool and function calls in an agent chat or run log.\n- Several calls in one turn: wrap them in ui-tool-call-group.\n- Developer views where people copy the exact arguments or result.\n\n## When not to use\n- Reasoning without tool calls: use a thinking state.\n- End users who never need JSON: one status line, details in a log.\n- Megabyte payloads: trim or paginate first.\n\n## Usage\n\n```ts\nimport { Component, input, output } from '@angular/core';\nimport { ToolCallIcon, ToolCallStatus, UiToolCallCard, UiToolCallGroup } from './ui/tool-call-card';\n\nexport interface ToolCall {\n id: string;\n name: string;\n icon: ToolCallIcon;\n summary: string;\n status: ToolCallStatus;\n args: unknown;\n result?: unknown;\n error?: string;\n startedAt?: number;\n durationMs?: number;\n}\n\n@Component({\n selector: 'app-agent-turn',\n imports: [UiToolCallCard, UiToolCallGroup],\n template: `\n <ui-tool-call-group>\n @for (call of calls(); track call.id) {\n <ui-tool-call-card\n [name]=\"call.name\"\n [icon]=\"call.icon\"\n [summary]=\"call.summary\"\n [status]=\"call.status\"\n [args]=\"call.args\"\n [result]=\"call.result\"\n [error]=\"call.error\"\n [startedAt]=\"call.startedAt\"\n [duration]=\"call.durationMs\"\n retryable\n (retry)=\"rerun.emit(call.id)\"\n />\n }\n </ui-tool-call-group>\n `,\n})\nexport class AgentTurn {\n readonly calls = input.required<ToolCall[]>();\n readonly rerun = output<string>();\n}\n```\n\n## Rules\n- Keep cards as direct children of ui-tool-call-group; it reads their status, icon and time.\n- Set status back to running on retry; the card closes again if it opened itself.\n- Summaries: present progressive while running, past tense when done.\n- Redact secrets from args and result.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `name` | `string` | required | Tool name, monospace. |\n| `status` | `'running' \\| 'success' \\| 'error'` | 'running' | Spinner + live timer, check + duration, or Failed. |\n| `summary` | `string` | none | Short line after the name; truncates. |\n| `icon` | `ToolCallIcon` | 'wrench' | Built-in name (wrench, search, file, database, globe, terminal, code, mail, calendar, chart, cloud, user) or 24x24 path data. The group tiles show it too. |\n| `args` | `unknown` | none | Arguments; objects and JSON strings are pretty-printed and highlighted. Hidden when undefined. |\n| `result` | `unknown` | none | Result, like args; other strings are plain text. Running without it shows Waiting for result… |\n| `error` | `string` | none | Message shown when status is error. |\n| `startedAt` | `number` | none | Start time (ms epoch) for the live timer. |\n| `duration` | `number` | measured | Final duration in ms. |\n| `open` | `boolean (model)` | false | Body open; [(open)]. |\n| `openOnError` | `boolean` | true | Opens on error, closes on rerun, unless toggled by hand. |\n| `retryable` | `boolean` | false | Shows Retry next to the error. |\n| `maxCodeHeight` | `number` | 220 | Cap in px before fade + Show all. |\n| `labels` | `Partial<ToolCallLabels>` | English | Every visible and spoken string, and the duration format. |\n| `ui-tool-call-group · label` | `string` | Used N tools | Group header once nothing runs. |\n| `ui-tool-call-group · duration` | `number` | sum of cards | Total ms; default adds the cards up, failed attempts included. |\n| `ui-tool-call-group · open` | `boolean (model)` | false | List open; [(open)]. |\n| `ui-tool-call-group · labels` | `Partial<ToolCallGroupLabels>` | English | running, used(n), failed(n), duration(ms). |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `retry` | `void` | Retry pressed. Set status back to running and rerun. |\n\n## ToolCallLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `arguments` | `string` | Arguments |\n| `result` | `string` | Result |\n| `copyArguments` | `string` | Copy arguments |\n| `copyResult` | `string` | Copy result |\n| `copied` | `string` | Copied |\n| `showAll` | `string` | Show all |\n| `showLess` | `string` | Show less |\n| `waiting` | `string` | Waiting for result… |\n| `failed` | `string` | Failed |\n| `retry` | `string` | Retry |\n| `running` | `string` | Status word read and announced while running. |\n| `finished` | `string` | Status word once it succeeded. |\n| `failedAnnouncement` | `string` | Announced after the name on failure. |\n| `duration` | `(ms: number) => string` | 1.5s; 1m 05s past a minute. |\n\n## ToolCallGroupLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `running` | `string` | Using tools… |\n| `used` | `(count: number) => string` | Used N tools |\n| `failed` | `(count: number) => string` | N failed |\n| `duration` | `(ms: number) => string` | Total time format. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-tool-call-radius` | `calc(10px + 2px * var(--ui-look-tray))` | Card corners. |\n| `--ui-tool-call-code-string` | `darkened --ui-hue-cyan (Classic --ui-hue-teal)` | JSON strings; 4.5:1 on the well. |\n| `--ui-tool-call-code-number` | `darkened --ui-hue-amber` | JSON numbers and literals. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Headers, Retry, copy buttons, Show all; closed bodies skipped. |\n| Enter / Space | Toggles the focused card or group. |\n\n## Accessibility\n- Headers are buttons with aria-expanded/aria-controls; closed bodies are inert.\n- Header name includes a status word; status never rests on colour.\n- Polite live regions announce status changes and the group summary, not the first render.\n- Copy buttons named Copy arguments/result, Copied for 1.4s; Show all has aria-expanded.\n- Text and JSON colours ≥ 4.5:1; focus ring drawn whole; forced-colors borders.\n",
879
+ "keywords": "Agents UiToolCallCard UiToolCallGroup ToolCallStatus ToolCallIcon ToolCallIconName ToolCallLabels ToolCallGroupLabels toolCallIconPath formatToolCallValue Tool and function calls in an agent chat or run log. Several calls in one turn: wrap them in ui-tool-call-group. Developer views where people copy the exact arguments or result."
880
+ },
881
+ {
882
+ "slug": "tooltip",
883
+ "name": "Tooltip",
884
+ "description": "A small dark label for one control. It shows on hover after a short wait and at once under keyboard focus, neighbours follow without the wait, a shortcut can sit inside, and it flips to stay on screen.",
885
+ "category": "Feedback",
886
+ "pro": false,
887
+ "entryPoint": "./ui/tooltip",
888
+ "selector": "[uiTooltip]",
889
+ "url": "/ai/tooltip.json",
890
+ "markdown": "# Tooltip\n\nA small dark label for one control. It shows on hover after a short wait and at once under keyboard focus, neighbours follow without the wait, a shortcut can sit inside, and it flips to stay on screen.\n\nAdd: `npx ochreui@latest add tooltip`\nImport: `import { UiTooltip } from './ui/tooltip';`\nSelector: `<[uiTooltip]>`\nDocs: /components/tooltip\n\n## When to use\n- Naming an icon-only control and showing its shortcut.\n- Showing the whole of a cut-off label.\n- One short line about a control that already has a name.\n\n## When not to use\n- Anything clickable, selectable or copyable: use Popover.\n- A list of actions: use Dropdown Menu.\n- Information needed to finish a task, or a control's only label: touch never shows tooltips.\n- Copied/Saved after an action: use a live region or a toast.\n\n## Usage\n\n```ts\nimport { Component, output } from '@angular/core';\nimport { UiIconButton, UiIconButtonIcon } from './ui/icon-button';\nimport { UiTooltip } from './ui/tooltip';\n\n@Component({\n selector: 'app-search-button',\n imports: [UiIconButton, UiIconButtonIcon, UiTooltip],\n template: `\n <button type=\"button\" uiIconButton variant=\"secondary\" label=\"Search\" title=\"\"\n uiTooltip=\"Search\" uiTooltipShortcut=\"⌘K\" uiTooltipSide=\"bottom\" (click)=\"search.emit()\">\n <svg uiIconButtonIcon viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.9\" stroke-linecap=\"round\">\n <circle cx=\"11\" cy=\"11\" r=\"6.5\" />\n <path d=\"M20 20l-4.4-4.4\" />\n </svg>\n </button>\n `,\n})\nexport class SearchButton {\n search = output();\n}\n```\n\n## Rules\n- Put uiTooltip on the focusable control itself; wrap disabled controls in a tabindex=0 span.\n- On uiIconButton set title=\"\" so the native tooltip stays away.\n- Never put the only label or needed information in a tooltip.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `uiTooltip` | `string \\| null` | none | The label; empty or null means no tooltip. Text only, wraps at 240px. |\n| `uiTooltipShortcut` | `string` | none | Shortcut after the label, e.g. ⌘K; spelled out for screen readers. |\n| `uiTooltipSide` | `'top' \\| 'bottom' \\| 'left' \\| 'right'` | 'top' | Preferred side; flips when the other has more room. |\n| `uiTooltipAlign` | `'start' \\| 'center' \\| 'end'` | 'center' | Edge alignment (start mirrors in RTL); pushed inside the window. |\n| `uiTooltipOffset` | `number` | 6 | Gap to the control in px. |\n| `uiTooltipDelay` | `number` | 500 | Hover rest before showing, in ms; focus and neighbours within 300ms skip it. |\n| `uiTooltipDisabled` | `boolean` | false | Never shows. |\n| `uiTooltipOpen` | `boolean` | unset | Controlled open state; your value decides. [(uiTooltipOpen)] also follows hover and focus. |\n| `uiTooltipClass` | `string` | none | A class for the label. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `uiTooltipOpenChange` | `boolean` | When it wants to open or close: hover, focus, Escape or a click. |\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-tooltip-bg` | `var(--ui-bg-neutral-solid)` | Fill, inverted in dark mode. |\n| `--ui-tooltip-fg` | `var(--ui-text-on-neutral)` | Text. |\n| `--ui-tooltip-max-width` | `240px` | Where text wraps. |\n| `--ui-tooltip-drift` | `2px` | Glide-in distance (Classic 3px). |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Focus shows it at once; moving on hides it. |\n| Esc | Hides it before surrounding layers react; focus stays. |\n| Enter or Space | Activating the control hides it. |\n\n## Accessibility\n- role=tooltip; the control gets aria-describedby while it shows, merged with existing ids, never as its name.\n- Repeating the name describes only the shortcut, or nothing.\n- Shortcut glyphs are spelled out (⇧⌘S → Shift Command S).\n- Opens on keyboard focus, never after a click; Escape hides without moving focus.\n- Hoverable; one at a time; never on touch.\n- Text ≥ 4.5:1 light and dark; forced colors keep an outline.\n",
891
+ "keywords": "Feedback UiTooltip TooltipSide TooltipAlign Naming an icon-only control and showing its shortcut. Showing the whole of a cut-off label. One short line about a control that already has a name."
892
+ },
893
+ {
894
+ "slug": "tree-view",
895
+ "name": "Tree View",
896
+ "description": "Folders and files, or any hierarchy, where one row is picked: chevron folders that glide open, indent guides that darken around the picked row, a quiet meta per row, and the full tree keyboard with typeahead. The pick works with signal forms, reactive forms or ngModel.",
897
+ "category": "Data display",
898
+ "pro": false,
899
+ "entryPoint": "./ui/tree-view",
900
+ "selector": "ui-tree-view",
901
+ "url": "/ai/tree-view.json",
902
+ "markdown": "# Tree View\n\nFolders and files, or any hierarchy, where one row is picked: chevron folders that glide open, indent guides that darken around the picked row, a quiet meta per row, and the full tree keyboard with typeahead. The pick works with signal forms, reactive forms or ngModel.\n\nAdd: `npx ochreui@latest add tree-view`\nImport: `import { UiTreeView, UiTreeIcon } from './ui/tree-view';`\nSelector: `<ui-tree-view>`\nDocs: /components/tree-view\n\n## When to use\n- Folders and files: repositories, drives, knowledge bases, job outputs.\n- Any hierarchy browsed to pick one item: projects, docs outlines, nested categories.\n- A side panel whose picked row drives a viewer.\n\n## When not to use\n- Many columns, sorting or multi-select: use a data table.\n- Where a page sits in a hierarchy: use Breadcrumb.\n- A flat list of choices: use Select or Dropdown Menu.\n\n## Usage\n\n```ts\nimport { Component, signal } from '@angular/core';\nimport { TreeNode, UiTreeIcon, UiTreeView } from './ui/tree-view';\n\n@Component({\n selector: 'app-handbook-files',\n imports: [UiTreeView, UiTreeIcon],\n template: `\n <ui-tree-view aria-label=\"Handbook\" [items]=\"files\" [expanded]=\"['guides']\" [(value)]=\"selected\" (picked)=\"open($event.node)\">\n <ng-template uiTreeIcon let-node let-open=\"open\">\n <svg class=\"ui-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n @if (!node.children) {\n <path d=\"M9 2H4.5A1.5 1.5 0 0 0 3 3.5v9A1.5 1.5 0 0 0 4.5 14h7a1.5 1.5 0 0 0 1.5-1.5V6zM9 2v4h4\" />\n } @else if (open) {\n <path d=\"M2 11.5v-7A1.5 1.5 0 0 1 3.5 3h2.4l1.6 1.5h4A1.5 1.5 0 0 1 13 6v1M2 11.5 3.7 7.9A1.5 1.5 0 0 1 5 7h8.3a.8.8 0 0 1 .7 1.1l-1.5 3.8a1.5 1.5 0 0 1-1.4 1.1h-7.6A1.5 1.5 0 0 1 2 11.5z\" />\n } @else {\n <path d=\"M2 4.5A1.5 1.5 0 0 1 3.5 3h2.4l1.6 1.5h5A1.5 1.5 0 0 1 14 6v5.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 11.5z\" />\n }\n </svg>\n </ng-template>\n </ui-tree-view>\n `,\n})\nexport class HandbookFiles {\n protected readonly files: TreeNode[] = [\n {\n id: 'guides',\n label: 'guides',\n children: [\n { id: 'onboarding', label: 'onboarding.md', meta: '4 KB' },\n { id: 'on-call', label: 'on-call.md', meta: '9 KB' },\n ],\n },\n { id: 'policies', label: 'policies', children: [{ id: 'expenses', label: 'expenses.md' }] },\n { id: 'contacts', label: 'contacts.csv', meta: '1 KB' },\n ];\n protected readonly selected = signal<string | null>('onboarding');\n protected readonly reading = signal<TreeNode | null>(null);\n\n protected open(node: TreeNode) {\n if (!node.children) this.reading.set(node);\n }\n}\n```\n\n## Rules\n- Give every node a unique id; a children array (even empty) makes a folder.\n- Name the tree with aria-label or aria-labelledby.\n- Draw icons with <ng-template uiTreeIcon let-node let-open=\"open\"> and currentColor.\n- Bind the pick with [(value)], [formField], formControl or ngModel; use (picked) to act on every pick.\n- With [formField], don't set disabled or name: the schema does.\n- Arrow keys move focus only; selection follows Enter, Space or a click.\n\n## Inputs\n\n| Name | Type | Default | Description |\n| --- | --- | --- | --- |\n| `items` | `readonly TreeNode[]` | required | Top-level nodes; ids unique across the tree. |\n| `value` | `string \\| null (model)` | null | Picked id; [(value)] or a form binding. |\n| `expanded` | `readonly string[] (model)` | [] | Open folder ids; [(expanded)] to control, [expanded] for the start. |\n| `guides` | `boolean` | true | Lines under open folders; darker around the picked row. |\n| `disabled` | `boolean` | false | Whole tree off; forms set it. |\n| `invalid` | `boolean` | false | aria-invalid; signal forms set it. |\n| `labels` | `Partial<TreeViewLabels>` | English | Translations: empty. |\n| `aria-label / aria-labelledby` | `string` | none | Names the tree; one is required. |\n\n## Outputs\n\n| Name | Payload | Description |\n| --- | --- | --- |\n| `picked` | `TreePick` | { id, node } after click, Enter or Space, also on re-picks; not on form writes. |\n| `valueChange` | `string \\| null` | A pick changed the value. |\n| `expandedChange` | `readonly string[]` | A folder opened or closed. |\n| `touch` | `void` | Focus left the tree. |\n\n## TreeNode\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | `string` | Unique across the tree. |\n| `label` | `string` | Row text and accessible name. |\n| `meta` | `string` | Quiet end detail; the row description. |\n| `disabled` | `boolean` | Faded, skipped, inert; folders stay closed. |\n| `children` | `readonly TreeNode[]` | Makes a folder, even when empty. |\n| `icon` | `string` | Key for the uiTreeIcon template. |\n| `data` | `T` | Your payload, returned in picked. |\n\n## TreePick\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `id` | `string` | Picked id. |\n| `node` | `TreeNode` | Picked node. |\n\n## TreeIconContext\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `$implicit` | `TreeNode` | The node. |\n| `open` | `boolean` | Folder is open. |\n| `selected` | `boolean` | Row is picked. |\n\n## TreeViewLabels\n\n| Field | Type | Description |\n| --- | --- | --- |\n| `empty` | `string` | Line in an open empty folder. |\n\n## Template: uiTreeIcon\n\nDraws the 16px icon before each label. Use currentColor: muted, full ink on the picked row. Context: `{ $implicit: TreeNode; open: boolean; selected: boolean }`.\n\n```html\n<ng-template uiTreeIcon let-node let-open=\"open\">\n <svg class=\"ui-icon\" viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path [attr.d]=\"node.children ? (open ? folderOpen : folder) : file\" /></svg>\n</ng-template>\n```\n\n## CSS variables\n\n| Variable | Default | Description |\n| --- | --- | --- |\n| `--ui-tree-row-h` | `calc(var(--ui-control-h-sm) + 4px * tray)` | Row height: 28, Classic 32; on touch screens 36, Classic 40. |\n| `--ui-tree-indent` | `calc(var(--ui-space-4) + 2px * tray)` | Indent per level: 16, Classic and touch 18; capped at 45%. |\n| `--ui-tree-hover-bg` | `text at about 3%` | Hovered row. |\n| `--ui-tree-selected-bg` | `text at about 6%` | Picked row. |\n| `--ui-tree-chevron` | `muted at 45%, Classic 59% (about 51% in dark)` | Resting chevrons; var(--ui-text-muted) for 3:1. The Empty line is var(--ui-text-muted). |\n| `--ui-tree-guide` | `text at about 8%` | Guides. |\n| `--ui-tree-guide-active` | `text at about 22%` | Guide around the picked row. |\n\n## Keyboard\n\n| Keys | Action |\n| --- | --- |\n| Tab | Enter on the last-used, picked or first row; Tab again leaves. |\n| ↓ / ↑ | Next / previous visible row; disabled skipped; no wrap. |\n| → | Open a folder; on an open one, go to its first row. |\n| ← | Close an open folder; else go to the parent. |\n| Home / End | First / last visible row. |\n| Enter | Pick; on a folder also toggle. |\n| Space | Pick. |\n| * | Open every folder at this level. |\n| a–z, 0–9 | Typeahead over visible enabled rows; repeat a letter to cycle. |\n\n## Accessibility\n- role=tree with treeitems carrying aria-level, posinset, setsize, expanded, selected and disabled.\n- Rows named by the label (aria-labelledby), described by meta (aria-describedby).\n- Roving tabindex; focus ring on :focus-visible only.\n- Closed folders are visibility: hidden; closing around focus moves focus to the folder.\n- Labels use dir=auto aligned to the row direction.\n- Forced colors: SelectedItem for the picked row, dashed outline on hover, guides kept as borders.\n",
903
+ "keywords": "Data display UiTreeView UiTreeIcon TreeNode TreePick TreeIconContext TreeViewLabels Folders and files: repositories, drives, knowledge bases, job outputs. Any hierarchy browsed to pick one item: projects, docs outlines, nested categories. A side panel whose picked row drives a viewer."
904
+ }
905
+ ]
906
+ }