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,83 @@
1
+ # Shimmer Loader
2
+
3
+ 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.
4
+
5
+ Add: `npx ochreui@latest add shimmer-loader`
6
+ Import: `import { UiShimmerBlock, UiShimmerText } from './ui/shimmer-loader';`
7
+ Selector: `<[uiShimmerBlock], [uiShimmerText]>`
8
+ Docs: /components/shimmer-loader
9
+
10
+ ## When to use
11
+ - Placeholders shaped like the cards, rows or profiles on their way.
12
+ - A shimmering status line while an answer or a long task is written.
13
+
14
+ ## When not to use
15
+ - Waits under about 300ms: a flash of placeholders feels slower.
16
+ - Measurable progress: use a progress bar.
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { Component } from '@angular/core';
22
+ import { UiShimmerBlock, UiShimmerText } from './ui/shimmer-loader';
23
+
24
+ @Component({
25
+ selector: 'app-post-placeholder',
26
+ imports: [UiShimmerBlock, UiShimmerText],
27
+ template: `
28
+ <div class="post" aria-busy="true" aria-label="Loading post">
29
+ <span uiShimmerBlock circle [width]="36"></span>
30
+ <div class="lines">
31
+ <span uiShimmerBlock [width]="120" [height]="10"></span>
32
+ <span uiShimmerBlock [width]="80" [height]="8"></span>
33
+ </div>
34
+ </div>
35
+ <p uiShimmerText class="status">Writing a summary…</p>
36
+ `,
37
+ styles: `
38
+ :host { display: grid; gap: 16px; }
39
+ .post { display: flex; align-items: center; gap: 10px; }
40
+ .lines { display: grid; gap: 6px; flex: 1; }
41
+ .status { margin: 0; font-size: 14px; font-weight: 500; }
42
+ `,
43
+ })
44
+ export class PostPlaceholder {}
45
+ ```
46
+
47
+ ## Rules
48
+ - Put uiShimmerBlock on an empty element (span); give it the size of the content it stands in for.
49
+ - The consumer owns aria-busy on the container; blocks add none.
50
+ - Font, size and weight of uiShimmerText come from your own styles.
51
+ - Sweeps pause off-screen and in hidden tabs; blocks resume on one shared clock.
52
+
53
+ ## Inputs
54
+
55
+ | Name | Type | Default | Description |
56
+ | --- | --- | --- | --- |
57
+ | `width` | `number \| string` | '100%' | UiShimmerBlock. Number = px, string = any CSS length; never wider than its parent. |
58
+ | `height` | `number \| string` | 12 | UiShimmerBlock. Number = px; ignored by circle. |
59
+ | `radius` | `number \| string` | 6 | UiShimmerBlock. Corner radius; number = px. |
60
+ | `circle` | `boolean` | false | UiShimmerBlock. Round, width for both sides (avatars). |
61
+ | `duration` | `number` | 2 | UiShimmerText. Seconds per pass of the band; 0 or less falls back to 2. |
62
+
63
+ ## ShimmerLength
64
+
65
+ `type ShimmerLength = number | string`
66
+
67
+ ## CSS variables
68
+
69
+ | Variable | Default | Description |
70
+ | --- | --- | --- |
71
+ | `--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. |
72
+ | `--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. |
73
+ | `--ui-shimmer-loader-speed` | `2200ms` | One sweep of the block band. |
74
+ | `--ui-shimmer-loader-radius` | `6px` | Block corners when radius is not set. |
75
+ | `--ui-shimmer-loader-text` | `var(--ui-text-muted)` | Shimmer text at rest. |
76
+ | `--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. |
77
+
78
+ ## Accessibility
79
+ - Blocks are aria-hidden; put aria-busy="true" on the loading container and set it to false when content arrives.
80
+ - Shimmer text stays real text, read once; rest colour --ui-text-muted (4.5:1 or more).
81
+ - No live region: wrap the text in role="status" to announce label changes.
82
+ - dir="auto" on the text unless you set dir, so a trailing ellipsis stays at the end in RTL.
83
+ - Forced colors: blocks get a GrayText outline, text turns plain CanvasText; reduced motion: flat grey blocks and plain text.
@@ -0,0 +1,75 @@
1
+ # Side Folder
2
+
3
+ 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.
4
+
5
+ Add: `npx ochreui@latest add side-folder`
6
+ Import: `import { UiSideFolder } from './ui/side-folder';`
7
+ Selector: `<ui-side-folder>`
8
+ Docs: /components/side-folder
9
+
10
+ ## When to use
11
+ - Feature cards about files, uploads, storage or a knowledge base, and empty states for documents.
12
+ - Bento grids that want a quiet, friendly picture above the text.
13
+
14
+ ## When not to use
15
+ - Showing real files: the pages only carry placeholder lines.
16
+ - Dark sections: the drawing is made for light surfaces and does not change in dark mode.
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { Component } from '@angular/core';
22
+ import { UiSideFolder } from './ui/side-folder';
23
+
24
+ @Component({
25
+ selector: 'app-drive-card',
26
+ imports: [UiSideFolder],
27
+ template: `
28
+ <article>
29
+ <ui-side-folder />
30
+ <h3>Shared drive</h3>
31
+ <p>Keep every draft in one place.</p>
32
+ </article>
33
+ `,
34
+ styles: `
35
+ 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); }
36
+ h3 { margin: 4px 12px 0; color: var(--ui-text); font-size: 15px; line-height: 22px; font-weight: 600; }
37
+ p { margin: 4px 12px 0; color: var(--ui-text-muted); font-size: 13px; line-height: 20px; }
38
+ `,
39
+ })
40
+ export class DriveCard {}
41
+ ```
42
+
43
+ ## Rules
44
+ - It is 3 : 2 and up to 560px wide by default: set another width with your own class.
45
+ - Hover opens it only over the folder itself, and only on devices that can hover; touch screens see it closed.
46
+ - Reduced motion or --ui-motion-scale: 0 makes the pose change instant.
47
+ - Set label="" when a heading next to it already says the same thing.
48
+
49
+ ## Inputs
50
+
51
+ | Name | Type | Default | Description |
52
+ | --- | --- | --- | --- |
53
+ | `label` | `string` | a sentence describing the folder | What screen readers hear. "" hides the drawing from them (decorative). |
54
+
55
+ ## CSS variables
56
+
57
+ | Variable | Default | Description |
58
+ | --- | --- | --- |
59
+ | `--ui-side-folder-back` | `#56b5eb (sky blue)` | Back cover. |
60
+ | `--ui-side-folder-back-sheen` | `rgb(255 255 255 / 0.2)` | Soft light across the top of the back cover. |
61
+ | `--ui-side-folder-glass-1` | `rgb(104 196 246 / 0.5)` | Pocket glass at the top. Keep it translucent. |
62
+ | `--ui-side-folder-glass-2` | `rgb(52 118 166 / 0.72)` | Pocket glass at the bottom, deeper. Keep it translucent. |
63
+ | `--ui-side-folder-rim` | `rgb(255 255 255 / 0.32)` | Thin rim around the pocket. |
64
+ | `--ui-side-folder-paper-1` | `#fff` | Paper at the top. |
65
+ | `--ui-side-folder-paper-2` | `#ebf2f9` | Paper at the bottom. |
66
+ | `--ui-side-folder-paper-edge` | `#d6dce3` | Paper outline. |
67
+ | `--ui-side-folder-line` | `#dfe2e6` | Placeholder lines. |
68
+ | `--ui-side-folder-shadow` | `rgb(36 118 186 / 0.2)` | Shadow under the folder; a glow on dark pages. |
69
+
70
+ ## Accessibility
71
+ - One role=img named by label; the drawing is aria-hidden.
72
+ - label="" makes it decorative: aria-hidden, no role.
73
+ - Nothing focusable; the hover effect is decoration.
74
+ - forced-color-adjust: none keeps the drawing intact in forced colours.
75
+ - The drawing stays left to right in RTL pages.
@@ -0,0 +1,95 @@
1
+ # Skeleton
2
+
3
+ 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.
4
+
5
+ Add: `npx ochreui@latest add skeleton`
6
+ Import: `import { UiSkeleton, UiLoading } from './ui/skeleton';`
7
+ Selector: `<ui-skeleton, ui-loading>`
8
+ Docs: /components/skeleton
9
+
10
+ ## When to use
11
+ - A list, table, card or panel waiting for its data: the layout holds and nothing shifts when the data arrives.
12
+ - Text, avatars, badges and buttons of known size: give each skeleton the size of what it replaces.
13
+ - Wrap the skeletons of one area in ui-loading: one status for screen readers, no flash when the data is quick.
14
+
15
+ ## When not to use
16
+ - One running action: use a spinner in the button or row.
17
+ - An agent thinking or writing: use a thinking state.
18
+ - Data that never arrived: show an empty state, not skeletons forever.
19
+
20
+ ## Usage
21
+
22
+ ```ts
23
+ import { Component, input } from '@angular/core';
24
+ import { UiLoading, UiSkeleton } from './ui/skeleton';
25
+
26
+ export interface Deploy {
27
+ id: string;
28
+ service: string;
29
+ }
30
+
31
+ @Component({
32
+ selector: 'app-deploy-list',
33
+ imports: [UiLoading, UiSkeleton],
34
+ template: `
35
+ @if (deploys(); as deploys) {
36
+ <ul class="deploys">
37
+ @for (d of deploys; track d.id) {
38
+ <li><span class="mark"></span><span class="name">{{ d.service }}</span></li>
39
+ }
40
+ </ul>
41
+ } @else {
42
+ <ui-loading class="deploys" label="Loading deploys">
43
+ @for (w of [132, 148, 140]; track $index) {
44
+ <div>
45
+ <ui-skeleton width="16" height="16" radius="4" />
46
+ <ui-skeleton class="name" line [width]="w" height="10" />
47
+ </div>
48
+ }
49
+ </ui-loading>
50
+ }
51
+ `,
52
+ styles: `
53
+ .deploys { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
54
+ .deploys > * { display: flex; align-items: center; gap: 12px; }
55
+ .mark { width: 16px; height: 16px; border-radius: 4px; background: var(--ui-accent); }
56
+ .name { flex: 1; font-size: var(--ui-text-base); line-height: var(--ui-leading-base); }
57
+ `,
58
+ })
59
+ export class DeployList {
60
+ deploys = input<Deploy[]>();
61
+ }
62
+ ```
63
+
64
+ ## Rules
65
+ - Always pair skeletons with ui-loading (or another announced loading message).
66
+ - Size each skeleton like the content it replaces; use line for text bars so rows keep their height.
67
+ - Put the real list's class on ui-loading.
68
+ - Swap to the data at once, without a fade.
69
+
70
+ ## Inputs
71
+
72
+ | Name | Type | Default | Description |
73
+ | --- | --- | --- | --- |
74
+ | `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. |
75
+ | `height` | `number \| string` | 12 | UiSkeleton. Height of the shape. |
76
+ | `radius` | `number \| string` | --ui-radius-sm | UiSkeleton. Corner radius; "50%" with equal width and height makes a circle. |
77
+ | `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. |
78
+ | `label` | `string` | Loading | UiLoading. What is loading, for screen readers. |
79
+ | `class` | `attribute` | none | UiLoading. Put the real layout's class on it. |
80
+
81
+ ## CSS variables
82
+
83
+ | Variable | Default | Description |
84
+ | --- | --- | --- |
85
+ | `--ui-skeleton-bg` | `--ui-bg-placeholder` | Shape fill. Tuned for cards; set it a step darker on tinted surfaces. |
86
+ | `--ui-skeleton-sheen` | `--ui-bg-placeholder-sheen` | The passing highlight. |
87
+ | `--ui-skeleton-speed` | `1600ms` | One sheen cycle: a quick pass, then rest. No sheen with reduced motion. |
88
+ | `--ui-skeleton-delay` | `150ms` | How long ui-loading stays invisible before fading in. Kept with reduced motion. |
89
+
90
+ ## Accessibility
91
+ - Every shape is aria-hidden.
92
+ - 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.
93
+ - Remove ui-loading when the data arrives; do not flip aria-busy.
94
+ - Nothing focusable inside ui-loading.
95
+ - Forced colors: shapes get a GrayText border.
@@ -0,0 +1,132 @@
1
+ # Smart Recommendation
2
+
3
+ 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.
4
+
5
+ Add: `npx ochreui@latest add smart-recommendation`
6
+ Import: `import { UiSmartRecommendation, UiRecommendationReason } from './ui/smart-recommendation';`
7
+ Selector: `<ui-smart-recommendation>`
8
+ Docs: /components/smart-recommendation
9
+
10
+ ## When to use
11
+ - Suggesting the next step your app or assistant thinks is best, with a way out.
12
+ - Settings people rarely revisit but should get a nudge on: backups, sync modes, plans.
13
+
14
+ ## When not to use
15
+ - Choices with no clear favorite: show them side by side.
16
+ - Changes that can't be undone: confirm in a dialog.
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { Component } from '@angular/core';
22
+ import { Recommendation, UiSmartRecommendation } from './ui/smart-recommendation';
23
+
24
+ @Component({
25
+ selector: 'app-export-mode',
26
+ imports: [UiSmartRecommendation],
27
+ template: `
28
+ <ui-smart-recommendation [options]="modes" (accept)="save($event)" (undo)="revert($event)" />
29
+ `,
30
+ })
31
+ export class ExportMode {
32
+ protected readonly modes: Recommendation[] = [
33
+ { id: 'delta', label: 'Delta export', reason: 'Only 3% of records changed since Monday, so a delta export takes minutes.', signal: 3 },
34
+ { id: 'full', label: 'Full export', reason: 'Rewrites every record. Needed after a schema change, but takes about an hour.', signal: 1 },
35
+ ];
36
+
37
+ protected save(mode: Recommendation) {
38
+ console.log('Export mode set to', mode.id);
39
+ }
40
+
41
+ protected revert(mode: Recommendation) {
42
+ console.log('Export mode reverted from', mode.id);
43
+ }
44
+ }
45
+ ```
46
+
47
+ ## Rules
48
+ - Put the recommended option first; give every option a unique id.
49
+ - Save the choice in (accept) and revert it in (undo). The component never lower-cases labels: pass labels.accept to change the wording.
50
+ - The card is min(440px, 100%) wide: set --ui-smart-recommendation-width to change it.
51
+ - Host styling (padding, corners, fill, edge) is inline: restyle through the --ui-smart-recommendation-* variables.
52
+
53
+ ## Inputs
54
+
55
+ | Name | Type | Default | Description |
56
+ | --- | --- | --- | --- |
57
+ | `options` | `readonly Recommendation[]` | required | Best first; the rest are alternatives. One option hides Alternatives; none renders nothing. |
58
+ | `title` | `string` | 'Smart recommendation' | Card heading and region name. |
59
+ | `labels` | `Partial<SmartRecommendationLabels>` | English | Every visible and spoken string, for translation. |
60
+ | `open` | `boolean` | true | Two-way. Whether the reason shows; the header toggles it. |
61
+ | `selected` | `string \| undefined` | undefined | Two-way. Id of the option shown; unset or unknown shows the first. |
62
+ | `accepted` | `boolean` | false | Two-way. True while the shown option is accepted and Undo is offered. |
63
+
64
+ ## Outputs
65
+
66
+ | Name | Payload | Description |
67
+ | --- | --- | --- |
68
+ | `accept` | `Recommendation` | The option shown, when Accept is pressed. |
69
+ | `undo` | `Recommendation` | The same option, when Undo is pressed. |
70
+ | `openChange` | `boolean` | Every change of open, when the header folds or unfolds the card. |
71
+ | `selectedChange` | `string \| undefined` | Every change of selected, when an option is picked in the menu. |
72
+ | `acceptedChange` | `boolean` | Every change of accepted, on Accept and on Undo. |
73
+
74
+ ## Recommendation
75
+
76
+ | Field | Type | Description |
77
+ | --- | --- | --- |
78
+ | `id` | `string` | Unique within the list. |
79
+ | `label` | `string` | Name in the menu, the Accept button and the status, used as written. |
80
+ | `reason` | `string` | Why, in a sentence or two. Use uiRecommendationReason for markup. |
81
+ | `signal` | `RecommendationSignal` | 0 to 3: no, weak, moderate or strong signal. |
82
+
83
+ ## RecommendationSignal
84
+
85
+ | Field | Type | Description |
86
+ | --- | --- | --- |
87
+ | `(union)` | `0 \| 1 \| 2 \| 3` | How sure the app is. |
88
+
89
+ ## SmartRecommendationLabels
90
+
91
+ | Field | Type | Description |
92
+ | --- | --- | --- |
93
+ | `alternatives` | `string` | Default "Alternatives". |
94
+ | `accept` | `(label: string) => string` | Default "Accept {label}". |
95
+ | `accepted` | `(label: string) => string` | Default "{label} accepted"; shown and announced. |
96
+ | `undo` | `string` | Default "Undo". |
97
+ | `recommended` | `string` | Badge on the first option in the menu. Default "Recommended". |
98
+ | `alternative` | `string` | Header badge while another option is shown. Default "Alternative". |
99
+ | `signal` | `readonly [string, string, string, string]` | Words for signal 0 to 3. Default "No signal", "Weak signal", "Moderate signal", "Strong signal". |
100
+
101
+ ## Template: uiRecommendationReason
102
+
103
+ Renders the reason with markup; bold text takes the card's ink. Context: `Recommendation`.
104
+
105
+ ```html
106
+ <ui-smart-recommendation [options]="modes">
107
+ <ng-template uiRecommendationReason let-o>{{ o.reason }} <strong>{{ o.label }}</strong> is ready.</ng-template>
108
+ </ui-smart-recommendation>
109
+ ```
110
+
111
+ ## CSS variables
112
+
113
+ | Variable | Default | Description |
114
+ | --- | --- | --- |
115
+ | `--ui-smart-recommendation-width` | `440px` | Widest the card grows; it shrinks with its container. |
116
+ | `--ui-smart-recommendation-radius` | `10px; Classic 16px` | Corners; in Classic the card, with the tray 6px around it. |
117
+
118
+ ## Keyboard
119
+
120
+ | Keys | Action |
121
+ | --- | --- |
122
+ | Tab | Moves between header, Alternatives and Accept or Undo; inside the menu, closes it and moves on. |
123
+ | Enter Space | Folds the card, opens the alternatives, picks an option, accepts or undoes. |
124
+ | ArrowDown ArrowUp | On Alternatives, opens the menu on the first or last option; in the menu, moves with wrapping. |
125
+ | Home End | First or last option in the menu. |
126
+ | Escape | Closes the menu and returns focus to Alternatives. |
127
+
128
+ ## Accessibility
129
+ - A region named by its title. The header is a button with aria-expanded and aria-controls; the folded reason is inert and hidden.
130
+ - Alternatives opens a menu of menuitemradio items labelled by the button; each item is read with its signal words.
131
+ - Focus moves into the menu, back to Alternatives after a pick, to Undo after Accept and to Accept after Undo. Accepting is announced politely.
132
+ - 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.
@@ -0,0 +1,84 @@
1
+ # Spinner
2
+
3
+ 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.
4
+
5
+ Add: `npx ochreui@latest add spinner`
6
+ Import: `import { UiSpinner } from './ui/spinner';`
7
+ Selector: `<ui-spinner>`
8
+ Docs: /components/spinner
9
+
10
+ ## When to use
11
+ - Work running now that finishes by itself: a run, a check, connecting, saving.
12
+ - As a button's icon while its action runs.
13
+ - As the status icon of a still-running row.
14
+
15
+ ## When not to use
16
+ - A whole region waiting for data: use a skeleton.
17
+ - An agent thinking or writing: use a thinking state.
18
+ - Work whose length is known: show real progress.
19
+
20
+ ## Usage
21
+
22
+ ```ts
23
+ import { Component, signal } from '@angular/core';
24
+ import { UiSpinner } from './ui/spinner';
25
+
26
+ @Component({
27
+ selector: 'app-connect-github',
28
+ imports: [UiSpinner],
29
+ template: `
30
+ <button type="button" class="connect" [attr.aria-disabled]="connecting() || null" (click)="connect()">
31
+ @if (connecting()) {
32
+ <ui-spinner />
33
+ Connecting
34
+ } @else {
35
+ Connect GitHub
36
+ }
37
+ </button>
38
+
39
+ <p><ui-spinner [size]="12" label="Checking domain" /></p>
40
+ `,
41
+ styles: `
42
+ .connect { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-inline-size: 140px; }
43
+ `,
44
+ })
45
+ export class ConnectGithub {
46
+ connecting = signal(false);
47
+
48
+ async connect() {
49
+ if (this.connecting()) return;
50
+ this.connecting.set(true);
51
+ try {
52
+ await fetch('/api/integrations/github', { method: 'POST' });
53
+ } finally {
54
+ this.connecting.set(false);
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ ## Rules
61
+ - Color it with the CSS color property; it draws in currentColor.
62
+ - 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.
63
+ - Only label it when no visible text next to it says what is running.
64
+
65
+ ## Inputs
66
+
67
+ | Name | Type | Default | Description |
68
+ | --- | --- | --- | --- |
69
+ | `size` | `number` | --ui-spinner-size (14px) | Width and height in px; the stroke scales with it. Invalid values fall back to the CSS default. |
70
+ | `label` | `string` | none | Makes it role="status" with this name. Without it the spinner is aria-hidden. |
71
+
72
+ ## CSS variables
73
+
74
+ | Variable | Default | Description |
75
+ | --- | --- | --- |
76
+ | `--ui-spinner-speed` | `800ms; 750ms with data-ui-look="tray"` | One full turn. Three times slower with reduced motion. |
77
+ | `--ui-spinner-size` | `var(--ui-icon-sm) (14px)` | Width and height when size is not set. |
78
+ | `color` | `inherited` | The spinner draws in currentColor. |
79
+
80
+ ## Accessibility
81
+ - With a label: role="status" and aria-label, so it has a name when browsing.
82
+ - A status inserted already filled is not reliably announced: for announcements keep a persistent live region or set aria-busy on the updating area.
83
+ - Without a label: aria-hidden, so nearby text carries the meaning.
84
+ - Draws in currentColor, so it has the contrast of the surrounding text.
@@ -0,0 +1,79 @@
1
+ # Switch
2
+
3
+ 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.
4
+
5
+ Add: `npx ochreui@latest add switch`
6
+ Import: `import { UiSwitch, UiSwitchInput } from './ui/switch';`
7
+ Selector: `<ui-switch>`
8
+ Docs: /components/switch
9
+
10
+ ## When to use
11
+ - A setting that applies at once: notifications, privacy, a feature.
12
+ - Settings lists of on/off rows.
13
+
14
+ ## When not to use
15
+ - Choices applied on submit, or agreeing to terms: use Checkbox.
16
+ - More than two options: use Segmented Control or Select.
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { Component, signal } from '@angular/core';
22
+ import { FormField, form } from '@angular/forms/signals';
23
+ import { UiSwitch, UiSwitchInput } from './ui/switch';
24
+
25
+ @Component({
26
+ selector: 'app-notification-settings',
27
+ imports: [UiSwitch, UiSwitchInput, FormField],
28
+ template: `
29
+ <ui-switch label="Daily digest" description="Approvals waiting, runs that finished or failed" placement="end">
30
+ <input type="checkbox" uiSwitch [formField]="f.digest" />
31
+ </ui-switch>
32
+ <ui-switch label="Weekly usage report" description="Credits spent and the busiest agents" placement="end">
33
+ <input type="checkbox" uiSwitch [formField]="f.weekly" />
34
+ </ui-switch>
35
+ `,
36
+ })
37
+ export class NotificationSettings {
38
+ private readonly model = signal({ digest: true, weekly: false });
39
+ protected readonly f = form(this.model);
40
+ }
41
+ ```
42
+
43
+ ## Rules
44
+ - Write type="checkbox" yourself on <input uiSwitch>: Angular forms match it in your template.
45
+ - Bind checked with [formField], formControl, ngModel or [checked] + (change); disabled stays on the input.
46
+ - Without a label, put aria-label on the input.
47
+
48
+ ## Inputs
49
+
50
+ | Name | Type | Default | Description |
51
+ | --- | --- | --- | --- |
52
+ | `label` | `string` | none | Setting name; clicking toggles. |
53
+ | `description` | `string` | none | Quiet line under the label; the switch's description. |
54
+ | `placement` | `'start' \| 'end'` | 'start' | Switch before the text, or at the end of the row. |
55
+ | `size` | `'sm' \| 'md'` | 'md' | 32×20 or 26×16; touch 40×24 or 34×20. |
56
+
57
+ ## CSS variables
58
+
59
+ | Variable | Default | Description |
60
+ | --- | --- | --- |
61
+ | `--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. |
62
+ | `--ui-switch-track-hover` | `color-mix(in srgb, var(--ui-text) 20%, var(--ui-bg-surface))` | Off track on hover. |
63
+ | `--ui-switch-track-on` | `var(--ui-bg-neutral-solid)` | On track. |
64
+ | `--ui-switch-thumb` | `var(--ui-bg-knob)` | Off thumb. |
65
+ | `--ui-switch-thumb-on` | `var(--ui-text-on-neutral)` | On thumb. |
66
+
67
+ ## Keyboard
68
+
69
+ | Keys | Action |
70
+ | --- | --- |
71
+ | Space | Toggles. |
72
+ | Tab | Next switch; disabled ones skipped. |
73
+
74
+ ## Accessibility
75
+ - Native checkbox with role=switch: on/off announced.
76
+ - Named by the label only (aria-labelledby), described by the description.
77
+ - Off track pale by default; --ui-switch-track or prefers-contrast: more takes it to 3:1; position also shows the state.
78
+ - Hit area 6px past the track; the whole row toggles.
79
+ - Forced colors: Canvas track with a CanvasText edge, Highlight when on, GrayText when disabled.
@@ -0,0 +1,70 @@
1
+ # Tab Overload
2
+
3
+ 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.
4
+
5
+ Add: `npx ochreui@latest add tab-overload`
6
+ Import: `import { UiTabOverload } from './ui/tab-overload';`
7
+ Selector: `<ui-tab-overload>`
8
+ Docs: /components/tab-overload
9
+
10
+ ## When to use
11
+ - A problem card about context switching, research spread over too many tabs, or copy-and-paste busywork.
12
+ - Bento grids and feature cards that want a small picture above their title and text.
13
+
14
+ ## When not to use
15
+ - To show real pages or screenshots: the windows only hold grey placeholder blocks.
16
+ - Where the right and bottom edges must stay crisp: the scene fades out there on purpose.
17
+
18
+ ## Usage
19
+
20
+ ```ts
21
+ import { Component } from '@angular/core';
22
+ import { UiTabOverload } from './ui/tab-overload';
23
+
24
+ @Component({
25
+ selector: 'app-research-card',
26
+ imports: [UiTabOverload],
27
+ template: `
28
+ <article>
29
+ <ui-tab-overload />
30
+ <h3>Research lives in forty tabs</h3>
31
+ <p>Every answer means another window, another copy and paste, another lost thread.</p>
32
+ </article>
33
+ `,
34
+ styles: `
35
+ article { max-inline-size: 360px; }
36
+ h3 { margin: 16px 0 0; font-size: 16px; line-height: 1.4; font-weight: 600; }
37
+ p { margin: 6px 0 0; color: var(--ui-text-muted); font-size: 14px; line-height: 1.5; }
38
+ `,
39
+ })
40
+ export class ResearchCard {}
41
+ ```
42
+
43
+ ## Rules
44
+ - Width up to 560px from its container, height at 3:2; the whole drawing scales, nothing reflows.
45
+ - The front window is lit by default; hovering a window behind crossfades the light to it in 300ms (hover-capable pointers only).
46
+ - The pulse (2.4s) waits off-screen and in hidden tabs, and starts over when it comes back.
47
+ - Reduced motion or --ui-motion-scale: 0: blocks hold their light shade and the highlight swaps instantly.
48
+
49
+ ## Inputs
50
+
51
+ | Name | Type | Default | Description |
52
+ | --- | --- | --- | --- |
53
+ | `label` | `string` | 'Three overlapping browser windows filled with placeholder blocks' | What screen readers hear for the whole picture. Empty hides the picture from them. |
54
+
55
+ ## CSS variables
56
+
57
+ | Variable | Default | Description |
58
+ | --- | --- | --- |
59
+ | `--ui-tab-overload-bar` | `var(--ui-bg-subtle), near-black in dark mode` | Title bar of each window. |
60
+ | `--ui-tab-overload-panel` | `var(--ui-bg-surface)` | The page inside each window. |
61
+ | `--ui-tab-overload-edge` | `var(--ui-hairline)` | Window and page outlines. |
62
+ | `--ui-tab-overload-dot` | `var(--ui-text) at 20%` | The grey title-bar dots of the windows behind. |
63
+ | `--ui-tab-overload-block` | `var(--ui-bg-placeholder)` | Placeholder blocks, at the light end of the pulse. |
64
+ | `--ui-tab-overload-pulse` | `the block a step darker` | The dark end of the pulse. |
65
+
66
+ ## Accessibility
67
+ - One image named by label; the drawing inside is aria-hidden, so nothing is read twice.
68
+ - label="" hides the whole picture from screen readers.
69
+ - Not focusable; the hover highlight is decoration only and never changes on touch screens.
70
+ - Forced colours: windows outlined in system colours, the lit window edged in Highlight, no glow.