@adamosuiteservices/ui 2.14.2 → 2.15.0
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/combobox-DGuQtXjP.js +608 -0
- package/dist/combobox-hTCtPMUL.cjs +40 -0
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/components/ui/combobox/combobox.d.ts +5 -1
- package/dist/components/ui/date-picker-selector/date-picker-selector.d.ts +5 -1
- package/dist/components/ui/file-upload/file-upload.d.ts +3 -1
- package/dist/components/ui/slider/slider.d.ts +1 -1
- package/dist/components/ui/switch/switch.d.ts +1 -1
- package/dist/date-picker-selector.cjs +1 -1
- package/dist/date-picker-selector.js +38 -28
- package/dist/field.cjs +2 -2
- package/dist/field.js +2 -2
- package/dist/file-upload.cjs +5 -3
- package/dist/file-upload.js +178 -149
- package/dist/slider.cjs +5 -5
- package/dist/slider.js +196 -177
- package/dist/styles.css +1 -1
- package/dist/switch.cjs +3 -3
- package/dist/switch.js +105 -85
- package/docs/components/ui/accordion-rounded.md +2 -6
- package/docs/components/ui/avatar.md +3 -1
- package/docs/components/ui/button.md +22 -16
- package/docs/components/ui/card.md +49 -31
- package/docs/components/ui/checkbox.md +44 -8
- package/docs/components/ui/combobox.md +62 -4
- package/docs/components/ui/date-picker-selector.md +90 -26
- package/docs/components/ui/file-upload.md +241 -94
- package/docs/components/ui/icon.md +1 -1
- package/docs/components/ui/input.md +4 -1
- package/docs/components/ui/radio-group.md +1 -1
- package/docs/components/ui/select.md +51 -34
- package/docs/components/ui/sheet.md +3 -9
- package/docs/components/ui/slider.md +120 -99
- package/docs/components/ui/switch.md +408 -408
- package/docs/components/ui/textarea.md +37 -22
- package/docs/components/ui/tooltip.md +5 -2
- package/docs/components/ui/typography.md +63 -39
- package/package.json +1 -1
- package/dist/combobox-CCJGIMFQ.cjs +0 -40
- package/dist/combobox-Cj-GEp-T.js +0 -604
package/dist/slider.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { j as
|
|
2
|
+
import { j as h } from "./jsx-runtime-BzflLqGi.js";
|
|
3
3
|
import * as l from "react";
|
|
4
4
|
import { c as Y } from "./index-rKs9bXHr.js";
|
|
5
5
|
import { u as le, c as _ } from "./index-C0UREtMP.js";
|
|
6
6
|
import { u as M } from "./index-DLcqcWxM.js";
|
|
7
7
|
import { c as ce } from "./index-FxyLF8MY.js";
|
|
8
|
-
import { c as ue, u as
|
|
9
|
-
import { u as
|
|
8
|
+
import { c as ue, u as fe } from "./index-CmWhhuj7.js";
|
|
9
|
+
import { u as me } from "./index-BZPx6jYI.js";
|
|
10
10
|
import { u as he } from "./index-BGQepRFJ.js";
|
|
11
|
-
import { P as
|
|
11
|
+
import { P as K } from "./index-BMWt1NBG.js";
|
|
12
12
|
import { c as N } from "./index-CRiPKpXj.js";
|
|
13
13
|
var X = ["PageUp", "PageDown"], G = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], W = {
|
|
14
14
|
"from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
@@ -22,85 +22,85 @@ var X = ["PageUp", "PageDown"], G = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arrow
|
|
|
22
22
|
const {
|
|
23
23
|
name: n,
|
|
24
24
|
min: o = 0,
|
|
25
|
-
max:
|
|
25
|
+
max: a = 100,
|
|
26
26
|
step: d = 1,
|
|
27
27
|
orientation: r = "horizontal",
|
|
28
28
|
disabled: s = !1,
|
|
29
|
-
minStepsBetweenThumbs:
|
|
30
|
-
defaultValue:
|
|
31
|
-
value:
|
|
32
|
-
onValueChange:
|
|
29
|
+
minStepsBetweenThumbs: m = 0,
|
|
30
|
+
defaultValue: v = [o],
|
|
31
|
+
value: S,
|
|
32
|
+
onValueChange: i = () => {
|
|
33
33
|
},
|
|
34
|
-
onValueCommit:
|
|
34
|
+
onValueCommit: u = () => {
|
|
35
35
|
},
|
|
36
|
-
inverted:
|
|
36
|
+
inverted: g = !1,
|
|
37
37
|
form: y,
|
|
38
|
-
...
|
|
39
|
-
} = e,
|
|
40
|
-
prop:
|
|
41
|
-
defaultProp:
|
|
38
|
+
...p
|
|
39
|
+
} = e, f = l.useRef(/* @__PURE__ */ new Set()), c = l.useRef(0), w = r === "horizontal" ? be : ve, [b = [], A] = le({
|
|
40
|
+
prop: S,
|
|
41
|
+
defaultProp: v,
|
|
42
42
|
onChange: (x) => {
|
|
43
|
-
[...
|
|
43
|
+
[...f.current][c.current]?.focus(), i(x);
|
|
44
44
|
}
|
|
45
|
-
}), B = l.useRef(
|
|
45
|
+
}), B = l.useRef(b);
|
|
46
46
|
function T(x) {
|
|
47
|
-
const R = Pe(
|
|
47
|
+
const R = Pe(b, x);
|
|
48
48
|
j(x, R);
|
|
49
49
|
}
|
|
50
50
|
function se(x) {
|
|
51
|
-
j(x,
|
|
51
|
+
j(x, c.current);
|
|
52
52
|
}
|
|
53
53
|
function de() {
|
|
54
|
-
const x = B.current[
|
|
55
|
-
|
|
54
|
+
const x = B.current[c.current];
|
|
55
|
+
b[c.current] !== x && u(b);
|
|
56
56
|
}
|
|
57
57
|
function j(x, R, { commit: V } = { commit: !1 }) {
|
|
58
|
-
const
|
|
58
|
+
const U = Me(d), z = Ce(Math.round((x - o) / d) * d + o, U), I = Y(z, [o, a]);
|
|
59
59
|
A((E = []) => {
|
|
60
|
-
const P = ye(E,
|
|
61
|
-
if (_e(P,
|
|
62
|
-
|
|
60
|
+
const P = ye(E, I, R);
|
|
61
|
+
if (_e(P, m * d)) {
|
|
62
|
+
c.current = P.indexOf(I);
|
|
63
63
|
const $ = String(P) !== String(E);
|
|
64
|
-
return $ && V &&
|
|
64
|
+
return $ && V && u(P), $ ? P : E;
|
|
65
65
|
} else
|
|
66
66
|
return E;
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ h.jsx(
|
|
70
70
|
ge,
|
|
71
71
|
{
|
|
72
72
|
scope: e.__scopeSlider,
|
|
73
73
|
name: n,
|
|
74
74
|
disabled: s,
|
|
75
75
|
min: o,
|
|
76
|
-
max:
|
|
77
|
-
valueIndexToChangeRef:
|
|
78
|
-
thumbs:
|
|
79
|
-
values:
|
|
76
|
+
max: a,
|
|
77
|
+
valueIndexToChangeRef: c,
|
|
78
|
+
thumbs: f.current,
|
|
79
|
+
values: b,
|
|
80
80
|
orientation: r,
|
|
81
81
|
form: y,
|
|
82
|
-
children: /* @__PURE__ */
|
|
83
|
-
|
|
82
|
+
children: /* @__PURE__ */ h.jsx(H.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ h.jsx(H.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ h.jsx(
|
|
83
|
+
w,
|
|
84
84
|
{
|
|
85
85
|
"aria-disabled": s,
|
|
86
86
|
"data-disabled": s ? "" : void 0,
|
|
87
|
-
...
|
|
87
|
+
...p,
|
|
88
88
|
ref: t,
|
|
89
|
-
onPointerDown: _(
|
|
90
|
-
s || (B.current =
|
|
89
|
+
onPointerDown: _(p.onPointerDown, () => {
|
|
90
|
+
s || (B.current = b);
|
|
91
91
|
}),
|
|
92
92
|
min: o,
|
|
93
|
-
max:
|
|
94
|
-
inverted:
|
|
93
|
+
max: a,
|
|
94
|
+
inverted: g,
|
|
95
95
|
onSlideStart: s ? void 0 : T,
|
|
96
96
|
onSlideMove: s ? void 0 : se,
|
|
97
97
|
onSlideEnd: s ? void 0 : de,
|
|
98
98
|
onHomeKeyDown: () => !s && j(o, 0, { commit: !0 }),
|
|
99
|
-
onEndKeyDown: () => !s && j(
|
|
99
|
+
onEndKeyDown: () => !s && j(a, b.length - 1, { commit: !0 }),
|
|
100
100
|
onStepKeyDown: ({ event: x, direction: R }) => {
|
|
101
101
|
if (!s) {
|
|
102
|
-
const z = X.includes(x.key) || x.shiftKey && G.includes(x.key) ? 10 : 1,
|
|
103
|
-
j(E + P,
|
|
102
|
+
const z = X.includes(x.key) || x.shiftKey && G.includes(x.key) ? 10 : 1, I = c.current, E = b[I], P = d * z * R;
|
|
103
|
+
j(E + P, I, { commit: !0 });
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|
|
@@ -115,110 +115,110 @@ var [Q, Z] = q(C, {
|
|
|
115
115
|
endEdge: "right",
|
|
116
116
|
size: "width",
|
|
117
117
|
direction: 1
|
|
118
|
-
}),
|
|
118
|
+
}), be = l.forwardRef(
|
|
119
119
|
(e, t) => {
|
|
120
120
|
const {
|
|
121
121
|
min: n,
|
|
122
122
|
max: o,
|
|
123
|
-
dir:
|
|
123
|
+
dir: a,
|
|
124
124
|
inverted: d,
|
|
125
125
|
onSlideStart: r,
|
|
126
126
|
onSlideMove: s,
|
|
127
|
-
onSlideEnd:
|
|
128
|
-
onStepKeyDown:
|
|
129
|
-
...
|
|
130
|
-
} = e, [
|
|
131
|
-
function D(
|
|
132
|
-
const
|
|
133
|
-
return y.current =
|
|
127
|
+
onSlideEnd: m,
|
|
128
|
+
onStepKeyDown: v,
|
|
129
|
+
...S
|
|
130
|
+
} = e, [i, u] = l.useState(null), g = M(t, (w) => u(w)), y = l.useRef(void 0), p = fe(a), f = p === "ltr", c = f && !d || !f && d;
|
|
131
|
+
function D(w) {
|
|
132
|
+
const b = y.current || i.getBoundingClientRect(), A = [0, b.width], T = L(A, c ? [n, o] : [o, n]);
|
|
133
|
+
return y.current = b, T(w - b.left);
|
|
134
134
|
}
|
|
135
|
-
return /* @__PURE__ */
|
|
135
|
+
return /* @__PURE__ */ h.jsx(
|
|
136
136
|
Q,
|
|
137
137
|
{
|
|
138
138
|
scope: e.__scopeSlider,
|
|
139
|
-
startEdge:
|
|
140
|
-
endEdge:
|
|
141
|
-
direction:
|
|
139
|
+
startEdge: c ? "left" : "right",
|
|
140
|
+
endEdge: c ? "right" : "left",
|
|
141
|
+
direction: c ? 1 : -1,
|
|
142
142
|
size: "width",
|
|
143
|
-
children: /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ h.jsx(
|
|
144
144
|
ee,
|
|
145
145
|
{
|
|
146
|
-
dir:
|
|
146
|
+
dir: p,
|
|
147
147
|
"data-orientation": "horizontal",
|
|
148
|
-
...
|
|
149
|
-
ref:
|
|
148
|
+
...S,
|
|
149
|
+
ref: g,
|
|
150
150
|
style: {
|
|
151
|
-
...
|
|
151
|
+
...S.style,
|
|
152
152
|
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
153
153
|
},
|
|
154
|
-
onSlideStart: (
|
|
155
|
-
const
|
|
156
|
-
r?.(
|
|
154
|
+
onSlideStart: (w) => {
|
|
155
|
+
const b = D(w.clientX);
|
|
156
|
+
r?.(b);
|
|
157
157
|
},
|
|
158
|
-
onSlideMove: (
|
|
159
|
-
const
|
|
160
|
-
s?.(
|
|
158
|
+
onSlideMove: (w) => {
|
|
159
|
+
const b = D(w.clientX);
|
|
160
|
+
s?.(b);
|
|
161
161
|
},
|
|
162
162
|
onSlideEnd: () => {
|
|
163
|
-
y.current = void 0,
|
|
163
|
+
y.current = void 0, m?.();
|
|
164
164
|
},
|
|
165
|
-
onStepKeyDown: (
|
|
166
|
-
const A = W[
|
|
167
|
-
|
|
165
|
+
onStepKeyDown: (w) => {
|
|
166
|
+
const A = W[c ? "from-left" : "from-right"].includes(w.key);
|
|
167
|
+
v?.({ event: w, direction: A ? -1 : 1 });
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
)
|
|
171
171
|
}
|
|
172
172
|
);
|
|
173
173
|
}
|
|
174
|
-
),
|
|
174
|
+
), ve = l.forwardRef(
|
|
175
175
|
(e, t) => {
|
|
176
176
|
const {
|
|
177
177
|
min: n,
|
|
178
178
|
max: o,
|
|
179
|
-
inverted:
|
|
179
|
+
inverted: a,
|
|
180
180
|
onSlideStart: d,
|
|
181
181
|
onSlideMove: r,
|
|
182
182
|
onSlideEnd: s,
|
|
183
|
-
onStepKeyDown:
|
|
184
|
-
...
|
|
185
|
-
} = e,
|
|
186
|
-
function y(
|
|
187
|
-
const
|
|
188
|
-
return
|
|
183
|
+
onStepKeyDown: m,
|
|
184
|
+
...v
|
|
185
|
+
} = e, S = l.useRef(null), i = M(t, S), u = l.useRef(void 0), g = !a;
|
|
186
|
+
function y(p) {
|
|
187
|
+
const f = u.current || S.current.getBoundingClientRect(), c = [0, f.height], w = L(c, g ? [o, n] : [n, o]);
|
|
188
|
+
return u.current = f, w(p - f.top);
|
|
189
189
|
}
|
|
190
|
-
return /* @__PURE__ */
|
|
190
|
+
return /* @__PURE__ */ h.jsx(
|
|
191
191
|
Q,
|
|
192
192
|
{
|
|
193
193
|
scope: e.__scopeSlider,
|
|
194
|
-
startEdge:
|
|
195
|
-
endEdge:
|
|
194
|
+
startEdge: g ? "bottom" : "top",
|
|
195
|
+
endEdge: g ? "top" : "bottom",
|
|
196
196
|
size: "height",
|
|
197
|
-
direction:
|
|
198
|
-
children: /* @__PURE__ */
|
|
197
|
+
direction: g ? 1 : -1,
|
|
198
|
+
children: /* @__PURE__ */ h.jsx(
|
|
199
199
|
ee,
|
|
200
200
|
{
|
|
201
201
|
"data-orientation": "vertical",
|
|
202
|
-
...
|
|
203
|
-
ref:
|
|
202
|
+
...v,
|
|
203
|
+
ref: i,
|
|
204
204
|
style: {
|
|
205
|
-
...
|
|
205
|
+
...v.style,
|
|
206
206
|
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
207
207
|
},
|
|
208
|
-
onSlideStart: (
|
|
209
|
-
const
|
|
210
|
-
d?.(
|
|
208
|
+
onSlideStart: (p) => {
|
|
209
|
+
const f = y(p.clientY);
|
|
210
|
+
d?.(f);
|
|
211
211
|
},
|
|
212
|
-
onSlideMove: (
|
|
213
|
-
const
|
|
214
|
-
r?.(
|
|
212
|
+
onSlideMove: (p) => {
|
|
213
|
+
const f = y(p.clientY);
|
|
214
|
+
r?.(f);
|
|
215
215
|
},
|
|
216
216
|
onSlideEnd: () => {
|
|
217
|
-
|
|
217
|
+
u.current = void 0, s?.();
|
|
218
218
|
},
|
|
219
|
-
onStepKeyDown: (
|
|
220
|
-
const
|
|
221
|
-
|
|
219
|
+
onStepKeyDown: (p) => {
|
|
220
|
+
const c = W[g ? "from-bottom" : "from-top"].includes(p.key);
|
|
221
|
+
m?.({ event: p, direction: c ? -1 : 1 });
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
)
|
|
@@ -230,43 +230,43 @@ var [Q, Z] = q(C, {
|
|
|
230
230
|
const {
|
|
231
231
|
__scopeSlider: n,
|
|
232
232
|
onSlideStart: o,
|
|
233
|
-
onSlideMove:
|
|
233
|
+
onSlideMove: a,
|
|
234
234
|
onSlideEnd: d,
|
|
235
235
|
onHomeKeyDown: r,
|
|
236
236
|
onEndKeyDown: s,
|
|
237
|
-
onStepKeyDown:
|
|
238
|
-
...
|
|
239
|
-
} = e,
|
|
240
|
-
return /* @__PURE__ */
|
|
241
|
-
|
|
237
|
+
onStepKeyDown: m,
|
|
238
|
+
...v
|
|
239
|
+
} = e, S = k(C, n);
|
|
240
|
+
return /* @__PURE__ */ h.jsx(
|
|
241
|
+
K.span,
|
|
242
242
|
{
|
|
243
|
-
...
|
|
243
|
+
...v,
|
|
244
244
|
ref: t,
|
|
245
|
-
onKeyDown: _(e.onKeyDown, (
|
|
246
|
-
|
|
245
|
+
onKeyDown: _(e.onKeyDown, (i) => {
|
|
246
|
+
i.key === "Home" ? (r(i), i.preventDefault()) : i.key === "End" ? (s(i), i.preventDefault()) : X.concat(G).includes(i.key) && (m(i), i.preventDefault());
|
|
247
247
|
}),
|
|
248
|
-
onPointerDown: _(e.onPointerDown, (
|
|
249
|
-
const
|
|
250
|
-
|
|
248
|
+
onPointerDown: _(e.onPointerDown, (i) => {
|
|
249
|
+
const u = i.target;
|
|
250
|
+
u.setPointerCapture(i.pointerId), i.preventDefault(), S.thumbs.has(u) ? u.focus() : o(i);
|
|
251
251
|
}),
|
|
252
|
-
onPointerMove: _(e.onPointerMove, (
|
|
253
|
-
|
|
252
|
+
onPointerMove: _(e.onPointerMove, (i) => {
|
|
253
|
+
i.target.hasPointerCapture(i.pointerId) && a(i);
|
|
254
254
|
}),
|
|
255
|
-
onPointerUp: _(e.onPointerUp, (
|
|
256
|
-
const
|
|
257
|
-
|
|
255
|
+
onPointerUp: _(e.onPointerUp, (i) => {
|
|
256
|
+
const u = i.target;
|
|
257
|
+
u.hasPointerCapture(i.pointerId) && (u.releasePointerCapture(i.pointerId), d(i));
|
|
258
258
|
})
|
|
259
259
|
}
|
|
260
260
|
);
|
|
261
261
|
}
|
|
262
262
|
), te = "SliderTrack", ne = l.forwardRef(
|
|
263
263
|
(e, t) => {
|
|
264
|
-
const { __scopeSlider: n, ...o } = e,
|
|
265
|
-
return /* @__PURE__ */
|
|
266
|
-
|
|
264
|
+
const { __scopeSlider: n, ...o } = e, a = k(te, n);
|
|
265
|
+
return /* @__PURE__ */ h.jsx(
|
|
266
|
+
K.span,
|
|
267
267
|
{
|
|
268
|
-
"data-disabled":
|
|
269
|
-
"data-orientation":
|
|
268
|
+
"data-disabled": a.disabled ? "" : void 0,
|
|
269
|
+
"data-orientation": a.orientation,
|
|
270
270
|
...o,
|
|
271
271
|
ref: t
|
|
272
272
|
}
|
|
@@ -274,79 +274,79 @@ var [Q, Z] = q(C, {
|
|
|
274
274
|
}
|
|
275
275
|
);
|
|
276
276
|
ne.displayName = te;
|
|
277
|
-
var
|
|
277
|
+
var F = "SliderRange", oe = l.forwardRef(
|
|
278
278
|
(e, t) => {
|
|
279
|
-
const { __scopeSlider: n, ...o } = e,
|
|
280
|
-
(
|
|
281
|
-
),
|
|
282
|
-
return /* @__PURE__ */
|
|
283
|
-
|
|
279
|
+
const { __scopeSlider: n, ...o } = e, a = k(F, n), d = Z(F, n), r = l.useRef(null), s = M(t, r), m = a.values.length, v = a.values.map(
|
|
280
|
+
(u) => ae(u, a.min, a.max)
|
|
281
|
+
), S = m > 1 ? Math.min(...v) : 0, i = 100 - Math.max(...v);
|
|
282
|
+
return /* @__PURE__ */ h.jsx(
|
|
283
|
+
K.span,
|
|
284
284
|
{
|
|
285
|
-
"data-orientation":
|
|
286
|
-
"data-disabled":
|
|
285
|
+
"data-orientation": a.orientation,
|
|
286
|
+
"data-disabled": a.disabled ? "" : void 0,
|
|
287
287
|
...o,
|
|
288
288
|
ref: s,
|
|
289
289
|
style: {
|
|
290
290
|
...e.style,
|
|
291
|
-
[d.startEdge]:
|
|
292
|
-
[d.endEdge]:
|
|
291
|
+
[d.startEdge]: S + "%",
|
|
292
|
+
[d.endEdge]: i + "%"
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
295
|
);
|
|
296
296
|
}
|
|
297
297
|
);
|
|
298
|
-
oe.displayName =
|
|
298
|
+
oe.displayName = F;
|
|
299
299
|
var O = "SliderThumb", re = l.forwardRef(
|
|
300
300
|
(e, t) => {
|
|
301
|
-
const n = pe(e.__scopeSlider), [o,
|
|
301
|
+
const n = pe(e.__scopeSlider), [o, a] = l.useState(null), d = M(t, (s) => a(s)), r = l.useMemo(
|
|
302
302
|
() => o ? n().findIndex((s) => s.ref.current === o) : -1,
|
|
303
303
|
[n, o]
|
|
304
304
|
);
|
|
305
|
-
return /* @__PURE__ */
|
|
305
|
+
return /* @__PURE__ */ h.jsx(we, { ...e, ref: d, index: r });
|
|
306
306
|
}
|
|
307
|
-
),
|
|
307
|
+
), we = l.forwardRef(
|
|
308
308
|
(e, t) => {
|
|
309
|
-
const { __scopeSlider: n, index: o, name:
|
|
309
|
+
const { __scopeSlider: n, index: o, name: a, ...d } = e, r = k(O, n), s = Z(O, n), [m, v] = l.useState(null), S = M(t, (D) => v(D)), i = m ? r.form || !!m.closest("form") : !0, u = he(m), g = r.values[o], y = g === void 0 ? 0 : ae(g, r.min, r.max), p = Re(o, r.values.length), f = u?.[s.size], c = f ? De(f, y, s.direction) : 0;
|
|
310
310
|
return l.useEffect(() => {
|
|
311
|
-
if (
|
|
312
|
-
return r.thumbs.add(
|
|
313
|
-
r.thumbs.delete(
|
|
311
|
+
if (m)
|
|
312
|
+
return r.thumbs.add(m), () => {
|
|
313
|
+
r.thumbs.delete(m);
|
|
314
314
|
};
|
|
315
|
-
}, [
|
|
315
|
+
}, [m, r.thumbs]), /* @__PURE__ */ h.jsxs(
|
|
316
316
|
"span",
|
|
317
317
|
{
|
|
318
318
|
style: {
|
|
319
319
|
transform: "var(--radix-slider-thumb-transform)",
|
|
320
320
|
position: "absolute",
|
|
321
|
-
[s.startEdge]: `calc(${y}% + ${
|
|
321
|
+
[s.startEdge]: `calc(${y}% + ${c}px)`
|
|
322
322
|
},
|
|
323
323
|
children: [
|
|
324
|
-
/* @__PURE__ */
|
|
325
|
-
|
|
324
|
+
/* @__PURE__ */ h.jsx(H.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ h.jsx(
|
|
325
|
+
K.span,
|
|
326
326
|
{
|
|
327
327
|
role: "slider",
|
|
328
|
-
"aria-label": e["aria-label"] ||
|
|
328
|
+
"aria-label": e["aria-label"] || p,
|
|
329
329
|
"aria-valuemin": r.min,
|
|
330
|
-
"aria-valuenow":
|
|
330
|
+
"aria-valuenow": g,
|
|
331
331
|
"aria-valuemax": r.max,
|
|
332
332
|
"aria-orientation": r.orientation,
|
|
333
333
|
"data-orientation": r.orientation,
|
|
334
334
|
"data-disabled": r.disabled ? "" : void 0,
|
|
335
335
|
tabIndex: r.disabled ? void 0 : 0,
|
|
336
336
|
...d,
|
|
337
|
-
ref:
|
|
338
|
-
style:
|
|
337
|
+
ref: S,
|
|
338
|
+
style: g === void 0 ? { display: "none" } : e.style,
|
|
339
339
|
onFocus: _(e.onFocus, () => {
|
|
340
340
|
r.valueIndexToChangeRef.current = o;
|
|
341
341
|
})
|
|
342
342
|
}
|
|
343
343
|
) }),
|
|
344
|
-
|
|
344
|
+
i && /* @__PURE__ */ h.jsx(
|
|
345
345
|
ie,
|
|
346
346
|
{
|
|
347
|
-
name:
|
|
347
|
+
name: a ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
|
|
348
348
|
form: r.form,
|
|
349
|
-
value:
|
|
349
|
+
value: g
|
|
350
350
|
},
|
|
351
351
|
o
|
|
352
352
|
)
|
|
@@ -358,17 +358,17 @@ var O = "SliderThumb", re = l.forwardRef(
|
|
|
358
358
|
re.displayName = O;
|
|
359
359
|
var xe = "RadioBubbleInput", ie = l.forwardRef(
|
|
360
360
|
({ __scopeSlider: e, value: t, ...n }, o) => {
|
|
361
|
-
const
|
|
361
|
+
const a = l.useRef(null), d = M(a, o), r = me(t);
|
|
362
362
|
return l.useEffect(() => {
|
|
363
|
-
const s =
|
|
363
|
+
const s = a.current;
|
|
364
364
|
if (!s) return;
|
|
365
|
-
const
|
|
366
|
-
if (r !== t &&
|
|
367
|
-
const
|
|
368
|
-
|
|
365
|
+
const m = window.HTMLInputElement.prototype, S = Object.getOwnPropertyDescriptor(m, "value").set;
|
|
366
|
+
if (r !== t && S) {
|
|
367
|
+
const i = new Event("input", { bubbles: !0 });
|
|
368
|
+
S.call(s, t), s.dispatchEvent(i);
|
|
369
369
|
}
|
|
370
|
-
}, [r, t]), /* @__PURE__ */
|
|
371
|
-
|
|
370
|
+
}, [r, t]), /* @__PURE__ */ h.jsx(
|
|
371
|
+
K.input,
|
|
372
372
|
{
|
|
373
373
|
style: { display: "none" },
|
|
374
374
|
...n,
|
|
@@ -381,7 +381,7 @@ var xe = "RadioBubbleInput", ie = l.forwardRef(
|
|
|
381
381
|
ie.displayName = xe;
|
|
382
382
|
function ye(e = [], t, n) {
|
|
383
383
|
const o = [...e];
|
|
384
|
-
return o[n] = t, o.sort((
|
|
384
|
+
return o[n] = t, o.sort((a, d) => a - d);
|
|
385
385
|
}
|
|
386
386
|
function ae(e, t, n) {
|
|
387
387
|
const d = 100 / (n - t) * (e - t);
|
|
@@ -392,11 +392,11 @@ function Re(e, t) {
|
|
|
392
392
|
}
|
|
393
393
|
function Pe(e, t) {
|
|
394
394
|
if (e.length === 1) return 0;
|
|
395
|
-
const n = e.map((
|
|
395
|
+
const n = e.map((a) => Math.abs(a - t)), o = Math.min(...n);
|
|
396
396
|
return n.indexOf(o);
|
|
397
397
|
}
|
|
398
398
|
function De(e, t, n) {
|
|
399
|
-
const o = e / 2, d =
|
|
399
|
+
const o = e / 2, d = L([0, 50], [0, o]);
|
|
400
400
|
return (o - d(t) * n) * n;
|
|
401
401
|
}
|
|
402
402
|
function Ee(e) {
|
|
@@ -409,7 +409,7 @@ function _e(e, t) {
|
|
|
409
409
|
}
|
|
410
410
|
return !0;
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function L(e, t) {
|
|
413
413
|
return (n) => {
|
|
414
414
|
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
415
415
|
const o = (t[1] - t[0]) / (e[1] - e[0]);
|
|
@@ -423,21 +423,38 @@ function Ce(e, t) {
|
|
|
423
423
|
const n = Math.pow(10, t);
|
|
424
424
|
return Math.round(e * n) / n;
|
|
425
425
|
}
|
|
426
|
-
var Ae = J, je = ne,
|
|
427
|
-
function
|
|
426
|
+
var Ae = J, je = ne, Ie = oe, Ke = re;
|
|
427
|
+
function Ue({
|
|
428
428
|
className: e,
|
|
429
429
|
defaultValue: t,
|
|
430
430
|
value: n,
|
|
431
431
|
min: o = 0,
|
|
432
|
-
max:
|
|
432
|
+
max: a = 100,
|
|
433
433
|
theme: d,
|
|
434
434
|
colorSlide: r,
|
|
435
|
-
|
|
435
|
+
disabled: s,
|
|
436
|
+
...m
|
|
436
437
|
}) {
|
|
437
|
-
const
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
438
|
+
const [v, S] = l.useState(!1), i = l.useRef(null);
|
|
439
|
+
l.useEffect(() => {
|
|
440
|
+
const p = () => {
|
|
441
|
+
if (i.current) {
|
|
442
|
+
const c = i.current.closest("fieldset");
|
|
443
|
+
S(c?.disabled ?? !1);
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
p();
|
|
447
|
+
const f = new MutationObserver(p);
|
|
448
|
+
if (i.current) {
|
|
449
|
+
const c = i.current.closest("fieldset");
|
|
450
|
+
c && f.observe(c, { attributes: !0, attributeFilter: ["disabled"] });
|
|
451
|
+
}
|
|
452
|
+
return () => f.disconnect();
|
|
453
|
+
}, []);
|
|
454
|
+
const u = s || v, g = l.useMemo(
|
|
455
|
+
() => Array.isArray(n) ? n : Array.isArray(t) ? t : [o, a],
|
|
456
|
+
[n, t, o, a]
|
|
457
|
+
), y = l.useMemo(() => {
|
|
441
458
|
if (r) {
|
|
442
459
|
if (r === "full")
|
|
443
460
|
return {
|
|
@@ -449,15 +466,17 @@ function Fe({
|
|
|
449
466
|
};
|
|
450
467
|
}
|
|
451
468
|
}, [r]);
|
|
452
|
-
return /* @__PURE__ */
|
|
469
|
+
return /* @__PURE__ */ h.jsxs(
|
|
453
470
|
Ae,
|
|
454
471
|
{
|
|
472
|
+
ref: i,
|
|
455
473
|
"data-slot": "slider",
|
|
456
474
|
"data-theme": d,
|
|
457
475
|
defaultValue: t,
|
|
458
476
|
value: n,
|
|
459
477
|
min: o,
|
|
460
|
-
max:
|
|
478
|
+
max: a,
|
|
479
|
+
disabled: u,
|
|
461
480
|
className: N(
|
|
462
481
|
`
|
|
463
482
|
adm:relative adm:flex adm:w-full adm:touch-none adm:items-center
|
|
@@ -470,9 +489,9 @@ function Fe({
|
|
|
470
489
|
`,
|
|
471
490
|
e
|
|
472
491
|
),
|
|
473
|
-
...
|
|
492
|
+
...m,
|
|
474
493
|
children: [
|
|
475
|
-
/* @__PURE__ */
|
|
494
|
+
/* @__PURE__ */ h.jsx(
|
|
476
495
|
je,
|
|
477
496
|
{
|
|
478
497
|
"data-slot": "slider-track",
|
|
@@ -486,9 +505,9 @@ function Fe({
|
|
|
486
505
|
`,
|
|
487
506
|
r ? "" : "adm:bg-muted"
|
|
488
507
|
),
|
|
489
|
-
style: r ?
|
|
490
|
-
children: /* @__PURE__ */
|
|
491
|
-
|
|
508
|
+
style: r ? y : void 0,
|
|
509
|
+
children: /* @__PURE__ */ h.jsx(
|
|
510
|
+
Ie,
|
|
492
511
|
{
|
|
493
512
|
"data-slot": "slider-range",
|
|
494
513
|
className: N(
|
|
@@ -503,8 +522,8 @@ function Fe({
|
|
|
503
522
|
)
|
|
504
523
|
}
|
|
505
524
|
),
|
|
506
|
-
Array.from({ length:
|
|
507
|
-
|
|
525
|
+
Array.from({ length: g.length }, (p, f) => /* @__PURE__ */ h.jsx(
|
|
526
|
+
Ke,
|
|
508
527
|
{
|
|
509
528
|
"data-slot": "slider-thumb",
|
|
510
529
|
className: `
|
|
@@ -516,12 +535,12 @@ function Fe({
|
|
|
516
535
|
adm:disabled:pointer-events-none adm:disabled:opacity-50
|
|
517
536
|
`
|
|
518
537
|
},
|
|
519
|
-
|
|
538
|
+
f
|
|
520
539
|
))
|
|
521
540
|
]
|
|
522
541
|
}
|
|
523
542
|
);
|
|
524
543
|
}
|
|
525
544
|
export {
|
|
526
|
-
|
|
545
|
+
Ue as Slider
|
|
527
546
|
};
|