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