gurunkit 0.3.0 → 0.4.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/dist/gurun-kit.js +314 -107
- package/dist/gurun-kit.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/gurun-kit.js
CHANGED
|
@@ -1,32 +1,71 @@
|
|
|
1
|
-
import { Transition as e,
|
|
2
|
-
//#region
|
|
3
|
-
var
|
|
4
|
-
|
|
1
|
+
import { Transition as e, TransitionGroup as t, createElementBlock as n, createElementVNode as r, h as i, openBlock as a, ref as o, useId as s } from "vue";
|
|
2
|
+
//#region \0plugin-vue:export-helper
|
|
3
|
+
var c = (e, t) => {
|
|
4
|
+
let n = e.__vccOpts || e;
|
|
5
|
+
for (let [e, r] of t) n[e] = r;
|
|
6
|
+
return n;
|
|
7
|
+
}, l = {}, u = {
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
width: "1em",
|
|
10
|
+
height: "1em",
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
class: "animate-spin"
|
|
13
|
+
};
|
|
14
|
+
function d(e, t) {
|
|
15
|
+
return a(), n("svg", u, [...t[0] ||= [r("path", {
|
|
16
|
+
d: "M0 0h24v24H0z",
|
|
17
|
+
fill: "none"
|
|
18
|
+
}, null, -1), r("g", { fill: "currentColor" }, [r("path", {
|
|
19
|
+
"fill-rule": "evenodd",
|
|
20
|
+
d: "M12 19a7 7 0 1 0 0-14a7 7 0 0 0 0 14m0 3c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10",
|
|
21
|
+
"clip-rule": "evenodd",
|
|
22
|
+
opacity: ".2"
|
|
23
|
+
}), r("path", { d: "M2 12C2 6.477 6.477 2 12 2v3a7 7 0 0 0-7 7z" })], -1)]]);
|
|
24
|
+
}
|
|
25
|
+
var f = /* @__PURE__ */ c(l, [["render", d]]), p = {
|
|
26
|
+
base: "font-medium cursor-pointer inline-flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
5
27
|
colors: {
|
|
6
|
-
primary:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
28
|
+
primary: {
|
|
29
|
+
solid: "bg-blue-600 text-white hover:bg-blue-700",
|
|
30
|
+
outline: "border-blue-600 text-blue-600 hover:bg-blue-600 hover:text-white"
|
|
31
|
+
},
|
|
32
|
+
success: {
|
|
33
|
+
solid: "bg-green-600 text-white hover:bg-green-700",
|
|
34
|
+
outline: "border-green-600 text-green-600 hover:bg-green-600 hover:text-white"
|
|
35
|
+
},
|
|
36
|
+
error: {
|
|
37
|
+
solid: "bg-red-600 text-white hover:bg-red-700",
|
|
38
|
+
outline: "border-red-600 text-red-600 hover:bg-red-600 hover:text-white"
|
|
39
|
+
},
|
|
40
|
+
warning: {
|
|
41
|
+
solid: "bg-yellow-600 text-white hover:bg-yellow-700",
|
|
42
|
+
outline: "border-yellow-600 text-yellow-600 hover:bg-yellow-600 hover:text-white"
|
|
43
|
+
},
|
|
44
|
+
light: {
|
|
45
|
+
solid: "bg-white text-gray-700 hover:bg-gray-100",
|
|
46
|
+
outline: "border-gray-300 text-gray-900 hover:bg-gray-100"
|
|
47
|
+
}
|
|
11
48
|
},
|
|
12
49
|
sizes: {
|
|
13
50
|
sm: "h-8 px-3 rounded text-sm",
|
|
14
51
|
md: "h-10 px-4 rounded-md",
|
|
15
52
|
lg: "h-12 px-6 rounded-md text-lg"
|
|
16
53
|
}
|
|
17
|
-
},
|
|
18
|
-
let { class: n, ...
|
|
19
|
-
return
|
|
54
|
+
}, m = (e, t) => {
|
|
55
|
+
let { class: n, ...r } = t.attrs;
|
|
56
|
+
return i(e.tag ?? "button", {
|
|
57
|
+
disabled: e.loading,
|
|
20
58
|
class: [
|
|
21
59
|
n,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
60
|
+
p.base,
|
|
61
|
+
p.colors[e.color ?? "primary"][e.variant ?? "solid"],
|
|
62
|
+
p.sizes[e.size ?? "md"],
|
|
63
|
+
e.variant === "solid" ? "" : "border"
|
|
25
64
|
],
|
|
26
|
-
...
|
|
27
|
-
}, {
|
|
65
|
+
...r
|
|
66
|
+
}, [e.loading ? i(f, { "data-test": "spinner" }) : t.slots.icon ? t.slots.icon() : null, t.slots.default ? t.slots.default() : null]);
|
|
28
67
|
};
|
|
29
|
-
|
|
68
|
+
m.props = {
|
|
30
69
|
color: {
|
|
31
70
|
type: String,
|
|
32
71
|
default: "primary"
|
|
@@ -38,19 +77,27 @@ s.props = {
|
|
|
38
77
|
tag: {
|
|
39
78
|
type: null,
|
|
40
79
|
default: "button"
|
|
80
|
+
},
|
|
81
|
+
variant: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: "solid"
|
|
84
|
+
},
|
|
85
|
+
loading: {
|
|
86
|
+
type: Boolean,
|
|
87
|
+
default: !1
|
|
41
88
|
}
|
|
42
89
|
};
|
|
43
90
|
//#endregion
|
|
44
91
|
//#region src/utils.ts
|
|
45
|
-
function
|
|
92
|
+
function h(e) {
|
|
46
93
|
return typeof e == "number" ? new Intl.NumberFormat().format(e) : new Intl.NumberFormat().format(Number(e.replace(/\D/gi, "")));
|
|
47
94
|
}
|
|
48
|
-
function
|
|
95
|
+
function g(e) {
|
|
49
96
|
return `${Number(e.replace(/\D/gi, ""))}`;
|
|
50
97
|
}
|
|
51
98
|
//#endregion
|
|
52
99
|
//#region src/components/input/input.ts
|
|
53
|
-
var
|
|
100
|
+
var _ = {
|
|
54
101
|
base: "border focus:outline-1",
|
|
55
102
|
file: "pl-0 file:bg-gray-100 file:h-full file:text-gray-900 file:border-r dark:file:bg-gray-700 dark:file:text-white",
|
|
56
103
|
colors: {
|
|
@@ -95,31 +142,31 @@ var u = {
|
|
|
95
142
|
file: "file:text-lg file:px-4 file:mr-4"
|
|
96
143
|
}
|
|
97
144
|
}
|
|
98
|
-
},
|
|
99
|
-
let { class: n, type:
|
|
100
|
-
return
|
|
101
|
-
type:
|
|
145
|
+
}, v = (e, t) => {
|
|
146
|
+
let { class: n, type: r, ...a } = t.attrs;
|
|
147
|
+
return i(e.tag === "textarea" ? "textarea" : "input", {
|
|
148
|
+
type: r,
|
|
102
149
|
class: [
|
|
103
150
|
n,
|
|
104
|
-
|
|
105
|
-
...
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
151
|
+
_.base,
|
|
152
|
+
...r === "file" ? [
|
|
153
|
+
_.file,
|
|
154
|
+
_.colors[e.color ?? "light"].file,
|
|
155
|
+
_.sizes[e.size ?? "md"].file
|
|
109
156
|
] : [],
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
157
|
+
_.colors[e.color ?? "light"].base,
|
|
158
|
+
_.sizes[e.size ?? "md"].base,
|
|
159
|
+
_.sizes[e.size ?? "md"][e.tag === "textarea" ? "textarea" : "input"]
|
|
113
160
|
],
|
|
114
161
|
...a,
|
|
115
|
-
value: e.currency ?
|
|
162
|
+
value: e.currency ? h(Number(e.modelValue)) : e.modelValue,
|
|
116
163
|
onInput: (n) => {
|
|
117
164
|
let r = n.target.value;
|
|
118
|
-
t.emit("update:modelValue", e.currency ?
|
|
165
|
+
t.emit("update:modelValue", e.currency ? g(r) : r);
|
|
119
166
|
}
|
|
120
167
|
});
|
|
121
168
|
};
|
|
122
|
-
|
|
169
|
+
v.props = {
|
|
123
170
|
color: {
|
|
124
171
|
type: String,
|
|
125
172
|
default: "light"
|
|
@@ -137,7 +184,7 @@ d.props = {
|
|
|
137
184
|
};
|
|
138
185
|
//#endregion
|
|
139
186
|
//#region src/components/checkbox/checkbox.ts
|
|
140
|
-
var
|
|
187
|
+
var y = {
|
|
141
188
|
wrapper: "inline-flex items-center gap-2.5",
|
|
142
189
|
label: "font-normal text-gray-900 dark:text-gray-300",
|
|
143
190
|
base: "appearance-none relative border focus-visible:outline-2 focus:ring-0 focus-visible:outline-offset-2 after:hidden checked:after:block after:content-[''] after:border-white after:-rotate-45 after:absolute",
|
|
@@ -153,28 +200,28 @@ var f = {
|
|
|
153
200
|
md: "size-4 rounded after:w-2.5 after:border-l-2 after:border-b-2 after:h-1.5 after:top-0.75 after:left-0.5",
|
|
154
201
|
lg: "size-6 rounded-md after:w-4 after:border-l-3 after:border-b-3 after:h-2.5 after:top-0.75 after:left-0.75"
|
|
155
202
|
}
|
|
156
|
-
},
|
|
157
|
-
let n = e.id ||
|
|
158
|
-
return
|
|
203
|
+
}, b = (e, t) => {
|
|
204
|
+
let n = e.id || s();
|
|
205
|
+
return i("div", { class: y.wrapper }, [i("input", {
|
|
159
206
|
...t.attrs,
|
|
160
207
|
id: n,
|
|
161
208
|
type: "checkbox",
|
|
162
209
|
checked: Array.isArray(e.modelValue) ? e.modelValue.findIndex((t) => t === e.inputValue) !== -1 : e.modelValue,
|
|
163
210
|
class: [
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
211
|
+
y.base,
|
|
212
|
+
y.colors[e.color ?? "light"],
|
|
213
|
+
y.sizes[e.size ?? "md"]
|
|
167
214
|
],
|
|
168
215
|
onChange: (n) => {
|
|
169
216
|
let r = n.target.checked;
|
|
170
217
|
t.emit("update:modelValue", Array.isArray(e.modelValue) ? r ? [...e.modelValue, e.inputValue] : e.modelValue.filter((t) => t !== e.inputValue) : r);
|
|
171
218
|
}
|
|
172
|
-
}), e.label ?
|
|
173
|
-
class:
|
|
219
|
+
}), e.label ? i("label", {
|
|
220
|
+
class: y.label,
|
|
174
221
|
for: n
|
|
175
222
|
}, e.label) : null]);
|
|
176
223
|
};
|
|
177
|
-
|
|
224
|
+
b.props = {
|
|
178
225
|
label: String,
|
|
179
226
|
color: {
|
|
180
227
|
type: String,
|
|
@@ -187,10 +234,10 @@ p.props = {
|
|
|
187
234
|
inputValue: String,
|
|
188
235
|
modelValue: [Boolean, Array],
|
|
189
236
|
id: String
|
|
190
|
-
},
|
|
237
|
+
}, b.emits = ["update:modelValue"];
|
|
191
238
|
//#endregion
|
|
192
239
|
//#region src/components/radio/radio.ts
|
|
193
|
-
var
|
|
240
|
+
var x = {
|
|
194
241
|
wrapper: "inline-flex items-center gap-2",
|
|
195
242
|
label: "font-normal text-gray-900 dark:text-gray-300",
|
|
196
243
|
base: "appearance-none rounded-full relative border focus-visible:outline-2 focus:ring-0 focus-visible:outline-offset-2 after:hidden checked:after:block after:content-[''] after:bg-white after:absolute after:rounded-full after:top-1/2 after:left-1/2 after:-translate-x-1/2 after:-translate-y-1/2",
|
|
@@ -206,27 +253,27 @@ var m = {
|
|
|
206
253
|
md: "size-4 after:size-1.75",
|
|
207
254
|
lg: "size-6 after:size-3"
|
|
208
255
|
}
|
|
209
|
-
},
|
|
210
|
-
let n = e.id ||
|
|
211
|
-
return
|
|
256
|
+
}, S = (e, t) => {
|
|
257
|
+
let n = e.id || s();
|
|
258
|
+
return i("div", { class: x.wrapper }, [i("input", {
|
|
212
259
|
...t.attrs,
|
|
213
260
|
id: n,
|
|
214
261
|
type: "radio",
|
|
215
262
|
checked: e.modelValue === e.inputValue,
|
|
216
263
|
class: [
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
264
|
+
x.base,
|
|
265
|
+
x.colors[e.color ?? "light"],
|
|
266
|
+
x.sizes[e.size ?? "md"]
|
|
220
267
|
],
|
|
221
268
|
onChange: () => {
|
|
222
269
|
t.emit("update:modelValue", e.inputValue);
|
|
223
270
|
}
|
|
224
|
-
}), e.label ?
|
|
225
|
-
class:
|
|
271
|
+
}), e.label ? i("label", {
|
|
272
|
+
class: x.label,
|
|
226
273
|
for: n
|
|
227
274
|
}, e.label) : null]);
|
|
228
275
|
};
|
|
229
|
-
|
|
276
|
+
S.props = {
|
|
230
277
|
label: String,
|
|
231
278
|
color: {
|
|
232
279
|
type: String,
|
|
@@ -239,10 +286,10 @@ h.props = {
|
|
|
239
286
|
inputValue: String,
|
|
240
287
|
modelValue: String,
|
|
241
288
|
id: String
|
|
242
|
-
},
|
|
289
|
+
}, S.emits = ["update:modelValue"];
|
|
243
290
|
//#endregion
|
|
244
291
|
//#region src/components/select/select.ts
|
|
245
|
-
var
|
|
292
|
+
var C = {
|
|
246
293
|
base: "appearance-none border focus:outline-1",
|
|
247
294
|
wrapper: "w-fit relative after:block after:content-[''] after:border-l-2 after:border-b-2 after:border-gray-500 after:-rotate-45 has-focus:after:rotate-135 after:absolute",
|
|
248
295
|
colors: {
|
|
@@ -262,15 +309,15 @@ var g = {
|
|
|
262
309
|
md: "h-10 pl-3 pr-10 rounded-md",
|
|
263
310
|
lg: "h-12 px-4 pr-12 rounded-md text-lg"
|
|
264
311
|
}
|
|
265
|
-
},
|
|
266
|
-
let { class: n, type:
|
|
267
|
-
return
|
|
268
|
-
type:
|
|
312
|
+
}, w = (e, t) => {
|
|
313
|
+
let { class: n, type: r, ...a } = t.attrs;
|
|
314
|
+
return i("div", { class: [C.wrapper, C.wrapperSizes[e.size ?? "md"]] }, i("select", {
|
|
315
|
+
type: r,
|
|
269
316
|
class: [
|
|
270
317
|
n,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
318
|
+
C.base,
|
|
319
|
+
C.colors[e.color ?? "light"],
|
|
320
|
+
C.sizes[e.size ?? "md"]
|
|
274
321
|
],
|
|
275
322
|
...a,
|
|
276
323
|
value: e.modelValue === null ? "" : e.modelValue,
|
|
@@ -278,9 +325,9 @@ var g = {
|
|
|
278
325
|
let n = e.target.value;
|
|
279
326
|
t.emit("update:modelValue", n === "" ? null : n);
|
|
280
327
|
}
|
|
281
|
-
}, e.options?.map((e) =>
|
|
328
|
+
}, e.options?.map((e) => i("option", { value: typeof e == "object" && e ? e.id === null ? "" : e.id : e === null ? "" : e }, typeof e == "object" && e ? e.name : e))));
|
|
282
329
|
};
|
|
283
|
-
|
|
330
|
+
w.props = {
|
|
284
331
|
color: {
|
|
285
332
|
type: String,
|
|
286
333
|
default: "light"
|
|
@@ -297,14 +344,14 @@ _.props = {
|
|
|
297
344
|
};
|
|
298
345
|
//#endregion
|
|
299
346
|
//#region src/components/form-item/form-item.ts
|
|
300
|
-
var
|
|
301
|
-
let n = e.id ||
|
|
302
|
-
return
|
|
347
|
+
var T = (e, t) => {
|
|
348
|
+
let n = e.id || s();
|
|
349
|
+
return i("div", [i("label", {
|
|
303
350
|
class: "block mb-1",
|
|
304
351
|
for: n
|
|
305
352
|
}, e.label), t.slots.default ? t.slots.default({ id: n }) : null]);
|
|
306
353
|
};
|
|
307
|
-
|
|
354
|
+
T.props = {
|
|
308
355
|
label: {
|
|
309
356
|
type: String,
|
|
310
357
|
required: !0
|
|
@@ -312,78 +359,85 @@ v.props = {
|
|
|
312
359
|
id: String
|
|
313
360
|
};
|
|
314
361
|
//#endregion
|
|
315
|
-
//#region
|
|
316
|
-
var
|
|
317
|
-
let n = e.__vccOpts || e;
|
|
318
|
-
for (let [e, r] of t) n[e] = r;
|
|
319
|
-
return n;
|
|
320
|
-
}, b = {}, x = {
|
|
362
|
+
//#region src/components/icons/x.vue
|
|
363
|
+
var E = {}, D = {
|
|
321
364
|
xmlns: "http://www.w3.org/2000/svg",
|
|
322
365
|
fill: "none",
|
|
323
366
|
viewBox: "0 0 24 24",
|
|
324
367
|
"stroke-width": "1.5",
|
|
325
368
|
stroke: "currentColor"
|
|
326
369
|
};
|
|
327
|
-
function
|
|
328
|
-
return
|
|
370
|
+
function O(e, t) {
|
|
371
|
+
return a(), n("svg", D, [...t[0] ||= [r("path", {
|
|
329
372
|
"stroke-linecap": "round",
|
|
330
373
|
"stroke-linejoin": "round",
|
|
331
374
|
d: "M6 18 18 6M6 6l12 12"
|
|
332
375
|
}, null, -1)]]);
|
|
333
376
|
}
|
|
334
|
-
var
|
|
377
|
+
var k = /* @__PURE__ */ c(E, [["render", O]]), A = (e, t) => i("div", {
|
|
378
|
+
"data-test": "card-content",
|
|
379
|
+
class: ["bg-white text-gray-900 rounded-md border border-gray-300 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-100", t.attrs.class]
|
|
380
|
+
}, [
|
|
381
|
+
e.title ? i("header", { class: "p-4 border-b border-gray-300 dark:border-gray-700 flex items-center justify-between" }, [i("h2", { class: "font-bold text-lg" }, e.title), t.slots.action?.()]) : null,
|
|
382
|
+
i("div", {
|
|
383
|
+
"data-test": "card-body",
|
|
384
|
+
class: "p-4"
|
|
385
|
+
}, t.slots.default?.()),
|
|
386
|
+
t.slots.footer ? i("footer", { class: "p-4 border-t border-gray-300 dark:border-gray-700" }, t.slots.footer()) : null
|
|
387
|
+
]);
|
|
388
|
+
A.props = { title: String };
|
|
389
|
+
//#endregion
|
|
390
|
+
//#region src/components/modal/modal.ts
|
|
391
|
+
var j = { size: {
|
|
335
392
|
sm: "max-w-md",
|
|
336
393
|
md: "max-w-2xl",
|
|
337
394
|
lg: "max-w-4xl"
|
|
338
|
-
} },
|
|
339
|
-
let
|
|
395
|
+
} }, M = (t, n) => {
|
|
396
|
+
let r = () => {
|
|
340
397
|
n.emit("update:visible", !1), n.emit("close");
|
|
341
398
|
};
|
|
342
|
-
return
|
|
399
|
+
return i(e, {
|
|
343
400
|
enterFromClass: "opacity-0",
|
|
344
401
|
enterActiveClass: "transition transition-all duration-150",
|
|
345
402
|
enterToClass: "opacity-100",
|
|
346
403
|
leaveFromClass: "opacity-100",
|
|
347
404
|
leaveActiveClass: "transition transition-all duration-150",
|
|
348
405
|
leaveToClass: "opacity-0"
|
|
349
|
-
}, () => t.visible ?
|
|
406
|
+
}, () => t.visible ? i("div", {
|
|
350
407
|
role: "dialog",
|
|
351
408
|
class: "fixed inset-0 bg-black/50 w-full h-screen z-30 flex items-center justify-center",
|
|
352
|
-
onClick:
|
|
353
|
-
},
|
|
354
|
-
|
|
355
|
-
class: ["
|
|
409
|
+
onClick: r
|
|
410
|
+
}, i(A, {
|
|
411
|
+
title: t.title,
|
|
412
|
+
class: ["w-full shadow", j.size[t.size ?? "md"]],
|
|
356
413
|
onClick: (e) => {
|
|
357
414
|
e.stopPropagation();
|
|
358
415
|
}
|
|
359
|
-
},
|
|
360
|
-
|
|
416
|
+
}, {
|
|
417
|
+
action: () => i("button", {
|
|
361
418
|
"aria-label": "Close Modal",
|
|
362
419
|
class: "cursor-pointer",
|
|
363
|
-
onClick:
|
|
364
|
-
},
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
}, n.slots.default?.()),
|
|
369
|
-
n.slots.footer ? r("footer", { class: "p-4 border-t border-gray-300" }, n.slots.footer()) : null
|
|
370
|
-
])) : void 0);
|
|
420
|
+
onClick: r
|
|
421
|
+
}, i(k, { class: "size-5" })),
|
|
422
|
+
default: n.slots.default,
|
|
423
|
+
footer: n.slots.footer ? () => n.slots.footer?.() : null
|
|
424
|
+
})) : void 0);
|
|
371
425
|
};
|
|
372
|
-
|
|
426
|
+
M.props = {
|
|
373
427
|
title: String,
|
|
374
428
|
visible: Boolean,
|
|
375
429
|
size: {
|
|
376
430
|
type: String,
|
|
377
431
|
default: "md"
|
|
378
432
|
}
|
|
379
|
-
},
|
|
433
|
+
}, M.emits = ["update:visible", "close"];
|
|
380
434
|
//#endregion
|
|
381
435
|
//#region src/components/table/table.ts
|
|
382
|
-
var
|
|
436
|
+
var N = (e) => i("div", { class: "overflow-x-auto" }, i("table", { class: "w-full border border-gray-300 dark:border-gray-700" }, [i("thead", i("tr", e.columns?.map((e) => i("th", { class: "text-left font-bold px-4 py-3 border-b border-gray-300 bg-gray-50 text-gray-900 dark:bg-gray-800 dark:text-white dark:border-gray-700" }, e.name)))), i("tbody", e.data?.length ? e.data?.map((t) => i("tr", e.columns?.map((e) => i("td", { class: "text-gray-900 px-4 py-3 border-b border-gray-300 dark:text-white dark:border-gray-700" }, e.render ? i(e.render, { item: t }) : t[e.id])))) : i("tr", i("td", {
|
|
383
437
|
colspan: 2,
|
|
384
438
|
class: "text-gray-900 px-4 py-3 dark:text-white"
|
|
385
439
|
}, e.emptyMessage)))]));
|
|
386
|
-
|
|
440
|
+
N.props = {
|
|
387
441
|
columns: {
|
|
388
442
|
type: Array,
|
|
389
443
|
default: () => []
|
|
@@ -399,14 +453,14 @@ E.props = {
|
|
|
399
453
|
};
|
|
400
454
|
//#endregion
|
|
401
455
|
//#region src/components/widget/widget.ts
|
|
402
|
-
var
|
|
456
|
+
var P = (e) => i("div", { class: "bg-white border border-gray-300 rounded-lg px-5 py-4.5 space-y-2 dark:bg-gray-800 dark:border-gray-700" }, [i("p", {
|
|
403
457
|
"data-test": "widget-label",
|
|
404
458
|
class: "text-gray-700 dark:text-gray-400"
|
|
405
|
-
}, e.label),
|
|
459
|
+
}, e.label), i("p", {
|
|
406
460
|
"data-test": "widget-value",
|
|
407
461
|
class: "text-gray-900 text-xl font-bold dark:text-white"
|
|
408
462
|
}, e.value)]);
|
|
409
|
-
|
|
463
|
+
P.props = {
|
|
410
464
|
label: {
|
|
411
465
|
type: String,
|
|
412
466
|
required: !0
|
|
@@ -417,4 +471,157 @@ D.props = {
|
|
|
417
471
|
}
|
|
418
472
|
};
|
|
419
473
|
//#endregion
|
|
420
|
-
|
|
474
|
+
//#region src/components/icons/chevron-left.vue
|
|
475
|
+
var F = {}, I = {
|
|
476
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
477
|
+
fill: "none",
|
|
478
|
+
viewBox: "0 0 24 24",
|
|
479
|
+
"stroke-width": "1.5",
|
|
480
|
+
stroke: "currentColor"
|
|
481
|
+
};
|
|
482
|
+
function L(e, t) {
|
|
483
|
+
return a(), n("svg", I, [...t[0] ||= [r("path", {
|
|
484
|
+
"stroke-linecap": "round",
|
|
485
|
+
"stroke-linejoin": "round",
|
|
486
|
+
d: "M15.75 19.5 8.25 12l7.5-7.5"
|
|
487
|
+
}, null, -1)]]);
|
|
488
|
+
}
|
|
489
|
+
var R = /* @__PURE__ */ c(F, [["render", L]]), z = {}, B = {
|
|
490
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
491
|
+
fill: "none",
|
|
492
|
+
viewBox: "0 0 24 24",
|
|
493
|
+
"stroke-width": "1.5",
|
|
494
|
+
stroke: "currentColor"
|
|
495
|
+
};
|
|
496
|
+
function V(e, t) {
|
|
497
|
+
return a(), n("svg", B, [...t[0] ||= [r("path", {
|
|
498
|
+
"stroke-linecap": "round",
|
|
499
|
+
"stroke-linejoin": "round",
|
|
500
|
+
d: "m8.25 4.5 7.5 7.5-7.5 7.5"
|
|
501
|
+
}, null, -1)]]);
|
|
502
|
+
}
|
|
503
|
+
var H = /* @__PURE__ */ c(z, [["render", V]]), U = {
|
|
504
|
+
active: "bg-blue-600 text-white dark:bg-blue-600",
|
|
505
|
+
inactive: "text-gray-900 cursor-pointer hover:bg-gray-50 dark:text-white dark:hover:bg-gray-700",
|
|
506
|
+
item: "w-9 h-9 flex items-center justify-center"
|
|
507
|
+
}, W = (e, t) => {
|
|
508
|
+
let n = e?.active && e?.active >= e.total;
|
|
509
|
+
return i("nav", { class: "border flex w-fit rounded-md border-gray-300 dark:border-gray-700" }, [
|
|
510
|
+
e?.active && e?.active < 2 ? null : i("a", {
|
|
511
|
+
"aria-label": "Prev",
|
|
512
|
+
class: [
|
|
513
|
+
U.item,
|
|
514
|
+
U.inactive,
|
|
515
|
+
"border-r border-gray-300 rounded-l-md dark:border-gray-700"
|
|
516
|
+
],
|
|
517
|
+
onClick: (n) => {
|
|
518
|
+
n.preventDefault(), e.active && t.emit("update:active", e.active - 1);
|
|
519
|
+
}
|
|
520
|
+
}, i(R, { class: "size-4" })),
|
|
521
|
+
...Array.from({ length: e.total }, (e, t) => t + 1).map((r) => i(r === e.active ? "span" : "a", {
|
|
522
|
+
class: [
|
|
523
|
+
e.active === r ? U.active : U.inactive,
|
|
524
|
+
U.item,
|
|
525
|
+
r === 1 ? "rounded-l-md" : "",
|
|
526
|
+
r < e.total || r === e.total && !n ? "border-r border-gray-300 dark:border-gray-700" : "rounded-r-md"
|
|
527
|
+
],
|
|
528
|
+
"data-page": r,
|
|
529
|
+
onClick: (e) => {
|
|
530
|
+
e.preventDefault(), t.emit("update:active", r);
|
|
531
|
+
}
|
|
532
|
+
}, r)),
|
|
533
|
+
n ? null : i("a", {
|
|
534
|
+
"aria-label": "Next",
|
|
535
|
+
class: [
|
|
536
|
+
U.item,
|
|
537
|
+
U.inactive,
|
|
538
|
+
"rounded-r-md"
|
|
539
|
+
],
|
|
540
|
+
onClick: (n) => {
|
|
541
|
+
n.preventDefault(), e.active && t.emit("update:active", e.active + 1);
|
|
542
|
+
}
|
|
543
|
+
}, i(H, { class: "size-4" }))
|
|
544
|
+
]);
|
|
545
|
+
};
|
|
546
|
+
W.props = {
|
|
547
|
+
total: {
|
|
548
|
+
type: Number,
|
|
549
|
+
required: !0
|
|
550
|
+
},
|
|
551
|
+
active: Number
|
|
552
|
+
}, W.emits = ["update:active"];
|
|
553
|
+
//#endregion
|
|
554
|
+
//#region src/components/message/message.compose.ts
|
|
555
|
+
var G = o([]);
|
|
556
|
+
function K() {
|
|
557
|
+
function e() {
|
|
558
|
+
return G.value;
|
|
559
|
+
}
|
|
560
|
+
function t(e, t = 3e3) {
|
|
561
|
+
let n = Date.now();
|
|
562
|
+
G.value.push({
|
|
563
|
+
id: n,
|
|
564
|
+
message: e,
|
|
565
|
+
duration: t
|
|
566
|
+
}), setTimeout(() => r(n), t);
|
|
567
|
+
}
|
|
568
|
+
function n() {
|
|
569
|
+
G.value = [];
|
|
570
|
+
}
|
|
571
|
+
function r(e) {
|
|
572
|
+
G.value = G.value.filter((t) => t.id !== e);
|
|
573
|
+
}
|
|
574
|
+
return {
|
|
575
|
+
getItems: e,
|
|
576
|
+
info: t,
|
|
577
|
+
clear: n,
|
|
578
|
+
close: r
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
//#endregion
|
|
582
|
+
//#region src/components/message/message.ts
|
|
583
|
+
var q = () => {
|
|
584
|
+
let { getItems: e } = K();
|
|
585
|
+
return i(t, {
|
|
586
|
+
tag: "div",
|
|
587
|
+
enterFromClass: "opacity-0 -translate-y-full",
|
|
588
|
+
enterActiveClass: "transition transition-all duration-150",
|
|
589
|
+
enterToClass: "opacity-100 translate-y-0",
|
|
590
|
+
leaveFromClass: "opacity-100 translate-y-0",
|
|
591
|
+
leaveActiveClass: "transition transition-all duration-150 absolute",
|
|
592
|
+
leaveToClass: "opacity-0 -translate-y-full",
|
|
593
|
+
moveClass: "transition transition-all duration-150",
|
|
594
|
+
"data-test": "message-wrapper",
|
|
595
|
+
class: "fixed top-4 left-1/2 -translate-x-1/2 z-9999 space-y-2"
|
|
596
|
+
}, () => e().map((e) => i("div", {
|
|
597
|
+
key: e.id,
|
|
598
|
+
"data-test": "message",
|
|
599
|
+
class: "bg-gray-900 text-white px-3 py-2 rounded-md whitespace-nowrap dark:bg-gray-700"
|
|
600
|
+
}, e.message)));
|
|
601
|
+
}, J = {
|
|
602
|
+
base: "px-4 py-3 rounded-md border flex items-start gap-2",
|
|
603
|
+
colors: {
|
|
604
|
+
error: "bg-red-100 text-red-700 border-red-300 dark:bg-red-900/50 dark:text-red-300 dark:border-red-900",
|
|
605
|
+
light: "bg-gray-100 text-gray-700 border-gray-200 dark:bg-gray-800 dark:text-gray-200 dark:border-gray-700",
|
|
606
|
+
primary: "bg-blue-100 text-blue-700 border-blue-300 dark:bg-blue-900/50 dark:text-blue-300 dark:border-blue-900",
|
|
607
|
+
success: "bg-green-100 text-green-700 border-green-300 dark:bg-green-900/50 dark:text-green-300 dark:border-green-900",
|
|
608
|
+
warning: "bg-yellow-100 text-yellow-700 border-yellow-300 dark:bg-yellow-900/50 dark:text-yellow-300 dark:border-yellow-900"
|
|
609
|
+
}
|
|
610
|
+
}, Y = (e, t) => i("div", { class: [J.base, J.colors[e.color ?? "light"]] }, [
|
|
611
|
+
t.slots.icon ? i("div", { class: "mt-0.75 shrink-0" }, t.slots.icon()) : null,
|
|
612
|
+
t.slots.default?.(),
|
|
613
|
+
e.closable ? i("button", {
|
|
614
|
+
class: "cursor-pointer ml-auto mt-1 shrink-0",
|
|
615
|
+
"aria-label": "Close Alert",
|
|
616
|
+
onClick: () => t.emit("close")
|
|
617
|
+
}, i(k, { class: "size-4" })) : null
|
|
618
|
+
]);
|
|
619
|
+
Y.props = {
|
|
620
|
+
color: {
|
|
621
|
+
type: String,
|
|
622
|
+
default: "light"
|
|
623
|
+
},
|
|
624
|
+
closable: Boolean
|
|
625
|
+
};
|
|
626
|
+
//#endregion
|
|
627
|
+
export { Y as Alert, m as Button, A as Card, b as Checkbox, T as FormItem, v as Input, q as Message, M as Modal, W as Pagination, S as Radio, w as Select, N as Table, P as Widget, K as useMessage };
|
package/dist/gurun-kit.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.GurunKit={},e.Vue))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n={base:`font-medium cursor-pointer inline-flex items-center justify-center`,colors:{primary:`bg-blue-600 text-white hover:bg-blue-700`,success:`bg-green-600 text-white hover:bg-green-700`,error:`bg-red-600 text-white hover:bg-red-700`,warning:`bg-yellow-600 text-white hover:bg-yellow-700`,light:`bg-white text-gray-700 hover:bg-gray-100`},sizes:{sm:`h-8 px-3 rounded text-sm`,md:`h-10 px-4 rounded-md`,lg:`h-12 px-6 rounded-md text-lg`}},r=(e,r)=>{let{class:i,...a}=r.attrs;return(0,t.h)(e.tag??`button`,{class:[i,n.base,n.colors[e.color??`primary`],n.sizes[e.size??`md`]],...a},{default:r.slots.default})};r.props={color:{type:String,default:`primary`},size:{type:String,default:`md`},tag:{type:null,default:`button`}};function i(e){return typeof e==`number`?new Intl.NumberFormat().format(e):new Intl.NumberFormat().format(Number(e.replace(/\D/gi,``)))}function a(e){return`${Number(e.replace(/\D/gi,``))}`}var o={base:`border focus:outline-1`,file:`pl-0 file:bg-gray-100 file:h-full file:text-gray-900 file:border-r dark:file:bg-gray-700 dark:file:text-white`,colors:{primary:{base:`bg-white text-blue-700 placeholder-blue-500 border-blue-300 focus:border-blue-600 focus:outline-blue-600 dark:bg-transparent dark:border-blue-600 dark:focus:border-blue-400 dark:focus:outline-blue-400 dark:placeholder-blue-600 dark:text-blue-300`,file:`file:border-blue-300 focus:file:border-blue-600 dark:file:border-blue-600 dark:focus:file:border-blue-400`},success:{base:`bg-white text-green-700 placeholder-green-500 border-green-300 focus:border-green-600 focus:outline-green-600 dark:bg-transparent dark:border-green-600 dark:focus:border-green-400 dark:focus:outline-green-400 dark:placeholder-green-600 dark:text-green-300`,file:`file:border-green-300 focus:file:border-green-600 dark:file:border-green-600 dark:focus:file:border-green-400`},error:{base:`bg-white text-red-700 placeholder-red-500 border-red-300 focus:border-red-600 focus:outline-red-600 dark:bg-transparent dark:border-red-600 dark:focus:border-red-400 dark:focus:outline-red-400 dark:placeholder-red-600 dark:text-red-300`,file:`file:border-red-300 focus:file:border-red-600 dark:file:border-red-600 dark:focus:file:border-red-400`},warning:{base:`bg-white text-yellow-700 placeholder-yellow-500 border-yellow-300 focus:border-yellow-600 focus:outline-yellow-600 dark:bg-transparent dark:border-yellow-600 dark:focus:border-yellow-400 dark:focus:outline-yellow-400 dark:placeholder-yellow-600 dark:text-yellow-300`,file:`file:border-yellow-300 focus:file:border-yellow-600 dark:file:border-yellow-600 dark:focus:file:border-yellow-400`},light:{base:`bg-white text-gray-700 placeholder-gray-400 border-gray-300 focus:border-blue-600 focus:outline-blue-600 dark:bg-transparent dark:border-gray-600 dark:focus:border-blue-400 dark:focus:outline-blue-400 dark:placeholder-gray-500 dark:text-gray-300`,file:`file:border-gray-300 focus:file:border-blue-600 dark:file:border-gray-600 dark:focus:file:border-blue-400`}},sizes:{sm:{base:`px-2.5 rounded text-sm`,input:`h-8`,textarea:`min-h-8 py-2`,file:`file:text-sm file:px-2.5 file:mr-2.5`},md:{base:`px-3 rounded-md`,input:`h-10`,textarea:`min-h-10 py-2`,file:`file:px-3 file:mr-3`},lg:{base:`px-4 rounded-md text-lg`,input:`h-12`,textarea:`min-h-12 py-3`,file:`file:text-lg file:px-4 file:mr-4`}}},s=(e,n)=>{let{class:r,type:s,...c}=n.attrs;return(0,t.h)(e.tag===`textarea`?`textarea`:`input`,{type:s,class:[r,o.base,...s===`file`?[o.file,o.colors[e.color??`light`].file,o.sizes[e.size??`md`].file]:[],o.colors[e.color??`light`].base,o.sizes[e.size??`md`].base,o.sizes[e.size??`md`][e.tag===`textarea`?`textarea`:`input`]],...c,value:e.currency?i(Number(e.modelValue)):e.modelValue,onInput:t=>{let r=t.target.value;n.emit(`update:modelValue`,e.currency?a(r):r)}})};s.props={color:{type:String,default:`light`},size:{type:String,default:`md`},modelValue:String,tag:{type:String,default:`input`},currency:Boolean};var c={wrapper:`inline-flex items-center gap-2.5`,label:`font-normal text-gray-900 dark:text-gray-300`,base:`appearance-none relative border focus-visible:outline-2 focus:ring-0 focus-visible:outline-offset-2 after:hidden checked:after:block after:content-[''] after:border-white after:-rotate-45 after:absolute`,colors:{light:`border-gray-300 checked:bg-blue-600 checked:border-blue-600 dark:border-gray-600 focus-visible:outline-blue-600`,primary:`border-blue-300 checked:bg-blue-600 checked:border-blue-600 dark:border-blue-600 focus-visible:outline-blue-600`,error:`border-red-300 checked:bg-red-600 checked:border-red-600 dark:border-red-600 focus-visible:outline-red-600`,warning:`border-yellow-300 checked:bg-yellow-600 checked:border-yellow-600 dark:border-yellow-600 focus-visible:outline-yellow-600`,success:`border-green-300 checked:bg-green-600 checked:border-green-600 dark:border-green-600 focus-visible:outline-green-600`},sizes:{sm:`size-3 rounded-sm after:w-1.5 after:border-l-1 after:border-b-1 after:h-1 after:top-0.5 after:left-0.5`,md:`size-4 rounded after:w-2.5 after:border-l-2 after:border-b-2 after:h-1.5 after:top-0.75 after:left-0.5`,lg:`size-6 rounded-md after:w-4 after:border-l-3 after:border-b-3 after:h-2.5 after:top-0.75 after:left-0.75`}},l=(e,n)=>{let r=e.id||(0,t.useId)();return(0,t.h)(`div`,{class:c.wrapper},[(0,t.h)(`input`,{...n.attrs,id:r,type:`checkbox`,checked:Array.isArray(e.modelValue)?e.modelValue.findIndex(t=>t===e.inputValue)!==-1:e.modelValue,class:[c.base,c.colors[e.color??`light`],c.sizes[e.size??`md`]],onChange:t=>{let r=t.target.checked;n.emit(`update:modelValue`,Array.isArray(e.modelValue)?r?[...e.modelValue,e.inputValue]:e.modelValue.filter(t=>t!==e.inputValue):r)}}),e.label?(0,t.h)(`label`,{class:c.label,for:r},e.label):null])};l.props={label:String,color:{type:String,default:`light`},size:{type:String,default:`md`},inputValue:String,modelValue:[Boolean,Array],id:String},l.emits=[`update:modelValue`];var u={wrapper:`inline-flex items-center gap-2`,label:`font-normal text-gray-900 dark:text-gray-300`,base:`appearance-none rounded-full relative border focus-visible:outline-2 focus:ring-0 focus-visible:outline-offset-2 after:hidden checked:after:block after:content-[''] after:bg-white after:absolute after:rounded-full after:top-1/2 after:left-1/2 after:-translate-x-1/2 after:-translate-y-1/2`,colors:{light:`border-gray-300 checked:bg-blue-600 checked:border-blue-600 dark:border-gray-600 focus-visible:outline-blue-600`,primary:`border-blue-300 checked:bg-blue-600 checked:border-blue-600 dark:border-blue-600 focus-visible:outline-blue-600`,error:`border-red-300 checked:bg-red-600 checked:border-red-600 dark:border-red-600 focus-visible:outline-red-600`,warning:`border-yellow-300 checked:bg-yellow-600 checked:border-yellow-600 dark:border-yellow-600 focus-visible:outline-yellow-600`,success:`border-green-300 checked:bg-green-600 checked:border-green-600 dark:border-green-600 focus-visible:outline-green-600`},sizes:{sm:`size-3 after:size-1.25`,md:`size-4 after:size-1.75`,lg:`size-6 after:size-3`}},d=(e,n)=>{let r=e.id||(0,t.useId)();return(0,t.h)(`div`,{class:u.wrapper},[(0,t.h)(`input`,{...n.attrs,id:r,type:`radio`,checked:e.modelValue===e.inputValue,class:[u.base,u.colors[e.color??`light`],u.sizes[e.size??`md`]],onChange:()=>{n.emit(`update:modelValue`,e.inputValue)}}),e.label?(0,t.h)(`label`,{class:u.label,for:r},e.label):null])};d.props={label:String,color:{type:String,default:`light`},size:{type:String,default:`md`},inputValue:String,modelValue:String,id:String},d.emits=[`update:modelValue`];var f={base:`appearance-none border focus:outline-1`,wrapper:`w-fit relative after:block after:content-[''] after:border-l-2 after:border-b-2 after:border-gray-500 after:-rotate-45 has-focus:after:rotate-135 after:absolute`,colors:{primary:`bg-white text-blue-700 placeholder-blue-500 border-blue-300 focus:border-blue-600 focus:outline-blue-600 dark:bg-transparent dark:border-blue-600 dark:focus:border-blue-400 dark:focus:outline-blue-400 dark:placeholder-blue-600 dark:text-blue-300`,success:`bg-white text-green-700 placeholder-green-500 border-green-300 focus:border-green-600 focus:outline-green-600 dark:bg-transparent dark:border-green-600 dark:focus:border-green-400 dark:focus:outline-green-400 dark:placeholder-green-600 dark:text-green-300`,error:`bg-white text-red-700 placeholder-red-500 border-red-300 focus:border-red-600 focus:outline-red-600 dark:bg-transparent dark:border-red-600 dark:focus:border-red-400 dark:focus:outline-red-400 dark:placeholder-red-600 dark:text-red-300`,warning:`bg-white text-yellow-700 placeholder-yellow-500 border-yellow-300 focus:border-yellow-600 focus:outline-yellow-600 dark:bg-transparent dark:border-yellow-600 dark:focus:border-yellow-400 dark:focus:outline-yellow-400 dark:placeholder-yellow-600 dark:text-yellow-300`,light:`bg-white text-gray-700 placeholder-gray-400 border-gray-300 focus:border-blue-600 focus:outline-blue-600 dark:bg-transparent dark:border-gray-600 dark:focus:border-blue-400 dark:focus:outline-blue-400 dark:placeholder-gray-500 dark:text-gray-300`},wrapperSizes:{sm:`after:size-1.75 after:top-2.5 after:right-2.5 has-focus:after:top-3.5`,md:`after:size-2 after:top-3.25 after:right-3 has-focus:after:top-4.25`,lg:`after:size-2 after:top-4.25 after:right-4 has-focus:after:top-5.25`},sizes:{sm:`h-8 px-2.5 pr-8 rounded text-sm`,md:`h-10 pl-3 pr-10 rounded-md`,lg:`h-12 px-4 pr-12 rounded-md text-lg`}},p=(e,n)=>{let{class:r,type:i,...a}=n.attrs;return(0,t.h)(`div`,{class:[f.wrapper,f.wrapperSizes[e.size??`md`]]},(0,t.h)(`select`,{type:i,class:[r,f.base,f.colors[e.color??`light`],f.sizes[e.size??`md`]],...a,value:e.modelValue===null?``:e.modelValue,onChange:e=>{let t=e.target.value;n.emit(`update:modelValue`,t===``?null:t)}},e.options?.map(e=>(0,t.h)(`option`,{value:typeof e==`object`&&e?e.id===null?``:e.id:e===null?``:e},typeof e==`object`&&e?e.name:e))))};p.props={color:{type:String,default:`light`},size:{type:String,default:`md`},modelValue:null,options:{type:Array,default:()=>[]}};var m=(e,n)=>{let r=e.id||(0,t.useId)();return(0,t.h)(`div`,[(0,t.h)(`label`,{class:`block mb-1`,for:r},e.label),n.slots.default?n.slots.default({id:r}):null])};m.props={label:{type:String,required:!0},id:String};var h=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},g={},_={xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,"stroke-width":`1.5`,stroke:`currentColor`};function v(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,_,[...n[0]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M6 18 18 6M6 6l12 12`},null,-1)]])}var y=h(g,[[`render`,v]]),b={size:{sm:`max-w-md`,md:`max-w-2xl`,lg:`max-w-4xl`}},x=(e,n)=>{let r=()=>{n.emit(`update:visible`,!1),n.emit(`close`)};return(0,t.h)(t.Transition,{enterFromClass:`opacity-0`,enterActiveClass:`transition transition-all duration-150`,enterToClass:`opacity-100`,leaveFromClass:`opacity-100`,leaveActiveClass:`transition transition-all duration-150`,leaveToClass:`opacity-0`},()=>e.visible?(0,t.h)(`div`,{role:`dialog`,class:`fixed inset-0 bg-black/50 w-full h-screen z-30 flex items-center justify-center`,onClick:r},(0,t.h)(`div`,{"data-test":`dialog-content`,class:[`bg-white text-gray-900 w-full rounded-md shadow`,b.size[e.size??`md`]],onClick:e=>{e.stopPropagation()}},[e.title?(0,t.h)(`header`,{class:`p-4 border-b border-gray-300 flex items-center justify-between`},[(0,t.h)(`h2`,{class:`font-bold text-lg`},e.title),(0,t.h)(`button`,{"aria-label":`Close Modal`,class:`cursor-pointer`,onClick:r},(0,t.h)(y,{class:`size-5`}))]):null,(0,t.h)(`div`,{"data-test":`dialog-body`,class:`p-4`},n.slots.default?.()),n.slots.footer?(0,t.h)(`footer`,{class:`p-4 border-t border-gray-300`},n.slots.footer()):null])):void 0)};x.props={title:String,visible:Boolean,size:{type:String,default:`md`}},x.emits=[`update:visible`,`close`];var S=e=>(0,t.h)(`div`,{class:`overflow-x-auto`},(0,t.h)(`table`,{class:`w-full border border-gray-300 dark:border-gray-700`},[(0,t.h)(`thead`,(0,t.h)(`tr`,e.columns?.map(e=>(0,t.h)(`th`,{class:`text-left font-bold px-4 py-3 border-b border-gray-300 bg-gray-50 text-gray-900 dark:bg-gray-800 dark:text-white dark:border-gray-700`},e.name)))),(0,t.h)(`tbody`,e.data?.length?e.data?.map(n=>(0,t.h)(`tr`,e.columns?.map(e=>(0,t.h)(`td`,{class:`text-gray-900 px-4 py-3 border-b border-gray-300 dark:text-white dark:border-gray-700`},e.render?(0,t.h)(e.render,{item:n}):n[e.id])))):(0,t.h)(`tr`,(0,t.h)(`td`,{colspan:2,class:`text-gray-900 px-4 py-3 dark:text-white`},e.emptyMessage)))]));S.props={columns:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]},emptyMessage:{type:String,default:`Empty data`}};var C=e=>(0,t.h)(`div`,{class:`bg-white border border-gray-300 rounded-lg px-5 py-4.5 space-y-2 dark:bg-gray-800 dark:border-gray-700`},[(0,t.h)(`p`,{"data-test":`widget-label`,class:`text-gray-700 dark:text-gray-400`},e.label),(0,t.h)(`p`,{"data-test":`widget-value`,class:`text-gray-900 text-xl font-bold dark:text-white`},e.value)]);C.props={label:{type:String,required:!0},value:{type:[String,Number],required:!0}},e.Button=r,e.Checkbox=l,e.FormItem=m,e.Input=s,e.Modal=x,e.Radio=d,e.Select=p,e.Table=S,e.Widget=C});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.GurunKit={},e.Vue))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},r={},i={xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,class:`animate-spin`};function a(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,i,[...n[0]||=[(0,t.createElementVNode)(`path`,{d:`M0 0h24v24H0z`,fill:`none`},null,-1),(0,t.createElementVNode)(`g`,{fill:`currentColor`},[(0,t.createElementVNode)(`path`,{"fill-rule":`evenodd`,d:`M12 19a7 7 0 1 0 0-14a7 7 0 0 0 0 14m0 3c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10`,"clip-rule":`evenodd`,opacity:`.2`}),(0,t.createElementVNode)(`path`,{d:`M2 12C2 6.477 6.477 2 12 2v3a7 7 0 0 0-7 7z`})],-1)]])}var o=n(r,[[`render`,a]]),s={base:`font-medium cursor-pointer inline-flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed`,colors:{primary:{solid:`bg-blue-600 text-white hover:bg-blue-700`,outline:`border-blue-600 text-blue-600 hover:bg-blue-600 hover:text-white`},success:{solid:`bg-green-600 text-white hover:bg-green-700`,outline:`border-green-600 text-green-600 hover:bg-green-600 hover:text-white`},error:{solid:`bg-red-600 text-white hover:bg-red-700`,outline:`border-red-600 text-red-600 hover:bg-red-600 hover:text-white`},warning:{solid:`bg-yellow-600 text-white hover:bg-yellow-700`,outline:`border-yellow-600 text-yellow-600 hover:bg-yellow-600 hover:text-white`},light:{solid:`bg-white text-gray-700 hover:bg-gray-100`,outline:`border-gray-300 text-gray-900 hover:bg-gray-100`}},sizes:{sm:`h-8 px-3 rounded text-sm`,md:`h-10 px-4 rounded-md`,lg:`h-12 px-6 rounded-md text-lg`}},c=(e,n)=>{let{class:r,...i}=n.attrs;return(0,t.h)(e.tag??`button`,{disabled:e.loading,class:[r,s.base,s.colors[e.color??`primary`][e.variant??`solid`],s.sizes[e.size??`md`],e.variant===`solid`?``:`border`],...i},[e.loading?(0,t.h)(o,{"data-test":`spinner`}):n.slots.icon?n.slots.icon():null,n.slots.default?n.slots.default():null])};c.props={color:{type:String,default:`primary`},size:{type:String,default:`md`},tag:{type:null,default:`button`},variant:{type:String,default:`solid`},loading:{type:Boolean,default:!1}};function l(e){return typeof e==`number`?new Intl.NumberFormat().format(e):new Intl.NumberFormat().format(Number(e.replace(/\D/gi,``)))}function u(e){return`${Number(e.replace(/\D/gi,``))}`}var d={base:`border focus:outline-1`,file:`pl-0 file:bg-gray-100 file:h-full file:text-gray-900 file:border-r dark:file:bg-gray-700 dark:file:text-white`,colors:{primary:{base:`bg-white text-blue-700 placeholder-blue-500 border-blue-300 focus:border-blue-600 focus:outline-blue-600 dark:bg-transparent dark:border-blue-600 dark:focus:border-blue-400 dark:focus:outline-blue-400 dark:placeholder-blue-600 dark:text-blue-300`,file:`file:border-blue-300 focus:file:border-blue-600 dark:file:border-blue-600 dark:focus:file:border-blue-400`},success:{base:`bg-white text-green-700 placeholder-green-500 border-green-300 focus:border-green-600 focus:outline-green-600 dark:bg-transparent dark:border-green-600 dark:focus:border-green-400 dark:focus:outline-green-400 dark:placeholder-green-600 dark:text-green-300`,file:`file:border-green-300 focus:file:border-green-600 dark:file:border-green-600 dark:focus:file:border-green-400`},error:{base:`bg-white text-red-700 placeholder-red-500 border-red-300 focus:border-red-600 focus:outline-red-600 dark:bg-transparent dark:border-red-600 dark:focus:border-red-400 dark:focus:outline-red-400 dark:placeholder-red-600 dark:text-red-300`,file:`file:border-red-300 focus:file:border-red-600 dark:file:border-red-600 dark:focus:file:border-red-400`},warning:{base:`bg-white text-yellow-700 placeholder-yellow-500 border-yellow-300 focus:border-yellow-600 focus:outline-yellow-600 dark:bg-transparent dark:border-yellow-600 dark:focus:border-yellow-400 dark:focus:outline-yellow-400 dark:placeholder-yellow-600 dark:text-yellow-300`,file:`file:border-yellow-300 focus:file:border-yellow-600 dark:file:border-yellow-600 dark:focus:file:border-yellow-400`},light:{base:`bg-white text-gray-700 placeholder-gray-400 border-gray-300 focus:border-blue-600 focus:outline-blue-600 dark:bg-transparent dark:border-gray-600 dark:focus:border-blue-400 dark:focus:outline-blue-400 dark:placeholder-gray-500 dark:text-gray-300`,file:`file:border-gray-300 focus:file:border-blue-600 dark:file:border-gray-600 dark:focus:file:border-blue-400`}},sizes:{sm:{base:`px-2.5 rounded text-sm`,input:`h-8`,textarea:`min-h-8 py-2`,file:`file:text-sm file:px-2.5 file:mr-2.5`},md:{base:`px-3 rounded-md`,input:`h-10`,textarea:`min-h-10 py-2`,file:`file:px-3 file:mr-3`},lg:{base:`px-4 rounded-md text-lg`,input:`h-12`,textarea:`min-h-12 py-3`,file:`file:text-lg file:px-4 file:mr-4`}}},f=(e,n)=>{let{class:r,type:i,...a}=n.attrs;return(0,t.h)(e.tag===`textarea`?`textarea`:`input`,{type:i,class:[r,d.base,...i===`file`?[d.file,d.colors[e.color??`light`].file,d.sizes[e.size??`md`].file]:[],d.colors[e.color??`light`].base,d.sizes[e.size??`md`].base,d.sizes[e.size??`md`][e.tag===`textarea`?`textarea`:`input`]],...a,value:e.currency?l(Number(e.modelValue)):e.modelValue,onInput:t=>{let r=t.target.value;n.emit(`update:modelValue`,e.currency?u(r):r)}})};f.props={color:{type:String,default:`light`},size:{type:String,default:`md`},modelValue:String,tag:{type:String,default:`input`},currency:Boolean};var p={wrapper:`inline-flex items-center gap-2.5`,label:`font-normal text-gray-900 dark:text-gray-300`,base:`appearance-none relative border focus-visible:outline-2 focus:ring-0 focus-visible:outline-offset-2 after:hidden checked:after:block after:content-[''] after:border-white after:-rotate-45 after:absolute`,colors:{light:`border-gray-300 checked:bg-blue-600 checked:border-blue-600 dark:border-gray-600 focus-visible:outline-blue-600`,primary:`border-blue-300 checked:bg-blue-600 checked:border-blue-600 dark:border-blue-600 focus-visible:outline-blue-600`,error:`border-red-300 checked:bg-red-600 checked:border-red-600 dark:border-red-600 focus-visible:outline-red-600`,warning:`border-yellow-300 checked:bg-yellow-600 checked:border-yellow-600 dark:border-yellow-600 focus-visible:outline-yellow-600`,success:`border-green-300 checked:bg-green-600 checked:border-green-600 dark:border-green-600 focus-visible:outline-green-600`},sizes:{sm:`size-3 rounded-sm after:w-1.5 after:border-l-1 after:border-b-1 after:h-1 after:top-0.5 after:left-0.5`,md:`size-4 rounded after:w-2.5 after:border-l-2 after:border-b-2 after:h-1.5 after:top-0.75 after:left-0.5`,lg:`size-6 rounded-md after:w-4 after:border-l-3 after:border-b-3 after:h-2.5 after:top-0.75 after:left-0.75`}},m=(e,n)=>{let r=e.id||(0,t.useId)();return(0,t.h)(`div`,{class:p.wrapper},[(0,t.h)(`input`,{...n.attrs,id:r,type:`checkbox`,checked:Array.isArray(e.modelValue)?e.modelValue.findIndex(t=>t===e.inputValue)!==-1:e.modelValue,class:[p.base,p.colors[e.color??`light`],p.sizes[e.size??`md`]],onChange:t=>{let r=t.target.checked;n.emit(`update:modelValue`,Array.isArray(e.modelValue)?r?[...e.modelValue,e.inputValue]:e.modelValue.filter(t=>t!==e.inputValue):r)}}),e.label?(0,t.h)(`label`,{class:p.label,for:r},e.label):null])};m.props={label:String,color:{type:String,default:`light`},size:{type:String,default:`md`},inputValue:String,modelValue:[Boolean,Array],id:String},m.emits=[`update:modelValue`];var h={wrapper:`inline-flex items-center gap-2`,label:`font-normal text-gray-900 dark:text-gray-300`,base:`appearance-none rounded-full relative border focus-visible:outline-2 focus:ring-0 focus-visible:outline-offset-2 after:hidden checked:after:block after:content-[''] after:bg-white after:absolute after:rounded-full after:top-1/2 after:left-1/2 after:-translate-x-1/2 after:-translate-y-1/2`,colors:{light:`border-gray-300 checked:bg-blue-600 checked:border-blue-600 dark:border-gray-600 focus-visible:outline-blue-600`,primary:`border-blue-300 checked:bg-blue-600 checked:border-blue-600 dark:border-blue-600 focus-visible:outline-blue-600`,error:`border-red-300 checked:bg-red-600 checked:border-red-600 dark:border-red-600 focus-visible:outline-red-600`,warning:`border-yellow-300 checked:bg-yellow-600 checked:border-yellow-600 dark:border-yellow-600 focus-visible:outline-yellow-600`,success:`border-green-300 checked:bg-green-600 checked:border-green-600 dark:border-green-600 focus-visible:outline-green-600`},sizes:{sm:`size-3 after:size-1.25`,md:`size-4 after:size-1.75`,lg:`size-6 after:size-3`}},g=(e,n)=>{let r=e.id||(0,t.useId)();return(0,t.h)(`div`,{class:h.wrapper},[(0,t.h)(`input`,{...n.attrs,id:r,type:`radio`,checked:e.modelValue===e.inputValue,class:[h.base,h.colors[e.color??`light`],h.sizes[e.size??`md`]],onChange:()=>{n.emit(`update:modelValue`,e.inputValue)}}),e.label?(0,t.h)(`label`,{class:h.label,for:r},e.label):null])};g.props={label:String,color:{type:String,default:`light`},size:{type:String,default:`md`},inputValue:String,modelValue:String,id:String},g.emits=[`update:modelValue`];var _={base:`appearance-none border focus:outline-1`,wrapper:`w-fit relative after:block after:content-[''] after:border-l-2 after:border-b-2 after:border-gray-500 after:-rotate-45 has-focus:after:rotate-135 after:absolute`,colors:{primary:`bg-white text-blue-700 placeholder-blue-500 border-blue-300 focus:border-blue-600 focus:outline-blue-600 dark:bg-transparent dark:border-blue-600 dark:focus:border-blue-400 dark:focus:outline-blue-400 dark:placeholder-blue-600 dark:text-blue-300`,success:`bg-white text-green-700 placeholder-green-500 border-green-300 focus:border-green-600 focus:outline-green-600 dark:bg-transparent dark:border-green-600 dark:focus:border-green-400 dark:focus:outline-green-400 dark:placeholder-green-600 dark:text-green-300`,error:`bg-white text-red-700 placeholder-red-500 border-red-300 focus:border-red-600 focus:outline-red-600 dark:bg-transparent dark:border-red-600 dark:focus:border-red-400 dark:focus:outline-red-400 dark:placeholder-red-600 dark:text-red-300`,warning:`bg-white text-yellow-700 placeholder-yellow-500 border-yellow-300 focus:border-yellow-600 focus:outline-yellow-600 dark:bg-transparent dark:border-yellow-600 dark:focus:border-yellow-400 dark:focus:outline-yellow-400 dark:placeholder-yellow-600 dark:text-yellow-300`,light:`bg-white text-gray-700 placeholder-gray-400 border-gray-300 focus:border-blue-600 focus:outline-blue-600 dark:bg-transparent dark:border-gray-600 dark:focus:border-blue-400 dark:focus:outline-blue-400 dark:placeholder-gray-500 dark:text-gray-300`},wrapperSizes:{sm:`after:size-1.75 after:top-2.5 after:right-2.5 has-focus:after:top-3.5`,md:`after:size-2 after:top-3.25 after:right-3 has-focus:after:top-4.25`,lg:`after:size-2 after:top-4.25 after:right-4 has-focus:after:top-5.25`},sizes:{sm:`h-8 px-2.5 pr-8 rounded text-sm`,md:`h-10 pl-3 pr-10 rounded-md`,lg:`h-12 px-4 pr-12 rounded-md text-lg`}},v=(e,n)=>{let{class:r,type:i,...a}=n.attrs;return(0,t.h)(`div`,{class:[_.wrapper,_.wrapperSizes[e.size??`md`]]},(0,t.h)(`select`,{type:i,class:[r,_.base,_.colors[e.color??`light`],_.sizes[e.size??`md`]],...a,value:e.modelValue===null?``:e.modelValue,onChange:e=>{let t=e.target.value;n.emit(`update:modelValue`,t===``?null:t)}},e.options?.map(e=>(0,t.h)(`option`,{value:typeof e==`object`&&e?e.id===null?``:e.id:e===null?``:e},typeof e==`object`&&e?e.name:e))))};v.props={color:{type:String,default:`light`},size:{type:String,default:`md`},modelValue:null,options:{type:Array,default:()=>[]}};var y=(e,n)=>{let r=e.id||(0,t.useId)();return(0,t.h)(`div`,[(0,t.h)(`label`,{class:`block mb-1`,for:r},e.label),n.slots.default?n.slots.default({id:r}):null])};y.props={label:{type:String,required:!0},id:String};var b={},x={xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,"stroke-width":`1.5`,stroke:`currentColor`};function S(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,x,[...n[0]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M6 18 18 6M6 6l12 12`},null,-1)]])}var C=n(b,[[`render`,S]]),w=(e,n)=>(0,t.h)(`div`,{"data-test":`card-content`,class:[`bg-white text-gray-900 rounded-md border border-gray-300 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-100`,n.attrs.class]},[e.title?(0,t.h)(`header`,{class:`p-4 border-b border-gray-300 dark:border-gray-700 flex items-center justify-between`},[(0,t.h)(`h2`,{class:`font-bold text-lg`},e.title),n.slots.action?.()]):null,(0,t.h)(`div`,{"data-test":`card-body`,class:`p-4`},n.slots.default?.()),n.slots.footer?(0,t.h)(`footer`,{class:`p-4 border-t border-gray-300 dark:border-gray-700`},n.slots.footer()):null]);w.props={title:String};var T={size:{sm:`max-w-md`,md:`max-w-2xl`,lg:`max-w-4xl`}},E=(e,n)=>{let r=()=>{n.emit(`update:visible`,!1),n.emit(`close`)};return(0,t.h)(t.Transition,{enterFromClass:`opacity-0`,enterActiveClass:`transition transition-all duration-150`,enterToClass:`opacity-100`,leaveFromClass:`opacity-100`,leaveActiveClass:`transition transition-all duration-150`,leaveToClass:`opacity-0`},()=>e.visible?(0,t.h)(`div`,{role:`dialog`,class:`fixed inset-0 bg-black/50 w-full h-screen z-30 flex items-center justify-center`,onClick:r},(0,t.h)(w,{title:e.title,class:[`w-full shadow`,T.size[e.size??`md`]],onClick:e=>{e.stopPropagation()}},{action:()=>(0,t.h)(`button`,{"aria-label":`Close Modal`,class:`cursor-pointer`,onClick:r},(0,t.h)(C,{class:`size-5`})),default:n.slots.default,footer:n.slots.footer?()=>n.slots.footer?.():null})):void 0)};E.props={title:String,visible:Boolean,size:{type:String,default:`md`}},E.emits=[`update:visible`,`close`];var D=e=>(0,t.h)(`div`,{class:`overflow-x-auto`},(0,t.h)(`table`,{class:`w-full border border-gray-300 dark:border-gray-700`},[(0,t.h)(`thead`,(0,t.h)(`tr`,e.columns?.map(e=>(0,t.h)(`th`,{class:`text-left font-bold px-4 py-3 border-b border-gray-300 bg-gray-50 text-gray-900 dark:bg-gray-800 dark:text-white dark:border-gray-700`},e.name)))),(0,t.h)(`tbody`,e.data?.length?e.data?.map(n=>(0,t.h)(`tr`,e.columns?.map(e=>(0,t.h)(`td`,{class:`text-gray-900 px-4 py-3 border-b border-gray-300 dark:text-white dark:border-gray-700`},e.render?(0,t.h)(e.render,{item:n}):n[e.id])))):(0,t.h)(`tr`,(0,t.h)(`td`,{colspan:2,class:`text-gray-900 px-4 py-3 dark:text-white`},e.emptyMessage)))]));D.props={columns:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]},emptyMessage:{type:String,default:`Empty data`}};var O=e=>(0,t.h)(`div`,{class:`bg-white border border-gray-300 rounded-lg px-5 py-4.5 space-y-2 dark:bg-gray-800 dark:border-gray-700`},[(0,t.h)(`p`,{"data-test":`widget-label`,class:`text-gray-700 dark:text-gray-400`},e.label),(0,t.h)(`p`,{"data-test":`widget-value`,class:`text-gray-900 text-xl font-bold dark:text-white`},e.value)]);O.props={label:{type:String,required:!0},value:{type:[String,Number],required:!0}};var k={},A={xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,"stroke-width":`1.5`,stroke:`currentColor`};function j(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,A,[...n[0]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M15.75 19.5 8.25 12l7.5-7.5`},null,-1)]])}var M=n(k,[[`render`,j]]),N={},P={xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,"stroke-width":`1.5`,stroke:`currentColor`};function F(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,P,[...n[0]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`m8.25 4.5 7.5 7.5-7.5 7.5`},null,-1)]])}var I=n(N,[[`render`,F]]),L={active:`bg-blue-600 text-white dark:bg-blue-600`,inactive:`text-gray-900 cursor-pointer hover:bg-gray-50 dark:text-white dark:hover:bg-gray-700`,item:`w-9 h-9 flex items-center justify-center`},R=(e,n)=>{let r=e?.active&&e?.active>=e.total;return(0,t.h)(`nav`,{class:`border flex w-fit rounded-md border-gray-300 dark:border-gray-700`},[e?.active&&e?.active<2?null:(0,t.h)(`a`,{"aria-label":`Prev`,class:[L.item,L.inactive,`border-r border-gray-300 rounded-l-md dark:border-gray-700`],onClick:t=>{t.preventDefault(),e.active&&n.emit(`update:active`,e.active-1)}},(0,t.h)(M,{class:`size-4`})),...Array.from({length:e.total},(e,t)=>t+1).map(i=>(0,t.h)(i===e.active?`span`:`a`,{class:[e.active===i?L.active:L.inactive,L.item,i===1?`rounded-l-md`:``,i<e.total||i===e.total&&!r?`border-r border-gray-300 dark:border-gray-700`:`rounded-r-md`],"data-page":i,onClick:e=>{e.preventDefault(),n.emit(`update:active`,i)}},i)),r?null:(0,t.h)(`a`,{"aria-label":`Next`,class:[L.item,L.inactive,`rounded-r-md`],onClick:t=>{t.preventDefault(),e.active&&n.emit(`update:active`,e.active+1)}},(0,t.h)(I,{class:`size-4`}))])};R.props={total:{type:Number,required:!0},active:Number},R.emits=[`update:active`];var z=(0,t.ref)([]);function B(){function e(){return z.value}function t(e,t=3e3){let n=Date.now();z.value.push({id:n,message:e,duration:t}),setTimeout(()=>r(n),t)}function n(){z.value=[]}function r(e){z.value=z.value.filter(t=>t.id!==e)}return{getItems:e,info:t,clear:n,close:r}}var V=()=>{let{getItems:e}=B();return(0,t.h)(t.TransitionGroup,{tag:`div`,enterFromClass:`opacity-0 -translate-y-full`,enterActiveClass:`transition transition-all duration-150`,enterToClass:`opacity-100 translate-y-0`,leaveFromClass:`opacity-100 translate-y-0`,leaveActiveClass:`transition transition-all duration-150 absolute`,leaveToClass:`opacity-0 -translate-y-full`,moveClass:`transition transition-all duration-150`,"data-test":`message-wrapper`,class:`fixed top-4 left-1/2 -translate-x-1/2 z-9999 space-y-2`},()=>e().map(e=>(0,t.h)(`div`,{key:e.id,"data-test":`message`,class:`bg-gray-900 text-white px-3 py-2 rounded-md whitespace-nowrap dark:bg-gray-700`},e.message)))},H={base:`px-4 py-3 rounded-md border flex items-start gap-2`,colors:{error:`bg-red-100 text-red-700 border-red-300 dark:bg-red-900/50 dark:text-red-300 dark:border-red-900`,light:`bg-gray-100 text-gray-700 border-gray-200 dark:bg-gray-800 dark:text-gray-200 dark:border-gray-700`,primary:`bg-blue-100 text-blue-700 border-blue-300 dark:bg-blue-900/50 dark:text-blue-300 dark:border-blue-900`,success:`bg-green-100 text-green-700 border-green-300 dark:bg-green-900/50 dark:text-green-300 dark:border-green-900`,warning:`bg-yellow-100 text-yellow-700 border-yellow-300 dark:bg-yellow-900/50 dark:text-yellow-300 dark:border-yellow-900`}},U=(e,n)=>(0,t.h)(`div`,{class:[H.base,H.colors[e.color??`light`]]},[n.slots.icon?(0,t.h)(`div`,{class:`mt-0.75 shrink-0`},n.slots.icon()):null,n.slots.default?.(),e.closable?(0,t.h)(`button`,{class:`cursor-pointer ml-auto mt-1 shrink-0`,"aria-label":`Close Alert`,onClick:()=>n.emit(`close`)},(0,t.h)(C,{class:`size-4`})):null]);U.props={color:{type:String,default:`light`},closable:Boolean},e.Alert=U,e.Button=c,e.Card=w,e.Checkbox=m,e.FormItem=y,e.Input=f,e.Message=V,e.Modal=E,e.Pagination=R,e.Radio=g,e.Select=v,e.Table=D,e.Widget=O,e.useMessage=B});
|