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