veloce-vue 0.11.0 → 0.12.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 (44) hide show
  1. package/README.md +22 -18
  2. package/components/{Button → button}/Index.vue.d.ts +1 -1
  3. package/components/checkbox/Index.vue.d.ts +43 -0
  4. package/components/checkbox/props.d.ts +14 -0
  5. package/components/checkbox/stories.d.ts +9 -0
  6. package/components/drawer/Index.vue.d.ts +77 -0
  7. package/components/drawer/props.d.ts +23 -0
  8. package/components/drawer/stories.d.ts +9 -0
  9. package/components/input/Index.vue.d.ts +54 -0
  10. package/components/input/props.d.ts +19 -0
  11. package/components/input/stories.d.ts +9 -0
  12. package/components/modal/Index.vue.d.ts +29 -0
  13. package/components/modal/props.d.ts +6 -0
  14. package/components/modal/stories.d.ts +6 -0
  15. package/components/popover/Index.vue.d.ts +47 -0
  16. package/components/popover/props.d.ts +15 -0
  17. package/components/popover/stories.d.ts +7 -0
  18. package/components/range-slider/Index.vue.d.ts +28 -0
  19. package/components/range-slider/props.d.ts +10 -0
  20. package/components/range-slider/stories.d.ts +7 -0
  21. package/components/select/Index.vue.d.ts +58 -0
  22. package/components/select/props.d.ts +23 -0
  23. package/components/select/stories.d.ts +11 -0
  24. package/components/separator/Index.vue.d.ts +44 -0
  25. package/components/separator/props.d.ts +19 -0
  26. package/components/separator/stories.d.ts +7 -0
  27. package/components/tooltip/Index.vue.d.ts +47 -0
  28. package/components/tooltip/props.d.ts +15 -0
  29. package/components/tooltip/stories.d.ts +10 -0
  30. package/exports.d.ts +11 -2
  31. package/index.cjs +1 -1
  32. package/index.cjs.map +1 -1
  33. package/index.js +609 -63
  34. package/index.js.map +1 -1
  35. package/package.json +1 -1
  36. package/pages/Home/stories.d.ts +30 -1
  37. package/pages/config/Index.vue.d.ts +3 -0
  38. package/pages/config/stories.d.ts +6 -0
  39. package/veloce-vue.css +1 -1
  40. /package/components/{Accordion → accordion}/Index.vue.d.ts +0 -0
  41. /package/components/{Accordion → accordion}/stories.d.ts +0 -0
  42. /package/components/{Button → button}/props.d.ts +0 -0
  43. /package/components/{Button → button}/stories.d.ts +0 -0
  44. /package/{composables → utils}/useRandomId.d.ts +0 -0
package/index.js CHANGED
@@ -1,5 +1,41 @@
1
- import { defineComponent as g, computed as h, resolveComponent as b, createElementBlock as o, openBlock as r, normalizeClass as i, createElementVNode as d, createBlock as p, createCommentVNode as l, toDisplayString as c, ref as v, Fragment as y, renderList as f, createVNode as _, renderSlot as x, createTextVNode as k } from "vue";
2
- const w = {
1
+ import { defineComponent as h, ref as b, resolveComponent as j, createElementBlock as n, openBlock as s, Fragment as _, renderList as I, createElementVNode as l, createCommentVNode as p, normalizeClass as u, createVNode as x, toDisplayString as y, renderSlot as g, createTextVNode as A, computed as k, createBlock as L, resolveDynamicComponent as P, mergeModels as B, useModel as E, watch as V, withDirectives as O, vModelDynamic as F, onMounted as X, onUnmounted as U, normalizeStyle as $, vModelText as Z } from "vue";
2
+ const R = { class: "w-full divide-y divide-gray-200 rounded border border-slate-200 bg-white" }, K = ["onClick"], Q = { class: "title text-gray-600" }, G = {
3
+ key: 0,
4
+ class: "p-3 text-gray-500"
5
+ }, H = {
6
+ key: 1,
7
+ class: "px-3 py-6 text-center text-gray-500"
8
+ }, Je = /* @__PURE__ */ h({
9
+ __name: "Index",
10
+ props: {
11
+ items: { type: Array, required: !0 }
12
+ },
13
+ setup(r) {
14
+ const e = b(null);
15
+ return (t, d) => {
16
+ const a = j("Icon");
17
+ return s(), n("div", R, [
18
+ r.items.length ? (s(!0), n(_, { key: 0 }, I(r.items, (o, i) => (s(), n("div", { key: i }, [
19
+ l("div", {
20
+ class: u([{ "bg-primary/5": e.value === i }, "hover:bg-primary/5 relative flex cursor-pointer justify-between gap-4 p-3 font-medium duration-100"]),
21
+ onClick: (c) => e.value = e.value === i ? null : i
22
+ }, [
23
+ l("span", Q, y(o.title), 1),
24
+ x(a, {
25
+ icon: "chevron-down",
26
+ class: u([{ "rotate-180": e.value === i }, "icon text-[1.4rem] text-gray-400 duration-200"])
27
+ }, null, 8, ["class"])
28
+ ], 10, K),
29
+ e.value === i ? (s(), n("div", G, [
30
+ o.slot ? g(t.$slots, o.slot, { key: 0 }) : (s(), n(_, { key: 1 }, [
31
+ A(y(o.content), 1)
32
+ ], 64))
33
+ ])) : p("", !0)
34
+ ]))), 128)) : (s(), n("div", H, "No items to show"))
35
+ ]);
36
+ };
37
+ }
38
+ }), J = {
3
39
  label: { type: String, default: "" },
4
40
  loading: { type: Boolean, default: !1 },
5
41
  disabled: { type: Boolean, default: !1 },
@@ -16,11 +52,11 @@ const w = {
16
52
  options: ["left", "right"]
17
53
  },
18
54
  rounded: { type: Boolean, default: !1 }
19
- }, C = ["disabled"], P = /* @__PURE__ */ g({
55
+ }, W = ["disabled"], C = /* @__PURE__ */ h({
20
56
  __name: "Index",
21
- props: w,
22
- setup(t) {
23
- const e = t, n = h(() => {
57
+ props: J,
58
+ setup(r) {
59
+ const e = r, t = k(() => {
24
60
  switch (e.variant) {
25
61
  case "outlined":
26
62
  return "!border-primary text-primary bg-transparent hover:bg-primary disabled:hover:bg-transparent disabled:hover:text-primary hover:text-white";
@@ -32,89 +68,599 @@ const w = {
32
68
  return "bg-primary text-white hover:bg-primary/75 disabled:hover:bg-primary disabled:hover:text-white";
33
69
  }
34
70
  });
35
- return (m, u) => {
36
- const a = b("Icon");
37
- return r(), o("button", {
71
+ return (d, a) => {
72
+ const o = j("Icon");
73
+ return s(), n("button", {
38
74
  type: "button",
39
75
  disabled: e.disabled || e.loading,
40
- class: i([
41
- n.value,
76
+ class: u([
77
+ t.value,
42
78
  { "rounded-full": e.rounded },
43
79
  "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 "
44
80
  ])
45
81
  }, [
46
- d("div", {
47
- class: i([{ "justify-center": !e.icon }, "flex w-full items-center justify-between gap-2"])
82
+ l("div", {
83
+ class: u([{ "justify-center": !e.icon }, "flex w-full items-center justify-between gap-2"])
48
84
  }, [
49
- e.label ? (r(), o("span", {
85
+ e.label ? (s(), n("span", {
50
86
  key: 0,
51
- class: i({ "order-2": e.iconPosition === "left" })
52
- }, c(e.label), 3)) : l("", !0),
53
- e.icon && !e.loading ? (r(), p(a, {
87
+ class: u({ "order-2": e.iconPosition === "left" })
88
+ }, y(e.label), 3)) : p("", !0),
89
+ e.icon && !e.loading ? (s(), L(o, {
54
90
  key: 1,
55
91
  icon: e.icon,
56
- class: i(e.iconClass)
57
- }, null, 8, ["icon", "class"])) : l("", !0)
92
+ class: u([e.iconClass, "duration-200"])
93
+ }, null, 8, ["icon", "class"])) : p("", !0)
58
94
  ], 2),
59
- e.loading ? (r(), p(a, {
95
+ e.loading ? (s(), L(o, {
60
96
  key: 0,
61
97
  icon: "loading"
62
- })) : l("", !0)
63
- ], 10, C);
98
+ })) : p("", !0)
99
+ ], 10, W);
64
100
  };
65
101
  }
66
- }), S = { class: "w-full divide-y divide-gray-200 rounded border border-slate-200 bg-white" }, B = ["onClick"], I = { class: "title text-gray-600" }, N = {
67
- key: 0,
68
- class: "p-3 text-gray-500"
69
- }, V = {
70
- key: 1,
71
- class: "px-3 py-6 text-center text-gray-500"
72
- }, A = /* @__PURE__ */ g({
73
- __name: "Index",
102
+ }), Y = {
103
+ label: { type: String, default: "" },
104
+ labelClass: { type: String, default: "" },
105
+ checkboxClass: { type: String, default: "" }
106
+ }, S = (r, e) => {
107
+ const t = r.__vccOpts || r;
108
+ for (const [d, a] of e)
109
+ t[d] = a;
110
+ return t;
111
+ }, ee = {}, te = {
112
+ xmlns: "http://www.w3.org/2000/svg",
113
+ width: "24",
114
+ height: "24",
115
+ viewBox: "0 0 24 24"
116
+ };
117
+ function oe(r, e) {
118
+ return s(), n("svg", te, [...e[0] || (e[0] = [
119
+ l("path", {
120
+ fill: "currentColor",
121
+ 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"
122
+ }, null, -1)
123
+ ])]);
124
+ }
125
+ const se = /* @__PURE__ */ S(ee, [["render", oe]]), le = {}, re = {
126
+ xmlns: "http://www.w3.org/2000/svg",
127
+ width: "24",
128
+ height: "24",
129
+ viewBox: "0 0 24 24"
130
+ };
131
+ function ne(r, e) {
132
+ return s(), n("svg", re, [...e[0] || (e[0] = [
133
+ l("path", {
134
+ fill: "currentColor",
135
+ 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"
136
+ }, null, -1)
137
+ ])]);
138
+ }
139
+ const ae = /* @__PURE__ */ S(le, [["render", ne]]), ie = {}, de = {
140
+ xmlns: "http://www.w3.org/2000/svg",
141
+ width: "24",
142
+ height: "24",
143
+ viewBox: "0 0 24 24"
144
+ };
145
+ function ue(r, e) {
146
+ return s(), n("svg", de, [...e[0] || (e[0] = [
147
+ l("path", {
148
+ fill: "currentColor",
149
+ 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",
150
+ opacity: "0.25"
151
+ }, null, -1),
152
+ l("path", {
153
+ fill: "currentColor",
154
+ 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"
155
+ }, [
156
+ l("animateTransform", {
157
+ type: "rotate",
158
+ attributeName: "transform",
159
+ dur: "0.75s",
160
+ repeatCount: "indefinite",
161
+ values: "0 12 12;360 12 12"
162
+ })
163
+ ], -1)
164
+ ])]);
165
+ }
166
+ const ce = /* @__PURE__ */ S(ie, [["render", ue]]), pe = {}, fe = {
167
+ xmlns: "http://www.w3.org/2000/svg",
168
+ width: "24",
169
+ height: "24",
170
+ viewBox: "-5 -8 24 24"
171
+ };
172
+ function me(r, e) {
173
+ return s(), n("svg", fe, [...e[0] || (e[0] = [
174
+ l("path", {
175
+ fill: "currentColor",
176
+ 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"
177
+ }, null, -1)
178
+ ])]);
179
+ }
180
+ const ve = /* @__PURE__ */ S(pe, [["render", me]]), he = {}, ye = {
181
+ xmlns: "http://www.w3.org/2000/svg",
182
+ width: "24",
183
+ height: "24",
184
+ viewBox: "0 0 24 24"
185
+ };
186
+ function be(r, e) {
187
+ return s(), n("svg", ye, [...e[0] || (e[0] = [
188
+ l("g", { fill: "none" }, [
189
+ l("path", {
190
+ fill: "currentColor",
191
+ "fill-opacity": "0.16",
192
+ 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"
193
+ }),
194
+ l("path", {
195
+ stroke: "currentColor",
196
+ "stroke-linecap": "round",
197
+ "stroke-linejoin": "round",
198
+ "stroke-miterlimit": "10",
199
+ "stroke-width": "1.5",
200
+ 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"
201
+ })
202
+ ], -1)
203
+ ])]);
204
+ }
205
+ const ge = /* @__PURE__ */ S(he, [["render", be]]), T = {
206
+ check: se,
207
+ close: ae,
208
+ loading: ce,
209
+ "chevron-down": ve,
210
+ alert: ge
211
+ }, D = /* @__PURE__ */ h({
212
+ __name: "index",
74
213
  props: {
75
- items: { type: Array, required: !0 }
214
+ icon: {},
215
+ fallbackIcon: {},
216
+ class: {},
217
+ size: {}
76
218
  },
77
- setup(t) {
78
- const e = v(null);
79
- return (n, m) => {
80
- const u = b("Icon");
81
- return r(), o("div", S, [
82
- t.items.length ? (r(!0), o(y, { key: 0 }, f(t.items, (a, s) => (r(), o("div", { key: s }, [
83
- d("div", {
84
- class: i([{ "bg-primary/5": e.value === s }, "hover:bg-primary/5 relative flex cursor-pointer justify-between gap-4 p-3 font-medium duration-100"]),
85
- onClick: (j) => e.value = e.value === s ? null : s
86
- }, [
87
- d("span", I, c(a.title), 1),
88
- _(u, {
89
- icon: "chevron-down",
90
- class: i([{ "rotate-180": e.value === s }, "icon text-[1.4rem] text-gray-400 duration-200"])
91
- }, null, 8, ["class"])
92
- ], 10, B),
93
- e.value === s ? (r(), o("div", N, [
94
- a.slot ? x(n.$slots, a.slot, { key: 0 }) : (r(), o(y, { key: 1 }, [
95
- k(c(a.content), 1)
96
- ], 64))
97
- ])) : l("", !0)
98
- ]))), 128)) : (r(), o("div", V, "No items to show"))
99
- ]);
219
+ setup(r) {
220
+ const e = r, t = k(() => e.size ?? 24), d = k(() => {
221
+ const a = e.icon, o = e.fallbackIcon ? e.fallbackIcon : "alert";
222
+ return T[a] ?? T[o];
223
+ });
224
+ return (a, o) => (s(), L(P(d.value), {
225
+ class: u(["shrink-0", e.class]),
226
+ width: t.value,
227
+ height: t.value
228
+ }, null, 8, ["class", "width", "height"]));
229
+ }
230
+ }), We = /* @__PURE__ */ h({
231
+ __name: "Index",
232
+ props: /* @__PURE__ */ B(Y, {
233
+ modelValue: {},
234
+ modelModifiers: {}
235
+ }),
236
+ emits: ["update:modelValue"],
237
+ setup(r) {
238
+ const e = E(r, "modelValue");
239
+ return (t, d) => (s(), n("div", {
240
+ class: "flex w-fit cursor-pointer gap-2 select-none",
241
+ onClick: d[0] || (d[0] = (a) => e.value = !e.value)
242
+ }, [
243
+ l("div", {
244
+ class: u([[{ "bg-primary": e.value }, t.checkboxClass], "border-primary m-0 size-6 rounded-sm border-2 duration-200"])
245
+ }, [
246
+ e.value ? (s(), L(D, {
247
+ key: 0,
248
+ icon: "check",
249
+ class: u([{ "text-white": e.value }, "size-5"])
250
+ }, null, 8, ["class"])) : p("", !0)
251
+ ], 2),
252
+ l("div", {
253
+ class: u(t.labelClass)
254
+ }, y(t.label), 3)
255
+ ]));
256
+ }
257
+ }), we = {
258
+ direction: { type: String, default: "bottom", options: ["left", "bottom", "right"] },
259
+ title: { type: String, default: "" },
260
+ description: { type: String, default: "" },
261
+ showFooter: { type: Boolean, default: !1 },
262
+ show: { type: Boolean, default: !1 }
263
+ }, xe = { class: "flex justify-between border-b border-gray-200 p-2" }, $e = { class: "font-semibold" }, _e = { class: "text-sm text-gray-500" }, ke = { class: "ml-auto" }, Ce = { class: "size-full overflow-auto p-2" }, Se = {
264
+ key: 0,
265
+ class: "border-t border-gray-200 p-2"
266
+ }, Ye = /* @__PURE__ */ h({
267
+ __name: "Index",
268
+ props: /* @__PURE__ */ B(we, {
269
+ modelValue: {},
270
+ modelModifiers: {}
271
+ }),
272
+ emits: ["update:modelValue"],
273
+ setup(r) {
274
+ const e = r, t = E(r, "modelValue"), d = k(() => {
275
+ let o = "";
276
+ switch (e.direction) {
277
+ case "left":
278
+ o = t.value ? "fixed top-0 left-0 bottom-0" : "fixed top-0 -left-full bottom-0";
279
+ break;
280
+ case "bottom":
281
+ o = t.value ? "fixed left-0 bottom-0 right-0" : "fixed left-0 right-0 -bottom-full";
282
+ break;
283
+ case "right":
284
+ o = t.value ? "fixed top-0 right-0 bottom-0" : "fixed top-0 -right-full bottom-0";
285
+ break;
286
+ default:
287
+ alert("Invalid direction");
288
+ }
289
+ return o;
290
+ }), a = k(() => {
291
+ let o = "";
292
+ switch (e.direction) {
293
+ case "left":
294
+ o = "w-full max-w-[360px]";
295
+ break;
296
+ case "bottom":
297
+ o = "w-full h-full max-h-[90dvh]";
298
+ break;
299
+ case "right":
300
+ o = "w-full max-w-[360px]";
301
+ break;
302
+ }
303
+ return o;
304
+ });
305
+ return V(t, () => {
306
+ t.value ? document.body.classList.add("overflow-hidden") : document.body.classList.remove("overflow-hidden");
307
+ }), (o, i) => (s(), n(_, null, [
308
+ l("div", {
309
+ onClick: i[0] || (i[0] = (c) => t.value = !t.value)
310
+ }, [
311
+ g(o.$slots, "default")
312
+ ]),
313
+ l("div", {
314
+ class: u([[d.value, a.value], "z-50 flex flex-col justify-between bg-white duration-300"])
315
+ }, [
316
+ l("div", xe, [
317
+ l("div", null, [
318
+ l("h4", $e, y(o.title), 1),
319
+ l("p", _e, y(o.description), 1)
320
+ ]),
321
+ l("div", ke, [
322
+ x(C, {
323
+ icon: "close",
324
+ class: "!p-1",
325
+ circle: "",
326
+ variant: "text",
327
+ onClick: i[1] || (i[1] = (c) => t.value = !1)
328
+ })
329
+ ])
330
+ ]),
331
+ l("div", Ce, [
332
+ g(o.$slots, "content")
333
+ ]),
334
+ o.showFooter ? (s(), n("div", Se, [
335
+ g(o.$slots, "footer")
336
+ ])) : p("", !0)
337
+ ], 2),
338
+ l("div", {
339
+ class: u([t.value ? "opacity-100" : "pointer-events-none", "fixed inset-0 z-[49] bg-black/40 opacity-0 duration-200"]),
340
+ onClick: i[2] || (i[2] = (c) => t.value = !1)
341
+ }, null, 2)
342
+ ], 64));
343
+ }
344
+ }), Le = {
345
+ icon: { type: String, default: "" },
346
+ placeholder: { type: String, default: "" },
347
+ helpText: { type: String, default: "" },
348
+ type: { type: String, default: "text", options: ["text", "password"] }
349
+ }, Me = ["type"], ze = {
350
+ key: 0,
351
+ class: "ml-1 pt-1 text-xs text-gray-400"
352
+ }, et = /* @__PURE__ */ h({
353
+ __name: "Index",
354
+ props: /* @__PURE__ */ B(Le, {
355
+ modelValue: {},
356
+ modelModifiers: {}
357
+ }),
358
+ emits: ["update:modelValue"],
359
+ setup(r) {
360
+ const e = E(r, "modelValue");
361
+ return (t, d) => (s(), n("div", {
362
+ class: u([{ "mb-6": t.helpText }, "relative h-[42px]"])
363
+ }, [
364
+ O(l("input", {
365
+ type: t.type,
366
+ "onUpdate:modelValue": d[0] || (d[0] = (a) => e.value = a),
367
+ class: "hover:border-primary/60 peer outline-primary h-full w-full rounded-md border border-gray-200 px-3 duration-200",
368
+ placeholder: " "
369
+ }, null, 8, Me), [
370
+ [F, e.value]
371
+ ]),
372
+ l("div", {
373
+ class: u([e.value ? "-top-2.5 text-sm text-black" : "top-[9px]", "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"])
374
+ }, y(t.placeholder), 3),
375
+ t.helpText ? (s(), n("div", ze, y(t.helpText), 1)) : p("", !0)
376
+ ], 2));
377
+ }
378
+ }), Ve = {
379
+ show: { type: Boolean, default: !1 }
380
+ }, Ie = {
381
+ key: 0,
382
+ class: "fixed top-0 left-0 z-20 flex h-screen w-screen items-center justify-center backdrop-blur-[2px]"
383
+ }, Be = {
384
+ 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%]",
385
+ role: "document"
386
+ }, Ee = { class: "flex items-center gap-4 border-b border-gray-200 px-4 py-2" }, qe = { class: "max-h-[calc(100dvh-100px)] flex-1 overflow-auto px-4 py-2 sm:max-h-[75vh]" }, Te = { class: "flex items-center justify-end gap-4 border-t border-gray-200 px-4 py-2" }, tt = /* @__PURE__ */ h({
387
+ __name: "Index",
388
+ props: Ve,
389
+ emits: ["update:show"],
390
+ setup(r, { emit: e }) {
391
+ const t = r, d = e, a = b(t.show ?? !1);
392
+ return V(
393
+ () => t.show,
394
+ (o) => {
395
+ o !== a.value && (a.value = o);
396
+ }
397
+ ), V(a, (o) => {
398
+ d("update:show", o), document.body.classList.toggle("overflow-hidden", o);
399
+ }), (o, i) => (s(), n(_, null, [
400
+ l("div", {
401
+ class: "w-full",
402
+ onClick: i[0] || (i[0] = (c) => a.value = !0)
403
+ }, [
404
+ g(o.$slots, "default")
405
+ ]),
406
+ a.value ? (s(), n("div", Ie, [
407
+ l("div", Be, [
408
+ l("div", Ee, [
409
+ i[4] || (i[4] = l("h3", { class: "text-primary flex-1 text-xl font-medium" }, "Modal title", -1)),
410
+ x(C, {
411
+ icon: "close",
412
+ class: "!p-1",
413
+ variant: "ghost",
414
+ circle: "",
415
+ onClick: i[1] || (i[1] = (c) => a.value = !1)
416
+ })
417
+ ]),
418
+ l("div", qe, [
419
+ (s(), n(_, null, I(15, (c) => l("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))
420
+ ]),
421
+ l("div", Te, [
422
+ x(C, {
423
+ class: "!px-3 !py-1",
424
+ variant: "ghost",
425
+ label: "Close",
426
+ onClick: i[2] || (i[2] = (c) => a.value = !1)
427
+ }),
428
+ x(C, {
429
+ class: "!px-3 !py-1",
430
+ label: "Save",
431
+ onClick: i[3] || (i[3] = (c) => a.value = !1)
432
+ })
433
+ ])
434
+ ])
435
+ ])) : p("", !0)
436
+ ], 64));
437
+ }
438
+ }), je = {
439
+ position: { type: String, default: "bottom", options: ["top", "bottom"] },
440
+ bodyClass: { type: String, default: "" },
441
+ contentClass: { type: String, default: "" }
442
+ }, ot = /* @__PURE__ */ h({
443
+ __name: "Index",
444
+ props: je,
445
+ setup(r) {
446
+ const e = b(!0);
447
+ return (t, d) => (s(), n("div", {
448
+ class: "relative inline-block",
449
+ onMouseleave: d[1] || (d[1] = (a) => e.value = !1)
450
+ }, [
451
+ l("div", {
452
+ class: "relative",
453
+ onMouseover: d[0] || (d[0] = (a) => e.value = !0)
454
+ }, [
455
+ e.value ? (s(), n("svg", {
456
+ key: 0,
457
+ class: u([{ "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"]),
458
+ xmlns: "http://www.w3.org/2000/svg",
459
+ viewBox: "0 0 24 24"
460
+ }, [...d[2] || (d[2] = [
461
+ l("path", {
462
+ fill: "currentColor",
463
+ 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"
464
+ }, null, -1)
465
+ ])], 2)) : p("", !0),
466
+ g(t.$slots, "default")
467
+ ], 32),
468
+ e.value ? (s(), n("div", {
469
+ key: 0,
470
+ class: u([[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"])
471
+ }, [
472
+ l("div", {
473
+ class: u([t.contentClass, "w-[200px] rounded-md border border-gray-200 bg-white p-3"])
474
+ }, [
475
+ g(t.$slots, "body")
476
+ ], 2)
477
+ ], 2)) : p("", !0)
478
+ ], 32));
479
+ }
480
+ }), Ae = {
481
+ showTooltip: { type: Boolean, default: !1 },
482
+ value: { type: Number, default: 0 }
483
+ }, Oe = { class: "progress-container relative min-w-full py-4" }, De = { class: "relative h-2 rounded-full bg-gray-200" }, st = /* @__PURE__ */ h({
484
+ __name: "Index",
485
+ props: Ae,
486
+ emits: ["update:value"],
487
+ setup(r, { emit: e }) {
488
+ const t = r, d = e, a = b(t.value), o = b(!1), i = b(!1), c = (m) => {
489
+ if (!o.value) return;
490
+ const w = document.querySelector(".progress-container");
491
+ if (!w) return;
492
+ const M = w.getBoundingClientRect();
493
+ let z;
494
+ m instanceof TouchEvent ? z = m.touches[0]?.clientX ?? 0 : z = m.clientX;
495
+ const N = z - M.left, q = Math.max(0, Math.min(100, N / M.width * 100));
496
+ a.value = q, d("update:value", q);
497
+ }, f = (m) => {
498
+ o.value = !0, i.value = !0, c(m);
499
+ }, v = () => {
500
+ o.value = !1, i.value = !1;
100
501
  };
502
+ return X(() => {
503
+ window.addEventListener("mousemove", c), window.addEventListener("mouseup", v), window.addEventListener("mouseleave", v), window.addEventListener("touchmove", c, { passive: !1 }), window.addEventListener("touchend", v), window.addEventListener("touchcancel", v);
504
+ }), U(() => {
505
+ window.removeEventListener("mousemove", c), window.removeEventListener("mouseup", v), window.removeEventListener("mouseleave", v), window.removeEventListener("touchmove", c), window.removeEventListener("touchend", v), window.removeEventListener("touchcancel", v);
506
+ }), (m, w) => (s(), n("div", Oe, [
507
+ l("div", De, [
508
+ l("div", {
509
+ class: "bg-primary absolute h-2 rounded-full",
510
+ style: $({ width: a.value + "%" })
511
+ }, null, 4),
512
+ l("div", {
513
+ 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",
514
+ style: $({ left: a.value + "%" }),
515
+ unselectable: "on",
516
+ onselectstart: "return false;",
517
+ onMousedown: f,
518
+ onTouchstart: f
519
+ }, null, 36),
520
+ i.value && m.showTooltip ? (s(), n("div", {
521
+ key: 0,
522
+ class: "absolute -top-9 mx-auto w-10 -translate-x-1/2 rounded bg-gray-800 px-2 py-1 text-xs text-white",
523
+ style: $({ left: a.value + "%" })
524
+ }, [
525
+ A(y(Math.round(a.value)) + "% ", 1),
526
+ w[0] || (w[0] = l("span", { class: "absolute -bottom-1 left-1/2 -ml-1 h-2 w-2 rotate-45 bg-gray-800" }, null, -1))
527
+ ], 4)) : p("", !0)
528
+ ])
529
+ ]));
530
+ }
531
+ }), Ne = {
532
+ modelValue: { type: String, default: "" },
533
+ options: { type: Array, required: !0 },
534
+ variant: { type: String, default: "solid", options: ["outlined", "text", "ghost", "solid"] },
535
+ showFilter: { type: Boolean, default: !1 },
536
+ isOpen: { type: Boolean, default: !1 }
537
+ }, Pe = { class: "relative" }, Fe = {
538
+ key: 0,
539
+ 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"
540
+ }, Xe = {
541
+ key: 0,
542
+ class: "border-b border-gray-200 p-2"
543
+ }, Ue = ["onClick"], lt = /* @__PURE__ */ h({
544
+ __name: "Index",
545
+ props: Ne,
546
+ emits: ["update:modelValue", "update:isOpen"],
547
+ setup(r, { emit: e }) {
548
+ const t = r, d = e, a = b(t.modelValue), o = (f) => {
549
+ a.value = f, d("update:modelValue", f), d("update:isOpen", !1);
550
+ }, i = b(""), c = k(() => i.value ? t.options.filter((f) => f.toLowerCase().includes(i.value.toLowerCase())) : t.options);
551
+ return (f, v) => (s(), n("div", Pe, [
552
+ x(C, {
553
+ "icon-class": f.isOpen ? "rotate-180" : "",
554
+ icon: "chevron-down",
555
+ class: "w-full",
556
+ variant: f.variant,
557
+ label: a.value || "Select",
558
+ onClick: v[0] || (v[0] = (m) => f.isOpen = !f.isOpen)
559
+ }, null, 8, ["icon-class", "variant", "label"]),
560
+ f.isOpen ? (s(), n("ul", Fe, [
561
+ f.showFilter ? (s(), n("li", Xe, [
562
+ O(l("input", {
563
+ type: "text",
564
+ "onUpdate:modelValue": v[1] || (v[1] = (m) => i.value = m),
565
+ class: "focus:border-primary w-full rounded-sm border border-gray-200 px-2 py-1 focus:outline-none",
566
+ placeholder: "Search"
567
+ }, null, 512), [
568
+ [Z, i.value]
569
+ ])
570
+ ])) : p("", !0),
571
+ (s(!0), n(_, null, I(c.value, (m, w) => (s(), n("li", {
572
+ key: w,
573
+ class: u([m === a.value && "bg-primary/10", "hover:bg-primary/5 cursor-pointer px-4 py-2"]),
574
+ onClick: (M) => o(m)
575
+ }, y(m), 11, Ue))), 128))
576
+ ])) : p("", !0)
577
+ ]));
578
+ }
579
+ }), Ze = {
580
+ direction: { type: String, default: "horizontal", options: ["horizontal", "vertical"] },
581
+ color: { type: String, default: "#16476A" },
582
+ label: { type: String, default: "" },
583
+ icon: { type: String, default: "" }
584
+ }, Re = {
585
+ key: 1,
586
+ class: "absolute inset-0 m-auto flex h-fit w-fit shrink-0 items-center justify-center bg-white p-1"
587
+ }, rt = /* @__PURE__ */ h({
588
+ __name: "Index",
589
+ props: Ze,
590
+ setup(r) {
591
+ return (e, t) => (s(), n("div", {
592
+ class: u([e.direction === "horizontal" ? "h-[1px] w-full" : e.direction === "vertical" ? "h-full w-[1px]" : "", "relative bg-gray-200"]),
593
+ style: $({ backgroundColor: e.color })
594
+ }, [
595
+ e.direction === "horizontal" && e.label && !e.icon ? (s(), n("span", {
596
+ key: 0,
597
+ 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",
598
+ style: $({ color: e.color, borderColor: e.color })
599
+ }, "Test label", 4)) : p("", !0),
600
+ e.direction === "horizontal" && !e.label && e.icon ? (s(), n("span", Re, [
601
+ x(D, {
602
+ icon: e.icon,
603
+ class: "size-6",
604
+ style: $({ color: e.color })
605
+ }, null, 8, ["icon", "style"])
606
+ ])) : p("", !0)
607
+ ], 6));
608
+ }
609
+ }), Ke = {
610
+ content: { type: String, default: "" },
611
+ position: { type: String, default: "bottom", options: ["top", "bottom", "left", "right"] },
612
+ bodyClass: { type: String, default: "" }
613
+ }, Qe = { key: 0 }, nt = /* @__PURE__ */ h({
614
+ __name: "Index",
615
+ props: Ke,
616
+ setup(r) {
617
+ const e = b(!1);
618
+ return (t, d) => (s(), n("div", {
619
+ class: "relative inline-block",
620
+ onMouseenter: d[0] || (d[0] = (a) => e.value = !0),
621
+ onMouseleave: d[1] || (d[1] = (a) => e.value = !1)
622
+ }, [
623
+ g(t.$slots, "default"),
624
+ e.value ? (s(), n("div", {
625
+ key: 0,
626
+ class: u([
627
+ "absolute z-10 w-max rounded-md bg-white px-3 py-2 text-sm text-primary border shadow-xl transition-opacity duration-200",
628
+ t.position === "top" && "bottom-full left-1/2 mb-2 -translate-x-1/2",
629
+ t.position === "bottom" && "top-full left-1/2 mt-2 -translate-x-1/2",
630
+ t.position === "left" && "top-1/2 right-full mr-2 -translate-y-1/2",
631
+ t.position === "right" && "top-1/2 left-full ml-2 -translate-y-1/2",
632
+ t.bodyClass
633
+ ])
634
+ }, [
635
+ t.content ? g(t.$slots, "body", { key: 1 }) : (s(), n("span", Qe, y(t.content), 1))
636
+ ], 2)) : p("", !0)
637
+ ], 32));
101
638
  }
102
- }), q = (t) => ({
639
+ }), at = (r) => ({
103
640
  install() {
104
- if (!t || !t.colors) {
641
+ if (!r || !r.colors) {
105
642
  console.warn("No config provided for the theme settings");
106
643
  return;
107
644
  }
108
- $(t.colors);
645
+ Ge(r.colors);
109
646
  }
110
- }), $ = (t) => {
647
+ }), Ge = (r) => {
111
648
  const e = document.documentElement;
112
- for (const n in t)
113
- t[n] && e.style.setProperty(`--ui-color-${n}`, t[n]);
649
+ for (const t in r)
650
+ r[t] && e.style.setProperty(`--ui-color-${t}`, r[t]);
114
651
  };
115
652
  export {
116
- A as Accordion,
117
- P as Button,
118
- q as config
653
+ Je as Accordion,
654
+ C as Button,
655
+ We as Checkbox,
656
+ Ye as Drawer,
657
+ et as Input,
658
+ tt as Modal,
659
+ ot as Popover,
660
+ st as RangeSlider,
661
+ lt as Select,
662
+ rt as Separator,
663
+ nt as Tooltip,
664
+ at as config
119
665
  };
120
666
  //# sourceMappingURL=index.js.map