ochreui 0.0.0-stage → 0.0.2

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 +153 -2
  3. package/cli/ochreui.mjs +601 -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 +393 -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 +2124 -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
@@ -0,0 +1,109 @@
1
+ # Region Map
2
+
3
+ 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.
4
+
5
+ Add: `npx ochreui@latest add region-map`
6
+ Import: `import { UiRegionMap } from './ui/region-map';`
7
+ Selector: `<ui-region-map>`
8
+ Docs: /components/region-map
9
+
10
+ ## When to use
11
+ - A service area, sales territory or market focus in Morocco.
12
+ - A section about local presence or exclusive coverage in the United States, China, India, Brazil or Japan, next to a short text.
13
+
14
+ ## When not to use
15
+ - Maps that need cities, states, labels or exact borders: the outlines are simplified and unlabelled.
16
+
17
+ ## Usage
18
+
19
+ ```ts
20
+ import { Component } from '@angular/core';
21
+ import { UiRegionMap } from './ui/region-map';
22
+
23
+ @Component({
24
+ selector: 'app-coverage',
25
+ imports: [UiRegionMap],
26
+ template: `
27
+ <section class="coverage">
28
+ <ui-region-map />
29
+ <h3>Next-day service across Morocco</h3>
30
+ <p>Our technicians reach every site from Tangier to Dakhla within one working day.</p>
31
+ </section>
32
+ `,
33
+ styles: `
34
+ .coverage { inline-size: min(420px, 100%); margin-inline: auto; }
35
+ ui-region-map { inline-size: 100%; }
36
+ h3 { margin: 8px 0 0; color: var(--ui-text); font-size: 15px; line-height: 22px; font-weight: 600; }
37
+ p { margin: 4px 0 0; color: var(--ui-text-muted); font-size: 13px; line-height: 20px; }
38
+ `,
39
+ })
40
+ export class Coverage {}
41
+ ```
42
+
43
+ ## Rules
44
+ - 540 : 440 box, inline-size min(560px, 100%); menu scale clamp(0.62, width / 540, 1) from the top-left.
45
+ - Band: 14 s linear loop, clockwise from the northernmost point, layers at 0 / -0.42 / -0.84 s, glow outside the region only.
46
+ - Switch: old map 320 ms fade + grow to 1.04, new map 520 ms fade + 0.94 to 1; band restarts.
47
+ - 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.
48
+ - Pauses off-screen and in hidden tabs (animation-play-state) and resumes the band from the same pose when back.
49
+ - Reduced motion or --ui-motion-scale: 0 (also when set after load): band rests at its start; menu and switch instant; press scale kept.
50
+ - Outlines simplified from Natural Earth (public domain); Morocco from the Moroccan point-of-view file, southern provinces included with no internal line.
51
+ - Morocco is one closed outline (southern provinces included) among closed neighbour outlines, with no off-shore fragments, filling the box inside a small padding.
52
+
53
+ ## Inputs
54
+
55
+ | Name | Type | Default | Description |
56
+ | --- | --- | --- | --- |
57
+ | `region` | `RegionMapRegion` | 'ma' | Region shown: 'ma' \| 'us' \| 'cn' \| 'in' \| 'br' \| 'jp'. model(): two-way with [(region)]; picking in the menu writes it. |
58
+ | `showSwitcher` | `boolean` | true | Shows the region menu in the top-left corner. |
59
+ | `label` | `string \| ((region: RegionMapRegion) => string)` | labels.maps[region] | Accessible name of the map (role=img). Empty hides the map from assistive tech. |
60
+ | `labels` | `RegionMapLabelsInput` | English | regions (menu text per region), maps (map name per region), list (listbox name), button (button name, {name} = region). |
61
+
62
+ ## Outputs
63
+
64
+ | Name | Payload | Description |
65
+ | --- | --- | --- |
66
+ | `regionChange` | `RegionMapRegion` | Emits when a region is picked in the menu (from the region model). |
67
+
68
+ ## RegionMapRegion
69
+
70
+ `type RegionMapRegion = 'ma' | 'us' | 'cn' | 'in' | 'br' | 'jp'`
71
+
72
+ ## RegionMapLabels
73
+
74
+ `type RegionMapLabels = { regions: Record<RegionMapRegion, string>; maps: Record<RegionMapRegion, string>; list: string; button: string }`
75
+
76
+ ## RegionMapLabelsInput
77
+
78
+ `type RegionMapLabelsInput = Partial<Pick<RegionMapLabels, 'list' | 'button'>> & { regions?: Partial<Record<RegionMapRegion, string>>; maps?: Partial<Record<RegionMapRegion, string>> }`
79
+
80
+ ## CSS variables
81
+
82
+ | Variable | Default | Description |
83
+ | --- | --- | --- |
84
+ | `--ui-region-map-fill` | `light-dark(surface at 55%, slate at 9%)` | Region fill. |
85
+ | `--ui-region-map-line` | `light-dark(--ui-border-strong, text at 24%)` | Region borders. |
86
+ | `--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. |
87
+ | `--ui-region-map-band-1` | `lavender` | Eastern end of the band. |
88
+ | `--ui-region-map-band-2` | `pink` | Middle of the band. |
89
+ | `--ui-region-map-band-3` | `peach` | Western end of the band. |
90
+ | `--ui-region-map-panel-radius` | `16px` | Corners of the open menu. |
91
+ | `--ui-region-map-row-radius` | `10px` | Corners of a menu row and its highlight. |
92
+
93
+ ## Keyboard
94
+
95
+ | Keys | Action |
96
+ | --- | --- |
97
+ | Enter / Space | Button: open on the current region. List: pick the highlighted region, close, focus the button. |
98
+ | ArrowDown / ArrowUp | Button: open. List: move one row, no wrap. |
99
+ | Home / End | First / last region. |
100
+ | Escape | Close and focus the button. |
101
+ | Tab | Close and move on. |
102
+
103
+ ## Accessibility
104
+ - Map: role=img with aria-label from label (follows the region); the SVG is aria-hidden and not focusable; empty label: aria-hidden map.
105
+ - Button: aria-haspopup=listbox, aria-expanded, aria-controls, aria-label "Region: <name>".
106
+ - Listbox with aria-activedescendant and options with aria-selected; focus moves into the list on open; no type-ahead.
107
+ - Keyboard-driven: highlight shown on the selected row on open plus a 1px ring; forced colors: Highlight/HighlightText.
108
+ - Button hit area at least 24px when the menu is scaled to 62%.
109
+ - Forced colors: land outline CanvasText, neighbours GrayText, in light and dark alike.
@@ -0,0 +1,127 @@
1
+ # Resizable
2
+
3
+ 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.
4
+
5
+ Add: `npx ochreui@latest add resizable`
6
+ Import: `import { UiResizableGroup, UiResizablePanel, UiResizableHandle } from './ui/resizable';`
7
+ Selector: `<ui-resizable-group, ui-resizable-panel, ui-resizable-handle>`
8
+ Docs: /components/resizable
9
+
10
+ ## When to use
11
+ - A list or sidebar next to a work area whose width people choose: jobs and details, files and an editor.
12
+ - An editor above its output or log: nest a vertical group in a pane.
13
+ - A pane that folds away and comes back (drag past half its min, or Enter on the line).
14
+
15
+ ## When not to use
16
+ - Two views people switch between: use Tabs or Segmented Control.
17
+ - A panel that slides over the page for a moment: use Dialog or Popover.
18
+ - Only scrolling inside a fixed box: use Scroll Area.
19
+
20
+ ## Usage
21
+
22
+ ```ts
23
+ import { Component } from '@angular/core';
24
+ import { UiResizableGroup, UiResizableHandle, UiResizablePanel } from './ui/resizable';
25
+
26
+ @Component({
27
+ selector: 'app-job-console',
28
+ imports: [UiResizableGroup, UiResizablePanel, UiResizableHandle],
29
+ template: `
30
+ <div class="frame">
31
+ <ui-resizable-group>
32
+ <ui-resizable-panel [defaultSize]="30" [minSize]="20" [maxSize]="50" collapsible>
33
+ <nav aria-label="Jobs">Nightly orders export · Refresh price cache · Rebuild search index</nav>
34
+ </ui-resizable-panel>
35
+ <ui-resizable-handle withHandle aria-label="Resize the job list" />
36
+ <ui-resizable-panel [defaultSize]="70" [minSize]="40">
37
+ <ui-resizable-group direction="vertical">
38
+ <ui-resizable-panel [defaultSize]="65">
39
+ <p>Copies yesterday's orders to the warehouse in batches of 500.</p>
40
+ </ui-resizable-panel>
41
+ <ui-resizable-handle aria-label="Resize the log" />
42
+ <ui-resizable-panel [defaultSize]="35" [minSize]="15" collapsible>
43
+ <pre>02:00:11 Wrote batch 1 of 37</pre>
44
+ </ui-resizable-panel>
45
+ </ui-resizable-group>
46
+ </ui-resizable-panel>
47
+ </ui-resizable-group>
48
+ </div>
49
+ `,
50
+ styles: `
51
+ .frame { height: 480px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); overflow: hidden; }
52
+ nav, p, pre { margin: 0; padding: 14px; }
53
+ `,
54
+ })
55
+ export class JobConsole {}
56
+ ```
57
+
58
+ ## Rules
59
+ - Panels and handles alternate as direct children of <ui-resizable-group>; nest a whole group inside a panel for the other direction.
60
+ - Give the group's parent a height; sizes are percentages.
61
+ - A handle trades space only with its two neighbouring panes.
62
+ - Store [(layout)] (e.g. localStorage) and pass it back; it is written once per user change.
63
+
64
+ ## Inputs
65
+
66
+ | Name | Type | Default | Description |
67
+ | --- | --- | --- | --- |
68
+ | `direction (UiResizableGroup)` | `'horizontal' \| 'vertical'` | 'horizontal' | Side by side or stacked. The group fills its parent; give the parent a height. |
69
+ | `keyboardStep (UiResizableGroup)` | `number` | 5 | Arrow step in %; Shift doubles it. |
70
+ | `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. |
71
+ | `defaultSize (UiResizablePanel)` | `number` | none | Starting size in %. Panes without one share what is left; all scaled to 100. |
72
+ | `minSize (UiResizablePanel)` | `number` | 0 | Smallest size in %; drags, arrows and Home stop here. |
73
+ | `maxSize (UiResizablePanel)` | `number` | 100 | Largest size in %. |
74
+ | `collapsible (UiResizablePanel)` | `boolean` | false | Snaps to collapsedSize past half its min; Enter on the next handle folds and restores it. |
75
+ | `collapsedSize (UiResizablePanel)` | `number` | 0 | Folded size in %. 0 = hidden and inert; more keeps an icon rail. |
76
+ | `collapsed (UiResizablePanel)` | `boolean` | false | Two-way. Set from code to fold or unfold with a glide. |
77
+ | `id (UiResizablePanel)` | `string` | generated | Target of the handle's aria-controls. |
78
+ | `withHandle (UiResizableHandle)` | `boolean` | false | A small grip on the line. |
79
+ | `aria-label (UiResizableHandle)` | `string` | 'Resize' | What it resizes: "Resize the job list". |
80
+ | `labels (UiResizableHandle)` | `Partial<ResizableLabels>` | { resize: 'Resize' } | Fallback name and the spoken size, for translation. |
81
+
82
+ ## Outputs
83
+
84
+ | Name | Payload | Description |
85
+ | --- | --- | --- |
86
+ | `layoutChange (UiResizableGroup)` | `number[]` | After each user change: pointerup, a key, Enter, double-click, reset() or [(collapsed)]. |
87
+ | `resizing (UiResizableGroup)` | `boolean` | True when a drag starts, false when it ends. |
88
+ | `collapsedChange (UiResizablePanel)` | `boolean` | When the pane folds or opens, by any means. |
89
+
90
+ ## ResizableDirection
91
+
92
+ | Field | Type | Description |
93
+ | --- | --- | --- |
94
+ | `'horizontal' \| 'vertical'` | `union` | Group direction. |
95
+
96
+ ## ResizableLabels
97
+
98
+ | Field | Type | Description |
99
+ | --- | --- | --- |
100
+ | `resize` | `string` | Handle name when it has no aria-label. |
101
+ | `size` | `(percent: number) => string` | Optional. Spoken size; default "34%" in the app locale. |
102
+
103
+ ## CSS variables
104
+
105
+ | Variable | Default | Description |
106
+ | --- | --- | --- |
107
+ | `--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. |
108
+ | `--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). |
109
+ | `--ui-resizable-hit` | `var(--ui-space-3)` | Grab strip across the line; var(--ui-space-6) on touch. |
110
+
111
+ ## Keyboard
112
+
113
+ | Keys | Action |
114
+ | --- | --- |
115
+ | Tab | Next handle; a folded pane's content is skipped. |
116
+ | ← / → (↑ / ↓ when stacked) | Move 5%; Shift 10%. Follow the screen in RTL. From a folded pane, away from the edge opens it to its min. |
117
+ | Home | Pane before the line to its min. |
118
+ | End | Pane before the line to its max; folds a collapsible pane after it. |
119
+ | Enter | Fold or restore the collapsible neighbour; focus stays. |
120
+ | Double-click | The pair back to its default sizes. |
121
+
122
+ ## Accessibility
123
+ - 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.
124
+ - Name each handle with aria-label; dev-mode warning when missing.
125
+ - A pane folded to 0 is inert.
126
+ - Focus ring inside the 12px grab strip, keyboard only (not after a mouse or touch drag).
127
+ - Forced colors: line CanvasText, grip edge CanvasText, ring Highlight.
@@ -0,0 +1,113 @@
1
+ # Scroll Area
2
+
3
+ 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.
4
+
5
+ Add: `npx ochreui@latest add scroll-area`
6
+ Import: `import { UiScrollArea } from './ui/scroll-area';`
7
+ Selector: `<ui-scroll-area>`
8
+ Docs: /components/scroll-area
9
+
10
+ ## When to use
11
+ - A fixed-height list, log or panel inside a card.
12
+ - A row wider than its card (attachments, chips, tabs), scrolled sideways.
13
+ - Where the native scrollbar looks out of place but scrolling must stay native.
14
+
15
+ ## When not to use
16
+ - The page itself: keep the window's scrollbar.
17
+ - A sortable, selectable table: a data table has its own scroller.
18
+ - Code: a code block scrolls its own lines.
19
+ - User-resizable panes: put a Scroll Area inside each pane.
20
+
21
+ ## Usage
22
+
23
+ ```ts
24
+ import { Component } from '@angular/core';
25
+ import { UiScrollArea } from './ui/scroll-area';
26
+
27
+ @Component({
28
+ selector: 'app-release-notes',
29
+ imports: [UiScrollArea],
30
+ template: `
31
+ <ui-scroll-area maxHeight="240" fade label="Release notes">
32
+ <ul class="notes">
33
+ @for (note of notes; track note.version) {
34
+ <li><strong>{{ note.version }}</strong> {{ note.summary }}</li>
35
+ }
36
+ </ul>
37
+ </ui-scroll-area>
38
+ `,
39
+ styles: `
40
+ .notes { margin: 0; padding: 4px 16px; list-style: none; }
41
+ .notes li { padding: 10px 0; }
42
+ `,
43
+ })
44
+ export class ReleaseNotes {
45
+ protected readonly notes = [
46
+ { version: '4.2.0', summary: 'Shared dashboards can be pinned to the sidebar.' },
47
+ { version: '4.1.3', summary: 'CSV exports keep the column order you set.' },
48
+ { version: '4.1.2', summary: 'Faster search across archived projects.' },
49
+ { version: '4.1.0', summary: 'Two-factor sign-in with passkeys.' },
50
+ { version: '4.0.4', summary: 'Fixed time zones in weekly reports.' },
51
+ { version: '4.0.0', summary: 'A new editor, with comments on any line.' },
52
+ { version: '3.9.1', summary: 'Webhooks retry for up to a day.' },
53
+ { version: '3.9.0', summary: 'Audit log filters by person and action.' },
54
+ ];
55
+ }
56
+ ```
57
+
58
+ ## Rules
59
+ - Give it a height to scroll in: maxHeight, a fixed block-size, or flex: 1 with min-block-size: 0 in a column.
60
+ - Name it with label or labelledBy, not aria-label on the tag: the name goes on the inner scrolling element.
61
+ - viewport() returns the scrolling element, for scrollTo, scrollTop or an IntersectionObserver root.
62
+ - class, style and id on <ui-scroll-area> land on the outer box.
63
+ - 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.
64
+
65
+ ## Inputs
66
+
67
+ | Name | Type | Default | Description |
68
+ | --- | --- | --- | --- |
69
+ | `orientation` | `'vertical' \| 'horizontal' \| 'both'` | 'vertical' | Which way it scrolls; the other axis is clipped. |
70
+ | `type` | `'hover' \| 'scroll' \| 'always'` | 'hover' | Bar shows on hover or while scrolling; only while scrolling; or always while it overflows. |
71
+ | `fade` | `boolean` | false | Edge fades (24px, Classic 28px) where there is more to scroll; each shrinks to 0 at its end. |
72
+ | `maxHeight` | `number \| string` | none | Grows with its content up to this, then scrolls. Number = px, or any CSS length. |
73
+ | `label` | `string` | none | Accessible name of the scroll region (on the scrolling element). |
74
+ | `labelledBy` | `string` | none | Id of a visible heading that names the region, instead of label. |
75
+
76
+ ## Outputs
77
+
78
+ | Name | Payload | Description |
79
+ | --- | --- | --- |
80
+ | `scrolled` | `Event` | The scrolling element's native scroll event. |
81
+
82
+ ## ScrollAreaOrientation
83
+
84
+ `type ScrollAreaOrientation = 'vertical' | 'horizontal' | 'both'`
85
+
86
+ ## ScrollAreaType
87
+
88
+ `type ScrollAreaType = 'hover' | 'scroll' | 'always'`
89
+
90
+ ## CSS variables
91
+
92
+ | Variable | Default | Description |
93
+ | --- | --- | --- |
94
+ | `--ui-scroll-area-thumb` | `color-mix(in oklab, var(--ui-text) 22%, transparent); 24% in Classic` | Thumb at rest. |
95
+ | `--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. |
96
+ | `--ui-scroll-area-thumb-active` | `color-mix(in oklab, var(--ui-text) 50%, transparent); 54% in Classic` | Thumb while dragged. |
97
+ | `--ui-scroll-area-fade` | `24px; 28px in Classic` | Longest edge fade. |
98
+
99
+ ## Keyboard
100
+
101
+ | Keys | Action |
102
+ | --- | --- |
103
+ | Tab | Reaches the box only while it overflows. |
104
+ | Arrow keys | Scroll a little (native). |
105
+ | Page Up / Page Down / Space | Scroll a page (native). |
106
+ | Home / End | Start / end (native, vertical scrollers). |
107
+
108
+ ## Accessibility
109
+ - Scrolling is native: wheel, touch, keys, find in page and scrollIntoView all work.
110
+ - The scrolling element is a region named by label or labelledBy, and a Tab stop only while it overflows.
111
+ - The drawn bar is aria-hidden; keyboard scrolling does the same job.
112
+ - Keyboard-only inset focus ring, drawn on the outer box so the fades never hide it.
113
+ - Forced colors: CanvasText thumb, Highlight while hovered or dragged.
@@ -0,0 +1,96 @@
1
+ # Segmented Control
2
+
3
+ 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.
4
+
5
+ Add: `npx ochreui@latest add segmented-control`
6
+ Import: `import { UiSegmentedControl, UiSegment, UiSegmentCount } from './ui/segmented-control';`
7
+ Selector: `<ui-segmented-control>`
8
+ Docs: /components/segmented-control
9
+
10
+ ## When to use
11
+ - Switching between a few views of the same content: list/board, ranges, page sections.
12
+ - A small choice that applies at once, with every option in sight.
13
+
14
+ ## When not to use
15
+ - More than six options or long labels: use Select or a menu.
16
+ - A choice that counts only when a form is saved: use radio buttons.
17
+ - One thing on or off: use Switch.
18
+
19
+ ## Usage
20
+
21
+ ```ts
22
+ import { Component, signal } from '@angular/core';
23
+ import { UiSegment, UiSegmentCount, UiSegmentedControl } from './ui/segmented-control';
24
+
25
+ @Component({
26
+ selector: 'app-agent-sections',
27
+ imports: [UiSegmentedControl, UiSegment, UiSegmentCount],
28
+ template: `
29
+ <ui-segmented-control aria-label="Agent sections" kind="tabs" [(value)]="section">
30
+ <button uiSegment value="overview" id="tab-overview" aria-controls="panel-overview">Overview</button>
31
+ <button uiSegment value="runs" id="tab-runs" aria-controls="panel-runs">Runs</button>
32
+ <button uiSegment value="alerts" id="tab-alerts" aria-controls="panel-alerts">Alerts <span uiSegmentCount>3</span></button>
33
+ </ui-segmented-control>
34
+ <section id="panel-overview" role="tabpanel" aria-labelledby="tab-overview" [hidden]="section() !== 'overview'">…</section>
35
+ <section id="panel-runs" role="tabpanel" aria-labelledby="tab-runs" [hidden]="section() !== 'runs'">…</section>
36
+ <section id="panel-alerts" role="tabpanel" aria-labelledby="tab-alerts" [hidden]="section() !== 'alerts'">…</section>
37
+ `,
38
+ })
39
+ export class AgentSections {
40
+ protected readonly section = signal<string | null>('overview');
41
+ }
42
+ ```
43
+
44
+ ## Rules
45
+ - Put uiSegment on your own <button> elements inside ui-segmented-control; give each a value.
46
+ - Name the group with aria-label or aria-labelledby; icon-only options need aria-label.
47
+ - Bind [(value)], [formField], formControl, formControlName or ngModel.
48
+ - With [formField], don't set disabled or name: the form sets them.
49
+ - With kind="tabs", add aria-controls to each option and role="tabpanel" panels.
50
+ - valueChange fires once per choice (on release after a drag); value is null until someone picks.
51
+
52
+ ## Inputs
53
+
54
+ | Name | Type | Default | Description |
55
+ | --- | --- | --- | --- |
56
+ | `value` | `T \| null (model)` | null | Picked value; null until chosen (first enabled option takes Tab). |
57
+ | `variant` | `'tray' \| 'buttons' \| 'underline'` | 'tray' | Track with a pill; chips with a sliding fill; tabs with a sliding line. |
58
+ | `size` | `'sm' \| 'md' \| 'lg'` | 'md' | 24/28/32px; Classic 26/30/36; options ≥ 40px on touch. |
59
+ | `fullWidth` | `boolean` | false | Fills the container with equal options. |
60
+ | `kind` | `'radio' \| 'tabs'` | 'radio' | radiogroup, or tablist (aria-controls on each option). |
61
+ | `disabled` | `boolean` | false | Disables every option; forms set it. |
62
+ | `name` | `string` | none | Hidden input for native submission; a native form reset restores the first value. Signal forms set it. |
63
+ | `value (UiSegment)` | `T` | required | The value this option picks. |
64
+ | `disabled (UiSegment)` | `boolean` | false | Skipped by arrows and drag; still shows as picked if it holds the value. |
65
+
66
+ ## Outputs
67
+
68
+ | Name | Payload | Description |
69
+ | --- | --- | --- |
70
+ | `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. |
71
+
72
+ ## CSS variables
73
+
74
+ | Variable | Default | Description |
75
+ | --- | --- | --- |
76
+ | `--ui-segmented-track` | `ink at 6%` | Tray track. |
77
+ | `--ui-segmented-pill` | `light-dark(var(--ui-bg-surface), var(--ui-bg-muted))` | Tray pill, lighter than the track in dark. |
78
+ | `--ui-segmented-fill` | `ink at 8%` | buttons indicator. |
79
+ | `--ui-segmented-line` | `var(--ui-text)` | underline indicator. |
80
+
81
+ ## Keyboard
82
+
83
+ | Keys | Action |
84
+ | --- | --- |
85
+ | Tab | Into the picked option, then out: one stop. |
86
+ | ← / → | Previous/next option, focused and picked, wrapping; mirrored in RTL. |
87
+ | ↑ / ↓ | Same as ← / →; not with kind="tabs". |
88
+ | Home / End | First / last option. |
89
+ | Enter / Space | Picks the focused option. |
90
+
91
+ ## Accessibility
92
+ - radiogroup + radio with aria-checked, or tablist + tab with aria-selected; indicator aria-hidden.
93
+ - Counts and badges are part of the option name; dev warning when the group or an icon-only option has no name.
94
+ - Roving tabindex; disabled options skipped; disabled control sets aria-disabled.
95
+ - Inactive labels and icons ≥ 4.5:1; picked label in full ink.
96
+ - Forced colors: picked option in Highlight; focus outline kept.
@@ -0,0 +1,122 @@
1
+ # Select
2
+
3
+ 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)].
4
+
5
+ Add: `npx ochreui@latest add select`
6
+ Import: `import { UiSelect, UiSelectTrigger, UiOption, UiOptionIcon, UiSelectList } from './ui/select';`
7
+ Selector: `<ui-select>`
8
+ Docs: /components/select
9
+
10
+ ## When to use
11
+ - One option from a short or medium list in a form: team, region, time zone, plan.
12
+ - Settings rows next to Text Fields, with the same height, edge and focus.
13
+
14
+ ## When not to use
15
+ - Two to four options that should stay visible: use Segmented Control.
16
+ - Long searchable lists or several picks: use Combobox.
17
+ - Actions rather than a value: use a menu.
18
+
19
+ ## Usage
20
+
21
+ ```ts
22
+ import { Component, signal } from '@angular/core';
23
+ import { FormField, form, required } from '@angular/forms/signals';
24
+ import { UiOption, UiSelect, UiSelectTrigger } from './ui/select';
25
+
26
+ @Component({
27
+ selector: 'app-deploy-settings',
28
+ imports: [UiSelect, UiSelectTrigger, UiOption, FormField],
29
+ template: `
30
+ <ui-select label="Data region" hint="Where your files and backups live.">
31
+ <button uiSelect [formField]="f.region"></button>
32
+ @for (r of regions; track r.id) {
33
+ <ui-option [value]="r.id" [description]="r.note" [disabled]="r.soon">{{ r.name }}</ui-option>
34
+ }
35
+ </ui-select>
36
+ `,
37
+ })
38
+ export class DeploySettings {
39
+ protected readonly regions = [
40
+ { id: 'fra', name: 'Frankfurt', note: 'Data stays in the EU', soon: false },
41
+ { id: 'iad', name: 'Northern Virginia', note: 'Fastest for the Americas', soon: false },
42
+ { id: 'gru', name: 'São Paulo', note: 'Opens in March', soon: true },
43
+ ];
44
+ private readonly model = signal({ region: 'fra' as string | null });
45
+ protected readonly f = form(this.model, (p) => required(p.region));
46
+ }
47
+ ```
48
+
49
+ ## Rules
50
+ - Put uiSelect on an empty <button> inside ui-select, with ui-option elements next to it.
51
+ - Bind [formField], formControl(Name), ngModel or [(value)] on the button.
52
+ - With [formField], set required and disabled in the schema, not as attributes.
53
+ - Object values need compareWith; name submits String(value) only.
54
+ - Pass the error string you want shown; the field doesn't read form state itself.
55
+ - Without a label, give the button an aria-label.
56
+ - Needs overlay.ts next to select.ts (the CLI adds it): the placement, Escape and outside-press layer shared by the floating components.
57
+
58
+ ## Inputs
59
+
60
+ | Name | Type | Default | Description |
61
+ | --- | --- | --- | --- |
62
+ | `label` | `string` | none | Above the field; names the field and the list. Clicking focuses the field without opening. |
63
+ | `hint` | `string` | none | Quiet line under the field; the error replaces it. |
64
+ | `error` | `string \| null \| undefined` | none | Invalid state: red edge, aria-invalid, message in place of the hint. |
65
+ | `size` | `'sm' \| 'md' \| 'lg'` | 'md' | 28/32/36px; Classic 32/36/40; touch 34/38/42 with 16px text. |
66
+ | `optional` | `boolean` | false | "Optional" after the label, also spoken. |
67
+ | `labels` | `Partial<SelectLabels>` | English | Translations: optional, placeholder. |
68
+ | `value (UiSelectTrigger)` | `T \| null (model)` | null | The chosen value; null shows the placeholder. [(value)] or a form binding. |
69
+ | `open (UiSelectTrigger)` | `boolean (model)` | false | Whether the list shows; [(open)] opens it from code. |
70
+ | `placeholder (UiSelectTrigger)` | `string` | labels.placeholder | Shown while nothing is chosen. |
71
+ | `compareWith (UiSelectTrigger)` | `(a: T, b: T) => boolean` | Object.is | Matches the value to an option, for object values. |
72
+ | `name (UiSelectTrigger)` | `string` | none | Submits String(value) through a hidden input. |
73
+ | `required (UiSelectTrigger)` | `boolean` | false | Sets aria-required; signal forms set it from the schema. |
74
+ | `id (UiSelectTrigger)` | `string` | generated | Kept; the label's for points at it. |
75
+ | `aria-describedby (UiSelectTrigger)` | `string` | none | Your own descriptions, kept alongside the hint or error. Set it as aria-describedby="…", not [attr.aria-describedby]. |
76
+ | `value (UiOption)` | `unknown` | none | What the form gets when it is picked. |
77
+ | `description (UiOption)` | `string` | none | Quieter second line, read as the description. |
78
+ | `disabled (UiOption)` | `boolean` | false | Dimmed; pointer, keys and type-ahead skip it. |
79
+ | `textValue (UiOption)` | `string` | its text | What the field shows and type-ahead matches. |
80
+
81
+ ## Outputs
82
+
83
+ | Name | Payload | Description |
84
+ | --- | --- | --- |
85
+ | `valueChange (UiSelectTrigger)` | `T \| null` | When another option is picked, by pointer, keys or type-ahead. |
86
+ | `openChange (UiSelectTrigger)` | `boolean` | When the list opens or closes. |
87
+
88
+ ## SelectLabels
89
+
90
+ | Field | Type | Description |
91
+ | --- | --- | --- |
92
+ | `optional` | `string` | Tag after the label. |
93
+ | `placeholder` | `string` | Default placeholder ("Choose…"). |
94
+
95
+ ## CSS variables
96
+
97
+ | Variable | Default | Description |
98
+ | --- | --- | --- |
99
+ | `--ui-text-field-edge` | `var(--ui-hairline)` | Resting edge (shared with Text Field). |
100
+ | `--ui-text-field-edge-hover` | `text at 18%` | Hover edge. |
101
+ | `--ui-text-field-edge-focus` | `var(--ui-border-input)` | Edge while the list is open, ≥ 3:1. |
102
+ | `--ui-text-field-radius` | `7px` | Corners (Classic 10px). |
103
+ | `--ui-select-panel-max-height` | `288px` | Tallest the list gets before it scrolls. |
104
+
105
+ ## Keyboard
106
+
107
+ | Keys | Action |
108
+ | --- | --- |
109
+ | ↓ / ↑ | Closed: open on the chosen option. Open: move one option, no wrap, skipping disabled. |
110
+ | Enter / Space | Open, or pick the active option and close. |
111
+ | Home / End | First / last option while open. |
112
+ | Page Up / Page Down | Same as Home / End. |
113
+ | Letters | Type-ahead (0.65s buffer, Space joins it); a repeated letter cycles. Closed: picks directly. |
114
+ | Esc | Close without changing; stops there. |
115
+ | Tab | Close without picking and move on. |
116
+
117
+ ## Accessibility
118
+ - button role=combobox aria-haspopup=listbox; focus stays on it, aria-activedescendant while open.
119
+ - Named by the label only (no double read); aria-controls only while open.
120
+ - Options: role=option, aria-selected, aria-disabled, named by the label and described by the second line.
121
+ - The active row is the soft highlight, for pointer and keys alike; forced colors use Highlight.
122
+ - Placeholder, hint and descriptions ≥ 4.5:1; focus ring on keyboard focus only; dev warning without a name.
@@ -0,0 +1,69 @@
1
+ # Separator
2
+
3
+ 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.
4
+
5
+ Add: `npx ochreui@latest add separator`
6
+ Import: `import { UiSeparator } from './ui/separator';`
7
+ Selector: `<ui-separator>`
8
+ Docs: /components/separator
9
+
10
+ ## When to use
11
+ - Between groups inside a card, a list or a menu: above a footer, between settings sections.
12
+ - Upright between groups of toolbar controls, or between stats in a header.
13
+ - As a labelled break in a feed (Today, Earlier) or an "or" between two alternatives.
14
+
15
+ ## When not to use
16
+ - Between every row of a list: spacing or a hairline on the rows is calmer.
17
+ - Around content that already sits on its own card.
18
+ - As a heading people navigate by: use a real heading.
19
+ - Inside a dropdown menu: the menu draws its own dividers.
20
+
21
+ ## Usage
22
+
23
+ ```ts
24
+ import { Component } from '@angular/core';
25
+ import { UiSeparator } from './ui/separator';
26
+
27
+ @Component({
28
+ selector: 'app-run-stats',
29
+ imports: [UiSeparator],
30
+ template: `
31
+ <div class="stats">
32
+ <span>12 runs</span>
33
+ <ui-separator orientation="vertical" />
34
+ <span>1 failed</span>
35
+ </div>
36
+ `,
37
+ styles: `
38
+ .stats { display: flex; align-items: center; gap: 8px; }
39
+ `,
40
+ })
41
+ export class RunStats {}
42
+ ```
43
+
44
+ ## Rules
45
+ - Spacing first, line second: add a separator only where spacing alone doesn't show the break.
46
+ - Keep labels to one or two words; a sentence should be a heading.
47
+ - A vertical separator needs a flex row with align-items: center and a gap around it.
48
+
49
+ ## Inputs
50
+
51
+ | Name | Type | Default | Description |
52
+ | --- | --- | --- | --- |
53
+ | `orientation` | `'horizontal' \| 'vertical'` | 'horizontal' | Horizontal spans its container. Vertical is a short upright line centred in a flex row. |
54
+ | `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. |
55
+ | `decorative` | `boolean` | true | Hidden from assistive tech. Set false for role="separator", named by the label. |
56
+
57
+ ## CSS variables
58
+
59
+ | Variable | Default | Description |
60
+ | --- | --- | --- |
61
+ | `--ui-separator-color` | `--ui-hairline; --ui-border with data-ui-look="tray"` | Line color. |
62
+ | `--ui-separator-width` | `0.5px; 1px with data-ui-look="tray"` | Line thickness. |
63
+ | `--ui-separator-length` | `16px; 18px with data-ui-look="tray"` | Height of a vertical separator. |
64
+
65
+ ## Accessibility
66
+ - Decorative by default: role="none", so it is skipped. A label stays readable as plain text; only the two lines are hidden.
67
+ - With decorative set to false it is role="separator", with aria-orientation="vertical" when upright and the label as its name.
68
+ - Never focusable.
69
+ - In forced-colors mode the line uses the system text color.