@base-framework/ui 1.0.171 → 1.0.172
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.
|
@@ -34,8 +34,8 @@ const P = {
|
|
|
34
34
|
}, le = (e, t) => n({ class: `flex items-center justify-center h-6 w-6 mr-3 ${t}` }, [
|
|
35
35
|
g({ html: e })
|
|
36
36
|
]), ie = (e) => _({ class: "font-semibold" }, e), ae = (e) => b({ class: "text-sm text-muted-foreground" }, e), mt = c(({ title: e, description: t, icon: s, type: o = "default" }) => {
|
|
37
|
-
const { borderColor:
|
|
38
|
-
return n({ class: `flex items-start p-4 border rounded-lg ${
|
|
37
|
+
const { borderColor: l, bgColor: r, iconColor: i } = P[o] || P.default;
|
|
38
|
+
return n({ class: `flex items-start p-4 border rounded-lg ${r} ${l}` }, [
|
|
39
39
|
// Icon and content
|
|
40
40
|
s && le(s, i),
|
|
41
41
|
n({ class: "flex flex-col" }, [
|
|
@@ -70,9 +70,7 @@ class ce extends p {
|
|
|
70
70
|
}
|
|
71
71
|
const de = (e) => a({ class: "ml-auto text-xs tracking-widest opacity-60" }, e), ue = (e) => a({ class: "flex w-4 h-4", html: e }), he = (e) => a({ class: "flex-auto" }, e), me = (e, t) => O({
|
|
72
72
|
class: "relative flex cursor-pointer hover:bg-muted/50 select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
73
|
-
click: (
|
|
74
|
-
e.click && e.click(s, o), t(e);
|
|
75
|
-
}
|
|
73
|
+
click: () => t(e)
|
|
76
74
|
}, [
|
|
77
75
|
e.icon && ue(e.icon),
|
|
78
76
|
he(e.label),
|
|
@@ -176,15 +174,15 @@ const xe = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
176
174
|
invalid: s,
|
|
177
175
|
input: t
|
|
178
176
|
} : o)), ke = c((e, t) => {
|
|
179
|
-
const
|
|
180
|
-
|
|
181
|
-
}, (
|
|
182
|
-
e.setError(
|
|
177
|
+
const l = U(t, (r) => {
|
|
178
|
+
r.target.checkValidity() && e.setError(null);
|
|
179
|
+
}, (r) => {
|
|
180
|
+
e.setError(r.target.validationMessage);
|
|
183
181
|
});
|
|
184
182
|
return n({
|
|
185
183
|
...e,
|
|
186
184
|
class: "w-full"
|
|
187
|
-
},
|
|
185
|
+
}, l);
|
|
188
186
|
}), gt = w(
|
|
189
187
|
{
|
|
190
188
|
/**
|
|
@@ -206,8 +204,8 @@ const xe = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
206
204
|
* @returns {object}
|
|
207
205
|
*/
|
|
208
206
|
render() {
|
|
209
|
-
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this,
|
|
210
|
-
this.state.error =
|
|
207
|
+
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this, l = (r) => {
|
|
208
|
+
this.state.error = r, this.state.hasError = !!r;
|
|
211
209
|
};
|
|
212
210
|
return n({ class: "flex flex-auto space-y-4" }, [
|
|
213
211
|
xe([
|
|
@@ -216,10 +214,10 @@ const xe = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
216
214
|
id: t,
|
|
217
215
|
name: e,
|
|
218
216
|
value: this.state.value,
|
|
219
|
-
setError:
|
|
217
|
+
setError: l
|
|
220
218
|
}, this.children),
|
|
221
219
|
o && ye({ id: this.getId("description") }, o),
|
|
222
|
-
n({ onState: ["error", (
|
|
220
|
+
n({ onState: ["error", (r) => r && ve(r)] })
|
|
223
221
|
])
|
|
224
222
|
]);
|
|
225
223
|
}
|
|
@@ -237,11 +235,11 @@ const xe = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
237
235
|
]), wt = (e, t) => n({ class: "flex" }, [
|
|
238
236
|
a({ class: "text-muted-foreground mr-8 w-24 truncate text-nowrap" }, e),
|
|
239
237
|
a(t)
|
|
240
|
-
]), Ie = ({ title: e, description: t, back: s, icon: o, options:
|
|
238
|
+
]), Ie = ({ title: e, description: t, back: s, icon: o, options: l = [] }) => B({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10" }, [
|
|
241
239
|
/**
|
|
242
240
|
* Back Button
|
|
243
241
|
*/
|
|
244
|
-
s && h({ variant: "icon", icon: u.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (
|
|
242
|
+
s && h({ variant: "icon", icon: u.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (r, i) => i.close() }),
|
|
245
243
|
/**
|
|
246
244
|
* Icon
|
|
247
245
|
*/
|
|
@@ -254,7 +252,7 @@ const xe = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
254
252
|
A({ class: "text-lg font-semibold m-0 truncate" }, e),
|
|
255
253
|
t && n({ class: "text-sm text-muted-foreground truncate" }, t)
|
|
256
254
|
]),
|
|
257
|
-
...
|
|
255
|
+
...l
|
|
258
256
|
])
|
|
259
257
|
]), Te = c((e, t) => n({
|
|
260
258
|
popover: "manual",
|
|
@@ -292,8 +290,9 @@ class yt extends p {
|
|
|
292
290
|
description: o,
|
|
293
291
|
options: this.headerOptions(),
|
|
294
292
|
buttons: this.getButtons(),
|
|
295
|
-
onSubmit: (
|
|
296
|
-
|
|
293
|
+
onSubmit: (l) => {
|
|
294
|
+
let r = !0;
|
|
295
|
+
this.onSubmit && (r = this.onSubmit(l)), r !== !1 && this.destroy();
|
|
297
296
|
},
|
|
298
297
|
icon: this.icon,
|
|
299
298
|
back: this.back ?? !1,
|
|
@@ -480,14 +479,14 @@ class Le extends ce {
|
|
|
480
479
|
* @returns {object}
|
|
481
480
|
*/
|
|
482
481
|
render() {
|
|
483
|
-
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(),
|
|
484
|
-
return
|
|
485
|
-
href:
|
|
482
|
+
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), l = this.href || null, r = this.getChildren(o);
|
|
483
|
+
return l ? Be({
|
|
484
|
+
href: l,
|
|
486
485
|
class: `${t} ${s}`
|
|
487
|
-
},
|
|
486
|
+
}, r) : Me({
|
|
488
487
|
close: this.close.bind(this),
|
|
489
488
|
class: `${t} ${s}`
|
|
490
|
-
},
|
|
489
|
+
}, r);
|
|
491
490
|
}
|
|
492
491
|
/**
|
|
493
492
|
* This will be called after the component is set up.
|
|
@@ -596,8 +595,8 @@ const N = globalThis.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
|
|
|
596
595
|
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',
|
|
597
596
|
onState: ["method", { active: e }],
|
|
598
597
|
dataSet: ["method", ["state", e, "active"]],
|
|
599
|
-
click: (o, { state:
|
|
600
|
-
|
|
598
|
+
click: (o, { state: l }) => {
|
|
599
|
+
l.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), Fe(e);
|
|
601
600
|
}
|
|
602
601
|
}, [
|
|
603
602
|
x(s),
|
|
@@ -780,8 +779,8 @@ const N = globalThis.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
|
|
|
780
779
|
"bg-primary": e,
|
|
781
780
|
"shadow-md": e
|
|
782
781
|
}],
|
|
783
|
-
click: (s, { data: o, onClick:
|
|
784
|
-
o.activeIndex = e,
|
|
782
|
+
click: (s, { data: o, onClick: l }) => {
|
|
783
|
+
o.activeIndex = e, l && l(e);
|
|
785
784
|
}
|
|
786
785
|
})
|
|
787
786
|
]), Ye = (e, t) => Array.from({ length: e }, (s, o) => Ve({
|
|
@@ -840,10 +839,10 @@ const N = globalThis.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
|
|
|
840
839
|
]), _e = ({ onSelect: e, state: t }) => n({ class: "flex flex-auto flex-col" }, [
|
|
841
840
|
v(
|
|
842
841
|
"open",
|
|
843
|
-
(s, o,
|
|
842
|
+
(s, o, l) => s ? new D({
|
|
844
843
|
cache: "dropdown",
|
|
845
|
-
parent:
|
|
846
|
-
button:
|
|
844
|
+
parent: l,
|
|
845
|
+
button: l.button
|
|
847
846
|
}, [
|
|
848
847
|
qe(e, t)
|
|
849
848
|
]) : null
|
|
@@ -964,11 +963,11 @@ const N = globalThis.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
|
|
|
964
963
|
icon: u.circlePlus,
|
|
965
964
|
click: e,
|
|
966
965
|
ariaLabel: "Increment"
|
|
967
|
-
}), Ge = ({ bind: e, min: t, max: s, readonly: o = !1 }) => Q(({ state:
|
|
968
|
-
value: ["[[count]]",
|
|
966
|
+
}), Ge = ({ bind: e, min: t, max: s, readonly: o = !1 }) => Q(({ state: l }) => C({
|
|
967
|
+
value: ["[[count]]", l],
|
|
969
968
|
bind: e,
|
|
970
|
-
blur: (
|
|
971
|
-
let d = parseInt(
|
|
969
|
+
blur: (r, { state: i }) => {
|
|
970
|
+
let d = parseInt(r.target.value, 10);
|
|
972
971
|
isNaN(d) && (d = t ?? 0), t !== void 0 && (d = Math.max(d, t)), s !== void 0 && (d = Math.min(d, s)), i.count = d;
|
|
973
972
|
},
|
|
974
973
|
class: "flex flex-auto text-lg font-medium bg-transparent text-center border min-w-0",
|
|
@@ -1027,14 +1026,14 @@ const N = globalThis.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1027
1026
|
g({ html: u.calendar.days })
|
|
1028
1027
|
]), Qe = ({ handleDateSelect: e, blockPriorDates: t }) => v(
|
|
1029
1028
|
"open",
|
|
1030
|
-
(s, o,
|
|
1029
|
+
(s, o, l) => s ? new D({
|
|
1031
1030
|
cache: "dropdown",
|
|
1032
|
-
parent:
|
|
1033
|
-
button:
|
|
1031
|
+
parent: l,
|
|
1032
|
+
button: l.panel,
|
|
1034
1033
|
size: "fit"
|
|
1035
1034
|
}, [
|
|
1036
1035
|
new se({
|
|
1037
|
-
selectedDate:
|
|
1036
|
+
selectedDate: l.state.selectedDate,
|
|
1038
1037
|
selectedCallBack: e,
|
|
1039
1038
|
blockPriorDates: t
|
|
1040
1039
|
})
|
|
@@ -1087,8 +1086,8 @@ const N = globalThis.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1087
1086
|
new re({
|
|
1088
1087
|
dateTime: e,
|
|
1089
1088
|
filter: s || ((o) => {
|
|
1090
|
-
const
|
|
1091
|
-
return $.getTimeFrame(
|
|
1089
|
+
const l = $.getLocalTime(o, !0, !1, t);
|
|
1090
|
+
return $.getTimeFrame(l);
|
|
1092
1091
|
})
|
|
1093
1092
|
})
|
|
1094
1093
|
]);
|
|
@@ -1115,11 +1114,11 @@ function Ze({ bind: e, required: t, toggleOpen: s }) {
|
|
|
1115
1114
|
]
|
|
1116
1115
|
);
|
|
1117
1116
|
}
|
|
1118
|
-
function T({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad:
|
|
1117
|
+
function T({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: l = !1 }) {
|
|
1119
1118
|
return n(
|
|
1120
1119
|
{ class: "flex flex-col max-h-[200px] overflow-y-auto" },
|
|
1121
|
-
e.map((
|
|
1122
|
-
let i =
|
|
1120
|
+
e.map((r) => {
|
|
1121
|
+
let i = l ? r.toString().padStart(2, "0") : r.toString();
|
|
1123
1122
|
return m({
|
|
1124
1123
|
text: i,
|
|
1125
1124
|
class: "hover:bg-muted/50 rounded-md px-2 py-1",
|
|
@@ -1151,7 +1150,7 @@ function et({ handleTimeSelect: e }) {
|
|
|
1151
1150
|
[
|
|
1152
1151
|
// Hours column
|
|
1153
1152
|
T({
|
|
1154
|
-
items: Array.from({ length: 12 }, (
|
|
1153
|
+
items: Array.from({ length: 12 }, (l, r) => r + 1),
|
|
1155
1154
|
handleTimeSelect: e,
|
|
1156
1155
|
state: o.state,
|
|
1157
1156
|
stateValue: "hour",
|
|
@@ -1159,7 +1158,7 @@ function et({ handleTimeSelect: e }) {
|
|
|
1159
1158
|
}),
|
|
1160
1159
|
// Minutes column
|
|
1161
1160
|
T({
|
|
1162
|
-
items: Array.from({ length: 60 }, (
|
|
1161
|
+
items: Array.from({ length: 60 }, (l, r) => r),
|
|
1163
1162
|
handleTimeSelect: e,
|
|
1164
1163
|
state: o.state,
|
|
1165
1164
|
stateValue: "minute",
|
|
@@ -1188,11 +1187,11 @@ function E(e) {
|
|
|
1188
1187
|
const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
|
|
1189
1188
|
if (!s)
|
|
1190
1189
|
return { hour: null, minute: null, meridian: null };
|
|
1191
|
-
let [, o,
|
|
1192
|
-
return i < 0 || i > 23 || d < 0 || d > 59 ? { hour: null, minute: null, meridian: null } : (
|
|
1190
|
+
let [, o, l, , r] = s, i = parseInt(o, 10), d = parseInt(l, 10);
|
|
1191
|
+
return i < 0 || i > 23 || d < 0 || d > 59 ? { hour: null, minute: null, meridian: null } : (r ? (r = r.toUpperCase(), r === "PM" && i < 12 ? i += 12 : r === "AM" && i === 12 && (i = 12)) : i === 0 ? (r = "AM", i = 12) : i < 12 ? r = "AM" : i === 12 ? r = "PM" : (r = "PM", i -= 12), {
|
|
1193
1192
|
hour: i.toString().padStart(2, "0"),
|
|
1194
1193
|
minute: d.toString().padStart(2, "0"),
|
|
1195
|
-
meridian:
|
|
1194
|
+
meridian: r
|
|
1196
1195
|
});
|
|
1197
1196
|
}
|
|
1198
1197
|
const Lt = w(
|
|
@@ -1234,10 +1233,10 @@ const Lt = w(
|
|
|
1234
1233
|
* @returns {object}
|
|
1235
1234
|
*/
|
|
1236
1235
|
render() {
|
|
1237
|
-
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian:
|
|
1238
|
-
if (s && (this.state.hour = s), o && (this.state.minute = o),
|
|
1239
|
-
const
|
|
1240
|
-
this.state.selectedTime =
|
|
1236
|
+
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian: l }) => {
|
|
1237
|
+
if (s && (this.state.hour = s), o && (this.state.minute = o), l && (this.state.meridian = l), this.state.hour && this.state.minute && this.state.meridian) {
|
|
1238
|
+
const r = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
|
|
1239
|
+
this.state.selectedTime = r, this.state.open = !1, this.input.value = r, typeof this.change == "function" && this.change(r);
|
|
1241
1240
|
}
|
|
1242
1241
|
};
|
|
1243
1242
|
return n(
|
|
@@ -1325,13 +1324,13 @@ class rt extends p {
|
|
|
1325
1324
|
render() {
|
|
1326
1325
|
const t = (d) => {
|
|
1327
1326
|
d.target === this.panel && this.close();
|
|
1328
|
-
}, { borderColor: s, bgColor: o, iconColor:
|
|
1327
|
+
}, { borderColor: s, bgColor: o, iconColor: l } = j[this.type] || j.default, r = `${this.getMainClass()} ${o} ${s}`, i = this.title || "Dialog Title";
|
|
1329
1328
|
return ot({
|
|
1330
|
-
class:
|
|
1329
|
+
class: r,
|
|
1331
1330
|
title: i,
|
|
1332
1331
|
click: t,
|
|
1333
1332
|
icon: this.icon,
|
|
1334
|
-
iconColor:
|
|
1333
|
+
iconColor: l,
|
|
1335
1334
|
description: this.description,
|
|
1336
1335
|
buttons: this.getButtons()
|
|
1337
1336
|
}, this.children);
|
package/dist/index.es.js
CHANGED
|
@@ -3,7 +3,7 @@ import { B as g, I as T, L as c } from "./buttons-Cm9etaEG.js";
|
|
|
3
3
|
import { C as D, d as b, D as S, c as I, E as B, F as P, H as F, I as M, M as k, N, P as v, R as f, S as x, T as y, a as h, b as W, U as H, W as L } from "./inputs-Dmu4Z-7-.js";
|
|
4
4
|
import { V as w, a as U } from "./veil-D4dRxILB.js";
|
|
5
5
|
import { Icons as O } from "./icons.es.js";
|
|
6
|
-
import { A as G, B as V, C as j, t as q, E as z, v as J, w as _, x as K, D as Q, j as X, k as Y, H as Z, G as $, s as aa, c as sa, a as ea, b as oa, i as ta, g as ra, e as na, h as ia, F as la, d as pa, f as ua, u as ma, M as da, l as ga, N as Ta, P as ca, p as Ca, q as Da, S as ba, n as Sa, o as Ia, T as Ba, y as Pa, z as Fa, m as Ma, r as ka } from "./confirmation-
|
|
6
|
+
import { A as G, B as V, C as j, t as q, E as z, v as J, w as _, x as K, D as Q, j as X, k as Y, H as Z, G as $, s as aa, c as sa, a as ea, b as oa, i as ta, g as ra, e as na, h as ia, F as la, d as pa, f as ua, u as ma, M as da, l as ga, N as Ta, P as ca, p as Ca, q as Da, S as ba, n as Sa, o as Ia, T as Ba, y as Pa, z as Fa, m as Ma, r as ka } from "./confirmation-uvsQJos7.js";
|
|
7
7
|
import { A as va, b as fa, C as xa, D as ya, a as ha, F as Wa, M as Ha, P as La, c as Aa, g as wa, p as Ua } from "./calendar-DQXME-2u.js";
|
|
8
8
|
import { B as Oa, o as Ea, C as Ga, j as Va, D as ja, m as qa, k as za, H as Ja, I as _a, N as Ka, O as Qa, P as Xa, S as Ya, n as Za, s as $a, r as as, p as ss, q as es, T as os, l as ts, U as rs, W as ns, f as is, h as ls, i as ps, c as us, d as ms, b as ds, e as gs, a as Ts, g as cs } from "./signature-panel-BMKPAG1c.js";
|
|
9
9
|
import { B as Ds, I as bs, M as Ss, d as Is, e as Bs, g as Ps, N as Fs, b as Ms, a as ks, f as Ns, P as vs, c as fs, S as xs, T as ys } from "./mobile-nav-wrapper-Dj67Pb8l.js";
|
package/dist/molecules.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as o, B as t, C as e, t as i, E as r, v as n, w as m, x as l, D as S, j as u, k as D, H as c, G as C, s as d, c as g, a as p, b as F, i as T, g as A, e as P, h as f, F as w, d as b, f as B, u as I, M, l as x, N as y, P as k, p as v, q as N, S as h, n as E, o as L, T as R, y as U, z as j, m as q, r as z } from "./confirmation-
|
|
1
|
+
import { A as o, B as t, C as e, t as i, E as r, v as n, w as m, x as l, D as S, j as u, k as D, H as c, G as C, s as d, c as g, a as p, b as F, i as T, g as A, e as P, h as f, F as w, d as b, f as B, u as I, M, l as x, N as y, P as k, p as v, q as N, S as h, n as E, o as L, T as R, y as U, z as j, m as q, r as z } from "./confirmation-uvsQJos7.js";
|
|
2
2
|
import { A as H, P as O, g as _ } from "./calendar-DQXME-2u.js";
|
|
3
3
|
export {
|
|
4
4
|
o as Alert,
|
package/package.json
CHANGED