@cfasim-ui/components 0.1.9 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/Box/Box.d.ts +24 -0
  2. package/dist/Box/Box.spec.d.ts +1 -0
  3. package/dist/Box/Box.test.d.ts +1 -0
  4. package/dist/Button/Button.d.ts +29 -0
  5. package/dist/Button/Button.spec.d.ts +1 -0
  6. package/dist/Button/Button.test.d.ts +1 -0
  7. package/dist/Expander/Expander.d.ts +28 -0
  8. package/dist/Expander/Expander.spec.d.ts +1 -0
  9. package/dist/Hint/Hint.d.ts +5 -0
  10. package/dist/Hint/Hint.spec.d.ts +1 -0
  11. package/dist/Hint/Hint.test.d.ts +1 -0
  12. package/dist/Icon/Icon.d.ts +18 -0
  13. package/dist/Icon/Icon.spec.d.ts +1 -0
  14. package/dist/LightDarkToggle/LightDarkToggle.d.ts +2 -0
  15. package/dist/NumberInput/NumberInput.d.ts +21 -0
  16. package/dist/NumberInput/NumberInput.spec.d.ts +1 -0
  17. package/dist/NumberInput/NumberInput.test.d.ts +1 -0
  18. package/dist/SelectBox/SelectBox.d.ts +19 -0
  19. package/dist/SelectBox/SelectBox.spec.d.ts +1 -0
  20. package/dist/SelectBox/SelectBox.test.d.ts +1 -0
  21. package/dist/SidebarLayout/SidebarLayout.d.ts +37 -0
  22. package/dist/SidebarLayout/SidebarLayout.test.d.ts +1 -0
  23. package/dist/Spinner/Spinner.d.ts +9 -0
  24. package/dist/Spinner/Spinner.spec.d.ts +1 -0
  25. package/dist/TextInput/TextInput.d.ts +14 -0
  26. package/dist/TextInput/TextInput.spec.d.ts +1 -0
  27. package/dist/TextInput/TextInput.test.d.ts +1 -0
  28. package/dist/Toggle/Toggle.d.ts +14 -0
  29. package/dist/Toggle/Toggle.spec.d.ts +1 -0
  30. package/dist/Toggle/Toggle.test.d.ts +1 -0
  31. package/dist/index.css +2 -0
  32. package/dist/index.d.ts +15 -0
  33. package/dist/index.js +700 -0
  34. package/package.json +17 -3
  35. package/src/Box/Box.md +0 -41
  36. package/src/Box/Box.spec.ts +0 -13
  37. package/src/Box/Box.test.ts +0 -49
  38. package/src/Box/Box.vue +0 -52
  39. package/src/Button/Button.md +0 -55
  40. package/src/Button/Button.spec.ts +0 -18
  41. package/src/Button/Button.test.ts +0 -36
  42. package/src/Button/Button.vue +0 -81
  43. package/src/Expander/Expander.md +0 -23
  44. package/src/Expander/Expander.spec.ts +0 -14
  45. package/src/Expander/Expander.vue +0 -95
  46. package/src/Hint/Hint.md +0 -24
  47. package/src/Hint/Hint.spec.ts +0 -12
  48. package/src/Hint/Hint.test.ts +0 -34
  49. package/src/Hint/Hint.vue +0 -83
  50. package/src/Icon/Icon.md +0 -55
  51. package/src/Icon/Icon.spec.ts +0 -9
  52. package/src/Icon/Icon.vue +0 -112
  53. package/src/LightDarkToggle/LightDarkToggle.vue +0 -49
  54. package/src/NumberInput/NumberInput.md +0 -187
  55. package/src/NumberInput/NumberInput.spec.ts +0 -10
  56. package/src/NumberInput/NumberInput.test.ts +0 -580
  57. package/src/NumberInput/NumberInput.vue +0 -446
  58. package/src/SelectBox/SelectBox.md +0 -56
  59. package/src/SelectBox/SelectBox.spec.ts +0 -9
  60. package/src/SelectBox/SelectBox.test.ts +0 -42
  61. package/src/SelectBox/SelectBox.vue +0 -190
  62. package/src/SidebarLayout/SidebarLayout.md +0 -104
  63. package/src/SidebarLayout/SidebarLayout.test.ts +0 -86
  64. package/src/SidebarLayout/SidebarLayout.vue +0 -465
  65. package/src/Spinner/Spinner.md +0 -45
  66. package/src/Spinner/Spinner.spec.ts +0 -9
  67. package/src/Spinner/Spinner.vue +0 -55
  68. package/src/TextInput/TextInput.md +0 -41
  69. package/src/TextInput/TextInput.spec.ts +0 -10
  70. package/src/TextInput/TextInput.test.ts +0 -70
  71. package/src/TextInput/TextInput.vue +0 -90
  72. package/src/Toggle/Toggle.md +0 -68
  73. package/src/Toggle/Toggle.spec.ts +0 -13
  74. package/src/Toggle/Toggle.test.ts +0 -35
  75. package/src/Toggle/Toggle.vue +0 -81
  76. package/src/index.ts +0 -15
package/dist/index.js ADDED
@@ -0,0 +1,700 @@
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, getCurrentInstance as l, mergeModels as u, normalizeClass as d, normalizeStyle as f, onMounted as p, onUnmounted as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, useModel as x, vModelText as S, watch as C, withCtx as w, withDirectives as T, withKeys as E, withModifiers as D } from "vue";
2
+ import { CollapsibleContent as O, CollapsibleRoot as k, CollapsibleTrigger as A, Primitive as j, SelectContent as M, SelectItem as N, SelectItemIndicator as P, SelectItemText as F, SelectPortal as I, SelectRoot as L, SelectTrigger as R, SelectValue as z, SelectViewport as B, SliderRange as V, SliderRoot as H, SliderThumb as U, SliderTrack as W, SwitchRoot as G, SwitchThumb as K, TabsIndicator as q, TabsList as J, TabsRoot as Y, TabsTrigger as ee, TooltipArrow as te, TooltipContent as ne, TooltipPortal as re, TooltipProvider as ie, TooltipRoot as ae, TooltipTrigger as oe, useId as se } from "reka-ui";
3
+ //#region src/Box/Box.vue?vue&type=script&setup=true&lang.ts
4
+ var ce = ["role"], le = /* @__PURE__ */ c({
5
+ __name: "Box",
6
+ props: {
7
+ variant: {},
8
+ bgColor: {},
9
+ textColor: {},
10
+ role: {}
11
+ },
12
+ setup(e) {
13
+ return (t, n) => (h(), i("div", {
14
+ class: d(["box", e.variant ? `box-${e.variant}` : void 0]),
15
+ style: f({
16
+ backgroundColor: e.bgColor,
17
+ color: e.textColor
18
+ }),
19
+ role: e.role
20
+ }, [v(t.$slots, "default", {}, void 0, !0)], 14, ce));
21
+ }
22
+ }), X = (e, t) => {
23
+ let n = e.__vccOpts || e;
24
+ for (let [e, r] of t) n[e] = r;
25
+ return n;
26
+ }, ue = /* @__PURE__ */ X(le, [["__scopeId", "data-v-d7342c02"]]), de = /* @__PURE__ */ X(/* @__PURE__ */ c({
27
+ __name: "Button",
28
+ props: {
29
+ label: {},
30
+ variant: { default: "primary" },
31
+ asChild: { type: Boolean },
32
+ as: { default: "button" }
33
+ },
34
+ emits: ["click"],
35
+ setup(e) {
36
+ return (t, r) => (h(), n(b(j), {
37
+ class: "button",
38
+ "data-variant": e.variant,
39
+ as: e.as,
40
+ "as-child": e.asChild,
41
+ onClick: r[0] ||= (e) => t.$emit("click", e)
42
+ }, {
43
+ default: w(() => [v(t.$slots, "default", {}, () => [o(y(e.label), 1)], !0)]),
44
+ _: 3
45
+ }, 8, [
46
+ "data-variant",
47
+ "as",
48
+ "as-child"
49
+ ]));
50
+ }
51
+ }), [["__scopeId", "data-v-250eab18"]]), fe = /* @__PURE__ */ X(/* @__PURE__ */ c({
52
+ __name: "Expander",
53
+ props: /* @__PURE__ */ u({ label: {} }, {
54
+ open: {
55
+ type: Boolean,
56
+ default: !1
57
+ },
58
+ openModifiers: {}
59
+ }),
60
+ emits: ["update:open"],
61
+ setup(e) {
62
+ let t = x(e, "open");
63
+ return (r, i) => (h(), n(b(k), {
64
+ open: t.value,
65
+ "onUpdate:open": i[0] ||= (e) => t.value = e,
66
+ class: "expander"
67
+ }, {
68
+ default: w(() => [s(b(A), { class: "expander-trigger" }, {
69
+ default: w(() => [a("span", { class: d(["expander-caret", { open: t.value }]) }, null, 2), v(r.$slots, "label", {}, () => [o(y(e.label), 1)], !0)]),
70
+ _: 3
71
+ }), s(b(O), { class: "expander-content" }, {
72
+ default: w(() => [v(r.$slots, "default", {}, void 0, !0)]),
73
+ _: 3
74
+ })]),
75
+ _: 3
76
+ }, 8, ["open"]));
77
+ }
78
+ }), [["__scopeId", "data-v-39e4acd0"]]), pe = [
79
+ "data-size",
80
+ "data-fill",
81
+ "data-inline",
82
+ "aria-hidden",
83
+ "aria-label",
84
+ "role"
85
+ ], Z = /* @__PURE__ */ c({
86
+ __name: "Icon",
87
+ props: {
88
+ icon: {},
89
+ size: { default: "md" },
90
+ fill: {
91
+ type: Boolean,
92
+ default: !1
93
+ },
94
+ weight: {},
95
+ grade: {},
96
+ decorative: {
97
+ type: Boolean,
98
+ default: !0
99
+ },
100
+ ariaLabel: {},
101
+ inline: {
102
+ type: Boolean,
103
+ default: !1
104
+ }
105
+ },
106
+ setup(e) {
107
+ let n = e, r = t(() => typeof n.size == "string" ? n.size : void 0), a = t(() => typeof n.size == "number" ? n.size : void 0), o = t(() => {
108
+ let e = {};
109
+ return a.value !== void 0 && (e.fontSize = `${a.value}px`, e["--icon-opsz"] = a.value), n.weight !== void 0 && (e["--icon-weight"] = n.weight), n.grade !== void 0 && (e["--icon-grade"] = n.grade), e;
110
+ });
111
+ return (t, n) => (h(), i("span", {
112
+ class: "Icon",
113
+ "data-size": r.value,
114
+ "data-fill": e.fill ? "true" : void 0,
115
+ "data-inline": e.inline ? "true" : void 0,
116
+ style: f(o.value),
117
+ "aria-hidden": e.decorative ? !0 : void 0,
118
+ "aria-label": e.decorative ? void 0 : e.ariaLabel,
119
+ role: e.decorative ? void 0 : "img"
120
+ }, y(e.icon), 13, pe));
121
+ }
122
+ }), Q = /* @__PURE__ */ X(/* @__PURE__ */ c({
123
+ __name: "Hint",
124
+ props: { text: {} },
125
+ setup(e) {
126
+ return (t, r) => (h(), n(b(ie), null, {
127
+ default: w(() => [s(b(ae), {
128
+ "delay-duration": 0,
129
+ "disable-closing-trigger": ""
130
+ }, {
131
+ default: w(() => [s(b(oe), { "as-child": "" }, {
132
+ default: w(() => [a("button", {
133
+ type: "button",
134
+ class: "HintTrigger",
135
+ "aria-label": "More info",
136
+ onPointerdown: r[0] ||= D(() => {}, ["prevent"])
137
+ }, [s(Z, {
138
+ icon: "help",
139
+ size: 16
140
+ })], 32)]),
141
+ _: 1
142
+ }), s(b(re), null, {
143
+ default: w(() => [s(b(ne), {
144
+ class: "HintContent",
145
+ side: "top",
146
+ "side-offset": 4
147
+ }, {
148
+ default: w(() => [o(y(e.text) + " ", 1), s(b(te), {
149
+ class: "HintArrow",
150
+ width: 10,
151
+ height: 5
152
+ })]),
153
+ _: 1
154
+ })]),
155
+ _: 1
156
+ })]),
157
+ _: 1
158
+ })]),
159
+ _: 1
160
+ }));
161
+ }
162
+ }), [["__scopeId", "data-v-9dbf1c25"]]), me = ["aria-label"], $ = /* @__PURE__ */ X(/* @__PURE__ */ c({
163
+ __name: "LightDarkToggle",
164
+ setup(e) {
165
+ let t = g(window.matchMedia("(prefers-color-scheme: dark)").matches);
166
+ function n(e) {
167
+ document.documentElement.classList.toggle("dark", e), document.documentElement.classList.toggle("light", !e);
168
+ }
169
+ return n(t.value), C(t, n), (e, n) => (h(), i("button", {
170
+ class: "light-dark-toggle",
171
+ type: "button",
172
+ "aria-label": t.value ? "Switch to light mode" : "Switch to dark mode",
173
+ onClick: n[0] ||= (e) => t.value = !t.value
174
+ }, [s(Z, {
175
+ icon: t.value ? "dark_mode" : "light_mode",
176
+ size: "sm"
177
+ }, null, 8, ["icon"])], 8, me));
178
+ }
179
+ }), [["__scopeId", "data-v-4c423498"]]), he = {
180
+ key: 0,
181
+ class: "input-label"
182
+ }, ge = { class: "input-label-row" }, _e = {
183
+ key: 0,
184
+ class: "input-wrapper"
185
+ }, ve = [
186
+ "inputmode",
187
+ "placeholder",
188
+ "aria-invalid"
189
+ ], ye = {
190
+ key: 0,
191
+ class: "input-suffix"
192
+ }, be = {
193
+ key: 1,
194
+ class: "input-error",
195
+ role: "alert"
196
+ }, xe = {
197
+ key: 2,
198
+ class: "slider-container"
199
+ }, Se = { class: "slider-current" }, Ce = { class: "slider-labels" }, we = { key: 1 }, Te = {
200
+ key: 0,
201
+ class: "input-wrapper"
202
+ }, Ee = [
203
+ "inputmode",
204
+ "placeholder",
205
+ "aria-invalid"
206
+ ], De = {
207
+ key: 0,
208
+ class: "input-suffix"
209
+ }, Oe = {
210
+ key: 1,
211
+ class: "input-error",
212
+ role: "alert"
213
+ }, ke = {
214
+ key: 2,
215
+ class: "slider-container"
216
+ }, Ae = { class: "slider-current" }, je = { class: "slider-labels" }, Me = /* @__PURE__ */ X(/* @__PURE__ */ c({
217
+ __name: "NumberInput",
218
+ props: /* @__PURE__ */ u({
219
+ label: {},
220
+ placeholder: {},
221
+ step: {},
222
+ min: {},
223
+ max: {},
224
+ hint: {},
225
+ percent: { type: Boolean },
226
+ slider: { type: Boolean },
227
+ live: { type: Boolean },
228
+ numberType: {}
229
+ }, {
230
+ modelValue: {},
231
+ modelModifiers: {}
232
+ }),
233
+ emits: ["update:modelValue"],
234
+ setup(e) {
235
+ let c = x(e, "modelValue"), l = e, u = t(() => l.min ?? (l.percent, 0)), d = t(() => l.max ?? (l.percent ? 1 : 100)), f = t(() => l.step ?? (l.percent ? .01 : 1));
236
+ function p(e) {
237
+ return e == null ? "" : l.percent ? (e * 100).toFixed(0) + "%" : e.toLocaleString("en-US");
238
+ }
239
+ function m(e) {
240
+ return e == null ? e : l.percent ? Math.round(e * 1e4) / 100 : e;
241
+ }
242
+ function _(e) {
243
+ return l.percent ? e / 100 : e;
244
+ }
245
+ function v(e) {
246
+ if (l.numberType !== "integer") return e;
247
+ let t = m(e);
248
+ return t == null ? e : _(Math.trunc(t));
249
+ }
250
+ function D(e) {
251
+ return e == null ? "" : e.toLocaleString("en-US");
252
+ }
253
+ function O(e) {
254
+ let t = D(e);
255
+ return l.numberType === "float" && e != null && Number.isInteger(e) ? t + ".0" : t;
256
+ }
257
+ function k(e) {
258
+ return e.replace(/,/g, "");
259
+ }
260
+ let A = g(O(m(c.value))), j = g(c.value), M = g();
261
+ C(c, (e) => {
262
+ A.value = O(m(e)), j.value = e;
263
+ });
264
+ function N(e) {
265
+ let t = e.target, n = k(t.value);
266
+ if (n === "" || n === "-" || n.endsWith(".") || n.includes(".") && n.endsWith("0")) return;
267
+ let r = Number(n);
268
+ if (Number.isNaN(r)) return;
269
+ let i = D(r);
270
+ if (i === t.value) return;
271
+ let a = t.selectionStart ?? 0, o = (t.value.slice(0, a).match(/,/g) || []).length;
272
+ A.value = i, requestAnimationFrame(() => {
273
+ let e = a - o, n = 0, r = 0;
274
+ for (let t = 0; t < i.length; t++) if (i[t] !== "," && r++, r >= e) {
275
+ n = t + 1;
276
+ break;
277
+ }
278
+ r < e && (n = i.length), t.setSelectionRange(n, n);
279
+ });
280
+ }
281
+ function P() {
282
+ z();
283
+ let e = Number(k(A.value));
284
+ Number.isNaN(e) || (A.value = O(e));
285
+ }
286
+ let F = null;
287
+ function I() {
288
+ !l.live || l.slider || (F && clearTimeout(F), F = setTimeout(z, 300));
289
+ }
290
+ function L() {
291
+ !l.live || l.slider || (F && clearTimeout(F), z());
292
+ }
293
+ function R(e) {
294
+ if (J.value != null && e < J.value) return `Min ${J.value}${l.percent ? "%" : ""}`;
295
+ if (Y.value != null && e > Y.value) return `Max ${Y.value}${l.percent ? "%" : ""}`;
296
+ }
297
+ function z() {
298
+ let e = Number(k(A.value));
299
+ if (Number.isNaN(e)) return;
300
+ l.numberType === "integer" && (e = Math.trunc(e), A.value = O(e));
301
+ let t = R(e);
302
+ M.value = t, !t && (c.value = _(e), j.value = c.value);
303
+ }
304
+ function B(e) {
305
+ if (!e) return;
306
+ let t = v(e[0]);
307
+ j.value = t, A.value = O(m(t)), l.live && (c.value = t);
308
+ }
309
+ function G(e) {
310
+ e && (c.value = v(e[0]));
311
+ }
312
+ let K = t(() => l.step == null ? 1 : l.percent ? l.step * 100 : l.step);
313
+ function q(e, t) {
314
+ e.preventDefault();
315
+ let n = Number(k(A.value)), r = (Number.isNaN(n) ? 0 : n) + K.value * (e.shiftKey ? 10 : 1) * t;
316
+ l.numberType === "integer" && (r = Math.trunc(r)), J.value != null && (r = Math.max(r, J.value)), Y.value != null && (r = Math.min(r, Y.value)), A.value = O(r), M.value = void 0, c.value = _(r), j.value = c.value;
317
+ }
318
+ let J = t(() => l.min == null ? l.percent ? 0 : void 0 : l.percent ? l.min * 100 : l.min), Y = t(() => l.max == null ? l.percent ? 100 : void 0 : l.percent ? l.max * 100 : l.max);
319
+ return (e, t) => l.label ? (h(), i("label", he, [
320
+ a("span", ge, [o(y(l.label) + " ", 1), l.hint ? (h(), n(Q, {
321
+ key: 0,
322
+ text: l.hint
323
+ }, null, 8, ["text"])) : r("", !0)]),
324
+ l.slider ? r("", !0) : (h(), i("span", _e, [T(a("input", {
325
+ type: "text",
326
+ inputmode: l.numberType === "integer" ? "numeric" : "decimal",
327
+ "onUpdate:modelValue": t[0] ||= (e) => A.value = e,
328
+ placeholder: l.placeholder,
329
+ "aria-invalid": !!M.value,
330
+ onBlur: P,
331
+ onKeydown: [
332
+ E(z, ["enter"]),
333
+ t[1] ||= E((e) => q(e, 1), ["up"]),
334
+ t[2] ||= E((e) => q(e, -1), ["down"])
335
+ ],
336
+ onInput: t[3] ||= (e) => {
337
+ N(e), I();
338
+ },
339
+ onChange: L
340
+ }, null, 40, ve), [[S, A.value]]), l.percent ? (h(), i("span", ye, "%")) : r("", !0)])),
341
+ M.value ? (h(), i("span", be, y(M.value), 1)) : r("", !0),
342
+ l.slider ? (h(), i("div", xe, [s(b(H), {
343
+ class: "slider-root",
344
+ "model-value": j.value == null ? [u.value] : [j.value],
345
+ min: u.value,
346
+ max: d.value,
347
+ step: f.value,
348
+ "onUpdate:modelValue": B,
349
+ onValueCommit: G
350
+ }, {
351
+ default: w(() => [s(b(W), { class: "slider-track" }, {
352
+ default: w(() => [s(b(V), { class: "slider-range" })]),
353
+ _: 1
354
+ }), s(b(U), {
355
+ class: "slider-thumb",
356
+ "aria-label": l.label
357
+ }, {
358
+ default: w(() => [a("span", Se, y(p(j.value)), 1)]),
359
+ _: 1
360
+ }, 8, ["aria-label"])]),
361
+ _: 1
362
+ }, 8, [
363
+ "model-value",
364
+ "min",
365
+ "max",
366
+ "step"
367
+ ]), a("div", Ce, [a("span", null, y(p(u.value)), 1), a("span", null, y(p(d.value)), 1)])])) : r("", !0)
368
+ ])) : (h(), i("div", we, [
369
+ l.slider ? r("", !0) : (h(), i("span", Te, [T(a("input", {
370
+ type: "text",
371
+ inputmode: l.numberType === "integer" ? "numeric" : "decimal",
372
+ "onUpdate:modelValue": t[4] ||= (e) => A.value = e,
373
+ placeholder: l.placeholder,
374
+ "aria-invalid": !!M.value,
375
+ onBlur: P,
376
+ onKeydown: [
377
+ E(z, ["enter"]),
378
+ t[5] ||= E((e) => q(e, 1), ["up"]),
379
+ t[6] ||= E((e) => q(e, -1), ["down"])
380
+ ],
381
+ onInput: t[7] ||= (e) => {
382
+ N(e), I();
383
+ },
384
+ onChange: L
385
+ }, null, 40, Ee), [[S, A.value]]), l.percent ? (h(), i("span", De, "%")) : r("", !0)])),
386
+ M.value ? (h(), i("span", Oe, y(M.value), 1)) : r("", !0),
387
+ l.slider ? (h(), i("div", ke, [s(b(H), {
388
+ class: "slider-root",
389
+ "model-value": j.value == null ? [u.value] : [j.value],
390
+ min: u.value,
391
+ max: d.value,
392
+ step: f.value,
393
+ "onUpdate:modelValue": B,
394
+ onValueCommit: G
395
+ }, {
396
+ default: w(() => [s(b(W), { class: "slider-track" }, {
397
+ default: w(() => [s(b(V), { class: "slider-range" })]),
398
+ _: 1
399
+ }), s(b(U), {
400
+ class: "slider-thumb",
401
+ "aria-label": l.label
402
+ }, {
403
+ default: w(() => [a("span", Ae, y(p(j.value)), 1)]),
404
+ _: 1
405
+ }, 8, ["aria-label"])]),
406
+ _: 1
407
+ }, 8, [
408
+ "model-value",
409
+ "min",
410
+ "max",
411
+ "step"
412
+ ]), a("div", je, [a("span", null, y(p(u.value)), 1), a("span", null, y(p(d.value)), 1)])])) : r("", !0)
413
+ ]));
414
+ }
415
+ }), [["__scopeId", "data-v-cecbdacc"]]), Ne = { class: "select-box" }, Pe = ["id"], Fe = /* @__PURE__ */ X(/* @__PURE__ */ c({
416
+ __name: "SelectBox",
417
+ props: /* @__PURE__ */ u({
418
+ label: {},
419
+ ariaLabel: {},
420
+ options: {},
421
+ placeholder: {}
422
+ }, {
423
+ modelValue: {},
424
+ modelModifiers: {}
425
+ }),
426
+ emits: ["update:modelValue"],
427
+ setup(t) {
428
+ let c = x(t, "modelValue"), l = t, u = se();
429
+ return (d, f) => (h(), i("div", Ne, [t.label ? (h(), i("label", {
430
+ key: 0,
431
+ id: `${b(u)}-label`,
432
+ class: "select-label"
433
+ }, y(t.label), 9, Pe)) : r("", !0), s(b(L), {
434
+ modelValue: c.value,
435
+ "onUpdate:modelValue": f[0] ||= (e) => c.value = e
436
+ }, {
437
+ default: w(() => [s(b(R), {
438
+ class: "select-trigger",
439
+ "aria-labelledby": l.label ? `${b(u)}-label` : void 0,
440
+ "aria-label": l.label ? void 0 : l.ariaLabel
441
+ }, {
442
+ default: w(() => [s(b(z), { placeholder: t.placeholder }, null, 8, ["placeholder"]), f[1] ||= a("span", {
443
+ class: "select-icon",
444
+ "aria-hidden": "true"
445
+ }, [a("svg", {
446
+ width: "12",
447
+ height: "12",
448
+ viewBox: "0 0 12 12",
449
+ fill: "none",
450
+ stroke: "currentColor",
451
+ "stroke-width": "2",
452
+ "stroke-linecap": "round",
453
+ "stroke-linejoin": "round"
454
+ }, [a("path", { d: "M3 4.5L6 7.5L9 4.5" })])], -1)]),
455
+ _: 1
456
+ }, 8, ["aria-labelledby", "aria-label"]), s(b(I), null, {
457
+ default: w(() => [s(b(M), {
458
+ class: "select-content",
459
+ position: "popper",
460
+ "side-offset": 4,
461
+ "body-lock": !1
462
+ }, {
463
+ default: w(() => [s(b(B), { class: "select-viewport" }, {
464
+ default: w(() => [(h(!0), i(e, null, _(t.options, (e) => (h(), n(b(N), {
465
+ key: e.value,
466
+ value: e.value,
467
+ class: "select-item"
468
+ }, {
469
+ default: w(() => [s(b(F), null, {
470
+ default: w(() => [o(y(e.label), 1)]),
471
+ _: 2
472
+ }, 1024), s(b(P), { class: "select-indicator" }, {
473
+ default: w(() => [...f[2] ||= [a("svg", {
474
+ width: "12",
475
+ height: "12",
476
+ viewBox: "0 0 12 12",
477
+ fill: "none",
478
+ stroke: "currentColor",
479
+ "stroke-width": "2",
480
+ "stroke-linecap": "round",
481
+ "stroke-linejoin": "round"
482
+ }, [a("path", { d: "M2 6L5 9L10 3" })], -1)]]),
483
+ _: 1
484
+ })]),
485
+ _: 2
486
+ }, 1032, ["value"]))), 128))]),
487
+ _: 1
488
+ })]),
489
+ _: 1
490
+ })]),
491
+ _: 1
492
+ })]),
493
+ _: 1
494
+ }, 8, ["modelValue"])]));
495
+ }
496
+ }), [["__scopeId", "data-v-fa2f5d92"]]), Ie = ["data-collapsed"], Le = { class: "SidebarRail" }, Re = { class: "Sidebar" }, ze = { class: "SidebarScroll" }, Be = { class: "SidebarHeader" }, Ve = { class: "Main" }, He = { class: "TabsBar" }, Ue = { class: "TabsBarEnd" }, We = { class: "MainScroll" }, Ge = { class: "MainContent" }, Ke = { class: "Topbar" }, qe = { class: "TopbarEnd" }, Je = { class: "MainScroll" }, Ye = { class: "MainContent" }, Xe = /* @__PURE__ */ X(/* @__PURE__ */ c({
497
+ __name: "SidebarLayout",
498
+ props: /* @__PURE__ */ u({
499
+ hideTopbar: { type: Boolean },
500
+ tabs: {}
501
+ }, {
502
+ tab: {},
503
+ tabModifiers: {}
504
+ }),
505
+ emits: ["update:tab"],
506
+ setup(c) {
507
+ let u = l(), d = u?.appContext.config.globalProperties.$router, f = u?.appContext.config.globalProperties.$route, S = c, T = x(c, "tab"), E = window.matchMedia("(max-width: 767px)"), D = g(E.matches), O = g(E.matches);
508
+ function k(e) {
509
+ D.value = e.matches, O.value = e.matches;
510
+ }
511
+ p(() => {
512
+ E.addEventListener("change", k);
513
+ }), m(() => {
514
+ E.removeEventListener("change", k);
515
+ });
516
+ function A() {
517
+ O.value = !O.value;
518
+ }
519
+ let j = t(() => !!d && S.tabs?.some((e) => e.to)), M = t({
520
+ get() {
521
+ return T.value ?? S.tabs?.[0]?.value;
522
+ },
523
+ set(e) {
524
+ if (e && (T.value = e, j.value && d)) {
525
+ let t = S.tabs?.find((t) => t.value === e);
526
+ t?.to && d.push(t.to);
527
+ }
528
+ }
529
+ });
530
+ return f && C(() => f.path, () => {
531
+ if (j.value) {
532
+ let e = S.tabs?.find((e) => e.to === f.path);
533
+ e && (T.value = e.value);
534
+ }
535
+ }, { immediate: !0 }), (t, l) => (h(), i("div", {
536
+ class: "SidebarLayout",
537
+ "data-collapsed": O.value
538
+ }, [a("div", Le, [a("aside", Re, [a("div", ze, [a("div", Be, [a("button", {
539
+ type: "button",
540
+ class: "Toggle",
541
+ "aria-label": "Collapse sidebar",
542
+ title: "Collapse sidebar",
543
+ onClick: A
544
+ }, [s(Z, {
545
+ icon: "keyboard_double_arrow_left",
546
+ size: "sm"
547
+ })])]), v(t.$slots, "sidebar", {}, void 0, !0)])]), a("button", {
548
+ type: "button",
549
+ class: "Toggle Toggle--expand",
550
+ "aria-label": "Expand sidebar",
551
+ title: "Expand sidebar",
552
+ onClick: A
553
+ }, [s(Z, {
554
+ icon: "keyboard_double_arrow_right",
555
+ size: "sm"
556
+ })])]), a("main", Ve, [c.tabs?.length ? (h(), n(b(Y), {
557
+ key: 0,
558
+ "model-value": M.value,
559
+ class: "TabsLayout",
560
+ "onUpdate:modelValue": l[0] ||= (e) => M.value = e
561
+ }, {
562
+ default: w(() => [a("div", He, [
563
+ D.value && O.value ? (h(), i("button", {
564
+ key: 0,
565
+ type: "button",
566
+ class: "Toggle",
567
+ "aria-label": "Expand sidebar",
568
+ title: "Expand sidebar",
569
+ onClick: A
570
+ }, [s(Z, {
571
+ icon: "keyboard_double_arrow_right",
572
+ size: "sm"
573
+ })])) : r("", !0),
574
+ s(b(J), {
575
+ class: "TabsList",
576
+ "aria-label": "Tabs"
577
+ }, {
578
+ default: w(() => [(h(!0), i(e, null, _(c.tabs, (e) => (h(), n(b(ee), {
579
+ key: e.value,
580
+ value: e.value,
581
+ class: "TabsTrigger"
582
+ }, {
583
+ default: w(() => [o(y(e.label), 1)]),
584
+ _: 2
585
+ }, 1032, ["value"]))), 128)), s(b(q), {
586
+ class: "TabsIndicator",
587
+ style: {
588
+ width: "var(--reka-tabs-indicator-size)",
589
+ left: "var(--reka-tabs-indicator-position)"
590
+ }
591
+ })]),
592
+ _: 1
593
+ }),
594
+ a("div", Ue, [v(t.$slots, "topbar", {}, void 0, !0), c.hideTopbar ? r("", !0) : (h(), n($, { key: 0 }))])
595
+ ]), a("div", We, [a("div", Ge, [v(t.$slots, "default", {}, void 0, !0)])])]),
596
+ _: 3
597
+ }, 8, ["model-value"])) : (h(), i(e, { key: 1 }, [a("div", Ke, [D.value && O.value ? (h(), i("button", {
598
+ key: 0,
599
+ type: "button",
600
+ class: "Toggle",
601
+ "aria-label": "Expand sidebar",
602
+ title: "Expand sidebar",
603
+ onClick: A
604
+ }, [s(Z, {
605
+ icon: "keyboard_double_arrow_right",
606
+ size: "sm"
607
+ })])) : r("", !0), a("div", qe, [v(t.$slots, "topbar", {}, void 0, !0), c.hideTopbar ? r("", !0) : (h(), n($, { key: 0 }))])]), a("div", Je, [a("div", Ye, [v(t.$slots, "default", {}, void 0, !0)])])], 64))])], 8, Ie));
608
+ }
609
+ }), [["__scopeId", "data-v-b7035d57"]]), Ze = ["data-size", "aria-label"], Qe = /* @__PURE__ */ c({
610
+ __name: "Spinner",
611
+ props: {
612
+ size: { default: "sm" },
613
+ label: {}
614
+ },
615
+ setup(e) {
616
+ return (t, n) => (h(), i("span", {
617
+ class: "Spinner",
618
+ "data-size": e.size,
619
+ role: "status",
620
+ "aria-label": e.label ?? "Loading"
621
+ }, null, 8, Ze));
622
+ }
623
+ }), $e = {
624
+ key: 0,
625
+ class: "input-label"
626
+ }, et = { class: "input-label-row" }, tt = ["placeholder"], nt = { key: 1 }, rt = ["placeholder"], it = /* @__PURE__ */ X(/* @__PURE__ */ c({
627
+ __name: "TextInput",
628
+ props: /* @__PURE__ */ u({
629
+ label: {},
630
+ placeholder: {},
631
+ hint: {}
632
+ }, {
633
+ modelValue: {},
634
+ modelModifiers: {}
635
+ }),
636
+ emits: ["update:modelValue"],
637
+ setup(e) {
638
+ let t = x(e, "modelValue"), s = g(t.value);
639
+ C(t, (e) => {
640
+ s.value = e;
641
+ });
642
+ function c() {
643
+ t.value = s.value;
644
+ }
645
+ let l = e;
646
+ return (e, t) => l.label ? (h(), i("label", $e, [a("span", et, [o(y(l.label) + " ", 1), l.hint ? (h(), n(Q, {
647
+ key: 0,
648
+ text: l.hint
649
+ }, null, 8, ["text"])) : r("", !0)]), T(a("input", {
650
+ type: "text",
651
+ "onUpdate:modelValue": t[0] ||= (e) => s.value = e,
652
+ placeholder: l.placeholder,
653
+ onBlur: c,
654
+ onKeydown: E(c, ["enter"])
655
+ }, null, 40, tt), [[S, s.value]])])) : (h(), i("div", nt, [T(a("input", {
656
+ type: "text",
657
+ "onUpdate:modelValue": t[1] ||= (e) => s.value = e,
658
+ placeholder: l.placeholder,
659
+ onBlur: c,
660
+ onKeydown: E(c, ["enter"])
661
+ }, null, 40, rt), [[S, s.value]])]));
662
+ }
663
+ }), [["__scopeId", "data-v-2810bbb3"]]), at = { class: "toggle" }, ot = ["for"], st = /* @__PURE__ */ X(/* @__PURE__ */ c({
664
+ __name: "Toggle",
665
+ props: /* @__PURE__ */ u({
666
+ label: {},
667
+ hint: {},
668
+ disabled: { type: Boolean }
669
+ }, {
670
+ modelValue: { type: Boolean },
671
+ modelModifiers: {}
672
+ }),
673
+ emits: ["update:modelValue"],
674
+ setup(e) {
675
+ let t = x(e, "modelValue"), o = e, c = se();
676
+ return (l, u) => (h(), i("div", at, [
677
+ a("label", { for: b(c) }, y(e.label), 9, ot),
678
+ o.hint ? (h(), n(Q, {
679
+ key: 0,
680
+ text: o.hint
681
+ }, null, 8, ["text"])) : r("", !0),
682
+ s(b(G), {
683
+ id: b(c),
684
+ modelValue: t.value,
685
+ "onUpdate:modelValue": u[0] ||= (e) => t.value = e,
686
+ disabled: e.disabled,
687
+ class: "switch"
688
+ }, {
689
+ default: w(() => [s(b(K), { class: "thumb" })]),
690
+ _: 1
691
+ }, 8, [
692
+ "id",
693
+ "modelValue",
694
+ "disabled"
695
+ ])
696
+ ]));
697
+ }
698
+ }), [["__scopeId", "data-v-9916c71e"]]);
699
+ //#endregion
700
+ export { ue as Box, de as Button, fe as Expander, Q as Hint, Z as Icon, $ as LightDarkToggle, Me as NumberInput, Fe as SelectBox, Xe as SidebarLayout, Qe as Spinner, it as TextInput, st as Toggle };