@robuust-digital/vue-components 2.0.0-rc.0 → 2.0.0-rc.10

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