@zeyos/zx 5.4.0 → 5.6.0

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 (145) hide show
  1. package/CHANGELOG.md +136 -0
  2. package/README.md +23 -16
  3. package/dist/types/components/agent-thread/agent-thread.d.ts +583 -0
  4. package/dist/types/components/app-sidebar/app-sidebar.d.ts +33 -0
  5. package/dist/types/components/approval-card/approval-card.d.ts +596 -0
  6. package/dist/types/components/avatar/avatar.d.ts +91 -4
  7. package/dist/types/components/badge/badge.d.ts +5 -4
  8. package/dist/types/components/block-view/block-view.d.ts +205 -0
  9. package/dist/types/components/composer/composer.d.ts +736 -0
  10. package/dist/types/components/datebox/date-range-box.d.ts +15 -2
  11. package/dist/types/components/datebox/datebox.d.ts +37 -3
  12. package/dist/types/components/kbd/kbd.d.ts +41 -0
  13. package/dist/types/components/launcher/launcher.d.ts +4 -2
  14. package/dist/types/components/prose/prose.d.ts +69 -0
  15. package/dist/types/components/questionnaire/questionnaire.d.ts +0 -36
  16. package/dist/types/components/run-status/run-status.d.ts +393 -0
  17. package/dist/types/components/run-trace/run-trace.d.ts +624 -0
  18. package/dist/types/components/source-list/source-list.d.ts +177 -0
  19. package/dist/types/components/stat-tile/stat-tile.d.ts +20 -0
  20. package/dist/types/components/tag-picker/tag-picker.d.ts +11 -5
  21. package/dist/types/components/tree/tree.d.ts +44 -3
  22. package/dist/types/core/icons.d.ts +22 -1
  23. package/dist/types/core/messages.d.ts +135 -0
  24. package/dist/types/index.d.ts +12 -2
  25. package/dist/types/internal/agent-model.d.ts +587 -0
  26. package/dist/types/internal/app-rail.d.ts +10 -3
  27. package/dist/types/internal/highlight.d.ts +24 -0
  28. package/dist/types/internal/presence-loop.d.ts +148 -0
  29. package/dist/types/internal/row-actions.d.ts +151 -0
  30. package/dist/zx-zeyos.esm.js +4852 -4535
  31. package/dist/zx-zeyos.esm.min.js +4 -4
  32. package/dist/zx.css +3152 -434
  33. package/dist/zx.esm.js +13730 -6595
  34. package/dist/zx.esm.min.js +27 -8
  35. package/dist/zx.global.js +13730 -6595
  36. package/dist/zx.global.min.js +27 -8
  37. package/dist/zx.min.css +1 -1
  38. package/docs/api.json +1474 -205
  39. package/docs/llms.md +698 -39
  40. package/docs/llms.txt +12 -1
  41. package/package.json +1 -1
  42. package/src/components/account-menu/account-menu.js +2 -2
  43. package/src/components/agent-thread/agent-thread.css +417 -0
  44. package/src/components/agent-thread/agent-thread.js +1365 -0
  45. package/src/components/app-rail/app-rail.css +11 -11
  46. package/src/components/app-sidebar/app-sidebar.css +90 -17
  47. package/src/components/app-sidebar/app-sidebar.js +120 -12
  48. package/src/components/approval-card/approval-card.css +289 -0
  49. package/src/components/approval-card/approval-card.js +1377 -0
  50. package/src/components/avatar/avatar.css +56 -1
  51. package/src/components/avatar/avatar.js +148 -26
  52. package/src/components/badge/badge.css +33 -20
  53. package/src/components/badge/badge.js +5 -4
  54. package/src/components/block-view/block-view.css +300 -0
  55. package/src/components/block-view/block-view.js +523 -0
  56. package/src/components/breadcrumb/breadcrumb.css +28 -3
  57. package/src/components/breadcrumb/breadcrumb.js +2 -2
  58. package/src/components/button/button.css +24 -13
  59. package/src/components/button/button.js +20 -2
  60. package/src/components/calendar/calendar.css +14 -4
  61. package/src/components/card-view/card-view.js +2 -2
  62. package/src/components/chart/chart.js +20 -5
  63. package/src/components/check-button/check-button.css +11 -3
  64. package/src/components/check-button/check-button.js +3 -3
  65. package/src/components/composer/composer.css +403 -0
  66. package/src/components/composer/composer.js +1441 -0
  67. package/src/components/context-menu/context-menu.css +7 -1
  68. package/src/components/date-picker/date-picker.css +6 -0
  69. package/src/components/date-picker/date-picker.js +5 -5
  70. package/src/components/date-picker/date-range-picker.css +6 -0
  71. package/src/components/date-picker/date-range-picker.js +3 -3
  72. package/src/components/date-picker/month-picker.js +3 -3
  73. package/src/components/date-picker/time-picker.css +6 -0
  74. package/src/components/datebox/date-range-box.js +30 -6
  75. package/src/components/datebox/datebox.js +44 -7
  76. package/src/components/dialog/dialog.css +0 -1
  77. package/src/components/dialog/dialog.js +2 -1
  78. package/src/components/dock/dock.js +2 -2
  79. package/src/components/dropdown/dropdown.css +2 -1
  80. package/src/components/entity-ref/entity-ref.css +8 -1
  81. package/src/components/file-item/file-item.css +1 -1
  82. package/src/components/finder/finder.js +2 -2
  83. package/src/components/groupbox/groupbox.js +2 -2
  84. package/src/components/kanban-view/kanban-view.css +8 -4
  85. package/src/components/kanban-view/kanban-view.js +3 -3
  86. package/src/components/kbd/kbd.css +64 -0
  87. package/src/components/kbd/kbd.js +121 -0
  88. package/src/components/launcher/launcher.css +30 -25
  89. package/src/components/launcher/launcher.js +15 -21
  90. package/src/components/list-toolbar/list-toolbar.css +7 -1
  91. package/src/components/menu-button/menu-button.css +9 -2
  92. package/src/components/message/message.js +2 -2
  93. package/src/components/module-bar/module-bar.css +11 -1
  94. package/src/components/multi-value-editor/multi-value-editor.js +4 -4
  95. package/src/components/navigation-bar/navigation-bar.css +3 -2
  96. package/src/components/pagination/pagination.js +2 -2
  97. package/src/components/panel/panel.js +2 -2
  98. package/src/components/prose/prose.css +53 -0
  99. package/src/components/prose/prose.js +152 -0
  100. package/src/components/questionnaire/questionnaire.css +7 -17
  101. package/src/components/questionnaire/questionnaire.js +16 -1
  102. package/src/components/rating/rating.css +3 -1
  103. package/src/components/run-status/run-status.css +208 -0
  104. package/src/components/run-status/run-status.js +782 -0
  105. package/src/components/run-trace/run-trace.css +443 -0
  106. package/src/components/run-trace/run-trace.js +1209 -0
  107. package/src/components/search/search.js +2 -2
  108. package/src/components/select/glyphs.js +3 -3
  109. package/src/components/select/select.css +35 -7
  110. package/src/components/select/select.js +4 -4
  111. package/src/components/source-list/source-list.css +208 -0
  112. package/src/components/source-list/source-list.js +355 -0
  113. package/src/components/stat-tile/stat-tile.css +56 -2
  114. package/src/components/stat-tile/stat-tile.js +25 -2
  115. package/src/components/stepper/stepper.css +2 -1
  116. package/src/components/stepper/stepper.js +3 -3
  117. package/src/components/tabbox/tabbox.css +2 -2
  118. package/src/components/tabbox/tabbox.js +2 -2
  119. package/src/components/table/table.css +52 -16
  120. package/src/components/table/table.js +7 -5
  121. package/src/components/tag-picker/tag-picker.css +56 -43
  122. package/src/components/tag-picker/tag-picker.js +21 -16
  123. package/src/components/tree/tree.css +44 -0
  124. package/src/components/tree/tree.js +97 -9
  125. package/src/components/value-list/value-list.css +25 -4
  126. package/src/components/value-list/value-list.js +2 -1
  127. package/src/components/view/record-view.js +3 -3
  128. package/src/components/view-settings/view-settings.css +2 -1
  129. package/src/components/workspace-switcher/workspace-switcher.js +3 -3
  130. package/src/core/icons.js +34 -3
  131. package/src/core/messages.js +143 -0
  132. package/src/elements/define.js +1 -0
  133. package/src/index.js +12 -2
  134. package/src/internal/agent-model.js +488 -0
  135. package/src/internal/app-rail.js +5 -1
  136. package/src/internal/highlight.js +104 -0
  137. package/src/internal/presence-loop.js +343 -0
  138. package/src/internal/row-actions.js +203 -0
  139. package/styles/base.css +26 -1
  140. package/styles/prose.css +306 -0
  141. package/styles/tokens/dark.css +97 -120
  142. package/styles/tokens/global.css +24 -9
  143. package/styles/tokens/semantic.css +464 -184
  144. package/styles/tokens/themes.css +9 -0
  145. package/styles/zx.css +10 -0
@@ -0,0 +1,121 @@
1
+ import { h } from '../../core/dom.js';
2
+
3
+ /**
4
+ * @typedef {Object} KbdOptions
5
+ * @property {'md'|'sm'} [size='md'] Keycap size; `sm` sits inside a button or a menu row.
6
+ * @property {'neutral'|'inherit'} [tone='neutral'] `inherit` draws the keycaps in the surrounding
7
+ * ink — on a solid primary button, a dark toast — instead of the neutral surface keycap.
8
+ */
9
+
10
+ /** Key names that become a glyph on Apple platforms and a word elsewhere. */
11
+ const MODIFIERS = Object.freeze({
12
+ mod: ['⌘', 'Ctrl'],
13
+ meta: ['⌘', 'Meta'],
14
+ cmd: ['⌘', 'Ctrl'],
15
+ command: ['⌘', 'Ctrl'],
16
+ ctrl: ['⌃', 'Ctrl'],
17
+ control: ['⌃', 'Ctrl'],
18
+ alt: ['⌥', 'Alt'],
19
+ option: ['⌥', 'Alt'],
20
+ shift: ['⇧', 'Shift'],
21
+ backspace: ['⌫', 'Backspace'],
22
+ delete: ['⌦', 'Del'],
23
+ tab: ['⇥', 'Tab']
24
+ });
25
+
26
+ /** Key names that read the same on every platform. */
27
+ const KEYS = Object.freeze({
28
+ enter: '↵',
29
+ return: '↵',
30
+ escape: 'Esc',
31
+ esc: 'Esc',
32
+ space: 'Space',
33
+ arrowup: '↑',
34
+ up: '↑',
35
+ arrowdown: '↓',
36
+ down: '↓',
37
+ arrowleft: '←',
38
+ left: '←',
39
+ arrowright: '→',
40
+ right: '→',
41
+ pageup: 'PgUp',
42
+ pagedown: 'PgDn',
43
+ home: 'Home',
44
+ end: 'End'
45
+ });
46
+
47
+ /** @returns {boolean} Whether the platform names its command modifier ⌘. */
48
+ function isApplePlatform() {
49
+ const nav = globalThis.navigator;
50
+ if (!nav) return false;
51
+ const platform = /** @type {{userAgentData?: {platform?: string}}} */ (nav).userAgentData?.platform || nav.platform || '';
52
+ return /mac|iphone|ipad|ios/i.test(platform);
53
+ }
54
+
55
+ /**
56
+ * Splits a chord such as `'Mod+Shift+K'` into its keys. A literal plus is written as the last key
57
+ * (`'Mod++'`) or on its own (`'+'`).
58
+ * @param {string} chord
59
+ * @returns {string[]}
60
+ */
61
+ function splitChord(chord) {
62
+ if (chord === '+') return ['+'];
63
+ const keys = chord.split('+');
64
+ if (chord.endsWith('++')) keys.splice(-2, 2, '+');
65
+ return keys.map((key) => key.trim()).filter((key) => key !== '');
66
+ }
67
+
68
+ /**
69
+ * The label a key is shown with: a platform glyph for a modifier or a named key, the upper-case
70
+ * character for a letter, and anything else as written.
71
+ * @param {string} key
72
+ * @param {boolean} apple
73
+ * @returns {string}
74
+ */
75
+ function keyLabel(key, apple) {
76
+ const name = key.toLowerCase();
77
+ if (Object.hasOwn(MODIFIERS, name)) return MODIFIERS[name][apple ? 0 : 1];
78
+ if (Object.hasOwn(KEYS, name)) return KEYS[name];
79
+ return key.length === 1 ? key.toUpperCase() : key;
80
+ }
81
+
82
+ /**
83
+ * The keycap labels `kbd()` draws for a chord or a list of keys, without building any DOM.
84
+ * @example
85
+ * keyLabels('Mod+Shift+K'); // ['⌘', '⇧', 'K'] on macOS, ['Ctrl', 'Shift', 'K'] elsewhere
86
+ * keyLabels('Mod+K', { apple: false }); // ['Ctrl', 'K']
87
+ * @param {string|string[]} keys A chord (`'Mod+Shift+K'`) or the key labels, in order.
88
+ * @param {{apple?: boolean}} [options] `apple` overrides the platform check.
89
+ * @returns {string[]}
90
+ */
91
+ export function keyLabels(keys, { apple = isApplePlatform() } = {}) {
92
+ const list = Array.isArray(keys) ? keys.map(String) : splitChord(String(keys));
93
+ return list.map((key) => keyLabel(key, apple));
94
+ }
95
+
96
+ /**
97
+ * Renders a key or key combination as keycaps: one `<kbd class="zx-kbd">` holding a nested
98
+ * `<kbd class="zx-kbd__key">` per key, which is how HTML marks up a combination. Every place that
99
+ * shows a shortcut — a button, a menu, the launcher's hints, a shortcut sheet — uses it, so keys
100
+ * look the same everywhere.
101
+ *
102
+ * The keycaps are presentation. A control that has a shortcut announces it with
103
+ * `aria-keyshortcuts` on the control itself; mark a hint that repeats it `aria-hidden`.
104
+ *
105
+ * @example
106
+ * kbd('Mod+K'); // ⌘ K on macOS, Ctrl K elsewhere
107
+ * kbd(['g', 'h']); // a sequence written as two caps
108
+ * kbd('Enter', { size: 'sm' });
109
+ * @param {string|string[]} keys A chord (`'Mod+Shift+K'`) or the key labels, in order.
110
+ * @param {KbdOptions} [options]
111
+ * @returns {HTMLElement}
112
+ */
113
+ export function kbd(keys, options = {}) {
114
+ return h('kbd', {
115
+ class: 'zx-kbd',
116
+ dataset: {
117
+ size: options.size === 'sm' ? 'sm' : undefined,
118
+ tone: options.tone === 'inherit' ? 'inherit' : undefined
119
+ }
120
+ }, keyLabels(keys).map((label) => h('kbd', { class: 'zx-kbd__key' }, label)));
121
+ }
@@ -2,7 +2,8 @@
2
2
  inline-size: min(760px, calc(100vw - (2 * var(--zx-space-4))));
3
3
  max-block-size: min(720px, calc(100vh - (2 * var(--zx-space-6))));
4
4
  border: 1px solid var(--zx-color-overlay-border);
5
- border-radius: var(--zx-radius-lg);
5
+ /* Concentric with the rows inside it: their corner plus the inset around them. */
6
+ border-radius: var(--zx-radius-panel);
6
7
  background-color: var(--zx-color-overlay-panel);
7
8
  background-image: var(--zx-overlay-panel-image);
8
9
  background-clip: padding-box;
@@ -97,23 +98,9 @@
97
98
 
98
99
  .zx-launcher__input::-webkit-search-cancel-button { display: none; }
99
100
 
100
- .zx-launcher__shortcut,
101
- .zx-launcher__hints kbd,
102
- .zx-launcher__key {
103
- border: 1px solid var(--zx-color-border-control);
104
- border-radius: var(--zx-radius-sm);
105
- background: var(--zx-color-bg-muted);
106
- color: var(--zx-color-text-muted);
107
- font-family: var(--zx-font-mono);
108
- font-size: var(--zx-text-xs);
109
- font-weight: 600;
110
- line-height: 1.5;
111
- }
112
-
101
+ /* The ⌘K reminder beside the query. Its keycaps are `kbd()`'s. */
113
102
  .zx-launcher__shortcut {
114
103
  flex: none;
115
- padding-inline: var(--zx-space-2);
116
- white-space: nowrap;
117
104
  }
118
105
 
119
106
  .zx-launcher__status {
@@ -179,6 +166,13 @@
179
166
  color: var(--zx-color-text);
180
167
  }
181
168
 
169
+ /* The row you are in, under the cursor or the pointer, is both: the current fill one step
170
+ stronger than either, still neutral. */
171
+ .zx-launcher__option[aria-current="page"][aria-selected="true"],
172
+ .zx-launcher__option[aria-current="page"]:hover {
173
+ background: color-mix(in srgb, var(--zx-color-text) 14%, transparent);
174
+ }
175
+
182
176
  .zx-launcher__option[aria-current="page"] .zx-launcher__label {
183
177
  font-weight: var(--zx-weight-semibold);
184
178
  }
@@ -198,6 +192,20 @@
198
192
  background: var(--zx-color-bg-current);
199
193
  }
200
194
 
195
+ .zx-launcher__option[data-kind="application"][aria-current="page"][aria-selected="true"],
196
+ .zx-launcher__option[data-kind="application"][aria-current="page"]:hover {
197
+ background: color-mix(in srgb, var(--zx-color-text) 14%, transparent);
198
+ }
199
+
200
+ @media (forced-colors: active) {
201
+ .zx-launcher__option[aria-current="page"][aria-selected="true"],
202
+ .zx-launcher__option[aria-current="page"]:hover,
203
+ .zx-launcher__option[data-kind="application"][aria-current="page"][aria-selected="true"],
204
+ .zx-launcher__option[data-kind="application"][aria-current="page"]:hover {
205
+ background: var(--zx-color-overlay-hover);
206
+ }
207
+ }
208
+
201
209
  .zx-launcher__option[data-kind="application"] .zx-launcher__icon {
202
210
  min-block-size: 36px;
203
211
  align-items: center;
@@ -227,7 +235,12 @@
227
235
  .zx-launcher__copy { display: grid; min-inline-size: 0; gap: 2px; }
228
236
  .zx-launcher__label { overflow: hidden; font-weight: var(--zx-weight-medium); text-overflow: ellipsis; white-space: nowrap; }
229
237
  .zx-launcher__description { overflow: hidden; color: var(--zx-color-text-muted); font-size: var(--zx-text-sm); text-overflow: ellipsis; white-space: nowrap; }
230
- .zx-launcher__badge { margin-inline-start: auto; color: var(--zx-color-text-muted); font-size: var(--zx-text-xs); }
238
+ .zx-launcher__badge {
239
+ margin-inline-start: auto;
240
+ color: var(--zx-color-text-muted);
241
+ font-size: var(--zx-text-xs);
242
+ font-variant-numeric: tabular-nums;
243
+ }
231
244
 
232
245
  /* A row's copy takes the room; what trails it (badge, hint, key caps, the page chevron) sits at
233
246
  the end in that order. */
@@ -247,7 +260,6 @@
247
260
  .zx-launcher__keys {
248
261
  display: inline-flex;
249
262
  flex: none;
250
- gap: var(--zx-space-1);
251
263
  }
252
264
 
253
265
  .zx-launcher__chevron {
@@ -285,13 +297,6 @@
285
297
 
286
298
  .zx-launcher__hints span[hidden] { display: none; }
287
299
 
288
- .zx-launcher__hints kbd,
289
- .zx-launcher__key {
290
- min-inline-size: 1.5rem;
291
- padding-inline: 4px;
292
- text-align: center;
293
- }
294
-
295
300
  @media (max-width: 520px) {
296
301
  .zx-launcher__group[data-layout="grid"] {
297
302
  grid-template-columns: repeat(3, minmax(0, 1fr));
@@ -1,10 +1,11 @@
1
1
  import { Component } from '../../core/component.js';
2
2
  import { h, safeHref } from '../../core/dom.js';
3
- import { icon } from '../../core/icons.js';
3
+ import { ICON_SIZE, icon } from '../../core/icons.js';
4
4
  import { printf } from '../../core/i18n.js';
5
5
  import { connectedOverlayHost, overlayScope } from '../../core/overlay-host.js';
6
6
  import { pushOverlay } from '../../core/overlay-stack.js';
7
7
  import { uid } from '../../core/util.js';
8
+ import { kbd } from '../kbd/kbd.js';
8
9
 
9
10
  /**
10
11
  * @typedef {Object} LauncherItem
@@ -17,7 +18,8 @@ import { uid } from '../../core/util.js';
17
18
  * @property {string|number} [badge] Compact metadata.
18
19
  * @property {string|number} [hint] Muted text at the end of the row, such as a current value or a project.
19
20
  * @property {string|string[]|{label: string|string[], keys?: string}} [shortcut] Key labels drawn as
20
- * key caps (`['⌘', 'K']`), or Button's `{label, keys}` shape. Display only: the Launcher binds nothing.
21
+ * key caps with `kbd()` (`['⌘', 'K']`; a name such as `'Mod'` or `'Shift'` takes the platform's
22
+ * glyph), or Button's `{label, keys}` shape. Display only: the Launcher binds nothing.
21
23
  * @property {string} [keys] The same shortcut in `aria-keyshortcuts` syntax (`'Meta+K'`), exposed on
22
24
  * the option for assistive technology.
23
25
  * @property {'application'|'record'|'action'} [kind='action'] Tile or row presentation.
@@ -214,7 +216,7 @@ export class Launcher extends Component {
214
216
  ref: 'scopeBack',
215
217
  class: 'zx-icon-btn zx-launcher__scope-back',
216
218
  type: 'button'
217
- }, icon('x'));
219
+ }, icon('x', { size: ICON_SIZE.dismiss }));
218
220
  const scope = h('span', { ref: 'scope', class: 'zx-launcher__scope', hidden: true },
219
221
  h('span', { ref: 'scopeLabel', class: 'zx-launcher__scope-label' }), scopeBack);
220
222
  const close = h('button', {
@@ -222,7 +224,7 @@ export class Launcher extends Component {
222
224
  class: 'zx-icon-btn zx-launcher__close',
223
225
  type: 'button',
224
226
  ariaLabel: this.options.closeLabel ?? this._message('launcher.close', 'Close launcher')
225
- }, icon('x'));
227
+ }, icon('x', { size: ICON_SIZE.dismiss }));
226
228
  const status = h('div', {
227
229
  ref: 'status',
228
230
  class: 'zx-launcher__status',
@@ -245,10 +247,9 @@ export class Launcher extends Component {
245
247
  role: 'listbox',
246
248
  ariaLabel: this.options.resultsLabel ?? this._message('launcher.results', 'Launcher results')
247
249
  });
248
- const shortcut = this.options.shortcut === 'mod+k' ? h('kbd', {
249
- class: 'zx-launcher__shortcut',
250
- ariaHidden: 'true'
251
- }, launcherShortcutLabel()) : null;
250
+ const shortcut = this.options.shortcut === 'mod+k'
251
+ ? h('span', { class: 'zx-launcher__shortcut', ariaHidden: 'true' }, kbd('Mod+K'))
252
+ : null;
252
253
  const footer = launcherHints(this.options.hints, {
253
254
  move: this._message('launcher.hintMove', 'Move'),
254
255
  open: this._message('launcher.hintOpen', 'Open'),
@@ -790,8 +791,8 @@ export class Launcher extends Component {
790
791
  const caps = launcherShortcutCaps(item.shortcut);
791
792
  // Drawn caps are part of the option's name unless `keys` already exposes the shortcut.
792
793
  if (caps.length) children.push(h('span', { class: 'zx-launcher__keys', ariaHidden: keys ? 'true' : null },
793
- caps.map((cap) => h('kbd', { class: 'zx-launcher__key' }, cap))));
794
- if (page) children.push(h('span', { class: 'zx-launcher__chevron', ariaHidden: 'true' }, icon('chevron-right')));
794
+ kbd(caps, { size: 'sm' })));
795
+ if (page) children.push(h('span', { class: 'zx-launcher__chevron', ariaHidden: 'true' }, icon('chevron-right', { size: ICON_SIZE.chevron })));
795
796
  return /** @type {HTMLElement} */ (h(tag, {
796
797
  class: 'zx-launcher__option',
797
798
  type: tag === 'button' ? 'button' : null,
@@ -995,13 +996,6 @@ export class Launcher extends Component {
995
996
  }
996
997
  }
997
998
 
998
- /** @returns {string} */
999
- function launcherShortcutLabel() {
1000
- const platform = String((/** @type {any} */ (navigator)).userAgentData?.platform
1001
- ?? navigator.platform ?? '');
1002
- return /mac|iphone|ipad/i.test(platform) ? '⌘ K' : 'Ctrl K';
1003
- }
1004
-
1005
999
  /**
1006
1000
  * @param {LauncherOptions['hints']} hints Host-supplied hint labels, or false to omit the row.
1007
1001
  * @param {{move: string, open: string, back: string, close: string}} defaults Resolved built-in labels.
@@ -1011,11 +1005,11 @@ function launcherHints(hints, defaults) {
1011
1005
  if (hints === false) return null;
1012
1006
  const labels = hints && typeof hints === 'object' ? hints : {};
1013
1007
  return h('footer', { class: 'zx-launcher__hints', ariaHidden: 'true' },
1014
- h('span', {}, h('kbd', {}, '↑↓←→'), labels.move ?? defaults.move),
1015
- h('span', {}, h('kbd', {}, '↵'), labels.open ?? defaults.open),
1008
+ h('span', {}, kbd(['↑↓←→']), labels.move ?? defaults.move),
1009
+ h('span', {}, kbd('Enter'), labels.open ?? defaults.open),
1016
1010
  // Shown only on a page (`_syncPage()`).
1017
- h('span', { ref: 'backHint', hidden: true }, h('kbd', {}, '⌫'), labels.back ?? defaults.back),
1018
- h('span', {}, h('kbd', {}, 'Esc'), labels.close ?? defaults.close));
1011
+ h('span', { ref: 'backHint', hidden: true }, kbd('Backspace'), labels.back ?? defaults.back),
1012
+ h('span', {}, kbd('Escape'), labels.close ?? defaults.close));
1019
1013
  }
1020
1014
 
1021
1015
  /**
@@ -109,6 +109,11 @@
109
109
  background: var(--zx-color-bg-current);
110
110
  }
111
111
 
112
+ /* Pointed at, a pressed tool keeps its fill and takes the hover step on top of it. */
113
+ .zx-list-toolbar__tool[aria-pressed="true"]:hover:not(:disabled) {
114
+ background: linear-gradient(var(--zx-color-bg-hover), var(--zx-color-bg-hover)), var(--zx-color-bg-current);
115
+ }
116
+
112
117
  .zx-list-toolbar__tool:disabled {
113
118
  color: var(--zx-color-text-placeholder);
114
119
  cursor: default;
@@ -134,7 +139,8 @@
134
139
  min-inline-size: 44px;
135
140
  padding-inline: var(--zx-space-2);
136
141
  border: 0;
137
- border-radius: calc(var(--zx-control-radius) - 2px);
142
+ /* Concentric with the frame: its corner less the 1px border and the 2px padding between them. */
143
+ border-radius: max(0px, calc(var(--zx-control-radius) - 3px));
138
144
  background: none;
139
145
  color: var(--zx-color-text-muted);
140
146
  font-size: var(--zx-control-font-size);
@@ -89,14 +89,20 @@
89
89
  padding-inline: var(--zx-space-1);
90
90
  color: var(--zx-color-text-muted);
91
91
  font-size: var(--zx-text-xs);
92
+ font-variant-numeric: tabular-nums;
92
93
  text-align: center;
93
94
  }
94
95
 
96
+ /* A shortcut is text at the right edge, no box — set the way a keycap's label is, so every key
97
+ hint in the library shares one type treatment. */
95
98
  .zx-menu-button__shortcut {
96
99
  border: 0;
97
100
  background: transparent;
98
101
  padding: 0;
99
- font-family: var(--zx-font-mono);
102
+ font-family: var(--zx-font-sans);
103
+ font-weight: var(--zx-weight-medium);
104
+ font-feature-settings: "case", "tnum";
105
+ white-space: nowrap;
100
106
  }
101
107
 
102
108
  .zx-menu-button__check {
@@ -152,7 +158,8 @@
152
158
  display: inline-flex;
153
159
  flex: none;
154
160
  gap: 2px;
155
- border-radius: var(--zx-radius-md);
161
+ /* The thumb's corner plus the 2px of track around it. */
162
+ border-radius: calc(var(--zx-radius-sm) + 2px);
156
163
  background: var(--zx-color-bg-hover);
157
164
  padding: 2px;
158
165
  }
@@ -1,6 +1,6 @@
1
1
  import { Component } from '../../core/component.js';
2
2
  import { h, resolveElement } from '../../core/dom.js';
3
- import { icon } from '../../core/icons.js';
3
+ import { ICON_SIZE, icon } from '../../core/icons.js';
4
4
  import { overlayScope } from '../../core/overlay-host.js';
5
5
  import { overlayStack } from '../../core/overlay-stack.js';
6
6
  import { button } from '../button/button.js';
@@ -422,7 +422,7 @@ export class Message extends Component {
422
422
  type: 'button',
423
423
  ariaLabel: this._message('message.close', 'Close message'),
424
424
  title: this._message('message.closeTitle', 'Close')
425
- }, icon('x', { size: 14 }));
425
+ }, icon('x', { size: ICON_SIZE.dismiss }));
426
426
  node.append(close);
427
427
  this.listen(close, 'click', () => this._close(entry));
428
428
  }
@@ -57,13 +57,23 @@
57
57
  block-size: auto;
58
58
  min-block-size: var(--zx-module-bar-target);
59
59
  padding: var(--zx-space-1) var(--zx-space-2);
60
- color: var(--zx-color-text);
60
+ /* The names rest one ink step under the content, as navigation does, and come up to the full
61
+ text colour when pointed at, focused, current, or open. */
62
+ color: var(--zx-color-text-chrome);
61
63
  font-size: var(--zx-text-md);
62
64
  font-weight: 500;
63
65
  line-height: 1.3;
64
66
  text-align: start;
65
67
  }
66
68
 
69
+ .zx-module-bar[data-labels="beside"] .zx-module-bar__item:is(:hover, :focus-visible, [aria-current], [aria-expanded="true"]):not([aria-disabled="true"]) {
70
+ color: var(--zx-color-text);
71
+ }
72
+
73
+ .zx-module-bar[data-labels="beside"] .zx-module-bar__item[aria-disabled="true"] {
74
+ color: var(--zx-color-text-muted);
75
+ }
76
+
67
77
  .zx-module-bar[data-labels="beside"] .zx-module-bar__label { text-align: start; }
68
78
 
69
79
  .zx-module-bar[data-labels="beside"] .zx-module-bar__badge {
@@ -1,6 +1,6 @@
1
1
  import { Component } from '../../core/component.js';
2
2
  import { h } from '../../core/dom.js';
3
- import { icon } from '../../core/icons.js';
3
+ import { ICON_SIZE, icon } from '../../core/icons.js';
4
4
 
5
5
  /**
6
6
  * @typedef {Object} MultiValueEditorOptions
@@ -153,20 +153,20 @@ export class MultiValueEditor extends Component {
153
153
  ariaDisabled: String(index === 0),
154
154
  ariaLabel: `Move value ${index + 1} up`,
155
155
  dataset: { action: 'up', index }
156
- }, icon('chevron-up', { size: 12 })) : null,
156
+ }, icon('chevron-up', { size: ICON_SIZE.chevron })) : null,
157
157
  buttons ? h('button', {
158
158
  class: 'zx-btn',
159
159
  type: 'button',
160
160
  ariaDisabled: String(index === last),
161
161
  ariaLabel: `Move value ${index + 1} down`,
162
162
  dataset: { action: 'down', index }
163
- }, icon('chevron-down', { size: 12 })) : null,
163
+ }, icon('chevron-down', { size: ICON_SIZE.chevron })) : null,
164
164
  h('button', {
165
165
  class: 'zx-btn',
166
166
  type: 'button',
167
167
  ariaLabel: `Remove value ${index + 1}`,
168
168
  dataset: { action: 'remove', index }
169
- }, icon('x', { size: 12 }))
169
+ }, icon('x', { size: ICON_SIZE.dismiss }))
170
170
  )
171
171
  );
172
172
  });
@@ -29,7 +29,7 @@
29
29
  padding-inline: var(--zx-space-2);
30
30
  color: var(--zx-color-accent);
31
31
  font-size: var(--zx-text-xl);
32
- font-weight: 650;
32
+ font-weight: var(--zx-weight-title);
33
33
  letter-spacing: var(--zx-tracking-title);
34
34
  }
35
35
 
@@ -61,7 +61,8 @@
61
61
  cursor: pointer;
62
62
  }
63
63
 
64
- .zx-navigation-bar__item:hover:not([aria-disabled="true"]) {
64
+ /* The current item is left out, so pointing at it never trades its fill for the lighter hover. */
65
+ .zx-navigation-bar__item:hover:not([aria-disabled="true"], [aria-current="page"], [aria-selected="true"]) {
65
66
  background: var(--zx-color-bg-hover);
66
67
  color: var(--zx-color-text);
67
68
  }
@@ -1,7 +1,7 @@
1
1
  import { Component } from '../../core/component.js';
2
2
  import { h, restoreTarget, snapshotTarget } from '../../core/dom.js';
3
3
  import { printf } from '../../core/i18n.js';
4
- import { icon } from '../../core/icons.js';
4
+ import { ICON_SIZE, icon } from '../../core/icons.js';
5
5
 
6
6
  /** @typedef {'pages'|'loadmore'} PaginationMode */
7
7
 
@@ -336,7 +336,7 @@ export class Pagination extends Component {
336
336
  ref,
337
337
  ariaLabel: label,
338
338
  dataset: { kind: 'default', size: 'sm' }
339
- }, icon(glyph, { size: 14 }));
339
+ }, icon(glyph, { size: ICON_SIZE.chevron }));
340
340
  }
341
341
 
342
342
  /** @returns {HTMLElement} The append-style trigger. */
@@ -1,6 +1,6 @@
1
1
  import { Component } from '../../core/component.js';
2
2
  import { h } from '../../core/dom.js';
3
- import { icon } from '../../core/icons.js';
3
+ import { ICON_SIZE, icon } from '../../core/icons.js';
4
4
  import { isElement, uid } from '../../core/util.js';
5
5
  import { button } from '../button/button.js';
6
6
 
@@ -83,7 +83,7 @@ export class Panel extends Component {
83
83
  toggleChildren.push(h('span', {
84
84
  class: 'zx-panel__chevron',
85
85
  ariaHidden: 'true'
86
- }, icon('chevron-right', { size: 16 })));
86
+ }, icon('chevron-right', { size: ICON_SIZE.chevron })));
87
87
  }
88
88
  toggleChildren.push(title);
89
89
 
@@ -0,0 +1,53 @@
1
+ /*
2
+ * Section links (`proseAnchors()`). A heading with an id ends in a small link to itself; the heading
3
+ * is the reveal host (base.css), so the link rests out of sight, keeps its room, and shows while the
4
+ * heading is pointed at or the link has focus — and always on a touch screen or under a contrast
5
+ * preference. The link is a square a little smaller than a control, sized so that a heading's line
6
+ * never grows to hold it.
7
+ */
8
+ .zx-prose__anchor {
9
+ --zx-prose-anchor-size: calc(var(--zx-control-height) - var(--zx-space-1) - 2px);
10
+ display: inline-grid;
11
+ place-items: center;
12
+ inline-size: var(--zx-prose-anchor-size);
13
+ block-size: var(--zx-prose-anchor-size);
14
+ margin-block: calc((1lh - var(--zx-prose-anchor-size)) / 2);
15
+ margin-inline-start: 0.2em;
16
+ border-radius: var(--zx-radius-sm);
17
+ color: var(--zx-color-text-muted);
18
+ text-decoration: none;
19
+ vertical-align: bottom;
20
+ transition: opacity var(--zx-dur-fast) var(--zx-ease), color var(--zx-dur-fast) var(--zx-ease);
21
+ }
22
+
23
+ .zx-prose__anchor:hover {
24
+ background: var(--zx-color-bg-hover);
25
+ color: var(--zx-color-text);
26
+ }
27
+
28
+ .zx-prose__anchor:focus-visible {
29
+ outline-color: transparent;
30
+ box-shadow: var(--zx-focus-ring);
31
+ }
32
+
33
+ .zx-prose__anchor[data-copied] {
34
+ color: var(--zx-color-success);
35
+ }
36
+
37
+ /* The confirmation is spoken, not drawn: the tick already shows it. */
38
+ .zx-prose__status {
39
+ position: absolute;
40
+ inset-block-start: 0;
41
+ inset-inline-start: 0;
42
+ clip-path: inset(50%);
43
+ inline-size: 1px;
44
+ block-size: 1px;
45
+ overflow: hidden;
46
+ white-space: nowrap;
47
+ }
48
+
49
+ @media print {
50
+ .zx-prose__anchor {
51
+ display: none;
52
+ }
53
+ }