@base-framework/ui 1.1.13 → 1.1.15
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/README.md +44 -0
- package/dist/atoms.es.js +37 -34
- package/dist/buttons-snATS4J5.js +118 -0
- package/dist/{empty-state-CxSSx4bC.js → empty-state-BR5Aa8lA.js} +325 -322
- package/dist/full-page-DccgwWsM.js +69 -0
- package/dist/icons.es.js +127 -1
- package/dist/image-BhZbKYDj.js +237 -0
- package/dist/index.es.js +179 -173
- package/dist/{mobile-nav-wrapper-C3Lvz7CH.js → mobile-nav-wrapper-1erstN34.js} +77 -84
- package/dist/molecules.es.js +5 -5
- package/dist/organisms.es.js +52 -51
- package/dist/pages.es.js +10 -9
- package/dist/sidebar-menu-CVyJBcHE.js +13 -0
- package/dist/sidebar-menu-page-Db-6HPoS.js +153 -0
- package/dist/signature-panel-CVq5N5M1.js +1364 -0
- package/dist/simple-search-input-CuC8q0fJ.js +1654 -0
- package/dist/skeleton-BlY3opxG.js +7 -0
- package/dist/{tooltip-BlFbB8yL.js → tooltip-BmvjA9XQ.js} +104 -84
- package/dist/types/components/atoms/atoms.d.ts +2 -0
- package/dist/types/components/atoms/material-icon.d.ts +17 -0
- package/dist/types/components/atoms/universal-icon.d.ts +3 -0
- package/dist/types/components/icons/icons.d.ts +1 -0
- package/dist/types/components/icons/material-symbols.d.ts +19 -0
- package/dist/types/components/molecules/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/types/components/molecules/image/image-uploader.d.ts +2 -2
- package/dist/types/components/molecules/image/logo-uploader.d.ts +2 -2
- package/dist/types/components/organisms/navigation/mobile/nav-wrapper/title-header.d.ts +1 -1
- package/package.json +1 -1
- package/dist/buttons-Dr-bViom.js +0 -77
- package/dist/form-group-BB7dLJir.js +0 -29
- package/dist/image-BB__4s0g.js +0 -31
- package/dist/inputs-CcimrM1k.js +0 -210
- package/dist/range-calendar-BZW1R_D_.js +0 -831
- package/dist/sidebar-menu-page-BtuUB_XB.js +0 -217
- package/dist/signature-panel-CErd4IW_.js +0 -2186
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Div as r } from "@base-framework/atoms";
|
|
2
|
+
const o = ({ class: e, shape: s = "rectangle", width: l = "w-full", height: a = "h-4" }) => r({
|
|
3
|
+
class: `bg-muted animate-pulse ${l} ${a} ${s === "circle" ? "rounded-full" : "rounded-md"} ${e || ""}`
|
|
4
|
+
});
|
|
5
|
+
export {
|
|
6
|
+
o as S
|
|
7
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Span as c, Legend as
|
|
2
|
-
import { Atom as s, Html as
|
|
3
|
-
import {
|
|
4
|
-
import { f as h, e as y, g as k } from "./inputs-CcimrM1k.js";
|
|
1
|
+
import { Span as c, Div as o, Legend as f, Fieldset as x, H4 as C, P as h, UseParent as u, Input as y } from "@base-framework/atoms";
|
|
2
|
+
import { Atom as s, Html as p } from "@base-framework/base";
|
|
3
|
+
import { f as d, g as k, h as w, i as $ } from "./image-BhZbKYDj.js";
|
|
5
4
|
const a = {
|
|
6
5
|
gray: {
|
|
7
6
|
backgroundColor: "bg-gray-50",
|
|
@@ -78,25 +77,47 @@ const a = {
|
|
|
78
77
|
textColor: "text-primary",
|
|
79
78
|
ringColor: "ring-background"
|
|
80
79
|
}
|
|
81
|
-
},
|
|
82
|
-
const { backgroundColor: e, textColor:
|
|
83
|
-
return `inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors ${e} ${
|
|
84
|
-
},
|
|
85
|
-
const
|
|
86
|
-
return c({ ...
|
|
87
|
-
}),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
80
|
+
}, v = (r) => a[r] || a.gray, P = (r) => {
|
|
81
|
+
const { backgroundColor: e, textColor: t, ringColor: l } = v(r);
|
|
82
|
+
return `inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors ${e} ${t} ${l}`;
|
|
83
|
+
}, L = s((r, e) => {
|
|
84
|
+
const t = P(r?.type);
|
|
85
|
+
return c({ ...r, class: t }, e);
|
|
86
|
+
}), G = s((r, e) => {
|
|
87
|
+
const t = r.margin ?? "my-5 mx-5", l = r.padding ?? "p-4", n = r.border ?? "border-border";
|
|
88
|
+
return r.hover && (r.class += " hover:shadow-lg hover:bg-muted/50"), o({
|
|
89
|
+
...r,
|
|
90
|
+
class: `rounded-lg ${n} bg-card text-card-foreground shadow-md min-w-[120px] min-h-[80px] ${t} ${l} ${r.class || ""}`
|
|
91
|
+
}, e);
|
|
92
|
+
}), S = s((r, e) => f({
|
|
93
|
+
...r,
|
|
94
|
+
class: ` font-medium -mt-4 -mx-1 px-2 py-2 ${r.class || ""}`
|
|
95
|
+
}, e)), I = s((r, e) => {
|
|
96
|
+
const t = r.border === "full" ? "border rounded-md" : "border-t";
|
|
97
|
+
return x({
|
|
98
|
+
...r,
|
|
99
|
+
class: `p-6 ${t} ${r.class || ""}`
|
|
100
|
+
}, [
|
|
101
|
+
r.legend && S(r.legend),
|
|
102
|
+
o({ class: "flex flex-auto flex-col gap-y-6" }, e)
|
|
103
|
+
]);
|
|
104
|
+
}), R = s((r, e) => {
|
|
105
|
+
const t = r.border === !0 ? "border-t" : "";
|
|
106
|
+
return o({
|
|
107
|
+
...r,
|
|
108
|
+
class: `grid grid-cols-1 gap-y-4 sm:grid-cols-[1fr_2fr] sm:gap-x-6 pt-8 ${t} ${r.class || ""}`
|
|
95
109
|
}, [
|
|
96
|
-
|
|
97
|
-
|
|
110
|
+
r.label && o({
|
|
111
|
+
...r.labelProps,
|
|
112
|
+
class: `flex flex-auto flex-col gap-y-1 ${r.labelProps?.class || ""}`
|
|
113
|
+
}, [
|
|
114
|
+
C({ class: "text-base" }, r.label),
|
|
115
|
+
r.description && h({ class: "text-sm text-muted-foreground" }, r.description)
|
|
116
|
+
]),
|
|
117
|
+
// Controls container: grows to fill remaining space, spacing between items
|
|
118
|
+
o({ class: "flex flex-col gap-y-4" }, e)
|
|
98
119
|
]);
|
|
99
|
-
}),
|
|
120
|
+
}), O = d(
|
|
100
121
|
{
|
|
101
122
|
/**
|
|
102
123
|
* This will create the initial state of the RangeSlider.
|
|
@@ -117,8 +138,8 @@ const a = {
|
|
|
117
138
|
* @param {number} value
|
|
118
139
|
* @returns {number}
|
|
119
140
|
*/
|
|
120
|
-
getFillPercentage(
|
|
121
|
-
return (
|
|
141
|
+
getFillPercentage(r) {
|
|
142
|
+
return (r - this.min) / (this.max - this.min) * 100;
|
|
122
143
|
},
|
|
123
144
|
/**
|
|
124
145
|
* This will render the RangeSlider component.
|
|
@@ -126,63 +147,63 @@ const a = {
|
|
|
126
147
|
* @returns {object}
|
|
127
148
|
*/
|
|
128
149
|
render() {
|
|
129
|
-
return
|
|
150
|
+
return o({ class: "relative w-full h-4 flex items-center" }, [
|
|
130
151
|
// Track
|
|
131
|
-
|
|
132
|
-
u(({ state:
|
|
152
|
+
o({ class: "absolute h-2 w-full rounded-full bg-muted" }),
|
|
153
|
+
u(({ state: r }) => [
|
|
133
154
|
// Filled Track
|
|
134
|
-
|
|
155
|
+
o({
|
|
135
156
|
class: "absolute h-2 bg-primary rounded-full",
|
|
136
|
-
style: ["width: [[filledPercentage]]%",
|
|
157
|
+
style: ["width: [[filledPercentage]]%", r]
|
|
137
158
|
}),
|
|
138
159
|
// Thumb
|
|
139
|
-
|
|
160
|
+
o({
|
|
140
161
|
class: `
|
|
141
162
|
absolute block h-5 w-5 rounded-full border-2 border-primary bg-background
|
|
142
163
|
ring-offset-background transition-colors focus-visible:outline-none
|
|
143
164
|
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2
|
|
144
165
|
disabled:pointer-events-none disabled:opacity-50 transform -translate-x-1/2
|
|
145
166
|
`.trim(),
|
|
146
|
-
style: ["left: [[filledPercentage]]%",
|
|
167
|
+
style: ["left: [[filledPercentage]]%", r]
|
|
147
168
|
}),
|
|
148
169
|
// Hidden Range Input
|
|
149
|
-
|
|
170
|
+
y({
|
|
150
171
|
type: "range",
|
|
151
|
-
min: ["[[min]]",
|
|
152
|
-
max: ["[[max]]",
|
|
153
|
-
value: ["[[value]]",
|
|
172
|
+
min: ["[[min]]", r],
|
|
173
|
+
max: ["[[max]]", r],
|
|
174
|
+
value: ["[[value]]", r],
|
|
154
175
|
// Incorporate your new classes here
|
|
155
176
|
class: `
|
|
156
177
|
absolute w-full h-full opacity-0 cursor-pointer
|
|
157
|
-
${
|
|
158
|
-
${
|
|
178
|
+
${k}
|
|
179
|
+
${w}
|
|
159
180
|
${this.class || ""}
|
|
160
181
|
`.trim(),
|
|
161
182
|
bind: this.bind,
|
|
162
183
|
input: (e) => {
|
|
163
|
-
const
|
|
164
|
-
this.state.value =
|
|
184
|
+
const t = Number(e.target.value);
|
|
185
|
+
this.state.value = t, this.state.filledPercentage = this.getFillPercentage(t), typeof this.change == "function" && this.change(t);
|
|
165
186
|
}
|
|
166
187
|
})
|
|
167
188
|
])
|
|
168
189
|
]);
|
|
169
190
|
}
|
|
170
191
|
}
|
|
171
|
-
),
|
|
192
|
+
), V = s((r) => ({
|
|
172
193
|
tag: "select",
|
|
173
194
|
onCreated(e) {
|
|
174
|
-
|
|
195
|
+
r.options && p.setupSelectOptions(e, r.options);
|
|
175
196
|
},
|
|
176
|
-
...
|
|
177
|
-
class: `${
|
|
178
|
-
})),
|
|
179
|
-
const
|
|
197
|
+
...r,
|
|
198
|
+
class: `${$} ${r.class || ""}`.trim()
|
|
199
|
+
})), E = (r) => !r || isNaN(r) ? null : r, i = (r, e) => {
|
|
200
|
+
const t = r, l = 16, n = 2 * Math.PI * l, b = t / 100 * n, m = `
|
|
180
201
|
<svg class="w-40 h-40 mx-auto" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
|
|
181
202
|
<!-- Background Circle -->
|
|
182
203
|
<circle
|
|
183
204
|
cx="18"
|
|
184
205
|
cy="18"
|
|
185
|
-
r="${
|
|
206
|
+
r="${l}"
|
|
186
207
|
fill="none"
|
|
187
208
|
stroke="currentColor"
|
|
188
209
|
stroke-width="4"
|
|
@@ -193,13 +214,13 @@ const a = {
|
|
|
193
214
|
<circle
|
|
194
215
|
cx="18"
|
|
195
216
|
cy="18"
|
|
196
|
-
r="${
|
|
217
|
+
r="${l}"
|
|
197
218
|
fill="none"
|
|
198
219
|
stroke="currentColor"
|
|
199
220
|
stroke-width="4"
|
|
200
221
|
class="stroke-primary"
|
|
201
222
|
stroke-dasharray="${n}"
|
|
202
|
-
stroke-dashoffset="${n -
|
|
223
|
+
stroke-dashoffset="${n - b}"
|
|
203
224
|
stroke-linecap="round"
|
|
204
225
|
class="${e}"
|
|
205
226
|
/>
|
|
@@ -210,27 +231,27 @@ const a = {
|
|
|
210
231
|
class="text-[0.25em] font-medium fill-primary"
|
|
211
232
|
text-anchor="middle"
|
|
212
233
|
dominant-baseline="middle">
|
|
213
|
-
${
|
|
234
|
+
${t}%
|
|
214
235
|
</text>
|
|
215
236
|
</svg>
|
|
216
237
|
`;
|
|
217
|
-
return
|
|
238
|
+
return o({
|
|
218
239
|
class: "circle-graph text-inherit",
|
|
219
|
-
html:
|
|
240
|
+
html: m
|
|
220
241
|
});
|
|
221
|
-
},
|
|
222
|
-
const e =
|
|
223
|
-
return
|
|
242
|
+
}, _ = s((r) => {
|
|
243
|
+
const e = r.progress || 0, t = r.class || "", l = i(e, t);
|
|
244
|
+
return o({
|
|
224
245
|
class: "circle-graph-wrap",
|
|
225
246
|
onSet: [
|
|
226
|
-
|
|
227
|
-
(n) => (n =
|
|
247
|
+
r.prop,
|
|
248
|
+
(n) => (n = E(n), n ? i(n, t) : l)
|
|
228
249
|
]
|
|
229
|
-
}, [
|
|
230
|
-
}),
|
|
250
|
+
}, [l]);
|
|
251
|
+
}), B = () => u(({ state: r }) => o({
|
|
231
252
|
class: "absolute h-full rounded-full bg-primary transition-all duration-300",
|
|
232
|
-
style: ["width: [[progress]]%;",
|
|
233
|
-
})),
|
|
253
|
+
style: ["width: [[progress]]%;", r]
|
|
254
|
+
})), D = d(
|
|
234
255
|
{
|
|
235
256
|
/**
|
|
236
257
|
* This will render the progress bar component.
|
|
@@ -238,8 +259,8 @@ const a = {
|
|
|
238
259
|
* @returns {object}
|
|
239
260
|
*/
|
|
240
261
|
render() {
|
|
241
|
-
return
|
|
242
|
-
|
|
262
|
+
return o({ class: "relative w-full h-4 rounded-full bg-muted" }, [
|
|
263
|
+
B()
|
|
243
264
|
]);
|
|
244
265
|
},
|
|
245
266
|
/**
|
|
@@ -266,10 +287,10 @@ const a = {
|
|
|
266
287
|
* @param {object} evt
|
|
267
288
|
* @returns {void}
|
|
268
289
|
*/
|
|
269
|
-
uploadProgress(
|
|
270
|
-
if (
|
|
271
|
-
const
|
|
272
|
-
this.set(
|
|
290
|
+
uploadProgress(r) {
|
|
291
|
+
if (r.lengthComputable) {
|
|
292
|
+
const t = Math.round(r.loaded * 100 / r.total);
|
|
293
|
+
this.set(t);
|
|
273
294
|
}
|
|
274
295
|
},
|
|
275
296
|
/**
|
|
@@ -278,13 +299,11 @@ const a = {
|
|
|
278
299
|
* @param {number} progress
|
|
279
300
|
* @returns {void}
|
|
280
301
|
*/
|
|
281
|
-
set(
|
|
282
|
-
|
|
302
|
+
set(r) {
|
|
303
|
+
r < 0 && (r = 0), r > 100 && (r = 100), this.state.progress = r;
|
|
283
304
|
}
|
|
284
305
|
}
|
|
285
|
-
),
|
|
286
|
-
class: `bg-muted animate-pulse ${r} ${o} ${e === "circle" ? "rounded-full" : "rounded-md"} ${t || ""}`
|
|
287
|
-
}), g = {
|
|
306
|
+
), g = {
|
|
288
307
|
top: "bottom-full left-1/2 transform -translate-x-1/2 mb-2",
|
|
289
308
|
"top-right": "bottom-full left-full transform -translate-x-1 mb-2",
|
|
290
309
|
"top-left": "bottom-full right-full transform translate-x-1 mb-2",
|
|
@@ -293,27 +312,28 @@ const a = {
|
|
|
293
312
|
"bottom-left": "top-full right-full transform translate-x-1 mt-2",
|
|
294
313
|
left: "top-1/2 right-full transform -translate-y-1/2 mr-2",
|
|
295
314
|
right: "top-1/2 left-full transform -translate-y-1/2 ml-2"
|
|
296
|
-
},
|
|
297
|
-
const
|
|
298
|
-
return Array.isArray(
|
|
299
|
-
...
|
|
315
|
+
}, F = (r) => g[r] || g.top, H = s(({ position: r = "top", content: e }, t) => {
|
|
316
|
+
const l = F(r);
|
|
317
|
+
return Array.isArray(t) === !1 && (t = [t]), o({ class: "relative group inline-block" }, [
|
|
318
|
+
...t,
|
|
300
319
|
// Tooltip box
|
|
301
320
|
c({
|
|
302
321
|
class: `
|
|
303
322
|
absolute z-20 px-2 py-1 border text-sm bg-background rounded shadow-md opacity-0 whitespace-nowrap
|
|
304
|
-
group-hover:opacity-100 transition-opacity duration-200 ${
|
|
323
|
+
group-hover:opacity-100 transition-opacity duration-200 ${l} pointer-events-none
|
|
305
324
|
`
|
|
306
325
|
}, e)
|
|
307
326
|
]);
|
|
308
327
|
});
|
|
309
328
|
export {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
329
|
+
L as B,
|
|
330
|
+
G as C,
|
|
331
|
+
I as F,
|
|
332
|
+
S as L,
|
|
333
|
+
D as P,
|
|
334
|
+
O as R,
|
|
335
|
+
V as S,
|
|
336
|
+
H as T,
|
|
337
|
+
_ as a,
|
|
338
|
+
R as b
|
|
319
339
|
};
|
|
@@ -10,8 +10,10 @@ export * from "./form/legend.js";
|
|
|
10
10
|
export * from "./form/select.js";
|
|
11
11
|
export * from "./icon.js";
|
|
12
12
|
export * from "./image.js";
|
|
13
|
+
export * from "./material-icon.js";
|
|
13
14
|
export * from "./progress/circle-graph.js";
|
|
14
15
|
export * from "./progress/progress-bar.js";
|
|
15
16
|
export * from "./skeleton.js";
|
|
16
17
|
export * from "./tooltip.js";
|
|
18
|
+
export * from "./universal-icon.js";
|
|
17
19
|
export * from "./veil.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This will create a Material Icon atom using Google's Material Symbols.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* ```javascript
|
|
6
|
+
* MaterialIcon({ name: 'home', size: 'md', variant: 'outlined' })
|
|
7
|
+
* MaterialIcon({ name: 'favorite', size: 'sm', variant: 'filled', class: 'text-red-500' })
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* @param {object} props
|
|
11
|
+
* @param {string} props.name - The icon name (ligature) from Material Symbols
|
|
12
|
+
* @param {string} [props.size='sm'] - Icon size: xs, sm, md, lg, xl, 2xl, 3xl
|
|
13
|
+
* @param {string} [props.variant='outlined'] - Style variant: outlined, filled, rounded, sharp
|
|
14
|
+
* @param {string} [props.class] - Additional CSS classes
|
|
15
|
+
* @returns {object}
|
|
16
|
+
*/
|
|
17
|
+
export const MaterialIcon: Function;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Material Symbols
|
|
3
|
+
*
|
|
4
|
+
* Common icon names for Google Material Symbols.
|
|
5
|
+
* These are ligature names that work with the Material Symbols font.
|
|
6
|
+
*
|
|
7
|
+
* Usage with MaterialIcon:
|
|
8
|
+
* ```javascript
|
|
9
|
+
* import { MaterialIcon } from '@base-framework/ui/atoms';
|
|
10
|
+
* import { MaterialSymbols } from '@base-framework/ui/icons';
|
|
11
|
+
*
|
|
12
|
+
* MaterialIcon({ name: MaterialSymbols.home, size: 'md' })
|
|
13
|
+
* MaterialIcon({ name: MaterialSymbols.actions.delete, variant: 'filled' })
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @link https://fonts.google.com/icons
|
|
17
|
+
* @type {object}
|
|
18
|
+
*/
|
|
19
|
+
export const MaterialSymbols: object;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This will render a Breadcrumb component.
|
|
5
5
|
*
|
|
6
|
-
* @type {typeof Component}
|
|
6
|
+
* @type {typeof Component | null}
|
|
7
7
|
*/
|
|
8
|
-
export const Breadcrumb: typeof Component;
|
|
8
|
+
export const Breadcrumb: typeof Component | null;
|
|
9
9
|
export default Breadcrumb;
|
|
10
10
|
import { Component } from '@base-framework/base';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Upload button for image files, styled with a dashed circular drop zone.
|
|
5
5
|
*
|
|
6
|
-
* @type {typeof Component}
|
|
6
|
+
* @type {typeof Component | null}
|
|
7
7
|
*/
|
|
8
|
-
export const ImageUploader: typeof Component;
|
|
8
|
+
export const ImageUploader: typeof Component | null;
|
|
9
9
|
import { Component } from '@base-framework/base';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Upload button for logo images, styled with a dashed circular drop zone.
|
|
5
5
|
*
|
|
6
|
-
* @type {typeof Component}
|
|
6
|
+
* @type {typeof Component | null}
|
|
7
7
|
*/
|
|
8
|
-
export const LogoUploader: typeof Component;
|
|
8
|
+
export const LogoUploader: typeof Component | null;
|
|
9
9
|
import { Component } from '@base-framework/base';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function NavButton(
|
|
1
|
+
export function NavButton(): object;
|
|
2
2
|
export function TitleHeader(props: object): object;
|
package/package.json
CHANGED
package/dist/buttons-Dr-bViom.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
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 b = {
|
|
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 = b[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)), d = (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
|
-
}, w = (n) => i((t, s) => (t.icon = t.icon || u.arrows.left, t.click = t.click || d(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
|
-
}, g = n.backgroundClass || "bg-background/30 hover:bg-background/50";
|
|
53
|
-
return l({
|
|
54
|
-
...n,
|
|
55
|
-
class: `circle-icon-btn inline-flex items-center justify-center rounded-full ${g} 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 ${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: w({ class: "with-icon back-button" }),
|
|
71
|
-
circleIcon: k
|
|
72
|
-
}, f = i((n, t) => (r[n.variant] || r.primary)(n, t)), v = i((n, t) => f({ ...n, variant: "withIcon", icon: u.loading, animation: "animate-spin" }, t));
|
|
73
|
-
export {
|
|
74
|
-
f as B,
|
|
75
|
-
a as I,
|
|
76
|
-
v as L
|
|
77
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Div as r, H4 as s, P as c } from "@base-framework/atoms";
|
|
2
|
-
import { Atom as d } from "@base-framework/base";
|
|
3
|
-
const g = d((e, a) => {
|
|
4
|
-
const l = e.margin ?? "my-5 mx-5", t = e.padding ?? "p-4", o = e.border ?? "border-border";
|
|
5
|
-
return e.hover && (e.class += " hover:shadow-lg hover:bg-muted/50"), r({
|
|
6
|
-
...e,
|
|
7
|
-
class: `rounded-lg ${o} bg-card text-card-foreground shadow-md min-w-[120px] min-h-[80px] ${l} ${t} ${e.class || ""}`
|
|
8
|
-
}, a);
|
|
9
|
-
}), i = d((e, a) => {
|
|
10
|
-
const l = e.border === !0 ? "border-t" : "";
|
|
11
|
-
return r({
|
|
12
|
-
...e,
|
|
13
|
-
class: `grid grid-cols-1 gap-y-4 sm:grid-cols-[1fr_2fr] sm:gap-x-6 pt-8 ${l} ${e.class || ""}`
|
|
14
|
-
}, [
|
|
15
|
-
e.label && r({
|
|
16
|
-
...e.labelProps,
|
|
17
|
-
class: `flex flex-auto flex-col gap-y-1 ${e.labelProps?.class || ""}`
|
|
18
|
-
}, [
|
|
19
|
-
s({ class: "text-base" }, e.label),
|
|
20
|
-
e.description && c({ class: "text-sm text-muted-foreground" }, e.description)
|
|
21
|
-
]),
|
|
22
|
-
// Controls container: grows to fill remaining space, spacing between items
|
|
23
|
-
r({ class: "flex flex-col gap-y-4" }, a)
|
|
24
|
-
]);
|
|
25
|
-
});
|
|
26
|
-
export {
|
|
27
|
-
g as C,
|
|
28
|
-
i as F
|
|
29
|
-
};
|
package/dist/image-BB__4s0g.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Jot as r, Component as a, Atom as o } from "@base-framework/base";
|
|
2
|
-
import { Img as s } from "@base-framework/atoms";
|
|
3
|
-
class u extends a {
|
|
4
|
-
/**
|
|
5
|
-
* This will set the component context.
|
|
6
|
-
*
|
|
7
|
-
* @param {object|null} context
|
|
8
|
-
* @returns {object|null}
|
|
9
|
-
*/
|
|
10
|
-
setContext(i) {
|
|
11
|
-
if (this.data)
|
|
12
|
-
return null;
|
|
13
|
-
const e = this?.parent?.data ?? this?.parent?.context?.data ?? this?.parent?.state ?? null;
|
|
14
|
-
return e ? { data: e } : null;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const p = (t) => r(t, u), x = o(({ src: t, alt: i, class: e, checkPath: l = !0 }) => !t || (e = e || "", l && t.indexOf(".") === -1 && t.indexOf("[[") === -1) ? null : s({
|
|
18
|
-
class: `absolute w-full h-full object-cover fadeIn ${e}`,
|
|
19
|
-
src: t,
|
|
20
|
-
alt: i,
|
|
21
|
-
load: (n) => n.target.style.visibility = "visible",
|
|
22
|
-
/**
|
|
23
|
-
* If there's an error loading the image, hide it.
|
|
24
|
-
*/
|
|
25
|
-
error: (n) => n.target.style.visibility = "hidden"
|
|
26
|
-
}));
|
|
27
|
-
export {
|
|
28
|
-
x as I,
|
|
29
|
-
u as V,
|
|
30
|
-
p as a
|
|
31
|
-
};
|