veloce-vue 0.14.0 → 0.16.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 (79) hide show
  1. package/components/icon/Icon.vue.d.ts +24 -0
  2. package/components/icon/icons.d.ts +9 -0
  3. package/components/icon/index.d.ts +6 -9
  4. package/config.js +16 -0
  5. package/exports/config.d.ts +1 -0
  6. package/exports/icons.d.ts +1 -0
  7. package/exports/lib.d.ts +1 -0
  8. package/exports/ui.d.ts +2 -0
  9. package/icons.js +6 -0
  10. package/index-DETZgETo.js +147 -0
  11. package/lib/utils.d.ts +2 -0
  12. package/package.json +17 -29
  13. package/ui/accordion/Accordion.vue.d.ts +13 -0
  14. package/ui/accordion/AccordionContent.vue.d.ts +22 -0
  15. package/ui/accordion/AccordionItem.vue.d.ts +22 -0
  16. package/ui/accordion/AccordionRoot.vue.d.ts +24 -0
  17. package/ui/accordion/AccordionTrigger.vue.d.ts +23 -0
  18. package/ui/accordion/index.d.ts +5 -0
  19. package/ui/button/Button.vue.d.ts +31 -0
  20. package/ui/button/index.d.ts +8 -0
  21. package/ui.js +4050 -0
  22. package/utils/config.d.ts +10 -2
  23. package/veloce.css +1 -0
  24. package/README.md +0 -151
  25. package/components/accordion/Index.vue.d.ts +0 -31
  26. package/components/accordion/stories.d.ts +0 -10
  27. package/components/button/Index.vue.d.ts +0 -82
  28. package/components/button/props.d.ts +0 -37
  29. package/components/button/stories.d.ts +0 -23
  30. package/components/checkbox/Index.vue.d.ts +0 -43
  31. package/components/checkbox/props.d.ts +0 -14
  32. package/components/checkbox/stories.d.ts +0 -9
  33. package/components/drawer/Index.vue.d.ts +0 -77
  34. package/components/drawer/props.d.ts +0 -23
  35. package/components/drawer/stories.d.ts +0 -9
  36. package/components/icon/index.vue.d.ts +0 -10
  37. package/components/input/Index.vue.d.ts +0 -54
  38. package/components/input/props.d.ts +0 -19
  39. package/components/input/stories.d.ts +0 -9
  40. package/components/markdown-block/Index.vue.d.ts +0 -12
  41. package/components/modal/Index.vue.d.ts +0 -29
  42. package/components/modal/props.d.ts +0 -6
  43. package/components/modal/stories.d.ts +0 -6
  44. package/components/popover/Index.vue.d.ts +0 -47
  45. package/components/popover/props.d.ts +0 -15
  46. package/components/popover/stories.d.ts +0 -7
  47. package/components/range-slider/Index.vue.d.ts +0 -28
  48. package/components/range-slider/props.d.ts +0 -10
  49. package/components/range-slider/stories.d.ts +0 -7
  50. package/components/select/Index.vue.d.ts +0 -67
  51. package/components/select/props.d.ts +0 -27
  52. package/components/select/stories.d.ts +0 -11
  53. package/components/separator/Index.vue.d.ts +0 -44
  54. package/components/separator/props.d.ts +0 -19
  55. package/components/separator/stories.d.ts +0 -7
  56. package/components/toggle/Index.vue.d.ts +0 -36
  57. package/components/toggle/props.d.ts +0 -11
  58. package/components/toggle/stories.d.ts +0 -11
  59. package/components/tooltip/Index.vue.d.ts +0 -47
  60. package/components/tooltip/props.d.ts +0 -15
  61. package/components/tooltip/stories.d.ts +0 -10
  62. package/exports.d.ts +0 -12
  63. package/icons/alert.vue.d.ts +0 -3
  64. package/icons/check.vue.d.ts +0 -3
  65. package/icons/chevron-down.vue.d.ts +0 -3
  66. package/icons/close.vue.d.ts +0 -3
  67. package/icons/loading.vue.d.ts +0 -3
  68. package/index.cjs +0 -2
  69. package/index.cjs.map +0 -1
  70. package/index.js +0 -813
  71. package/index.js.map +0 -1
  72. package/pages/Home/Index.vue.d.ts +0 -3
  73. package/pages/Home/stories.d.ts +0 -6
  74. package/pages/config/Index.vue.d.ts +0 -3
  75. package/pages/config/stories.d.ts +0 -10
  76. package/types/config.d.ts +0 -9
  77. package/utils/storyControls.d.ts +0 -4
  78. package/utils/useRandomId.d.ts +0 -1
  79. package/veloce-vue.css +0 -1
package/index.js DELETED
@@ -1,813 +0,0 @@
1
- import { defineComponent as x, ref as _, resolveComponent as G, createElementBlock as i, openBlock as r, Fragment as E, renderList as F, createElementVNode as a, createCommentVNode as y, createVNode as S, toDisplayString as $, normalizeClass as h, renderSlot as C, createTextVNode as K, computed as M, createBlock as j, resolveDynamicComponent as ee, mergeModels as R, useModel as W, withDirectives as Q, vModelDynamic as te, watch as P, onMounted as oe, onUnmounted as se, normalizeStyle as V, getCurrentScope as le, onScopeDispose as ne, toValue as L, unref as re, useTemplateRef as ae, vModelText as ie } from "vue";
2
- const ue = { class: "w-full divide-y divide-gray-200 overflow-hidden rounded-xl border border-slate-200 bg-white shadow" }, de = ["onClick"], ce = { class: "title" }, pe = {
3
- key: 0,
4
- class: "text-text p-3"
5
- }, fe = {
6
- key: 1,
7
- class: "px-3 py-6 text-center text-gray-500"
8
- }, wt = /* @__PURE__ */ x({
9
- __name: "Index",
10
- props: {
11
- items: { type: Array, required: !0 }
12
- },
13
- setup(o) {
14
- const e = _(null);
15
- return (t, l) => {
16
- const n = G("Icon");
17
- return r(), i("div", ue, [
18
- o.items.length ? (r(!0), i(E, { key: 0 }, F(o.items, (s, u) => (r(), i("div", { key: u }, [
19
- a("div", {
20
- class: "text-text relative flex cursor-pointer justify-between gap-4 p-3 font-medium duration-100 hover:bg-gray-100",
21
- onClick: (d) => e.value = e.value === u ? null : u
22
- }, [
23
- a("span", ce, $(s.title), 1),
24
- S(n, {
25
- icon: "chevron-down",
26
- class: h([{ "rotate-180 ": e.value === u }, "icon text-[1.4rem] duration-200"])
27
- }, null, 8, ["class"])
28
- ], 8, de),
29
- e.value === u ? (r(), i("div", pe, [
30
- s.slot ? C(t.$slots, s.slot, { key: 0 }) : (r(), i(E, { key: 1 }, [
31
- K($(s.content), 1)
32
- ], 64))
33
- ])) : y("", !0)
34
- ]))), 128)) : (r(), i("div", fe, "No items to show"))
35
- ]);
36
- };
37
- }
38
- }), me = {
39
- label: { type: String, default: "" },
40
- loading: { type: Boolean, default: !1 },
41
- disabled: { type: Boolean, default: !1 },
42
- variant: {
43
- type: String,
44
- default: "solid",
45
- options: ["outlined", "text", "ghost", "solid", "gray"]
46
- },
47
- icon: { type: String, default: "" },
48
- iconClass: { type: String, default: "" },
49
- iconPosition: {
50
- type: String,
51
- default: "right",
52
- options: ["left", "right"]
53
- },
54
- rounded: { type: Boolean, default: !1 }
55
- }, ve = ["disabled"], O = /* @__PURE__ */ x({
56
- __name: "Index",
57
- props: me,
58
- setup(o) {
59
- const e = o, t = M(() => {
60
- switch (e.variant) {
61
- case "outlined":
62
- return "!border-primary text-primary bg-transparent hover:bg-primary disabled:hover:bg-transparent disabled:hover:text-primary hover:text-white";
63
- case "text":
64
- return "bg-transparent text-primary hover:bg-gray-200 disabled:hover:bg-transparent disabled:hover:text-primary";
65
- case "ghost":
66
- return "text-primary bg-gray-100 hover:bg-gray-200 disabled:hover:bg-transparent disabled:hover:text-primary";
67
- case "gray":
68
- return "bg-gray-100 text-gray-700 hover:bg-gray-200 disabled:hover:bg-gray-100 disabled:hover:text-gray-900";
69
- default:
70
- return "bg-primary text-white hover:bg-primary/75 disabled:hover:bg-primary disabled:hover:text-white";
71
- }
72
- });
73
- return (l, n) => {
74
- const s = G("Icon");
75
- return r(), i("button", {
76
- type: "button",
77
- disabled: e.disabled || e.loading,
78
- class: h([
79
- t.value,
80
- { "rounded-full": e.rounded },
81
- "flex cursor-pointer items-center justify-center gap-2 rounded border border-transparent px-3 py-2 transition duration-200 disabled:cursor-not-allowed disabled:opacity-75 "
82
- ])
83
- }, [
84
- a("div", {
85
- class: h([{ "justify-center": !e.icon }, "flex w-full items-center justify-between gap-2"])
86
- }, [
87
- e.label ? (r(), i("span", {
88
- key: 0,
89
- class: h({ "order-2": e.iconPosition === "left" })
90
- }, $(e.label), 3)) : y("", !0),
91
- e.icon && !e.loading ? (r(), j(s, {
92
- key: 1,
93
- icon: e.icon,
94
- class: h([e.iconClass, "duration-200 size-5 text-current"])
95
- }, null, 8, ["icon", "class"])) : y("", !0),
96
- e.loading ? (r(), j(s, {
97
- key: 2,
98
- icon: "loading",
99
- class: "duration-200 size-5 text-current"
100
- })) : y("", !0)
101
- ], 2)
102
- ], 10, ve);
103
- };
104
- }
105
- }), he = {
106
- label: { type: String, default: "" },
107
- labelClass: { type: String, default: "" },
108
- checkboxClass: { type: String, default: "" }
109
- }, T = (o, e) => {
110
- const t = o.__vccOpts || o;
111
- for (const [l, n] of e)
112
- t[l] = n;
113
- return t;
114
- }, ye = {}, ge = {
115
- xmlns: "http://www.w3.org/2000/svg",
116
- width: "24",
117
- height: "24",
118
- viewBox: "0 0 24 24"
119
- };
120
- function be(o, e) {
121
- return r(), i("svg", ge, [...e[0] || (e[0] = [
122
- a("path", {
123
- fill: "currentColor",
124
- d: "m9.55 15.15l8.475-8.475q.3-.3.7-.3t.7.3t.3.713t-.3.712l-9.175 9.2q-.3.3-.7.3t-.7-.3L4.55 13q-.3-.3-.288-.712t.313-.713t.713-.3t.712.3z"
125
- }, null, -1)
126
- ])]);
127
- }
128
- const we = /* @__PURE__ */ T(ye, [["render", be]]), xe = {}, ke = {
129
- xmlns: "http://www.w3.org/2000/svg",
130
- width: "24",
131
- height: "24",
132
- viewBox: "0 0 24 24"
133
- };
134
- function $e(o, e) {
135
- return r(), i("svg", ke, [...e[0] || (e[0] = [
136
- a("path", {
137
- fill: "currentColor",
138
- d: "m12 13.4l-4.9 4.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l4.9-4.9l-4.9-4.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.9 4.9l4.9-4.9q.275-.275.7-.275t.7.275t.275.7t-.275.7L13.4 12l4.9 4.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275z"
139
- }, null, -1)
140
- ])]);
141
- }
142
- const _e = /* @__PURE__ */ T(xe, [["render", $e]]), Ce = {}, Se = {
143
- xmlns: "http://www.w3.org/2000/svg",
144
- width: "24",
145
- height: "24",
146
- viewBox: "0 0 24 24"
147
- };
148
- function Le(o, e) {
149
- return r(), i("svg", Se, [...e[0] || (e[0] = [
150
- a("path", {
151
- fill: "currentColor",
152
- d: "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z",
153
- opacity: "0.25"
154
- }, null, -1),
155
- a("path", {
156
- fill: "currentColor",
157
- d: "M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
158
- }, [
159
- a("animateTransform", {
160
- type: "rotate",
161
- attributeName: "transform",
162
- dur: "0.75s",
163
- repeatCount: "indefinite",
164
- values: "0 12 12;360 12 12"
165
- })
166
- ], -1)
167
- ])]);
168
- }
169
- const Ee = /* @__PURE__ */ T(Ce, [["render", Le]]), Me = {}, Ie = {
170
- xmlns: "http://www.w3.org/2000/svg",
171
- width: "24",
172
- height: "24",
173
- viewBox: "-5 -8 24 24"
174
- };
175
- function ze(o, e) {
176
- return r(), i("svg", Ie, [...e[0] || (e[0] = [
177
- a("path", {
178
- fill: "currentColor",
179
- d: "m7.071 5.314l4.95-4.95a1 1 0 1 1 1.414 1.414L7.778 7.435a1 1 0 0 1-1.414 0L.707 1.778A1 1 0 1 1 2.121.364z"
180
- }, null, -1)
181
- ])]);
182
- }
183
- const Ve = /* @__PURE__ */ T(Me, [["render", ze]]), Ae = {}, Be = {
184
- xmlns: "http://www.w3.org/2000/svg",
185
- width: "24",
186
- height: "24",
187
- viewBox: "0 0 24 24"
188
- };
189
- function Oe(o, e) {
190
- return r(), i("svg", Be, [...e[0] || (e[0] = [
191
- a("g", { fill: "none" }, [
192
- a("path", {
193
- fill: "currentColor",
194
- "fill-opacity": "0.16",
195
- d: "M10.575 5.217L3.517 17a1.667 1.667 0 0 0 1.425 2.5h14.116a1.666 1.666 0 0 0 1.425-2.5L13.426 5.217a1.666 1.666 0 0 0-2.85 0"
196
- }),
197
- a("path", {
198
- stroke: "currentColor",
199
- "stroke-linecap": "round",
200
- "stroke-linejoin": "round",
201
- "stroke-miterlimit": "10",
202
- "stroke-width": "1.5",
203
- d: "M12 16h.008M12 10v3m-1.425-7.783L3.517 17a1.667 1.667 0 0 0 1.425 2.5h14.116a1.666 1.666 0 0 0 1.425-2.5L13.426 5.217a1.666 1.666 0 0 0-2.85 0"
204
- })
205
- ], -1)
206
- ])]);
207
- }
208
- const Te = /* @__PURE__ */ T(Ae, [["render", Oe]]), U = {
209
- check: we,
210
- close: _e,
211
- loading: Ee,
212
- "chevron-down": Ve,
213
- alert: Te
214
- }, H = /* @__PURE__ */ x({
215
- __name: "index",
216
- props: {
217
- icon: {},
218
- fallbackIcon: {},
219
- class: {},
220
- size: {}
221
- },
222
- setup(o) {
223
- const e = o, t = M(() => e.size ?? 24), l = M(() => {
224
- const n = e.icon, s = e.fallbackIcon ? e.fallbackIcon : "alert";
225
- return U[n] ?? U[s];
226
- });
227
- return (n, s) => (r(), j(ee(l.value), {
228
- class: h(["shrink-0", e.class]),
229
- width: t.value,
230
- height: t.value
231
- }, null, 8, ["class", "width", "height"]));
232
- }
233
- }), xt = /* @__PURE__ */ x({
234
- __name: "Index",
235
- props: /* @__PURE__ */ R(he, {
236
- modelValue: {},
237
- modelModifiers: {}
238
- }),
239
- emits: ["update:modelValue"],
240
- setup(o) {
241
- const e = W(o, "modelValue");
242
- return (t, l) => (r(), i("div", {
243
- class: "flex w-fit cursor-pointer gap-2 select-none",
244
- onClick: l[0] || (l[0] = (n) => e.value = !e.value)
245
- }, [
246
- a("div", {
247
- class: h([[{ "bg-primary": e.value }, t.checkboxClass], "border-primary m-0 size-6 rounded-sm border-2 duration-200"])
248
- }, [
249
- e.value ? (r(), j(H, {
250
- key: 0,
251
- icon: "check",
252
- class: h([{ "text-white": e.value }, "size-5"])
253
- }, null, 8, ["class"])) : y("", !0)
254
- ], 2),
255
- a("div", {
256
- class: h(t.labelClass)
257
- }, $(t.label), 3)
258
- ]));
259
- }
260
- }), je = {
261
- direction: { type: String, default: "bottom", options: ["left", "bottom", "right"] },
262
- title: { type: String, default: "" },
263
- description: { type: String, default: "" },
264
- showFooter: { type: Boolean, default: !1 },
265
- show: { type: Boolean, default: !1 }
266
- }, Pe = { class: "flex justify-between border-b border-gray-200 p-2" }, qe = { class: "font-semibold" }, De = { class: "text-sm text-gray-500" }, Ne = { class: "ml-auto" }, Fe = { class: "size-full overflow-auto p-2" }, Re = {
267
- key: 0,
268
- class: "border-t border-gray-200 p-2"
269
- }, kt = /* @__PURE__ */ x({
270
- __name: "Index",
271
- props: /* @__PURE__ */ R(je, {
272
- modelValue: {},
273
- modelModifiers: {}
274
- }),
275
- emits: ["update:modelValue"],
276
- setup(o) {
277
- const e = o, t = W(o, "modelValue"), l = M(() => {
278
- let s = "";
279
- switch (e.direction) {
280
- case "left":
281
- s = t.value ? "fixed top-0 left-0 bottom-0" : "fixed top-0 -left-full bottom-0";
282
- break;
283
- case "bottom":
284
- s = t.value ? "fixed left-0 bottom-0 right-0" : "fixed left-0 right-0 -bottom-full";
285
- break;
286
- case "right":
287
- s = t.value ? "fixed top-0 right-0 bottom-0" : "fixed top-0 -right-full bottom-0";
288
- break;
289
- default:
290
- alert("Invalid direction");
291
- }
292
- return s;
293
- }), n = M(() => {
294
- let s = "";
295
- switch (e.direction) {
296
- case "left":
297
- s = "w-full max-w-[360px]";
298
- break;
299
- case "bottom":
300
- s = "w-full h-full max-h-[90dvh]";
301
- break;
302
- case "right":
303
- s = "w-full max-w-[360px]";
304
- break;
305
- }
306
- return s;
307
- });
308
- return (s, u) => (r(), i(E, null, [
309
- a("div", {
310
- onClick: u[0] || (u[0] = (d) => t.value = !t.value)
311
- }, [
312
- C(s.$slots, "default")
313
- ]),
314
- a("div", {
315
- class: h([[l.value, n.value], "z-50 flex flex-col justify-between bg-white duration-300"])
316
- }, [
317
- a("div", Pe, [
318
- a("div", null, [
319
- a("h4", qe, $(s.title), 1),
320
- a("p", De, $(s.description), 1)
321
- ]),
322
- a("div", Ne, [
323
- S(O, {
324
- icon: "close",
325
- class: "!p-1",
326
- circle: "",
327
- variant: "text",
328
- onClick: u[1] || (u[1] = (d) => t.value = !1)
329
- })
330
- ])
331
- ]),
332
- a("div", Fe, [
333
- C(s.$slots, "content")
334
- ]),
335
- s.showFooter ? (r(), i("div", Re, [
336
- C(s.$slots, "footer")
337
- ])) : y("", !0)
338
- ], 2),
339
- a("div", {
340
- class: h([t.value ? "opacity-100" : "pointer-events-none", "fixed inset-0 z-[49] bg-black/40 opacity-0 duration-200"]),
341
- onClick: u[2] || (u[2] = (d) => t.value = !1)
342
- }, null, 2)
343
- ], 64));
344
- }
345
- }), We = {
346
- icon: { type: String, default: "" },
347
- placeholder: { type: String, default: "" },
348
- helpText: { type: String, default: "" },
349
- type: { type: String, default: "text", options: ["text", "password"] }
350
- }, Xe = ["type"], Ue = {
351
- key: 0,
352
- class: "ml-1 pt-1 text-xs text-gray-400"
353
- }, $t = /* @__PURE__ */ x({
354
- __name: "Index",
355
- props: /* @__PURE__ */ R(We, {
356
- modelValue: {},
357
- modelModifiers: {}
358
- }),
359
- emits: ["update:modelValue"],
360
- setup(o) {
361
- const e = W(o, "modelValue");
362
- return (t, l) => (r(), i("div", {
363
- class: h([{ "mb-6": t.helpText }, "relative h-[38px]"])
364
- }, [
365
- Q(a("input", {
366
- type: t.type,
367
- "onUpdate:modelValue": l[0] || (l[0] = (n) => e.value = n),
368
- class: "hover:border-primary/60 peer outline-primary h-full w-full rounded-md border border-gray-200 px-3 duration-200",
369
- placeholder: " "
370
- }, null, 8, Xe), [
371
- [te, e.value]
372
- ]),
373
- a("div", {
374
- class: h([e.value ? "-top-2.5 text-sm text-black" : "top-[6px]", "absolute left-3 bg-white px-[2px] text-black duration-100 peer-placeholder-shown:text-gray-400 peer-focus:-top-2.5 peer-focus:text-sm peer-focus:text-black"])
375
- }, $(t.placeholder), 3),
376
- t.helpText ? (r(), i("div", Ue, $(t.helpText), 1)) : y("", !0)
377
- ], 2));
378
- }
379
- }), Ze = {
380
- show: { type: Boolean, default: !1 }
381
- }, Ge = {
382
- key: 0,
383
- class: "fixed top-0 left-0 z-20 flex h-screen w-screen items-center justify-center backdrop-blur-[2px]"
384
- }, Ke = {
385
- class: "flex max-w-[600px] flex-col overflow-hidden rounded border border-gray-200 bg-white text-slate-500 shadow-xl shadow-slate-700/10 sm:max-h-[95dvh] sm:w-[90%]",
386
- role: "document"
387
- }, Qe = { class: "flex items-center gap-4 border-b border-gray-200 px-4 py-2" }, He = { class: "max-h-[calc(100dvh-100px)] flex-1 overflow-auto px-4 py-2 sm:max-h-[75vh]" }, Je = { class: "flex items-center justify-end gap-4 border-t border-gray-200 px-4 py-2" }, _t = /* @__PURE__ */ x({
388
- __name: "Index",
389
- props: Ze,
390
- emits: ["update:show"],
391
- setup(o, { emit: e }) {
392
- const t = o, l = e, n = _(t.show ?? !1);
393
- return P(
394
- () => t.show,
395
- (s) => {
396
- s !== n.value && (n.value = s);
397
- }
398
- ), P(n, (s) => {
399
- l("update:show", s), document.body.classList.toggle("overflow-hidden", s);
400
- }), (s, u) => (r(), i(E, null, [
401
- a("div", {
402
- class: "w-full",
403
- onClick: u[0] || (u[0] = (d) => n.value = !0)
404
- }, [
405
- C(s.$slots, "default")
406
- ]),
407
- n.value ? (r(), i("div", Ge, [
408
- a("div", Ke, [
409
- a("div", Qe, [
410
- u[4] || (u[4] = a("h3", { class: "text-primary flex-1 text-xl font-medium" }, "Modal title", -1)),
411
- S(O, {
412
- icon: "close",
413
- class: "!p-1",
414
- variant: "ghost",
415
- circle: "",
416
- onClick: u[1] || (u[1] = (d) => n.value = !1)
417
- })
418
- ]),
419
- a("div", He, [
420
- (r(), i(E, null, F(15, (d) => a("p", null, "Lorem ipsum dolor sit amet consectetur adipisicing elit. Nemo autem consequatur aspernatur animi voluptate quasi non, maxime iste, harum ipsa reiciendis laborum ad unde a sequi molestias? Dolore, obcaecati sed?")), 64))
421
- ]),
422
- a("div", Je, [
423
- S(O, {
424
- class: "!px-3 !py-1",
425
- variant: "ghost",
426
- label: "Close",
427
- onClick: u[2] || (u[2] = (d) => n.value = !1)
428
- }),
429
- S(O, {
430
- class: "!px-3 !py-1",
431
- label: "Save",
432
- onClick: u[3] || (u[3] = (d) => n.value = !1)
433
- })
434
- ])
435
- ])
436
- ])) : y("", !0)
437
- ], 64));
438
- }
439
- }), Ye = {
440
- position: { type: String, default: "bottom", options: ["top", "bottom"] },
441
- bodyClass: { type: String, default: "" },
442
- contentClass: { type: String, default: "" }
443
- }, Ct = /* @__PURE__ */ x({
444
- __name: "Index",
445
- props: Ye,
446
- setup(o) {
447
- const e = _(!0);
448
- return (t, l) => (r(), i("div", {
449
- class: "relative inline-block",
450
- onMouseleave: l[1] || (l[1] = (n) => e.value = !1)
451
- }, [
452
- a("div", {
453
- class: "relative",
454
- onMouseover: l[0] || (l[0] = (n) => e.value = !0)
455
- }, [
456
- e.value ? (r(), i("svg", {
457
- key: 0,
458
- class: h([{ "top-full": t.position === "bottom", "bottom-full rotate-180": t.position === "top" }, "absolute left-1/2 w-4 -translate-x-1/2 text-gray-200"]),
459
- xmlns: "http://www.w3.org/2000/svg",
460
- viewBox: "0 0 24 24"
461
- }, [...l[2] || (l[2] = [
462
- a("path", {
463
- fill: "currentColor",
464
- d: "M3 19h18a1.002 1.002 0 0 0 .823-1.569l-9-13c-.373-.539-1.271-.539-1.645 0l-9 13A.999.999 0 0 0 3 19"
465
- }, null, -1)
466
- ])], 2)) : y("", !0),
467
- C(t.$slots, "default")
468
- ], 32),
469
- e.value ? (r(), i("div", {
470
- key: 0,
471
- class: h([[t.bodyClass, { "bottom-full mb-3": t.position === "top" }, { "top-full mt-3": t.position === "bottom" }], "absolute left-1/2 z-10 w-fit -translate-x-1/2"])
472
- }, [
473
- a("div", {
474
- class: h([t.contentClass, "w-[200px] rounded-md border border-gray-200 bg-white p-3"])
475
- }, [
476
- C(t.$slots, "body")
477
- ], 2)
478
- ], 2)) : y("", !0)
479
- ], 32));
480
- }
481
- }), et = {
482
- showTooltip: { type: Boolean, default: !1 },
483
- value: { type: Number, default: 0 }
484
- }, tt = { class: "progress-container relative min-w-full py-4" }, ot = { class: "relative h-2 rounded-full bg-gray-200" }, St = /* @__PURE__ */ x({
485
- __name: "Index",
486
- props: et,
487
- emits: ["update:value"],
488
- setup(o, { emit: e }) {
489
- const t = o, l = e, n = _(t.value), s = _(!1), u = _(!1), d = (f) => {
490
- if (!s.value) return;
491
- const g = document.querySelector(".progress-container");
492
- if (!g) return;
493
- const b = g.getBoundingClientRect();
494
- let k;
495
- f instanceof TouchEvent ? k = f.touches[0]?.clientX ?? 0 : k = f.clientX;
496
- const I = k - b.left, A = Math.max(0, Math.min(100, I / b.width * 100));
497
- n.value = A, l("update:value", A);
498
- }, p = (f) => {
499
- s.value = !0, u.value = !0, d(f);
500
- }, m = () => {
501
- s.value = !1, u.value = !1;
502
- };
503
- return oe(() => {
504
- window.addEventListener("mousemove", d), window.addEventListener("mouseup", m), window.addEventListener("mouseleave", m), window.addEventListener("touchmove", d, { passive: !1 }), window.addEventListener("touchend", m), window.addEventListener("touchcancel", m);
505
- }), se(() => {
506
- window.removeEventListener("mousemove", d), window.removeEventListener("mouseup", m), window.removeEventListener("mouseleave", m), window.removeEventListener("touchmove", d), window.removeEventListener("touchend", m), window.removeEventListener("touchcancel", m);
507
- }), (f, g) => (r(), i("div", tt, [
508
- a("div", ot, [
509
- a("div", {
510
- class: "bg-primary absolute h-2 rounded-full",
511
- style: V({ width: n.value + "%" })
512
- }, null, 4),
513
- a("div", {
514
- class: "absolute top-1/2 -ml-2 flex h-4 w-4 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full border border-gray-300 bg-white shadow",
515
- style: V({ left: n.value + "%" }),
516
- unselectable: "on",
517
- onselectstart: "return false;",
518
- onMousedown: p,
519
- onTouchstart: p
520
- }, null, 36),
521
- u.value && f.showTooltip ? (r(), i("div", {
522
- key: 0,
523
- class: "absolute -top-9 mx-auto w-10 -translate-x-1/2 rounded bg-gray-800 px-2 py-1 text-xs text-white",
524
- style: V({ left: n.value + "%" })
525
- }, [
526
- K($(Math.round(n.value)) + "% ", 1),
527
- g[0] || (g[0] = a("span", { class: "absolute -bottom-1 left-1/2 -ml-1 h-2 w-2 rotate-45 bg-gray-800" }, null, -1))
528
- ], 4)) : y("", !0)
529
- ])
530
- ]));
531
- }
532
- }), st = {
533
- modelValue: { type: String, default: "" },
534
- options: { type: Array, required: !0 },
535
- variant: { type: String, default: "solid", options: ["outlined", "text", "ghost", "solid", "gray"] },
536
- showFilter: { type: Boolean, default: !1 },
537
- isOpen: { type: Boolean, default: !1 },
538
- closeOnClickOutside: { type: Boolean, default: !0 }
539
- };
540
- function lt(o) {
541
- return le() ? (ne(o), !0) : !1;
542
- }
543
- const J = typeof window < "u" && typeof document < "u";
544
- typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
545
- const nt = Object.prototype.toString, rt = (o) => nt.call(o) === "[object Object]", z = () => {
546
- }, at = /* @__PURE__ */ it();
547
- function it() {
548
- var o, e;
549
- return J && ((o = window?.navigator) == null ? void 0 : o.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((e = window?.navigator) == null ? void 0 : e.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window?.navigator.userAgent));
550
- }
551
- function D(o) {
552
- return Array.isArray(o) ? o : [o];
553
- }
554
- function ut(o, e, t) {
555
- return P(
556
- o,
557
- e,
558
- {
559
- ...t,
560
- immediate: !0
561
- }
562
- );
563
- }
564
- const Y = J ? window : void 0;
565
- function B(o) {
566
- var e;
567
- const t = L(o);
568
- return (e = t?.$el) != null ? e : t;
569
- }
570
- function N(...o) {
571
- const e = [], t = () => {
572
- e.forEach((d) => d()), e.length = 0;
573
- }, l = (d, p, m, f) => (d.addEventListener(p, m, f), () => d.removeEventListener(p, m, f)), n = M(() => {
574
- const d = D(L(o[0])).filter((p) => p != null);
575
- return d.every((p) => typeof p != "string") ? d : void 0;
576
- }), s = ut(
577
- () => {
578
- var d, p;
579
- return [
580
- (p = (d = n.value) == null ? void 0 : d.map((m) => B(m))) != null ? p : [Y].filter((m) => m != null),
581
- D(L(n.value ? o[1] : o[0])),
582
- D(re(n.value ? o[2] : o[1])),
583
- // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
584
- L(n.value ? o[3] : o[2])
585
- ];
586
- },
587
- ([d, p, m, f]) => {
588
- if (t(), !d?.length || !p?.length || !m?.length)
589
- return;
590
- const g = rt(f) ? { ...f } : f;
591
- e.push(
592
- ...d.flatMap(
593
- (b) => p.flatMap(
594
- (k) => m.map((I) => l(b, k, I, g))
595
- )
596
- )
597
- );
598
- },
599
- { flush: "post" }
600
- ), u = () => {
601
- s(), t();
602
- };
603
- return lt(t), u;
604
- }
605
- let Z = !1;
606
- function dt(o, e, t = {}) {
607
- const { window: l = Y, ignore: n = [], capture: s = !0, detectIframe: u = !1, controls: d = !1 } = t;
608
- if (!l)
609
- return d ? { stop: z, cancel: z, trigger: z } : z;
610
- if (at && !Z) {
611
- Z = !0;
612
- const c = { passive: !0 };
613
- Array.from(l.document.body.children).forEach((v) => v.addEventListener("click", z, c)), l.document.documentElement.addEventListener("click", z, c);
614
- }
615
- let p = !0;
616
- const m = (c) => L(n).some((v) => {
617
- if (typeof v == "string")
618
- return Array.from(l.document.querySelectorAll(v)).some((w) => w === c.target || c.composedPath().includes(w));
619
- {
620
- const w = B(v);
621
- return w && (c.target === w || c.composedPath().includes(w));
622
- }
623
- });
624
- function f(c) {
625
- const v = L(c);
626
- return v && v.$.subTree.shapeFlag === 16;
627
- }
628
- function g(c, v) {
629
- const w = L(c), q = w.$.subTree && w.$.subTree.children;
630
- return q == null || !Array.isArray(q) ? !1 : q.some((X) => X.el === v.target || v.composedPath().includes(X.el));
631
- }
632
- const b = (c) => {
633
- const v = B(o);
634
- if (c.target != null && !(!(v instanceof Element) && f(o) && g(o, c)) && !(!v || v === c.target || c.composedPath().includes(v))) {
635
- if ("detail" in c && c.detail === 0 && (p = !m(c)), !p) {
636
- p = !0;
637
- return;
638
- }
639
- e(c);
640
- }
641
- };
642
- let k = !1;
643
- const I = [
644
- N(l, "click", (c) => {
645
- k || (k = !0, setTimeout(() => {
646
- k = !1;
647
- }, 0), b(c));
648
- }, { passive: !0, capture: s }),
649
- N(l, "pointerdown", (c) => {
650
- const v = B(o);
651
- p = !m(c) && !!(v && !c.composedPath().includes(v));
652
- }, { passive: !0 }),
653
- u && N(l, "blur", (c) => {
654
- setTimeout(() => {
655
- var v;
656
- const w = B(o);
657
- ((v = l.document.activeElement) == null ? void 0 : v.tagName) === "IFRAME" && !w?.contains(l.document.activeElement) && e(c);
658
- }, 0);
659
- }, { passive: !0 })
660
- ].filter(Boolean), A = () => I.forEach((c) => c());
661
- return d ? {
662
- stop: A,
663
- cancel: () => {
664
- p = !1;
665
- },
666
- trigger: (c) => {
667
- p = !0, b(c), p = !1;
668
- }
669
- } : A;
670
- }
671
- const ct = {
672
- key: 0,
673
- class: "absolute top-full z-10 mt-1 flex w-full list-none flex-col rounded border border-gray-200 bg-white shadow-md shadow-slate-500/10"
674
- }, pt = {
675
- key: 0,
676
- class: "border-b border-gray-200 p-2"
677
- }, ft = ["onClick"], Lt = /* @__PURE__ */ x({
678
- __name: "Index",
679
- props: st,
680
- emits: ["update:modelValue", "update:isOpen"],
681
- setup(o, { emit: e }) {
682
- const t = o, l = e, n = _(t.modelValue), s = _(t.isOpen ?? !1), u = ae("target");
683
- dt(u, () => t.closeOnClickOutside && (s.value = !1)), P(
684
- () => t.isOpen,
685
- (f) => {
686
- f !== s.value && (s.value = f);
687
- }
688
- );
689
- const d = (f) => {
690
- n.value = f, l("update:modelValue", f), s.value = !1;
691
- }, p = _(""), m = M(() => p.value ? t.options.filter((f) => f.toLowerCase().includes(p.value.toLowerCase())) : t.options);
692
- return (f, g) => (r(), i("div", {
693
- class: "relative",
694
- ref_key: "target",
695
- ref: u
696
- }, [
697
- S(O, {
698
- "icon-class": s.value ? "rotate-180" : "",
699
- icon: "chevron-down",
700
- class: "w-full capitalize",
701
- variant: f.variant,
702
- label: n.value || "Select",
703
- onClick: g[0] || (g[0] = (b) => s.value = !s.value)
704
- }, null, 8, ["icon-class", "variant", "label"]),
705
- s.value ? (r(), i("ul", ct, [
706
- f.showFilter ? (r(), i("li", pt, [
707
- Q(a("input", {
708
- type: "text",
709
- "onUpdate:modelValue": g[1] || (g[1] = (b) => p.value = b),
710
- class: "focus:border-primary w-full rounded-sm border border-gray-200 px-2 py-1 focus:outline-none",
711
- placeholder: "Search"
712
- }, null, 512), [
713
- [ie, p.value]
714
- ])
715
- ])) : y("", !0),
716
- (r(!0), i(E, null, F(m.value, (b, k) => (r(), i("li", {
717
- key: k,
718
- class: h([b === n.value && "bg-primary/10", "hover:bg-primary/5 cursor-pointer px-4 py-2 text-left"]),
719
- onClick: (I) => d(b)
720
- }, $(b), 11, ft))), 128))
721
- ])) : y("", !0)
722
- ], 512));
723
- }
724
- }), mt = {
725
- direction: { type: String, default: "horizontal", options: ["horizontal", "vertical"] },
726
- color: { type: String, default: "" },
727
- label: { type: String, default: "" },
728
- icon: { type: String, default: "" }
729
- }, vt = {
730
- key: 1,
731
- class: "absolute inset-0 m-auto flex h-fit w-fit shrink-0 items-center justify-center bg-white p-1"
732
- }, Et = /* @__PURE__ */ x({
733
- __name: "Index",
734
- props: mt,
735
- setup(o) {
736
- return (e, t) => (r(), i("div", {
737
- class: h([e.direction === "horizontal" ? "h-[1px] w-full" : e.direction === "vertical" ? "h-full w-[1px]" : "", "relative bg-gray-200"]),
738
- style: V({ backgroundColor: e.color || "var(--color-primary)" })
739
- }, [
740
- e.direction === "horizontal" ? (r(), i(E, { key: 0 }, [
741
- e.label && !e.icon ? (r(), i("span", {
742
- key: 0,
743
- class: "absolute inset-0 m-auto flex w-fit items-center justify-center rounded-sm border border-gray-100 bg-white px-1 py-2 text-sm",
744
- style: V({ color: e.color, borderColor: e.color })
745
- }, "Test label", 4)) : y("", !0),
746
- e.icon && !e.label ? (r(), i("span", vt, [
747
- S(H, {
748
- icon: e.icon,
749
- class: "size-6",
750
- style: V({ color: e.color || "var(--color-primary)" })
751
- }, null, 8, ["icon", "style"])
752
- ])) : y("", !0)
753
- ], 64)) : y("", !0)
754
- ], 6));
755
- }
756
- }), ht = {
757
- content: { type: String, default: "" },
758
- position: { type: String, default: "bottom", options: ["top", "bottom", "left", "right"] },
759
- bodyClass: { type: String, default: "" }
760
- }, yt = { key: 0 }, Mt = /* @__PURE__ */ x({
761
- __name: "Index",
762
- props: ht,
763
- setup(o) {
764
- const e = _(!1);
765
- return (t, l) => (r(), i("div", {
766
- class: "relative inline-block",
767
- onMouseenter: l[0] || (l[0] = (n) => e.value = !0),
768
- onMouseleave: l[1] || (l[1] = (n) => e.value = !1)
769
- }, [
770
- C(t.$slots, "default"),
771
- e.value ? (r(), i("div", {
772
- key: 0,
773
- class: h([
774
- "absolute z-10 w-max rounded-md bg-white px-3 py-2 text-sm text-primary border shadow-xl transition-opacity duration-200",
775
- t.position === "top" && "bottom-full left-1/2 mb-2 -translate-x-1/2",
776
- t.position === "bottom" && "top-full left-1/2 mt-2 -translate-x-1/2",
777
- t.position === "left" && "top-1/2 right-full mr-2 -translate-y-1/2",
778
- t.position === "right" && "top-1/2 left-full ml-2 -translate-y-1/2",
779
- t.bodyClass
780
- ])
781
- }, [
782
- t.content ? C(t.$slots, "body", { key: 1 }) : (r(), i("span", yt, $(t.content), 1))
783
- ], 2)) : y("", !0)
784
- ], 32));
785
- }
786
- }), It = (o) => ({
787
- install() {
788
- if (!o || !o.colors) {
789
- console.warn("No config provided for the theme settings");
790
- return;
791
- }
792
- gt(o.colors);
793
- }
794
- }), gt = (o) => {
795
- const e = document.documentElement;
796
- for (const t in o)
797
- o[t] && e.style.setProperty(`--ui-color-${t}`, o[t]);
798
- };
799
- export {
800
- wt as Accordion,
801
- O as Button,
802
- xt as Checkbox,
803
- kt as Drawer,
804
- $t as Input,
805
- _t as Modal,
806
- Ct as Popover,
807
- St as RangeSlider,
808
- Lt as Select,
809
- Et as Separator,
810
- Mt as Tooltip,
811
- It as config
812
- };
813
- //# sourceMappingURL=index.js.map