@aggc/ui 0.7.1 → 0.9.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 (48) hide show
  1. package/dist/chunks/DataTable-CIiU5Jx3.js +8688 -0
  2. package/dist/components/DataTable.styles.d.ts +48 -0
  3. package/dist/components/DataTable.types.d.ts +38 -0
  4. package/dist/components/DataTable.vue.d.ts +72 -0
  5. package/dist/components/UiAvatar.styles.d.ts +53 -0
  6. package/dist/components/UiAvatar.vue.d.ts +13 -0
  7. package/dist/components/UiModal.styles.d.ts +31 -0
  8. package/dist/components/UiModal.vue.d.ts +30 -0
  9. package/dist/components/UiToast.styles.d.ts +41 -0
  10. package/dist/components/UiToast.vue.d.ts +13 -0
  11. package/dist/components/UiToastProvider.vue.d.ts +13 -0
  12. package/dist/components/UiTooltip.styles.d.ts +1 -0
  13. package/dist/components/UiTooltip.vue.d.ts +25 -0
  14. package/dist/components/index.d.ts +11 -0
  15. package/dist/components.js +30 -12
  16. package/dist/composables/useToast.d.ts +27 -0
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +82 -63
  19. package/dist/ui.css +995 -294
  20. package/package.json +3 -2
  21. package/src/components/DataTable.styles.ts +493 -0
  22. package/src/components/DataTable.test.ts +249 -0
  23. package/src/components/DataTable.types.ts +42 -0
  24. package/src/components/DataTable.vue +567 -0
  25. package/src/components/UiAvatar.styles.ts +81 -0
  26. package/src/components/UiAvatar.test.ts +43 -0
  27. package/src/components/UiAvatar.vue +41 -0
  28. package/src/components/UiModal.styles.ts +143 -0
  29. package/src/components/UiModal.test.ts +64 -0
  30. package/src/components/UiModal.vue +82 -0
  31. package/src/components/UiToast.styles.ts +143 -0
  32. package/src/components/UiToast.test.ts +47 -0
  33. package/src/components/UiToast.vue +65 -0
  34. package/src/components/UiToastProvider.vue +22 -0
  35. package/src/components/UiTooltip.styles.ts +25 -0
  36. package/src/components/UiTooltip.test.ts +37 -0
  37. package/src/components/UiTooltip.vue +37 -0
  38. package/src/components/index.ts +17 -0
  39. package/src/composables/useToast.ts +43 -0
  40. package/src/css/base.css +61 -1
  41. package/src/index.ts +1 -0
  42. package/src/stories/feedback/UiToast.stories.ts +72 -0
  43. package/src/stories/layout/DataTable.stories.ts +141 -0
  44. package/src/stories/layout/UiModal.stories.ts +89 -0
  45. package/src/stories/primitives/UiAvatar.stories.ts +83 -0
  46. package/src/stories/primitives/UiTooltip.stories.ts +46 -0
  47. package/src/stories/support/sources.ts +81 -0
  48. package/dist/chunks/UiSkeleton.vue_vue_type_script_setup_true_lang-DUse1KRc.js +0 -1201
@@ -1,1201 +0,0 @@
1
- import { defineComponent as m, openBlock as l, createElementBlock as o, normalizeClass as t, unref as a, renderSlot as y, createElementVNode as d, createBlock as ee, resolveDynamicComponent as ae, toDisplayString as c, createVNode as R, withCtx as te, createTextVNode as O, Fragment as $, renderList as V, createCommentVNode as b, withKeys as U, withModifiers as K, ref as B, useId as se, computed as L, watch as N, onMounted as le, onBeforeUnmount as oe, nextTick as T, normalizeStyle as ie } from "vue";
2
- import { j as re, o as f, q as H, n as Y, r, g as ne, f as de, a as X, l as ce, p as ue, b as be, h as fe, i as ge, d as me } from "./pageHeader-YZ3BV9dQ.js";
3
- import { CheckCircle2 as pe, TriangleAlert as ve, LoaderCircle as he, Check as q, ChevronDown as ye } from "lucide-vue-next";
4
- const Ce = re, Oa = /* @__PURE__ */ m({
5
- __name: "PageSurface",
6
- setup(e) {
7
- return (s, i) => (l(), o("div", {
8
- class: t(a(Ce))
9
- }, [
10
- y(s.$slots, "default")
11
- ], 2));
12
- }
13
- }), xe = f({
14
- base: {
15
- display: "inline-flex",
16
- alignItems: "center",
17
- justifyContent: "center",
18
- borderRadius: "full",
19
- borderWidth: "1px",
20
- px: "2.5",
21
- py: "1",
22
- fontSize: "xs",
23
- fontWeight: "700",
24
- textTransform: "uppercase",
25
- letterSpacing: "0.06em",
26
- lineHeight: "1",
27
- whiteSpace: "nowrap"
28
- },
29
- variants: {
30
- tone: {
31
- success: {
32
- bg: "badge.successBg",
33
- color: "badge.successText",
34
- borderColor: "badge.successBorder"
35
- },
36
- warning: {
37
- bg: "badge.warningBg",
38
- color: "badge.warningText",
39
- borderColor: "badge.warningBorder"
40
- },
41
- info: {
42
- bg: "badge.infoBg",
43
- color: "badge.infoText",
44
- borderColor: "badge.infoBorder"
45
- },
46
- neutral: {
47
- bg: "badge.neutralBg",
48
- color: "badge.neutralText",
49
- borderColor: "badge.neutralBorder"
50
- },
51
- danger: {
52
- bg: "badge.dangerBg",
53
- color: "badge.dangerText",
54
- borderColor: "badge.dangerBorder"
55
- }
56
- }
57
- },
58
- defaultVariants: {
59
- tone: "neutral"
60
- }
61
- }), ke = /* @__PURE__ */ m({
62
- __name: "StatusBadge",
63
- props: {
64
- tone: { default: "neutral" }
65
- },
66
- setup(e) {
67
- const s = e;
68
- return (i, g) => (l(), o("span", {
69
- class: t(a(xe)({ tone: s.tone }))
70
- }, [
71
- y(i.$slots, "default")
72
- ], 2));
73
- }
74
- }), we = f({
75
- base: {
76
- borderWidth: "1px",
77
- padding: "5",
78
- _dark: {
79
- borderColor: "border.default"
80
- }
81
- },
82
- variants: {
83
- ok: {
84
- true: {
85
- borderColor: "result.okBorder",
86
- bg: "result.okBg"
87
- },
88
- false: {
89
- borderColor: "result.failBorder",
90
- bg: "result.failBg"
91
- }
92
- }
93
- }
94
- }), Se = (e) => H(Y, we({ ok: e })), ze = r({
95
- display: "flex",
96
- justifyContent: "space-between",
97
- gap: "4",
98
- alignItems: { base: "flex-start", md: "center" },
99
- flexDirection: { base: "column", md: "row" },
100
- mb: "3"
101
- }), Be = r({
102
- display: "flex",
103
- alignItems: "center",
104
- gap: "3"
105
- }), $e = f({
106
- base: {
107
- width: "9",
108
- height: "9",
109
- borderRadius: "full",
110
- display: "flex",
111
- alignItems: "center",
112
- justifyContent: "center",
113
- flexShrink: "0"
114
- },
115
- variants: {
116
- ok: {
117
- true: {
118
- bg: "bg.accentSoft",
119
- color: "text.accent"
120
- },
121
- false: {
122
- bg: "badge.warningBg",
123
- color: "badge.warningText"
124
- }
125
- }
126
- }
127
- }), Ve = r({
128
- fontSize: "lg",
129
- fontWeight: "700",
130
- color: "text.primary",
131
- lineHeight: "1.3"
132
- }), G = f({
133
- base: {},
134
- variants: {
135
- spaced: {
136
- true: { mb: "3" },
137
- false: { mb: "0" }
138
- }
139
- }
140
- }), D = f({
141
- base: {
142
- fontSize: "sm",
143
- fontWeight: "700",
144
- mb: "2"
145
- },
146
- variants: {
147
- tone: {
148
- detail: { color: "result.detailText" },
149
- warning: { color: "result.warningLabel" },
150
- error: { color: "result.errorLabel" }
151
- }
152
- }
153
- }), P = f({
154
- base: {
155
- display: "grid",
156
- gap: "1.5",
157
- pl: "4"
158
- },
159
- variants: {
160
- tone: {
161
- detail: { color: "result.bodyText" },
162
- warning: { color: "result.warningBody" },
163
- error: { color: "result.errorBody" }
164
- }
165
- }
166
- }), Le = ["aria-live", "role"], Re = { key: 2 }, Ea = /* @__PURE__ */ m({
167
- __name: "ResultPanel",
168
- props: {
169
- ok: { type: Boolean },
170
- summary: {},
171
- warnings: {},
172
- errors: {},
173
- messages: {},
174
- live: {},
175
- passLabel: {},
176
- failLabel: {},
177
- detailsLabel: {},
178
- warningsLabel: {},
179
- errorsLabel: {}
180
- },
181
- setup(e) {
182
- const s = e;
183
- return (i, g) => (l(), o("div", {
184
- class: t(a(Se)(e.ok)),
185
- "aria-live": s.live ?? "polite",
186
- role: (s.live ?? "polite") === "off" ? void 0 : "status"
187
- }, [
188
- d("div", {
189
- class: t(a(ze))
190
- }, [
191
- d("div", {
192
- class: t(a(Be))
193
- }, [
194
- d("div", {
195
- class: t(a($e)({ ok: e.ok }))
196
- }, [
197
- (l(), ee(ae(e.ok ? a(pe) : a(ve)), { size: 18 }))
198
- ], 2),
199
- d("h3", {
200
- class: t(a(Ve))
201
- }, c(s.summary), 3)
202
- ], 2),
203
- R(ke, {
204
- tone: e.ok ? "success" : "warning"
205
- }, {
206
- default: te(() => [
207
- O(c(e.ok ? s.passLabel ?? "Pass" : s.failLabel ?? "Fail"), 1)
208
- ]),
209
- _: 1
210
- }, 8, ["tone"])
211
- ], 2),
212
- e.messages?.length ? (l(), o("div", {
213
- key: 0,
214
- class: t(a(G)({ spaced: !0 }))
215
- }, [
216
- d("p", {
217
- class: t(a(D)({ tone: "detail" }))
218
- }, c(s.detailsLabel ?? "Details"), 3),
219
- d("ul", {
220
- class: t(a(P)({ tone: "detail" }))
221
- }, [
222
- (l(!0), o($, null, V(e.messages, (u) => (l(), o("li", { key: u }, c(u), 1))), 128))
223
- ], 2)
224
- ], 2)) : b("", !0),
225
- e.warnings?.length ? (l(), o("div", {
226
- key: 1,
227
- class: t(a(G)({ spaced: !!e.errors?.length }))
228
- }, [
229
- d("p", {
230
- class: t(a(D)({ tone: "warning" }))
231
- }, c(s.warningsLabel ?? "Warnings"), 3),
232
- d("ul", {
233
- class: t(a(P)({ tone: "warning" }))
234
- }, [
235
- (l(!0), o($, null, V(e.warnings, (u) => (l(), o("li", { key: u }, c(u), 1))), 128))
236
- ], 2)
237
- ], 2)) : b("", !0),
238
- e.errors?.length ? (l(), o("div", Re, [
239
- d("p", {
240
- class: t(a(D)({ tone: "error" }))
241
- }, c(s.errorsLabel ?? "Errors"), 3),
242
- d("ul", {
243
- class: t(a(P)({ tone: "error" }))
244
- }, [
245
- (l(!0), o($, null, V(e.errors, (u) => (l(), o("li", { key: u }, c(u), 1))), 128))
246
- ], 2)
247
- ])) : b("", !0)
248
- ], 10, Le));
249
- }
250
- }), Ie = r({
251
- padding: "6"
252
- }), We = r({
253
- height: "100%",
254
- minHeight: "0",
255
- display: "grid",
256
- gridTemplateRows: "auto minmax(0, 1fr)"
257
- }), He = Y, Te = ne, De = r({
258
- position: "relative",
259
- zIndex: "1",
260
- mb: "4"
261
- }), Pe = r({
262
- position: "relative",
263
- zIndex: "1",
264
- mb: "0"
265
- }), Oe = de, Ee = X, je = ce, Ae = r({
266
- color: "text.secondary",
267
- lineHeight: "1.65",
268
- fontSize: "sm",
269
- maxWidth: "2xl"
270
- }), Fe = ue, Me = r({
271
- position: "relative",
272
- zIndex: "1",
273
- minHeight: "0",
274
- overflowY: "auto",
275
- paddingRight: "1",
276
- overscrollBehavior: "contain"
277
- }), Ue = r({
278
- position: "relative",
279
- zIndex: "1"
280
- }), ja = /* @__PURE__ */ m({
281
- __name: "SectionCard",
282
- props: {
283
- title: {},
284
- eyebrow: { default: void 0 },
285
- description: { default: "" },
286
- scrollBody: { type: Boolean, default: !1 },
287
- collapseBodyGap: { type: Boolean, default: !1 }
288
- },
289
- setup(e) {
290
- const s = e;
291
- return (i, g) => (l(), o("section", {
292
- class: t(a(H)(a(He), a(Ie), s.scrollBody && a(We)))
293
- }, [
294
- d("div", {
295
- class: t(a(H)(a(Te), s.collapseBodyGap ? a(Pe) : a(De)))
296
- }, [
297
- d("div", {
298
- class: t(a(Oe))
299
- }, [
300
- s.eyebrow ? (l(), o("p", {
301
- key: 0,
302
- class: t(a(Ee))
303
- }, c(s.eyebrow), 3)) : b("", !0),
304
- d("h2", {
305
- class: t(a(je))
306
- }, c(s.title), 3),
307
- s.description ? (l(), o("p", {
308
- key: 1,
309
- class: t(a(Ae))
310
- }, c(s.description), 3)) : b("", !0)
311
- ], 2),
312
- i.$slots.actions ? (l(), o("div", {
313
- key: 0,
314
- class: t(a(Fe))
315
- }, [
316
- y(i.$slots, "actions")
317
- ], 2)) : b("", !0)
318
- ], 2),
319
- d("div", {
320
- class: t(s.scrollBody ? a(Me) : a(Ue))
321
- }, [
322
- y(i.$slots, "default")
323
- ], 2)
324
- ], 2));
325
- }
326
- }), Ke = be, Ne = r({
327
- display: "inline-flex",
328
- alignItems: "center",
329
- justifyContent: "center",
330
- gap: "2",
331
- minWidth: "0"
332
- }), Ge = r({
333
- visibility: "hidden"
334
- }), Ye = r({
335
- position: "absolute",
336
- inset: "0",
337
- display: "inline-flex",
338
- alignItems: "center",
339
- justifyContent: "center",
340
- gap: "2",
341
- px: "4",
342
- py: "3",
343
- pointerEvents: "none"
344
- }), Xe = ["type", "disabled", "aria-busy", "aria-label"], Aa = /* @__PURE__ */ m({
345
- __name: "UiButton",
346
- props: {
347
- variant: { default: "solid" },
348
- size: { default: "md" },
349
- tone: { default: "default" },
350
- loading: { type: Boolean, default: !1 },
351
- loadingLabel: { default: "Working..." },
352
- disabled: { type: Boolean, default: !1 },
353
- type: { default: "button" },
354
- ariaLabel: { default: void 0 }
355
- },
356
- setup(e) {
357
- return (s, i) => (l(), o("button", {
358
- type: e.type,
359
- disabled: e.disabled || e.loading,
360
- "aria-busy": e.loading || void 0,
361
- "aria-label": e.ariaLabel,
362
- class: t(a(Ke)({ variant: e.variant, size: e.size, tone: e.tone, disabled: e.disabled, loading: e.loading }))
363
- }, [
364
- d("span", {
365
- class: t([a(Ne), e.loading ? a(Ge) : void 0])
366
- }, [
367
- y(s.$slots, "default")
368
- ], 2),
369
- e.loading ? (l(), o("span", {
370
- key: 0,
371
- class: t(a(Ye))
372
- }, [
373
- R(a(he), {
374
- size: 14,
375
- class: "aggc-spin",
376
- "aria-hidden": "true"
377
- }),
378
- d("span", null, c(e.loadingLabel), 1)
379
- ], 2)) : b("", !0)
380
- ], 10, Xe));
381
- }
382
- }), qe = f({
383
- base: {
384
- width: "100%",
385
- display: "flex",
386
- alignItems: "flex-start",
387
- gap: "3",
388
- textAlign: "left",
389
- borderRadius: "xl",
390
- borderWidth: "1px",
391
- px: "4",
392
- py: "3.5",
393
- color: "text.primary",
394
- transition: "border-color 160ms cubic-bezier(0.25, 0.1, 0.25, 1), background-color 160ms cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 160ms cubic-bezier(0.25, 0.1, 0.25, 1)"
395
- },
396
- variants: {
397
- checked: {
398
- true: {
399
- borderColor: "border.accent",
400
- bg: "bg.selected"
401
- },
402
- false: {
403
- borderColor: "border.default",
404
- bg: "bg.input"
405
- }
406
- },
407
- disabled: {
408
- true: {
409
- cursor: "not-allowed",
410
- opacity: 0.45
411
- },
412
- false: {
413
- cursor: "pointer"
414
- }
415
- }
416
- },
417
- compoundVariants: [
418
- {
419
- checked: !0,
420
- disabled: !1,
421
- css: {
422
- _hover: {
423
- borderColor: "border.accent"
424
- }
425
- }
426
- },
427
- {
428
- checked: !1,
429
- disabled: !1,
430
- css: {
431
- _hover: {
432
- borderColor: "border.strong"
433
- }
434
- }
435
- }
436
- ],
437
- defaultVariants: {
438
- checked: !1,
439
- disabled: !1
440
- }
441
- }), Je = f({
442
- base: {
443
- mt: "0.5",
444
- flexShrink: "0",
445
- width: "22px",
446
- height: "22px",
447
- borderRadius: "md",
448
- borderWidth: "1.5px",
449
- display: "flex",
450
- alignItems: "center",
451
- justifyContent: "center",
452
- transition: "border-color 160ms cubic-bezier(0.25, 0.1, 0.25, 1), background-color 160ms cubic-bezier(0.25, 0.1, 0.25, 1), color 160ms cubic-bezier(0.25, 0.1, 0.25, 1), transform 160ms cubic-bezier(0.25, 0.1, 0.25, 1)"
453
- },
454
- variants: {
455
- checked: {
456
- true: {
457
- borderColor: "border.accent",
458
- bg: "bg.accentStrong",
459
- color: "text.inverse",
460
- transform: "scale(1)"
461
- },
462
- false: {
463
- borderColor: "border.default",
464
- bg: "bg.buttonOutline",
465
- color: "transparent",
466
- transform: "scale(1)"
467
- }
468
- }
469
- },
470
- defaultVariants: {
471
- checked: !1
472
- }
473
- }), Qe = r({
474
- display: "grid",
475
- gap: "1",
476
- minWidth: "0"
477
- }), Ze = r({
478
- fontSize: "sm",
479
- fontWeight: "700",
480
- lineHeight: "1.45"
481
- }), _e = r({
482
- color: "text.secondary",
483
- fontSize: "sm",
484
- lineHeight: "1.55"
485
- }), ea = ["id", "name", "aria-checked", "aria-describedby", "aria-invalid", "disabled", "onKeydown"], Fa = /* @__PURE__ */ m({
486
- __name: "UiCheckbox",
487
- props: {
488
- modelValue: { type: Boolean },
489
- id: { default: void 0 },
490
- name: { default: void 0 },
491
- label: { default: void 0 },
492
- description: { default: void 0 },
493
- disabled: { type: Boolean, default: !1 },
494
- invalid: { type: Boolean, default: !1 },
495
- ariaDescribedby: { default: void 0 }
496
- },
497
- emits: ["update:modelValue"],
498
- setup(e, { emit: s }) {
499
- const i = e, g = s;
500
- function u() {
501
- i.disabled || g("update:modelValue", !i.modelValue);
502
- }
503
- return (p, I) => (l(), o("button", {
504
- type: "button",
505
- id: e.id,
506
- name: e.name,
507
- role: "checkbox",
508
- "aria-checked": e.modelValue,
509
- "aria-describedby": e.ariaDescribedby,
510
- "aria-invalid": e.invalid || void 0,
511
- disabled: e.disabled,
512
- class: t(a(qe)({ checked: e.modelValue, disabled: e.disabled })),
513
- onClick: u,
514
- onKeydown: [
515
- U(K(u, ["prevent"]), ["enter"]),
516
- U(K(u, ["prevent"]), ["space"])
517
- ]
518
- }, [
519
- d("span", {
520
- class: t(a(Je)({ checked: e.modelValue })),
521
- "aria-hidden": "true"
522
- }, [
523
- R(a(q), { size: 14 })
524
- ], 2),
525
- d("span", {
526
- class: t(a(Qe))
527
- }, [
528
- e.label || p.$slots.default ? (l(), o("span", {
529
- key: 0,
530
- class: t(a(Ze))
531
- }, [
532
- y(p.$slots, "default", {}, () => [
533
- O(c(e.label), 1)
534
- ])
535
- ], 2)) : b("", !0),
536
- e.description || p.$slots.description ? (l(), o("span", {
537
- key: 1,
538
- class: t(a(_e))
539
- }, [
540
- y(p.$slots, "description", {}, () => [
541
- O(c(e.description), 1)
542
- ])
543
- ], 2)) : b("", !0)
544
- ], 2)
545
- ], 42, ea));
546
- }
547
- }), aa = r({
548
- display: "grid",
549
- gap: "2",
550
- minWidth: "0"
551
- }), ta = r({
552
- display: "flex",
553
- alignItems: "flex-start",
554
- justifyContent: "space-between",
555
- gap: "3"
556
- }), sa = r({
557
- display: "grid",
558
- gap: "0.5",
559
- minWidth: "0"
560
- }), la = X, oa = r({
561
- fontSize: "sm",
562
- fontWeight: "600",
563
- color: "text.primary"
564
- }), ia = fe, ra = r({
565
- flexShrink: "0"
566
- }), na = ["for"], da = ["id"], Ma = /* @__PURE__ */ m({
567
- __name: "UiField",
568
- props: {
569
- id: {},
570
- forId: {},
571
- label: {},
572
- hint: {},
573
- eyebrow: {}
574
- },
575
- setup(e) {
576
- return (s, i) => (l(), o("div", {
577
- class: t(a(aa))
578
- }, [
579
- e.eyebrow || e.label || e.hint || s.$slots.meta ? (l(), o("div", {
580
- key: 0,
581
- class: t(a(ta))
582
- }, [
583
- d("div", {
584
- class: t(a(sa))
585
- }, [
586
- e.eyebrow ? (l(), o("p", {
587
- key: 0,
588
- class: t(a(la))
589
- }, c(e.eyebrow), 3)) : b("", !0),
590
- e.label ? (l(), o("label", {
591
- key: 1,
592
- for: e.forId,
593
- class: t(a(oa))
594
- }, c(e.label), 11, na)) : b("", !0),
595
- e.hint ? (l(), o("p", {
596
- key: 2,
597
- id: e.id,
598
- class: t(a(ia))
599
- }, c(e.hint), 11, da)) : b("", !0)
600
- ], 2),
601
- s.$slots.meta ? (l(), o("div", {
602
- key: 0,
603
- class: t(a(ra))
604
- }, [
605
- y(s.$slots, "meta")
606
- ], 2)) : b("", !0)
607
- ], 2)) : b("", !0),
608
- y(s.$slots, "default")
609
- ], 2));
610
- }
611
- }), ca = H(
612
- ge,
613
- r({
614
- paddingX: "4",
615
- paddingY: "3",
616
- display: "flex",
617
- alignItems: "center",
618
- gap: "3",
619
- color: "text.secondary",
620
- fontSize: "sm",
621
- lineHeight: "1.5"
622
- })
623
- ), ua = r({
624
- width: "2.5",
625
- height: "2.5",
626
- borderRadius: "full",
627
- flexShrink: "0",
628
- bg: "text.accent",
629
- boxShadow: "0 0 0 0 var(--colors-bg-accentSoft, rgba(49, 94, 255, 0.3))",
630
- animation: "loadingPulse 1.4s cubic-bezier(0.25, 0.1, 0.25, 1) infinite"
631
- }), ba = r({
632
- display: "grid",
633
- gap: "0.5"
634
- }), fa = r({
635
- fontWeight: "700",
636
- color: "text.primary"
637
- }), ga = ["aria-live", "role"], Ua = /* @__PURE__ */ m({
638
- __name: "UiLoadingState",
639
- props: {
640
- title: {},
641
- description: {},
642
- live: { default: "polite" }
643
- },
644
- setup(e) {
645
- return (s, i) => (l(), o("div", {
646
- class: t(a(ca)),
647
- "data-testid": "loading-state",
648
- "aria-live": e.live,
649
- role: e.live === "off" ? void 0 : "status"
650
- }, [
651
- d("span", {
652
- class: t(a(ua)),
653
- "aria-hidden": "true",
654
- "data-ui-loading-pulse": ""
655
- }, null, 2),
656
- d("div", {
657
- class: t(a(ba))
658
- }, [
659
- d("p", {
660
- class: t(a(fa))
661
- }, c(e.title), 3),
662
- d("p", null, c(e.description), 1)
663
- ], 2)
664
- ], 10, ga));
665
- }
666
- }), ma = r({
667
- display: "inline-flex",
668
- width: "fit-content",
669
- borderRadius: "full",
670
- borderWidth: "1px",
671
- borderColor: "border.default",
672
- bg: "bg.input",
673
- padding: "1",
674
- gap: "1",
675
- _dark: {
676
- borderColor: "border.strong"
677
- }
678
- }), pa = f({
679
- base: {
680
- borderRadius: "full",
681
- px: "3.5",
682
- py: "2",
683
- fontSize: "sm",
684
- fontWeight: "600",
685
- cursor: "pointer",
686
- borderWidth: "1px",
687
- transition: "background-color 160ms cubic-bezier(0.25, 0.1, 0.25, 1), border-color 160ms cubic-bezier(0.25, 0.1, 0.25, 1), color 160ms cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 160ms cubic-bezier(0.25, 0.1, 0.25, 1)",
688
- _focusVisible: {
689
- outline: "2px solid",
690
- outlineColor: "text.accent",
691
- outlineOffset: "2px"
692
- }
693
- },
694
- variants: {
695
- active: {
696
- true: {
697
- borderColor: "border.accent",
698
- bg: "bg.accentStrong",
699
- color: "text.inverse",
700
- _hover: {
701
- bg: "bg.accentStrong"
702
- },
703
- _dark: {
704
- bg: "rgba(138, 180, 255, 0.2)",
705
- color: "text.accent",
706
- borderColor: "border.accent"
707
- }
708
- },
709
- false: {
710
- borderColor: "transparent",
711
- bg: "transparent",
712
- color: "text.secondary",
713
- boxShadow: "none",
714
- _hover: {
715
- bg: "bg.hover"
716
- }
717
- }
718
- }
719
- }
720
- }), va = ["onClick"], Ka = /* @__PURE__ */ m({
721
- __name: "UiSegmentedControl",
722
- props: {
723
- modelValue: {},
724
- options: {}
725
- },
726
- emits: ["update:modelValue"],
727
- setup(e) {
728
- return (s, i) => (l(), o("div", {
729
- class: t(a(ma))
730
- }, [
731
- (l(!0), o($, null, V(e.options, (g) => (l(), o("button", {
732
- key: g.value,
733
- type: "button",
734
- class: t(a(pa)({ active: g.value === e.modelValue })),
735
- onClick: (u) => s.$emit("update:modelValue", g.value)
736
- }, c(g.label), 11, va))), 128))
737
- ], 2));
738
- }
739
- }), ha = f({
740
- base: {
741
- position: "relative"
742
- },
743
- variants: {
744
- open: {
745
- true: { zIndex: "30" },
746
- false: { zIndex: "1" }
747
- }
748
- },
749
- defaultVariants: {
750
- open: !1
751
- }
752
- }), ya = f({
753
- base: {
754
- width: "100%",
755
- display: "flex",
756
- alignItems: "center",
757
- justifyContent: "space-between",
758
- gap: "3",
759
- borderWidth: "1px",
760
- fontSize: "sm",
761
- overflow: "hidden",
762
- transition: "border-color 160ms cubic-bezier(0.25, 0.1, 0.25, 1), background-color 160ms cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 160ms cubic-bezier(0.25, 0.1, 0.25, 1)"
763
- },
764
- variants: {
765
- size: {
766
- sm: {
767
- minHeight: "40px",
768
- borderRadius: "lg",
769
- px: "3",
770
- py: "2.5"
771
- },
772
- md: {
773
- minHeight: "48px",
774
- borderRadius: "xl",
775
- px: "4",
776
- py: "3"
777
- }
778
- },
779
- open: {
780
- true: {
781
- borderColor: "border.accent",
782
- bg: "bg.cardStrong",
783
- _dark: {
784
- borderColor: "border.accent",
785
- bg: "bg.input"
786
- }
787
- },
788
- false: {
789
- borderColor: "border.default",
790
- bg: "bg.input"
791
- }
792
- },
793
- selected: {
794
- true: { color: "text.primary" },
795
- false: { color: "text.muted" }
796
- },
797
- disabled: {
798
- true: {
799
- cursor: "not-allowed",
800
- opacity: 0.45
801
- },
802
- false: {
803
- cursor: "pointer",
804
- _focusVisible: {
805
- outline: "2px solid",
806
- outlineColor: "text.accent",
807
- outlineOffset: "2px"
808
- }
809
- }
810
- }
811
- },
812
- compoundVariants: [
813
- {
814
- disabled: !1,
815
- css: {
816
- _hover: {
817
- borderColor: "border.strong",
818
- bg: "bg.cardStrong",
819
- _dark: {
820
- bg: "bg.input"
821
- }
822
- }
823
- }
824
- }
825
- ],
826
- defaultVariants: {
827
- size: "md",
828
- open: !1,
829
- selected: !1,
830
- disabled: !1
831
- }
832
- }), Ca = me({
833
- placement: "anchored",
834
- density: "cozy"
835
- }), xa = r({
836
- width: "100%",
837
- zIndex: "30",
838
- maxHeight: "320px",
839
- overflowY: "auto",
840
- display: "grid"
841
- }), ka = r({
842
- display: "block",
843
- textAlign: "left",
844
- minWidth: "0",
845
- flex: "1",
846
- overflow: "hidden"
847
- }), wa = r({
848
- display: "block",
849
- overflow: "hidden",
850
- textOverflow: "ellipsis",
851
- whiteSpace: "nowrap"
852
- }), Sa = f({
853
- base: {
854
- color: "text.muted",
855
- transition: "transform 160ms cubic-bezier(0.25, 0.1, 0.25, 1)"
856
- },
857
- variants: {
858
- open: {
859
- true: { transform: "rotate(180deg)" },
860
- false: { transform: "rotate(0deg)" }
861
- }
862
- },
863
- defaultVariants: {
864
- open: !1
865
- }
866
- }), za = f({
867
- base: {
868
- width: "100%",
869
- display: "flex",
870
- alignItems: "flex-start",
871
- justifyContent: "space-between",
872
- gap: "3",
873
- textAlign: "left",
874
- borderRadius: "lg",
875
- px: "3",
876
- borderWidth: "1px",
877
- cursor: "pointer",
878
- transition: "border-color 140ms cubic-bezier(0.25, 0.1, 0.25, 1), background-color 140ms cubic-bezier(0.25, 0.1, 0.25, 1), color 140ms cubic-bezier(0.25, 0.1, 0.25, 1)",
879
- _hover: {
880
- bg: "bg.selected",
881
- borderColor: "border.accent"
882
- },
883
- _focusVisible: {
884
- outline: "2px solid",
885
- outlineColor: "text.accent",
886
- outlineOffset: "-2px"
887
- }
888
- },
889
- variants: {
890
- size: {
891
- sm: { py: "2.5" },
892
- md: { py: "2.5" }
893
- },
894
- active: {
895
- true: {
896
- color: "text.primary",
897
- bg: "bg.selected",
898
- borderColor: "border.accent"
899
- },
900
- false: {
901
- color: "text.secondary",
902
- bg: "transparent",
903
- borderColor: "transparent"
904
- }
905
- }
906
- },
907
- defaultVariants: {
908
- size: "md",
909
- active: !1
910
- }
911
- }), Ba = r({
912
- display: "grid",
913
- gap: "0.5",
914
- minWidth: "0"
915
- }), $a = r({
916
- fontSize: "sm",
917
- fontWeight: "600",
918
- minWidth: "0",
919
- overflow: "hidden",
920
- textOverflow: "ellipsis",
921
- whiteSpace: "nowrap"
922
- }), Va = r({
923
- color: "text.secondary",
924
- fontSize: "xs",
925
- lineHeight: "1.45",
926
- overflowWrap: "anywhere"
927
- }), La = f({
928
- base: {
929
- color: "text.accent",
930
- transition: "opacity 140ms cubic-bezier(0.25, 0.1, 0.25, 1)"
931
- },
932
- variants: {
933
- selected: {
934
- true: { opacity: 1 },
935
- false: { opacity: 0 }
936
- }
937
- },
938
- defaultVariants: {
939
- selected: !1
940
- }
941
- }), Ra = ["id", "name", "disabled", "aria-expanded", "aria-controls", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid"], Ia = ["id", "aria-activedescendant"], Wa = ["id", "aria-selected", "onMouseenter", "onClick", "onKeydown"], Na = /* @__PURE__ */ m({
942
- __name: "UiSelect",
943
- props: {
944
- modelValue: {},
945
- options: {},
946
- id: { default: void 0 },
947
- name: { default: void 0 },
948
- placeholder: { default: "Select an option" },
949
- disabled: { type: Boolean, default: !1 },
950
- invalid: { type: Boolean, default: !1 },
951
- size: { default: "md" },
952
- ariaLabel: { default: void 0 },
953
- ariaLabelledby: { default: void 0 },
954
- ariaDescribedby: { default: void 0 }
955
- },
956
- emits: ["update:modelValue"],
957
- setup(e, { emit: s }) {
958
- const i = e, g = s, u = B(null), p = B(null), I = B([]), v = B(!1), x = B(-1), J = se(), W = L(() => i.id ?? `ui-select-${J}`), E = L(() => `${W.value}-listbox`), j = L(
959
- () => i.options.find((n) => n.value === i.modelValue) ?? null
960
- );
961
- function w(n) {
962
- if (!i.options.length) {
963
- x.value = -1;
964
- return;
965
- }
966
- const h = (n + i.options.length) % i.options.length;
967
- x.value = h, T(() => {
968
- I.value[h]?.focus();
969
- });
970
- }
971
- function k() {
972
- v.value = !1, x.value = -1;
973
- }
974
- async function A() {
975
- if (i.disabled || !i.options.length)
976
- return;
977
- v.value = !0;
978
- const n = i.options.findIndex((h) => h.value === i.modelValue);
979
- await T(), w(n >= 0 ? n : 0);
980
- }
981
- function Q() {
982
- if (v.value) {
983
- k();
984
- return;
985
- }
986
- A();
987
- }
988
- function F(n) {
989
- g("update:modelValue", n), k(), T(() => {
990
- p.value?.focus();
991
- });
992
- }
993
- function Z(n) {
994
- i.disabled || (n.key === "ArrowDown" || n.key === "Enter" || n.key === " ") && (n.preventDefault(), A());
995
- }
996
- function _(n, h) {
997
- switch (n.key) {
998
- case "ArrowDown":
999
- n.preventDefault(), w(h + 1);
1000
- break;
1001
- case "ArrowUp":
1002
- n.preventDefault(), w(h - 1);
1003
- break;
1004
- case "Home":
1005
- n.preventDefault(), w(0);
1006
- break;
1007
- case "End":
1008
- n.preventDefault(), w(i.options.length - 1);
1009
- break;
1010
- case "Escape":
1011
- n.preventDefault(), k(), p.value?.focus();
1012
- break;
1013
- case "Enter":
1014
- case " ":
1015
- n.preventDefault(), F(i.options[h].value);
1016
- break;
1017
- }
1018
- }
1019
- function M(n) {
1020
- v.value && (u.value?.contains(n.target) || k());
1021
- }
1022
- return N(
1023
- () => i.options,
1024
- () => {
1025
- I.value = [], i.options.some((n) => n.value === i.modelValue) || k();
1026
- }
1027
- ), N(
1028
- () => i.disabled,
1029
- (n) => {
1030
- n && k();
1031
- }
1032
- ), le(() => {
1033
- document.addEventListener("pointerdown", M);
1034
- }), oe(() => {
1035
- document.removeEventListener("pointerdown", M);
1036
- }), (n, h) => (l(), o("div", {
1037
- ref_key: "rootRef",
1038
- ref: u,
1039
- class: t(a(ha)({ open: v.value }))
1040
- }, [
1041
- d("button", {
1042
- ref_key: "triggerRef",
1043
- ref: p,
1044
- type: "button",
1045
- id: W.value,
1046
- name: e.name,
1047
- disabled: e.disabled,
1048
- class: t(a(ya)({ size: e.size, open: v.value, selected: !!j.value, disabled: e.disabled })),
1049
- "aria-haspopup": "listbox",
1050
- "aria-expanded": v.value,
1051
- "aria-controls": E.value,
1052
- "aria-label": e.ariaLabel,
1053
- "aria-labelledby": e.ariaLabelledby,
1054
- "aria-describedby": e.ariaDescribedby,
1055
- "aria-invalid": e.invalid || void 0,
1056
- onClick: Q,
1057
- onKeydown: Z
1058
- }, [
1059
- d("span", {
1060
- class: t(a(ka))
1061
- }, [
1062
- d("span", {
1063
- class: t(a(wa))
1064
- }, c(j.value?.label ?? e.placeholder), 3)
1065
- ], 2),
1066
- R(a(ye), {
1067
- size: 16,
1068
- class: t(a(Sa)({ open: v.value }))
1069
- }, null, 8, ["class"])
1070
- ], 42, Ra),
1071
- v.value ? (l(), o("div", {
1072
- key: 0,
1073
- id: E.value,
1074
- class: t([a(Ca), a(xa)]),
1075
- role: "listbox",
1076
- "aria-activedescendant": x.value >= 0 ? `${W.value}-${x.value}` : void 0
1077
- }, [
1078
- (l(!0), o($, null, V(e.options, (C, S) => (l(), o("button", {
1079
- id: `${W.value}-${S}`,
1080
- key: C.value,
1081
- ref_for: !0,
1082
- ref: (z) => I.value[S] = z,
1083
- type: "button",
1084
- role: "option",
1085
- "aria-selected": C.value === e.modelValue,
1086
- class: t(a(za)({ size: e.size, active: x.value === S || C.value === e.modelValue })),
1087
- onMouseenter: (z) => x.value = S,
1088
- onClick: (z) => F(C.value),
1089
- onKeydown: (z) => _(z, S)
1090
- }, [
1091
- d("span", {
1092
- class: t(a(Ba))
1093
- }, [
1094
- d("span", {
1095
- class: t(a($a))
1096
- }, c(C.label), 3),
1097
- C.description && e.size === "md" ? (l(), o("span", {
1098
- key: 0,
1099
- class: t(a(Va))
1100
- }, c(C.description), 3)) : b("", !0)
1101
- ], 2),
1102
- R(a(q), {
1103
- size: 15,
1104
- class: t(a(La)({ selected: C.value === e.modelValue }))
1105
- }, null, 8, ["class"])
1106
- ], 42, Wa))), 128))
1107
- ], 10, Ia)) : b("", !0)
1108
- ], 2));
1109
- }
1110
- }), Ha = f({
1111
- base: {
1112
- position: "relative",
1113
- overflow: "hidden",
1114
- bg: "bg.cardAlt",
1115
- borderRadius: "md",
1116
- _before: {
1117
- content: '""',
1118
- position: "absolute",
1119
- inset: "0",
1120
- background: "linear-gradient(90deg, transparent 0%, var(--colors-bg-overlay, rgba(255,255,255,0.36)) 50%, transparent 100%)",
1121
- transform: "translateX(-100%)",
1122
- animation: "aggc-shimmer 1.6s cubic-bezier(0.25, 0.1, 0.25, 1) infinite"
1123
- },
1124
- _dark: {
1125
- bg: "rgba(255, 255, 255, 0.04)",
1126
- _before: {
1127
- background: "linear-gradient(90deg, transparent 0%, rgba(186, 204, 236, 0.1) 50%, transparent 100%)"
1128
- }
1129
- }
1130
- },
1131
- variants: {
1132
- variant: {
1133
- text: {
1134
- width: "100%",
1135
- height: "0.875rem"
1136
- },
1137
- title: {
1138
- width: "100%",
1139
- height: "1.75rem",
1140
- borderRadius: "md"
1141
- },
1142
- rect: {
1143
- width: "100%",
1144
- height: "5rem"
1145
- },
1146
- pill: {
1147
- width: "5rem",
1148
- height: "1.75rem",
1149
- borderRadius: "999px"
1150
- },
1151
- circle: {
1152
- width: "2.75rem",
1153
- height: "2.75rem",
1154
- borderRadius: "999px"
1155
- },
1156
- stat: {
1157
- width: "100%",
1158
- height: "4.75rem"
1159
- },
1160
- action: {
1161
- width: "100%",
1162
- height: "2.75rem"
1163
- }
1164
- }
1165
- },
1166
- defaultVariants: {
1167
- variant: "rect"
1168
- }
1169
- }), Ga = /* @__PURE__ */ m({
1170
- __name: "UiSkeleton",
1171
- props: {
1172
- variant: { default: "rect" },
1173
- width: { default: void 0 },
1174
- height: { default: void 0 }
1175
- },
1176
- setup(e) {
1177
- const s = e, i = L(() => Ha({ variant: s.variant })), g = L(() => ({
1178
- width: s.width ?? (s.variant === "circle" ? "2.75rem" : s.variant === "pill" ? "5rem" : "100%"),
1179
- height: s.height ?? (s.variant === "text" ? "0.875rem" : s.variant === "title" || s.variant === "pill" ? "1.75rem" : s.variant === "circle" || s.variant === "action" ? "2.75rem" : s.variant === "stat" ? "4.75rem" : "5rem")
1180
- }));
1181
- return (u, p) => (l(), o("div", {
1182
- "aria-hidden": "true",
1183
- "data-ui-skeleton": "",
1184
- class: t(i.value),
1185
- style: ie(g.value)
1186
- }, null, 6));
1187
- }
1188
- });
1189
- export {
1190
- Oa as _,
1191
- Ea as a,
1192
- ja as b,
1193
- ke as c,
1194
- Aa as d,
1195
- Fa as e,
1196
- Ma as f,
1197
- Ua as g,
1198
- Ka as h,
1199
- Na as i,
1200
- Ga as j
1201
- };