@base-framework/ui 1.1.1 → 1.1.3

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 rt } from "@base-framework/atoms";
2
- import { Atom as c, Component as w, Html as A, Dom as it, base as lt, Data as B, Builder as _, Jot as C, Events as p, DateTime as M } from "@base-framework/base";
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 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
3
  import { P as D, b as at, R as ct } from "./range-calendar-CAwPjNM3.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}` }, [
36
+ }, pt = (t, e) => n({ class: `flex items-center justify-center h-6 w-6 mr-3 ${e}` }, [
37
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: r, bgColor: i, iconColor: l } = z[o] || z.default;
40
- return n({ class: `flex items-start p-4 border rounded-lg ${i} ${r}` }, [
38
+ ]), gt = (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: 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
- it.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({
@@ -94,7 +94,7 @@ const xt = (t) => a({ class: "ml-auto text-xs tracking-widest opacity-60" }, t),
94
94
  t && a(t),
95
95
  e && x({ 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,8 +167,16 @@ 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) => 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" }, [
172
180
  t.title && S({ class: "text-lg font-semibold py-4 px-6" }, t.title),
173
181
  t.description && b({ class: "text-sm text-muted-foreground pb-4 px-6 max-w-[700px]" }, t.description),
174
182
  ...e
@@ -185,15 +193,15 @@ 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 r = J(e, (i) => {
189
- i.target.checkValidity() && t.setError(null);
190
- }, (i) => {
191
- t.setError(i.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,
195
203
  class: "w-full"
196
- }, r);
204
+ }, i);
197
205
  }), Ee = v(
198
206
  {
199
207
  /**
@@ -215,20 +223,20 @@ 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, r = (i) => {
219
- this.state.error = i, this.state.hasError = !!i;
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,
227
235
  value: this.state.value,
228
- setError: r
236
+ setError: i
229
237
  }, this.children),
230
238
  o && Bt({ id: this.getId("description") }, o),
231
- n({ onState: ["error", (i) => i && Ft(i)] })
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: r = [] }) => 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: (i, 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
@@ -270,20 +278,20 @@ const Tt = c((t, e) => n({ ...t, class: "flex flex-auto flex-col gap-y-2" }, e))
270
278
  S({ class: "text-lg font-semibold m-0 truncate" }, t),
271
279
  e && n({ class: "text-sm text-muted-foreground truncate" }, e)
272
280
  ]),
273
- n({ class: "flex flex-none items-center gap-2" }, r)
281
+ n({ class: "flex flex-none items-center gap-2" }, i)
274
282
  ])
275
283
  ])), Q = c((t, e) => {
276
284
  const s = t.class?.includes("drawer");
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: (i, l) => {
281
- i.target === l.panel && (i.preventDefault(), i.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: (i, 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
  }, [
@@ -317,9 +325,9 @@ class At extends w {
317
325
  options: this.headerOptions(),
318
326
  buttons: this.getButtons(),
319
327
  hideFooter: this.hideFooter,
320
- onSubmit: (r) => {
321
- let i = !0;
322
- this.onSubmit && (i = this.onSubmit(r)), i !== !1 && this.destroy();
328
+ onSubmit: (i) => {
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,
@@ -453,7 +461,7 @@ class At extends w {
453
461
  * @returns {void}
454
462
  */
455
463
  beforeDestroy() {
456
- this.panel.hidePopover(), this.state.open = !1, typeof this.onClose == "function" && this.onClose(this), document.documentElement.style.overflowY = "auto";
464
+ this.panel.hidePopover(), this.state.open = !1, typeof this.onClose == "function" && this.onClose(this), document.documentElement.style.overflowY = "auto", this.modalContent = null, this.modalBody = null;
457
465
  }
458
466
  }
459
467
  class Yt {
@@ -472,12 +480,12 @@ class Yt {
472
480
  const {
473
481
  modal: s = null,
474
482
  modalContent: o = null,
475
- modalBody: r = null,
476
- closeThreshold: i = 150,
477
- snapThreshold: l = 50,
483
+ modalBody: i = null,
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 = r, this.closeThreshold = i, 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
@@ -527,10 +535,10 @@ class Yt {
527
535
  const o = this.getDeltaY();
528
536
  if (!this.state.isDragging && this.state.canDrag && o > 0 && this.modalBody.scrollTop === 0 && (this.state.isDragging = !0), this.state.isDragging && o > 0) {
529
537
  e.preventDefault();
530
- const r = this.calculateTranslateY(o);
531
- this.modalContent.style.transform = `translateY(${r}px)`, this.modalContent.style.transition = "none";
532
- const i = this.calculateBackdropOpacity(o);
533
- this.updateBackdropOpacity(i);
538
+ const i = this.calculateTranslateY(o);
539
+ this.modalContent.style.transform = `translateY(${i}px)`, this.modalContent.style.transition = "none";
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
  /**
@@ -642,7 +650,7 @@ class qe extends At {
642
650
  * @returns {object}
643
651
  */
644
652
  render() {
645
- const e = this.getMainClass(), s = this.title || "", o = this.description || null, r = this.getContainerProps();
653
+ const e = this.getMainClass(), s = this.title || "", o = this.description || null, i = this.getContainerProps();
646
654
  return Q(
647
655
  {
648
656
  class: e,
@@ -651,14 +659,14 @@ class qe extends At {
651
659
  options: this.headerOptions(),
652
660
  buttons: this.getButtons(),
653
661
  hideFooter: this.hideFooter,
654
- onSubmit: (i) => {
655
- let l = !0;
656
- this.onSubmit && (l = this.onSubmit(i)), 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,
660
668
  aria: { expanded: ["open"] },
661
- ...r
669
+ ...i
662
670
  },
663
671
  this.children
664
672
  );
@@ -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(), r = this.href || null, i = this.getChildren(o);
771
- return r ? jt({
772
- href: r,
778
+ const { bgColor: e, borderColor: s, iconColor: o } = this.getTypeStyles(), i = this.href || null, l = this.getChildren(o);
779
+ return i ? jt({
780
+ href: i,
773
781
  class: `${e} ${s}`
774
- }, i) : Et({
782
+ }, l) : Et({
775
783
  close: this.close.bind(this),
776
784
  class: `${e} ${s}`
777
- }, i);
785
+ }, l);
778
786
  }
779
787
  /**
780
788
  * This will be called after the component is set up.
@@ -878,16 +886,24 @@ 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',
884
900
  onState: ["method", { active: t }],
885
901
  dataSet: ["method", ["state", t, "active"]],
886
- click: (o, { state: r }) => {
887
- r.method = t, localStorage.setItem("theme", t), t === "system" && localStorage.removeItem("theme"), Rt(t);
902
+ click: (o, { state: i }) => {
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"
@@ -1211,8 +1251,8 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1211
1251
  "bg-primary": t,
1212
1252
  "shadow-md": t
1213
1253
  }],
1214
- click: (s, { data: o, onClick: r }) => {
1215
- o.activeIndex = t, r && r(t);
1254
+ click: (s, { data: o, onClick: i }) => {
1255
+ o.activeIndex = t, i && i(t);
1216
1256
  }
1217
1257
  })
1218
1258
  ]), Kt = (t, e) => Array.from({ length: t }, (s, o) => Jt({
@@ -1264,17 +1304,17 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
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
- (s, o, r) => s ? new D({
1314
+ (s, o, i) => s ? new D({
1275
1315
  cache: "dropdown",
1276
- parent: r,
1277
- button: r.button
1316
+ parent: i,
1317
+ button: i.button
1278
1318
  }, [
1279
1319
  Zt(t, e)
1280
1320
  ]) : null
@@ -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({
@@ -1395,12 +1443,12 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1395
1443
  icon: u.circlePlus,
1396
1444
  click: t,
1397
1445
  ariaLabel: "Increment"
1398
- }), oe = ({ bind: t, min: e, max: s, readonly: o = !1 }) => W(({ state: r }) => m({
1399
- value: ["[[count]]", r],
1446
+ }), oe = ({ bind: t, min: e, max: s, readonly: o = !1 }) => W(({ state: i }) => m({
1447
+ value: ["[[count]]", i],
1400
1448
  bind: t,
1401
- blur: (i, { state: l }) => {
1402
- let d = parseInt(i.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,
@@ -1445,30 +1493,30 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1445
1493
  ), ne = (t) => {
1446
1494
  let e = "";
1447
1495
  return t.length > 0 && (e = t.substring(0, 2), t.length > 2 && (e += "/" + t.substring(2, 4), t.length > 4 && (e += "/" + t.substring(4, 8)))), e;
1448
- }, re = (t) => {
1496
+ }, ie = (t) => {
1449
1497
  if (t.length !== 8)
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
- }, ie = ({ 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: r, placeholder: i }) => 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
- ie({ bind: t, required: e }),
1471
- le({ placeholder: i, handleInputChange: o, handleInputFocus: r }),
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",
@@ -1480,14 +1528,14 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1480
1528
  )
1481
1529
  ]
1482
1530
  ), ce = ({ handleDateSelect: t, blockPriorDates: e }) => O(
1483
- (s, o, r) => new D({
1531
+ (s, o, i) => new D({
1484
1532
  cache: "dropdown",
1485
- parent: r,
1486
- button: r.panel,
1533
+ parent: i,
1534
+ button: i.panel,
1487
1535
  size: "fit"
1488
1536
  }, [
1489
1537
  new at({
1490
- selectedDate: r.state.selectedDate,
1538
+ selectedDate: i.state.selectedDate,
1491
1539
  selectedCallBack: t,
1492
1540
  blockPriorDates: e
1493
1541
  })
@@ -1522,8 +1570,8 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1522
1570
  handleInputChange(t) {
1523
1571
  const s = t.target.value.replace(/\D/g, "");
1524
1572
  t.target.value = ne(s);
1525
- const o = re(s);
1526
- o && (this.state.selectedDate = o, this.input.value = o, p.trigger("change", this.input), typeof this.onChange == "function" && this.onChange(o));
1573
+ const o = ie(s);
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({
@@ -1591,15 +1647,15 @@ const E = globalThis.matchMedia, F = c(({ value: t, label: e, icon: s }) => f({
1591
1647
  a(Y.date(["[[end]]", o], "End Date"))
1592
1648
  ]),
1593
1649
  x({ html: u.calendar.days })
1594
- ]), he = ({ handleDateSelect: t, blockPriorDates: e }) => O((s, o, r) => new D({
1650
+ ]), he = ({ handleDateSelect: t, blockPriorDates: e }) => O((s, o, i) => new D({
1595
1651
  cache: "dropdown",
1596
- parent: r,
1597
- button: r.panel,
1652
+ parent: i,
1653
+ button: i.panel,
1598
1654
  size: "xl"
1599
1655
  }, [
1600
1656
  new ct({
1601
- startDate: r.state.start,
1602
- endDate: r.state.end,
1657
+ startDate: i.state.start,
1658
+ endDate: i.state.end,
1603
1659
  onRangeSelect: t,
1604
1660
  blockPriorDates: e
1605
1661
  })
@@ -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,14 +1705,22 @@ 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([
1655
1719
  new ft({
1656
1720
  dateTime: t,
1657
1721
  filter: s || ((o) => {
1658
- const r = M.getLocalTime(o, !0, !1, e);
1659
- return M.getTimeFrame(r);
1722
+ const i = M.getLocalTime(o, !0, !1, e);
1723
+ return M.getTimeFrame(i);
1660
1724
  })
1661
1725
  })
1662
1726
  ]);
@@ -1670,15 +1734,15 @@ function fe(t) {
1670
1734
  const e = parseInt(t.substring(0, 2), 10), s = parseInt(t.substring(2, 4), 10);
1671
1735
  if (e < 0 || e > 23 || s < 0 || s > 59)
1672
1736
  return { formattedTime: null, hour: null, minute: null, meridian: null };
1673
- let o = e, r = "AM";
1674
- return e === 0 ? o = 12 : e > 12 ? (o = e - 12, r = "PM") : e === 12 && (r = "PM"), {
1675
- formattedTime: `${o.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")} ${r}`,
1737
+ let o = e, i = "AM";
1738
+ return e === 0 ? o = 12 : e > 12 ? (o = e - 12, i = "PM") : e === 12 && (i = "PM"), {
1739
+ formattedTime: `${o.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")} ${i}`,
1676
1740
  hour: o.toString().padStart(2, "0"),
1677
1741
  minute: s.toString().padStart(2, "0"),
1678
- meridian: r
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,14 +1760,14 @@ 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: r, placeholder: i }) {
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: i, handleInputChange: o, handleInputFocus: r }),
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",
@@ -1716,16 +1780,16 @@ function be({ bind: t, required: e, toggleOpen: s, handleInputChange: o, handleI
1716
1780
  ]
1717
1781
  );
1718
1782
  }
1719
- function $({ items: t, handleTimeSelect: e, state: s, stateValue: o, pad: r = !1 }) {
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((i) => {
1723
- let l = r ? i.toString().padStart(2, "0") : i.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 }, (r, i) => i + 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 }, (r, i) => i),
1823
+ items: Array.from({ length: 60 }, (i, l) => l),
1760
1824
  handleTimeSelect: t,
1761
1825
  state: o.state,
1762
1826
  stateValue: "minute",
@@ -1783,14 +1847,14 @@ 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, r, , i] = s, l = parseInt(o, 10), d = parseInt(r, 10);
1787
- return l < 0 || l > 23 || d < 0 || d > 59 ? { hour: null, minute: null, meridian: null } : (i ? (i = i.toUpperCase(), i === "PM" && l < 12 ? l += 12 : i === "AM" && l === 12 && (l = 12)) : l === 0 ? (i = "AM", l = 12) : l < 12 ? i = "AM" : l === 12 ? i = "PM" : (i = "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: i
1854
+ meridian: l
1791
1855
  });
1792
1856
  }
1793
- const rs = v(
1857
+ const is = v(
1794
1858
  {
1795
1859
  /**
1796
1860
  * The initial shallow state of the TimePicker.
@@ -1845,7 +1909,7 @@ const rs = 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 rs = 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,13 +1952,21 @@ const rs = 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
- ]), Ce = c((t, e) => rt(
1969
+ ]), Ce = c((t, e) => it(
1898
1970
  {
1899
1971
  class: `fixed pullUpIn z-30 w-[98%] border md:w-full max-w-lg bg-popover text-foreground shadow-lg duration-200
1900
1972
  rounded-lg flex flex-auto flex-col
@@ -1960,13 +2032,13 @@ 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: r } = R[this.type] || R.default, i = `${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: i,
1966
- title: l,
2037
+ class: l,
2038
+ title: r,
1967
2039
  click: e,
1968
2040
  icon: this.icon,
1969
- iconColor: r,
2041
+ iconColor: i,
1970
2042
  description: this.description,
1971
2043
  buttons: this.getButtons()
1972
2044
  }, this.children);
@@ -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 is extends Se {
2091
+ class ls extends Se {
2020
2092
  /**
2021
2093
  * This will declare the props for the compiler.
2022
2094
  *
@@ -2046,15 +2118,15 @@ class is 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
2131
  b({ class: "pb-8 text-muted-foreground" }, t.description || ""),
2060
2132
  ...e
@@ -2068,26 +2140,26 @@ export {
2068
2140
  He as C,
2069
2141
  Oe as D,
2070
2142
  es as E,
2071
- Tt as F,
2143
+ It as F,
2072
2144
  ss as G,
2073
2145
  os as H,
2074
2146
  Ke as I,
2075
2147
  ns as J,
2076
- rs as K,
2148
+ is as K,
2077
2149
  Qe as L,
2078
2150
  At as M,
2079
2151
  Ve as N,
2080
- is as O,
2152
+ ls as O,
2081
2153
  se as P,
2082
2154
  Ce as Q,
2083
2155
  Se as R,
2084
2156
  Re as S,
2085
2157
  Ge as T,
2086
- ls as U,
2158
+ rs as U,
2087
2159
  Ct as a,
2088
2160
  Ae as b,
2089
2161
  St as c,
2090
- It as d,
2162
+ Tt as d,
2091
2163
  Bt as e,
2092
2164
  Ft as f,
2093
2165
  Ye as g,