@base-framework/ui 1.1.2 → 1.1.4

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,8 +1,8 @@
1
- import { Div as n, H5 as Z, P as b, I as x, Li as H, Span as a, Ul as q, Button as f, OnState as T, Label as P, H2 as S, Form as tt, Header as I, Footer as L, A as V, H3 as et, Checkbox as st, Input as m, Img as G, Nav as ot, UseParent as W, OnStateOpen as O, Time as nt, Dialog as it } from "@base-framework/atoms";
2
- import { Atom as c, Component as w, Html as A, Dom as rt, base as lt, Data as B, Builder as _, Jot as C, Events as p, DateTime as M } from "@base-framework/base";
3
- import { P as D, b as at, R as ct } from "./range-calendar-CAwPjNM3.js";
1
+ import { Div as n, I as b, H5 as Z, P as x, Li as H, Span as a, Ul as q, Button as f, OnState as I, Label as P, H2 as S, Form as tt, Header as T, Footer as L, A as V, H3 as et, Checkbox as st, Input as m, Img as G, Nav as ot, UseParent as W, OnStateOpen as O, Time as nt, Dialog as it } from "@base-framework/atoms";
2
+ import { Atom as c, Component as w, Html as A, Dom as lt, base as rt, Data as B, Builder as _, Jot as C, Events as g, DateTime as M } from "@base-framework/base";
3
+ import { P as D, C as at, R as ct } from "./range-calendar-BH4jZwwg.js";
4
4
  import { C as dt, F as ut } from "./form-group-BB7dLJir.js";
5
- import { B as h, I as g } from "./buttons-CfwtbIR-.js";
5
+ import { B as h, I as p } from "./buttons-CfwtbIR-.js";
6
6
  import { Icons as u } from "./icons.es.js";
7
7
  import { Timer as ht, List as mt, DynamicTime as ft } from "@base-framework/organisms";
8
8
  import { a as v } from "./image-BB__4s0g.js";
@@ -33,15 +33,15 @@ const z = {
33
33
  bgColor: "bg-muted/10",
34
34
  iconColor: "text-muted-foreground"
35
35
  }
36
- }, gt = (t, e) => n({ class: `flex items-center justify-center h-6 w-6 mr-3 ${e}` }, [
37
- x({ html: t })
38
- ]), pt = (t) => Z({ class: "font-semibold" }, t), bt = (t) => b({ class: "text-sm text-muted-foreground" }, t), Le = c(({ title: t, description: e, icon: s, type: o = "default" }) => {
39
- const { borderColor: i, bgColor: r, iconColor: l } = z[o] || z.default;
40
- return n({ class: `flex items-start p-4 border rounded-lg ${r} ${i}` }, [
36
+ }, pt = (t, e) => n({ class: `flex items-center justify-center h-6 w-6 mr-3 ${e}` }, [
37
+ b({ html: t })
38
+ ]), gt = (t) => Z({ class: "font-semibold" }, t), bt = (t) => x({ class: "text-sm text-muted-foreground" }, t), Le = c(({ title: t, description: e, icon: s, type: o = "default" }) => {
39
+ const { borderColor: i, bgColor: l, iconColor: r } = z[o] || z.default;
40
+ return n({ class: `flex items-start p-4 border rounded-lg ${l} ${i}` }, [
41
41
  // Icon and content
42
- s && gt(s, l),
42
+ s && pt(s, r),
43
43
  n({ class: "flex flex-col" }, [
44
- pt(t),
44
+ gt(t),
45
45
  bt(e)
46
46
  ])
47
47
  ]);
@@ -67,7 +67,7 @@ class Oe extends w {
67
67
  A.removeElement(e);
68
68
  return;
69
69
  }
70
- rt.addClass(e, s), lt.on("animationend", e, (o) => A.removeElement(e));
70
+ lt.addClass(e, s), rt.on("animationend", e, (o) => A.removeElement(e));
71
71
  }
72
72
  }
73
73
  const xt = (t) => a({ class: "ml-auto text-xs tracking-widest opacity-60" }, t), yt = (t) => a({ class: "flex w-4 h-4", html: t }), wt = (t) => a({ class: "flex-auto" }, t), Ct = (t, e) => H({
@@ -92,9 +92,9 @@ const xt = (t) => a({ class: "ml-auto text-xs tracking-widest opacity-60" }, t),
92
92
  click: s
93
93
  }, [
94
94
  t && a(t),
95
- e && x({ html: e })
95
+ e && b({ html: e })
96
96
  ]), kt = ({ onSelect: t }) => n([
97
- T(
97
+ I(
98
98
  "open",
99
99
  (e, s, o) => e ? new D({
100
100
  cache: "dropdown",
@@ -167,10 +167,18 @@ class Ae extends w {
167
167
  kt({ onSelect: this.handleSelect.bind(this) })
168
168
  ]);
169
169
  }
170
+ /**
171
+ * Cleanup before destroying the component.
172
+ *
173
+ * @returns {void}
174
+ */
175
+ beforeDestroy() {
176
+ this.button = null, this.dropdown = null;
177
+ }
170
178
  }
171
- const Tt = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e)), It = c((t, e) => P({ ...t, class: "flex auto text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" }, e)), Bt = c((t, e) => b({ ...t, class: "text-sm text-muted-foreground italic" }, e)), Ft = c((t, e) => b({ ...t, class: "text-sm text-destructive" }, e)), Ye = c((t, e = []) => dt({ class: "flex flex-auto flex-col gap-y-0", margin: "m-0", padding: "p-0" }, [
179
+ const It = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e)), Tt = c((t, e) => P({ ...t, class: "flex auto text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" }, e)), Bt = c((t, e) => x({ ...t, class: "text-sm text-muted-foreground italic" }, e)), Ft = c((t, e) => x({ ...t, class: "text-sm text-destructive" }, e)), Ye = c((t, e = []) => dt({ class: "flex flex-auto flex-col gap-y-0", margin: "m-0", padding: "p-0" }, [
172
180
  t.title && S({ class: "text-lg font-semibold py-4 px-6" }, t.title),
173
- t.description && b({ class: "text-sm text-muted-foreground pb-4 px-6 max-w-[700px]" }, t.description),
181
+ t.description && x({ class: "text-sm text-muted-foreground pb-4 px-6 max-w-[700px]" }, t.description),
174
182
  ...e
175
183
  ])), ze = c((t, e = []) => ut({ label: t.label, description: t.description, class: "py-4 px-6", border: t.border }, [
176
184
  n({ class: "flex flex-col gap-y-6" }, e)
@@ -185,10 +193,10 @@ const Tt = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e))
185
193
  invalid: s,
186
194
  input: e
187
195
  } : o), Mt = c((t, e) => {
188
- const i = J(e, (r) => {
189
- r.target.checkValidity() && t.setError(null);
190
- }, (r) => {
191
- t.setError(r.target.validationMessage);
196
+ const i = J(e, (l) => {
197
+ l.target.checkValidity() && t.setError(null);
198
+ }, (l) => {
199
+ t.setError(l.target.validationMessage);
192
200
  });
193
201
  return n({
194
202
  ...t,
@@ -215,12 +223,12 @@ const Tt = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e))
215
223
  * @returns {object}
216
224
  */
217
225
  render() {
218
- const t = this.name, e = this.getId(`${t}`), { label: s, description: o } = this, i = (r) => {
219
- this.state.error = r, this.state.hasError = !!r;
226
+ const t = this.name, e = this.getId(`${t}`), { label: s, description: o } = this, i = (l) => {
227
+ this.state.error = l, this.state.hasError = !!l;
220
228
  };
221
229
  return n({ class: "flex flex-auto gap-y-4" }, [
222
- Tt([
223
- It({ htmlFor: e }, s),
230
+ It([
231
+ Tt({ htmlFor: e }, s),
224
232
  Mt({
225
233
  id: e,
226
234
  name: t,
@@ -228,7 +236,7 @@ const Tt = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e))
228
236
  setError: i
229
237
  }, this.children),
230
238
  o && Bt({ id: this.getId("description") }, o),
231
- n({ onState: ["error", (r) => r && Ft(r)] })
239
+ n({ onState: ["error", (l) => l && Ft(l)] })
232
240
  ])
233
241
  ]);
234
242
  }
@@ -246,7 +254,7 @@ const Tt = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e))
246
254
  ]), He = (t, e) => n({ class: "flex" }, [
247
255
  a({ class: "text-muted-foreground mr-8 w-24 truncate text-nowrap" }, t),
248
256
  a(e)
249
- ]), Lt = c(({ title: t, description: e, back: s, icon: o, options: i = [] }) => I({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10 min-w-0" }, [
257
+ ]), Lt = c(({ title: t, description: e, back: s, icon: o, options: i = [] }) => T({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10 min-w-0" }, [
250
258
  /**
251
259
  * Back Button (Mobile Only)
252
260
  */
@@ -254,13 +262,13 @@ const Tt = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e))
254
262
  variant: "icon",
255
263
  icon: u.arrows.left,
256
264
  class: "mr-2 p-0 flex sm:hidden",
257
- click: (r, l) => l.close()
265
+ click: (l, r) => r.close()
258
266
  }),
259
267
  /**
260
268
  * Icon Container
261
269
  */
262
270
  o && n({ class: "mr-2 w-12 h-12 rounded-full bg-muted flex flex-none items-center justify-center" }, [
263
- g({ size: "md" }, o)
271
+ p({ size: "md" }, o)
264
272
  ]),
265
273
  /**
266
274
  * Title and Description Container
@@ -277,13 +285,13 @@ const Tt = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e))
277
285
  return n({
278
286
  popover: "manual",
279
287
  class: `modal ${s ? "" : "m-auto top-0 right-0 bottom-0 left-0"} ${s ? "" : "h-full max-h-screen"} fixed z-20 grid w-full gap-2 lg:border bg-background text-foreground shadow-xl break-words p-0 overflow-y-auto ${t.class}`,
280
- click: (r, l) => {
281
- r.target === l.panel && (r.preventDefault(), r.stopPropagation(), l.state.open = !1);
288
+ click: (l, r) => {
289
+ l.target === r.panel && (l.preventDefault(), l.stopPropagation(), r.state.open = !1);
282
290
  }
283
291
  }, [
284
292
  K({
285
293
  class: "modal-content relative bg-background z-[1] flex flex-auto flex-col gap-y-4 min-w-0",
286
- submit: (r, l) => t.onSubmit && t.onSubmit(l),
294
+ submit: (l, r) => t.onSubmit && t.onSubmit(r),
287
295
  cache: "modalContent",
288
296
  ...t.gestureHandlers
289
297
  }, [
@@ -318,8 +326,8 @@ class At extends w {
318
326
  buttons: this.getButtons(),
319
327
  hideFooter: this.hideFooter,
320
328
  onSubmit: (i) => {
321
- let r = !0;
322
- this.onSubmit && (r = this.onSubmit(i)), r !== !1 && this.destroy();
329
+ let l = !0;
330
+ this.onSubmit && (l = this.onSubmit(i)), l !== !1 && this.destroy();
323
331
  },
324
332
  icon: this.icon,
325
333
  back: this.back ?? !1,
@@ -473,11 +481,11 @@ class Yt {
473
481
  modal: s = null,
474
482
  modalContent: o = null,
475
483
  modalBody: i = null,
476
- closeThreshold: r = 150,
477
- snapThreshold: l = 50,
484
+ closeThreshold: l = 150,
485
+ snapThreshold: r = 50,
478
486
  onClose: d = null
479
487
  } = e;
480
- this.modal = s, this.modalContent = o, this.modalBody = i, this.closeThreshold = r, this.snapThreshold = l, this.onClose = d, this.reset();
488
+ this.modal = s, this.modalContent = o, this.modalBody = i, this.closeThreshold = l, this.snapThreshold = r, this.onClose = d, this.reset();
481
489
  }
482
490
  /**
483
491
  * Resets the drag state to initial values
@@ -529,8 +537,8 @@ class Yt {
529
537
  e.preventDefault();
530
538
  const i = this.calculateTranslateY(o);
531
539
  this.modalContent.style.transform = `translateY(${i}px)`, this.modalContent.style.transition = "none";
532
- const r = this.calculateBackdropOpacity(o);
533
- this.updateBackdropOpacity(r);
540
+ const l = this.calculateBackdropOpacity(o);
541
+ this.updateBackdropOpacity(l);
534
542
  } else this.modalBody.scrollTop > 0 && (this.state.canDrag = !1);
535
543
  }
536
544
  /**
@@ -651,9 +659,9 @@ class qe extends At {
651
659
  options: this.headerOptions(),
652
660
  buttons: this.getButtons(),
653
661
  hideFooter: this.hideFooter,
654
- onSubmit: (r) => {
655
- let l = !0;
656
- this.onSubmit && (l = this.onSubmit(r)), l !== !1 && this.destroy();
662
+ onSubmit: (l) => {
663
+ let r = !0;
664
+ this.onSubmit && (r = this.onSubmit(l)), r !== !1 && this.destroy();
657
665
  },
658
666
  icon: this.icon,
659
667
  back: this.back ?? !1,
@@ -729,7 +737,7 @@ const j = {
729
737
  borderColor: "border",
730
738
  iconColor: "text-muted-foreground"
731
739
  }
732
- }, zt = (t) => I({ class: "flex justify-center" }, [
740
+ }, zt = (t) => T({ class: "flex justify-center" }, [
733
741
  et({ class: "text-lg font-bold mb-0" }, t)
734
742
  ]), jt = c(({ href: t, class: e }, s) => V({
735
743
  class: `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 ${e}`,
@@ -767,14 +775,14 @@ class Nt extends w {
767
775
  * @returns {object}
768
776
  */
769
777
  render() {
770
- const { bgColor: e, borderColor: s, iconColor: o } = this.getTypeStyles(), i = this.href || null, r = this.getChildren(o);
778
+ const { bgColor: e, borderColor: s, iconColor: o } = this.getTypeStyles(), i = this.href || null, l = this.getChildren(o);
771
779
  return i ? jt({
772
780
  href: i,
773
781
  class: `${e} ${s}`
774
- }, r) : Et({
782
+ }, l) : Et({
775
783
  close: this.close.bind(this),
776
784
  class: `${e} ${s}`
777
- }, r);
785
+ }, l);
778
786
  }
779
787
  /**
780
788
  * This will be called after the component is set up.
@@ -816,12 +824,12 @@ class Nt extends w {
816
824
  getChildren(e) {
817
825
  return [
818
826
  n({ class: "flex items-start" }, [
819
- this.icon && x({ class: `mr-4 ${e}`, html: this.icon }),
827
+ this.icon && b({ class: `mr-4 ${e}`, html: this.icon }),
820
828
  n({ class: "flex flex-auto flex-col" }, [
821
829
  n({ class: "flex flex-auto flex-row items-center w-full pr-12" }, [
822
830
  this.title && zt(this.title)
823
831
  ]),
824
- b({ class: "text-base text-muted-foreground m-0 pr-12" }, this.description),
832
+ x({ class: "text-base text-muted-foreground m-0 pr-12" }, this.description),
825
833
  (this.primary || this.secondary) && L({ class: "margin-top-24 flex align-center" }, this.getButtons())
826
834
  ])
827
835
  ]),
@@ -878,6 +886,14 @@ class Ve extends w {
878
886
  removeNotice(e) {
879
887
  this.list.delete(e.id), this.list.isEmpty() && this.panel.hidePopover();
880
888
  }
889
+ /**
890
+ * Cleanup before destroying the component.
891
+ *
892
+ * @returns {void}
893
+ */
894
+ beforeDestroy() {
895
+ this.list = null;
896
+ }
881
897
  }
882
898
  const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
883
899
  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',
@@ -887,7 +903,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
887
903
  i.method = t, localStorage.setItem("theme", t), t === "system" && localStorage.removeItem("theme"), Rt(t);
888
904
  }
889
905
  }, [
890
- g(s),
906
+ p(s),
891
907
  a(e)
892
908
  ])), Rt = (t) => {
893
909
  const e = document.documentElement;
@@ -974,6 +990,14 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
974
990
  onState: ["active", { "translate-x-[22px]": !0, "translate-x-[2px]": !1 }]
975
991
  })
976
992
  ]);
993
+ },
994
+ /**
995
+ * Cleanup before destroying the component.
996
+ *
997
+ * @returns {void}
998
+ */
999
+ destroy() {
1000
+ this.checkbox = null;
977
1001
  }
978
1002
  }
979
1003
  ), k = {
@@ -1016,7 +1040,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1016
1040
  */
1017
1041
  openFileBrowse() {
1018
1042
  const t = this.input;
1019
- t && (t.value = "", p.trigger("click", t));
1043
+ t && (t.value = "", g.trigger("click", t));
1020
1044
  },
1021
1045
  /**
1022
1046
  * Get the URL for the uploaded file.
@@ -1052,11 +1076,11 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1052
1076
  s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
1053
1077
  }
1054
1078
  }, [
1055
- T("loaded", (s) => s === !1 || qt(this.src) ? P({
1079
+ I("loaded", (s) => s === !1 || qt(this.src) ? P({
1056
1080
  htmlFor: t,
1057
1081
  class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
1058
1082
  }, [
1059
- g(u.upload),
1083
+ p(u.upload),
1060
1084
  n("Upload Image")
1061
1085
  ]) : G({
1062
1086
  // @ts-ignore
@@ -1065,6 +1089,14 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1065
1089
  }))
1066
1090
  ])
1067
1091
  ]);
1092
+ },
1093
+ /**
1094
+ * Cleanup before destroying the component.
1095
+ *
1096
+ * @returns {void}
1097
+ */
1098
+ destroy() {
1099
+ this.input = null;
1068
1100
  }
1069
1101
  }
1070
1102
  ), Qe = C(
@@ -1087,7 +1119,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1087
1119
  */
1088
1120
  openFileBrowse() {
1089
1121
  const t = this.input;
1090
- t && (t.value = "", p.trigger("click", t));
1122
+ t && (t.value = "", g.trigger("click", t));
1091
1123
  },
1092
1124
  /**
1093
1125
  * Get the URL for the uploaded file.
@@ -1123,7 +1155,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1123
1155
  s.preventDefault(), s.stopPropagation(), this.openFileBrowse();
1124
1156
  }
1125
1157
  }, [
1126
- T(
1158
+ I(
1127
1159
  "loaded",
1128
1160
  (s) => s ? G({
1129
1161
  // @ts-ignore
@@ -1133,12 +1165,20 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1133
1165
  htmlFor: t,
1134
1166
  class: "z-10 flex flex-col items-center justify-center text-sm text-muted-foreground group-hover:text-primary"
1135
1167
  }, [
1136
- g(u.upload),
1168
+ p(u.upload),
1137
1169
  n("Upload logo")
1138
1170
  ])
1139
1171
  )
1140
1172
  ])
1141
1173
  ]);
1174
+ },
1175
+ /**
1176
+ * Cleanup before destroying the component.
1177
+ *
1178
+ * @returns {void}
1179
+ */
1180
+ destroy() {
1181
+ this.input = null;
1142
1182
  }
1143
1183
  }
1144
1184
  ), Vt = (t, e) => V(
@@ -1149,7 +1189,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1149
1189
  class: "text-muted-foreground font-medium hover:text-foreground"
1150
1190
  },
1151
1191
  [a(e)]
1152
- ), Gt = () => g({
1192
+ ), Gt = () => p({
1153
1193
  class: "mx-3 text-muted-foreground",
1154
1194
  "aria-hidden": !0,
1155
1195
  size: "xs"
@@ -1257,19 +1297,19 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1257
1297
  },
1258
1298
  [
1259
1299
  a({ onState: ["selectedLabel", (e) => e || "Select item..."] }),
1260
- x({ html: u.chevron.upDown })
1300
+ b({ html: u.chevron.upDown })
1261
1301
  ]
1262
1302
  ), Xt = (t, e, s) => H({
1263
1303
  class: "flex flex-auto items-center cursor-pointer p-2 hover:bg-muted/50 rounded-sm",
1264
1304
  click: () => e(t),
1265
1305
  onState: [s, "selectedValue", { "bg-secondary": t.value }]
1266
1306
  }, [
1267
- t.icon && a({ class: "mr-2 flex items-baseline" }, [g({ size: "xs" }, t.icon)]),
1307
+ t.icon && a({ class: "mr-2 flex items-baseline" }, [p({ size: "xs" }, t.icon)]),
1268
1308
  a({ class: "text-base font-normal" }, t.label)
1269
1309
  ]), Zt = (t, e) => n({ class: "w-full border rounded-md" }, [
1270
1310
  q({ class: "max-h-60 overflow-y-auto p-2 grid gap-1", for: ["items", (s) => Xt(s, t, e)] })
1271
1311
  ]), te = ({ onSelect: t, state: e }) => n({ class: "flex flex-auto flex-col" }, [
1272
- T(
1312
+ I(
1273
1313
  "open",
1274
1314
  (s, o, i) => s ? new D({
1275
1315
  cache: "dropdown",
@@ -1379,6 +1419,14 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1379
1419
  value: ["[[selectedValue]]", this.state]
1380
1420
  })
1381
1421
  ]);
1422
+ },
1423
+ /**
1424
+ * This will run before the component is destroyed.
1425
+ *
1426
+ * @returns {void}
1427
+ */
1428
+ destroy() {
1429
+ this.dropdown = null, this.button = null;
1382
1430
  }
1383
1431
  }
1384
1432
  ), X = ({ icon: t, click: e, ariaLabel: s }) => h({
@@ -1398,9 +1446,9 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1398
1446
  }), oe = ({ bind: t, min: e, max: s, readonly: o = !1 }) => W(({ state: i }) => m({
1399
1447
  value: ["[[count]]", i],
1400
1448
  bind: t,
1401
- blur: (r, { state: l }) => {
1402
- let d = parseInt(r.target.value, 10);
1403
- isNaN(d) && (d = e ?? 0), e !== void 0 && (d = Math.max(d, e)), s !== void 0 && (d = Math.min(d, s)), l.count = d;
1449
+ blur: (l, { state: r }) => {
1450
+ let d = parseInt(l.target.value, 10);
1451
+ isNaN(d) && (d = e ?? 0), e !== void 0 && (d = Math.max(d, e)), s !== void 0 && (d = Math.min(d, s)), r.count = d;
1404
1452
  },
1405
1453
  class: "flex flex-auto text-lg font-medium bg-input text-center border min-w-0",
1406
1454
  readonly: o,
@@ -1450,32 +1498,32 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1450
1498
  return null;
1451
1499
  const e = parseInt(t.substring(0, 2), 10), s = parseInt(t.substring(2, 4), 10), o = parseInt(t.substring(4, 8), 10);
1452
1500
  return e >= 1 && e <= 12 && s >= 1 && s <= 31 && o >= 1900 ? `${o}-${e.toString().padStart(2, "0")}-${s.toString().padStart(2, "0")}` : null;
1453
- }, re = ({ bind: t, required: e }) => m({
1501
+ }, le = ({ bind: t, required: e }) => m({
1454
1502
  cache: "input",
1455
1503
  class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
1456
1504
  bind: t,
1457
1505
  required: e
1458
- }), le = ({ placeholder: t, handleInputChange: e, handleInputFocus: s }) => m({
1506
+ }), re = ({ placeholder: t, handleInputChange: e, handleInputFocus: s }) => m({
1459
1507
  cache: "dateInput",
1460
1508
  class: "flex-1 bg-transparent outline-none placeholder:text-muted-foreground border-0",
1461
1509
  placeholder: t || "mm/dd/yyyy",
1462
1510
  input: e,
1463
1511
  focus: s,
1464
1512
  onState: ["selectedDate", (o) => o ? M.format("standard", o) : ""]
1465
- }), ae = ({ bind: t, required: e, toggleOpen: s, handleInputChange: o, handleInputFocus: i, placeholder: r }) => n(
1513
+ }), ae = ({ bind: t, required: e, toggleOpen: s, handleInputChange: o, handleInputFocus: i, placeholder: l }) => n(
1466
1514
  {
1467
1515
  class: "relative flex items-center gap-2 w-full justify-between border bg-input hover:bg-muted rounded-md h-10 pr-4 py-2"
1468
1516
  },
1469
1517
  [
1470
- re({ bind: t, required: e }),
1471
- le({ placeholder: r, handleInputChange: o, handleInputFocus: i }),
1518
+ le({ bind: t, required: e }),
1519
+ re({ placeholder: l, handleInputChange: o, handleInputFocus: i }),
1472
1520
  f(
1473
1521
  {
1474
1522
  class: "flex-shrink-0 hover:bg-muted/50 rounded p-1 cursor-pointer",
1475
1523
  click: s
1476
1524
  },
1477
1525
  [
1478
- x({ html: u.calendar.days })
1526
+ b({ html: u.calendar.days })
1479
1527
  ]
1480
1528
  )
1481
1529
  ]
@@ -1523,7 +1571,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1523
1571
  const s = t.target.value.replace(/\D/g, "");
1524
1572
  t.target.value = ne(s);
1525
1573
  const o = ie(s);
1526
- o && (this.state.selectedDate = o, this.input.value = o, p.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(o));
1574
+ o && (this.state.selectedDate = o, this.input.value = o, g.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(o));
1527
1575
  },
1528
1576
  /**
1529
1577
  * Handles input focus - select all text for easy editing.
@@ -1539,7 +1587,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1539
1587
  * @param {string} date
1540
1588
  */
1541
1589
  handleDateSelect(t) {
1542
- this.state.selectedDate = t, this.state.open = !1, this.input.value = t, p.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(t);
1590
+ this.state.selectedDate = t, this.state.open = !1, this.input.value = t, g.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(t);
1543
1591
  },
1544
1592
  /**
1545
1593
  * Toggles the calendar popover.
@@ -1573,6 +1621,14 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1573
1621
  })
1574
1622
  ]
1575
1623
  );
1624
+ },
1625
+ /**
1626
+ * This will run before the component is destroyed.
1627
+ *
1628
+ * @returns {void}
1629
+ */
1630
+ destroy() {
1631
+ this.dropdown = null, this.dateInput = null, this.input = null;
1576
1632
  }
1577
1633
  }
1578
1634
  ), de = ({ bind: t, required: e }) => m({
@@ -1590,7 +1646,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1590
1646
  a(" - "),
1591
1647
  a(Y.date(["[[end]]", o], "End Date"))
1592
1648
  ]),
1593
- x({ html: u.calendar.days })
1649
+ b({ html: u.calendar.days })
1594
1650
  ]), he = ({ handleDateSelect: t, blockPriorDates: e }) => O((s, o, i) => new D({
1595
1651
  cache: "dropdown",
1596
1652
  parent: i,
@@ -1636,7 +1692,7 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1636
1692
  */
1637
1693
  render() {
1638
1694
  const t = (s, { state: o }) => o.toggle("open"), e = (s, o) => {
1639
- this.state.start = s, this.state.end = o, this.state.open = !1, this.input.value = `${s}-${o}`, p.trigger("change", this.input), typeof this.onChange == "function" && this.onChange({ start: s, end: o }, this.parent);
1695
+ this.state.start = s, this.state.end = o, this.state.open = !1, this.input.value = `${s}-${o}`, g.trigger("change", this.input), typeof this.onChange == "function" && this.onChange({ start: s, end: o }, this.parent);
1640
1696
  };
1641
1697
  return n({ class: "relative w-full max-w-[320px]" }, [
1642
1698
  ue({
@@ -1649,6 +1705,14 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1649
1705
  blockPriorDates: this.blockPriorDates || !1
1650
1706
  })
1651
1707
  ]);
1708
+ },
1709
+ /**
1710
+ * This will run before the component is destroyed.
1711
+ *
1712
+ * @returns {void}
1713
+ */
1714
+ destroy() {
1715
+ this.dropdown = null, this.input = null;
1652
1716
  }
1653
1717
  }
1654
1718
  ), ns = ({ dateTime: t = "", remoteTimeZone: e = "America/Denver", filter: s = null }) => nt([
@@ -1678,7 +1742,7 @@ function fe(t) {
1678
1742
  meridian: i
1679
1743
  };
1680
1744
  }
1681
- function ge({ bind: t, required: e }) {
1745
+ function pe({ bind: t, required: e }) {
1682
1746
  return m({
1683
1747
  cache: "input",
1684
1748
  class: "opacity-0 absolute top-0 left-0 w-full h-full pointer-events-none",
@@ -1686,7 +1750,7 @@ function ge({ bind: t, required: e }) {
1686
1750
  required: e
1687
1751
  });
1688
1752
  }
1689
- function pe({ placeholder: t, handleInputChange: e, handleInputFocus: s }) {
1753
+ function ge({ placeholder: t, handleInputChange: e, handleInputFocus: s }) {
1690
1754
  return m({
1691
1755
  cache: "timeInput",
1692
1756
  class: "flex-1 bg-transparent outline-none placeholder:text-muted-foreground border-0",
@@ -1696,21 +1760,21 @@ function pe({ placeholder: t, handleInputChange: e, handleInputFocus: s }) {
1696
1760
  onState: ["selectedTime", (o) => o || ""]
1697
1761
  });
1698
1762
  }
1699
- function be({ bind: t, required: e, toggleOpen: s, handleInputChange: o, handleInputFocus: i, placeholder: r }) {
1763
+ function be({ bind: t, required: e, toggleOpen: s, handleInputChange: o, handleInputFocus: i, placeholder: l }) {
1700
1764
  return n(
1701
1765
  {
1702
1766
  class: "relative flex items-center gap-2 w-full justify-between border bg-input hover:bg-muted rounded-md h-10 pr-4 py-2"
1703
1767
  },
1704
1768
  [
1705
- ge({ bind: t, required: e }),
1706
- pe({ placeholder: r, handleInputChange: o, handleInputFocus: i }),
1769
+ pe({ bind: t, required: e }),
1770
+ ge({ placeholder: l, handleInputChange: o, handleInputFocus: i }),
1707
1771
  f(
1708
1772
  {
1709
1773
  class: "flex-shrink-0 hover:bg-muted/50 rounded p-1 cursor-pointer",
1710
1774
  click: s
1711
1775
  },
1712
1776
  [
1713
- x({ html: u.clock })
1777
+ b({ html: u.clock })
1714
1778
  ]
1715
1779
  )
1716
1780
  ]
@@ -1719,13 +1783,13 @@ function be({ bind: t, required: e, toggleOpen: s, handleInputChange: o, handleI
1719
1783
  function $({ items: t, handleTimeSelect: e, state: s, stateValue: o, pad: i = !1 }) {
1720
1784
  return n(
1721
1785
  { class: "flex flex-col max-h-[200px] overflow-y-auto" },
1722
- t.map((r) => {
1723
- let l = i ? r.toString().padStart(2, "0") : r.toString();
1786
+ t.map((l) => {
1787
+ let r = i ? l.toString().padStart(2, "0") : l.toString();
1724
1788
  return f({
1725
- text: l,
1789
+ text: r,
1726
1790
  class: "hover:bg-muted/50 rounded-md pr-2 py-1",
1727
- click: () => e({ [o]: l }),
1728
- onState: [s, o, { "bg-muted": l }]
1791
+ click: () => e({ [o]: r }),
1792
+ onState: [s, o, { "bg-muted": r }]
1729
1793
  });
1730
1794
  })
1731
1795
  );
@@ -1748,7 +1812,7 @@ function xe({ handleTimeSelect: t }) {
1748
1812
  [
1749
1813
  // Hours column
1750
1814
  $({
1751
- items: Array.from({ length: 12 }, (i, r) => r + 1),
1815
+ items: Array.from({ length: 12 }, (i, l) => l + 1),
1752
1816
  handleTimeSelect: t,
1753
1817
  state: o.state,
1754
1818
  stateValue: "hour",
@@ -1756,7 +1820,7 @@ function xe({ handleTimeSelect: t }) {
1756
1820
  }),
1757
1821
  // Minutes column
1758
1822
  $({
1759
- items: Array.from({ length: 60 }, (i, r) => r),
1823
+ items: Array.from({ length: 60 }, (i, l) => l),
1760
1824
  handleTimeSelect: t,
1761
1825
  state: o.state,
1762
1826
  stateValue: "minute",
@@ -1783,11 +1847,11 @@ function U(t) {
1783
1847
  const e = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = t.match(e);
1784
1848
  if (!s)
1785
1849
  return { hour: null, minute: null, meridian: null };
1786
- let [, o, i, , r] = s, l = parseInt(o, 10), d = parseInt(i, 10);
1787
- return l < 0 || l > 23 || d < 0 || d > 59 ? { hour: null, minute: null, meridian: null } : (r ? (r = r.toUpperCase(), r === "PM" && l < 12 ? l += 12 : r === "AM" && l === 12 && (l = 12)) : l === 0 ? (r = "AM", l = 12) : l < 12 ? r = "AM" : l === 12 ? r = "PM" : (r = "PM", l -= 12), {
1788
- hour: l.toString().padStart(2, "0"),
1850
+ let [, o, i, , l] = s, r = parseInt(o, 10), d = parseInt(i, 10);
1851
+ return r < 0 || r > 23 || d < 0 || d > 59 ? { hour: null, minute: null, meridian: null } : (l ? (l = l.toUpperCase(), l === "PM" && r < 12 ? r += 12 : l === "AM" && r === 12 && (r = 12)) : r === 0 ? (l = "AM", r = 12) : r < 12 ? l = "AM" : r === 12 ? l = "PM" : (l = "PM", r -= 12), {
1852
+ hour: r.toString().padStart(2, "0"),
1789
1853
  minute: d.toString().padStart(2, "0"),
1790
- meridian: r
1854
+ meridian: l
1791
1855
  });
1792
1856
  }
1793
1857
  const is = v(
@@ -1845,7 +1909,7 @@ const is = v(
1845
1909
  minute: o.minute,
1846
1910
  meridian: o.meridian,
1847
1911
  selectedTime: o.formattedTime
1848
- }), this.input.value = o.formattedTime, p.trigger("change", this.input), typeof this.change == "function" && this.change(o.formattedTime)), t.target.value = s;
1912
+ }), this.input.value = o.formattedTime, g.trigger("change", this.input), typeof this.change == "function" && this.change(o.formattedTime)), t.target.value = s;
1849
1913
  },
1850
1914
  /**
1851
1915
  * Handles input focus - select all text for easy editing.
@@ -1863,7 +1927,7 @@ const is = v(
1863
1927
  handleTimeSelect({ hour: t, minute: e, meridian: s }) {
1864
1928
  if (t && (this.state.hour = t), e && (this.state.minute = e), s && (this.state.meridian = s), this.state.hour && this.state.minute && this.state.meridian) {
1865
1929
  const o = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
1866
- this.state.selectedTime = o, this.state.open = !1, this.input.value = o, p.trigger("change", this.input), typeof this.change == "function" && this.change(o);
1930
+ this.state.selectedTime = o, this.state.open = !1, this.input.value = o, g.trigger("change", this.input), typeof this.change == "function" && this.change(o);
1867
1931
  }
1868
1932
  },
1869
1933
  /**
@@ -1888,11 +1952,19 @@ const is = v(
1888
1952
  })
1889
1953
  ]
1890
1954
  );
1955
+ },
1956
+ /**
1957
+ * Cleanup before destroying the component.
1958
+ *
1959
+ * @returns {void}
1960
+ */
1961
+ destroy() {
1962
+ this.input = null, this.timeInput = null, this.dropdown = null;
1891
1963
  }
1892
1964
  }
1893
1965
  ), ye = (t, e) => n({ class: `hidden md:flex items-start justify-center w-6 h-6 mr-3 ${e}` }, [
1894
- g({ size: "lg" }, t)
1895
- ]), we = ({ title: t }) => I({ class: "flex flex-auto items-center" }, [
1966
+ p({ size: "lg" }, t)
1967
+ ]), we = ({ title: t }) => T({ class: "flex flex-auto items-center" }, [
1896
1968
  S({ class: "text-lg font-semibold" }, t)
1897
1969
  ]), Ce = c((t, e) => it(
1898
1970
  {
@@ -1909,7 +1981,7 @@ const is = v(
1909
1981
  n({ class: "flex flex-auto flex-col gap-4" }, [
1910
1982
  n({ class: "flex flex-auto flex-col gap-y-2" }, [
1911
1983
  we(t),
1912
- t.description && b({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t.description),
1984
+ t.description && x({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, t.description),
1913
1985
  n({ class: "flex flex-auto flex-col text-sm text-muted-foreground" }, e)
1914
1986
  ]),
1915
1987
  t.buttons && L({ class: "flex flex-col-reverse sm:flex-row sm:justify-end mt-6 gap-2 sm:gap-0 sm:gap-x-2" }, t.buttons)
@@ -1960,10 +2032,10 @@ class Se extends w {
1960
2032
  render() {
1961
2033
  const e = (d) => {
1962
2034
  d.target === this.panel && this.close();
1963
- }, { borderColor: s, bgColor: o, iconColor: i } = R[this.type] || R.default, r = `${this.getMainClass()} ${o} ${s}`, l = this.title || "Dialog Title";
2035
+ }, { borderColor: s, bgColor: o, iconColor: i } = R[this.type] || R.default, l = `${this.getMainClass()} ${o} ${s}`, r = this.title || "Dialog Title";
1964
2036
  return Ce({
1965
- class: r,
1966
- title: l,
2037
+ class: l,
2038
+ title: r,
1967
2039
  click: e,
1968
2040
  icon: this.icon,
1969
2041
  iconColor: i,
@@ -2016,7 +2088,7 @@ class Se extends w {
2016
2088
  this.state.open = !1, this.panel.close(), typeof this.onClose == "function" && this.onClose(), this.destroy();
2017
2089
  }
2018
2090
  }
2019
- class rs extends Se {
2091
+ class ls extends Se {
2020
2092
  /**
2021
2093
  * This will declare the props for the compiler.
2022
2094
  *
@@ -2046,17 +2118,17 @@ class rs extends Se {
2046
2118
  this.confirmed && this.confirmed(), this.close();
2047
2119
  }
2048
2120
  }
2049
- const ls = c((t, e = []) => n({ class: "w-full max-w-md p-6 m-auto" }, [
2121
+ const rs = c((t, e = []) => n({ class: "w-full max-w-md p-6 m-auto" }, [
2050
2122
  K({ class: "flex flex-auto flex-col" }, [
2051
2123
  n({ class: "flex flex-auto flex-col gap-y-4" }, [
2052
2124
  n({ class: "flex flex-auto items-center justify-center" }, [
2053
2125
  t.icon && n({ class: "w-16 h-16 mb-2 text-primary" }, [
2054
- g(t.icon)
2126
+ p(t.icon)
2055
2127
  ])
2056
2128
  ]),
2057
- I({ class: "py-4 text-center" }, [
2129
+ T({ class: "py-4 text-center" }, [
2058
2130
  S({ class: "text-xl font-bold" }, t.title),
2059
- b({ class: "pb-8 text-muted-foreground" }, t.description || ""),
2131
+ x({ class: "pb-8 text-muted-foreground" }, t.description || ""),
2060
2132
  ...e
2061
2133
  ])
2062
2134
  ])
@@ -2066,48 +2138,48 @@ export {
2066
2138
  Le as A,
2067
2139
  Xe as B,
2068
2140
  He as C,
2069
- Oe as D,
2070
- es as E,
2071
- Tt as F,
2072
- ss as G,
2073
- os as H,
2141
+ ss as D,
2142
+ rs as E,
2143
+ K as F,
2144
+ y as G,
2145
+ Re as H,
2074
2146
  Ke as I,
2075
- ns as J,
2076
- is as K,
2147
+ _e as J,
2148
+ Je as K,
2077
2149
  Qe as L,
2078
- At as M,
2079
- Ve as N,
2080
- rs as O,
2150
+ ee as M,
2151
+ Nt as N,
2152
+ ns as O,
2081
2153
  se as P,
2082
- Ce as Q,
2083
- Se as R,
2084
- Re as S,
2154
+ is as Q,
2155
+ We as R,
2156
+ k as S,
2085
2157
  Ge as T,
2086
- ls as U,
2087
- Ct as a,
2088
- Ae as b,
2089
- St as c,
2090
- It as d,
2091
- Bt as e,
2092
- Ft as f,
2093
- Ye as g,
2094
- ze as h,
2095
- je as i,
2096
- Mt as j,
2097
- Ee as k,
2098
- K as l,
2099
- Ne as m,
2100
- Ue as n,
2101
- qe as o,
2102
- Nt as p,
2103
- We as q,
2104
- _e as r,
2105
- Je as s,
2106
- k as t,
2107
- y as u,
2108
- Ht as v,
2109
- Ze as w,
2110
- ts as x,
2111
- ee as y,
2112
- oe as z
2158
+ Ht as U,
2159
+ ts as a,
2160
+ ls as b,
2161
+ oe as c,
2162
+ es as d,
2163
+ os as e,
2164
+ Oe as f,
2165
+ Ne as g,
2166
+ Ue as h,
2167
+ Se as i,
2168
+ Ce as j,
2169
+ Ze as k,
2170
+ qe as l,
2171
+ St as m,
2172
+ Ct as n,
2173
+ Ae as o,
2174
+ Ye as p,
2175
+ je as q,
2176
+ ze as r,
2177
+ Mt as s,
2178
+ Bt as t,
2179
+ Ee as u,
2180
+ It as v,
2181
+ Tt as w,
2182
+ Ft as x,
2183
+ At as y,
2184
+ Ve as z
2113
2185
  };