@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.
- package/CHANGELOG.md +136 -0
- package/README.md +23 -16
- package/dist/types/components/agent-thread/agent-thread.d.ts +583 -0
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +33 -0
- package/dist/types/components/approval-card/approval-card.d.ts +596 -0
- package/dist/types/components/avatar/avatar.d.ts +91 -4
- package/dist/types/components/badge/badge.d.ts +5 -4
- package/dist/types/components/block-view/block-view.d.ts +205 -0
- package/dist/types/components/composer/composer.d.ts +736 -0
- package/dist/types/components/datebox/date-range-box.d.ts +15 -2
- package/dist/types/components/datebox/datebox.d.ts +37 -3
- package/dist/types/components/kbd/kbd.d.ts +41 -0
- package/dist/types/components/launcher/launcher.d.ts +4 -2
- package/dist/types/components/prose/prose.d.ts +69 -0
- package/dist/types/components/questionnaire/questionnaire.d.ts +0 -36
- package/dist/types/components/run-status/run-status.d.ts +393 -0
- package/dist/types/components/run-trace/run-trace.d.ts +624 -0
- package/dist/types/components/source-list/source-list.d.ts +177 -0
- package/dist/types/components/stat-tile/stat-tile.d.ts +20 -0
- package/dist/types/components/tag-picker/tag-picker.d.ts +11 -5
- package/dist/types/components/tree/tree.d.ts +44 -3
- package/dist/types/core/icons.d.ts +22 -1
- package/dist/types/core/messages.d.ts +135 -0
- package/dist/types/index.d.ts +12 -2
- package/dist/types/internal/agent-model.d.ts +587 -0
- package/dist/types/internal/app-rail.d.ts +10 -3
- package/dist/types/internal/highlight.d.ts +24 -0
- package/dist/types/internal/presence-loop.d.ts +148 -0
- package/dist/types/internal/row-actions.d.ts +151 -0
- package/dist/zx-zeyos.esm.js +4852 -4535
- package/dist/zx-zeyos.esm.min.js +4 -4
- package/dist/zx.css +3152 -434
- package/dist/zx.esm.js +13730 -6595
- package/dist/zx.esm.min.js +27 -8
- package/dist/zx.global.js +13730 -6595
- package/dist/zx.global.min.js +27 -8
- package/dist/zx.min.css +1 -1
- package/docs/api.json +1474 -205
- package/docs/llms.md +698 -39
- package/docs/llms.txt +12 -1
- package/package.json +1 -1
- package/src/components/account-menu/account-menu.js +2 -2
- package/src/components/agent-thread/agent-thread.css +417 -0
- package/src/components/agent-thread/agent-thread.js +1365 -0
- package/src/components/app-rail/app-rail.css +11 -11
- package/src/components/app-sidebar/app-sidebar.css +90 -17
- package/src/components/app-sidebar/app-sidebar.js +120 -12
- package/src/components/approval-card/approval-card.css +289 -0
- package/src/components/approval-card/approval-card.js +1377 -0
- package/src/components/avatar/avatar.css +56 -1
- package/src/components/avatar/avatar.js +148 -26
- package/src/components/badge/badge.css +33 -20
- package/src/components/badge/badge.js +5 -4
- package/src/components/block-view/block-view.css +300 -0
- package/src/components/block-view/block-view.js +523 -0
- package/src/components/breadcrumb/breadcrumb.css +28 -3
- package/src/components/breadcrumb/breadcrumb.js +2 -2
- package/src/components/button/button.css +24 -13
- package/src/components/button/button.js +20 -2
- package/src/components/calendar/calendar.css +14 -4
- package/src/components/card-view/card-view.js +2 -2
- package/src/components/chart/chart.js +20 -5
- package/src/components/check-button/check-button.css +11 -3
- package/src/components/check-button/check-button.js +3 -3
- package/src/components/composer/composer.css +403 -0
- package/src/components/composer/composer.js +1441 -0
- package/src/components/context-menu/context-menu.css +7 -1
- package/src/components/date-picker/date-picker.css +6 -0
- package/src/components/date-picker/date-picker.js +5 -5
- package/src/components/date-picker/date-range-picker.css +6 -0
- package/src/components/date-picker/date-range-picker.js +3 -3
- package/src/components/date-picker/month-picker.js +3 -3
- package/src/components/date-picker/time-picker.css +6 -0
- package/src/components/datebox/date-range-box.js +30 -6
- package/src/components/datebox/datebox.js +44 -7
- package/src/components/dialog/dialog.css +0 -1
- package/src/components/dialog/dialog.js +2 -1
- package/src/components/dock/dock.js +2 -2
- package/src/components/dropdown/dropdown.css +2 -1
- package/src/components/entity-ref/entity-ref.css +8 -1
- package/src/components/file-item/file-item.css +1 -1
- package/src/components/finder/finder.js +2 -2
- package/src/components/groupbox/groupbox.js +2 -2
- package/src/components/kanban-view/kanban-view.css +8 -4
- package/src/components/kanban-view/kanban-view.js +3 -3
- package/src/components/kbd/kbd.css +64 -0
- package/src/components/kbd/kbd.js +121 -0
- package/src/components/launcher/launcher.css +30 -25
- package/src/components/launcher/launcher.js +15 -21
- package/src/components/list-toolbar/list-toolbar.css +7 -1
- package/src/components/menu-button/menu-button.css +9 -2
- package/src/components/message/message.js +2 -2
- package/src/components/module-bar/module-bar.css +11 -1
- package/src/components/multi-value-editor/multi-value-editor.js +4 -4
- package/src/components/navigation-bar/navigation-bar.css +3 -2
- package/src/components/pagination/pagination.js +2 -2
- package/src/components/panel/panel.js +2 -2
- package/src/components/prose/prose.css +53 -0
- package/src/components/prose/prose.js +152 -0
- package/src/components/questionnaire/questionnaire.css +7 -17
- package/src/components/questionnaire/questionnaire.js +16 -1
- package/src/components/rating/rating.css +3 -1
- package/src/components/run-status/run-status.css +208 -0
- package/src/components/run-status/run-status.js +782 -0
- package/src/components/run-trace/run-trace.css +443 -0
- package/src/components/run-trace/run-trace.js +1209 -0
- package/src/components/search/search.js +2 -2
- package/src/components/select/glyphs.js +3 -3
- package/src/components/select/select.css +35 -7
- package/src/components/select/select.js +4 -4
- package/src/components/source-list/source-list.css +208 -0
- package/src/components/source-list/source-list.js +355 -0
- package/src/components/stat-tile/stat-tile.css +56 -2
- package/src/components/stat-tile/stat-tile.js +25 -2
- package/src/components/stepper/stepper.css +2 -1
- package/src/components/stepper/stepper.js +3 -3
- package/src/components/tabbox/tabbox.css +2 -2
- package/src/components/tabbox/tabbox.js +2 -2
- package/src/components/table/table.css +52 -16
- package/src/components/table/table.js +7 -5
- package/src/components/tag-picker/tag-picker.css +56 -43
- package/src/components/tag-picker/tag-picker.js +21 -16
- package/src/components/tree/tree.css +44 -0
- package/src/components/tree/tree.js +97 -9
- package/src/components/value-list/value-list.css +25 -4
- package/src/components/value-list/value-list.js +2 -1
- package/src/components/view/record-view.js +3 -3
- package/src/components/view-settings/view-settings.css +2 -1
- package/src/components/workspace-switcher/workspace-switcher.js +3 -3
- package/src/core/icons.js +34 -3
- package/src/core/messages.js +143 -0
- package/src/elements/define.js +1 -0
- package/src/index.js +12 -2
- package/src/internal/agent-model.js +488 -0
- package/src/internal/app-rail.js +5 -1
- package/src/internal/highlight.js +104 -0
- package/src/internal/presence-loop.js +343 -0
- package/src/internal/row-actions.js +203 -0
- package/styles/base.css +26 -1
- package/styles/prose.css +306 -0
- package/styles/tokens/dark.css +97 -120
- package/styles/tokens/global.css +24 -9
- package/styles/tokens/semantic.css +464 -184
- package/styles/tokens/themes.css +9 -0
- package/styles/zx.css +10 -0
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { h } from '../../core/dom.js';
|
|
2
2
|
import { icon as createIcon } from '../../core/icons.js';
|
|
3
|
+
import { kbd } from '../kbd/kbd.js';
|
|
3
4
|
import { spinner } from '../loading/spinner.js';
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {{label:string,keys:string}} ButtonShortcut Visible hint and ARIA key combination; the
|
|
8
|
+
* host binds the action. `label` is drawn as keycaps by `kbd()` — a chord such as `'Mod+K'`
|
|
9
|
+
* shows the platform's glyphs — and `keys` goes to `aria-keyshortcuts` as written.
|
|
10
|
+
*/
|
|
6
11
|
|
|
7
12
|
/**
|
|
8
13
|
* @typedef {Object} ButtonOptions
|
|
@@ -52,7 +57,7 @@ export function button(opts = {}) {
|
|
|
52
57
|
if (options.label !== '') {
|
|
53
58
|
element.append(h('span', { class: 'zx-btn__label' }, String(options.label)));
|
|
54
59
|
}
|
|
55
|
-
if (options.shortcut) element.append(
|
|
60
|
+
if (options.shortcut) element.append(shortcutHint(options.shortcut.label));
|
|
56
61
|
if (!options.label && options.title) element.setAttribute('aria-label', options.title);
|
|
57
62
|
if (typeof options.onclick === 'function') element.onclick = options.onclick;
|
|
58
63
|
if (options.busy) setButtonBusy(element, true);
|
|
@@ -107,6 +112,19 @@ export function setButtonBusy(element, busy) {
|
|
|
107
112
|
return element;
|
|
108
113
|
}
|
|
109
114
|
|
|
115
|
+
/**
|
|
116
|
+
* The visible key hint: small keycaps, hidden from assistive technology because the button
|
|
117
|
+
* already announces its shortcut through `aria-keyshortcuts` and its title.
|
|
118
|
+
* @param {string} label Key or chord to draw.
|
|
119
|
+
* @returns {HTMLElement}
|
|
120
|
+
*/
|
|
121
|
+
function shortcutHint(label) {
|
|
122
|
+
const hint = kbd(String(label), { size: 'sm' });
|
|
123
|
+
hint.classList.add('zx-btn__shortcut');
|
|
124
|
+
hint.setAttribute('aria-hidden', 'true');
|
|
125
|
+
return hint;
|
|
126
|
+
}
|
|
127
|
+
|
|
110
128
|
/** @param {unknown} value @returns {'default'|'primary'|'danger'|'ghost'} */
|
|
111
129
|
function normalizeKind(value) {
|
|
112
130
|
return ['primary', 'danger', 'ghost'].includes(String(value)) ?
|
|
@@ -77,7 +77,8 @@
|
|
|
77
77
|
block-size: 100%;
|
|
78
78
|
min-block-size: 0;
|
|
79
79
|
border-color: transparent;
|
|
80
|
-
|
|
80
|
+
/* Concentric with the view switch's frame: its corner less the 1px border and 2px padding. */
|
|
81
|
+
border-radius: max(0px, calc(var(--zx-control-radius) - 3px));
|
|
81
82
|
background: transparent;
|
|
82
83
|
color: var(--zx-color-text-muted);
|
|
83
84
|
padding-inline: var(--zx-space-3);
|
|
@@ -100,7 +101,11 @@
|
|
|
100
101
|
font-weight: var(--zx-weight-medium);
|
|
101
102
|
}
|
|
102
103
|
|
|
103
|
-
|
|
104
|
+
/* A toolbar button's hover is laid over its control fill, so it still shows in dark where both are
|
|
105
|
+
a few percent of white; a view button sits on the frame and takes the hover fill alone. */
|
|
106
|
+
.zx-calendar__toolbar-button:hover:not(:disabled) {
|
|
107
|
+
background: linear-gradient(var(--zx-color-bg-hover), var(--zx-color-bg-hover)), var(--zx-color-bg-control);
|
|
108
|
+
}
|
|
104
109
|
.zx-calendar__view-button:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--zx-color-bg-hover); }
|
|
105
110
|
.zx-calendar__new:hover:not(:disabled) { border-color: var(--zx-color-accent-solid-hover); background: var(--zx-color-accent-solid-hover); }
|
|
106
111
|
.zx-calendar button:disabled { cursor: default; opacity: .55; }
|
|
@@ -122,6 +127,11 @@
|
|
|
122
127
|
box-shadow: var(--zx-focus-ring);
|
|
123
128
|
}
|
|
124
129
|
|
|
130
|
+
/* A solid accent under the accent ring: an inner line in its own ink keeps them apart. */
|
|
131
|
+
.zx-calendar__new:focus-visible {
|
|
132
|
+
box-shadow: inset 0 0 0 1px var(--zx-color-on-accent-solid), var(--zx-focus-ring);
|
|
133
|
+
}
|
|
134
|
+
|
|
125
135
|
.zx-calendar__heading {
|
|
126
136
|
min-inline-size: 0;
|
|
127
137
|
margin: 0;
|
|
@@ -179,7 +189,7 @@
|
|
|
179
189
|
|
|
180
190
|
.zx-calendar__day-heading:last-child { border-inline-end: 0; }
|
|
181
191
|
.zx-calendar__day-heading:hover:not(:disabled) { background: var(--zx-color-bg-hover); }
|
|
182
|
-
.zx-calendar__day-heading[aria-current="date"] .zx-calendar__day-number { color: var(--zx-color-accent); font-weight:
|
|
192
|
+
.zx-calendar__day-heading[aria-current="date"] .zx-calendar__day-number { color: var(--zx-color-accent); font-weight: var(--zx-weight-title); }
|
|
183
193
|
.zx-calendar__day-weekday { color: var(--zx-color-text-muted); font-size: var(--zx-text-xs); font-weight: var(--zx-weight-medium); }
|
|
184
194
|
.zx-calendar__day-number { font-size: var(--zx-text-sm); }
|
|
185
195
|
|
|
@@ -503,7 +513,7 @@
|
|
|
503
513
|
.zx-calendar__month-day[data-other-month="true"] { color: var(--zx-color-text-muted); background: var(--zx-color-bg-muted); }
|
|
504
514
|
.zx-calendar__month-day[aria-current="date"] {
|
|
505
515
|
color: var(--zx-color-accent);
|
|
506
|
-
font-weight:
|
|
516
|
+
font-weight: var(--zx-weight-title);
|
|
507
517
|
}
|
|
508
518
|
.zx-calendar__month-day:hover:not(:disabled) { background: var(--zx-color-bg-hover); }
|
|
509
519
|
.zx-calendar__month-events {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import { h, restoreTarget, snapshotTarget } from '../../core/dom.js';
|
|
3
|
-
import { icon } from '../../core/icons.js';
|
|
3
|
+
import { ICON_SIZE, icon } from '../../core/icons.js';
|
|
4
4
|
import { uid } from '../../core/util.js';
|
|
5
5
|
import { normalizeViewFieldControls, RecordView, readViewField } from '../view/record-view.js';
|
|
6
6
|
import {
|
|
@@ -486,7 +486,7 @@ export class CardView extends RecordView {
|
|
|
486
486
|
ariaExpanded: String(!collapsed),
|
|
487
487
|
ariaControls: `${headingId}-list`,
|
|
488
488
|
dataset: { groupToggle: '' }
|
|
489
|
-
}, icon('chevron-down', { size:
|
|
489
|
+
}, icon('chevron-down', { size: ICON_SIZE.chevron }), labelNode) : labelNode;
|
|
490
490
|
const heading = h('h2', { class: 'zx-card-view__group-heading', id: headingId }, content);
|
|
491
491
|
const header = h('div', {
|
|
492
492
|
class: 'zx-card-view__group-header',
|
|
@@ -514,15 +514,30 @@ function summaryValue(value) {
|
|
|
514
514
|
/** @param {HTMLElement} root @returns {Record<string, unknown>} */
|
|
515
515
|
function themeChartOptions(root) {
|
|
516
516
|
if (typeof getComputedStyle !== 'function') return {};
|
|
517
|
-
const style = getComputedStyle(root);
|
|
518
|
-
const color = style.getPropertyValue('--zx-color-text').trim();
|
|
519
|
-
const borderColor = style.getPropertyValue('--zx-color-border').trim();
|
|
520
517
|
return {
|
|
521
|
-
color: color
|
|
522
|
-
borderColor:
|
|
518
|
+
color: themeColour(root, '--zx-color-text'),
|
|
519
|
+
borderColor: themeColour(root, '--zx-color-border')
|
|
523
520
|
};
|
|
524
521
|
}
|
|
525
522
|
|
|
523
|
+
/**
|
|
524
|
+
* A colour token as the chart root paints it. The token's text may be a `light-dark()` pair, which
|
|
525
|
+
* only an element can resolve (it takes that element's colour scheme) and a canvas cannot parse, so
|
|
526
|
+
* the colour is read back from a hidden probe inside the root.
|
|
527
|
+
* @param {HTMLElement} root
|
|
528
|
+
* @param {string} token
|
|
529
|
+
* @returns {string | undefined} The computed colour, or undefined where the token is not defined.
|
|
530
|
+
*/
|
|
531
|
+
function themeColour(root, token) {
|
|
532
|
+
if (!getComputedStyle(root).getPropertyValue(token).trim()) return undefined;
|
|
533
|
+
const probe = h('span', { hidden: true });
|
|
534
|
+
probe.style.color = `var(${token})`;
|
|
535
|
+
root.append(probe);
|
|
536
|
+
const colour = getComputedStyle(probe).color;
|
|
537
|
+
probe.remove();
|
|
538
|
+
return colour || undefined;
|
|
539
|
+
}
|
|
540
|
+
|
|
526
541
|
/** @param {unknown} error @param {unknown} fallback @returns {string} */
|
|
527
542
|
function errorMessage(error, fallback) {
|
|
528
543
|
const message = error && typeof error === 'object' && 'message' in error ? String(error.message) : '';
|
|
@@ -15,19 +15,27 @@
|
|
|
15
15
|
cursor: pointer;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
/* The hover fill is laid over the button's own fill rather than swapped in for it: in dark both
|
|
19
|
+
the control fill and the hover step are a few percent of white, and a swap would show nothing. */
|
|
18
20
|
.zx-check-button:hover:not(:disabled) {
|
|
19
|
-
background: var(--zx-color-bg-hover);
|
|
21
|
+
background: linear-gradient(var(--zx-color-bg-hover), var(--zx-color-bg-hover)), var(--zx-color-bg-control);
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
/* Pressed is a state the button is in, so the button itself goes neutral — the current fill, a
|
|
23
25
|
stronger border, the full text colour — and only the check glyph, which is the mark, keeps the
|
|
24
|
-
accent, as a checkbox would.
|
|
26
|
+
accent, as a checkbox would. The current fill is laid over the control fill too, so pressed
|
|
27
|
+
stays a step above hover in dark; pointed at, it keeps that fill and takes the hover on top. */
|
|
25
28
|
.zx-check-button[aria-pressed="true"] {
|
|
26
29
|
border-color: var(--zx-color-border-strong);
|
|
27
|
-
background: var(--zx-color-bg-current);
|
|
30
|
+
background: linear-gradient(var(--zx-color-bg-current), var(--zx-color-bg-current)), var(--zx-color-bg-control);
|
|
28
31
|
color: var(--zx-color-text);
|
|
29
32
|
}
|
|
30
33
|
|
|
34
|
+
.zx-check-button[aria-pressed="true"]:hover:not(:disabled) {
|
|
35
|
+
background: linear-gradient(var(--zx-color-bg-hover), var(--zx-color-bg-hover)),
|
|
36
|
+
linear-gradient(var(--zx-color-bg-current), var(--zx-color-bg-current)), var(--zx-color-bg-control);
|
|
37
|
+
}
|
|
38
|
+
|
|
31
39
|
.zx-check-button__on {
|
|
32
40
|
color: var(--zx-color-accent);
|
|
33
41
|
}
|
|
@@ -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} CheckButtonOptions
|
|
@@ -47,8 +47,8 @@ export class CheckButton extends Component {
|
|
|
47
47
|
// Both states carry a glyph — an empty box when off, a check when on — so the control still
|
|
48
48
|
// reads as a two-state control while pressed, unpressed, or disabled.
|
|
49
49
|
children.push(h('span', { class: 'zx-check-button__icon', ariaHidden: 'true' },
|
|
50
|
-
h('span', { class: 'zx-check-button__off' }, icon('square', { size:
|
|
51
|
-
h('span', { class: 'zx-check-button__on' }, icon('check', { size:
|
|
50
|
+
h('span', { class: 'zx-check-button__off' }, icon('square', { size: ICON_SIZE.check })),
|
|
51
|
+
h('span', { class: 'zx-check-button__on' }, icon('check', { size: ICON_SIZE.check }))));
|
|
52
52
|
}
|
|
53
53
|
children.push(h('span', { class: 'zx-check-button__label', ref: 'label' }));
|
|
54
54
|
root.replaceChildren(...children);
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Composer — the message box of an agent conversation. A filled box on the chrome tone with no
|
|
3
|
+
* frame of its own: the context and attachment chips, the text, and a bar of quiet tools ending in
|
|
4
|
+
* Send. Focus in the text rings the whole box. The `@` suggestions open above it, in the top layer.
|
|
5
|
+
*/
|
|
6
|
+
.zx-composer {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: grid;
|
|
9
|
+
gap: var(--zx-space-2);
|
|
10
|
+
min-inline-size: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.zx-composer__frame {
|
|
14
|
+
position: relative;
|
|
15
|
+
display: grid;
|
|
16
|
+
gap: var(--zx-space-1);
|
|
17
|
+
min-inline-size: 0;
|
|
18
|
+
padding: var(--zx-space-2) var(--zx-space-3);
|
|
19
|
+
border-radius: var(--zx-radius-lg);
|
|
20
|
+
background: var(--zx-color-bg-chrome);
|
|
21
|
+
color: var(--zx-color-text);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.zx-composer__frame:has(.zx-composer__input:focus) {
|
|
25
|
+
box-shadow: var(--zx-focus-ring);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.zx-composer[aria-disabled="true"] .zx-composer__frame {
|
|
29
|
+
opacity: 0.6;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* ------------------------------------------------------------------ text -- */
|
|
33
|
+
|
|
34
|
+
.zx-composer .zx-composer__input {
|
|
35
|
+
display: block;
|
|
36
|
+
inline-size: 100%;
|
|
37
|
+
min-block-size: 0;
|
|
38
|
+
margin: 0;
|
|
39
|
+
padding: var(--zx-space-1);
|
|
40
|
+
overflow-y: hidden;
|
|
41
|
+
border: 0;
|
|
42
|
+
border-radius: 0;
|
|
43
|
+
background: transparent;
|
|
44
|
+
box-shadow: none;
|
|
45
|
+
color: inherit;
|
|
46
|
+
font: inherit;
|
|
47
|
+
font-size: var(--zx-text-md);
|
|
48
|
+
line-height: 1.5;
|
|
49
|
+
resize: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.zx-composer .zx-composer__input[data-scrolls="true"] {
|
|
53
|
+
overflow-y: auto;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.zx-composer .zx-composer__input::placeholder {
|
|
57
|
+
color: var(--zx-color-text-placeholder);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* The box draws the ring; the text inside it draws none of its own. */
|
|
61
|
+
.zx-composer .zx-composer__input:is(:focus, :focus-visible) {
|
|
62
|
+
outline-color: transparent;
|
|
63
|
+
box-shadow: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.zx-composer .zx-composer__input:disabled {
|
|
67
|
+
cursor: not-allowed;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* ------------------------------------------------------------------- bar -- */
|
|
71
|
+
|
|
72
|
+
/* The bar is the container its own narrow form asks about: the composer itself may sit in a
|
|
73
|
+
shrink-to-fit parent, the bar always spans the box. */
|
|
74
|
+
.zx-composer__bar {
|
|
75
|
+
container: zx-composer-bar / inline-size;
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: var(--zx-space-1);
|
|
79
|
+
min-inline-size: 0;
|
|
80
|
+
margin-inline-start: calc(-1 * var(--zx-space-1));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.zx-composer__tools {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex: none;
|
|
86
|
+
align-items: center;
|
|
87
|
+
gap: var(--zx-space-1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.zx-composer__tools[hidden] {
|
|
91
|
+
display: none;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.zx-composer__spacer {
|
|
95
|
+
flex: 1 1 auto;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.zx-composer__hint {
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
min-inline-size: 0;
|
|
101
|
+
padding-inline-start: var(--zx-space-1);
|
|
102
|
+
color: var(--zx-color-text-muted);
|
|
103
|
+
font-size: var(--zx-text-xs);
|
|
104
|
+
text-overflow: ellipsis;
|
|
105
|
+
white-space: nowrap;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* The tools are quiet glyphs until they are pointed at. */
|
|
109
|
+
.zx-composer .zx-composer__tool > .zx-icon {
|
|
110
|
+
color: var(--zx-color-text-subtle);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.zx-composer .zx-composer__tool:hover:not(:disabled) > .zx-icon {
|
|
114
|
+
color: var(--zx-color-text);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.zx-composer .zx-composer__tool:disabled > .zx-icon {
|
|
118
|
+
color: var(--zx-color-text-placeholder);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* A pressed tool is a mode the next message is sent in: the neutral current fill, an edge, and the
|
|
122
|
+
full glyph colour, so the state never rests on colour alone. */
|
|
123
|
+
.zx-composer .zx-composer__tool[aria-pressed="true"] {
|
|
124
|
+
background: var(--zx-color-bg-current);
|
|
125
|
+
box-shadow: inset 0 0 0 1px var(--zx-color-border-strong);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.zx-composer .zx-composer__tool[aria-pressed="true"] > .zx-icon {
|
|
129
|
+
color: var(--zx-color-text);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.zx-composer .zx-composer__tool[aria-pressed="true"]:hover:not(:disabled) {
|
|
133
|
+
background: linear-gradient(var(--zx-color-bg-hover), var(--zx-color-bg-hover)), var(--zx-color-bg-current);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.zx-composer .zx-composer__tool[aria-pressed="true"]:focus-visible {
|
|
137
|
+
box-shadow: inset var(--zx-focus-ring);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Send is a neutral square until there is something to send; then it is the accent. Stop takes
|
|
141
|
+
its place while the agent works. */
|
|
142
|
+
.zx-composer .zx-composer__send {
|
|
143
|
+
flex: none;
|
|
144
|
+
inline-size: var(--zx-control-height);
|
|
145
|
+
block-size: var(--zx-control-height);
|
|
146
|
+
border-radius: var(--zx-radius-lg);
|
|
147
|
+
background: var(--zx-color-bg-current);
|
|
148
|
+
color: var(--zx-color-text);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.zx-composer .zx-composer__send:hover {
|
|
152
|
+
background: var(--zx-color-bg-current);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.zx-composer .zx-composer__send[aria-disabled="true"],
|
|
156
|
+
.zx-composer .zx-composer__send:disabled {
|
|
157
|
+
color: var(--zx-color-text-placeholder);
|
|
158
|
+
cursor: default;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.zx-composer .zx-composer__send[data-mode="send"][aria-disabled="false"]:not(:disabled) {
|
|
162
|
+
background: var(--zx-color-accent-solid);
|
|
163
|
+
color: var(--zx-color-on-accent-solid);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.zx-composer .zx-composer__send[data-mode="send"][aria-disabled="false"]:not(:disabled):hover {
|
|
167
|
+
background: var(--zx-color-accent-solid-hover);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.zx-composer .zx-composer__send[data-mode="stop"] > .zx-icon {
|
|
171
|
+
fill: currentColor;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.zx-composer .zx-composer__send:focus-visible {
|
|
175
|
+
outline-color: transparent;
|
|
176
|
+
box-shadow: var(--zx-focus-ring);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* A solid accent under the accent ring: an inner line in its own ink keeps them apart. */
|
|
180
|
+
.zx-composer .zx-composer__send[data-mode="send"][aria-disabled="false"]:focus-visible {
|
|
181
|
+
box-shadow: inset 0 0 0 1px var(--zx-color-on-accent-solid), var(--zx-focus-ring);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* `sendLabel`: the glyph and a word ("Start task", "Stop" while busy). */
|
|
185
|
+
.zx-composer .zx-composer__send:has(> .zx-composer__send-label) {
|
|
186
|
+
display: inline-flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
gap: var(--zx-space-2);
|
|
190
|
+
inline-size: auto;
|
|
191
|
+
max-inline-size: 100%;
|
|
192
|
+
padding-inline: var(--zx-space-3);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.zx-composer__send-label {
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
font-size: var(--zx-control-font-size);
|
|
198
|
+
font-weight: var(--zx-control-font-weight);
|
|
199
|
+
text-overflow: ellipsis;
|
|
200
|
+
white-space: nowrap;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* In a narrow composer — a phone, a side column — Send goes back to its square: the word is drawn
|
|
204
|
+
no more but stays the button's name, and its tooltip. */
|
|
205
|
+
@container zx-composer-bar (inline-size < 24rem) {
|
|
206
|
+
.zx-composer .zx-composer__send:has(> .zx-composer__send-label) {
|
|
207
|
+
inline-size: var(--zx-control-height);
|
|
208
|
+
padding-inline: 0;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.zx-composer__send-label {
|
|
212
|
+
position: absolute;
|
|
213
|
+
inline-size: 1px;
|
|
214
|
+
block-size: 1px;
|
|
215
|
+
overflow: hidden;
|
|
216
|
+
clip-path: inset(50%);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/* ----------------------------------------------------------------- chips -- */
|
|
221
|
+
|
|
222
|
+
.zx-composer__chips {
|
|
223
|
+
display: flex;
|
|
224
|
+
flex-wrap: wrap;
|
|
225
|
+
gap: var(--zx-space-2);
|
|
226
|
+
margin: 0;
|
|
227
|
+
padding: var(--zx-space-1) 0 0;
|
|
228
|
+
list-style: none;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.zx-composer__chips[hidden] {
|
|
232
|
+
display: none;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.zx-composer__chip {
|
|
236
|
+
display: inline-flex;
|
|
237
|
+
align-items: center;
|
|
238
|
+
gap: var(--zx-space-2);
|
|
239
|
+
max-inline-size: 100%;
|
|
240
|
+
min-block-size: calc(var(--zx-control-height) - var(--zx-space-1));
|
|
241
|
+
padding-inline: var(--zx-space-2) var(--zx-space-1);
|
|
242
|
+
border: 1px solid var(--zx-color-border-subtle);
|
|
243
|
+
border-radius: var(--zx-radius-md);
|
|
244
|
+
background: var(--zx-color-bg-surface);
|
|
245
|
+
font-size: var(--zx-text-sm);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* What the message is about reads as the accent's quiet tint; files stay on the surface. */
|
|
249
|
+
.zx-composer__chip[data-kind="context"] {
|
|
250
|
+
border-color: transparent;
|
|
251
|
+
background: var(--zx-color-accent-subtle);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.zx-composer__chip > .zx-icon {
|
|
255
|
+
flex: none;
|
|
256
|
+
color: var(--zx-color-text-subtle);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.zx-composer__chip-label {
|
|
260
|
+
overflow: hidden;
|
|
261
|
+
min-inline-size: 0;
|
|
262
|
+
text-overflow: ellipsis;
|
|
263
|
+
white-space: nowrap;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.zx-composer__chip-meta {
|
|
267
|
+
flex: none;
|
|
268
|
+
color: var(--zx-color-text-muted);
|
|
269
|
+
font-size: var(--zx-text-xs);
|
|
270
|
+
font-variant-numeric: tabular-nums;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.zx-composer .zx-composer__remove {
|
|
274
|
+
inline-size: calc(var(--zx-control-height) - var(--zx-space-2));
|
|
275
|
+
block-size: calc(var(--zx-control-height) - var(--zx-space-2));
|
|
276
|
+
border-radius: var(--zx-radius-sm);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* -------------------------------------------------------------- dropping -- */
|
|
280
|
+
|
|
281
|
+
.zx-composer__drop {
|
|
282
|
+
position: absolute;
|
|
283
|
+
inset: 0;
|
|
284
|
+
display: none;
|
|
285
|
+
place-items: center;
|
|
286
|
+
align-content: center;
|
|
287
|
+
gap: var(--zx-space-1);
|
|
288
|
+
border-radius: inherit;
|
|
289
|
+
background: var(--zx-color-accent-subtle);
|
|
290
|
+
box-shadow: inset 0 0 0 1px var(--zx-color-accent);
|
|
291
|
+
color: var(--zx-color-accent);
|
|
292
|
+
font-size: var(--zx-text-sm);
|
|
293
|
+
font-weight: var(--zx-weight-medium);
|
|
294
|
+
pointer-events: none;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.zx-composer[data-state="dropping"] .zx-composer__drop {
|
|
298
|
+
display: grid;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/* ------------------------------------------------------------------ note -- */
|
|
302
|
+
|
|
303
|
+
.zx-composer__note {
|
|
304
|
+
margin: 0;
|
|
305
|
+
color: var(--zx-color-text-muted);
|
|
306
|
+
font-size: var(--zx-text-xs);
|
|
307
|
+
text-align: center;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* ----------------------------------------------------------- suggestions -- */
|
|
311
|
+
|
|
312
|
+
.zx-composer__suggestions {
|
|
313
|
+
display: grid;
|
|
314
|
+
gap: 2px;
|
|
315
|
+
inline-size: min(22rem, calc(100vw - var(--zx-space-4)));
|
|
316
|
+
max-block-size: min(18rem, 45vh);
|
|
317
|
+
overflow: auto;
|
|
318
|
+
overscroll-behavior: contain;
|
|
319
|
+
padding: var(--zx-space-1);
|
|
320
|
+
border: 1px solid var(--zx-color-overlay-border);
|
|
321
|
+
border-radius: var(--zx-radius-panel);
|
|
322
|
+
background-color: var(--zx-color-overlay-surface);
|
|
323
|
+
background-clip: padding-box;
|
|
324
|
+
box-shadow: var(--zx-overlay-shadow);
|
|
325
|
+
color: var(--zx-color-text);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.zx-composer__suggestions[hidden] {
|
|
329
|
+
display: none;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
@media (prefers-reduced-transparency: reduce) {
|
|
333
|
+
.zx-composer__suggestions {
|
|
334
|
+
border-color: var(--zx-color-border-strong);
|
|
335
|
+
background: var(--zx-color-bg-raised);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.zx-composer__option {
|
|
340
|
+
display: flex;
|
|
341
|
+
align-items: center;
|
|
342
|
+
gap: var(--zx-space-2);
|
|
343
|
+
min-block-size: calc(var(--zx-control-height) - 2px);
|
|
344
|
+
padding: var(--zx-space-1) var(--zx-space-2);
|
|
345
|
+
border-radius: var(--zx-radius-sm);
|
|
346
|
+
line-height: 1.35;
|
|
347
|
+
cursor: pointer;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/* The highlighted suggestion takes the same neutral step as a highlighted option in any list. */
|
|
351
|
+
.zx-composer__option[aria-selected="true"] {
|
|
352
|
+
background: var(--zx-color-overlay-hover);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.zx-composer__option > .zx-icon {
|
|
356
|
+
flex: none;
|
|
357
|
+
color: var(--zx-color-text-subtle);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.zx-composer__option-text {
|
|
361
|
+
display: grid;
|
|
362
|
+
min-inline-size: 0;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.zx-composer__option-label {
|
|
366
|
+
overflow: hidden;
|
|
367
|
+
font-size: var(--zx-text-sm);
|
|
368
|
+
font-weight: var(--zx-weight-medium);
|
|
369
|
+
text-overflow: ellipsis;
|
|
370
|
+
white-space: nowrap;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.zx-composer__option-description {
|
|
374
|
+
overflow: hidden;
|
|
375
|
+
color: var(--zx-color-text-muted);
|
|
376
|
+
font-size: var(--zx-text-xs);
|
|
377
|
+
text-overflow: ellipsis;
|
|
378
|
+
white-space: nowrap;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/* Spoken, not drawn: the number of suggestions. */
|
|
382
|
+
.zx-composer__status {
|
|
383
|
+
position: absolute;
|
|
384
|
+
inline-size: 1px;
|
|
385
|
+
block-size: 1px;
|
|
386
|
+
overflow: hidden;
|
|
387
|
+
clip-path: inset(50%);
|
|
388
|
+
white-space: nowrap;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/* ---------------------------------------------------------------- motion -- */
|
|
392
|
+
|
|
393
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
394
|
+
.zx-composer .zx-composer__send {
|
|
395
|
+
transition:
|
|
396
|
+
background-color var(--zx-dur-fast) var(--zx-ease),
|
|
397
|
+
color var(--zx-dur-fast) var(--zx-ease);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.zx-composer__frame {
|
|
401
|
+
transition: box-shadow var(--zx-dur-fast) var(--zx-ease);
|
|
402
|
+
}
|
|
403
|
+
}
|