@robuust-digital/vue-components 1.3.1 → 2.0.0-rc.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 (73) hide show
  1. package/README.md +47 -52
  2. package/dist/_shared/ButtonBase-CQjlJ85F.js +87 -0
  3. package/dist/_shared/ChevronDownIcon-z-5U4fIb.js +55 -0
  4. package/dist/_shared/FormInput-abFMz_J4.js +82 -0
  5. package/dist/_shared/Modal-COVlUEud.js +193 -0
  6. package/dist/_shared/Tooltip-BKXJoJ1x.js +126 -0
  7. package/dist/_shared/XMarkIcon-90mcPzBs.js +19 -0
  8. package/dist/_shared/icon-spinner-CmxIOqaK.js +26 -0
  9. package/dist/combobox/combobox.css +203 -0
  10. package/dist/combobox/index.js +349 -0
  11. package/dist/combobox/styles.css +1 -0
  12. package/dist/core/accordion.css +47 -0
  13. package/dist/core/alert.css +169 -0
  14. package/dist/core/badge.css +121 -0
  15. package/dist/core/button.css +393 -0
  16. package/dist/core/checkbox.css +60 -0
  17. package/dist/core/empty-state.css +56 -0
  18. package/dist/core/index.js +779 -0
  19. package/dist/core/input.css +92 -0
  20. package/dist/core/pagination.css +48 -0
  21. package/dist/core/radio.css +61 -0
  22. package/dist/core/select.css +81 -0
  23. package/dist/core/styles.css +92 -0
  24. package/dist/core/table.css +87 -0
  25. package/dist/core/tabs.css +74 -0
  26. package/dist/core/textarea.css +48 -0
  27. package/dist/core/theme.css +11 -0
  28. package/dist/dialogs/drawer.css +72 -0
  29. package/dist/dialogs/index.js +200 -0
  30. package/dist/dialogs/modal.css +98 -0
  31. package/dist/dialogs/styles.css +2 -0
  32. package/dist/dropdown/dropdown.css +89 -0
  33. package/dist/dropdown/index.js +136 -0
  34. package/dist/dropdown/styles.css +1 -0
  35. package/dist/lightswitch/index.js +48 -0
  36. package/dist/lightswitch/lightswitch.css +68 -0
  37. package/dist/lightswitch/styles.css +1 -0
  38. package/dist/rich-text-editor/index.js +262 -0
  39. package/dist/rich-text-editor/rich-text.css +83 -0
  40. package/dist/rich-text-editor/styles.css +1 -0
  41. package/dist/toast/index.js +100 -0
  42. package/dist/toast/styles.css +1 -0
  43. package/dist/toast/toast.css +187 -0
  44. package/dist/tooltip/index.js +5 -0
  45. package/dist/tooltip/styles.css +1 -0
  46. package/dist/tooltip/tooltip.css +69 -0
  47. package/package.json +55 -52
  48. package/dist/nuxt-module.js +0 -27
  49. package/dist/style.css +0 -1
  50. package/dist/tailwind/base/index.js +0 -72
  51. package/dist/tailwind/components/accordion.js +0 -59
  52. package/dist/tailwind/components/alert.js +0 -166
  53. package/dist/tailwind/components/badge.js +0 -119
  54. package/dist/tailwind/components/button.js +0 -292
  55. package/dist/tailwind/components/checkbox.js +0 -70
  56. package/dist/tailwind/components/combobox.js +0 -226
  57. package/dist/tailwind/components/drawer.js +0 -104
  58. package/dist/tailwind/components/dropdown.js +0 -97
  59. package/dist/tailwind/components/empty-state.js +0 -69
  60. package/dist/tailwind/components/input.js +0 -101
  61. package/dist/tailwind/components/lightswitch.js +0 -79
  62. package/dist/tailwind/components/modal.js +0 -132
  63. package/dist/tailwind/components/pagination.js +0 -62
  64. package/dist/tailwind/components/radio.js +0 -75
  65. package/dist/tailwind/components/rich-text.js +0 -100
  66. package/dist/tailwind/components/select.js +0 -88
  67. package/dist/tailwind/components/table.js +0 -109
  68. package/dist/tailwind/components/tabs.js +0 -95
  69. package/dist/tailwind/components/textarea.js +0 -53
  70. package/dist/tailwind/components/toast.js +0 -188
  71. package/dist/tailwind/components/tooltip.js +0 -74
  72. package/dist/tailwind/index.js +0 -94
  73. package/dist/vue-components.es.js +0 -2401
@@ -0,0 +1,779 @@
1
+ import { createElementBlock as l, openBlock as t, createElementVNode as o, Fragment as k, renderList as S, renderSlot as v, createTextVNode as A, toDisplayString as m, createVNode as V, unref as h, normalizeClass as p, createBlock as x, resolveDynamicComponent as B, withCtx as L, createCommentVNode as $, computed as C, useAttrs as F, withDirectives as M, mergeProps as b, vModelDynamic as N, normalizeProps as P, guardReactiveProps as H, vModelSelect as E, ref as q, vModelText as R } from "vue";
2
+ import { r as U } from "../_shared/XMarkIcon-90mcPzBs.js";
3
+ import { r as Z } from "../_shared/ChevronDownIcon-z-5U4fIb.js";
4
+ import { _ as Ze } from "../_shared/ChevronDownIcon-z-5U4fIb.js";
5
+ import { _ as Ge } from "../_shared/ButtonBase-CQjlJ85F.js";
6
+ import { u as j } from "../_shared/FormInput-abFMz_J4.js";
7
+ import { _ as Qe } from "../_shared/FormInput-abFMz_J4.js";
8
+ import { S as K } from "../_shared/icon-spinner-CmxIOqaK.js";
9
+ function G(e, r) {
10
+ return t(), l("svg", {
11
+ xmlns: "http://www.w3.org/2000/svg",
12
+ viewBox: "0 0 24 24",
13
+ fill: "currentColor",
14
+ "aria-hidden": "true",
15
+ "data-slot": "icon"
16
+ }, [
17
+ o("path", {
18
+ "fill-rule": "evenodd",
19
+ d: "M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z",
20
+ "clip-rule": "evenodd"
21
+ })
22
+ ]);
23
+ }
24
+ function J(e, r) {
25
+ return t(), l("svg", {
26
+ xmlns: "http://www.w3.org/2000/svg",
27
+ viewBox: "0 0 24 24",
28
+ fill: "currentColor",
29
+ "aria-hidden": "true",
30
+ "data-slot": "icon"
31
+ }, [
32
+ o("path", {
33
+ "fill-rule": "evenodd",
34
+ d: "M12 3.75a.75.75 0 0 1 .75.75v6.75h6.75a.75.75 0 0 1 0 1.5h-6.75v6.75a.75.75 0 0 1-1.5 0v-6.75H4.5a.75.75 0 0 1 0-1.5h6.75V4.5a.75.75 0 0 1 .75-.75Z",
35
+ "clip-rule": "evenodd"
36
+ })
37
+ ]);
38
+ }
39
+ const Q = { class: "rvc-accordion" }, W = ["open", "name"], X = ["innerHTML"], Ie = {
40
+ __name: "Accordion",
41
+ props: {
42
+ items: {
43
+ type: Array,
44
+ required: !0,
45
+ default: () => []
46
+ },
47
+ name: {
48
+ type: String,
49
+ default: void 0
50
+ },
51
+ defaultOpenIndex: {
52
+ type: Number,
53
+ default: 0
54
+ },
55
+ contentClass: {
56
+ type: String,
57
+ default: ""
58
+ }
59
+ },
60
+ setup(e) {
61
+ return (r, i) => (t(), l("div", Q, [
62
+ (t(!0), l(k, null, S(e.items, (c, s) => (t(), l("details", {
63
+ key: s,
64
+ open: e.defaultOpenIndex === s,
65
+ name: e.name,
66
+ class: "group/accordion"
67
+ }, [
68
+ o("summary", null, [
69
+ v(r.$slots, "summary", {
70
+ item: c,
71
+ active: e.defaultOpenIndex === s
72
+ }, () => [
73
+ A(m(c.title) + " ", 1),
74
+ v(r.$slots, "icon", { classList: "size-5 group-open/accordion:rotate-45 transition-transform" }, () => [
75
+ V(h(J), { class: "size-5 group-open/accordion:rotate-45 transition-transform" })
76
+ ])
77
+ ])
78
+ ]),
79
+ o("div", {
80
+ class: p(["rvc-accordion-content", e.contentClass])
81
+ }, [
82
+ v(r.$slots, "content", { item: c }, () => [
83
+ o("div", {
84
+ innerHTML: c.content
85
+ }, null, 8, X)
86
+ ])
87
+ ], 2)
88
+ ], 8, W))), 128))
89
+ ]));
90
+ }
91
+ }, Y = { class: "rvc-alert-title" }, ze = {
92
+ __name: "Alert",
93
+ props: {
94
+ as: {
95
+ type: String,
96
+ default: "div"
97
+ },
98
+ title: {
99
+ type: String,
100
+ default: ""
101
+ },
102
+ icon: {
103
+ type: [Object, Function],
104
+ default: null
105
+ },
106
+ type: {
107
+ type: String,
108
+ default: "info",
109
+ validator: (e) => ["success", "warning", "danger", "info"].includes(e)
110
+ },
111
+ close: {
112
+ type: Boolean,
113
+ default: !1
114
+ }
115
+ },
116
+ emits: ["alert:close"],
117
+ setup(e) {
118
+ return (r, i) => (t(), x(B(e.as), {
119
+ class: p(["rvc-alert", `rvc-alert-${e.type}`])
120
+ }, {
121
+ default: L(() => [
122
+ v(r.$slots, "icon", {}, () => [
123
+ e.icon ? (t(), x(B(e.icon), {
124
+ key: 0,
125
+ class: "rvc-alert-icon"
126
+ })) : $("", !0)
127
+ ]),
128
+ o("div", null, [
129
+ v(r.$slots, "title", {}, () => [
130
+ o("span", Y, m(e.title), 1)
131
+ ]),
132
+ v(r.$slots, "default")
133
+ ]),
134
+ v(r.$slots, "close", {}, () => [
135
+ e.close ? (t(), l("button", {
136
+ key: 0,
137
+ type: "button",
138
+ class: "rvc-alert-close transition-colors",
139
+ onClick: i[0] || (i[0] = (c) => r.$emit("alert:close"))
140
+ }, [
141
+ V(h(U), { class: "size-5" })
142
+ ])) : $("", !0)
143
+ ])
144
+ ]),
145
+ _: 3
146
+ }, 8, ["class"]));
147
+ }
148
+ }, _ = { class: "rvc-checkbox-input peer-focus/checkbox:rvc-focus" }, ee = ["for"], Fe = /* @__PURE__ */ Object.assign({
149
+ inheritAttrs: !1
150
+ }, {
151
+ __name: "Checkbox",
152
+ props: {
153
+ modelValue: {
154
+ type: [Boolean, String, Array, Number],
155
+ default: null
156
+ },
157
+ id: {
158
+ type: String,
159
+ default: null
160
+ },
161
+ label: {
162
+ type: String,
163
+ default: ""
164
+ },
165
+ rootClass: {
166
+ type: String,
167
+ default: ""
168
+ }
169
+ },
170
+ emits: ["update:modelValue"],
171
+ setup(e, { emit: r }) {
172
+ const i = e, c = r, s = C({
173
+ get: () => i.modelValue,
174
+ set: (a) => c("update:modelValue", a)
175
+ }), { hasModelBinding: g } = j(), u = {
176
+ ...F(),
177
+ id: i.id,
178
+ type: "checkbox",
179
+ class: "absolute opacity-0 inset-0 cursor-pointer peer/checkbox"
180
+ };
181
+ return (a, n) => (t(), l("div", {
182
+ class: p(["rvc-checkbox", e.rootClass])
183
+ }, [
184
+ h(g) ? M((t(), l("input", b({ key: 0 }, u, {
185
+ "onUpdate:modelValue": n[0] || (n[0] = (d) => s.value = d)
186
+ }), null, 16)), [
187
+ [N, s.value]
188
+ ]) : (t(), l("input", P(b({ key: 1 }, u)), null, 16)),
189
+ o("span", _, [
190
+ V(h(G))
191
+ ]),
192
+ o("div", null, [
193
+ a.$slots.default || e.label ? v(a.$slots, "default", { key: 0 }, () => [
194
+ o("label", { for: e.id }, m(e.label), 9, ee)
195
+ ]) : $("", !0)
196
+ ])
197
+ ], 2));
198
+ }
199
+ });
200
+ function te(e, r) {
201
+ return t(), l("svg", {
202
+ xmlns: "http://www.w3.org/2000/svg",
203
+ viewBox: "0 0 16 16",
204
+ fill: "currentColor",
205
+ "aria-hidden": "true",
206
+ "data-slot": "icon"
207
+ }, [
208
+ o("path", {
209
+ "fill-rule": "evenodd",
210
+ d: "M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z",
211
+ "clip-rule": "evenodd"
212
+ })
213
+ ]);
214
+ }
215
+ function ae(e, r) {
216
+ return t(), l("svg", {
217
+ xmlns: "http://www.w3.org/2000/svg",
218
+ viewBox: "0 0 20 20",
219
+ fill: "currentColor",
220
+ "aria-hidden": "true",
221
+ "data-slot": "icon"
222
+ }, [
223
+ o("path", {
224
+ "fill-rule": "evenodd",
225
+ d: "M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z",
226
+ "clip-rule": "evenodd"
227
+ })
228
+ ]);
229
+ }
230
+ function ne(e, r) {
231
+ return t(), l("svg", {
232
+ xmlns: "http://www.w3.org/2000/svg",
233
+ viewBox: "0 0 20 20",
234
+ fill: "currentColor",
235
+ "aria-hidden": "true",
236
+ "data-slot": "icon"
237
+ }, [
238
+ o("path", {
239
+ "fill-rule": "evenodd",
240
+ d: "M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",
241
+ "clip-rule": "evenodd"
242
+ })
243
+ ]);
244
+ }
245
+ const D = /* @__PURE__ */ Object.assign({
246
+ inheritAttrs: !1
247
+ }, {
248
+ __name: "FormSelect",
249
+ props: {
250
+ modelValue: {
251
+ type: [String, Number, Object],
252
+ default: null
253
+ },
254
+ rootClass: {
255
+ type: String,
256
+ default: ""
257
+ },
258
+ prefixIcon: {
259
+ type: [Object, Function],
260
+ default: null
261
+ },
262
+ icon: {
263
+ type: [Object, Function],
264
+ default: null
265
+ },
266
+ size: {
267
+ type: String,
268
+ default: "base",
269
+ validator: (e) => ["sm", "base"].includes(e)
270
+ }
271
+ },
272
+ emits: ["update:modelValue"],
273
+ setup(e, { emit: r }) {
274
+ const i = e, c = r, s = C({
275
+ get: () => i.modelValue,
276
+ set: (f) => c("update:modelValue", f)
277
+ }), { hasModelBinding: g } = j();
278
+ return (f, u) => (t(), l("div", {
279
+ class: p([
280
+ "rvc-select",
281
+ `rvc-select-${e.size}`,
282
+ e.rootClass
283
+ ])
284
+ }, [
285
+ e.prefixIcon ? v(f.$slots, "prefixIcon", {
286
+ key: 0,
287
+ icon: e.prefixIcon
288
+ }, () => [
289
+ (t(), x(B(e.prefixIcon), { "aria-hidden": "true" }))
290
+ ]) : $("", !0),
291
+ v(f.$slots, "select", P(H(f.$attrs)), () => [
292
+ h(g) ? M((t(), l("select", b({ key: 0 }, f.$attrs, {
293
+ "onUpdate:modelValue": u[0] || (u[0] = (a) => s.value = a)
294
+ }), [
295
+ v(f.$slots, "default")
296
+ ], 16)), [
297
+ [E, s.value]
298
+ ]) : (t(), l("select", P(b({ key: 1 }, f.$attrs)), [
299
+ v(f.$slots, "default")
300
+ ], 16))
301
+ ]),
302
+ v(f.$slots, "icon", { icon: e.icon }, () => [
303
+ (t(), x(B(e.icon ?? h(Z)), { "aria-hidden": "true" }))
304
+ ])
305
+ ], 2));
306
+ }
307
+ }), le = {
308
+ key: 0,
309
+ class: "rvc-pagination grid grid-cols-2 md:grid-cols-3 items-center justify-between"
310
+ }, se = ["value"], ie = { class: "md:flex justify-center hidden" }, oe = { class: "rvc-pagination-info" }, re = { class: "flex justify-end" }, ue = { class: "flex items-center md:gap-0.5 xl:gap-1" }, ce = ["disabled", "onClick"], de = { key: 2 }, ge = { key: 3 }, fe = {
311
+ __name: "Pagination",
312
+ props: {
313
+ pagination: {
314
+ type: Object,
315
+ required: !0
316
+ },
317
+ perPage: {
318
+ type: Number,
319
+ default: 10
320
+ },
321
+ perPageLabel: {
322
+ type: String,
323
+ default: "per page"
324
+ },
325
+ perPageOptions: {
326
+ type: Array,
327
+ default: () => [10, 20, 50]
328
+ },
329
+ fromLabel: {
330
+ type: String,
331
+ default: "of"
332
+ }
333
+ },
334
+ emits: ["pagination:change", "pagination:perPage"],
335
+ setup(e, { emit: r }) {
336
+ const i = e, c = r, s = q(i.perPage);
337
+ return (g, f) => {
338
+ var u;
339
+ return (u = e.pagination) != null && u.total ? (t(), l("div", le, [
340
+ v(g.$slots, "perPage", b(e.pagination, { perPage: s.value }), () => [
341
+ V(D, {
342
+ modelValue: s.value,
343
+ "onUpdate:modelValue": [
344
+ f[0] || (f[0] = (a) => s.value = a),
345
+ f[1] || (f[1] = (a) => c("pagination:perPage", a))
346
+ ],
347
+ size: "sm",
348
+ "root-class": "w-fit"
349
+ }, {
350
+ default: L(() => [
351
+ (t(!0), l(k, null, S(e.perPageOptions, (a) => (t(), l("option", {
352
+ key: `pagination-items-per-page-option-${a}`,
353
+ value: a
354
+ }, m(a) + " " + m(e.perPageLabel), 9, se))), 128))
355
+ ]),
356
+ _: 1
357
+ }, 8, ["modelValue"])
358
+ ]),
359
+ v(g.$slots, "info", b(e.pagination, { fromLabel: e.fromLabel }), () => [
360
+ o("div", ie, [
361
+ o("div", oe, m(e.pagination.from) + " - " + m(e.pagination.to) + " " + m(e.fromLabel) + " " + m(e.pagination.total), 1)
362
+ ])
363
+ ]),
364
+ o("div", re, [
365
+ o("nav", null, [
366
+ o("ol", ue, [
367
+ (t(!0), l(k, null, S(e.pagination.links, (a, n) => (t(), l("li", {
368
+ key: `pagination-link-${a.label}-${n}`,
369
+ class: "hidden md:block first:block last:block"
370
+ }, [
371
+ o("button", {
372
+ type: "button",
373
+ disabled: a.label === "..." || !a.url,
374
+ class: p([
375
+ "rvc-pagination-button",
376
+ { "rvc-pagination-button-active": a.active }
377
+ ]),
378
+ onClick: (d) => a.url && c("pagination:change", a.url)
379
+ }, [
380
+ a.url !== "..." && n === 0 ? (t(), x(h(ae), {
381
+ key: 0,
382
+ "aria-hidden": "true",
383
+ class: p([
384
+ "size-5 text-slate-80",
385
+ { "opacity-50": !a.url }
386
+ ])
387
+ }, null, 8, ["class"])) : a.label !== "..." && n === e.pagination.links.length - 1 ? (t(), x(h(ne), {
388
+ key: 1,
389
+ "aria-hidden": "true",
390
+ class: p([
391
+ "size-5 text-slate-80",
392
+ { "opacity-50": !a.url }
393
+ ])
394
+ }, null, 8, ["class"])) : a.label === "..." ? (t(), l("span", de, " ... ")) : (t(), l("span", ge, m(a.label), 1))
395
+ ], 10, ce)
396
+ ]))), 128))
397
+ ])
398
+ ])
399
+ ])
400
+ ])) : $("", !0);
401
+ };
402
+ }
403
+ }, ve = { key: 0 }, me = ["aria-label", "onClick"], pe = ["innerHTML"], ye = { key: 1 }, be = ["colspan"], he = { key: 2 }, $e = ["colspan"], ke = { class: "flex gap-x-2 items-center" }, Ne = {
404
+ __name: "DataTable",
405
+ props: {
406
+ headers: {
407
+ type: Array,
408
+ default: () => [],
409
+ validator: (e) => e.every((i) => {
410
+ const c = !i.align || ["left", "center", "right"].includes(i.align), g = !(i.sortable === !0) || typeof i.key == "string" && i.key.length > 0;
411
+ return g || console.warn("[DataTable] Header item with sortable=true is missing required 'key' property:", i), !c && i.align && console.warn("[DataTable] Header item has invalid 'align' value. Must be 'left', 'center' or 'right':", i), c && g;
412
+ })
413
+ },
414
+ items: {
415
+ type: Array,
416
+ required: !0
417
+ },
418
+ noResultsText: {
419
+ type: String,
420
+ default: "No results found."
421
+ },
422
+ loadingText: {
423
+ type: String,
424
+ default: "Loading content..."
425
+ },
426
+ striped: {
427
+ type: Boolean
428
+ },
429
+ spinning: {
430
+ type: Boolean
431
+ },
432
+ pagination: {
433
+ type: Object,
434
+ default: null
435
+ },
436
+ wrapperClass: {
437
+ type: String,
438
+ default: ""
439
+ }
440
+ },
441
+ emits: ["table:sortBy", "pagination:change", "pagination:perPage"],
442
+ setup(e, { emit: r }) {
443
+ const i = e, c = r, s = q(null), g = (u) => i.headers.find((a) => a.key === u), f = (u) => {
444
+ !s.value || s.value.key !== u.key ? s.value = {
445
+ key: u.key,
446
+ direction: "asc"
447
+ } : s.value.direction === "asc" ? s.value = {
448
+ key: u.key,
449
+ direction: "desc"
450
+ } : s.value = null, c("table:sortBy", s.value);
451
+ };
452
+ return (u, a) => (t(), l("div", null, [
453
+ o("div", {
454
+ class: p(["rvc-table-wrapper", e.wrapperClass])
455
+ }, [
456
+ o("table", {
457
+ class: p([{ "rvc-table-striped": e.striped }, "w-full rvc-table"])
458
+ }, [
459
+ e.headers.length ? (t(), l("thead", ve, [
460
+ o("tr", null, [
461
+ v(u.$slots, "headers", { headers: e.headers }, () => [
462
+ (t(!0), l(k, null, S(e.headers, (n) => {
463
+ var d, y;
464
+ return t(), l("th", b({ ref_for: !0 }, n, {
465
+ key: `rvc-table-header-${n.id}`,
466
+ class: {
467
+ "text-left": n.align === "left" || !n.align,
468
+ "text-center": n.align === "center",
469
+ "text-right": n.align === "right"
470
+ }
471
+ }), [
472
+ n.sortable && n.key ? (t(), l("button", {
473
+ key: 0,
474
+ type: "button",
475
+ "aria-label": `Sort on ${n.label}`,
476
+ class: p([
477
+ "flex w-full gap-x-1.5 hover:underline group/table",
478
+ {
479
+ "justify-center": n.align === "center",
480
+ "justify-start flex-row-reverse": n.align === "right"
481
+ }
482
+ ]),
483
+ onClick: (w) => f(n)
484
+ }, [
485
+ v(u.$slots, "header-label", {
486
+ sortBy: s.value,
487
+ header: n
488
+ }, () => [
489
+ A(m(n.label), 1)
490
+ ]),
491
+ V(h(te), {
492
+ class: p([
493
+ "size-4 shrink-0 transition",
494
+ {
495
+ "opacity-100": ((d = s.value) == null ? void 0 : d.key) === n.key,
496
+ "opacity-0 group-hover/table:opacity-30": !s.value || s.value.key !== n.key,
497
+ "rotate-180": ((y = s.value) == null ? void 0 : y.key) === n.key && s.value.direction === "desc"
498
+ }
499
+ ])
500
+ }, null, 8, ["class"])
501
+ ], 10, me)) : v(u.$slots, "header-label", {
502
+ key: 1,
503
+ sortBy: s.value,
504
+ header: n
505
+ }, () => [
506
+ A(m(n.label), 1)
507
+ ])
508
+ ], 16);
509
+ }), 128))
510
+ ])
511
+ ])
512
+ ])) : $("", !0),
513
+ o("tbody", null, [
514
+ e.items.length && !e.spinning ? (t(!0), l(k, { key: 0 }, S(e.items, (n, d) => (t(), l("tr", {
515
+ key: `rvc-table-row-${d}-${n.id}`
516
+ }, [
517
+ v(u.$slots, "items", {
518
+ item: n,
519
+ index: d
520
+ }, () => [
521
+ (t(!0), l(k, null, S(n, (y, w) => {
522
+ var O, T, I, z;
523
+ return t(), l("td", b({
524
+ key: `rvc-table-row-${d}-column-${w}-${n.id}`,
525
+ ref_for: !0
526
+ }, n.attrs, {
527
+ class: {
528
+ "text-left": ((O = g(w)) == null ? void 0 : O.align) === "left" || !((T = g(w)) != null && T.align),
529
+ "text-center": ((I = g(w)) == null ? void 0 : I.align) === "center",
530
+ "text-right": ((z = g(w)) == null ? void 0 : z.align) === "right"
531
+ },
532
+ innerHTML: y
533
+ }), null, 16, pe);
534
+ }), 128))
535
+ ])
536
+ ]))), 128)) : !e.items.length && !e.spinning ? (t(), l("tr", ye, [
537
+ o("td", {
538
+ colspan: e.headers.length,
539
+ class: "rvc-table-state"
540
+ }, [
541
+ o("p", null, m(e.noResultsText), 1)
542
+ ], 8, be)
543
+ ])) : (t(), l("tr", he, [
544
+ o("td", {
545
+ colspan: e.headers.length,
546
+ class: "rvc-table-state"
547
+ }, [
548
+ v(u.$slots, "spinner", {
549
+ spinning: e.spinning,
550
+ label: e.loadingText
551
+ }, () => [
552
+ o("div", ke, [
553
+ e.spinning ? (t(), x(h(K), {
554
+ key: 0,
555
+ "aria-hidden": "true",
556
+ class: "rvc-table-spinner"
557
+ })) : $("", !0),
558
+ A(" " + m(e.loadingText), 1)
559
+ ])
560
+ ])
561
+ ], 8, $e)
562
+ ]))
563
+ ])
564
+ ], 2)
565
+ ], 2),
566
+ e.pagination ? v(u.$slots, "pagination", P(b({ key: 0 }, e.pagination)), () => [
567
+ V(fe, {
568
+ pagination: e.pagination,
569
+ "onPagination:change": a[0] || (a[0] = (n) => c("pagination:change", n)),
570
+ "onPagination:perPage": a[1] || (a[1] = (n) => c("pagination:perPage", n))
571
+ }, null, 8, ["pagination"])
572
+ ]) : $("", !0)
573
+ ]));
574
+ }
575
+ }, xe = {
576
+ key: 1,
577
+ class: "rvc-empty-state-title"
578
+ }, qe = {
579
+ __name: "EmptyState",
580
+ props: {
581
+ title: {
582
+ type: String,
583
+ required: !0,
584
+ default: ""
585
+ },
586
+ background: {
587
+ type: Boolean,
588
+ default: !1
589
+ },
590
+ icon: {
591
+ type: [Object, Function],
592
+ default: null
593
+ }
594
+ },
595
+ setup(e) {
596
+ return (r, i) => (t(), l("div", {
597
+ class: p(["rvc-empty-state", { "rvc-empty-state-bg": e.background }])
598
+ }, [
599
+ e.icon ? (t(), x(B(e.icon), {
600
+ key: 0,
601
+ class: "rvc-empty-state-icon"
602
+ })) : $("", !0),
603
+ e.title ? (t(), l("p", xe, m(e.title), 1)) : $("", !0),
604
+ v(r.$slots, "default")
605
+ ], 2));
606
+ }
607
+ }, De = {
608
+ __name: "FormTextarea",
609
+ props: {
610
+ modelValue: {
611
+ type: String,
612
+ default: void 0
613
+ },
614
+ size: {
615
+ type: String,
616
+ default: "base",
617
+ validator: (e) => ["sm", "base"].includes(e)
618
+ }
619
+ },
620
+ emits: ["update:modelValue"],
621
+ setup(e, { emit: r }) {
622
+ const i = e, c = r, { hasModelBinding: s } = j(), g = C({
623
+ get: () => i.modelValue,
624
+ set: (u) => c("update:modelValue", u)
625
+ }), f = C(() => [
626
+ "rvc-textarea",
627
+ `rvc-textarea-${i.size}`
628
+ ]);
629
+ return (u, a) => h(s) ? M((t(), l("textarea", {
630
+ key: 0,
631
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => g.value = n),
632
+ class: p(f.value)
633
+ }, null, 2)), [
634
+ [R, g.value]
635
+ ]) : (t(), l("textarea", {
636
+ key: 1,
637
+ class: p(f.value)
638
+ }, null, 2));
639
+ }
640
+ }, we = { class: "rvc-radio" }, Se = ["id"], Ve = { key: 2 }, Be = ["for"], He = /* @__PURE__ */ Object.assign({
641
+ inheritAttrs: !1
642
+ }, {
643
+ __name: "Radio",
644
+ props: {
645
+ modelValue: {
646
+ type: [Boolean, String, Array, Number],
647
+ default: null
648
+ },
649
+ id: {
650
+ type: String,
651
+ default: null
652
+ },
653
+ label: {
654
+ type: String,
655
+ default: ""
656
+ }
657
+ },
658
+ emits: ["update:modelValue"],
659
+ setup(e, { emit: r }) {
660
+ const i = e, c = r, s = C({
661
+ get: () => i.modelValue,
662
+ set: (a) => c("update:modelValue", a)
663
+ }), { hasModelBinding: g } = j(), u = {
664
+ ...F(),
665
+ id: i.id,
666
+ type: "radio",
667
+ class: "absolute opacity-0 inset-0 cursor-pointer peer/radio"
668
+ };
669
+ return (a, n) => (t(), l("div", we, [
670
+ h(g) ? M((t(), l("input", b({ key: 0 }, u, {
671
+ id: e.id,
672
+ "onUpdate:modelValue": n[0] || (n[0] = (d) => s.value = d)
673
+ }), null, 16, Se)), [
674
+ [N, s.value]
675
+ ]) : (t(), l("input", P(b({ key: 1 }, u)), null, 16)),
676
+ n[1] || (n[1] = o("span", { class: "rvc-radio-input peer-focus/radio:rvc-focus" }, null, -1)),
677
+ a.$slots.default || e.label ? (t(), l("span", Ve, [
678
+ v(a.$slots, "default", {}, () => [
679
+ o("label", { for: e.id }, m(e.label), 9, Be)
680
+ ])
681
+ ])) : $("", !0)
682
+ ]));
683
+ }
684
+ }), Ce = { class: "rvc-tabs-nav" }, Ae = { class: "md:hidden" }, Pe = ["value", "selected"], Ee = {
685
+ __name: "Tabs",
686
+ props: {
687
+ modelValue: {
688
+ type: Number,
689
+ default: void 0
690
+ },
691
+ tabs: {
692
+ type: Array,
693
+ required: !0,
694
+ default: () => []
695
+ },
696
+ tabStyle: {
697
+ type: String,
698
+ default: "default",
699
+ validator: (e) => ["buttons", "default"].includes(e)
700
+ }
701
+ },
702
+ emits: ["update:modelValue", "tabs:change"],
703
+ setup(e, { emit: r }) {
704
+ const i = e, c = r, s = () => {
705
+ const a = i.tabs.findIndex((n) => n.active);
706
+ return a >= 0 ? a : 0;
707
+ }, g = C({
708
+ get: () => i.modelValue ?? s(),
709
+ set: (a) => {
710
+ const n = i.tabs[a];
711
+ c("update:modelValue", a), c("tabs:change", n);
712
+ }
713
+ }), f = (a) => {
714
+ const n = +a.target.value;
715
+ g.value = n;
716
+ const d = i.tabs[n];
717
+ d != null && d.selectEvent && d.selectEvent();
718
+ }, u = (a) => {
719
+ const {
720
+ active: n,
721
+ as: d,
722
+ bindAs: y,
723
+ selectEvent: w,
724
+ name: O,
725
+ ...T
726
+ } = a;
727
+ return T;
728
+ };
729
+ return (a, n) => (t(), l(k, null, [
730
+ o("div", {
731
+ class: p(["rvc-tabs hidden md:flex", { "rvc-tabs-buttons": e.tabStyle === "buttons" }])
732
+ }, [
733
+ o("nav", Ce, [
734
+ (t(!0), l(k, null, S(e.tabs, (d, y) => (t(), x(B(d.as ? d.as : "button"), b({ ref_for: !0 }, u(d), {
735
+ key: `${y}-tab-item`,
736
+ as: d.bindAs ? d.bindAs : void 0,
737
+ class: ["rvc-tab", { "rvc-tab-active": g.value === y }],
738
+ onClick: (w) => g.value = y
739
+ }), {
740
+ default: L(() => [
741
+ A(m(d.name), 1)
742
+ ]),
743
+ _: 2
744
+ }, 1040, ["as", "class", "onClick"]))), 128))
745
+ ])
746
+ ], 2),
747
+ o("div", Ae, [
748
+ V(D, {
749
+ value: g.value,
750
+ onChange: f
751
+ }, {
752
+ default: L(() => [
753
+ (t(!0), l(k, null, S(e.tabs, (d, y) => (t(), l("option", {
754
+ key: `${y}-tab-item-select-option`,
755
+ value: y,
756
+ selected: g.value === y
757
+ }, m(d.name), 9, Pe))), 128))
758
+ ]),
759
+ _: 1
760
+ }, 8, ["value"])
761
+ ])
762
+ ], 64));
763
+ }
764
+ };
765
+ export {
766
+ Ie as Accordion,
767
+ ze as Alert,
768
+ Ze as Badge,
769
+ Ge as ButtonBase,
770
+ Fe as Checkbox,
771
+ Ne as DataTable,
772
+ qe as EmptyState,
773
+ Qe as FormInput,
774
+ D as FormSelect,
775
+ De as FormTextarea,
776
+ fe as Pagination,
777
+ He as Radio,
778
+ Ee as Tabs
779
+ };