@zeyos/zx 4.2.0 → 4.3.4
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 +148 -1
- package/README.md +5 -3
- package/dist/types/components/calendar/calendar-model.d.ts +22 -0
- package/dist/types/components/calendar/calendar.d.ts +19 -2
- package/dist/types/components/card-view/card-view.d.ts +1 -1
- package/dist/types/components/card-view/record-card.d.ts +47 -5
- package/dist/types/components/dialog/dialog.d.ts +6 -1
- package/dist/types/components/dropdown/dropdown.d.ts +5 -0
- package/dist/types/components/kanban-view/kanban-policy.d.ts +268 -0
- package/dist/types/components/kanban-view/kanban-view.d.ts +669 -24
- package/dist/types/components/launcher/launcher.d.ts +5 -0
- package/dist/types/components/message/message.d.ts +9 -1
- package/dist/types/components/modal/modal.d.ts +44 -7
- package/dist/types/components/sheet/sheet.d.ts +22 -12
- package/dist/types/core/component.d.ts +6 -1
- package/dist/types/core/overlay-host.d.ts +12 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/zx-zeyos.esm.js +173 -43
- package/dist/zx-zeyos.esm.min.js +1 -1
- package/dist/zx.css +876 -230
- package/dist/zx.esm.js +2053 -338
- package/dist/zx.esm.min.js +3 -3
- package/dist/zx.global.js +2053 -338
- package/dist/zx.global.min.js +3 -3
- package/dist/zx.min.css +1 -1
- package/docs/api.json +250 -2
- package/docs/llms.md +67 -48
- package/docs/llms.txt +1 -3
- package/package.json +1 -2
- package/src/components/account-menu/account-menu.css +1 -1
- package/src/components/app-rail/app-rail.css +1 -1
- package/src/components/calendar/calendar-model.js +45 -0
- package/src/components/calendar/calendar.css +96 -34
- package/src/components/calendar/calendar.js +122 -29
- package/src/components/card-view/card-view.css +211 -9
- package/src/components/card-view/card-view.js +7 -7
- package/src/components/card-view/record-card.js +92 -19
- package/src/components/context-menu/context-menu.css +2 -2
- package/src/components/context-menu/context-menu.js +5 -1
- package/src/components/date-picker/date-picker.css +18 -11
- package/src/components/datebox/date-range-box.css +4 -2
- package/src/components/datebox/datebox.css +4 -2
- package/src/components/dialog/dialog.css +4 -3
- package/src/components/dialog/dialog.js +2 -1
- package/src/components/dropdown/dropdown.css +4 -2
- package/src/components/dropdown/dropdown.js +7 -2
- package/src/components/kanban-view/kanban-policy.js +412 -0
- package/src/components/kanban-view/kanban-view.css +480 -36
- package/src/components/kanban-view/kanban-view.js +1514 -235
- package/src/components/launcher/launcher.css +10 -8
- package/src/components/launcher/launcher.js +9 -2
- package/src/components/menu-button/menu-button.css +2 -2
- package/src/components/message/message.css +15 -25
- package/src/components/message/message.js +17 -11
- package/src/components/modal/modal.css +6 -4
- package/src/components/modal/modal.js +99 -25
- package/src/components/select/select.css +9 -7
- package/src/components/sheet/sheet.css +25 -7
- package/src/components/sheet/sheet.js +43 -23
- package/src/components/table/table.css +5 -3
- package/src/components/tag-picker/tag-picker.css +5 -3
- package/src/components/tooltip/tooltip.css +4 -2
- package/src/components/tooltip/tooltip.js +4 -1
- package/src/core/component.js +8 -3
- package/src/core/overlay-host.js +23 -0
- package/src/index.js +8 -3
- package/styles/tokens/dark.css +4 -0
- package/styles/tokens/semantic.css +83 -8
- package/DESIGN-SYSTEM.md +0 -182
|
@@ -45,6 +45,7 @@ const GROW_SIGN = Object.freeze({ start: 1, end: -1, top: 1, bottom: -1 });
|
|
|
45
45
|
* @property {boolean} [lightDismiss=true] Whether a click outside closes the sheet — the backdrop
|
|
46
46
|
* when modal, a document-level pointer press when not.
|
|
47
47
|
* @property {boolean} [destroyOnClose=false] Whether to destroy the sheet after it closes.
|
|
48
|
+
* @property {Element|string|null} [scope=null] Element whose nearest Zx theme scope owns a floating sheet; defaults to the opener.
|
|
48
49
|
* @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open event listener.
|
|
49
50
|
* @property {(event: CustomEvent<{result: unknown}>) => void} [onclose] Close event listener.
|
|
50
51
|
* @property {(event: CustomEvent<Record<string, never>>) => void} [oncancel] Cancel event listener.
|
|
@@ -61,9 +62,11 @@ const GROW_SIGN = Object.freeze({ start: 1, end: -1, top: 1, bottom: -1 });
|
|
|
61
62
|
*
|
|
62
63
|
* Modality is a three-way choice rather than a boolean because the three real behaviours do not
|
|
63
64
|
* collapse into two: a modal sheet delegates focus containment, page inertness, and Escape to the
|
|
64
|
-
* browser via `showModal()`;
|
|
65
|
-
*
|
|
66
|
-
*
|
|
65
|
+
* browser via `showModal()`; floating non-modal sheets use the manual Popover top layer so a
|
|
66
|
+
* transformed or clipped application scope cannot displace them, and re-implement only what they
|
|
67
|
+
* still want. Docked sheets remain native non-modal dialogs in flow. That is also why `backdrop`
|
|
68
|
+
* applies only to `modal: true`: painting one for either non-modal mode would make the sheet look
|
|
69
|
+
* blocking while it is not.
|
|
67
70
|
* @fires Sheet#open
|
|
68
71
|
* @fires Sheet#close
|
|
69
72
|
* @fires Sheet#cancel
|
|
@@ -109,7 +112,6 @@ export class Sheet extends Dialog {
|
|
|
109
112
|
* field would be undefined at best and a private one would throw.
|
|
110
113
|
*/
|
|
111
114
|
this._dock = null;
|
|
112
|
-
this._handoff = false;
|
|
113
115
|
this.setSide(this.options.side);
|
|
114
116
|
this.el.dataset.backdrop = BACKDROPS.has(this.options.backdrop) ? this.options.backdrop : 'dim';
|
|
115
117
|
this.el.dataset.modality = modality(this.options.modal);
|
|
@@ -318,7 +320,7 @@ export class Sheet extends Dialog {
|
|
|
318
320
|
* @returns {Element}
|
|
319
321
|
*/
|
|
320
322
|
mountTarget() {
|
|
321
|
-
return this._dock?.el ??
|
|
323
|
+
return this._dock?.el ?? super.mountTarget();
|
|
322
324
|
}
|
|
323
325
|
|
|
324
326
|
/**
|
|
@@ -347,35 +349,23 @@ export class Sheet extends Dialog {
|
|
|
347
349
|
/**
|
|
348
350
|
* Moves the dialog to its current mount and, when it was open, reopens it there.
|
|
349
351
|
*
|
|
350
|
-
* The close is unavoidable — a dialog cannot cross between
|
|
351
|
-
*
|
|
352
|
-
* `open()` so no lifecycle event is emitted for what is only a change of address.
|
|
352
|
+
* The close is unavoidable — a dialog cannot cross between presentation layers while open —
|
|
353
|
+
* but it is invisible: Modal's presentation generation drops the stale event, and reopening
|
|
354
|
+
* bypasses `open()` so no lifecycle event is emitted for what is only a change of address.
|
|
353
355
|
* @returns {void}
|
|
354
356
|
*/
|
|
355
357
|
_rehost() {
|
|
356
358
|
const wasOpen = this.isOpen();
|
|
357
|
-
if (wasOpen)
|
|
358
|
-
this._handoff = true;
|
|
359
|
-
/** @type {HTMLDialogElement} */ (this.el).close();
|
|
360
|
-
}
|
|
359
|
+
if (wasOpen) this._dismiss();
|
|
361
360
|
this.mountTarget().append(this.el);
|
|
362
361
|
if (!wasOpen) return;
|
|
363
362
|
this.el.returnValue = '';
|
|
364
|
-
this.
|
|
363
|
+
this._present();
|
|
365
364
|
this.el.dataset.state = 'open';
|
|
366
365
|
if (this._dock) delete /** @type {HTMLElement} */ (this.el).dataset.zxOverlayOrder;
|
|
367
366
|
else this.el.dataset.zxOverlayOrder = String(nextOverlayOrder());
|
|
368
367
|
}
|
|
369
368
|
|
|
370
|
-
/**
|
|
371
|
-
* Drops the stale `close` a re-hosting handoff leaves behind.
|
|
372
|
-
* @returns {boolean}
|
|
373
|
-
*/
|
|
374
|
-
_isRealClose() {
|
|
375
|
-
if (!this._handoff) return true;
|
|
376
|
-
this._handoff = false;
|
|
377
|
-
return false;
|
|
378
|
-
}
|
|
379
369
|
|
|
380
370
|
/**
|
|
381
371
|
* Opens the sheet, trapping focus first where the modality asks for it.
|
|
@@ -465,10 +455,40 @@ export class Sheet extends Dialog {
|
|
|
465
455
|
*/
|
|
466
456
|
_show() {
|
|
467
457
|
if (this.options.modal === true && !this._dock) {
|
|
458
|
+
this.el.removeAttribute('popover');
|
|
459
|
+
this.el.removeAttribute('aria-modal');
|
|
468
460
|
super._show();
|
|
469
461
|
return;
|
|
470
462
|
}
|
|
471
|
-
|
|
463
|
+
this.el.setAttribute('aria-modal', 'false');
|
|
464
|
+
if (this._dock) {
|
|
465
|
+
this.el.removeAttribute('popover');
|
|
466
|
+
/** @type {HTMLDialogElement} */ (this.el).show();
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
this.el.setAttribute('popover', 'manual');
|
|
470
|
+
/** @type {HTMLElement} */ (this.el).showPopover();
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* Hides a native dialog or a non-modal Sheet promoted through the popover top layer.
|
|
475
|
+
* @param {string} [result=''] Native string return value.
|
|
476
|
+
* @param {number} [presentation] Presentation generation being hidden.
|
|
477
|
+
* @returns {void}
|
|
478
|
+
*/
|
|
479
|
+
_hide(result = '', presentation) {
|
|
480
|
+
if (!this.el.matches(':popover-open')) {
|
|
481
|
+
super._hide(result, presentation);
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
this.el.returnValue = result;
|
|
485
|
+
/** @type {HTMLElement} */ (this.el).hidePopover();
|
|
486
|
+
queueMicrotask(() => this._settleClose(presentation));
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
/** @returns {boolean} */
|
|
490
|
+
_isShown() {
|
|
491
|
+
return this.el.matches(':popover-open') || super._isShown();
|
|
472
492
|
}
|
|
473
493
|
|
|
474
494
|
/**
|
|
@@ -35,10 +35,12 @@
|
|
|
35
35
|
min-inline-size: 190px;
|
|
36
36
|
border: 1px solid var(--zx-color-overlay-border);
|
|
37
37
|
border-radius: var(--zx-radius-md);
|
|
38
|
-
background: var(--zx-color-overlay-surface);
|
|
38
|
+
background-color: var(--zx-color-overlay-surface);
|
|
39
|
+
background-image: var(--zx-overlay-surface-image);
|
|
40
|
+
background-clip: padding-box;
|
|
39
41
|
-webkit-backdrop-filter: var(--zx-glass-filter-overlay);
|
|
40
42
|
backdrop-filter: var(--zx-glass-filter-overlay);
|
|
41
|
-
box-shadow: var(--zx-glass-
|
|
43
|
+
box-shadow: var(--zx-glass-overlay-shadow);
|
|
42
44
|
padding: var(--zx-space-2);
|
|
43
45
|
max-block-size: min(360px, 70vh);
|
|
44
46
|
overflow: auto;
|
|
@@ -64,7 +66,7 @@
|
|
|
64
66
|
padding-inline: var(--zx-space-2);
|
|
65
67
|
}
|
|
66
68
|
|
|
67
|
-
.zx-table__column-option:hover { background: var(--zx-color-
|
|
69
|
+
.zx-table__column-option:hover { background: var(--zx-color-overlay-hover); }
|
|
68
70
|
|
|
69
71
|
.zx-table__column-option > label,
|
|
70
72
|
.zx-table__column-label {
|
|
@@ -124,10 +124,12 @@
|
|
|
124
124
|
overflow: hidden;
|
|
125
125
|
border: 1px solid var(--zx-color-overlay-border);
|
|
126
126
|
border-radius: var(--zx-radius-md);
|
|
127
|
-
background: var(--zx-color-overlay-surface);
|
|
127
|
+
background-color: var(--zx-color-overlay-surface);
|
|
128
|
+
background-image: var(--zx-overlay-surface-image);
|
|
129
|
+
background-clip: padding-box;
|
|
128
130
|
-webkit-backdrop-filter: var(--zx-glass-filter-overlay);
|
|
129
131
|
backdrop-filter: var(--zx-glass-filter-overlay);
|
|
130
|
-
box-shadow: var(--zx-glass-
|
|
132
|
+
box-shadow: var(--zx-glass-overlay-shadow);
|
|
131
133
|
color: var(--zx-color-text);
|
|
132
134
|
padding: var(--zx-space-1);
|
|
133
135
|
}
|
|
@@ -158,7 +160,7 @@
|
|
|
158
160
|
}
|
|
159
161
|
|
|
160
162
|
.zx-tag-picker__option[data-active] {
|
|
161
|
-
background: var(--zx-color-
|
|
163
|
+
background: var(--zx-color-overlay-hover);
|
|
162
164
|
}
|
|
163
165
|
|
|
164
166
|
.zx-tag-picker__option[aria-selected="true"] {
|
|
@@ -8,10 +8,12 @@
|
|
|
8
8
|
max-inline-size: var(--zx-tooltip-max-inline-size, 260px);
|
|
9
9
|
border: 1px solid var(--zx-color-overlay-border);
|
|
10
10
|
border-radius: var(--zx-radius-md);
|
|
11
|
-
background: var(--zx-color-overlay-surface);
|
|
11
|
+
background-color: var(--zx-color-overlay-surface);
|
|
12
|
+
background-image: var(--zx-overlay-surface-image);
|
|
13
|
+
background-clip: padding-box;
|
|
12
14
|
-webkit-backdrop-filter: var(--zx-glass-filter-overlay);
|
|
13
15
|
backdrop-filter: var(--zx-glass-filter-overlay);
|
|
14
|
-
box-shadow: var(--zx-glass-
|
|
16
|
+
box-shadow: var(--zx-glass-overlay-shadow);
|
|
15
17
|
padding: var(--zx-space-1) var(--zx-space-2);
|
|
16
18
|
color: var(--zx-color-text);
|
|
17
19
|
font-size: var(--zx-text-sm);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component } from '../../core/component.js';
|
|
2
2
|
import { h, resolveElement } from '../../core/dom.js';
|
|
3
|
+
import { overlayHost } from '../../core/overlay-host.js';
|
|
3
4
|
import { position } from '../../core/position.js';
|
|
4
5
|
import { uid } from '../../core/util.js';
|
|
5
6
|
|
|
@@ -95,6 +96,7 @@ export class Tooltip extends Component {
|
|
|
95
96
|
super(null, options);
|
|
96
97
|
|
|
97
98
|
this.#anchor = resolved;
|
|
99
|
+
overlayHost(resolved).append(this.el);
|
|
98
100
|
this.#content = this.options.content;
|
|
99
101
|
this.#disabled = Boolean(this.options.disabled);
|
|
100
102
|
this.#describedBy = resolved.getAttribute('aria-describedby');
|
|
@@ -154,7 +156,6 @@ export class Tooltip extends Component {
|
|
|
154
156
|
popover: 'manual'
|
|
155
157
|
});
|
|
156
158
|
panel.dataset.state = 'closed';
|
|
157
|
-
document.body.append(panel);
|
|
158
159
|
return panel;
|
|
159
160
|
}
|
|
160
161
|
|
|
@@ -167,6 +168,8 @@ export class Tooltip extends Component {
|
|
|
167
168
|
show() {
|
|
168
169
|
if (this.#destroyed || this.#disabled || this.isOpen()) return this;
|
|
169
170
|
this.#cancelTimers();
|
|
171
|
+
const host = overlayHost(this.#anchor);
|
|
172
|
+
if (this.el.parentElement !== host) host.append(this.el);
|
|
170
173
|
const node = resolveContent(this.#content);
|
|
171
174
|
if (node === null) return this;
|
|
172
175
|
|
package/src/core/component.js
CHANGED
|
@@ -157,21 +157,26 @@ export class Component extends EventTarget {
|
|
|
157
157
|
* Dispatches a component event and a bubbling, composed `zx-*` DOM event.
|
|
158
158
|
* @param {string} type Lowercase event name.
|
|
159
159
|
* @param {Record<string, unknown>} [detail={}] Single event detail object.
|
|
160
|
+
* @param {{honorDomCancellation?:boolean}} [options={}] Mirrored DOM-event behavior. Components
|
|
161
|
+
* with a cancelable mutation boundary may opt into treating `preventDefault()` on the bubbling
|
|
162
|
+
* `zx-*` event exactly like cancellation of the component event.
|
|
160
163
|
* @returns {Event & {detail: Record<string, unknown>}}
|
|
161
164
|
* @fires Component#event
|
|
162
165
|
*/
|
|
163
|
-
emit(type, detail = {}) {
|
|
166
|
+
emit(type, detail = {}, options = {}) {
|
|
164
167
|
if (detail === null || typeof detail !== 'object' || Array.isArray(detail)) {
|
|
165
168
|
throw new TypeError('Event detail must be an object');
|
|
166
169
|
}
|
|
167
170
|
const componentEvent = createCustomEvent(type, detail, { cancelable: true });
|
|
168
171
|
this.dispatchEvent(componentEvent);
|
|
169
172
|
if (this.el) {
|
|
170
|
-
|
|
173
|
+
const domEvent = createCustomEvent(`zx-${type}`, detail, {
|
|
171
174
|
bubbles: true,
|
|
172
175
|
composed: true,
|
|
173
176
|
cancelable: true
|
|
174
|
-
})
|
|
177
|
+
});
|
|
178
|
+
this.el.dispatchEvent(domEvent);
|
|
179
|
+
if (options.honorDomCancellation && domEvent.defaultPrevented) componentEvent.preventDefault();
|
|
175
180
|
}
|
|
176
181
|
return componentEvent;
|
|
177
182
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { resolveElement } from './dom.js';
|
|
2
|
+
|
|
3
|
+
const SCOPE_SELECTOR = '.zx-scope, [data-zx-theme], [data-zx-density], [data-zx-preset]';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Finds the closest styling scope for a top-layer element.
|
|
7
|
+
*
|
|
8
|
+
* Popovers and dialogs escape clipping even when their DOM parent is inside an application shell,
|
|
9
|
+
* so keeping them below that parent preserves inherited theme, density, material, and product
|
|
10
|
+
* token overrides without sacrificing top-layer behaviour. The document body remains the safe
|
|
11
|
+
* fallback for unscoped applications.
|
|
12
|
+
*
|
|
13
|
+
* @param {Element|string|null} [source=null] Element or selector whose styling scope should own the overlay.
|
|
14
|
+
* @returns {Element}
|
|
15
|
+
*/
|
|
16
|
+
export function overlayHost(source = null) {
|
|
17
|
+
const context = source == null
|
|
18
|
+
? (document.activeElement instanceof Element ? document.activeElement : null)
|
|
19
|
+
: resolveElement(source);
|
|
20
|
+
const scope = context?.closest?.(SCOPE_SELECTOR) ?? null;
|
|
21
|
+
if (!scope || scope === document.documentElement || scope === document.body) return document.body;
|
|
22
|
+
return scope;
|
|
23
|
+
}
|
package/src/index.js
CHANGED
|
@@ -136,9 +136,9 @@ export {
|
|
|
136
136
|
export { Timebox, splitTime, joinTime } from './components/timebox/timebox.js';
|
|
137
137
|
export { Calendar } from './components/calendar/calendar.js';
|
|
138
138
|
export {
|
|
139
|
-
CALENDAR_VIEWS, addCalendarDays, calendarDayDifference, calendarDayKey,
|
|
140
|
-
calendarEventIntersects, calendarEventSpansDays,
|
|
141
|
-
layoutCalendarSpans, layoutTimedCalendarEvents, normalizeCalendarEvents,
|
|
139
|
+
CALENDAR_VIEWS, addCalendarDays, addCalendarMonths, calendarDayDifference, calendarDayKey,
|
|
140
|
+
calendarEventIntersects, calendarEventSpansDays, calendarPageDate, calendarRange,
|
|
141
|
+
cloneCalendarEvent, layoutCalendarSpans, layoutTimedCalendarEvents, normalizeCalendarEvents,
|
|
142
142
|
shiftCalendarEvent, startOfCalendarDay, startOfCalendarWeek
|
|
143
143
|
} from './components/calendar/calendar-model.js';
|
|
144
144
|
export {
|
|
@@ -149,6 +149,11 @@ export { Table, reorderTableRows } from './components/table/table.js';
|
|
|
149
149
|
export { TableView } from './components/table-view/table-view.js';
|
|
150
150
|
export { CardView } from './components/card-view/card-view.js';
|
|
151
151
|
export { KanbanView } from './components/kanban-view/kanban-view.js';
|
|
152
|
+
export {
|
|
153
|
+
absoluteKanbanIndex, allowsKanbanTransition, createKanbanHistory, evaluateKanbanMove,
|
|
154
|
+
kanbanSearchTerms, locateKanbanRecord, matchesKanbanSearch, normalizeKanbanRules,
|
|
155
|
+
reorderKanbanRecords, resolveKanbanRules
|
|
156
|
+
} from './components/kanban-view/kanban-policy.js';
|
|
152
157
|
export { Grid, billingColumns, isBillingLine } from './components/grid/grid.js';
|
|
153
158
|
export {
|
|
154
159
|
Chart, ChartJsAdapter, chartSummaryTable, cloneChartValue, isEmptyChartData
|
package/styles/tokens/dark.css
CHANGED
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
--zx-color-bg-hover: color-mix(in srgb, var(--zx-gray-0) 8%, transparent);
|
|
20
20
|
--zx-color-bg-selected: color-mix(in srgb, var(--zx-accent-400) 18%, var(--zx-gray-900));
|
|
21
21
|
--zx-color-bg-backdrop: color-mix(in srgb, var(--zx-gray-950) 75%, transparent);
|
|
22
|
+
--zx-color-overlay-base: color-mix(in srgb, var(--zx-color-bg-raised) 42%, var(--zx-color-bg-page));
|
|
23
|
+
--zx-color-overlay-backdrop: color-mix(in srgb, var(--zx-gray-950) 38%, transparent);
|
|
22
24
|
--zx-color-border: color-mix(in srgb, var(--zx-gray-0) 10%, transparent);
|
|
23
25
|
--zx-color-border-strong: color-mix(in srgb, var(--zx-gray-0) 28%, transparent);
|
|
24
26
|
--zx-color-border-control: color-mix(in srgb, var(--zx-gray-0) 15%, transparent);
|
|
@@ -57,6 +59,8 @@
|
|
|
57
59
|
--zx-color-bg-hover: color-mix(in srgb, var(--zx-gray-0) 8%, transparent);
|
|
58
60
|
--zx-color-bg-selected: color-mix(in srgb, var(--zx-accent-400) 18%, var(--zx-gray-900));
|
|
59
61
|
--zx-color-bg-backdrop: color-mix(in srgb, var(--zx-gray-950) 75%, transparent);
|
|
62
|
+
--zx-color-overlay-base: color-mix(in srgb, var(--zx-color-bg-raised) 42%, var(--zx-color-bg-page));
|
|
63
|
+
--zx-color-overlay-backdrop: color-mix(in srgb, var(--zx-gray-950) 38%, transparent);
|
|
60
64
|
--zx-color-border: color-mix(in srgb, var(--zx-gray-0) 10%, transparent);
|
|
61
65
|
--zx-color-border-strong: color-mix(in srgb, var(--zx-gray-0) 28%, transparent);
|
|
62
66
|
--zx-color-border-control: color-mix(in srgb, var(--zx-gray-0) 15%, transparent);
|
|
@@ -70,10 +70,33 @@
|
|
|
70
70
|
--zx-color-glass-chrome: color-mix(in srgb, var(--zx-color-bg-surface) 90%, transparent);
|
|
71
71
|
--zx-color-glass-control: color-mix(in srgb, var(--zx-color-bg-control) 88%, transparent);
|
|
72
72
|
--zx-color-glass-control-hover: color-mix(in srgb, var(--zx-color-bg-hover) 76%, var(--zx-color-glass-surface));
|
|
73
|
-
/*
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
--zx-color-overlay-
|
|
73
|
+
/* Overlay glass is composed from four roles: a neutral base, translucent colour, a restrained
|
|
74
|
+
reflection, and the backdrop behind modal panels. Keeping them separate makes the material
|
|
75
|
+
visibly react to Aurora/content without baking decoration into each component. */
|
|
76
|
+
--zx-color-overlay-base: var(--zx-color-bg-raised);
|
|
77
|
+
--zx-color-overlay-surface: color-mix(in srgb, var(--zx-color-overlay-base) 72%, transparent);
|
|
78
|
+
--zx-color-overlay-panel: color-mix(in srgb, var(--zx-color-overlay-base) 80%, transparent);
|
|
79
|
+
--zx-color-overlay-backdrop: color-mix(in srgb, var(--zx-gray-950) 28%, transparent);
|
|
80
|
+
--zx-color-overlay-border: color-mix(in srgb, var(--zx-color-text) 14%, transparent);
|
|
81
|
+
--zx-color-overlay-hover: color-mix(in srgb, var(--zx-color-text) 8%, transparent);
|
|
82
|
+
--zx-color-overlay-selected: color-mix(in srgb, var(--zx-color-accent) 18%, transparent);
|
|
83
|
+
--zx-color-overlay-divider: color-mix(in srgb, var(--zx-color-text) 11%, transparent);
|
|
84
|
+
--zx-color-overlay-scrim: color-mix(in srgb, var(--zx-color-overlay-base) 28%, transparent);
|
|
85
|
+
--zx-overlay-specular-strength: 48%;
|
|
86
|
+
--zx-overlay-surface-image: linear-gradient(145deg,
|
|
87
|
+
color-mix(in srgb, var(--zx-color-glass-highlight-strong) var(--zx-overlay-specular-strength), transparent) 0%,
|
|
88
|
+
color-mix(in srgb, var(--zx-color-glass-highlight) 16%, transparent) 28%,
|
|
89
|
+
transparent 54%), radial-gradient(120% 100% at 8% -12%,
|
|
90
|
+
color-mix(in srgb, var(--zx-color-accent) 8%, transparent), transparent 58%);
|
|
91
|
+
--zx-overlay-toast-image: radial-gradient(120% 160% at 0% 0%,
|
|
92
|
+
color-mix(in srgb, var(--zx-message-kind, var(--zx-color-info)) 18%, transparent), transparent 62%),
|
|
93
|
+
var(--zx-overlay-surface-image);
|
|
94
|
+
--zx-overlay-panel-image: radial-gradient(140% 100% at 0% 0%,
|
|
95
|
+
color-mix(in srgb, var(--zx-color-glass-highlight-strong) var(--zx-overlay-specular-strength), transparent) 0%,
|
|
96
|
+
transparent 58%), radial-gradient(100% 70% at 100% 0%,
|
|
97
|
+
color-mix(in srgb, var(--zx-color-accent) 5%, transparent), transparent 64%),
|
|
98
|
+
linear-gradient(180deg, color-mix(in srgb, var(--zx-color-glass-highlight) 16%, transparent) 0%,
|
|
99
|
+
transparent 28%);
|
|
77
100
|
--zx-glass-blur: 8px;
|
|
78
101
|
--zx-glass-saturation: 130%;
|
|
79
102
|
--zx-glass-color-strength: 82%;
|
|
@@ -82,13 +105,15 @@
|
|
|
82
105
|
--zx-glass-filter-control: blur(6px) saturate(116%);
|
|
83
106
|
--zx-glass-filter-raised: blur(8px) saturate(120%);
|
|
84
107
|
--zx-glass-filter-chrome: blur(10px) saturate(122%);
|
|
85
|
-
--zx-glass-filter-overlay: blur(
|
|
86
|
-
--zx-glass-filter-panel: blur(
|
|
108
|
+
--zx-glass-filter-overlay: blur(16px) saturate(140%);
|
|
109
|
+
--zx-glass-filter-panel: blur(14px) saturate(132%);
|
|
87
110
|
--zx-app-icon-shadow: inset 0 1px 0 color-mix(in srgb, var(--zx-gray-0) 14%, transparent), inset 0 -1px 0 color-mix(in srgb, var(--zx-gray-950) 28%, transparent), 0 2px 6px color-mix(in srgb, var(--zx-color-app-icon-shade) 24%, transparent);
|
|
88
111
|
--zx-app-icon-shadow-hover: inset 0 1px 0 color-mix(in srgb, var(--zx-gray-0) 20%, transparent), inset 0 -1px 0 color-mix(in srgb, var(--zx-gray-950) 32%, transparent), 0 4px 10px color-mix(in srgb, var(--zx-color-app-icon-shade) 30%, transparent);
|
|
89
112
|
--zx-glass-control-shadow: inset 0 1px 0 color-mix(in srgb, var(--zx-gray-0) 18%, transparent), var(--zx-shadow-1);
|
|
90
113
|
--zx-glass-chrome-shadow: inset 0 1px 0 color-mix(in srgb, var(--zx-gray-0) 16%, transparent), var(--zx-shadow-1);
|
|
91
114
|
--zx-glass-raised-shadow: inset 0 1px 0 color-mix(in srgb, var(--zx-gray-0) 18%, transparent), var(--zx-overlay-shadow);
|
|
115
|
+
--zx-glass-overlay-shadow: inset 0 1px 0 color-mix(in srgb, var(--zx-color-glass-highlight-strong) 42%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--zx-color-glass-highlight) 20%, transparent), var(--zx-overlay-shadow);
|
|
116
|
+
--zx-glass-panel-shadow: inset 0 1px 0 color-mix(in srgb, var(--zx-color-glass-highlight-strong) 34%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--zx-color-glass-highlight) 14%, transparent), var(--zx-overlay-shadow);
|
|
92
117
|
--zx-header-bg: var(--zx-gray-900);
|
|
93
118
|
--zx-header-text: var(--zx-gray-50);
|
|
94
119
|
}
|
|
@@ -97,13 +122,25 @@
|
|
|
97
122
|
chrome outside a component stylesheet, receives the same deterministic opaque fallback. */
|
|
98
123
|
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
|
|
99
124
|
:root,
|
|
100
|
-
|
|
125
|
+
.zx-scope,
|
|
126
|
+
[data-zx-theme],
|
|
127
|
+
[data-zx-density],
|
|
128
|
+
[data-zx-preset] {
|
|
101
129
|
--zx-color-glass-chrome: var(--zx-color-bg-surface) !important;
|
|
102
130
|
--zx-color-glass-surface: var(--zx-color-bg-raised) !important;
|
|
103
131
|
--zx-color-glass-control: var(--zx-color-bg-control) !important;
|
|
104
132
|
--zx-color-glass-control-hover: var(--zx-color-bg-hover) !important;
|
|
105
133
|
--zx-color-overlay-surface: var(--zx-color-bg-raised) !important;
|
|
106
134
|
--zx-color-overlay-panel: var(--zx-color-bg-raised) !important;
|
|
135
|
+
--zx-color-overlay-backdrop: var(--zx-color-bg-backdrop) !important;
|
|
136
|
+
--zx-color-overlay-hover: var(--zx-color-bg-hover) !important;
|
|
137
|
+
--zx-color-overlay-selected: var(--zx-color-bg-selected) !important;
|
|
138
|
+
--zx-color-overlay-divider: var(--zx-color-border) !important;
|
|
139
|
+
--zx-color-overlay-scrim: var(--zx-color-bg-raised) !important;
|
|
140
|
+
--zx-overlay-specular-strength: 0% !important;
|
|
141
|
+
--zx-overlay-surface-image: none !important;
|
|
142
|
+
--zx-overlay-toast-image: none !important;
|
|
143
|
+
--zx-overlay-panel-image: none !important;
|
|
107
144
|
--zx-app-icon-core-strength: 68% !important;
|
|
108
145
|
--zx-app-icon-rim-strength: 62% !important;
|
|
109
146
|
--zx-app-icon-bloom-strength: 0% !important;
|
|
@@ -116,21 +153,59 @@
|
|
|
116
153
|
--zx-glass-filter-chrome: none !important;
|
|
117
154
|
--zx-glass-filter-overlay: none !important;
|
|
118
155
|
--zx-glass-filter-panel: none !important;
|
|
156
|
+
--zx-glass-overlay-shadow: var(--zx-overlay-shadow) !important;
|
|
157
|
+
--zx-glass-panel-shadow: var(--zx-overlay-shadow) !important;
|
|
119
158
|
}
|
|
120
159
|
}
|
|
121
160
|
|
|
122
161
|
@media (forced-colors: active) {
|
|
123
162
|
:root,
|
|
124
|
-
|
|
163
|
+
.zx-scope,
|
|
164
|
+
[data-zx-theme],
|
|
165
|
+
[data-zx-density],
|
|
166
|
+
[data-zx-preset] {
|
|
125
167
|
--zx-color-glass-chrome: Canvas !important;
|
|
126
168
|
--zx-color-glass-surface: Canvas !important;
|
|
127
169
|
--zx-color-glass-control: ButtonFace !important;
|
|
128
170
|
--zx-color-glass-control-hover: Highlight !important;
|
|
129
171
|
--zx-color-overlay-surface: Canvas !important;
|
|
130
172
|
--zx-color-overlay-panel: Canvas !important;
|
|
173
|
+
--zx-color-overlay-backdrop: transparent !important;
|
|
131
174
|
--zx-color-overlay-border: CanvasText !important;
|
|
175
|
+
--zx-color-overlay-hover: Highlight !important;
|
|
176
|
+
--zx-color-overlay-selected: Highlight !important;
|
|
177
|
+
--zx-color-overlay-divider: CanvasText !important;
|
|
178
|
+
--zx-color-overlay-scrim: Canvas !important;
|
|
179
|
+
--zx-overlay-specular-strength: 0% !important;
|
|
180
|
+
--zx-overlay-surface-image: none !important;
|
|
181
|
+
--zx-overlay-toast-image: none !important;
|
|
182
|
+
--zx-overlay-panel-image: none !important;
|
|
132
183
|
--zx-glass-control-shadow: none !important;
|
|
133
184
|
--zx-glass-chrome-shadow: none !important;
|
|
134
185
|
--zx-glass-raised-shadow: none !important;
|
|
186
|
+
--zx-glass-filter-overlay: none !important;
|
|
187
|
+
--zx-glass-filter-panel: none !important;
|
|
188
|
+
--zx-glass-overlay-shadow: none !important;
|
|
189
|
+
--zx-glass-panel-shadow: none !important;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Browsers without backdrop filtering get an intentionally opaque material instead of a washed
|
|
194
|
+
translucent colour. This is a capability fallback, independent of user preference fallbacks. */
|
|
195
|
+
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
|
|
196
|
+
:root,
|
|
197
|
+
.zx-scope,
|
|
198
|
+
[data-zx-theme],
|
|
199
|
+
[data-zx-density],
|
|
200
|
+
[data-zx-preset] {
|
|
201
|
+
--zx-color-overlay-surface: var(--zx-color-bg-raised) !important;
|
|
202
|
+
--zx-color-overlay-panel: var(--zx-color-bg-raised) !important;
|
|
203
|
+
--zx-color-overlay-backdrop: var(--zx-color-bg-backdrop) !important;
|
|
204
|
+
--zx-overlay-specular-strength: 0% !important;
|
|
205
|
+
--zx-overlay-surface-image: none !important;
|
|
206
|
+
--zx-overlay-toast-image: none !important;
|
|
207
|
+
--zx-overlay-panel-image: none !important;
|
|
208
|
+
--zx-glass-filter-overlay: none !important;
|
|
209
|
+
--zx-glass-filter-panel: none !important;
|
|
135
210
|
}
|
|
136
211
|
}
|