@base-framework/ui 1.2.2 → 1.2.4
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 +39 -36
- package/dist/buttons-DthWscX3.js +254 -0
- package/dist/{empty-state-CWha-IxF.js → empty-state-h7KNXNy2.js} +4 -4
- package/dist/index.es.js +178 -175
- package/dist/{mobile-nav-wrapper-DxcNwPu2.js → mobile-nav-wrapper-9VRCW4oA.js} +1 -1
- package/dist/molecules.es.js +2 -2
- package/dist/organisms.es.js +4 -4
- package/dist/pages.es.js +1 -1
- package/dist/{sidebar-menu-BwgM82AG.js → sidebar-menu-DLGBb0-I.js} +1 -1
- package/dist/{sidebar-menu-page-DVgAv5ZY.js → sidebar-menu-page-DFRJL944.js} +2 -2
- package/dist/{signature-panel-DIUiqroE.js → signature-panel-Dwnm79Sg.js} +2 -2
- package/dist/{simple-search-input-Dbk3_QiK.js → simple-search-input-gDRD6pEN.js} +1 -1
- package/dist/{tooltip-BFST5Fcz.js → tooltip-vxHsNvfy.js} +79 -70
- package/dist/types/components/atoms/buttons/buttons.d.ts +1 -0
- package/dist/types/components/atoms/buttons/toggle-button.d.ts +104 -0
- package/package.json +1 -1
- package/dist/buttons-Dxnuce2_.js +0 -138
package/dist/atoms.es.js
CHANGED
|
@@ -1,44 +1,47 @@
|
|
|
1
|
-
import { B as e, C as t, a as o, F as n, b as r, L as
|
|
2
|
-
import { B as m, I as
|
|
3
|
-
import { C as
|
|
4
|
-
import { S as
|
|
1
|
+
import { B as e, C as t, a as o, F as n, b as r, L as i, P as p, R as u, S as I, T as l } from "./tooltip-vxHsNvfy.js";
|
|
2
|
+
import { B as d, C as g, a as m, I as T, L as B, M as C, T as x, U as b, i as f, b as F } from "./buttons-DthWscX3.js";
|
|
3
|
+
import { C as S, a as L, D as P, b as R, E as U, F as h, H as k, I as D, c as H, M as V, N as E, P as G, R as N, T as W, d as v, e as w, U as J, V as j, f as q, W as y } from "./image-T4fJLqgd.js";
|
|
4
|
+
import { S as A } from "./skeleton-BlY3opxG.js";
|
|
5
5
|
export {
|
|
6
6
|
e as Badge,
|
|
7
|
-
|
|
7
|
+
d as Button,
|
|
8
8
|
t as Card,
|
|
9
|
-
|
|
9
|
+
S as Checkbox,
|
|
10
|
+
g as CircleButton,
|
|
10
11
|
o as CircleGraph,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
m as CircleToggleButton,
|
|
13
|
+
L as ColorInput,
|
|
14
|
+
P as DateInput,
|
|
15
|
+
R as DateTimeInput,
|
|
16
|
+
U as EmailInput,
|
|
15
17
|
n as Fieldset,
|
|
16
|
-
|
|
18
|
+
h as FileInput,
|
|
17
19
|
r as FormGroup,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
20
|
+
k as HiddenInput,
|
|
21
|
+
T as Icon,
|
|
22
|
+
D as Image,
|
|
23
|
+
H as Input,
|
|
24
|
+
i as Legend,
|
|
25
|
+
B as LoadingButton,
|
|
26
|
+
C as MaterialIcon,
|
|
27
|
+
V as MonthInput,
|
|
28
|
+
E as NumberInput,
|
|
29
|
+
G as PasswordInput,
|
|
30
|
+
p as ProgressBar,
|
|
31
|
+
N as Radio,
|
|
32
|
+
u as RangeSlider,
|
|
33
|
+
I as Select,
|
|
34
|
+
A as Skeleton,
|
|
35
|
+
W as TelInput,
|
|
36
|
+
v as Textarea,
|
|
37
|
+
w as TimeInput,
|
|
38
|
+
x as ToggleButton,
|
|
36
39
|
l as Tooltip,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
b as UniversalIcon,
|
|
41
|
+
J as UrlInput,
|
|
42
|
+
j as Veil,
|
|
43
|
+
q as VeilJot,
|
|
44
|
+
y as WeekInput,
|
|
45
|
+
f as isHeroicon,
|
|
46
|
+
F as isMaterialIcon
|
|
44
47
|
};
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { I as $, Span as h, Button as r, OnState as w, On as B } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as i, Component as y } from "@base-framework/base";
|
|
3
|
+
import { Icons as k } from "./icons.es.js";
|
|
4
|
+
const S = {
|
|
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
|
+
}, d = i((s, t) => {
|
|
13
|
+
const n = S[s.size || "sm"];
|
|
14
|
+
return $({
|
|
15
|
+
...s,
|
|
16
|
+
// @ts-ignore
|
|
17
|
+
class: `stroke-current icon-size ${n} ${s.class || ""}`,
|
|
18
|
+
html: t[0]?.textContent
|
|
19
|
+
});
|
|
20
|
+
}), f = {
|
|
21
|
+
xs: "w-4 h-4",
|
|
22
|
+
// 16px - matches Icon
|
|
23
|
+
sm: "w-6 h-6",
|
|
24
|
+
// 24px - matches Icon
|
|
25
|
+
md: "w-8 h-8",
|
|
26
|
+
// 32px - matches Icon
|
|
27
|
+
lg: "w-10 h-10",
|
|
28
|
+
// 40px - matches Icon
|
|
29
|
+
xl: "w-12 h-12",
|
|
30
|
+
// 48px - matches Icon
|
|
31
|
+
"2xl": "w-14 h-14",
|
|
32
|
+
// 56px - matches Icon
|
|
33
|
+
"3xl": "w-16 h-16"
|
|
34
|
+
// 64px - matches Icon
|
|
35
|
+
}, m = {
|
|
36
|
+
xs: "16px",
|
|
37
|
+
sm: "24px",
|
|
38
|
+
md: "32px",
|
|
39
|
+
lg: "40px",
|
|
40
|
+
xl: "48px",
|
|
41
|
+
"2xl": "56px",
|
|
42
|
+
"3xl": "64px"
|
|
43
|
+
}, b = {
|
|
44
|
+
outlined: "material-symbols-outlined",
|
|
45
|
+
filled: "material-symbols-filled",
|
|
46
|
+
rounded: "material-symbols-rounded",
|
|
47
|
+
sharp: "material-symbols-sharp"
|
|
48
|
+
}, v = i((s) => {
|
|
49
|
+
const t = s.size || "sm", n = s.variant || "outlined", e = f[t] || f.sm, l = m[t] || m.sm, c = b[n] || b.outlined;
|
|
50
|
+
return h({
|
|
51
|
+
...s,
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
class: `inline-flex items-center justify-center ${c} ${e} ${s.class || ""}`,
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
style: `font-size: ${l}; ${s.style || ""}`,
|
|
56
|
+
// Remove props that shouldn't be passed to the DOM element
|
|
57
|
+
size: void 0,
|
|
58
|
+
variant: void 0,
|
|
59
|
+
name: void 0
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
}, s.name);
|
|
62
|
+
}), o = (s = {}, t) => t ? typeof t == "string" && t.includes("<svg") ? d(s, t) : typeof t == "object" && t.name ? v({
|
|
63
|
+
...s,
|
|
64
|
+
name: t.name,
|
|
65
|
+
variant: t.variant || s.variant || "outlined"
|
|
66
|
+
}) : typeof t == "string" ? v({
|
|
67
|
+
...s,
|
|
68
|
+
name: t
|
|
69
|
+
}) : d(s, t) : null, M = (s) => s ? !!(typeof s == "object" && s.name || typeof s == "string" && !s.includes("<svg")) : !1, N = (s) => typeof s == "string" && s.includes("<svg");
|
|
70
|
+
class O extends y {
|
|
71
|
+
/**
|
|
72
|
+
* Declare public props and their defaults.
|
|
73
|
+
*/
|
|
74
|
+
declareProps() {
|
|
75
|
+
this.icon = null, this.activeIcon = null, this.value = null, this.dataKey = null, this.active = !1, this.toggle = null, this.size = "sm";
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Set up internal states.
|
|
79
|
+
*
|
|
80
|
+
* @returns {object}
|
|
81
|
+
*/
|
|
82
|
+
setupStates() {
|
|
83
|
+
return {
|
|
84
|
+
active: this.active ?? !1
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Toggle the active state and fire the callback.
|
|
89
|
+
*
|
|
90
|
+
* @returns {void}
|
|
91
|
+
*/
|
|
92
|
+
handleToggle() {
|
|
93
|
+
this.state.active = !this.state.active, typeof this.toggle == "function" && this.toggle(this.state.active);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Render the toggle button.
|
|
97
|
+
*
|
|
98
|
+
* @returns {object}
|
|
99
|
+
*/
|
|
100
|
+
render() {
|
|
101
|
+
const t = this.size, n = this.icon, e = this.activeIcon || this.icon, l = this.dataKey ? h({ class: "toggle-btn-value text-sm tabular-nums" }, [
|
|
102
|
+
B(this.dataKey, (c) => String(c))
|
|
103
|
+
]) : this.value !== null && this.value !== void 0 ? h({ class: "toggle-btn-value text-sm tabular-nums" }, String(this.value)) : null;
|
|
104
|
+
return r({
|
|
105
|
+
click: () => this.handleToggle(),
|
|
106
|
+
// @ts-ignore
|
|
107
|
+
class: `toggle-btn inline-flex items-center gap-1.5 bg-transparent border-0 p-0 cursor-pointer text-foreground/70 hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${this.class || ""}`
|
|
108
|
+
}, [
|
|
109
|
+
w(
|
|
110
|
+
"active",
|
|
111
|
+
(c) => o({ size: t }, c ? e : n)
|
|
112
|
+
),
|
|
113
|
+
l
|
|
114
|
+
]);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const u = {
|
|
118
|
+
xs: "w-6 h-6",
|
|
119
|
+
sm: "w-8 h-8",
|
|
120
|
+
md: "w-10 h-10",
|
|
121
|
+
lg: "w-12 h-12",
|
|
122
|
+
xl: "w-14 h-14",
|
|
123
|
+
"2xl": "w-16 h-16"
|
|
124
|
+
};
|
|
125
|
+
class E extends y {
|
|
126
|
+
/**
|
|
127
|
+
* Declare public props.
|
|
128
|
+
*/
|
|
129
|
+
declareProps() {
|
|
130
|
+
this.icon = null, this.activeIcon = null, this.active = !1, this.size = "md", this.activeClass = "", this.toggle = null;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Set up internal states.
|
|
134
|
+
*
|
|
135
|
+
* @returns {object}
|
|
136
|
+
*/
|
|
137
|
+
setupStates() {
|
|
138
|
+
return {
|
|
139
|
+
active: this.active ?? !1
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Toggle active state and fire callback.
|
|
144
|
+
*
|
|
145
|
+
* @returns {void}
|
|
146
|
+
*/
|
|
147
|
+
handleToggle() {
|
|
148
|
+
this.state.active = !this.state.active, typeof this.toggle == "function" && this.toggle(this.state.active);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Render the circular toggle button.
|
|
152
|
+
*
|
|
153
|
+
* @returns {object}
|
|
154
|
+
*/
|
|
155
|
+
render() {
|
|
156
|
+
const t = this.icon, n = this.activeIcon || this.icon, e = u[this.size] || u.md, l = ["xs", "sm"].includes(this.size) ? "xs" : "sm", c = "bg-background/40 backdrop-blur-sm text-foreground", C = this.activeClass || c;
|
|
157
|
+
return r({
|
|
158
|
+
click: () => this.handleToggle(),
|
|
159
|
+
// @ts-ignore
|
|
160
|
+
class: `circle-toggle-btn inline-flex items-center justify-center rounded-full border-0 cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 ${e} ${this.class || ""}`
|
|
161
|
+
}, [
|
|
162
|
+
w("active", (g) => [
|
|
163
|
+
o({
|
|
164
|
+
size: l,
|
|
165
|
+
class: `transition-colors ${g ? C : c}`
|
|
166
|
+
}, g ? n : t)
|
|
167
|
+
])
|
|
168
|
+
]);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const H = i((s, t) => {
|
|
172
|
+
const n = s.size || "md", e = u[n] || u.md, l = ["xs", "sm"].includes(n) ? "xs" : "sm";
|
|
173
|
+
return r({
|
|
174
|
+
...s,
|
|
175
|
+
// @ts-ignore
|
|
176
|
+
class: `circle-btn inline-flex items-center justify-center rounded-full border-0 bg-background/40 backdrop-blur-sm text-foreground cursor-pointer transition-colors hover:bg-background/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 ${e} ${s.class || ""}`
|
|
177
|
+
}, [
|
|
178
|
+
// @ts-ignore
|
|
179
|
+
s.icon ? o({ size: l }, s.icon) : null,
|
|
180
|
+
...t || []
|
|
181
|
+
]);
|
|
182
|
+
}), a = (s) => i((t, n) => r({
|
|
183
|
+
...s,
|
|
184
|
+
...t,
|
|
185
|
+
// @ts-ignore
|
|
186
|
+
class: `bttn ${s.class} ${t.class || ""}`
|
|
187
|
+
}, n)), I = i(
|
|
188
|
+
(s, t) => r({
|
|
189
|
+
...s,
|
|
190
|
+
// @ts-ignore
|
|
191
|
+
class: s.class
|
|
192
|
+
}, [
|
|
193
|
+
// @ts-ignore
|
|
194
|
+
s.icon && s.position !== "right" ? o({ size: s.size || "sm", class: s.animation ?? null }, s.icon) : null,
|
|
195
|
+
...t || [],
|
|
196
|
+
// @ts-ignore
|
|
197
|
+
s.icon && s.position === "right" ? o({ size: s.size || "sm", class: s.animation ?? null }, s.icon) : null
|
|
198
|
+
])
|
|
199
|
+
), x = (s) => i((t, n) => I({
|
|
200
|
+
...s,
|
|
201
|
+
...t,
|
|
202
|
+
// @ts-ignore
|
|
203
|
+
class: `bttn ${s.class} ${t.class || ""}`
|
|
204
|
+
}, n)), T = (s) => () => {
|
|
205
|
+
if (s.allowHistory === !0 && globalThis.history.length > 2) {
|
|
206
|
+
globalThis.history.back();
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
s.backUrl && app.navigate(s.backUrl);
|
|
210
|
+
}, V = (s) => i((t, n) => (t.icon = t.icon || k.arrows.left, t.click = t.click || T(t), I({
|
|
211
|
+
...s,
|
|
212
|
+
...t
|
|
213
|
+
}, n))), j = i((s, t) => {
|
|
214
|
+
const n = s.size || "md", e = {
|
|
215
|
+
xs: "w-6 h-6",
|
|
216
|
+
sm: "w-8 h-8",
|
|
217
|
+
md: "w-10 h-10",
|
|
218
|
+
lg: "w-12 h-12",
|
|
219
|
+
xl: "w-14 h-14"
|
|
220
|
+
}, l = s.backgroundClass || "bg-background/30 hover:bg-background/50";
|
|
221
|
+
return r({
|
|
222
|
+
...s,
|
|
223
|
+
// @ts-ignore
|
|
224
|
+
class: `circle-icon-btn inline-flex items-center justify-center rounded-full ${l} text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ring-offset-background transition-colors disabled:pointer-events-none disabled:opacity-50 cursor-pointer ${e[n] || e.md} ${s.class || ""}`
|
|
225
|
+
}, [
|
|
226
|
+
// @ts-ignore
|
|
227
|
+
s.icon ? o({ size: n === "xs" ? "xs" : "sm" }, s.icon) : null,
|
|
228
|
+
...t || []
|
|
229
|
+
]);
|
|
230
|
+
}), z = {
|
|
231
|
+
primary: a({ class: "primary" }),
|
|
232
|
+
secondary: a({ class: "secondary" }),
|
|
233
|
+
destructive: a({ class: "destructive" }),
|
|
234
|
+
warning: a({ class: "warning" }),
|
|
235
|
+
outline: a({ class: "outline" }),
|
|
236
|
+
ghost: a({ class: "ghost" }),
|
|
237
|
+
link: a({ class: "link" }),
|
|
238
|
+
icon: x({ class: "icon" }),
|
|
239
|
+
withIcon: x({ class: "with-icon" }),
|
|
240
|
+
back: V({ class: "with-icon back-button" }),
|
|
241
|
+
circleIcon: j
|
|
242
|
+
}, U = i((s, t) => (z[s.variant] || z.primary)(s, t)), _ = i((s, t) => U({ ...s, variant: "withIcon", icon: k.loading, animation: "animate-spin" }, t));
|
|
243
|
+
export {
|
|
244
|
+
U as B,
|
|
245
|
+
H as C,
|
|
246
|
+
d as I,
|
|
247
|
+
_ as L,
|
|
248
|
+
v as M,
|
|
249
|
+
O as T,
|
|
250
|
+
o as U,
|
|
251
|
+
E as a,
|
|
252
|
+
M as b,
|
|
253
|
+
N as i
|
|
254
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Atom as c, Component as y, Html as A, Dom as Z, base as tt, Data as k, Builder as H, Jot as w, Events as g, DateTime as M } from "@base-framework/base";
|
|
2
2
|
import { Div as n, H5 as et, P as b, Li as q, Span as a, Ul as V, Button as p, I as T, OnState as I, Label as P, H2 as v, Form as st, Header as B, Footer as L, A as G, H3 as ot, Checkbox as nt, Input as f, Img as W, Nav as it, UseParent as _, OnStateOpen as O, Time as rt, Dialog as lt } from "@base-framework/atoms";
|
|
3
|
-
import { P as S, C as at, R as ct } from "./simple-search-input-
|
|
4
|
-
import { U as m, B as h, I as dt } from "./buttons-
|
|
3
|
+
import { P as S, C as at, R as ct } from "./simple-search-input-gDRD6pEN.js";
|
|
4
|
+
import { U as m, B as h, I as dt } from "./buttons-DthWscX3.js";
|
|
5
5
|
import { Timer as ut, List as ht, DynamicTime as mt } from "@base-framework/organisms";
|
|
6
|
-
import { C as ft, b as pt } from "./tooltip-
|
|
6
|
+
import { C as ft, b as pt } from "./tooltip-vxHsNvfy.js";
|
|
7
7
|
import { f as C } from "./image-T4fJLqgd.js";
|
|
8
8
|
import { Icons as u } from "./icons.es.js";
|
|
9
9
|
import { F as z } from "./format-DE4rFWuD.js";
|
|
10
|
-
import "./mobile-nav-wrapper-
|
|
10
|
+
import "./mobile-nav-wrapper-9VRCW4oA.js";
|
|
11
11
|
import "./aside-template-B9V-0xle.js";
|
|
12
12
|
import "./full-page-CgVI1G7F.js";
|
|
13
13
|
import "./bside-template-oLChzjxQ.js";
|