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,84 @@
|
|
|
1
|
+
# Glow Cloud
|
|
2
|
+
|
|
3
|
+
A small living mascot: a glowing cloud with pill eyes on a red-to-orange or blue-to-cyan sky that floats, looks around, blinks, follows the mouse and bounces with a wink when pressed.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add glow-cloud`
|
|
6
|
+
Import: `import { UiGlowCloud } from './ui/glow-cloud';`
|
|
7
|
+
Selector: `<ui-glow-cloud>`
|
|
8
|
+
Docs: /components/glow-cloud
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- A friendly face for an assistant, an AI feature or a cloud product: app icon, empty state, feature card.
|
|
12
|
+
- Landing pages that want a calm living mascot instead of a static logo.
|
|
13
|
+
|
|
14
|
+
## When not to use
|
|
15
|
+
- Below about 48px, where the glow and eyes get lost.
|
|
16
|
+
- Brands far from blue or orange.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { Component } from '@angular/core';
|
|
22
|
+
import { UiGlowCloud } from './ui/glow-cloud';
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'app-assistant-card',
|
|
26
|
+
imports: [UiGlowCloud],
|
|
27
|
+
template: `
|
|
28
|
+
<article>
|
|
29
|
+
<ui-glow-cloud color="blue" class="art" />
|
|
30
|
+
<h3>Say hello to Nimbus</h3>
|
|
31
|
+
<p>Your workspace helper drafts replies, sorts the inbox and keeps notes from every call.</p>
|
|
32
|
+
</article>
|
|
33
|
+
`,
|
|
34
|
+
styles: `
|
|
35
|
+
article { box-sizing: border-box; inline-size: min(320px, 100%); padding: 12px 12px 20px; border-radius: 20px; background: var(--ui-bg-surface); box-shadow: inset 0 0 0 1px var(--ui-hairline); }
|
|
36
|
+
.art { inline-size: 100%; border-radius: 12px; }
|
|
37
|
+
h3 { margin: 16px 8px 4px; color: var(--ui-text); font-size: 16px; line-height: 24px; font-weight: 600; }
|
|
38
|
+
p { margin: 0 8px; color: var(--ui-text-muted); font-size: 14px; line-height: 20px; }
|
|
39
|
+
`,
|
|
40
|
+
})
|
|
41
|
+
export class AssistantCard {}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Rules
|
|
45
|
+
- Square, min(380px, 100%) by default; the drawing is min(380px, 78%) of the width, centred.
|
|
46
|
+
- To fill a box, set width and height and aspect-ratio: auto in your class.
|
|
47
|
+
- Script-driven motion: 5.7s float cycle, random glances and blinks, mouse follow, bounce and wink on press.
|
|
48
|
+
- Runs only on screen in a visible tab and carries on from the same pose; reduced motion or --ui-motion-scale: 0 keeps it fully still, with no press reaction.
|
|
49
|
+
|
|
50
|
+
## Inputs
|
|
51
|
+
|
|
52
|
+
| Name | Type | Default | Description |
|
|
53
|
+
| --- | --- | --- | --- |
|
|
54
|
+
| `color` | `GlowCloudColor` | 'orange' | Red-to-orange or blue-to-cyan sky; the body follows. |
|
|
55
|
+
| `background` | `boolean` | true | Fill the box with the sky; false leaves the cloud on your own background. |
|
|
56
|
+
| `followPointer` | `boolean` | true | Eyes, lean and highlight follow the mouse over the host. Never on touch. |
|
|
57
|
+
| `label` | `string \| null \| undefined` | undefined | Accessible name; defaults to a short description. Empty string: aria-hidden decoration. |
|
|
58
|
+
|
|
59
|
+
## GlowCloudColor
|
|
60
|
+
|
|
61
|
+
`type GlowCloudColor = 'blue' | 'orange'`
|
|
62
|
+
|
|
63
|
+
## CSS variables
|
|
64
|
+
|
|
65
|
+
| Variable | Default | Description |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
| `--ui-glow-cloud-sky-top` | `deep red / deep blue (deeper in dark)` | Sky colour at the top. |
|
|
68
|
+
| `--ui-glow-cloud-sky-bottom` | `warm orange / light cyan` | Sky colour at the bottom. |
|
|
69
|
+
| `--ui-glow-cloud-bloom` | `soft peach / cyan light` | Glow behind the cloud, up and right of centre. |
|
|
70
|
+
| `--ui-glow-cloud-body` | `#f4512f / #00a0ff (orange / blue)` | Centre of the glowing body. |
|
|
71
|
+
| `--ui-glow-cloud-body-mid` | `#fb7b48 / #19b2ff (orange / blue)` | Middle of the body. |
|
|
72
|
+
| `--ui-glow-cloud-rim` | `#ffbd8e / #6dd4ff (orange / blue)` | Outer edge of the body, inside the white glow. |
|
|
73
|
+
| `--ui-glow-cloud-shine` | `#ffb398 / #9fe0ff (orange / blue)` | Highlight on the top lobe. |
|
|
74
|
+
| `--ui-glow-cloud-eye` | `#fff8f3 / #f3faff (orange / blue)` | The eyes. |
|
|
75
|
+
| `--ui-glow-cloud-eye-low` | `#ffe5d6 / #d6ecff (orange / blue)` | Lower half of each eye. |
|
|
76
|
+
| `--ui-glow-cloud-eye-rim` | `#eda48c / #8fbdea (orange / blue)` | Thin rim around each eye. |
|
|
77
|
+
| `--ui-glow-cloud-shadow` | `#a4230e / #14408c (orange / blue)` | Ground shadow. |
|
|
78
|
+
|
|
79
|
+
## Accessibility
|
|
80
|
+
- Host role=img with one aria-label; the SVG is aria-hidden and not focusable.
|
|
81
|
+
- Empty label: host aria-hidden, purely decorative.
|
|
82
|
+
- Not focusable; a press only animates.
|
|
83
|
+
- Motion pauses off-screen, in hidden tabs and with reduced motion (or --ui-motion-scale: 0).
|
|
84
|
+
- Forced colors: sky and cloud keep their colours (forced-color-adjust: none).
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Grid Background
|
|
2
|
+
|
|
3
|
+
A fine line grid that drifts slowly behind your content, fades out toward the edges and is uncovered once by a circle growing from the centre when it first comes into view.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add grid-background`
|
|
6
|
+
Import: `import { UiGridBackground } from './ui/grid-background';`
|
|
7
|
+
Selector: `<ui-grid-background>`
|
|
8
|
+
Docs: /components/grid-background
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- Hero sections and feature headers that want a quiet, technical backdrop.
|
|
12
|
+
- Empty states and panels that look too flat on a plain fill.
|
|
13
|
+
|
|
14
|
+
## When not to use
|
|
15
|
+
- Behind dense text or data tables.
|
|
16
|
+
- Several moving backgrounds on one screen: one per view.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { Component } from '@angular/core';
|
|
22
|
+
import { UiButton } from './ui/button';
|
|
23
|
+
import { UiGridBackground } from './ui/grid-background';
|
|
24
|
+
|
|
25
|
+
@Component({
|
|
26
|
+
selector: 'app-launch-hero',
|
|
27
|
+
imports: [UiGridBackground, UiButton],
|
|
28
|
+
template: `
|
|
29
|
+
<ui-grid-background class="hero" [size]="48" direction="diagonal">
|
|
30
|
+
<section>
|
|
31
|
+
<h1>Release 3.0 is out</h1>
|
|
32
|
+
<p>Scheduled runs, shared prompts and a faster editor, in one update.</p>
|
|
33
|
+
<button uiButton>Read the changelog</button>
|
|
34
|
+
</section>
|
|
35
|
+
</ui-grid-background>
|
|
36
|
+
`,
|
|
37
|
+
styles: `
|
|
38
|
+
.hero { min-block-size: 480px; border-radius: 20px; background: var(--ui-bg-surface); box-shadow: inset 0 0 0 1px var(--ui-hairline); }
|
|
39
|
+
section { display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
|
|
40
|
+
h1 { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -0.03em; }
|
|
41
|
+
p { max-inline-size: 340px; margin: 0 0 8px; color: var(--ui-text-muted); font-size: 15px; line-height: 1.5; }
|
|
42
|
+
`,
|
|
43
|
+
})
|
|
44
|
+
export class LaunchHero {}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Rules
|
|
48
|
+
- Project one element: it fills the box. Give the host a height through your class, or let the content size it.
|
|
49
|
+
- Corners, fill and frame come from your own class.
|
|
50
|
+
- Drift pauses off-screen and in hidden tabs; reduced motion: still, no reveal.
|
|
51
|
+
|
|
52
|
+
## Inputs
|
|
53
|
+
|
|
54
|
+
| Name | Type | Default | Description |
|
|
55
|
+
| --- | --- | --- | --- |
|
|
56
|
+
| `size` | `number` | 48 | Cell size in px. |
|
|
57
|
+
| `speed` | `number` | 3 | Seconds to drift one cell; 0 keeps it still. |
|
|
58
|
+
| `direction` | `GridBackgroundDirection` | 'diagonal' | up, down, left, right or diagonal (top right to bottom left). Physical in RTL. |
|
|
59
|
+
| `reveal` | `boolean` | true | Uncover with a circle from the centre, once, at 20% in view (or 20% of the viewport for tall boxes). |
|
|
60
|
+
| `fade` | `number` | 70 | Edge fade end, % of the distance to the corners; full strength to 30% of it. |
|
|
61
|
+
| `color` | `string \| null` | null | Line colour for this grid; sets --ui-grid-background-line. |
|
|
62
|
+
|
|
63
|
+
## GridBackgroundDirection
|
|
64
|
+
|
|
65
|
+
`type GridBackgroundDirection = 'up' | 'down' | 'left' | 'right' | 'diagonal'`
|
|
66
|
+
|
|
67
|
+
## CSS variables
|
|
68
|
+
|
|
69
|
+
| Variable | Default | Description |
|
|
70
|
+
| --- | --- | --- |
|
|
71
|
+
| `--ui-grid-background-line` | `color-mix(in srgb, var(--ui-text) 8%, transparent)` | Line colour; follows the theme. |
|
|
72
|
+
|
|
73
|
+
## Accessibility
|
|
74
|
+
- Grid layer aria-hidden with pointer-events: none.
|
|
75
|
+
- Projected content on its own layer above, in reading order, interactive.
|
|
76
|
+
- Forced colors: grid hidden.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Hover Card
|
|
2
|
+
|
|
3
|
+
A preview card for what a link or a name points to. It opens after the pointer rests or keyboard focus stays, keeps open while the pointer travels into it, never opens on touch, and flips to stay on screen.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add hover-card`
|
|
6
|
+
Import: `import { UiHoverCard, UiHoverCardPanel } from './ui/hover-card';`
|
|
7
|
+
Selector: `<[uiHoverCard]>`
|
|
8
|
+
Docs: /components/hover-card
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- A quick look at what a name or link refers to: a person, an agent, a file, a run.
|
|
12
|
+
- Mentions in feeds, logs and tables, where the full page is one click away.
|
|
13
|
+
|
|
14
|
+
## When not to use
|
|
15
|
+
- An icon button's name or a one-line hint: use Tooltip.
|
|
16
|
+
- Anything to act on, or a form: use Popover.
|
|
17
|
+
- Information that exists only in the card: touch never shows it.
|
|
18
|
+
- Actions on the item under the pointer: use Context Menu.
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { Component, input } from '@angular/core';
|
|
24
|
+
import { UiHoverCard } from './ui/hover-card';
|
|
25
|
+
|
|
26
|
+
@Component({
|
|
27
|
+
selector: 'app-agent-name',
|
|
28
|
+
imports: [UiHoverCard],
|
|
29
|
+
template: `
|
|
30
|
+
<a [href]="'/agents/' + id()" [uiHoverCard]="card" [uiHoverCardWidth]="288">{{ name() }}</a>
|
|
31
|
+
<ng-template #card>
|
|
32
|
+
<div class="card">
|
|
33
|
+
<strong aria-hidden="true">{{ name() }}</strong>
|
|
34
|
+
<span class="meta">{{ role() }} · {{ status() }}</span>
|
|
35
|
+
<a [href]="'/agents/' + id()">Open agent</a>
|
|
36
|
+
</div>
|
|
37
|
+
</ng-template>
|
|
38
|
+
`,
|
|
39
|
+
styles: `
|
|
40
|
+
.card { display: grid; gap: 4px; }
|
|
41
|
+
.meta { color: var(--ui-text-muted); font-size: 12px; line-height: 16px; }
|
|
42
|
+
`,
|
|
43
|
+
})
|
|
44
|
+
export class AgentName {
|
|
45
|
+
id = input.required<string>();
|
|
46
|
+
name = input.required<string>();
|
|
47
|
+
role = input('');
|
|
48
|
+
status = input('');
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Rules
|
|
53
|
+
- Put [uiHoverCard] on a focusable link or button with a name; it warns in dev mode otherwise.
|
|
54
|
+
- Pass the content as an <ng-template>; use [uiHoverCardContext] to share one template across rows.
|
|
55
|
+
- Everything in the card must also be on the page the link opens: touch never shows it.
|
|
56
|
+
- Mark a title that repeats the trigger's text aria-hidden="true".
|
|
57
|
+
- Needs overlay.ts next to hover-card.ts (the CLI adds it): the placement, Escape and outside-press layer shared by the floating components.
|
|
58
|
+
|
|
59
|
+
## Inputs
|
|
60
|
+
|
|
61
|
+
| Name | Type | Default | Description |
|
|
62
|
+
| --- | --- | --- | --- |
|
|
63
|
+
| `uiHoverCard` | `TemplateRef<unknown> \| null \| undefined` | undefined | What the card shows. Null or undefined: no card. |
|
|
64
|
+
| `uiHoverCardContext` | `unknown` | undefined | Passed to the template as $implicit (let-item). |
|
|
65
|
+
| `uiHoverCardSide` | `'bottom' \| 'top' \| 'right' \| 'left'` | 'bottom' | Preferred side; flips to the side with more room. |
|
|
66
|
+
| `uiHoverCardAlign` | `'start' \| 'center' \| 'end'` | 'start' | Edges that line up (logical in RTL); switches when it would stick out. |
|
|
67
|
+
| `uiHoverCardOffset` | `number` | 8 | Gap to the trigger in px. |
|
|
68
|
+
| `uiHoverCardOpenDelay` | `number` | 600 | Pointer rest or keyboard focus time before it opens, ms. |
|
|
69
|
+
| `uiHoverCardCloseDelay` | `number` | 300 | Time it stays after the pointer leaves trigger, card and corridor, ms. |
|
|
70
|
+
| `uiHoverCardWidth` | `number \| string` | none | Card width (number = px). Default fits the content up to 320px. |
|
|
71
|
+
| `uiHoverCardOpen` | `boolean` | false | Open state, two-way [(uiHoverCardOpen)]; true from code opens at once. Open on the first render, it closes once the pointer moves outside it and its trigger. |
|
|
72
|
+
| `uiHoverCardDisabled` | `boolean` | false | Never opens. |
|
|
73
|
+
| `uiHoverCardClass` | `string` | none | A class on the card. |
|
|
74
|
+
| `uiHoverCardLabels` | `Partial<HoverCardLabels>` | {} | card(name): the card's spoken name from the trigger's (default: the trigger's name). |
|
|
75
|
+
|
|
76
|
+
## Outputs
|
|
77
|
+
|
|
78
|
+
| Name | Payload | Description |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `uiHoverCardOpenChange` | `boolean` | Every change of uiHoverCardOpen. |
|
|
81
|
+
|
|
82
|
+
## HoverCardLabels
|
|
83
|
+
|
|
84
|
+
| Field | Type | Description |
|
|
85
|
+
| --- | --- | --- |
|
|
86
|
+
| `card` | `(name: string) => string` | The card's spoken name, from the trigger's name. Default: the trigger's name, or "Preview" when it has none. |
|
|
87
|
+
|
|
88
|
+
## Template: uiHoverCard
|
|
89
|
+
|
|
90
|
+
The card's content, created on open and destroyed on close. Context: `$implicit: uiHoverCardContext`.
|
|
91
|
+
|
|
92
|
+
```html
|
|
93
|
+
<a href="/runs/r-8841" [uiHoverCard]="details" [uiHoverCardContext]="run">r-8841</a>
|
|
94
|
+
<ng-template #details let-run>{{ run.agent }} · {{ run.cost }}</ng-template>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## CSS variables
|
|
98
|
+
|
|
99
|
+
| Variable | Default | Description |
|
|
100
|
+
| --- | --- | --- |
|
|
101
|
+
| `--ui-hover-card-bg` | `var(--ui-popover-bg, var(--ui-bg-overlay))` | Fill. |
|
|
102
|
+
| `--ui-hover-card-fg` | `var(--ui-popover-fg, var(--ui-text))` | Text. |
|
|
103
|
+
| `--ui-hover-card-radius` | `12px (Classic 16px)` | Corners. |
|
|
104
|
+
| `--ui-hover-card-padding` | `14px (Classic and touch 16px)` | Inner space. |
|
|
105
|
+
| `--ui-hover-card-shadow` | `var(--ui-popover-shadow, var(--ui-shadow-md))` | Ring and drop shadow. |
|
|
106
|
+
| `--ui-hover-card-width` | `max-content` | Width when uiHoverCardWidth is unset. |
|
|
107
|
+
| `--ui-hover-card-max-width` | `320px` | Widest it grows on its own. |
|
|
108
|
+
| `--ui-hover-card-drift` | `4px` | Glide distance on enter. |
|
|
109
|
+
| `--ui-hover-card-from` | `0.97` | Starting scale on enter. |
|
|
110
|
+
|
|
111
|
+
## Keyboard
|
|
112
|
+
|
|
113
|
+
| Keys | Action |
|
|
114
|
+
| --- | --- |
|
|
115
|
+
| Tab | Focus that stays on the trigger opens it after the delay; Tab again moves into its links; Tab past them closes it. |
|
|
116
|
+
| Shift+Tab | From the trigger closes it; from a link inside returns to the trigger. |
|
|
117
|
+
| Escape | Closes it (focus back to the trigger if inside) and stops the event; when closed, Escape passes through. |
|
|
118
|
+
| Enter | Follows the link. |
|
|
119
|
+
|
|
120
|
+
## Accessibility
|
|
121
|
+
- No ARIA is added to the trigger; it keeps its role, name and behavior.
|
|
122
|
+
- The card is role=group, named after the trigger, and sits right after it in reading and Tab order.
|
|
123
|
+
- Opens on :focus-visible focus after the delay, never after a mouse press or on touch.
|
|
124
|
+
- Mark a card title that repeats the trigger's text aria-hidden so the name is heard once.
|
|
125
|
+
- Forced colors keep a card edge; muted text in examples uses --ui-text-muted (4.5:1).
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Icon Button
|
|
2
|
+
|
|
3
|
+
A square button that is only an icon: ghost, outlined or solid, two sizes, a pressed state for toggles, and its label as the tooltip.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add icon-button`
|
|
6
|
+
Import: `import { UiIconButton, UiIconButtonIcon } from './ui/icon-button';`
|
|
7
|
+
Selector: `<button[uiIconButton]>`
|
|
8
|
+
Docs: /components/icon-button
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- Toolbar tools whose icon says it all.
|
|
12
|
+
- Quiet actions under a message or on a row: ghost.
|
|
13
|
+
- A tool that stays on: [(pressed)].
|
|
14
|
+
|
|
15
|
+
## When not to use
|
|
16
|
+
- Unclear icons or the page's main action: use Button.
|
|
17
|
+
- Choosing between views: use Segmented Control.
|
|
18
|
+
- Saved on/off settings: use Switch.
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { Component, model, output } from '@angular/core';
|
|
24
|
+
import { UiIconButton, UiIconButtonIcon } from './ui/icon-button';
|
|
25
|
+
|
|
26
|
+
@Component({
|
|
27
|
+
selector: 'app-notes-toolbar',
|
|
28
|
+
imports: [UiIconButton, UiIconButtonIcon],
|
|
29
|
+
template: `
|
|
30
|
+
<div class="tools">
|
|
31
|
+
<button type="button" uiIconButton variant="secondary" label="Search notes" (click)="search.emit()">
|
|
32
|
+
<svg uiIconButtonIcon viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round">
|
|
33
|
+
<circle cx="11" cy="11" r="6.5" />
|
|
34
|
+
<path d="M20 20l-4.4-4.4" />
|
|
35
|
+
</svg>
|
|
36
|
+
</button>
|
|
37
|
+
<button type="button" uiIconButton variant="secondary" label="Unread only" [(pressed)]="unreadOnly">
|
|
38
|
+
<svg uiIconButtonIcon viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linejoin="round">
|
|
39
|
+
<path d="M5 5.5h14A1.5 1.5 0 0 1 20.5 7v8a1.5 1.5 0 0 1-1.5 1.5h-9l-4.5 3.5v-3.5H5A1.5 1.5 0 0 1 3.5 15V7A1.5 1.5 0 0 1 5 5.5z" />
|
|
40
|
+
</svg>
|
|
41
|
+
</button>
|
|
42
|
+
<button type="button" uiIconButton variant="primary" label="New note" (click)="create.emit()">
|
|
43
|
+
<svg uiIconButtonIcon viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round">
|
|
44
|
+
<path d="M12 5v14M5 12h14" />
|
|
45
|
+
</svg>
|
|
46
|
+
</button>
|
|
47
|
+
</div>
|
|
48
|
+
`,
|
|
49
|
+
styles: `
|
|
50
|
+
.tools { display: flex; gap: 6px; }
|
|
51
|
+
`,
|
|
52
|
+
})
|
|
53
|
+
export class NotesToolbar {
|
|
54
|
+
unreadOnly = model(false);
|
|
55
|
+
search = output();
|
|
56
|
+
create = output();
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Rules
|
|
61
|
+
- Always give a label that says what it does.
|
|
62
|
+
- Keep a toggle's label stable; let pressed carry the state.
|
|
63
|
+
- Put uiIconButtonIcon on the svg, drawn in currentColor.
|
|
64
|
+
|
|
65
|
+
## Inputs
|
|
66
|
+
|
|
67
|
+
| Name | Type | Default | Description |
|
|
68
|
+
| --- | --- | --- | --- |
|
|
69
|
+
| `label` | `string` | required | Accessible name and tooltip. |
|
|
70
|
+
| `variant` | `'ghost' \| 'secondary' \| 'primary'` | 'ghost' | Icon only, white with a hairline edge, or dark chip. |
|
|
71
|
+
| `size` | `'sm' \| 'md'` | 'md' | 24/28px (icons 14/15); Classic 32/40px. |
|
|
72
|
+
| `pressed` | `boolean \| undefined (model)` | unset | Toggle: aria-pressed, gray fill, flips on click. [(pressed)]. |
|
|
73
|
+
| `title` | `string` | label | Tooltip; "" removes it. |
|
|
74
|
+
|
|
75
|
+
## Outputs
|
|
76
|
+
|
|
77
|
+
| Name | Payload | Description |
|
|
78
|
+
| --- | --- | --- |
|
|
79
|
+
| `pressedChange` | `boolean` | Emitted when a toggle flips. |
|
|
80
|
+
|
|
81
|
+
## CSS variables
|
|
82
|
+
|
|
83
|
+
| Variable | Default | Description |
|
|
84
|
+
| --- | --- | --- |
|
|
85
|
+
| `--ui-icon-button-press` | `0.94` | Scale while held (Classic 0.95). |
|
|
86
|
+
|
|
87
|
+
## Keyboard
|
|
88
|
+
|
|
89
|
+
| Keys | Action |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| Enter or Space | Clicks it, or flips a toggle. |
|
|
92
|
+
| Tab | Moves to the next control. |
|
|
93
|
+
|
|
94
|
+
## Accessibility
|
|
95
|
+
- Native <button>; label is aria-label and title.
|
|
96
|
+
- Toggles expose aria-pressed true/false; plain buttons have none.
|
|
97
|
+
- Icon (uiIconButtonIcon) is aria-hidden; announce label swaps like Copied in your own live region.
|
|
98
|
+
- Rest icons ≥ 4.5:1; forced colors keep outlines and highlight pressed toggles.
|
|
99
|
+
- Touch: invisible ring of 36x36 (Classic 42x42) takes the tap.
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Integration Beam
|
|
2
|
+
|
|
3
|
+
Your product as a dark hub between the tools it connects, joined by curved beams that carry pulses in from the senders and out to the receivers. Hover or focus a tool to bring its beam forward, click or tap it to pause it.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add integration-beam`
|
|
6
|
+
Import: `import { UiIntegrationBeam, UiBeamLogo } from './ui/integration-beam';`
|
|
7
|
+
Selector: `<ui-integration-beam>`
|
|
8
|
+
Docs: /components/integration-beam
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- A hero or integrations section showing your product between the tools a team uses.
|
|
12
|
+
- A landing page where a calm self-running flow says "we connect to these".
|
|
13
|
+
|
|
14
|
+
## When not to use
|
|
15
|
+
- A real integration settings page: pausing saves nothing.
|
|
16
|
+
- More than four tools per side: use a logo grid.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { Component } from '@angular/core';
|
|
22
|
+
import { UiIntegrationBeam } from './ui/integration-beam';
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'app-integrations-section',
|
|
26
|
+
imports: [UiIntegrationBeam],
|
|
27
|
+
template: `
|
|
28
|
+
<section>
|
|
29
|
+
<h2>Fits between the tools you already use</h2>
|
|
30
|
+
<p>Messages, notes and mail come in; deals, tickets and files go out.</p>
|
|
31
|
+
<ui-integration-beam />
|
|
32
|
+
</section>
|
|
33
|
+
`,
|
|
34
|
+
styles: `
|
|
35
|
+
section { max-inline-size: 640px; margin-inline: auto; padding: 48px 0; text-align: center; }
|
|
36
|
+
h2 { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; }
|
|
37
|
+
p { margin: 6px 0 40px; color: var(--ui-text-muted); font-size: 15px; line-height: 22px; }
|
|
38
|
+
`,
|
|
39
|
+
})
|
|
40
|
+
export class IntegrationsSection {}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Rules
|
|
44
|
+
- Logos come from <ng-template uiBeamLogo="Name"> with the exact tool or hub name.
|
|
45
|
+
- At most four tools per side.
|
|
46
|
+
- Pausing is visual only; read [(paused)] if the page needs it.
|
|
47
|
+
- Below 460px of its own width the scene stacks vertically.
|
|
48
|
+
|
|
49
|
+
## Inputs
|
|
50
|
+
|
|
51
|
+
| Name | Type | Default | Description |
|
|
52
|
+
| --- | --- | --- | --- |
|
|
53
|
+
| `left` | `BeamTool[]` | Chatline, Notebook, Mailroom | Senders: left of the hub, above it when stacked. |
|
|
54
|
+
| `right` | `BeamTool[]` | Pipeline, Tracker, Vault | Receivers: right of the hub, below it when stacked. |
|
|
55
|
+
| `center` | `BeamHub` | { name: 'Relay' } | Your product; neutral four-petal mark without a logo template. |
|
|
56
|
+
| `label` | `string \| null` | null | Group name; unset = "{hub} connected to {tools}". |
|
|
57
|
+
| `labels` | `Partial<IntegrationBeamLabels>` | {} | Every shown or spoken string; {n} {total} {name} {hub} {tools} are filled in. |
|
|
58
|
+
| `paused` | `string[]` | [] | Names of paused tools; two-way [(paused)]. |
|
|
59
|
+
|
|
60
|
+
## Outputs
|
|
61
|
+
|
|
62
|
+
| Name | Payload | Description |
|
|
63
|
+
| --- | --- | --- |
|
|
64
|
+
| `pausedChange` | `string[]` | Emitted when a tool is paused or reconnected. |
|
|
65
|
+
|
|
66
|
+
## BeamTool
|
|
67
|
+
|
|
68
|
+
`type BeamTool = { name: string }`
|
|
69
|
+
|
|
70
|
+
## BeamHub
|
|
71
|
+
|
|
72
|
+
`type BeamHub = { name: string }`
|
|
73
|
+
|
|
74
|
+
## IntegrationBeamLabels
|
|
75
|
+
|
|
76
|
+
`type IntegrationBeamLabels = { connected: string; syncing: string; allPaused: string; paused: string; group: string; announcePaused: string; announceConnected: string }`
|
|
77
|
+
|
|
78
|
+
## Template: uiBeamLogo
|
|
79
|
+
|
|
80
|
+
Logo of the tool or hub whose name matches. Tools 28x28, hub 36x36 in currentColor (light on the dark hub). Unmatched names: built-in mark for the sample tools, else the initial. Context: `none`.
|
|
81
|
+
|
|
82
|
+
```html
|
|
83
|
+
<ng-template uiBeamLogo="Relay">
|
|
84
|
+
<svg viewBox="0 0 36 36" fill="currentColor">…</svg>
|
|
85
|
+
</ng-template>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## CSS variables
|
|
89
|
+
|
|
90
|
+
| Variable | Default | Description |
|
|
91
|
+
| --- | --- | --- |
|
|
92
|
+
| `--ui-integration-beam-line` | `light-dark(color-mix(in srgb, var(--ui-text) 12%, transparent), color-mix(in srgb, var(--ui-text) 7%, transparent))` | Resting beam colour. |
|
|
93
|
+
|
|
94
|
+
## Keyboard
|
|
95
|
+
|
|
96
|
+
| Keys | Action |
|
|
97
|
+
| --- | --- |
|
|
98
|
+
| Tab | Next tool, senders first; its beam comes forward and its name shows. |
|
|
99
|
+
| Enter / Space | Pauses or reconnects the focused tool. |
|
|
100
|
+
|
|
101
|
+
## Accessibility
|
|
102
|
+
- role=group named after the hub and tools.
|
|
103
|
+
- Each tool is a button named by the tool with aria-pressed (true = connected).
|
|
104
|
+
- Toggles announced politely: "{name} paused. N of M connected."
|
|
105
|
+
- The status chip is visual only (no role=status); only real changes reach the one polite live region.
|
|
106
|
+
- Beams, pulses, glows, logos and name labels are aria-hidden.
|
|
107
|
+
- Forced colors: tiles, hub, chip and labels get a CanvasText edge; paused tiles dashed.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Integration Grid
|
|
2
|
+
|
|
3
|
+
A still wall of rounded app tiles, 7 / 9 / 7, around a larger, brighter centre tile with your product mark. The tiles fade gently toward the sides and a hovered logo grows.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add integration-grid`
|
|
6
|
+
Import: `import { UiIntegrationGrid, UiIntegrationGridMark } from './ui/integration-grid';`
|
|
7
|
+
Selector: `<ui-integration-grid>`
|
|
8
|
+
Docs: /components/integration-grid
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- Integration sections and feature cards: works with the tools you use.
|
|
12
|
+
- Landing pages that put your product at the centre of its ecosystem.
|
|
13
|
+
|
|
14
|
+
## When not to use
|
|
15
|
+
- A clickable list of integrations: the tiles are a picture, not links.
|
|
16
|
+
- More than 22 logos (16 at 7 columns, 10 at 5): extras are dropped.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { Component } from '@angular/core';
|
|
22
|
+
import { UiIntegrationGrid, UiIntegrationGridMark } from './ui/integration-grid';
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'app-integrations-section',
|
|
26
|
+
imports: [UiIntegrationGrid, UiIntegrationGridMark],
|
|
27
|
+
template: `
|
|
28
|
+
<section>
|
|
29
|
+
<ui-integration-grid>
|
|
30
|
+
<svg uiIntegrationGridMark viewBox="0 0 40 40" aria-hidden="true">
|
|
31
|
+
<rect width="40" height="40" rx="10" fill="#c2410c" />
|
|
32
|
+
<path d="M11 27V13l9 8 9-8v14" fill="none" stroke="#fff" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" />
|
|
33
|
+
</svg>
|
|
34
|
+
</ui-integration-grid>
|
|
35
|
+
<h3>Plugs into the tools you already pay for</h3>
|
|
36
|
+
<p>Two-way sync with 22 apps, set up in a few clicks and kept in step every minute.</p>
|
|
37
|
+
</section>
|
|
38
|
+
`,
|
|
39
|
+
styles: `
|
|
40
|
+
section { display: grid; justify-items: center; gap: 8px; max-inline-size: 760px; margin-inline: auto; text-align: center; }
|
|
41
|
+
h3 { margin: 16px 0 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; }
|
|
42
|
+
p { max-inline-size: 420px; margin: 0; color: var(--ui-text-muted); font-size: 14px; line-height: 22px; }
|
|
43
|
+
`,
|
|
44
|
+
})
|
|
45
|
+
export class IntegrationsSection {}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Rules
|
|
49
|
+
- Import UiIntegrationGridMark with UiIntegrationGrid when you project a centre mark.
|
|
50
|
+
- Each logo is one filled path in a 24×24 viewBox; use darkColor when its colour is too dark or light for dark mode.
|
|
51
|
+
- Set the width with your own class; it caps at 760px and keeps its aspect ratio.
|
|
52
|
+
|
|
53
|
+
## Inputs
|
|
54
|
+
|
|
55
|
+
| Name | Type | Default | Description |
|
|
56
|
+
| --- | --- | --- | --- |
|
|
57
|
+
| `logos` | `readonly IntegrationGridLogo[]` | INTEGRATION_GRID_LOGOS (22 sample marks) | { name, path, color?, darkColor? }, path in a 24×24 box; filled row by row around the centre. Extras dropped, missing ones leave empty tiles. |
|
|
58
|
+
| `columns` | `5 \| 7 \| 9` | 9 | Tiles in the middle row; outer rows hold two fewer. Fewer columns: larger tiles, taller wall. |
|
|
59
|
+
| `label` | `string` | generated | Accessible name. Unset: "Integrates with" + the names shown. "" hides it as decoration. |
|
|
60
|
+
| `labels` | `Partial<IntegrationGridLabels>` | { integratesWith: "Integrates with" } | Words that start the generated label. |
|
|
61
|
+
|
|
62
|
+
## IntegrationGridLogo
|
|
63
|
+
|
|
64
|
+
| Field | Type | Description |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| `name` | `string` | Read out in the generated label. |
|
|
67
|
+
| `path` | `string` | One filled SVG path in a 24×24 box. |
|
|
68
|
+
| `color` | `string?` | Fill. Without it the logo follows the ink. |
|
|
69
|
+
| `darkColor` | `string?` | Fill in dark mode. |
|
|
70
|
+
|
|
71
|
+
## IntegrationGridLabels
|
|
72
|
+
|
|
73
|
+
| Field | Type | Description |
|
|
74
|
+
| --- | --- | --- |
|
|
75
|
+
| `integratesWith` | `string` | Starts the generated label. Default "Integrates with". |
|
|
76
|
+
|
|
77
|
+
## Template: uiIntegrationGridMark
|
|
78
|
+
|
|
79
|
+
Your own <img> or <svg> in the centre tile, at 40% of its width and square. Without it, a neutral mark. Context: `none`.
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<ui-integration-grid>
|
|
83
|
+
<img uiIntegrationGridMark src="/mark.svg" alt="" width="40" height="40" />
|
|
84
|
+
</ui-integration-grid>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## CSS variables
|
|
88
|
+
|
|
89
|
+
| Variable | Default | Description |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| `--ui-integration-grid-face` | `var(--ui-bg-surface)` | Tile face; fades toward the sides. |
|
|
92
|
+
| `--ui-integration-grid-line` | `color-mix(in srgb, var(--ui-text) 15%, transparent)` | Tile outline; fades slightly toward the sides. |
|
|
93
|
+
| `--ui-integration-grid-centre-face` | `var(--ui-bg-overlay)` | Centre tile face. |
|
|
94
|
+
| `--ui-integration-grid-centre-line` | `color-mix(in srgb, var(--ui-text) 16%, transparent)` | Centre tile outline. |
|
|
95
|
+
| `--ui-integration-grid-ink` | `var(--ui-text)` | Logos without a colour and the default centre mark. |
|
|
96
|
+
|
|
97
|
+
## Accessibility
|
|
98
|
+
- One role=img named "Integrates with" + the logo names; tiles and SVGs aria-hidden.
|
|
99
|
+
- label="" makes it decorative (aria-hidden).
|
|
100
|
+
- Forced colors: tiles keep a CanvasText outline; logos keep their colours.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Kbd
|
|
2
|
+
|
|
3
|
+
A chip for keyboard shortcuts: one key or a whole combo in one chip. mod becomes ⌘ on a Mac and Ctrl elsewhere, and screen readers hear the keys spelled out.
|
|
4
|
+
|
|
5
|
+
Add: `npx ochreui@latest add kbd`
|
|
6
|
+
Import: `import { UiKbd } from './ui/kbd';`
|
|
7
|
+
Selector: `<kbd[ui-kbd]>`
|
|
8
|
+
Docs: /components/kbd
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
- Next to a menu item or a command, to show its shortcut.
|
|
12
|
+
- On a help sheet or settings page that lists shortcuts.
|
|
13
|
+
- When running text names a key.
|
|
14
|
+
- Inside a tooltip or on a dark button: in the flat look the chip takes its colors from the text around it.
|
|
15
|
+
|
|
16
|
+
## When not to use
|
|
17
|
+
- A status or a count: use a badge.
|
|
18
|
+
- Code, a shell command or a file path: use inline <code>.
|
|
19
|
+
- Something people click or remove: use a button or a tag.
|
|
20
|
+
- Touch-only screens.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { Component } from '@angular/core';
|
|
26
|
+
import { UiKbd } from './ui/kbd';
|
|
27
|
+
|
|
28
|
+
@Component({
|
|
29
|
+
selector: 'app-search-hint',
|
|
30
|
+
imports: [UiKbd],
|
|
31
|
+
template: `
|
|
32
|
+
<span>Search</span>
|
|
33
|
+
<kbd ui-kbd [keys]="['mod', 'k']"></kbd>
|
|
34
|
+
`,
|
|
35
|
+
})
|
|
36
|
+
export class SearchHint {}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Rules
|
|
40
|
+
- Write mod, not cmd or ctrl, so each platform sees its own key.
|
|
41
|
+
- List keys in the order they are pressed: modifiers first, then the main key.
|
|
42
|
+
- Use <kbd ui-kbd> on a real kbd element; one chip per shortcut, never one per key and never a '+' between keys.
|
|
43
|
+
- Show shortcuts in menus, tooltips and help sheets, not on every button.
|
|
44
|
+
|
|
45
|
+
## Inputs
|
|
46
|
+
|
|
47
|
+
| Name | Type | Default | Description |
|
|
48
|
+
| --- | --- | --- | --- |
|
|
49
|
+
| `keys` | `string \| string[]` | none | One key or a combo in one chip. Named keys: mod, cmd, ctrl, alt, shift, enter, esc, tab, space, backspace, delete, up, down, left, right, pageup, pagedown, home, end. Anything else is shown as written; single letters as capitals. |
|
|
50
|
+
| `size` | `'sm' \| 'md'` | 'sm' | sm for menus and running text, md for shortcut lists. |
|
|
51
|
+
| `platform` | `'mac' \| 'other'` | detected | Forces Mac symbols or Windows/Linux words. 'other' during server rendering. |
|
|
52
|
+
| `(content)` | `text` | none | Shown as one plain key when keys is left out; ignored when keys is set. |
|
|
53
|
+
|
|
54
|
+
## CSS variables
|
|
55
|
+
|
|
56
|
+
| Variable | Default | Description |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| `--ui-kbd-bg` | `faint wash of currentColor; --ui-bg-overlay with data-ui-look="tray"` | Chip fill. |
|
|
59
|
+
| `--ui-kbd-edge` | `faint ring of currentColor; --ui-border with data-ui-look="tray"` | Chip ring. |
|
|
60
|
+
|
|
61
|
+
## Accessibility
|
|
62
|
+
- A real <kbd>, read in place within the sentence.
|
|
63
|
+
- Glyphs are aria-hidden; visually hidden text spells the keys out ("Command Shift A").
|
|
64
|
+
- Not focusable; the app handles the shortcut itself.
|
|
65
|
+
- In forced-colors mode the chip gets a 1px system-color border.
|