@eschoolbase/client-ui 0.0.0-stage → 0.2.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 (66) hide show
  1. package/README.md +211 -2
  2. package/dist/components/AccountPanel/AccountPanel.d.ts +8 -0
  3. package/dist/components/AccountPanel/AccountPanel.types.d.ts +65 -0
  4. package/dist/components/AccountPanel/index.d.ts +2 -0
  5. package/dist/components/Avatar/Avatar.d.ts +4 -0
  6. package/dist/components/Avatar/Avatar.types.d.ts +14 -0
  7. package/dist/components/Avatar/index.d.ts +2 -0
  8. package/dist/components/Badge/Badge.d.ts +3 -0
  9. package/dist/components/Badge/Badge.types.d.ts +8 -0
  10. package/dist/components/Badge/index.d.ts +2 -0
  11. package/dist/components/Button/Button.d.ts +2 -0
  12. package/dist/components/Button/Button.types.d.ts +14 -0
  13. package/dist/components/Button/index.d.ts +2 -0
  14. package/dist/components/Checkbox/Checkbox.d.ts +3 -0
  15. package/dist/components/Checkbox/Checkbox.types.d.ts +10 -0
  16. package/dist/components/Checkbox/index.d.ts +2 -0
  17. package/dist/components/FormField/FormField.d.ts +2 -0
  18. package/dist/components/FormField/FormField.types.d.ts +43 -0
  19. package/dist/components/FormField/FormFieldContext.d.ts +8 -0
  20. package/dist/components/FormField/index.d.ts +3 -0
  21. package/dist/components/FormSection/FormSection.d.ts +6 -0
  22. package/dist/components/FormSection/FormSection.types.d.ts +15 -0
  23. package/dist/components/FormSection/index.d.ts +2 -0
  24. package/dist/components/Input/Input.d.ts +2 -0
  25. package/dist/components/Input/Input.types.d.ts +15 -0
  26. package/dist/components/Input/index.d.ts +2 -0
  27. package/dist/components/Select/Select.d.ts +7 -0
  28. package/dist/components/Select/Select.types.d.ts +57 -0
  29. package/dist/components/Select/SelectControl.d.ts +2 -0
  30. package/dist/components/Select/index.d.ts +2 -0
  31. package/dist/components/Skeleton/Skeleton.d.ts +3 -0
  32. package/dist/components/Skeleton/Skeleton.types.d.ts +10 -0
  33. package/dist/components/Skeleton/index.d.ts +2 -0
  34. package/dist/components/Switch/Switch.d.ts +3 -0
  35. package/dist/components/Switch/Switch.types.d.ts +8 -0
  36. package/dist/components/Switch/index.d.ts +2 -0
  37. package/dist/components/Tabs/Tabs.d.ts +6 -0
  38. package/dist/components/Tabs/Tabs.types.d.ts +20 -0
  39. package/dist/components/Tabs/index.d.ts +2 -0
  40. package/dist/components/Textarea/Textarea.d.ts +3 -0
  41. package/dist/components/Textarea/Textarea.types.d.ts +12 -0
  42. package/dist/components/Textarea/index.d.ts +2 -0
  43. package/dist/components/ThemeToggle/ThemeToggle.d.ts +6 -0
  44. package/dist/components/ThemeToggle/ThemeToggle.types.d.ts +13 -0
  45. package/dist/components/ThemeToggle/index.d.ts +2 -0
  46. package/dist/components/Typography/Typography.d.ts +3 -0
  47. package/dist/components/Typography/Typography.types.d.ts +22 -0
  48. package/dist/components/Typography/index.d.ts +2 -0
  49. package/dist/index.cjs +2 -0
  50. package/dist/index.cjs.map +1 -0
  51. package/dist/index.d.ts +37 -0
  52. package/dist/index.js +1405 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/license/UnlicensedNotice.d.ts +2 -0
  55. package/dist/license/hash.d.ts +1 -0
  56. package/dist/license/index.d.ts +2 -0
  57. package/dist/license/keys.d.ts +6 -0
  58. package/dist/license/license.d.ts +7 -0
  59. package/dist/styles.css +2 -0
  60. package/dist/theme/ThemeProvider.d.ts +4 -0
  61. package/dist/theme/ThemeProvider.types.d.ts +30 -0
  62. package/dist/theme/index.d.ts +2 -0
  63. package/dist/theme/themeStore.d.ts +5 -0
  64. package/dist/types/index.d.ts +2 -0
  65. package/dist/utils/cn.d.ts +3 -0
  66. package/package.json +75 -4
package/dist/index.js ADDED
@@ -0,0 +1,1405 @@
1
+ "use client";
2
+ import { createContext as e, createElement as t, forwardRef as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s, useRef as c, useState as l, useSyncExternalStore as u } from "react";
3
+ import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
4
+ import { createPortal as m } from "react-dom";
5
+ //#region src/utils/cn.ts
6
+ function h(...e) {
7
+ return e.filter(Boolean).join(" ");
8
+ }
9
+ //#endregion
10
+ //#region src/license/hash.ts
11
+ var g = "client-ui:";
12
+ function _(e) {
13
+ let t = g + e.trim(), n = 3735928559, r = 1103547991;
14
+ for (let e = 0; e < t.length; e++) {
15
+ let i = t.charCodeAt(e);
16
+ n = Math.imul(n ^ i, 2654435761), r = Math.imul(r ^ i, 1597334677);
17
+ }
18
+ return n = Math.imul(n ^ n >>> 16, 2246822507), n ^= Math.imul(r ^ r >>> 13, 3266489909), r = Math.imul(r ^ r >>> 16, 2246822507), r ^= Math.imul(n ^ n >>> 13, 3266489909), (4294967296 * (2097151 & r) + (n >>> 0)).toString(16).padStart(14, "0");
19
+ }
20
+ //#endregion
21
+ //#region src/license/keys.ts
22
+ var v = ["1cd9d9bd20471f"], y = "", b = /* @__PURE__ */ new Set(), x = !1, S = e(null);
23
+ function C(e) {
24
+ y = e, x = !1, b.forEach((e) => e());
25
+ }
26
+ function w(e) {
27
+ return !e || !e.trim() ? !1 : v.includes(_(e));
28
+ }
29
+ var T = (e) => (b.add(e), () => {
30
+ b.delete(e);
31
+ }), ee = () => y;
32
+ function E() {
33
+ let e = i(S), t = u(T, ee, ee), n = w(e ?? t);
34
+ return a(() => {
35
+ n || x || (x = !0, console.error("[client-ui] Missing or invalid license key. Components are disabled. Pass licenseKey to <ThemeProvider> or call setLicenseKey() once at app start."));
36
+ }, [n]), n;
37
+ }
38
+ var te = { root: "cui-UnlicensedNotice-module__root--FdnRG" };
39
+ //#endregion
40
+ //#region src/license/UnlicensedNotice.tsx
41
+ function D() {
42
+ return /* @__PURE__ */ f("span", {
43
+ role: "alert",
44
+ className: te.root,
45
+ children: "client-ui: missing or invalid license key"
46
+ });
47
+ }
48
+ var O = {
49
+ button: "cui-Button-module__button--2ZuB7",
50
+ sm: "cui-Button-module__sm--NhG0g",
51
+ md: "cui-Button-module__md--hH4h3",
52
+ lg: "cui-Button-module__lg--2plQf",
53
+ fullWidth: "cui-Button-module__fullWidth--36oJT",
54
+ primary: "cui-Button-module__primary--s1sM6",
55
+ secondary: "cui-Button-module__secondary--R0waJ",
56
+ outline: "cui-Button-module__outline--F5jq-",
57
+ ghost: "cui-Button-module__ghost--1KINV",
58
+ danger: "cui-Button-module__danger--V4fX8",
59
+ link: "cui-Button-module__link--Zt5hw",
60
+ spinner: "cui-Button-module__spinner--ZExvW",
61
+ spin: "cui-Button-module__spin--JvkZu"
62
+ }, ne = n(function({ variant: e = "primary", size: t = "md", loading: n = !1, fullWidth: r = !1, type: i = "button", disabled: a, className: o, children: s, ...c }, l) {
63
+ return E() ? /* @__PURE__ */ p("button", {
64
+ ...c,
65
+ ref: l,
66
+ type: i,
67
+ disabled: a || n,
68
+ "aria-busy": n || void 0,
69
+ "data-variant": e,
70
+ "data-size": t,
71
+ className: h(O.button, O[e], O[t], r && O.fullWidth, o),
72
+ children: [n ? /* @__PURE__ */ f("span", {
73
+ className: O.spinner,
74
+ "aria-hidden": "true"
75
+ }) : null, s]
76
+ }) : /* @__PURE__ */ f(D, {});
77
+ }), k = e(null);
78
+ function A(e) {
79
+ let t = i(k), n = o(), r = t?.id ?? e.id ?? n, a = !!(e.required ?? t?.required), s = !!(e.disabled ?? t?.disabled), c = !!e.error || !!t?.invalid, l = [e["aria-describedby"], t?.describedById].filter(Boolean).join(" ") || void 0;
80
+ return {
81
+ id: r,
82
+ required: a,
83
+ disabled: s,
84
+ invalid: c,
85
+ labelId: t?.labelId,
86
+ "aria-invalid": c ? !0 : void 0,
87
+ "aria-describedby": l
88
+ };
89
+ }
90
+ var j = {
91
+ root: "cui-FormField-module__root--QkVj-",
92
+ label: "cui-FormField-module__label--98wVM",
93
+ labelDisabled: "cui-FormField-module__labelDisabled--I5V6c",
94
+ required: "cui-FormField-module__required--Erm4t",
95
+ message: "cui-FormField-module__message--FUq3k",
96
+ helper: "cui-FormField-module__helper--JuBZ6",
97
+ error: "cui-FormField-module__error--4SHKr"
98
+ };
99
+ //#endregion
100
+ //#region src/components/FormField/FormField.tsx
101
+ function M({ children: e, label: t, required: n = !1, helperText: r, error: i, disabled: a = !1, id: c, className: l, ...u }) {
102
+ let d = o(), m = c ?? d, g = !!i, _ = g ? `${m}-error` : r ? `${m}-helper` : void 0, v = s(() => ({
103
+ id: m,
104
+ describedById: _,
105
+ labelId: t ? `${m}-label` : void 0,
106
+ required: n,
107
+ disabled: a,
108
+ invalid: g
109
+ }), [
110
+ m,
111
+ _,
112
+ t,
113
+ n,
114
+ a,
115
+ g
116
+ ]);
117
+ return E() ? /* @__PURE__ */ f(k.Provider, {
118
+ value: v,
119
+ children: /* @__PURE__ */ p("div", {
120
+ ...u,
121
+ className: h(j.root, l),
122
+ children: [
123
+ t ? /* @__PURE__ */ p("label", {
124
+ id: `${m}-label`,
125
+ htmlFor: m,
126
+ className: h(j.label, a && j.labelDisabled),
127
+ children: [t, n ? /* @__PURE__ */ f("span", {
128
+ className: j.required,
129
+ "aria-hidden": "true",
130
+ children: "*"
131
+ }) : null]
132
+ }) : null,
133
+ e,
134
+ g ? /* @__PURE__ */ f("p", {
135
+ id: _,
136
+ className: h(j.message, j.error),
137
+ role: "alert",
138
+ children: i
139
+ }) : r ? /* @__PURE__ */ f("p", {
140
+ id: _,
141
+ className: h(j.message, j.helper),
142
+ children: r
143
+ }) : null
144
+ ]
145
+ })
146
+ }) : /* @__PURE__ */ f(D, {});
147
+ }
148
+ var N = {
149
+ control: "cui-Input-module__control--e3jPo",
150
+ disabled: "cui-Input-module__disabled--nzcnQ",
151
+ invalid: "cui-Input-module__invalid--VyrnA",
152
+ sm: "cui-Input-module__sm--SCPkT",
153
+ md: "cui-Input-module__md--weRbk",
154
+ lg: "cui-Input-module__lg--ic8a4",
155
+ input: "cui-Input-module__input--WjT81",
156
+ affix: "cui-Input-module__affix--zz0Xe",
157
+ readOnly: "cui-Input-module__readOnly--0ag-W"
158
+ }, P = n(function({ id: e, required: t, disabled: n, error: r, "aria-describedby": i, prefix: a, suffix: o, size: s = "md", readOnly: c, className: l, ...u }, d) {
159
+ let m = A({
160
+ id: e,
161
+ required: t,
162
+ disabled: n,
163
+ error: r,
164
+ "aria-describedby": i
165
+ });
166
+ return /* @__PURE__ */ p("div", {
167
+ className: h(N.control, N[s], m.invalid && N.invalid, m.disabled && N.disabled, c && N.readOnly, l),
168
+ children: [
169
+ a ? /* @__PURE__ */ f("span", {
170
+ className: N.affix,
171
+ children: a
172
+ }) : null,
173
+ /* @__PURE__ */ f("input", {
174
+ ...u,
175
+ ref: d,
176
+ id: m.id,
177
+ required: m.required,
178
+ disabled: m.disabled,
179
+ readOnly: c,
180
+ "aria-invalid": m["aria-invalid"],
181
+ "aria-describedby": m["aria-describedby"],
182
+ className: N.input
183
+ }),
184
+ o ? /* @__PURE__ */ f("span", {
185
+ className: N.affix,
186
+ children: o
187
+ }) : null
188
+ ]
189
+ });
190
+ }), re = n(function({ label: e, helperText: t, ...n }, r) {
191
+ return E() ? !e && !t && !n.error ? /* @__PURE__ */ f(P, {
192
+ ...n,
193
+ ref: r
194
+ }) : /* @__PURE__ */ f(M, {
195
+ id: n.id,
196
+ label: e,
197
+ helperText: t,
198
+ error: n.error,
199
+ required: n.required,
200
+ disabled: n.disabled,
201
+ children: /* @__PURE__ */ f(P, {
202
+ ...n,
203
+ ref: r
204
+ })
205
+ }) : /* @__PURE__ */ f(D, {});
206
+ }), F = {
207
+ control: "cui-Select-module__control--OqOfI",
208
+ trigger: "cui-Select-module__trigger--ECKfC",
209
+ open: "cui-Select-module__open--PADOK",
210
+ value: "cui-Select-module__value--7CDNo",
211
+ placeholder: "cui-Select-module__placeholder--yUgBU",
212
+ sm: "cui-Select-module__sm--TPJwf",
213
+ md: "cui-Select-module__md--nOV6u",
214
+ lg: "cui-Select-module__lg--NGPOa",
215
+ chevron: "cui-Select-module__chevron--PLUsh",
216
+ clear: "cui-Select-module__clear--2OgzI",
217
+ invalid: "cui-Select-module__invalid--opDrx",
218
+ disabled: "cui-Select-module__disabled--8YgjS",
219
+ popover: "cui-Select-module__popover--VnWAu",
220
+ "cui-select-in": "cui-Select-module__cui-select-in--VGYFd",
221
+ top: "cui-Select-module__top--v5FSw",
222
+ "cui-select-in-top": "cui-Select-module__cui-select-in-top--fwYA4",
223
+ searchWrap: "cui-Select-module__searchWrap--YBOFZ",
224
+ search: "cui-Select-module__search--FrUXx",
225
+ list: "cui-Select-module__list--CI08p",
226
+ option: "cui-Select-module__option--Hvo8n",
227
+ optionLabel: "cui-Select-module__optionLabel--FGiUZ",
228
+ selected: "cui-Select-module__selected--8A13A",
229
+ highlighted: "cui-Select-module__highlighted--YIVPT",
230
+ optionDisabled: "cui-Select-module__optionDisabled--FhDw-",
231
+ check: "cui-Select-module__check--RxZrV",
232
+ empty: "cui-Select-module__empty--KmYrm",
233
+ spinner: "cui-Select-module__spinner--OxCAP",
234
+ "cui-select-spin": "cui-Select-module__cui-select-spin--MQqaM"
235
+ }, ie = 4, ae = 280, oe = 500, se = (e) => Array.isArray(e) ? e : e ? [e] : [], I = n(function({ options: e, placeholder: t = "Select an option", size: n = "md", multiple: i = !1, clearable: u = !0, onSearch: d, loading: g = !1, emptyMessage: _ = "No options found.", listClassName: v, name: y, value: b, defaultValue: x, onChange: S, id: C, required: w, disabled: T, error: ee, "aria-describedby": E, className: te, onKeyDown: D, onClick: O, ...ne }, k) {
236
+ let j = A({
237
+ id: C,
238
+ required: w,
239
+ disabled: T,
240
+ error: ee,
241
+ "aria-describedby": E
242
+ }), M = o(), N = `${M}-list`, P = `${M}-value`, re = (e) => `${M}-option-${e}`, I = c(null), ce = c(null), L = c(null), R = c(null), le = c(null), [z, ue] = l(!1), [B, de] = l(null), [V, fe] = l(""), [H, pe] = l(!1), [U, W] = l(0), G = b !== void 0, [me, K] = l(() => se(x)), q = G ? se(b) : me, he = r((e) => {
243
+ ce.current = e, typeof k == "function" ? k(e) : k && (k.current = e);
244
+ }, [k]), J = s(() => {
245
+ if (d || !V) return e;
246
+ let t = V.toLowerCase();
247
+ return e.filter((e) => e.label.toLowerCase().includes(t));
248
+ }, [
249
+ e,
250
+ V,
251
+ d
252
+ ]), Y = (e) => {
253
+ G || K(e), S?.(i ? e : e[0] ?? "");
254
+ }, X = (e) => {
255
+ let t = e.findIndex((e) => !e.disabled);
256
+ return t === -1 ? 0 : t;
257
+ }, ge = r(() => {
258
+ let e = I.current;
259
+ if (!e) return;
260
+ let t = e.getBoundingClientRect(), n = window.innerHeight - t.bottom, r = n < ae && t.top > n ? "top" : "bottom", i = {
261
+ left: t.left,
262
+ width: t.width
263
+ };
264
+ r === "bottom" ? i.top = t.bottom + ie : i.bottom = window.innerHeight - t.top + ie, de({
265
+ style: i,
266
+ placement: r
267
+ });
268
+ }, []), Z = () => {
269
+ if (j.disabled) return;
270
+ ge(), fe(""), pe(!1);
271
+ let t = e.findIndex((e) => q.includes(e.value));
272
+ W(t === -1 ? X(e) : t), ue(!0);
273
+ }, _e = (e = !0) => {
274
+ ue(!1), e && ce.current?.focus({ preventScroll: !0 });
275
+ }, ve = (e) => {
276
+ e.disabled || (i ? Y(q.includes(e.value) ? q.filter((t) => t !== e.value) : [...q, e.value]) : (Y([e.value]), _e()), fe(""), pe(!1));
277
+ }, ye = (e) => {
278
+ if (!J.length) return;
279
+ let t = U;
280
+ for (let n = 0; n < J.length && (t = (t + e + J.length) % J.length, J[t]?.disabled); n++);
281
+ W(t);
282
+ };
283
+ a(() => {
284
+ z && R.current?.focus({ preventScroll: !0 });
285
+ }, [z]), a(() => {
286
+ H && le.current?.focus({ preventScroll: !0 });
287
+ }, [H]);
288
+ let be = c(d);
289
+ a(() => {
290
+ be.current = d;
291
+ }, [d]), a(() => {
292
+ if (!z || !be.current) return;
293
+ let e = setTimeout(() => be.current?.(V), oe);
294
+ return () => clearTimeout(e);
295
+ }, [V, z]), a(() => {
296
+ if (!z) return;
297
+ let e = () => requestAnimationFrame(ge);
298
+ return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), () => {
299
+ window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e);
300
+ };
301
+ }, [z, ge]), a(() => {
302
+ if (!z) return;
303
+ let e = (e) => {
304
+ let t = e.target;
305
+ !I.current?.contains(t) && !L.current?.contains(t) && ue(!1);
306
+ };
307
+ return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
308
+ }, [z]), a(() => {
309
+ if (!z) return;
310
+ let e = R.current, t = e?.children[U];
311
+ e && t && (t.offsetTop < e.scrollTop ? e.scrollTop = t.offsetTop : t.offsetTop + t.offsetHeight > e.scrollTop + e.clientHeight && (e.scrollTop = t.offsetTop + t.offsetHeight - e.clientHeight));
312
+ }, [U, z]);
313
+ let xe = (e) => {
314
+ D?.(e), !e.defaultPrevented && !z && (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), Z());
315
+ }, Se = (e) => {
316
+ switch (e.key) {
317
+ case "Escape":
318
+ e.preventDefault(), e.stopPropagation(), _e();
319
+ return;
320
+ case "ArrowDown":
321
+ e.preventDefault(), ye(1);
322
+ return;
323
+ case "ArrowUp":
324
+ e.preventDefault(), ye(-1);
325
+ return;
326
+ case "Home":
327
+ if (H) return;
328
+ e.preventDefault(), W(X(J));
329
+ return;
330
+ case "End":
331
+ if (H) return;
332
+ e.preventDefault(), W(Math.max(J.length - 1, 0));
333
+ return;
334
+ case "Enter":
335
+ e.preventDefault(), e.stopPropagation(), J[U] && ve(J[U]);
336
+ return;
337
+ case "Tab":
338
+ ue(!1), ce.current?.focus({ preventScroll: !0 });
339
+ return;
340
+ case " ":
341
+ if (H) return;
342
+ e.preventDefault(), J[U] && ve(J[U]);
343
+ return;
344
+ }
345
+ let t = e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey;
346
+ !H && t && (e.preventDefault(), fe(e.key), W(0), pe(!0));
347
+ }, Q = e.filter((e) => q.includes(e.value)), Ce = q.length > 0, we = q.length > 1 ? `${q.length} selected` : Q[0]?.label ?? t, Te = u && Ce && !j.disabled, Ee = z ? I.current?.closest("[data-theme]")?.getAttribute("data-theme") : void 0, De = z && J[U] ? re(U) : void 0, $ = j.labelId ? `${j.labelId} ${P}` : void 0;
348
+ return /* @__PURE__ */ p("div", {
349
+ ref: I,
350
+ className: h(F.control, F[n], j.invalid && F.invalid, j.disabled && F.disabled, z && F.open, te),
351
+ children: [
352
+ /* @__PURE__ */ f("button", {
353
+ ...ne,
354
+ ref: he,
355
+ id: j.id,
356
+ type: "button",
357
+ role: "combobox",
358
+ "aria-haspopup": "listbox",
359
+ "aria-expanded": z,
360
+ "aria-controls": z ? N : void 0,
361
+ "aria-labelledby": $,
362
+ "aria-invalid": j["aria-invalid"],
363
+ "aria-describedby": j["aria-describedby"],
364
+ "aria-required": j.required || void 0,
365
+ disabled: j.disabled,
366
+ className: h(F.trigger, !Q.length && F.placeholder),
367
+ onClick: (e) => {
368
+ O?.(e), !e.defaultPrevented && (z ? _e(!1) : Z());
369
+ },
370
+ onKeyDown: xe,
371
+ children: /* @__PURE__ */ f("span", {
372
+ id: P,
373
+ className: F.value,
374
+ children: we
375
+ })
376
+ }),
377
+ Te ? /* @__PURE__ */ f("button", {
378
+ type: "button",
379
+ className: F.clear,
380
+ "aria-label": "Clear selection",
381
+ onClick: () => {
382
+ Y([]), ce.current?.focus({ preventScroll: !0 });
383
+ },
384
+ children: /* @__PURE__ */ f("svg", {
385
+ viewBox: "0 0 20 20",
386
+ "aria-hidden": "true",
387
+ focusable: "false",
388
+ children: /* @__PURE__ */ f("path", {
389
+ d: "M6 6l8 8M14 6l-8 8",
390
+ fill: "none",
391
+ stroke: "currentColor",
392
+ strokeWidth: "2",
393
+ strokeLinecap: "round"
394
+ })
395
+ })
396
+ }) : null,
397
+ /* @__PURE__ */ f("svg", {
398
+ className: F.chevron,
399
+ viewBox: "0 0 20 20",
400
+ "aria-hidden": "true",
401
+ focusable: "false",
402
+ children: /* @__PURE__ */ f("path", {
403
+ d: "M5 7.5l5 5 5-5",
404
+ fill: "none",
405
+ stroke: "currentColor",
406
+ strokeWidth: "2",
407
+ strokeLinecap: "round",
408
+ strokeLinejoin: "round"
409
+ })
410
+ }),
411
+ y ? q.length > 0 ? q.map((e) => /* @__PURE__ */ f("input", {
412
+ type: "hidden",
413
+ name: y,
414
+ value: e
415
+ }, e)) : !i && /* @__PURE__ */ f("input", {
416
+ type: "hidden",
417
+ name: y,
418
+ value: ""
419
+ }) : null,
420
+ z && B ? m(/* @__PURE__ */ p("div", {
421
+ ref: L,
422
+ className: h(F.popover, F[B.placement]),
423
+ style: B.style,
424
+ "data-theme": Ee ?? void 0,
425
+ onKeyDown: Se,
426
+ children: [H ? /* @__PURE__ */ f("div", {
427
+ className: F.searchWrap,
428
+ children: /* @__PURE__ */ f("input", {
429
+ ref: le,
430
+ type: "text",
431
+ className: F.search,
432
+ placeholder: "Search options...",
433
+ "aria-label": "Search options",
434
+ "aria-controls": N,
435
+ "aria-activedescendant": De,
436
+ autoComplete: "off",
437
+ value: V,
438
+ onChange: (e) => {
439
+ let t = e.target.value;
440
+ fe(t), W(0), t === "" && (pe(!1), R.current?.focus({ preventScroll: !0 }));
441
+ }
442
+ })
443
+ }) : null, /* @__PURE__ */ f("ul", {
444
+ ref: R,
445
+ id: N,
446
+ role: "listbox",
447
+ tabIndex: -1,
448
+ "aria-labelledby": $,
449
+ "aria-multiselectable": i || void 0,
450
+ "aria-activedescendant": H ? void 0 : De,
451
+ className: h(F.list, v),
452
+ children: J.length > 0 ? J.map((e, t) => {
453
+ let n = q.includes(e.value);
454
+ return /* @__PURE__ */ p("li", {
455
+ id: re(t),
456
+ role: "option",
457
+ "aria-selected": n,
458
+ "aria-disabled": e.disabled || void 0,
459
+ className: h(F.option, n && F.selected, t === U && F.highlighted, e.disabled && F.optionDisabled),
460
+ onMouseEnter: () => !e.disabled && W(t),
461
+ onClick: () => ve(e),
462
+ children: [/* @__PURE__ */ f("span", {
463
+ className: F.optionLabel,
464
+ children: e.label
465
+ }), n ? /* @__PURE__ */ f("svg", {
466
+ className: F.check,
467
+ viewBox: "0 0 20 20",
468
+ "aria-hidden": "true",
469
+ focusable: "false",
470
+ children: /* @__PURE__ */ f("path", {
471
+ d: "M4.5 10.5l3.5 3.5 7.5-8",
472
+ fill: "none",
473
+ stroke: "currentColor",
474
+ strokeWidth: "2",
475
+ strokeLinecap: "round",
476
+ strokeLinejoin: "round"
477
+ })
478
+ }) : null]
479
+ }, e.value);
480
+ }) : /* @__PURE__ */ f("li", {
481
+ className: F.empty,
482
+ role: "presentation",
483
+ children: g ? /* @__PURE__ */ f("span", {
484
+ className: F.spinner,
485
+ role: "status",
486
+ "aria-label": "Loading"
487
+ }) : _
488
+ })
489
+ })]
490
+ }), document.body) : null
491
+ ]
492
+ });
493
+ }), ce = n(function({ label: e, helperText: t, ...n }, r) {
494
+ if (!E()) return /* @__PURE__ */ f(D, {});
495
+ let i = n;
496
+ return !e && !t && !n.error ? /* @__PURE__ */ f(I, {
497
+ ...i,
498
+ ref: r
499
+ }) : /* @__PURE__ */ f(M, {
500
+ id: n.id,
501
+ label: e,
502
+ helperText: t,
503
+ error: n.error,
504
+ required: n.required,
505
+ disabled: n.disabled,
506
+ children: /* @__PURE__ */ f(I, {
507
+ ...i,
508
+ ref: r
509
+ })
510
+ });
511
+ }), L = {
512
+ textarea: "cui-Textarea-module__textarea--Z-y6g",
513
+ invalid: "cui-Textarea-module__invalid--E88X-",
514
+ "resize-none": "cui-Textarea-module__resize-none---T499",
515
+ "resize-vertical": "cui-Textarea-module__resize-vertical--P4hRY",
516
+ "resize-horizontal": "cui-Textarea-module__resize-horizontal--htj2f",
517
+ "resize-both": "cui-Textarea-module__resize-both--wR4os",
518
+ readOnly: "cui-Textarea-module__readOnly--mI513"
519
+ }, R = n(function({ id: e, required: t, disabled: n, error: r, "aria-describedby": i, rows: a = 3, resize: o = "vertical", readOnly: s, className: c, ...l }, u) {
520
+ let d = A({
521
+ id: e,
522
+ required: t,
523
+ disabled: n,
524
+ error: r,
525
+ "aria-describedby": i
526
+ });
527
+ return /* @__PURE__ */ f("textarea", {
528
+ ...l,
529
+ ref: u,
530
+ id: d.id,
531
+ rows: a,
532
+ required: d.required,
533
+ disabled: d.disabled,
534
+ readOnly: s,
535
+ "aria-invalid": d["aria-invalid"],
536
+ "aria-describedby": d["aria-describedby"],
537
+ className: h(L.textarea, L[`resize-${o}`], d.invalid && L.invalid, s && L.readOnly, c)
538
+ });
539
+ }), le = n(function({ label: e, helperText: t, ...n }, r) {
540
+ return E() ? !e && !t && !n.error ? /* @__PURE__ */ f(R, {
541
+ ...n,
542
+ ref: r
543
+ }) : /* @__PURE__ */ f(M, {
544
+ id: n.id,
545
+ label: e,
546
+ helperText: t,
547
+ error: n.error,
548
+ required: n.required,
549
+ disabled: n.disabled,
550
+ children: /* @__PURE__ */ f(R, {
551
+ ...n,
552
+ ref: r
553
+ })
554
+ }) : /* @__PURE__ */ f(D, {});
555
+ }), z = {
556
+ root: "cui-Checkbox-module__root--mY3qk",
557
+ label: "cui-Checkbox-module__label--cwRtI",
558
+ disabled: "cui-Checkbox-module__disabled--x7-eg",
559
+ input: "cui-Checkbox-module__input--2kt-h",
560
+ box: "cui-Checkbox-module__box--OCPee",
561
+ check: "cui-Checkbox-module__check--4HYWn",
562
+ dash: "cui-Checkbox-module__dash--5Dkdl",
563
+ invalid: "cui-Checkbox-module__invalid---Cs7q",
564
+ text: "cui-Checkbox-module__text--EmtRj",
565
+ required: "cui-Checkbox-module__required--t9DLN",
566
+ message: "cui-Checkbox-module__message--ZPKsV",
567
+ helper: "cui-Checkbox-module__helper--16DrX",
568
+ error: "cui-Checkbox-module__error--E-bmD"
569
+ }, ue = n(function({ label: e, helperText: t, error: n, indeterminate: i = !1, id: o, required: s, disabled: l, "aria-describedby": u, className: d, ...m }, g) {
570
+ let _ = c(null), v = r((e) => {
571
+ _.current = e, typeof g == "function" ? g(e) : g && (g.current = e);
572
+ }, [g]);
573
+ a(() => {
574
+ _.current && (_.current.indeterminate = i);
575
+ }, [i]);
576
+ let y = A({
577
+ id: o,
578
+ required: s,
579
+ disabled: l,
580
+ error: n,
581
+ "aria-describedby": u
582
+ });
583
+ if (!E()) return /* @__PURE__ */ f(D, {});
584
+ let b = `${y.id}-message`, x = !!(n || t), S = [y["aria-describedby"], x ? b : void 0].filter(Boolean).join(" ") || void 0;
585
+ return /* @__PURE__ */ p("div", {
586
+ className: h(z.root, d),
587
+ children: [/* @__PURE__ */ p("label", {
588
+ className: h(z.label, y.disabled && z.disabled),
589
+ children: [
590
+ /* @__PURE__ */ f("input", {
591
+ ...m,
592
+ ref: v,
593
+ id: y.id,
594
+ type: "checkbox",
595
+ required: y.required,
596
+ disabled: y.disabled,
597
+ "aria-invalid": y["aria-invalid"],
598
+ "aria-describedby": S,
599
+ className: h(z.input, y.invalid && z.invalid)
600
+ }),
601
+ /* @__PURE__ */ p("span", {
602
+ className: z.box,
603
+ "aria-hidden": "true",
604
+ children: [/* @__PURE__ */ f("svg", {
605
+ className: z.check,
606
+ viewBox: "0 0 20 20",
607
+ focusable: "false",
608
+ children: /* @__PURE__ */ f("path", {
609
+ d: "M4.5 10.5l3.5 3.5 7.5-8",
610
+ fill: "none",
611
+ stroke: "currentColor",
612
+ strokeWidth: "2.5",
613
+ strokeLinecap: "round",
614
+ strokeLinejoin: "round"
615
+ })
616
+ }), /* @__PURE__ */ f("svg", {
617
+ className: z.dash,
618
+ viewBox: "0 0 20 20",
619
+ focusable: "false",
620
+ children: /* @__PURE__ */ f("path", {
621
+ d: "M5 10h10",
622
+ fill: "none",
623
+ stroke: "currentColor",
624
+ strokeWidth: "2.5",
625
+ strokeLinecap: "round"
626
+ })
627
+ })]
628
+ }),
629
+ e ? /* @__PURE__ */ p("span", {
630
+ className: z.text,
631
+ children: [e, y.required ? /* @__PURE__ */ f("span", {
632
+ className: z.required,
633
+ "aria-hidden": "true",
634
+ children: "*"
635
+ }) : null]
636
+ }) : null
637
+ ]
638
+ }), x ? /* @__PURE__ */ f("p", {
639
+ id: b,
640
+ className: h(z.message, n ? z.error : z.helper),
641
+ role: n ? "alert" : void 0,
642
+ children: n || t
643
+ }) : null]
644
+ });
645
+ }), B = {
646
+ root: "cui-Switch-module__root--Y5Ydi",
647
+ label: "cui-Switch-module__label--LrH7V",
648
+ disabled: "cui-Switch-module__disabled--2aZ0V",
649
+ input: "cui-Switch-module__input--5BPNu",
650
+ track: "cui-Switch-module__track--7ObdZ",
651
+ thumb: "cui-Switch-module__thumb---FTeK",
652
+ invalid: "cui-Switch-module__invalid--4QBSq",
653
+ required: "cui-Switch-module__required--cVb-Z",
654
+ message: "cui-Switch-module__message--fA-a5",
655
+ helper: "cui-Switch-module__helper--gZCYS",
656
+ error: "cui-Switch-module__error--OSPrU"
657
+ }, de = n(function({ label: e, helperText: t, error: n, id: r, required: i, disabled: a, "aria-describedby": o, className: s, ...c }, l) {
658
+ let u = A({
659
+ id: r,
660
+ required: i,
661
+ disabled: a,
662
+ error: n,
663
+ "aria-describedby": o
664
+ });
665
+ if (!E()) return /* @__PURE__ */ f(D, {});
666
+ let d = `${u.id}-message`, m = !!(n || t), g = [u["aria-describedby"], m ? d : void 0].filter(Boolean).join(" ") || void 0;
667
+ return /* @__PURE__ */ p("div", {
668
+ className: h(B.root, s),
669
+ children: [/* @__PURE__ */ p("label", {
670
+ className: h(B.label, u.disabled && B.disabled),
671
+ children: [
672
+ /* @__PURE__ */ f("input", {
673
+ ...c,
674
+ ref: l,
675
+ id: u.id,
676
+ type: "checkbox",
677
+ role: "switch",
678
+ required: u.required,
679
+ disabled: u.disabled,
680
+ "aria-invalid": u["aria-invalid"],
681
+ "aria-describedby": g,
682
+ className: h(B.input, u.invalid && B.invalid)
683
+ }),
684
+ /* @__PURE__ */ f("span", {
685
+ className: B.track,
686
+ "aria-hidden": "true",
687
+ children: /* @__PURE__ */ f("span", { className: B.thumb })
688
+ }),
689
+ e ? /* @__PURE__ */ p("span", {
690
+ className: B.text,
691
+ children: [e, u.required ? /* @__PURE__ */ f("span", {
692
+ className: B.required,
693
+ "aria-hidden": "true",
694
+ children: "*"
695
+ }) : null]
696
+ }) : null
697
+ ]
698
+ }), m ? /* @__PURE__ */ f("p", {
699
+ id: d,
700
+ className: h(B.message, n ? B.error : B.helper),
701
+ role: n ? "alert" : void 0,
702
+ children: n || t
703
+ }) : null]
704
+ });
705
+ }), V = {
706
+ root: "cui-Badge-module__root--5osNT",
707
+ dot: "cui-Badge-module__dot--i0c-G",
708
+ neutral: "cui-Badge-module__neutral--lulSm",
709
+ primary: "cui-Badge-module__primary--S0WCS",
710
+ success: "cui-Badge-module__success--u9JiS",
711
+ warning: "cui-Badge-module__warning--nsGp-",
712
+ danger: "cui-Badge-module__danger--PD2hz",
713
+ info: "cui-Badge-module__info--na6DQ"
714
+ };
715
+ //#endregion
716
+ //#region src/components/Badge/Badge.tsx
717
+ function fe({ color: e = "neutral", dot: t = !1, className: n, children: r, ...i }) {
718
+ return E() ? /* @__PURE__ */ p("span", {
719
+ ...i,
720
+ className: h(V.root, V[e], n),
721
+ children: [t ? /* @__PURE__ */ f("span", {
722
+ className: V.dot,
723
+ "aria-hidden": "true"
724
+ }) : null, r]
725
+ }) : /* @__PURE__ */ f(D, {});
726
+ }
727
+ var H = {
728
+ root: "cui-Skeleton-module__root--qaX19",
729
+ "cui-skeleton-pulse": "cui-Skeleton-module__cui-skeleton-pulse--HzSoY",
730
+ rect: "cui-Skeleton-module__rect--do1uR",
731
+ text: "cui-Skeleton-module__text---A8IF",
732
+ circle: "cui-Skeleton-module__circle--DYcl8"
733
+ };
734
+ //#endregion
735
+ //#region src/components/Skeleton/Skeleton.tsx
736
+ function pe({ variant: e = "rect", width: t, height: n, className: r, style: i, ...a }) {
737
+ if (!E()) return /* @__PURE__ */ f(D, {});
738
+ let o = {
739
+ width: t,
740
+ height: n ?? (e === "circle" ? t : void 0)
741
+ };
742
+ return /* @__PURE__ */ f("span", {
743
+ "aria-hidden": "true",
744
+ ...a,
745
+ className: h(H.root, H[e], r),
746
+ style: {
747
+ ...o,
748
+ ...i
749
+ }
750
+ });
751
+ }
752
+ var U = {
753
+ root: "cui-Tabs-module__root---VKVI",
754
+ list: "cui-Tabs-module__list--qRVME",
755
+ tab: "cui-Tabs-module__tab--IdDYc",
756
+ selected: "cui-Tabs-module__selected--TxfYv",
757
+ icon: "cui-Tabs-module__icon--LYFix",
758
+ panel: "cui-Tabs-module__panel--08i9c"
759
+ };
760
+ //#endregion
761
+ //#region src/components/Tabs/Tabs.tsx
762
+ function W({ items: e, value: t, defaultValue: n, onValueChange: r, className: i, "aria-label": a, ...s }) {
763
+ let u = o(), d = c([]), m = e.find((e) => !e.disabled)?.value, [g, _] = l(n ?? m);
764
+ if (!E()) return /* @__PURE__ */ f(D, {});
765
+ let v = t ?? g, y = e.findIndex((e) => e.value === v), b = e[y], x = (e) => {
766
+ t === void 0 && _(e), r?.(e);
767
+ }, S = (t, n) => {
768
+ let r = e.length, i = n === "first" ? -1 : n === "last" ? r : t, a = n === "first" ? 1 : n === "last" ? -1 : n;
769
+ for (let t = 0; t < r; t++) {
770
+ i = (i + a + r) % r;
771
+ let t = e[i];
772
+ if (t && !t.disabled) {
773
+ x(t.value), d.current[i]?.focus();
774
+ return;
775
+ }
776
+ }
777
+ }, C = (e, t) => {
778
+ let n = getComputedStyle(e.currentTarget).direction === "rtl", r = n ? "ArrowLeft" : "ArrowRight", i = n ? "ArrowRight" : "ArrowLeft";
779
+ if (e.key === r) S(t, 1);
780
+ else if (e.key === i) S(t, -1);
781
+ else if (e.key === "Home") S(t, "first");
782
+ else if (e.key === "End") S(t, "last");
783
+ else return;
784
+ e.preventDefault();
785
+ }, w = (e) => `${u}-tab-${e}`, T = (e) => `${u}-panel-${e}`;
786
+ return /* @__PURE__ */ p("div", {
787
+ ...s,
788
+ className: h(U.root, i),
789
+ children: [/* @__PURE__ */ f("div", {
790
+ role: "tablist",
791
+ "aria-label": a,
792
+ className: U.list,
793
+ children: e.map((e, t) => {
794
+ let n = t === y;
795
+ return /* @__PURE__ */ p("button", {
796
+ ref: (e) => {
797
+ d.current[t] = e;
798
+ },
799
+ id: w(t),
800
+ type: "button",
801
+ role: "tab",
802
+ "aria-selected": n,
803
+ "aria-controls": n && e.content !== void 0 ? T(t) : void 0,
804
+ tabIndex: n ? 0 : -1,
805
+ disabled: e.disabled,
806
+ className: h(U.tab, n && U.selected),
807
+ onClick: () => x(e.value),
808
+ onKeyDown: (e) => C(e, t),
809
+ children: [e.icon ? /* @__PURE__ */ f("span", {
810
+ className: U.icon,
811
+ "aria-hidden": "true",
812
+ children: e.icon
813
+ }) : null, e.label]
814
+ }, e.value);
815
+ })
816
+ }), b && b.content !== void 0 ? /* @__PURE__ */ f("div", {
817
+ role: "tabpanel",
818
+ id: T(y),
819
+ "aria-labelledby": w(y),
820
+ tabIndex: 0,
821
+ className: U.panel,
822
+ children: b.content
823
+ }) : null]
824
+ });
825
+ }
826
+ var G = {
827
+ root: "cui-FormSection-module__root--M70AE",
828
+ header: "cui-FormSection-module__header--xTDAF",
829
+ heading: "cui-FormSection-module__heading--QU0-u",
830
+ title: "cui-FormSection-module__title--cw5qX",
831
+ subtitle: "cui-FormSection-module__subtitle--cIB53",
832
+ divider: "cui-FormSection-module__divider--954nY",
833
+ fields: "cui-FormSection-module__fields--ALVzc",
834
+ columns2: "cui-FormSection-module__columns2--IgG6n",
835
+ columns3: "cui-FormSection-module__columns3--q-4XF"
836
+ };
837
+ //#endregion
838
+ //#region src/components/FormSection/FormSection.tsx
839
+ function me({ title: e, subtitle: n, children: r, columns: i = 1, headingLevel: a = 3, className: s, ...c }) {
840
+ let l = o(), u = !!(e || n);
841
+ return E() ? /* @__PURE__ */ p("section", {
842
+ ...c,
843
+ "aria-labelledby": e ? l : c["aria-labelledby"],
844
+ className: h(G.root, s),
845
+ children: [u ? /* @__PURE__ */ p("div", {
846
+ className: G.header,
847
+ children: [/* @__PURE__ */ p("div", {
848
+ className: G.heading,
849
+ children: [e ? t(`h${a}`, {
850
+ id: l,
851
+ className: G.title
852
+ }, e) : null, n ? /* @__PURE__ */ f("p", {
853
+ className: G.subtitle,
854
+ children: n
855
+ }) : null]
856
+ }), /* @__PURE__ */ f("span", {
857
+ className: G.divider,
858
+ "aria-hidden": "true"
859
+ })]
860
+ }) : null, /* @__PURE__ */ f("div", {
861
+ className: h(G.fields, G[`columns${i}`]),
862
+ children: r
863
+ })]
864
+ }) : /* @__PURE__ */ f(D, {});
865
+ }
866
+ var K = {
867
+ root: "cui-Avatar-module__root--fXu-J",
868
+ xs: "cui-Avatar-module__xs--oSaLL",
869
+ sm: "cui-Avatar-module__sm--sZ2bk",
870
+ md: "cui-Avatar-module__md--Fdkbz",
871
+ lg: "cui-Avatar-module__lg--pTTUA",
872
+ xl: "cui-Avatar-module__xl--mW58F",
873
+ image: "cui-Avatar-module__image--ieqGp",
874
+ fallback: "cui-Avatar-module__fallback--BWBXY",
875
+ tone0: "cui-Avatar-module__tone0--NoD23",
876
+ tone1: "cui-Avatar-module__tone1--xFqRb",
877
+ tone2: "cui-Avatar-module__tone2--nxsRe",
878
+ tone3: "cui-Avatar-module__tone3--goa6z",
879
+ tone4: "cui-Avatar-module__tone4--g6kRy",
880
+ primary: "cui-Avatar-module__primary--HKPgn"
881
+ }, q = [
882
+ K.tone0,
883
+ K.tone1,
884
+ K.tone2,
885
+ K.tone3,
886
+ K.tone4
887
+ ];
888
+ function he(e) {
889
+ let t = (e ?? "").trim().split(/\s+/).filter(Boolean);
890
+ return t.length === 0 ? "" : ((t[0]?.[0] ?? "") + (t.length > 1 ? t[t.length - 1]?.[0] ?? "" : "")).toUpperCase();
891
+ }
892
+ function J(e) {
893
+ let t = e ?? "", n = 0;
894
+ for (let e = 0; e < t.length; e++) n = n * 31 + t.charCodeAt(e) >>> 0;
895
+ return q[n % q.length];
896
+ }
897
+ function Y({ name: e, src: t, size: n = "md", tone: r = "auto", className: i, ...a }) {
898
+ let [o, s] = l(null), c = !!t && t !== o, u = he(e);
899
+ return E() ? /* @__PURE__ */ f("span", {
900
+ role: a["aria-hidden"] ? void 0 : "img",
901
+ "aria-label": a["aria-hidden"] || !e ? void 0 : e,
902
+ ...a,
903
+ className: h(K.root, K[n], !c && (r === "primary" ? K.primary : J(e)), i),
904
+ children: c ? /* @__PURE__ */ f("img", {
905
+ className: K.image,
906
+ src: t ?? void 0,
907
+ alt: "",
908
+ onError: () => s(t ?? null)
909
+ }) : u ? /* @__PURE__ */ f("span", {
910
+ "aria-hidden": "true",
911
+ children: u
912
+ }) : /* @__PURE__ */ p("svg", {
913
+ className: K.fallback,
914
+ viewBox: "0 0 24 24",
915
+ "aria-hidden": "true",
916
+ focusable: "false",
917
+ children: [/* @__PURE__ */ f("circle", {
918
+ cx: "12",
919
+ cy: "8",
920
+ r: "4",
921
+ fill: "currentColor"
922
+ }), /* @__PURE__ */ f("path", {
923
+ d: "M4 21c0-4.4 3.6-7 8-7s8 2.6 8 7z",
924
+ fill: "currentColor"
925
+ })]
926
+ })
927
+ }) : /* @__PURE__ */ f(D, {});
928
+ }
929
+ var X = {
930
+ root: "cui-AccountPanel-module__root--Twbp0",
931
+ rootSidebar: "cui-AccountPanel-module__rootSidebar--OMB7L",
932
+ contents: "cui-AccountPanel-module__contents--OFL-r",
933
+ triggerHeader: "cui-AccountPanel-module__triggerHeader--ib8Bi",
934
+ triggerOpen: "cui-AccountPanel-module__triggerOpen--NbT3m",
935
+ triggerSidebar: "cui-AccountPanel-module__triggerSidebar--FeaXc",
936
+ collapsed: "cui-AccountPanel-module__collapsed--c8z-m",
937
+ identityText: "cui-AccountPanel-module__identityText--eziAT",
938
+ triggerName: "cui-AccountPanel-module__triggerName--f56mY",
939
+ triggerRole: "cui-AccountPanel-module__triggerRole--KpeeO",
940
+ panel: "cui-AccountPanel-module__panel--PinlA",
941
+ "cui-account-in": "cui-AccountPanel-module__cui-account-in--QVNEb",
942
+ panelSidebar: "cui-AccountPanel-module__panelSidebar--EuGZh",
943
+ identity: "cui-AccountPanel-module__identity--lZRA7",
944
+ email: "cui-AccountPanel-module__email--Ze3OW",
945
+ avatarRing: "cui-AccountPanel-module__avatarRing--FQrz4",
946
+ avatarInner: "cui-AccountPanel-module__avatarInner--5ZfEz",
947
+ greeting: "cui-AccountPanel-module__greeting--am-j3",
948
+ role: "cui-AccountPanel-module__role--E9lrf",
949
+ pills: "cui-AccountPanel-module__pills--5gSce",
950
+ pill: "cui-AccountPanel-module__pill--vK7aC",
951
+ actionIcon: "cui-AccountPanel-module__actionIcon--oReIE",
952
+ externalIcon: "cui-AccountPanel-module__externalIcon--dJc16",
953
+ details: "cui-AccountPanel-module__details--MGxxd",
954
+ detailRow: "cui-AccountPanel-module__detailRow--VzvVD",
955
+ apps: "cui-AccountPanel-module__apps--KRMBA",
956
+ appsTitle: "cui-AccountPanel-module__appsTitle--mcvnH",
957
+ grid: "cui-AccountPanel-module__grid--KYmem",
958
+ app: "cui-AccountPanel-module__app--Dj--X",
959
+ tile: "cui-AccountPanel-module__tile--YKNda",
960
+ tonePrimary: "cui-AccountPanel-module__tonePrimary--lAexZ",
961
+ toneInfo: "cui-AccountPanel-module__toneInfo--yb-xj",
962
+ toneSuccess: "cui-AccountPanel-module__toneSuccess--XIJic",
963
+ toneWarning: "cui-AccountPanel-module__toneWarning--oz2d6",
964
+ toneDanger: "cui-AccountPanel-module__toneDanger--MP2rJ",
965
+ toneNeutral: "cui-AccountPanel-module__toneNeutral--diEHz",
966
+ appName: "cui-AccountPanel-module__appName--MJc25",
967
+ danger: "cui-AccountPanel-module__danger--t0t-L",
968
+ dangerAction: "cui-AccountPanel-module__dangerAction--jvJ7-"
969
+ }, ge = 8, Z = 12, _e = 352, ve = "a[href], button:not([disabled])", ye = ({ href: e, className: t, title: n, onClick: r, children: i }) => /* @__PURE__ */ f("a", {
970
+ href: e,
971
+ className: t,
972
+ title: n,
973
+ onClick: r,
974
+ children: i
975
+ }), be = {
976
+ primary: X.tonePrimary,
977
+ info: X.toneInfo,
978
+ success: X.toneSuccess,
979
+ warning: X.toneWarning,
980
+ danger: X.toneDanger,
981
+ neutral: X.toneNeutral
982
+ };
983
+ function xe() {
984
+ return /* @__PURE__ */ f("svg", {
985
+ className: X.externalIcon,
986
+ viewBox: "0 0 20 20",
987
+ "aria-hidden": "true",
988
+ focusable: "false",
989
+ children: /* @__PURE__ */ f("path", {
990
+ d: "M8 5H5v10h10v-3M11 5h4v4M15 5l-7 7",
991
+ fill: "none",
992
+ stroke: "currentColor",
993
+ strokeWidth: "1.8",
994
+ strokeLinecap: "round",
995
+ strokeLinejoin: "round"
996
+ })
997
+ });
998
+ }
999
+ function Se({ user: e, apps: t = [], actions: n = [], placement: r = "header", collapsed: i = !1, appsTitle: s = "All Apps", greeting: u = "Hi", renderLink: g = ye, className: _ }) {
1000
+ let v = r === "sidebar", y = o(), b = c(null), x = c(null), S = c(null), [C, w] = l(!1), [T, ee] = l(null), [te, O] = l(), ne = () => {
1001
+ let e = x.current;
1002
+ if (!e) return;
1003
+ let t = e.getBoundingClientRect();
1004
+ if (v) {
1005
+ let e = Math.min(_e, window.innerWidth - 24);
1006
+ ee({
1007
+ left: Math.max(Z, Math.min(t.right + ge, window.innerWidth - e - Z)),
1008
+ bottom: Math.max(Z, window.innerHeight - t.bottom)
1009
+ });
1010
+ } else ee({
1011
+ top: t.bottom + ge,
1012
+ right: Math.max(Z, window.innerWidth - t.right)
1013
+ });
1014
+ }, k = () => {
1015
+ ne(), O(b.current?.closest("[data-theme]")?.getAttribute("data-theme") ?? void 0), w(!0);
1016
+ }, A = () => w(!1);
1017
+ a(() => {
1018
+ C && S.current?.focus({ preventScroll: !0 });
1019
+ }, [C]), a(() => {
1020
+ if (!C) return;
1021
+ let e = () => requestAnimationFrame(ne), t = (e) => {
1022
+ let t = e.target;
1023
+ !b.current?.contains(t) && !S.current?.contains(t) && A();
1024
+ };
1025
+ return window.addEventListener("scroll", e, !0), window.addEventListener("resize", e), document.addEventListener("mousedown", t, !0), () => {
1026
+ window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e), document.removeEventListener("mousedown", t, !0);
1027
+ };
1028
+ }, [C, v]);
1029
+ let j = (e) => {
1030
+ if (e.key === "Escape") {
1031
+ e.preventDefault(), e.stopPropagation(), A(), x.current?.focus({ preventScroll: !0 });
1032
+ return;
1033
+ }
1034
+ if (e.key !== "Tab") return;
1035
+ let t = Array.from(S.current?.querySelectorAll(ve) ?? []), n = t[0], r = t[t.length - 1];
1036
+ n && r && (e.shiftKey && (document.activeElement === n || document.activeElement === S.current) ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus()));
1037
+ };
1038
+ if (!E()) return /* @__PURE__ */ f(D, {});
1039
+ let M = e.name.trim().split(/\s+/)[0] ?? e.name, N = n.filter((e) => e.tone !== "danger"), P = n.filter((e) => e.tone === "danger"), re = (e) => {
1040
+ e.onClick?.(), A();
1041
+ }, F = /* @__PURE__ */ p("div", {
1042
+ ref: S,
1043
+ id: y,
1044
+ role: "dialog",
1045
+ "aria-label": "Account",
1046
+ tabIndex: -1,
1047
+ className: h(X.panel, v && X.panelSidebar),
1048
+ style: T ?? void 0,
1049
+ "data-theme": te,
1050
+ onKeyDown: j,
1051
+ children: [
1052
+ /* @__PURE__ */ p("div", {
1053
+ className: X.identity,
1054
+ children: [
1055
+ e.email ? /* @__PURE__ */ f("p", {
1056
+ className: X.email,
1057
+ children: e.email
1058
+ }) : null,
1059
+ /* @__PURE__ */ f("span", {
1060
+ className: X.avatarRing,
1061
+ children: /* @__PURE__ */ f("span", {
1062
+ className: X.avatarInner,
1063
+ children: /* @__PURE__ */ f(Y, {
1064
+ name: e.name,
1065
+ src: e.avatarUrl,
1066
+ size: "xl",
1067
+ tone: "primary",
1068
+ "aria-hidden": "true"
1069
+ })
1070
+ })
1071
+ }),
1072
+ /* @__PURE__ */ p("p", {
1073
+ className: X.greeting,
1074
+ children: [
1075
+ u,
1076
+ ", ",
1077
+ M,
1078
+ "!"
1079
+ ]
1080
+ }),
1081
+ e.role ? /* @__PURE__ */ f("span", {
1082
+ className: X.role,
1083
+ children: e.role
1084
+ }) : null,
1085
+ N.length > 0 ? /* @__PURE__ */ f("div", {
1086
+ className: X.pills,
1087
+ children: N.map((e) => {
1088
+ let t = /* @__PURE__ */ p(d, { children: [
1089
+ e.icon ? /* @__PURE__ */ f("span", {
1090
+ className: X.actionIcon,
1091
+ "aria-hidden": "true",
1092
+ children: e.icon
1093
+ }) : null,
1094
+ /* @__PURE__ */ f("span", { children: e.label }),
1095
+ e.external ? /* @__PURE__ */ f(xe, {}) : null
1096
+ ] });
1097
+ return e.href && !e.disabled ? e.external ? /* @__PURE__ */ f("a", {
1098
+ href: e.href,
1099
+ target: "_blank",
1100
+ rel: "noreferrer",
1101
+ title: e.title,
1102
+ className: X.pill,
1103
+ onClick: () => A(),
1104
+ children: t
1105
+ }, e.id) : /* @__PURE__ */ f("span", {
1106
+ className: X.contents,
1107
+ children: g({
1108
+ href: e.href,
1109
+ className: X.pill ?? "",
1110
+ title: e.title,
1111
+ onClick: () => A(),
1112
+ children: t
1113
+ })
1114
+ }, e.id) : /* @__PURE__ */ f("button", {
1115
+ type: "button",
1116
+ disabled: e.disabled,
1117
+ title: e.title,
1118
+ className: X.pill,
1119
+ onClick: () => re(e),
1120
+ children: t
1121
+ }, e.id);
1122
+ })
1123
+ }) : null
1124
+ ]
1125
+ }),
1126
+ e.details?.length ? /* @__PURE__ */ f("dl", {
1127
+ className: X.details,
1128
+ children: e.details.map((e) => /* @__PURE__ */ p("div", {
1129
+ className: X.detailRow,
1130
+ children: [/* @__PURE__ */ f("dt", { children: e.label }), /* @__PURE__ */ f("dd", { children: e.value })]
1131
+ }, e.label))
1132
+ }) : null,
1133
+ t.length > 0 ? /* @__PURE__ */ p("section", {
1134
+ className: X.apps,
1135
+ "aria-label": s,
1136
+ children: [/* @__PURE__ */ f("p", {
1137
+ className: X.appsTitle,
1138
+ children: s
1139
+ }), /* @__PURE__ */ f("div", {
1140
+ className: X.grid,
1141
+ children: t.map((e) => {
1142
+ let t = /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("span", {
1143
+ className: h(X.tile, be[e.tone ?? "primary"]),
1144
+ "aria-hidden": "true",
1145
+ children: e.icon
1146
+ }), /* @__PURE__ */ f("span", {
1147
+ className: X.appName,
1148
+ children: e.name
1149
+ })] });
1150
+ return e.current ? /* @__PURE__ */ f("span", {
1151
+ className: X.contents,
1152
+ children: g({
1153
+ href: e.url,
1154
+ className: X.app ?? "",
1155
+ title: e.description,
1156
+ onClick: () => A(),
1157
+ children: t
1158
+ })
1159
+ }, e.id) : /* @__PURE__ */ f("a", {
1160
+ href: e.url,
1161
+ target: "_blank",
1162
+ rel: "noreferrer",
1163
+ title: e.description,
1164
+ className: X.app,
1165
+ children: t
1166
+ }, e.id);
1167
+ })
1168
+ })]
1169
+ }) : null,
1170
+ P.length > 0 ? /* @__PURE__ */ f("div", {
1171
+ className: X.danger,
1172
+ children: P.map((e) => /* @__PURE__ */ p("button", {
1173
+ type: "button",
1174
+ disabled: e.disabled,
1175
+ title: e.title,
1176
+ className: X.dangerAction,
1177
+ onClick: () => re(e),
1178
+ children: [e.icon ? /* @__PURE__ */ f("span", {
1179
+ className: X.actionIcon,
1180
+ "aria-hidden": "true",
1181
+ children: e.icon
1182
+ }) : null, e.label]
1183
+ }, e.id))
1184
+ }) : null
1185
+ ]
1186
+ });
1187
+ return /* @__PURE__ */ p("div", {
1188
+ ref: b,
1189
+ className: h(X.root, v && X.rootSidebar, _),
1190
+ children: [/* @__PURE__ */ p("button", {
1191
+ ref: x,
1192
+ type: "button",
1193
+ "aria-label": `Account: ${e.name}`,
1194
+ "aria-haspopup": "dialog",
1195
+ "aria-expanded": C,
1196
+ "aria-controls": C ? y : void 0,
1197
+ className: h(v ? X.triggerSidebar : X.triggerHeader, v && i && X.collapsed, C && X.triggerOpen),
1198
+ onClick: () => C ? A() : k(),
1199
+ children: [/* @__PURE__ */ f(Y, {
1200
+ name: e.name,
1201
+ src: e.avatarUrl,
1202
+ size: "sm",
1203
+ tone: "primary",
1204
+ "aria-hidden": "true"
1205
+ }), v && !i ? /* @__PURE__ */ p("span", {
1206
+ className: X.identityText,
1207
+ children: [/* @__PURE__ */ f("span", {
1208
+ className: X.triggerName,
1209
+ children: e.name
1210
+ }), e.role ? /* @__PURE__ */ f("span", {
1211
+ className: X.triggerRole,
1212
+ children: e.role
1213
+ }) : null]
1214
+ }) : null]
1215
+ }), C && T ? m(F, document.body) : null]
1216
+ });
1217
+ }
1218
+ var Q = {
1219
+ root: "cui-Typography-module__root--PebSf",
1220
+ h1: "cui-Typography-module__h1--pJqnF",
1221
+ h2: "cui-Typography-module__h2--8YqGv",
1222
+ h3: "cui-Typography-module__h3--DT-DL",
1223
+ h4: "cui-Typography-module__h4--UsocF",
1224
+ body: "cui-Typography-module__body--s-YlR",
1225
+ bodySm: "cui-Typography-module__bodySm--RPpZ5",
1226
+ caption: "cui-Typography-module__caption--K-n4O",
1227
+ label: "cui-Typography-module__label---CGg4",
1228
+ "color-default": "cui-Typography-module__color-default--U4Xg0",
1229
+ "color-secondary": "cui-Typography-module__color-secondary--5wnuV",
1230
+ "color-muted": "cui-Typography-module__color-muted--GLLRl",
1231
+ "color-disabled": "cui-Typography-module__color-disabled--bBBVc",
1232
+ "color-primary": "cui-Typography-module__color-primary--B-bVH",
1233
+ "color-success": "cui-Typography-module__color-success--hXHcS",
1234
+ "color-warning": "cui-Typography-module__color-warning---oLwA",
1235
+ "color-danger": "cui-Typography-module__color-danger--sStkk",
1236
+ "color-info": "cui-Typography-module__color-info--4uSt5",
1237
+ "weight-normal": "cui-Typography-module__weight-normal--fFcMp",
1238
+ "weight-medium": "cui-Typography-module__weight-medium--5RtTe",
1239
+ "weight-semibold": "cui-Typography-module__weight-semibold--TDOgV",
1240
+ "weight-bold": "cui-Typography-module__weight-bold--YahG3",
1241
+ "align-start": "cui-Typography-module__align-start--mX51I",
1242
+ "align-center": "cui-Typography-module__align-center--2Ng2u",
1243
+ "align-end": "cui-Typography-module__align-end--6LwA3",
1244
+ truncate: "cui-Typography-module__truncate--3B0O4"
1245
+ }, Ce = {
1246
+ h1: "h1",
1247
+ h2: "h2",
1248
+ h3: "h3",
1249
+ h4: "h4",
1250
+ body: "p",
1251
+ "body-sm": "p",
1252
+ caption: "span",
1253
+ label: "span"
1254
+ }, we = {
1255
+ h1: Q.h1,
1256
+ h2: Q.h2,
1257
+ h3: Q.h3,
1258
+ h4: Q.h4,
1259
+ body: Q.body,
1260
+ "body-sm": Q.bodySm,
1261
+ caption: Q.caption,
1262
+ label: Q.label
1263
+ };
1264
+ function Te({ variant: e = "body", as: n, color: r = "default", weight: i, align: a, truncate: o = !1, className: s, ...c }) {
1265
+ return E() ? t(n ?? Ce[e], {
1266
+ ...c,
1267
+ className: h(Q.root, we[e], Q[`color-${r}`], i && Q[`weight-${i}`], a && Q[`align-${a}`], o && Q.truncate, s)
1268
+ }) : /* @__PURE__ */ f(D, {});
1269
+ }
1270
+ //#endregion
1271
+ //#region src/theme/themeStore.ts
1272
+ var Ee = "(prefers-color-scheme: dark)";
1273
+ function De() {
1274
+ return u((e) => {
1275
+ if (typeof window > "u" || typeof window.matchMedia != "function") return () => {};
1276
+ let t = window.matchMedia(Ee);
1277
+ return t.addEventListener("change", e), () => t.removeEventListener("change", e);
1278
+ }, () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(Ee).matches, () => !1);
1279
+ }
1280
+ var $ = /* @__PURE__ */ new Set();
1281
+ function Oe(e) {
1282
+ try {
1283
+ return window.localStorage.getItem(e);
1284
+ } catch {
1285
+ return null;
1286
+ }
1287
+ }
1288
+ function ke(e, t) {
1289
+ try {
1290
+ window.localStorage.setItem(e, t);
1291
+ } catch {}
1292
+ $.forEach((e) => e());
1293
+ }
1294
+ function Ae(e) {
1295
+ return u((e) => ($.add(e), window.addEventListener("storage", e), () => {
1296
+ $.delete(e), window.removeEventListener("storage", e);
1297
+ }), () => e ? Oe(e) : null, () => null);
1298
+ }
1299
+ var je = { root: "cui-ThemeProvider-module__root--2DEGi" }, Me = e(null);
1300
+ function Ne({ children: e, theme: t, defaultTheme: n = "light", onThemeChange: a, storageKey: o, licenseKey: c, className: u, ...d }) {
1301
+ let [p, m] = l(n), g = Ae(t === void 0 ? o : void 0), _ = De(), v = t ?? g ?? p, y = v === "system" ? _ ? "dark" : "light" : v, b = r((e) => {
1302
+ t === void 0 && (m(e), o && ke(o, e)), a?.(e);
1303
+ }, [
1304
+ t,
1305
+ a,
1306
+ o
1307
+ ]), x = s(() => ({
1308
+ theme: v,
1309
+ resolvedTheme: y,
1310
+ setTheme: b
1311
+ }), [
1312
+ v,
1313
+ y,
1314
+ b
1315
+ ]), C = i(S);
1316
+ return /* @__PURE__ */ f(Me.Provider, {
1317
+ value: x,
1318
+ children: /* @__PURE__ */ f(S.Provider, {
1319
+ value: c ?? C,
1320
+ children: /* @__PURE__ */ f("div", {
1321
+ ...d,
1322
+ "data-theme": y,
1323
+ className: h(je.root, u),
1324
+ children: e
1325
+ })
1326
+ })
1327
+ });
1328
+ }
1329
+ function Pe() {
1330
+ let e = i(Me);
1331
+ if (!e) throw Error("useTheme must be used within a <ThemeProvider>.");
1332
+ return e;
1333
+ }
1334
+ var Fe = {
1335
+ root: "cui-ThemeToggle-module__root--k2-Go",
1336
+ option: "cui-ThemeToggle-module__option--CngnC",
1337
+ input: "cui-ThemeToggle-module__input--0nC-Q",
1338
+ face: "cui-ThemeToggle-module__face--jX0TD",
1339
+ icon: "cui-ThemeToggle-module__icon--N0Uj1"
1340
+ }, Ie = {
1341
+ light: /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("circle", {
1342
+ cx: "12",
1343
+ cy: "12",
1344
+ r: "4"
1345
+ }), /* @__PURE__ */ f("path", { d: "M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M5.6 18.4L7 17M17 7l1.4-1.4" })] }),
1346
+ dark: /* @__PURE__ */ f("path", { d: "M20 14.5A8 8 0 019.5 4a8 8 0 1010.5 10.5z" }),
1347
+ system: /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f("rect", {
1348
+ x: "3",
1349
+ y: "4",
1350
+ width: "18",
1351
+ height: "12",
1352
+ rx: "2"
1353
+ }), /* @__PURE__ */ f("path", { d: "M8 20h8M12 16v4" })] })
1354
+ }, Le = {
1355
+ light: "Light",
1356
+ dark: "Dark",
1357
+ system: "System"
1358
+ };
1359
+ function Re({ modes: e = [
1360
+ "light",
1361
+ "dark",
1362
+ "system"
1363
+ ], compact: t = !1, className: n, "aria-label": r = "Theme", ...i }) {
1364
+ let { theme: a, setTheme: s } = Pe(), c = o();
1365
+ return E() ? /* @__PURE__ */ f("div", {
1366
+ ...i,
1367
+ role: "radiogroup",
1368
+ "aria-label": r,
1369
+ className: h(Fe.root, n),
1370
+ children: e.map((e) => {
1371
+ let n = Le[e] ?? e;
1372
+ return /* @__PURE__ */ p("label", {
1373
+ className: Fe.option,
1374
+ title: t ? n : void 0,
1375
+ children: [/* @__PURE__ */ f("input", {
1376
+ type: "radio",
1377
+ name: c,
1378
+ value: e,
1379
+ checked: a === e,
1380
+ onChange: () => s(e),
1381
+ className: Fe.input,
1382
+ "aria-label": t ? n : void 0
1383
+ }), /* @__PURE__ */ p("span", {
1384
+ className: Fe.face,
1385
+ children: [Ie[e] ? /* @__PURE__ */ f("svg", {
1386
+ className: Fe.icon,
1387
+ viewBox: "0 0 24 24",
1388
+ fill: "none",
1389
+ stroke: "currentColor",
1390
+ strokeWidth: "1.8",
1391
+ strokeLinecap: "round",
1392
+ strokeLinejoin: "round",
1393
+ "aria-hidden": "true",
1394
+ focusable: "false",
1395
+ children: Ie[e]
1396
+ }) : null, t ? null : n]
1397
+ })]
1398
+ }, e);
1399
+ })
1400
+ }) : /* @__PURE__ */ f(D, {});
1401
+ }
1402
+ //#endregion
1403
+ export { Se as AccountPanel, Y as Avatar, fe as Badge, ne as Button, ue as Checkbox, M as FormField, me as FormSection, re as Input, ce as Select, pe as Skeleton, de as Switch, W as Tabs, le as Textarea, Ne as ThemeProvider, Re as ThemeToggle, Te as Typography, h as cn, he as getInitials, C as setLicenseKey, A as useFormFieldControl, Pe as useTheme };
1404
+
1405
+ //# sourceMappingURL=index.js.map