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.
- package/LICENSE +21 -0
- package/README.md +153 -2
- package/cli/ochreui.mjs +601 -0
- package/mcp/core.mjs +126 -0
- package/mcp/docs.json +906 -0
- package/mcp/server.mjs +23 -0
- package/package.json +393 -3
- package/registry/agent-team.ts +350 -0
- package/registry/avatar.ts +300 -0
- package/registry/badge.ts +207 -0
- package/registry/breadcrumb.ts +435 -0
- package/registry/button.ts +238 -0
- package/registry/card.ts +221 -0
- package/registry/change-summary.ts +200 -0
- package/registry/checkbox.ts +204 -0
- package/registry/code-block.ts +332 -0
- package/registry/color-picker.ts +720 -0
- package/registry/comment-thread.ts +503 -0
- package/registry/context-menu.ts +281 -0
- package/registry/cover-flow.ts +623 -0
- package/registry/date-picker.ts +799 -0
- package/registry/decision-inbox.ts +340 -0
- package/registry/dialog.ts +577 -0
- package/registry/dropdown-menu.ts +864 -0
- package/registry/email-draft.ts +916 -0
- package/registry/empty-calendar.ts +199 -0
- package/registry/empty-state.ts +164 -0
- package/registry/enrichment-orbit.ts +164 -0
- package/registry/filter-menu.ts +541 -0
- package/registry/form-field.ts +308 -0
- package/registry/frost-cloud.ts +381 -0
- package/registry/ghosted-chat.ts +210 -0
- package/registry/glow-cloud.ts +402 -0
- package/registry/grid-background.ts +164 -0
- package/registry/hover-card.ts +401 -0
- package/registry/icon-button.ts +133 -0
- package/registry/index.json +2124 -0
- package/registry/integration-beam.ts +588 -0
- package/registry/integration-grid.ts +209 -0
- package/registry/kbd.ts +176 -0
- package/registry/layer-stack.ts +351 -0
- package/registry/lead-sourcing.ts +285 -0
- package/registry/logo-cluster.ts +239 -0
- package/registry/logo-marquee.ts +505 -0
- package/registry/message-actions.ts +833 -0
- package/registry/model-orbit.ts +583 -0
- package/registry/model-wheel.ts +372 -0
- package/registry/notification-stack.ts +301 -0
- package/registry/number-input.ts +552 -0
- package/registry/number-ticker.ts +261 -0
- package/registry/ochre.css +917 -0
- package/registry/otp-input.ts +704 -0
- package/registry/overlay.ts +312 -0
- package/registry/pagination.ts +362 -0
- package/registry/popover.ts +296 -0
- package/registry/profile-menu.ts +332 -0
- package/registry/progress-tracker.ts +291 -0
- package/registry/rating.ts +461 -0
- package/registry/reaction-bar.ts +322 -0
- package/registry/region-map.ts +537 -0
- package/registry/resizable.ts +489 -0
- package/registry/scroll-area.ts +271 -0
- package/registry/segmented-control.ts +433 -0
- package/registry/select.ts +769 -0
- package/registry/separator.ts +97 -0
- package/registry/shimmer-loader.ts +211 -0
- package/registry/side-folder.ts +152 -0
- package/registry/skeleton.ts +136 -0
- package/registry/skill/INSTRUCTIONS.md +11 -0
- package/registry/skill/SKILL.md +65 -0
- package/registry/skill/checklist.md +45 -0
- package/registry/skill/references/agent-team.md +105 -0
- package/registry/skill/references/avatar.md +88 -0
- package/registry/skill/references/badge.md +92 -0
- package/registry/skill/references/breadcrumb.md +99 -0
- package/registry/skill/references/button.md +82 -0
- package/registry/skill/references/card.md +111 -0
- package/registry/skill/references/catalog.md +114 -0
- package/registry/skill/references/change-summary.md +103 -0
- package/registry/skill/references/checkbox.md +105 -0
- package/registry/skill/references/code-block.md +109 -0
- package/registry/skill/references/color-picker.md +138 -0
- package/registry/skill/references/comment-thread.md +164 -0
- package/registry/skill/references/context-menu.md +205 -0
- package/registry/skill/references/cover-flow.md +128 -0
- package/registry/skill/references/date-picker.md +154 -0
- package/registry/skill/references/decision-inbox.md +126 -0
- package/registry/skill/references/dialog.md +155 -0
- package/registry/skill/references/dropdown-menu.md +144 -0
- package/registry/skill/references/email-draft.md +182 -0
- package/registry/skill/references/empty-calendar.md +74 -0
- package/registry/skill/references/empty-state.md +118 -0
- package/registry/skill/references/enrichment-orbit.md +71 -0
- package/registry/skill/references/filter-menu.md +143 -0
- package/registry/skill/references/form-field.md +118 -0
- package/registry/skill/references/frost-cloud.md +80 -0
- package/registry/skill/references/ghosted-chat.md +75 -0
- package/registry/skill/references/glow-cloud.md +84 -0
- package/registry/skill/references/grid-background.md +76 -0
- package/registry/skill/references/hover-card.md +125 -0
- package/registry/skill/references/icon-button.md +99 -0
- package/registry/skill/references/integration-beam.md +107 -0
- package/registry/skill/references/integration-grid.md +100 -0
- package/registry/skill/references/kbd.md +65 -0
- package/registry/skill/references/layer-stack.md +115 -0
- package/registry/skill/references/lead-sourcing.md +92 -0
- package/registry/skill/references/logo-cluster.md +92 -0
- package/registry/skill/references/logo-marquee.md +123 -0
- package/registry/skill/references/message-actions.md +146 -0
- package/registry/skill/references/model-orbit.md +106 -0
- package/registry/skill/references/model-wheel.md +84 -0
- package/registry/skill/references/notification-stack.md +138 -0
- package/registry/skill/references/number-input.md +117 -0
- package/registry/skill/references/number-ticker.md +73 -0
- package/registry/skill/references/otp-input.md +142 -0
- package/registry/skill/references/pagination.md +112 -0
- package/registry/skill/references/popover.md +143 -0
- package/registry/skill/references/profile-menu.md +123 -0
- package/registry/skill/references/progress-tracker.md +122 -0
- package/registry/skill/references/rating.md +111 -0
- package/registry/skill/references/reaction-bar.md +128 -0
- package/registry/skill/references/region-map.md +109 -0
- package/registry/skill/references/resizable.md +127 -0
- package/registry/skill/references/scroll-area.md +113 -0
- package/registry/skill/references/segmented-control.md +96 -0
- package/registry/skill/references/select.md +122 -0
- package/registry/skill/references/separator.md +69 -0
- package/registry/skill/references/shimmer-loader.md +83 -0
- package/registry/skill/references/side-folder.md +75 -0
- package/registry/skill/references/skeleton.md +95 -0
- package/registry/skill/references/smart-recommendation.md +132 -0
- package/registry/skill/references/spinner.md +84 -0
- package/registry/skill/references/switch.md +79 -0
- package/registry/skill/references/tab-overload.md +70 -0
- package/registry/skill/references/tag-input.md +126 -0
- package/registry/skill/references/team-invite.md +94 -0
- package/registry/skill/references/testimonial-wall.md +110 -0
- package/registry/skill/references/text-area.md +115 -0
- package/registry/skill/references/text-field.md +126 -0
- package/registry/skill/references/text-reveal.md +71 -0
- package/registry/skill/references/thinking-loader.md +87 -0
- package/registry/skill/references/time-picker.md +122 -0
- package/registry/skill/references/tips-panel.md +115 -0
- package/registry/skill/references/toggle-group.md +98 -0
- package/registry/skill/references/tool-call-card.md +151 -0
- package/registry/skill/references/tooltip.md +94 -0
- package/registry/skill/references/tree-view.md +172 -0
- package/registry/skill/theming.md +57 -0
- package/registry/smart-recommendation.ts +415 -0
- package/registry/spinner.ts +67 -0
- package/registry/switch.ts +146 -0
- package/registry/tab-overload.ts +211 -0
- package/registry/tag-input.ts +620 -0
- package/registry/team-invite.ts +248 -0
- package/registry/testimonial-wall.ts +521 -0
- package/registry/text-area.ts +432 -0
- package/registry/text-field.ts +415 -0
- package/registry/text-reveal.ts +175 -0
- package/registry/theme.ts +68 -0
- package/registry/thinking-loader.ts +302 -0
- package/registry/time-picker.ts +828 -0
- package/registry/tips-panel.ts +312 -0
- package/registry/toggle-group.ts +357 -0
- package/registry/tool-call-card.ts +578 -0
- package/registry/tooltip.ts +486 -0
- package/registry/tree-view.ts +454 -0
- package/styles/base.css +500 -0
- package/styles/tokens.css +415 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Layer Stack
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add layer-stack`
|
|
6
|
+
Import: `import { UiLayerStack } from './ui/layer-stack';`
|
|
7
|
+
Selector: `<ui-layer-stack>`
|
|
8
|
+
Docs: /components/layer-stack
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- Explaining a product or platform built in layers, one entry per layer.
|
|
12
|
+
- Feature sections that walk through capabilities one at a time with a picture that follows.
|
|
13
|
+
|
|
14
|
+
## When not to use
|
|
15
|
+
- More than five layers: it is drawn for five at most.
|
|
16
|
+
- Navigation that swaps page content: use Tabs.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { Component } from '@angular/core';
|
|
22
|
+
import { LayerStackItem, UiLayerStack } from './ui/layer-stack';
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'app-platform-section',
|
|
26
|
+
imports: [UiLayerStack],
|
|
27
|
+
template: `
|
|
28
|
+
<section>
|
|
29
|
+
<h2>One platform, five layers</h2>
|
|
30
|
+
<p>Each layer does one job. Pick one to see where it sits.</p>
|
|
31
|
+
<ui-layer-stack [items]="layers" />
|
|
32
|
+
</section>
|
|
33
|
+
`,
|
|
34
|
+
styles: `
|
|
35
|
+
section { max-inline-size: 640px; margin-inline: auto; }
|
|
36
|
+
h2 { margin: 0 0 4px; font-size: 20px; }
|
|
37
|
+
p { margin: 0 0 16px; color: var(--ui-text-muted); }
|
|
38
|
+
ui-layer-stack { inline-size: 100%; }
|
|
39
|
+
`,
|
|
40
|
+
})
|
|
41
|
+
export class PlatformSection {
|
|
42
|
+
protected readonly layers: LayerStackItem[] = [
|
|
43
|
+
{ title: 'Fired by any signal', hint: 'Triggers', icon: 'bolt' },
|
|
44
|
+
{ title: 'Fed by your own files', hint: 'Sources', icon: 'database' },
|
|
45
|
+
{ title: 'Linked to your toolset', hint: 'SDKs', icon: 'plug' },
|
|
46
|
+
{ title: 'Runs on every engine', hint: 'Gateway', icon: 'spark' },
|
|
47
|
+
{ title: 'Audited at each turn', hint: 'Feed', icon: 'pulse' },
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Rules
|
|
53
|
+
- Pass at most five items; titles of about 22 characters, hints of one short word.
|
|
54
|
+
- Size it through the host's inline size (at most 560px); the height follows at 3 : 2.
|
|
55
|
+
- Use (picked) for user choices; [(index)] also changes on autoplay steps.
|
|
56
|
+
- Reduced motion or --ui-motion-scale: 0: no autoplay and instant changes.
|
|
57
|
+
|
|
58
|
+
## Inputs
|
|
59
|
+
|
|
60
|
+
| Name | Type | Default | Description |
|
|
61
|
+
| --- | --- | --- | --- |
|
|
62
|
+
| `items` | `readonly LayerStackItem[]` | LAYER_STACK_ITEMS | Up to five entries, top layer first; any more are left out. |
|
|
63
|
+
| `index` | `number (model)` | 0 | The chosen entry, two-way: follows autoplay steps and picks; clamped to the items. |
|
|
64
|
+
| `interval` | `number` | 2600 | Time on each entry while it steps by itself, in ms. |
|
|
65
|
+
| `label` | `string \| undefined` | labels.list | The list's accessible name. |
|
|
66
|
+
| `labels` | `Partial<LayerStackLabels>` | English | The list name and how each entry's name is built, for translation. |
|
|
67
|
+
|
|
68
|
+
## Outputs
|
|
69
|
+
|
|
70
|
+
| Name | Payload | Description |
|
|
71
|
+
| --- | --- | --- |
|
|
72
|
+
| `picked` | `number` | The index the user picked by click, tap or key; never on autoplay steps. |
|
|
73
|
+
|
|
74
|
+
## LayerStackItem
|
|
75
|
+
|
|
76
|
+
| Field | Type | Description |
|
|
77
|
+
| --- | --- | --- |
|
|
78
|
+
| `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. |
|
|
79
|
+
| `hint` | `string \| undefined` | A short word at the end of the row. |
|
|
80
|
+
| `icon` | `LayerStackIcon \| undefined` | Glyph drawn flat on the chosen plate. |
|
|
81
|
+
|
|
82
|
+
## LayerStackIcon
|
|
83
|
+
|
|
84
|
+
`type LayerStackIcon = 'bolt' | 'database' | 'plug' | 'spark' | 'pulse'`
|
|
85
|
+
|
|
86
|
+
## LayerStackLabels
|
|
87
|
+
|
|
88
|
+
| Field | Type | Description |
|
|
89
|
+
| --- | --- | --- |
|
|
90
|
+
| `list` | `string` | The list name, used when label is left out ("Layers"). |
|
|
91
|
+
| `tab` | `(title: string, hint: string \| undefined) => string` | Each entry's accessible name ("title, hint"). |
|
|
92
|
+
|
|
93
|
+
## CSS variables
|
|
94
|
+
|
|
95
|
+
| Variable | Default | Description |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| `--ui-layer-stack-accent` | `var(--ui-accent)` | Chosen plate face, edge, outline, icon, glow and title. |
|
|
98
|
+
| `--ui-layer-stack-face` | `surface 60% (ink 4% dark)` | Faces of the other plates. |
|
|
99
|
+
| `--ui-layer-stack-edge` | `ink 9% (dark: half-opaque canvas with 5% ink)` | Edges of the other plates. |
|
|
100
|
+
| `--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. |
|
|
101
|
+
| `--ui-layer-stack-card` | `var(--ui-bg-surface)` | Card behind the chosen entry. |
|
|
102
|
+
|
|
103
|
+
## Keyboard
|
|
104
|
+
|
|
105
|
+
| Keys | Action |
|
|
106
|
+
| --- | --- |
|
|
107
|
+
| Tab | Focus the chosen entry; focus pauses autoplay. |
|
|
108
|
+
| ArrowDown / ArrowUp | Next or previous entry, wrapping; autoplay stops. |
|
|
109
|
+
| Home / End | First or last entry. |
|
|
110
|
+
|
|
111
|
+
## Accessibility
|
|
112
|
+
- role=tablist (vertical, named by label) of button role=tab with aria-selected and a roving tabindex; no tabpanels.
|
|
113
|
+
- Each tab is named "title, hint" once; the SVG stack is aria-hidden.
|
|
114
|
+
- Autoplay pauses on hover (not touch), focus, off-screen and in hidden tabs; stops for good after a pick.
|
|
115
|
+
- Forced colors: the card behind the chosen row keeps a CanvasText outline; focus ring uses the focus-ring token.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Lead Sourcing
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add lead-sourcing`
|
|
6
|
+
Import: `import { UiLeadSourcing } from './ui/lead-sourcing';`
|
|
7
|
+
Selector: `<ui-lead-sourcing>`
|
|
8
|
+
Docs: /components/lead-sourcing
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- A step or feature card about gathering leads or data from a few sources.
|
|
12
|
+
- Integration sections showing your product joined to two apps people already use.
|
|
13
|
+
|
|
14
|
+
## When not to use
|
|
15
|
+
- Suggesting integrations you do not offer: put your real sources in logos.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { Component } from '@angular/core';
|
|
21
|
+
import { UiLeadSourcing } from './ui/lead-sourcing';
|
|
22
|
+
|
|
23
|
+
@Component({
|
|
24
|
+
selector: 'app-prospecting-card',
|
|
25
|
+
imports: [UiLeadSourcing],
|
|
26
|
+
template: `
|
|
27
|
+
<article>
|
|
28
|
+
<ui-lead-sourcing />
|
|
29
|
+
<h3>Leads from where you already work</h3>
|
|
30
|
+
<p>Your assistant reads the inbox and the web, then hands you a short list of people worth a reply.</p>
|
|
31
|
+
</article>
|
|
32
|
+
`,
|
|
33
|
+
styles: `
|
|
34
|
+
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); }
|
|
35
|
+
ui-lead-sourcing { border-radius: 14px; background: var(--ui-bg-canvas); }
|
|
36
|
+
h3 { margin: 16px 12px 4px; color: var(--ui-text); font-size: 16px; line-height: 24px; font-weight: 600; }
|
|
37
|
+
p { margin: 0 12px; color: var(--ui-text-muted); font-size: 14px; line-height: 20px; }
|
|
38
|
+
`,
|
|
39
|
+
})
|
|
40
|
+
export class ProspectingCard {}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Rules
|
|
44
|
+
- Three logo slots in order left, centre, right; each path is one filled path in a 24×24 viewBox.
|
|
45
|
+
- 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.
|
|
46
|
+
- Set the width with your own class; it caps at 560px and keeps 3:2.
|
|
47
|
+
|
|
48
|
+
## Inputs
|
|
49
|
+
|
|
50
|
+
| Name | Type | Default | Description |
|
|
51
|
+
| --- | --- | --- | --- |
|
|
52
|
+
| `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. |
|
|
53
|
+
| `label` | `string` | generated | Accessible name. Unset: built from labels and the logo names. "" hides it as decoration. |
|
|
54
|
+
| `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. |
|
|
55
|
+
|
|
56
|
+
## LeadSourcingLogo
|
|
57
|
+
|
|
58
|
+
| Field | Type | Description |
|
|
59
|
+
| --- | --- | --- |
|
|
60
|
+
| `name` | `string` | Read out in the generated label. |
|
|
61
|
+
| `path` | `string` | One filled SVG path in a 24×24 box. |
|
|
62
|
+
| `color` | `string?` | Fill. Without it the logo follows the ink. |
|
|
63
|
+
| `darkColor` | `string?` | Fill in dark mode. |
|
|
64
|
+
|
|
65
|
+
## LeadSourcingLabels
|
|
66
|
+
|
|
67
|
+
| Field | Type | Description |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| `scene` | `string` | Generated label; {left}, {center} and {right} are filled with the names. |
|
|
70
|
+
| `left` | `string` | Name of the built-in left glyph. Default "a mail app". |
|
|
71
|
+
| `center` | `string` | Name of the built-in centre glyph. Default "An assistant". |
|
|
72
|
+
| `right` | `string` | Name of the built-in right glyph. Default "a search app". |
|
|
73
|
+
|
|
74
|
+
## CSS variables
|
|
75
|
+
|
|
76
|
+
| Variable | Default | Description |
|
|
77
|
+
| --- | --- | --- |
|
|
78
|
+
| `--ui-lead-sourcing-tile` | `var(--ui-bg-surface)` | Tile face. |
|
|
79
|
+
| `--ui-lead-sourcing-edge` | `the text colour at 11% (15% dark)` | Tile outline. |
|
|
80
|
+
| `--ui-lead-sourcing-lip` | `a deeper tone of the tile` | Band along each tile bottom edge. |
|
|
81
|
+
| `--ui-lead-sourcing-line` | `the text colour at 11% (16% dark)` | Resting line. |
|
|
82
|
+
| `--ui-lead-sourcing-ink` | `var(--ui-text)` | Built-in mono glyphs and logos without a colour. |
|
|
83
|
+
| `--ui-lead-sourcing-glow-a` | `var(--ui-hue-pink)` | Glow and centre rim, left end. |
|
|
84
|
+
| `--ui-lead-sourcing-glow-b` | `var(--ui-hue-purple)` | Glow and centre rim, right end. |
|
|
85
|
+
| `--ui-lead-sourcing-shine-tail` | `coral` | Shine tail. |
|
|
86
|
+
| `--ui-lead-sourcing-shine-mid` | `pink-white` | Shine middle. |
|
|
87
|
+
| `--ui-lead-sourcing-shine-head` | `violet` | Shine head. |
|
|
88
|
+
|
|
89
|
+
## Accessibility
|
|
90
|
+
- One role=img with a generated or custom label; the SVG is aria-hidden.
|
|
91
|
+
- label="" makes it decorative (aria-hidden).
|
|
92
|
+
- Forced colors: tiles get a CanvasText outline, the line GrayText; glow and shine hidden.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Logo Cluster
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add logo-cluster`
|
|
6
|
+
Import: `import { UiLogoCluster, UiLogoClusterMark } from './ui/logo-cluster';`
|
|
7
|
+
Selector: `<ui-logo-cluster>`
|
|
8
|
+
Docs: /components/logo-cluster
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- Integration sections: works with the tools you already use.
|
|
12
|
+
- Feature cards that want a lively picture around your own mark.
|
|
13
|
+
|
|
14
|
+
## When not to use
|
|
15
|
+
- The real list of your integrations: seven logos are a hint.
|
|
16
|
+
- Where people need to read or click the logos.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { Component } from '@angular/core';
|
|
22
|
+
import { UiLogoCluster } from './ui/logo-cluster';
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'app-connect-card',
|
|
26
|
+
imports: [UiLogoCluster],
|
|
27
|
+
template: `
|
|
28
|
+
<article class="card">
|
|
29
|
+
<ui-logo-cluster label="Our app in the middle of the tools it syncs with" />
|
|
30
|
+
<h3>Plays well with your stack</h3>
|
|
31
|
+
<p>Docs, tickets and calendars stay in step, both ways, a minute after anything changes.</p>
|
|
32
|
+
</article>
|
|
33
|
+
`,
|
|
34
|
+
styles: `
|
|
35
|
+
.card {
|
|
36
|
+
box-sizing: border-box; inline-size: min(360px, 100%); padding: 8px 8px 20px;
|
|
37
|
+
border-radius: 16px; background: var(--ui-bg-surface); box-shadow: inset 0 0 0 1px var(--ui-hairline);
|
|
38
|
+
}
|
|
39
|
+
ui-logo-cluster { inline-size: 100%; }
|
|
40
|
+
h3 { margin: 4px 12px 0; color: var(--ui-text); font-size: 15px; line-height: 22px; font-weight: 600; }
|
|
41
|
+
p { margin: 4px 12px 0; color: var(--ui-text-muted); font-size: 13px; line-height: 20px; }
|
|
42
|
+
`,
|
|
43
|
+
})
|
|
44
|
+
export class ConnectCard {}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Rules
|
|
48
|
+
- Square, inline-size min(380px, 100%); set another width with your own class.
|
|
49
|
+
- Entrance once at about a third visible: centre 420 ms, logos 520 ms each from 180 ms, 45 ms apart.
|
|
50
|
+
- 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.
|
|
51
|
+
- Hover (mouse only) grows a logo disc 1.12x in 260 ms with a springy ease and deepens its shadow.
|
|
52
|
+
- Reduced motion or --ui-motion-scale: 0: everything in place, no turn, hover only deepens the shadow.
|
|
53
|
+
|
|
54
|
+
## Inputs
|
|
55
|
+
|
|
56
|
+
| Name | Type | Default | Description |
|
|
57
|
+
| --- | --- | --- | --- |
|
|
58
|
+
| `label` | `string` | 'The product mark with sample logos bouncing out around it' | Accessible name (role=img). Empty hides it from assistive tech. |
|
|
59
|
+
| `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. |
|
|
60
|
+
|
|
61
|
+
## LogoClusterLogo
|
|
62
|
+
|
|
63
|
+
| Field | Type | Description |
|
|
64
|
+
| --- | --- | --- |
|
|
65
|
+
| `name` | `string` | The logo name (not shown or read out). |
|
|
66
|
+
| `path` | `string` | One filled SVG path in a 24×24 box. |
|
|
67
|
+
| `color` | `string?` | Fill. Without it the logo follows the ink. |
|
|
68
|
+
| `darkColor` | `string?` | Fill in dark mode. |
|
|
69
|
+
|
|
70
|
+
## Template: uiLogoClusterMark
|
|
71
|
+
|
|
72
|
+
Your own <img> or <svg> in the centre disc, 34% of its width, keeping its shape. Without it, a neutral mark. Context: `none`.
|
|
73
|
+
|
|
74
|
+
```html
|
|
75
|
+
<ui-logo-cluster>
|
|
76
|
+
<img uiLogoClusterMark src="/mark.svg" alt="" />
|
|
77
|
+
</ui-logo-cluster>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## CSS variables
|
|
81
|
+
|
|
82
|
+
| Variable | Default | Description |
|
|
83
|
+
| --- | --- | --- |
|
|
84
|
+
| `--ui-logo-cluster-face` | `var(--ui-bg-overlay)` | Disc face. |
|
|
85
|
+
| `--ui-logo-cluster-shadow` | `var(--ui-shadow-sm), 0 8px 20px -8px (scrim at 40%)` | Disc shadow, hairline ring included. |
|
|
86
|
+
| `--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. |
|
|
87
|
+
| `--ui-logo-cluster-ink` | `var(--ui-text)` | Logos without a colour and the default centre mark. |
|
|
88
|
+
|
|
89
|
+
## Accessibility
|
|
90
|
+
- Host role=img with aria-label from label; ring and centre are aria-hidden, SVGs not focusable.
|
|
91
|
+
- Empty label: aria-hidden host, no role.
|
|
92
|
+
- Sample logos are at least 3:1 on the disc in both themes; forced colors outline every disc.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Logo Marquee
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add logo-marquee`
|
|
6
|
+
Import: `import { UiLogoMarquee, UiLogo } from './ui/logo-marquee';`
|
|
7
|
+
Selector: `<ui-logo-marquee>`
|
|
8
|
+
Docs: /components/logo-marquee
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- A "Trusted by" strip under a hero or above pricing.
|
|
12
|
+
- More customer, partner or integration logos than fit in one calm row.
|
|
13
|
+
|
|
14
|
+
## When not to use
|
|
15
|
+
- Three to five logos: a static centred row.
|
|
16
|
+
- Logos people compare or click through: use a grid.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { Component } from '@angular/core';
|
|
22
|
+
import { UiLogo, UiLogoMarquee } from './ui/logo-marquee';
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'app-trusted-by',
|
|
26
|
+
imports: [UiLogoMarquee, UiLogo],
|
|
27
|
+
template: `
|
|
28
|
+
<section class="trusted">
|
|
29
|
+
<p>Trusted by teams at</p>
|
|
30
|
+
<ui-logo-marquee [rows]="2" [speed]="36" labels="beside" label="Companies that use the product">
|
|
31
|
+
<ng-template uiLogo name="Kestro">
|
|
32
|
+
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2.5 22.5 21h-21Z" /></svg>
|
|
33
|
+
</ng-template>
|
|
34
|
+
<ng-template uiLogo name="Tidel" color="var(--ui-hue-blue)">
|
|
35
|
+
<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>
|
|
36
|
+
</ng-template>
|
|
37
|
+
<ng-template uiLogo name="Lumora" color="var(--ui-hue-amber)" [scale]="0.9">
|
|
38
|
+
<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>
|
|
39
|
+
</ng-template>
|
|
40
|
+
<ng-template uiLogo name="Solvane" color="var(--ui-hue-red)">
|
|
41
|
+
<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>
|
|
42
|
+
</ng-template>
|
|
43
|
+
<ng-template uiLogo name="Vantly" color="var(--ui-hue-cyan)">
|
|
44
|
+
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M2 4h5.5L12 13.5 16.5 4H22L12 21Z" /></svg>
|
|
45
|
+
</ng-template>
|
|
46
|
+
<ng-template uiLogo name="Hexon" color="var(--ui-hue-orange)" href="/customers/hexon">
|
|
47
|
+
<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>
|
|
48
|
+
</ng-template>
|
|
49
|
+
</ui-logo-marquee>
|
|
50
|
+
</section>
|
|
51
|
+
`,
|
|
52
|
+
styles: `
|
|
53
|
+
.trusted { display: grid; gap: 24px; }
|
|
54
|
+
.trusted p { margin: 0; text-align: center; color: var(--ui-text-muted); font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase; }
|
|
55
|
+
`,
|
|
56
|
+
})
|
|
57
|
+
export class TrustedBy {}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Rules
|
|
61
|
+
- Logos are <ng-template uiLogo>, because the loop stamps each one several times.
|
|
62
|
+
- Give inline SVGs a viewBox and fill="currentColor"; set color for the hover hue.
|
|
63
|
+
- Put the caption outside the strip; use [(paused)] for a visible pause control.
|
|
64
|
+
|
|
65
|
+
## Inputs
|
|
66
|
+
|
|
67
|
+
| Name | Type | Default | Description |
|
|
68
|
+
| --- | --- | --- | --- |
|
|
69
|
+
| `speed` | `number` | 40 | Pixels per second; the same pace at any width. |
|
|
70
|
+
| `direction` | `LogoMarqueeDirection` | 'left' | First row travel; a second row runs the other way. Physical in RTL too. |
|
|
71
|
+
| `rows` | `1 \| 2` | 1 | Two rows split the logos alternately (1st, 3rd… / 2nd, 4th…). |
|
|
72
|
+
| `gap` | `number` | 56 | Px between logos; × 0.62 when the strip is 520px wide or less. |
|
|
73
|
+
| `pauseOnHover` | `boolean` | true | Ease to a stop under the mouse. Keyboard focus always stops it. |
|
|
74
|
+
| `grayscale` | `boolean` | true | Muted logos; the hovered one lifts to its colour. Off: full colour, others dim on hover. |
|
|
75
|
+
| `labels` | `LogoMarqueeLabels` | 'none' | Name beside the mark, below it, or for screen readers only. |
|
|
76
|
+
| `label` | `string` | 'Logos of companies using the product' | Accessible name of the region. |
|
|
77
|
+
| `paused` | `boolean (model)` | false | Two-way. Stops the strip; a touch tap toggles it. |
|
|
78
|
+
|
|
79
|
+
## Outputs
|
|
80
|
+
|
|
81
|
+
| Name | Payload | Description |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| `pausedChange` | `boolean` | Emitted when a touch tap toggles paused. |
|
|
84
|
+
|
|
85
|
+
## LogoMarqueeDirection
|
|
86
|
+
|
|
87
|
+
`type LogoMarqueeDirection = 'left' | 'right'`
|
|
88
|
+
|
|
89
|
+
## LogoMarqueeLabels
|
|
90
|
+
|
|
91
|
+
`type LogoMarqueeLabels = 'none' | 'below' | 'beside'`
|
|
92
|
+
|
|
93
|
+
## Template: uiLogo
|
|
94
|
+
|
|
95
|
+
One 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`.
|
|
96
|
+
|
|
97
|
+
```html
|
|
98
|
+
<ng-template uiLogo name="Tidel" color="var(--ui-hue-blue)" [scale]="0.9" href="/customers/tidel">
|
|
99
|
+
<svg viewBox="0 0 24 24" fill="currentColor">…</svg>
|
|
100
|
+
</ng-template>
|
|
101
|
+
<ng-template uiLogo name="Kiteo" src="/logos/kiteo.svg" />
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## CSS variables
|
|
105
|
+
|
|
106
|
+
| Variable | Default | Description |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| `--ui-logo-marquee-ink` | `var(--ui-text-muted)` | Marks and names at rest. |
|
|
109
|
+
| `--ui-logo-marquee-fade` | `min(20%, 168px); Classic min(14%, 120px)` | Soft fade width at each end. |
|
|
110
|
+
|
|
111
|
+
## Keyboard
|
|
112
|
+
|
|
113
|
+
| Keys | Action |
|
|
114
|
+
| --- | --- |
|
|
115
|
+
| Tab | Focuses the strip or each linked logo; the strip stops while focus is inside. |
|
|
116
|
+
| ← / → | Glides the logos about 150px, then settles. |
|
|
117
|
+
|
|
118
|
+
## Accessibility
|
|
119
|
+
- Region named by label; one real list, loop copies aria-hidden with their links out of the tab order.
|
|
120
|
+
- Hover, keyboard focus, a touch tap and the paused model stop the motion (WCAG 2.2.2).
|
|
121
|
+
- One Tab stop without links; with links, each link is a stop and glides clear of the fade.
|
|
122
|
+
- Rest ink is --ui-text-muted; hovered names go to --ui-text.
|
|
123
|
+
- Forced colors: system text colours, fade kept. Reduced motion or --ui-motion-scale: 0: a still, centred, wrapping list.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Message Actions
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add message-actions`
|
|
6
|
+
Import: `import { UiMessageActions, UiMessage, UiMessageText, UiMessageTip, UiMessageVersions, UiMessageFeedback } from './ui/message-actions';`
|
|
7
|
+
Selector: `<ui-message-actions>`
|
|
8
|
+
Docs: /components/message-actions
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- Under each assistant answer in a chat: copy, try again, rate, listen.
|
|
12
|
+
- Where a model can answer more than once and people flip between answers.
|
|
13
|
+
- Collecting feedback on answers with a reason, not only a thumb.
|
|
14
|
+
|
|
15
|
+
## When not to use
|
|
16
|
+
- Under the person's own messages: use edit and delete.
|
|
17
|
+
- A long list of actions: keep these four, put the rest in a menu.
|
|
18
|
+
- While the answer streams: show a stop button, then the bar.
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { Component, computed, input, signal } from '@angular/core';
|
|
24
|
+
import { MessageFeedback, MessageVote, UiMessage, UiMessageActions, UiMessageText } from './ui/message-actions';
|
|
25
|
+
|
|
26
|
+
@Component({
|
|
27
|
+
selector: 'app-assistant-message',
|
|
28
|
+
imports: [UiMessage, UiMessageActions, UiMessageText],
|
|
29
|
+
template: `
|
|
30
|
+
<!-- uiMessage lights the quiet bar while anything in the message is hovered or focused -->
|
|
31
|
+
<article uiMessage>
|
|
32
|
+
<p uiMessageText [version]="v()">{{ versions()[v()] }}</p>
|
|
33
|
+
<ui-message-actions [text]="versions()[v()]" [versions]="versions()" [(version)]="picked"
|
|
34
|
+
[vote]="votes()[v()] ?? null" (regenerate)="retry()" (feedback)="save($event)" />
|
|
35
|
+
</article>
|
|
36
|
+
`,
|
|
37
|
+
})
|
|
38
|
+
export class AssistantMessage {
|
|
39
|
+
readonly versions = input.required<string[]>();
|
|
40
|
+
protected readonly picked = signal<number | undefined>(undefined);
|
|
41
|
+
protected readonly v = computed(() => this.picked() ?? this.versions().length - 1);
|
|
42
|
+
protected readonly votes = signal<Record<number, MessageVote>>({});
|
|
43
|
+
|
|
44
|
+
protected save({ kind, reason }: MessageFeedback): void {
|
|
45
|
+
this.votes.update((all) => ({ ...all, [this.v()]: kind }));
|
|
46
|
+
console.log('feedback', this.v(), kind, reason);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
protected retry(): void {
|
|
50
|
+
console.log('ask the model for another version');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Rules
|
|
56
|
+
- Put uiMessage on the wrapper of one answer so the quiet bar lights on hover and focus.
|
|
57
|
+
- Keep versions per message; after regenerating, append the new text and the bar jumps to it.
|
|
58
|
+
- feedback fires twice for thumbs down with a reason: upsert by message and version.
|
|
59
|
+
- The bar does not speak: bind [(speaking)] and drive speechSynthesis yourself, or leave it unbound for a timed state.
|
|
60
|
+
- With translated reasons, set otherReason to the one that opens the text field.
|
|
61
|
+
|
|
62
|
+
## Inputs
|
|
63
|
+
|
|
64
|
+
| Name | Type | Default | Description |
|
|
65
|
+
| --- | --- | --- | --- |
|
|
66
|
+
| `text` | `string` | '' | Message text; Copy writes it, an unbound read aloud is timed by it. |
|
|
67
|
+
| `actions` | `readonly MessageActionKey[]` | ['copy', 'regenerate', 'feedback', 'speak'] | Which actions show, in order; feedback is both thumbs. |
|
|
68
|
+
| `versions` | `number \| readonly string[]` | 1 | All versions or their count; from 2 the switcher unfolds. |
|
|
69
|
+
| `version` | `number \| undefined (model)` | undefined (newest) | Shown version, 0-based; jumps to each new version. |
|
|
70
|
+
| `regenerating` | `boolean` | false | Spins the arrow, keeps the bar lit, ignores presses. |
|
|
71
|
+
| `vote` | `'up' \| 'down' \| null (model)` | null | Vote on the shown version; cleared on Regenerate and new versions. |
|
|
72
|
+
| `reasons` | `readonly string[]` | ['Not accurate', 'Too long', "Didn't follow instructions", 'Other'] | Quick reasons in the feedback row; single choice. |
|
|
73
|
+
| `otherReason` | `string \| null` | 'Other' | Reason that unfolds a text field whose words are sent. |
|
|
74
|
+
| `speaking` | `boolean \| undefined (model)` | undefined | Read aloud playing; bind to drive speech, unbound it stops on its own. |
|
|
75
|
+
| `speakDuration` | `number (ms)` | max(2600, 60 × characters) | How long an unbound read aloud plays. |
|
|
76
|
+
| `quiet` | `boolean` | true | Faded (0.6) until the message or bar is hovered or focused; never on touch. |
|
|
77
|
+
| `label` | `string` | labels.bar | Accessible name of the bar. |
|
|
78
|
+
| `labels` | `Partial<MessageActionsLabels>` | English | Every visible and spoken string. |
|
|
79
|
+
|
|
80
|
+
## Outputs
|
|
81
|
+
|
|
82
|
+
| Name | Payload | Description |
|
|
83
|
+
| --- | --- | --- |
|
|
84
|
+
| `copied` | `string` | After a successful copy, with the text. |
|
|
85
|
+
| `regenerate` | `void` | Regenerate pressed; add a version to versions. |
|
|
86
|
+
| `feedback` | `MessageFeedback` | { kind } at once (null when taken back), then { kind: 'down', reason } on Send. |
|
|
87
|
+
| `versionChange` | `number \| undefined` | A version was picked or added. |
|
|
88
|
+
| `voteChange` | `'up' \| 'down' \| null` | The vote changed. |
|
|
89
|
+
| `speakingChange` | `boolean \| undefined` | Read aloud started or stopped. |
|
|
90
|
+
|
|
91
|
+
## MessageActionKey
|
|
92
|
+
|
|
93
|
+
| Field | Type | Description |
|
|
94
|
+
| --- | --- | --- |
|
|
95
|
+
| `(union)` | `'copy' \| 'regenerate' \| 'feedback' \| 'speak'` | One action of the bar. |
|
|
96
|
+
|
|
97
|
+
## MessageFeedback
|
|
98
|
+
|
|
99
|
+
| Field | Type | Description |
|
|
100
|
+
| --- | --- | --- |
|
|
101
|
+
| `kind` | `'up' \| 'down' \| null` | The vote. |
|
|
102
|
+
| `reason` | `string` | Set on Send: the picked reason or the typed words. |
|
|
103
|
+
|
|
104
|
+
## MessageActionsLabels
|
|
105
|
+
|
|
106
|
+
| Field | Type | Description |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| `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. |
|
|
109
|
+
| `versionOf` | `(n: number, total: number) => string` | "Version 2 of 3". |
|
|
110
|
+
|
|
111
|
+
## UiMessage
|
|
112
|
+
|
|
113
|
+
| Field | Type | Description |
|
|
114
|
+
| --- | --- | --- |
|
|
115
|
+
| `[uiMessage]` | `directive` | Marks one answer; hover or focus inside lights the bar. |
|
|
116
|
+
|
|
117
|
+
## UiMessageText
|
|
118
|
+
|
|
119
|
+
| Field | Type | Description |
|
|
120
|
+
| --- | --- | --- |
|
|
121
|
+
| `version` | `unknown` | Changing it crossfades the text and eases the height. |
|
|
122
|
+
| `busy` | `boolean` | Mutes the text and pulses it while a version is written. |
|
|
123
|
+
|
|
124
|
+
## CSS variables
|
|
125
|
+
|
|
126
|
+
| Variable | Default | Description |
|
|
127
|
+
| --- | --- | --- |
|
|
128
|
+
| `--ui-message-actions-quiet` | `0.6` | Bar opacity at rest. |
|
|
129
|
+
| `--ui-message-actions-size` | `28px (Classic 30px, touch 36px)` | Button size. |
|
|
130
|
+
| `--ui-message-actions-bars` | `var(--ui-info)` | Read-aloud equalizer colour. |
|
|
131
|
+
|
|
132
|
+
## Keyboard
|
|
133
|
+
|
|
134
|
+
| Keys | Action |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| Tab | Copy, Regenerate, version arrows, thumbs, Read aloud, then the open row: close, reasons, Send, field. |
|
|
137
|
+
| Enter / Space | Presses an action, toggles a reason, sends. |
|
|
138
|
+
| Enter in the field | Sends with the typed words. |
|
|
139
|
+
| Esc | Closes the row from inside it or from thumbs down; focus to thumbs down; vote kept. |
|
|
140
|
+
|
|
141
|
+
## Accessibility
|
|
142
|
+
- role=group named by label; thumbs and Read aloud use aria-pressed; thumbs down has aria-expanded and aria-controls.
|
|
143
|
+
- Tooltips are aria-hidden and also show on keyboard focus.
|
|
144
|
+
- Polite live region: Copied, Regenerating, Version n of m, votes, Thanks for the feedback, reading states. Copy keeps its name.
|
|
145
|
+
- End arrows use aria-disabled and stay focusable; the closed row and field are inert; focus returns to thumbs down when the row folds.
|
|
146
|
+
- Forced colors: pressed and picked use Highlight; chips, Send, field and tooltips keep an edge.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Model Orbit
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add model-orbit`
|
|
6
|
+
Import: `import { UiModelOrbit, UiModelOrbitLogo } from './ui/model-orbit';`
|
|
7
|
+
Selector: `<ui-model-orbit>`
|
|
8
|
+
Docs: /components/model-orbit
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- A hero or feature section about one gateway, router or SDK that reaches many AI models or providers.
|
|
12
|
+
- Wide cards and landing sections that want a calm illustration with a little life in it.
|
|
13
|
+
|
|
14
|
+
## When not to use
|
|
15
|
+
- Small cards: it is wide (16 : 9) and the logos need room.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { Component } from '@angular/core';
|
|
21
|
+
import { UiModelOrbit } from './ui/model-orbit';
|
|
22
|
+
|
|
23
|
+
@Component({
|
|
24
|
+
selector: 'app-gateway-hero',
|
|
25
|
+
imports: [UiModelOrbit],
|
|
26
|
+
template: `
|
|
27
|
+
<section class="hero">
|
|
28
|
+
<h2>One endpoint, every model</h2>
|
|
29
|
+
<p>Route each request to the model that fits it, and switch providers without touching your code.</p>
|
|
30
|
+
<ui-model-orbit class="orbit" />
|
|
31
|
+
</section>
|
|
32
|
+
`,
|
|
33
|
+
styles: `
|
|
34
|
+
.hero { box-sizing: border-box; max-inline-size: 960px; margin-inline: auto; padding: 32px 16px; text-align: center; }
|
|
35
|
+
h2 { margin: 0; color: var(--ui-text); font-size: 24px; line-height: 32px; font-weight: 600; }
|
|
36
|
+
p { margin: 8px auto 0; max-inline-size: 460px; color: var(--ui-text-muted); font-size: 14px; line-height: 22px; }
|
|
37
|
+
.orbit { margin: 8px auto 0; }
|
|
38
|
+
`,
|
|
39
|
+
})
|
|
40
|
+
export class GatewayHero {}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Rules
|
|
44
|
+
- 16 : 9 box, inline-size min(760px, 100%) on a 960 × 540 viewBox; set another width with your own class.
|
|
45
|
+
- One root width of drag = 180° of turn; release glides with geometric decay, no snapping.
|
|
46
|
+
- Tooltip only for mouse pointers on hover-capable devices; 140 ms fade and 4 px rise, removed instantly.
|
|
47
|
+
- Sparks pause off-screen and in hidden tabs and restart from scratch when back.
|
|
48
|
+
- Reduced motion or --ui-motion-scale: 0: no sparks, no glide, no tooltip animation.
|
|
49
|
+
|
|
50
|
+
## Inputs
|
|
51
|
+
|
|
52
|
+
| Name | Type | Default | Description |
|
|
53
|
+
| --- | --- | --- | --- |
|
|
54
|
+
| `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. |
|
|
55
|
+
| `numbers` | `boolean` | true | Shows the small zero-padded numbers beside the tiles. |
|
|
56
|
+
| `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. |
|
|
57
|
+
| `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. |
|
|
58
|
+
|
|
59
|
+
## ModelOrbitItem
|
|
60
|
+
|
|
61
|
+
| Field | Type | Description |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| `name` | `string` | Shown in the tooltip. |
|
|
64
|
+
| `logo` | `string \| undefined` | Image URL drawn in the 24 × 24 logo box. |
|
|
65
|
+
|
|
66
|
+
## ModelOrbitLogoContext
|
|
67
|
+
|
|
68
|
+
| Field | Type | Description |
|
|
69
|
+
| --- | --- | --- |
|
|
70
|
+
| `$implicit` | `ModelOrbitItem` | The model of this tile. |
|
|
71
|
+
| `index` | `number` | Its position in models. |
|
|
72
|
+
|
|
73
|
+
## Template: uiModelOrbitLogo
|
|
74
|
+
|
|
75
|
+
Draws 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 }`.
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<ui-model-orbit [models]="models">
|
|
79
|
+
<ng-template uiModelOrbitLogo let-model>
|
|
80
|
+
<svg viewBox="0 0 24 24">…</svg>
|
|
81
|
+
</ng-template>
|
|
82
|
+
</ui-model-orbit>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## CSS variables
|
|
86
|
+
|
|
87
|
+
| Variable | Default | Description |
|
|
88
|
+
| --- | --- | --- |
|
|
89
|
+
| `--ui-model-orbit-beam` | `blue (--ui-blue-light; deeper mix in dark)` | Beams, thin rings and the hub mark. |
|
|
90
|
+
| `--ui-model-orbit-spark` | `blue (brighter mix in dark)` | Sparks. |
|
|
91
|
+
| `--ui-model-orbit-halo` | `blue at 15% (20% dark)` | Glow around the hub, fading to its edge. |
|
|
92
|
+
| `--ui-model-orbit-track` | `text colour at 4% (5% dark)` | The tilted track. |
|
|
93
|
+
| `--ui-model-orbit-tile` | `light-dark(--ui-bg-surface, canvas + 8% text)` | Tile fill. |
|
|
94
|
+
| `--ui-model-orbit-hub` | `light-dark(--ui-bg-surface, darkened canvas)` | Hub puck. |
|
|
95
|
+
|
|
96
|
+
## Keyboard
|
|
97
|
+
|
|
98
|
+
| Keys | Action |
|
|
99
|
+
| --- | --- |
|
|
100
|
+
| Tab | Focuses the illustration (ring on :focus-visible only). |
|
|
101
|
+
| ArrowLeft / ArrowRight | Turns the ring half a step (180°/n) at once; → moves the front tiles right. Not mirrored in RTL. |
|
|
102
|
+
|
|
103
|
+
## Accessibility
|
|
104
|
+
- Host role=img with aria-label from label, tabindex=0 when draggable; the SVG and tooltip are aria-hidden.
|
|
105
|
+
- Empty label: aria-hidden host, no role, no tabindex.
|
|
106
|
+
- Numbers use --ui-text-muted; forced colors give the tooltip a system border and background.
|