@purpurds/slider 8.8.1 → 8.9.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/slider.cjs.js +1 -5
- package/dist/slider.cjs.js.map +1 -1
- package/dist/slider.es.js +276 -288
- package/dist/slider.es.js.map +1 -1
- package/package.json +18 -18
- package/src/slider.test.tsx +9 -5
package/dist/slider.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as h, jsxs as J } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
3
|
import D, { forwardRef as ge, useId as be } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
function Q(e, [t, n]) {
|
|
6
6
|
return Math.min(n, Math.max(t, e));
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return function(
|
|
10
|
-
if (e
|
|
11
|
-
return t
|
|
8
|
+
function A(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
9
|
+
return function(r) {
|
|
10
|
+
if (e?.(r), n === !1 || !r.defaultPrevented)
|
|
11
|
+
return t?.(r);
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
function G(e, t) {
|
|
@@ -19,65 +19,63 @@ function G(e, t) {
|
|
|
19
19
|
function ee(...e) {
|
|
20
20
|
return (t) => {
|
|
21
21
|
let n = !1;
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
return !n && typeof
|
|
22
|
+
const i = e.map((r) => {
|
|
23
|
+
const o = G(r, t);
|
|
24
|
+
return !n && typeof o == "function" && (n = !0), o;
|
|
25
25
|
});
|
|
26
26
|
if (n)
|
|
27
27
|
return () => {
|
|
28
|
-
for (let
|
|
29
|
-
const
|
|
30
|
-
typeof
|
|
28
|
+
for (let r = 0; r < i.length; r++) {
|
|
29
|
+
const o = i[r];
|
|
30
|
+
typeof o == "function" ? o() : G(e[r], null);
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function M(...e) {
|
|
36
36
|
return l.useCallback(ee(...e), e);
|
|
37
37
|
}
|
|
38
38
|
function te(e, t = []) {
|
|
39
39
|
let n = [];
|
|
40
|
-
function o
|
|
40
|
+
function i(o, s) {
|
|
41
41
|
const c = l.createContext(s), u = n.length;
|
|
42
42
|
n = [...n, s];
|
|
43
43
|
const d = (a) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return /* @__PURE__ */ S(m.Provider, { value: p, children: y });
|
|
44
|
+
const { scope: p, children: y, ..._ } = a, m = p?.[e]?.[u] || c, f = l.useMemo(() => _, Object.values(_));
|
|
45
|
+
return /* @__PURE__ */ h(m.Provider, { value: f, children: y });
|
|
47
46
|
};
|
|
48
|
-
d.displayName =
|
|
49
|
-
function g(a,
|
|
50
|
-
|
|
51
|
-
const y = ((m = f == null ? void 0 : f[e]) == null ? void 0 : m[u]) || c, _ = l.useContext(y);
|
|
47
|
+
d.displayName = o + "Provider";
|
|
48
|
+
function g(a, p) {
|
|
49
|
+
const y = p?.[e]?.[u] || c, _ = l.useContext(y);
|
|
52
50
|
if (_) return _;
|
|
53
51
|
if (s !== void 0) return s;
|
|
54
|
-
throw new Error(`\`${a}\` must be used within \`${
|
|
52
|
+
throw new Error(`\`${a}\` must be used within \`${o}\``);
|
|
55
53
|
}
|
|
56
54
|
return [d, g];
|
|
57
55
|
}
|
|
58
|
-
const
|
|
59
|
-
const
|
|
56
|
+
const r = () => {
|
|
57
|
+
const o = n.map((s) => l.createContext(s));
|
|
60
58
|
return function(c) {
|
|
61
|
-
const u =
|
|
59
|
+
const u = c?.[e] || o;
|
|
62
60
|
return l.useMemo(
|
|
63
61
|
() => ({ [`__scope${e}`]: { ...c, [e]: u } }),
|
|
64
62
|
[c, u]
|
|
65
63
|
);
|
|
66
64
|
};
|
|
67
65
|
};
|
|
68
|
-
return
|
|
66
|
+
return r.scopeName = e, [i, ye(r, ...t)];
|
|
69
67
|
}
|
|
70
68
|
function ye(...e) {
|
|
71
69
|
const t = e[0];
|
|
72
70
|
if (e.length === 1) return t;
|
|
73
71
|
const n = () => {
|
|
74
|
-
const
|
|
75
|
-
useScope:
|
|
76
|
-
scopeName:
|
|
72
|
+
const i = e.map((r) => ({
|
|
73
|
+
useScope: r(),
|
|
74
|
+
scopeName: r.scopeName
|
|
77
75
|
}));
|
|
78
|
-
return function(
|
|
79
|
-
const s =
|
|
80
|
-
const a = u(
|
|
76
|
+
return function(o) {
|
|
77
|
+
const s = i.reduce((c, { useScope: u, scopeName: d }) => {
|
|
78
|
+
const a = u(o)[`__scope${d}`];
|
|
81
79
|
return { ...c, ...a };
|
|
82
80
|
}, {});
|
|
83
81
|
return l.useMemo(() => ({ [`__scope${t.scopeName}`]: s }), [s]);
|
|
@@ -89,10 +87,7 @@ function ne(e) {
|
|
|
89
87
|
const t = l.useRef(e);
|
|
90
88
|
return l.useEffect(() => {
|
|
91
89
|
t.current = e;
|
|
92
|
-
}), l.useMemo(() => (...n) =>
|
|
93
|
-
var o;
|
|
94
|
-
return (o = t.current) == null ? void 0 : o.call(t, ...n);
|
|
95
|
-
}, []);
|
|
90
|
+
}), l.useMemo(() => (...n) => t.current?.(...n), []);
|
|
96
91
|
}
|
|
97
92
|
function _e({
|
|
98
93
|
prop: e,
|
|
@@ -100,102 +95,101 @@ function _e({
|
|
|
100
95
|
onChange: n = () => {
|
|
101
96
|
}
|
|
102
97
|
}) {
|
|
103
|
-
const [
|
|
98
|
+
const [i, r] = we({ defaultProp: t, onChange: n }), o = e !== void 0, s = o ? e : i, c = ne(n), u = l.useCallback(
|
|
104
99
|
(d) => {
|
|
105
|
-
if (
|
|
100
|
+
if (o) {
|
|
106
101
|
const a = typeof d == "function" ? d(e) : d;
|
|
107
102
|
a !== e && c(a);
|
|
108
103
|
} else
|
|
109
|
-
|
|
104
|
+
r(d);
|
|
110
105
|
},
|
|
111
|
-
[
|
|
106
|
+
[o, e, r, c]
|
|
112
107
|
);
|
|
113
108
|
return [s, u];
|
|
114
109
|
}
|
|
115
|
-
function
|
|
110
|
+
function we({
|
|
116
111
|
defaultProp: e,
|
|
117
112
|
onChange: t
|
|
118
113
|
}) {
|
|
119
|
-
const n = l.useState(e), [
|
|
114
|
+
const n = l.useState(e), [i] = n, r = l.useRef(i), o = ne(t);
|
|
120
115
|
return l.useEffect(() => {
|
|
121
|
-
|
|
122
|
-
}, [
|
|
116
|
+
r.current !== i && (o(i), r.current = i);
|
|
117
|
+
}, [i, r, o]), n;
|
|
123
118
|
}
|
|
124
|
-
var
|
|
125
|
-
function
|
|
126
|
-
const t = l.useContext(
|
|
119
|
+
var Ce = l.createContext(void 0);
|
|
120
|
+
function Re(e) {
|
|
121
|
+
const t = l.useContext(Ce);
|
|
127
122
|
return e || t || "ltr";
|
|
128
123
|
}
|
|
129
|
-
function
|
|
124
|
+
function xe(e) {
|
|
130
125
|
const t = l.useRef({ value: e, previous: e });
|
|
131
126
|
return l.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
132
127
|
}
|
|
133
|
-
var
|
|
128
|
+
var Ee = globalThis?.document ? l.useLayoutEffect : () => {
|
|
134
129
|
};
|
|
135
|
-
function
|
|
130
|
+
function Pe(e) {
|
|
136
131
|
const [t, n] = l.useState(void 0);
|
|
137
|
-
return
|
|
132
|
+
return Ee(() => {
|
|
138
133
|
if (e) {
|
|
139
134
|
n({ width: e.offsetWidth, height: e.offsetHeight });
|
|
140
|
-
const
|
|
141
|
-
if (!Array.isArray(
|
|
135
|
+
const i = new ResizeObserver((r) => {
|
|
136
|
+
if (!Array.isArray(r) || !r.length)
|
|
142
137
|
return;
|
|
143
|
-
const
|
|
138
|
+
const o = r[0];
|
|
144
139
|
let s, c;
|
|
145
|
-
if ("borderBoxSize" in
|
|
146
|
-
const u =
|
|
140
|
+
if ("borderBoxSize" in o) {
|
|
141
|
+
const u = o.borderBoxSize, d = Array.isArray(u) ? u[0] : u;
|
|
147
142
|
s = d.inlineSize, c = d.blockSize;
|
|
148
143
|
} else
|
|
149
144
|
s = e.offsetWidth, c = e.offsetHeight;
|
|
150
145
|
n({ width: s, height: c });
|
|
151
146
|
});
|
|
152
|
-
return
|
|
147
|
+
return i.observe(e, { box: "border-box" }), () => i.unobserve(e);
|
|
153
148
|
} else
|
|
154
149
|
n(void 0);
|
|
155
150
|
}, [e]), t;
|
|
156
151
|
}
|
|
157
152
|
// @__NO_SIDE_EFFECTS__
|
|
158
|
-
function
|
|
159
|
-
const t = /* @__PURE__ */ De(e), n = l.forwardRef((
|
|
160
|
-
const { children:
|
|
153
|
+
function j(e) {
|
|
154
|
+
const t = /* @__PURE__ */ De(e), n = l.forwardRef((i, r) => {
|
|
155
|
+
const { children: o, ...s } = i, c = l.Children.toArray(o), u = c.find(Ie);
|
|
161
156
|
if (u) {
|
|
162
157
|
const d = u.props.children, g = c.map((a) => a === u ? l.Children.count(d) > 1 ? l.Children.only(null) : l.isValidElement(d) ? d.props.children : null : a);
|
|
163
|
-
return /* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ h(t, { ...s, ref: r, children: l.isValidElement(d) ? l.cloneElement(d, void 0, g) : null });
|
|
164
159
|
}
|
|
165
|
-
return /* @__PURE__ */
|
|
160
|
+
return /* @__PURE__ */ h(t, { ...s, ref: r, children: o });
|
|
166
161
|
});
|
|
167
162
|
return n.displayName = `${e}.Slot`, n;
|
|
168
163
|
}
|
|
169
164
|
// @__NO_SIDE_EFFECTS__
|
|
170
165
|
function De(e) {
|
|
171
|
-
const t = l.forwardRef((n,
|
|
172
|
-
const { children:
|
|
173
|
-
if (l.isValidElement(
|
|
174
|
-
const s = Ne(
|
|
175
|
-
return
|
|
166
|
+
const t = l.forwardRef((n, i) => {
|
|
167
|
+
const { children: r, ...o } = n;
|
|
168
|
+
if (l.isValidElement(r)) {
|
|
169
|
+
const s = Ne(r), c = Ae(o, r.props);
|
|
170
|
+
return r.type !== l.Fragment && (c.ref = i ? ee(i, s) : s), l.cloneElement(r, c);
|
|
176
171
|
}
|
|
177
|
-
return l.Children.count(
|
|
172
|
+
return l.Children.count(r) > 1 ? l.Children.only(null) : null;
|
|
178
173
|
});
|
|
179
174
|
return t.displayName = `${e}.SlotClone`, t;
|
|
180
175
|
}
|
|
181
|
-
var
|
|
182
|
-
function
|
|
183
|
-
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId ===
|
|
176
|
+
var Me = Symbol("radix.slottable");
|
|
177
|
+
function Ie(e) {
|
|
178
|
+
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Me;
|
|
184
179
|
}
|
|
185
180
|
function Ae(e, t) {
|
|
186
181
|
const n = { ...t };
|
|
187
|
-
for (const
|
|
188
|
-
const
|
|
189
|
-
/^on[A-Z]/.test(
|
|
190
|
-
|
|
191
|
-
} :
|
|
182
|
+
for (const i in t) {
|
|
183
|
+
const r = e[i], o = t[i];
|
|
184
|
+
/^on[A-Z]/.test(i) ? r && o ? n[i] = (...c) => {
|
|
185
|
+
o(...c), r(...c);
|
|
186
|
+
} : r && (n[i] = r) : i === "style" ? n[i] = { ...r, ...o } : i === "className" && (n[i] = [r, o].filter(Boolean).join(" "));
|
|
192
187
|
}
|
|
193
188
|
return { ...e, ...n };
|
|
194
189
|
}
|
|
195
190
|
function Ne(e) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
return n ? e.ref : (t = (i = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : i.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
191
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
192
|
+
return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
199
193
|
}
|
|
200
194
|
var Oe = [
|
|
201
195
|
"a",
|
|
@@ -214,145 +208,144 @@ var Oe = [
|
|
|
214
208
|
"span",
|
|
215
209
|
"svg",
|
|
216
210
|
"ul"
|
|
217
|
-
],
|
|
218
|
-
const n = /* @__PURE__ */
|
|
219
|
-
const { asChild: s, ...c } =
|
|
220
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */
|
|
211
|
+
], z = Oe.reduce((e, t) => {
|
|
212
|
+
const n = /* @__PURE__ */ j(`Primitive.${t}`), i = l.forwardRef((r, o) => {
|
|
213
|
+
const { asChild: s, ...c } = r, u = s ? n : t;
|
|
214
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ h(u, { ...c, ref: o });
|
|
221
215
|
});
|
|
222
|
-
return
|
|
216
|
+
return i.displayName = `Primitive.${t}`, { ...e, [t]: i };
|
|
223
217
|
}, {});
|
|
224
218
|
function Te(e) {
|
|
225
|
-
const t = e + "CollectionProvider", [n,
|
|
219
|
+
const t = e + "CollectionProvider", [n, i] = te(t), [r, o] = n(
|
|
226
220
|
t,
|
|
227
221
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
228
222
|
), s = (m) => {
|
|
229
|
-
const { scope:
|
|
230
|
-
return /* @__PURE__ */
|
|
223
|
+
const { scope: f, children: S } = m, w = D.useRef(null), b = D.useRef(/* @__PURE__ */ new Map()).current;
|
|
224
|
+
return /* @__PURE__ */ h(r, { scope: f, itemMap: b, collectionRef: w, children: S });
|
|
231
225
|
};
|
|
232
226
|
s.displayName = t;
|
|
233
|
-
const c = e + "CollectionSlot", u = /* @__PURE__ */
|
|
234
|
-
(m,
|
|
235
|
-
const { scope:
|
|
236
|
-
return /* @__PURE__ */
|
|
227
|
+
const c = e + "CollectionSlot", u = /* @__PURE__ */ j(c), d = D.forwardRef(
|
|
228
|
+
(m, f) => {
|
|
229
|
+
const { scope: S, children: w } = m, b = o(c, S), v = M(f, b.collectionRef);
|
|
230
|
+
return /* @__PURE__ */ h(u, { ref: v, children: w });
|
|
237
231
|
}
|
|
238
232
|
);
|
|
239
233
|
d.displayName = c;
|
|
240
|
-
const g = e + "CollectionItemSlot", a = "data-radix-collection-item",
|
|
241
|
-
(m,
|
|
242
|
-
const { scope:
|
|
243
|
-
return D.useEffect(() => (
|
|
234
|
+
const g = e + "CollectionItemSlot", a = "data-radix-collection-item", p = /* @__PURE__ */ j(g), y = D.forwardRef(
|
|
235
|
+
(m, f) => {
|
|
236
|
+
const { scope: S, children: w, ...b } = m, v = D.useRef(null), R = M(f, v), x = o(g, S);
|
|
237
|
+
return D.useEffect(() => (x.itemMap.set(v, { ref: v, ...b }), () => void x.itemMap.delete(v))), /* @__PURE__ */ h(p, { [a]: "", ref: R, children: w });
|
|
244
238
|
}
|
|
245
239
|
);
|
|
246
240
|
y.displayName = g;
|
|
247
241
|
function _(m) {
|
|
248
|
-
const
|
|
242
|
+
const f = o(e + "CollectionConsumer", m);
|
|
249
243
|
return D.useCallback(() => {
|
|
250
|
-
const
|
|
251
|
-
if (!
|
|
252
|
-
const b = Array.from(
|
|
253
|
-
return Array.from(
|
|
254
|
-
(
|
|
244
|
+
const w = f.collectionRef.current;
|
|
245
|
+
if (!w) return [];
|
|
246
|
+
const b = Array.from(w.querySelectorAll(`[${a}]`));
|
|
247
|
+
return Array.from(f.itemMap.values()).sort(
|
|
248
|
+
(x, O) => b.indexOf(x.ref.current) - b.indexOf(O.ref.current)
|
|
255
249
|
);
|
|
256
|
-
}, [
|
|
250
|
+
}, [f.collectionRef, f.itemMap]);
|
|
257
251
|
}
|
|
258
252
|
return [
|
|
259
253
|
{ Provider: s, Slot: d, ItemSlot: y },
|
|
260
254
|
_,
|
|
261
|
-
|
|
255
|
+
i
|
|
262
256
|
];
|
|
263
257
|
}
|
|
264
|
-
var
|
|
258
|
+
var oe = ["PageUp", "PageDown"], re = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], ie = {
|
|
265
259
|
"from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
266
260
|
"from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
|
|
267
261
|
"from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
268
262
|
"from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
|
|
269
|
-
},
|
|
263
|
+
}, N = "Slider", [F, Ve, ke] = Te(N), [se] = te(N, [
|
|
270
264
|
ke
|
|
271
|
-
]), [
|
|
265
|
+
]), [Ke, B] = se(N), ce = l.forwardRef(
|
|
272
266
|
(e, t) => {
|
|
273
267
|
const {
|
|
274
268
|
name: n,
|
|
275
|
-
min:
|
|
276
|
-
max:
|
|
277
|
-
step:
|
|
269
|
+
min: i = 0,
|
|
270
|
+
max: r = 100,
|
|
271
|
+
step: o = 1,
|
|
278
272
|
orientation: s = "horizontal",
|
|
279
273
|
disabled: c = !1,
|
|
280
274
|
minStepsBetweenThumbs: u = 0,
|
|
281
|
-
defaultValue: d = [
|
|
275
|
+
defaultValue: d = [i],
|
|
282
276
|
value: g,
|
|
283
277
|
onValueChange: a = () => {
|
|
284
278
|
},
|
|
285
|
-
onValueCommit:
|
|
279
|
+
onValueCommit: p = () => {
|
|
286
280
|
},
|
|
287
281
|
inverted: y = !1,
|
|
288
282
|
form: _,
|
|
289
283
|
...m
|
|
290
|
-
} = e,
|
|
284
|
+
} = e, f = l.useRef(/* @__PURE__ */ new Set()), S = l.useRef(0), b = s === "horizontal" ? ze : Be, [v = [], R] = _e({
|
|
291
285
|
prop: g,
|
|
292
286
|
defaultProp: d,
|
|
293
|
-
onChange: (
|
|
294
|
-
|
|
295
|
-
(M = [...p.current][h.current]) == null || M.focus(), a(w);
|
|
287
|
+
onChange: (C) => {
|
|
288
|
+
[...f.current][S.current]?.focus(), a(C);
|
|
296
289
|
}
|
|
297
|
-
}),
|
|
298
|
-
function
|
|
299
|
-
const
|
|
300
|
-
|
|
290
|
+
}), x = l.useRef(v);
|
|
291
|
+
function O(C) {
|
|
292
|
+
const E = Fe(v, C);
|
|
293
|
+
T(C, E);
|
|
301
294
|
}
|
|
302
|
-
function
|
|
303
|
-
|
|
295
|
+
function he(C) {
|
|
296
|
+
T(C, S.current);
|
|
304
297
|
}
|
|
305
298
|
function ve() {
|
|
306
|
-
const
|
|
307
|
-
v[
|
|
299
|
+
const C = x.current[S.current];
|
|
300
|
+
v[S.current] !== C && p(v);
|
|
308
301
|
}
|
|
309
|
-
function
|
|
310
|
-
const q = qe(
|
|
311
|
-
|
|
312
|
-
const
|
|
313
|
-
if (Ye(
|
|
314
|
-
|
|
315
|
-
const X = String(
|
|
316
|
-
return X &&
|
|
302
|
+
function T(C, E, { commit: H } = { commit: !1 }) {
|
|
303
|
+
const q = qe(o), L = Xe(Math.round((C - i) / o) * o + i, q), V = Q(L, [i, r]);
|
|
304
|
+
R((I = []) => {
|
|
305
|
+
const P = $e(I, V, E);
|
|
306
|
+
if (Ye(P, u * o)) {
|
|
307
|
+
S.current = P.indexOf(V);
|
|
308
|
+
const X = String(P) !== String(I);
|
|
309
|
+
return X && H && p(P), X ? P : I;
|
|
317
310
|
} else
|
|
318
|
-
return
|
|
311
|
+
return I;
|
|
319
312
|
});
|
|
320
313
|
}
|
|
321
|
-
return /* @__PURE__ */
|
|
322
|
-
|
|
314
|
+
return /* @__PURE__ */ h(
|
|
315
|
+
Ke,
|
|
323
316
|
{
|
|
324
317
|
scope: e.__scopeSlider,
|
|
325
318
|
name: n,
|
|
326
319
|
disabled: c,
|
|
327
|
-
min:
|
|
328
|
-
max:
|
|
329
|
-
valueIndexToChangeRef:
|
|
330
|
-
thumbs:
|
|
320
|
+
min: i,
|
|
321
|
+
max: r,
|
|
322
|
+
valueIndexToChangeRef: S,
|
|
323
|
+
thumbs: f.current,
|
|
331
324
|
values: v,
|
|
332
325
|
orientation: s,
|
|
333
326
|
form: _,
|
|
334
|
-
children: /* @__PURE__ */
|
|
327
|
+
children: /* @__PURE__ */ h(F.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ h(F.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ h(
|
|
335
328
|
b,
|
|
336
329
|
{
|
|
337
330
|
"aria-disabled": c,
|
|
338
331
|
"data-disabled": c ? "" : void 0,
|
|
339
332
|
...m,
|
|
340
333
|
ref: t,
|
|
341
|
-
onPointerDown:
|
|
342
|
-
c || (
|
|
334
|
+
onPointerDown: A(m.onPointerDown, () => {
|
|
335
|
+
c || (x.current = v);
|
|
343
336
|
}),
|
|
344
|
-
min:
|
|
345
|
-
max:
|
|
337
|
+
min: i,
|
|
338
|
+
max: r,
|
|
346
339
|
inverted: y,
|
|
347
|
-
onSlideStart: c ? void 0 :
|
|
348
|
-
onSlideMove: c ? void 0 :
|
|
340
|
+
onSlideStart: c ? void 0 : O,
|
|
341
|
+
onSlideMove: c ? void 0 : he,
|
|
349
342
|
onSlideEnd: c ? void 0 : ve,
|
|
350
|
-
onHomeKeyDown: () => !c &&
|
|
351
|
-
onEndKeyDown: () => !c &&
|
|
352
|
-
onStepKeyDown: ({ event:
|
|
343
|
+
onHomeKeyDown: () => !c && T(i, 0, { commit: !0 }),
|
|
344
|
+
onEndKeyDown: () => !c && T(r, v.length - 1, { commit: !0 }),
|
|
345
|
+
onStepKeyDown: ({ event: C, direction: E }) => {
|
|
353
346
|
if (!c) {
|
|
354
|
-
const
|
|
355
|
-
|
|
347
|
+
const L = oe.includes(C.key) || C.shiftKey && re.includes(C.key) ? 10 : 1, V = S.current, I = v[V], P = o * L * E;
|
|
348
|
+
T(I + P, V, { commit: !0 });
|
|
356
349
|
}
|
|
357
350
|
}
|
|
358
351
|
}
|
|
@@ -361,8 +354,8 @@ var re = ["PageUp", "PageDown"], oe = ["ArrowUp", "ArrowDown", "ArrowLeft", "Arr
|
|
|
361
354
|
);
|
|
362
355
|
}
|
|
363
356
|
);
|
|
364
|
-
ce.displayName =
|
|
365
|
-
var [le, ae] = se(
|
|
357
|
+
ce.displayName = N;
|
|
358
|
+
var [le, ae] = se(N, {
|
|
366
359
|
startEdge: "left",
|
|
367
360
|
endEdge: "right",
|
|
368
361
|
size: "width",
|
|
@@ -371,28 +364,28 @@ var [le, ae] = se(O, {
|
|
|
371
364
|
(e, t) => {
|
|
372
365
|
const {
|
|
373
366
|
min: n,
|
|
374
|
-
max:
|
|
375
|
-
dir:
|
|
376
|
-
inverted:
|
|
367
|
+
max: i,
|
|
368
|
+
dir: r,
|
|
369
|
+
inverted: o,
|
|
377
370
|
onSlideStart: s,
|
|
378
371
|
onSlideMove: c,
|
|
379
372
|
onSlideEnd: u,
|
|
380
373
|
onStepKeyDown: d,
|
|
381
374
|
...g
|
|
382
|
-
} = e, [a,
|
|
383
|
-
function
|
|
384
|
-
const v = _.current || a.getBoundingClientRect(),
|
|
385
|
-
return _.current = v,
|
|
375
|
+
} = e, [a, p] = l.useState(null), y = M(t, (b) => p(b)), _ = l.useRef(void 0), m = Re(r), f = m === "ltr", S = f && !o || !f && o;
|
|
376
|
+
function w(b) {
|
|
377
|
+
const v = _.current || a.getBoundingClientRect(), R = [0, v.width], O = Y(R, S ? [n, i] : [i, n]);
|
|
378
|
+
return _.current = v, O(b - v.left);
|
|
386
379
|
}
|
|
387
|
-
return /* @__PURE__ */
|
|
380
|
+
return /* @__PURE__ */ h(
|
|
388
381
|
le,
|
|
389
382
|
{
|
|
390
383
|
scope: e.__scopeSlider,
|
|
391
|
-
startEdge:
|
|
392
|
-
endEdge:
|
|
393
|
-
direction:
|
|
384
|
+
startEdge: S ? "left" : "right",
|
|
385
|
+
endEdge: S ? "right" : "left",
|
|
386
|
+
direction: S ? 1 : -1,
|
|
394
387
|
size: "width",
|
|
395
|
-
children: /* @__PURE__ */
|
|
388
|
+
children: /* @__PURE__ */ h(
|
|
396
389
|
ue,
|
|
397
390
|
{
|
|
398
391
|
dir: m,
|
|
@@ -404,42 +397,42 @@ var [le, ae] = se(O, {
|
|
|
404
397
|
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
405
398
|
},
|
|
406
399
|
onSlideStart: (b) => {
|
|
407
|
-
const v =
|
|
408
|
-
s
|
|
400
|
+
const v = w(b.clientX);
|
|
401
|
+
s?.(v);
|
|
409
402
|
},
|
|
410
403
|
onSlideMove: (b) => {
|
|
411
|
-
const v =
|
|
412
|
-
c
|
|
404
|
+
const v = w(b.clientX);
|
|
405
|
+
c?.(v);
|
|
413
406
|
},
|
|
414
407
|
onSlideEnd: () => {
|
|
415
|
-
_.current = void 0, u
|
|
408
|
+
_.current = void 0, u?.();
|
|
416
409
|
},
|
|
417
410
|
onStepKeyDown: (b) => {
|
|
418
|
-
const
|
|
419
|
-
d
|
|
411
|
+
const R = ie[S ? "from-left" : "from-right"].includes(b.key);
|
|
412
|
+
d?.({ event: b, direction: R ? -1 : 1 });
|
|
420
413
|
}
|
|
421
414
|
}
|
|
422
415
|
)
|
|
423
416
|
}
|
|
424
417
|
);
|
|
425
418
|
}
|
|
426
|
-
),
|
|
419
|
+
), Be = l.forwardRef(
|
|
427
420
|
(e, t) => {
|
|
428
421
|
const {
|
|
429
422
|
min: n,
|
|
430
|
-
max:
|
|
431
|
-
inverted:
|
|
432
|
-
onSlideStart:
|
|
423
|
+
max: i,
|
|
424
|
+
inverted: r,
|
|
425
|
+
onSlideStart: o,
|
|
433
426
|
onSlideMove: s,
|
|
434
427
|
onSlideEnd: c,
|
|
435
428
|
onStepKeyDown: u,
|
|
436
429
|
...d
|
|
437
|
-
} = e, g = l.useRef(null), a =
|
|
430
|
+
} = e, g = l.useRef(null), a = M(t, g), p = l.useRef(void 0), y = !r;
|
|
438
431
|
function _(m) {
|
|
439
|
-
const
|
|
440
|
-
return
|
|
432
|
+
const f = p.current || g.current.getBoundingClientRect(), S = [0, f.height], b = Y(S, y ? [i, n] : [n, i]);
|
|
433
|
+
return p.current = f, b(m - f.top);
|
|
441
434
|
}
|
|
442
|
-
return /* @__PURE__ */
|
|
435
|
+
return /* @__PURE__ */ h(
|
|
443
436
|
le,
|
|
444
437
|
{
|
|
445
438
|
scope: e.__scopeSlider,
|
|
@@ -447,7 +440,7 @@ var [le, ae] = se(O, {
|
|
|
447
440
|
endEdge: y ? "top" : "bottom",
|
|
448
441
|
size: "height",
|
|
449
442
|
direction: y ? 1 : -1,
|
|
450
|
-
children: /* @__PURE__ */
|
|
443
|
+
children: /* @__PURE__ */ h(
|
|
451
444
|
ue,
|
|
452
445
|
{
|
|
453
446
|
"data-orientation": "vertical",
|
|
@@ -458,19 +451,19 @@ var [le, ae] = se(O, {
|
|
|
458
451
|
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
459
452
|
},
|
|
460
453
|
onSlideStart: (m) => {
|
|
461
|
-
const
|
|
462
|
-
|
|
454
|
+
const f = _(m.clientY);
|
|
455
|
+
o?.(f);
|
|
463
456
|
},
|
|
464
457
|
onSlideMove: (m) => {
|
|
465
|
-
const
|
|
466
|
-
s
|
|
458
|
+
const f = _(m.clientY);
|
|
459
|
+
s?.(f);
|
|
467
460
|
},
|
|
468
461
|
onSlideEnd: () => {
|
|
469
|
-
|
|
462
|
+
p.current = void 0, c?.();
|
|
470
463
|
},
|
|
471
464
|
onStepKeyDown: (m) => {
|
|
472
|
-
const
|
|
473
|
-
u
|
|
465
|
+
const S = ie[y ? "from-bottom" : "from-top"].includes(m.key);
|
|
466
|
+
u?.({ event: m, direction: S ? -1 : 1 });
|
|
474
467
|
}
|
|
475
468
|
}
|
|
476
469
|
)
|
|
@@ -481,45 +474,45 @@ var [le, ae] = se(O, {
|
|
|
481
474
|
(e, t) => {
|
|
482
475
|
const {
|
|
483
476
|
__scopeSlider: n,
|
|
484
|
-
onSlideStart:
|
|
485
|
-
onSlideMove:
|
|
486
|
-
onSlideEnd:
|
|
477
|
+
onSlideStart: i,
|
|
478
|
+
onSlideMove: r,
|
|
479
|
+
onSlideEnd: o,
|
|
487
480
|
onHomeKeyDown: s,
|
|
488
481
|
onEndKeyDown: c,
|
|
489
482
|
onStepKeyDown: u,
|
|
490
483
|
...d
|
|
491
|
-
} = e, g =
|
|
492
|
-
return /* @__PURE__ */
|
|
493
|
-
|
|
484
|
+
} = e, g = B(N, n);
|
|
485
|
+
return /* @__PURE__ */ h(
|
|
486
|
+
z.span,
|
|
494
487
|
{
|
|
495
488
|
...d,
|
|
496
489
|
ref: t,
|
|
497
|
-
onKeyDown:
|
|
498
|
-
a.key === "Home" ? (s(a), a.preventDefault()) : a.key === "End" ? (c(a), a.preventDefault()) :
|
|
490
|
+
onKeyDown: A(e.onKeyDown, (a) => {
|
|
491
|
+
a.key === "Home" ? (s(a), a.preventDefault()) : a.key === "End" ? (c(a), a.preventDefault()) : oe.concat(re).includes(a.key) && (u(a), a.preventDefault());
|
|
499
492
|
}),
|
|
500
|
-
onPointerDown:
|
|
501
|
-
const
|
|
502
|
-
|
|
493
|
+
onPointerDown: A(e.onPointerDown, (a) => {
|
|
494
|
+
const p = a.target;
|
|
495
|
+
p.setPointerCapture(a.pointerId), a.preventDefault(), g.thumbs.has(p) ? p.focus() : i(a);
|
|
503
496
|
}),
|
|
504
|
-
onPointerMove:
|
|
505
|
-
a.target.hasPointerCapture(a.pointerId) &&
|
|
497
|
+
onPointerMove: A(e.onPointerMove, (a) => {
|
|
498
|
+
a.target.hasPointerCapture(a.pointerId) && r(a);
|
|
506
499
|
}),
|
|
507
|
-
onPointerUp:
|
|
508
|
-
const
|
|
509
|
-
|
|
500
|
+
onPointerUp: A(e.onPointerUp, (a) => {
|
|
501
|
+
const p = a.target;
|
|
502
|
+
p.hasPointerCapture(a.pointerId) && (p.releasePointerCapture(a.pointerId), o(a));
|
|
510
503
|
})
|
|
511
504
|
}
|
|
512
505
|
);
|
|
513
506
|
}
|
|
514
507
|
), de = "SliderTrack", fe = l.forwardRef(
|
|
515
508
|
(e, t) => {
|
|
516
|
-
const { __scopeSlider: n, ...
|
|
517
|
-
return /* @__PURE__ */
|
|
518
|
-
|
|
509
|
+
const { __scopeSlider: n, ...i } = e, r = B(de, n);
|
|
510
|
+
return /* @__PURE__ */ h(
|
|
511
|
+
z.span,
|
|
519
512
|
{
|
|
520
|
-
"data-disabled":
|
|
521
|
-
"data-orientation":
|
|
522
|
-
...
|
|
513
|
+
"data-disabled": r.disabled ? "" : void 0,
|
|
514
|
+
"data-orientation": r.orientation,
|
|
515
|
+
...i,
|
|
523
516
|
ref: t
|
|
524
517
|
}
|
|
525
518
|
);
|
|
@@ -528,20 +521,20 @@ var [le, ae] = se(O, {
|
|
|
528
521
|
fe.displayName = de;
|
|
529
522
|
var W = "SliderRange", pe = l.forwardRef(
|
|
530
523
|
(e, t) => {
|
|
531
|
-
const { __scopeSlider: n, ...
|
|
532
|
-
(
|
|
524
|
+
const { __scopeSlider: n, ...i } = e, r = B(W, n), o = ae(W, n), s = l.useRef(null), c = M(t, s), u = r.values.length, d = r.values.map(
|
|
525
|
+
(p) => Se(p, r.min, r.max)
|
|
533
526
|
), g = u > 1 ? Math.min(...d) : 0, a = 100 - Math.max(...d);
|
|
534
|
-
return /* @__PURE__ */
|
|
535
|
-
|
|
527
|
+
return /* @__PURE__ */ h(
|
|
528
|
+
z.span,
|
|
536
529
|
{
|
|
537
|
-
"data-orientation":
|
|
538
|
-
"data-disabled":
|
|
539
|
-
...
|
|
530
|
+
"data-orientation": r.orientation,
|
|
531
|
+
"data-disabled": r.disabled ? "" : void 0,
|
|
532
|
+
...i,
|
|
540
533
|
ref: c,
|
|
541
534
|
style: {
|
|
542
535
|
...e.style,
|
|
543
|
-
[
|
|
544
|
-
[
|
|
536
|
+
[o.startEdge]: g + "%",
|
|
537
|
+
[o.endEdge]: a + "%"
|
|
545
538
|
}
|
|
546
539
|
}
|
|
547
540
|
);
|
|
@@ -550,15 +543,15 @@ var W = "SliderRange", pe = l.forwardRef(
|
|
|
550
543
|
pe.displayName = W;
|
|
551
544
|
var U = "SliderThumb", me = l.forwardRef(
|
|
552
545
|
(e, t) => {
|
|
553
|
-
const n = Ve(e.__scopeSlider), [
|
|
554
|
-
() =>
|
|
555
|
-
[n,
|
|
546
|
+
const n = Ve(e.__scopeSlider), [i, r] = l.useState(null), o = M(t, (c) => r(c)), s = l.useMemo(
|
|
547
|
+
() => i ? n().findIndex((c) => c.ref.current === i) : -1,
|
|
548
|
+
[n, i]
|
|
556
549
|
);
|
|
557
|
-
return /* @__PURE__ */
|
|
550
|
+
return /* @__PURE__ */ h(He, { ...e, ref: o, index: s });
|
|
558
551
|
}
|
|
559
|
-
),
|
|
552
|
+
), He = l.forwardRef(
|
|
560
553
|
(e, t) => {
|
|
561
|
-
const { __scopeSlider: n, index:
|
|
554
|
+
const { __scopeSlider: n, index: i, name: r, ...o } = e, s = B(U, n), c = ae(U, n), [u, d] = l.useState(null), g = M(t, (w) => d(w)), a = u ? s.form || !!u.closest("form") : !0, p = Pe(u), y = s.values[i], _ = y === void 0 ? 0 : Se(y, s.min, s.max), m = je(i, s.values.length), f = p?.[c.size], S = f ? We(f, _, c.direction) : 0;
|
|
562
555
|
return l.useEffect(() => {
|
|
563
556
|
if (u)
|
|
564
557
|
return s.thumbs.add(u), () => {
|
|
@@ -570,11 +563,11 @@ var U = "SliderThumb", me = l.forwardRef(
|
|
|
570
563
|
style: {
|
|
571
564
|
transform: "var(--radix-slider-thumb-transform)",
|
|
572
565
|
position: "absolute",
|
|
573
|
-
[c.startEdge]: `calc(${_}% + ${
|
|
566
|
+
[c.startEdge]: `calc(${_}% + ${S}px)`
|
|
574
567
|
},
|
|
575
568
|
children: [
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
|
|
569
|
+
/* @__PURE__ */ h(F.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ h(
|
|
570
|
+
z.span,
|
|
578
571
|
{
|
|
579
572
|
role: "slider",
|
|
580
573
|
"aria-label": e["aria-label"] || m,
|
|
@@ -585,22 +578,22 @@ var U = "SliderThumb", me = l.forwardRef(
|
|
|
585
578
|
"data-orientation": s.orientation,
|
|
586
579
|
"data-disabled": s.disabled ? "" : void 0,
|
|
587
580
|
tabIndex: s.disabled ? void 0 : 0,
|
|
588
|
-
...
|
|
581
|
+
...o,
|
|
589
582
|
ref: g,
|
|
590
583
|
style: y === void 0 ? { display: "none" } : e.style,
|
|
591
|
-
onFocus:
|
|
592
|
-
s.valueIndexToChangeRef.current =
|
|
584
|
+
onFocus: A(e.onFocus, () => {
|
|
585
|
+
s.valueIndexToChangeRef.current = i;
|
|
593
586
|
})
|
|
594
587
|
}
|
|
595
588
|
) }),
|
|
596
|
-
a && /* @__PURE__ */
|
|
597
|
-
|
|
589
|
+
a && /* @__PURE__ */ h(
|
|
590
|
+
Le,
|
|
598
591
|
{
|
|
599
|
-
name:
|
|
592
|
+
name: r ?? (s.name ? s.name + (s.values.length > 1 ? "[]" : "") : void 0),
|
|
600
593
|
form: s.form,
|
|
601
594
|
value: y
|
|
602
595
|
},
|
|
603
|
-
|
|
596
|
+
i
|
|
604
597
|
)
|
|
605
598
|
]
|
|
606
599
|
}
|
|
@@ -608,35 +601,35 @@ var U = "SliderThumb", me = l.forwardRef(
|
|
|
608
601
|
}
|
|
609
602
|
);
|
|
610
603
|
me.displayName = U;
|
|
611
|
-
var
|
|
612
|
-
const { value: t, ...n } = e,
|
|
604
|
+
var Le = (e) => {
|
|
605
|
+
const { value: t, ...n } = e, i = l.useRef(null), r = xe(t);
|
|
613
606
|
return l.useEffect(() => {
|
|
614
|
-
const
|
|
615
|
-
if (
|
|
607
|
+
const o = i.current, s = window.HTMLInputElement.prototype, u = Object.getOwnPropertyDescriptor(s, "value").set;
|
|
608
|
+
if (r !== t && u) {
|
|
616
609
|
const d = new Event("input", { bubbles: !0 });
|
|
617
|
-
u.call(
|
|
610
|
+
u.call(o, t), o.dispatchEvent(d);
|
|
618
611
|
}
|
|
619
|
-
}, [
|
|
612
|
+
}, [r, t]), /* @__PURE__ */ h("input", { style: { display: "none" }, ...n, ref: i, defaultValue: t });
|
|
620
613
|
};
|
|
621
|
-
function
|
|
622
|
-
const
|
|
623
|
-
return
|
|
614
|
+
function $e(e = [], t, n) {
|
|
615
|
+
const i = [...e];
|
|
616
|
+
return i[n] = t, i.sort((r, o) => r - o);
|
|
624
617
|
}
|
|
625
|
-
function
|
|
626
|
-
const
|
|
627
|
-
return Q(
|
|
618
|
+
function Se(e, t, n) {
|
|
619
|
+
const o = 100 / (n - t) * (e - t);
|
|
620
|
+
return Q(o, [0, 100]);
|
|
628
621
|
}
|
|
629
|
-
function
|
|
622
|
+
function je(e, t) {
|
|
630
623
|
return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
|
|
631
624
|
}
|
|
632
|
-
function
|
|
625
|
+
function Fe(e, t) {
|
|
633
626
|
if (e.length === 1) return 0;
|
|
634
|
-
const n = e.map((
|
|
635
|
-
return n.indexOf(
|
|
627
|
+
const n = e.map((r) => Math.abs(r - t)), i = Math.min(...n);
|
|
628
|
+
return n.indexOf(i);
|
|
636
629
|
}
|
|
637
630
|
function We(e, t, n) {
|
|
638
|
-
const
|
|
639
|
-
return (
|
|
631
|
+
const i = e / 2, o = Y([0, 50], [0, i]);
|
|
632
|
+
return (i - o(t) * n) * n;
|
|
640
633
|
}
|
|
641
634
|
function Ue(e) {
|
|
642
635
|
return e.slice(0, -1).map((t, n) => e[n + 1] - t);
|
|
@@ -651,8 +644,8 @@ function Ye(e, t) {
|
|
|
651
644
|
function Y(e, t) {
|
|
652
645
|
return (n) => {
|
|
653
646
|
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
654
|
-
const
|
|
655
|
-
return t[0] +
|
|
647
|
+
const i = (t[1] - t[0]) / (e[1] - e[0]);
|
|
648
|
+
return t[0] + i * (n - e[0]);
|
|
656
649
|
};
|
|
657
650
|
}
|
|
658
651
|
function qe(e) {
|
|
@@ -666,76 +659,71 @@ var Ge = ce, Ze = fe, Je = pe, Qe = me;
|
|
|
666
659
|
function et(e) {
|
|
667
660
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
668
661
|
}
|
|
669
|
-
var
|
|
670
|
-
/*!
|
|
671
|
-
Copyright (c) 2018 Jed Watson.
|
|
672
|
-
Licensed under the MIT License (MIT), see
|
|
673
|
-
http://jedwatson.github.io/classnames
|
|
674
|
-
*/
|
|
662
|
+
var $ = { exports: {} };
|
|
675
663
|
var Z;
|
|
676
664
|
function tt() {
|
|
677
665
|
return Z || (Z = 1, (function(e) {
|
|
678
666
|
(function() {
|
|
679
667
|
var t = {}.hasOwnProperty;
|
|
680
668
|
function n() {
|
|
681
|
-
for (var
|
|
669
|
+
for (var o = "", s = 0; s < arguments.length; s++) {
|
|
682
670
|
var c = arguments[s];
|
|
683
|
-
c && (
|
|
671
|
+
c && (o = r(o, i.call(this, c)));
|
|
684
672
|
}
|
|
685
|
-
return
|
|
673
|
+
return o;
|
|
686
674
|
}
|
|
687
|
-
function o
|
|
688
|
-
if (typeof
|
|
689
|
-
return this && this[
|
|
690
|
-
if (typeof
|
|
675
|
+
function i(o) {
|
|
676
|
+
if (typeof o == "string" || typeof o == "number")
|
|
677
|
+
return this && this[o] || o;
|
|
678
|
+
if (typeof o != "object")
|
|
691
679
|
return "";
|
|
692
|
-
if (Array.isArray(
|
|
693
|
-
return n.apply(this,
|
|
694
|
-
if (
|
|
695
|
-
return
|
|
680
|
+
if (Array.isArray(o))
|
|
681
|
+
return n.apply(this, o);
|
|
682
|
+
if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]"))
|
|
683
|
+
return o.toString();
|
|
696
684
|
var s = "";
|
|
697
|
-
for (var c in
|
|
698
|
-
t.call(
|
|
685
|
+
for (var c in o)
|
|
686
|
+
t.call(o, c) && o[c] && (s = r(s, this && this[c] || c));
|
|
699
687
|
return s;
|
|
700
688
|
}
|
|
701
|
-
function
|
|
702
|
-
return s ?
|
|
689
|
+
function r(o, s) {
|
|
690
|
+
return s ? o ? o + " " + s : o + s : o;
|
|
703
691
|
}
|
|
704
692
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
705
693
|
})();
|
|
706
|
-
})(
|
|
694
|
+
})($)), $.exports;
|
|
707
695
|
}
|
|
708
696
|
var nt = tt();
|
|
709
|
-
const
|
|
697
|
+
const ot = /* @__PURE__ */ et(nt), rt = {
|
|
710
698
|
"purpur-slider": "_purpur-slider_14tuk_1",
|
|
711
699
|
"purpur-slider__track": "_purpur-slider__track_14tuk_17",
|
|
712
700
|
"purpur-slider__range": "_purpur-slider__range_14tuk_17",
|
|
713
701
|
"purpur-slider__thumb": "_purpur-slider__thumb_14tuk_43"
|
|
714
|
-
},
|
|
702
|
+
}, k = ot.bind(rt), dt = ["horizontal", "vertical"], K = "purpur-slider", it = (e) => String(e), st = ({
|
|
715
703
|
"aria-label": e,
|
|
716
704
|
"aria-valuetext": t,
|
|
717
705
|
className: n,
|
|
718
|
-
defaultValue:
|
|
719
|
-
id:
|
|
720
|
-
value:
|
|
706
|
+
defaultValue: i,
|
|
707
|
+
id: r,
|
|
708
|
+
value: o,
|
|
721
709
|
...s
|
|
722
710
|
}, c) => {
|
|
723
|
-
const u = be(), d =
|
|
711
|
+
const u = be(), d = o || i;
|
|
724
712
|
return /* @__PURE__ */ J(
|
|
725
713
|
Ge,
|
|
726
714
|
{
|
|
727
715
|
...s,
|
|
728
|
-
id:
|
|
716
|
+
id: r || u,
|
|
729
717
|
ref: c,
|
|
730
|
-
className:
|
|
731
|
-
value:
|
|
732
|
-
defaultValue:
|
|
718
|
+
className: k(K, n),
|
|
719
|
+
value: o,
|
|
720
|
+
defaultValue: i,
|
|
733
721
|
children: [
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
d
|
|
722
|
+
/* @__PURE__ */ h(Ze, { className: k(`${K}__track`), children: /* @__PURE__ */ h(Je, { className: k(`${K}__range`) }) }),
|
|
723
|
+
d?.map((g, a) => /* @__PURE__ */ h(
|
|
736
724
|
Qe,
|
|
737
725
|
{
|
|
738
|
-
className:
|
|
726
|
+
className: k(`${K}__thumb`),
|
|
739
727
|
"aria-label": e,
|
|
740
728
|
"aria-valuetext": t
|
|
741
729
|
},
|