@astrake/lumora-ui 0.2.2 → 0.7.3

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 (94) hide show
  1. package/CHANGELOG.md +113 -21
  2. package/README.md +29 -31
  3. package/dist/LuAccordion.vue_vue_type_script_setup_true_lang-CwG5Ml8t.js +5032 -0
  4. package/dist/__mocks__/empty.d.ts +4 -0
  5. package/dist/components/LuAccordion.vue.d.ts +23 -0
  6. package/dist/components/LuBarChart.vue.d.ts +22 -0
  7. package/dist/components/LuBottomSheet.vue.d.ts +27 -0
  8. package/dist/components/LuCalendar.vue.d.ts +34 -0
  9. package/dist/components/LuCheckbox.vue.d.ts +17 -3
  10. package/dist/components/LuChip.vue.d.ts +35 -0
  11. package/dist/components/LuChipGroup.vue.d.ts +23 -0
  12. package/dist/components/LuCollapsible.vue.d.ts +5 -2
  13. package/dist/components/LuCommandPalette.vue.d.ts +25 -0
  14. package/dist/components/LuDataGrid.types.d.ts +39 -0
  15. package/dist/components/LuDataGrid.vue.d.ts +84 -0
  16. package/dist/components/LuDateRangePicker.vue.d.ts +29 -0
  17. package/dist/components/LuDoughnutChart.vue.d.ts +17 -0
  18. package/dist/components/LuDrawer.vue.d.ts +33 -0
  19. package/dist/components/LuFileUpload.vue.d.ts +38 -0
  20. package/dist/components/LuFormField.vue.d.ts +21 -0
  21. package/dist/components/LuFormWizard.types.d.ts +7 -0
  22. package/dist/components/LuFormWizard.vue.d.ts +33 -0
  23. package/dist/components/LuGaugeChart.vue.d.ts +16 -0
  24. package/dist/components/LuKanban.types.d.ts +24 -0
  25. package/dist/components/LuKanban.vue.d.ts +30 -0
  26. package/dist/components/LuLineChart.vue.d.ts +19 -0
  27. package/dist/components/LuList.vue.d.ts +18 -0
  28. package/dist/components/LuListDivider.vue.d.ts +5 -0
  29. package/dist/components/LuListItem.vue.d.ts +32 -0
  30. package/dist/components/LuListSubheader.vue.d.ts +16 -0
  31. package/dist/components/LuMediaGallery.vue.d.ts +25 -0
  32. package/dist/components/LuMenu.vue.d.ts +2 -2
  33. package/dist/components/LuPlanner.types.d.ts +14 -0
  34. package/dist/components/LuPlanner.vue.d.ts +23 -0
  35. package/dist/components/LuPopover.vue.d.ts +24 -0
  36. package/dist/components/LuRadioGroup.types.d.ts +1 -0
  37. package/dist/components/LuRichTextEditor.vue.d.ts +27 -0
  38. package/dist/components/LuSelect.vue.d.ts +35 -2
  39. package/dist/components/{LuPageHeader.vue.d.ts → LuSparkline.vue.d.ts} +9 -5
  40. package/dist/components/LuSwitch.vue.d.ts +19 -5
  41. package/dist/components/LuTimeline.vue.d.ts +17 -0
  42. package/dist/components/LuTimelineItem.vue.d.ts +24 -0
  43. package/dist/components/LuToast.vue.d.ts +5 -0
  44. package/dist/components/LuTree.types.d.ts +9 -0
  45. package/dist/components/LuTree.vue.d.ts +25 -0
  46. package/dist/components/LuTreeNode.vue.d.ts +37 -0
  47. package/dist/components/__tests__/LuAccordion.test.d.ts +1 -0
  48. package/dist/components/__tests__/LuBarChart.test.d.ts +1 -0
  49. package/dist/components/__tests__/LuBottomSheet.test.d.ts +1 -0
  50. package/dist/components/__tests__/LuCalendar.test.d.ts +1 -0
  51. package/dist/components/__tests__/LuCheckbox.test.d.ts +1 -0
  52. package/dist/components/__tests__/LuChip.test.d.ts +1 -0
  53. package/dist/components/__tests__/LuCommandPalette.test.d.ts +1 -0
  54. package/dist/components/__tests__/LuDataGrid.test.d.ts +1 -0
  55. package/dist/components/__tests__/LuDateRangePicker.test.d.ts +1 -0
  56. package/dist/components/__tests__/LuDoughnutChart.test.d.ts +1 -0
  57. package/dist/components/__tests__/LuDrawer.test.d.ts +1 -0
  58. package/dist/components/__tests__/LuFileUpload.test.d.ts +1 -0
  59. package/dist/components/__tests__/LuFormWizard.test.d.ts +1 -0
  60. package/dist/components/__tests__/LuGaugeChart.test.d.ts +1 -0
  61. package/dist/components/__tests__/LuKanban.test.d.ts +1 -0
  62. package/dist/components/__tests__/LuLineChart.test.d.ts +1 -0
  63. package/dist/components/__tests__/LuList.test.d.ts +1 -0
  64. package/dist/components/__tests__/LuMediaGallery.test.d.ts +1 -0
  65. package/dist/components/__tests__/LuPlanner.test.d.ts +1 -0
  66. package/dist/components/__tests__/LuPopover.test.d.ts +1 -0
  67. package/dist/components/__tests__/LuRadio.test.d.ts +1 -0
  68. package/dist/components/__tests__/LuRichTextEditor.test.d.ts +1 -0
  69. package/dist/components/__tests__/LuSelect.test.d.ts +1 -0
  70. package/dist/components/__tests__/LuSparkline.test.d.ts +1 -0
  71. package/dist/components/__tests__/LuSwitch.test.d.ts +1 -0
  72. package/dist/components/__tests__/LuTimeline.test.d.ts +1 -0
  73. package/dist/components/__tests__/LuToast.test.d.ts +1 -0
  74. package/dist/components/__tests__/LuTree.test.d.ts +1 -0
  75. package/dist/components/index.d.ts +42 -3
  76. package/dist/components/index.js +73 -44
  77. package/dist/composables/index.d.ts +2 -0
  78. package/dist/composables/index.js +36 -17
  79. package/dist/composables/lazyVChart.d.ts +10 -0
  80. package/dist/composables/useChartTheme.d.ts +65 -0
  81. package/dist/composables/useDataGrid.d.ts +52 -0
  82. package/dist/composables/useFloating.d.ts +12 -0
  83. package/dist/composables/useLuToast.d.ts +14 -0
  84. package/dist/index.d.ts +5 -0
  85. package/dist/index.js +210 -146
  86. package/dist/skins/index.js +824 -20
  87. package/dist/useLuToast-D5d7Wrcr.js +1029 -0
  88. package/package.json +16 -3
  89. package/scripts/postinstall.mjs +35 -0
  90. package/src/lumora.css +216 -5
  91. package/dist/LuCodeBlock.vue_vue_type_script_setup_true_lang-BdXflBkJ.js +0 -1672
  92. package/dist/components/LuThemeSelect.vue.d.ts +0 -2
  93. package/dist/components/LuThemeSwitch.vue.d.ts +0 -2
  94. package/dist/useShiki-DPOJfneq.js +0 -30
@@ -1,1672 +0,0 @@
1
- import { defineComponent as b, computed as o, resolveComponent as ie, openBlock as i, createBlock as w, resolveDynamicComponent as W, mergeProps as S, withCtx as V, renderSlot as h, inject as I, ref as M, onMounted as F, onUnmounted as G, createElementBlock as p, normalizeClass as m, createCommentVNode as _, createElementVNode as C, unref as R, useSlots as de, Fragment as J, renderList as te, toDisplayString as O, watch as D, provide as Q, withDirectives as ne, vShow as le, normalizeStyle as me, createVNode as T, Transition as x, createTextVNode as P, readonly as se, withModifiers as K, onBeforeUnmount as ue, Teleport as pe } from "vue";
2
- import { u as L, c as oe } from "./context-CGS7Ou_x.js";
3
- import { u as ce, g as fe } from "./useShiki-DPOJfneq.js";
4
- const H = /* @__PURE__ */ b({
5
- inheritAttrs: !1,
6
- __name: "LuButton",
7
- props: {
8
- type: {},
9
- disabled: { type: Boolean },
10
- variant: {},
11
- as: {},
12
- to: {},
13
- href: {}
14
- },
15
- emits: ["click"],
16
- setup(a, { emit: n }) {
17
- const e = a, l = n, t = o(() => {
18
- if (e.as) return e.as;
19
- if (e.to) {
20
- const c = ie("RouterLink");
21
- return typeof c == "string" ? "a" : c;
22
- }
23
- return e.href ? "a" : "button";
24
- }), { resolveSkin: r } = L(), s = o(() => r("LuButton", e.variant));
25
- return (c, u) => (i(), w(W(t.value), S(c.$attrs, {
26
- to: a.to,
27
- href: a.href,
28
- type: t.value === "button" ? a.type : void 0,
29
- disabled: t.value === "button" ? a.disabled : void 0,
30
- "aria-disabled": a.disabled ? "true" : void 0,
31
- class: [s.value, { "pointer-events-none": a.disabled && t.value !== "button" }],
32
- onClick: u[0] || (u[0] = (v) => l("click", v))
33
- }), {
34
- default: V(() => [
35
- h(c.$slots, "default")
36
- ]),
37
- _: 3
38
- }, 16, ["to", "href", "type", "disabled", "aria-disabled", "class"]));
39
- }
40
- }), N = Symbol("LuFormContext"), ke = {
41
- key: 0,
42
- class: "relative w-full"
43
- }, be = ["value", "name", "disabled"], ge = ["value", "name", "disabled"], Ke = /* @__PURE__ */ b({
44
- __name: "LuInput",
45
- props: {
46
- modelValue: {},
47
- variant: {},
48
- name: {},
49
- error: {}
50
- },
51
- emits: ["update:modelValue", "blur"],
52
- setup(a, { emit: n }) {
53
- const e = a, l = n, { resolveSkin: t } = L(), r = o(() => t("LuInput", e.variant)), s = o(() => t("LuInputPrepend", e.variant)), c = o(() => t("LuInputAppend", e.variant)), u = I(N, null), v = M(e.modelValue), d = (k) => {
54
- const f = k.target.value;
55
- v.value = f, l("update:modelValue", f);
56
- }, g = () => {
57
- e.name && u && (u.validateOn.value === "blur" || u.validateOn.value), l("blur");
58
- };
59
- return F(() => {
60
- !e.name || !u || u.register({
61
- name: e.name,
62
- getValue: () => v.value,
63
- setValue: (k) => {
64
- v.value = k;
65
- },
66
- setError: (k) => {
67
- }
68
- });
69
- }), G(() => {
70
- e.name && u && u.unregister(e.name);
71
- }), (k, f) => {
72
- var B, y;
73
- return k.$slots.prepend || k.$slots.append ? (i(), p("div", ke, [
74
- k.$slots.prepend ? (i(), p("div", {
75
- key: 0,
76
- class: m(s.value)
77
- }, [
78
- h(k.$slots, "prepend")
79
- ], 2)) : _("", !0),
80
- C("input", S(k.$attrs, {
81
- class: [r.value, k.$slots.prepend && "pl-9", k.$slots.append && "pr-9"],
82
- value: a.modelValue,
83
- name: a.name,
84
- disabled: (B = R(u)) == null ? void 0 : B.disabled.value,
85
- onInput: d,
86
- onBlur: g
87
- }), null, 16, be),
88
- k.$slots.append ? (i(), p("div", {
89
- key: 1,
90
- class: m(c.value)
91
- }, [
92
- h(k.$slots, "append")
93
- ], 2)) : _("", !0)
94
- ])) : (i(), p("input", S({ key: 1 }, k.$attrs, {
95
- class: r.value,
96
- value: a.modelValue,
97
- name: a.name,
98
- disabled: (y = R(u)) == null ? void 0 : y.disabled.value,
99
- onInput: d,
100
- onBlur: g
101
- }), null, 16, ge));
102
- };
103
- }
104
- }), E = /* @__PURE__ */ b({
105
- __name: "LuIcon",
106
- props: {
107
- variant: {},
108
- name: {},
109
- size: {},
110
- strokeWidth: {}
111
- },
112
- setup(a) {
113
- const n = a, e = de(), { resolveSkin: l, resolveIcon: t } = L(), r = o(() => l("LuIcon", n.variant)), s = o(() => e.default || !n.name ? null : t(n.name, n.size)), c = o(
114
- () => n.size ? { width: `${n.size}px`, height: `${n.size}px` } : void 0
115
- );
116
- return (u, v) => (i(), p("span", S(u.$attrs, {
117
- class: r.value,
118
- "aria-hidden": "true",
119
- style: c.value
120
- }), [
121
- h(u.$slots, "default", {}, () => [
122
- s.value ? (i(), w(W(s.value), {
123
- key: 0,
124
- size: a.size,
125
- "stroke-width": a.strokeWidth
126
- }, null, 8, ["size", "stroke-width"])) : _("", !0)
127
- ])
128
- ], 16));
129
- }
130
- }), X = /* @__PURE__ */ b({
131
- __name: "LuText",
132
- props: {
133
- variant: {},
134
- as: {}
135
- },
136
- setup(a) {
137
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuText", n.variant));
138
- return (t, r) => (i(), w(W(a.as ?? "span"), S(t.$attrs, { class: l.value }), {
139
- default: V(() => [
140
- h(t.$slots, "default")
141
- ]),
142
- _: 3
143
- }, 16, ["class"]));
144
- }
145
- }), he = ["name", "aria-checked", "disabled"], Le = /* @__PURE__ */ b({
146
- __name: "LuSwitch",
147
- props: {
148
- modelValue: { type: Boolean },
149
- variant: {},
150
- disabled: { type: Boolean },
151
- name: {},
152
- error: {}
153
- },
154
- emits: ["update:modelValue", "blur"],
155
- setup(a, { emit: n }) {
156
- const e = a, l = n, { resolveSkin: t } = L(), r = o(() => t("LuSwitch", e.variant)), s = o(() => t("LuSwitch", "checked")), c = o(() => t("LuSwitchThumb", e.variant)), u = o(() => t("LuSwitchThumb", "checked")), v = I(N, null), d = M(e.modelValue), g = o(() => e.modelValue !== void 0 ? e.modelValue : !!d.value), k = o(() => e.disabled || (v == null ? void 0 : v.disabled.value)), f = () => {
157
- if (k.value) return;
158
- const y = !g.value;
159
- d.value = y, l("update:modelValue", y);
160
- }, B = () => {
161
- e.name && v && (v.validateOn.value === "blur" || v.validateOn.value), l("blur");
162
- };
163
- return F(() => {
164
- !e.name || !v || v.register({
165
- name: e.name,
166
- getValue: () => d.value,
167
- setValue: (y) => {
168
- d.value = !!y;
169
- },
170
- setError: (y) => {
171
- }
172
- });
173
- }), G(() => {
174
- e.name && v && v.unregister(e.name);
175
- }), (y, $) => (i(), p("button", {
176
- role: "switch",
177
- type: "button",
178
- name: a.name,
179
- "aria-checked": g.value,
180
- disabled: k.value,
181
- class: m(R(oe)(r.value, g.value ? s.value : "")),
182
- onClick: f,
183
- onBlur: B
184
- }, [
185
- C("span", {
186
- class: m(R(oe)(c.value, g.value ? u.value : ""))
187
- }, null, 2)
188
- ], 42, he));
189
- }
190
- }), ye = ["value", "name", "disabled"], Se = ["value"], $e = /* @__PURE__ */ b({
191
- __name: "LuSelect",
192
- props: {
193
- modelValue: {},
194
- variant: {},
195
- options: {},
196
- name: {},
197
- error: {}
198
- },
199
- emits: ["update:modelValue", "blur"],
200
- setup(a, { emit: n }) {
201
- const e = a, l = n, { resolveSkin: t } = L(), r = o(() => t("LuSelect", e.variant)), s = I(N, null), c = M(e.modelValue), u = (d) => {
202
- const g = d.target.value;
203
- c.value = g, l("update:modelValue", g);
204
- }, v = () => {
205
- e.name && s && (s.validateOn.value === "blur" || s.validateOn.value), l("blur");
206
- };
207
- return F(() => {
208
- !e.name || !s || s.register({
209
- name: e.name,
210
- getValue: () => c.value,
211
- setValue: (d) => {
212
- c.value = d;
213
- },
214
- setError: (d) => {
215
- }
216
- });
217
- }), G(() => {
218
- e.name && s && s.unregister(e.name);
219
- }), (d, g) => {
220
- var k;
221
- return i(), p("select", S(d.$attrs, {
222
- class: r.value,
223
- value: a.modelValue,
224
- name: a.name,
225
- disabled: (k = R(s)) == null ? void 0 : k.disabled.value,
226
- onChange: u,
227
- onBlur: v
228
- }), [
229
- (i(!0), p(J, null, te(a.options, (f) => (i(), p("option", {
230
- key: f.value,
231
- value: f.value
232
- }, O(f.label), 9, Se))), 128))
233
- ], 16, ye);
234
- };
235
- }
236
- }), We = /* @__PURE__ */ b({
237
- __name: "LuThemeSwitch",
238
- setup(a) {
239
- const { resolved: n, setMode: e } = ce(), l = o(() => n.value === "dark"), t = (r) => {
240
- e(r ? "dark" : "light");
241
- };
242
- return (r, s) => (i(), w(Le, S({
243
- "model-value": l.value,
244
- variant: "theme"
245
- }, r.$attrs, { "onUpdate:modelValue": t }), null, 16, ["model-value"]));
246
- }
247
- }), Ge = /* @__PURE__ */ b({
248
- __name: "LuThemeSelect",
249
- setup(a) {
250
- const { mode: n, setMode: e } = ce(), l = [
251
- { value: "system", label: "System" },
252
- { value: "light", label: "Light" },
253
- { value: "dark", label: "Dark" }
254
- ], t = (r) => {
255
- e(r);
256
- };
257
- return (r, s) => (i(), w($e, S({
258
- "model-value": R(n),
259
- variant: "theme",
260
- options: l
261
- }, r.$attrs, { "onUpdate:modelValue": t }), null, 16, ["model-value"]));
262
- }
263
- }), Ce = /* @__PURE__ */ b({
264
- __name: "LuTabs",
265
- props: {
266
- variant: {},
267
- modelValue: {}
268
- },
269
- emits: ["update:modelValue"],
270
- setup(a, { emit: n }) {
271
- const e = a, l = n, t = M(e.modelValue);
272
- D(() => e.modelValue, (c) => t.value = c), D(t, (c) => {
273
- c !== void 0 && l("update:modelValue", c);
274
- }), Q("lu-tabs-active", t);
275
- const { resolveSkin: r } = L(), s = o(() => r("LuTabs", e.variant));
276
- return (c, u) => (i(), p("div", S(c.$attrs, { class: s.value }), [
277
- h(c.$slots, "default")
278
- ], 16));
279
- }
280
- }), Ve = /* @__PURE__ */ b({
281
- __name: "LuTabList",
282
- props: {
283
- variant: {}
284
- },
285
- setup(a) {
286
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuTabList", n.variant));
287
- return (t, r) => (i(), p("div", S(t.$attrs, { class: l.value }), [
288
- h(t.$slots, "default")
289
- ], 16));
290
- }
291
- }), re = /* @__PURE__ */ b({
292
- __name: "LuTab",
293
- props: {
294
- variant: {},
295
- value: {}
296
- },
297
- setup(a) {
298
- const n = a, e = I("lu-tabs-active"), l = o(() => (e == null ? void 0 : e.value) === n.value), t = () => {
299
- e && (e.value = n.value);
300
- }, { resolveSkin: r } = L(), s = o(() => r("LuTab", n.variant)), c = o(() => r("LuTab", "active"));
301
- return (u, v) => (i(), p("button", S(u.$attrs, {
302
- class: [s.value, l.value ? c.value : ""],
303
- onClick: t
304
- }), [
305
- h(u.$slots, "default")
306
- ], 16));
307
- }
308
- }), qe = /* @__PURE__ */ b({
309
- __name: "LuTabPanel",
310
- props: {
311
- variant: {},
312
- value: {}
313
- },
314
- setup(a) {
315
- const n = a, e = I("lu-tabs-active"), l = o(() => (e == null ? void 0 : e.value) === n.value), { resolveSkin: t } = L(), r = o(() => t("LuTabPanel", n.variant));
316
- return (s, c) => ne((i(), p("div", S(s.$attrs, { class: r.value }), [
317
- h(s.$slots, "default")
318
- ], 16)), [
319
- [le, l.value]
320
- ]);
321
- }
322
- }), Je = /* @__PURE__ */ b({
323
- __name: "LuBadge",
324
- props: {
325
- variant: {},
326
- as: {}
327
- },
328
- setup(a) {
329
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuBadge", n.variant));
330
- return (t, r) => (i(), w(W(a.as || "span"), S(t.$attrs, { class: l.value }), {
331
- default: V(() => [
332
- h(t.$slots, "default")
333
- ]),
334
- _: 3
335
- }, 16, ["class"]));
336
- }
337
- }), Qe = /* @__PURE__ */ b({
338
- __name: "LuProgressBar",
339
- props: {
340
- variant: {},
341
- value: {},
342
- max: {}
343
- },
344
- setup(a) {
345
- const n = a, e = o(() => {
346
- const s = n.max ?? 100;
347
- return Math.max(0, Math.min(100, n.value / s * 100));
348
- }), { resolveSkin: l } = L(), t = o(() => l("LuProgressBar", n.variant)), r = o(() => l("LuProgressBarFill", n.variant));
349
- return (s, c) => (i(), p("div", S(s.$attrs, { class: t.value }), [
350
- C("div", {
351
- class: m(r.value),
352
- style: me({ width: `${e.value}%` })
353
- }, null, 6)
354
- ], 16));
355
- }
356
- }), Xe = /* @__PURE__ */ b({
357
- __name: "LuTooltip",
358
- props: {
359
- variant: {},
360
- position: {},
361
- delay: {}
362
- },
363
- setup(a) {
364
- const n = a, e = M(!1);
365
- let l = null;
366
- const t = () => {
367
- l && clearTimeout(l), n.delay ? l = setTimeout(() => e.value = !0, n.delay) : e.value = !0;
368
- }, r = () => {
369
- l && clearTimeout(l), e.value = !1;
370
- }, { resolveSkin: s } = L(), c = o(() => s("LuTooltip", n.variant)), u = o(() => s("LuTooltipContent", n.position ?? n.variant));
371
- return (v, d) => (i(), p("div", S(v.$attrs, {
372
- class: c.value,
373
- onMouseenter: t,
374
- onMouseleave: r
375
- }), [
376
- h(v.$slots, "trigger"),
377
- ne(C("div", {
378
- class: m(u.value)
379
- }, [
380
- h(v.$slots, "content")
381
- ], 2), [
382
- [le, e.value]
383
- ])
384
- ], 16));
385
- }
386
- }), Ye = /* @__PURE__ */ b({
387
- __name: "LuCollapsible",
388
- props: {
389
- variant: {},
390
- modelValue: { type: Boolean },
391
- defaultOpen: { type: Boolean }
392
- },
393
- emits: ["update:modelValue"],
394
- setup(a, { emit: n }) {
395
- const e = a, l = n, t = M(e.modelValue ?? e.defaultOpen ?? !1);
396
- D(() => e.modelValue, (d) => {
397
- d !== void 0 && (t.value = d);
398
- });
399
- const r = () => {
400
- t.value = !t.value, l("update:modelValue", t.value);
401
- }, { resolveSkin: s } = L(), c = o(() => s("LuCollapsible", e.variant)), u = o(() => s("LuCollapsibleTrigger", e.variant)), v = o(() => ({
402
- wrapper: s("LuCollapsibleContent", e.variant),
403
- inner: s("LuCollapsibleContent", "inner")
404
- }));
405
- return (d, g) => (i(), p("div", S(d.$attrs, { class: c.value }), [
406
- C("button", {
407
- type: "button",
408
- class: m(u.value),
409
- onClick: r
410
- }, [
411
- h(d.$slots, "trigger", { isOpen: t.value })
412
- ], 2),
413
- T(x, { name: "lu-collapsible" }, {
414
- default: V(() => [
415
- ne(C("div", {
416
- class: m(v.value.wrapper)
417
- }, [
418
- C("div", {
419
- class: m(v.value.inner)
420
- }, [
421
- h(d.$slots, "content")
422
- ], 2)
423
- ], 2), [
424
- [le, t.value]
425
- ])
426
- ]),
427
- _: 3
428
- })
429
- ], 16));
430
- }
431
- }), _e = ["data-size"], Te = ["src", "alt"], Ze = /* @__PURE__ */ b({
432
- __name: "LuAvatar",
433
- props: {
434
- variant: {},
435
- src: {},
436
- fallback: {},
437
- alt: {},
438
- size: {}
439
- },
440
- setup(a) {
441
- const n = a, e = M(!1), { resolveSkin: l } = L(), t = o(() => l("LuAvatar", n.variant)), r = o(() => l("LuAvatarImage", n.variant)), s = o(() => l("LuAvatarFallback", n.variant));
442
- return (c, u) => (i(), p("div", S(c.$attrs, {
443
- class: t.value,
444
- "data-size": a.size
445
- }), [
446
- a.src && !e.value ? (i(), p("img", {
447
- key: 0,
448
- src: a.src,
449
- alt: a.alt,
450
- class: m(r.value),
451
- onError: u[0] || (u[0] = (v) => e.value = !0)
452
- }, null, 42, Te)) : (i(), p("div", {
453
- key: 1,
454
- class: m(s.value)
455
- }, [
456
- h(c.$slots, "default", {}, () => [
457
- P(O(a.fallback), 1)
458
- ])
459
- ], 2))
460
- ], 16, _e));
461
- }
462
- }), Be = /* @__PURE__ */ b({
463
- __name: "LuLink",
464
- props: {
465
- variant: {},
466
- as: {},
467
- to: {},
468
- href: {},
469
- target: {}
470
- },
471
- emits: ["click"],
472
- setup(a, { emit: n }) {
473
- const e = a, l = n, t = o(() => {
474
- if (e.as) return e.as;
475
- if (e.to) {
476
- const u = ie("RouterLink");
477
- return typeof u == "string" ? "a" : u;
478
- }
479
- return "a";
480
- }), r = o(() => {
481
- const u = { ...e };
482
- return delete u.variant, delete u.as, u;
483
- }), { resolveSkin: s } = L(), c = o(() => s("LuLink", e.variant));
484
- return (u, v) => (i(), w(W(t.value), S(r.value, {
485
- class: c.value,
486
- onClick: v[0] || (v[0] = (d) => l("click", d))
487
- }), {
488
- default: V(() => [
489
- h(u.$slots, "default")
490
- ]),
491
- _: 3
492
- }, 16, ["class"]));
493
- }
494
- }), xe = /* @__PURE__ */ b({
495
- __name: "LuDivider",
496
- props: {
497
- variant: {},
498
- orientation: { default: "horizontal" }
499
- },
500
- setup(a) {
501
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuDivider", n.variant || n.orientation));
502
- return (t, r) => (i(), p("div", S(t.$attrs, { class: l.value }), null, 16));
503
- }
504
- }), ea = /* @__PURE__ */ b({
505
- __name: "LuPageHeader",
506
- props: {
507
- variant: {},
508
- title: {},
509
- description: {},
510
- level: { default: "h1" }
511
- },
512
- setup(a) {
513
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuPageHeader", n.variant));
514
- return (t, r) => (i(), p("div", S(t.$attrs, { class: l.value }), [
515
- T(X, {
516
- as: a.level,
517
- variant: "page-title"
518
- }, {
519
- default: V(() => [
520
- P(O(a.title), 1)
521
- ]),
522
- _: 1
523
- }, 8, ["as"]),
524
- a.description ? (i(), w(X, {
525
- key: 0,
526
- as: "p",
527
- variant: "page-subtitle",
528
- class: "mt-2"
529
- }, {
530
- default: V(() => [
531
- P(O(a.description), 1)
532
- ]),
533
- _: 1
534
- })) : _("", !0)
535
- ], 16));
536
- }
537
- }), aa = /* @__PURE__ */ b({
538
- __name: "LuCard",
539
- props: {
540
- variant: {},
541
- as: { default: "div" }
542
- },
543
- setup(a) {
544
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuCard", n.variant));
545
- return (t, r) => (i(), w(W(a.as), S(t.$attrs, { class: l.value }), {
546
- default: V(() => [
547
- h(t.$slots, "default")
548
- ]),
549
- _: 3
550
- }, 16, ["class"]));
551
- }
552
- }), ta = /* @__PURE__ */ b({
553
- __name: "LuTable",
554
- props: {
555
- variant: {}
556
- },
557
- setup(a) {
558
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuTable", n.variant));
559
- return (t, r) => (i(), p("table", S(t.$attrs, { class: l.value }), [
560
- h(t.$slots, "default")
561
- ], 16));
562
- }
563
- }), na = /* @__PURE__ */ b({
564
- __name: "LuTableHead",
565
- props: {
566
- variant: {}
567
- },
568
- setup(a) {
569
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuTableHead", n.variant));
570
- return (t, r) => (i(), p("thead", S(t.$attrs, { class: l.value }), [
571
- h(t.$slots, "default")
572
- ], 16));
573
- }
574
- }), la = /* @__PURE__ */ b({
575
- __name: "LuTableBody",
576
- props: {
577
- variant: {}
578
- },
579
- setup(a) {
580
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuTableBody", n.variant));
581
- return (t, r) => (i(), p("tbody", S(t.$attrs, { class: l.value }), [
582
- h(t.$slots, "default")
583
- ], 16));
584
- }
585
- }), sa = /* @__PURE__ */ b({
586
- __name: "LuTableRow",
587
- props: {
588
- variant: {}
589
- },
590
- setup(a) {
591
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuTableRow", n.variant));
592
- return (t, r) => (i(), p("tr", S(t.$attrs, { class: l.value }), [
593
- h(t.$slots, "default")
594
- ], 16));
595
- }
596
- }), oa = /* @__PURE__ */ b({
597
- __name: "LuTableHeadCell",
598
- props: {
599
- variant: {}
600
- },
601
- setup(a) {
602
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuTableHeadCell", n.variant));
603
- return (t, r) => (i(), p("th", S(t.$attrs, { class: l.value }), [
604
- h(t.$slots, "default")
605
- ], 16));
606
- }
607
- }), ra = /* @__PURE__ */ b({
608
- __name: "LuTableCell",
609
- props: {
610
- variant: {}
611
- },
612
- setup(a) {
613
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuTableCell", n.variant));
614
- return (t, r) => (i(), p("td", S(t.$attrs, { class: l.value }), [
615
- h(t.$slots, "default")
616
- ], 16));
617
- }
618
- }), ia = /* @__PURE__ */ b({
619
- __name: "LuForm",
620
- props: {
621
- rules: { default: () => ({}) },
622
- validateOn: { default: "submit" },
623
- resetOnSubmit: { type: Boolean, default: !1 },
624
- disabled: { type: Boolean, default: !1 }
625
- },
626
- emits: ["submit", "reset", "error"],
627
- setup(a, { expose: n, emit: e }) {
628
- const l = a, t = e, r = /* @__PURE__ */ new Map(), s = M({}), c = M(!1), u = o(() => Object.keys(s.value).length > 0);
629
- async function v() {
630
- var B;
631
- const f = {};
632
- for (const [y, $] of r) {
633
- const A = (B = l.rules) == null ? void 0 : B[y];
634
- if (!A) continue;
635
- const j = Array.isArray(A) ? A : [A], Y = $.getValue();
636
- for (const q of j) {
637
- const z = await q(Y);
638
- if (z) {
639
- f[y] = z, $.setError(z);
640
- break;
641
- } else
642
- $.setError(null);
643
- }
644
- }
645
- return s.value = f, Object.keys(f).length === 0;
646
- }
647
- async function d() {
648
- c.value = !0;
649
- try {
650
- if (!await v()) {
651
- t("error", s.value);
652
- return;
653
- }
654
- const B = {};
655
- for (const [y, $] of r)
656
- B[y] = $.getValue();
657
- t("submit", B), l.resetOnSubmit && g();
658
- } finally {
659
- c.value = !1;
660
- }
661
- }
662
- function g() {
663
- s.value = {};
664
- for (const f of r.values())
665
- f.setValue(void 0), f.setError(null);
666
- t("reset");
667
- }
668
- const k = {
669
- register(f) {
670
- r.set(f.name, f);
671
- },
672
- unregister(f) {
673
- r.delete(f);
674
- },
675
- getError(f) {
676
- return s.value[f] ?? null;
677
- },
678
- validateOn: o(() => l.validateOn),
679
- disabled: o(() => l.disabled)
680
- };
681
- return Q(N, k), n({
682
- submit: d,
683
- reset: g,
684
- errors: se(s),
685
- pending: se(c),
686
- values: o(() => {
687
- const f = {};
688
- for (const [B, y] of r) f[B] = y.getValue();
689
- return f;
690
- })
691
- }), (f, B) => (i(), p("form", {
692
- onSubmit: K(d, ["prevent"]),
693
- onReset: K(g, ["prevent"])
694
- }, [
695
- h(f.$slots, "default"),
696
- h(f.$slots, "errors", {
697
- errors: s.value,
698
- hasErrors: u.value
699
- }),
700
- h(f.$slots, "actions", {
701
- submit: d,
702
- reset: g,
703
- pending: c.value
704
- })
705
- ], 32));
706
- }
707
- }), we = ["value", "name", "disabled"], ua = /* @__PURE__ */ b({
708
- __name: "LuTextarea",
709
- props: {
710
- modelValue: {},
711
- variant: {},
712
- name: {},
713
- error: {}
714
- },
715
- emits: ["update:modelValue", "blur"],
716
- setup(a, { emit: n }) {
717
- const e = a, l = n, { resolveSkin: t } = L(), r = o(() => t("LuTextarea", e.variant)), s = I(N, null), c = M(e.modelValue), u = (d) => {
718
- const g = d.target.value;
719
- c.value = g, l("update:modelValue", g);
720
- }, v = () => {
721
- e.name && s && (s.validateOn.value === "blur" || s.validateOn.value), l("blur");
722
- };
723
- return F(() => {
724
- !e.name || !s || s.register({
725
- name: e.name,
726
- getValue: () => c.value,
727
- setValue: (d) => {
728
- c.value = d;
729
- },
730
- setError: (d) => {
731
- }
732
- });
733
- }), G(() => {
734
- e.name && s && s.unregister(e.name);
735
- }), (d, g) => {
736
- var k;
737
- return i(), p("textarea", S(d.$attrs, {
738
- class: r.value,
739
- value: a.modelValue,
740
- name: a.name,
741
- disabled: (k = R(s)) == null ? void 0 : k.disabled.value,
742
- onInput: u,
743
- onBlur: v
744
- }), null, 16, we);
745
- };
746
- }
747
- }), Ae = ["checked", "name", "disabled"], ca = /* @__PURE__ */ b({
748
- __name: "LuCheckbox",
749
- props: {
750
- modelValue: { type: Boolean },
751
- variant: {},
752
- name: {},
753
- label: {},
754
- error: {}
755
- },
756
- emits: ["update:modelValue", "change", "blur"],
757
- setup(a, { emit: n }) {
758
- const e = a, l = n, { resolveSkin: t } = L(), r = o(() => t("LuCheckboxContainer", e.variant)), s = o(() => t("LuCheckbox", e.variant)), c = o(() => t("LuCheckboxLabel", e.variant)), u = I(N, null), v = M(!!e.modelValue);
759
- D(() => e.modelValue, (f) => {
760
- v.value = !!f;
761
- });
762
- const d = (f) => {
763
- const y = f.target.checked;
764
- v.value = y, l("update:modelValue", y), l("change", y), e.name && u && (u.validateOn.value === "blur" || u.validateOn.value);
765
- }, g = () => {
766
- if (u != null && u.disabled.value || "disabled" in e && e.disabled !== !1) return;
767
- const f = !v.value;
768
- v.value = f, l("update:modelValue", f), l("change", f), e.name && u && (u.validateOn.value === "blur" || u.validateOn.value);
769
- }, k = () => {
770
- e.name && u && (u.validateOn.value === "blur" || u.validateOn.value), l("blur");
771
- };
772
- return F(() => {
773
- !e.name || !u || u.register({
774
- name: e.name,
775
- getValue: () => v.value,
776
- setValue: (f) => {
777
- v.value = !!f;
778
- },
779
- setError: (f) => {
780
- }
781
- });
782
- }), G(() => {
783
- e.name && u && u.unregister(e.name);
784
- }), (f, B) => {
785
- var y;
786
- return i(), p("div", {
787
- class: m(r.value)
788
- }, [
789
- C("input", S({ type: "checkbox" }, f.$attrs, {
790
- class: s.value,
791
- checked: a.modelValue,
792
- name: a.name,
793
- disabled: (y = R(u)) == null ? void 0 : y.disabled.value,
794
- onChange: d,
795
- onBlur: k
796
- }), null, 16, Ae),
797
- f.$slots.default || a.label ? (i(), p("label", {
798
- key: 0,
799
- class: m(c.value),
800
- onClick: K(g, ["prevent"])
801
- }, [
802
- h(f.$slots, "default", {}, () => [
803
- P(O(a.label), 1)
804
- ])
805
- ], 2)) : _("", !0)
806
- ], 2);
807
- };
808
- }
809
- }), ve = Symbol("LuRadioGroupContext"), Me = ["aria-disabled"], va = /* @__PURE__ */ b({
810
- __name: "LuRadioGroup",
811
- props: {
812
- modelValue: {},
813
- name: {},
814
- variant: {},
815
- disabled: { type: Boolean }
816
- },
817
- emits: ["update:modelValue", "change"],
818
- setup(a, { emit: n }) {
819
- const e = a, l = n, { resolveSkin: t } = L(), r = o(() => t("LuRadioGroup", e.variant)), s = I(N, null), c = M(e.modelValue);
820
- D(() => e.modelValue, (v) => {
821
- c.value = v;
822
- });
823
- const u = (v) => {
824
- e.disabled || s != null && s.disabled.value || (c.value = v, l("update:modelValue", v), l("change", v), e.name && s && (s.validateOn.value === "blur" || s.validateOn.value));
825
- };
826
- return Q(ve, {
827
- name: e.name,
828
- modelValue: o(() => c.value),
829
- updateValue: u,
830
- disabled: o(() => !!e.disabled || !!(s != null && s.disabled.value))
831
- }), F(() => {
832
- !e.name || !s || s.register({
833
- name: e.name,
834
- getValue: () => c.value,
835
- setValue: (v) => {
836
- c.value = v;
837
- },
838
- setError: (v) => {
839
- }
840
- });
841
- }), G(() => {
842
- e.name && s && s.unregister(e.name);
843
- }), (v, d) => {
844
- var g;
845
- return i(), p("div", {
846
- class: m(r.value),
847
- role: "radiogroup",
848
- "aria-disabled": a.disabled || ((g = R(s)) == null ? void 0 : g.disabled.value)
849
- }, [
850
- h(v.$slots, "default")
851
- ], 10, Me);
852
- };
853
- }
854
- }), Oe = ["name", "value", "checked", "disabled"], da = /* @__PURE__ */ b({
855
- __name: "LuRadio",
856
- props: {
857
- value: {},
858
- variant: {},
859
- label: {},
860
- disabled: { type: Boolean }
861
- },
862
- setup(a) {
863
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuRadioContainer", n.variant)), t = o(() => e("LuRadio", n.variant)), r = o(() => e("LuRadioLabel", n.variant)), s = I(ve, null);
864
- s || console.warn("LuRadio must be used within a LuRadioGroup");
865
- const c = o(() => (s == null ? void 0 : s.modelValue.value) === n.value), u = () => {
866
- n.disabled || s != null && s.disabled.value || s == null || s.updateValue(n.value);
867
- }, v = () => {
868
- n.disabled || s != null && s.disabled.value || s == null || s.updateValue(n.value);
869
- };
870
- return (d, g) => {
871
- var k, f;
872
- return i(), p("div", {
873
- class: m(l.value)
874
- }, [
875
- C("input", S({ type: "radio" }, d.$attrs, {
876
- class: t.value,
877
- name: (k = R(s)) == null ? void 0 : k.name,
878
- value: a.value,
879
- checked: c.value,
880
- disabled: ((f = R(s)) == null ? void 0 : f.disabled.value) || a.disabled,
881
- onChange: u
882
- }), null, 16, Oe),
883
- d.$slots.default || a.label ? (i(), p("label", {
884
- key: 0,
885
- class: m(r.value),
886
- onClick: K(v, ["prevent"])
887
- }, [
888
- h(d.$slots, "default", {}, () => [
889
- P(O(a.label), 1)
890
- ])
891
- ], 2)) : _("", !0)
892
- ], 2);
893
- };
894
- }
895
- }), ma = /* @__PURE__ */ b({
896
- __name: "LuAlert",
897
- props: {
898
- variant: {},
899
- icon: {}
900
- },
901
- setup(a) {
902
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuAlert", n.variant)), t = o(() => e("LuAlertIcon", n.variant)), r = o(() => e("LuAlertContent", n.variant)), s = o(() => e("LuAlertAction", n.variant));
903
- return (c, u) => (i(), p("div", {
904
- class: m(l.value),
905
- role: "alert"
906
- }, [
907
- c.$slots.icon || a.icon ? (i(), p("div", {
908
- key: 0,
909
- class: m(t.value)
910
- }, [
911
- h(c.$slots, "icon", {}, () => [
912
- a.icon ? (i(), w(E, {
913
- key: 0,
914
- name: a.icon
915
- }, null, 8, ["name"])) : _("", !0)
916
- ])
917
- ], 2)) : _("", !0),
918
- C("div", {
919
- class: m(r.value)
920
- }, [
921
- h(c.$slots, "default")
922
- ], 2),
923
- c.$slots.action ? (i(), p("div", {
924
- key: 1,
925
- class: m(s.value)
926
- }, [
927
- h(c.$slots, "action")
928
- ], 2)) : _("", !0)
929
- ], 2));
930
- }
931
- }), pa = /* @__PURE__ */ b({
932
- __name: "LuSpinner",
933
- props: {
934
- variant: {}
935
- },
936
- setup(a) {
937
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuSpinner", n.variant));
938
- return (t, r) => (i(), p("svg", {
939
- class: m(l.value),
940
- xmlns: "http://www.w3.org/2000/svg",
941
- fill: "none",
942
- viewBox: "0 0 24 24",
943
- role: "status",
944
- "aria-label": "Loading"
945
- }, [...r[0] || (r[0] = [
946
- C("circle", {
947
- class: "opacity-25",
948
- cx: "12",
949
- cy: "12",
950
- r: "10",
951
- stroke: "currentColor",
952
- "stroke-width": "4"
953
- }, null, -1),
954
- C("path", {
955
- class: "opacity-75",
956
- fill: "currentColor",
957
- d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
958
- }, null, -1)
959
- ])], 2));
960
- }
961
- }), fa = /* @__PURE__ */ b({
962
- __name: "LuSkeleton",
963
- props: {
964
- variant: {}
965
- },
966
- setup(a) {
967
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuSkeleton", n.variant));
968
- return (t, r) => (i(), p("div", {
969
- class: m(l.value),
970
- "aria-hidden": "true"
971
- }, null, 2));
972
- }
973
- }), ka = /* @__PURE__ */ b({
974
- __name: "LuTag",
975
- props: {
976
- variant: {},
977
- closable: { type: Boolean }
978
- },
979
- emits: ["close"],
980
- setup(a, { emit: n }) {
981
- const e = a, l = n, { resolveSkin: t } = L(), r = o(() => t("LuTag", e.variant)), s = o(() => t("LuTagCloseButton", e.variant)), c = o(() => t("LuTagIcon", e.variant));
982
- return (u, v) => (i(), p("span", {
983
- class: m(r.value)
984
- }, [
985
- h(u.$slots, "default"),
986
- a.closable ? (i(), w(H, {
987
- key: 0,
988
- variant: "icon",
989
- class: m(s.value),
990
- onClick: v[0] || (v[0] = K((d) => l("close"), ["stop"])),
991
- "aria-label": "Remove"
992
- }, {
993
- default: V(() => [
994
- T(E, {
995
- name: "x",
996
- class: m(c.value)
997
- }, null, 8, ["class"])
998
- ]),
999
- _: 1
1000
- }, 8, ["class"])) : _("", !0)
1001
- ], 2));
1002
- }
1003
- }), Pe = { "aria-label": "breadcrumb" }, Ee = ["aria-current"], ba = /* @__PURE__ */ b({
1004
- __name: "LuBreadcrumb",
1005
- props: {
1006
- items: {},
1007
- variant: {},
1008
- separatorIcon: { default: "chevron-right" }
1009
- },
1010
- setup(a) {
1011
- const n = a, { resolveSkin: e } = L(), l = o(() => e("LuBreadcrumb", n.variant)), t = o(() => e("LuBreadcrumbItem", n.variant)), r = o(() => e("LuBreadcrumbLink", n.variant)), s = o(() => e("LuBreadcrumbPage", n.variant)), c = o(() => e("LuBreadcrumbSeparator", n.variant));
1012
- return (u, v) => (i(), p("nav", Pe, [
1013
- C("ol", {
1014
- class: m(l.value)
1015
- }, [
1016
- (i(!0), p(J, null, te(a.items, (d, g) => (i(), p("li", {
1017
- key: g,
1018
- class: m(t.value)
1019
- }, [
1020
- d.href || d.to ? (i(), w(Be, {
1021
- key: 0,
1022
- href: d.href,
1023
- to: d.to,
1024
- variant: d.current ? "nav-active" : "nav",
1025
- "aria-current": d.current ? "page" : void 0,
1026
- class: m(r.value)
1027
- }, {
1028
- default: V(() => [
1029
- d.icon ? (i(), w(E, {
1030
- key: 0,
1031
- name: d.icon,
1032
- class: "mr-2 h-4 w-4"
1033
- }, null, 8, ["name"])) : _("", !0),
1034
- P(" " + O(d.label), 1)
1035
- ]),
1036
- _: 2
1037
- }, 1032, ["href", "to", "variant", "aria-current", "class"])) : (i(), p("span", {
1038
- key: 1,
1039
- class: m(s.value),
1040
- "aria-current": d.current ? "page" : void 0
1041
- }, [
1042
- d.icon ? (i(), w(E, {
1043
- key: 0,
1044
- name: d.icon,
1045
- class: "mr-2 h-4 w-4"
1046
- }, null, 8, ["name"])) : _("", !0),
1047
- P(" " + O(d.label), 1)
1048
- ], 10, Ee)),
1049
- g < a.items.length - 1 ? (i(), w(E, {
1050
- key: 2,
1051
- name: a.separatorIcon,
1052
- class: m(c.value)
1053
- }, null, 8, ["name", "class"])) : _("", !0)
1054
- ], 2))), 128))
1055
- ], 2)
1056
- ]));
1057
- }
1058
- }), Ie = ["aria-expanded"], ga = /* @__PURE__ */ b({
1059
- __name: "LuMenu",
1060
- props: {
1061
- variant: {},
1062
- align: { default: "left" }
1063
- },
1064
- emits: ["open", "close"],
1065
- setup(a, { emit: n }) {
1066
- const e = a, l = n, t = M(!1), r = M(null), { resolveSkin: s } = L(), c = o(() => s("LuMenu", e.variant)), u = o(() => s("LuMenuTrigger", e.variant)), v = o(() => s("LuMenuContent", e.variant)), d = o(() => s("LuMenuGroup", e.variant)), g = o(() => e.align === "right" ? "right-0 origin-top-right" : "left-0 origin-top-left"), k = () => {
1067
- t.value = !t.value, t.value ? l("open") : l("close");
1068
- }, f = () => {
1069
- t.value && (t.value = !1, l("close"));
1070
- }, B = (y) => {
1071
- r.value && !r.value.contains(y.target) && f();
1072
- };
1073
- return F(() => {
1074
- document.addEventListener("click", B);
1075
- }), ue(() => {
1076
- document.removeEventListener("click", B);
1077
- }), (y, $) => (i(), p("div", {
1078
- class: m(c.value),
1079
- ref_key: "dropdownRef",
1080
- ref: r
1081
- }, [
1082
- C("div", {
1083
- onClick: k,
1084
- class: m(u.value),
1085
- "aria-haspopup": "true",
1086
- "aria-expanded": t.value
1087
- }, [
1088
- h(y.$slots, "trigger", {}, () => [
1089
- T(H, { variant: "default" }, {
1090
- default: V(() => [
1091
- $[0] || ($[0] = P("Options ", -1)),
1092
- T(E, {
1093
- name: "chevron-down",
1094
- class: "ml-2 h-4 w-4"
1095
- })
1096
- ]),
1097
- _: 1
1098
- })
1099
- ])
1100
- ], 10, Ie),
1101
- T(x, {
1102
- "enter-active-class": "transition ease-out duration-100",
1103
- "enter-from-class": "transform opacity-0 scale-95",
1104
- "enter-to-class": "transform opacity-100 scale-100",
1105
- "leave-active-class": "transition ease-in duration-75",
1106
- "leave-from-class": "transform opacity-100 scale-100",
1107
- "leave-to-class": "transform opacity-0 scale-95"
1108
- }, {
1109
- default: V(() => [
1110
- t.value ? (i(), p("div", {
1111
- key: 0,
1112
- class: m([v.value, g.value])
1113
- }, [
1114
- C("div", {
1115
- class: m(d.value),
1116
- role: "menu",
1117
- "aria-orientation": "vertical",
1118
- "aria-labelledby": "options-menu"
1119
- }, [
1120
- h(y.$slots, "default")
1121
- ], 2)
1122
- ], 2)) : _("", !0)
1123
- ]),
1124
- _: 3
1125
- })
1126
- ], 2));
1127
- }
1128
- }), Re = ["disabled", "data-disabled"], ha = /* @__PURE__ */ b({
1129
- __name: "LuMenuItem",
1130
- props: {
1131
- variant: {},
1132
- disabled: { type: Boolean }
1133
- },
1134
- emits: ["click"],
1135
- setup(a, { emit: n }) {
1136
- const e = a, l = n, { resolveSkin: t } = L(), r = o(() => t("LuMenuItem", e.variant)), s = (c) => {
1137
- if (e.disabled) {
1138
- c.preventDefault();
1139
- return;
1140
- }
1141
- l("click", c);
1142
- };
1143
- return (c, u) => (i(), p("button", {
1144
- type: "button",
1145
- class: m(r.value),
1146
- role: "menuitem",
1147
- disabled: a.disabled,
1148
- "data-disabled": a.disabled ? "" : void 0,
1149
- onClick: s
1150
- }, [
1151
- h(c.$slots, "default")
1152
- ], 10, Re));
1153
- }
1154
- }), La = /* @__PURE__ */ b({
1155
- __name: "LuPagination",
1156
- props: {
1157
- modelValue: {},
1158
- total: {},
1159
- pageSize: { default: 10 },
1160
- siblingCount: { default: 1 },
1161
- variant: {}
1162
- },
1163
- emits: ["update:modelValue", "change"],
1164
- setup(a, { emit: n }) {
1165
- const e = a, l = n, t = o(() => Math.ceil(e.total / e.pageSize)), r = o(() => {
1166
- const y = e.modelValue, $ = t.value, A = e.siblingCount;
1167
- if ($ <= 1) return [1];
1168
- const j = Math.max(y - A, 1), Y = Math.min(y + A, $), q = j > 2, z = Y < $ - 1;
1169
- if (!q && z) {
1170
- const U = 3 + 2 * A;
1171
- return [...Array.from({ length: Math.min(U, $) }, (ee, ae) => ae + 1), "...", $];
1172
- }
1173
- if (q && !z) {
1174
- const U = 3 + 2 * A;
1175
- return [1, "...", ...Array.from({ length: Math.min(U, $) }, (ee, ae) => $ - U + ae + 1)];
1176
- }
1177
- return q && z ? [1, "...", ...Array.from({ length: Y - j + 1 }, (Z, ee) => j + ee), "...", $] : Array.from({ length: $ }, (U, Z) => Z + 1);
1178
- }), { resolveSkin: s } = L(), c = o(() => s("LuPagination", e.variant)), u = o(() => s("LuPaginationButton", e.variant)), v = o(() => s("LuPaginationPages", e.variant)), d = o(() => s("LuPaginationPageButton", e.variant)), g = o(() => s("LuPaginationEllipsis", e.variant)), k = (y) => {
1179
- y !== e.modelValue && (l("update:modelValue", y), l("change", y));
1180
- }, f = () => {
1181
- e.modelValue > 1 && k(e.modelValue - 1);
1182
- }, B = () => {
1183
- e.modelValue < t.value && k(e.modelValue + 1);
1184
- };
1185
- return (y, $) => (i(), p("nav", {
1186
- "aria-label": "Pagination",
1187
- class: m(c.value)
1188
- }, [
1189
- T(H, {
1190
- variant: "ghost",
1191
- disabled: a.modelValue <= 1,
1192
- onClick: f,
1193
- class: m(u.value),
1194
- "aria-label": "Previous page"
1195
- }, {
1196
- default: V(() => [
1197
- T(E, {
1198
- name: "chevron-left",
1199
- class: "h-4 w-4"
1200
- })
1201
- ]),
1202
- _: 1
1203
- }, 8, ["disabled", "class"]),
1204
- C("div", {
1205
- class: m(v.value)
1206
- }, [
1207
- (i(!0), p(J, null, te(r.value, (A) => (i(), p(J, { key: A }, [
1208
- A === "..." ? (i(), p("span", {
1209
- key: 0,
1210
- class: m(g.value)
1211
- }, "...", 2)) : (i(), w(H, {
1212
- key: 1,
1213
- variant: A === a.modelValue ? "primary" : "ghost",
1214
- onClick: (j) => k(A),
1215
- class: m(d.value),
1216
- "aria-current": A === a.modelValue ? "page" : void 0
1217
- }, {
1218
- default: V(() => [
1219
- P(O(A), 1)
1220
- ]),
1221
- _: 2
1222
- }, 1032, ["variant", "onClick", "class", "aria-current"]))
1223
- ], 64))), 128))
1224
- ], 2),
1225
- T(H, {
1226
- variant: "ghost",
1227
- disabled: a.modelValue >= t.value,
1228
- onClick: B,
1229
- class: m(u.value),
1230
- "aria-label": "Next page"
1231
- }, {
1232
- default: V(() => [
1233
- T(E, {
1234
- name: "chevron-right",
1235
- class: "h-4 w-4"
1236
- })
1237
- ]),
1238
- _: 1
1239
- }, 8, ["disabled", "class"])
1240
- ], 2));
1241
- }
1242
- }), ya = /* @__PURE__ */ b({
1243
- __name: "LuModal",
1244
- props: {
1245
- modelValue: { type: Boolean },
1246
- title: {},
1247
- variant: {},
1248
- closable: { type: Boolean, default: !0 },
1249
- closeOnOverlayClick: { type: Boolean, default: !0 }
1250
- },
1251
- emits: ["update:modelValue", "close"],
1252
- setup(a, { emit: n }) {
1253
- const e = a, l = n, { resolveSkin: t } = L(), r = o(() => t("LuModalOverlay", e.variant)), s = o(() => t("LuModal", e.variant)), c = o(() => t("LuModalHeader", e.variant)), u = o(() => t("LuModalContent", e.variant)), v = o(() => t("LuModalFooter", e.variant)), d = o(() => t("LuModalCloseButton", e.variant)), g = o(() => ({
1254
- enterActive: t("LuModalTransitionOverlay", "enterActive"),
1255
- enterFrom: t("LuModalTransitionOverlay", "enterFrom"),
1256
- enterTo: t("LuModalTransitionOverlay", "enterTo"),
1257
- leaveActive: t("LuModalTransitionOverlay", "leaveActive"),
1258
- leaveFrom: t("LuModalTransitionOverlay", "leaveFrom"),
1259
- leaveTo: t("LuModalTransitionOverlay", "leaveTo")
1260
- })), k = o(() => ({
1261
- enterActive: t("LuModalTransitionContent", "enterActive"),
1262
- enterFrom: t("LuModalTransitionContent", "enterFrom"),
1263
- enterTo: t("LuModalTransitionContent", "enterTo"),
1264
- leaveActive: t("LuModalTransitionContent", "leaveActive"),
1265
- leaveFrom: t("LuModalTransitionContent", "leaveFrom"),
1266
- leaveTo: t("LuModalTransitionContent", "leaveTo")
1267
- })), f = () => {
1268
- e.closable && (l("update:modelValue", !1), l("close"));
1269
- }, B = () => {
1270
- e.closeOnOverlayClick && f();
1271
- }, y = ($) => {
1272
- $.key === "Escape" && e.modelValue && f();
1273
- };
1274
- return D(() => e.modelValue, ($) => {
1275
- typeof document < "u" && ($ ? document.body.style.overflow = "hidden" : document.body.style.overflow = "");
1276
- }, { immediate: !0 }), F(() => {
1277
- document.addEventListener("keydown", y);
1278
- }), ue(() => {
1279
- document.removeEventListener("keydown", y), typeof document < "u" && (document.body.style.overflow = "");
1280
- }), ($, A) => (i(), w(pe, { to: "body" }, [
1281
- T(x, {
1282
- "enter-active-class": g.value.enterActive,
1283
- "enter-from-class": g.value.enterFrom,
1284
- "enter-to-class": g.value.enterTo,
1285
- "leave-active-class": g.value.leaveActive,
1286
- "leave-from-class": g.value.leaveFrom,
1287
- "leave-to-class": g.value.leaveTo
1288
- }, {
1289
- default: V(() => [
1290
- a.modelValue ? (i(), p("div", {
1291
- key: 0,
1292
- class: m(r.value),
1293
- onClick: B,
1294
- "aria-modal": "true",
1295
- role: "dialog",
1296
- tabindex: "-1"
1297
- }, [
1298
- T(x, {
1299
- "enter-active-class": k.value.enterActive,
1300
- "enter-from-class": k.value.enterFrom,
1301
- "enter-to-class": k.value.enterTo,
1302
- "leave-active-class": k.value.leaveActive,
1303
- "leave-from-class": k.value.leaveFrom,
1304
- "leave-to-class": k.value.leaveTo,
1305
- appear: ""
1306
- }, {
1307
- default: V(() => [
1308
- a.modelValue ? (i(), p("div", {
1309
- key: 0,
1310
- class: m(s.value),
1311
- onClick: A[0] || (A[0] = K(() => {
1312
- }, ["stop"]))
1313
- }, [
1314
- $.$slots.header || a.title ? (i(), p("div", {
1315
- key: 0,
1316
- class: m(c.value)
1317
- }, [
1318
- h($.$slots, "header", {}, () => [
1319
- T(X, { variant: "section-title" }, {
1320
- default: V(() => [
1321
- P(O(a.title), 1)
1322
- ]),
1323
- _: 1
1324
- })
1325
- ]),
1326
- a.closable ? (i(), w(H, {
1327
- key: 0,
1328
- variant: "icon",
1329
- class: m(d.value),
1330
- onClick: f,
1331
- "aria-label": "Close modal"
1332
- }, {
1333
- default: V(() => [
1334
- T(E, {
1335
- name: "x",
1336
- class: "h-5 w-5"
1337
- })
1338
- ]),
1339
- _: 1
1340
- }, 8, ["class"])) : _("", !0)
1341
- ], 2)) : _("", !0),
1342
- C("div", {
1343
- class: m(u.value)
1344
- }, [
1345
- h($.$slots, "default")
1346
- ], 2),
1347
- $.$slots.footer ? (i(), p("div", {
1348
- key: 1,
1349
- class: m(v.value)
1350
- }, [
1351
- h($.$slots, "footer")
1352
- ], 2)) : _("", !0)
1353
- ], 2)) : _("", !0)
1354
- ]),
1355
- _: 3
1356
- }, 8, ["enter-active-class", "enter-from-class", "enter-to-class", "leave-active-class", "leave-from-class", "leave-to-class"])
1357
- ], 2)) : _("", !0)
1358
- ]),
1359
- _: 3
1360
- }, 8, ["enter-active-class", "enter-from-class", "enter-to-class", "leave-active-class", "leave-from-class", "leave-to-class"])
1361
- ]));
1362
- }
1363
- }), Sa = /* @__PURE__ */ b({
1364
- __name: "LuToggleGroup",
1365
- props: {
1366
- modelValue: { type: [String, Number, Boolean] },
1367
- variant: {}
1368
- },
1369
- emits: ["update:modelValue"],
1370
- setup(a, { emit: n }) {
1371
- const e = a, l = n;
1372
- Q("lu-toggle-value", o(() => e.modelValue)), Q("lu-toggle-set", (s) => {
1373
- l("update:modelValue", s);
1374
- });
1375
- const { resolveSkin: t } = L(), r = o(() => t("LuToggleGroup", e.variant));
1376
- return (s, c) => (i(), p("div", S(s.$attrs, {
1377
- class: r.value,
1378
- role: "group"
1379
- }), [
1380
- h(s.$slots, "default")
1381
- ], 16));
1382
- }
1383
- }), He = ["aria-pressed"], $a = /* @__PURE__ */ b({
1384
- __name: "LuToggleButton",
1385
- props: {
1386
- value: { type: [String, Number, Boolean] },
1387
- variant: {}
1388
- },
1389
- setup(a) {
1390
- const n = a, e = I("lu-toggle-value"), l = I("lu-toggle-set"), t = o(() => (e == null ? void 0 : e.value) === n.value), r = () => {
1391
- l && l(n.value);
1392
- }, { resolveSkin: s } = L(), c = o(() => s("LuToggleButton", n.variant)), u = o(() => {
1393
- const v = n.variant ? `${n.variant}-active` : "active";
1394
- return s("LuToggleButton", v) || s("LuToggleButton", "active");
1395
- });
1396
- return (v, d) => (i(), p("button", S(v.$attrs, {
1397
- class: [c.value, t.value ? u.value : ""],
1398
- onClick: r,
1399
- "aria-pressed": t.value
1400
- }), [
1401
- h(v.$slots, "default")
1402
- ], 16, He));
1403
- }
1404
- }), Fe = ["innerHTML"], ze = ["innerHTML"], De = ["innerHTML"], Ca = /* @__PURE__ */ b({
1405
- __name: "LuCodeBlock",
1406
- props: {
1407
- code: {},
1408
- lang: { default: "vue" },
1409
- variant: { default: "default" },
1410
- layout: { default: "tabbed" },
1411
- title: {},
1412
- description: {}
1413
- },
1414
- setup(a) {
1415
- const n = a, { resolveSkin: e } = L(), l = o(() => ({
1416
- wrapper: e("LuCodeBlockWrapper", n.variant),
1417
- header: e("LuCodeBlockHeader", n.variant),
1418
- title: e("LuCodeBlockTitle", n.variant),
1419
- description: e("LuCodeBlockDescription", n.variant),
1420
- card: e("LuCodeBlockCard", n.variant),
1421
- previewArea: e("LuCodeBlockPreviewArea", n.variant),
1422
- codeArea: e("LuCodeBlockCodeArea", n.variant),
1423
- splitCodeArea: e("LuCodeBlockSplitArea", n.variant),
1424
- splitContainer: e("LuCodeBlockSplitContainer", n.variant),
1425
- codeHeader: e("LuCodeBlockCodeHeader", n.variant),
1426
- badge: e("LuCodeBlockBadge", n.variant),
1427
- copyButton: e("LuCodeBlockCopyButton", n.variant),
1428
- codeContent: e("LuCodeBlockCodeContent", n.variant)
1429
- })), t = M(""), r = M("preview"), s = M(!1), c = async () => {
1430
- if (!n.code) {
1431
- t.value = "";
1432
- return;
1433
- }
1434
- try {
1435
- const v = await fe();
1436
- t.value = v.codeToHtml(n.code, {
1437
- lang: n.lang || "vue",
1438
- theme: "one-dark-pro"
1439
- });
1440
- } catch (v) {
1441
- console.error("Failed to highlight code", v), t.value = `<pre><code>${n.code.replace(/</g, "&lt;").replace(/>/g, "&gt;")}</code></pre>`;
1442
- }
1443
- };
1444
- F(() => {
1445
- c();
1446
- }), D(() => [n.code, n.lang], () => {
1447
- c();
1448
- });
1449
- const u = async () => {
1450
- try {
1451
- await navigator.clipboard.writeText(n.code), s.value = !0, setTimeout(() => s.value = !1, 2e3);
1452
- } catch (v) {
1453
- console.error("Failed to copy", v);
1454
- }
1455
- };
1456
- return (v, d) => (i(), p("div", S(v.$attrs, {
1457
- class: l.value.wrapper
1458
- }), [
1459
- a.title || a.description ? (i(), p("div", {
1460
- key: 0,
1461
- class: m(l.value.header)
1462
- }, [
1463
- a.title ? (i(), w(X, {
1464
- key: 0,
1465
- variant: "section-title",
1466
- class: m(l.value.title)
1467
- }, {
1468
- default: V(() => [
1469
- P(O(a.title), 1)
1470
- ]),
1471
- _: 1
1472
- }, 8, ["class"])) : _("", !0),
1473
- a.description ? (i(), w(X, {
1474
- key: 1,
1475
- variant: "body",
1476
- class: m(l.value.description)
1477
- }, {
1478
- default: V(() => [
1479
- P(O(a.description), 1)
1480
- ]),
1481
- _: 1
1482
- }, 8, ["class"])) : _("", !0)
1483
- ], 2)) : _("", !0),
1484
- a.variant === "preview" ? (i(), p("div", {
1485
- key: 1,
1486
- class: m(l.value.card)
1487
- }, [
1488
- a.layout === "tabbed" ? (i(), p(J, { key: 0 }, [
1489
- T(Ce, {
1490
- modelValue: r.value,
1491
- "onUpdate:modelValue": d[0] || (d[0] = (g) => r.value = g),
1492
- variant: "default"
1493
- }, {
1494
- default: V(() => [
1495
- T(Ve, { variant: "card-header" }, {
1496
- default: V(() => [
1497
- T(re, { value: "preview" }, {
1498
- default: V(() => [...d[1] || (d[1] = [
1499
- P("Preview", -1)
1500
- ])]),
1501
- _: 1
1502
- }),
1503
- T(re, { value: "code" }, {
1504
- default: V(() => [...d[2] || (d[2] = [
1505
- P("Code", -1)
1506
- ])]),
1507
- _: 1
1508
- })
1509
- ]),
1510
- _: 1
1511
- })
1512
- ]),
1513
- _: 1
1514
- }, 8, ["modelValue"]),
1515
- r.value === "preview" ? (i(), p("div", {
1516
- key: 0,
1517
- class: m(l.value.previewArea)
1518
- }, [
1519
- h(v.$slots, "preview")
1520
- ], 2)) : _("", !0),
1521
- r.value === "code" ? (i(), p("div", {
1522
- key: 1,
1523
- class: m(l.value.codeArea)
1524
- }, [
1525
- C("div", {
1526
- class: m(l.value.codeHeader)
1527
- }, [
1528
- C("div", {
1529
- class: m(l.value.badge)
1530
- }, O(a.lang), 3),
1531
- T(H, {
1532
- onClick: u,
1533
- variant: "icon",
1534
- class: m(l.value.copyButton),
1535
- "aria-label": "Copy code"
1536
- }, {
1537
- default: V(() => [
1538
- T(E, {
1539
- name: s.value ? "check" : "copy",
1540
- class: "w-4 h-4"
1541
- }, null, 8, ["name"])
1542
- ]),
1543
- _: 1
1544
- }, 8, ["class"])
1545
- ], 2),
1546
- C("div", {
1547
- class: m(l.value.codeContent),
1548
- innerHTML: t.value
1549
- }, null, 10, Fe)
1550
- ], 2)) : _("", !0)
1551
- ], 64)) : a.layout === "split" ? (i(), p("div", {
1552
- key: 1,
1553
- class: m(l.value.splitContainer)
1554
- }, [
1555
- C("div", {
1556
- class: m(l.value.previewArea)
1557
- }, [
1558
- h(v.$slots, "preview")
1559
- ], 2),
1560
- C("div", {
1561
- class: m(l.value.splitCodeArea)
1562
- }, [
1563
- C("div", {
1564
- class: m(l.value.codeHeader)
1565
- }, [
1566
- C("div", {
1567
- class: m(l.value.badge)
1568
- }, O(a.lang), 3),
1569
- T(H, {
1570
- onClick: u,
1571
- variant: "icon",
1572
- class: m(l.value.copyButton),
1573
- "aria-label": "Copy code"
1574
- }, {
1575
- default: V(() => [
1576
- T(E, {
1577
- name: s.value ? "check" : "copy",
1578
- class: "w-4 h-4"
1579
- }, null, 8, ["name"])
1580
- ]),
1581
- _: 1
1582
- }, 8, ["class"])
1583
- ], 2),
1584
- C("div", {
1585
- class: m(l.value.codeContent),
1586
- innerHTML: t.value
1587
- }, null, 10, ze)
1588
- ], 2)
1589
- ], 2)) : _("", !0)
1590
- ], 2)) : (i(), p("div", {
1591
- key: 2,
1592
- class: m(l.value.card)
1593
- }, [
1594
- C("div", {
1595
- class: m(l.value.codeArea)
1596
- }, [
1597
- C("div", {
1598
- class: m(l.value.codeHeader)
1599
- }, [
1600
- C("div", {
1601
- class: m(l.value.badge)
1602
- }, O(a.lang), 3),
1603
- T(H, {
1604
- onClick: u,
1605
- variant: "icon",
1606
- class: m(l.value.copyButton),
1607
- "aria-label": "Copy code"
1608
- }, {
1609
- default: V(() => [
1610
- T(E, {
1611
- name: s.value ? "check" : "copy",
1612
- class: "w-4 h-4"
1613
- }, null, 8, ["name"])
1614
- ]),
1615
- _: 1
1616
- }, 8, ["class"])
1617
- ], 2),
1618
- C("div", {
1619
- class: m(l.value.codeContent),
1620
- innerHTML: t.value
1621
- }, null, 10, De)
1622
- ], 2)
1623
- ], 2))
1624
- ], 16));
1625
- }
1626
- });
1627
- export {
1628
- Ve as A,
1629
- qe as B,
1630
- ta as C,
1631
- la as D,
1632
- ra as E,
1633
- na as F,
1634
- oa as G,
1635
- sa as H,
1636
- Ce as I,
1637
- ka as J,
1638
- X as K,
1639
- ua as L,
1640
- Ge as M,
1641
- We as N,
1642
- $a as O,
1643
- Sa as P,
1644
- Xe as Q,
1645
- ma as _,
1646
- Ze as a,
1647
- Je as b,
1648
- ba as c,
1649
- H as d,
1650
- aa as e,
1651
- ca as f,
1652
- Ca as g,
1653
- Ye as h,
1654
- xe as i,
1655
- ia as j,
1656
- E as k,
1657
- Ke as l,
1658
- Be as m,
1659
- ga as n,
1660
- ha as o,
1661
- ya as p,
1662
- ea as q,
1663
- La as r,
1664
- Qe as s,
1665
- da as t,
1666
- va as u,
1667
- $e as v,
1668
- fa as w,
1669
- pa as x,
1670
- Le as y,
1671
- re as z
1672
- };