@cfx-dev/ui-components 4.2.20 → 4.2.22
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/assets/css/Badge.css +1 -1
- package/dist/assets/css/Link.css +1 -1
- package/dist/assets/general/global.css +1 -1
- package/dist/components/Accordion/Accordion.d.ts +1 -7
- package/dist/components/Accordion/Accordion.js +1 -1
- package/dist/components/Accordion/AccordionShowcase.js +1 -1
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/Avatar/AvatarShowcase.js +1 -1
- package/dist/components/BackdropPortal/BackdropPortal.d.ts +2 -0
- package/dist/components/BackdropPortal/BackdropPortal.js +7 -5
- package/dist/components/BackdropPortal/index.d.ts +2 -0
- package/dist/components/BackdropPortal/index.js +5 -0
- package/dist/components/Badge/Badge.d.ts +9 -2
- package/dist/components/Badge/Badge.js +52 -25
- package/dist/components/Badge/BadgeShowcase.js +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/BurgerMenu/BurgerMenu.js +1 -1
- package/dist/components/BurgerMenu/BurgerMenuShowcase.js +1 -1
- package/dist/components/Button/ButtonShowcase.js +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/ClipboardButton/ClipboardButton.d.ts +3 -3
- package/dist/components/ClipboardButton/ClipboardButton.js +10 -9
- package/dist/components/ControlBox/ControlBox.d.ts +2 -0
- package/dist/components/ControlBox/ControlBox.js +10 -9
- package/dist/components/ControlBox/index.d.ts +2 -0
- package/dist/components/ControlBox/index.js +4 -0
- package/dist/components/CountryFlag/CountryFlag.d.ts +2 -0
- package/dist/components/CountryFlag/CountryFlag.js +14 -13
- package/dist/components/CountryFlag/index.d.ts +2 -0
- package/dist/components/CountryFlag/index.js +4 -0
- package/dist/components/Decorate/Decorate.d.ts +2 -0
- package/dist/components/Decorate/Decorate.js +15 -14
- package/dist/components/Decorate/index.d.ts +2 -0
- package/dist/components/Decorate/index.js +4 -0
- package/dist/components/DropdownSelect/DropdownSelect.d.ts +1 -1
- package/dist/components/DropdownSelect/DropdownSelect.js +801 -1039
- package/dist/components/DropdownSelect/DropdownSelectShowcase.js +1 -1
- package/dist/components/DropdownSelect/index.d.ts +1 -0
- package/dist/components/Flyout/Flyout.d.ts +2 -1
- package/dist/components/Flyout/index.d.ts +2 -0
- package/dist/components/Flyout/index.js +5 -0
- package/dist/components/Icon/Icon.d.ts +1 -1
- package/dist/components/Icon/Icon.js +1 -1
- package/dist/components/IconBig/IconBig.js +1 -1
- package/dist/components/IconButton/IconButton.d.ts +2 -3
- package/dist/components/IconButton/index.d.ts +1 -1
- package/dist/components/Indicator/index.d.ts +2 -0
- package/dist/components/Indicator/index.js +4 -0
- package/dist/components/InfoPanel/InfoPanelShowcase.js +1 -1
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +6 -6
- package/dist/components/Input/InputShowcase.js +1 -1
- package/dist/components/Input/RichInput.d.ts +1 -1
- package/dist/components/Input/RichInput.js +4 -4
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/InputDropzone/index.d.ts +3 -3
- package/dist/components/InputDropzone/index.js +3 -3
- package/dist/components/Interactive/index.d.ts +2 -0
- package/dist/components/Interactive/index.js +4 -0
- package/dist/components/Island/Island.js +4 -4
- package/dist/components/Island/index.d.ts +2 -0
- package/dist/components/Island/index.js +5 -0
- package/dist/components/Layout/Box/Box.d.ts +2 -1
- package/dist/components/Layout/Box/Box.js +3 -2
- package/dist/components/Layout/Box/index.d.ts +2 -0
- package/dist/components/Layout/Box/index.js +5 -0
- package/dist/components/Layout/Center/index.d.ts +2 -0
- package/dist/components/Layout/Center/index.js +4 -0
- package/dist/components/Layout/Flex/Flex.d.ts +4 -4
- package/dist/components/Layout/Flex/Flex.js +1 -1
- package/dist/components/Layout/Flex/Flex.types.d.ts +7 -0
- package/dist/components/Layout/Flex/Flex.types.js +6 -5
- package/dist/components/Layout/Flex/index.d.ts +6 -0
- package/dist/components/Layout/Flex/index.js +12 -0
- package/dist/components/Layout/Pad/index.d.ts +2 -0
- package/dist/components/Layout/Pad/index.js +4 -0
- package/dist/components/Layout/Page/index.d.ts +2 -0
- package/dist/components/Layout/Page/index.js +4 -0
- package/dist/components/Layout/Scrollable/ScrollableShowcase.js +1 -1
- package/dist/components/Link/ButtonLink.js +23 -18
- package/dist/components/Link/Link.d.ts +3 -1
- package/dist/components/Link/Link.js +48 -30
- package/dist/components/Link/LinkShowcase.js +46 -41
- package/dist/components/Link/index.d.ts +1 -1
- package/dist/components/Link/index.js +6 -5
- package/dist/components/Loaf/index.d.ts +2 -0
- package/dist/components/Loaf/index.js +4 -0
- package/dist/components/Logos/LogosShowcase.js +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/NavList/index.d.ts +2 -0
- package/dist/components/NavList/index.js +4 -0
- package/dist/components/Overlay/index.d.ts +2 -0
- package/dist/components/Overlay/index.js +5 -0
- package/dist/components/PremiumBadge/index.d.ts +2 -0
- package/dist/components/PremiumBadge/index.js +4 -0
- package/dist/components/Prose/Prose.d.ts +1 -2
- package/dist/components/Prose/index.d.ts +2 -0
- package/dist/components/Prose/index.js +4 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/index.js +4 -0
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.js +2 -2
- package/dist/components/Select/SelectShowcase.js +1 -1
- package/dist/components/Separator/Separator.d.ts +1 -1
- package/dist/components/Separator/Separator.js +1 -1
- package/dist/components/Separator/index.d.ts +2 -0
- package/dist/components/Separator/index.js +4 -0
- package/dist/components/Shroud/Shroud.js +6 -6
- package/dist/components/Shroud/index.d.ts +2 -0
- package/dist/components/Shroud/index.js +4 -0
- package/dist/components/Skeleton/Skeleton.d.ts +2 -2
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/Skeleton/SkeletonShowcase.js +1 -1
- package/dist/components/Skeleton/index.d.ts +1 -0
- package/dist/components/Slider/Slider.js +294 -374
- package/dist/components/Slider/SliderShowcase.js +1 -1
- package/dist/components/Spacer/Spacer.d.ts +1 -1
- package/dist/components/Spacer/index.d.ts +2 -0
- package/dist/components/Spacer/index.js +4 -0
- package/dist/components/Style/index.d.ts +2 -0
- package/dist/components/Style/index.js +5 -0
- package/dist/components/Table/Table.d.ts +13 -4
- package/dist/components/Table/Table.js +3 -2
- package/dist/components/Table/TableShowcase.js +1 -1
- package/dist/components/Table/index.d.ts +2 -2
- package/dist/components/Table/index.js +5 -2
- package/dist/components/Tabular/Tabular.d.ts +1 -1
- package/dist/components/Tabular/Tabular.js +1 -1
- package/dist/components/Tabular/TabularShowcase.js +1 -1
- package/dist/components/Text/Text.js +13 -12
- package/dist/components/Text/Text.types.d.ts +3 -2
- package/dist/components/Text/TextShowcase.js +12 -15
- package/dist/components/Text/index.d.ts +2 -2
- package/dist/components/Text/index.js +9 -8
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Textarea/index.js +4 -0
- package/dist/components/Title/Title.d.ts +5 -4
- package/dist/components/Title/Title.js +4 -2
- package/dist/components/Title/TitleShowcase.js +1 -1
- package/dist/components/Title/index.d.ts +2 -0
- package/dist/components/Title/index.js +7 -0
- package/dist/components/ToggleGroup/ToggleGroupShowcase.js +1 -1
- package/dist/index-AweK2ufS.js +171 -0
- package/dist/{index-DBus3GoO.js → index-Bz27DCHt.js} +2 -2
- package/dist/main.d.ts +93 -69
- package/dist/main.js +217 -191
- package/dist/styles-scss/global.scss +2 -2
- package/dist/styles-scss/tokens.scss +0 -4
- package/dist/utils/color.d.ts +3 -1
- package/dist/utils/enum.d.ts +1 -0
- package/dist/utils/enum.js +6 -0
- package/dist/utils/ui/index.d.ts +3 -0
- package/dist/utils/ui/index.js +11 -0
- package/dist/{components → utils/ui}/ui.d.ts +2 -68
- package/dist/utils/ui/ui.js +68 -0
- package/dist/utils/ui/ui.types.d.ts +86 -0
- package/dist/utils/ui/ui.types.js +9 -0
- package/package.json +1 -1
- package/dist/components/ui.js +0 -73
- package/dist/index-CjTSD6zB.js +0 -161
|
@@ -1,135 +1,55 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as d, Fragment as me, jsxs as K } from "react/jsx-runtime";
|
|
2
2
|
import * as c from "react";
|
|
3
3
|
import I from "react";
|
|
4
|
-
import { c as
|
|
5
|
-
import {
|
|
6
|
-
import { u as be } from "../../index-
|
|
7
|
-
import { u as ve } from "../../index-
|
|
4
|
+
import { c as Z } from "../../index-rKs9bXHr.js";
|
|
5
|
+
import { c as pe, a as he, b as Se, d as V, u as B } from "../../index-AweK2ufS.js";
|
|
6
|
+
import { u as ge, a as be } from "../../index-Cf5Yu9oD.js";
|
|
7
|
+
import { u as ve } from "../../index-ByaXH_ih.js";
|
|
8
|
+
import { u as _e } from "../../index-BZPx6jYI.js";
|
|
8
9
|
import "../../index-2hJuj4UN.js";
|
|
9
|
-
import { c as _e } from "../../index-CjTSD6zB.js";
|
|
10
10
|
import { clsx as G } from "../../utils/clsx.js";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
function Z(e, t) {
|
|
18
|
-
if (typeof e == "function")
|
|
19
|
-
return e(t);
|
|
20
|
-
e != null && (e.current = t);
|
|
21
|
-
}
|
|
22
|
-
function J(...e) {
|
|
23
|
-
return (t) => {
|
|
24
|
-
let n = !1;
|
|
25
|
-
const r = e.map((o) => {
|
|
26
|
-
const s = Z(o, t);
|
|
27
|
-
return !n && typeof s == "function" && (n = !0), s;
|
|
28
|
-
});
|
|
29
|
-
if (n)
|
|
30
|
-
return () => {
|
|
31
|
-
for (let o = 0; o < r.length; o++) {
|
|
32
|
-
const s = r[o];
|
|
33
|
-
typeof s == "function" ? s() : Z(e[o], null);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function B(...e) {
|
|
39
|
-
return c.useCallback(J(...e), e);
|
|
40
|
-
}
|
|
41
|
-
function we(e, t = []) {
|
|
42
|
-
let n = [];
|
|
43
|
-
function r(s, i) {
|
|
44
|
-
const a = c.createContext(i), u = n.length;
|
|
45
|
-
n = [...n, i];
|
|
46
|
-
const m = (l) => {
|
|
47
|
-
var p;
|
|
48
|
-
const { scope: d, children: h, ...v } = l, S = ((p = d == null ? void 0 : d[e]) == null ? void 0 : p[u]) || a, g = c.useMemo(() => v, Object.values(v));
|
|
49
|
-
return /* @__PURE__ */ f(S.Provider, { value: g, children: h });
|
|
50
|
-
};
|
|
51
|
-
m.displayName = s + "Provider";
|
|
52
|
-
function b(l, d) {
|
|
53
|
-
var S;
|
|
54
|
-
const h = ((S = d == null ? void 0 : d[e]) == null ? void 0 : S[u]) || a, v = c.useContext(h);
|
|
55
|
-
if (v) return v;
|
|
56
|
-
if (i !== void 0) return i;
|
|
57
|
-
throw new Error(`\`${l}\` must be used within \`${s}\``);
|
|
58
|
-
}
|
|
59
|
-
return [m, b];
|
|
11
|
+
var q = c.forwardRef((e, t) => {
|
|
12
|
+
const { children: r, ...n } = e, o = c.Children.toArray(r), a = o.find(ye);
|
|
13
|
+
if (a) {
|
|
14
|
+
const i = a.props.children, s = o.map((u) => u === a ? c.Children.count(i) > 1 ? c.Children.only(null) : c.isValidElement(i) ? i.props.children : null : u);
|
|
15
|
+
return /* @__PURE__ */ d(F, { ...n, ref: t, children: c.isValidElement(i) ? c.cloneElement(i, void 0, s) : null });
|
|
60
16
|
}
|
|
61
|
-
|
|
62
|
-
const s = n.map((i) => c.createContext(i));
|
|
63
|
-
return function(a) {
|
|
64
|
-
const u = (a == null ? void 0 : a[e]) || s;
|
|
65
|
-
return c.useMemo(
|
|
66
|
-
() => ({ [`__scope${e}`]: { ...a, [e]: u } }),
|
|
67
|
-
[a, u]
|
|
68
|
-
);
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
return o.scopeName = e, [r, xe(o, ...t)];
|
|
72
|
-
}
|
|
73
|
-
function xe(...e) {
|
|
74
|
-
const t = e[0];
|
|
75
|
-
if (e.length === 1) return t;
|
|
76
|
-
const n = () => {
|
|
77
|
-
const r = e.map((o) => ({
|
|
78
|
-
useScope: o(),
|
|
79
|
-
scopeName: o.scopeName
|
|
80
|
-
}));
|
|
81
|
-
return function(s) {
|
|
82
|
-
const i = r.reduce((a, { useScope: u, scopeName: m }) => {
|
|
83
|
-
const l = u(s)[`__scope${m}`];
|
|
84
|
-
return { ...a, ...l };
|
|
85
|
-
}, {});
|
|
86
|
-
return c.useMemo(() => ({ [`__scope${t.scopeName}`]: i }), [i]);
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
return n.scopeName = t.scopeName, n;
|
|
90
|
-
}
|
|
91
|
-
var Q = c.forwardRef((e, t) => {
|
|
92
|
-
const { children: n, ...r } = e, o = c.Children.toArray(n), s = o.find(Pe);
|
|
93
|
-
if (s) {
|
|
94
|
-
const i = s.props.children, a = o.map((u) => u === s ? c.Children.count(i) > 1 ? c.Children.only(null) : c.isValidElement(i) ? i.props.children : null : u);
|
|
95
|
-
return /* @__PURE__ */ f(j, { ...r, ref: t, children: c.isValidElement(i) ? c.cloneElement(i, void 0, a) : null });
|
|
96
|
-
}
|
|
97
|
-
return /* @__PURE__ */ f(j, { ...r, ref: t, children: n });
|
|
17
|
+
return /* @__PURE__ */ d(F, { ...n, ref: t, children: r });
|
|
98
18
|
});
|
|
99
|
-
|
|
100
|
-
var
|
|
101
|
-
const { children:
|
|
102
|
-
if (c.isValidElement(
|
|
103
|
-
const o =
|
|
104
|
-
return c.cloneElement(
|
|
105
|
-
...
|
|
19
|
+
q.displayName = "Slot";
|
|
20
|
+
var F = c.forwardRef((e, t) => {
|
|
21
|
+
const { children: r, ...n } = e;
|
|
22
|
+
if (c.isValidElement(r)) {
|
|
23
|
+
const o = xe(r);
|
|
24
|
+
return c.cloneElement(r, {
|
|
25
|
+
...Re(n, r.props),
|
|
106
26
|
// @ts-ignore
|
|
107
|
-
ref: t ?
|
|
27
|
+
ref: t ? pe(t, o) : o
|
|
108
28
|
});
|
|
109
29
|
}
|
|
110
|
-
return c.Children.count(
|
|
30
|
+
return c.Children.count(r) > 1 ? c.Children.only(null) : null;
|
|
111
31
|
});
|
|
112
|
-
|
|
113
|
-
var
|
|
114
|
-
function
|
|
115
|
-
return c.isValidElement(e) && e.type ===
|
|
32
|
+
F.displayName = "SlotClone";
|
|
33
|
+
var we = ({ children: e }) => /* @__PURE__ */ d(me, { children: e });
|
|
34
|
+
function ye(e) {
|
|
35
|
+
return c.isValidElement(e) && e.type === we;
|
|
116
36
|
}
|
|
117
|
-
function
|
|
118
|
-
const
|
|
119
|
-
for (const
|
|
120
|
-
const o = e[
|
|
121
|
-
/^on[A-Z]/.test(
|
|
122
|
-
|
|
123
|
-
} : o && (n
|
|
37
|
+
function Re(e, t) {
|
|
38
|
+
const r = { ...t };
|
|
39
|
+
for (const n in t) {
|
|
40
|
+
const o = e[n], a = t[n];
|
|
41
|
+
/^on[A-Z]/.test(n) ? o && a ? r[n] = (...s) => {
|
|
42
|
+
a(...s), o(...s);
|
|
43
|
+
} : o && (r[n] = o) : n === "style" ? r[n] = { ...o, ...a } : n === "className" && (r[n] = [o, a].filter(Boolean).join(" "));
|
|
124
44
|
}
|
|
125
|
-
return { ...e, ...
|
|
45
|
+
return { ...e, ...r };
|
|
126
46
|
}
|
|
127
|
-
function
|
|
128
|
-
var
|
|
129
|
-
let t = (
|
|
130
|
-
return
|
|
47
|
+
function xe(e) {
|
|
48
|
+
var n, o;
|
|
49
|
+
let t = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
50
|
+
return r ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
131
51
|
}
|
|
132
|
-
var
|
|
52
|
+
var Pe = [
|
|
133
53
|
"a",
|
|
134
54
|
"button",
|
|
135
55
|
"div",
|
|
@@ -146,104 +66,104 @@ var De = [
|
|
|
146
66
|
"span",
|
|
147
67
|
"svg",
|
|
148
68
|
"ul"
|
|
149
|
-
], T =
|
|
150
|
-
const
|
|
151
|
-
const { asChild:
|
|
152
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */
|
|
69
|
+
], T = Pe.reduce((e, t) => {
|
|
70
|
+
const r = c.forwardRef((n, o) => {
|
|
71
|
+
const { asChild: a, ...i } = n, s = a ? q : t;
|
|
72
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ d(s, { ...i, ref: o });
|
|
153
73
|
});
|
|
154
|
-
return
|
|
155
|
-
}, {}),
|
|
74
|
+
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
75
|
+
}, {}), J = ["PageUp", "PageDown"], Q = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], ee = {
|
|
156
76
|
"from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
157
77
|
"from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
|
|
158
78
|
"from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
159
79
|
"from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
]), [
|
|
80
|
+
}, N = "Slider", [j, Ce, Ee] = he(N), [te, st] = Se(N, [
|
|
81
|
+
Ee
|
|
82
|
+
]), [De, H] = te(N), ne = c.forwardRef(
|
|
163
83
|
(e, t) => {
|
|
164
84
|
const {
|
|
165
|
-
name:
|
|
166
|
-
min:
|
|
85
|
+
name: r,
|
|
86
|
+
min: n = 0,
|
|
167
87
|
max: o = 100,
|
|
168
|
-
step:
|
|
88
|
+
step: a = 1,
|
|
169
89
|
orientation: i = "horizontal",
|
|
170
|
-
disabled:
|
|
90
|
+
disabled: s = !1,
|
|
171
91
|
minStepsBetweenThumbs: u = 0,
|
|
172
|
-
defaultValue:
|
|
173
|
-
value:
|
|
92
|
+
defaultValue: p = [n],
|
|
93
|
+
value: v,
|
|
174
94
|
onValueChange: l = () => {
|
|
175
95
|
},
|
|
176
|
-
onValueCommit:
|
|
96
|
+
onValueCommit: f = () => {
|
|
177
97
|
},
|
|
178
|
-
inverted:
|
|
179
|
-
form:
|
|
180
|
-
...
|
|
181
|
-
} = e,
|
|
182
|
-
prop:
|
|
183
|
-
defaultProp:
|
|
184
|
-
onChange: (
|
|
185
|
-
var
|
|
186
|
-
(
|
|
98
|
+
inverted: S = !1,
|
|
99
|
+
form: y,
|
|
100
|
+
...g
|
|
101
|
+
} = e, h = c.useRef(/* @__PURE__ */ new Set()), m = c.useRef(0), _ = i === "horizontal" ? Ve : Ne, [b = [], M] = ge({
|
|
102
|
+
prop: v,
|
|
103
|
+
defaultProp: p,
|
|
104
|
+
onChange: (w) => {
|
|
105
|
+
var E;
|
|
106
|
+
(E = [...h.current][m.current]) == null || E.focus(), l(w);
|
|
187
107
|
}
|
|
188
|
-
}),
|
|
189
|
-
function
|
|
190
|
-
const
|
|
191
|
-
A(
|
|
108
|
+
}), O = c.useRef(b);
|
|
109
|
+
function L(w) {
|
|
110
|
+
const x = Ie(b, w);
|
|
111
|
+
A(w, x);
|
|
192
112
|
}
|
|
193
|
-
function
|
|
194
|
-
A(
|
|
113
|
+
function de(w) {
|
|
114
|
+
A(w, m.current);
|
|
195
115
|
}
|
|
196
|
-
function
|
|
197
|
-
const
|
|
198
|
-
|
|
116
|
+
function fe() {
|
|
117
|
+
const w = O.current[m.current];
|
|
118
|
+
b[m.current] !== w && f(b);
|
|
199
119
|
}
|
|
200
|
-
function A(
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
const
|
|
204
|
-
if (
|
|
205
|
-
|
|
206
|
-
const X = String(
|
|
207
|
-
return X &&
|
|
120
|
+
function A(w, x, { commit: E } = { commit: !1 }) {
|
|
121
|
+
const $ = Oe(a), z = Le(Math.round((w - n) / a) * a + n, $), k = Z(z, [n, o]);
|
|
122
|
+
M((D = []) => {
|
|
123
|
+
const P = ke(D, k, x);
|
|
124
|
+
if (He(P, u * a)) {
|
|
125
|
+
m.current = P.indexOf(k);
|
|
126
|
+
const X = String(P) !== String(D);
|
|
127
|
+
return X && E && f(P), X ? P : D;
|
|
208
128
|
} else
|
|
209
|
-
return
|
|
129
|
+
return D;
|
|
210
130
|
});
|
|
211
131
|
}
|
|
212
|
-
return /* @__PURE__ */
|
|
213
|
-
|
|
132
|
+
return /* @__PURE__ */ d(
|
|
133
|
+
De,
|
|
214
134
|
{
|
|
215
135
|
scope: e.__scopeSlider,
|
|
216
|
-
name:
|
|
217
|
-
disabled:
|
|
218
|
-
min:
|
|
136
|
+
name: r,
|
|
137
|
+
disabled: s,
|
|
138
|
+
min: n,
|
|
219
139
|
max: o,
|
|
220
|
-
valueIndexToChangeRef:
|
|
221
|
-
thumbs:
|
|
222
|
-
values:
|
|
140
|
+
valueIndexToChangeRef: m,
|
|
141
|
+
thumbs: h.current,
|
|
142
|
+
values: b,
|
|
223
143
|
orientation: i,
|
|
224
|
-
form:
|
|
225
|
-
children: /* @__PURE__ */
|
|
226
|
-
|
|
144
|
+
form: y,
|
|
145
|
+
children: /* @__PURE__ */ d(j.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ d(j.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ d(
|
|
146
|
+
_,
|
|
227
147
|
{
|
|
228
|
-
"aria-disabled":
|
|
229
|
-
"data-disabled":
|
|
230
|
-
...
|
|
148
|
+
"aria-disabled": s,
|
|
149
|
+
"data-disabled": s ? "" : void 0,
|
|
150
|
+
...g,
|
|
231
151
|
ref: t,
|
|
232
|
-
onPointerDown: V(
|
|
233
|
-
|
|
152
|
+
onPointerDown: V(g.onPointerDown, () => {
|
|
153
|
+
s || (O.current = b);
|
|
234
154
|
}),
|
|
235
|
-
min:
|
|
155
|
+
min: n,
|
|
236
156
|
max: o,
|
|
237
|
-
inverted:
|
|
238
|
-
onSlideStart:
|
|
239
|
-
onSlideMove:
|
|
240
|
-
onSlideEnd:
|
|
241
|
-
onHomeKeyDown: () => !
|
|
242
|
-
onEndKeyDown: () => !
|
|
243
|
-
onStepKeyDown: ({ event:
|
|
244
|
-
if (!
|
|
245
|
-
const
|
|
246
|
-
A(
|
|
157
|
+
inverted: S,
|
|
158
|
+
onSlideStart: s ? void 0 : L,
|
|
159
|
+
onSlideMove: s ? void 0 : de,
|
|
160
|
+
onSlideEnd: s ? void 0 : fe,
|
|
161
|
+
onHomeKeyDown: () => !s && A(n, 0, { commit: !0 }),
|
|
162
|
+
onEndKeyDown: () => !s && A(o, b.length - 1, { commit: !0 }),
|
|
163
|
+
onStepKeyDown: ({ event: w, direction: x }) => {
|
|
164
|
+
if (!s) {
|
|
165
|
+
const z = J.includes(w.key) || w.shiftKey && Q.includes(w.key) ? 10 : 1, k = m.current, D = b[k], P = a * z * x;
|
|
166
|
+
A(D + P, k, { commit: !0 });
|
|
247
167
|
}
|
|
248
168
|
}
|
|
249
169
|
}
|
|
@@ -252,204 +172,204 @@ var De = [
|
|
|
252
172
|
);
|
|
253
173
|
}
|
|
254
174
|
);
|
|
255
|
-
|
|
256
|
-
var [
|
|
175
|
+
ne.displayName = N;
|
|
176
|
+
var [re, oe] = te(N, {
|
|
257
177
|
startEdge: "left",
|
|
258
178
|
endEdge: "right",
|
|
259
179
|
size: "width",
|
|
260
180
|
direction: 1
|
|
261
|
-
}),
|
|
181
|
+
}), Ve = c.forwardRef(
|
|
262
182
|
(e, t) => {
|
|
263
183
|
const {
|
|
264
|
-
min:
|
|
265
|
-
max:
|
|
184
|
+
min: r,
|
|
185
|
+
max: n,
|
|
266
186
|
dir: o,
|
|
267
|
-
inverted:
|
|
187
|
+
inverted: a,
|
|
268
188
|
onSlideStart: i,
|
|
269
|
-
onSlideMove:
|
|
189
|
+
onSlideMove: s,
|
|
270
190
|
onSlideEnd: u,
|
|
271
|
-
onStepKeyDown:
|
|
272
|
-
...
|
|
273
|
-
} = e, [l,
|
|
274
|
-
function
|
|
275
|
-
const
|
|
276
|
-
return
|
|
191
|
+
onStepKeyDown: p,
|
|
192
|
+
...v
|
|
193
|
+
} = e, [l, f] = c.useState(null), S = B(t, (_) => f(_)), y = c.useRef(void 0), g = ve(o), h = g === "ltr", m = h && !a || !h && a;
|
|
194
|
+
function R(_) {
|
|
195
|
+
const b = y.current || l.getBoundingClientRect(), M = [0, b.width], L = Y(M, m ? [r, n] : [n, r]);
|
|
196
|
+
return y.current = b, L(_ - b.left);
|
|
277
197
|
}
|
|
278
|
-
return /* @__PURE__ */
|
|
279
|
-
|
|
198
|
+
return /* @__PURE__ */ d(
|
|
199
|
+
re,
|
|
280
200
|
{
|
|
281
201
|
scope: e.__scopeSlider,
|
|
282
|
-
startEdge:
|
|
283
|
-
endEdge:
|
|
284
|
-
direction:
|
|
202
|
+
startEdge: m ? "left" : "right",
|
|
203
|
+
endEdge: m ? "right" : "left",
|
|
204
|
+
direction: m ? 1 : -1,
|
|
285
205
|
size: "width",
|
|
286
|
-
children: /* @__PURE__ */
|
|
287
|
-
|
|
206
|
+
children: /* @__PURE__ */ d(
|
|
207
|
+
ie,
|
|
288
208
|
{
|
|
289
|
-
dir:
|
|
209
|
+
dir: g,
|
|
290
210
|
"data-orientation": "horizontal",
|
|
291
|
-
...
|
|
292
|
-
ref:
|
|
211
|
+
...v,
|
|
212
|
+
ref: S,
|
|
293
213
|
style: {
|
|
294
|
-
...
|
|
214
|
+
...v.style,
|
|
295
215
|
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
296
216
|
},
|
|
297
|
-
onSlideStart: (
|
|
298
|
-
const
|
|
299
|
-
i == null || i(
|
|
217
|
+
onSlideStart: (_) => {
|
|
218
|
+
const b = R(_.clientX);
|
|
219
|
+
i == null || i(b);
|
|
300
220
|
},
|
|
301
|
-
onSlideMove: (
|
|
302
|
-
const
|
|
303
|
-
|
|
221
|
+
onSlideMove: (_) => {
|
|
222
|
+
const b = R(_.clientX);
|
|
223
|
+
s == null || s(b);
|
|
304
224
|
},
|
|
305
225
|
onSlideEnd: () => {
|
|
306
|
-
|
|
226
|
+
y.current = void 0, u == null || u();
|
|
307
227
|
},
|
|
308
|
-
onStepKeyDown: (
|
|
309
|
-
const
|
|
310
|
-
|
|
228
|
+
onStepKeyDown: (_) => {
|
|
229
|
+
const M = ee[m ? "from-left" : "from-right"].includes(_.key);
|
|
230
|
+
p == null || p({ event: _, direction: M ? -1 : 1 });
|
|
311
231
|
}
|
|
312
232
|
}
|
|
313
233
|
)
|
|
314
234
|
}
|
|
315
235
|
);
|
|
316
236
|
}
|
|
317
|
-
),
|
|
237
|
+
), Ne = c.forwardRef(
|
|
318
238
|
(e, t) => {
|
|
319
239
|
const {
|
|
320
|
-
min:
|
|
321
|
-
max:
|
|
240
|
+
min: r,
|
|
241
|
+
max: n,
|
|
322
242
|
inverted: o,
|
|
323
|
-
onSlideStart:
|
|
243
|
+
onSlideStart: a,
|
|
324
244
|
onSlideMove: i,
|
|
325
|
-
onSlideEnd:
|
|
245
|
+
onSlideEnd: s,
|
|
326
246
|
onStepKeyDown: u,
|
|
327
|
-
...
|
|
328
|
-
} = e,
|
|
329
|
-
function
|
|
330
|
-
const
|
|
331
|
-
return
|
|
247
|
+
...p
|
|
248
|
+
} = e, v = c.useRef(null), l = B(t, v), f = c.useRef(void 0), S = !o;
|
|
249
|
+
function y(g) {
|
|
250
|
+
const h = f.current || v.current.getBoundingClientRect(), m = [0, h.height], _ = Y(m, S ? [n, r] : [r, n]);
|
|
251
|
+
return f.current = h, _(g - h.top);
|
|
332
252
|
}
|
|
333
|
-
return /* @__PURE__ */
|
|
334
|
-
|
|
253
|
+
return /* @__PURE__ */ d(
|
|
254
|
+
re,
|
|
335
255
|
{
|
|
336
256
|
scope: e.__scopeSlider,
|
|
337
|
-
startEdge:
|
|
338
|
-
endEdge:
|
|
257
|
+
startEdge: S ? "bottom" : "top",
|
|
258
|
+
endEdge: S ? "top" : "bottom",
|
|
339
259
|
size: "height",
|
|
340
|
-
direction:
|
|
341
|
-
children: /* @__PURE__ */
|
|
342
|
-
|
|
260
|
+
direction: S ? 1 : -1,
|
|
261
|
+
children: /* @__PURE__ */ d(
|
|
262
|
+
ie,
|
|
343
263
|
{
|
|
344
264
|
"data-orientation": "vertical",
|
|
345
|
-
...
|
|
265
|
+
...p,
|
|
346
266
|
ref: l,
|
|
347
267
|
style: {
|
|
348
|
-
...
|
|
268
|
+
...p.style,
|
|
349
269
|
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
350
270
|
},
|
|
351
|
-
onSlideStart: (
|
|
352
|
-
const
|
|
353
|
-
|
|
271
|
+
onSlideStart: (g) => {
|
|
272
|
+
const h = y(g.clientY);
|
|
273
|
+
a == null || a(h);
|
|
354
274
|
},
|
|
355
|
-
onSlideMove: (
|
|
356
|
-
const
|
|
357
|
-
i == null || i(
|
|
275
|
+
onSlideMove: (g) => {
|
|
276
|
+
const h = y(g.clientY);
|
|
277
|
+
i == null || i(h);
|
|
358
278
|
},
|
|
359
279
|
onSlideEnd: () => {
|
|
360
|
-
|
|
280
|
+
f.current = void 0, s == null || s();
|
|
361
281
|
},
|
|
362
|
-
onStepKeyDown: (
|
|
363
|
-
const
|
|
364
|
-
u == null || u({ event:
|
|
282
|
+
onStepKeyDown: (g) => {
|
|
283
|
+
const m = ee[S ? "from-bottom" : "from-top"].includes(g.key);
|
|
284
|
+
u == null || u({ event: g, direction: m ? -1 : 1 });
|
|
365
285
|
}
|
|
366
286
|
}
|
|
367
287
|
)
|
|
368
288
|
}
|
|
369
289
|
);
|
|
370
290
|
}
|
|
371
|
-
),
|
|
291
|
+
), ie = c.forwardRef(
|
|
372
292
|
(e, t) => {
|
|
373
293
|
const {
|
|
374
|
-
__scopeSlider:
|
|
375
|
-
onSlideStart:
|
|
294
|
+
__scopeSlider: r,
|
|
295
|
+
onSlideStart: n,
|
|
376
296
|
onSlideMove: o,
|
|
377
|
-
onSlideEnd:
|
|
297
|
+
onSlideEnd: a,
|
|
378
298
|
onHomeKeyDown: i,
|
|
379
|
-
onEndKeyDown:
|
|
299
|
+
onEndKeyDown: s,
|
|
380
300
|
onStepKeyDown: u,
|
|
381
|
-
...
|
|
382
|
-
} = e,
|
|
383
|
-
return /* @__PURE__ */
|
|
301
|
+
...p
|
|
302
|
+
} = e, v = H(N, r);
|
|
303
|
+
return /* @__PURE__ */ d(
|
|
384
304
|
T.span,
|
|
385
305
|
{
|
|
386
|
-
...
|
|
306
|
+
...p,
|
|
387
307
|
ref: t,
|
|
388
308
|
onKeyDown: V(e.onKeyDown, (l) => {
|
|
389
|
-
l.key === "Home" ? (i(l), l.preventDefault()) : l.key === "End" ? (
|
|
309
|
+
l.key === "Home" ? (i(l), l.preventDefault()) : l.key === "End" ? (s(l), l.preventDefault()) : J.concat(Q).includes(l.key) && (u(l), l.preventDefault());
|
|
390
310
|
}),
|
|
391
311
|
onPointerDown: V(e.onPointerDown, (l) => {
|
|
392
|
-
const
|
|
393
|
-
|
|
312
|
+
const f = l.target;
|
|
313
|
+
f.setPointerCapture(l.pointerId), l.preventDefault(), v.thumbs.has(f) ? f.focus() : n(l);
|
|
394
314
|
}),
|
|
395
315
|
onPointerMove: V(e.onPointerMove, (l) => {
|
|
396
316
|
l.target.hasPointerCapture(l.pointerId) && o(l);
|
|
397
317
|
}),
|
|
398
318
|
onPointerUp: V(e.onPointerUp, (l) => {
|
|
399
|
-
const
|
|
400
|
-
|
|
319
|
+
const f = l.target;
|
|
320
|
+
f.hasPointerCapture(l.pointerId) && (f.releasePointerCapture(l.pointerId), a(l));
|
|
401
321
|
})
|
|
402
322
|
}
|
|
403
323
|
);
|
|
404
324
|
}
|
|
405
|
-
),
|
|
325
|
+
), ae = "SliderTrack", se = c.forwardRef(
|
|
406
326
|
(e, t) => {
|
|
407
|
-
const { __scopeSlider:
|
|
408
|
-
return /* @__PURE__ */
|
|
327
|
+
const { __scopeSlider: r, ...n } = e, o = H(ae, r);
|
|
328
|
+
return /* @__PURE__ */ d(
|
|
409
329
|
T.span,
|
|
410
330
|
{
|
|
411
331
|
"data-disabled": o.disabled ? "" : void 0,
|
|
412
332
|
"data-orientation": o.orientation,
|
|
413
|
-
...
|
|
333
|
+
...n,
|
|
414
334
|
ref: t
|
|
415
335
|
}
|
|
416
336
|
);
|
|
417
337
|
}
|
|
418
338
|
);
|
|
419
|
-
|
|
420
|
-
var
|
|
339
|
+
se.displayName = ae;
|
|
340
|
+
var W = "SliderRange", le = c.forwardRef(
|
|
421
341
|
(e, t) => {
|
|
422
|
-
const { __scopeSlider:
|
|
423
|
-
(
|
|
424
|
-
),
|
|
425
|
-
return /* @__PURE__ */
|
|
342
|
+
const { __scopeSlider: r, ...n } = e, o = H(W, r), a = oe(W, r), i = c.useRef(null), s = B(t, i), u = o.values.length, p = o.values.map(
|
|
343
|
+
(f) => ue(f, o.min, o.max)
|
|
344
|
+
), v = u > 1 ? Math.min(...p) : 0, l = 100 - Math.max(...p);
|
|
345
|
+
return /* @__PURE__ */ d(
|
|
426
346
|
T.span,
|
|
427
347
|
{
|
|
428
348
|
"data-orientation": o.orientation,
|
|
429
349
|
"data-disabled": o.disabled ? "" : void 0,
|
|
430
|
-
...
|
|
431
|
-
ref:
|
|
350
|
+
...n,
|
|
351
|
+
ref: s,
|
|
432
352
|
style: {
|
|
433
353
|
...e.style,
|
|
434
|
-
[
|
|
435
|
-
[
|
|
354
|
+
[a.startEdge]: v + "%",
|
|
355
|
+
[a.endEdge]: l + "%"
|
|
436
356
|
}
|
|
437
357
|
}
|
|
438
358
|
);
|
|
439
359
|
}
|
|
440
360
|
);
|
|
441
|
-
|
|
442
|
-
var
|
|
361
|
+
le.displayName = W;
|
|
362
|
+
var U = "SliderThumb", ce = c.forwardRef(
|
|
443
363
|
(e, t) => {
|
|
444
|
-
const
|
|
445
|
-
() =>
|
|
446
|
-
[
|
|
364
|
+
const r = Ce(e.__scopeSlider), [n, o] = c.useState(null), a = B(t, (s) => o(s)), i = c.useMemo(
|
|
365
|
+
() => n ? r().findIndex((s) => s.ref.current === n) : -1,
|
|
366
|
+
[r, n]
|
|
447
367
|
);
|
|
448
|
-
return /* @__PURE__ */
|
|
368
|
+
return /* @__PURE__ */ d(Me, { ...e, ref: a, index: i });
|
|
449
369
|
}
|
|
450
|
-
),
|
|
370
|
+
), Me = c.forwardRef(
|
|
451
371
|
(e, t) => {
|
|
452
|
-
const { __scopeSlider:
|
|
372
|
+
const { __scopeSlider: r, index: n, name: o, ...a } = e, i = H(U, r), s = oe(U, r), [u, p] = c.useState(null), v = B(t, (R) => p(R)), l = u ? i.form || !!u.closest("form") : !0, f = be(u), S = i.values[n], y = S === void 0 ? 0 : ue(S, i.min, i.max), g = Be(n, i.values.length), h = f == null ? void 0 : f[s.size], m = h ? Ke(h, y, s.direction) : 0;
|
|
453
373
|
return c.useEffect(() => {
|
|
454
374
|
if (u)
|
|
455
375
|
return i.thumbs.add(u), () => {
|
|
@@ -461,159 +381,159 @@ var W = "SliderThumb", de = c.forwardRef(
|
|
|
461
381
|
style: {
|
|
462
382
|
transform: "var(--radix-slider-thumb-transform)",
|
|
463
383
|
position: "absolute",
|
|
464
|
-
[
|
|
384
|
+
[s.startEdge]: `calc(${y}% + ${m}px)`
|
|
465
385
|
},
|
|
466
386
|
children: [
|
|
467
|
-
/* @__PURE__ */
|
|
387
|
+
/* @__PURE__ */ d(j.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ d(
|
|
468
388
|
T.span,
|
|
469
389
|
{
|
|
470
390
|
role: "slider",
|
|
471
|
-
"aria-label": e["aria-label"] ||
|
|
391
|
+
"aria-label": e["aria-label"] || g,
|
|
472
392
|
"aria-valuemin": i.min,
|
|
473
|
-
"aria-valuenow":
|
|
393
|
+
"aria-valuenow": S,
|
|
474
394
|
"aria-valuemax": i.max,
|
|
475
395
|
"aria-orientation": i.orientation,
|
|
476
396
|
"data-orientation": i.orientation,
|
|
477
397
|
"data-disabled": i.disabled ? "" : void 0,
|
|
478
398
|
tabIndex: i.disabled ? void 0 : 0,
|
|
479
|
-
...
|
|
480
|
-
ref:
|
|
481
|
-
style:
|
|
399
|
+
...a,
|
|
400
|
+
ref: v,
|
|
401
|
+
style: S === void 0 ? { display: "none" } : e.style,
|
|
482
402
|
onFocus: V(e.onFocus, () => {
|
|
483
|
-
i.valueIndexToChangeRef.current =
|
|
403
|
+
i.valueIndexToChangeRef.current = n;
|
|
484
404
|
})
|
|
485
405
|
}
|
|
486
406
|
) }),
|
|
487
|
-
l && /* @__PURE__ */
|
|
488
|
-
|
|
407
|
+
l && /* @__PURE__ */ d(
|
|
408
|
+
Ae,
|
|
489
409
|
{
|
|
490
410
|
name: o ?? (i.name ? i.name + (i.values.length > 1 ? "[]" : "") : void 0),
|
|
491
411
|
form: i.form,
|
|
492
|
-
value:
|
|
412
|
+
value: S
|
|
493
413
|
},
|
|
494
|
-
|
|
414
|
+
n
|
|
495
415
|
)
|
|
496
416
|
]
|
|
497
417
|
}
|
|
498
418
|
);
|
|
499
419
|
}
|
|
500
420
|
);
|
|
501
|
-
|
|
502
|
-
var
|
|
503
|
-
const { value: t, ...
|
|
421
|
+
ce.displayName = U;
|
|
422
|
+
var Ae = (e) => {
|
|
423
|
+
const { value: t, ...r } = e, n = c.useRef(null), o = _e(t);
|
|
504
424
|
return c.useEffect(() => {
|
|
505
|
-
const
|
|
425
|
+
const a = n.current, i = window.HTMLInputElement.prototype, u = Object.getOwnPropertyDescriptor(i, "value").set;
|
|
506
426
|
if (o !== t && u) {
|
|
507
|
-
const
|
|
508
|
-
u.call(
|
|
427
|
+
const p = new Event("input", { bubbles: !0 });
|
|
428
|
+
u.call(a, t), a.dispatchEvent(p);
|
|
509
429
|
}
|
|
510
|
-
}, [o, t]), /* @__PURE__ */
|
|
430
|
+
}, [o, t]), /* @__PURE__ */ d("input", { style: { display: "none" }, ...r, ref: n, defaultValue: t });
|
|
511
431
|
};
|
|
512
|
-
function
|
|
513
|
-
const
|
|
514
|
-
return r
|
|
432
|
+
function ke(e = [], t, r) {
|
|
433
|
+
const n = [...e];
|
|
434
|
+
return n[r] = t, n.sort((o, a) => o - a);
|
|
515
435
|
}
|
|
516
|
-
function
|
|
517
|
-
const
|
|
518
|
-
return
|
|
436
|
+
function ue(e, t, r) {
|
|
437
|
+
const a = 100 / (r - t) * (e - t);
|
|
438
|
+
return Z(a, [0, 100]);
|
|
519
439
|
}
|
|
520
|
-
function
|
|
440
|
+
function Be(e, t) {
|
|
521
441
|
return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
|
|
522
442
|
}
|
|
523
|
-
function
|
|
443
|
+
function Ie(e, t) {
|
|
524
444
|
if (e.length === 1) return 0;
|
|
525
|
-
const
|
|
526
|
-
return
|
|
445
|
+
const r = e.map((o) => Math.abs(o - t)), n = Math.min(...r);
|
|
446
|
+
return r.indexOf(n);
|
|
527
447
|
}
|
|
528
|
-
function
|
|
529
|
-
const
|
|
530
|
-
return (
|
|
448
|
+
function Ke(e, t, r) {
|
|
449
|
+
const n = e / 2, a = Y([0, 50], [0, n]);
|
|
450
|
+
return (n - a(t) * r) * r;
|
|
531
451
|
}
|
|
532
|
-
function
|
|
533
|
-
return e.slice(0, -1).map((t,
|
|
452
|
+
function Te(e) {
|
|
453
|
+
return e.slice(0, -1).map((t, r) => e[r + 1] - t);
|
|
534
454
|
}
|
|
535
|
-
function
|
|
455
|
+
function He(e, t) {
|
|
536
456
|
if (t > 0) {
|
|
537
|
-
const
|
|
538
|
-
return Math.min(...
|
|
457
|
+
const r = Te(e);
|
|
458
|
+
return Math.min(...r) >= t;
|
|
539
459
|
}
|
|
540
460
|
return !0;
|
|
541
461
|
}
|
|
542
|
-
function
|
|
543
|
-
return (
|
|
462
|
+
function Y(e, t) {
|
|
463
|
+
return (r) => {
|
|
544
464
|
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
545
|
-
const
|
|
546
|
-
return t[0] +
|
|
465
|
+
const n = (t[1] - t[0]) / (e[1] - e[0]);
|
|
466
|
+
return t[0] + n * (r - e[0]);
|
|
547
467
|
};
|
|
548
468
|
}
|
|
549
|
-
function
|
|
469
|
+
function Oe(e) {
|
|
550
470
|
return (String(e).split(".")[1] || "").length;
|
|
551
471
|
}
|
|
552
|
-
function
|
|
553
|
-
const
|
|
554
|
-
return Math.round(e *
|
|
472
|
+
function Le(e, t) {
|
|
473
|
+
const r = Math.pow(10, t);
|
|
474
|
+
return Math.round(e * r) / r;
|
|
555
475
|
}
|
|
556
|
-
var
|
|
557
|
-
const
|
|
558
|
-
container:
|
|
559
|
-
labels:
|
|
560
|
-
root:
|
|
561
|
-
track:
|
|
562
|
-
range:
|
|
563
|
-
thumb:
|
|
564
|
-
valueBubble:
|
|
565
|
-
},
|
|
476
|
+
var ze = ne, Fe = se, je = le, We = ce;
|
|
477
|
+
const Ue = "cfxui__Slider__container__997ea", Ye = "cfxui__Slider__labels__2a966", $e = "cfxui__Slider__root__a6c1b", Xe = "cfxui__Slider__track__570cb", Ge = "cfxui__Slider__range__5ae17", Ze = "cfxui__Slider__thumb__27d80", qe = "cfxui__Slider__valueBubble__ebce8", C = {
|
|
478
|
+
container: Ue,
|
|
479
|
+
labels: Ye,
|
|
480
|
+
root: $e,
|
|
481
|
+
track: Xe,
|
|
482
|
+
range: Ge,
|
|
483
|
+
thumb: Ze,
|
|
484
|
+
valueBubble: qe
|
|
485
|
+
}, lt = I.forwardRef(function(t, r) {
|
|
566
486
|
const {
|
|
567
|
-
value:
|
|
487
|
+
value: n,
|
|
568
488
|
defaultValue: o,
|
|
569
|
-
title:
|
|
489
|
+
title: a,
|
|
570
490
|
ariaLabel: i,
|
|
571
|
-
className:
|
|
491
|
+
className: s,
|
|
572
492
|
trackClassName: u,
|
|
573
|
-
minLabel:
|
|
574
|
-
maxLabel:
|
|
493
|
+
minLabel: p,
|
|
494
|
+
maxLabel: v,
|
|
575
495
|
min: l = 0,
|
|
576
|
-
max:
|
|
577
|
-
onValueChange:
|
|
578
|
-
...
|
|
579
|
-
} = t, [
|
|
580
|
-
if (
|
|
581
|
-
return
|
|
496
|
+
max: f,
|
|
497
|
+
onValueChange: S,
|
|
498
|
+
...y
|
|
499
|
+
} = t, [g, h] = I.useState(() => {
|
|
500
|
+
if (n)
|
|
501
|
+
return n;
|
|
582
502
|
if (o)
|
|
583
503
|
return o;
|
|
584
|
-
}),
|
|
585
|
-
if (
|
|
586
|
-
|
|
504
|
+
}), m = I.useCallback((R) => {
|
|
505
|
+
if (S) {
|
|
506
|
+
S(R);
|
|
587
507
|
return;
|
|
588
508
|
}
|
|
589
|
-
|
|
590
|
-
}, [
|
|
509
|
+
h(R);
|
|
510
|
+
}, [S]);
|
|
591
511
|
return I.useEffect(() => {
|
|
592
|
-
|
|
593
|
-
}, [
|
|
512
|
+
n && h(n);
|
|
513
|
+
}, [n]), /* @__PURE__ */ K("div", { className: C.container, children: [
|
|
594
514
|
/* @__PURE__ */ K(
|
|
595
|
-
|
|
515
|
+
ze,
|
|
596
516
|
{
|
|
597
|
-
...
|
|
598
|
-
ref:
|
|
517
|
+
...y,
|
|
518
|
+
ref: r,
|
|
599
519
|
min: l,
|
|
600
|
-
max:
|
|
601
|
-
value:
|
|
602
|
-
className: G(
|
|
603
|
-
onValueChange:
|
|
520
|
+
max: f,
|
|
521
|
+
value: n,
|
|
522
|
+
className: G(C.root, s),
|
|
523
|
+
onValueChange: m,
|
|
604
524
|
children: [
|
|
605
|
-
/* @__PURE__ */
|
|
606
|
-
/* @__PURE__ */
|
|
525
|
+
/* @__PURE__ */ d(Fe, { className: G(C.track, u), children: /* @__PURE__ */ d(je, { className: C.range }) }),
|
|
526
|
+
/* @__PURE__ */ d(We, { className: C.thumb, "aria-label": i, children: /* @__PURE__ */ d("div", { className: C.valueBubble, children: [g, a].join(" ") }) })
|
|
607
527
|
]
|
|
608
528
|
}
|
|
609
529
|
),
|
|
610
|
-
/* @__PURE__ */ K("div", { className:
|
|
611
|
-
/* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
530
|
+
/* @__PURE__ */ K("div", { className: C.labels, children: [
|
|
531
|
+
/* @__PURE__ */ d("span", { children: typeof p < "u" ? p : l }),
|
|
532
|
+
/* @__PURE__ */ d("span", { children: typeof v < "u" ? v : f })
|
|
613
533
|
] })
|
|
614
534
|
] });
|
|
615
535
|
});
|
|
616
536
|
export {
|
|
617
|
-
|
|
618
|
-
|
|
537
|
+
lt as Slider,
|
|
538
|
+
lt as default
|
|
619
539
|
};
|