@base-framework/ui 1.0.99 → 1.0.101
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,4 +1,4 @@
|
|
|
1
|
-
import { B as e, C as t, a as n, F as o, L as p, P as r, R as u, S as I, b as i, T as l } from "./tooltip-
|
|
1
|
+
import { B as e, C as t, a as n, F as o, L as p, P as r, R as u, S as I, b as i, T as l } from "./tooltip-qwYWgQDH.js";
|
|
2
2
|
import { B as m, I as T, L as c } from "./buttons-CVEwmPAi.js";
|
|
3
3
|
import { C as B, d as C, D as S, c as g, E as b, F as f, H as h, I as F, M as L, N as P, P as R, R as k, S as D, T as V, a as E, b as H, U as M, W as N } from "./inputs-nzivW9Dr.js";
|
|
4
4
|
import { V as W, a as w } from "./veil-D4dRxILB.js";
|
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as e, C as o, a as t, F as r, L as n, P as i, R as l, S as p, b as u, T as m } from "./tooltip-
|
|
1
|
+
import { B as e, C as o, a as t, F as r, L as n, P as i, R as l, S as p, b as u, T as m } from "./tooltip-qwYWgQDH.js";
|
|
2
2
|
import { B as g, I as T, L as c } from "./buttons-CVEwmPAi.js";
|
|
3
3
|
import { C as b, d as D, D as S, c as I, 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-nzivW9Dr.js";
|
|
4
4
|
import { V as w, a as U } from "./veil-D4dRxILB.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Span as c, Div as l, Legend as b, Fieldset as f, UseParent as x, Input as C } from "@base-framework/atoms";
|
|
2
|
-
import { Atom as s,
|
|
2
|
+
import { Atom as s, Html as p } from "@base-framework/base";
|
|
3
3
|
import { a as u } from "./veil-D4dRxILB.js";
|
|
4
|
-
import { f as
|
|
4
|
+
import { f as h, e as y, g as k } from "./inputs-nzivW9Dr.js";
|
|
5
5
|
const a = {
|
|
6
6
|
gray: {
|
|
7
7
|
backgroundColor: "bg-gray-50",
|
|
@@ -78,41 +78,32 @@ const a = {
|
|
|
78
78
|
textColor: "text-primary",
|
|
79
79
|
ringColor: "ring-background"
|
|
80
80
|
}
|
|
81
|
-
},
|
|
82
|
-
const { backgroundColor: e, textColor: r, ringColor: o } =
|
|
81
|
+
}, w = (t) => a[t] || a.gray, $ = (t) => {
|
|
82
|
+
const { backgroundColor: e, textColor: r, ringColor: o } = w(t);
|
|
83
83
|
return `inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors ${e} ${r} ${o}`;
|
|
84
|
-
},
|
|
85
|
-
const r =
|
|
84
|
+
}, T = s((t, e) => {
|
|
85
|
+
const r = $(t == null ? void 0 : t.type);
|
|
86
86
|
return c({ ...t, class: r }, e);
|
|
87
|
-
}),
|
|
87
|
+
}), L = s((t, e) => {
|
|
88
88
|
const r = t.margin ?? "my-5 mx-5", o = t.padding ?? "p-4";
|
|
89
89
|
return l({
|
|
90
90
|
...t,
|
|
91
91
|
class: `rounded-lg border bg-card text-card-foreground shadow-md min-w-[120px] min-h-[80px] ${r} ${o} ${t.class || ""}`
|
|
92
92
|
}, e);
|
|
93
|
-
}),
|
|
93
|
+
}), v = s((t, e) => b({
|
|
94
94
|
...t,
|
|
95
95
|
class: ` font-medium bg-background -mt-4 -mx-1 px-2 py-2 ${t.class || ""}`
|
|
96
|
-
}, e)),
|
|
96
|
+
}, e)), I = s((t, e) => {
|
|
97
97
|
const r = t.border === "full" ? "border rounded-md" : "border-t";
|
|
98
98
|
return f({
|
|
99
99
|
...t,
|
|
100
100
|
class: `p-6 ${r} ${t.class || ""}`
|
|
101
101
|
}, [
|
|
102
|
-
t.legend &&
|
|
102
|
+
t.legend && v(t.legend),
|
|
103
103
|
l({ class: "flex flex-auto flex-col space-y-6" }, e)
|
|
104
104
|
]);
|
|
105
105
|
}), G = u(
|
|
106
106
|
{
|
|
107
|
-
/**
|
|
108
|
-
* This will set the data for the RangeSlider component.
|
|
109
|
-
*
|
|
110
|
-
* @return {Data}
|
|
111
|
-
*/
|
|
112
|
-
setData() {
|
|
113
|
-
const t = this.data || new p({ fillPercentage: 0 });
|
|
114
|
-
return t.fillPercentage = this.getFillPercentage(this.value ?? 0), t;
|
|
115
|
-
},
|
|
116
107
|
/**
|
|
117
108
|
* This will create the initial state of the RangeSlider.
|
|
118
109
|
*
|
|
@@ -122,7 +113,8 @@ const a = {
|
|
|
122
113
|
return {
|
|
123
114
|
value: this.value ?? 0,
|
|
124
115
|
min: this.min ?? 0,
|
|
125
|
-
max: this.max ?? 100
|
|
116
|
+
max: this.max ?? 100,
|
|
117
|
+
filledPercentage: this.getFillPercentage(this.value)
|
|
126
118
|
};
|
|
127
119
|
},
|
|
128
120
|
/**
|
|
@@ -143,12 +135,13 @@ const a = {
|
|
|
143
135
|
return l({ class: "relative w-full h-4 flex items-center" }, [
|
|
144
136
|
// Track
|
|
145
137
|
l({ class: "absolute h-2 w-full rounded-full bg-muted" }),
|
|
146
|
-
x(({ state: t }) =>
|
|
138
|
+
x(({ state: t }) => [
|
|
147
139
|
// Filled Track
|
|
148
|
-
|
|
140
|
+
l({
|
|
149
141
|
class: "absolute h-2 bg-primary rounded-full",
|
|
150
142
|
style: "width: [[filledPercentage]]%"
|
|
151
|
-
}),
|
|
143
|
+
}),
|
|
144
|
+
// Thumb
|
|
152
145
|
l({
|
|
153
146
|
class: `
|
|
154
147
|
absolute block h-5 w-5 rounded-full border-2 border-primary bg-background
|
|
@@ -157,7 +150,8 @@ const a = {
|
|
|
157
150
|
disabled:pointer-events-none disabled:opacity-50 transform -translate-x-1/2
|
|
158
151
|
`.trim(),
|
|
159
152
|
style: "left: [[filledPercentage]]%"
|
|
160
|
-
}),
|
|
153
|
+
}),
|
|
154
|
+
// Hidden Range Input
|
|
161
155
|
C({
|
|
162
156
|
type: "range",
|
|
163
157
|
min: ["[[min]]", t],
|
|
@@ -166,28 +160,28 @@ const a = {
|
|
|
166
160
|
// Incorporate your new classes here
|
|
167
161
|
class: `
|
|
168
162
|
absolute w-full h-full opacity-0 cursor-pointer
|
|
163
|
+
${h}
|
|
169
164
|
${y}
|
|
170
|
-
${k}
|
|
171
165
|
${this.class || ""}
|
|
172
166
|
`.trim(),
|
|
173
167
|
bind: this.bind,
|
|
174
168
|
input: (e) => {
|
|
175
169
|
const r = Number(e.target.value);
|
|
176
|
-
this.state.value = r, this.
|
|
170
|
+
this.state.value = r, this.state.filledPercentage = this.getFillPercentage(r), typeof this.change == "function" && this.change(r);
|
|
177
171
|
}
|
|
178
|
-
})
|
|
179
|
-
)
|
|
172
|
+
})
|
|
173
|
+
])
|
|
180
174
|
]);
|
|
181
175
|
}
|
|
182
176
|
}
|
|
183
177
|
), R = s((t) => ({
|
|
184
178
|
tag: "select",
|
|
185
179
|
...t,
|
|
186
|
-
class: `${
|
|
180
|
+
class: `${k} ${t.class || ""}`.trim(),
|
|
187
181
|
onCreated(e) {
|
|
188
|
-
t.options &&
|
|
182
|
+
t.options && p.setupSelectOptions(e, t.options);
|
|
189
183
|
}
|
|
190
|
-
})),
|
|
184
|
+
})), P = (t) => !t || isNaN(t) ? null : t, i = (t, e) => {
|
|
191
185
|
const r = t, o = 16, n = 2 * Math.PI * o, d = r / 100 * n, m = `
|
|
192
186
|
<svg class="w-40 h-40 mx-auto" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
|
|
193
187
|
<!-- Background Circle -->
|
|
@@ -236,10 +230,10 @@ const a = {
|
|
|
236
230
|
class: "circle-graph-wrap",
|
|
237
231
|
onSet: [
|
|
238
232
|
t.prop,
|
|
239
|
-
(n) => (n =
|
|
233
|
+
(n) => (n = P(n), n ? i(n, r) : o)
|
|
240
234
|
]
|
|
241
235
|
}, [o]);
|
|
242
|
-
}),
|
|
236
|
+
}), S = () => l({
|
|
243
237
|
class: "absolute h-full rounded-full bg-primary transition-all duration-300",
|
|
244
238
|
style: "width: [[progress]]%;"
|
|
245
239
|
}), V = u(
|
|
@@ -251,7 +245,7 @@ const a = {
|
|
|
251
245
|
*/
|
|
252
246
|
render() {
|
|
253
247
|
return l({ class: "relative w-full h-4 rounded-full bg-muted" }, [
|
|
254
|
-
|
|
248
|
+
S()
|
|
255
249
|
]);
|
|
256
250
|
},
|
|
257
251
|
/**
|
|
@@ -294,7 +288,7 @@ const a = {
|
|
|
294
288
|
t < 0 && (t = 0), t > 100 && (t = 100), this.state.progress = t;
|
|
295
289
|
}
|
|
296
290
|
}
|
|
297
|
-
),
|
|
291
|
+
), D = ({ class: t, shape: e = "rectangle", width: r = "w-full", height: o = "h-4" }) => l({
|
|
298
292
|
class: `bg-muted animate-pulse ${r} ${o} ${e === "circle" ? "rounded-full" : "rounded-md"} ${t || ""}`
|
|
299
293
|
}), g = {
|
|
300
294
|
top: "bottom-full left-1/2 transform -translate-x-1/2 mb-2",
|
|
@@ -305,8 +299,8 @@ const a = {
|
|
|
305
299
|
"bottom-left": "top-full right-full transform translate-x-1 mt-2",
|
|
306
300
|
left: "top-1/2 right-full transform -translate-y-1/2 mr-2",
|
|
307
301
|
right: "top-1/2 left-full transform -translate-y-1/2 ml-2"
|
|
308
|
-
},
|
|
309
|
-
const o =
|
|
302
|
+
}, E = (t) => g[t] || g.top, M = s(({ position: t = "top", content: e }, r) => {
|
|
303
|
+
const o = E(t);
|
|
310
304
|
return Array.isArray(r) === !1 && (r = [r]), l({ class: "relative group inline-block" }, [
|
|
311
305
|
...r,
|
|
312
306
|
// Tooltip box
|
|
@@ -319,14 +313,14 @@ const a = {
|
|
|
319
313
|
]);
|
|
320
314
|
});
|
|
321
315
|
export {
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
316
|
+
T as B,
|
|
317
|
+
L as C,
|
|
318
|
+
I as F,
|
|
319
|
+
v as L,
|
|
326
320
|
V as P,
|
|
327
321
|
G as R,
|
|
328
322
|
R as S,
|
|
329
|
-
|
|
323
|
+
M as T,
|
|
330
324
|
O as a,
|
|
331
|
-
|
|
325
|
+
D as b
|
|
332
326
|
};
|
package/package.json
CHANGED