@base-framework/ui 1.0.171 → 1.0.1723

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: r, bgColor: l, iconColor: i } = P[o] || P.default;
38
- return n({ class: `flex items-start p-4 border rounded-lg ${l} ${r}` }, [
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: (s, o) => {
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 r = U(t, (l) => {
180
- l.target.checkValidity() && e.setError(null);
181
- }, (l) => {
182
- e.setError(l.target.validationMessage);
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
- }, r);
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, r = (l) => {
210
- this.state.error = l, this.state.hasError = !!l;
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: r
217
+ setError: l
220
218
  }, this.children),
221
219
  o && ye({ id: this.getId("description") }, o),
222
- n({ onState: ["error", (l) => l && ve(l)] })
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: r = [] }) => B({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10" }, [
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: (l, i) => i.close() }),
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
- ...r
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: (r) => {
296
- this.onSubmit && this.onSubmit(r), this.destroy();
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,
@@ -401,6 +400,14 @@ class yt extends p {
401
400
  open() {
402
401
  $e(this), this.showModal();
403
402
  }
403
+ /**
404
+ * This will destroy the modal.
405
+ *
406
+ * @returns {void}
407
+ */
408
+ close() {
409
+ this.destroy();
410
+ }
404
411
  /**
405
412
  * This will show the modal.
406
413
  *
@@ -480,14 +487,14 @@ class Le extends ce {
480
487
  * @returns {object}
481
488
  */
482
489
  render() {
483
- const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), r = this.href || null, l = this.getChildren(o);
484
- return r ? Be({
485
- href: r,
490
+ const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), l = this.href || null, r = this.getChildren(o);
491
+ return l ? Be({
492
+ href: l,
486
493
  class: `${t} ${s}`
487
- }, l) : Me({
494
+ }, r) : Me({
488
495
  close: this.close.bind(this),
489
496
  class: `${t} ${s}`
490
- }, l);
497
+ }, r);
491
498
  }
492
499
  /**
493
500
  * This will be called after the component is set up.
@@ -596,8 +603,8 @@ const N = globalThis.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
596
603
  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
604
  onState: ["method", { active: e }],
598
605
  dataSet: ["method", ["state", e, "active"]],
599
- click: (o, { state: r }) => {
600
- r.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), Fe(e);
606
+ click: (o, { state: l }) => {
607
+ l.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), Fe(e);
601
608
  }
602
609
  }, [
603
610
  x(s),
@@ -780,8 +787,8 @@ const N = globalThis.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
780
787
  "bg-primary": e,
781
788
  "shadow-md": e
782
789
  }],
783
- click: (s, { data: o, onClick: r }) => {
784
- o.activeIndex = e, r && r(e);
790
+ click: (s, { data: o, onClick: l }) => {
791
+ o.activeIndex = e, l && l(e);
785
792
  }
786
793
  })
787
794
  ]), Ye = (e, t) => Array.from({ length: e }, (s, o) => Ve({
@@ -840,10 +847,10 @@ const N = globalThis.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
840
847
  ]), _e = ({ onSelect: e, state: t }) => n({ class: "flex flex-auto flex-col" }, [
841
848
  v(
842
849
  "open",
843
- (s, o, r) => s ? new D({
850
+ (s, o, l) => s ? new D({
844
851
  cache: "dropdown",
845
- parent: r,
846
- button: r.button
852
+ parent: l,
853
+ button: l.button
847
854
  }, [
848
855
  qe(e, t)
849
856
  ]) : null
@@ -964,11 +971,11 @@ const N = globalThis.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
964
971
  icon: u.circlePlus,
965
972
  click: e,
966
973
  ariaLabel: "Increment"
967
- }), Ge = ({ bind: e, min: t, max: s, readonly: o = !1 }) => Q(({ state: r }) => C({
968
- value: ["[[count]]", r],
974
+ }), Ge = ({ bind: e, min: t, max: s, readonly: o = !1 }) => Q(({ state: l }) => C({
975
+ value: ["[[count]]", l],
969
976
  bind: e,
970
- blur: (l, { state: i }) => {
971
- let d = parseInt(l.target.value, 10);
977
+ blur: (r, { state: i }) => {
978
+ let d = parseInt(r.target.value, 10);
972
979
  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
980
  },
974
981
  class: "flex flex-auto text-lg font-medium bg-transparent text-center border min-w-0",
@@ -1027,14 +1034,14 @@ const N = globalThis.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
1027
1034
  g({ html: u.calendar.days })
1028
1035
  ]), Qe = ({ handleDateSelect: e, blockPriorDates: t }) => v(
1029
1036
  "open",
1030
- (s, o, r) => s ? new D({
1037
+ (s, o, l) => s ? new D({
1031
1038
  cache: "dropdown",
1032
- parent: r,
1033
- button: r.panel,
1039
+ parent: l,
1040
+ button: l.panel,
1034
1041
  size: "fit"
1035
1042
  }, [
1036
1043
  new se({
1037
- selectedDate: r.state.selectedDate,
1044
+ selectedDate: l.state.selectedDate,
1038
1045
  selectedCallBack: e,
1039
1046
  blockPriorDates: t
1040
1047
  })
@@ -1087,8 +1094,8 @@ const N = globalThis.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
1087
1094
  new re({
1088
1095
  dateTime: e,
1089
1096
  filter: s || ((o) => {
1090
- const r = $.getLocalTime(o, !0, !1, t);
1091
- return $.getTimeFrame(r);
1097
+ const l = $.getLocalTime(o, !0, !1, t);
1098
+ return $.getTimeFrame(l);
1092
1099
  })
1093
1100
  })
1094
1101
  ]);
@@ -1115,11 +1122,11 @@ function Ze({ bind: e, required: t, toggleOpen: s }) {
1115
1122
  ]
1116
1123
  );
1117
1124
  }
1118
- function T({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: r = !1 }) {
1125
+ function T({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: l = !1 }) {
1119
1126
  return n(
1120
1127
  { class: "flex flex-col max-h-[200px] overflow-y-auto" },
1121
- e.map((l) => {
1122
- let i = r ? l.toString().padStart(2, "0") : l.toString();
1128
+ e.map((r) => {
1129
+ let i = l ? r.toString().padStart(2, "0") : r.toString();
1123
1130
  return m({
1124
1131
  text: i,
1125
1132
  class: "hover:bg-muted/50 rounded-md px-2 py-1",
@@ -1151,7 +1158,7 @@ function et({ handleTimeSelect: e }) {
1151
1158
  [
1152
1159
  // Hours column
1153
1160
  T({
1154
- items: Array.from({ length: 12 }, (r, l) => l + 1),
1161
+ items: Array.from({ length: 12 }, (l, r) => r + 1),
1155
1162
  handleTimeSelect: e,
1156
1163
  state: o.state,
1157
1164
  stateValue: "hour",
@@ -1159,7 +1166,7 @@ function et({ handleTimeSelect: e }) {
1159
1166
  }),
1160
1167
  // Minutes column
1161
1168
  T({
1162
- items: Array.from({ length: 60 }, (r, l) => l),
1169
+ items: Array.from({ length: 60 }, (l, r) => r),
1163
1170
  handleTimeSelect: e,
1164
1171
  state: o.state,
1165
1172
  stateValue: "minute",
@@ -1188,11 +1195,11 @@ function E(e) {
1188
1195
  const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
1189
1196
  if (!s)
1190
1197
  return { hour: null, minute: null, meridian: null };
1191
- let [, o, r, , l] = s, i = parseInt(o, 10), d = parseInt(r, 10);
1192
- return i < 0 || i > 23 || d < 0 || d > 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), {
1198
+ let [, o, l, , r] = s, i = parseInt(o, 10), d = parseInt(l, 10);
1199
+ 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
1200
  hour: i.toString().padStart(2, "0"),
1194
1201
  minute: d.toString().padStart(2, "0"),
1195
- meridian: l
1202
+ meridian: r
1196
1203
  });
1197
1204
  }
1198
1205
  const Lt = w(
@@ -1234,10 +1241,10 @@ const Lt = w(
1234
1241
  * @returns {object}
1235
1242
  */
1236
1243
  render() {
1237
- const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian: r }) => {
1238
- 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) {
1239
- const l = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
1240
- this.state.selectedTime = l, this.state.open = !1, this.input.value = l, typeof this.change == "function" && this.change(l);
1244
+ const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian: l }) => {
1245
+ 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) {
1246
+ const r = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
1247
+ this.state.selectedTime = r, this.state.open = !1, this.input.value = r, typeof this.change == "function" && this.change(r);
1241
1248
  }
1242
1249
  };
1243
1250
  return n(
@@ -1325,13 +1332,13 @@ class rt extends p {
1325
1332
  render() {
1326
1333
  const t = (d) => {
1327
1334
  d.target === this.panel && this.close();
1328
- }, { borderColor: s, bgColor: o, iconColor: r } = j[this.type] || j.default, l = `${this.getMainClass()} ${o} ${s}`, i = this.title || "Dialog Title";
1335
+ }, { borderColor: s, bgColor: o, iconColor: l } = j[this.type] || j.default, r = `${this.getMainClass()} ${o} ${s}`, i = this.title || "Dialog Title";
1329
1336
  return ot({
1330
- class: l,
1337
+ class: r,
1331
1338
  title: i,
1332
1339
  click: t,
1333
1340
  icon: this.icon,
1334
- iconColor: r,
1341
+ iconColor: l,
1335
1342
  description: this.description,
1336
1343
  buttons: this.getButtons()
1337
1344
  }, 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-DY9zk34b.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-BxmDhBjv.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";
@@ -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-DY9zk34b.js";
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-BxmDhBjv.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,
@@ -113,6 +113,12 @@ export class Modal extends Component {
113
113
  * @returns {void}
114
114
  */
115
115
  open(): void;
116
+ /**
117
+ * This will destroy the modal.
118
+ *
119
+ * @returns {void}
120
+ */
121
+ close(): void;
116
122
  /**
117
123
  * This will show the modal.
118
124
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/ui",
3
- "version": "1.0.171",
3
+ "version": "1.0.1723",
4
4
  "description": "This is a UI package that adds components and atoms that use Tailwind CSS and a theme based on Shadcn.",
5
5
  "main": "./dist/index.es.js",
6
6
  "scripts": {