@base-framework/ui 0.0.12 → 0.0.14

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.
@@ -31,15 +31,15 @@ const P = {
31
31
  bgColor: "bg-muted/10",
32
32
  iconColor: "text-muted-foreground"
33
33
  }
34
- }, re = (e, t) => n({ class: `flex items-center justify-center h-6 w-6 mr-3 ${t}` }, [
34
+ }, le = (e, t) => n({ class: `flex items-center justify-center h-6 w-6 mr-3 ${t}` }, [
35
35
  h({ html: e })
36
- ]), le = (e) => _({ class: "font-semibold" }, e), ie = (e) => p({ class: "text-sm text-muted-foreground" }, e), ht = c(({ title: e, description: t, icon: s, type: o = "default" }) => {
37
- const { borderColor: l, bgColor: r, iconColor: i } = P[o] || P.default;
38
- return n({ class: `flex items-start p-4 border rounded-lg ${r} ${l}` }, [
36
+ ]), re = (e) => _({ class: "font-semibold" }, e), ie = (e) => p({ class: "text-sm text-muted-foreground" }, e), ht = c(({ title: e, description: t, icon: s, type: o = "default" }) => {
37
+ const { borderColor: r, bgColor: l, iconColor: i } = P[o] || P.default;
38
+ return n({ class: `flex items-start p-4 border rounded-lg ${l} ${r}` }, [
39
39
  // Icon and content
40
- s && re(s, i),
40
+ s && le(s, i),
41
41
  n({ class: "flex flex-col" }, [
42
- le(e),
42
+ re(e),
43
43
  ie(t)
44
44
  ])
45
45
  ]);
@@ -174,15 +174,15 @@ const be = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
174
174
  invalid: s,
175
175
  input: t
176
176
  } : o)), Ce = c((e, t) => {
177
- const l = H(t, (r) => {
178
- r.target.checkValidity() && e.setError(null);
179
- }, (r) => {
180
- e.setError(r.target.validationMessage);
177
+ const r = H(t, (l) => {
178
+ l.target.checkValidity() && e.setError(null);
179
+ }, (l) => {
180
+ e.setError(l.target.validationMessage);
181
181
  });
182
182
  return n({
183
183
  ...e,
184
184
  class: "w-full"
185
- }, l);
185
+ }, r);
186
186
  }), ft = x(
187
187
  {
188
188
  /**
@@ -204,8 +204,8 @@ const be = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
204
204
  * @returns {object}
205
205
  */
206
206
  render() {
207
- const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this, l = (r) => {
208
- this.state.error = r, this.state.hasError = !!r;
207
+ const e = this.name, t = this.getId(`${e}`), { label: s, description: o } = this, r = (l) => {
208
+ this.state.error = l, this.state.hasError = !!l;
209
209
  };
210
210
  return n({ class: "flex flex-auto space-y-4" }, [
211
211
  be([
@@ -214,10 +214,10 @@ const be = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
214
214
  id: t,
215
215
  name: e,
216
216
  value: this.state.value,
217
- setError: l
217
+ setError: r
218
218
  }, this.children),
219
219
  o && we({ id: this.getId("description") }, o),
220
- n({ onState: ["error", (r) => r && ye(r)] })
220
+ n({ onState: ["error", (l) => l && ye(l)] })
221
221
  ])
222
222
  ]);
223
223
  }
@@ -232,11 +232,11 @@ const be = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
232
232
  ])), bt = (e, t) => n({ class: "flex justify-between" }, [
233
233
  a({ class: "text-muted-foreground" }, e),
234
234
  a(t)
235
- ]), De = ({ title: e, description: t, back: s, icon: o, options: l = [] }) => M({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10" }, [
235
+ ]), De = ({ title: e, description: t, back: s, icon: o, options: r = [] }) => M({ class: "modal-header bg-background/80 backdrop-blur-md sticky flex flex-none items-center py-4 px-6 z-10" }, [
236
236
  /**
237
237
  * Back Button
238
238
  */
239
- s && u({ variant: "icon", icon: d.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (r, i) => i.close() }),
239
+ s && u({ variant: "icon", icon: d.arrows.left, class: "mr-2 p-0 flex sm:hidden", click: (l, i) => i.close() }),
240
240
  /**
241
241
  * Icon
242
242
  */
@@ -249,7 +249,7 @@ const be = c((e, t) => n({ ...e, class: "flex flex-auto flex-col space-y-2" }, t
249
249
  B({ class: "text-lg font-semibold m-0" }, e),
250
250
  t && n({ class: "text-sm text-muted-foreground" }, t)
251
251
  ]),
252
- ...l
252
+ ...r
253
253
  ])
254
254
  ]), Ie = c((e, t) => n({
255
255
  popover: "manual",
@@ -271,7 +271,7 @@ class xt extends b {
271
271
  * @returns {void}
272
272
  */
273
273
  declareProps() {
274
- this.title = null, this.description = null, this.size = "md", this.type = "", this.hidePrimaryButton = !1, this.icon = null, this.onSubmit = null, this.onClose = null, this.back = !1;
274
+ this.title = null, this.description = null, this.size = null, this.type = null, this.hidePrimaryButton = !1, this.icon = null, this.onSubmit = null, this.onClose = null, this.back = !1;
275
275
  }
276
276
  /**
277
277
  * This will render the modal component.
@@ -473,14 +473,14 @@ class Me extends ae {
473
473
  * @returns {object}
474
474
  */
475
475
  render() {
476
- const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), l = this.href || null, r = this.getChildren(o);
477
- return l ? Be({
478
- href: l,
476
+ const { bgColor: t, borderColor: s, iconColor: o } = this.getTypeStyles(), r = this.href || null, l = this.getChildren(o);
477
+ return r ? Be({
478
+ href: r,
479
479
  class: `${t} ${s}`
480
- }, r) : $e({
480
+ }, l) : $e({
481
481
  close: this.close.bind(this),
482
482
  class: `${t} ${s}`
483
- }, r);
483
+ }, l);
484
484
  }
485
485
  /**
486
486
  * This will be called after the component is set up.
@@ -589,8 +589,8 @@ const z = window.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
589
589
  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',
590
590
  onState: ["method", { active: e }],
591
591
  dataSet: ["method", ["state", e, "active"]],
592
- click: (o, { state: l }) => {
593
- l.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), Pe(e);
592
+ click: (o, { state: r }) => {
593
+ r.method = e, localStorage.setItem("theme", e), e === "system" && localStorage.removeItem("theme"), Pe(e);
594
594
  }
595
595
  }, [
596
596
  D(s),
@@ -773,8 +773,8 @@ const z = window.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
773
773
  "bg-primary": e,
774
774
  "shadow-md": e
775
775
  }],
776
- click: (s, { data: o, onClick: l }) => {
777
- o.activeIndex = e, l && l(e);
776
+ click: (s, { data: o, onClick: r }) => {
777
+ o.activeIndex = e, r && r(e);
778
778
  }
779
779
  })
780
780
  ]), Ve = (e, t) => Array.from({ length: e }, (s, o) => Oe({
@@ -927,9 +927,9 @@ const z = window.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
927
927
  }), We = ({ bind: e, min: t, max: s, readonly: o = !1 }) => v({
928
928
  value: "[[count]]",
929
929
  bind: e,
930
- blur: (l, { state: r }) => {
931
- let i = parseInt(l.target.value, 10);
932
- isNaN(i) && (i = t ?? 0), t !== void 0 && (i = Math.max(i, t)), s !== void 0 && (i = Math.min(i, s)), r.count = i;
930
+ blur: (r, { state: l }) => {
931
+ let i = parseInt(r.target.value, 10);
932
+ isNaN(i) && (i = t ?? 0), t !== void 0 && (i = Math.max(i, t)), s !== void 0 && (i = Math.min(i, s)), l.count = i;
933
933
  },
934
934
  class: "flex flex-auto text-lg font-medium bg-transparent text-center border min-w-0",
935
935
  readonly: o,
@@ -1047,8 +1047,8 @@ const z = window.matchMedia, I = c(({ value: e, label: t, icon: s }) => m({
1047
1047
  new ne({
1048
1048
  dateTime: e,
1049
1049
  filter: s || ((o) => {
1050
- const l = A.getLocalTime(o, !0, !1, t);
1051
- return A.getTimeFrame(l);
1050
+ const r = A.getLocalTime(o, !0, !1, t);
1051
+ return A.getTimeFrame(r);
1052
1052
  })
1053
1053
  })
1054
1054
  ]);
@@ -1075,11 +1075,11 @@ function Xe({ bind: e, required: t, toggleOpen: s }) {
1075
1075
  ]
1076
1076
  );
1077
1077
  }
1078
- function T({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: l = !1 }) {
1078
+ function T({ items: e, handleTimeSelect: t, state: s, stateValue: o, pad: r = !1 }) {
1079
1079
  return n(
1080
1080
  { class: "flex flex-col max-h-[200px] overflow-y-auto" },
1081
- e.map((r) => {
1082
- let i = l ? r.toString().padStart(2, "0") : r.toString();
1081
+ e.map((l) => {
1082
+ let i = r ? l.toString().padStart(2, "0") : l.toString();
1083
1083
  return m({
1084
1084
  text: i,
1085
1085
  class: "hover:bg-muted/50 rounded-md px-2 py-1",
@@ -1111,7 +1111,7 @@ function Ze({ handleTimeSelect: e }) {
1111
1111
  [
1112
1112
  // Hours column
1113
1113
  T({
1114
- items: Array.from({ length: 12 }, (l, r) => r + 1),
1114
+ items: Array.from({ length: 12 }, (r, l) => l + 1),
1115
1115
  handleTimeSelect: e,
1116
1116
  state: o.state,
1117
1117
  stateValue: "hour",
@@ -1119,7 +1119,7 @@ function Ze({ handleTimeSelect: e }) {
1119
1119
  }),
1120
1120
  // Minutes column
1121
1121
  T({
1122
- items: Array.from({ length: 60 }, (l, r) => r),
1122
+ items: Array.from({ length: 60 }, (r, l) => l),
1123
1123
  handleTimeSelect: e,
1124
1124
  state: o.state,
1125
1125
  stateValue: "minute",
@@ -1148,11 +1148,11 @@ function E(e) {
1148
1148
  const t = /^(\d{1,2}):(\d{2})(?::(\d{2}))?\s?(AM|PM)?$/i, s = e.match(t);
1149
1149
  if (!s)
1150
1150
  return { hour: null, minute: null, meridian: null };
1151
- let [, o, l, , r] = s, i = parseInt(o, 10), g = parseInt(l, 10);
1152
- return i < 0 || i > 23 || g < 0 || g > 59 ? { hour: null, minute: null, meridian: null } : (r ? (r = r.toUpperCase(), r === "PM" && i < 12 ? i += 12 : r === "AM" && i === 12 && (i = 12)) : i === 0 ? (r = "AM", i = 12) : i < 12 ? r = "AM" : i === 12 ? r = "PM" : (r = "PM", i -= 12), {
1151
+ let [, o, r, , l] = s, i = parseInt(o, 10), g = parseInt(r, 10);
1152
+ return i < 0 || i > 23 || g < 0 || g > 59 ? { hour: null, minute: null, meridian: null } : (l ? (l = l.toUpperCase(), l === "PM" && i < 12 ? i += 12 : l === "AM" && i === 12 && (i = 12)) : i === 0 ? (l = "AM", i = 12) : i < 12 ? l = "AM" : i === 12 ? l = "PM" : (l = "PM", i -= 12), {
1153
1153
  hour: i.toString().padStart(2, "0"),
1154
1154
  minute: g.toString().padStart(2, "0"),
1155
- meridian: r
1155
+ meridian: l
1156
1156
  });
1157
1157
  }
1158
1158
  const $t = x(
@@ -1194,10 +1194,10 @@ const $t = x(
1194
1194
  * @returns {object}
1195
1195
  */
1196
1196
  render() {
1197
- const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian: l }) => {
1198
- if (s && (this.state.hour = s), o && (this.state.minute = o), l && (this.state.meridian = l), this.state.hour && this.state.minute && this.state.meridian) {
1199
- const r = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
1200
- this.state.selectedTime = r, this.state.open = !1, this.input.value = r, typeof this.change == "function" && this.change(r);
1197
+ const e = (s, { state: o }) => o.toggle("open"), t = ({ hour: s, minute: o, meridian: r }) => {
1198
+ if (s && (this.state.hour = s), o && (this.state.minute = o), r && (this.state.meridian = r), this.state.hour && this.state.minute && this.state.meridian) {
1199
+ const l = `${this.state.hour}:${this.state.minute} ${this.state.meridian}`;
1200
+ this.state.selectedTime = l, this.state.open = !1, this.input.value = l, typeof this.change == "function" && this.change(l);
1201
1201
  }
1202
1202
  };
1203
1203
  return n(
@@ -1285,13 +1285,13 @@ class nt extends b {
1285
1285
  render() {
1286
1286
  const t = (g) => {
1287
1287
  g.target === this.panel && this.close();
1288
- }, { borderColor: s, bgColor: o, iconColor: l } = j[this.type] || j.default, r = `${this.getMainClass()} ${o} ${s}`, i = this.title || "Dialog Title";
1288
+ }, { borderColor: s, bgColor: o, iconColor: r } = j[this.type] || j.default, l = `${this.getMainClass()} ${o} ${s}`, i = this.title || "Dialog Title";
1289
1289
  return st({
1290
- class: r,
1290
+ class: l,
1291
1291
  title: i,
1292
1292
  click: t,
1293
1293
  icon: this.icon,
1294
- iconColor: l,
1294
+ iconColor: r,
1295
1295
  description: this.description,
1296
1296
  buttons: this.getButtons()
1297
1297
  }, this.children);
package/dist/index.es.js CHANGED
@@ -3,7 +3,7 @@ import { B as g, I as C, L as T } from "./icon-B9QUT2NY.js";
3
3
  import { C as D, d as I, D as b, c as S, E as B, F as P, H as F, I as M, M as k, N, P as v, R as f, S as x, T as h, a as y, b as W, U as L, W as A } from "./inputs-O_WkdbI3.js";
4
4
  import { V as w, a as U } from "./veil-DSQdR6CM.js";
5
5
  import { Icons as R } from "./icons.es.js";
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 ba, T as Sa, x as Ba, y as Pa, m as Fa, r as Ma } from "./confirmation-CYHsLIOn.js";
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 ba, T as Sa, x as Ba, y as Pa, m as Fa, r as Ma } from "./confirmation-BqQwYCFz.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-B5TK6tLi.js";
8
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, p as Xa, n as Ya, o as Za, T as $a, k as as, U as ss, W as es, f as os, h as ts, i as rs, c as ns, d as is, b as ls, e as ps, a as us, g as ms } from "./tab-BjiQGl_0.js";
9
9
  import { B as gs, I as Cs, M as Ts, d as cs, e as Ds, g as Is, N as bs, b as Ss, a as Bs, f as Ps, P as Fs, c as Ms, S as ks, T as Ns } from "./mobile-nav-wrapper-CguousG5.js";
@@ -1,4 +1,4 @@
1
- import { A as o, B as t, C as e, z as i, u as r, v as n, w as m, D as l, j as S, k as D, G as c, E as u, s as d, c as g, a as p, b as C, i as F, g as T, e as A, h as P, F as f, d as b, f as w, t as B, M as I, l as M, N as x, P as y, p as k, q as v, S as N, n as h, o as E, T as L, x as U, y as j, m as q, r as z } from "./confirmation-CYHsLIOn.js";
1
+ import { A as o, B as t, C as e, z as i, u as r, v as n, w as m, D as l, j as S, k as D, G as c, E as u, s as d, c as g, a as p, b as C, i as F, g as T, e as A, h as P, F as f, d as b, f as w, t as B, M as I, l as M, N as x, P as y, p as k, q as v, S as N, n as h, o as E, T as L, x as U, y as j, m as q, r as z } from "./confirmation-BqQwYCFz.js";
2
2
  import { A as O, P as R, g as _ } from "./calendar-B5TK6tLi.js";
3
3
  export {
4
4
  o as Alert,
@@ -17,18 +17,18 @@ export class Modal extends Component {
17
17
  */
18
18
  description: any;
19
19
  /**
20
- * @member {string} size
21
- * @default 'md'
20
+ * @member {string|null} size
21
+ * @default null
22
22
  * @values 'sm', 'md', 'lg', 'xl'
23
23
  */
24
- size: string;
24
+ size: any;
25
25
  /**
26
- * @member {string} type
27
- * @default ''
26
+ * @member {string|null} type
27
+ * @default null
28
28
  * @values 'right', 'left'
29
29
  * @description This will set the type of modal.
30
30
  */
31
- type: string;
31
+ type: any;
32
32
  /**
33
33
  * @member {boolean} hidePrimaryButton
34
34
  * @default false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base-framework/ui",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
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": {
package/dist/style.css DELETED
@@ -1 +0,0 @@
1
- .modal{animation:popIn .2s;max-height:100vh;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);@apply shadow-xl md:rounded-md rounded-md;}.modal:after{content:"";position:fixed;top:0;left:0;right:0;bottom:0;z-index:-1}.modal.sm{max-width:425px;max-height:350px;@apply shadow-xl md:rounded-md rounded-md border;}.modal.sm .modal-body{max-height:300px}.modal.lg,.modal.xl{top:0;bottom:0;max-height:100vh}.modal .modal-header{padding-top:calc(1rem + env(safe-area-inset-top));top:calc(-0px - env(safe-area-inset-top))}.modal .modal-footer{padding-bottom:calc(1rem + env(safe-area-inset-bottom));bottom:calc(-0px - env(safe-area-inset-bottom))}@media (min-width: 1024px){.modal.md{max-height:80vh;padding:0}.modal header button.icon{@apply hidden;}}.modal.right,.modal.left{top:0;bottom:0;max-height:100vh;border-radius:0}.modal.right.md,.modal.left.md{@apply max-w-[640px];}.modal.right{margin-right:0;animation-name:pullRightIn}.modal.left{margin-left:0;animation-name:pullLeftIn}