gurunkit 0.4.2 → 0.5.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 +125 -82
- package/dist/gurun-kit.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/gurun-kit.js
CHANGED
|
@@ -43,7 +43,7 @@ var f = /* @__PURE__ */ c(l, [["render", d]]), p = {
|
|
|
43
43
|
},
|
|
44
44
|
light: {
|
|
45
45
|
solid: "bg-white text-gray-700 hover:bg-gray-100",
|
|
46
|
-
outline: "border-gray-300 text-gray-900 hover:bg-gray-100"
|
|
46
|
+
outline: "border-gray-300 text-gray-900 hover:bg-gray-100 dark:text-white dark:hover:text-gray-900"
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
sizes: {
|
|
@@ -63,7 +63,11 @@ var f = /* @__PURE__ */ c(l, [["render", d]]), p = {
|
|
|
63
63
|
e.variant === "solid" ? "" : "border"
|
|
64
64
|
],
|
|
65
65
|
...r
|
|
66
|
-
},
|
|
66
|
+
}, { default: () => [
|
|
67
|
+
e.loading ? i(f, { "data-test": "spinner" }) : t.slots.icon && e.iconPosition === "start" ? t.slots.icon() : null,
|
|
68
|
+
t.slots.default ? t.slots.default() : null,
|
|
69
|
+
t.slots.icon && e.iconPosition === "end" ? t.slots.icon() : null
|
|
70
|
+
] });
|
|
67
71
|
};
|
|
68
72
|
m.props = {
|
|
69
73
|
color: {
|
|
@@ -85,6 +89,10 @@ m.props = {
|
|
|
85
89
|
loading: {
|
|
86
90
|
type: Boolean,
|
|
87
91
|
default: !1
|
|
92
|
+
},
|
|
93
|
+
iconPosition: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: "start"
|
|
88
96
|
}
|
|
89
97
|
};
|
|
90
98
|
//#endregion
|
|
@@ -95,10 +103,18 @@ function h(e) {
|
|
|
95
103
|
function g(e) {
|
|
96
104
|
return `${Number(e.replace(/\D/gi, ""))}`;
|
|
97
105
|
}
|
|
106
|
+
function _(e, t) {
|
|
107
|
+
let n;
|
|
108
|
+
return (...r) => {
|
|
109
|
+
clearTimeout(n), n = setTimeout(() => {
|
|
110
|
+
e(...r);
|
|
111
|
+
}, t);
|
|
112
|
+
};
|
|
113
|
+
}
|
|
98
114
|
//#endregion
|
|
99
115
|
//#region src/components/input/input.ts
|
|
100
|
-
var
|
|
101
|
-
base: "border focus:outline-1",
|
|
116
|
+
var v = {
|
|
117
|
+
base: "border focus:outline-1 disabled:bg-gray-50",
|
|
102
118
|
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",
|
|
103
119
|
colors: {
|
|
104
120
|
primary: {
|
|
@@ -142,31 +158,31 @@ var _ = {
|
|
|
142
158
|
file: "file:text-lg file:px-4 file:mr-4"
|
|
143
159
|
}
|
|
144
160
|
}
|
|
145
|
-
},
|
|
146
|
-
let { class: n, type: r, ...a } = t.attrs;
|
|
161
|
+
}, y = (e, t) => {
|
|
162
|
+
let { class: n, type: r, ...a } = t.attrs, o = _(() => t.emit("input-debounce"), 300);
|
|
147
163
|
return i(e.tag === "textarea" ? "textarea" : "input", {
|
|
148
164
|
type: r,
|
|
149
165
|
class: [
|
|
150
166
|
n,
|
|
151
|
-
|
|
167
|
+
v.base,
|
|
152
168
|
...r === "file" ? [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
169
|
+
v.file,
|
|
170
|
+
v.colors[e.color ?? "light"].file,
|
|
171
|
+
v.sizes[e.size ?? "md"].file
|
|
156
172
|
] : [],
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
173
|
+
v.colors[e.color ?? "light"].base,
|
|
174
|
+
v.sizes[e.size ?? "md"].base,
|
|
175
|
+
v.sizes[e.size ?? "md"][e.tag === "textarea" ? "textarea" : "input"]
|
|
160
176
|
],
|
|
161
177
|
...a,
|
|
162
178
|
value: e.currency ? h(Number(e.modelValue)) : e.modelValue,
|
|
163
179
|
onInput: (n) => {
|
|
164
180
|
let r = n.target.value;
|
|
165
|
-
t.emit("update:modelValue", e.currency ? g(r) : r);
|
|
181
|
+
t.emit("update:modelValue", e.currency ? g(r) : r), o();
|
|
166
182
|
}
|
|
167
183
|
});
|
|
168
184
|
};
|
|
169
|
-
|
|
185
|
+
y.props = {
|
|
170
186
|
color: {
|
|
171
187
|
type: String,
|
|
172
188
|
default: "light"
|
|
@@ -181,10 +197,10 @@ v.props = {
|
|
|
181
197
|
default: "input"
|
|
182
198
|
},
|
|
183
199
|
currency: Boolean
|
|
184
|
-
};
|
|
200
|
+
}, y.emits = ["update:modelValue", "input-debounce"];
|
|
185
201
|
//#endregion
|
|
186
202
|
//#region src/components/checkbox/checkbox.ts
|
|
187
|
-
var
|
|
203
|
+
var b = {
|
|
188
204
|
wrapper: "inline-flex items-center gap-2.5",
|
|
189
205
|
label: "font-normal text-gray-900 dark:text-gray-300",
|
|
190
206
|
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",
|
|
@@ -200,28 +216,28 @@ var y = {
|
|
|
200
216
|
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",
|
|
201
217
|
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"
|
|
202
218
|
}
|
|
203
|
-
},
|
|
219
|
+
}, x = (e, t) => {
|
|
204
220
|
let n = e.id || s();
|
|
205
|
-
return i("div", { class:
|
|
221
|
+
return i("div", { class: b.wrapper }, [i("input", {
|
|
206
222
|
...t.attrs,
|
|
207
223
|
id: n,
|
|
208
224
|
type: "checkbox",
|
|
209
225
|
checked: Array.isArray(e.modelValue) ? e.modelValue.findIndex((t) => t === e.inputValue) !== -1 : e.modelValue,
|
|
210
226
|
class: [
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
227
|
+
b.base,
|
|
228
|
+
b.colors[e.color ?? "light"],
|
|
229
|
+
b.sizes[e.size ?? "md"]
|
|
214
230
|
],
|
|
215
231
|
onChange: (n) => {
|
|
216
232
|
let r = n.target.checked;
|
|
217
233
|
t.emit("update:modelValue", Array.isArray(e.modelValue) ? r ? [...e.modelValue, e.inputValue] : e.modelValue.filter((t) => t !== e.inputValue) : r);
|
|
218
234
|
}
|
|
219
235
|
}), e.label ? i("label", {
|
|
220
|
-
class:
|
|
236
|
+
class: b.label,
|
|
221
237
|
for: n
|
|
222
238
|
}, e.label) : null]);
|
|
223
239
|
};
|
|
224
|
-
|
|
240
|
+
x.props = {
|
|
225
241
|
label: String,
|
|
226
242
|
color: {
|
|
227
243
|
type: String,
|
|
@@ -234,10 +250,10 @@ b.props = {
|
|
|
234
250
|
inputValue: String,
|
|
235
251
|
modelValue: [Boolean, Array],
|
|
236
252
|
id: String
|
|
237
|
-
},
|
|
253
|
+
}, x.emits = ["update:modelValue"];
|
|
238
254
|
//#endregion
|
|
239
255
|
//#region src/components/radio/radio.ts
|
|
240
|
-
var
|
|
256
|
+
var S = {
|
|
241
257
|
wrapper: "inline-flex items-center gap-2",
|
|
242
258
|
label: "font-normal text-gray-900 dark:text-gray-300",
|
|
243
259
|
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",
|
|
@@ -253,27 +269,27 @@ var x = {
|
|
|
253
269
|
md: "size-4 after:size-1.75",
|
|
254
270
|
lg: "size-6 after:size-3"
|
|
255
271
|
}
|
|
256
|
-
},
|
|
272
|
+
}, C = (e, t) => {
|
|
257
273
|
let n = e.id || s();
|
|
258
|
-
return i("div", { class:
|
|
274
|
+
return i("div", { class: S.wrapper }, [i("input", {
|
|
259
275
|
...t.attrs,
|
|
260
276
|
id: n,
|
|
261
277
|
type: "radio",
|
|
262
278
|
checked: e.modelValue === e.inputValue,
|
|
263
279
|
class: [
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
280
|
+
S.base,
|
|
281
|
+
S.colors[e.color ?? "light"],
|
|
282
|
+
S.sizes[e.size ?? "md"]
|
|
267
283
|
],
|
|
268
284
|
onChange: () => {
|
|
269
285
|
t.emit("update:modelValue", e.inputValue);
|
|
270
286
|
}
|
|
271
287
|
}), e.label ? i("label", {
|
|
272
|
-
class:
|
|
288
|
+
class: S.label,
|
|
273
289
|
for: n
|
|
274
290
|
}, e.label) : null]);
|
|
275
291
|
};
|
|
276
|
-
|
|
292
|
+
C.props = {
|
|
277
293
|
label: String,
|
|
278
294
|
color: {
|
|
279
295
|
type: String,
|
|
@@ -286,10 +302,10 @@ S.props = {
|
|
|
286
302
|
inputValue: String,
|
|
287
303
|
modelValue: String,
|
|
288
304
|
id: String
|
|
289
|
-
},
|
|
305
|
+
}, C.emits = ["update:modelValue"];
|
|
290
306
|
//#endregion
|
|
291
307
|
//#region src/components/select/select.ts
|
|
292
|
-
var
|
|
308
|
+
var w = {
|
|
293
309
|
base: "appearance-none border focus:outline-1",
|
|
294
310
|
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",
|
|
295
311
|
colors: {
|
|
@@ -309,15 +325,15 @@ var C = {
|
|
|
309
325
|
md: "h-10 pl-3 pr-10 rounded-md",
|
|
310
326
|
lg: "h-12 px-4 pr-12 rounded-md text-lg"
|
|
311
327
|
}
|
|
312
|
-
},
|
|
328
|
+
}, T = (e, t) => {
|
|
313
329
|
let { class: n, type: r, ...a } = t.attrs;
|
|
314
|
-
return i("div", { class: [
|
|
330
|
+
return i("div", { class: [w.wrapper, w.wrapperSizes[e.size ?? "md"]] }, i("select", {
|
|
315
331
|
type: r,
|
|
316
332
|
class: [
|
|
317
333
|
n,
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
334
|
+
w.base,
|
|
335
|
+
w.colors[e.color ?? "light"],
|
|
336
|
+
w.sizes[e.size ?? "md"]
|
|
321
337
|
],
|
|
322
338
|
...a,
|
|
323
339
|
value: e.modelValue === null ? "" : e.modelValue,
|
|
@@ -327,7 +343,7 @@ var C = {
|
|
|
327
343
|
}
|
|
328
344
|
}, 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))));
|
|
329
345
|
};
|
|
330
|
-
|
|
346
|
+
T.props = {
|
|
331
347
|
color: {
|
|
332
348
|
type: String,
|
|
333
349
|
default: "light"
|
|
@@ -344,14 +360,14 @@ w.props = {
|
|
|
344
360
|
};
|
|
345
361
|
//#endregion
|
|
346
362
|
//#region src/components/form-item/form-item.ts
|
|
347
|
-
var
|
|
363
|
+
var E = (e, t) => {
|
|
348
364
|
let n = e.id || s();
|
|
349
365
|
return i("div", [i("label", {
|
|
350
366
|
class: "block mb-1",
|
|
351
367
|
for: n
|
|
352
368
|
}, e.label), t.slots.default ? t.slots.default({ id: n }) : null]);
|
|
353
369
|
};
|
|
354
|
-
|
|
370
|
+
E.props = {
|
|
355
371
|
label: {
|
|
356
372
|
type: String,
|
|
357
373
|
required: !0
|
|
@@ -360,21 +376,21 @@ T.props = {
|
|
|
360
376
|
};
|
|
361
377
|
//#endregion
|
|
362
378
|
//#region src/components/icons/x.vue
|
|
363
|
-
var
|
|
379
|
+
var D = {}, O = {
|
|
364
380
|
xmlns: "http://www.w3.org/2000/svg",
|
|
365
381
|
fill: "none",
|
|
366
382
|
viewBox: "0 0 24 24",
|
|
367
383
|
"stroke-width": "1.5",
|
|
368
384
|
stroke: "currentColor"
|
|
369
385
|
};
|
|
370
|
-
function
|
|
371
|
-
return a(), n("svg",
|
|
386
|
+
function ee(e, t) {
|
|
387
|
+
return a(), n("svg", O, [...t[0] ||= [r("path", {
|
|
372
388
|
"stroke-linecap": "round",
|
|
373
389
|
"stroke-linejoin": "round",
|
|
374
390
|
d: "M6 18 18 6M6 6l12 12"
|
|
375
391
|
}, null, -1)]]);
|
|
376
392
|
}
|
|
377
|
-
var k = /* @__PURE__ */ c(
|
|
393
|
+
var k = /* @__PURE__ */ c(D, [["render", ee]]), A = (e, t) => i("div", {
|
|
378
394
|
"data-test": "card-content",
|
|
379
395
|
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
396
|
}, [
|
|
@@ -433,7 +449,7 @@ M.props = {
|
|
|
433
449
|
}, M.emits = ["update:visible", "close"];
|
|
434
450
|
//#endregion
|
|
435
451
|
//#region src/components/table/table.ts
|
|
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", {
|
|
452
|
+
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 }) : e.value ? e.value({ item: t }) : t[e.id])))) : i("tr", i("td", {
|
|
437
453
|
colspan: 2,
|
|
438
454
|
class: "text-gray-900 px-4 py-3 dark:text-white"
|
|
439
455
|
}, e.emptyMessage)))]));
|
|
@@ -472,104 +488,104 @@ P.props = {
|
|
|
472
488
|
};
|
|
473
489
|
//#endregion
|
|
474
490
|
//#region src/components/icons/chevron-left.vue
|
|
475
|
-
var
|
|
491
|
+
var te = {}, ne = {
|
|
476
492
|
xmlns: "http://www.w3.org/2000/svg",
|
|
477
493
|
fill: "none",
|
|
478
494
|
viewBox: "0 0 24 24",
|
|
479
495
|
"stroke-width": "1.5",
|
|
480
496
|
stroke: "currentColor"
|
|
481
497
|
};
|
|
482
|
-
function
|
|
483
|
-
return a(), n("svg",
|
|
498
|
+
function F(e, t) {
|
|
499
|
+
return a(), n("svg", ne, [...t[0] ||= [r("path", {
|
|
484
500
|
"stroke-linecap": "round",
|
|
485
501
|
"stroke-linejoin": "round",
|
|
486
502
|
d: "M15.75 19.5 8.25 12l7.5-7.5"
|
|
487
503
|
}, null, -1)]]);
|
|
488
504
|
}
|
|
489
|
-
var
|
|
505
|
+
var I = /* @__PURE__ */ c(te, [["render", F]]), L = {}, R = {
|
|
490
506
|
xmlns: "http://www.w3.org/2000/svg",
|
|
491
507
|
fill: "none",
|
|
492
508
|
viewBox: "0 0 24 24",
|
|
493
509
|
"stroke-width": "1.5",
|
|
494
510
|
stroke: "currentColor"
|
|
495
511
|
};
|
|
496
|
-
function
|
|
497
|
-
return a(), n("svg",
|
|
512
|
+
function z(e, t) {
|
|
513
|
+
return a(), n("svg", R, [...t[0] ||= [r("path", {
|
|
498
514
|
"stroke-linecap": "round",
|
|
499
515
|
"stroke-linejoin": "round",
|
|
500
516
|
d: "m8.25 4.5 7.5 7.5-7.5 7.5"
|
|
501
517
|
}, null, -1)]]);
|
|
502
518
|
}
|
|
503
|
-
var
|
|
519
|
+
var B = /* @__PURE__ */ c(L, [["render", z]]), V = {
|
|
504
520
|
active: "bg-blue-600 text-white dark:bg-blue-600",
|
|
505
521
|
inactive: "text-gray-900 cursor-pointer hover:bg-gray-50 dark:text-white dark:hover:bg-gray-700",
|
|
506
522
|
item: "w-9 h-9 flex items-center justify-center"
|
|
507
|
-
},
|
|
523
|
+
}, H = (e, t) => {
|
|
508
524
|
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" }, [
|
|
525
|
+
return i("nav", { class: "bg-white border flex w-fit rounded-md border-gray-300 dark:bg-gray-800 dark:border-gray-700" }, [
|
|
510
526
|
e?.active && e?.active < 2 ? null : i("a", {
|
|
511
527
|
"aria-label": "Prev",
|
|
512
528
|
class: [
|
|
513
|
-
|
|
514
|
-
|
|
529
|
+
V.item,
|
|
530
|
+
V.inactive,
|
|
515
531
|
"border-r border-gray-300 rounded-l-md dark:border-gray-700"
|
|
516
532
|
],
|
|
517
533
|
onClick: (n) => {
|
|
518
|
-
n.preventDefault(), e.active && t.emit("update:active", e.active - 1);
|
|
534
|
+
n.preventDefault(), e.active && (t.emit("update:active", e.active - 1), t.emit("change"));
|
|
519
535
|
}
|
|
520
|
-
}, i(
|
|
536
|
+
}, i(I, { class: "size-4" })),
|
|
521
537
|
...Array.from({ length: e.total }, (e, t) => t + 1).map((r) => i(r === e.active ? "span" : "a", {
|
|
522
538
|
class: [
|
|
523
|
-
e.active === r ?
|
|
524
|
-
|
|
539
|
+
e.active === r ? V.active : V.inactive,
|
|
540
|
+
V.item,
|
|
525
541
|
r === 1 ? "rounded-l-md" : "",
|
|
526
542
|
r < e.total || r === e.total && !n ? "border-r border-gray-300 dark:border-gray-700" : "rounded-r-md"
|
|
527
543
|
],
|
|
528
544
|
"data-page": r,
|
|
529
545
|
onClick: (e) => {
|
|
530
|
-
e.preventDefault(), t.emit("update:active", r);
|
|
546
|
+
e.preventDefault(), t.emit("update:active", r), t.emit("change");
|
|
531
547
|
}
|
|
532
548
|
}, r)),
|
|
533
549
|
n ? null : i("a", {
|
|
534
550
|
"aria-label": "Next",
|
|
535
551
|
class: [
|
|
536
|
-
|
|
537
|
-
|
|
552
|
+
V.item,
|
|
553
|
+
V.inactive,
|
|
538
554
|
"rounded-r-md"
|
|
539
555
|
],
|
|
540
556
|
onClick: (n) => {
|
|
541
|
-
n.preventDefault(), e.active && t.emit("update:active", e.active + 1);
|
|
557
|
+
n.preventDefault(), e.active && (t.emit("update:active", e.active + 1), t.emit("change"));
|
|
542
558
|
}
|
|
543
|
-
}, i(
|
|
559
|
+
}, i(B, { class: "size-4" }))
|
|
544
560
|
]);
|
|
545
561
|
};
|
|
546
|
-
|
|
562
|
+
H.props = {
|
|
547
563
|
total: {
|
|
548
564
|
type: Number,
|
|
549
565
|
required: !0
|
|
550
566
|
},
|
|
551
567
|
active: Number
|
|
552
|
-
},
|
|
568
|
+
}, H.emits = ["update:active", "change"];
|
|
553
569
|
//#endregion
|
|
554
570
|
//#region src/components/message/message.compose.ts
|
|
555
|
-
var
|
|
556
|
-
function
|
|
571
|
+
var U = o([]);
|
|
572
|
+
function W() {
|
|
557
573
|
function e() {
|
|
558
|
-
return
|
|
574
|
+
return U.value;
|
|
559
575
|
}
|
|
560
576
|
function t(e, t = 3e3) {
|
|
561
577
|
let n = Date.now();
|
|
562
|
-
|
|
578
|
+
U.value.push({
|
|
563
579
|
id: n,
|
|
564
580
|
message: e,
|
|
565
581
|
duration: t
|
|
566
582
|
}), setTimeout(() => r(n), t);
|
|
567
583
|
}
|
|
568
584
|
function n() {
|
|
569
|
-
|
|
585
|
+
U.value = [];
|
|
570
586
|
}
|
|
571
587
|
function r(e) {
|
|
572
|
-
|
|
588
|
+
U.value = U.value.filter((t) => t.id !== e);
|
|
573
589
|
}
|
|
574
590
|
return {
|
|
575
591
|
getItems: e,
|
|
@@ -580,8 +596,8 @@ function K() {
|
|
|
580
596
|
}
|
|
581
597
|
//#endregion
|
|
582
598
|
//#region src/components/message/message.ts
|
|
583
|
-
var
|
|
584
|
-
let { getItems: e } =
|
|
599
|
+
var G = () => {
|
|
600
|
+
let { getItems: e } = W();
|
|
585
601
|
return i(t, {
|
|
586
602
|
tag: "div",
|
|
587
603
|
enterFromClass: "opacity-0 -translate-y-full",
|
|
@@ -598,7 +614,7 @@ var q = () => {
|
|
|
598
614
|
"data-test": "message",
|
|
599
615
|
class: "bg-gray-900 text-white px-3 py-2 rounded-md whitespace-nowrap dark:bg-gray-700"
|
|
600
616
|
}, e.message)));
|
|
601
|
-
},
|
|
617
|
+
}, K = {
|
|
602
618
|
base: "px-4 py-3 rounded-md border flex items-start gap-2",
|
|
603
619
|
colors: {
|
|
604
620
|
error: "bg-red-100 text-red-700 border-red-300 dark:bg-red-900/50 dark:text-red-300 dark:border-red-900",
|
|
@@ -607,7 +623,7 @@ var q = () => {
|
|
|
607
623
|
success: "bg-green-100 text-green-700 border-green-300 dark:bg-green-900/50 dark:text-green-300 dark:border-green-900",
|
|
608
624
|
warning: "bg-yellow-100 text-yellow-700 border-yellow-300 dark:bg-yellow-900/50 dark:text-yellow-300 dark:border-yellow-900"
|
|
609
625
|
}
|
|
610
|
-
},
|
|
626
|
+
}, q = (e, t) => i("div", { class: [K.base, K.colors[e.color ?? "light"]] }, [
|
|
611
627
|
e.loading ? i(f, { class: "mt-0.75" }) : t.slots.icon ? i("div", { class: "mt-0.75 shrink-0" }, t.slots.icon()) : null,
|
|
612
628
|
t.slots.default?.(),
|
|
613
629
|
t.slots.action ? i("div", { class: "ml-auto" }, t.slots.action()) : e.closable ? i("button", {
|
|
@@ -616,7 +632,7 @@ var q = () => {
|
|
|
616
632
|
onClick: () => t.emit("close")
|
|
617
633
|
}, i(k, { class: "size-4" })) : null
|
|
618
634
|
]);
|
|
619
|
-
|
|
635
|
+
q.props = {
|
|
620
636
|
color: {
|
|
621
637
|
type: String,
|
|
622
638
|
default: "light"
|
|
@@ -625,4 +641,31 @@ Y.props = {
|
|
|
625
641
|
loading: Boolean
|
|
626
642
|
};
|
|
627
643
|
//#endregion
|
|
628
|
-
|
|
644
|
+
//#region src/components/skeleton/skeleton.ts
|
|
645
|
+
var J = { base: "bg-gray-200 h-40 rounded-md animate-pulse dark:bg-gray-800" }, Y = () => i("div", { class: J.base }), X = {
|
|
646
|
+
base: "border h-6 inline-flex items-center text-sm font-medium px-2 rounded whitespace-nowrap",
|
|
647
|
+
colors: {
|
|
648
|
+
light: "bg-gray-100 border-gray-300 text-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-white",
|
|
649
|
+
warning: "bg-yellow-50 border-yellow-500 text-yellow-700 dark:bg-yellow-600 dark:border-yellow-500 dark:text-yellow-100",
|
|
650
|
+
primary: "bg-sky-50 border-sky-500 text-sky-700 dark:bg-sky-600 dark:border-sky-500 dark:text-sky-100",
|
|
651
|
+
success: "bg-green-50 border-green-500 text-green-700 dark:bg-green-600 dark:border-green-500 dark:text-green-100",
|
|
652
|
+
error: "bg-red-50 border-red-500 text-red-700 dark:bg-red-600 dark:border-red-500 dark:text-red-100"
|
|
653
|
+
}
|
|
654
|
+
}, Z = (e, t) => i("span", { class: [X.base, X.colors[e.color ?? "light"]] }, t.slots.default?.());
|
|
655
|
+
Z.props = { color: {
|
|
656
|
+
type: String,
|
|
657
|
+
default: "light"
|
|
658
|
+
} };
|
|
659
|
+
//#endregion
|
|
660
|
+
//#region src/components/description-list/description-list.ts
|
|
661
|
+
var Q = {
|
|
662
|
+
base: "space-y-1",
|
|
663
|
+
title: "text-sm text-gray-500 dark:text-gray-400",
|
|
664
|
+
description: "font-medium text-gray-900 dark:text-white"
|
|
665
|
+
}, $ = (e, t) => i("div", { class: Q.base }, [i("dt", { class: Q.title }, e.title), i("dd", { class: Q.description }, t.slots.default?.())]);
|
|
666
|
+
$.props = { title: {
|
|
667
|
+
type: String,
|
|
668
|
+
required: !0
|
|
669
|
+
} };
|
|
670
|
+
//#endregion
|
|
671
|
+
export { q as Alert, Z as Badge, m as Button, A as Card, x as Checkbox, $ as DescriptionList, E as FormItem, y as Input, G as Message, M as Modal, H as Pagination, C as Radio, T as Select, Y as Skeleton, N as Table, P as Widget, W 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=(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 shrink-0 size-4`};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`]]},[e.loading?(0,t.h)(o,{class:`mt-0.75`}):n.slots.icon?(0,t.h)(`div`,{class:`mt-0.75 shrink-0`},n.slots.icon()):null,n.slots.default?.(),n.slots.action?(0,t.h)(`div`,{class:`ml-auto`},n.slots.action()):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,loading: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});
|
|
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 shrink-0 size-4`};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 dark:text-white dark:hover:text-gray-900`}},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},{default:()=>[e.loading?(0,t.h)(o,{"data-test":`spinner`}):n.slots.icon&&e.iconPosition===`start`?n.slots.icon():null,n.slots.default?n.slots.default():null,n.slots.icon&&e.iconPosition===`end`?n.slots.icon():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},iconPosition:{type:String,default:`start`}};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,``))}`}function d(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}var f={base:`border focus:outline-1 disabled:bg-gray-50`,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`}}},p=(e,n)=>{let{class:r,type:i,...a}=n.attrs,o=d(()=>n.emit(`input-debounce`),300);return(0,t.h)(e.tag===`textarea`?`textarea`:`input`,{type:i,class:[r,f.base,...i===`file`?[f.file,f.colors[e.color??`light`].file,f.sizes[e.size??`md`].file]:[],f.colors[e.color??`light`].base,f.sizes[e.size??`md`].base,f.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),o()}})};p.props={color:{type:String,default:`light`},size:{type:String,default:`md`},modelValue:String,tag:{type:String,default:`input`},currency:Boolean},p.emits=[`update:modelValue`,`input-debounce`];var m={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`}},h=(e,n)=>{let r=e.id||(0,t.useId)();return(0,t.h)(`div`,{class:m.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:[m.base,m.colors[e.color??`light`],m.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:m.label,for:r},e.label):null])};h.props={label:String,color:{type:String,default:`light`},size:{type:String,default:`md`},inputValue:String,modelValue:[Boolean,Array],id:String},h.emits=[`update:modelValue`];var g={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`}},_=(e,n)=>{let r=e.id||(0,t.useId)();return(0,t.h)(`div`,{class:g.wrapper},[(0,t.h)(`input`,{...n.attrs,id:r,type:`radio`,checked:e.modelValue===e.inputValue,class:[g.base,g.colors[e.color??`light`],g.sizes[e.size??`md`]],onChange:()=>{n.emit(`update:modelValue`,e.inputValue)}}),e.label?(0,t.h)(`label`,{class:g.label,for:r},e.label):null])};_.props={label:String,color:{type:String,default:`light`},size:{type:String,default:`md`},inputValue:String,modelValue:String,id:String},_.emits=[`update:modelValue`];var v={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`}},y=(e,n)=>{let{class:r,type:i,...a}=n.attrs;return(0,t.h)(`div`,{class:[v.wrapper,v.wrapperSizes[e.size??`md`]]},(0,t.h)(`select`,{type:i,class:[r,v.base,v.colors[e.color??`light`],v.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))))};y.props={color:{type:String,default:`light`},size:{type:String,default:`md`},modelValue:null,options:{type:Array,default:()=>[]}};var b=(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])};b.props={label:{type:String,required:!0},id:String};var x={},S={xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,"stroke-width":`1.5`,stroke:`currentColor`};function C(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,S,[...n[0]||=[(0,t.createElementVNode)(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M6 18 18 6M6 6l12 12`},null,-1)]])}var w=n(x,[[`render`,C]]),T=(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]);T.props={title:String};var E={size:{sm:`max-w-md`,md:`max-w-2xl`,lg:`max-w-4xl`}},D=(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)(T,{title:e.title,class:[`w-full shadow`,E.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)(w,{class:`size-5`})),default:n.slots.default,footer:n.slots.footer?()=>n.slots.footer?.():null})):void 0)};D.props={title:String,visible:Boolean,size:{type:String,default:`md`}},D.emits=[`update:visible`,`close`];var O=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}):e.value?e.value({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)))]));O.props={columns:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]},emptyMessage:{type:String,default:`Empty data`}};var k=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)]);k.props={label:{type:String,required:!0},value:{type:[String,Number],required:!0}};var A={},j={xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,"stroke-width":`1.5`,stroke:`currentColor`};function M(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,j,[...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 N=n(A,[[`render`,M]]),P={},F={xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,"stroke-width":`1.5`,stroke:`currentColor`};function I(e,n){return(0,t.openBlock)(),(0,t.createElementBlock)(`svg`,F,[...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 L=n(P,[[`render`,I]]),R={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`},z=(e,n)=>{let r=e?.active&&e?.active>=e.total;return(0,t.h)(`nav`,{class:`bg-white border flex w-fit rounded-md border-gray-300 dark:bg-gray-800 dark:border-gray-700`},[e?.active&&e?.active<2?null:(0,t.h)(`a`,{"aria-label":`Prev`,class:[R.item,R.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),n.emit(`change`))}},(0,t.h)(N,{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?R.active:R.inactive,R.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),n.emit(`change`)}},i)),r?null:(0,t.h)(`a`,{"aria-label":`Next`,class:[R.item,R.inactive,`rounded-r-md`],onClick:t=>{t.preventDefault(),e.active&&(n.emit(`update:active`,e.active+1),n.emit(`change`))}},(0,t.h)(L,{class:`size-4`}))])};z.props={total:{type:Number,required:!0},active:Number},z.emits=[`update:active`,`change`];var B=(0,t.ref)([]);function V(){function e(){return B.value}function t(e,t=3e3){let n=Date.now();B.value.push({id:n,message:e,duration:t}),setTimeout(()=>r(n),t)}function n(){B.value=[]}function r(e){B.value=B.value.filter(t=>t.id!==e)}return{getItems:e,info:t,clear:n,close:r}}var H=()=>{let{getItems:e}=V();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)))},U={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`}},W=(e,n)=>(0,t.h)(`div`,{class:[U.base,U.colors[e.color??`light`]]},[e.loading?(0,t.h)(o,{class:`mt-0.75`}):n.slots.icon?(0,t.h)(`div`,{class:`mt-0.75 shrink-0`},n.slots.icon()):null,n.slots.default?.(),n.slots.action?(0,t.h)(`div`,{class:`ml-auto`},n.slots.action()):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)(w,{class:`size-4`})):null]);W.props={color:{type:String,default:`light`},closable:Boolean,loading:Boolean};var G={base:`bg-gray-200 h-40 rounded-md animate-pulse dark:bg-gray-800`},K=()=>(0,t.h)(`div`,{class:G.base}),q={base:`border h-6 inline-flex items-center text-sm font-medium px-2 rounded whitespace-nowrap`,colors:{light:`bg-gray-100 border-gray-300 text-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-white`,warning:`bg-yellow-50 border-yellow-500 text-yellow-700 dark:bg-yellow-600 dark:border-yellow-500 dark:text-yellow-100`,primary:`bg-sky-50 border-sky-500 text-sky-700 dark:bg-sky-600 dark:border-sky-500 dark:text-sky-100`,success:`bg-green-50 border-green-500 text-green-700 dark:bg-green-600 dark:border-green-500 dark:text-green-100`,error:`bg-red-50 border-red-500 text-red-700 dark:bg-red-600 dark:border-red-500 dark:text-red-100`}},J=(e,n)=>(0,t.h)(`span`,{class:[q.base,q.colors[e.color??`light`]]},n.slots.default?.());J.props={color:{type:String,default:`light`}};var Y={base:`space-y-1`,title:`text-sm text-gray-500 dark:text-gray-400`,description:`font-medium text-gray-900 dark:text-white`},X=(e,n)=>(0,t.h)(`div`,{class:Y.base},[(0,t.h)(`dt`,{class:Y.title},e.title),(0,t.h)(`dd`,{class:Y.description},n.slots.default?.())]);X.props={title:{type:String,required:!0}},e.Alert=W,e.Badge=J,e.Button=c,e.Card=T,e.Checkbox=h,e.DescriptionList=X,e.FormItem=b,e.Input=p,e.Message=H,e.Modal=D,e.Pagination=z,e.Radio=_,e.Select=y,e.Skeleton=K,e.Table=O,e.Widget=k,e.useMessage=V});
|