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