@base-framework/ui 0.0.12 → 0.0.13
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.
|
@@ -31,15 +31,15 @@ const P = {
|
|
|
31
31
|
bgColor: "bg-muted/10",
|
|
32
32
|
iconColor: "text-muted-foreground"
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, le = (e, t) => n({ class: `flex items-center justify-center h-6 w-6 mr-3 ${t}` }, [
|
|
35
35
|
h({ html: e })
|
|
36
|
-
]),
|
|
37
|
-
const { borderColor:
|
|
38
|
-
return n({ class: `flex items-start p-4 border rounded-lg ${
|
|
36
|
+
]), re = (e) => _({ class: "font-semibold" }, e), ie = (e) => p({ class: "text-sm text-muted-foreground" }, e), ht = c(({ title: e, description: t, icon: s, type: o = "default" }) => {
|
|
37
|
+
const { borderColor: r, bgColor: l, iconColor: i } = P[o] || P.default;
|
|
38
|
+
return n({ class: `flex items-start p-4 border rounded-lg ${l} ${r}` }, [
|
|
39
39
|
// Icon and content
|
|
40
|
-
s &&
|
|
40
|
+
s && le(s, i),
|
|
41
41
|
n({ class: "flex flex-col" }, [
|
|
42
|
-
|
|
42
|
+
re(e),
|
|
43
43
|
ie(t)
|
|
44
44
|
])
|
|
45
45
|
]);
|
|
@@ -174,15 +174,15 @@ const be = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
174
174
|
invalid: s,
|
|
175
175
|
input: t
|
|
176
176
|
} : o)), Ce = c((e, t) => {
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
}, (
|
|
180
|
-
e.setError(
|
|
177
|
+
const r = H(t, (l) => {
|
|
178
|
+
l.target.checkValidity() && e.setError(null);
|
|
179
|
+
}, (l) => {
|
|
180
|
+
e.setError(l.target.validationMessage);
|
|
181
181
|
});
|
|
182
182
|
return n({
|
|
183
183
|
...e,
|
|
184
184
|
class: "w-full"
|
|
185
|
-
},
|
|
185
|
+
}, r);
|
|
186
186
|
}), ft = x(
|
|
187
187
|
{
|
|
188
188
|
/**
|
|
@@ -204,8 +204,8 @@ const be = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
204
204
|
* @returns {object}
|
|
205
205
|
*/
|
|
206
206
|
render() {
|
|
207
|
-
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this,
|
|
208
|
-
this.state.error =
|
|
207
|
+
const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this, r = (l) => {
|
|
208
|
+
this.state.error = l, this.state.hasError = !!l;
|
|
209
209
|
};
|
|
210
210
|
return n({ class: "flex flex-auto space-y-4" }, [
|
|
211
211
|
be([
|
|
@@ -214,10 +214,10 @@ const be = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
214
214
|
id: t,
|
|
215
215
|
name: e,
|
|
216
216
|
value: this.state.value,
|
|
217
|
-
setError:
|
|
217
|
+
setError: r
|
|
218
218
|
}, this.children),
|
|
219
219
|
o && we({ id: this.getId("description") }, o),
|
|
220
|
-
n({ onState: ["error", (
|
|
220
|
+
n({ onState: ["error", (l) => l && ye(l)] })
|
|
221
221
|
])
|
|
222
222
|
]);
|
|
223
223
|
}
|
|
@@ -232,11 +232,11 @@ const be = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
232
232
|
])), bt = (e, t) => n({ class: "flex justify-between" }, [
|
|
233
233
|
a({ class: "text-muted-foreground" }, e),
|
|
234
234
|
a(t)
|
|
235
|
-
]), De = ({ title: e, description: t, back: s, icon: o, options:
|
|
235
|
+
]), De = ({ title: e, description: t, back: s, icon: o, options: r = [] }) => M({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10" }, [
|
|
236
236
|
/**
|
|
237
237
|
* Back Button
|
|
238
238
|
*/
|
|
239
|
-
s && u({ variant: "icon", icon: d.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (
|
|
239
|
+
s && u({ variant: "icon", icon: d.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (l, i) => i.close() }),
|
|
240
240
|
/**
|
|
241
241
|
* Icon
|
|
242
242
|
*/
|
|
@@ -249,7 +249,7 @@ const be = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
|
|
|
249
249
|
B({ class: "text-lg font-semibold m-0" }, e),
|
|
250
250
|
t && n({ class: "text-sm text-muted-foreground" }, t)
|
|
251
251
|
]),
|
|
252
|
-
...
|
|
252
|
+
...r
|
|
253
253
|
])
|
|
254
254
|
]), Ie = c((e, t) => n({
|
|
255
255
|
popover: "manual",
|
|
@@ -271,7 +271,7 @@ class xt extends b {
|
|
|
271
271
|
* @returns {void}
|
|
272
272
|
*/
|
|
273
273
|
declareProps() {
|
|
274
|
-
this.title = null, this.description = null, this.size =
|
|
274
|
+
this.title = null, this.description = null, this.size = null, this.type = null, this.hidePrimaryButton = !1, this.icon = null, this.onSubmit = null, this.onClose = null, this.back = !1;
|
|
275
275
|
}
|
|
276
276
|
/**
|
|
277
277
|
* This will render the modal component.
|
|
@@ -473,14 +473,14 @@ class Me extends ae {
|
|
|
473
473
|
* @returns {object}
|
|
474
474
|
*/
|
|
475
475
|
render() {
|
|
476
|
-
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(),
|
|
477
|
-
return
|
|
478
|
-
href:
|
|
476
|
+
const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), r = this.href || null, l = this.getChildren(o);
|
|
477
|
+
return r ? Be({
|
|
478
|
+
href: r,
|
|
479
479
|
class: `${t} ${s}`
|
|
480
|
-
},
|
|
480
|
+
}, l) : $e({
|
|
481
481
|
close: this.close.bind(this),
|
|
482
482
|
class: `${t} ${s}`
|
|
483
|
-
},
|
|
483
|
+
}, l);
|
|
484
484
|
}
|
|
485
485
|
/**
|
|
486
486
|
* This will be called after the component is set up.
|
|
@@ -589,8 +589,8 @@ const z = window.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
|
|
|
589
589
|
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',
|
|
590
590
|
onState: ["method", { active: e }],
|
|
591
591
|
dataSet: ["method", ["state", e, "active"]],
|
|
592
|
-
click: (o, { state:
|
|
593
|
-
|
|
592
|
+
click: (o, { state: r }) => {
|
|
593
|
+
r.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), Pe(e);
|
|
594
594
|
}
|
|
595
595
|
}, [
|
|
596
596
|
D(s),
|
|
@@ -773,8 +773,8 @@ const z = window.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
|
|
|
773
773
|
"bg-primary": e,
|
|
774
774
|
"shadow-md": e
|
|
775
775
|
}],
|
|
776
|
-
click: (s, { data: o, onClick:
|
|
777
|
-
o.activeIndex = e,
|
|
776
|
+
click: (s, { data: o, onClick: r }) => {
|
|
777
|
+
o.activeIndex = e, r && r(e);
|
|
778
778
|
}
|
|
779
779
|
})
|
|
780
780
|
]), Ve = (e, t) => Array.from({ length: e }, (s, o) => Oe({
|
|
@@ -927,9 +927,9 @@ const z = window.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
|
|
|
927
927
|
}), We = ({ bind: e, min: t, max: s, readonly: o = !1 }) => v({
|
|
928
928
|
value: "[[count]]",
|
|
929
929
|
bind: e,
|
|
930
|
-
blur: (
|
|
931
|
-
let i = parseInt(
|
|
932
|
-
isNaN(i) && (i = t ?? 0), t !== void 0 && (i = Math.max(i, t)), s !== void 0 && (i = Math.min(i, s)),
|
|
930
|
+
blur: (r, { state: l }) => {
|
|
931
|
+
let i = parseInt(r.target.value, 10);
|
|
932
|
+
isNaN(i) && (i = t ?? 0), t !== void 0 && (i = Math.max(i, t)), s !== void 0 && (i = Math.min(i, s)), l.count = i;
|
|
933
933
|
},
|
|
934
934
|
class: "flex flex-auto text-lg font-medium bg-transparent text-center border min-w-0",
|
|
935
935
|
readonly: o,
|
|
@@ -1047,8 +1047,8 @@ const z = window.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
|
|
|
1047
1047
|
new ne({
|
|
1048
1048
|
dateTime: e,
|
|
1049
1049
|
filter: s || ((o) => {
|
|
1050
|
-
const
|
|
1051
|
-
return A.getTimeFrame(
|
|
1050
|
+
const r = A.getLocalTime(o, !0, !1, t);
|
|
1051
|
+
return A.getTimeFrame(r);
|
|
1052
1052
|
})
|
|
1053
1053
|
})
|
|
1054
1054
|
]);
|
|
@@ -1075,11 +1075,11 @@ function Xe({ bind: e, required: t, toggleOpen: s }) {
|
|
|
1075
1075
|
]
|
|
1076
1076
|
);
|
|
1077
1077
|
}
|
|
1078
|
-
function T({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad:
|
|
1078
|
+
function T({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: r = !1 }) {
|
|
1079
1079
|
return n(
|
|
1080
1080
|
{ class: "flex flex-col max-h-[200px] overflow-y-auto" },
|
|
1081
|
-
e.map((
|
|
1082
|
-
let i =
|
|
1081
|
+
e.map((l) => {
|
|
1082
|
+
let i = r ? l.toString().padStart(2, "0") : l.toString();
|
|
1083
1083
|
return m({
|
|
1084
1084
|
text: i,
|
|
1085
1085
|
class: "hover:bg-muted/50 rounded-md px-2 py-1",
|
|
@@ -1111,7 +1111,7 @@ function Ze({ handleTimeSelect: e }) {
|
|
|
1111
1111
|
[
|
|
1112
1112
|
// Hours column
|
|
1113
1113
|
T({
|
|
1114
|
-
items: Array.from({ length: 12 }, (
|
|
1114
|
+
items: Array.from({ length: 12 }, (r, l) => l + 1),
|
|
1115
1115
|
handleTimeSelect: e,
|
|
1116
1116
|
state: o.state,
|
|
1117
1117
|
stateValue: "hour",
|
|
@@ -1119,7 +1119,7 @@ function Ze({ handleTimeSelect: e }) {
|
|
|
1119
1119
|
}),
|
|
1120
1120
|
// Minutes column
|
|
1121
1121
|
T({
|
|
1122
|
-
items: Array.from({ length: 60 }, (
|
|
1122
|
+
items: Array.from({ length: 60 }, (r, l) => l),
|
|
1123
1123
|
handleTimeSelect: e,
|
|
1124
1124
|
state: o.state,
|
|
1125
1125
|
stateValue: "minute",
|
|
@@ -1148,11 +1148,11 @@ function E(e) {
|
|
|
1148
1148
|
const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
|
|
1149
1149
|
if (!s)
|
|
1150
1150
|
return { hour: null, minute: null, meridian: null };
|
|
1151
|
-
let [, o,
|
|
1152
|
-
return i < 0 || i > 23 || g < 0 || g > 59 ? { hour: null, minute: null, meridian: null } : (
|
|
1151
|
+
let [, o, r, , l] = s, i = parseInt(o, 10), g = parseInt(r, 10);
|
|
1152
|
+
return i < 0 || i > 23 || g < 0 || g > 59 ? { hour: null, minute: null, meridian: null } : (l ? (l = l.toUpperCase(), l === "PM" && i < 12 ? i += 12 : l === "AM" && i === 12 && (i = 12)) : i === 0 ? (l = "AM", i = 12) : i < 12 ? l = "AM" : i === 12 ? l = "PM" : (l = "PM", i -= 12), {
|
|
1153
1153
|
hour: i.toString().padStart(2, "0"),
|
|
1154
1154
|
minute: g.toString().padStart(2, "0"),
|
|
1155
|
-
meridian:
|
|
1155
|
+
meridian: l
|
|
1156
1156
|
});
|
|
1157
1157
|
}
|
|
1158
1158
|
const $t = x(
|
|
@@ -1194,10 +1194,10 @@ const $t = x(
|
|
|
1194
1194
|
* @returns {object}
|
|
1195
1195
|
*/
|
|
1196
1196
|
render() {
|
|
1197
|
-
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian:
|
|
1198
|
-
if (s && (this.state.hour = s), o && (this.state.minute = o),
|
|
1199
|
-
const
|
|
1200
|
-
this.state.selectedTime =
|
|
1197
|
+
const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian: r }) => {
|
|
1198
|
+
if (s && (this.state.hour = s), o && (this.state.minute = o), r && (this.state.meridian = r), this.state.hour && this.state.minute && this.state.meridian) {
|
|
1199
|
+
const l = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
|
|
1200
|
+
this.state.selectedTime = l, this.state.open = !1, this.input.value = l, typeof this.change == "function" && this.change(l);
|
|
1201
1201
|
}
|
|
1202
1202
|
};
|
|
1203
1203
|
return n(
|
|
@@ -1285,13 +1285,13 @@ class nt extends b {
|
|
|
1285
1285
|
render() {
|
|
1286
1286
|
const t = (g) => {
|
|
1287
1287
|
g.target === this.panel && this.close();
|
|
1288
|
-
}, { borderColor: s, bgColor: o, iconColor:
|
|
1288
|
+
}, { borderColor: s, bgColor: o, iconColor: r } = j[this.type] || j.default, l = `${this.getMainClass()} ${o} ${s}`, i = this.title || "Dialog Title";
|
|
1289
1289
|
return st({
|
|
1290
|
-
class:
|
|
1290
|
+
class: l,
|
|
1291
1291
|
title: i,
|
|
1292
1292
|
click: t,
|
|
1293
1293
|
icon: this.icon,
|
|
1294
|
-
iconColor:
|
|
1294
|
+
iconColor: r,
|
|
1295
1295
|
description: this.description,
|
|
1296
1296
|
buttons: this.getButtons()
|
|
1297
1297
|
}, this.children);
|
package/dist/index.es.js
CHANGED
|
@@ -3,7 +3,7 @@ import { B as g, I as C, L as T } from "./icon-B9QUT2NY.js";
|
|
|
3
3
|
import { C as D, d as I, D as b, c as S, 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 h, a as y, b as W, U as L, W as A } from "./inputs-O_WkdbI3.js";
|
|
4
4
|
import { V as w, a as U } from "./veil-DSQdR6CM.js";
|
|
5
5
|
import { Icons as R } from "./icons.es.js";
|
|
6
|
-
import { A as G, B as V, C as j, z as q, u as z, v as J, w as _, D as K, j as Q, k as X, G as Y, E as Z, s as $, c as aa, a as sa, b as ea, i as oa, g as ta, e as ra, h as na, F as ia, d as la, f as pa, t as ua, M as ma, l as da, N as ga, P as Ca, p as Ta, q as ca, S as Da, n as Ia, o as ba, T as Sa, x as Ba, y as Pa, m as Fa, r as Ma } from "./confirmation-
|
|
6
|
+
import { A as G, B as V, C as j, z as q, u as z, v as J, w as _, D as K, j as Q, k as X, G as Y, E as Z, s as $, c as aa, a as sa, b as ea, i as oa, g as ta, e as ra, h as na, F as ia, d as la, f as pa, t as ua, M as ma, l as da, N as ga, P as Ca, p as Ta, q as ca, S as Da, n as Ia, o as ba, T as Sa, x as Ba, y as Pa, m as Fa, r as Ma } from "./confirmation-BqQwYCFz.js";
|
|
7
7
|
import { A as Na, b as va, C as fa, D as xa, a as ha, F as ya, M as Wa, P as La, c as Aa, g as Ha, p as wa } from "./calendar-B5TK6tLi.js";
|
|
8
8
|
import { B as Oa, m as Ra, C as Ea, j as Ga, D as Va, l as ja, H as qa, I as za, N as Ja, O as _a, P as Ka, S as Qa, p as Xa, n as Ya, o as Za, T as $a, k as as, U as ss, W as es, f as os, h as ts, i as rs, c as ns, d as is, b as ls, e as ps, a as us, g as ms } from "./tab-BjiQGl_0.js";
|
|
9
9
|
import { B as gs, I as Cs, M as Ts, d as cs, e as Ds, g as Is, N as bs, b as Ss, a as Bs, f as Ps, P as Fs, c as Ms, S as ks, T as Ns } from "./mobile-nav-wrapper-CguousG5.js";
|
package/dist/molecules.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as o, B as t, C as e, z as i, u as r, v as n, w as m, D as l, j as S, k as D, G as c, E as u, s as d, c as g, a as p, b as C, i as F, g as T, e as A, h as P, F as f, d as b, f as w, t as B, M as I, l as M, N as x, P as y, p as k, q as v, S as N, n as h, o as E, T as L, x as U, y as j, m as q, r as z } from "./confirmation-
|
|
1
|
+
import { A as o, B as t, C as e, z as i, u as r, v as n, w as m, D as l, j as S, k as D, G as c, E as u, s as d, c as g, a as p, b as C, i as F, g as T, e as A, h as P, F as f, d as b, f as w, t as B, M as I, l as M, N as x, P as y, p as k, q as v, S as N, n as h, o as E, T as L, x as U, y as j, m as q, r as z } from "./confirmation-BqQwYCFz.js";
|
|
2
2
|
import { A as O, P as R, g as _ } from "./calendar-B5TK6tLi.js";
|
|
3
3
|
export {
|
|
4
4
|
o as Alert,
|
|
@@ -17,18 +17,18 @@ export class Modal extends Component {
|
|
|
17
17
|
*/
|
|
18
18
|
description: any;
|
|
19
19
|
/**
|
|
20
|
-
* @member {string} size
|
|
21
|
-
* @default
|
|
20
|
+
* @member {string|null} size
|
|
21
|
+
* @default null
|
|
22
22
|
* @values 'sm', 'md', 'lg', 'xl'
|
|
23
23
|
*/
|
|
24
|
-
size:
|
|
24
|
+
size: any;
|
|
25
25
|
/**
|
|
26
|
-
* @member {string} type
|
|
27
|
-
* @default
|
|
26
|
+
* @member {string|null} type
|
|
27
|
+
* @default null
|
|
28
28
|
* @values 'right', 'left'
|
|
29
29
|
* @description This will set the type of modal.
|
|
30
30
|
*/
|
|
31
|
-
type:
|
|
31
|
+
type: any;
|
|
32
32
|
/**
|
|
33
33
|
* @member {boolean} hidePrimaryButton
|
|
34
34
|
* @default false
|
package/package.json
CHANGED