@contentstudio/ui 0.1.0 → 0.1.1
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.
- package/dist/index.d.ts +20 -264
- package/dist/index.js +680 -705
- package/dist/index.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as C, computed as c, openBlock as l, createElementBlock as o, normalizeClass as h, unref as i, mergeProps as z, createBlock as j, resolveDynamicComponent as M, createCommentVNode as g, renderSlot as B, createElementVNode as f, withKeys as te, withModifiers as K, toDisplayString as p, createTextVNode as L, ref as A, watch as se, onMounted as le, onUnmounted as ae, withDirectives as W, vModelText as oe, Fragment as D, renderList as ne, vShow as ie, normalizeStyle as E } from "vue";
|
|
2
|
+
const F = {
|
|
3
3
|
primary: {
|
|
4
4
|
base: "blue",
|
|
5
5
|
light: "50",
|
|
@@ -72,48 +72,48 @@ const T = {
|
|
|
72
72
|
border: "200",
|
|
73
73
|
focus: "300"
|
|
74
74
|
}
|
|
75
|
-
}, P = (
|
|
76
|
-
const { hover:
|
|
77
|
-
if (
|
|
75
|
+
}, P = (e, s, t = {}) => {
|
|
76
|
+
const { hover: n = !1, active: r = !1, focus: u = !1, disabled: x = !1 } = t;
|
|
77
|
+
if (x)
|
|
78
78
|
return "bg-gray-100 border-gray-200 text-gray-400 cursor-not-allowed";
|
|
79
|
-
const a =
|
|
79
|
+
const a = F[e];
|
|
80
80
|
if (!a || s === "default")
|
|
81
81
|
return "";
|
|
82
|
-
const
|
|
82
|
+
const d = [];
|
|
83
83
|
switch (s) {
|
|
84
84
|
case "filled":
|
|
85
|
-
|
|
85
|
+
d.push(`bg-${a.base}-${a.main}`), d.push("text-white"), n && d.push(`hover:bg-${a.base}-${a.hover}`), r && d.push(`active:bg-${a.base}-${a.dark}`), u && d.push(`focus:ring-${a.base}-${a.focus}/20`);
|
|
86
86
|
break;
|
|
87
87
|
case "light":
|
|
88
|
-
|
|
88
|
+
d.push(`bg-${a.base}-${a.light}`), d.push(`text-${a.base}-${a.main}`), d.push(`border border-${a.base}-${a.border}`), n && d.push(`hover:bg-${a.base}-100`), r && d.push(`active:bg-${a.base}-200`), u && d.push(`focus:ring-${a.base}-${a.focus}/20`);
|
|
89
89
|
break;
|
|
90
90
|
case "outline":
|
|
91
|
-
|
|
91
|
+
d.push("bg-white"), d.push(`text-${a.base}-${a.main}`), d.push(`border-2 border-${a.base}-${a.main}`), n && d.push(`hover:bg-${a.base}-50`), r && d.push(`active:bg-${a.base}-100`), u && d.push(`focus:ring-${a.base}-${a.focus}/20`);
|
|
92
92
|
break;
|
|
93
93
|
case "subtle":
|
|
94
|
-
|
|
94
|
+
d.push(`text-${a.base}-${a.main}`), n && d.push(`hover:bg-${a.base}-50`), r && d.push(`active:bg-${a.base}-100`), u && d.push(`focus:ring-${a.base}-${a.focus}/20`);
|
|
95
95
|
break;
|
|
96
96
|
case "white":
|
|
97
|
-
|
|
97
|
+
d.push("bg-white text-gray-900"), n && d.push("hover:bg-gray-50"), r && d.push("active:bg-gray-100"), u && d.push("focus:ring-gray-200");
|
|
98
98
|
break;
|
|
99
99
|
case "dot":
|
|
100
|
-
|
|
100
|
+
d.push(`bg-${a.base}-${a.main}`);
|
|
101
101
|
break;
|
|
102
102
|
}
|
|
103
|
-
return
|
|
104
|
-
}, re = (
|
|
103
|
+
return d.join(" ");
|
|
104
|
+
}, re = (e, s) => {
|
|
105
105
|
if (s === "filled")
|
|
106
106
|
return "text-white";
|
|
107
|
-
const
|
|
108
|
-
return `text-${
|
|
109
|
-
},
|
|
107
|
+
const t = F[e];
|
|
108
|
+
return `text-${t.base}-${t.main}`;
|
|
109
|
+
}, de = (e, s) => {
|
|
110
110
|
if (s === "filled")
|
|
111
111
|
return "text-white";
|
|
112
|
-
const
|
|
113
|
-
return `text-${
|
|
114
|
-
},
|
|
112
|
+
const t = F[e];
|
|
113
|
+
return `text-${t.base}-${t.main}`;
|
|
114
|
+
}, ce = (e) => {
|
|
115
115
|
const s = ["shadow-sm", "transition-all duration-200"];
|
|
116
|
-
switch (
|
|
116
|
+
switch (e) {
|
|
117
117
|
case "filled":
|
|
118
118
|
s.push("border-transparent");
|
|
119
119
|
break;
|
|
@@ -133,15 +133,7 @@ const T = {
|
|
|
133
133
|
s.push("border");
|
|
134
134
|
}
|
|
135
135
|
return s.join(" ");
|
|
136
|
-
},
|
|
137
|
-
const s = T[l];
|
|
138
|
-
return [
|
|
139
|
-
"focus:outline-none",
|
|
140
|
-
"focus:ring-2",
|
|
141
|
-
"focus:ring-offset-0",
|
|
142
|
-
`focus:ring-${s.base}-${s.focus}/20`
|
|
143
|
-
].join(" ");
|
|
144
|
-
}, W = {
|
|
136
|
+
}, O = {
|
|
145
137
|
button: {
|
|
146
138
|
xs: { padding: { x: "px-2", y: "py-1" }, text: "text-xs", icon: "w-3 h-3" },
|
|
147
139
|
sm: { padding: { x: "px-3", y: "py-1.5" }, text: "text-sm", icon: "w-4 h-4" },
|
|
@@ -212,11 +204,11 @@ const T = {
|
|
|
212
204
|
lg: { padding: { x: "px-5", y: "py-4" }, text: "text-lg", icon: "w-6 h-6" },
|
|
213
205
|
xl: { padding: { x: "px-6", y: "py-5" }, text: "text-xl", icon: "w-7 h-7" }
|
|
214
206
|
}
|
|
215
|
-
},
|
|
216
|
-
const
|
|
217
|
-
return [
|
|
218
|
-
},
|
|
219
|
-
switch (
|
|
207
|
+
}, S = (e, s) => {
|
|
208
|
+
const t = O[s][e];
|
|
209
|
+
return [t.padding.x, t.padding.y, t.text].filter(Boolean).join(" ");
|
|
210
|
+
}, U = (e, s) => O[s][e].icon || "", X = (e, s) => O[s][e].height || "", Y = (e) => {
|
|
211
|
+
switch (e) {
|
|
220
212
|
case "xs":
|
|
221
213
|
return "text-xs";
|
|
222
214
|
case "sm":
|
|
@@ -230,8 +222,8 @@ const T = {
|
|
|
230
222
|
default:
|
|
231
223
|
return "text-base";
|
|
232
224
|
}
|
|
233
|
-
}, ue = (
|
|
234
|
-
switch (
|
|
225
|
+
}, ue = (e) => {
|
|
226
|
+
switch (e) {
|
|
235
227
|
case "xs":
|
|
236
228
|
return "space-x-1";
|
|
237
229
|
case "sm":
|
|
@@ -245,19 +237,38 @@ const T = {
|
|
|
245
237
|
default:
|
|
246
238
|
return "space-x-3";
|
|
247
239
|
}
|
|
248
|
-
}, R = (
|
|
240
|
+
}, R = (e) => {
|
|
249
241
|
const s = [];
|
|
250
|
-
return
|
|
251
|
-
},
|
|
242
|
+
return e.disabled && s.push("opacity-50 cursor-not-allowed pointer-events-none"), e.loading && s.push("cursor-wait"), e.active && s.push("ring-2 ring-offset-2"), e.error && s.push("border-red-300 focus:ring-red-500/20 focus:border-red-500"), e.success && s.push("border-green-300 focus:ring-green-500/20 focus:border-green-500"), s.join(" ");
|
|
243
|
+
}, he = (e) => {
|
|
252
244
|
const s = [];
|
|
253
|
-
return
|
|
254
|
-
},
|
|
255
|
-
const
|
|
256
|
-
return
|
|
257
|
-
},
|
|
245
|
+
return e.valid && s.push("border-green-300 focus:ring-green-500/20 focus:border-green-500"), e.invalid && s.push("border-red-300 focus:ring-red-500/20 focus:border-red-500"), e.pending && s.push("border-yellow-300 focus:ring-yellow-500/20 focus:border-yellow-500"), s.join(" ");
|
|
246
|
+
}, fe = (e, s = "primary") => {
|
|
247
|
+
const t = [];
|
|
248
|
+
return e.hover && t.push(`hover:bg-${s}-50`), e.active && t.push(`active:bg-${s}-100`), e.focus && t.push(`focus:outline-none focus:ring-2 focus:ring-${s}-500/20 focus:border-${s}-500`), t.join(" ");
|
|
249
|
+
}, xe = ["disabled", "type"], ge = {
|
|
258
250
|
key: 1,
|
|
259
251
|
class: "mr-2"
|
|
260
|
-
},
|
|
252
|
+
}, be = /* @__PURE__ */ f("svg", {
|
|
253
|
+
class: "animate-spin h-4 w-4",
|
|
254
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
255
|
+
fill: "none",
|
|
256
|
+
viewBox: "0 0 24 24"
|
|
257
|
+
}, [
|
|
258
|
+
/* @__PURE__ */ f("circle", {
|
|
259
|
+
class: "opacity-25",
|
|
260
|
+
cx: "12",
|
|
261
|
+
cy: "12",
|
|
262
|
+
r: "10",
|
|
263
|
+
stroke: "currentColor",
|
|
264
|
+
"stroke-width": "4"
|
|
265
|
+
}),
|
|
266
|
+
/* @__PURE__ */ f("path", {
|
|
267
|
+
class: "opacity-75",
|
|
268
|
+
fill: "currentColor",
|
|
269
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
270
|
+
})
|
|
271
|
+
], -1), gt = /* @__PURE__ */ C({
|
|
261
272
|
__name: "Button",
|
|
262
273
|
props: {
|
|
263
274
|
variant: { default: "filled" },
|
|
@@ -267,19 +278,17 @@ const T = {
|
|
|
267
278
|
disabled: { type: Boolean, default: !1 },
|
|
268
279
|
loading: { type: Boolean, default: !1 },
|
|
269
280
|
fullWidth: { type: Boolean, default: !1 },
|
|
270
|
-
class: {},
|
|
271
281
|
type: { default: "button" },
|
|
272
|
-
leftSection:
|
|
273
|
-
rightSection:
|
|
274
|
-
leftSectionProps:
|
|
275
|
-
rightSectionProps:
|
|
276
|
-
|
|
282
|
+
leftSection: null,
|
|
283
|
+
rightSection: null,
|
|
284
|
+
leftSectionProps: null,
|
|
285
|
+
rightSectionProps: null,
|
|
286
|
+
gradient: null
|
|
277
287
|
},
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}, r = (a) => ({
|
|
288
|
+
setup(e, { emit: s }) {
|
|
289
|
+
const t = e, n = (x) => {
|
|
290
|
+
!t.disabled && !t.loading && s("click", x);
|
|
291
|
+
}, r = (x) => ({
|
|
283
292
|
none: "rounded-none",
|
|
284
293
|
xs: "rounded",
|
|
285
294
|
sm: "rounded-md",
|
|
@@ -287,83 +296,64 @@ const T = {
|
|
|
287
296
|
lg: "rounded-xl",
|
|
288
297
|
xl: "rounded-2xl",
|
|
289
298
|
full: "rounded-full"
|
|
290
|
-
})[
|
|
291
|
-
const
|
|
299
|
+
})[x] || "rounded-lg", u = c(() => {
|
|
300
|
+
const x = "inline-flex items-center justify-center font-medium transition-all duration-200", a = P(t.color, t.variant, {
|
|
292
301
|
hover: !0,
|
|
293
302
|
active: !0,
|
|
294
303
|
focus: !0
|
|
295
|
-
}),
|
|
296
|
-
disabled:
|
|
297
|
-
loading:
|
|
298
|
-
}),
|
|
304
|
+
}), d = S(t.size, "button"), y = t.leftSection || t.rightSection ? U(t.size, "button") : "", m = R({
|
|
305
|
+
disabled: t.disabled,
|
|
306
|
+
loading: t.loading
|
|
307
|
+
}), w = r(t.radius);
|
|
299
308
|
return [
|
|
300
|
-
a,
|
|
301
|
-
n,
|
|
302
|
-
w,
|
|
303
309
|
x,
|
|
310
|
+
a,
|
|
311
|
+
d,
|
|
312
|
+
y,
|
|
304
313
|
m,
|
|
305
|
-
|
|
314
|
+
w,
|
|
306
315
|
{
|
|
307
|
-
"w-full":
|
|
308
|
-
"cursor-pointer": !
|
|
316
|
+
"w-full": t.fullWidth,
|
|
317
|
+
"cursor-pointer": !t.disabled && !t.loading
|
|
309
318
|
}
|
|
310
319
|
];
|
|
311
320
|
});
|
|
312
|
-
return (
|
|
313
|
-
class:
|
|
314
|
-
disabled:
|
|
315
|
-
type:
|
|
316
|
-
onClick:
|
|
321
|
+
return (x, a) => (l(), o("button", {
|
|
322
|
+
class: h(i(u)),
|
|
323
|
+
disabled: e.disabled || e.loading,
|
|
324
|
+
type: e.type,
|
|
325
|
+
onClick: n
|
|
317
326
|
}, [
|
|
318
|
-
|
|
319
|
-
(
|
|
327
|
+
e.leftSection ? (l(), o("span", z({ key: 0 }, e.leftSectionProps, { class: "mr-2" }), [
|
|
328
|
+
(l(), j(M(e.leftSection)))
|
|
320
329
|
], 16)) : g("", !0),
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
class: "animate-spin h-4 w-4",
|
|
325
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
326
|
-
fill: "none",
|
|
327
|
-
viewBox: "0 0 24 24"
|
|
328
|
-
}, [
|
|
329
|
-
c("circle", {
|
|
330
|
-
class: "opacity-25",
|
|
331
|
-
cx: "12",
|
|
332
|
-
cy: "12",
|
|
333
|
-
r: "10",
|
|
334
|
-
stroke: "currentColor",
|
|
335
|
-
"stroke-width": "4"
|
|
336
|
-
}),
|
|
337
|
-
c("path", {
|
|
338
|
-
class: "opacity-75",
|
|
339
|
-
fill: "currentColor",
|
|
340
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
341
|
-
})
|
|
342
|
-
], -1))
|
|
330
|
+
e.loading ? (l(), o("span", ge, [
|
|
331
|
+
B(x.$slots, "loader", {}, () => [
|
|
332
|
+
be
|
|
343
333
|
])
|
|
344
334
|
])) : g("", !0),
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
(
|
|
335
|
+
B(x.$slots, "default"),
|
|
336
|
+
e.rightSection ? (l(), o("span", z({ key: 2 }, e.rightSectionProps, { class: "ml-2" }), [
|
|
337
|
+
(l(), j(M(e.rightSection)))
|
|
348
338
|
], 16)) : g("", !0)
|
|
349
|
-
], 10,
|
|
339
|
+
], 10, xe));
|
|
350
340
|
}
|
|
351
|
-
}),
|
|
341
|
+
}), Q = (e) => {
|
|
352
342
|
const s = ["relative"];
|
|
353
|
-
|
|
354
|
-
const
|
|
355
|
-
disabled:
|
|
356
|
-
error:
|
|
357
|
-
required:
|
|
343
|
+
e.fullWidth && s.push("w-full");
|
|
344
|
+
const t = R({
|
|
345
|
+
disabled: e.disabled,
|
|
346
|
+
error: e.error,
|
|
347
|
+
required: e.required || e.withAsterisk
|
|
358
348
|
});
|
|
359
|
-
return
|
|
360
|
-
},
|
|
349
|
+
return t && s.push(t), s.join(" ");
|
|
350
|
+
}, G = (e) => {
|
|
361
351
|
const s = [
|
|
362
352
|
"block",
|
|
363
353
|
"font-medium",
|
|
364
354
|
"mb-1"
|
|
365
355
|
];
|
|
366
|
-
switch (
|
|
356
|
+
switch (e.size) {
|
|
367
357
|
case "xs":
|
|
368
358
|
s.push("text-xs");
|
|
369
359
|
break;
|
|
@@ -379,307 +369,290 @@ const T = {
|
|
|
379
369
|
default:
|
|
380
370
|
s.push("text-sm");
|
|
381
371
|
}
|
|
382
|
-
return
|
|
383
|
-
},
|
|
372
|
+
return e.error ? s.push("text-red-500") : e.disabled ? s.push("text-gray-400") : s.push("text-gray-700"), (e.required || e.withAsterisk) && s.push('after:content-["*"] after:ml-0.5 after:text-red-500'), s.join(" ");
|
|
373
|
+
}, J = (e) => {
|
|
374
|
+
const s = [
|
|
375
|
+
"mt-1",
|
|
376
|
+
"text-sm"
|
|
377
|
+
];
|
|
378
|
+
return e.error ? s.push("text-red-500") : e.disabled ? s.push("text-gray-400") : s.push("text-gray-500"), s.join(" ");
|
|
379
|
+
}, pe = ["aria-checked", "aria-disabled", "onKeydown"], ye = /* @__PURE__ */ f("polyline", { points: "20 6 9 17 4 12" }, null, -1), me = [
|
|
380
|
+
ye
|
|
381
|
+
], ve = /* @__PURE__ */ f("line", {
|
|
382
|
+
x1: "5",
|
|
383
|
+
y1: "12",
|
|
384
|
+
x2: "19",
|
|
385
|
+
y2: "12"
|
|
386
|
+
}, null, -1), we = [
|
|
387
|
+
ve
|
|
388
|
+
], ke = {
|
|
384
389
|
key: 2,
|
|
385
390
|
class: "text-sm text-red-500 mt-0.5"
|
|
386
|
-
},
|
|
391
|
+
}, Ce = {
|
|
387
392
|
name: "Checkbox"
|
|
388
|
-
},
|
|
389
|
-
...
|
|
393
|
+
}, bt = /* @__PURE__ */ C({
|
|
394
|
+
...Ce,
|
|
390
395
|
props: {
|
|
391
396
|
modelValue: { type: [Boolean, Array], default: !1 },
|
|
392
|
-
value:
|
|
393
|
-
id:
|
|
394
|
-
label:
|
|
395
|
-
color:
|
|
397
|
+
value: null,
|
|
398
|
+
id: null,
|
|
399
|
+
label: null,
|
|
400
|
+
color: null,
|
|
396
401
|
size: { default: "md" },
|
|
397
402
|
radius: { default: "sm" },
|
|
398
403
|
labelPosition: { default: "right" },
|
|
399
|
-
description:
|
|
400
|
-
error:
|
|
404
|
+
description: null,
|
|
405
|
+
error: null,
|
|
401
406
|
disabled: { type: Boolean, default: !1 },
|
|
402
407
|
indeterminate: { type: Boolean, default: !1 },
|
|
403
408
|
iconColor: { default: "" },
|
|
404
|
-
autoContrast: { type: Boolean }
|
|
409
|
+
autoContrast: { type: Boolean, default: !1 }
|
|
405
410
|
},
|
|
406
411
|
emits: ["update:modelValue", "change"],
|
|
407
|
-
setup(
|
|
408
|
-
const
|
|
409
|
-
if (
|
|
412
|
+
setup(e, { emit: s }) {
|
|
413
|
+
const t = e, n = c(() => t.modelValue), r = () => {
|
|
414
|
+
if (t.disabled)
|
|
410
415
|
return;
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
},
|
|
416
|
+
const v = !n.value;
|
|
417
|
+
s("update:modelValue", v), s("change", v);
|
|
418
|
+
}, u = () => {
|
|
414
419
|
r();
|
|
415
|
-
},
|
|
416
|
-
size:
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
xs: "rounded-[2px]",
|
|
431
|
-
sm: "rounded-[3px]",
|
|
432
|
-
md: "rounded-[4px]",
|
|
433
|
-
lg: "rounded-[6px]",
|
|
434
|
-
xl: "rounded-[8px]",
|
|
435
|
-
full: "rounded-full"
|
|
436
|
-
}, x = d(() => [
|
|
437
|
-
"flex-shrink-0 flex items-center justify-center",
|
|
438
|
-
"transition-colors duration-200",
|
|
420
|
+
}, x = c(() => G({
|
|
421
|
+
size: t.size,
|
|
422
|
+
disabled: t.disabled,
|
|
423
|
+
error: t.error
|
|
424
|
+
})), a = c(() => J({
|
|
425
|
+
color: t.color
|
|
426
|
+
})), d = c(() => [
|
|
427
|
+
"flex",
|
|
428
|
+
"flex-col",
|
|
429
|
+
t.labelPosition === "left" ? "order-first" : ""
|
|
430
|
+
]), y = c(() => [
|
|
431
|
+
"inline-flex",
|
|
432
|
+
"items-center",
|
|
433
|
+
"justify-center",
|
|
434
|
+
"rounded-md",
|
|
439
435
|
"border",
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
"
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
"flex flex-col flex-grow",
|
|
466
|
-
{
|
|
467
|
-
"cursor-pointer": !e.disabled,
|
|
468
|
-
"cursor-not-allowed": e.disabled
|
|
469
|
-
}
|
|
470
|
-
]), j = d(() => [
|
|
471
|
-
"text-sm text-gray-500 mt-0.5",
|
|
472
|
-
{ "text-gray-400": e.disabled }
|
|
473
|
-
]);
|
|
474
|
-
return (y, f) => (o(), i("div", {
|
|
475
|
-
class: p([a.value, "flex items-center gap-2"])
|
|
436
|
+
"border-gray-300",
|
|
437
|
+
"cursor-pointer",
|
|
438
|
+
"transition-colors",
|
|
439
|
+
"duration-200",
|
|
440
|
+
"ease-in-out",
|
|
441
|
+
t.size === "xs" ? "h-3 w-3" : "",
|
|
442
|
+
t.size === "sm" ? "h-4 w-4" : "",
|
|
443
|
+
t.size === "md" ? "h-5 w-5" : "",
|
|
444
|
+
t.size === "lg" ? "h-6 w-6" : "",
|
|
445
|
+
t.size === "xl" ? "h-7 w-7" : "",
|
|
446
|
+
t.disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
447
|
+
n.value ? "bg-primary-600 border-primary-600" : "bg-white hover:border-primary-500"
|
|
448
|
+
]), m = c(() => [
|
|
449
|
+
"text-white",
|
|
450
|
+
t.size === "xs" ? "h-2 w-2" : "",
|
|
451
|
+
t.size === "sm" ? "h-3 w-3" : "",
|
|
452
|
+
t.size === "md" ? "h-4 w-4" : "",
|
|
453
|
+
t.size === "lg" ? "h-5 w-5" : "",
|
|
454
|
+
t.size === "xl" ? "h-6 w-6" : ""
|
|
455
|
+
]), w = c(() => Q({
|
|
456
|
+
disabled: t.disabled,
|
|
457
|
+
error: t.error
|
|
458
|
+
}));
|
|
459
|
+
return (v, I) => (l(), o("div", {
|
|
460
|
+
class: h([i(w), "flex items-center gap-2"])
|
|
476
461
|
}, [
|
|
477
|
-
|
|
478
|
-
class:
|
|
479
|
-
onClick:
|
|
462
|
+
f("div", {
|
|
463
|
+
class: h(i(y)),
|
|
464
|
+
onClick: u,
|
|
480
465
|
role: "checkbox",
|
|
481
|
-
"aria-checked":
|
|
482
|
-
"aria-disabled":
|
|
466
|
+
"aria-checked": i(n),
|
|
467
|
+
"aria-disabled": e.disabled,
|
|
483
468
|
tabindex: "0",
|
|
484
|
-
onKeydown:
|
|
469
|
+
onKeydown: te(K(u, ["prevent"]), ["space"])
|
|
485
470
|
}, [
|
|
486
|
-
|
|
471
|
+
i(n) && !e.indeterminate ? (l(), o("svg", {
|
|
487
472
|
key: 0,
|
|
488
473
|
xmlns: "http://www.w3.org/2000/svg",
|
|
489
|
-
class:
|
|
474
|
+
class: h(i(m)),
|
|
490
475
|
viewBox: "0 0 24 24",
|
|
491
476
|
fill: "none",
|
|
492
477
|
stroke: "currentColor",
|
|
493
478
|
"stroke-width": "3",
|
|
494
479
|
"stroke-linecap": "round",
|
|
495
480
|
"stroke-linejoin": "round"
|
|
496
|
-
},
|
|
497
|
-
|
|
498
|
-
]), 2)) : g("", !0),
|
|
499
|
-
y.indeterminate ? (o(), i("svg", {
|
|
481
|
+
}, me, 2)) : g("", !0),
|
|
482
|
+
e.indeterminate ? (l(), o("svg", {
|
|
500
483
|
key: 1,
|
|
501
484
|
xmlns: "http://www.w3.org/2000/svg",
|
|
502
|
-
class:
|
|
485
|
+
class: h(i(m)),
|
|
503
486
|
viewBox: "0 0 24 24",
|
|
504
487
|
fill: "none",
|
|
505
488
|
stroke: "currentColor",
|
|
506
489
|
"stroke-width": "3",
|
|
507
490
|
"stroke-linecap": "round",
|
|
508
491
|
"stroke-linejoin": "round"
|
|
509
|
-
},
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
y1: "12",
|
|
513
|
-
x2: "19",
|
|
514
|
-
y2: "12"
|
|
515
|
-
}, null, -1)
|
|
516
|
-
]), 2)) : g("", !0)
|
|
517
|
-
], 42, xe),
|
|
518
|
-
y.label || y.description ? (o(), i("div", {
|
|
492
|
+
}, we, 2)) : g("", !0)
|
|
493
|
+
], 42, pe),
|
|
494
|
+
e.label || e.description ? (l(), o("div", {
|
|
519
495
|
key: 0,
|
|
520
|
-
class:
|
|
496
|
+
class: h(i(d))
|
|
521
497
|
}, [
|
|
522
|
-
|
|
498
|
+
e.label ? (l(), o("label", {
|
|
523
499
|
key: 0,
|
|
524
|
-
class:
|
|
525
|
-
onClick:
|
|
526
|
-
},
|
|
527
|
-
|
|
500
|
+
class: h([i(x), "pt-0.5"]),
|
|
501
|
+
onClick: u
|
|
502
|
+
}, p(e.label), 3)) : g("", !0),
|
|
503
|
+
e.description ? (l(), o("div", {
|
|
528
504
|
key: 1,
|
|
529
|
-
class:
|
|
530
|
-
},
|
|
531
|
-
|
|
505
|
+
class: h(i(a))
|
|
506
|
+
}, p(e.description), 3)) : g("", !0),
|
|
507
|
+
e.error ? (l(), o("div", ke, p(e.error), 1)) : g("", !0)
|
|
532
508
|
], 2)) : g("", !0)
|
|
533
509
|
], 2));
|
|
534
510
|
}
|
|
535
|
-
}),
|
|
511
|
+
}), $e = ["aria-checked", "aria-disabled"], ze = ["id", "checked", "disabled", "value"], Be = ["for"], pt = /* @__PURE__ */ C({
|
|
536
512
|
__name: "Radio",
|
|
537
513
|
props: {
|
|
538
514
|
modelValue: { default: void 0 },
|
|
539
515
|
value: { default: void 0 },
|
|
540
|
-
|
|
516
|
+
id: { default: () => `radio-${Math.random().toString(36).substr(2, 9)}` },
|
|
517
|
+
label: null,
|
|
541
518
|
color: { default: "primary" },
|
|
542
519
|
size: { default: "md" },
|
|
543
520
|
labelPosition: { default: "right" },
|
|
544
|
-
description:
|
|
545
|
-
error:
|
|
521
|
+
description: null,
|
|
522
|
+
error: null,
|
|
546
523
|
disabled: { type: Boolean, default: !1 },
|
|
547
|
-
iconColor:
|
|
548
|
-
id: { default: () => `radio-${Math.random().toString(36).substr(2, 9)}` }
|
|
524
|
+
iconColor: null
|
|
549
525
|
},
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
526
|
+
setup(e, { emit: s }) {
|
|
527
|
+
const t = e, n = c(() => t.modelValue === t.value), r = () => {
|
|
528
|
+
t.disabled || (s("update:modelValue", t.value), s("change", t.value));
|
|
529
|
+
}, u = c(() => [
|
|
530
|
+
Q({
|
|
531
|
+
disabled: t.disabled,
|
|
532
|
+
error: t.error
|
|
533
|
+
}),
|
|
534
|
+
"flex items-center gap-2",
|
|
535
|
+
t.labelPosition === "left" ? "flex-row-reverse" : "flex-row"
|
|
536
|
+
]), x = c(() => [
|
|
537
|
+
"relative flex items-center justify-center rounded-full border transition-colors duration-200",
|
|
538
|
+
v.value,
|
|
539
|
+
n.value ? `bg-${t.color}-600 border-${t.color}-600` : "bg-white border-gray-300 hover:border-gray-400",
|
|
540
|
+
t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
541
|
+
]), a = c(() => [
|
|
542
|
+
"rounded-full bg-white",
|
|
543
|
+
I.value,
|
|
544
|
+
t.disabled ? "opacity-50" : ""
|
|
545
|
+
]), d = c(() => G({
|
|
546
|
+
size: t.size,
|
|
547
|
+
disabled: t.disabled,
|
|
548
|
+
error: t.error
|
|
549
|
+
})), y = c(() => J({
|
|
550
|
+
color: t.color
|
|
551
|
+
})), m = c(() => [
|
|
552
|
+
"text-sm text-red-500 mt-1"
|
|
553
|
+
]), w = c(() => [
|
|
554
|
+
"flex flex-col",
|
|
555
|
+
t.disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
556
|
+
]), v = c(() => ({
|
|
555
557
|
xs: "w-4 h-4",
|
|
556
558
|
sm: "w-5 h-5",
|
|
557
559
|
md: "w-6 h-6",
|
|
558
560
|
lg: "w-8 h-8",
|
|
559
561
|
xl: "w-10 h-10"
|
|
560
|
-
})[
|
|
562
|
+
})[t.size]), I = c(() => ({
|
|
561
563
|
xs: "w-2 h-2",
|
|
562
564
|
sm: "w-2.5 h-2.5",
|
|
563
565
|
md: "w-3 h-3",
|
|
564
566
|
lg: "w-4 h-4",
|
|
565
567
|
xl: "w-5 h-5"
|
|
566
|
-
})[
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
})), w = d(() => [
|
|
570
|
-
"inline-flex items-start gap-2",
|
|
571
|
-
e.labelPosition === "left" ? "flex-row-reverse justify-between" : "flex-row",
|
|
572
|
-
e.disabled ? "cursor-not-allowed" : "cursor-pointer",
|
|
573
|
-
R(n.value)
|
|
574
|
-
]), x = d(() => [
|
|
575
|
-
"relative flex items-center justify-center rounded-full border-2 transition-colors duration-200 flex-shrink-0 mt-0.5",
|
|
576
|
-
b.value,
|
|
577
|
-
t.value ? `${P(e.color, "filled")} border-blue-500` : "border-gray-300 hover:border-gray-400 bg-white"
|
|
578
|
-
]), m = d(() => [
|
|
579
|
-
"rounded-full",
|
|
580
|
-
a.value,
|
|
581
|
-
t.value ? "bg-white scale-100" : "bg-transparent scale-0"
|
|
582
|
-
]), C = d(() => [
|
|
583
|
-
"flex flex-col flex-grow",
|
|
584
|
-
e.labelPosition === "left" ? "items-end" : "items-start"
|
|
585
|
-
]), V = d(() => [
|
|
586
|
-
N(e.size),
|
|
587
|
-
"font-medium",
|
|
588
|
-
e.disabled ? "text-gray-400" : "text-gray-900 cursor-pointer"
|
|
589
|
-
]), j = d(() => [
|
|
590
|
-
"text-sm text-gray-500 mt-1"
|
|
591
|
-
]), y = d(() => [
|
|
592
|
-
"text-sm text-red-500 mt-1"
|
|
593
|
-
]);
|
|
594
|
-
return (f, q) => (o(), i("div", {
|
|
595
|
-
class: p(w.value),
|
|
568
|
+
})[t.size]);
|
|
569
|
+
return (V, q) => (l(), o("div", {
|
|
570
|
+
class: h(i(u)),
|
|
596
571
|
onClick: r,
|
|
597
|
-
"aria-checked":
|
|
598
|
-
"aria-disabled":
|
|
572
|
+
"aria-checked": i(n),
|
|
573
|
+
"aria-disabled": e.disabled,
|
|
599
574
|
role: "radio"
|
|
600
575
|
}, [
|
|
601
|
-
|
|
576
|
+
f("input", {
|
|
602
577
|
ref: "radio",
|
|
603
578
|
type: "radio",
|
|
604
|
-
id:
|
|
605
|
-
checked:
|
|
606
|
-
disabled:
|
|
607
|
-
value:
|
|
579
|
+
id: e.id,
|
|
580
|
+
checked: i(n),
|
|
581
|
+
disabled: e.disabled,
|
|
582
|
+
value: e.value,
|
|
608
583
|
onChange: r,
|
|
609
584
|
class: "sr-only"
|
|
610
|
-
}, null, 40,
|
|
611
|
-
|
|
612
|
-
class:
|
|
585
|
+
}, null, 40, ze),
|
|
586
|
+
f("div", {
|
|
587
|
+
class: h(i(x))
|
|
613
588
|
}, [
|
|
614
|
-
|
|
589
|
+
i(n) ? (l(), o("div", {
|
|
615
590
|
key: 0,
|
|
616
|
-
class:
|
|
591
|
+
class: h([i(a), "transition-transform duration-200 ease-in-out"])
|
|
617
592
|
}, null, 2)) : g("", !0)
|
|
618
593
|
], 2),
|
|
619
|
-
|
|
620
|
-
class:
|
|
594
|
+
f("div", {
|
|
595
|
+
class: h(i(w))
|
|
621
596
|
}, [
|
|
622
|
-
|
|
597
|
+
e.label ? (l(), o("label", {
|
|
623
598
|
key: 0,
|
|
624
|
-
for:
|
|
625
|
-
class:
|
|
599
|
+
for: e.id,
|
|
600
|
+
class: h(i(d))
|
|
626
601
|
}, [
|
|
627
|
-
|
|
628
|
-
|
|
602
|
+
B(V.$slots, "label", {}, () => [
|
|
603
|
+
L(p(e.label), 1)
|
|
629
604
|
])
|
|
630
|
-
], 10,
|
|
631
|
-
|
|
605
|
+
], 10, Be)) : g("", !0),
|
|
606
|
+
e.description ? (l(), o("div", {
|
|
632
607
|
key: 1,
|
|
633
|
-
class:
|
|
608
|
+
class: h(i(y))
|
|
634
609
|
}, [
|
|
635
|
-
|
|
636
|
-
|
|
610
|
+
B(V.$slots, "description", {}, () => [
|
|
611
|
+
L(p(e.description), 1)
|
|
637
612
|
])
|
|
638
613
|
], 2)) : g("", !0),
|
|
639
|
-
|
|
614
|
+
e.error ? (l(), o("div", {
|
|
640
615
|
key: 2,
|
|
641
|
-
class:
|
|
616
|
+
class: h(i(m))
|
|
642
617
|
}, [
|
|
643
|
-
|
|
644
|
-
|
|
618
|
+
B(V.$slots, "error", {}, () => [
|
|
619
|
+
L(p(e.error), 1)
|
|
645
620
|
])
|
|
646
621
|
], 2)) : g("", !0)
|
|
647
622
|
], 2)
|
|
648
|
-
], 10,
|
|
623
|
+
], 10, $e));
|
|
649
624
|
}
|
|
650
|
-
}),
|
|
625
|
+
}), Se = ["for"], Ve = {
|
|
651
626
|
key: 0,
|
|
652
627
|
class: "text-red-500",
|
|
653
628
|
"aria-hidden": "true"
|
|
654
|
-
},
|
|
629
|
+
}, Pe = { class: "relative" }, je = ["id", "type", "value", "placeholder", "disabled", "required"], yt = /* @__PURE__ */ C({
|
|
655
630
|
__name: "TextInput",
|
|
656
631
|
props: {
|
|
657
|
-
id:
|
|
632
|
+
id: null,
|
|
658
633
|
type: { default: "text" },
|
|
659
|
-
modelValue:
|
|
660
|
-
placeholder:
|
|
634
|
+
modelValue: null,
|
|
635
|
+
placeholder: null,
|
|
661
636
|
disabled: { type: Boolean, default: !1 },
|
|
662
|
-
label:
|
|
663
|
-
labelProps:
|
|
664
|
-
description:
|
|
665
|
-
descriptionProps:
|
|
666
|
-
error:
|
|
667
|
-
errorProps:
|
|
668
|
-
wrapperProps:
|
|
669
|
-
inputProps:
|
|
637
|
+
label: null,
|
|
638
|
+
labelProps: null,
|
|
639
|
+
description: null,
|
|
640
|
+
descriptionProps: null,
|
|
641
|
+
error: null,
|
|
642
|
+
errorProps: null,
|
|
643
|
+
wrapperProps: null,
|
|
644
|
+
inputProps: null,
|
|
670
645
|
size: { default: "md" },
|
|
671
646
|
radius: { default: "md" },
|
|
672
|
-
|
|
647
|
+
rightSection: null,
|
|
648
|
+
rightSectionProps: null,
|
|
649
|
+
leftSection: null,
|
|
650
|
+
leftSectionProps: null,
|
|
673
651
|
withAsterisk: { type: Boolean, default: !1 },
|
|
674
|
-
|
|
675
|
-
rightSection: {},
|
|
676
|
-
rightSectionProps: {},
|
|
677
|
-
leftSection: {},
|
|
678
|
-
leftSectionProps: {}
|
|
652
|
+
required: { type: Boolean, default: !1 }
|
|
679
653
|
},
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
const s = l, e = (t) => ({
|
|
654
|
+
setup(e) {
|
|
655
|
+
const s = e, t = (r) => ({
|
|
683
656
|
none: "rounded-none",
|
|
684
657
|
xs: "rounded",
|
|
685
658
|
sm: "rounded-md",
|
|
@@ -687,93 +660,140 @@ const T = {
|
|
|
687
660
|
lg: "rounded-xl",
|
|
688
661
|
xl: "rounded-2xl",
|
|
689
662
|
full: "rounded-full"
|
|
690
|
-
})[
|
|
691
|
-
const
|
|
663
|
+
})[r] || "rounded-lg", n = c(() => {
|
|
664
|
+
const r = [
|
|
692
665
|
"block w-full bg-white transition-all duration-200",
|
|
693
666
|
"border border-gray-200",
|
|
694
667
|
"text-gray-900",
|
|
695
668
|
"focus:outline-none focus:ring-2 focus:ring-offset-0 focus:border-transparent",
|
|
696
669
|
"placeholder:text-gray-400",
|
|
697
670
|
"shadow-sm"
|
|
698
|
-
],
|
|
671
|
+
], u = S(s.size, "input"), x = S(s.size, "input"), a = R({
|
|
699
672
|
disabled: s.disabled,
|
|
700
673
|
error: s.withError || !!s.error
|
|
701
|
-
}),
|
|
674
|
+
}), d = t(s.radius), y = {
|
|
702
675
|
left: s.leftSection ? "pl-10" : "",
|
|
703
676
|
right: s.rightSection ? "pr-10" : ""
|
|
704
|
-
},
|
|
677
|
+
}, m = s.disabled ? "" : [
|
|
705
678
|
s.withError || s.error ? "focus:ring-red-500/20 focus:border-red-500" : "focus:ring-blue-500/20 focus:border-blue-500",
|
|
706
679
|
"hover:border-gray-300"
|
|
707
680
|
];
|
|
708
681
|
return [
|
|
709
|
-
...
|
|
710
|
-
|
|
711
|
-
|
|
682
|
+
...r,
|
|
683
|
+
u,
|
|
684
|
+
x,
|
|
712
685
|
a,
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
686
|
+
d,
|
|
687
|
+
y.left,
|
|
688
|
+
y.right,
|
|
689
|
+
m
|
|
717
690
|
].filter(Boolean).join(" ");
|
|
718
691
|
});
|
|
719
|
-
return (
|
|
692
|
+
return (r, u) => (l(), o("div", z({
|
|
720
693
|
class: [
|
|
721
694
|
"relative flex flex-col",
|
|
722
|
-
{ "opacity-50 pointer-events-none":
|
|
695
|
+
{ "opacity-50 pointer-events-none": e.disabled }
|
|
723
696
|
]
|
|
724
|
-
},
|
|
725
|
-
|
|
697
|
+
}, e.wrapperProps), [
|
|
698
|
+
e.label ? (l(), o("label", z({
|
|
726
699
|
key: 0,
|
|
727
|
-
for:
|
|
700
|
+
for: e.id,
|
|
728
701
|
class: "mb-1 text-sm font-medium text-gray-700 flex items-center gap-1"
|
|
729
|
-
},
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
], 16,
|
|
733
|
-
|
|
734
|
-
|
|
702
|
+
}, e.labelProps), [
|
|
703
|
+
L(p(e.label) + " ", 1),
|
|
704
|
+
e.required || e.withAsterisk ? (l(), o("span", Ve, "*")) : g("", !0)
|
|
705
|
+
], 16, Se)) : g("", !0),
|
|
706
|
+
f("div", Pe, [
|
|
707
|
+
e.leftSection ? (l(), o("div", z({
|
|
735
708
|
key: 0,
|
|
736
709
|
class: "absolute inset-y-0 left-0 flex items-center pl-3"
|
|
737
|
-
},
|
|
738
|
-
(
|
|
710
|
+
}, e.leftSectionProps), [
|
|
711
|
+
(l(), j(M(e.leftSection)))
|
|
739
712
|
], 16)) : g("", !0),
|
|
740
|
-
|
|
741
|
-
id:
|
|
742
|
-
type:
|
|
743
|
-
value:
|
|
744
|
-
placeholder:
|
|
745
|
-
disabled:
|
|
746
|
-
required:
|
|
747
|
-
class:
|
|
748
|
-
onInput:
|
|
749
|
-
},
|
|
750
|
-
|
|
713
|
+
f("input", z({
|
|
714
|
+
id: e.id,
|
|
715
|
+
type: e.type,
|
|
716
|
+
value: e.modelValue,
|
|
717
|
+
placeholder: e.placeholder,
|
|
718
|
+
disabled: e.disabled,
|
|
719
|
+
required: e.required,
|
|
720
|
+
class: i(n),
|
|
721
|
+
onInput: u[0] || (u[0] = (x) => r.$emit("update:modelValue", x.target.value))
|
|
722
|
+
}, e.inputProps), null, 16, je),
|
|
723
|
+
e.rightSection ? (l(), o("div", z({
|
|
751
724
|
key: 1,
|
|
752
725
|
class: "absolute inset-y-0 right-0 flex items-center pr-3"
|
|
753
|
-
},
|
|
754
|
-
(
|
|
726
|
+
}, e.rightSectionProps), [
|
|
727
|
+
(l(), j(M(e.rightSection)))
|
|
755
728
|
], 16)) : g("", !0)
|
|
756
729
|
]),
|
|
757
|
-
|
|
730
|
+
e.description ? (l(), o("p", z({
|
|
758
731
|
key: 1,
|
|
759
732
|
class: "mt-1 text-sm text-gray-500"
|
|
760
|
-
},
|
|
761
|
-
|
|
733
|
+
}, e.descriptionProps), p(e.description), 17)) : g("", !0),
|
|
734
|
+
e.error ? (l(), o("p", z({
|
|
762
735
|
key: 2,
|
|
763
736
|
class: "mt-1 text-sm text-red-500"
|
|
764
|
-
},
|
|
737
|
+
}, e.errorProps), p(e.error), 17)) : g("", !0)
|
|
765
738
|
], 16));
|
|
766
739
|
}
|
|
767
|
-
}),
|
|
740
|
+
}), Me = ["aria-expanded", "aria-disabled"], Ie = ["placeholder", "disabled"], Le = {
|
|
768
741
|
key: 1,
|
|
769
742
|
class: "w-full truncate text-gray-900"
|
|
770
|
-
},
|
|
743
|
+
}, Re = { class: "flex items-center gap-2 shrink-0" }, qe = ["onClick"], Ae = /* @__PURE__ */ f("svg", {
|
|
744
|
+
class: "w-4 h-4",
|
|
745
|
+
fill: "none",
|
|
746
|
+
stroke: "currentColor",
|
|
747
|
+
viewBox: "0 0 24 24"
|
|
748
|
+
}, [
|
|
749
|
+
/* @__PURE__ */ f("path", {
|
|
750
|
+
"stroke-linecap": "round",
|
|
751
|
+
"stroke-linejoin": "round",
|
|
752
|
+
"stroke-width": "2",
|
|
753
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
754
|
+
})
|
|
755
|
+
], -1), De = [
|
|
756
|
+
Ae
|
|
757
|
+
], Te = /* @__PURE__ */ f("path", {
|
|
758
|
+
"stroke-linecap": "round",
|
|
759
|
+
"stroke-linejoin": "round",
|
|
760
|
+
"stroke-width": "2",
|
|
761
|
+
d: "M19 9l-7 7-7-7"
|
|
762
|
+
}, null, -1), Ee = [
|
|
763
|
+
Te
|
|
764
|
+
], Fe = {
|
|
771
765
|
key: 0,
|
|
772
766
|
class: "py-3 text-center text-gray-500"
|
|
773
|
-
},
|
|
767
|
+
}, Oe = /* @__PURE__ */ f("svg", {
|
|
768
|
+
class: "animate-spin h-5 w-5 mx-auto",
|
|
769
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
770
|
+
fill: "none",
|
|
771
|
+
viewBox: "0 0 24 24"
|
|
772
|
+
}, [
|
|
773
|
+
/* @__PURE__ */ f("circle", {
|
|
774
|
+
class: "opacity-25",
|
|
775
|
+
cx: "12",
|
|
776
|
+
cy: "12",
|
|
777
|
+
r: "10",
|
|
778
|
+
stroke: "currentColor",
|
|
779
|
+
"stroke-width": "4"
|
|
780
|
+
}),
|
|
781
|
+
/* @__PURE__ */ f("path", {
|
|
782
|
+
class: "opacity-75",
|
|
783
|
+
fill: "currentColor",
|
|
784
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
785
|
+
})
|
|
786
|
+
], -1), He = ["onClick"], Ne = /* @__PURE__ */ f("path", {
|
|
787
|
+
"stroke-linecap": "round",
|
|
788
|
+
"stroke-linejoin": "round",
|
|
789
|
+
"stroke-width": "2",
|
|
790
|
+
d: "M5 13l4 4L19 7"
|
|
791
|
+
}, null, -1), We = [
|
|
792
|
+
Ne
|
|
793
|
+
], Ke = {
|
|
774
794
|
key: 0,
|
|
775
795
|
class: "py-3 px-4 text-gray-500 text-center text-sm"
|
|
776
|
-
},
|
|
796
|
+
}, mt = /* @__PURE__ */ C({
|
|
777
797
|
__name: "Select",
|
|
778
798
|
props: {
|
|
779
799
|
modelValue: { default: null },
|
|
@@ -785,16 +805,15 @@ const T = {
|
|
|
785
805
|
loading: { type: Boolean, default: !1 },
|
|
786
806
|
error: { type: Boolean, default: !1 },
|
|
787
807
|
size: { default: "md" },
|
|
788
|
-
radius: { default: "
|
|
808
|
+
radius: { default: "sm" },
|
|
789
809
|
variant: { default: "outline" },
|
|
790
810
|
color: { default: "primary" },
|
|
791
811
|
withCheckIcon: { type: Boolean, default: !0 },
|
|
792
|
-
checkIconPosition: { default: "
|
|
793
|
-
nothingFoundMessage: { default: "
|
|
812
|
+
checkIconPosition: { default: "right" },
|
|
813
|
+
nothingFoundMessage: { default: "Nothing found..." }
|
|
794
814
|
},
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
const e = l, u = s, t = E(!1), r = E(""), b = E(null), a = E(null), n = (h) => ({
|
|
815
|
+
setup(e, { emit: s }) {
|
|
816
|
+
const t = e, n = A(!1), r = A(""), u = A(null), x = A(null), a = (b) => ({
|
|
798
817
|
none: "rounded-none",
|
|
799
818
|
xs: "rounded",
|
|
800
819
|
sm: "rounded-md",
|
|
@@ -802,191 +821,171 @@ const T = {
|
|
|
802
821
|
lg: "rounded-xl",
|
|
803
822
|
xl: "rounded-2xl",
|
|
804
823
|
full: "rounded-full"
|
|
805
|
-
})[
|
|
806
|
-
const
|
|
807
|
-
disabled:
|
|
808
|
-
error:
|
|
809
|
-
}),
|
|
824
|
+
})[b] || "rounded-lg", d = c(() => {
|
|
825
|
+
const b = "w-full flex items-center justify-between transition-colors duration-200", $ = S(t.size, "input"), k = getHeightClasses(t.size, "input"), H = a(t.radius), N = t.error ? "focus-within:ring-2 focus-within:ring-red-500/20 focus-within:border-red-500" : "focus-within:ring-2 focus-within:ring-primary-500/20 focus-within:border-primary-500", Z = t.variant === "filled" ? `bg-gray-50 border border-transparent ${!t.disabled && `hover:bg-gray-100 focus-within:bg-white focus-within:border-gray-300 ${N}`}` : `bg-white border border-gray-300 ${!t.disabled && `hover:border-gray-400 ${N}`}`, _ = R({
|
|
826
|
+
disabled: t.disabled,
|
|
827
|
+
error: t.error
|
|
828
|
+
}), ee = !t.disabled && "cursor-pointer";
|
|
810
829
|
return [
|
|
811
|
-
|
|
812
|
-
k,
|
|
830
|
+
b,
|
|
813
831
|
$,
|
|
832
|
+
k,
|
|
814
833
|
H,
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
834
|
+
Z,
|
|
835
|
+
_,
|
|
836
|
+
ee
|
|
818
837
|
].filter(Boolean).join(" ");
|
|
819
|
-
}),
|
|
838
|
+
}), y = c(() => t.options.find((b) => b.value === t.modelValue)), m = c(() => {
|
|
820
839
|
if (!r.value)
|
|
821
|
-
return
|
|
822
|
-
const
|
|
823
|
-
return
|
|
824
|
-
(
|
|
840
|
+
return t.options;
|
|
841
|
+
const b = r.value.toLowerCase();
|
|
842
|
+
return t.options.filter(
|
|
843
|
+
($) => $.label.toLowerCase().includes(b)
|
|
825
844
|
);
|
|
826
|
-
}),
|
|
827
|
-
var
|
|
828
|
-
|
|
829
|
-
},
|
|
830
|
-
|
|
831
|
-
},
|
|
832
|
-
|
|
833
|
-
},
|
|
834
|
-
|
|
835
|
-
},
|
|
836
|
-
|
|
837
|
-
},
|
|
838
|
-
const
|
|
839
|
-
|
|
845
|
+
}), w = () => {
|
|
846
|
+
var b;
|
|
847
|
+
t.disabled || (t.searchable ? ((b = u.value) == null || b.focus(), n.value = !0) : n.value = !n.value);
|
|
848
|
+
}, v = (b) => {
|
|
849
|
+
s("update:modelValue", b.value), s("change", b), n.value = !1, t.searchable && (r.value = b.label);
|
|
850
|
+
}, I = () => {
|
|
851
|
+
s("update:modelValue", null), s("change", null), r.value = "";
|
|
852
|
+
}, V = () => {
|
|
853
|
+
n.value || (n.value = !0);
|
|
854
|
+
}, q = () => {
|
|
855
|
+
n.value || (n.value = !0);
|
|
856
|
+
}, T = (b) => {
|
|
857
|
+
const $ = b.target;
|
|
858
|
+
x.value && !x.value.contains($) && (n.value = !1);
|
|
840
859
|
};
|
|
841
|
-
return
|
|
842
|
-
|
|
843
|
-
}),
|
|
844
|
-
document.addEventListener("click",
|
|
845
|
-
}),
|
|
846
|
-
document.removeEventListener("click",
|
|
847
|
-
}), (
|
|
860
|
+
return se(() => t.modelValue, (b) => {
|
|
861
|
+
b ? y.value && t.searchable && (r.value = y.value.label) : r.value = "";
|
|
862
|
+
}), le(() => {
|
|
863
|
+
document.addEventListener("click", T);
|
|
864
|
+
}), ae(() => {
|
|
865
|
+
document.removeEventListener("click", T);
|
|
866
|
+
}), (b, $) => (l(), o("div", {
|
|
848
867
|
class: "relative select",
|
|
849
868
|
ref_key: "selectRoot",
|
|
850
|
-
ref:
|
|
869
|
+
ref: x
|
|
851
870
|
}, [
|
|
852
|
-
|
|
853
|
-
class:
|
|
871
|
+
f("div", {
|
|
872
|
+
class: h(i(d)),
|
|
854
873
|
role: "combobox",
|
|
855
|
-
"aria-expanded":
|
|
856
|
-
"aria-disabled":
|
|
857
|
-
onClick:
|
|
874
|
+
"aria-expanded": n.value,
|
|
875
|
+
"aria-disabled": e.disabled,
|
|
876
|
+
onClick: w
|
|
858
877
|
}, [
|
|
859
|
-
|
|
878
|
+
e.searchable ? W((l(), o("input", {
|
|
860
879
|
key: 0,
|
|
861
880
|
ref_key: "searchInput",
|
|
862
|
-
ref:
|
|
863
|
-
"onUpdate:modelValue":
|
|
864
|
-
placeholder:
|
|
881
|
+
ref: u,
|
|
882
|
+
"onUpdate:modelValue": $[0] || ($[0] = (k) => r.value = k),
|
|
883
|
+
placeholder: e.placeholder,
|
|
865
884
|
type: "text",
|
|
866
885
|
class: "w-full bg-transparent outline-none placeholder:text-gray-500",
|
|
867
|
-
disabled:
|
|
868
|
-
onFocus:
|
|
869
|
-
onInput:
|
|
870
|
-
}, null, 40,
|
|
871
|
-
[
|
|
872
|
-
]) : (
|
|
873
|
-
|
|
874
|
-
|
|
886
|
+
disabled: e.disabled,
|
|
887
|
+
onFocus: V,
|
|
888
|
+
onInput: q
|
|
889
|
+
}, null, 40, Ie)), [
|
|
890
|
+
[oe, r.value]
|
|
891
|
+
]) : (l(), o("div", Le, p(i(y) ? i(y).label : e.placeholder), 1)),
|
|
892
|
+
f("div", Re, [
|
|
893
|
+
e.clearable && e.modelValue && !e.disabled ? (l(), o("button", {
|
|
875
894
|
key: 0,
|
|
876
895
|
type: "button",
|
|
877
896
|
class: "p-1 hover:bg-gray-100 rounded-full text-gray-500 hover:text-gray-700",
|
|
878
|
-
onClick:
|
|
879
|
-
},
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
fill: "none",
|
|
883
|
-
stroke: "currentColor",
|
|
884
|
-
viewBox: "0 0 24 24"
|
|
885
|
-
}, [
|
|
886
|
-
c("path", {
|
|
887
|
-
"stroke-linecap": "round",
|
|
888
|
-
"stroke-linejoin": "round",
|
|
889
|
-
"stroke-width": "2",
|
|
890
|
-
d: "M6 18L18 6M6 6l12 12"
|
|
891
|
-
})
|
|
892
|
-
], -1)
|
|
893
|
-
]))) : g("", !0),
|
|
894
|
-
(o(), i("svg", {
|
|
895
|
-
class: p(["w-4 h-4 text-gray-500 transition-transform duration-200", { "rotate-180": t.value }]),
|
|
897
|
+
onClick: K(I, ["stop"])
|
|
898
|
+
}, De, 8, qe)) : g("", !0),
|
|
899
|
+
(l(), o("svg", {
|
|
900
|
+
class: h(["w-4 h-4 text-gray-500 transition-transform duration-200", { "rotate-180": n.value }]),
|
|
896
901
|
fill: "none",
|
|
897
902
|
stroke: "currentColor",
|
|
898
903
|
viewBox: "0 0 24 24"
|
|
899
|
-
},
|
|
900
|
-
c("path", {
|
|
901
|
-
"stroke-linecap": "round",
|
|
902
|
-
"stroke-linejoin": "round",
|
|
903
|
-
"stroke-width": "2",
|
|
904
|
-
d: "M19 9l-7 7-7-7"
|
|
905
|
-
}, null, -1)
|
|
906
|
-
]), 2))
|
|
904
|
+
}, Ee, 2))
|
|
907
905
|
])
|
|
908
|
-
], 10,
|
|
909
|
-
|
|
910
|
-
class:
|
|
906
|
+
], 10, Me),
|
|
907
|
+
W(f("div", {
|
|
908
|
+
class: h([
|
|
911
909
|
"absolute w-full z-50 mt-1 bg-white",
|
|
912
910
|
"border border-gray-200",
|
|
913
|
-
|
|
911
|
+
a(t.radius),
|
|
914
912
|
"shadow-lg max-h-[240px] overflow-auto",
|
|
915
913
|
"divide-y divide-gray-100"
|
|
916
914
|
])
|
|
917
915
|
}, [
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
class: "animate-spin h-5 w-5 mx-auto",
|
|
922
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
923
|
-
fill: "none",
|
|
924
|
-
viewBox: "0 0 24 24"
|
|
925
|
-
}, [
|
|
926
|
-
c("circle", {
|
|
927
|
-
class: "opacity-25",
|
|
928
|
-
cx: "12",
|
|
929
|
-
cy: "12",
|
|
930
|
-
r: "10",
|
|
931
|
-
stroke: "currentColor",
|
|
932
|
-
"stroke-width": "4"
|
|
933
|
-
}),
|
|
934
|
-
c("path", {
|
|
935
|
-
class: "opacity-75",
|
|
936
|
-
fill: "currentColor",
|
|
937
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
938
|
-
})
|
|
939
|
-
], -1))
|
|
916
|
+
e.loading ? (l(), o("div", Fe, [
|
|
917
|
+
B(b.$slots, "loader", {}, () => [
|
|
918
|
+
Oe
|
|
940
919
|
])
|
|
941
|
-
])) : (
|
|
942
|
-
(
|
|
943
|
-
key:
|
|
944
|
-
class:
|
|
920
|
+
])) : (l(), o(D, { key: 1 }, [
|
|
921
|
+
(l(!0), o(D, null, ne(i(m), (k) => (l(), o("div", {
|
|
922
|
+
key: k.value,
|
|
923
|
+
class: h([
|
|
945
924
|
"py-2.5 px-4 flex items-center transition-colors duration-200",
|
|
946
925
|
"text-[14px] leading-5",
|
|
947
926
|
"text-gray-900",
|
|
948
|
-
|
|
949
|
-
|
|
927
|
+
k.value === e.modelValue ? "bg-gray-50 font-medium" : "hover:bg-gray-50",
|
|
928
|
+
k.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
950
929
|
]),
|
|
951
|
-
onClick: (H) =>
|
|
930
|
+
onClick: (H) => !k.disabled && v(k)
|
|
952
931
|
}, [
|
|
953
|
-
|
|
932
|
+
e.withCheckIcon && k.value === e.modelValue ? (l(), o("svg", {
|
|
954
933
|
key: 0,
|
|
955
|
-
class:
|
|
934
|
+
class: h([
|
|
956
935
|
"w-4 h-4 text-primary-600 shrink-0",
|
|
957
|
-
|
|
936
|
+
e.checkIconPosition === "left" ? "mr-2" : "ml-2 order-last"
|
|
958
937
|
]),
|
|
959
938
|
fill: "none",
|
|
960
939
|
stroke: "currentColor",
|
|
961
940
|
viewBox: "0 0 24 24"
|
|
962
|
-
},
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
}, null, -1)
|
|
969
|
-
]), 2)) : g("", !0),
|
|
970
|
-
c("span", {
|
|
971
|
-
class: p({ "text-gray-500": $.disabled })
|
|
972
|
-
}, v($.label), 3)
|
|
973
|
-
], 10, Ie))), 128)),
|
|
974
|
-
m.value.length === 0 ? (o(), i("div", Le, v(h.nothingFoundMessage || "No options found"), 1)) : g("", !0)
|
|
941
|
+
}, We, 2)) : g("", !0),
|
|
942
|
+
f("span", {
|
|
943
|
+
class: h({ "text-gray-500": k.disabled })
|
|
944
|
+
}, p(k.label), 3)
|
|
945
|
+
], 10, He))), 128)),
|
|
946
|
+
i(m).length === 0 ? (l(), o("div", Ke, p(e.nothingFoundMessage || "No options found"), 1)) : g("", !0)
|
|
975
947
|
], 64))
|
|
976
948
|
], 2), [
|
|
977
|
-
[
|
|
949
|
+
[ie, n.value]
|
|
978
950
|
])
|
|
979
951
|
], 512));
|
|
980
952
|
}
|
|
981
|
-
}),
|
|
953
|
+
}), Ue = ["disabled"], Xe = {
|
|
982
954
|
key: 0,
|
|
983
955
|
class: "w-3.5 h-3.5",
|
|
984
956
|
viewBox: "0 0 20 20",
|
|
985
957
|
fill: "currentColor"
|
|
986
|
-
},
|
|
958
|
+
}, Ye = /* @__PURE__ */ f("path", {
|
|
959
|
+
"fill-rule": "evenodd",
|
|
960
|
+
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
961
|
+
"clip-rule": "evenodd"
|
|
962
|
+
}, null, -1), Qe = [
|
|
963
|
+
Ye
|
|
964
|
+
], Ge = {
|
|
987
965
|
key: 1,
|
|
988
966
|
class: "animate-spin"
|
|
989
|
-
},
|
|
967
|
+
}, Je = /* @__PURE__ */ f("svg", {
|
|
968
|
+
class: "w-3.5 h-3.5",
|
|
969
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
970
|
+
fill: "none",
|
|
971
|
+
viewBox: "0 0 24 24"
|
|
972
|
+
}, [
|
|
973
|
+
/* @__PURE__ */ f("circle", {
|
|
974
|
+
class: "opacity-25",
|
|
975
|
+
cx: "12",
|
|
976
|
+
cy: "12",
|
|
977
|
+
r: "10",
|
|
978
|
+
stroke: "currentColor",
|
|
979
|
+
"stroke-width": "4"
|
|
980
|
+
}),
|
|
981
|
+
/* @__PURE__ */ f("path", {
|
|
982
|
+
class: "opacity-75",
|
|
983
|
+
fill: "currentColor",
|
|
984
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
985
|
+
})
|
|
986
|
+
], -1), Ze = [
|
|
987
|
+
Je
|
|
988
|
+
], vt = /* @__PURE__ */ C({
|
|
990
989
|
__name: "Chip",
|
|
991
990
|
props: {
|
|
992
991
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -994,83 +993,60 @@ const T = {
|
|
|
994
993
|
size: { default: "md" },
|
|
995
994
|
variant: { default: "filled" },
|
|
996
995
|
color: { default: "primary" },
|
|
996
|
+
radius: { default: "xl" },
|
|
997
|
+
checked: { type: Boolean, default: !1 },
|
|
997
998
|
disabled: { type: Boolean, default: !1 },
|
|
999
|
+
withRemoveButton: { type: Boolean, default: !1 },
|
|
998
1000
|
withCheckIcon: { type: Boolean, default: !0 },
|
|
999
|
-
|
|
1000
|
-
allowDeselect: { type: Boolean, default: !0 }
|
|
1001
|
+
checkIconPosition: { default: "left" },
|
|
1002
|
+
allowDeselect: { type: Boolean, default: !0 },
|
|
1003
|
+
loading: { type: Boolean, default: !1 }
|
|
1001
1004
|
},
|
|
1002
1005
|
emits: ["update:modelValue"],
|
|
1003
|
-
setup(
|
|
1004
|
-
const
|
|
1005
|
-
disabled:
|
|
1006
|
-
loading:
|
|
1007
|
-
})),
|
|
1008
|
-
|
|
1006
|
+
setup(e, { emit: s }) {
|
|
1007
|
+
const t = e, n = c(() => P(t.color)), r = c(() => S(t.size, "chip")), u = c(() => R({
|
|
1008
|
+
disabled: t.disabled,
|
|
1009
|
+
loading: t.loading
|
|
1010
|
+
})), x = c(() => P(t.color, "filled")), a = c(() => P(t.color, "outline")), d = () => {
|
|
1011
|
+
t.disabled || t.loading || t.modelValue && !t.allowDeselect || s("update:modelValue", !t.modelValue);
|
|
1009
1012
|
};
|
|
1010
|
-
return (
|
|
1011
|
-
class:
|
|
1013
|
+
return (y, m) => (l(), o("button", {
|
|
1014
|
+
class: h([
|
|
1012
1015
|
"inline-flex items-center justify-center gap-2 rounded-full transition-colors duration-200 select-none",
|
|
1013
1016
|
"focus:outline-none",
|
|
1014
|
-
|
|
1015
|
-
r
|
|
1016
|
-
|
|
1017
|
-
|
|
1017
|
+
i(n),
|
|
1018
|
+
i(r),
|
|
1019
|
+
i(u),
|
|
1020
|
+
e.modelValue ? i(x) : i(a),
|
|
1018
1021
|
"cursor-pointer"
|
|
1019
1022
|
]),
|
|
1020
|
-
disabled:
|
|
1021
|
-
onClick:
|
|
1023
|
+
disabled: e.disabled || e.loading,
|
|
1024
|
+
onClick: d
|
|
1022
1025
|
}, [
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
"clip-rule": "evenodd"
|
|
1028
|
-
}, null, -1)
|
|
1029
|
-
]))) : g("", !0),
|
|
1030
|
-
x.loading ? (o(), i("span", Ae, m[1] || (m[1] = [
|
|
1031
|
-
c("svg", {
|
|
1032
|
-
class: "w-3.5 h-3.5",
|
|
1033
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1034
|
-
fill: "none",
|
|
1035
|
-
viewBox: "0 0 24 24"
|
|
1036
|
-
}, [
|
|
1037
|
-
c("circle", {
|
|
1038
|
-
class: "opacity-25",
|
|
1039
|
-
cx: "12",
|
|
1040
|
-
cy: "12",
|
|
1041
|
-
r: "10",
|
|
1042
|
-
stroke: "currentColor",
|
|
1043
|
-
"stroke-width": "4"
|
|
1044
|
-
}),
|
|
1045
|
-
c("path", {
|
|
1046
|
-
class: "opacity-75",
|
|
1047
|
-
fill: "currentColor",
|
|
1048
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
1049
|
-
})
|
|
1050
|
-
], -1)
|
|
1051
|
-
]))) : g("", !0),
|
|
1052
|
-
c("span", {
|
|
1053
|
-
class: p([
|
|
1026
|
+
e.withCheckIcon && e.modelValue ? (l(), o("svg", Xe, Qe)) : g("", !0),
|
|
1027
|
+
e.loading ? (l(), o("span", Ge, Ze)) : g("", !0),
|
|
1028
|
+
f("span", {
|
|
1029
|
+
class: h([
|
|
1054
1030
|
"whitespace-nowrap",
|
|
1055
|
-
|
|
1031
|
+
e.loading ? "opacity-75" : ""
|
|
1056
1032
|
])
|
|
1057
|
-
},
|
|
1058
|
-
], 10,
|
|
1033
|
+
}, p(e.label), 3)
|
|
1034
|
+
], 10, Ue));
|
|
1059
1035
|
}
|
|
1060
|
-
}),
|
|
1061
|
-
const
|
|
1036
|
+
}), _e = (e, s = 0) => {
|
|
1037
|
+
const t = {
|
|
1062
1038
|
position: "absolute",
|
|
1063
1039
|
transform: "translate(50%, -50%)"
|
|
1064
|
-
}, [
|
|
1065
|
-
if (
|
|
1066
|
-
const
|
|
1067
|
-
(
|
|
1040
|
+
}, [n, r] = e.split("-");
|
|
1041
|
+
if (n === "top" ? t.top = "0" : n === "bottom" ? (t.bottom = "0", t.transform = "translate(50%, 50%)") : n === "middle" && (t.top = "50%", r === "start" ? t.transform = "translate(-50%, -50%)" : r === "end" ? t.transform = "translate(50%, -50%)" : t.transform = "translate(0, -50%)"), r === "start" ? (t.left = "0", t.transform = n === "bottom" ? "translate(-50%, 50%)" : "translate(-50%, -50%)") : r === "end" ? t.right = "0" : r === "center" && (t.left = "50%", t.transform = n === "bottom" ? "translate(-50%, 50%)" : "translate(-50%, -50%)"), s) {
|
|
1042
|
+
const u = t.transform.includes("50%") ? "50%" : "0", x = t.transform.includes("-50%") ? "-50%" : "50%";
|
|
1043
|
+
(n === "top" || n === "bottom") && (t.transform = `translate(${u}, ${x}) translateY(${s}px)`), (r === "start" || r === "end") && (t.transform = `translate(${u}, ${x}) translateX(${r === "start" ? -s : s}px)`);
|
|
1068
1044
|
}
|
|
1069
|
-
return
|
|
1070
|
-
},
|
|
1045
|
+
return t;
|
|
1046
|
+
}, et = {
|
|
1071
1047
|
name: "Indicator"
|
|
1072
|
-
},
|
|
1073
|
-
...
|
|
1048
|
+
}, tt = /* @__PURE__ */ C({
|
|
1049
|
+
...et,
|
|
1074
1050
|
props: {
|
|
1075
1051
|
position: { default: "top-end" },
|
|
1076
1052
|
size: { default: "md" },
|
|
@@ -1085,21 +1061,21 @@ const T = {
|
|
|
1085
1061
|
processing: { type: Boolean, default: !1 },
|
|
1086
1062
|
zIndex: { default: 200 }
|
|
1087
1063
|
},
|
|
1088
|
-
setup(
|
|
1089
|
-
const s =
|
|
1064
|
+
setup(e) {
|
|
1065
|
+
const s = e, t = c(() => [
|
|
1090
1066
|
s.inline ? "inline-block" : "block",
|
|
1091
1067
|
"relative"
|
|
1092
|
-
]),
|
|
1068
|
+
]), n = c(() => ({
|
|
1093
1069
|
...s.inline && { display: "inline-block" }
|
|
1094
|
-
})),
|
|
1070
|
+
})), r = c(() => [
|
|
1095
1071
|
// Base classes
|
|
1096
1072
|
"flex items-center justify-center",
|
|
1097
1073
|
"absolute",
|
|
1098
1074
|
"select-none",
|
|
1099
1075
|
"rounded-full",
|
|
1100
1076
|
// Size classes
|
|
1101
|
-
|
|
1102
|
-
|
|
1077
|
+
X(s.size, "indicator"),
|
|
1078
|
+
S(s.size, "indicator"),
|
|
1103
1079
|
// Color classes
|
|
1104
1080
|
!s.disabled && `bg-${s.color === "primary" ? "blue" : s.color}-600 text-white`,
|
|
1105
1081
|
s.disabled && "bg-gray-200 text-gray-500",
|
|
@@ -1107,205 +1083,204 @@ const T = {
|
|
|
1107
1083
|
s.withBorder && "border-2 border-white dark:border-gray-900",
|
|
1108
1084
|
// Processing animation
|
|
1109
1085
|
s.processing && "animate-pulse"
|
|
1110
|
-
]),
|
|
1111
|
-
...
|
|
1086
|
+
]), u = c(() => ({
|
|
1087
|
+
..._e(s.position, s.offset),
|
|
1112
1088
|
zIndex: s.zIndex
|
|
1113
1089
|
}));
|
|
1114
|
-
return (
|
|
1115
|
-
class:
|
|
1116
|
-
style:
|
|
1090
|
+
return (x, a) => (l(), o("div", {
|
|
1091
|
+
class: h(i(t)),
|
|
1092
|
+
style: E(i(n))
|
|
1117
1093
|
}, [
|
|
1118
|
-
|
|
1094
|
+
e.disabled ? g("", !0) : (l(), o("div", {
|
|
1119
1095
|
key: 0,
|
|
1120
|
-
class:
|
|
1121
|
-
style:
|
|
1122
|
-
},
|
|
1123
|
-
|
|
1096
|
+
class: h(i(r)),
|
|
1097
|
+
style: E(i(u))
|
|
1098
|
+
}, p(e.label), 7)),
|
|
1099
|
+
B(x.$slots, "default", {}, void 0, !0)
|
|
1124
1100
|
], 6));
|
|
1125
1101
|
}
|
|
1126
1102
|
});
|
|
1127
|
-
const
|
|
1128
|
-
const
|
|
1129
|
-
for (const [
|
|
1130
|
-
|
|
1131
|
-
return
|
|
1132
|
-
},
|
|
1103
|
+
const st = (e, s) => {
|
|
1104
|
+
const t = e.__vccOpts || e;
|
|
1105
|
+
for (const [n, r] of s)
|
|
1106
|
+
t[n] = r;
|
|
1107
|
+
return t;
|
|
1108
|
+
}, wt = /* @__PURE__ */ st(tt, [["__scopeId", "data-v-643e9acf"]]), lt = ["aria-valuenow"], kt = /* @__PURE__ */ C({
|
|
1133
1109
|
__name: "Progress",
|
|
1134
1110
|
props: {
|
|
1135
1111
|
value: { default: 0 },
|
|
1136
1112
|
size: { default: "md" },
|
|
1137
|
-
color:
|
|
1138
|
-
label:
|
|
1113
|
+
color: null,
|
|
1114
|
+
label: null,
|
|
1139
1115
|
striped: { type: Boolean, default: !1 },
|
|
1140
1116
|
animated: { type: Boolean, default: !1 }
|
|
1141
1117
|
},
|
|
1142
|
-
setup(
|
|
1143
|
-
return (s,
|
|
1144
|
-
class:
|
|
1118
|
+
setup(e) {
|
|
1119
|
+
return (s, t) => (l(), o("div", {
|
|
1120
|
+
class: h([
|
|
1145
1121
|
"relative w-full rounded-sm overflow-hidden",
|
|
1146
1122
|
"bg-gray-100",
|
|
1147
|
-
|
|
1123
|
+
i(X)(e.size, "progress")
|
|
1148
1124
|
]),
|
|
1149
1125
|
role: "progressbar",
|
|
1150
|
-
"aria-valuenow":
|
|
1126
|
+
"aria-valuenow": e.value,
|
|
1151
1127
|
"aria-valuemin": "0",
|
|
1152
1128
|
"aria-valuemax": "100"
|
|
1153
1129
|
}, [
|
|
1154
|
-
|
|
1155
|
-
class:
|
|
1130
|
+
f("div", {
|
|
1131
|
+
class: h([
|
|
1156
1132
|
"h-full transition-all duration-300 ease-in-out",
|
|
1157
|
-
|
|
1133
|
+
i(P)(e.color || "primary", "filled"),
|
|
1158
1134
|
{
|
|
1159
|
-
"bg-striped":
|
|
1160
|
-
"bg-striped animate-progress":
|
|
1135
|
+
"bg-striped": e.striped && !e.animated,
|
|
1136
|
+
"bg-striped animate-progress": e.animated
|
|
1161
1137
|
}
|
|
1162
1138
|
]),
|
|
1163
|
-
style:
|
|
1139
|
+
style: E({ width: `${e.value}%` })
|
|
1164
1140
|
}, [
|
|
1165
|
-
|
|
1141
|
+
e.label && (e.size === "lg" || e.size === "xl") ? (l(), o("span", {
|
|
1166
1142
|
key: 0,
|
|
1167
|
-
class:
|
|
1143
|
+
class: h([
|
|
1168
1144
|
"block px-2 py-1 text-white whitespace-nowrap font-medium leading-none",
|
|
1169
|
-
|
|
1145
|
+
i(Y)(e.size)
|
|
1170
1146
|
])
|
|
1171
|
-
},
|
|
1147
|
+
}, p(e.label), 3)) : g("", !0)
|
|
1172
1148
|
], 6)
|
|
1173
|
-
], 10,
|
|
1149
|
+
], 10, lt));
|
|
1174
1150
|
}
|
|
1175
1151
|
});
|
|
1176
|
-
const
|
|
1152
|
+
const at = {
|
|
1177
1153
|
key: 0,
|
|
1178
1154
|
class: "flex-shrink-0"
|
|
1179
|
-
},
|
|
1155
|
+
}, ot = {
|
|
1180
1156
|
key: 0,
|
|
1181
1157
|
class: "flex items-center justify-between"
|
|
1182
|
-
},
|
|
1158
|
+
}, nt = {
|
|
1183
1159
|
key: 1,
|
|
1184
1160
|
class: "flex-shrink-0 ml-3"
|
|
1185
|
-
},
|
|
1161
|
+
}, it = ["disabled"], rt = /* @__PURE__ */ f("span", { class: "sr-only" }, "Close", -1), dt = /* @__PURE__ */ f("svg", {
|
|
1162
|
+
class: "h-5 w-5",
|
|
1163
|
+
viewBox: "0 0 20 20",
|
|
1164
|
+
fill: "currentColor",
|
|
1165
|
+
"aria-hidden": "true"
|
|
1166
|
+
}, [
|
|
1167
|
+
/* @__PURE__ */ f("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" })
|
|
1168
|
+
], -1), ct = [
|
|
1169
|
+
rt,
|
|
1170
|
+
dt
|
|
1171
|
+
], Ct = /* @__PURE__ */ C({
|
|
1186
1172
|
__name: "Alert",
|
|
1187
1173
|
props: {
|
|
1188
|
-
title:
|
|
1189
|
-
message:
|
|
1190
|
-
icon:
|
|
1174
|
+
title: null,
|
|
1175
|
+
message: null,
|
|
1176
|
+
icon: null,
|
|
1191
1177
|
variant: { default: "default" },
|
|
1192
1178
|
color: { default: "primary" },
|
|
1193
1179
|
size: { default: "md" },
|
|
1194
1180
|
closable: { type: Boolean, default: !1 },
|
|
1195
|
-
onClose:
|
|
1181
|
+
onClose: null,
|
|
1196
1182
|
disabled: { type: Boolean, default: !1 },
|
|
1197
1183
|
loading: { type: Boolean, default: !1 },
|
|
1198
1184
|
valid: { type: Boolean, default: void 0 },
|
|
1199
|
-
invalid: { type: Boolean, default: void 0 }
|
|
1200
|
-
class: {}
|
|
1185
|
+
invalid: { type: Boolean, default: void 0 }
|
|
1201
1186
|
},
|
|
1202
1187
|
emits: ["close"],
|
|
1203
|
-
setup(
|
|
1204
|
-
const
|
|
1188
|
+
setup(e, { emit: s }) {
|
|
1189
|
+
const t = e, n = c(() => P(t.color, t.variant, {
|
|
1205
1190
|
hover: !1,
|
|
1206
1191
|
active: !1,
|
|
1207
1192
|
focus: !1,
|
|
1208
|
-
disabled:
|
|
1209
|
-
})), r =
|
|
1210
|
-
disabled:
|
|
1211
|
-
loading:
|
|
1212
|
-
})),
|
|
1213
|
-
valid:
|
|
1214
|
-
invalid:
|
|
1215
|
-
})),
|
|
1193
|
+
disabled: t.disabled
|
|
1194
|
+
})), r = c(() => ce(t.variant)), u = c(() => re(t.color, t.variant)), x = c(() => de(t.color, t.variant)), a = c(() => S(t.size, "alert")), d = c(() => U(t.size, "alert")), y = c(() => Y(t.size)), m = c(() => ue(t.size)), w = c(() => R({
|
|
1195
|
+
disabled: t.disabled,
|
|
1196
|
+
loading: t.loading
|
|
1197
|
+
})), v = c(() => he({
|
|
1198
|
+
valid: t.valid,
|
|
1199
|
+
invalid: t.invalid
|
|
1200
|
+
})), I = c(() => fe({
|
|
1216
1201
|
hover: !0,
|
|
1217
1202
|
focus: !0
|
|
1218
|
-
},
|
|
1219
|
-
|
|
1203
|
+
}, t.color)), V = () => {
|
|
1204
|
+
s("close");
|
|
1220
1205
|
};
|
|
1221
|
-
return (
|
|
1222
|
-
class:
|
|
1206
|
+
return (q, T) => (l(), o("div", {
|
|
1207
|
+
class: h([
|
|
1223
1208
|
"relative rounded-md",
|
|
1224
|
-
r
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1209
|
+
i(r),
|
|
1210
|
+
i(n),
|
|
1211
|
+
i(a),
|
|
1212
|
+
i(w),
|
|
1213
|
+
i(v)
|
|
1229
1214
|
]),
|
|
1230
1215
|
role: "alert"
|
|
1231
1216
|
}, [
|
|
1232
|
-
|
|
1233
|
-
class:
|
|
1217
|
+
f("div", {
|
|
1218
|
+
class: h(["flex items-start", [i(m)]])
|
|
1234
1219
|
}, [
|
|
1235
|
-
|
|
1236
|
-
(
|
|
1237
|
-
class:
|
|
1238
|
-
|
|
1239
|
-
|
|
1220
|
+
e.icon ? (l(), o("div", at, [
|
|
1221
|
+
(l(), j(M(e.icon), {
|
|
1222
|
+
class: h([
|
|
1223
|
+
i(d),
|
|
1224
|
+
i(u)
|
|
1240
1225
|
])
|
|
1241
1226
|
}, null, 8, ["class"]))
|
|
1242
1227
|
])) : g("", !0),
|
|
1243
|
-
|
|
1244
|
-
class:
|
|
1228
|
+
f("div", {
|
|
1229
|
+
class: h(["flex-grow", [e.icon && "ml-3"]])
|
|
1245
1230
|
}, [
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
class:
|
|
1231
|
+
e.title ? (l(), o("div", ot, [
|
|
1232
|
+
f("h3", {
|
|
1233
|
+
class: h([
|
|
1249
1234
|
"font-medium",
|
|
1250
|
-
|
|
1235
|
+
i(x)
|
|
1251
1236
|
])
|
|
1252
|
-
},
|
|
1237
|
+
}, p(e.title), 3)
|
|
1253
1238
|
])) : g("", !0),
|
|
1254
|
-
|
|
1239
|
+
e.message ? (l(), o("div", {
|
|
1255
1240
|
key: 1,
|
|
1256
|
-
class:
|
|
1241
|
+
class: h([
|
|
1257
1242
|
"mt-1",
|
|
1258
|
-
|
|
1259
|
-
|
|
1243
|
+
e.variant === "filled" ? "text-white/90" : "text-gray-600",
|
|
1244
|
+
i(y)
|
|
1260
1245
|
])
|
|
1261
|
-
},
|
|
1262
|
-
|
|
1246
|
+
}, p(e.message), 3)) : g("", !0),
|
|
1247
|
+
B(q.$slots, "default")
|
|
1263
1248
|
], 2),
|
|
1264
|
-
|
|
1265
|
-
|
|
1249
|
+
e.closable ? (l(), o("div", nt, [
|
|
1250
|
+
f("button", {
|
|
1266
1251
|
type: "button",
|
|
1267
|
-
class:
|
|
1268
|
-
|
|
1269
|
-
|
|
1252
|
+
class: h(["inline-flex rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2", [
|
|
1253
|
+
e.variant === "filled" ? "text-white/80 hover:text-white focus:ring-white" : "text-gray-400 hover:text-gray-500 focus:ring-primary-500",
|
|
1254
|
+
i(I)
|
|
1270
1255
|
]]),
|
|
1271
|
-
disabled:
|
|
1272
|
-
onClick:
|
|
1273
|
-
},
|
|
1274
|
-
c("span", { class: "sr-only" }, "Close", -1),
|
|
1275
|
-
c("svg", {
|
|
1276
|
-
class: "h-5 w-5",
|
|
1277
|
-
viewBox: "0 0 20 20",
|
|
1278
|
-
fill: "currentColor",
|
|
1279
|
-
"aria-hidden": "true"
|
|
1280
|
-
}, [
|
|
1281
|
-
c("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" })
|
|
1282
|
-
], -1)
|
|
1283
|
-
]), 10, He)
|
|
1256
|
+
disabled: e.disabled,
|
|
1257
|
+
onClick: V
|
|
1258
|
+
}, ct, 10, it)
|
|
1284
1259
|
])) : g("", !0)
|
|
1285
1260
|
], 2)
|
|
1286
1261
|
], 2));
|
|
1287
1262
|
}
|
|
1288
|
-
}),
|
|
1263
|
+
}), $t = {}, ut = {
|
|
1289
1264
|
key: 0,
|
|
1290
1265
|
class: "badge-section mr-2"
|
|
1291
|
-
},
|
|
1266
|
+
}, ht = { class: "badge-label" }, ft = {
|
|
1292
1267
|
key: 1,
|
|
1293
1268
|
class: "badge-section ml-2"
|
|
1294
|
-
},
|
|
1269
|
+
}, zt = /* @__PURE__ */ C({
|
|
1295
1270
|
__name: "Badge",
|
|
1296
1271
|
props: {
|
|
1297
1272
|
size: { default: "md" },
|
|
1298
1273
|
circle: { type: Boolean, default: !1 },
|
|
1299
1274
|
radius: { default: "xl" },
|
|
1300
1275
|
color: { default: "primary" },
|
|
1301
|
-
gradient:
|
|
1302
|
-
leftSection:
|
|
1303
|
-
rightSection:
|
|
1276
|
+
gradient: null,
|
|
1277
|
+
leftSection: null,
|
|
1278
|
+
rightSection: null,
|
|
1304
1279
|
fullWidth: { type: Boolean, default: !1 },
|
|
1305
1280
|
variant: { default: "filled" }
|
|
1306
1281
|
},
|
|
1307
|
-
setup(
|
|
1308
|
-
const s =
|
|
1282
|
+
setup(e) {
|
|
1283
|
+
const s = e, t = (u) => ({
|
|
1309
1284
|
none: "rounded-none",
|
|
1310
1285
|
xs: "rounded",
|
|
1311
1286
|
sm: "rounded-md",
|
|
@@ -1313,50 +1288,50 @@ const Oe = {
|
|
|
1313
1288
|
lg: "rounded-xl",
|
|
1314
1289
|
xl: "rounded-2xl",
|
|
1315
1290
|
full: "rounded-full"
|
|
1316
|
-
})[
|
|
1317
|
-
var
|
|
1318
|
-
const
|
|
1291
|
+
})[u] || "rounded-lg", n = (u) => `relative pl-6 before:absolute before:left-2 before:top-1/2 before:-translate-y-1/2 before:w-2 before:h-2 before:rounded-full before:bg-${u}-500`, r = c(() => {
|
|
1292
|
+
var w, v;
|
|
1293
|
+
const u = "inline-flex items-center justify-center font-medium", x = s.variant === "gradient" ? `bg-gradient-to-r from-${(w = s.gradient) == null ? void 0 : w.from} to-${(v = s.gradient) == null ? void 0 : v.to} text-white` : P(s.color, s.variant), a = S(s.size, "badge"), d = t(s.radius), y = s.variant === "dot" ? n(s.color) : "";
|
|
1319
1294
|
return [
|
|
1320
|
-
|
|
1321
|
-
|
|
1295
|
+
u,
|
|
1296
|
+
x,
|
|
1322
1297
|
a,
|
|
1323
|
-
|
|
1324
|
-
|
|
1298
|
+
d,
|
|
1299
|
+
y,
|
|
1325
1300
|
{
|
|
1326
1301
|
"aspect-square p-0": s.circle,
|
|
1327
1302
|
"w-full": s.fullWidth
|
|
1328
1303
|
}
|
|
1329
1304
|
].filter(Boolean).join(" ");
|
|
1330
1305
|
});
|
|
1331
|
-
return (
|
|
1332
|
-
class:
|
|
1306
|
+
return (u, x) => (l(), o("div", {
|
|
1307
|
+
class: h(i(r))
|
|
1333
1308
|
}, [
|
|
1334
|
-
|
|
1335
|
-
typeof
|
|
1336
|
-
|
|
1337
|
-
], 64)) : (
|
|
1309
|
+
e.leftSection ? (l(), o("span", ut, [
|
|
1310
|
+
typeof e.leftSection == "string" ? (l(), o(D, { key: 0 }, [
|
|
1311
|
+
L(p(e.leftSection), 1)
|
|
1312
|
+
], 64)) : (l(), j(M(e.leftSection), { key: 1 }))
|
|
1338
1313
|
])) : g("", !0),
|
|
1339
|
-
|
|
1340
|
-
|
|
1314
|
+
f("span", ht, [
|
|
1315
|
+
B(u.$slots, "default")
|
|
1341
1316
|
]),
|
|
1342
|
-
|
|
1343
|
-
typeof
|
|
1344
|
-
|
|
1345
|
-
], 64)) : (
|
|
1317
|
+
e.rightSection ? (l(), o("span", ft, [
|
|
1318
|
+
typeof e.rightSection == "string" ? (l(), o(D, { key: 0 }, [
|
|
1319
|
+
L(p(e.rightSection), 1)
|
|
1320
|
+
], 64)) : (l(), j(M(e.rightSection), { key: 1 }))
|
|
1346
1321
|
])) : g("", !0)
|
|
1347
1322
|
], 2));
|
|
1348
1323
|
}
|
|
1349
1324
|
});
|
|
1350
1325
|
export {
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1326
|
+
Ct as Alert,
|
|
1327
|
+
zt as Badge,
|
|
1328
|
+
gt as Button,
|
|
1329
|
+
bt as Checkbox,
|
|
1330
|
+
vt as Chip,
|
|
1331
|
+
wt as Indicator,
|
|
1332
|
+
kt as Progress,
|
|
1333
|
+
pt as Radio,
|
|
1334
|
+
mt as Select,
|
|
1335
|
+
yt as TextInput,
|
|
1336
|
+
$t as composables
|
|
1362
1337
|
};
|