@zeyos/zx 4.1.1 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/DESIGN-SYSTEM.md +33 -3
  3. package/README.md +22 -5
  4. package/dist/types/components/app-icon/app-icon.d.ts +8 -1
  5. package/dist/types/components/aurora/aurora.d.ts +72 -0
  6. package/dist/types/components/calendar/calendar-model.d.ts +202 -0
  7. package/dist/types/components/calendar/calendar.d.ts +517 -0
  8. package/dist/types/components/card-view/card-view.d.ts +303 -0
  9. package/dist/types/components/card-view/record-card.d.ts +242 -0
  10. package/dist/types/components/dialog/dialog.d.ts +6 -1
  11. package/dist/types/components/dropdown/dropdown.d.ts +5 -0
  12. package/dist/types/components/kanban-view/kanban-view.d.ts +572 -0
  13. package/dist/types/components/launcher/launcher.d.ts +5 -0
  14. package/dist/types/components/message/message.d.ts +9 -1
  15. package/dist/types/components/modal/modal.d.ts +44 -7
  16. package/dist/types/components/sheet/sheet.d.ts +22 -12
  17. package/dist/types/components/table/table.d.ts +120 -31
  18. package/dist/types/components/table-view/table-view.d.ts +192 -0
  19. package/dist/types/components/view/record-view.d.ts +464 -0
  20. package/dist/types/core/overlay-host.d.ts +12 -0
  21. package/dist/types/index.d.ts +7 -0
  22. package/dist/types/zeyos/calendar.d.ts +91 -0
  23. package/dist/types/zeyos/icons.d.ts +18 -2
  24. package/dist/types/zeyos/index.d.ts +4 -0
  25. package/dist/types/zeyos/legacy-saved-views.d.ts +66 -0
  26. package/dist/types/zeyos/saved-views.d.ts +331 -0
  27. package/dist/types/zeyos/view.d.ts +305 -0
  28. package/dist/zx-zeyos.esm.js +4742 -1470
  29. package/dist/zx-zeyos.esm.min.js +1 -1
  30. package/dist/zx.css +2536 -471
  31. package/dist/zx.esm.js +5193 -223
  32. package/dist/zx.esm.min.js +3 -3
  33. package/dist/zx.global.js +5193 -223
  34. package/dist/zx.global.min.js +3 -3
  35. package/dist/zx.min.css +1 -1
  36. package/docs/api.json +1729 -182
  37. package/docs/llms.md +236 -32
  38. package/docs/llms.txt +16 -6
  39. package/package.json +1 -1
  40. package/src/components/account-menu/account-menu.css +1 -1
  41. package/src/components/app-icon/app-icon.css +77 -51
  42. package/src/components/app-icon/app-icon.js +28 -4
  43. package/src/components/app-rail/app-rail.css +12 -3
  44. package/src/components/app-sidebar/app-sidebar.css +11 -2
  45. package/src/components/aurora/aurora.css +143 -0
  46. package/src/components/aurora/aurora.js +146 -0
  47. package/src/components/avatar/avatar.css +1 -1
  48. package/src/components/button/button.css +2 -2
  49. package/src/components/calendar/calendar-model.js +402 -0
  50. package/src/components/calendar/calendar.css +609 -0
  51. package/src/components/calendar/calendar.js +1619 -0
  52. package/src/components/card/card.css +2 -2
  53. package/src/components/card-view/card-view.css +389 -0
  54. package/src/components/card-view/card-view.js +527 -0
  55. package/src/components/card-view/record-card.js +392 -0
  56. package/src/components/context-menu/context-menu.css +4 -4
  57. package/src/components/context-menu/context-menu.js +5 -1
  58. package/src/components/date-picker/date-picker.css +31 -12
  59. package/src/components/datebox/date-range-box.css +17 -2
  60. package/src/components/datebox/datebox.css +18 -3
  61. package/src/components/dialog/dialog.css +4 -3
  62. package/src/components/dialog/dialog.js +2 -1
  63. package/src/components/dropdown/dropdown.css +17 -3
  64. package/src/components/dropdown/dropdown.js +7 -2
  65. package/src/components/kanban-view/kanban-view.css +216 -0
  66. package/src/components/kanban-view/kanban-view.js +1228 -0
  67. package/src/components/launcher/launcher.css +24 -9
  68. package/src/components/launcher/launcher.js +9 -2
  69. package/src/components/master-panel/master-panel.css +14 -3
  70. package/src/components/menu-button/menu-button.css +4 -4
  71. package/src/components/message/message.css +13 -21
  72. package/src/components/message/message.js +17 -11
  73. package/src/components/modal/modal.css +19 -5
  74. package/src/components/modal/modal.js +99 -25
  75. package/src/components/navigation-bar/navigation-bar.css +17 -5
  76. package/src/components/panel/panel.css +10 -2
  77. package/src/components/select/select.css +26 -8
  78. package/src/components/sheet/sheet.css +28 -7
  79. package/src/components/sheet/sheet.js +43 -23
  80. package/src/components/table/table.css +83 -5
  81. package/src/components/table/table.js +322 -37
  82. package/src/components/table-view/table-view.css +18 -0
  83. package/src/components/table-view/table-view.js +347 -0
  84. package/src/components/tag-picker/tag-picker.css +18 -4
  85. package/src/components/tooltip/tooltip.css +17 -3
  86. package/src/components/tooltip/tooltip.js +4 -1
  87. package/src/components/view/record-view.css +114 -0
  88. package/src/components/view/record-view.js +770 -0
  89. package/src/core/overlay-host.js +23 -0
  90. package/src/index.js +15 -0
  91. package/src/zeyos/calendar.js +115 -0
  92. package/src/zeyos/icons.js +11 -4
  93. package/src/zeyos/index.js +13 -0
  94. package/src/zeyos/launcher.js +2 -2
  95. package/src/zeyos/legacy-saved-views.js +155 -0
  96. package/src/zeyos/saved-views.js +815 -0
  97. package/src/zeyos/table.js +3 -1
  98. package/src/zeyos/view.js +543 -0
  99. package/styles/icons.css +3 -10
  100. package/styles/tokens/dark.css +4 -0
  101. package/styles/tokens/semantic.css +142 -3
  102. package/styles/zx.css +6 -0
@@ -96,10 +96,14 @@
96
96
  inline-size: max-content;
97
97
  max-inline-size: calc(100vw - var(--zx-space-4));
98
98
  overflow: hidden;
99
- border: 1px solid var(--zx-color-border-strong);
99
+ border: 1px solid var(--zx-color-overlay-border);
100
100
  border-radius: var(--zx-radius-md);
101
- background: var(--zx-color-bg-raised);
102
- box-shadow: var(--zx-overlay-shadow);
101
+ background-color: var(--zx-color-overlay-surface);
102
+ background-image: var(--zx-overlay-surface-image);
103
+ background-clip: padding-box;
104
+ -webkit-backdrop-filter: var(--zx-glass-filter-overlay);
105
+ backdrop-filter: var(--zx-glass-filter-overlay);
106
+ box-shadow: var(--zx-glass-overlay-shadow);
103
107
  color: var(--zx-color-text);
104
108
  padding: var(--zx-space-1);
105
109
  }
@@ -126,15 +130,15 @@
126
130
  }
127
131
 
128
132
  .zx-select__option[data-active="true"] {
129
- background: var(--zx-color-bg-hover);
133
+ background: var(--zx-color-overlay-hover);
130
134
  }
131
135
 
132
136
  .zx-select__option:hover {
133
- background: var(--zx-color-bg-hover);
137
+ background: var(--zx-color-overlay-hover);
134
138
  }
135
139
 
136
140
  .zx-select__option[aria-selected="true"] {
137
- background: var(--zx-color-bg-selected);
141
+ background: var(--zx-color-overlay-selected);
138
142
  }
139
143
 
140
144
  .zx-select__option > .zx-icon {
@@ -146,7 +150,7 @@
146
150
  position: sticky;
147
151
  z-index: 1;
148
152
  inset-block-start: 0;
149
- background: var(--zx-color-bg-raised);
153
+ background: var(--zx-color-overlay-scrim);
150
154
  color: var(--zx-color-text-muted);
151
155
  font-size: var(--zx-text-xs);
152
156
  font-weight: 700;
@@ -155,10 +159,24 @@
155
159
  text-transform: uppercase;
156
160
  }
157
161
 
162
+ @media (prefers-reduced-transparency: reduce) {
163
+ .zx-select__panel,
164
+ .zx-select__group {
165
+ background: var(--zx-color-bg-raised);
166
+ }
167
+
168
+ .zx-select__panel {
169
+ border-color: var(--zx-color-border-strong);
170
+ -webkit-backdrop-filter: none;
171
+ backdrop-filter: none;
172
+ box-shadow: var(--zx-overlay-shadow);
173
+ }
174
+ }
175
+
158
176
  .zx-select__separator {
159
177
  block-size: 1px;
160
178
  margin: var(--zx-space-1) var(--zx-control-pad-x);
161
- background: var(--zx-color-border);
179
+ background: var(--zx-color-overlay-divider);
162
180
  }
163
181
 
164
182
  .zx-select__empty {
@@ -12,7 +12,7 @@
12
12
  border-radius: 0;
13
13
  /* The header and footer stay put; `.zx-dialog__body` is what scrolls. */
14
14
  overflow: hidden;
15
- box-shadow: var(--zx-overlay-shadow);
15
+ box-shadow: var(--zx-glass-panel-shadow);
16
16
  }
17
17
 
18
18
  /* Horizontal sheets: full height, sized across the inline axis. */
@@ -26,14 +26,14 @@
26
26
  .zx-sheet[data-side="start"] {
27
27
  inset-inline-start: 0;
28
28
  inset-inline-end: auto;
29
- border-inline-end: 1px solid var(--zx-color-border);
29
+ border-inline-end: 1px solid var(--zx-color-overlay-border);
30
30
  --zx-sheet-enter: -100% 0;
31
31
  }
32
32
 
33
33
  .zx-sheet[data-side="end"] {
34
34
  inset-inline-start: auto;
35
35
  inset-inline-end: 0;
36
- border-inline-start: 1px solid var(--zx-color-border);
36
+ border-inline-start: 1px solid var(--zx-color-overlay-border);
37
37
  --zx-sheet-enter: 100% 0;
38
38
  }
39
39
 
@@ -56,7 +56,7 @@
56
56
  .zx-sheet[data-side="top"] {
57
57
  inset-block-start: 0;
58
58
  inset-block-end: auto;
59
- border-block-end: 1px solid var(--zx-color-border);
59
+ border-block-end: 1px solid var(--zx-color-overlay-border);
60
60
  border-end-start-radius: var(--zx-sheet-radius, var(--zx-radius-xl));
61
61
  border-end-end-radius: var(--zx-sheet-radius, var(--zx-radius-xl));
62
62
  --zx-sheet-enter: 0 -100%;
@@ -65,7 +65,7 @@
65
65
  .zx-sheet[data-side="bottom"] {
66
66
  inset-block-start: auto;
67
67
  inset-block-end: 0;
68
- border-block-start: 1px solid var(--zx-color-border);
68
+ border-block-start: 1px solid var(--zx-color-overlay-border);
69
69
  border-start-start-radius: var(--zx-sheet-radius, var(--zx-radius-xl));
70
70
  border-start-end-radius: var(--zx-sheet-radius, var(--zx-radius-xl));
71
71
  --zx-sheet-enter: 0 100%;
@@ -80,9 +80,26 @@
80
80
  }
81
81
 
82
82
  .zx-sheet[data-backdrop="blur"]::backdrop {
83
+ -webkit-backdrop-filter: blur(var(--zx-overlay-blur));
83
84
  backdrop-filter: blur(var(--zx-overlay-blur));
84
85
  }
85
86
 
87
+ /* A non-modal Sheet uses the popover top layer to escape transformed/clipped application shells,
88
+ but it must not gain a visual or interactive modal backdrop in the process. */
89
+ .zx-sheet[data-modality="none"]::backdrop,
90
+ .zx-sheet[data-modality="trap-focus"]::backdrop {
91
+ background: transparent;
92
+ -webkit-backdrop-filter: none;
93
+ backdrop-filter: none;
94
+ }
95
+
96
+ @media (prefers-reduced-transparency: reduce), (prefers-contrast: more), (forced-colors: active) {
97
+ .zx-sheet[data-backdrop="blur"]::backdrop {
98
+ -webkit-backdrop-filter: none;
99
+ backdrop-filter: none;
100
+ }
101
+ }
102
+
86
103
  /*
87
104
  * Entry and exit both animate. A `<dialog>` normally cannot animate out — `close()` applies
88
105
  * `display: none` immediately — so `display` and `overlay` transition with `allow-discrete`, which
@@ -103,13 +120,14 @@
103
120
  animation: none;
104
121
  }
105
122
 
106
- .zx-sheet:not([open]) {
123
+ .zx-sheet:not([open]):not(:popover-open) {
107
124
  translate: var(--zx-sheet-enter, 0 0);
108
125
  opacity: 0;
109
126
  }
110
127
 
111
128
  @starting-style {
112
- .zx-sheet[open] {
129
+ .zx-sheet[open],
130
+ .zx-sheet:popover-open {
113
131
  translate: var(--zx-sheet-enter, 0 0);
114
132
  opacity: 0;
115
133
  }
@@ -156,6 +174,9 @@
156
174
  min-inline-size: 0;
157
175
  min-block-size: 0;
158
176
  border-radius: 0;
177
+ background: var(--zx-color-bg-raised);
178
+ -webkit-backdrop-filter: none;
179
+ backdrop-filter: none;
159
180
  box-shadow: none;
160
181
  }
161
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()`; the other two open with `show()` and re-implement only what they still
65
- * want. That is also why `backdrop` applies only to `modal: true` — `::backdrop` does not render
66
- * for a non-modal dialog, and painting a fake one would make a sheet look blocking while it is not.
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 ?? document.body;
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 the top layer and the flow while
351
- * open — but it is invisible: `_isRealClose()` drops the stale event, and reopening bypasses
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._show();
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
- /** @type {HTMLDialogElement} */ (this.el).show();
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
  /**
@@ -33,15 +33,32 @@
33
33
  inset-inline-end: 0;
34
34
  display: grid;
35
35
  min-inline-size: 190px;
36
- border: 1px solid var(--zx-color-border-strong);
36
+ border: 1px solid var(--zx-color-overlay-border);
37
37
  border-radius: var(--zx-radius-md);
38
- background: var(--zx-color-bg-raised);
39
- box-shadow: var(--zx-overlay-shadow);
38
+ background-color: var(--zx-color-overlay-surface);
39
+ background-image: var(--zx-overlay-surface-image);
40
+ background-clip: padding-box;
41
+ -webkit-backdrop-filter: var(--zx-glass-filter-overlay);
42
+ backdrop-filter: var(--zx-glass-filter-overlay);
43
+ box-shadow: var(--zx-glass-overlay-shadow);
40
44
  padding: var(--zx-space-2);
45
+ max-block-size: min(360px, 70vh);
46
+ overflow: auto;
47
+ }
48
+
49
+ @media (prefers-reduced-transparency: reduce) {
50
+ .zx-table__column-list {
51
+ border-color: var(--zx-color-border-strong);
52
+ background: var(--zx-color-bg-raised);
53
+ -webkit-backdrop-filter: none;
54
+ backdrop-filter: none;
55
+ box-shadow: var(--zx-overlay-shadow);
56
+ }
41
57
  }
42
58
 
43
59
  .zx-table__column-option {
44
- display: flex;
60
+ display: grid;
61
+ grid-template-columns: minmax(0, 1fr) auto;
45
62
  align-items: center;
46
63
  gap: var(--zx-space-2);
47
64
  min-block-size: var(--zx-control-height);
@@ -49,7 +66,68 @@
49
66
  padding-inline: var(--zx-space-2);
50
67
  }
51
68
 
52
- .zx-table__column-option:hover { background: var(--zx-color-bg-hover); }
69
+ .zx-table__column-option:hover { background: var(--zx-color-overlay-hover); }
70
+
71
+ .zx-table__column-option > label,
72
+ .zx-table__column-label {
73
+ display: flex;
74
+ align-items: center;
75
+ gap: var(--zx-space-2);
76
+ min-inline-size: 0;
77
+ }
78
+
79
+ .zx-table__column-option > label > span,
80
+ .zx-table__column-label {
81
+ overflow: hidden;
82
+ text-overflow: ellipsis;
83
+ white-space: nowrap;
84
+ }
85
+
86
+ .zx-table__column-order {
87
+ display: inline-flex;
88
+ }
89
+
90
+ .zx-table__column-move {
91
+ display: inline-grid;
92
+ place-items: center;
93
+ inline-size: 26px;
94
+ block-size: 26px;
95
+ border: 0;
96
+ border-radius: var(--zx-radius-sm);
97
+ background: transparent;
98
+ color: var(--zx-color-text-muted);
99
+ cursor: pointer;
100
+ }
101
+
102
+ .zx-table__column-move:hover:not(:disabled) {
103
+ background: var(--zx-color-bg-hover);
104
+ color: var(--zx-color-text);
105
+ }
106
+
107
+ .zx-table__column-move:focus-visible {
108
+ outline: none;
109
+ box-shadow: var(--zx-focus-ring);
110
+ }
111
+
112
+ .zx-table__column-move:disabled {
113
+ opacity: .35;
114
+ cursor: not-allowed;
115
+ }
116
+
117
+ .zx-table__column-status {
118
+ position: absolute;
119
+ inline-size: 1px;
120
+ block-size: 1px;
121
+ overflow: hidden;
122
+ clip-path: inset(50%);
123
+ }
124
+
125
+ @media (prefers-reduced-motion: no-preference) {
126
+ .zx-table__column-move {
127
+ transition: color var(--zx-dur-fast) var(--zx-ease),
128
+ background var(--zx-dur-fast) var(--zx-ease), opacity var(--zx-dur-fast) var(--zx-ease);
129
+ }
130
+ }
53
131
 
54
132
  .zx-table__reorder-column,
55
133
  .zx-table__reorder-header,