@zeyos/zx 5.7.0 → 5.8.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 +330 -0
- package/README.md +47 -9
- package/dist/types/components/activity-item/activity-item.d.ts +14 -3
- package/dist/types/components/agent-avatar/agent-avatar.d.ts +165 -0
- package/dist/types/components/agent-avatar/agent-face.d.ts +93 -0
- package/dist/types/components/agent-thread/ag-ui.d.ts +21 -9
- package/dist/types/components/agent-thread/agent-thread.d.ts +26 -0
- package/dist/types/components/agent-thread/ui-message-stream.d.ts +3 -1
- package/dist/types/components/approval-card/approval-card.d.ts +31 -2
- package/dist/types/components/aurora/aurora.d.ts +31 -5
- package/dist/types/components/calendar/calendar.d.ts +39 -26
- package/dist/types/components/chart/chart.d.ts +250 -20
- package/dist/types/components/chart/color.d.ts +66 -0
- package/dist/types/components/chart/svg-adapter.d.ts +103 -0
- package/dist/types/components/chart/svg-geometry.d.ts +203 -0
- package/dist/types/components/check-button/check-button.d.ts +1 -4
- package/dist/types/components/checklist/checklist.d.ts +48 -5
- package/dist/types/components/code-editor/code-editor.d.ts +55 -1
- package/dist/types/components/composer/composer.d.ts +41 -6
- package/dist/types/components/context-menu/context-menu.d.ts +36 -8
- package/dist/types/components/copy/copy-button.d.ts +6 -0
- package/dist/types/components/copy/copy-input.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +14 -0
- package/dist/types/components/date-picker/time-picker.d.ts +26 -17
- package/dist/types/components/datebox/datebox.d.ts +8 -4
- package/dist/types/components/dialog/dialog.d.ts +15 -4
- package/dist/types/components/empty-state/empty-state.d.ts +10 -1
- package/dist/types/components/field/field.d.ts +4 -2
- package/dist/types/components/form/form.d.ts +2 -1
- package/dist/types/components/kanban-view/kanban-card.d.ts +7 -0
- package/dist/types/components/kanban-view/kanban-view.d.ts +15 -3
- package/dist/types/components/launcher/launcher.d.ts +26 -0
- package/dist/types/components/master-panel/master-panel.d.ts +9 -4
- package/dist/types/components/menu-button/menu-button.d.ts +29 -5
- package/dist/types/components/message/message.d.ts +308 -5
- package/dist/types/components/modal/modal.d.ts +45 -8
- package/dist/types/components/modal/native-dialog.d.ts +40 -0
- package/dist/types/components/module-bar/module-bar.d.ts +9 -2
- package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +5 -4
- package/dist/types/components/number-field/number-field.d.ts +31 -1
- package/dist/types/components/pagination/pagination.d.ts +341 -19
- package/dist/types/components/run-status/run-status.d.ts +26 -0
- package/dist/types/components/run-trace/run-trace.d.ts +10 -6
- package/dist/types/components/search/search.d.ts +16 -4
- package/dist/types/components/select/select.d.ts +19 -1
- package/dist/types/components/sheet/sheet.d.ts +20 -6
- package/dist/types/components/slider/slider.d.ts +2 -1
- package/dist/types/components/stat-tile/stat-tile.d.ts +20 -3
- package/dist/types/components/stepper/stepper.d.ts +17 -4
- package/dist/types/components/surface/catalog.d.ts +61 -17
- package/dist/types/components/surface/surface.d.ts +6 -4
- package/dist/types/components/table/table.d.ts +207 -5
- package/dist/types/components/table/window.d.ts +25 -1
- package/dist/types/components/toggle/toggle.d.ts +38 -6
- package/dist/types/components/tooltip/tooltip.d.ts +5 -4
- package/dist/types/components/tree/tree.d.ts +43 -6
- package/dist/types/components/truncate/truncate.d.ts +4 -2
- package/dist/types/components/value-list/value-list.d.ts +9 -2
- package/dist/types/core/date.d.ts +2 -1
- package/dist/types/core/dom.d.ts +14 -0
- package/dist/types/core/drag-axis.d.ts +10 -5
- package/dist/types/core/export.d.ts +2 -2
- package/dist/types/core/format.d.ts +3 -1
- package/dist/types/core/icons.d.ts +36 -3
- package/dist/types/core/keyboard.d.ts +7 -3
- package/dist/types/core/messages.d.ts +3 -0
- package/dist/types/core/storage.d.ts +4 -3
- package/dist/types/core/util.d.ts +3 -1
- package/dist/types/elements/define.d.ts +5 -2
- package/dist/types/index.d.ts +6 -4
- package/dist/types/internal/agent-model.d.ts +99 -0
- package/dist/types/internal/app-rail.d.ts +37 -2
- package/dist/types/internal/collections.d.ts +18 -0
- package/dist/types/internal/menu-items.d.ts +27 -0
- package/dist/types/internal/overlay-content.d.ts +23 -0
- package/dist/types/internal/presence-loop.d.ts +5 -2
- package/dist/types/locales/index.d.ts +3 -0
- package/dist/types/zeyos/calendar.d.ts +43 -7
- package/dist/types/zeyos/connect.d.ts +4 -0
- package/dist/types/zeyos/form.d.ts +13 -5
- package/dist/types/zeyos/select.d.ts +5 -2
- package/dist/types/zeyos/table.d.ts +16 -8
- package/dist/types/zeyos/view.d.ts +2 -1
- package/dist/zx-zeyos.esm.js +3161 -515
- package/dist/zx-zeyos.esm.min.js +4 -4
- package/dist/zx.core.css +4 -0
- package/dist/zx.core.min.css +1 -1
- package/dist/zx.css +970 -57
- package/dist/zx.esm.js +6405 -2249
- package/dist/zx.esm.min.js +26 -26
- package/dist/zx.global.js +6405 -2249
- package/dist/zx.global.min.js +26 -26
- package/dist/zx.layered.css +972 -57
- package/dist/zx.layered.min.css +1 -1
- package/dist/zx.min.css +1 -1
- package/docs/agent-catalog.json +159 -1
- package/docs/agent-surfaces.md +21 -21
- package/docs/api.json +3154 -518
- package/docs/components/account-menu.md +24 -0
- package/docs/components/activity-item.md +23 -0
- package/docs/components/activity-list.md +28 -0
- package/docs/components/agent-avatar.md +59 -0
- package/docs/components/agent-thread.md +275 -0
- package/docs/components/app-icon.md +36 -0
- package/docs/components/app-sidebar.md +92 -0
- package/docs/components/approval-card.md +71 -0
- package/docs/components/aurora.md +34 -0
- package/docs/components/avatar.md +37 -0
- package/docs/components/badge.md +36 -0
- package/docs/components/block-view.md +34 -0
- package/docs/components/breadcrumb.md +20 -0
- package/docs/components/button.md +23 -0
- package/docs/components/calendar.md +68 -0
- package/docs/components/card-view.md +73 -0
- package/docs/components/card.md +25 -0
- package/docs/components/chart.md +109 -0
- package/docs/components/check-button.md +16 -0
- package/docs/components/checklist.md +19 -0
- package/docs/components/code-editor.md +38 -0
- package/docs/components/composer.md +107 -0
- package/docs/components/context-menu.md +32 -0
- package/docs/components/copy.md +37 -0
- package/docs/components/data-filter.md +16 -0
- package/docs/components/date-picker.md +31 -0
- package/docs/components/date-range.md +21 -0
- package/docs/components/datebox.md +31 -0
- package/docs/components/dialog.md +25 -0
- package/docs/components/dock.md +57 -0
- package/docs/components/dropdown.md +39 -0
- package/docs/components/elements.md +63 -0
- package/docs/components/empty-state.md +17 -0
- package/docs/components/entity-ref.md +26 -0
- package/docs/components/field-upload.md +18 -0
- package/docs/components/file-item.md +27 -0
- package/docs/components/file-list.md +23 -0
- package/docs/components/filter-panel.md +45 -0
- package/docs/components/filter.md +47 -0
- package/docs/components/finder.md +25 -0
- package/docs/components/form-widgets.md +42 -0
- package/docs/components/form.md +80 -0
- package/docs/components/grid.md +26 -0
- package/docs/components/groupbox.md +11 -0
- package/docs/components/helpers.md +359 -0
- package/docs/components/icons.md +87 -0
- package/docs/components/index.md +99 -0
- package/docs/components/kanban-view.md +42 -0
- package/docs/components/kbd.md +23 -0
- package/docs/components/kernel.md +41 -0
- package/docs/components/launcher.md +66 -0
- package/docs/components/layout.md +33 -0
- package/docs/components/list-toolbar.md +38 -0
- package/docs/components/loading.md +48 -0
- package/docs/components/menu-button.md +47 -0
- package/docs/components/message.md +76 -0
- package/docs/components/modal.md +27 -0
- package/docs/components/module-bar.md +71 -0
- package/docs/components/multi-value-editor.md +16 -0
- package/docs/components/navigation-bar.md +22 -0
- package/docs/components/number-field.md +34 -0
- package/docs/components/pagination.md +73 -0
- package/docs/components/panel.md +28 -0
- package/docs/components/prompt-starters.md +40 -0
- package/docs/components/prose.md +38 -0
- package/docs/components/questionnaire.md +115 -0
- package/docs/components/rating.md +19 -0
- package/docs/components/run-status.md +50 -0
- package/docs/components/run-trace.md +72 -0
- package/docs/components/search.md +11 -0
- package/docs/components/select.md +129 -0
- package/docs/components/sheet-stack.md +39 -0
- package/docs/components/sheet.md +77 -0
- package/docs/components/skeleton.md +27 -0
- package/docs/components/slider.md +29 -0
- package/docs/components/sort-control.md +21 -0
- package/docs/components/source-list.md +30 -0
- package/docs/components/split-view.md +12 -0
- package/docs/components/stat-tile.md +49 -0
- package/docs/components/stepper.md +27 -0
- package/docs/components/surface.md +152 -0
- package/docs/components/tabbox.md +33 -0
- package/docs/components/table-view.md +43 -0
- package/docs/components/table.md +232 -0
- package/docs/components/tag-picker.md +39 -0
- package/docs/components/timebox.md +16 -0
- package/docs/components/toggle.md +21 -0
- package/docs/components/tokens.md +82 -0
- package/docs/components/toolbar.md +26 -0
- package/docs/components/tooltip.md +16 -0
- package/docs/components/tree.md +48 -0
- package/docs/components/truncate.md +21 -0
- package/docs/components/value-list.md +14 -0
- package/docs/components/view-settings.md +56 -0
- package/docs/components/workspace-switcher.md +42 -0
- package/docs/components/zeyos.md +196 -0
- package/docs/llms-small.txt +299 -0
- package/docs/llms.md +725 -109
- package/docs/llms.txt +46 -19
- package/package.json +9 -4
- package/src/components/activity-item/activity-item.js +21 -2
- package/src/components/agent-avatar/agent-avatar.css +195 -0
- package/src/components/agent-avatar/agent-avatar.js +333 -0
- package/src/components/agent-avatar/agent-face.js +292 -0
- package/src/components/agent-thread/ag-ui.js +44 -11
- package/src/components/agent-thread/agent-thread.js +103 -11
- package/src/components/agent-thread/ui-message-stream.js +3 -1
- package/src/components/app-rail/app-rail.css +5 -0
- package/src/components/app-sidebar/app-sidebar.css +3 -0
- package/src/components/app-sidebar/app-sidebar.js +4 -3
- package/src/components/approval-card/approval-card.css +6 -0
- package/src/components/approval-card/approval-card.js +55 -7
- package/src/components/aurora/aurora.css +149 -14
- package/src/components/aurora/aurora.js +49 -6
- package/src/components/button/button.css +24 -11
- package/src/components/calendar/calendar.css +6 -2
- package/src/components/calendar/calendar.js +127 -47
- package/src/components/card-view/card-view.js +5 -6
- package/src/components/chart/chart.css +159 -1
- package/src/components/chart/chart.js +450 -62
- package/src/components/chart/color.js +297 -0
- package/src/components/chart/svg-adapter.js +576 -0
- package/src/components/chart/svg-geometry.js +323 -0
- package/src/components/check-button/check-button.js +3 -18
- package/src/components/checklist/checklist.css +9 -1
- package/src/components/checklist/checklist.js +105 -20
- package/src/components/checklist/field-adapter.js +6 -12
- package/src/components/code-editor/code-editor.css +33 -0
- package/src/components/code-editor/code-editor.js +97 -8
- package/src/components/code-editor/field-adapter.js +3 -0
- package/src/components/composer/composer.css +3 -0
- package/src/components/composer/composer.js +100 -22
- package/src/components/context-menu/context-menu.js +41 -5
- package/src/components/copy/copy-button.js +9 -1
- package/src/components/copy/copy-input.js +5 -0
- package/src/components/data-filter/filter-core.js +0 -1
- package/src/components/date-picker/date-picker.css +8 -0
- package/src/components/date-picker/date-picker.js +47 -8
- package/src/components/date-picker/date-range-picker.js +1 -1
- package/src/components/date-picker/month-picker.js +19 -3
- package/src/components/date-picker/time-picker.js +54 -19
- package/src/components/datebox/date-range-box.js +7 -3
- package/src/components/datebox/datebox.js +32 -6
- package/src/components/dialog/dialog.css +6 -0
- package/src/components/dialog/dialog.js +24 -33
- package/src/components/dropdown/dropdown.js +1 -18
- package/src/components/empty-state/empty-state.js +21 -2
- package/src/components/field/field.js +19 -3
- package/src/components/fieldset/fieldset.js +3 -1
- package/src/components/filter/filter.js +9 -0
- package/src/components/form/form.js +19 -2
- package/src/components/kanban-view/kanban-card.js +15 -2
- package/src/components/kanban-view/kanban-view.css +21 -0
- package/src/components/kanban-view/kanban-view.js +29 -16
- package/src/components/launcher/launcher.css +14 -0
- package/src/components/launcher/launcher.js +54 -9
- package/src/components/master-panel/master-panel.js +24 -22
- package/src/components/menu-button/menu-button.js +26 -4
- package/src/components/message/message.css +228 -29
- package/src/components/message/message.js +664 -30
- package/src/components/modal/modal.js +129 -30
- package/src/components/modal/native-dialog.js +91 -0
- package/src/components/module-bar/module-bar.css +3 -0
- package/src/components/module-bar/module-bar.js +17 -4
- package/src/components/multi-value-editor/multi-value-editor.css +7 -2
- package/src/components/multi-value-editor/multi-value-editor.js +3 -2
- package/src/components/navigation-bar/navigation-bar.js +13 -1
- package/src/components/number-field/field-adapter.js +3 -0
- package/src/components/number-field/number-field.js +70 -16
- package/src/components/pagination/pagination.css +26 -2
- package/src/components/pagination/pagination.js +551 -65
- package/src/components/prose/prose.js +7 -1
- package/src/components/rating/field-adapter.js +3 -0
- package/src/components/run-status/run-status.js +43 -3
- package/src/components/run-trace/run-trace.js +15 -7
- package/src/components/search/search.js +3 -18
- package/src/components/select/field-adapter.js +8 -1
- package/src/components/select/select.js +68 -13
- package/src/components/sheet/sheet.js +39 -13
- package/src/components/slider/field-adapter.js +3 -0
- package/src/components/slider/slider.js +4 -6
- package/src/components/stat-tile/stat-tile.js +24 -9
- package/src/components/stepper/stepper.css +15 -0
- package/src/components/stepper/stepper.js +34 -2
- package/src/components/surface/catalog.js +185 -28
- package/src/components/surface/surface.js +10 -5
- package/src/components/tabbox/tabbox.js +13 -1
- package/src/components/table/table.css +160 -2
- package/src/components/table/table.js +479 -52
- package/src/components/table/window.js +46 -4
- package/src/components/table-view/table-view.js +1 -10
- package/src/components/tag-picker/field-adapter.js +3 -0
- package/src/components/tag-picker/tag-picker.js +2 -0
- package/src/components/timebox/field-adapter.js +3 -0
- package/src/components/toggle/toggle.js +51 -27
- package/src/components/tooltip/tooltip.js +21 -14
- package/src/components/tree/tree.js +87 -14
- package/src/components/truncate/truncate.js +21 -5
- package/src/components/value-list/value-list.js +37 -9
- package/src/components/view-settings/view-settings.js +1 -5
- package/src/core/component.js +34 -2
- package/src/core/date.js +5 -4
- package/src/core/dom.js +45 -2
- package/src/core/drag-axis.js +24 -7
- package/src/core/export.js +4 -4
- package/src/core/fontawesome.js +34 -3
- package/src/core/format.js +3 -1
- package/src/core/http.js +23 -11
- package/src/core/icons.js +60 -8
- package/src/core/keyboard.js +83 -9
- package/src/core/messages.js +3 -0
- package/src/core/position.js +4 -3
- package/src/core/storage.js +80 -31
- package/src/core/util.js +16 -5
- package/src/elements/define.js +82 -47
- package/src/elements/kit.js +46 -35
- package/src/index.js +8 -4
- package/src/internal/agent-model.js +152 -0
- package/src/internal/app-rail.js +53 -2
- package/src/internal/collections.js +25 -0
- package/src/internal/menu-items.js +59 -0
- package/src/internal/overlay-content.js +35 -0
- package/src/internal/presence-loop.js +61 -14
- package/src/locales/de.js +3 -0
- package/src/zeyos/calendar.js +81 -19
- package/src/zeyos/connect.js +5 -1
- package/src/zeyos/form.js +29 -10
- package/src/zeyos/select.js +36 -12
- package/src/zeyos/table.js +43 -11
- package/src/zeyos/view.js +2 -1
- package/styles/tokens/semantic.css +7 -1
- package/styles/zx.css +1 -0
|
@@ -4,8 +4,10 @@ import { uid } from '../../core/util.js';
|
|
|
4
4
|
import { icon } from '../../core/icons.js';
|
|
5
5
|
import { rovingTabindex, typeahead } from '../../core/keyboard.js';
|
|
6
6
|
import {
|
|
7
|
+
applyCheckedState,
|
|
7
8
|
isMenuItem,
|
|
8
9
|
MENU_ITEM_SELECTOR,
|
|
10
|
+
nextCheckedState,
|
|
9
11
|
renderMenuEntries
|
|
10
12
|
} from '../../internal/menu-items.js';
|
|
11
13
|
import { Dropdown } from '../dropdown/dropdown.js';
|
|
@@ -19,11 +21,19 @@ import { Dropdown } from '../dropdown/dropdown.js';
|
|
|
19
21
|
* @property {'default'|'primary'|'danger'|'ghost'} [kind='default'] Trigger button kind.
|
|
20
22
|
* @property {MenuButtonItem[]} [items=[]] Menu items and separators.
|
|
21
23
|
* @property {'bottom-start'|'bottom-end'|'top-start'|'top-end'|'bottom'|'top'|'right-start'|'right-end'|'left-start'|'left-end'|'right'|'left'} [placement='bottom-start'] Menu placement.
|
|
22
|
-
* @property {(event: CustomEvent<
|
|
24
|
+
* @property {(event: CustomEvent<MenuButtonSelectDetail>) => void} [onselect] Select event listener.
|
|
23
25
|
* @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open event listener.
|
|
24
26
|
* @property {(event: CustomEvent<Record<string, never>>) => void} [onclose] Close event listener.
|
|
25
27
|
*/
|
|
26
28
|
|
|
29
|
+
/**
|
|
30
|
+
* @typedef {Object} MenuButtonSelectDetail
|
|
31
|
+
* @property {unknown} value The chosen item's value.
|
|
32
|
+
* @property {MenuItem} item The chosen item, as the application gave it.
|
|
33
|
+
* @property {boolean} [checked] For a `menuitemcheckbox` or `menuitemradio`, the state choosing it
|
|
34
|
+
* gives the item: a checkbox toggles, a radio is checked. Absent for a plain item.
|
|
35
|
+
*/
|
|
36
|
+
|
|
27
37
|
/**
|
|
28
38
|
* @typedef {Object} MenuButtonOpenOptions
|
|
29
39
|
* @property {boolean|HTMLElement} [returnFocus=true] Where focus goes when this opening ends with a
|
|
@@ -37,6 +47,11 @@ import { Dropdown } from '../dropdown/dropdown.js';
|
|
|
37
47
|
* Choosing an item closes the menu and puts focus back on the trigger before the `select` event
|
|
38
48
|
* and the item's `onselect` run, so whatever they open — a dialog, a sheet — records the trigger
|
|
39
49
|
* as the place to return to, and focus they move themselves stays where they put it.
|
|
50
|
+
*
|
|
51
|
+
* Choosing a `menuitemcheckbox` toggles its `aria-checked`, and choosing a `menuitemradio` checks
|
|
52
|
+
* it and unchecks the other radio items of its section (between separators or headings); the new
|
|
53
|
+
* state arrives as `detail.checked`. A `select` listener that prevents the event keeps the state as
|
|
54
|
+
* it was, and one that calls `setItems()` renders the state it wants instead.
|
|
40
55
|
* @fires MenuButton#select
|
|
41
56
|
* @fires MenuButton#open
|
|
42
57
|
* @fires MenuButton#close
|
|
@@ -391,13 +406,19 @@ export class MenuButton extends Component {
|
|
|
391
406
|
const active = document.activeElement;
|
|
392
407
|
const reclaim = Boolean(target) && (!active || active === document.body || this.#panel.contains(active));
|
|
393
408
|
if (reclaim) target?.focus();
|
|
394
|
-
const
|
|
409
|
+
const entries = this.#items;
|
|
410
|
+
const checked = nextCheckedState(item, element.getAttribute('aria-checked') === 'true');
|
|
411
|
+
const selected = this.emit('select', checked === undefined
|
|
412
|
+
? { value: item.value, item }
|
|
413
|
+
: { value: item.value, item, checked });
|
|
395
414
|
if (selected.defaultPrevented) {
|
|
396
415
|
event?.preventDefault();
|
|
397
416
|
// The menu stays open, so focus returns to the item, unless a listener has moved it again.
|
|
398
417
|
if (reclaim && document.activeElement === target && element instanceof HTMLElement) element.focus();
|
|
399
418
|
return;
|
|
400
419
|
}
|
|
420
|
+
// A listener that replaced the items has rendered the state it wants already.
|
|
421
|
+
if (checked !== undefined && this.#items === entries) applyCheckedState(this.#panel, entries, index, checked);
|
|
401
422
|
try {
|
|
402
423
|
item.onselect?.(item.value, item, this);
|
|
403
424
|
} finally {
|
|
@@ -423,9 +444,10 @@ export class MenuButton extends Component {
|
|
|
423
444
|
}
|
|
424
445
|
|
|
425
446
|
/**
|
|
426
|
-
* Fired when an enabled item is activated.
|
|
447
|
+
* Fired when an enabled item is activated. Preventing it keeps the menu open and a checkbox or
|
|
448
|
+
* radio item's state unchanged.
|
|
427
449
|
* @event MenuButton#select
|
|
428
|
-
* @type {CustomEvent<
|
|
450
|
+
* @type {CustomEvent<MenuButtonSelectDetail>}
|
|
429
451
|
*/
|
|
430
452
|
|
|
431
453
|
/**
|
|
@@ -1,17 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The light that travels around an animated highlight. Registered so the angle interpolates —
|
|
3
|
+
* an unregistered custom property would jump from one end of the turn to the other.
|
|
4
|
+
*/
|
|
5
|
+
@property --zx-message-sweep {
|
|
6
|
+
syntax: '<angle>';
|
|
7
|
+
inherits: false;
|
|
8
|
+
initial-value: 0deg;
|
|
9
|
+
}
|
|
10
|
+
|
|
1
11
|
.zx-message {
|
|
12
|
+
/* Which way a stack piles: 1 from the top edge, -1 from the foot. Read by the script too. */
|
|
13
|
+
--zx-message-dir: 1;
|
|
14
|
+
/* An open stack spaces its messages like a list; a collapsed one shows each message behind the
|
|
15
|
+
front by a peek. The bleed is how far a message's shadow may reach past its clip. */
|
|
16
|
+
--zx-message-gap: var(--zx-space-2);
|
|
17
|
+
--zx-message-peek: var(--zx-space-3);
|
|
18
|
+
--zx-message-bleed: var(--zx-space-8);
|
|
2
19
|
display: grid;
|
|
3
|
-
gap: var(--zx-
|
|
20
|
+
gap: var(--zx-message-gap);
|
|
4
21
|
}
|
|
5
22
|
|
|
23
|
+
/*
|
|
24
|
+
* The floating region. `data-placement` names its corner or centre — the block edge, then the
|
|
25
|
+
* inline position — and `--zx-message-offset` is its distance from the viewport edge: public, read
|
|
26
|
+
* with the spacing token as its fallback, so an application sets it on the theme scope (or on
|
|
27
|
+
* `:root`) to clear a header or a status bar.
|
|
28
|
+
*/
|
|
6
29
|
.zx-message-region {
|
|
30
|
+
--zx-message-inset: var(--zx-message-offset, var(--zx-space-4));
|
|
7
31
|
position: fixed;
|
|
8
|
-
inset-block-start: var(--zx-
|
|
32
|
+
inset-block-start: var(--zx-message-inset);
|
|
9
33
|
inset-block-end: auto;
|
|
10
34
|
inset-inline-start: auto;
|
|
11
|
-
inset-inline-end: var(--zx-
|
|
12
|
-
inline-size: min(420px, calc(100% - (2 * var(--zx-
|
|
35
|
+
inset-inline-end: var(--zx-message-inset);
|
|
36
|
+
inline-size: min(420px, calc(100% - (2 * var(--zx-message-inset))));
|
|
13
37
|
block-size: max-content;
|
|
14
|
-
max-block-size: calc(100% - (2 * var(--zx-
|
|
38
|
+
max-block-size: calc(100% - (2 * var(--zx-message-inset)));
|
|
15
39
|
margin: 0;
|
|
16
40
|
overflow: visible;
|
|
17
41
|
border: 0;
|
|
@@ -25,24 +49,57 @@
|
|
|
25
49
|
align-content: start;
|
|
26
50
|
}
|
|
27
51
|
|
|
52
|
+
.zx-message-region[data-placement$="-start"] {
|
|
53
|
+
inset-inline-start: var(--zx-message-inset);
|
|
54
|
+
inset-inline-end: auto;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Centred: pinned to both inline edges, and the auto margins share out what the width leaves. */
|
|
58
|
+
.zx-message-region[data-placement="top"],
|
|
59
|
+
.zx-message-region[data-placement="bottom"] {
|
|
60
|
+
inset-inline: var(--zx-message-inset);
|
|
61
|
+
margin-inline: auto;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* At the foot the newest toast is the one nearest the edge, and toasts enter and leave downwards. */
|
|
65
|
+
.zx-message-region[data-placement^="bottom"] {
|
|
66
|
+
--zx-message-shift: var(--zx-space-2);
|
|
67
|
+
--zx-message-dir: -1;
|
|
68
|
+
inset-block-start: auto;
|
|
69
|
+
inset-block-end: var(--zx-message-inset);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.zx-message-region[data-placement^="bottom"]:popover-open {
|
|
73
|
+
align-content: end;
|
|
74
|
+
}
|
|
75
|
+
|
|
28
76
|
/* On a phone the toasts rise from the foot of the screen, full width, where they cover content
|
|
29
|
-
rather than the header's controls, and sit where a thumb can reach their action
|
|
77
|
+
rather than the header's controls, and sit where a thumb can reach their action — whatever
|
|
78
|
+
placement was asked for, since there is one column to put them in. */
|
|
30
79
|
@media (max-width: 640px) {
|
|
31
|
-
.zx-message-region
|
|
80
|
+
.zx-message-region,
|
|
81
|
+
.zx-message-region[data-placement] {
|
|
82
|
+
--zx-message-shift: var(--zx-space-2);
|
|
83
|
+
--zx-message-dir: -1;
|
|
32
84
|
inset-block-start: auto;
|
|
33
|
-
inset-block-end: var(--zx-
|
|
34
|
-
inset-inline: var(--zx-
|
|
85
|
+
inset-block-end: var(--zx-message-inset);
|
|
86
|
+
inset-inline: var(--zx-message-inset);
|
|
35
87
|
inline-size: auto;
|
|
88
|
+
margin-inline: 0;
|
|
36
89
|
}
|
|
37
90
|
|
|
38
|
-
.zx-message-region:popover-open
|
|
91
|
+
.zx-message-region:popover-open,
|
|
92
|
+
.zx-message-region[data-placement]:popover-open {
|
|
39
93
|
align-content: end;
|
|
40
94
|
}
|
|
41
95
|
}
|
|
42
96
|
|
|
97
|
+
/*
|
|
98
|
+
* One message: a plain card on the overlay material, a neutral border, and the kind in its icon.
|
|
99
|
+
* A highlight (`data-highlight`) is the one way a message is made to stand out.
|
|
100
|
+
*/
|
|
43
101
|
.zx-message__toast {
|
|
44
102
|
--zx-message-kind: var(--zx-color-info);
|
|
45
|
-
--zx-message-fallback-bg: var(--zx-color-info-bg);
|
|
46
103
|
position: relative;
|
|
47
104
|
display: grid;
|
|
48
105
|
/* Icon and text, then whatever follows — the action, the close button — in columns of their own. */
|
|
@@ -51,42 +108,35 @@
|
|
|
51
108
|
grid-auto-flow: column;
|
|
52
109
|
align-items: start;
|
|
53
110
|
gap: var(--zx-space-3);
|
|
54
|
-
border: 1px solid var(--zx-color-
|
|
111
|
+
border: 1px solid var(--zx-color-border);
|
|
55
112
|
border-radius: var(--zx-radius-lg);
|
|
56
|
-
background: var(--zx-
|
|
57
|
-
box-shadow:
|
|
113
|
+
background: var(--zx-color-bg-raised);
|
|
114
|
+
box-shadow: var(--zx-overlay-shadow);
|
|
58
115
|
padding: var(--zx-space-3);
|
|
59
116
|
color: var(--zx-color-text);
|
|
60
117
|
}
|
|
61
118
|
|
|
62
119
|
.zx-message__toast[data-kind="success"] {
|
|
63
120
|
--zx-message-kind: var(--zx-color-success);
|
|
64
|
-
--zx-message-fallback-bg: var(--zx-color-success-bg);
|
|
65
121
|
}
|
|
66
122
|
|
|
67
123
|
.zx-message__toast[data-kind="warning"] {
|
|
68
124
|
--zx-message-kind: var(--zx-color-warning);
|
|
69
|
-
--zx-message-fallback-bg: var(--zx-color-warning-bg);
|
|
70
125
|
}
|
|
71
126
|
|
|
72
127
|
.zx-message__toast[data-kind="error"] {
|
|
73
128
|
--zx-message-kind: var(--zx-color-danger);
|
|
74
|
-
--zx-message-fallback-bg: var(--zx-color-danger-bg);
|
|
75
129
|
}
|
|
76
130
|
|
|
77
131
|
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
|
78
132
|
.zx-message__toast {
|
|
79
|
-
border-color:
|
|
133
|
+
border-color: var(--zx-color-overlay-border);
|
|
80
134
|
background-color: var(--zx-color-overlay-surface);
|
|
81
|
-
/* The
|
|
82
|
-
|
|
83
|
-
background-image: radial-gradient(120% 160% at 0% 0%,
|
|
84
|
-
color-mix(in srgb, var(--zx-message-kind) 16%, transparent), transparent 62%),
|
|
85
|
-
var(--zx-overlay-toast-image);
|
|
135
|
+
/* The theme's toast body and nothing more: no tint for the kind, which shows in the icon. */
|
|
136
|
+
background-image: var(--zx-overlay-toast-image);
|
|
86
137
|
background-clip: padding-box;
|
|
87
138
|
-webkit-backdrop-filter: var(--zx-glass-filter-overlay);
|
|
88
139
|
backdrop-filter: var(--zx-glass-filter-overlay);
|
|
89
|
-
/* No bar on the leading edge: the kind shows in the icon and the tinted border. */
|
|
90
140
|
box-shadow: var(--zx-glass-overlay-shadow);
|
|
91
141
|
}
|
|
92
142
|
}
|
|
@@ -94,13 +144,55 @@
|
|
|
94
144
|
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
|
|
95
145
|
.zx-message__toast {
|
|
96
146
|
border-color: var(--zx-color-border);
|
|
97
|
-
background: var(--zx-
|
|
147
|
+
background: var(--zx-color-bg-raised);
|
|
98
148
|
-webkit-backdrop-filter: none;
|
|
99
149
|
backdrop-filter: none;
|
|
100
150
|
box-shadow: var(--zx-overlay-shadow);
|
|
101
151
|
}
|
|
102
152
|
}
|
|
103
153
|
|
|
154
|
+
/* A highlight draws the border in the kind colour. Listed after the material and its fallbacks so
|
|
155
|
+
it holds over every one of them. */
|
|
156
|
+
.zx-message__toast[data-highlight] {
|
|
157
|
+
border-color: var(--zx-message-kind);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/*
|
|
161
|
+
* The animated highlight: a faint kind-coloured border with a light running round it. The light
|
|
162
|
+
* is a conic gradient on a layer the size of the border box, masked down to the border ring, so
|
|
163
|
+
* it never paints over the card's face or its content.
|
|
164
|
+
*/
|
|
165
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
166
|
+
.zx-message__toast[data-highlight="animated"] {
|
|
167
|
+
border-color: color-mix(in srgb, var(--zx-message-kind) 30%, var(--zx-color-overlay-border));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.zx-message__toast[data-highlight="animated"]::before {
|
|
171
|
+
content: '';
|
|
172
|
+
position: absolute;
|
|
173
|
+
inset: -1px;
|
|
174
|
+
border: 1px solid transparent;
|
|
175
|
+
border-radius: inherit;
|
|
176
|
+
background: conic-gradient(from var(--zx-message-sweep),
|
|
177
|
+
transparent 0turn, transparent 0.55turn,
|
|
178
|
+
color-mix(in srgb, var(--zx-message-kind) 45%, transparent) 0.75turn,
|
|
179
|
+
var(--zx-message-kind) 0.92turn, transparent 1turn) border-box;
|
|
180
|
+
-webkit-mask: linear-gradient(currentColor, currentColor) padding-box,
|
|
181
|
+
linear-gradient(currentColor, currentColor) border-box;
|
|
182
|
+
-webkit-mask-composite: xor;
|
|
183
|
+
mask: linear-gradient(currentColor, currentColor) padding-box exclude,
|
|
184
|
+
linear-gradient(currentColor, currentColor) border-box;
|
|
185
|
+
pointer-events: none;
|
|
186
|
+
animation: zx-message-sweep calc(16 * var(--zx-dur-base)) linear infinite;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
@keyframes zx-message-sweep {
|
|
191
|
+
to {
|
|
192
|
+
--zx-message-sweep: 1turn;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
104
196
|
.zx-message__icon {
|
|
105
197
|
display: inline-grid;
|
|
106
198
|
place-items: center;
|
|
@@ -148,9 +240,97 @@
|
|
|
148
240
|
background: var(--zx-message-kind);
|
|
149
241
|
}
|
|
150
242
|
|
|
243
|
+
/*
|
|
244
|
+
* A stack (`data-stack`). The messages lie on top of one another, placed by the script from their
|
|
245
|
+
* measured heights: `--zx-message-y` is how far each one moves from the stack's edge,
|
|
246
|
+
* `--zx-message-scale` its size, `--zx-message-clip` what it cuts from its inner edge — all but the
|
|
247
|
+
* strip that peeks out, so no card shows through the translucent one in front — and
|
|
248
|
+
* `--zx-message-z` puts the newest on top. The clip is a rectangle (`inset()` without `round`):
|
|
249
|
+
* its cut lies along the edge of the card in front, and only the outer corners are the card's own. The stack's own height is
|
|
250
|
+
* `--zx-message-stack-size`; `--zx-message-stack-hold` keeps it from shrinking under the pointer.
|
|
251
|
+
*/
|
|
252
|
+
.zx-message[data-stack] {
|
|
253
|
+
isolation: isolate;
|
|
254
|
+
block-size: var(--zx-message-stack-size, 0px);
|
|
255
|
+
min-block-size: var(--zx-message-stack-hold, 0px);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.zx-message[data-stack]:not(.zx-message-region) {
|
|
259
|
+
position: relative;
|
|
260
|
+
display: block;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.zx-message-region[data-stack]:popover-open {
|
|
264
|
+
display: block;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.zx-message[data-stack] > .zx-message__toast {
|
|
268
|
+
position: absolute;
|
|
269
|
+
inset-block: 0 auto;
|
|
270
|
+
inset-inline: 0;
|
|
271
|
+
z-index: var(--zx-message-z, 0);
|
|
272
|
+
/* Behind the front message, each one shrinks towards the edge that peeks out. */
|
|
273
|
+
transform-origin: 50% 100%;
|
|
274
|
+
translate: 0 calc(var(--zx-message-dir) * var(--zx-message-y, 0px));
|
|
275
|
+
scale: var(--zx-message-scale, 1);
|
|
276
|
+
clip-path: inset(var(--zx-message-clip, calc(-1 * var(--zx-message-bleed)))
|
|
277
|
+
calc(-1 * var(--zx-message-bleed)) calc(-1 * var(--zx-message-bleed)));
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.zx-message-region[data-stack][data-placement^="bottom"] > .zx-message__toast {
|
|
281
|
+
inset-block: auto 0;
|
|
282
|
+
transform-origin: 50% 0;
|
|
283
|
+
clip-path: inset(calc(-1 * var(--zx-message-bleed)) calc(-1 * var(--zx-message-bleed))
|
|
284
|
+
var(--zx-message-clip, calc(-1 * var(--zx-message-bleed))));
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
@media (max-width: 640px) {
|
|
288
|
+
.zx-message-region[data-stack] > .zx-message__toast,
|
|
289
|
+
.zx-message-region[data-stack][data-placement] > .zx-message__toast {
|
|
290
|
+
inset-block: auto 0;
|
|
291
|
+
transform-origin: 50% 0;
|
|
292
|
+
clip-path: inset(calc(-1 * var(--zx-message-bleed)) calc(-1 * var(--zx-message-bleed))
|
|
293
|
+
var(--zx-message-clip, calc(-1 * var(--zx-message-bleed))));
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/* An open floating stack taller than the viewport is a list that scrolls, so every message in it
|
|
298
|
+
can be reached; the script sets `data-overflow` and scrolls the newest into view. */
|
|
299
|
+
.zx-message-region[data-stack][data-overflow] {
|
|
300
|
+
block-size: max-content;
|
|
301
|
+
overflow-y: auto;
|
|
302
|
+
overscroll-behavior: contain;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.zx-message-region[data-stack][data-overflow]:popover-open {
|
|
306
|
+
display: grid;
|
|
307
|
+
grid-auto-rows: max-content;
|
|
308
|
+
align-content: start;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.zx-message-region[data-stack][data-overflow][data-state] > .zx-message__toast {
|
|
312
|
+
position: relative;
|
|
313
|
+
inset: auto;
|
|
314
|
+
z-index: auto;
|
|
315
|
+
translate: none;
|
|
316
|
+
scale: none;
|
|
317
|
+
clip-path: none;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* Collapsed, only the front message shows its content; the ones behind are its edges. */
|
|
321
|
+
.zx-message[data-stack][data-state="collapsed"] > .zx-message__toast:not([data-depth="0"]) > * {
|
|
322
|
+
opacity: 0;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.zx-message[data-stack][data-state="collapsed"] > .zx-message__toast[data-depth="hidden"] {
|
|
326
|
+
opacity: 0;
|
|
327
|
+
pointer-events: none;
|
|
328
|
+
}
|
|
329
|
+
|
|
151
330
|
@media (prefers-reduced-motion: no-preference) {
|
|
152
|
-
|
|
153
|
-
|
|
331
|
+
/* A message moved from one end of its stack to the other (`data-entered`) has entered already. */
|
|
332
|
+
.zx-message__toast[data-state="open"]:not([data-entered]) {
|
|
333
|
+
animation: zx-message-enter var(--zx-dur-base) var(--zx-ease) backwards;
|
|
154
334
|
}
|
|
155
335
|
|
|
156
336
|
.zx-message__toast[data-state="closing"] {
|
|
@@ -160,12 +340,31 @@
|
|
|
160
340
|
.zx-message__progress-fill {
|
|
161
341
|
transition: inline-size var(--zx-dur-base) var(--zx-ease);
|
|
162
342
|
}
|
|
343
|
+
|
|
344
|
+
.zx-message[data-stack] {
|
|
345
|
+
transition: block-size calc(2 * var(--zx-dur-base)) var(--zx-ease-drawer),
|
|
346
|
+
min-block-size calc(2 * var(--zx-dur-base)) var(--zx-ease-drawer);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.zx-message[data-stack] > .zx-message__toast {
|
|
350
|
+
transition: translate calc(2 * var(--zx-dur-base)) var(--zx-ease-drawer),
|
|
351
|
+
scale calc(2 * var(--zx-dur-base)) var(--zx-ease-drawer),
|
|
352
|
+
clip-path calc(2 * var(--zx-dur-base)) var(--zx-ease-drawer),
|
|
353
|
+
opacity calc(2 * var(--zx-dur-base)) var(--zx-ease-drawer);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.zx-message[data-stack] > .zx-message__toast > * {
|
|
357
|
+
transition: opacity calc(2 * var(--zx-dur-base)) var(--zx-ease);
|
|
358
|
+
}
|
|
163
359
|
}
|
|
164
360
|
|
|
361
|
+
/* `--zx-message-shift` is the direction a toast travels: up and out at the top of the viewport and
|
|
362
|
+
in an inline area, down and out in a region at the foot. In a stack it is a transform of its
|
|
363
|
+
own, on top of the place the stack gives it. */
|
|
165
364
|
@keyframes zx-message-enter {
|
|
166
365
|
from {
|
|
167
366
|
opacity: 0;
|
|
168
|
-
transform: translateY(calc(-1 * var(--zx-space-2)));
|
|
367
|
+
transform: translateY(var(--zx-message-shift, calc(-1 * var(--zx-space-2))));
|
|
169
368
|
}
|
|
170
369
|
|
|
171
370
|
to {
|
|
@@ -182,6 +381,6 @@
|
|
|
182
381
|
|
|
183
382
|
to {
|
|
184
383
|
opacity: 0;
|
|
185
|
-
transform: translateY(calc(-1 * var(--zx-space-2)));
|
|
384
|
+
transform: translateY(var(--zx-message-shift, calc(-1 * var(--zx-space-2))));
|
|
186
385
|
}
|
|
187
386
|
}
|