@base-framework/ui 1.0.263 → 1.0.265
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Div as
|
|
2
|
-
import { Atom as c, Component as C, Html as L, Dom as oe, base as
|
|
1
|
+
import { Div as l, H5 as J, P as m, I as p, Li as U, Span as i, Ul as V, Button as f, OnState as x, Label as R, H2 as v, Form as K, Header as I, Footer as A, A as q, H3 as Q, Checkbox as X, Input as w, Img as Z, Nav as ee, UseParent as H, Time as te, Dialog as se } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as c, Component as C, Html as L, Dom as oe, base as le, Data as $, Builder as Y, Jot as k, Events as ne, DateTime as F } from "@base-framework/base";
|
|
3
3
|
import { P as S, b as re, R as ae } from "./range-calendar-BxLjYfrT.js";
|
|
4
4
|
import { C as ie, F as ce, a as y } from "./veil-tVDPinrr.js";
|
|
5
5
|
import { B as h, I as g } from "./buttons-Cm9etaEG.js";
|
|
@@ -32,14 +32,14 @@ const M = {
|
|
|
32
32
|
bgColor: "bg-muted/10",
|
|
33
33
|
iconColor: "text-muted-foreground"
|
|
34
34
|
}
|
|
35
|
-
}, fe = (e, t) =>
|
|
35
|
+
}, fe = (e, t) => l({ class: `flex items-center justify-center h-6 w-6 mr-3 ${t}` }, [
|
|
36
36
|
p({ html: e })
|
|
37
37
|
]), me = (e) => J({ class: "font-semibold" }, e), pe = (e) => m({ class: "text-sm text-muted-foreground" }, e), kt = c(({ title: e, description: t, icon: s, type: o = "default" }) => {
|
|
38
|
-
const { borderColor:
|
|
39
|
-
return
|
|
38
|
+
const { borderColor: n, bgColor: r, iconColor: a } = M[o] || M.default;
|
|
39
|
+
return l({ class: `flex items-start p-4 border rounded-lg ${r} ${n}` }, [
|
|
40
40
|
// Icon and content
|
|
41
41
|
s && fe(s, a),
|
|
42
|
-
|
|
42
|
+
l({ class: "flex flex-col" }, [
|
|
43
43
|
me(e),
|
|
44
44
|
pe(t)
|
|
45
45
|
])
|
|
@@ -66,7 +66,7 @@ class ge extends C {
|
|
|
66
66
|
L.removeElement(t);
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
oe.addClass(t, s),
|
|
69
|
+
oe.addClass(t, s), le.on("animationend", t, (o) => L.removeElement(t));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
const be = (e) => i({ class: "ml-auto text-xs tracking-widest opacity-60" }, e), xe = (e) => i({ class: "flex w-4 h-4", html: e }), we = (e) => i({ class: "flex-auto" }, e), ye = (e, t) => U({
|
|
@@ -78,8 +78,8 @@ const be = (e) => i({ class: "ml-auto text-xs tracking-widest opacity-60" }, e),
|
|
|
78
78
|
e.shortcut && be(e.shortcut)
|
|
79
79
|
]), ve = (e, t) => V({ class: "grid gap-2" }, [
|
|
80
80
|
e.map((s) => ye(s, t))
|
|
81
|
-
]), Ce = (e) =>
|
|
82
|
-
|
|
81
|
+
]), Ce = (e) => l({ class: "w-full z-10" }, [
|
|
82
|
+
l({
|
|
83
83
|
class: "max-h-60 border rounded-md overflow-y-auto p-1 grid gap-2 divide-y divide-border",
|
|
84
84
|
for: ["groups", (t) => ve(t, e)]
|
|
85
85
|
})
|
|
@@ -92,7 +92,7 @@ const be = (e) => i({ class: "ml-auto text-xs tracking-widest opacity-60" }, e),
|
|
|
92
92
|
}, [
|
|
93
93
|
e && i(e),
|
|
94
94
|
t && p({ html: t })
|
|
95
|
-
]), Se = ({ onSelect: e }) =>
|
|
95
|
+
]), Se = ({ onSelect: e }) => l([
|
|
96
96
|
x(
|
|
97
97
|
"open",
|
|
98
98
|
(t, s, o) => t ? new S({
|
|
@@ -157,7 +157,7 @@ class St extends C {
|
|
|
157
157
|
* @returns {object}
|
|
158
158
|
*/
|
|
159
159
|
render() {
|
|
160
|
-
return
|
|
160
|
+
return l({ class: "relative" }, [
|
|
161
161
|
ke({
|
|
162
162
|
label: this.label,
|
|
163
163
|
icon: this.icon,
|
|
@@ -167,13 +167,16 @@ class St extends C {
|
|
|
167
167
|
]);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
const De = c((e, t) =>
|
|
170
|
+
const De = c((e, t) => l({ ...e, class: "flex flex-auto flex-col space-y-2" }, t)), Ie = c((e, t) => R({ ...e, class: "flex auto text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" }, t)), $e = c((e, t) => m({ ...e, class: "text-sm text-muted-foreground italic" }, t)), Te = c((e, t) => m({ ...e, class: "text-sm text-destructive" }, t)), Dt = c((e, t = []) => ie({ class: "space-y-0", margin: "m-0", padding: "p-0" }, [
|
|
171
171
|
e.title && v({ class: "text-lg font-semibold py-4 px-6" }, e.title),
|
|
172
172
|
e.description && m({ class: "text-sm text-muted-foreground pb-4 px-6 max-w-[700px]" }, e.description),
|
|
173
173
|
...t
|
|
174
174
|
])), It = c((e, t = []) => ce({ label: e.label, description: e.description, class: "py-4 px-6", border: e.border }, [
|
|
175
|
-
|
|
176
|
-
])), $t = c((e, t = []) =>
|
|
175
|
+
l({ class: "flex flex-col space-y-6" }, t)
|
|
176
|
+
])), $t = c((e, t = []) => {
|
|
177
|
+
const s = e.border ? "border-t" : "";
|
|
178
|
+
return l({ ...e, class: `flex flex-col pb-4 px-6 space-y-4 ${s} ${e.class || ""}` }, t);
|
|
179
|
+
}), Be = (e) => e.tag === "input" || e.tag === "select" || e.tag === "textarea", _ = (e, t, s) => e.map((o) => !o || (o.children && o.children.length > 0 && (o.children = _(o.children, t, s)), !o.required) ? o : Be(o) ? {
|
|
177
180
|
...o,
|
|
178
181
|
aria: {
|
|
179
182
|
invalid: ["hasError"]
|
|
@@ -181,15 +184,15 @@ const De = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
181
184
|
invalid: s,
|
|
182
185
|
input: t
|
|
183
186
|
} : o), Fe = c((e, t) => {
|
|
184
|
-
const
|
|
187
|
+
const n = _(t, (r) => {
|
|
185
188
|
r.target.checkValidity() && e.setError(null);
|
|
186
189
|
}, (r) => {
|
|
187
190
|
e.setError(r.target.validationMessage);
|
|
188
191
|
});
|
|
189
|
-
return
|
|
192
|
+
return l({
|
|
190
193
|
...e,
|
|
191
194
|
class: "w-full"
|
|
192
|
-
},
|
|
195
|
+
}, n);
|
|
193
196
|
}), Tt = y(
|
|
194
197
|
{
|
|
195
198
|
/**
|
|
@@ -211,20 +214,20 @@ const De = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
211
214
|
* @returns {object}
|
|
212
215
|
*/
|
|
213
216
|
render() {
|
|
214
|
-
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this,
|
|
217
|
+
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this, n = (r) => {
|
|
215
218
|
this.state.error = r, this.state.hasError = !!r;
|
|
216
219
|
};
|
|
217
|
-
return
|
|
220
|
+
return l({ class: "flex flex-auto space-y-4" }, [
|
|
218
221
|
De([
|
|
219
222
|
Ie({ htmlFor: t }, s),
|
|
220
223
|
Fe({
|
|
221
224
|
id: t,
|
|
222
225
|
name: e,
|
|
223
226
|
value: this.state.value,
|
|
224
|
-
setError:
|
|
227
|
+
setError: n
|
|
225
228
|
}, this.children),
|
|
226
229
|
o && $e({ id: this.getId("description") }, o),
|
|
227
|
-
|
|
230
|
+
l({ onState: ["error", (r) => r && Te(r)] })
|
|
228
231
|
])
|
|
229
232
|
]);
|
|
230
233
|
}
|
|
@@ -233,16 +236,16 @@ const De = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
233
236
|
e.target.checkValidity() && (e.preventDefault(), s && s(e, t));
|
|
234
237
|
}, W = c(
|
|
235
238
|
(e, t) => K({ ...e, submit: (s, o) => Ae(s, o, e.submit), class: `w-full ${e.class ?? ""}` }, t)
|
|
236
|
-
), Bt = c((e, t) =>
|
|
239
|
+
), Bt = c((e, t) => l({ ...e, class: `space-y-6 p-4 md:p-6 divide-y ${e.class || ""}` }, t)), Ft = c((e, t = []) => l({ class: "space-y-3 py-4" }, [
|
|
237
240
|
e.title && v({ class: "font-semibold" }, e.title),
|
|
238
241
|
...t
|
|
239
|
-
])), At = (e, t) =>
|
|
242
|
+
])), At = (e, t) => l({ class: "flex justify-between" }, [
|
|
240
243
|
i({ class: "text-muted-foreground" }, e),
|
|
241
244
|
i(t)
|
|
242
|
-
]), Lt = (e, t) =>
|
|
245
|
+
]), Lt = (e, t) => l({ class: "flex" }, [
|
|
243
246
|
i({ class: "text-muted-foreground mr-8 w-24 truncate text-nowrap" }, e),
|
|
244
247
|
i(t)
|
|
245
|
-
]), Le = ({ title: e, description: t, back: s, icon: o, options:
|
|
248
|
+
]), Le = ({ title: e, description: t, back: s, icon: o, options: n = [] }) => I({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10" }, [
|
|
246
249
|
/**
|
|
247
250
|
* Back Button
|
|
248
251
|
*/
|
|
@@ -250,18 +253,18 @@ const De = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
250
253
|
/**
|
|
251
254
|
* Icon
|
|
252
255
|
*/
|
|
253
|
-
o &&
|
|
256
|
+
o && l({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [g(o)]),
|
|
254
257
|
/**
|
|
255
258
|
* Title and Description
|
|
256
259
|
*/
|
|
257
|
-
|
|
258
|
-
|
|
260
|
+
l({ class: "flex flex-auto flex-row justify-between w-full ml-2 gap-2" }, [
|
|
261
|
+
l({ class: "flex flex-auto flex-col" }, [
|
|
259
262
|
v({ class: "text-lg font-semibold m-0 truncate" }, e),
|
|
260
|
-
t &&
|
|
263
|
+
t && l({ class: "text-sm text-muted-foreground truncate" }, t)
|
|
261
264
|
]),
|
|
262
|
-
...
|
|
265
|
+
...n
|
|
263
266
|
])
|
|
264
|
-
]), Pe = c((e, t) =>
|
|
267
|
+
]), Pe = c((e, t) => l({
|
|
265
268
|
popover: "manual",
|
|
266
269
|
class: `modal m-auto top-0 right-0 bottom-0 left-0 fixed z-20 grid w-full h-full max-h-screen gap-2 lg:border bg-background text-foreground shadow-xl break-words p-0 ${e.class}`,
|
|
267
270
|
click: (s, o) => {
|
|
@@ -270,7 +273,7 @@ const De = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
270
273
|
}, [
|
|
271
274
|
W({ class: "modal-content relative bg-background z-[1] flex flex-auto flex-col space-y-4", submit: (s, o) => e.onSubmit && e.onSubmit(o) }, [
|
|
272
275
|
Le(e),
|
|
273
|
-
|
|
276
|
+
l({ class: "modal-body flex flex-grow flex-col overflow-y-auto py-0 px-6 z-0" }, t),
|
|
274
277
|
A({ class: "modal-footer sticky bg-background/80 backdrop-blur-md flex flex-none justify-between py-4 px-6 z-10" }, e.buttons)
|
|
275
278
|
])
|
|
276
279
|
])), Me = (e) => Y.render(e, app.root);
|
|
@@ -297,9 +300,9 @@ class Pt extends C {
|
|
|
297
300
|
description: o,
|
|
298
301
|
options: this.headerOptions(),
|
|
299
302
|
buttons: this.getButtons(),
|
|
300
|
-
onSubmit: (
|
|
303
|
+
onSubmit: (n) => {
|
|
301
304
|
let r = !0;
|
|
302
|
-
this.onSubmit && (r = this.onSubmit(
|
|
305
|
+
this.onSubmit && (r = this.onSubmit(n)), r !== !1 && this.destroy();
|
|
303
306
|
},
|
|
304
307
|
icon: this.icon,
|
|
305
308
|
back: this.back ?? !1,
|
|
@@ -466,7 +469,7 @@ const N = {
|
|
|
466
469
|
class: `pullRightIn bg-popover text-popover-foreground relative flex flex-auto flex-col justify-start shadow-lg pointer-events-auto p-4 border rounded-md min-w-[340px] max-w-[450px] mt-4 ${t}`,
|
|
467
470
|
href: e,
|
|
468
471
|
role: "alert"
|
|
469
|
-
}, s)), Ee = c(({ close: e, class: t }, s) =>
|
|
472
|
+
}, s)), Ee = c(({ close: e, class: t }, s) => l({
|
|
470
473
|
class: `pullRightIn bg-popover text-popover-foreground relative flex flex-auto flex-col justify-start shadow-lg pointer-events-auto p-4 border rounded-md min-w-[340px] max-w-[450px] mt-4 ${t}`,
|
|
471
474
|
click: () => e(),
|
|
472
475
|
role: "alert"
|
|
@@ -494,9 +497,9 @@ class je extends ge {
|
|
|
494
497
|
* @returns {object}
|
|
495
498
|
*/
|
|
496
499
|
render() {
|
|
497
|
-
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(),
|
|
498
|
-
return
|
|
499
|
-
href:
|
|
500
|
+
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), n = this.href || null, r = this.getChildren(o);
|
|
501
|
+
return n ? ze({
|
|
502
|
+
href: n,
|
|
500
503
|
class: `${t} ${s}`
|
|
501
504
|
}, r) : Ee({
|
|
502
505
|
close: this.close.bind(this),
|
|
@@ -528,7 +531,7 @@ class je extends ge {
|
|
|
528
531
|
*/
|
|
529
532
|
getButtons() {
|
|
530
533
|
return [
|
|
531
|
-
|
|
534
|
+
l({ class: "flex flex-row mt-6 gap-2" }, [
|
|
532
535
|
this.secondary && h({ variant: "outline", click: () => this.secondaryAction && this.secondaryAction() }, this.secondary),
|
|
533
536
|
this.primary && h({ click: () => this.primaryAction && this.primaryAction() }, this.primary)
|
|
534
537
|
])
|
|
@@ -542,10 +545,10 @@ class je extends ge {
|
|
|
542
545
|
*/
|
|
543
546
|
getChildren(t) {
|
|
544
547
|
return [
|
|
545
|
-
|
|
548
|
+
l({ class: "flex items-start" }, [
|
|
546
549
|
this.icon && p({ class: `mr-4 ${t}`, html: this.icon }),
|
|
547
|
-
|
|
548
|
-
|
|
550
|
+
l({ class: "flex flex-auto flex-col" }, [
|
|
551
|
+
l({ class: "flex flex-auto flex-row items-center w-full pr-12" }, [
|
|
549
552
|
this.title && Ne(this.title)
|
|
550
553
|
]),
|
|
551
554
|
m({ class: "text-base text-muted-foreground m-0 pr-12" }, this.description),
|
|
@@ -578,7 +581,7 @@ class Mt extends C {
|
|
|
578
581
|
* @returns {object}
|
|
579
582
|
*/
|
|
580
583
|
render() {
|
|
581
|
-
return
|
|
584
|
+
return l({ class: "notification-container pointer-events-none inset-auto bg-transparent backdrop:bg-transparent overflow-visible fixed bottom-[80px] right-0 z-50 p-5", popover: "manual" }, [
|
|
582
585
|
new ue({
|
|
583
586
|
cache: "list",
|
|
584
587
|
key: "id",
|
|
@@ -610,8 +613,8 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
610
613
|
class: 'text-sm gap-1 font-medium leading-none disabled:cursor-not-allowed disabled:opacity-70 flex flex-col items-center justify-between rounded-md border-2 bg-popover p-4 hover:bg-accent hover:text-accent-foreground data-[state="active"]:border-primary [&:has([data-state="active"])]:border-primary',
|
|
611
614
|
onState: ["method", { active: e }],
|
|
612
615
|
dataSet: ["method", ["state", e, "active"]],
|
|
613
|
-
click: (o, { state:
|
|
614
|
-
|
|
616
|
+
click: (o, { state: n }) => {
|
|
617
|
+
n.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), Ue(e);
|
|
615
618
|
}
|
|
616
619
|
}, [
|
|
617
620
|
g(s),
|
|
@@ -633,8 +636,8 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
633
636
|
* @returns {object}
|
|
634
637
|
*/
|
|
635
638
|
render() {
|
|
636
|
-
return
|
|
637
|
-
|
|
639
|
+
return l({ class: "flex flex-auto flex-col" }, [
|
|
640
|
+
l({ class: "grid grid-cols-3 gap-4" }, [
|
|
638
641
|
T({ label: "System", value: "system", icon: u.adjustments.horizontal }),
|
|
639
642
|
T({ label: "Light", value: "light", icon: u.sun }),
|
|
640
643
|
T({ label: "Dark", value: "dark", icon: u.moon })
|
|
@@ -714,9 +717,9 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
714
717
|
OFFLINE: "bg-gray-500",
|
|
715
718
|
BUSY: "bg-red-500",
|
|
716
719
|
AWAY: "bg-yellow-500"
|
|
717
|
-
}, Ve = (e = "") => (e = e.toUpperCase(), b[e] || b.OFFLINE), Et = (e) =>
|
|
720
|
+
}, Ve = (e = "") => (e = e.toUpperCase(), b[e] || b.OFFLINE), Et = (e) => l({
|
|
718
721
|
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${Ve(e)}`
|
|
719
|
-
}), jt = ({ propName: e = "status" } = {}) =>
|
|
722
|
+
}), jt = ({ propName: e = "status" } = {}) => l({
|
|
720
723
|
class: "absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full",
|
|
721
724
|
onSet: [e, {
|
|
722
725
|
[b.ONLINE]: D.ONLINE,
|
|
@@ -744,7 +747,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
744
747
|
*/
|
|
745
748
|
openFileBrowse() {
|
|
746
749
|
const e = this.input;
|
|
747
|
-
e && (e.value = "",
|
|
750
|
+
e && (e.value = "", ne.trigger("click", e));
|
|
748
751
|
},
|
|
749
752
|
/**
|
|
750
753
|
* Get the URL for the uploaded file.
|
|
@@ -762,7 +765,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
762
765
|
*/
|
|
763
766
|
render() {
|
|
764
767
|
const e = "logo-upload", t = this.onChange || null;
|
|
765
|
-
return
|
|
768
|
+
return l({ class: "flex flex-col items-center" }, [
|
|
766
769
|
w({
|
|
767
770
|
id: e,
|
|
768
771
|
cache: "input",
|
|
@@ -770,12 +773,12 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
770
773
|
accept: "image/*",
|
|
771
774
|
class: "hidden",
|
|
772
775
|
change: (s) => {
|
|
773
|
-
var
|
|
774
|
-
const o = (
|
|
776
|
+
var n;
|
|
777
|
+
const o = (n = s.target.files) == null ? void 0 : n[0];
|
|
775
778
|
o && t && (this.state.loaded = !1, t(o, this.parent), this.src = this.getFileUrl(o), this.state.loaded = !0);
|
|
776
779
|
}
|
|
777
780
|
}),
|
|
778
|
-
|
|
781
|
+
l({
|
|
779
782
|
class: "relative w-32 h-32 rounded-full border flex items-center justify-center cursor-pointer hover:bg-muted transition-colors duration-150 overflow-hidden group",
|
|
780
783
|
click: (s) => {
|
|
781
784
|
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
@@ -792,7 +795,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
792
795
|
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
793
796
|
}, [
|
|
794
797
|
g(u.upload),
|
|
795
|
-
|
|
798
|
+
l("Upload logo")
|
|
796
799
|
])
|
|
797
800
|
)
|
|
798
801
|
])
|
|
@@ -811,7 +814,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
811
814
|
class: "mx-3 text-muted-foreground",
|
|
812
815
|
"aria-hidden": !0,
|
|
813
816
|
size: "xs"
|
|
814
|
-
}, u.chevron.single.right), He = (e) =>
|
|
817
|
+
}, u.chevron.single.right), He = (e) => l({ class: "flex items-center" }, [
|
|
815
818
|
e.href ? Re(e.href, e.label) : i(e.label),
|
|
816
819
|
e.separator && qe()
|
|
817
820
|
]), Ut = k(
|
|
@@ -840,7 +843,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
840
843
|
class: "flex items-center space-x-1 text-sm"
|
|
841
844
|
},
|
|
842
845
|
[
|
|
843
|
-
|
|
846
|
+
l({
|
|
844
847
|
role: "list",
|
|
845
848
|
class: "flex items-center",
|
|
846
849
|
for: ["items", (t, s) => He({
|
|
@@ -862,15 +865,15 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
862
865
|
"2xl": "h-16 w-16",
|
|
863
866
|
"3xl": "h-24 w-24",
|
|
864
867
|
default: "h-4 w-4"
|
|
865
|
-
}, Ye = (e) => E[e] || E.default, _e = ({ index: e, size: t }) =>
|
|
868
|
+
}, Ye = (e) => E[e] || E.default, _e = ({ index: e, size: t }) => l({ class: `${t} rounded-full bg-muted cursor-pointer` }, [
|
|
866
869
|
i({
|
|
867
870
|
class: "block w-full h-full rounded-full transition-colors",
|
|
868
871
|
onSet: ["activeIndex", {
|
|
869
872
|
"bg-primary": e,
|
|
870
873
|
"shadow-md": e
|
|
871
874
|
}],
|
|
872
|
-
click: (s, { data: o, onClick:
|
|
873
|
-
o.activeIndex = e,
|
|
875
|
+
click: (s, { data: o, onClick: n }) => {
|
|
876
|
+
o.activeIndex = e, n && n(e);
|
|
874
877
|
}
|
|
875
878
|
})
|
|
876
879
|
]), We = (e, t) => Array.from({ length: e }, (s, o) => _e({
|
|
@@ -899,10 +902,10 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
899
902
|
*/
|
|
900
903
|
render() {
|
|
901
904
|
const e = this.gap || "gap-2", t = Ye(this.size || "sm"), s = We(this.data.count, t);
|
|
902
|
-
return
|
|
905
|
+
return l(
|
|
903
906
|
{ class: "flex justify-center items-center py-2" },
|
|
904
907
|
[
|
|
905
|
-
|
|
908
|
+
l({ class: `flex ${e}` }, s)
|
|
906
909
|
]
|
|
907
910
|
);
|
|
908
911
|
}
|
|
@@ -924,15 +927,15 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
924
927
|
}, [
|
|
925
928
|
e.icon && i({ class: "mr-2 flex items-baseline" }, [g({ size: "xs" }, e.icon)]),
|
|
926
929
|
i({ class: "text-base font-normal" }, e.label)
|
|
927
|
-
]), Ke = (e, t) =>
|
|
930
|
+
]), Ke = (e, t) => l({ class: "w-full border rounded-md" }, [
|
|
928
931
|
V({ class: "max-h-60 overflow-y-auto p-2 grid gap-1", for: ["items", (s) => Je(s, e, t)] })
|
|
929
|
-
]), Qe = ({ onSelect: e, state: t }) =>
|
|
932
|
+
]), Qe = ({ onSelect: e, state: t }) => l({ class: "flex flex-auto flex-col" }, [
|
|
930
933
|
x(
|
|
931
934
|
"open",
|
|
932
|
-
(s, o,
|
|
935
|
+
(s, o, n) => s ? new S({
|
|
933
936
|
cache: "dropdown",
|
|
934
|
-
parent:
|
|
935
|
-
button:
|
|
937
|
+
parent: n,
|
|
938
|
+
button: n.button
|
|
936
939
|
}, [
|
|
937
940
|
Ke(e, t)
|
|
938
941
|
]) : null
|
|
@@ -1016,7 +1019,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1016
1019
|
*/
|
|
1017
1020
|
render() {
|
|
1018
1021
|
const e = this.class || "", t = this.maxWidth || "max-w-[250px]", s = this.width || "w-full";
|
|
1019
|
-
return
|
|
1022
|
+
return l({ class: `relative ${s} flex flex-auto flex-col ${t} ${e}` }, [
|
|
1020
1023
|
// @ts-ignore
|
|
1021
1024
|
Ge({ toggleDropdown: this.toggleDropdown.bind(this) }),
|
|
1022
1025
|
Qe({
|
|
@@ -1053,8 +1056,8 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1053
1056
|
icon: u.circlePlus,
|
|
1054
1057
|
click: e,
|
|
1055
1058
|
ariaLabel: "Increment"
|
|
1056
|
-
}), et = ({ bind: e, min: t, max: s, readonly: o = !1 }) => H(({ state:
|
|
1057
|
-
value: ["[[count]]",
|
|
1059
|
+
}), et = ({ bind: e, min: t, max: s, readonly: o = !1 }) => H(({ state: n }) => w({
|
|
1060
|
+
value: ["[[count]]", n],
|
|
1058
1061
|
bind: e,
|
|
1059
1062
|
blur: (r, { state: a }) => {
|
|
1060
1063
|
let d = parseInt(r.target.value, 10);
|
|
@@ -1088,7 +1091,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1088
1091
|
*/
|
|
1089
1092
|
render() {
|
|
1090
1093
|
const e = this.class ?? "";
|
|
1091
|
-
return
|
|
1094
|
+
return l({ class: `flex flex-auto items-center justify-between space-x-4 p-4 ${e}` }, [
|
|
1092
1095
|
Xe({ click: () => this.state.decrement("count") }),
|
|
1093
1096
|
et({
|
|
1094
1097
|
bind: this.bind,
|
|
@@ -1116,14 +1119,14 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1116
1119
|
p({ html: u.calendar.days })
|
|
1117
1120
|
]), ot = ({ handleDateSelect: e, blockPriorDates: t }) => x(
|
|
1118
1121
|
"open",
|
|
1119
|
-
(s, o,
|
|
1122
|
+
(s, o, n) => s ? new S({
|
|
1120
1123
|
cache: "dropdown",
|
|
1121
|
-
parent:
|
|
1122
|
-
button:
|
|
1124
|
+
parent: n,
|
|
1125
|
+
button: n.panel,
|
|
1123
1126
|
size: "fit"
|
|
1124
1127
|
}, [
|
|
1125
1128
|
new re({
|
|
1126
|
-
selectedDate:
|
|
1129
|
+
selectedDate: n.state.selectedDate,
|
|
1127
1130
|
selectedCallBack: e,
|
|
1128
1131
|
blockPriorDates: t
|
|
1129
1132
|
})
|
|
@@ -1159,7 +1162,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1159
1162
|
const e = (s, { state: o }) => o.toggle("open"), t = (s) => {
|
|
1160
1163
|
this.state.selectedDate = s, this.state.open = !1, this.input.value = s, typeof this.onChange == "function" && this.onChange(s);
|
|
1161
1164
|
};
|
|
1162
|
-
return
|
|
1165
|
+
return l({ class: "relative w-full max-w-[320px]" }, [
|
|
1163
1166
|
st({
|
|
1164
1167
|
toggleOpen: e,
|
|
1165
1168
|
bind: this.bind,
|
|
@@ -1172,16 +1175,16 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1172
1175
|
]);
|
|
1173
1176
|
}
|
|
1174
1177
|
}
|
|
1175
|
-
),
|
|
1178
|
+
), lt = ({ bind: e, required: t }) => w({
|
|
1176
1179
|
cache: "input",
|
|
1177
1180
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1178
1181
|
bind: e,
|
|
1179
1182
|
required: t
|
|
1180
|
-
}),
|
|
1183
|
+
}), nt = ({ bind: e, required: t, toggleOpen: s }) => f({
|
|
1181
1184
|
class: "relative flex items-center gap-2 w-full justify-between border bg-input hover:bg-muted rounded-md h-10 px-4 py-2",
|
|
1182
1185
|
click: s
|
|
1183
1186
|
}, [
|
|
1184
|
-
|
|
1187
|
+
lt({ bind: e, required: t }),
|
|
1185
1188
|
H(({ state: o }) => [
|
|
1186
1189
|
i(P.date(["[[start]]", o], "Start Date")),
|
|
1187
1190
|
i(" - "),
|
|
@@ -1190,15 +1193,15 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1190
1193
|
p({ html: u.calendar.days })
|
|
1191
1194
|
]), rt = ({ handleDateSelect: e, blockPriorDates: t }) => x(
|
|
1192
1195
|
"open",
|
|
1193
|
-
(s, o,
|
|
1196
|
+
(s, o, n) => s ? new S({
|
|
1194
1197
|
cache: "dropdown",
|
|
1195
|
-
parent:
|
|
1196
|
-
button:
|
|
1198
|
+
parent: n,
|
|
1199
|
+
button: n.panel,
|
|
1197
1200
|
size: "xl"
|
|
1198
1201
|
}, [
|
|
1199
1202
|
new ae({
|
|
1200
|
-
startDate:
|
|
1201
|
-
endDate:
|
|
1203
|
+
startDate: n.state.start,
|
|
1204
|
+
endDate: n.state.end,
|
|
1202
1205
|
onRangeSelect: e,
|
|
1203
1206
|
blockPriorDates: t
|
|
1204
1207
|
})
|
|
@@ -1238,8 +1241,8 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1238
1241
|
const e = (s, { state: o }) => o.toggle("open"), t = (s, o) => {
|
|
1239
1242
|
this.state.start = s, this.state.end = o, this.state.open = !1, this.input.value = `${s}-${o}`, typeof this.onChange == "function" && this.onChange({ start: s, end: o }, this.parent);
|
|
1240
1243
|
};
|
|
1241
|
-
return
|
|
1242
|
-
|
|
1244
|
+
return l({ class: "relative w-full max-w-[320px]" }, [
|
|
1245
|
+
nt({
|
|
1243
1246
|
toggleOpen: e,
|
|
1244
1247
|
bind: this.bind,
|
|
1245
1248
|
required: this.required
|
|
@@ -1255,8 +1258,8 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1255
1258
|
new he({
|
|
1256
1259
|
dateTime: e,
|
|
1257
1260
|
filter: s || ((o) => {
|
|
1258
|
-
const
|
|
1259
|
-
return F.getTimeFrame(
|
|
1261
|
+
const n = F.getLocalTime(o, !0, !1, t);
|
|
1262
|
+
return F.getTimeFrame(n);
|
|
1260
1263
|
})
|
|
1261
1264
|
})
|
|
1262
1265
|
]);
|
|
@@ -1283,11 +1286,11 @@ function it({ bind: e, required: t, toggleOpen: s }) {
|
|
|
1283
1286
|
]
|
|
1284
1287
|
);
|
|
1285
1288
|
}
|
|
1286
|
-
function B({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad:
|
|
1287
|
-
return
|
|
1289
|
+
function B({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: n = !1 }) {
|
|
1290
|
+
return l(
|
|
1288
1291
|
{ class: "flex flex-col max-h-[200px] overflow-y-auto" },
|
|
1289
1292
|
e.map((r) => {
|
|
1290
|
-
let a =
|
|
1293
|
+
let a = n ? r.toString().padStart(2, "0") : r.toString();
|
|
1291
1294
|
return f({
|
|
1292
1295
|
text: a,
|
|
1293
1296
|
class: "hover:bg-muted/50 rounded-md px-2 py-1",
|
|
@@ -1308,15 +1311,15 @@ function ct({ handleTimeSelect: e }) {
|
|
|
1308
1311
|
size: "fit"
|
|
1309
1312
|
},
|
|
1310
1313
|
[
|
|
1311
|
-
|
|
1314
|
+
l(
|
|
1312
1315
|
{ class: "flex flex-auto flex-col border rounded-md shadow-md" },
|
|
1313
1316
|
[
|
|
1314
|
-
|
|
1317
|
+
l(
|
|
1315
1318
|
{ class: "grid grid-cols-3 gap-2 p-4 text-center max-h-[220px] min-w-[240px]" },
|
|
1316
1319
|
[
|
|
1317
1320
|
// Hours column
|
|
1318
1321
|
B({
|
|
1319
|
-
items: Array.from({ length: 12 }, (
|
|
1322
|
+
items: Array.from({ length: 12 }, (n, r) => r + 1),
|
|
1320
1323
|
handleTimeSelect: e,
|
|
1321
1324
|
state: o.state,
|
|
1322
1325
|
stateValue: "hour",
|
|
@@ -1324,7 +1327,7 @@ function ct({ handleTimeSelect: e }) {
|
|
|
1324
1327
|
}),
|
|
1325
1328
|
// Minutes column
|
|
1326
1329
|
B({
|
|
1327
|
-
items: Array.from({ length: 60 }, (
|
|
1330
|
+
items: Array.from({ length: 60 }, (n, r) => r),
|
|
1328
1331
|
handleTimeSelect: e,
|
|
1329
1332
|
state: o.state,
|
|
1330
1333
|
stateValue: "minute",
|
|
@@ -1351,7 +1354,7 @@ function j(e) {
|
|
|
1351
1354
|
const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
|
|
1352
1355
|
if (!s)
|
|
1353
1356
|
return { hour: null, minute: null, meridian: null };
|
|
1354
|
-
let [, o,
|
|
1357
|
+
let [, o, n, , r] = s, a = parseInt(o, 10), d = parseInt(n, 10);
|
|
1355
1358
|
return a < 0 || a > 23 || d < 0 || d > 59 ? { hour: null, minute: null, meridian: null } : (r ? (r = r.toUpperCase(), r === "PM" && a < 12 ? a += 12 : r === "AM" && a === 12 && (a = 12)) : a === 0 ? (r = "AM", a = 12) : a < 12 ? r = "AM" : a === 12 ? r = "PM" : (r = "PM", a -= 12), {
|
|
1356
1359
|
hour: a.toString().padStart(2, "0"),
|
|
1357
1360
|
minute: d.toString().padStart(2, "0"),
|
|
@@ -1397,13 +1400,13 @@ const Wt = y(
|
|
|
1397
1400
|
* @returns {object}
|
|
1398
1401
|
*/
|
|
1399
1402
|
render() {
|
|
1400
|
-
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian:
|
|
1401
|
-
if (s && (this.state.hour = s), o && (this.state.minute = o),
|
|
1403
|
+
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian: n }) => {
|
|
1404
|
+
if (s && (this.state.hour = s), o && (this.state.minute = o), n && (this.state.meridian = n), this.state.hour && this.state.minute && this.state.meridian) {
|
|
1402
1405
|
const r = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
|
|
1403
1406
|
this.state.selectedTime = r, this.state.open = !1, this.input.value = r, typeof this.change == "function" && this.change(r);
|
|
1404
1407
|
}
|
|
1405
1408
|
};
|
|
1406
|
-
return
|
|
1409
|
+
return l(
|
|
1407
1410
|
{ class: "relative w-full max-w-[320px]" },
|
|
1408
1411
|
[
|
|
1409
1412
|
it({
|
|
@@ -1418,7 +1421,7 @@ const Wt = y(
|
|
|
1418
1421
|
);
|
|
1419
1422
|
}
|
|
1420
1423
|
}
|
|
1421
|
-
), dt = (e, t) =>
|
|
1424
|
+
), dt = (e, t) => l({ class: `hidden md:flex items-start justify-center w-6 h-6 mr-3 ${t}` }, [
|
|
1422
1425
|
g({ size: "lg" }, e)
|
|
1423
1426
|
]), ut = ({ title: e }) => I({ class: "flex flex-auto items-center" }, [
|
|
1424
1427
|
v({ class: "text-lg font-semibold" }, e)
|
|
@@ -1431,14 +1434,14 @@ const Wt = y(
|
|
|
1431
1434
|
aria: { expanded: ["open"] }
|
|
1432
1435
|
},
|
|
1433
1436
|
[
|
|
1434
|
-
|
|
1437
|
+
l({ class: "flex flex-auto p-6 pb-12 md:pb-6" }, [
|
|
1435
1438
|
// Icon and content
|
|
1436
1439
|
e.icon && dt(e.icon, e.iconColor),
|
|
1437
|
-
|
|
1438
|
-
|
|
1440
|
+
l({ class: "flex flex-auto flex-col gap-4" }, [
|
|
1441
|
+
l({ class: "flex flex-auto flex-col space-y-2" }, [
|
|
1439
1442
|
ut(e),
|
|
1440
1443
|
e.description && m({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, e.description),
|
|
1441
|
-
|
|
1444
|
+
l({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t)
|
|
1442
1445
|
]),
|
|
1443
1446
|
e.buttons && A({ class: "flex flex-col-reverse sm:flex-row sm:justify-end mt-6 gap-2 sm:gap-0 sm:space-x-2" }, e.buttons)
|
|
1444
1447
|
])
|
|
@@ -1488,13 +1491,13 @@ class mt extends C {
|
|
|
1488
1491
|
render() {
|
|
1489
1492
|
const t = (d) => {
|
|
1490
1493
|
d.target === this.panel && this.close();
|
|
1491
|
-
}, { borderColor: s, bgColor: o, iconColor:
|
|
1494
|
+
}, { borderColor: s, bgColor: o, iconColor: n } = O[this.type] || O.default, r = `${this.getMainClass()} ${o} ${s}`, a = this.title || "Dialog Title";
|
|
1492
1495
|
return ht({
|
|
1493
1496
|
class: r,
|
|
1494
1497
|
title: a,
|
|
1495
1498
|
click: t,
|
|
1496
1499
|
icon: this.icon,
|
|
1497
|
-
iconColor:
|
|
1500
|
+
iconColor: n,
|
|
1498
1501
|
description: this.description,
|
|
1499
1502
|
buttons: this.getButtons()
|
|
1500
1503
|
}, this.children);
|
|
@@ -1574,11 +1577,11 @@ class Gt extends mt {
|
|
|
1574
1577
|
this.confirmed && this.confirmed(), this.close();
|
|
1575
1578
|
}
|
|
1576
1579
|
}
|
|
1577
|
-
const Jt = c((e, t = []) =>
|
|
1580
|
+
const Jt = c((e, t = []) => l({ class: "w-full max-w-md p-6 m-auto" }, [
|
|
1578
1581
|
W({ class: "flex flex-auto flex-col" }, [
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
e.icon &&
|
|
1582
|
+
l({ class: "flex flex-auto flex-col space-y-4" }, [
|
|
1583
|
+
l({ class: "flex flex-auto items-center justify-center" }, [
|
|
1584
|
+
e.icon && l({ class: "w-16 h-16 mb-2 text-primary" }, [
|
|
1582
1585
|
g(e.icon)
|
|
1583
1586
|
])
|
|
1584
1587
|
]),
|
package/dist/index.es.js
CHANGED
|
@@ -3,7 +3,7 @@ import { B as d, I as g, L as C } from "./buttons-Cm9etaEG.js";
|
|
|
3
3
|
import { C as T, F as D, V as I, a as b } from "./veil-tVDPinrr.js";
|
|
4
4
|
import { C as F, d as P, D as B, c as k, E as M, F as f, H as x, I as N, M as v, N as y, P as h, R as L, T as W, a as H, b as A, U as R, W as w } from "./inputs-DscqfC6k.js";
|
|
5
5
|
import { Icons as G } from "./icons.es.js";
|
|
6
|
-
import { A as E, B as V, C as j, w as q, J, y as z, z as K, E as Q, G as _, D as X, m as Y, n as Z, O as $, K as aa, v as ea, c as sa, a as oa, b as ta, Q as ra, l as na, g as la, i as ia, h as pa, j as ma, e as ua, k as da, F as ga, d as Ca, f as ca, L as Ta, x as Da, M as Ia, o as ba, N as Sa, P as Fa, s as Pa, t as Ba, S as ka, q as Ma, r as fa, T as xa, H as Na, I as va, p as ya, u as ha } from "./empty-state-
|
|
6
|
+
import { A as E, B as V, C as j, w as q, J, y as z, z as K, E as Q, G as _, D as X, m as Y, n as Z, O as $, K as aa, v as ea, c as sa, a as oa, b as ta, Q as ra, l as na, g as la, i as ia, h as pa, j as ma, e as ua, k as da, F as ga, d as Ca, f as ca, L as Ta, x as Da, M as Ia, o as ba, N as Sa, P as Fa, s as Pa, t as Ba, S as ka, q as Ma, r as fa, T as xa, H as Na, I as va, p as ya, u as ha } from "./empty-state-CPFSCaH0.js";
|
|
7
7
|
import { A as Wa, b as Ha, C as Aa, D as Ra, a as wa, F as Ua, M as Ga, P as Oa, R as Ea, c as Va, g as ja, p as qa } from "./range-calendar-BxLjYfrT.js";
|
|
8
8
|
import { B as za, p as Ka, C as Qa, j as _a, D as Xa, m as Ya, k as Za, H as $a, I as ae, N as ee, O as se, P as oe, S as te, n as re, o as ne, t as le, s as ie, q as pe, r as me, T as ue, l as de, U as ge, W as Ce, f as ce, h as Te, i as De, c as Ie, d as be, b as Se, e as Fe, a as Pe, g as Be } from "./signature-panel-obojbki5.js";
|
|
9
9
|
import { B as Me, I as fe, M as xe, d as Ne, e as ve, g as ye, N as he, b as Le, a as We, f as He, P as Ae, c as Re, S as we, T as Ue } from "./mobile-nav-wrapper-Dj67Pb8l.js";
|
package/dist/molecules.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as s, B as t, C as r, w as e, J as i, y as n, z as m, E as l, G as C, D as d, m as S, n as p, O as u, K as D, v as c, c as g, a as F, b as T, Q as P, l as A, g as f, i as w, h as I, j as b, e as y, k as B, F as M, d as k, f as x, L, x as v, M as E, o as N, N as R, P as U, s as h, t as G, S as O, q as j, r as q, T as z, H, I as J, p as K, u as Q } from "./empty-state-
|
|
1
|
+
import { A as s, B as t, C as r, w as e, J as i, y as n, z as m, E as l, G as C, D as d, m as S, n as p, O as u, K as D, v as c, c as g, a as F, b as T, Q as P, l as A, g as f, i as w, h as I, j as b, e as y, k as B, F as M, d as k, f as x, L, x as v, M as E, o as N, N as R, P as U, s as h, t as G, S as O, q as j, r as q, T as z, H, I as J, p as K, u as Q } from "./empty-state-CPFSCaH0.js";
|
|
2
2
|
import { A as V, P as W, g as X } from "./range-calendar-BxLjYfrT.js";
|
|
3
3
|
export {
|
|
4
4
|
s as Alert,
|
package/package.json
CHANGED