@base-framework/ui 1.0.214 → 1.0.215

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,12 +1,12 @@
1
- import { Div as i, Img as j, Span as P, Button as I, OnState as W } from "@base-framework/atoms";
2
- import { Component as N, Data as Y, Atom as z, DateTime as B } from "@base-framework/base";
1
+ import { Div as l, Img as j, Span as $, Button as I, OnState as W } from "@base-framework/atoms";
2
+ import { Component as N, Data as z, Atom as Y, DateTime as B } from "@base-framework/base";
3
3
  import { B as m } from "./buttons-Cm9etaEG.js";
4
4
  import { Icons as S } from "./icons.es.js";
5
5
  const H = (e, t) => {
6
- const n = e ? e.getBoundingClientRect() : { top: 0, bottom: 0, left: 0 }, s = t.getBoundingClientRect(), a = 10, r = globalThis.scrollX, l = globalThis.scrollY;
7
- let c = n.left + r, g = n.bottom + l;
6
+ const n = e ? e.getBoundingClientRect() : { top: 0, bottom: 0, left: 0 }, s = t.getBoundingClientRect(), a = 10, r = globalThis.scrollX, i = globalThis.scrollY;
7
+ let c = n.left + r, g = n.bottom + i;
8
8
  const d = globalThis.innerHeight - n.bottom, h = n.top;
9
- return c + s.width > globalThis.innerWidth && (c = globalThis.innerWidth - s.width - a), d < s.height && h > d ? g = n.top + l - s.height - a : d < s.height && (g = n.bottom + l - (s.height - d) - a), { x: c, y: g };
9
+ return c + s.width > globalThis.innerWidth && (c = globalThis.innerWidth - s.width - a), d < s.height && h > d ? g = n.top + i - s.height - a : d < s.height && (g = n.bottom + i - (s.height - d) - a), { x: c, y: g };
10
10
  };
11
11
  class ht extends N {
12
12
  /**
@@ -15,7 +15,7 @@ class ht extends N {
15
15
  * @returns {object}
16
16
  */
17
17
  setData() {
18
- const t = this.parent.data || new Y();
18
+ const t = this.parent.data || new z();
19
19
  return t.set({
20
20
  position: { x: 0, y: 0 }
21
21
  }), t;
@@ -56,7 +56,7 @@ class ht extends N {
56
56
  */
57
57
  render() {
58
58
  const t = this.getSize();
59
- return i({
59
+ return l({
60
60
  class: `absolute inset-auto fadeIn mt-2 rounded-md p-0 shadow-lg bg-popover min-h-12 backdrop:bg-transparent text-inherit r z-30 ${t}`,
61
61
  popover: "manual",
62
62
  toggle: (n, { state: s }) => n.newState === "closed" ? s.open = !1 : null,
@@ -136,7 +136,7 @@ class ht extends N {
136
136
  this.panel.hidePopover();
137
137
  }
138
138
  }
139
- const R = z(({ src: e, alt: t }) => e ? j({
139
+ const R = Y(({ src: e, alt: t }) => e ? j({
140
140
  class: "absolute w-full h-full rounded-full object-cover fadeIn",
141
141
  src: e,
142
142
  alt: t,
@@ -144,7 +144,7 @@ const R = z(({ src: e, alt: t }) => e ? j({
144
144
  * If there's an error loading the image, hide it.
145
145
  */
146
146
  error: (n) => n.target.style.display = "none"
147
- }) : null), X = (e) => e && (Array.isArray(e) && (e = e.join(" ")), typeof e != "string" && (e = String(e)), e.split(" ").map((t) => t.charAt(0)).join("").toUpperCase()), O = (e) => !e || e.length < 2 ? e : X(e), E = (e) => P([e, (t, n) => {
147
+ }) : null), X = (e) => e && (Array.isArray(e) && (e = e.join(" ")), typeof e != "string" && (e = String(e)), e.split(" ").map((t) => t.charAt(0)).join("").toUpperCase()), O = (e) => !e || e.length < 2 ? e : X(e), E = (e) => $([e, (t, n) => {
148
148
  n.textContent = O(t);
149
149
  }]), T = {
150
150
  xs: "h-6 w-6",
@@ -168,7 +168,7 @@ const R = z(({ src: e, alt: t }) => e ? j({
168
168
  default: "text-base"
169
169
  }, G = (e) => T[e] || T.default, L = (e) => k[e] || k.default, U = (e, t = null, n = "md") => {
170
170
  const s = O(e), a = L(n);
171
- return i(
171
+ return l(
172
172
  {
173
173
  class: `
174
174
  flex items-center justify-center w-full h-full rounded-full
@@ -177,12 +177,12 @@ const R = z(({ src: e, alt: t }) => e ? j({
177
177
  `
178
178
  },
179
179
  [
180
- t ? E(t) : P({ class: "uppercase" }, s)
180
+ t ? E(t) : $({ class: "uppercase" }, s)
181
181
  ]
182
182
  );
183
- }, dt = z(({ src: e, alt: t, fallbackText: n, watcherFallback: s, size: a }) => {
183
+ }, dt = Y(({ src: e, alt: t, fallbackText: n, watcherFallback: s, size: a }) => {
184
184
  const r = G(a);
185
- return i(
185
+ return l(
186
186
  {
187
187
  class: `relative flex items-center justify-center ${r}`
188
188
  },
@@ -191,19 +191,21 @@ const R = z(({ src: e, alt: t }) => e ? j({
191
191
  U(n, s, a)
192
192
  ]
193
193
  );
194
- }), _ = ({ currentYear: e, onSelect: t }) => i(
194
+ }), _ = ({ currentMonth: e, currentYear: t, onSelect: n }) => l(
195
195
  { class: "grid grid-cols-3 gap-2" },
196
196
  B.monthNames.map(
197
- (n, s) => m(
197
+ (s, a) => m(
198
198
  {
199
- click: () => t(s),
200
- variant: "ghost",
201
- "aria-label": `Select ${n} ${e}`
199
+ click: (r) => {
200
+ r.preventDefault(), r.stopPropagation(), n(a);
201
+ },
202
+ variant: e === a ? "ghost" : "primary",
203
+ "aria-label": `Select ${s} ${t}`
202
204
  },
203
- n.substring(0, 3)
205
+ s.substring(0, 3)
204
206
  )
205
207
  )
206
- ), D = (e) => (e *= 1, e < 10 ? `0${e}` : String(e)), q = (e) => (e.indexOf("T") === -1 && e.indexOf(" ") === -1 && (e += "T00:00:01"), e.replace(" ", "T"), e), x = (e, t, n) => `${e}-${D(t + 1)}-${D(n)}`, J = (e) => e ? "bg-accent text-primary" : "", K = (e) => e ? "text-muted-foreground opacity-50" : "", Q = (e, t) => e === t, V = (e, t) => Q(e, t) ? "bg-primary text-primary-foreground" : "", Z = (e, t, n, s) => {
208
+ ), x = (e) => (e *= 1, e < 10 ? `0${e}` : String(e)), q = (e) => (e.indexOf("T") === -1 && e.indexOf(" ") === -1 && (e += "T00:00:01"), e.replace(" ", "T"), e), D = (e, t, n) => `${e}-${x(t + 1)}-${x(n)}`, J = (e) => e ? "bg-accent text-primary" : "", K = (e) => e ? "text-muted-foreground opacity-50" : "", Q = (e, t) => e === t, V = (e, t) => Q(e, t) ? "bg-primary text-primary-foreground" : "", Z = (e, t, n, s) => {
207
209
  const a = V(t, s);
208
210
  return a || (e ? J(e) : n ? K(n) : "text-foreground");
209
211
  }, C = (e) => {
@@ -213,7 +215,7 @@ const R = z(({ src: e, alt: t }) => e ? j({
213
215
  date: s,
214
216
  isToday: a,
215
217
  isOutsideMonth: r,
216
- select: l,
218
+ select: i,
217
219
  disabled: c
218
220
  } = e;
219
221
  return I(
@@ -227,19 +229,19 @@ const R = z(({ src: e, alt: t }) => e ? j({
227
229
  disabled: c || t === null,
228
230
  "aria-label": t ? `Day ${t}` : null,
229
231
  // Only call select if it's not disabled.
230
- click: () => !c && l(s)
232
+ click: () => !c && i(s)
231
233
  },
232
234
  t.toString()
233
235
  );
234
236
  }, M = (e, t, n, s) => e === s.date && t === s.month && n === s.year, tt = (e, t, n, s = !1) => {
235
- const { year: a, month: r } = e, l = x(a, r, e.date), c = new Date(a, r, 1).getDay(), g = new Date(a, r + 1, 0).getDate(), d = new Date(a, r, 0).getDate(), h = [], y = r === 0 ? 11 : r - 1, w = r === 0 ? a - 1 : a;
237
+ const { year: a, month: r } = e, i = D(a, r, e.date), c = new Date(a, r, 1).getDay(), g = new Date(a, r + 1, 0).getDate(), d = new Date(a, r, 0).getDate(), h = [], y = r === 0 ? 11 : r - 1, w = r === 0 ? a - 1 : a;
236
238
  for (let o = c - 1; o >= 0; o--) {
237
239
  const u = d - o, f = M(u, y, w, t), p = new Date(w, y, u) < new Date(t.year, t.month, t.date), F = s && p;
238
240
  h.push(
239
241
  C({
240
242
  day: u,
241
- currentDate: l,
242
- date: x(w, y, u),
243
+ currentDate: i,
244
+ date: D(w, y, u),
243
245
  isToday: f,
244
246
  isOutsideMonth: !0,
245
247
  select: n,
@@ -252,8 +254,8 @@ const R = z(({ src: e, alt: t }) => e ? j({
252
254
  h.push(
253
255
  C({
254
256
  day: o,
255
- currentDate: l,
256
- date: x(a, r, o),
257
+ currentDate: i,
258
+ date: D(a, r, o),
257
259
  isToday: u,
258
260
  isOutsideMonth: !1,
259
261
  select: n,
@@ -267,8 +269,8 @@ const R = z(({ src: e, alt: t }) => e ? j({
267
269
  h.push(
268
270
  C({
269
271
  day: o,
270
- currentDate: l,
271
- date: x(b, v, o),
272
+ currentDate: i,
273
+ date: D(b, v, o),
272
274
  isToday: u,
273
275
  isOutsideMonth: !0,
274
276
  select: n,
@@ -277,7 +279,7 @@ const R = z(({ src: e, alt: t }) => e ? j({
277
279
  );
278
280
  }
279
281
  return h;
280
- }, $ = ({ label: e, click: t }) => m(
282
+ }, P = ({ label: e, click: t }) => m(
281
283
  {
282
284
  class: `
283
285
  inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
@@ -290,28 +292,28 @@ const R = z(({ src: e, alt: t }) => e ? j({
290
292
  variant: "icon",
291
293
  icon: e === "Previous" ? S.chevron.single.left : S.chevron.single.right
292
294
  }
293
- ), et = ({ onMonthClick: e, onYearClick: t, next: n, previous: s }) => i({ class: "flex items-center justify-center space-x-2 relative min-h-12 text-sm font-medium" }, [
295
+ ), et = ({ onMonthClick: e, onYearClick: t, next: n, previous: s }) => l({ class: "flex items-center justify-center space-x-2 relative min-h-12 text-sm font-medium" }, [
294
296
  m({ click: e, variant: "ghost", "aria-label": "Select month" }, "[[monthName]]"),
295
297
  m({ click: t, variant: "ghost", "aria-label": "Select year" }, "[[current.year]]"),
296
- $({ label: "Previous", click: s }),
297
- $({ label: "Next", click: n })
298
- ]), nt = (e) => i(
298
+ P({ label: "Previous", click: s }),
299
+ P({ label: "Next", click: n })
300
+ ]), nt = (e) => l(
299
301
  { class: "flex items-center justify-center h-9 w-auto text-[0.8rem] font-normal text-muted-foreground" },
300
302
  e
301
- ), st = () => ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(nt), at = (e) => i({ class: "rdp w-full space-y-1" }, [
303
+ ), st = () => ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(nt), at = (e) => l({ class: "rdp w-full space-y-1" }, [
302
304
  et({
303
305
  onMonthClick: e.onMonthClick,
304
306
  onYearClick: e.onYearClick,
305
307
  next: e.next,
306
308
  previous: e.previous
307
309
  }),
308
- i({
310
+ l({
309
311
  class: "flex flex-auto flex-col w-full",
310
312
  onSet: [
311
313
  "currentDate",
312
314
  () => [
313
- i({ class: "grid grid-cols-7" }, st()),
314
- i(
315
+ l({ class: "grid grid-cols-7" }, st()),
316
+ l(
315
317
  { class: "grid grid-cols-7" },
316
318
  tt(
317
319
  e.current,
@@ -324,14 +326,16 @@ const R = z(({ src: e, alt: t }) => e ? j({
324
326
  ]
325
327
  })
326
328
  ]), rt = ({ currentMonth: e, currentYear: t, onSelect: n }) => {
327
- const s = t - 50, a = Array.from({ length: 101 }, (r, l) => s + l);
328
- return i(
329
+ const s = t - 50, a = Array.from({ length: 101 }, (r, i) => s + i);
330
+ return l(
329
331
  { class: "grid grid-cols-4 gap-2 overflow-y-auto max-h-72" },
330
332
  a.map(
331
333
  (r) => m(
332
334
  {
333
- click: () => n(r),
334
- variant: "ghost",
335
+ click: (i) => {
336
+ i.preventDefault(), i.stopPropagation(), n(r);
337
+ },
338
+ variant: r === t ? "ghost" : "primary",
335
339
  "aria-label": `Select ${r}`
336
340
  },
337
341
  r.toString()
@@ -365,7 +369,7 @@ class gt extends N {
365
369
  */
366
370
  setData() {
367
371
  const t = /* @__PURE__ */ new Date(), n = this.getSelectedDate(t), s = n.getMonth();
368
- return new Y({
372
+ return new z({
369
373
  monthName: this.getMonthName(s),
370
374
  currentDate: `${n.getFullYear()}-${s + 1}-${n.getDate()}`,
371
375
  current: {
@@ -430,7 +434,7 @@ class gt extends N {
430
434
  */
431
435
  setCurrentDate(t, n, s = null) {
432
436
  const a = this.data;
433
- a.current.month = t, a.current.year = n, typeof s == "number" && (a.current.date = D(s)), a.currentDate = `${n}-${D(t + 1)}-${a.current.date}`, a.monthName = this.getMonthName(t);
437
+ a.current.month = t, a.current.year = n, typeof s == "number" && (a.current.date = x(s)), a.currentDate = `${n}-${x(t + 1)}-${a.current.date}`, a.monthName = this.getMonthName(t);
434
438
  }
435
439
  /**
436
440
  * This will select a date.
@@ -448,12 +452,13 @@ class gt extends N {
448
452
  * @returns {object}
449
453
  */
450
454
  render() {
451
- return i({ class: "calendar-container p-3 rounded-md border min-w-80" }, [
455
+ return l({ class: "calendar-container p-3 rounded-md border min-w-80" }, [
452
456
  W("view", (t) => {
453
457
  switch (t) {
454
458
  case "months":
455
459
  return _(
456
460
  {
461
+ currentMonth: this.data.current.month,
457
462
  currentYear: this.data.current.year,
458
463
  onSelect: (n) => {
459
464
  this.setCurrentDate(n, this.data.current.year), this.state.view = "calendar";
@@ -494,12 +499,12 @@ export {
494
499
  dt as A,
495
500
  tt as C,
496
501
  C as D,
497
- x as F,
502
+ D as F,
498
503
  at as M,
499
504
  ht as P,
500
505
  nt as a,
501
506
  gt as b,
502
507
  q as c,
503
508
  H as g,
504
- D as p
509
+ x as p
505
510
  };
@@ -1,6 +1,6 @@
1
1
  import { Div as n, H5 as R, P as g, I as b, Li as O, Span as a, Ul as V, Button as m, OnState as v, Label as W, Form as G, H2 as C, Header as k, Footer as M, A as Y, H3 as J, Checkbox as K, Nav as Q, Input as S, UseParent as X, Time as Z, Dialog as ee } from "@base-framework/atoms";
2
2
  import { Atom as c, Component as x, Html as L, Dom as te, base as se, Data as D, Builder as H, Jot as I, DateTime as B } from "@base-framework/base";
3
- import { P as T, b as oe } from "./calendar-Bvg0AY6S.js";
3
+ import { P as T, b as oe } from "./calendar-g937lhWs.js";
4
4
  import { B as h, I as p } from "./buttons-Cm9etaEG.js";
5
5
  import { Icons as u } from "./icons.es.js";
6
6
  import { Timer as ne, List as le, DynamicTime as re } from "@base-framework/organisms";
package/dist/index.es.js CHANGED
@@ -3,9 +3,9 @@ import { B as g, I as C, L as T } from "./buttons-Cm9etaEG.js";
3
3
  import { C as D, d as I, D as S, c as B, E as P, F, H as M, I as k, M as N, N as f, P as v, R as x, T as y, a as h, b as W, U as H, W as L } from "./inputs-CMjx5-IX.js";
4
4
  import { V as w, a as U } from "./veil-D4dRxILB.js";
5
5
  import { Icons as E } from "./icons.es.js";
6
- import { A as O, 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, i as ra, g as na, e as la, h as ia, F as pa, d as ua, f as ma, u as da, M as ca, l as ga, N as Ca, P as Ta, p as ba, q as Da, S as Ia, n as Sa, o as Ba, T as Pa, y as Fa, z as Ma, m as ka, r as Na } from "./empty-state-Cmj6BpXb.js";
7
- import { A as va, b as xa, C as ya, D as ha, a as Wa, F as Ha, M as La, P as Aa, c as wa, g as Ua, p as Ra } from "./calendar-Bvg0AY6S.js";
8
- import { B as Ga, p as Oa, C as Va, j as ja, D as qa, m as za, k as Ja, H as _a, I as Ka, N as Qa, O as Xa, P as Ya, S as Za, n as $a, o as as, t as ss, s as es, q as os, r as ts, T as rs, l as ns, U as ls, W as is, f as ps, h as us, i as ms, c as ds, d as cs, b as gs, e as Cs, a as Ts, g as bs } from "./signature-panel--Rz3Tmii.js";
6
+ import { A as O, 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, i as ra, g as na, e as la, h as ia, F as pa, d as ua, f as ma, u as da, M as ca, l as ga, N as Ca, P as Ta, p as ba, q as Da, S as Ia, n as Sa, o as Ba, T as Pa, y as Fa, z as Ma, m as ka, r as Na } from "./empty-state-DX8ih8Tm.js";
7
+ import { A as va, b as xa, C as ya, D as ha, a as Wa, F as Ha, M as La, P as Aa, c as wa, g as Ua, p as Ra } from "./calendar-g937lhWs.js";
8
+ import { B as Ga, p as Oa, C as Va, j as ja, D as qa, m as za, k as Ja, H as _a, I as Ka, N as Qa, O as Xa, P as Ya, S as Za, n as $a, o as as, t as ss, s as es, q as os, r as ts, T as rs, l as ns, U as ls, W as is, f as ps, h as us, i as ms, c as ds, d as cs, b as gs, e as Cs, a as Ts, g as bs } from "./signature-panel-BVYXGRnM.js";
9
9
  import { B as Is, I as Ss, M as Bs, d as Ps, e as Fs, g as Ms, N as ks, b as Ns, a as fs, f as vs, P as xs, c as ys, S as hs, T as Ws } from "./mobile-nav-wrapper-Dj67Pb8l.js";
10
10
  import { B as Ls, a as As, C as ws, F as Us, b as Rs, c as Es, M as Gs, P as Os, S as Vs } from "./sidebar-menu-page-BVryQj2Z.js";
11
11
  import { A as qs, F as zs, M as Js, a as _s, T as Ks } from "./aside-template-McEj_Gxc.js";
@@ -1,5 +1,5 @@
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 p, s as C, c as d, a as g, b as F, I as T, i as A, g as P, e as f, h as w, F as I, d as b, f as y, u as B, M, l as x, N as k, P as v, p as E, q as N, S as h, n as L, o as R, T as U, y as j, z as q, m as z, r as G } from "./empty-state-Cmj6BpXb.js";
2
- import { A as O, P as _, g as J } from "./calendar-Bvg0AY6S.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 p, s as C, c as d, a as g, b as F, I as T, i as A, g as P, e as f, h as w, F as I, d as b, f as y, u as B, M, l as x, N as k, P as v, p as E, q as N, S as h, n as L, o as R, T as U, y as j, z as q, m as z, r as G } from "./empty-state-DX8ih8Tm.js";
2
+ import { A as O, P as _, g as J } from "./calendar-g937lhWs.js";
3
3
  export {
4
4
  o as Alert,
5
5
  O as Avatar,
@@ -1,5 +1,5 @@
1
- import { B as s, p as t, C as o, j as r, D as n, m as l, k as i, H as b, I as d, N as p, O as u, P as v, S as D, n as g, o as N, t as k, s as c, q as C, r as T, T as M, l as m, U as y, W as B, f as W, h, i as S, c as H, d as P, b as I, e as f, a as x, g as L } from "./signature-panel--Rz3Tmii.js";
2
- import { b as F, C as U, D as G, a as j, F as q, M as w, c as z, p as A } from "./calendar-Bvg0AY6S.js";
1
+ import { B as s, p as t, C as o, j as r, D as n, m as l, k as i, H as b, I as d, N as p, O as u, P as v, S as D, n as g, o as N, t as k, s as c, q as C, r as T, T as M, l as m, U as y, W as B, f as W, h, i as S, c as H, d as P, b as I, e as f, a as x, g as L } from "./signature-panel-BVYXGRnM.js";
2
+ import { b as F, C as U, D as G, a as j, F as q, M as w, c as z, p as A } from "./calendar-g937lhWs.js";
3
3
  import { B as J, I as K, M as Q, d as R, e as V, g as X, N as Y, b as Z, a as _, f as $, P as aa, c as ea, S as sa, T as ta } from "./mobile-nav-wrapper-Dj67Pb8l.js";
4
4
  export {
5
5
  s as BackButton,
@@ -4,7 +4,7 @@ import { B as T, I as _ } from "./buttons-Cm9etaEG.js";
4
4
  import { Icons as x } from "./icons.es.js";
5
5
  import { TableBody as J, DataTableBody as Z, ScrollableTableBody as ee, List as te, IntervalTimer as se } from "@base-framework/organisms";
6
6
  import { C as ae, I as ie, H as ne } from "./inputs-CMjx5-IX.js";
7
- import { A as oe, P as le } from "./calendar-Bvg0AY6S.js";
7
+ import { A as oe, P as le } from "./calendar-g937lhWs.js";
8
8
  d((t, e) => ({
9
9
  class: "flex items-center px-4 py-2",
10
10
  ...t,
@@ -1,4 +1,5 @@
1
- export function MonthSelector({ currentYear, onSelect }: {
1
+ export function MonthSelector({ currentMonth, currentYear, onSelect }: {
2
+ currentMonth: number;
2
3
  currentYear: number;
3
4
  onSelect: Function;
4
5
  }): object;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/ui",
3
- "version": "1.0.214",
3
+ "version": "1.0.215",
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": {