@editora/ui-core 0.2.0 → 0.2.2

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 (153) hide show
  1. package/README.md +8 -0
  2. package/dist/accordion.cjs.js +1 -1
  3. package/dist/accordion.esm.js +1 -1
  4. package/dist/alert-dialog.cjs.js +32 -24
  5. package/dist/alert-dialog.esm.js +48 -40
  6. package/dist/alert.cjs.js +2 -2
  7. package/dist/alert.esm.js +2 -2
  8. package/dist/animated-text.cjs.js +5 -5
  9. package/dist/animated-text.esm.js +5 -5
  10. package/dist/app-header.cjs.js +12 -7
  11. package/dist/app-header.esm.js +12 -7
  12. package/dist/avatar.cjs.js +3 -3
  13. package/dist/avatar.esm.js +3 -3
  14. package/dist/{calendar-o273O28D.js → calendar-CzpWDxLc.js} +5 -4
  15. package/dist/{calendar-DmxiZrR7.mjs → calendar-DkSDFg33.mjs} +1 -0
  16. package/dist/calendar.cjs.js +1 -1
  17. package/dist/calendar.esm.js +1 -1
  18. package/dist/chart.cjs.js +13 -7
  19. package/dist/chart.esm.js +13 -7
  20. package/dist/collapsible.cjs.js +2 -2
  21. package/dist/collapsible.esm.js +2 -2
  22. package/dist/color-picker.cjs.js +3 -3
  23. package/dist/color-picker.esm.js +3 -3
  24. package/dist/combobox.cjs.js +3 -3
  25. package/dist/combobox.esm.js +36 -36
  26. package/dist/components/ui-alert-dialog.d.ts.map +1 -1
  27. package/dist/components/ui-app-header.d.ts.map +1 -1
  28. package/dist/components/ui-calendar.d.ts.map +1 -1
  29. package/dist/components/ui-chart.d.ts.map +1 -1
  30. package/dist/components/ui-gantt.d.ts.map +1 -1
  31. package/dist/components/ui-hover-card.d.ts.map +1 -1
  32. package/dist/components/ui-inline-edit.d.ts.map +1 -1
  33. package/dist/components/ui-multi-select.d.ts.map +1 -1
  34. package/dist/components/ui-sidebar.d.ts.map +1 -1
  35. package/dist/components/ui-tabs.d.ts.map +1 -1
  36. package/dist/components/ui-wizard.d.ts.map +1 -1
  37. package/dist/context-menu.cjs.js +1 -1
  38. package/dist/context-menu.esm.js +1 -1
  39. package/dist/data-table.cjs.js +3 -3
  40. package/dist/data-table.esm.js +3 -3
  41. package/dist/date-field.cjs.js +2 -2
  42. package/dist/date-field.esm.js +14 -14
  43. package/dist/date-picker.cjs.js +3 -3
  44. package/dist/date-picker.esm.js +4 -4
  45. package/dist/date-range-picker.cjs.js +3 -3
  46. package/dist/date-range-picker.esm.js +59 -59
  47. package/dist/date-range-time-picker.cjs.js +2 -2
  48. package/dist/date-range-time-picker.esm.js +3 -3
  49. package/dist/date-time-picker.cjs.js +2 -2
  50. package/dist/date-time-picker.esm.js +3 -3
  51. package/dist/{date-time-utils-DdigV4hs.js → date-time-utils-C-4eHTyy.js} +1 -1
  52. package/dist/{date-time-utils-B4hAkt36.mjs → date-time-utils-zAx4ghvC.mjs} +1 -1
  53. package/dist/description.cjs.js +4 -4
  54. package/dist/description.esm.js +4 -4
  55. package/dist/dialog.cjs.js +2 -2
  56. package/dist/dialog.esm.js +2 -2
  57. package/dist/direction-provider.cjs.js +1 -1
  58. package/dist/direction-provider.esm.js +1 -1
  59. package/dist/dock.cjs.js +1 -1
  60. package/dist/dock.esm.js +1 -1
  61. package/dist/dropdown.cjs.js +1 -1
  62. package/dist/dropdown.esm.js +1 -1
  63. package/dist/field-error.cjs.js +1 -1
  64. package/dist/field-error.esm.js +7 -7
  65. package/dist/field.cjs.js +1 -1
  66. package/dist/field.esm.js +29 -29
  67. package/dist/fieldset.cjs.js +4 -4
  68. package/dist/fieldset.esm.js +3 -3
  69. package/dist/file-upload.cjs.js +2 -2
  70. package/dist/file-upload.esm.js +2 -2
  71. package/dist/flex.cjs.js +2 -2
  72. package/dist/flex.esm.js +8 -8
  73. package/dist/form.cjs.js +4 -4
  74. package/dist/form.esm.js +4 -4
  75. package/dist/gantt.cjs.js +7 -5
  76. package/dist/gantt.esm.js +7 -5
  77. package/dist/grid.cjs.js +1 -1
  78. package/dist/grid.esm.js +1 -1
  79. package/dist/hover-card.cjs.js +1 -1
  80. package/dist/hover-card.esm.js +11 -8
  81. package/dist/index.cjs.js +1 -1
  82. package/dist/index.esm.js +2 -2
  83. package/dist/inline-edit.cjs.js +6 -6
  84. package/dist/inline-edit.esm.js +15 -15
  85. package/dist/input.cjs.js +1 -1
  86. package/dist/input.esm.js +1 -1
  87. package/dist/label.cjs.js +6 -6
  88. package/dist/label.esm.js +6 -6
  89. package/dist/masonry-grid.cjs.js +2 -2
  90. package/dist/masonry-grid.esm.js +11 -11
  91. package/dist/{menu-item-styles-IGSFLAHu.mjs → menu-item-styles-CdqxPUuw.mjs} +15 -15
  92. package/dist/{menu-item-styles-B4onAr4C.js → menu-item-styles-DUdyjQ7i.js} +10 -10
  93. package/dist/menu.cjs.js +1 -1
  94. package/dist/menu.esm.js +1 -1
  95. package/dist/menubar.cjs.js +1 -1
  96. package/dist/menubar.esm.js +1 -1
  97. package/dist/multi-select.cjs.js +7 -7
  98. package/dist/multi-select.esm.js +26 -26
  99. package/dist/number-field.cjs.js +1 -1
  100. package/dist/number-field.esm.js +1 -1
  101. package/dist/number-ticker.cjs.js +4 -4
  102. package/dist/number-ticker.esm.js +10 -10
  103. package/dist/odometer.cjs.js +7 -7
  104. package/dist/odometer.esm.js +14 -14
  105. package/dist/password-field.cjs.js +1 -1
  106. package/dist/password-field.esm.js +1 -1
  107. package/dist/pin-input.cjs.js +1 -1
  108. package/dist/pin-input.esm.js +1 -1
  109. package/dist/placement-grid.cjs.js +1 -1
  110. package/dist/placement-grid.esm.js +1 -1
  111. package/dist/portal.cjs.js +1 -1
  112. package/dist/portal.esm.js +1 -1
  113. package/dist/presence.cjs.js +1 -1
  114. package/dist/presence.esm.js +1 -1
  115. package/dist/quick-actions.cjs.js +1 -1
  116. package/dist/quick-actions.esm.js +1 -1
  117. package/dist/radio.cjs.js +1 -1
  118. package/dist/radio.esm.js +1 -1
  119. package/dist/{runtime-CQM6wZOc.mjs → runtime-CJzoaC8Z.mjs} +385 -329
  120. package/dist/runtime-DYSIU3sR.js +5 -0
  121. package/dist/runtime.cjs.js +1 -1
  122. package/dist/runtime.esm.js +1 -1
  123. package/dist/select.cjs.js +2 -2
  124. package/dist/select.esm.js +2 -2
  125. package/dist/separator.cjs.js +6 -6
  126. package/dist/separator.esm.js +7 -7
  127. package/dist/sidebar.cjs.js +7 -6
  128. package/dist/sidebar.esm.js +7 -6
  129. package/dist/slot.cjs.js +1 -1
  130. package/dist/slot.esm.js +1 -1
  131. package/dist/sortable.cjs.js +6 -6
  132. package/dist/sortable.esm.js +6 -6
  133. package/dist/split-button.cjs.js +2 -2
  134. package/dist/split-button.esm.js +2 -2
  135. package/dist/tabs.cjs.js +11 -6
  136. package/dist/tabs.esm.js +28 -23
  137. package/dist/tags-input.cjs.js +2 -2
  138. package/dist/tags-input.esm.js +2 -2
  139. package/dist/textarea.cjs.js +2 -2
  140. package/dist/textarea.esm.js +16 -16
  141. package/dist/theme.d.ts.map +1 -1
  142. package/dist/time-field.cjs.js +2 -2
  143. package/dist/time-field.esm.js +24 -24
  144. package/dist/time-picker.cjs.js +2 -2
  145. package/dist/time-picker.esm.js +3 -3
  146. package/dist/toast.cjs.js +2 -2
  147. package/dist/toast.esm.js +2 -2
  148. package/dist/transfer-list.cjs.js +9 -9
  149. package/dist/transfer-list.esm.js +4 -4
  150. package/dist/wizard.cjs.js +16 -7
  151. package/dist/wizard.esm.js +16 -7
  152. package/package.json +1 -1
  153. package/dist/runtime-DxCl0A5q.js +0 -5
@@ -1,26 +1,26 @@
1
1
  import "./portal-DeaM1tYY.mjs";
2
2
  import "./positioner-BE8Nbho2.mjs";
3
- function C() {
3
+ function A() {
4
4
  return typeof window < "u" && typeof document < "u";
5
5
  }
6
- function F(n) {
6
+ function N(n) {
7
7
  return n ? typeof n == "string" ? n : n instanceof Error && n.message ? n.message : "Something went wrong. Please try again." : "Something went wrong. Please try again.";
8
8
  }
9
- function j(n) {
9
+ function V(n) {
10
10
  return n === "replace" || n === "stack" ? n : "queue";
11
11
  }
12
- function z(n) {
12
+ function L(n) {
13
13
  return `ui-alert-dialog-${n}`;
14
14
  }
15
- function B(n, a) {
16
- const e = n.kind === "alert" && a.action === "cancel" ? "dismiss" : a.action, r = n.dialog?.getChecked();
15
+ function Z(n, a) {
16
+ const e = n.kind === "alert" && a.action === "cancel" ? "dismiss" : a.action, t = n.dialog?.getChecked();
17
17
  if (n.kind === "prompt") {
18
18
  const i = n.dialog?.getInputValue() ?? n.value ?? "";
19
19
  return {
20
20
  id: n.id,
21
21
  action: e,
22
22
  value: i,
23
- checked: r,
23
+ checked: t,
24
24
  source: a.source,
25
25
  reason: a.reason
26
26
  };
@@ -29,12 +29,12 @@ function B(n, a) {
29
29
  id: n.id,
30
30
  action: e,
31
31
  value: n.value,
32
- checked: r,
32
+ checked: t,
33
33
  source: a.source,
34
34
  reason: a.reason
35
35
  };
36
36
  }
37
- function h(n, a, e) {
37
+ function y(n, a, e) {
38
38
  return n.kind === "prompt" ? {
39
39
  id: n.id,
40
40
  action: "dismiss",
@@ -51,10 +51,10 @@ function h(n, a, e) {
51
51
  reason: e
52
52
  };
53
53
  }
54
- function N(n) {
54
+ function U(n) {
55
55
  return n === "esc" || n === "backdrop" || n === "close-icon" || n === "abort" || n === "unmount" || n === "replace" || n === "programmatic" ? n : "abort";
56
56
  }
57
- class V {
57
+ class Q {
58
58
  constructor(a) {
59
59
  this._container = null, this._ownsContainer = !1, this._queue = [], this._active = [], this._disposed = !1, this._seed = 0, this._defaults = {}, this._container = a ?? null;
60
60
  }
@@ -77,42 +77,42 @@ class V {
77
77
  this._disposed = !0;
78
78
  const e = [...this._active, ...this._queue];
79
79
  this._queue = [];
80
- for (const r of e)
81
- this._settle(r, h(r, a), !1);
80
+ for (const t of e)
81
+ this._settle(t, y(t, a), !1);
82
82
  this._active = [], this._ownsContainer && this._container && this._container.parentElement && this._container.parentElement.removeChild(this._container), this._container = null, this._ownsContainer = !1;
83
83
  }
84
84
  _enqueue(a, e) {
85
- const r = this._mergeOptions(e);
86
- if (!C() || this._disposed) {
85
+ const t = this._mergeOptions(e);
86
+ if (!A() || this._disposed) {
87
87
  const s = {
88
- id: r.id || z(++this._seed),
88
+ id: t.id || L(++this._seed),
89
89
  action: "dismiss",
90
90
  source: "unmount"
91
91
  };
92
92
  return Promise.resolve(s);
93
93
  }
94
- const i = r.id || z(++this._seed), t = j(r.mode);
94
+ const i = t.id || L(++this._seed), r = V(t.mode);
95
95
  return new Promise((s) => {
96
96
  const c = {
97
97
  id: i,
98
98
  kind: a,
99
- mode: t,
100
- options: r,
99
+ mode: r,
100
+ options: t,
101
101
  settled: !1,
102
102
  processing: !1,
103
103
  resolve: s,
104
104
  cleanup: []
105
105
  };
106
- if (r.signal?.aborted) {
107
- this._settle(c, h(c, "abort"), !1);
106
+ if (t.signal?.aborted) {
107
+ this._settle(c, y(c, "abort"), !1);
108
108
  return;
109
109
  }
110
- if (t === "replace") {
110
+ if (r === "replace") {
111
111
  const d = this._active[this._active.length - 1];
112
- d && this._settle(d, h(d, "replace", "replace"), !1, !1), this._open(c);
112
+ d && this._settle(d, y(d, "replace", "replace"), !1, !1), this._open(c);
113
113
  return;
114
114
  }
115
- if (t === "stack") {
115
+ if (r === "stack") {
116
116
  this._open(c);
117
117
  return;
118
118
  }
@@ -126,68 +126,68 @@ class V {
126
126
  _open(a) {
127
127
  const e = this._ensureContainer();
128
128
  if (!e) {
129
- this._settle(a, h(a, "unmount"), !1);
129
+ this._settle(a, y(a, "unmount"), !1);
130
130
  return;
131
131
  }
132
- const r = document.createElement("ui-alert-dialog");
133
- a.dialog = r, a.checked = !!a.options.checkbox?.defaultChecked;
132
+ const t = document.createElement("ui-alert-dialog");
133
+ a.dialog = t, a.checked = !!a.options.checkbox?.defaultChecked;
134
134
  const i = this._buildConfig(a);
135
- r.dialogId = a.id, r.config = i;
136
- const t = (d) => {
135
+ t.dialogId = a.id, t.config = i;
136
+ const r = (d) => {
137
137
  if (a.settled) return;
138
- const u = d.detail;
139
- a.value = u?.inputValue, a.checked = u?.checked;
140
- const x = this._validatePrompt(a);
141
- if (x) {
142
- d.preventDefault(), r.setError(x);
138
+ const f = d.detail;
139
+ a.value = f?.inputValue, a.checked = f?.checked;
140
+ const g = this._validatePrompt(a);
141
+ if (g) {
142
+ d.preventDefault(), t.setError(g);
143
143
  return;
144
144
  }
145
145
  if (!a.options.onConfirm) {
146
- r.clearError();
146
+ t.clearError();
147
147
  return;
148
148
  }
149
- d.preventDefault(), a.processing = !0, r.state = "loading", r.clearError(), Promise.resolve(
149
+ d.preventDefault(), a.processing = !0, t.state = "loading", t.clearError(), Promise.resolve(
150
150
  a.options.onConfirm({
151
151
  id: a.id,
152
152
  value: a.value,
153
153
  checked: a.checked,
154
- dialog: r,
154
+ dialog: t,
155
155
  signal: a.options.signal
156
156
  })
157
157
  ).then(() => {
158
- a.processing = !1, r.state = "idle", r.clearError(), a.settled || r.close("confirm");
159
- }).catch((k) => {
160
- a.processing = !1, r.state = "error", r.setError(F(k));
158
+ a.processing = !1, t.state = "idle", t.clearError(), a.settled || t.close("confirm");
159
+ }).catch((m) => {
160
+ a.processing = !1, t.state = "error", t.setError(N(m));
161
161
  });
162
162
  }, s = () => {
163
- a.settled || (a.value = r.getInputValue(), a.checked = r.getChecked(), r.state === "error" && r.clearError());
163
+ a.settled || (a.value = t.getInputValue(), a.checked = t.getChecked(), t.state === "error" && t.clearError());
164
164
  }, c = (d) => {
165
165
  if (a.settled) return;
166
- const u = d.detail;
167
- this._handleClose(a, u);
166
+ const f = d.detail;
167
+ this._handleClose(a, f);
168
168
  };
169
- if (r.addEventListener("ui-confirm", t), r.addEventListener("ui-change", s), r.addEventListener("ui-close", c), a.cleanup.push(() => r.removeEventListener("ui-confirm", t)), a.cleanup.push(() => r.removeEventListener("ui-change", s)), a.cleanup.push(() => r.removeEventListener("ui-close", c)), a.options.signal) {
169
+ if (t.addEventListener("ui-confirm", r), t.addEventListener("ui-change", s), t.addEventListener("ui-close", c), a.cleanup.push(() => t.removeEventListener("ui-confirm", r)), a.cleanup.push(() => t.removeEventListener("ui-change", s)), a.cleanup.push(() => t.removeEventListener("ui-close", c)), a.options.signal) {
170
170
  const d = () => {
171
- a.settled || this._settle(a, h(a, "abort"), !1);
171
+ a.settled || this._settle(a, y(a, "abort"), !1);
172
172
  };
173
173
  a.options.signal.addEventListener("abort", d, { once: !0 }), a.cleanup.push(() => a.options.signal?.removeEventListener("abort", d));
174
174
  }
175
- this._active.push(a), e.appendChild(r), r.open = !0, this._updateStackZIndex();
175
+ this._active.push(a), e.appendChild(t), t.open = !0, this._updateStackZIndex();
176
176
  }
177
177
  _validatePrompt(a) {
178
178
  if (a.kind !== "prompt") return null;
179
- const r = a.options.input, i = a.dialog?.getInputValue() ?? a.value ?? "";
180
- return r?.required && !i.trim() ? "Please enter a value." : r?.validate ? r.validate(i) : null;
179
+ const t = a.options.input, i = a.dialog?.getInputValue() ?? a.value ?? "";
180
+ return t?.required && !i.trim() ? "Please enter a value." : t?.validate ? t.validate(i) : null;
181
181
  }
182
- _settle(a, e, r, i = !0) {
182
+ _settle(a, e, t, i = !0) {
183
183
  if (!a.settled) {
184
- if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((t) => t !== a), this._queue = this._queue.filter((t) => t !== a), a.dialog) {
185
- const t = a.dialog;
186
- if (!r && t.open) {
187
- const s = N(e.source);
188
- t.close("dismiss", s, e.reason);
184
+ if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((r) => r !== a), this._queue = this._queue.filter((r) => r !== a), a.dialog) {
185
+ const r = a.dialog;
186
+ if (!t && r.open) {
187
+ const s = U(e.source);
188
+ r.close("dismiss", s, e.reason);
189
189
  }
190
- t.parentElement && t.parentElement.removeChild(t);
190
+ r.parentElement && r.parentElement.removeChild(r);
191
191
  }
192
192
  a.resolve(e), this._updateStackZIndex(), !this._disposed && i && this._drainQueue();
193
193
  }
@@ -205,7 +205,7 @@ class V {
205
205
  a && this._open(a);
206
206
  }
207
207
  _buildConfig(a) {
208
- const e = a.options, r = a.kind === "prompt", i = a.kind === "alert", t = r ? e.input : void 0;
208
+ const e = a.options, t = a.kind === "prompt", i = a.kind === "alert", r = t ? e.input : void 0;
209
209
  return {
210
210
  id: a.id,
211
211
  title: e.title,
@@ -219,7 +219,7 @@ class V {
219
219
  closeOnBackdrop: e.closeOnBackdrop,
220
220
  lockWhileLoading: e.lockWhileLoading ?? !0,
221
221
  role: e.role || "alertdialog",
222
- tone: e.tone || (i ? "info" : r ? "neutral" : "warning"),
222
+ tone: e.tone || (i ? "info" : t ? "neutral" : "warning"),
223
223
  size: e.size || "md",
224
224
  variant: e.variant || "surface",
225
225
  radius: e.radius,
@@ -233,11 +233,11 @@ class V {
233
233
  showCancel: !i,
234
234
  showClose: e.dismissible ?? !0,
235
235
  input: {
236
- enabled: r,
237
- label: t?.label,
238
- placeholder: t?.placeholder,
239
- value: t?.defaultValue || "",
240
- required: t?.required
236
+ enabled: t,
237
+ label: r?.label,
238
+ placeholder: r?.placeholder,
239
+ value: r?.defaultValue || "",
240
+ required: r?.required
241
241
  },
242
242
  checkbox: {
243
243
  enabled: !!e.checkbox?.enabled,
@@ -256,10 +256,10 @@ class V {
256
256
  };
257
257
  }
258
258
  _handleClose(a, e) {
259
- const r = B(a, e);
259
+ const t = Z(a, e);
260
260
  if (e.action === "cancel" && a.options.onCancel) {
261
261
  Promise.resolve(a.options.onCancel(this._buildLifecycleContext(a))).finally(() => {
262
- this._settle(a, r, !0);
262
+ this._settle(a, t, !0);
263
263
  });
264
264
  return;
265
265
  }
@@ -271,11 +271,11 @@ class V {
271
271
  reason: e.reason
272
272
  })
273
273
  ).finally(() => {
274
- this._settle(a, r, !0);
274
+ this._settle(a, t, !0);
275
275
  });
276
276
  return;
277
277
  }
278
- this._settle(a, r, !0);
278
+ this._settle(a, t, !0);
279
279
  }
280
280
  _mergeOptions(a) {
281
281
  const e = this._defaults;
@@ -289,7 +289,7 @@ class V {
289
289
  };
290
290
  }
291
291
  _ensureContainer() {
292
- if (!C()) return null;
292
+ if (!A()) return null;
293
293
  if (this._container && this._container.isConnected) return this._container;
294
294
  let a = document.querySelector('[data-ui-alert-dialog-host="true"]');
295
295
  return a ? this._ownsContainer = !1 : (a = document.createElement("div"), a.setAttribute("data-ui-alert-dialog-host", "true"), a.style.position = "relative", a.style.zIndex = "1000", document.body.appendChild(a), this._ownsContainer = !0), this._container = a, a;
@@ -301,38 +301,38 @@ class V {
301
301
  }
302
302
  }
303
303
  }
304
- let g = null;
305
- function Z(n = {}) {
306
- return new V(n.container ?? null);
304
+ let h = null;
305
+ function W(n = {}) {
306
+ return new Q(n.container ?? null);
307
307
  }
308
- function S() {
309
- return g || (g = Z()), g;
308
+ function T() {
309
+ return h || (h = W()), h;
310
310
  }
311
- function da(n = {}) {
312
- return S().alert(n);
311
+ function xa(n = {}) {
312
+ return T().alert(n);
313
313
  }
314
- function fa(n = {}) {
315
- return S().confirm(n);
314
+ function ha(n = {}) {
315
+ return T().confirm(n);
316
316
  }
317
- function ua(n = {}) {
318
- return S().prompt(n);
317
+ function ba(n = {}) {
318
+ return T().prompt(n);
319
319
  }
320
- function ga(n = "programmatic") {
321
- g && (g.destroy(n), g = null);
320
+ function va(n = "programmatic") {
321
+ h && (h.destroy(n), h = null);
322
322
  }
323
- function E() {
323
+ function I() {
324
324
  return typeof window < "u" && typeof document < "u";
325
325
  }
326
- function U(n) {
326
+ function G(n) {
327
327
  return n === "replace" || n === "stack" ? n : "queue";
328
328
  }
329
- function A(n) {
329
+ function O(n) {
330
330
  return `ui-dialog-${n}`;
331
331
  }
332
- function Q(n) {
332
+ function X(n) {
333
333
  return n ? typeof n == "string" ? n : n instanceof Error && n.message ? n.message : "Something went wrong. Please try again." : "Something went wrong. Please try again.";
334
334
  }
335
- class W {
335
+ class K {
336
336
  constructor(a) {
337
337
  this._container = null, this._ownsContainer = !1, this._queue = [], this._active = [], this._disposed = !1, this._seed = 0, this._container = a ?? null;
338
338
  }
@@ -349,9 +349,9 @@ class W {
349
349
  this._disposed = !0;
350
350
  const e = [...this._active, ...this._queue];
351
351
  this._queue = [];
352
- for (const r of e)
353
- this._settle(r, {
354
- id: r.id,
352
+ for (const t of e)
353
+ this._settle(t, {
354
+ id: t.id,
355
355
  action: "dismiss",
356
356
  source: a,
357
357
  reason: a
@@ -359,40 +359,40 @@ class W {
359
359
  this._active = [], this._ownsContainer && this._container && this._container.parentElement && this._container.parentElement.removeChild(this._container), this._container = null, this._ownsContainer = !1;
360
360
  }
361
361
  _enqueue(a) {
362
- if (!E() || this._disposed)
362
+ if (!I() || this._disposed)
363
363
  return Promise.resolve({
364
- id: a.id || A(++this._seed),
364
+ id: a.id || O(++this._seed),
365
365
  action: "dismiss",
366
366
  source: "unmount"
367
367
  });
368
- const e = a.id || A(++this._seed), r = U(a.mode);
368
+ const e = a.id || O(++this._seed), t = G(a.mode);
369
369
  return new Promise((i) => {
370
- const t = {
370
+ const r = {
371
371
  id: e,
372
- mode: r,
372
+ mode: t,
373
373
  options: a,
374
374
  settled: !1,
375
375
  resolve: i,
376
376
  cleanup: []
377
377
  };
378
378
  if (a.signal?.aborted) {
379
- this._settle(t, { id: e, action: "dismiss", source: "abort" }, !1);
379
+ this._settle(r, { id: e, action: "dismiss", source: "abort" }, !1);
380
380
  return;
381
381
  }
382
- if (r === "replace") {
382
+ if (t === "replace") {
383
383
  const s = this._active[this._active.length - 1];
384
- s && this._settle(s, { id: s.id, action: "dismiss", source: "replace", reason: "replace" }, !1, !1), this._open(t);
384
+ s && this._settle(s, { id: s.id, action: "dismiss", source: "replace", reason: "replace" }, !1, !1), this._open(r);
385
385
  return;
386
386
  }
387
- if (r === "stack") {
388
- this._open(t);
387
+ if (t === "stack") {
388
+ this._open(r);
389
389
  return;
390
390
  }
391
391
  if (this._active.length > 0) {
392
- this._queue.push(t);
392
+ this._queue.push(r);
393
393
  return;
394
394
  }
395
- this._open(t);
395
+ this._open(r);
396
396
  });
397
397
  }
398
398
  _open(a) {
@@ -405,28 +405,28 @@ class W {
405
405
  }, !1);
406
406
  return;
407
407
  }
408
- const r = document.createElement("ui-dialog");
409
- a.dialog = r;
408
+ const t = document.createElement("ui-dialog");
409
+ a.dialog = t;
410
410
  const i = this._buildConfig(a.options, a.id);
411
- r.dialogId = a.id, r.config = i;
412
- const t = (c) => {
411
+ t.dialogId = a.id, t.config = i;
412
+ const r = (c) => {
413
413
  if (a.settled) return;
414
414
  const d = c.detail;
415
415
  if (a.resultFormData = d?.formData, !a.options.onSubmit) {
416
- r.clearError();
416
+ t.clearError();
417
417
  return;
418
418
  }
419
- c.preventDefault(), r.state = "loading", r.clearError(), Promise.resolve(
419
+ c.preventDefault(), t.state = "loading", t.clearError(), Promise.resolve(
420
420
  a.options.onSubmit({
421
421
  id: a.id,
422
- dialog: r,
422
+ dialog: t,
423
423
  signal: a.options.signal,
424
424
  formData: d?.formData
425
425
  })
426
426
  ).then(() => {
427
- a.settled || (r.state = "idle", r.clearError(), r.close("submit"));
428
- }).catch((u) => {
429
- r.state = "error", r.setError(Q(u));
427
+ a.settled || (t.state = "idle", t.clearError(), t.close("submit"));
428
+ }).catch((f) => {
429
+ t.state = "error", t.setError(X(f));
430
430
  });
431
431
  }, s = (c) => {
432
432
  if (a.settled) return;
@@ -439,7 +439,7 @@ class W {
439
439
  formData: a.resultFormData
440
440
  }, !0);
441
441
  };
442
- if (r.addEventListener("ui-submit", t), r.addEventListener("ui-close", s), a.cleanup.push(() => r.removeEventListener("ui-submit", t)), a.cleanup.push(() => r.removeEventListener("ui-close", s)), a.options.signal) {
442
+ if (t.addEventListener("ui-submit", r), t.addEventListener("ui-close", s), a.cleanup.push(() => t.removeEventListener("ui-submit", r)), a.cleanup.push(() => t.removeEventListener("ui-close", s)), a.options.signal) {
443
443
  const c = () => {
444
444
  a.settled || this._settle(a, {
445
445
  id: a.id,
@@ -449,13 +449,13 @@ class W {
449
449
  };
450
450
  a.options.signal.addEventListener("abort", c, { once: !0 }), a.cleanup.push(() => a.options.signal?.removeEventListener("abort", c));
451
451
  }
452
- this._active.push(a), e.appendChild(r), r.openDialog(), this._updateStackZIndex();
452
+ this._active.push(a), e.appendChild(t), t.openDialog(), this._updateStackZIndex();
453
453
  }
454
- _settle(a, e, r, i = !0) {
454
+ _settle(a, e, t, i = !0) {
455
455
  if (!a.settled) {
456
- if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((t) => t !== a), this._queue = this._queue.filter((t) => t !== a), a.dialog) {
457
- const t = a.dialog;
458
- !r && t.open && t.close("dismiss", e.source || "abort", e.reason), t.parentElement && t.parentElement.removeChild(t);
456
+ if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((r) => r !== a), this._queue = this._queue.filter((r) => r !== a), a.dialog) {
457
+ const r = a.dialog;
458
+ !t && r.open && r.close("dismiss", e.source || "abort", e.reason), r.parentElement && r.parentElement.removeChild(r);
459
459
  }
460
460
  a.resolve(e), this._updateStackZIndex(), !this._disposed && i && this._drainQueue();
461
461
  }
@@ -497,7 +497,7 @@ class W {
497
497
  };
498
498
  }
499
499
  _ensureContainer() {
500
- if (!E()) return null;
500
+ if (!I()) return null;
501
501
  if (this._container && this._container.isConnected) return this._container;
502
502
  let a = document.querySelector('[data-ui-dialog-host="true"]');
503
503
  return a ? this._ownsContainer = !1 : (a = document.createElement("div"), a.setAttribute("data-ui-dialog-host", "true"), a.style.position = "relative", a.style.zIndex = "1200", document.body.appendChild(a), this._ownsContainer = !0), this._container = a, a;
@@ -509,36 +509,36 @@ class W {
509
509
  }
510
510
  }
511
511
  }
512
- let m = null;
513
- function G(n = {}) {
514
- return new W(n.container ?? null);
512
+ let b = null;
513
+ function J(n = {}) {
514
+ return new K(n.container ?? null);
515
515
  }
516
- function L() {
517
- return m || (m = G()), m;
516
+ function M() {
517
+ return b || (b = J()), b;
518
518
  }
519
- function ma(n = {}) {
520
- return L().open(n);
519
+ function ya(n = {}) {
520
+ return M().open(n);
521
521
  }
522
- function xa(n = {}) {
523
- return L().confirm(n);
522
+ function wa(n = {}) {
523
+ return M().confirm(n);
524
524
  }
525
- function ha(n = "programmatic") {
526
- m && (m.destroy(n), m = null);
525
+ function ka(n = "programmatic") {
526
+ b && (b.destroy(n), b = null);
527
527
  }
528
- const K = ["1", "2", "3", "4"], X = { 1: "24px", 2: "32px", 3: "40px", 4: "48px" }, J = { 1: "12px", 2: "14px", 3: "16px", 4: "18px" }, Y = { 1: "8px", 2: "12px", 3: "16px", 4: "20px" }, q = { 1: 0, 2: 0, 3: 2, 4: 4 };
529
- function aa(n) {
530
- const a = n.palette?.gray || {}, e = n.palette?.accent || {}, r = n.radiusScale || {}, i = n.colors, t = {}, s = (c, d) => {
531
- d && (t[c] = d);
528
+ const Y = ["1", "2", "3", "4"], q = { 1: "24px", 2: "32px", 3: "40px", 4: "48px" }, aa = { 1: "12px", 2: "14px", 3: "16px", 4: "18px" }, ea = { 1: "8px", 2: "12px", 3: "16px", 4: "20px" }, na = { 1: 0, 2: 0, 3: 2, 4: 4 };
529
+ function ta(n) {
530
+ const a = n.palette?.gray || {}, e = n.palette?.accent || {}, t = n.radiusScale || {}, i = n.colors, r = {}, s = (c, d) => {
531
+ d && (r[c] = d);
532
532
  };
533
- s("--ui-color-surface-subtle", a[2]), s("--ui-color-fill", a[3]), s("--ui-color-fill-hover", a[4]), s("--ui-color-fill-active", a[5]), s("--ui-color-line-subtle", a[6]), s("--ui-color-line", a[7]), s("--ui-color-line-strong", a[8]), s("--ui-color-text-secondary", a[11] || i.muted), s("--ui-color-text-strong", a[12] || i.text), s("--ui-color-accent-subtle", e[2]), s("--ui-color-accent-fill", e[3]), s("--ui-color-accent-fill-hover", e[4]), s("--ui-color-accent-fill-active", e[5]), s("--ui-color-accent-line", e[7]), s("--ui-color-accent-solid", e[9] || i.primary), s("--ui-color-accent-solid-hover", e[10] || i.primaryHover || i.primary), s("--ui-color-accent-text", e[11]), s("--ui-color-surface-elevated", n.surfaces?.panelSolid || i.surfaceAlt || i.surface), s("--ui-color-info", i.info), s("--ui-color-placeholder", i.text ? `color-mix(in srgb, ${i.text} 62%, transparent)` : void 0), s("--ui-ring-color", i.focusRing || i.primary), t["--ui-ring-width"] = "2px", t["--ui-ring-offset"] = "2px";
534
- for (const c of K) {
535
- t[`--ui-control-height-${c}`] = X[c], t[`--ui-control-font-size-${c}`] = J[c], t[`--ui-control-padding-inline-${c}`] = Y[c];
536
- const d = q[c], u = n.radius || r[2] || "6px";
537
- t[`--ui-control-radius-${c}`] = d ? `calc(${u} + ${d}px)` : u;
533
+ s("--ui-color-surface-subtle", a[2]), s("--ui-color-fill", a[3]), s("--ui-color-fill-hover", a[4]), s("--ui-color-fill-active", a[5]), s("--ui-color-line-subtle", a[6]), s("--ui-color-line", a[7]), s("--ui-color-line-strong", a[8]), s("--ui-color-text-secondary", a[11] || i.muted), s("--ui-color-text-strong", a[12] || i.text), s("--ui-color-accent-subtle", e[2]), s("--ui-color-accent-fill", e[3]), s("--ui-color-accent-fill-hover", e[4]), s("--ui-color-accent-fill-active", e[5]), s("--ui-color-accent-line", e[7]), s("--ui-color-accent-solid", e[9] || i.primary), s("--ui-color-accent-solid-hover", e[10] || i.primaryHover || i.primary), s("--ui-color-accent-text", e[11]), s("--ui-color-surface-elevated", n.surfaces?.panelSolid || i.surfaceAlt || i.surface), s("--ui-color-info", i.info), s("--ui-color-placeholder", i.text ? `color-mix(in srgb, ${i.text} 62%, transparent)` : void 0), s("--ui-ring-color", i.focusRing || i.primary), r["--ui-ring-width"] = "2px", r["--ui-ring-offset"] = "2px";
534
+ for (const c of Y) {
535
+ r[`--ui-control-height-${c}`] = q[c], r[`--ui-control-font-size-${c}`] = aa[c], r[`--ui-control-padding-inline-${c}`] = ea[c];
536
+ const d = na[c], f = n.radius || t[2] || "6px";
537
+ r[`--ui-control-radius-${c}`] = d ? `calc(${f} + ${d}px)` : f;
538
538
  }
539
- return t["--ui-motion-enter-easing"] = "cubic-bezier(0.16, 1, 0.3, 1)", t["--ui-motion-exit-easing"] = "cubic-bezier(0.4, 0, 1, 1)", s("--ui-font-family-mono", n.typography?.codeFamily || "monospace"), s("--font-mono", n.typography?.codeFamily || "monospace"), s("--ui-breakpoint-xl", n.breakpoints?.xl || "1280px"), t;
539
+ return r["--ui-motion-enter-easing"] = "cubic-bezier(0.16, 1, 0.3, 1)", r["--ui-motion-exit-easing"] = "cubic-bezier(0.4, 0, 1, 1)", s("--ui-font-family-mono", n.typography?.codeFamily || "monospace"), s("--font-mono", n.typography?.codeFamily || "monospace"), s("--ui-breakpoint-xl", n.breakpoints?.xl || "1280px"), r;
540
540
  }
541
- const O = {
541
+ const R = {
542
542
  1: "#0000000d",
543
543
  2: "#0000001a",
544
544
  3: "#00000026",
@@ -551,7 +551,7 @@ const O = {
551
551
  10: "#000c",
552
552
  11: "#000000e6",
553
553
  12: "#000000f2"
554
- }, I = {
554
+ }, $ = {
555
555
  1: "#ffffff0d",
556
556
  2: "#ffffff1a",
557
557
  3: "#ffffff26",
@@ -564,7 +564,7 @@ const O = {
564
564
  10: "#fffc",
565
565
  11: "#ffffffe6",
566
566
  12: "#fffffff2"
567
- }, f = {
567
+ }, u = {
568
568
  amber: {
569
569
  light: {
570
570
  scale: {
@@ -915,7 +915,7 @@ const O = {
915
915
  track: "#7b7b7b"
916
916
  }
917
917
  }
918
- }, ea = {
918
+ }, ra = {
919
919
  button: {
920
920
  "classic-after-inset": "2px",
921
921
  "classic-box-shadow-top": "inset 0 0 0 1px var(--gray-a5), inset 0 1px 1px var(--white-a10)",
@@ -1164,7 +1164,7 @@ const O = {
1164
1164
  input: {
1165
1165
  bg: "var(--color-panel-solid)"
1166
1166
  }
1167
- }, na = {
1167
+ }, ia = {
1168
1168
  button: {
1169
1169
  "classic-after-inset": "1px",
1170
1170
  "classic-box-shadow-top": "inset 0 0 0 1px var(--white-a2), inset 0 4px 2px -2px var(--white-a3), inset 0 1px 1px var(--white-a6), inset 0 -1px 1px var(--black-a6)",
@@ -1414,41 +1414,41 @@ const O = {
1414
1414
  bg: "var(--color-panel-solid)"
1415
1415
  }
1416
1416
  };
1417
- function b(n) {
1417
+ function w(n) {
1418
1418
  const a = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(n.trim())?.[1];
1419
1419
  if (!a) return null;
1420
- const e = a.length === 3 ? a.replace(/./g, (i) => i + i) : a.slice(0, 6), r = (i) => {
1421
- const t = parseInt(e.slice(i, i + 2), 16) / 255;
1422
- return t <= 0.03928 ? t / 12.92 : ((t + 0.055) / 1.055) ** 2.4;
1420
+ const e = a.length === 3 ? a.replace(/./g, (i) => i + i) : a.slice(0, 6), t = (i) => {
1421
+ const r = parseInt(e.slice(i, i + 2), 16) / 255;
1422
+ return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
1423
1423
  };
1424
- return 0.2126 * r(0) + 0.7152 * r(2) + 0.0722 * r(4);
1424
+ return 0.2126 * t(0) + 0.7152 * t(2) + 0.0722 * t(4);
1425
1425
  }
1426
- function _(n, a) {
1427
- const e = b(n), r = b(a);
1428
- return e === null || r === null ? null : (Math.max(e, r) + 0.05) / (Math.min(e, r) + 0.05);
1426
+ function v(n, a) {
1427
+ const e = w(n), t = w(a);
1428
+ return e === null || t === null ? null : (Math.max(e, t) + 0.05) / (Math.min(e, t) + 0.05);
1429
1429
  }
1430
- function ra(n, a) {
1430
+ function oa(n, a) {
1431
1431
  const e = n?.colors;
1432
1432
  if (!e?.primary) return {};
1433
- const r = e.foregroundOnPrimary;
1434
- return a ? e.primary === a.colors?.primary ? {} : r && r !== a.colors?.foregroundOnPrimary ? {} : { foregroundOnPrimary: v(e.primary, a.colors?.foregroundOnPrimary || "#ffffff") } : r ? {} : { foregroundOnPrimary: v(e.primary, "#ffffff") };
1433
+ const t = e.foregroundOnPrimary;
1434
+ return a ? e.primary === a.colors?.primary ? {} : t && t !== a.colors?.foregroundOnPrimary ? {} : { foregroundOnPrimary: k(e.primary, a.colors?.foregroundOnPrimary || "#ffffff") } : t ? {} : { foregroundOnPrimary: k(e.primary, "#ffffff") };
1435
1435
  }
1436
- function v(n, a) {
1437
- const e = _(a, n);
1436
+ function k(n, a) {
1437
+ const e = v(a, n);
1438
1438
  if (e === null || e >= 4.5) return a;
1439
- const r = _("#ffffff", n) ?? 0;
1440
- return (_("#111111", n) ?? 0) > r ? "#111111" : "#ffffff";
1439
+ const t = v("#ffffff", n) ?? 0;
1440
+ return (v("#111111", n) ?? 0) > t ? "#111111" : "#ffffff";
1441
1441
  }
1442
- function P(n) {
1442
+ function H(n) {
1443
1443
  return {
1444
1444
  primary: n.scale[9],
1445
1445
  primaryHover: n.scale[10] || n.scale[9],
1446
- foregroundOnPrimary: v(n.scale[9], n.contrast),
1446
+ foregroundOnPrimary: k(n.scale[9], n.contrast),
1447
1447
  focusRing: n.scale[8] || n.scale[9],
1448
1448
  warning: n.scale[9]
1449
1449
  };
1450
1450
  }
1451
- const y = {
1451
+ const _ = {
1452
1452
  colors: {
1453
1453
  primary: "#ffc53d",
1454
1454
  primaryHover: "#ffba18",
@@ -1494,18 +1494,18 @@ const y = {
1494
1494
  11: "#0000009b",
1495
1495
  12: "#000000df"
1496
1496
  },
1497
- blackAlpha: O,
1498
- whiteAlpha: I,
1497
+ blackAlpha: R,
1498
+ whiteAlpha: $,
1499
1499
  accent: {
1500
- ...f.amber.light.scale
1500
+ ...u.amber.light.scale
1501
1501
  },
1502
1502
  accentAlpha: {
1503
- ...f.amber.light.alphaScale
1503
+ ...u.amber.light.alphaScale
1504
1504
  },
1505
- accentContrast: f.amber.light.contrast,
1506
- accentSurface: f.amber.light.surface,
1507
- accentIndicator: f.amber.light.indicator,
1508
- accentTrack: f.amber.light.track
1505
+ accentContrast: u.amber.light.contrast,
1506
+ accentSurface: u.amber.light.surface,
1507
+ accentIndicator: u.amber.light.indicator,
1508
+ accentTrack: u.amber.light.track
1509
1509
  },
1510
1510
  surfaces: {
1511
1511
  background: "#ffffff",
@@ -1603,11 +1603,11 @@ const y = {
1603
1603
  effects: {
1604
1604
  backdropFilterPanel: "blur(64px)"
1605
1605
  },
1606
- components: ea,
1606
+ components: ra,
1607
1607
  zIndex: { modal: 1e3, overlay: 900, toast: 1100 },
1608
1608
  breakpoints: { sm: "640px", md: "768px", lg: "1024px" }
1609
- }, ta = {
1610
- ...y,
1609
+ }, sa = {
1610
+ ..._,
1611
1611
  colors: {
1612
1612
  primary: "#ffc53d",
1613
1613
  primaryHover: "#ffd60a",
@@ -1625,7 +1625,7 @@ const y = {
1625
1625
  info: "#4cc3d6"
1626
1626
  },
1627
1627
  palette: {
1628
- ...y.palette,
1628
+ ..._.palette,
1629
1629
  gray: {
1630
1630
  1: "#111",
1631
1631
  2: "#191919",
@@ -1654,18 +1654,18 @@ const y = {
1654
1654
  11: "#ffffffaf",
1655
1655
  12: "#ffffffed"
1656
1656
  },
1657
- blackAlpha: O,
1658
- whiteAlpha: I,
1657
+ blackAlpha: R,
1658
+ whiteAlpha: $,
1659
1659
  accent: {
1660
- ...f.amber.dark.scale
1660
+ ...u.amber.dark.scale
1661
1661
  },
1662
1662
  accentAlpha: {
1663
- ...f.amber.dark.alphaScale
1663
+ ...u.amber.dark.alphaScale
1664
1664
  },
1665
- accentContrast: f.amber.dark.contrast,
1666
- accentSurface: f.amber.dark.surface,
1667
- accentIndicator: f.amber.dark.indicator,
1668
- accentTrack: f.amber.dark.track
1665
+ accentContrast: u.amber.dark.contrast,
1666
+ accentSurface: u.amber.dark.surface,
1667
+ accentIndicator: u.amber.dark.indicator,
1668
+ accentTrack: u.amber.dark.track
1669
1669
  },
1670
1670
  surfaces: {
1671
1671
  background: "#111111",
@@ -1687,141 +1687,141 @@ const y = {
1687
1687
  5: "0 0 0 1px var(--gray-a6),0 12px 60px var(--black-a5),0 12px 32px -16px var(--black-a7)",
1688
1688
  6: "0 0 0 1px var(--gray-a6),0 12px 60px var(--black-a4),0 16px 64px var(--black-a6),0 16px 36px -20px var(--black-a11)"
1689
1689
  },
1690
- components: na
1691
- }, ba = y, D = /* @__PURE__ */ new Set();
1690
+ components: ia
1691
+ }, _a = _, F = /* @__PURE__ */ new Set();
1692
1692
  function p(n, a) {
1693
1693
  if (!(!n && !a))
1694
1694
  return { ...n || {}, ...a || {} };
1695
1695
  }
1696
- function ia(n) {
1697
- const a = n?.colors, e = n?.surfaces || {}, r = {};
1698
- if (!a) return r;
1699
- if (a.background && !e.background && (r.background = a.background), a.surface) {
1696
+ function ca(n) {
1697
+ const a = n?.colors, e = n?.surfaces || {}, t = {};
1698
+ if (!a) return t;
1699
+ if (a.background && !e.background && (t.background = a.background), a.surface) {
1700
1700
  const i = `color-mix(in srgb, ${a.surface} 80%, transparent)`;
1701
- e.surface || (r.surface = a.surface), e.panelSolid || (r.panelSolid = a.surface), e.panel || (r.panel = i), e.panelTranslucent || (r.panelTranslucent = i);
1701
+ e.surface || (t.surface = a.surface), e.panelSolid || (t.panelSolid = a.surface), e.panel || (t.panel = i), e.panelTranslucent || (t.panelTranslucent = i);
1702
1702
  }
1703
- return r;
1703
+ return t;
1704
1704
  }
1705
- function w(n, a) {
1706
- const e = a?.mode || "light", r = e === "dark" ? ta : y, i = a?.accentPalette, t = i ? f[i][e] : null, s = t ? {
1705
+ function S(n, a) {
1706
+ const e = a?.mode || "light", t = e === "dark" ? sa : _, i = a?.accentPalette, r = i ? u[i][e] : null, s = r ? {
1707
1707
  colors: {
1708
- ...P(t)
1708
+ ...H(r)
1709
1709
  },
1710
1710
  palette: {
1711
- accent: t.scale,
1712
- accentAlpha: t.alphaScale,
1713
- accentContrast: t.contrast,
1714
- accentSurface: t.surface,
1715
- accentIndicator: t.indicator,
1716
- accentTrack: t.track
1711
+ accent: r.scale,
1712
+ accentAlpha: r.alphaScale,
1713
+ accentContrast: r.contrast,
1714
+ accentSurface: r.surface,
1715
+ accentIndicator: r.indicator,
1716
+ accentTrack: r.track
1717
1717
  }
1718
1718
  } : null;
1719
1719
  return {
1720
- ...r,
1720
+ ...t,
1721
1721
  ...n,
1722
1722
  colors: {
1723
- ...r.colors,
1723
+ ...t.colors,
1724
1724
  ...s?.colors || {},
1725
1725
  ...n?.colors || {},
1726
- ...ra(n)
1726
+ ...oa(n)
1727
1727
  },
1728
1728
  palette: {
1729
- ...r.palette || {},
1729
+ ...t.palette || {},
1730
1730
  ...s?.palette || {},
1731
1731
  ...n?.palette || {},
1732
- gray: p(r.palette?.gray, n?.palette?.gray),
1733
- grayAlpha: p(r.palette?.grayAlpha, n?.palette?.grayAlpha),
1734
- blackAlpha: p(r.palette?.blackAlpha, n?.palette?.blackAlpha),
1735
- whiteAlpha: p(r.palette?.whiteAlpha, n?.palette?.whiteAlpha),
1736
- accent: p(t?.scale || r.palette?.accent, n?.palette?.accent),
1737
- accentAlpha: p(t?.alphaScale || r.palette?.accentAlpha, n?.palette?.accentAlpha)
1732
+ gray: p(t.palette?.gray, n?.palette?.gray),
1733
+ grayAlpha: p(t.palette?.grayAlpha, n?.palette?.grayAlpha),
1734
+ blackAlpha: p(t.palette?.blackAlpha, n?.palette?.blackAlpha),
1735
+ whiteAlpha: p(t.palette?.whiteAlpha, n?.palette?.whiteAlpha),
1736
+ accent: p(r?.scale || t.palette?.accent, n?.palette?.accent),
1737
+ accentAlpha: p(r?.alphaScale || t.palette?.accentAlpha, n?.palette?.accentAlpha)
1738
1738
  },
1739
1739
  surfaces: {
1740
- ...r.surfaces || {},
1741
- ...ia(n),
1740
+ ...t.surfaces || {},
1741
+ ...ca(n),
1742
1742
  ...n?.surfaces || {}
1743
1743
  },
1744
1744
  shadows: {
1745
- ...r.shadows || {},
1745
+ ...t.shadows || {},
1746
1746
  ...n?.shadows || {}
1747
1747
  },
1748
1748
  spacing: {
1749
- ...r.spacing || {},
1749
+ ...t.spacing || {},
1750
1750
  ...n?.spacing || {}
1751
1751
  },
1752
- spaceScale: p(r.spaceScale, n?.spaceScale),
1753
- radiusScale: p(r.radiusScale, n?.radiusScale),
1752
+ spaceScale: p(t.spaceScale, n?.spaceScale),
1753
+ radiusScale: p(t.radiusScale, n?.radiusScale),
1754
1754
  typography: {
1755
- ...r.typography || {},
1755
+ ...t.typography || {},
1756
1756
  ...n?.typography || {},
1757
1757
  size: {
1758
- ...r.typography?.size || {},
1758
+ ...t.typography?.size || {},
1759
1759
  ...n?.typography?.size || {}
1760
1760
  },
1761
- fontScale: p(r.typography?.fontScale, n?.typography?.fontScale),
1762
- lineHeight: p(r.typography?.lineHeight, n?.typography?.lineHeight),
1763
- letterSpacing: p(r.typography?.letterSpacing, n?.typography?.letterSpacing)
1761
+ fontScale: p(t.typography?.fontScale, n?.typography?.fontScale),
1762
+ lineHeight: p(t.typography?.lineHeight, n?.typography?.lineHeight),
1763
+ letterSpacing: p(t.typography?.letterSpacing, n?.typography?.letterSpacing)
1764
1764
  },
1765
1765
  motion: {
1766
- ...r.motion || {},
1766
+ ...t.motion || {},
1767
1767
  ...n?.motion || {}
1768
1768
  },
1769
1769
  effects: {
1770
- ...r.effects || {},
1770
+ ...t.effects || {},
1771
1771
  ...n?.effects || {}
1772
1772
  },
1773
1773
  components: {
1774
- ...r.components || {},
1774
+ ...t.components || {},
1775
1775
  ...n?.components || {},
1776
- button: p(r.components?.button, n?.components?.button),
1777
- badge: p(r.components?.badge, n?.components?.badge),
1778
- dropdown: p(r.components?.dropdown, n?.components?.dropdown),
1779
- select: p(r.components?.select, n?.components?.select),
1780
- sidebar: p(r.components?.sidebar, n?.components?.sidebar),
1781
- card: p(r.components?.card, n?.components?.card),
1782
- navigationMenu: p(r.components?.navigationMenu, n?.components?.navigationMenu),
1783
- blockControls: p(r.components?.blockControls, n?.components?.blockControls),
1784
- box: p(r.components?.box, n?.components?.box),
1785
- breadcrumb: p(r.components?.breadcrumb, n?.components?.breadcrumb),
1786
- contextMenu: p(r.components?.contextMenu, n?.components?.contextMenu),
1787
- menubar: p(r.components?.menubar, n?.components?.menubar),
1788
- alert: p(r.components?.alert, n?.components?.alert),
1789
- alertDialog: p(r.components?.alertDialog, n?.components?.alertDialog),
1790
- appHeader: p(r.components?.appHeader, n?.components?.appHeader),
1791
- aspectRatio: p(r.components?.aspectRatio, n?.components?.aspectRatio),
1792
- avatar: p(r.components?.avatar, n?.components?.avatar),
1793
- menu: p(r.components?.menu, n?.components?.menu),
1794
- multiSelect: p(r.components?.multiSelect, n?.components?.multiSelect),
1795
- panel: p(r.components?.panel, n?.components?.panel),
1796
- input: p(r.components?.input, n?.components?.input)
1776
+ button: p(t.components?.button, n?.components?.button),
1777
+ badge: p(t.components?.badge, n?.components?.badge),
1778
+ dropdown: p(t.components?.dropdown, n?.components?.dropdown),
1779
+ select: p(t.components?.select, n?.components?.select),
1780
+ sidebar: p(t.components?.sidebar, n?.components?.sidebar),
1781
+ card: p(t.components?.card, n?.components?.card),
1782
+ navigationMenu: p(t.components?.navigationMenu, n?.components?.navigationMenu),
1783
+ blockControls: p(t.components?.blockControls, n?.components?.blockControls),
1784
+ box: p(t.components?.box, n?.components?.box),
1785
+ breadcrumb: p(t.components?.breadcrumb, n?.components?.breadcrumb),
1786
+ contextMenu: p(t.components?.contextMenu, n?.components?.contextMenu),
1787
+ menubar: p(t.components?.menubar, n?.components?.menubar),
1788
+ alert: p(t.components?.alert, n?.components?.alert),
1789
+ alertDialog: p(t.components?.alertDialog, n?.components?.alertDialog),
1790
+ appHeader: p(t.components?.appHeader, n?.components?.appHeader),
1791
+ aspectRatio: p(t.components?.aspectRatio, n?.components?.aspectRatio),
1792
+ avatar: p(t.components?.avatar, n?.components?.avatar),
1793
+ menu: p(t.components?.menu, n?.components?.menu),
1794
+ multiSelect: p(t.components?.multiSelect, n?.components?.multiSelect),
1795
+ panel: p(t.components?.panel, n?.components?.panel),
1796
+ input: p(t.components?.input, n?.components?.input)
1797
1797
  },
1798
1798
  zIndex: {
1799
- ...r.zIndex || {},
1799
+ ...t.zIndex || {},
1800
1800
  ...n?.zIndex || {}
1801
1801
  },
1802
1802
  breakpoints: {
1803
- ...r.breakpoints || {},
1803
+ ...t.breakpoints || {},
1804
1804
  ...n?.breakpoints || {}
1805
1805
  }
1806
1806
  };
1807
1807
  }
1808
- function va(n, a, e = "light") {
1809
- const r = f[a][e], i = n;
1810
- return w(
1808
+ function Sa(n, a, e = "light") {
1809
+ const t = u[a][e], i = n;
1810
+ return S(
1811
1811
  {
1812
1812
  ...i,
1813
1813
  colors: {
1814
1814
  ...i.colors || {},
1815
- ...P(r)
1815
+ ...H(t)
1816
1816
  },
1817
1817
  palette: {
1818
1818
  ...i.palette || {},
1819
- accent: r.scale,
1820
- accentAlpha: r.alphaScale,
1821
- accentContrast: r.contrast,
1822
- accentSurface: r.surface,
1823
- accentIndicator: r.indicator,
1824
- accentTrack: r.track
1819
+ accent: t.scale,
1820
+ accentAlpha: t.alphaScale,
1821
+ accentContrast: t.contrast,
1822
+ accentSurface: t.surface,
1823
+ accentIndicator: t.indicator,
1824
+ accentTrack: t.track
1825
1825
  }
1826
1826
  },
1827
1827
  { mode: e }
@@ -1831,120 +1831,176 @@ function o(n, a, e) {
1831
1831
  n[a] = e;
1832
1832
  }
1833
1833
  function l(n, a, e) {
1834
- e && Object.entries(e).forEach(([r, i]) => {
1835
- typeof i == "string" && i && (n[`${a}${r}`] = i);
1834
+ e && Object.entries(e).forEach(([t, i]) => {
1835
+ typeof i == "string" && i && (n[`${a}${t}`] = i);
1836
1836
  });
1837
1837
  }
1838
- function ya(n) {
1839
- n && D.add(n);
1838
+ function Ca(n) {
1839
+ n && F.add(n);
1840
1840
  }
1841
- function oa(n) {
1842
- return M(w(n));
1841
+ function la(n) {
1842
+ return j(S(n));
1843
+ }
1844
+ const pa = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
1845
+ function E(n) {
1846
+ const a = pa.exec(n.trim());
1847
+ if (!a) return null;
1848
+ const e = a[1].length === 3 ? a[1].replace(/./g, (t) => t + t) : a[1];
1849
+ return [parseInt(e.slice(0, 2), 16), parseInt(e.slice(2, 4), 16), parseInt(e.slice(4, 6), 16)];
1843
1850
  }
1844
- function sa(n) {
1851
+ function z(n, a, e) {
1852
+ const t = E(n), i = E(a);
1853
+ return !t || !i ? null : "#" + t.map((s, c) => Math.round(s + (i[c] - s) * e)).map((s) => s.toString(16).padStart(2, "0")).join("");
1854
+ }
1855
+ function da(n) {
1856
+ const a = {}, e = n.colors, t = e.surface || e.background, i = e.text;
1857
+ if (!t || !i) return a;
1858
+ const r = [
1859
+ // the accent's text step (Radix step 11) can sit just under 4.5:1 (amber is 4.49:1 on near-white)
1860
+ ["accent", n.palette?.accent?.["11"] || e.primary],
1861
+ ["danger", e.danger],
1862
+ ["success", e.success],
1863
+ ["warning", e.warning],
1864
+ ["info", e.info]
1865
+ ];
1866
+ for (const [s, c] of r) {
1867
+ if (!c) continue;
1868
+ if (!E(c)) {
1869
+ a[`--ui-color-${s}-text`] = `color-mix(in srgb, ${c} 62%, ${i})`;
1870
+ continue;
1871
+ }
1872
+ const d = z(c, t, 0.86);
1873
+ let f = c;
1874
+ for (let g = 0; g <= 18; g += 1) {
1875
+ const m = z(c, i, g * 0.05);
1876
+ if (!m) break;
1877
+ f = m;
1878
+ const x = v(m, t) ?? 0, C = d ? v(m, d) ?? 0 : x;
1879
+ if (x >= 5.5 && C >= 5) break;
1880
+ }
1881
+ if (a[`--ui-color-${s}-text`] = f, s === "danger" || s === "success") {
1882
+ let g = c;
1883
+ for (let m = 0; m <= 12; m += 1) {
1884
+ const x = z(c, "#000000", m * 0.05);
1885
+ if (!x || (g = x, (v("#ffffff", x) ?? 0) >= 4.6)) break;
1886
+ }
1887
+ a[`--ui-color-${s}-solid`] = g, a[`--ui-color-foreground-on-${s}`] = "#ffffff";
1888
+ }
1889
+ }
1890
+ return a;
1891
+ }
1892
+ function fa(n) {
1845
1893
  const a = n.colors, e = n.palette;
1846
1894
  if (!e || !a) return n;
1847
- const r = (k, H, $) => `color-mix(in srgb, ${k} ${H}%, ${$})`, i = a.surface || a.background, t = a.text;
1895
+ const t = (m, x, C) => `color-mix(in srgb, ${m} ${x}%, ${C})`, i = a.surface || a.background, r = a.text;
1848
1896
  let s = e.gray, c = e.accent;
1849
- const d = a.background ? b(a.background) : null, u = s?.["1"] ? b(s[1]) : null;
1850
- i && t && d !== null && u !== null && d < 0.4 != u < 0.4 && (s = {
1897
+ const d = a.background ? w(a.background) : null, f = s?.["1"] ? w(s[1]) : null;
1898
+ i && r && d !== null && f !== null && d < 0.4 != f < 0.4 && (s = {
1851
1899
  ...s,
1852
- 2: r(t, 4, i),
1853
- 3: r(t, 8, i),
1854
- 4: r(t, 12, i),
1855
- 5: r(t, 16, i),
1856
- 6: r(t, 20, i),
1857
- 7: r(t, 28, i),
1858
- 8: r(t, 40, i),
1859
- 11: a.muted || t,
1860
- 12: t
1900
+ 2: t(r, 4, i),
1901
+ 3: t(r, 8, i),
1902
+ 4: t(r, 12, i),
1903
+ 5: t(r, 16, i),
1904
+ 6: t(r, 20, i),
1905
+ 7: t(r, 28, i),
1906
+ 8: t(r, 40, i),
1907
+ 11: a.muted || r,
1908
+ 12: r
1861
1909
  });
1862
- const x = c?.["9"];
1863
- return i && t && a.primary && x && x.trim().toLowerCase() !== a.primary.trim().toLowerCase() && (c = {
1910
+ const g = c?.["9"];
1911
+ return i && r && a.primary && g && g.trim().toLowerCase() !== a.primary.trim().toLowerCase() && (c = {
1864
1912
  ...c,
1865
- 2: r(a.primary, 6, i),
1866
- 3: r(a.primary, 14, i),
1867
- 4: r(a.primary, 20, i),
1868
- 5: r(a.primary, 26, i),
1869
- 7: r(a.primary, 42, i),
1913
+ 2: t(a.primary, 6, i),
1914
+ 3: t(a.primary, 14, i),
1915
+ 4: t(a.primary, 20, i),
1916
+ 5: t(a.primary, 26, i),
1917
+ 7: t(a.primary, 42, i),
1870
1918
  9: a.primary,
1871
1919
  10: a.primaryHover || a.primary,
1872
- 11: r(a.primary, 60, t)
1920
+ 11: t(a.primary, 60, r)
1873
1921
  }), s === e.gray && c === e.accent ? n : { ...n, palette: { ...e, gray: s, accent: c } };
1874
1922
  }
1875
- function M(n) {
1876
- const a = sa(n), e = {};
1877
- return o(e, "--ui-color-primary", a.colors.primary), o(e, "--ui-color-primary-hover", a.colors.primaryHover || a.colors.primary), o(e, "--ui-color-foreground-on-primary", a.colors.foregroundOnPrimary || "#ffffff"), o(e, "--ui-color-background", a.colors.background || "#ffffff"), o(e, "--ui-color-surface", a.colors.surface || a.colors.background || "#ffffff"), o(e, "--ui-color-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), o(e, "--ui-color-text", a.colors.text || "#202020"), o(e, "--ui-color-muted", a.colors.muted || "#646464"), o(e, "--ui-color-border", a.colors.border || "#0000001f"), o(e, "--ui-color-focus-ring", a.colors.focusRing || a.colors.primary), o(e, "--ui-color-success", a.colors.success || "#30a46c"), o(e, "--ui-color-danger", a.colors.danger || "#e5484d"), o(e, "--ui-color-warning", a.colors.warning || a.colors.primary), o(e, "--ui-primary", a.colors.primary), o(e, "--ui-primary-hover", a.colors.primaryHover || a.colors.primary), o(e, "--ui-foreground", a.colors.foregroundOnPrimary || "#ffffff"), o(e, "--ui-background", a.colors.background || "#ffffff"), o(e, "--ui-surface", a.colors.surface || a.colors.background || "#ffffff"), o(e, "--ui-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), o(e, "--ui-text", a.colors.text || "#202020"), o(e, "--ui-muted", a.colors.muted || "#646464"), o(e, "--ui-border", a.colors.border || "#0000001f"), o(e, "--ui-focus-ring", a.colors.focusRing || a.colors.primary), o(e, "--ui-success", a.colors.success || "#30a46c"), o(e, "--ui-error", a.colors.danger || "#e5484d"), o(e, "--ui-warning", a.colors.warning || a.colors.primary), o(e, "--ui-radius", a.radius || "6px"), o(e, "--ui-space-xs", a.spacing?.xs || "4px"), o(e, "--ui-space-sm", a.spacing?.sm || "8px"), o(e, "--ui-space-md", a.spacing?.md || "12px"), o(e, "--ui-space-lg", a.spacing?.lg || "24px"), o(e, "--ui-space-xl", a.spacing?.xl || "32px"), o(e, "--ui-space-xxl", a.spacing?.xxl || "48px"), o(e, "--ui-default-gap", a.spacing?.sm || a.spaceScale?.["2"] || "8px"), o(e, "--ui-shadow-sm", a.shadows?.sm || a.shadows?.["2"] || "none"), o(e, "--ui-shadow-md", a.shadows?.md || a.shadows?.["3"] || "none"), o(e, "--ui-shadow-lg", a.shadows?.lg || a.shadows?.["4"] || "none"), o(e, "--ui-font-family", a.typography?.family || "system-ui, sans-serif"), o(e, "--ui-font-family-heading", a.typography?.headingFamily || a.typography?.family || "system-ui, sans-serif"), o(e, "--ui-font-family-code", a.typography?.codeFamily || "monospace"), o(e, "--ui-font-size-sm", a.typography?.size?.sm || "12px"), o(e, "--ui-font-size-md", a.typography?.size?.md || "14px"), o(e, "--ui-font-size-lg", a.typography?.size?.lg || "16px"), o(e, "--ui-default-font-size", a.typography?.size?.md || a.typography?.fontScale?.["2"] || "14px"), o(e, "--ui-default-line-height", a.typography?.lineHeight?.["2"] || "20px"), o(e, "--ui-default-letter-spacing", a.typography?.letterSpacing?.["2"] || "0em"), o(e, "--ui-motion-short", a.motion?.durationShort || "120ms"), o(e, "--ui-motion-base", a.motion?.durationBase || "180ms"), o(e, "--ui-motion-long", a.motion?.durationLong || "260ms"), o(e, "--ui-motion-easing", a.motion?.easing || "cubic-bezier(0.2, 0.8, 0.2, 1)"), o(e, "--ui-z-modal", String(a.zIndex?.modal ?? 1e3)), o(e, "--ui-z-overlay", String(a.zIndex?.overlay ?? 900)), o(e, "--ui-z-toast", String(a.zIndex?.toast ?? 1100)), o(e, "--ui-breakpoint-sm", a.breakpoints?.sm || "640px"), o(e, "--ui-breakpoint-md", a.breakpoints?.md || "768px"), o(e, "--ui-breakpoint-lg", a.breakpoints?.lg || "1024px"), o(e, "--color-background", a.surfaces?.background || a.colors.background || "#ffffff"), o(e, "--color-surface", a.surfaces?.surface || a.colors.surface || "#fcfcfc"), o(e, "--color-panel", a.surfaces?.panel || a.surfaces?.panelTranslucent || "#ffffffcc"), o(e, "--color-panel-solid", a.surfaces?.panelSolid || a.colors.surface || "#ffffff"), o(e, "--color-panel-translucent", a.surfaces?.panelTranslucent || "#ffffffcc"), o(e, "--color-overlay", a.surfaces?.overlay || "rgba(2, 6, 23, 0.52)"), o(e, "--color-transparent", a.surfaces?.transparent || "transparent"), o(e, "--backdrop-filter-panel", a.effects?.backdropFilterPanel || "blur(64px)"), a.palette?.accentContrast && o(e, "--accent-contrast", a.palette.accentContrast), a.palette?.accentSurface && o(e, "--accent-surface", a.palette.accentSurface), a.palette?.accentIndicator && o(e, "--accent-indicator", a.palette.accentIndicator), a.palette?.accentTrack && o(e, "--accent-track", a.palette.accentTrack), l(e, "--gray-", a.palette?.gray), l(e, "--gray-a", a.palette?.grayAlpha), l(e, "--black-a", a.palette?.blackAlpha), l(e, "--white-a", a.palette?.whiteAlpha), l(e, "--accent-", a.palette?.accent), l(e, "--accent-a", a.palette?.accentAlpha), l(e, "--space-", a.spaceScale), l(e, "--radius-", a.radiusScale), l(e, "--font-size-", a.typography?.fontScale), l(e, "--line-height-", a.typography?.lineHeight), l(e, "--letter-spacing-", a.typography?.letterSpacing), l(e, "--shadow-", a.shadows), l(e, "--base-button-", a.components?.button), l(e, "--base-badge-", a.components?.badge), l(e, "--base-dropdown-", a.components?.dropdown), l(e, "--base-select-", a.components?.select), l(e, "--base-sidebar-", a.components?.sidebar), l(e, "--base-block-controls-", a.components?.blockControls), l(e, "--base-box-", a.components?.box), l(e, "--base-breadcrumb-", a.components?.breadcrumb), l(e, "--base-card-", a.components?.card), l(e, "--base-multi-select-", a.components?.multiSelect), l(e, "--base-navigation-menu-", a.components?.navigationMenu), l(e, "--base-menubar-", a.components?.menubar), l(e, "--base-context-menu-", a.components?.contextMenu), l(e, "--base-alert-", a.components?.alert), l(e, "--base-alert-dialog-", a.components?.alertDialog), l(e, "--base-app-header-", a.components?.appHeader), l(e, "--base-aspect-ratio-", a.components?.aspectRatio), l(e, "--base-avatar-", a.components?.avatar), l(e, "--base-menu-", a.components?.menu), l(e, "--base-panel-", a.components?.panel), l(e, "--base-input-", a.components?.input), Object.assign(e, aa(a)), o(e, "--ui-color-foreground-on-warning", v(a.colors.warning || a.colors.primary, "#ffffff")), e;
1923
+ function j(n) {
1924
+ const a = fa(n), e = {};
1925
+ return o(e, "--ui-color-primary", a.colors.primary), o(e, "--ui-color-primary-hover", a.colors.primaryHover || a.colors.primary), o(e, "--ui-color-foreground-on-primary", a.colors.foregroundOnPrimary || "#ffffff"), o(e, "--ui-color-background", a.colors.background || "#ffffff"), o(e, "--ui-color-surface", a.colors.surface || a.colors.background || "#ffffff"), o(e, "--ui-color-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), o(e, "--ui-color-text", a.colors.text || "#202020"), o(e, "--ui-color-muted", a.colors.muted || "#646464"), o(e, "--ui-color-border", a.colors.border || "#0000001f"), o(e, "--ui-color-focus-ring", a.colors.focusRing || a.colors.primary), o(e, "--ui-color-success", a.colors.success || "#30a46c"), o(e, "--ui-color-danger", a.colors.danger || "#e5484d"), o(e, "--ui-color-warning", a.colors.warning || a.colors.primary), o(e, "--ui-primary", a.colors.primary), o(e, "--ui-primary-hover", a.colors.primaryHover || a.colors.primary), o(e, "--ui-foreground", a.colors.foregroundOnPrimary || "#ffffff"), o(e, "--ui-background", a.colors.background || "#ffffff"), o(e, "--ui-surface", a.colors.surface || a.colors.background || "#ffffff"), o(e, "--ui-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), o(e, "--ui-text", a.colors.text || "#202020"), o(e, "--ui-muted", a.colors.muted || "#646464"), o(e, "--ui-border", a.colors.border || "#0000001f"), o(e, "--ui-focus-ring", a.colors.focusRing || a.colors.primary), o(e, "--ui-success", a.colors.success || "#30a46c"), o(e, "--ui-error", a.colors.danger || "#e5484d"), o(e, "--ui-warning", a.colors.warning || a.colors.primary), o(e, "--ui-radius", a.radius || "6px"), o(e, "--ui-space-xs", a.spacing?.xs || "4px"), o(e, "--ui-space-sm", a.spacing?.sm || "8px"), o(e, "--ui-space-md", a.spacing?.md || "12px"), o(e, "--ui-space-lg", a.spacing?.lg || "24px"), o(e, "--ui-space-xl", a.spacing?.xl || "32px"), o(e, "--ui-space-xxl", a.spacing?.xxl || "48px"), o(e, "--ui-default-gap", a.spacing?.sm || a.spaceScale?.["2"] || "8px"), o(e, "--ui-shadow-sm", a.shadows?.sm || a.shadows?.["2"] || "none"), o(e, "--ui-shadow-md", a.shadows?.md || a.shadows?.["3"] || "none"), o(e, "--ui-shadow-lg", a.shadows?.lg || a.shadows?.["4"] || "none"), o(e, "--ui-font-family", a.typography?.family || "system-ui, sans-serif"), o(e, "--ui-font-family-heading", a.typography?.headingFamily || a.typography?.family || "system-ui, sans-serif"), o(e, "--ui-font-family-code", a.typography?.codeFamily || "monospace"), o(e, "--ui-font-size-sm", a.typography?.size?.sm || "12px"), o(e, "--ui-font-size-md", a.typography?.size?.md || "14px"), o(e, "--ui-font-size-lg", a.typography?.size?.lg || "16px"), o(e, "--ui-default-font-size", a.typography?.size?.md || a.typography?.fontScale?.["2"] || "14px"), o(e, "--ui-default-line-height", a.typography?.lineHeight?.["2"] || "20px"), o(e, "--ui-default-letter-spacing", a.typography?.letterSpacing?.["2"] || "0em"), o(e, "--ui-motion-short", a.motion?.durationShort || "120ms"), o(e, "--ui-motion-base", a.motion?.durationBase || "180ms"), o(e, "--ui-motion-long", a.motion?.durationLong || "260ms"), o(e, "--ui-motion-easing", a.motion?.easing || "cubic-bezier(0.2, 0.8, 0.2, 1)"), o(e, "--ui-z-modal", String(a.zIndex?.modal ?? 1e3)), o(e, "--ui-z-overlay", String(a.zIndex?.overlay ?? 900)), o(e, "--ui-z-toast", String(a.zIndex?.toast ?? 1100)), o(e, "--ui-breakpoint-sm", a.breakpoints?.sm || "640px"), o(e, "--ui-breakpoint-md", a.breakpoints?.md || "768px"), o(e, "--ui-breakpoint-lg", a.breakpoints?.lg || "1024px"), o(e, "--color-background", a.surfaces?.background || a.colors.background || "#ffffff"), o(e, "--color-surface", a.surfaces?.surface || a.colors.surface || "#fcfcfc"), o(e, "--color-panel", a.surfaces?.panel || a.surfaces?.panelTranslucent || "#ffffffcc"), o(e, "--color-panel-solid", a.surfaces?.panelSolid || a.colors.surface || "#ffffff"), o(e, "--color-panel-translucent", a.surfaces?.panelTranslucent || "#ffffffcc"), o(e, "--color-overlay", a.surfaces?.overlay || "rgba(2, 6, 23, 0.52)"), o(e, "--color-transparent", a.surfaces?.transparent || "transparent"), o(e, "--backdrop-filter-panel", a.effects?.backdropFilterPanel || "blur(64px)"), a.palette?.accentContrast && o(e, "--accent-contrast", a.palette.accentContrast), a.palette?.accentSurface && o(e, "--accent-surface", a.palette.accentSurface), a.palette?.accentIndicator && o(e, "--accent-indicator", a.palette.accentIndicator), a.palette?.accentTrack && o(e, "--accent-track", a.palette.accentTrack), l(e, "--gray-", a.palette?.gray), l(e, "--gray-a", a.palette?.grayAlpha), l(e, "--black-a", a.palette?.blackAlpha), l(e, "--white-a", a.palette?.whiteAlpha), l(e, "--accent-", a.palette?.accent), l(e, "--accent-a", a.palette?.accentAlpha), l(e, "--space-", a.spaceScale), l(e, "--radius-", a.radiusScale), l(e, "--font-size-", a.typography?.fontScale), l(e, "--line-height-", a.typography?.lineHeight), l(e, "--letter-spacing-", a.typography?.letterSpacing), l(e, "--shadow-", a.shadows), l(e, "--base-button-", a.components?.button), l(e, "--base-badge-", a.components?.badge), l(e, "--base-dropdown-", a.components?.dropdown), l(e, "--base-select-", a.components?.select), l(e, "--base-sidebar-", a.components?.sidebar), l(e, "--base-block-controls-", a.components?.blockControls), l(e, "--base-box-", a.components?.box), l(e, "--base-breadcrumb-", a.components?.breadcrumb), l(e, "--base-card-", a.components?.card), l(e, "--base-multi-select-", a.components?.multiSelect), l(e, "--base-navigation-menu-", a.components?.navigationMenu), l(e, "--base-menubar-", a.components?.menubar), l(e, "--base-context-menu-", a.components?.contextMenu), l(e, "--base-alert-", a.components?.alert), l(e, "--base-alert-dialog-", a.components?.alertDialog), l(e, "--base-app-header-", a.components?.appHeader), l(e, "--base-aspect-ratio-", a.components?.aspectRatio), l(e, "--base-avatar-", a.components?.avatar), l(e, "--base-menu-", a.components?.menu), l(e, "--base-panel-", a.components?.panel), l(e, "--base-input-", a.components?.input), Object.assign(e, ta(a)), Object.assign(e, da(a)), o(e, "--ui-color-foreground-on-warning", k(a.colors.warning || a.colors.primary, "#ffffff")), e;
1878
1926
  }
1879
- function T(n, a) {
1880
- Object.entries(a).forEach(([e, r]) => {
1927
+ function P(n, a) {
1928
+ Object.entries(a).forEach(([e, t]) => {
1881
1929
  try {
1882
- n.style.setProperty(e, r);
1930
+ n.style.setProperty(e, t);
1883
1931
  } catch {
1884
1932
  }
1885
1933
  });
1886
1934
  }
1887
- function wa(n, a = ":root") {
1888
- const e = Object.entries(oa(n)).map(([r, i]) => ` ${r}: ${i};`).join(`
1935
+ function za(n, a = ":root") {
1936
+ const e = Object.entries(la(n)).map(([t, i]) => ` ${t}: ${i};`).join(`
1889
1937
  `);
1890
1938
  return `${a} {
1891
1939
  ${e}
1892
1940
  }
1893
1941
  `;
1894
1942
  }
1895
- function R(n) {
1943
+ function B(n) {
1896
1944
  return n === document ? document.documentElement : n instanceof ShadowRoot ? n.host : n;
1897
1945
  }
1898
- function ca(n, a = typeof document < "u" ? document : null) {
1946
+ function ua(n, a = typeof document < "u" ? document : null) {
1899
1947
  if (!a) return;
1900
- const e = M(w(n)), r = a === document || a instanceof ShadowRoot, i = R(a);
1901
- if (T(i, e), r)
1902
- for (const t of D)
1948
+ const e = j(S(n)), t = a === document || a instanceof ShadowRoot, i = B(a);
1949
+ if (P(i, e), D(i, e["--ui-color-background"]), t)
1950
+ for (const r of F)
1903
1951
  try {
1904
- T(t, e);
1952
+ P(r, e), D(r, e["--ui-color-background"]);
1905
1953
  } catch {
1906
1954
  }
1907
1955
  }
1908
- function ka(n = {}) {
1956
+ function D(n, a) {
1957
+ const e = a ? w(a) : null;
1958
+ if (e !== null)
1959
+ try {
1960
+ n.style.setProperty("color-scheme", e < 0.179 ? "dark" : "light");
1961
+ } catch {
1962
+ }
1963
+ }
1964
+ function Ea(n = {}) {
1909
1965
  const a = n.root === void 0 ? typeof document < "u" ? document : null : n.root;
1910
1966
  if (!a) return () => {
1911
1967
  };
1912
- const e = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null, r = (t) => {
1913
- const s = t ? "dark" : "light";
1914
- ca(w(t ? n.dark : n.light, { accentPalette: n.accentPalette, mode: s }), a);
1915
- const c = R(a);
1968
+ const e = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null, t = (r) => {
1969
+ const s = r ? "dark" : "light";
1970
+ ua(S(r ? n.dark : n.light, { accentPalette: n.accentPalette, mode: s }), a);
1971
+ const c = B(a);
1916
1972
  c.setAttribute("data-ui-mode", s), c.style.setProperty("color-scheme", s);
1917
1973
  };
1918
- if (r(!!e?.matches), !e) return () => {
1974
+ if (t(!!e?.matches), !e) return () => {
1919
1975
  };
1920
- const i = (t) => r(t.matches);
1976
+ const i = (r) => t(r.matches);
1921
1977
  return typeof e.addEventListener == "function" ? (e.addEventListener("change", i), () => e.removeEventListener("change", i)) : (e.addListener(i), () => e.removeListener(i));
1922
1978
  }
1923
1979
  export {
1924
- V as A,
1925
- W as D,
1926
- da as a,
1927
- ka as b,
1928
- ca as c,
1929
- f as d,
1930
- ta as e,
1931
- y as f,
1932
- fa as g,
1933
- xa as h,
1934
- Z as i,
1935
- G as j,
1936
- w as k,
1937
- ba as l,
1938
- ra as m,
1939
- aa as n,
1940
- ia as o,
1941
- ga as p,
1942
- ha as q,
1943
- ua as r,
1944
- v as s,
1945
- ya as t,
1946
- ma as u,
1947
- wa as v,
1948
- oa as w,
1949
- va as x
1980
+ Q as A,
1981
+ K as D,
1982
+ xa as a,
1983
+ Ea as b,
1984
+ ua as c,
1985
+ u as d,
1986
+ sa as e,
1987
+ _ as f,
1988
+ ha as g,
1989
+ wa as h,
1990
+ W as i,
1991
+ J as j,
1992
+ S as k,
1993
+ _a as l,
1994
+ oa as m,
1995
+ ta as n,
1996
+ ca as o,
1997
+ va as p,
1998
+ ka as q,
1999
+ ba as r,
2000
+ k as s,
2001
+ Ca as t,
2002
+ ya as u,
2003
+ za as v,
2004
+ la as w,
2005
+ Sa as x
1950
2006
  };