@base-framework/ui 1.0.263 → 1.0.264
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,13 @@ 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 = []) => l({ ...e, class: `flex flex-col pb-4 px-6 space-y-4 ${e.class || ""}` }, t)), 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
177
|
...o,
|
|
178
178
|
aria: {
|
|
179
179
|
invalid: ["hasError"]
|
|
@@ -181,15 +181,15 @@ const De = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
181
181
|
invalid: s,
|
|
182
182
|
input: t
|
|
183
183
|
} : o), Fe = c((e, t) => {
|
|
184
|
-
const
|
|
184
|
+
const n = _(t, (r) => {
|
|
185
185
|
r.target.checkValidity() && e.setError(null);
|
|
186
186
|
}, (r) => {
|
|
187
187
|
e.setError(r.target.validationMessage);
|
|
188
188
|
});
|
|
189
|
-
return
|
|
189
|
+
return l({
|
|
190
190
|
...e,
|
|
191
191
|
class: "w-full"
|
|
192
|
-
},
|
|
192
|
+
}, n);
|
|
193
193
|
}), Tt = y(
|
|
194
194
|
{
|
|
195
195
|
/**
|
|
@@ -211,20 +211,20 @@ const De = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
211
211
|
* @returns {object}
|
|
212
212
|
*/
|
|
213
213
|
render() {
|
|
214
|
-
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this,
|
|
214
|
+
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this, n = (r) => {
|
|
215
215
|
this.state.error = r, this.state.hasError = !!r;
|
|
216
216
|
};
|
|
217
|
-
return
|
|
217
|
+
return l({ class: "flex flex-auto space-y-4" }, [
|
|
218
218
|
De([
|
|
219
219
|
Ie({ htmlFor: t }, s),
|
|
220
220
|
Fe({
|
|
221
221
|
id: t,
|
|
222
222
|
name: e,
|
|
223
223
|
value: this.state.value,
|
|
224
|
-
setError:
|
|
224
|
+
setError: n
|
|
225
225
|
}, this.children),
|
|
226
226
|
o && $e({ id: this.getId("description") }, o),
|
|
227
|
-
|
|
227
|
+
l({ onState: ["error", (r) => r && Te(r)] })
|
|
228
228
|
])
|
|
229
229
|
]);
|
|
230
230
|
}
|
|
@@ -233,16 +233,16 @@ const De = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
233
233
|
e.target.checkValidity() && (e.preventDefault(), s && s(e, t));
|
|
234
234
|
}, W = c(
|
|
235
235
|
(e, t) => K({ ...e, submit: (s, o) => Ae(s, o, e.submit), class: `w-full ${e.class ?? ""}` }, t)
|
|
236
|
-
), Bt = c((e, t) =>
|
|
236
|
+
), 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
237
|
e.title && v({ class: "font-semibold" }, e.title),
|
|
238
238
|
...t
|
|
239
|
-
])), At = (e, t) =>
|
|
239
|
+
])), At = (e, t) => l({ class: "flex justify-between" }, [
|
|
240
240
|
i({ class: "text-muted-foreground" }, e),
|
|
241
241
|
i(t)
|
|
242
|
-
]), Lt = (e, t) =>
|
|
242
|
+
]), Lt = (e, t) => l({ class: "flex" }, [
|
|
243
243
|
i({ class: "text-muted-foreground mr-8 w-24 truncate text-nowrap" }, e),
|
|
244
244
|
i(t)
|
|
245
|
-
]), Le = ({ title: e, description: t, back: s, icon: o, options:
|
|
245
|
+
]), 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
246
|
/**
|
|
247
247
|
* Back Button
|
|
248
248
|
*/
|
|
@@ -250,18 +250,18 @@ const De = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
250
250
|
/**
|
|
251
251
|
* Icon
|
|
252
252
|
*/
|
|
253
|
-
o &&
|
|
253
|
+
o && l({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [g(o)]),
|
|
254
254
|
/**
|
|
255
255
|
* Title and Description
|
|
256
256
|
*/
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
l({ class: "flex flex-auto flex-row justify-between w-full ml-2 gap-2" }, [
|
|
258
|
+
l({ class: "flex flex-auto flex-col" }, [
|
|
259
259
|
v({ class: "text-lg font-semibold m-0 truncate" }, e),
|
|
260
|
-
t &&
|
|
260
|
+
t && l({ class: "text-sm text-muted-foreground truncate" }, t)
|
|
261
261
|
]),
|
|
262
|
-
...
|
|
262
|
+
...n
|
|
263
263
|
])
|
|
264
|
-
]), Pe = c((e, t) =>
|
|
264
|
+
]), Pe = c((e, t) => l({
|
|
265
265
|
popover: "manual",
|
|
266
266
|
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
267
|
click: (s, o) => {
|
|
@@ -270,7 +270,7 @@ const De = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
270
270
|
}, [
|
|
271
271
|
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
272
|
Le(e),
|
|
273
|
-
|
|
273
|
+
l({ class: "modal-body flex flex-grow flex-col overflow-y-auto py-0 px-6 z-0" }, t),
|
|
274
274
|
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
275
|
])
|
|
276
276
|
])), Me = (e) => Y.render(e, app.root);
|
|
@@ -297,9 +297,9 @@ class Pt extends C {
|
|
|
297
297
|
description: o,
|
|
298
298
|
options: this.headerOptions(),
|
|
299
299
|
buttons: this.getButtons(),
|
|
300
|
-
onSubmit: (
|
|
300
|
+
onSubmit: (n) => {
|
|
301
301
|
let r = !0;
|
|
302
|
-
this.onSubmit && (r = this.onSubmit(
|
|
302
|
+
this.onSubmit && (r = this.onSubmit(n)), r !== !1 && this.destroy();
|
|
303
303
|
},
|
|
304
304
|
icon: this.icon,
|
|
305
305
|
back: this.back ?? !1,
|
|
@@ -466,7 +466,7 @@ const N = {
|
|
|
466
466
|
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
467
|
href: e,
|
|
468
468
|
role: "alert"
|
|
469
|
-
}, s)), Ee = c(({ close: e, class: t }, s) =>
|
|
469
|
+
}, s)), Ee = c(({ close: e, class: t }, s) => l({
|
|
470
470
|
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
471
|
click: () => e(),
|
|
472
472
|
role: "alert"
|
|
@@ -494,9 +494,9 @@ class je extends ge {
|
|
|
494
494
|
* @returns {object}
|
|
495
495
|
*/
|
|
496
496
|
render() {
|
|
497
|
-
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(),
|
|
498
|
-
return
|
|
499
|
-
href:
|
|
497
|
+
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), n = this.href || null, r = this.getChildren(o);
|
|
498
|
+
return n ? ze({
|
|
499
|
+
href: n,
|
|
500
500
|
class: `${t} ${s}`
|
|
501
501
|
}, r) : Ee({
|
|
502
502
|
close: this.close.bind(this),
|
|
@@ -528,7 +528,7 @@ class je extends ge {
|
|
|
528
528
|
*/
|
|
529
529
|
getButtons() {
|
|
530
530
|
return [
|
|
531
|
-
|
|
531
|
+
l({ class: "flex flex-row mt-6 gap-2" }, [
|
|
532
532
|
this.secondary && h({ variant: "outline", click: () => this.secondaryAction && this.secondaryAction() }, this.secondary),
|
|
533
533
|
this.primary && h({ click: () => this.primaryAction && this.primaryAction() }, this.primary)
|
|
534
534
|
])
|
|
@@ -542,10 +542,10 @@ class je extends ge {
|
|
|
542
542
|
*/
|
|
543
543
|
getChildren(t) {
|
|
544
544
|
return [
|
|
545
|
-
|
|
545
|
+
l({ class: "flex items-start" }, [
|
|
546
546
|
this.icon && p({ class: `mr-4 ${t}`, html: this.icon }),
|
|
547
|
-
|
|
548
|
-
|
|
547
|
+
l({ class: "flex flex-auto flex-col" }, [
|
|
548
|
+
l({ class: "flex flex-auto flex-row items-center w-full pr-12" }, [
|
|
549
549
|
this.title && Ne(this.title)
|
|
550
550
|
]),
|
|
551
551
|
m({ class: "text-base text-muted-foreground m-0 pr-12" }, this.description),
|
|
@@ -578,7 +578,7 @@ class Mt extends C {
|
|
|
578
578
|
* @returns {object}
|
|
579
579
|
*/
|
|
580
580
|
render() {
|
|
581
|
-
return
|
|
581
|
+
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
582
|
new ue({
|
|
583
583
|
cache: "list",
|
|
584
584
|
key: "id",
|
|
@@ -610,8 +610,8 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
610
610
|
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
611
|
onState: ["method", { active: e }],
|
|
612
612
|
dataSet: ["method", ["state", e, "active"]],
|
|
613
|
-
click: (o, { state:
|
|
614
|
-
|
|
613
|
+
click: (o, { state: n }) => {
|
|
614
|
+
n.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), Ue(e);
|
|
615
615
|
}
|
|
616
616
|
}, [
|
|
617
617
|
g(s),
|
|
@@ -633,8 +633,8 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
633
633
|
* @returns {object}
|
|
634
634
|
*/
|
|
635
635
|
render() {
|
|
636
|
-
return
|
|
637
|
-
|
|
636
|
+
return l({ class: "flex flex-auto flex-col" }, [
|
|
637
|
+
l({ class: "grid grid-cols-3 gap-4" }, [
|
|
638
638
|
T({ label: "System", value: "system", icon: u.adjustments.horizontal }),
|
|
639
639
|
T({ label: "Light", value: "light", icon: u.sun }),
|
|
640
640
|
T({ label: "Dark", value: "dark", icon: u.moon })
|
|
@@ -714,9 +714,9 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
714
714
|
OFFLINE: "bg-gray-500",
|
|
715
715
|
BUSY: "bg-red-500",
|
|
716
716
|
AWAY: "bg-yellow-500"
|
|
717
|
-
}, Ve = (e = "") => (e = e.toUpperCase(), b[e] || b.OFFLINE), Et = (e) =>
|
|
717
|
+
}, Ve = (e = "") => (e = e.toUpperCase(), b[e] || b.OFFLINE), Et = (e) => l({
|
|
718
718
|
class: `absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full ${Ve(e)}`
|
|
719
|
-
}), jt = ({ propName: e = "status" } = {}) =>
|
|
719
|
+
}), jt = ({ propName: e = "status" } = {}) => l({
|
|
720
720
|
class: "absolute bottom-0 right-0 w-3 h-3 border-2 rounded-full",
|
|
721
721
|
onSet: [e, {
|
|
722
722
|
[b.ONLINE]: D.ONLINE,
|
|
@@ -744,7 +744,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
744
744
|
*/
|
|
745
745
|
openFileBrowse() {
|
|
746
746
|
const e = this.input;
|
|
747
|
-
e && (e.value = "",
|
|
747
|
+
e && (e.value = "", ne.trigger("click", e));
|
|
748
748
|
},
|
|
749
749
|
/**
|
|
750
750
|
* Get the URL for the uploaded file.
|
|
@@ -762,7 +762,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
762
762
|
*/
|
|
763
763
|
render() {
|
|
764
764
|
const e = "logo-upload", t = this.onChange || null;
|
|
765
|
-
return
|
|
765
|
+
return l({ class: "flex flex-col items-center" }, [
|
|
766
766
|
w({
|
|
767
767
|
id: e,
|
|
768
768
|
cache: "input",
|
|
@@ -770,12 +770,12 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
770
770
|
accept: "image/*",
|
|
771
771
|
class: "hidden",
|
|
772
772
|
change: (s) => {
|
|
773
|
-
var
|
|
774
|
-
const o = (
|
|
773
|
+
var n;
|
|
774
|
+
const o = (n = s.target.files) == null ? void 0 : n[0];
|
|
775
775
|
o && t && (this.state.loaded = !1, t(o, this.parent), this.src = this.getFileUrl(o), this.state.loaded = !0);
|
|
776
776
|
}
|
|
777
777
|
}),
|
|
778
|
-
|
|
778
|
+
l({
|
|
779
779
|
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
780
|
click: (s) => {
|
|
781
781
|
s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
|
|
@@ -792,7 +792,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
792
792
|
class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
|
|
793
793
|
}, [
|
|
794
794
|
g(u.upload),
|
|
795
|
-
|
|
795
|
+
l("Upload logo")
|
|
796
796
|
])
|
|
797
797
|
)
|
|
798
798
|
])
|
|
@@ -811,7 +811,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
811
811
|
class: "mx-3 text-muted-foreground",
|
|
812
812
|
"aria-hidden": !0,
|
|
813
813
|
size: "xs"
|
|
814
|
-
}, u.chevron.single.right), He = (e) =>
|
|
814
|
+
}, u.chevron.single.right), He = (e) => l({ class: "flex items-center" }, [
|
|
815
815
|
e.href ? Re(e.href, e.label) : i(e.label),
|
|
816
816
|
e.separator && qe()
|
|
817
817
|
]), Ut = k(
|
|
@@ -840,7 +840,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
840
840
|
class: "flex items-center space-x-1 text-sm"
|
|
841
841
|
},
|
|
842
842
|
[
|
|
843
|
-
|
|
843
|
+
l({
|
|
844
844
|
role: "list",
|
|
845
845
|
class: "flex items-center",
|
|
846
846
|
for: ["items", (t, s) => He({
|
|
@@ -862,15 +862,15 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
862
862
|
"2xl": "h-16 w-16",
|
|
863
863
|
"3xl": "h-24 w-24",
|
|
864
864
|
default: "h-4 w-4"
|
|
865
|
-
}, Ye = (e) => E[e] || E.default, _e = ({ index: e, size: t }) =>
|
|
865
|
+
}, Ye = (e) => E[e] || E.default, _e = ({ index: e, size: t }) => l({ class: `${t} rounded-full bg-muted cursor-pointer` }, [
|
|
866
866
|
i({
|
|
867
867
|
class: "block w-full h-full rounded-full transition-colors",
|
|
868
868
|
onSet: ["activeIndex", {
|
|
869
869
|
"bg-primary": e,
|
|
870
870
|
"shadow-md": e
|
|
871
871
|
}],
|
|
872
|
-
click: (s, { data: o, onClick:
|
|
873
|
-
o.activeIndex = e,
|
|
872
|
+
click: (s, { data: o, onClick: n }) => {
|
|
873
|
+
o.activeIndex = e, n && n(e);
|
|
874
874
|
}
|
|
875
875
|
})
|
|
876
876
|
]), We = (e, t) => Array.from({ length: e }, (s, o) => _e({
|
|
@@ -899,10 +899,10 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
899
899
|
*/
|
|
900
900
|
render() {
|
|
901
901
|
const e = this.gap || "gap-2", t = Ye(this.size || "sm"), s = We(this.data.count, t);
|
|
902
|
-
return
|
|
902
|
+
return l(
|
|
903
903
|
{ class: "flex justify-center items-center py-2" },
|
|
904
904
|
[
|
|
905
|
-
|
|
905
|
+
l({ class: `flex ${e}` }, s)
|
|
906
906
|
]
|
|
907
907
|
);
|
|
908
908
|
}
|
|
@@ -924,15 +924,15 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
924
924
|
}, [
|
|
925
925
|
e.icon && i({ class: "mr-2 flex items-baseline" }, [g({ size: "xs" }, e.icon)]),
|
|
926
926
|
i({ class: "text-base font-normal" }, e.label)
|
|
927
|
-
]), Ke = (e, t) =>
|
|
927
|
+
]), Ke = (e, t) => l({ class: "w-full border rounded-md" }, [
|
|
928
928
|
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 }) =>
|
|
929
|
+
]), Qe = ({ onSelect: e, state: t }) => l({ class: "flex flex-auto flex-col" }, [
|
|
930
930
|
x(
|
|
931
931
|
"open",
|
|
932
|
-
(s, o,
|
|
932
|
+
(s, o, n) => s ? new S({
|
|
933
933
|
cache: "dropdown",
|
|
934
|
-
parent:
|
|
935
|
-
button:
|
|
934
|
+
parent: n,
|
|
935
|
+
button: n.button
|
|
936
936
|
}, [
|
|
937
937
|
Ke(e, t)
|
|
938
938
|
]) : null
|
|
@@ -1016,7 +1016,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1016
1016
|
*/
|
|
1017
1017
|
render() {
|
|
1018
1018
|
const e = this.class || "", t = this.maxWidth || "max-w-[250px]", s = this.width || "w-full";
|
|
1019
|
-
return
|
|
1019
|
+
return l({ class: `relative ${s} flex flex-auto flex-col ${t} ${e}` }, [
|
|
1020
1020
|
// @ts-ignore
|
|
1021
1021
|
Ge({ toggleDropdown: this.toggleDropdown.bind(this) }),
|
|
1022
1022
|
Qe({
|
|
@@ -1053,8 +1053,8 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1053
1053
|
icon: u.circlePlus,
|
|
1054
1054
|
click: e,
|
|
1055
1055
|
ariaLabel: "Increment"
|
|
1056
|
-
}), et = ({ bind: e, min: t, max: s, readonly: o = !1 }) => H(({ state:
|
|
1057
|
-
value: ["[[count]]",
|
|
1056
|
+
}), et = ({ bind: e, min: t, max: s, readonly: o = !1 }) => H(({ state: n }) => w({
|
|
1057
|
+
value: ["[[count]]", n],
|
|
1058
1058
|
bind: e,
|
|
1059
1059
|
blur: (r, { state: a }) => {
|
|
1060
1060
|
let d = parseInt(r.target.value, 10);
|
|
@@ -1088,7 +1088,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1088
1088
|
*/
|
|
1089
1089
|
render() {
|
|
1090
1090
|
const e = this.class ?? "";
|
|
1091
|
-
return
|
|
1091
|
+
return l({ class: `flex flex-auto items-center justify-between space-x-4 p-4 ${e}` }, [
|
|
1092
1092
|
Xe({ click: () => this.state.decrement("count") }),
|
|
1093
1093
|
et({
|
|
1094
1094
|
bind: this.bind,
|
|
@@ -1116,14 +1116,14 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1116
1116
|
p({ html: u.calendar.days })
|
|
1117
1117
|
]), ot = ({ handleDateSelect: e, blockPriorDates: t }) => x(
|
|
1118
1118
|
"open",
|
|
1119
|
-
(s, o,
|
|
1119
|
+
(s, o, n) => s ? new S({
|
|
1120
1120
|
cache: "dropdown",
|
|
1121
|
-
parent:
|
|
1122
|
-
button:
|
|
1121
|
+
parent: n,
|
|
1122
|
+
button: n.panel,
|
|
1123
1123
|
size: "fit"
|
|
1124
1124
|
}, [
|
|
1125
1125
|
new re({
|
|
1126
|
-
selectedDate:
|
|
1126
|
+
selectedDate: n.state.selectedDate,
|
|
1127
1127
|
selectedCallBack: e,
|
|
1128
1128
|
blockPriorDates: t
|
|
1129
1129
|
})
|
|
@@ -1159,7 +1159,7 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1159
1159
|
const e = (s, { state: o }) => o.toggle("open"), t = (s) => {
|
|
1160
1160
|
this.state.selectedDate = s, this.state.open = !1, this.input.value = s, typeof this.onChange == "function" && this.onChange(s);
|
|
1161
1161
|
};
|
|
1162
|
-
return
|
|
1162
|
+
return l({ class: "relative w-full max-w-[320px]" }, [
|
|
1163
1163
|
st({
|
|
1164
1164
|
toggleOpen: e,
|
|
1165
1165
|
bind: this.bind,
|
|
@@ -1172,16 +1172,16 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1172
1172
|
]);
|
|
1173
1173
|
}
|
|
1174
1174
|
}
|
|
1175
|
-
),
|
|
1175
|
+
), lt = ({ bind: e, required: t }) => w({
|
|
1176
1176
|
cache: "input",
|
|
1177
1177
|
class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
|
|
1178
1178
|
bind: e,
|
|
1179
1179
|
required: t
|
|
1180
|
-
}),
|
|
1180
|
+
}), nt = ({ bind: e, required: t, toggleOpen: s }) => f({
|
|
1181
1181
|
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
1182
|
click: s
|
|
1183
1183
|
}, [
|
|
1184
|
-
|
|
1184
|
+
lt({ bind: e, required: t }),
|
|
1185
1185
|
H(({ state: o }) => [
|
|
1186
1186
|
i(P.date(["[[start]]", o], "Start Date")),
|
|
1187
1187
|
i(" - "),
|
|
@@ -1190,15 +1190,15 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1190
1190
|
p({ html: u.calendar.days })
|
|
1191
1191
|
]), rt = ({ handleDateSelect: e, blockPriorDates: t }) => x(
|
|
1192
1192
|
"open",
|
|
1193
|
-
(s, o,
|
|
1193
|
+
(s, o, n) => s ? new S({
|
|
1194
1194
|
cache: "dropdown",
|
|
1195
|
-
parent:
|
|
1196
|
-
button:
|
|
1195
|
+
parent: n,
|
|
1196
|
+
button: n.panel,
|
|
1197
1197
|
size: "xl"
|
|
1198
1198
|
}, [
|
|
1199
1199
|
new ae({
|
|
1200
|
-
startDate:
|
|
1201
|
-
endDate:
|
|
1200
|
+
startDate: n.state.start,
|
|
1201
|
+
endDate: n.state.end,
|
|
1202
1202
|
onRangeSelect: e,
|
|
1203
1203
|
blockPriorDates: t
|
|
1204
1204
|
})
|
|
@@ -1238,8 +1238,8 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1238
1238
|
const e = (s, { state: o }) => o.toggle("open"), t = (s, o) => {
|
|
1239
1239
|
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
1240
|
};
|
|
1241
|
-
return
|
|
1242
|
-
|
|
1241
|
+
return l({ class: "relative w-full max-w-[320px]" }, [
|
|
1242
|
+
nt({
|
|
1243
1243
|
toggleOpen: e,
|
|
1244
1244
|
bind: this.bind,
|
|
1245
1245
|
required: this.required
|
|
@@ -1255,8 +1255,8 @@ const z = globalThis.matchMedia, T = c(({ value: e, label: t, icon: s }) => f({
|
|
|
1255
1255
|
new he({
|
|
1256
1256
|
dateTime: e,
|
|
1257
1257
|
filter: s || ((o) => {
|
|
1258
|
-
const
|
|
1259
|
-
return F.getTimeFrame(
|
|
1258
|
+
const n = F.getLocalTime(o, !0, !1, t);
|
|
1259
|
+
return F.getTimeFrame(n);
|
|
1260
1260
|
})
|
|
1261
1261
|
})
|
|
1262
1262
|
]);
|
|
@@ -1283,11 +1283,11 @@ function it({ bind: e, required: t, toggleOpen: s }) {
|
|
|
1283
1283
|
]
|
|
1284
1284
|
);
|
|
1285
1285
|
}
|
|
1286
|
-
function B({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad:
|
|
1287
|
-
return
|
|
1286
|
+
function B({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: n = !1 }) {
|
|
1287
|
+
return l(
|
|
1288
1288
|
{ class: "flex flex-col max-h-[200px] overflow-y-auto" },
|
|
1289
1289
|
e.map((r) => {
|
|
1290
|
-
let a =
|
|
1290
|
+
let a = n ? r.toString().padStart(2, "0") : r.toString();
|
|
1291
1291
|
return f({
|
|
1292
1292
|
text: a,
|
|
1293
1293
|
class: "hover:bg-muted/50 rounded-md px-2 py-1",
|
|
@@ -1308,15 +1308,15 @@ function ct({ handleTimeSelect: e }) {
|
|
|
1308
1308
|
size: "fit"
|
|
1309
1309
|
},
|
|
1310
1310
|
[
|
|
1311
|
-
|
|
1311
|
+
l(
|
|
1312
1312
|
{ class: "flex flex-auto flex-col border rounded-md shadow-md" },
|
|
1313
1313
|
[
|
|
1314
|
-
|
|
1314
|
+
l(
|
|
1315
1315
|
{ class: "grid grid-cols-3 gap-2 p-4 text-center max-h-[220px] min-w-[240px]" },
|
|
1316
1316
|
[
|
|
1317
1317
|
// Hours column
|
|
1318
1318
|
B({
|
|
1319
|
-
items: Array.from({ length: 12 }, (
|
|
1319
|
+
items: Array.from({ length: 12 }, (n, r) => r + 1),
|
|
1320
1320
|
handleTimeSelect: e,
|
|
1321
1321
|
state: o.state,
|
|
1322
1322
|
stateValue: "hour",
|
|
@@ -1324,7 +1324,7 @@ function ct({ handleTimeSelect: e }) {
|
|
|
1324
1324
|
}),
|
|
1325
1325
|
// Minutes column
|
|
1326
1326
|
B({
|
|
1327
|
-
items: Array.from({ length: 60 }, (
|
|
1327
|
+
items: Array.from({ length: 60 }, (n, r) => r),
|
|
1328
1328
|
handleTimeSelect: e,
|
|
1329
1329
|
state: o.state,
|
|
1330
1330
|
stateValue: "minute",
|
|
@@ -1351,7 +1351,7 @@ function j(e) {
|
|
|
1351
1351
|
const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
|
|
1352
1352
|
if (!s)
|
|
1353
1353
|
return { hour: null, minute: null, meridian: null };
|
|
1354
|
-
let [, o,
|
|
1354
|
+
let [, o, n, , r] = s, a = parseInt(o, 10), d = parseInt(n, 10);
|
|
1355
1355
|
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
1356
|
hour: a.toString().padStart(2, "0"),
|
|
1357
1357
|
minute: d.toString().padStart(2, "0"),
|
|
@@ -1397,13 +1397,13 @@ const Wt = y(
|
|
|
1397
1397
|
* @returns {object}
|
|
1398
1398
|
*/
|
|
1399
1399
|
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),
|
|
1400
|
+
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian: n }) => {
|
|
1401
|
+
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
1402
|
const r = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
|
|
1403
1403
|
this.state.selectedTime = r, this.state.open = !1, this.input.value = r, typeof this.change == "function" && this.change(r);
|
|
1404
1404
|
}
|
|
1405
1405
|
};
|
|
1406
|
-
return
|
|
1406
|
+
return l(
|
|
1407
1407
|
{ class: "relative w-full max-w-[320px]" },
|
|
1408
1408
|
[
|
|
1409
1409
|
it({
|
|
@@ -1418,7 +1418,7 @@ const Wt = y(
|
|
|
1418
1418
|
);
|
|
1419
1419
|
}
|
|
1420
1420
|
}
|
|
1421
|
-
), dt = (e, t) =>
|
|
1421
|
+
), dt = (e, t) => l({ class: `hidden md:flex items-start justify-center w-6 h-6 mr-3 ${t}` }, [
|
|
1422
1422
|
g({ size: "lg" }, e)
|
|
1423
1423
|
]), ut = ({ title: e }) => I({ class: "flex flex-auto items-center" }, [
|
|
1424
1424
|
v({ class: "text-lg font-semibold" }, e)
|
|
@@ -1431,14 +1431,14 @@ const Wt = y(
|
|
|
1431
1431
|
aria: { expanded: ["open"] }
|
|
1432
1432
|
},
|
|
1433
1433
|
[
|
|
1434
|
-
|
|
1434
|
+
l({ class: "flex flex-auto p-6 pb-12 md:pb-6" }, [
|
|
1435
1435
|
// Icon and content
|
|
1436
1436
|
e.icon && dt(e.icon, e.iconColor),
|
|
1437
|
-
|
|
1438
|
-
|
|
1437
|
+
l({ class: "flex flex-auto flex-col gap-4" }, [
|
|
1438
|
+
l({ class: "flex flex-auto flex-col space-y-2" }, [
|
|
1439
1439
|
ut(e),
|
|
1440
1440
|
e.description && m({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, e.description),
|
|
1441
|
-
|
|
1441
|
+
l({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t)
|
|
1442
1442
|
]),
|
|
1443
1443
|
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
1444
|
])
|
|
@@ -1488,13 +1488,13 @@ class mt extends C {
|
|
|
1488
1488
|
render() {
|
|
1489
1489
|
const t = (d) => {
|
|
1490
1490
|
d.target === this.panel && this.close();
|
|
1491
|
-
}, { borderColor: s, bgColor: o, iconColor:
|
|
1491
|
+
}, { borderColor: s, bgColor: o, iconColor: n } = O[this.type] || O.default, r = `${this.getMainClass()} ${o} ${s}`, a = this.title || "Dialog Title";
|
|
1492
1492
|
return ht({
|
|
1493
1493
|
class: r,
|
|
1494
1494
|
title: a,
|
|
1495
1495
|
click: t,
|
|
1496
1496
|
icon: this.icon,
|
|
1497
|
-
iconColor:
|
|
1497
|
+
iconColor: n,
|
|
1498
1498
|
description: this.description,
|
|
1499
1499
|
buttons: this.getButtons()
|
|
1500
1500
|
}, this.children);
|
|
@@ -1574,11 +1574,11 @@ class Gt extends mt {
|
|
|
1574
1574
|
this.confirmed && this.confirmed(), this.close();
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
1577
|
-
const Jt = c((e, t = []) =>
|
|
1577
|
+
const Jt = c((e, t = []) => l({ class: "w-full max-w-md p-6 m-auto" }, [
|
|
1578
1578
|
W({ class: "flex flex-auto flex-col" }, [
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
e.icon &&
|
|
1579
|
+
l({ class: "flex flex-auto flex-col space-y-4" }, [
|
|
1580
|
+
l({ class: "flex flex-auto items-center justify-center" }, [
|
|
1581
|
+
e.icon && l({ class: "w-16 h-16 mb-2 text-primary" }, [
|
|
1582
1582
|
g(e.icon)
|
|
1583
1583
|
])
|
|
1584
1584
|
]),
|
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-DqbqL8Wo.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-DqbqL8Wo.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