@base-framework/ui 1.1.5 → 1.1.7

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/atoms.es.js CHANGED
@@ -1,7 +1,7 @@
1
- import { B as e, C as t, F as o, L as r, P as n, R as p, S as I, a as u, T as i } from "./tooltip-BNsImT7F.js";
2
- import { B as d, I as m, L as x } from "./buttons-CfwtbIR-.js";
1
+ import { B as e, C as t, F as o, L as r, P as n, R as p, S as I, a as u, T as i } from "./tooltip-BlFbB8yL.js";
2
+ import { B as d, I as m, L as x } from "./buttons-B-FvkS9B.js";
3
3
  import { C as T, F as g } from "./form-group-BB7dLJir.js";
4
- import { C as F, a as c, D as f, b as L, E as P, F as R, H as S, I as b, M as h, N as k, P as D, R as V, T as E, c as G, d as H, U as M, W as N } from "./inputs-DEfa4qLY.js";
4
+ import { C as F, a as c, D as f, b as L, E as P, F as R, H as S, I as b, M as h, N as k, P as D, R as V, T as E, c as G, d as H, U as M, W as N } from "./inputs-CcimrM1k.js";
5
5
  import { I as W, V as w, a as J } from "./image-BB__4s0g.js";
6
6
  export {
7
7
  e as Badge,
@@ -0,0 +1,77 @@
1
+ import { I as m, Button as l } from "@base-framework/atoms";
2
+ import { Atom as i } from "@base-framework/base";
3
+ import { Icons as u } from "./icons.es.js";
4
+ const g = {
5
+ xs: "w-4 h-4",
6
+ sm: "w-6 h-6",
7
+ md: "w-8 h-8",
8
+ lg: "w-10 h-10",
9
+ xl: "w-12 h-12",
10
+ "2xl": "w-14 h-14",
11
+ "3xl": "w-16 h-16"
12
+ }, a = i((n, t) => {
13
+ const s = g[n.size || "sm"];
14
+ return m({
15
+ ...n,
16
+ class: `stroke-current icon-size ${s} ${n.class || ""}`,
17
+ html: t[0]?.textContent
18
+ });
19
+ }), c = (n) => i((t, s) => l({
20
+ ...n,
21
+ ...t,
22
+ class: `bttn ${n.class} ${t.class || ""}`
23
+ }, s)), h = i(
24
+ (n, t) => l({
25
+ ...n,
26
+ class: n.class
27
+ }, [
28
+ n.icon && n.position !== "right" ? a({ size: "sm", class: n.animation ?? null }, n.icon) : null,
29
+ ...t || [],
30
+ n.icon && n.position === "right" ? a({ size: "sm", class: n.animation ?? null }, n.icon) : null
31
+ ])
32
+ ), e = (n) => i((t, s) => h({
33
+ ...n,
34
+ ...t,
35
+ class: `bttn ${n.class} ${t.class || ""}`
36
+ }, s)), w = (n) => () => {
37
+ if (n.allowHistory === !0 && globalThis.history.length > 2) {
38
+ globalThis.history.back();
39
+ return;
40
+ }
41
+ n.backUrl && app.navigate(n.backUrl);
42
+ }, b = (n) => i((t, s) => (t.icon = t.icon || u.arrows.left, t.click = t.click || w(t), h({
43
+ ...n,
44
+ ...t
45
+ }, s))), k = i((n, t) => {
46
+ const s = n.size || "md", o = {
47
+ xs: "w-6 h-6",
48
+ sm: "w-8 h-8",
49
+ md: "w-10 h-10",
50
+ lg: "w-12 h-12",
51
+ xl: "w-14 h-14"
52
+ };
53
+ return l({
54
+ ...n,
55
+ class: `inline-flex items-center justify-center rounded-full bg-transparent text-foreground hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors ${o[s] || o.md} ${n.class || ""}`
56
+ }, [
57
+ n.icon ? a({ size: s === "xs" ? "xs" : "sm" }, n.icon) : null,
58
+ ...t || []
59
+ ]);
60
+ }), r = {
61
+ primary: c({ class: "primary" }),
62
+ secondary: c({ class: "secondary" }),
63
+ destructive: c({ class: "destructive" }),
64
+ warning: c({ class: "warning" }),
65
+ outline: c({ class: "outline" }),
66
+ ghost: c({ class: "ghost" }),
67
+ link: c({ class: "link" }),
68
+ icon: e({ class: "icon" }),
69
+ withIcon: e({ class: "with-icon" }),
70
+ back: b({ class: "with-icon back-button" }),
71
+ circleIcon: k
72
+ }, d = i((n, t) => (r[n.variant] || r.primary)(n, t)), I = i((n, t) => d({ ...n, variant: "withIcon", icon: u.loading, animation: "animate-spin" }, t));
73
+ export {
74
+ d as B,
75
+ a as I,
76
+ I as L
77
+ };