@base-framework/ui 1.0.1727 → 1.0.2001

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.
Files changed (79) hide show
  1. package/copilot.md +80 -0
  2. package/dist/aside-template-sUm-F2f0.js +44 -0
  3. package/dist/atoms.es.js +31 -30
  4. package/dist/{bside-template-Du2m3rsE.js → bside-template-do_hXebn.js} +1 -1
  5. package/dist/{buttons-Cm9etaEG.js → buttons-CHEs54Wl.js} +23 -24
  6. package/dist/{confirmation-BxmDhBjv.js → empty-state-BfT4MKkN.js} +721 -335
  7. package/dist/form-group-CJzpq9Us.js +29 -0
  8. package/dist/format-BLolnx9j.js +122 -0
  9. package/dist/icons.es.js +4 -1
  10. package/dist/image-scaler-1G-JzJVG.js +530 -0
  11. package/dist/index.es.js +170 -151
  12. package/dist/inputs-9udyzkHR.js +210 -0
  13. package/dist/{mobile-nav-wrapper-Dj67Pb8l.js → mobile-nav-wrapper-Dm9DinRD.js} +2 -2
  14. package/dist/molecules.es.js +46 -39
  15. package/dist/organisms.es.js +55 -49
  16. package/dist/pages.es.js +1 -1
  17. package/dist/range-calendar-BMWSJTE0.js +833 -0
  18. package/dist/{sidebar-menu-page-BVryQj2Z.js → sidebar-menu-page-D4WMgz5U.js} +6 -6
  19. package/dist/{signature-panel-xXbYWejE.js → signature-panel-Bq-usDxi.js} +598 -252
  20. package/dist/templates.es.js +2 -2
  21. package/dist/{tooltip-CESEqMCU.js → tooltip-PupzYM1r.js} +27 -34
  22. package/dist/types/components/atoms/atoms.d.ts +1 -0
  23. package/dist/types/components/atoms/form/form-group.d.ts +12 -0
  24. package/dist/types/components/atoms/form/inputs/input-classes.d.ts +2 -2
  25. package/dist/types/components/atoms/form/inputs/inputs.d.ts +0 -7
  26. package/dist/types/components/molecules/date-time/date-range-picker.d.ts +10 -0
  27. package/dist/types/components/molecules/empty/empty-state.d.ts +9 -0
  28. package/dist/types/components/molecules/files/attachment/attachment-input.d.ts +9 -0
  29. package/dist/types/components/molecules/files/attachment/attachment.d.ts +10 -0
  30. package/dist/types/components/molecules/files/attachment/orientation.d.ts +1 -0
  31. package/dist/types/components/molecules/files/attachment/type.d.ts +1 -0
  32. package/dist/types/components/molecules/form/form-card.d.ts +31 -0
  33. package/dist/types/components/molecules/image/image-uploader.d.ts +9 -0
  34. package/dist/types/components/molecules/image/logo-uploader.d.ts +9 -0
  35. package/dist/types/components/molecules/molecules.d.ts +5 -0
  36. package/dist/types/components/molecules/notifications/notification.d.ts +3 -3
  37. package/dist/types/components/organisms/calendar/calendar.d.ts +6 -0
  38. package/dist/types/components/organisms/calendar/month/calendar-header.d.ts +7 -0
  39. package/dist/types/components/organisms/calendar/month-selector.d.ts +5 -0
  40. package/dist/types/components/organisms/calendar/range/calendar-header.d.ts +7 -0
  41. package/dist/types/components/organisms/calendar/range/day-header.d.ts +1 -0
  42. package/dist/types/components/organisms/calendar/range/days-of-week-header.d.ts +1 -0
  43. package/dist/types/components/organisms/calendar/range/month-calendar.d.ts +17 -0
  44. package/dist/types/components/organisms/calendar/range/month-selector.d.ts +5 -0
  45. package/dist/types/components/organisms/calendar/range/navigation-button.d.ts +1 -0
  46. package/dist/types/components/organisms/calendar/range/range-calendar.d.ts +72 -0
  47. package/dist/types/components/organisms/calendar/range/range-day-cell.d.ts +10 -0
  48. package/dist/types/components/organisms/calendar/range/range-days-grid.d.ts +6 -0
  49. package/dist/types/components/organisms/calendar/range/range-toggle.d.ts +7 -0
  50. package/dist/types/components/organisms/calendar/range/year-selector.d.ts +4 -0
  51. package/dist/types/components/organisms/calendar/year-selector.d.ts +5 -0
  52. package/dist/types/components/organisms/lists/data-table-body.d.ts +1 -1
  53. package/dist/types/components/organisms/lists/data-table.d.ts +7 -0
  54. package/dist/types/components/organisms/lists/dynamic-data-table.d.ts +2 -0
  55. package/dist/types/components/organisms/lists/dynamic-table.d.ts +2 -0
  56. package/dist/types/components/organisms/lists/scrollable-data-table.d.ts +2 -0
  57. package/dist/types/components/organisms/lists/scrollable-table.d.ts +2 -0
  58. package/dist/types/components/organisms/lists/skeleton-examples.d.ts +12 -0
  59. package/dist/types/components/organisms/lists/skeleton-table-row.d.ts +6 -0
  60. package/dist/types/components/organisms/organisms.d.ts +6 -0
  61. package/dist/types/components/organisms/tabs/button-tab.d.ts +2 -2
  62. package/dist/types/components/organisms/tabs/tab-group.d.ts +3 -3
  63. package/dist/types/components/organisms/tabs/tab-navigation.d.ts +2 -2
  64. package/dist/types/components/organisms/tabs/tab.d.ts +2 -2
  65. package/dist/types/components/organisms/tabs/underlined-button-tab.d.ts +60 -0
  66. package/dist/types/components/organisms/tabs/underlined-tab-group.d.ts +48 -0
  67. package/dist/types/components/organisms/tabs/underlined-tab-navigation.d.ts +63 -0
  68. package/dist/types/components/organisms/tabs/underlined-tab.d.ts +36 -0
  69. package/dist/types/demo.d.ts +0 -0
  70. package/dist/types/ui.d.ts +1 -0
  71. package/dist/types/utils/format/format.d.ts +78 -0
  72. package/dist/types/utils/utils.d.ts +2 -0
  73. package/dist/utils.es.js +7 -1
  74. package/dist/veil-CqnAmj-D.js +20 -0
  75. package/package.json +85 -85
  76. package/dist/aside-template-McEj_Gxc.js +0 -35
  77. package/dist/calendar-DQXME-2u.js +0 -440
  78. package/dist/inputs-Dmu4Z-7-.js +0 -209
  79. package/dist/veil-D4dRxILB.js +0 -21
@@ -1,440 +0,0 @@
1
- import { Div as i, Img as F, Span as M, Button as j } from "@base-framework/atoms";
2
- import { Component as N, Data as z, Atom as k, DateTime as I } from "@base-framework/base";
3
- import { B as Y } from "./buttons-Cm9etaEG.js";
4
- import { Icons as T } from "./icons.es.js";
5
- const W = (e, t) => {
6
- const s = e ? e.getBoundingClientRect() : { top: 0, bottom: 0, left: 0 }, n = t.getBoundingClientRect(), o = 10, r = globalThis.scrollX, l = globalThis.scrollY;
7
- let c = s.left + r, f = s.bottom + l;
8
- const h = globalThis.innerHeight - s.bottom, d = s.top;
9
- return c + n.width > globalThis.innerWidth && (c = globalThis.innerWidth - n.width - o), h < n.height && d > h ? f = s.top + l - n.height - o : h < n.height && (f = s.bottom + l - (n.height - h) - o), { x: c, y: f };
10
- };
11
- class lt extends N {
12
- /**
13
- * This will set up the data.
14
- *
15
- * @returns {object}
16
- */
17
- setData() {
18
- const t = this.parent.data || new z();
19
- return t.set({
20
- position: { x: 0, y: 0 }
21
- }), t;
22
- }
23
- /**
24
- * This will get the class size.
25
- *
26
- * @returns {string}
27
- */
28
- getSize() {
29
- switch (this.size || "lg") {
30
- // @ts-ignore
31
- case "sm":
32
- return "w-48";
33
- // @ts-ignore
34
- case "md":
35
- return "w-64";
36
- case "lg":
37
- return "w-[250px]";
38
- // @ts-ignore
39
- case "xl":
40
- return "w-96";
41
- // @ts-ignore
42
- case "2xl":
43
- return "w-[400px]";
44
- // @ts-ignore
45
- case "fit":
46
- return "w-fit";
47
- // @ts-ignore
48
- case "full":
49
- return "w-full";
50
- }
51
- }
52
- /**
53
- * This will render the modal component.
54
- *
55
- * @returns {object}
56
- */
57
- render() {
58
- const t = this.getSize();
59
- return i({
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
- popover: "manual",
62
- toggle: (s, { state: n }) => s.newState === "closed" ? n.open = !1 : null,
63
- style: "top: [[position.y]]px; left: [[position.x]]px"
64
- }, this.children);
65
- }
66
- /**
67
- * This will setup the states.
68
- *
69
- * @returns {object}
70
- */
71
- setupStates() {
72
- return {
73
- open: {
74
- id: this.parent.getId(),
75
- callBack: (n) => {
76
- this.state.open === !1 && this.destroy();
77
- }
78
- }
79
- };
80
- }
81
- /**
82
- * Updates the dropdown position.
83
- *
84
- * @returns {void}
85
- */
86
- updatePosition() {
87
- const t = this.button ?? null, s = this.panel, n = W(t, s);
88
- this.data.position = n;
89
- }
90
- /**
91
- * This will run after the setup.
92
- *
93
- * @returns {void}
94
- */
95
- afterSetup() {
96
- this.panel.showPopover(), this.updatePosition();
97
- }
98
- /**
99
- * This will check if the element clicked was in the
100
- * component of the button.
101
- *
102
- * @param {object} element
103
- * @returns {boolean}
104
- */
105
- isOutsideClick(t) {
106
- return !this.panel.contains(t) && this.button && !this.button.contains(t);
107
- }
108
- /**
109
- * This will set up the events.
110
- *
111
- * @returns {array}
112
- */
113
- setupEvents() {
114
- return [
115
- ["click", document, (t) => {
116
- this.isOutsideClick(t.target) && (this.state.open = !1);
117
- }],
118
- ["resize", globalThis, (t) => this.updatePosition()],
119
- ["scroll", document, (t) => this.updatePosition()]
120
- ];
121
- }
122
- /**
123
- * This will override the set up to use the app shell.
124
- *
125
- * @param {object} container
126
- */
127
- setContainer(t) {
128
- this.container = app.root;
129
- }
130
- /**
131
- * This will hide the popover before destroying.
132
- *
133
- * @returns {void}
134
- */
135
- beforeDestroy() {
136
- this.panel.hidePopover();
137
- }
138
- }
139
- const H = k(({ src: e, alt: t }) => e ? F({
140
- class: "absolute w-full h-full rounded-full object-cover fadeIn",
141
- src: e,
142
- alt: t,
143
- /**
144
- * If there's an error loading the image, hide it.
145
- */
146
- error: (s) => s.target.style.display = "none"
147
- }) : null), R = (e) => e && (Array.isArray(e) && (e = e.join(" ")), typeof e != "string" && (e = String(e)), e.split(" ").map((t) => t.charAt(0)).join("").toUpperCase()), B = (e) => !e || e.length < 2 ? e : R(e), X = (e) => M([e, (t, s) => {
148
- s.textContent = B(t);
149
- }]), S = {
150
- xs: "h-6 w-6",
151
- sm: "h-8 w-8",
152
- md: "h-12 w-12",
153
- lg: "h-16 w-16",
154
- xl: "h-24 w-24",
155
- "2xl": "h-32 w-32",
156
- "3xl": "h-48 w-48",
157
- "4xl": "h-64 w-64",
158
- default: "h-12 w-12"
159
- }, P = {
160
- xs: "text-[7px]",
161
- sm: "text-xs",
162
- md: "text-base",
163
- lg: "text-xl",
164
- xl: "text-2xl",
165
- "2xl": "text-3xl",
166
- "3xl": "text-4xl",
167
- "4xl": "text-5xl",
168
- default: "text-base"
169
- }, E = (e) => S[e] || S.default, G = (e) => P[e] || P.default, L = (e, t = null, s = "md") => {
170
- const n = B(e), o = G(s);
171
- return i(
172
- {
173
- class: `
174
- flex items-center justify-center w-full h-full rounded-full
175
- bg-muted text-muted-foreground font-medium
176
- ${o}
177
- `
178
- },
179
- [
180
- t ? X(t) : M({ class: "uppercase" }, n)
181
- ]
182
- );
183
- }, ct = k(({ src: e, alt: t, fallbackText: s, watcherFallback: n, size: o }) => {
184
- const r = E(o);
185
- return i(
186
- {
187
- class: `relative flex items-center justify-center ${r}`
188
- },
189
- [
190
- H({ src: e, alt: t }),
191
- L(s, n, o)
192
- ]
193
- );
194
- }), x = (e) => (e *= 1, e < 10 ? `0${e}` : String(e)), U = (e) => (e.indexOf("T") === -1 && e.indexOf(" ") === -1 && (e += "T00:00:01"), e.replace(" ", "T"), e), m = (e, t, s) => `${e}-${x(t + 1)}-${x(s)}`, q = (e) => e ? "bg-accent text-primary" : "", J = (e) => e ? "text-muted-foreground opacity-50" : "", K = (e, t) => e === t, Q = (e, t) => K(e, t) ? "bg-primary text-primary-foreground" : "", V = (e, t, s, n) => {
195
- const o = Q(t, n);
196
- return o || (e ? q(e) : s ? J(s) : "text-foreground");
197
- }, v = (e) => {
198
- const {
199
- day: t,
200
- currentDate: s,
201
- date: n,
202
- isToday: o,
203
- isOutsideMonth: r,
204
- select: l,
205
- disabled: c
206
- } = e;
207
- return j(
208
- {
209
- class: `
210
- flex items-center justify-center h-9 w-auto p-0 font-normal text-sm rounded-md
211
- ${V(o, s, r, n)}
212
- hover:bg-muted/50 hover:text-muted-foreground focus:z-10
213
- disabled:pointer-events-none disabled:opacity-50
214
- `,
215
- disabled: c || t === null,
216
- "aria-label": t ? `Day ${t}` : null,
217
- // Only call select if it's not disabled.
218
- click: () => !c && l(n)
219
- },
220
- t.toString()
221
- );
222
- }, C = (e, t, s, n) => e === n.date && t === n.month && s === n.year, Z = (e, t, s, n = !1) => {
223
- const { year: o, month: r } = e, l = m(o, r, e.date), c = new Date(o, r, 1).getDay(), f = new Date(o, r + 1, 0).getDate(), h = new Date(o, r, 0).getDate(), d = [], D = r === 0 ? 11 : r - 1, y = r === 0 ? o - 1 : o;
224
- for (let a = c - 1; a >= 0; a--) {
225
- const u = h - a, g = C(u, D, y, t), p = new Date(y, D, u) < new Date(t.year, t.month, t.date), A = n && p;
226
- d.push(
227
- v({
228
- day: u,
229
- currentDate: l,
230
- date: m(y, D, u),
231
- isToday: g,
232
- isOutsideMonth: !0,
233
- select: s,
234
- disabled: A
235
- })
236
- );
237
- }
238
- for (let a = 1; a <= f; a++) {
239
- const u = C(a, r, o, t), g = new Date(o, r, a) < new Date(t.year, t.month, t.date), p = n && g;
240
- d.push(
241
- v({
242
- day: a,
243
- currentDate: l,
244
- date: m(o, r, a),
245
- isToday: u,
246
- isOutsideMonth: !1,
247
- select: s,
248
- disabled: p
249
- })
250
- );
251
- }
252
- const w = r === 11 ? 0 : r + 1, b = r === 11 ? o + 1 : o, O = (7 - d.length % 7) % 7;
253
- for (let a = 1; a <= O; a++) {
254
- const u = C(a, w, b, t), g = new Date(b, w, a) < new Date(t.year, t.month, t.date), p = n && g;
255
- d.push(
256
- v({
257
- day: a,
258
- currentDate: l,
259
- date: m(b, w, a),
260
- isToday: u,
261
- isOutsideMonth: !0,
262
- select: s,
263
- disabled: p
264
- })
265
- );
266
- }
267
- return d;
268
- }, _ = (e) => i(
269
- { class: "flex items-center justify-center h-9 w-auto text-[0.8rem] font-normal text-muted-foreground" },
270
- e
271
- ), $ = ({ label: e, click: t }) => Y(
272
- {
273
- class: `
274
- inline-flex items-center justify-center h-7 w-7 bg-transparent p-0
275
- opacity-50 hover:opacity-100 text-muted-foreground absolute
276
- ${e === "Previous" ? "left-1" : "right-1"}
277
- focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2
278
- `,
279
- click: t,
280
- "aria-label": `${e} month`,
281
- variant: "icon",
282
- icon: e === "Previous" ? T.chevron.single.left : T.chevron.single.right
283
- }
284
- ), tt = ({ next: e, previous: t }) => i({ class: "flex flex-auto min-h-12 text-sm font-medium relative justify-center items-center" }, [
285
- M("[[monthName]] [[current.year]]"),
286
- $({
287
- label: "Previous",
288
- click: t
289
- }),
290
- $({
291
- label: "Next",
292
- click: e
293
- })
294
- ]), et = () => ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(_), st = (e) => i({ class: "rdp w-full space-y-1" }, [
295
- tt({
296
- next: e.next,
297
- previous: e.previous
298
- }),
299
- i({
300
- class: "flex flex-auto flex-col w-full",
301
- onSet: [
302
- "currentDate",
303
- () => [
304
- i({ class: "grid grid-cols-7" }, et()),
305
- i(
306
- { class: "grid grid-cols-7" },
307
- Z(
308
- e.current,
309
- e.today,
310
- e.select,
311
- e.blockPriorDates
312
- )
313
- )
314
- ]
315
- ]
316
- })
317
- ]);
318
- class ut extends N {
319
- /**
320
- * This will declare the props for the compiler.
321
- *
322
- * @returns {void}
323
- */
324
- declareProps() {
325
- this.selectedDate = null, this.selectedCallBack = null, this.blockPriorDates = !1;
326
- }
327
- /**
328
- * This will get the selected data.
329
- *
330
- * @param {object} today
331
- * @returns {Date}
332
- */
333
- getSelectedDate(t) {
334
- const s = this.selectedDate ? new Date(U(this.selectedDate)) : t;
335
- return new Date(s.getFullYear(), s.getMonth(), s.getDate());
336
- }
337
- /**
338
- * This will set up the data for the calendar.
339
- *
340
- * @returns {Data}
341
- */
342
- setData() {
343
- const t = /* @__PURE__ */ new Date(), s = this.getSelectedDate(t), n = s.getMonth();
344
- return new z({
345
- monthName: this.getMonthName(n),
346
- currentDate: `${s.getFullYear()}-${n + 1}-${s.getDate()}`,
347
- current: {
348
- date: s.getDate(),
349
- year: s.getFullYear(),
350
- month: n
351
- },
352
- today: {
353
- date: t.getDate(),
354
- month: t.getMonth(),
355
- year: t.getFullYear()
356
- }
357
- });
358
- }
359
- /**
360
- * This will get the name of the month.
361
- *
362
- * @param {number} month
363
- * @returns {string}
364
- */
365
- getMonthName(t) {
366
- return I.monthNames[t];
367
- }
368
- /**
369
- * This will go to the previous month.
370
- *
371
- * @returns {void}
372
- */
373
- goToPreviousMonth() {
374
- const t = this.data;
375
- let s = t.current.month, n = t.current.year;
376
- s === 0 ? (s = 11, n--) : s--, this.setCurrentDate(s, n);
377
- }
378
- /**
379
- * This will go to the next month.
380
- *
381
- * @returns {void}
382
- */
383
- goToNextMonth() {
384
- const t = this.data;
385
- let s = t.current.month, n = t.current.year;
386
- s === 11 ? (s = 0, n++) : s++, this.setCurrentDate(s, n);
387
- }
388
- /**
389
- * This will set the current month and year.
390
- *
391
- * @param {number} month
392
- * @param {number} year
393
- * @param {number} [date=null]
394
- * @returns {void}
395
- */
396
- setCurrentDate(t, s, n = null) {
397
- const o = this.data;
398
- o.current.month = t, o.current.year = s, typeof n == "number" && (o.current.date = x(n)), o.currentDate = `${s}-${x(t + 1)}-${o.current.date}`, o.monthName = this.getMonthName(t);
399
- }
400
- /**
401
- * This will select a date.
402
- *
403
- * @param {string} date
404
- * @returns {void}
405
- */
406
- selectDate(t) {
407
- const s = /* @__PURE__ */ new Date(t + "T00:00:00");
408
- this.setCurrentDate(s.getMonth(), s.getFullYear(), s.getDate()), typeof this.selectedCallBack == "function" && this.selectedCallBack(this.data.currentDate);
409
- }
410
- /**
411
- * This will render the calendar.
412
- *
413
- * @returns {object}
414
- */
415
- render() {
416
- return i({ class: "calendar-container p-3 rounded-md border min-w-80" }, [
417
- st({
418
- current: this.data.current,
419
- today: this.data.today,
420
- select: (t) => this.selectDate(t),
421
- next: () => this.goToNextMonth(),
422
- previous: () => this.goToPreviousMonth(),
423
- blockPriorDates: this.blockPriorDates || !1
424
- })
425
- ]);
426
- }
427
- }
428
- export {
429
- ct as A,
430
- Z as C,
431
- v as D,
432
- m as F,
433
- st as M,
434
- lt as P,
435
- _ as a,
436
- ut as b,
437
- U as c,
438
- W as g,
439
- x as p
440
- };
@@ -1,209 +0,0 @@
1
- import { Div as l, Label as d, Checkbox as u, Span as g, OnState as p, I as x, Input as r, Textarea as k } from "@base-framework/atoms";
2
- import { Jot as y, Atom as s } from "@base-framework/base";
3
- import { Icons as v } from "./icons.es.js";
4
- const $ = "flex h-10 w-full px-3 py-2 text-sm", b = "rounded-md border border-input bg-background", n = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background", a = "disabled:cursor-not-allowed disabled:opacity-50 [&:user-invalid]:border-destructive", f = "placeholder:text-muted-foreground", h = `${$} ${b} ${n} ${f} ${a}`, I = ({ id: e, checked: o, bind: t, required: i }) => u({
5
- id: e,
6
- cache: "checkbox",
7
- class: "absolute opacity-0 w-full h-full cursor-pointer pointer-events-none",
8
- aria: {
9
- checked: ["checked"]
10
- },
11
- required: i,
12
- checked: o,
13
- bind: t
14
- }), C = () => g({ class: "absolute text-xs pointer-events-none" }, [
15
- p(
16
- "checked",
17
- (e) => e ? x({
18
- class: "w-2 h-2 pointer-events-none",
19
- html: v.check
20
- }) : null
21
- )
22
- ]), w = ({ id: e, bind: o, checked: t, required: i, clickHandler: m }) => l({
23
- class: `relative flex items-center justify-center w-5 h-5 transition-colors duration-200 border-primary hover:border-accent-foreground
24
- ${b}
25
- ${n}
26
- ${a}`.trim(),
27
- onState: [
28
- "checked",
29
- {
30
- "bg-primary": !0,
31
- "text-primary-foreground": !0,
32
- "border-primary": !0
33
- }
34
- ],
35
- role: "checkbox",
36
- aria: {
37
- checked: ["checked"]
38
- },
39
- tabIndex: 0,
40
- click: m
41
- }, [
42
- I({ bind: o, checked: t, id: e, required: i }),
43
- C()
44
- ]), T = ({ id: e, label: o, clickHandler: t }) => d({
45
- class: "text-base cursor-pointer",
46
- htmlFor: e,
47
- click: t
48
- }, o), F = y(
49
- {
50
- /**
51
- * This will initialize the state of the checkbox.
52
- *
53
- * @returns {object}
54
- */
55
- state() {
56
- return {
57
- // @ts-ignore
58
- checked: this.checked ?? !1
59
- };
60
- },
61
- /**
62
- * This is added to check the checkbox after the component is rendered
63
- * to see if the bind updated the checked value.
64
- *
65
- * @returns {void}
66
- */
67
- after() {
68
- this.state.checked = this.checkbox.checked;
69
- },
70
- /**
71
- * This will handle the click event for the checkbox.
72
- *
73
- * @param {object} e
74
- * @returns {void}
75
- */
76
- clickHandler(e) {
77
- e.preventDefault(), e.stopPropagation(), this.state.toggle("checked"), this.checkbox.checked = this.state.checked, typeof this.onChange == "function" && this.onChange(this.state.checked, this);
78
- },
79
- /**
80
- * This will render the checkbox component.
81
- *
82
- * @returns {object}
83
- */
84
- render() {
85
- const e = this.getId(), o = (t) => this.clickHandler(t);
86
- return l({ class: `flex items-center space-x-2 cursor-pointer ${this.class || ""}` }, [
87
- w({
88
- id: e,
89
- // @ts-ignore
90
- bind: this.bind,
91
- // @ts-ignore
92
- checked: this.state.checked,
93
- // @ts-ignore
94
- required: this.required,
95
- // @ts-ignore
96
- clickHandler: o
97
- }),
98
- // @ts-ignore
99
- this.label && T({ id: e, label: this.label, clickHandler: o })
100
- ]);
101
- }
102
- }
103
- ), H = (e) => {
104
- if (!e || e.length === 0) return "";
105
- const t = e.replace(/\D/g, "").match(/^(\d{0,3})(\d{0,3})(\d{0,4})$/);
106
- return t ? t[2] ? `(${t[1]}) ${t[2]}${t[3] ? "-" + t[3] : ""}` : t[1] || "" : e;
107
- }, D = (e) => {
108
- const o = e.target, t = H(o.value);
109
- t && (o.value = t);
110
- }, c = s((e) => r({
111
- ...e,
112
- class: `${h} ${e.class || ""}`.trim()
113
- })), L = s((e) => c({
114
- ...e,
115
- type: "tel",
116
- name: e.name || "Phone",
117
- label: e.label || "Phone",
118
- placeholder: "(555) 555-5555",
119
- pattern: e.pattern || "\\(\\d{3}\\) \\d{3}-\\d{4}",
120
- keyup: D
121
- })), M = s((e) => c({
122
- ...e,
123
- type: "email",
124
- name: e.name || "Email",
125
- label: e.label || "Email",
126
- placeholder: "Email address"
127
- })), q = s((e) => k({
128
- ...e,
129
- as: "textarea",
130
- class: `flex w-full h-24 px-3 py-2 text-sm rounded-md border border-input bg-background ${n} ${f} ${a} ${e.class || ""}`.trim()
131
- })), R = (e = {}) => l({ class: "flex items-center space-x-2" }, [
132
- r({
133
- ...e,
134
- type: "radio",
135
- class: "cursor-pointer appearance-none h-4 w-4 border rounded-full checked:border-primary checked:bg-primary focus:ring focus:ring-primary".trim()
136
- }),
137
- e.label && d({ forHTML: e.value, class: "cursor-pointer" }, e.label)
138
- ]), U = s((e) => r({
139
- ...e,
140
- type: "date",
141
- class: `rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${e.class || ""}`.trim()
142
- })), W = s((e) => r({
143
- ...e,
144
- type: "time",
145
- class: `rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${e.class || ""}`.trim()
146
- })), j = s((e) => r({
147
- ...e,
148
- type: "datetime-local",
149
- class: `rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${e.class || ""}`.trim()
150
- })), z = s((e) => r({
151
- ...e,
152
- type: "month",
153
- class: `rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${e.class || ""}`.trim()
154
- })), A = s((e) => r({
155
- ...e,
156
- type: "week",
157
- class: `rounded-md border px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${e.class || ""}`.trim()
158
- })), B = s((e) => c({
159
- ...e,
160
- type: "number"
161
- })), J = s((e) => c({
162
- ...e,
163
- type: "password"
164
- })), O = s((e) => c({
165
- ...e,
166
- type: "search"
167
- })), G = s((e) => c({
168
- ...e,
169
- type: "url"
170
- })), K = s((e) => c({
171
- ...e,
172
- type: "hidden"
173
- })), Q = s((e) => r({
174
- ...e,
175
- type: "color",
176
- class: `border rounded-md border-input bg-background text-foreground p-0 disabled:cursor-not-allowed disabled:opacity-50 ${e.class || ""}`.trim()
177
- }));
178
- s((e) => u({
179
- ...e,
180
- class: `flex h-4 w-4 rounded-md border border-input bg-background text-foreground ${n} ${a} ${e.class || ""}`.trim()
181
- }));
182
- const E = "file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground", V = s((e) => r({
183
- ...e,
184
- type: "file",
185
- class: `${h} ${E} ${e.class || ""}`.trim()
186
- }));
187
- export {
188
- F as C,
189
- U as D,
190
- M as E,
191
- V as F,
192
- K as H,
193
- c as I,
194
- z as M,
195
- B as N,
196
- J as P,
197
- R,
198
- O as S,
199
- L as T,
200
- G as U,
201
- A as W,
202
- q as a,
203
- W as b,
204
- j as c,
205
- Q as d,
206
- a as e,
207
- n as f,
208
- h as g
209
- };
@@ -1,21 +0,0 @@
1
- import { Jot as r, Component as i } from "@base-framework/base";
2
- class l extends i {
3
- /**
4
- * This will set the component context.
5
- *
6
- * @param {object|null} context
7
- * @returns {object|null}
8
- */
9
- setContext(p) {
10
- var n, a, s, o;
11
- if (this.data)
12
- return null;
13
- const e = ((n = this == null ? void 0 : this.parent) == null ? void 0 : n.data) ?? ((s = (a = this == null ? void 0 : this.parent) == null ? void 0 : a.context) == null ? void 0 : s.data) ?? ((o = this == null ? void 0 : this.parent) == null ? void 0 : o.state) ?? null;
14
- return e ? { data: e } : null;
15
- }
16
- }
17
- const c = (t) => r(t, l);
18
- export {
19
- l as V,
20
- c as a
21
- };