@base-framework/ui 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -5,7 +5,7 @@ import { V as w, a as U } from "./veil-DSQdR6CM.js";
5
5
  import { Icons as R } from "./icons.es.js";
6
6
  import { A as G, B as V, C as j, z as q, u as z, v as J, w as _, D as K, j as Q, k as X, G as Y, E as Z, s as $, c as aa, a as sa, b as ea, i as oa, g as ta, e as ra, h as na, F as ia, d as la, f as pa, t as ua, M as ma, l as da, N as ga, P as Ca, p as Ta, q as ca, S as Da, n as Ia, o as Sa, T as ba, x as Ba, y as Pa, m as Fa, r as Ma } from "./confirmation-34GijCiu.js";
7
7
  import { A as Na, b as va, C as fa, D as xa, a as ha, F as ya, M as Wa, P as La, c as Aa, g as Ha, p as wa } from "./calendar-BjUju8_5.js";
8
- import { B as Oa, m as Ra, C as Ea, j as Ga, D as Va, l as ja, H as qa, I as za, N as Ja, O as _a, P as Ka, S as Qa, q as Xa, p as Ya, n as Za, o as $a, T as as, k as ss, U as es, W as os, f as ts, h as rs, i as ns, c as is, d as ls, b as ps, e as us, a as ms, g as ds } from "./signature-panel-DUghPs3y.js";
8
+ import { B as Oa, m as Ra, C as Ea, j as Ga, D as Va, l as ja, H as qa, I as za, N as Ja, O as _a, P as Ka, S as Qa, q as Xa, p as Ya, n as Za, o as $a, T as as, k as ss, U as es, W as os, f as ts, h as rs, i as ns, c as is, d as ls, b as ps, e as us, a as ms, g as ds } from "./signature-panel-D_C96Oak.js";
9
9
  import { B as Cs, I as Ts, M as cs, d as Ds, e as Is, g as Ss, N as bs, b as Bs, a as Ps, f as Fs, P as Ms, c as ks, S as Ns, T as vs } from "./mobile-nav-wrapper-DyNFnla-.js";
10
10
  import { B as xs, a as hs, C as ys, F as Ws, b as Ls, c as As, M as Hs, P as ws, S as Us } from "./sidebar-menu-page-lAu74WTl.js";
11
11
  import { A as Rs, F as Es, M as Gs, a as Vs, T as js } from "./aside-template-McEj_Gxc.js";
@@ -1,4 +1,4 @@
1
- import { B as s, m as o, C as t, j as r, D as n, l, H as i, I as d, N as b, O as v, P as g, S as p, q as u, p as N, n as k, o as C, T as D, k as M, U as T, W as c, f as B, h as m, i as y, c as W, d as h, b as H, e as P, a as S, g as f } from "./signature-panel-DUghPs3y.js";
1
+ import { B as s, m as o, C as t, j as r, D as n, l, H as i, I as d, N as b, O as v, P as g, S as p, q as u, p as N, n as k, o as C, T as D, k as M, U as T, W as c, f as B, h as m, i as y, c as W, d as h, b as H, e as P, a as S, g as f } from "./signature-panel-D_C96Oak.js";
2
2
  import { b as I, C as L, D as O, a as F, F as U, M as G, c as j, p as q } from "./calendar-BjUju8_5.js";
3
3
  import { B as z, I as A, M as E, d as J, e as K, g as Q, N as R, b as V, a as X, f as Y, P as Z, c as _, S as $, T as aa } from "./mobile-nav-wrapper-DyNFnla-.js";
4
4
  export {
@@ -1,10 +1,10 @@
1
- import { Button as v, Div as o, On as U, Span as y, Th as P, UseParent as Y, I as E, Thead as F, Tr as H, Table as Q, P as m, Li as D, Time as X, Nav as S, Ul as b, Section as O, Canvas as q } from "@base-framework/atoms";
2
- import { Atom as u, Component as g, Data as L, DateTime as K, Jot as R, router as k, NavLink as M, base as B, Dom as I } from "@base-framework/base";
1
+ import { Button as v, Div as o, On as U, Span as y, Th as P, I as Y, Thead as E, Tr as F, Table as H, P as m, Li as D, Time as Q, Nav as S, Ul as b, Section as O, Canvas as X } from "@base-framework/atoms";
2
+ import { Atom as u, Component as g, Data as L, DateTime as q, Jot as R, router as k, NavLink as M, base as B, Dom as I } from "@base-framework/base";
3
3
  import { B as C, I as z } from "./buttons-CVEwmPAi.js";
4
4
  import { Icons as w } from "./icons.es.js";
5
- import { TableBody as _, List as G, IntervalTimer as V } from "@base-framework/organisms";
6
- import { C as J, I as Z, H as ee } from "./inputs-O_WkdbI3.js";
7
- import { A as te, P as se } from "./calendar-BjUju8_5.js";
5
+ import { TableBody as K, List as _, IntervalTimer as G } from "@base-framework/organisms";
6
+ import { C as V, I as J, H as Z } from "./inputs-O_WkdbI3.js";
7
+ import { A as ee, P as te } from "./calendar-BjUju8_5.js";
8
8
  u((t, e) => ({
9
9
  class: "flex items-center px-4 py-2",
10
10
  ...t,
@@ -34,31 +34,31 @@ class _e extends g {
34
34
  return o({ class: this.class || "" }, this.children);
35
35
  }
36
36
  }
37
- const ne = (t) => {
37
+ const se = (t) => {
38
38
  const e = new Date(t, 11, 31), s = new Date(t, 0, 1);
39
39
  return e.getDay() === 4 || // December 31 is a Thursday
40
40
  s.getDay() === 4;
41
- }, ae = (t) => {
41
+ }, ne = (t) => {
42
42
  const e = new Date(t.valueOf()), s = (e.getDay() + 6) % 7;
43
43
  e.setDate(e.getDate() - s + 3);
44
44
  const n = e.getFullYear(), a = new Date(n, 0, 4);
45
45
  a.setDate(a.getDate() - (a.getDay() + 6) % 7);
46
46
  const i = Math.ceil((e - a) / 6048e5) + 1;
47
- return i > 52 && !ne(n) ? {
47
+ return i > 52 && !se(n) ? {
48
48
  weekNumber: 1,
49
49
  year: n + 1
50
50
  } : {
51
51
  weekNumber: i,
52
52
  year: n
53
53
  };
54
- }, ie = (t, e, s) => {
54
+ }, ae = (t, e, s) => {
55
55
  if (s === 0) return [];
56
56
  const n = new Date(t, e, 0).getDate();
57
57
  return Array.from(
58
58
  { length: s },
59
59
  (a, i) => new Date(t, e - 1, n - s + i + 1)
60
60
  );
61
- }, oe = (t, e, s) => Array.from({ length: s }, (n, a) => new Date(t, e + 1, a + 1)), T = (t, e) => {
61
+ }, ie = (t, e, s) => Array.from({ length: s }, (n, a) => new Date(t, e + 1, a + 1)), T = (t, e) => {
62
62
  const s = new Date(e, 0, 4), n = (s.getDay() + 6) % 7, a = new Date(s);
63
63
  a.setDate(s.getDate() - n);
64
64
  const i = new Date(a);
@@ -77,11 +77,11 @@ const ne = (t) => {
77
77
  for (let i = 1; i <= s; i++)
78
78
  a.push(new Date(t, e, i)), a.length === 7 && (n.push(a), a = []);
79
79
  return a.length > 0 && n.push(a), n;
80
- }, le = (t, e, s) => {
80
+ }, oe = (t, e, s) => {
81
81
  const n = /* @__PURE__ */ new Date();
82
82
  return n.getDate() === t && n.getMonth() === e && n.getFullYear() === s;
83
- }, re = ({ day: t, month: e, year: s, weekNumber: n, selectWeek: a }) => {
84
- const i = le(t, e, s);
83
+ }, le = ({ day: t, month: e, year: s, weekNumber: n, selectWeek: a }) => {
84
+ const i = oe(t, e, s);
85
85
  return v({
86
86
  text: t || "",
87
87
  disabled: !t,
@@ -92,10 +92,10 @@ const ne = (t) => {
92
92
  `,
93
93
  click: () => a(n, s)
94
94
  });
95
- }, ce = (t, e) => {
96
- const s = new Date(t, e, 1).getDay(), n = new Date(t, e + 1, 0).getDate(), a = ie(t, e, s), i = Array.from({ length: n }, (r, p) => new Date(t, e, p + 1)), l = (a.length + i.length) % 7, d = l === 0 ? 0 : 7 - l, c = oe(t, e, d), h = [...a, ...i, ...c], f = [];
95
+ }, re = (t, e) => {
96
+ const s = new Date(t, e, 1).getDay(), n = new Date(t, e + 1, 0).getDate(), a = ae(t, e, s), i = Array.from({ length: n }, (r, p) => new Date(t, e, p + 1)), l = (a.length + i.length) % 7, d = l === 0 ? 0 : 7 - l, c = ie(t, e, d), h = [...a, ...i, ...c], f = [];
97
97
  for (let r = 0; r < h.length; r += 7) {
98
- const p = h.slice(r, r + 7), x = p.find((j) => j) || new Date(t, e, 1), { weekNumber: $, year: A } = ae(x);
98
+ const p = h.slice(r, r + 7), x = p.find((j) => j) || new Date(t, e, 1), { weekNumber: $, year: A } = ne(x);
99
99
  f.push({
100
100
  weekNumber: $,
101
101
  year: A,
@@ -103,8 +103,8 @@ const ne = (t) => {
103
103
  });
104
104
  }
105
105
  return f;
106
- }, de = ({ selectWeek: t }) => U("month", (e, s, { data: n }) => {
107
- const { year: a, month: i, currentDate: l } = n, d = ce(a, i);
106
+ }, ce = ({ selectWeek: t }) => U("month", (e, s, { data: n }) => {
107
+ const { year: a, month: i, currentDate: l } = n, d = re(a, i);
108
108
  return o(
109
109
  { class: "grid grid-cols-8 gap-1 text-sm px-4 py-2" },
110
110
  [
@@ -141,7 +141,7 @@ const ne = (t) => {
141
141
  o(
142
142
  { class: "grid grid-cols-7 col-span-7 text-center" },
143
143
  h.map(
144
- (r) => re({
144
+ (r) => le({
145
145
  year: (r == null ? void 0 : r.getFullYear()) || null,
146
146
  month: (r == null ? void 0 : r.getMonth()) || null,
147
147
  day: (r == null ? void 0 : r.getDate()) || null,
@@ -169,7 +169,7 @@ const ne = (t) => {
169
169
  variant: "icon",
170
170
  icon: t === "Previous" ? w.chevron.single.left : w.chevron.single.right
171
171
  }
172
- ), he = ({ next: t, previous: e }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
172
+ ), de = ({ next: t, previous: e }) => o({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
173
173
  y("[[monthName]] [[year]]"),
174
174
  W({
175
175
  label: "Previous",
@@ -233,7 +233,7 @@ class Je extends g {
233
233
  * @returns {string}
234
234
  */
235
235
  getMonthName(e) {
236
- return K.monthNames[e];
236
+ return q.monthNames[e];
237
237
  }
238
238
  /**
239
239
  * Updates the calendar to show the previous month.
@@ -288,18 +288,21 @@ class Je extends g {
288
288
  */
289
289
  render() {
290
290
  return o({ class: "week-calendar-container border rounded-md bg-background p-3" }, [
291
- he({
291
+ de({
292
292
  next: () => this.goToNextMonth(),
293
293
  previous: () => this.goToPreviousMonth()
294
294
  }),
295
- de({
295
+ ce({
296
296
  selectWeek: (e, s) => this.selectWeek(e, s)
297
297
  })
298
298
  ]);
299
299
  }
300
300
  }
301
- const ue = (t) => P({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
302
- Y((e) => new J({ class: "mr-2", onChange: () => e.toggleAllSelectedRows() }))
301
+ const he = (t, e) => {
302
+ const s = e.toggleAllSelectedRows();
303
+ t.target.checked = !s;
304
+ }, ue = (t) => P({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class || ""}` }, [
305
+ new V({ class: "mr-2", onChange: he })
303
306
  ]), ge = ({ align: t, sortable: e, key: s, label: n, sort: a, class: i }) => {
304
307
  const l = t || "justify-start";
305
308
  return P({
@@ -308,11 +311,11 @@ const ue = (t) => P({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class
308
311
  }, [
309
312
  o({ class: `flex flex-auto w-full items-center ${l}` }, [
310
313
  y(n),
311
- e && E({ class: "ml-2", html: w.arrows.upDown })
314
+ e && Y({ class: "ml-2", html: w.arrows.upDown })
312
315
  ])
313
316
  ]);
314
- }, fe = (t) => F([
315
- H({
317
+ }, fe = (t) => E([
318
+ F({
316
319
  class: "text-muted-foreground border-b",
317
320
  map: [t.headers, (e) => e.label === "checkbox" ? ue({ toggle: t.toggle }) : ge({
318
321
  align: e.align,
@@ -322,7 +325,7 @@ const ue = (t) => P({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class
322
325
  sort: t.sort
323
326
  })]
324
327
  })
325
- ]), pe = ({ key: t, rows: e, selectRow: s, rowItem: n }) => new _({
328
+ ]), pe = ({ key: t, rows: e, selectRow: s, rowItem: n }) => new K({
326
329
  cache: "table",
327
330
  key: t,
328
331
  items: e,
@@ -344,11 +347,11 @@ const ue = (t) => P({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class
344
347
  /**
345
348
  * This will toggle all selected rows.
346
349
  *
347
- * @returns {void}
350
+ * @returns {boolean}
348
351
  */
349
352
  toggleAllSelectedRows() {
350
353
  const t = this.table.getRows(), e = this.data.selectedRows.length === t.length, s = e ? [] : t;
351
- this.data.selectedRows = s, this.updateSelected(), this.updateTable(!e);
354
+ return this.data.selectedRows = s, this.updateSelected(), this.updateTable(!select), e;
352
355
  },
353
356
  /**
354
357
  * This will update the selected state.
@@ -398,7 +401,7 @@ const ue = (t) => P({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class
398
401
  const t = this.rows, e = this.border !== !1 ? "border" : "";
399
402
  return o({ class: "w-full" }, [
400
403
  o({ class: `w-full rounded-md ${e} overflow-x-auto` }, [
401
- Q({ class: "w-full" }, [
404
+ H({ class: "w-full" }, [
402
405
  // @ts-ignore
403
406
  this.headers && fe({ headers: this.headers, sort: (s) => this.sortRows(s) }),
404
407
  // @ts-ignore
@@ -486,13 +489,13 @@ const ue = (t) => P({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class
486
489
  m({ class: "text-xs leading-5 text-gray-500" }, "Online")
487
490
  ]), be = (t) => m({ class: "text-xs leading-5 text-muted-foreground" }, [
488
491
  y("Last seen "),
489
- X({ datetime: t }, "3h ago")
492
+ Q({ datetime: t }, "3h ago")
490
493
  ]), xe = (t, e) => t === "online" ? we() : be(e), ke = u(({ role: t, lastSeen: e, status: s }) => o({ class: "hidden shrink-0 sm:flex sm:flex-col sm:items-end" }, [
491
494
  m({ class: "text-sm leading-6 m-0" }, t),
492
495
  xe(s, e)
493
496
  ])), ve = (t) => t.split(" ").map((s) => s[0]).join(""), ye = u((t) => D({ class: "fadeIn flex justify-between gap-x-6 py-4 px-4 rounded-md hover:bg-muted/50" }, [
494
497
  o({ class: "flex min-w-0 gap-x-4" }, [
495
- te({ src: t.image, alt: t.name, fallbackText: ve(t.name) }),
498
+ ee({ src: t.image, alt: t.name, fallbackText: ve(t.name) }),
496
499
  me({ name: t.name, email: t.email })
497
500
  ]),
498
501
  ke({
@@ -500,7 +503,7 @@ const ue = (t) => P({ class: `cursor-pointer py-3 px-4 text-base w-10 ${t.class
500
503
  lastSeen: t.lastSeen,
501
504
  status: t.status
502
505
  })
503
- ])), et = u((t) => new G({
506
+ ])), et = u((t) => new _({
504
507
  cache: "list",
505
508
  key: "name",
506
509
  items: t.users,
@@ -852,7 +855,7 @@ const Ce = u(({ index: t, click: e, state: s }, n) => D({
852
855
  class: "border rounded-md list-none m-0 p-0 max-h-[400px] overflow-y-auto",
853
856
  for: ["filteredOptions", (s, n) => Ce({ index: n, click: t, state: e }, s.label)]
854
857
  })), Ie = 100, Te = u((t) => o({ class: "relative flex items-center" }, [
855
- Z({
858
+ J({
856
859
  cache: "input",
857
860
  placeholder: t.placeholder ?? "Search...",
858
861
  bind: [t.state, "searchQuery"],
@@ -870,7 +873,7 @@ const Ce = u(({ index: t, click: e, state: s }, n) => D({
870
873
  class: "relative flex fle-auto flex-col",
871
874
  onState: ["open", (e, s, n) => {
872
875
  if (e)
873
- return new se({
876
+ return new te({
874
877
  cache: "dropdown",
875
878
  parent: n,
876
879
  button: n.input,
@@ -1322,7 +1325,7 @@ class Ye extends g {
1322
1325
  onCreated() {
1323
1326
  this.lineWidth = this.lineWidth || 3, this.lineColor = this.lineColor || "#000000", this.canvas = null, this.ctx = null, this.status = "stopped";
1324
1327
  const e = 1e3 / 60;
1325
- this.timer = new V(e, this.draw.bind(this)), this.width = 0, this.height = 0, this.signed = !1, this.mouse = { x: 0, y: 0, status: "up" }, this.margin = this.margin || { x: 40, y: 60 }, this.targetSize = this.targetSize || { width: 740, height: 345 }, this.baseLineWidth = this.baseLineWidth || 2, this.baseStrokeColor = this.baseStrokeColor || "#000000";
1328
+ this.timer = new G(e, this.draw.bind(this)), this.width = 0, this.height = 0, this.signed = !1, this.mouse = { x: 0, y: 0, status: "up" }, this.margin = this.margin || { x: 40, y: 60 }, this.targetSize = this.targetSize || { width: 740, height: 345 }, this.baseLineWidth = this.baseLineWidth || 2, this.baseStrokeColor = this.baseStrokeColor || "#000000";
1326
1329
  }
1327
1330
  /**
1328
1331
  * Renders a <canvas> element.
@@ -1330,7 +1333,7 @@ class Ye extends g {
1330
1333
  * @returns {object} Layout definition for the canvas.
1331
1334
  */
1332
1335
  render() {
1333
- return q({
1336
+ return X({
1334
1337
  style: "touch-action: none; -webkit-user-select: none; -webkit-touch-callout: none;"
1335
1338
  });
1336
1339
  }
@@ -1555,7 +1558,7 @@ class ct extends g {
1555
1558
  */
1556
1559
  render() {
1557
1560
  return o({ class: "signature-panel relative flex flex-auto overflow-hidden select-none" }, [
1558
- ee({
1561
+ Z({
1559
1562
  cache: "hiddenInput",
1560
1563
  required: !0,
1561
1564
  bind: this.path + ".data"
@@ -1629,15 +1632,15 @@ export {
1629
1632
  fe as T,
1630
1633
  ye as U,
1631
1634
  Je as W,
1632
- oe as a,
1635
+ ie as a,
1633
1636
  T as b,
1634
- ae as c,
1637
+ ne as c,
1635
1638
  Ge as d,
1636
1639
  Ve as e,
1637
- re as f,
1638
- ie as g,
1639
- de as h,
1640
- he as i,
1640
+ le as f,
1641
+ ae as g,
1642
+ ce as h,
1643
+ de as i,
1641
1644
  Ze as j,
1642
1645
  et as k,
1643
1646
  nt as l,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/ui",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
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": {