@cfx-dev/ui-components 4.5.16 → 4.5.18
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/{Combination-2dfXEDc9.js → Combination-CcTTSYNP.js} +1 -1
- package/dist/{DropdownContent-CLtPVRZg.js → DropdownContent-MvHlrWi6.js} +4 -4
- package/dist/assets/all_css.css +2 -0
- package/dist/assets/css/DropdownSelect.css +1 -1
- package/dist/assets/css/Flyout.css +1 -1
- package/dist/assets/css/Popover.css +1 -1
- package/dist/assets/css/Range.css +1 -0
- package/dist/assets/css/RangeInput.css +1 -0
- package/dist/assets/css/RichInput.css +1 -1
- package/dist/assets/css/Select.css +1 -1
- package/dist/assets/css/StyledInput.css +1 -1
- package/dist/assets/general/global.css +1 -1
- package/dist/components/Checkbox/Checkbox.js +23 -23
- package/dist/components/DropdownContent/DropdownContent.js +1 -1
- package/dist/components/DropdownContent/index.js +1 -1
- package/dist/components/DropdownMenu/DropdownMenu.js +1 -1
- package/dist/components/DropdownSelect/DropdownSelect.js +1 -1
- package/dist/components/Flyout/Flyout.d.ts +7 -3
- package/dist/components/Flyout/Flyout.js +61 -48
- package/dist/components/Flyout/FlyoutShowcase.d.ts +5 -0
- package/dist/components/Flyout/FlyoutShowcase.js +28 -0
- package/dist/components/Flyout/index.d.ts +1 -1
- package/dist/components/Flyout/index.js +5 -3
- package/dist/components/Range/Range.d.ts +4 -0
- package/dist/components/Range/Range.js +90 -0
- package/dist/components/Range/Range.types.d.ts +9 -0
- package/dist/components/Range/Range.types.js +1 -0
- package/dist/components/Range/RangeInput.d.ts +13 -0
- package/dist/components/Range/RangeInput.js +78 -0
- package/dist/components/Range/RangeShowcase.d.ts +2 -0
- package/dist/components/Range/RangeShowcase.js +41 -0
- package/dist/components/Range/RangeWithInputs.d.ts +8 -0
- package/dist/components/Range/RangeWithInputs.js +81 -0
- package/dist/components/Range/index.d.ts +6 -0
- package/dist/components/Range/index.js +8 -0
- package/dist/components/Select/Select.js +3 -3
- package/dist/components/Slider/Slider.js +64 -472
- package/dist/components/Slider/SliderShowcase.js +6 -4
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/{index-DWzyrn_L.js → index-3ctv5u9o.js} +1 -1
- package/dist/{index-BMU9X4M-.js → index-9LBuZ7x4.js} +7 -7
- package/dist/{index-DCuJlMqr.js → index-CfQtbUfi.js} +6 -6
- package/dist/index-D5SMGei3.js +427 -0
- package/dist/main.d.ts +3 -1
- package/dist/main.js +186 -178
- package/dist/styles-scss/_ui.scss +20 -17
- package/dist/styles-scss/global.scss +2 -0
- package/dist/styles-scss/tokens.scss +26 -21
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as P, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
3
|
import M from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { b as x, u as H, c as j, P as y, a as A, d as q } from "../../index-CfQtbUfi.js";
|
|
5
5
|
import { u as z } from "../../index-BZPx6jYI.js";
|
|
6
6
|
import { clsx as k } from "../../utils/clsx.js";
|
|
7
7
|
var w = "Switch", [L, et] = j(w), [O, $] = L(w), T = r.forwardRef(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as A from "react";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import { c as D,
|
|
3
|
+
import { c as D, b as S, f as M } from "./index-CfQtbUfi.js";
|
|
4
4
|
import { jsx as d } from "react/jsx-runtime";
|
|
5
5
|
function g(l) {
|
|
6
6
|
const i = l + "CollectionProvider", [N, _] = D(i), [v, f] = N(
|
|
@@ -11,20 +11,20 @@ function g(l) {
|
|
|
11
11
|
return /* @__PURE__ */ d(v, { scope: e, itemMap: o, collectionRef: t, children: s });
|
|
12
12
|
};
|
|
13
13
|
p.displayName = i;
|
|
14
|
-
const
|
|
14
|
+
const m = l + "CollectionSlot", E = M(m), C = r.forwardRef(
|
|
15
15
|
(c, e) => {
|
|
16
|
-
const { scope: s, children: t } = c, o = f(
|
|
16
|
+
const { scope: s, children: t } = c, o = f(m, s), n = S(e, o.collectionRef);
|
|
17
17
|
return /* @__PURE__ */ d(E, { ref: n, children: t });
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
|
-
C.displayName =
|
|
21
|
-
const
|
|
20
|
+
C.displayName = m;
|
|
21
|
+
const u = l + "CollectionItemSlot", R = "data-radix-collection-item", T = M(u), I = r.forwardRef(
|
|
22
22
|
(c, e) => {
|
|
23
|
-
const { scope: s, children: t, ...o } = c, n = r.useRef(null), x = S(e, n), a = f(
|
|
23
|
+
const { scope: s, children: t, ...o } = c, n = r.useRef(null), x = S(e, n), a = f(u, s);
|
|
24
24
|
return r.useEffect(() => (a.itemMap.set(n, { ref: n, ...o }), () => void a.itemMap.delete(n))), /* @__PURE__ */ d(T, { [R]: "", ref: x, children: t });
|
|
25
25
|
}
|
|
26
26
|
);
|
|
27
|
-
I.displayName =
|
|
27
|
+
I.displayName = u;
|
|
28
28
|
function O(c) {
|
|
29
29
|
const e = f(l + "CollectionConsumer", c);
|
|
30
30
|
return r.useCallback(() => {
|
|
@@ -227,13 +227,13 @@ function M(t, n) {
|
|
|
227
227
|
}
|
|
228
228
|
export {
|
|
229
229
|
F as P,
|
|
230
|
-
|
|
231
|
-
|
|
230
|
+
k as a,
|
|
231
|
+
j as b,
|
|
232
232
|
B as c,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
T as d,
|
|
234
|
+
x as e,
|
|
235
|
+
z as f,
|
|
236
236
|
M as g,
|
|
237
237
|
C as h,
|
|
238
|
-
|
|
238
|
+
L as u
|
|
239
239
|
};
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import * as d from "react";
|
|
2
|
+
import { c as $ } from "./index-rKs9bXHr.js";
|
|
3
|
+
import { u as ce, c as le, a as C, P as B, b as M, d as de } from "./index-CfQtbUfi.js";
|
|
4
|
+
import { c as ue, u as fe } from "./index-9LBuZ7x4.js";
|
|
5
|
+
import { u as me } from "./index-BZPx6jYI.js";
|
|
6
|
+
import { jsx as v, jsxs as pe } from "react/jsx-runtime";
|
|
7
|
+
var j = ["PageUp", "PageDown"], X = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], G = {
|
|
8
|
+
"from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
9
|
+
"from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
|
|
10
|
+
"from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
|
|
11
|
+
"from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
|
|
12
|
+
}, I = "Slider", [z, he, Se] = ue(I), [W, Ke] = le(I, [
|
|
13
|
+
Se
|
|
14
|
+
]), [ge, K] = W(I), q = d.forwardRef(
|
|
15
|
+
(e, t) => {
|
|
16
|
+
const {
|
|
17
|
+
name: o,
|
|
18
|
+
min: n = 0,
|
|
19
|
+
max: a = 100,
|
|
20
|
+
step: c = 1,
|
|
21
|
+
orientation: r = "horizontal",
|
|
22
|
+
disabled: s = !1,
|
|
23
|
+
minStepsBetweenThumbs: l = 0,
|
|
24
|
+
defaultValue: h = [n],
|
|
25
|
+
value: S,
|
|
26
|
+
onValueChange: i = () => {
|
|
27
|
+
},
|
|
28
|
+
onValueCommit: u = () => {
|
|
29
|
+
},
|
|
30
|
+
inverted: w = !1,
|
|
31
|
+
form: P,
|
|
32
|
+
...g
|
|
33
|
+
} = e, m = d.useRef(/* @__PURE__ */ new Set()), f = d.useRef(0), b = r === "horizontal" ? ve : we, [p = [], A] = ce({
|
|
34
|
+
prop: S,
|
|
35
|
+
defaultProp: h,
|
|
36
|
+
onChange: (R) => {
|
|
37
|
+
var E;
|
|
38
|
+
(E = [...m.current][f.current]) == null || E.focus(), i(R);
|
|
39
|
+
}
|
|
40
|
+
}), k = d.useRef(p);
|
|
41
|
+
function H(R) {
|
|
42
|
+
const x = ye(p, R);
|
|
43
|
+
T(R, x);
|
|
44
|
+
}
|
|
45
|
+
function se(R) {
|
|
46
|
+
T(R, f.current);
|
|
47
|
+
}
|
|
48
|
+
function ae() {
|
|
49
|
+
const R = k.current[f.current];
|
|
50
|
+
p[f.current] !== R && u(p);
|
|
51
|
+
}
|
|
52
|
+
function T(R, x, { commit: E } = { commit: !1 }) {
|
|
53
|
+
const F = Ce(c), N = Me(Math.round((R - n) / c) * c + n, F), V = $(N, [n, a]);
|
|
54
|
+
A((_ = []) => {
|
|
55
|
+
const y = Pe(_, V, x);
|
|
56
|
+
if (_e(y, l * c)) {
|
|
57
|
+
f.current = y.indexOf(V);
|
|
58
|
+
const Y = String(y) !== String(_);
|
|
59
|
+
return Y && E && u(y), Y ? y : _;
|
|
60
|
+
} else
|
|
61
|
+
return _;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return /* @__PURE__ */ v(
|
|
65
|
+
ge,
|
|
66
|
+
{
|
|
67
|
+
scope: e.__scopeSlider,
|
|
68
|
+
name: o,
|
|
69
|
+
disabled: s,
|
|
70
|
+
min: n,
|
|
71
|
+
max: a,
|
|
72
|
+
valueIndexToChangeRef: f,
|
|
73
|
+
thumbs: m.current,
|
|
74
|
+
values: p,
|
|
75
|
+
orientation: r,
|
|
76
|
+
form: P,
|
|
77
|
+
children: /* @__PURE__ */ v(z.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(z.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(
|
|
78
|
+
b,
|
|
79
|
+
{
|
|
80
|
+
"aria-disabled": s,
|
|
81
|
+
"data-disabled": s ? "" : void 0,
|
|
82
|
+
...g,
|
|
83
|
+
ref: t,
|
|
84
|
+
onPointerDown: C(g.onPointerDown, () => {
|
|
85
|
+
s || (k.current = p);
|
|
86
|
+
}),
|
|
87
|
+
min: n,
|
|
88
|
+
max: a,
|
|
89
|
+
inverted: w,
|
|
90
|
+
onSlideStart: s ? void 0 : H,
|
|
91
|
+
onSlideMove: s ? void 0 : se,
|
|
92
|
+
onSlideEnd: s ? void 0 : ae,
|
|
93
|
+
onHomeKeyDown: () => !s && T(n, 0, { commit: !0 }),
|
|
94
|
+
onEndKeyDown: () => !s && T(a, p.length - 1, { commit: !0 }),
|
|
95
|
+
onStepKeyDown: ({ event: R, direction: x }) => {
|
|
96
|
+
if (!s) {
|
|
97
|
+
const N = j.includes(R.key) || R.shiftKey && X.includes(R.key) ? 10 : 1, V = f.current, _ = p[V], y = c * N * x;
|
|
98
|
+
T(_ + y, V, { commit: !0 });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
) }) })
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
);
|
|
107
|
+
q.displayName = I;
|
|
108
|
+
var [J, Q] = W(I, {
|
|
109
|
+
startEdge: "left",
|
|
110
|
+
endEdge: "right",
|
|
111
|
+
size: "width",
|
|
112
|
+
direction: 1
|
|
113
|
+
}), ve = d.forwardRef(
|
|
114
|
+
(e, t) => {
|
|
115
|
+
const {
|
|
116
|
+
min: o,
|
|
117
|
+
max: n,
|
|
118
|
+
dir: a,
|
|
119
|
+
inverted: c,
|
|
120
|
+
onSlideStart: r,
|
|
121
|
+
onSlideMove: s,
|
|
122
|
+
onSlideEnd: l,
|
|
123
|
+
onStepKeyDown: h,
|
|
124
|
+
...S
|
|
125
|
+
} = e, [i, u] = d.useState(null), w = M(t, (b) => u(b)), P = d.useRef(void 0), g = fe(a), m = g === "ltr", f = m && !c || !m && c;
|
|
126
|
+
function D(b) {
|
|
127
|
+
const p = P.current || i.getBoundingClientRect(), A = [0, p.width], H = U(A, f ? [o, n] : [n, o]);
|
|
128
|
+
return P.current = p, H(b - p.left);
|
|
129
|
+
}
|
|
130
|
+
return /* @__PURE__ */ v(
|
|
131
|
+
J,
|
|
132
|
+
{
|
|
133
|
+
scope: e.__scopeSlider,
|
|
134
|
+
startEdge: f ? "left" : "right",
|
|
135
|
+
endEdge: f ? "right" : "left",
|
|
136
|
+
direction: f ? 1 : -1,
|
|
137
|
+
size: "width",
|
|
138
|
+
children: /* @__PURE__ */ v(
|
|
139
|
+
Z,
|
|
140
|
+
{
|
|
141
|
+
dir: g,
|
|
142
|
+
"data-orientation": "horizontal",
|
|
143
|
+
...S,
|
|
144
|
+
ref: w,
|
|
145
|
+
style: {
|
|
146
|
+
...S.style,
|
|
147
|
+
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
148
|
+
},
|
|
149
|
+
onSlideStart: (b) => {
|
|
150
|
+
const p = D(b.clientX);
|
|
151
|
+
r == null || r(p);
|
|
152
|
+
},
|
|
153
|
+
onSlideMove: (b) => {
|
|
154
|
+
const p = D(b.clientX);
|
|
155
|
+
s == null || s(p);
|
|
156
|
+
},
|
|
157
|
+
onSlideEnd: () => {
|
|
158
|
+
P.current = void 0, l == null || l();
|
|
159
|
+
},
|
|
160
|
+
onStepKeyDown: (b) => {
|
|
161
|
+
const A = G[f ? "from-left" : "from-right"].includes(b.key);
|
|
162
|
+
h == null || h({ event: b, direction: A ? -1 : 1 });
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
), we = d.forwardRef(
|
|
170
|
+
(e, t) => {
|
|
171
|
+
const {
|
|
172
|
+
min: o,
|
|
173
|
+
max: n,
|
|
174
|
+
inverted: a,
|
|
175
|
+
onSlideStart: c,
|
|
176
|
+
onSlideMove: r,
|
|
177
|
+
onSlideEnd: s,
|
|
178
|
+
onStepKeyDown: l,
|
|
179
|
+
...h
|
|
180
|
+
} = e, S = d.useRef(null), i = M(t, S), u = d.useRef(void 0), w = !a;
|
|
181
|
+
function P(g) {
|
|
182
|
+
const m = u.current || S.current.getBoundingClientRect(), f = [0, m.height], b = U(f, w ? [n, o] : [o, n]);
|
|
183
|
+
return u.current = m, b(g - m.top);
|
|
184
|
+
}
|
|
185
|
+
return /* @__PURE__ */ v(
|
|
186
|
+
J,
|
|
187
|
+
{
|
|
188
|
+
scope: e.__scopeSlider,
|
|
189
|
+
startEdge: w ? "bottom" : "top",
|
|
190
|
+
endEdge: w ? "top" : "bottom",
|
|
191
|
+
size: "height",
|
|
192
|
+
direction: w ? 1 : -1,
|
|
193
|
+
children: /* @__PURE__ */ v(
|
|
194
|
+
Z,
|
|
195
|
+
{
|
|
196
|
+
"data-orientation": "vertical",
|
|
197
|
+
...h,
|
|
198
|
+
ref: i,
|
|
199
|
+
style: {
|
|
200
|
+
...h.style,
|
|
201
|
+
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
202
|
+
},
|
|
203
|
+
onSlideStart: (g) => {
|
|
204
|
+
const m = P(g.clientY);
|
|
205
|
+
c == null || c(m);
|
|
206
|
+
},
|
|
207
|
+
onSlideMove: (g) => {
|
|
208
|
+
const m = P(g.clientY);
|
|
209
|
+
r == null || r(m);
|
|
210
|
+
},
|
|
211
|
+
onSlideEnd: () => {
|
|
212
|
+
u.current = void 0, s == null || s();
|
|
213
|
+
},
|
|
214
|
+
onStepKeyDown: (g) => {
|
|
215
|
+
const f = G[w ? "from-bottom" : "from-top"].includes(g.key);
|
|
216
|
+
l == null || l({ event: g, direction: f ? -1 : 1 });
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
), Z = d.forwardRef(
|
|
224
|
+
(e, t) => {
|
|
225
|
+
const {
|
|
226
|
+
__scopeSlider: o,
|
|
227
|
+
onSlideStart: n,
|
|
228
|
+
onSlideMove: a,
|
|
229
|
+
onSlideEnd: c,
|
|
230
|
+
onHomeKeyDown: r,
|
|
231
|
+
onEndKeyDown: s,
|
|
232
|
+
onStepKeyDown: l,
|
|
233
|
+
...h
|
|
234
|
+
} = e, S = K(I, o);
|
|
235
|
+
return /* @__PURE__ */ v(
|
|
236
|
+
B.span,
|
|
237
|
+
{
|
|
238
|
+
...h,
|
|
239
|
+
ref: t,
|
|
240
|
+
onKeyDown: C(e.onKeyDown, (i) => {
|
|
241
|
+
i.key === "Home" ? (r(i), i.preventDefault()) : i.key === "End" ? (s(i), i.preventDefault()) : j.concat(X).includes(i.key) && (l(i), i.preventDefault());
|
|
242
|
+
}),
|
|
243
|
+
onPointerDown: C(e.onPointerDown, (i) => {
|
|
244
|
+
const u = i.target;
|
|
245
|
+
u.setPointerCapture(i.pointerId), i.preventDefault(), S.thumbs.has(u) ? u.focus() : n(i);
|
|
246
|
+
}),
|
|
247
|
+
onPointerMove: C(e.onPointerMove, (i) => {
|
|
248
|
+
i.target.hasPointerCapture(i.pointerId) && a(i);
|
|
249
|
+
}),
|
|
250
|
+
onPointerUp: C(e.onPointerUp, (i) => {
|
|
251
|
+
const u = i.target;
|
|
252
|
+
u.hasPointerCapture(i.pointerId) && (u.releasePointerCapture(i.pointerId), c(i));
|
|
253
|
+
})
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
), ee = "SliderTrack", te = d.forwardRef(
|
|
258
|
+
(e, t) => {
|
|
259
|
+
const { __scopeSlider: o, ...n } = e, a = K(ee, o);
|
|
260
|
+
return /* @__PURE__ */ v(
|
|
261
|
+
B.span,
|
|
262
|
+
{
|
|
263
|
+
"data-disabled": a.disabled ? "" : void 0,
|
|
264
|
+
"data-orientation": a.orientation,
|
|
265
|
+
...n,
|
|
266
|
+
ref: t
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
te.displayName = ee;
|
|
272
|
+
var L = "SliderRange", ne = d.forwardRef(
|
|
273
|
+
(e, t) => {
|
|
274
|
+
const { __scopeSlider: o, ...n } = e, a = K(L, o), c = Q(L, o), r = d.useRef(null), s = M(t, r), l = a.values.length, h = a.values.map(
|
|
275
|
+
(u) => ie(u, a.min, a.max)
|
|
276
|
+
), S = l > 1 ? Math.min(...h) : 0, i = 100 - Math.max(...h);
|
|
277
|
+
return /* @__PURE__ */ v(
|
|
278
|
+
B.span,
|
|
279
|
+
{
|
|
280
|
+
"data-orientation": a.orientation,
|
|
281
|
+
"data-disabled": a.disabled ? "" : void 0,
|
|
282
|
+
...n,
|
|
283
|
+
ref: s,
|
|
284
|
+
style: {
|
|
285
|
+
...e.style,
|
|
286
|
+
[c.startEdge]: S + "%",
|
|
287
|
+
[c.endEdge]: i + "%"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
ne.displayName = L;
|
|
294
|
+
var O = "SliderThumb", oe = d.forwardRef(
|
|
295
|
+
(e, t) => {
|
|
296
|
+
const o = he(e.__scopeSlider), [n, a] = d.useState(null), c = M(t, (s) => a(s)), r = d.useMemo(
|
|
297
|
+
() => n ? o().findIndex((s) => s.ref.current === n) : -1,
|
|
298
|
+
[o, n]
|
|
299
|
+
);
|
|
300
|
+
return /* @__PURE__ */ v(be, { ...e, ref: c, index: r });
|
|
301
|
+
}
|
|
302
|
+
), be = d.forwardRef(
|
|
303
|
+
(e, t) => {
|
|
304
|
+
const { __scopeSlider: o, index: n, name: a, ...c } = e, r = K(O, o), s = Q(O, o), [l, h] = d.useState(null), S = M(t, (D) => h(D)), i = l ? r.form || !!l.closest("form") : !0, u = de(l), w = r.values[n], P = w === void 0 ? 0 : ie(w, r.min, r.max), g = xe(n, r.values.length), m = u == null ? void 0 : u[s.size], f = m ? De(m, P, s.direction) : 0;
|
|
305
|
+
return d.useEffect(() => {
|
|
306
|
+
if (l)
|
|
307
|
+
return r.thumbs.add(l), () => {
|
|
308
|
+
r.thumbs.delete(l);
|
|
309
|
+
};
|
|
310
|
+
}, [l, r.thumbs]), /* @__PURE__ */ pe(
|
|
311
|
+
"span",
|
|
312
|
+
{
|
|
313
|
+
style: {
|
|
314
|
+
transform: "var(--radix-slider-thumb-transform)",
|
|
315
|
+
position: "absolute",
|
|
316
|
+
[s.startEdge]: `calc(${P}% + ${f}px)`
|
|
317
|
+
},
|
|
318
|
+
children: [
|
|
319
|
+
/* @__PURE__ */ v(z.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(
|
|
320
|
+
B.span,
|
|
321
|
+
{
|
|
322
|
+
role: "slider",
|
|
323
|
+
"aria-label": e["aria-label"] || g,
|
|
324
|
+
"aria-valuemin": r.min,
|
|
325
|
+
"aria-valuenow": w,
|
|
326
|
+
"aria-valuemax": r.max,
|
|
327
|
+
"aria-orientation": r.orientation,
|
|
328
|
+
"data-orientation": r.orientation,
|
|
329
|
+
"data-disabled": r.disabled ? "" : void 0,
|
|
330
|
+
tabIndex: r.disabled ? void 0 : 0,
|
|
331
|
+
...c,
|
|
332
|
+
ref: S,
|
|
333
|
+
style: w === void 0 ? { display: "none" } : e.style,
|
|
334
|
+
onFocus: C(e.onFocus, () => {
|
|
335
|
+
r.valueIndexToChangeRef.current = n;
|
|
336
|
+
})
|
|
337
|
+
}
|
|
338
|
+
) }),
|
|
339
|
+
i && /* @__PURE__ */ v(
|
|
340
|
+
re,
|
|
341
|
+
{
|
|
342
|
+
name: a ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
|
|
343
|
+
form: r.form,
|
|
344
|
+
value: w
|
|
345
|
+
},
|
|
346
|
+
n
|
|
347
|
+
)
|
|
348
|
+
]
|
|
349
|
+
}
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
oe.displayName = O;
|
|
354
|
+
var Re = "RadioBubbleInput", re = d.forwardRef(
|
|
355
|
+
({ __scopeSlider: e, value: t, ...o }, n) => {
|
|
356
|
+
const a = d.useRef(null), c = M(a, n), r = me(t);
|
|
357
|
+
return d.useEffect(() => {
|
|
358
|
+
const s = a.current;
|
|
359
|
+
if (!s) return;
|
|
360
|
+
const l = window.HTMLInputElement.prototype, S = Object.getOwnPropertyDescriptor(l, "value").set;
|
|
361
|
+
if (r !== t && S) {
|
|
362
|
+
const i = new Event("input", { bubbles: !0 });
|
|
363
|
+
S.call(s, t), s.dispatchEvent(i);
|
|
364
|
+
}
|
|
365
|
+
}, [r, t]), /* @__PURE__ */ v(
|
|
366
|
+
B.input,
|
|
367
|
+
{
|
|
368
|
+
style: { display: "none" },
|
|
369
|
+
...o,
|
|
370
|
+
ref: c,
|
|
371
|
+
defaultValue: t
|
|
372
|
+
}
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
);
|
|
376
|
+
re.displayName = Re;
|
|
377
|
+
function Pe(e = [], t, o) {
|
|
378
|
+
const n = [...e];
|
|
379
|
+
return n[o] = t, n.sort((a, c) => a - c);
|
|
380
|
+
}
|
|
381
|
+
function ie(e, t, o) {
|
|
382
|
+
const c = 100 / (o - t) * (e - t);
|
|
383
|
+
return $(c, [0, 100]);
|
|
384
|
+
}
|
|
385
|
+
function xe(e, t) {
|
|
386
|
+
return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
|
|
387
|
+
}
|
|
388
|
+
function ye(e, t) {
|
|
389
|
+
if (e.length === 1) return 0;
|
|
390
|
+
const o = e.map((a) => Math.abs(a - t)), n = Math.min(...o);
|
|
391
|
+
return o.indexOf(n);
|
|
392
|
+
}
|
|
393
|
+
function De(e, t, o) {
|
|
394
|
+
const n = e / 2, c = U([0, 50], [0, n]);
|
|
395
|
+
return (n - c(t) * o) * o;
|
|
396
|
+
}
|
|
397
|
+
function Ee(e) {
|
|
398
|
+
return e.slice(0, -1).map((t, o) => e[o + 1] - t);
|
|
399
|
+
}
|
|
400
|
+
function _e(e, t) {
|
|
401
|
+
if (t > 0) {
|
|
402
|
+
const o = Ee(e);
|
|
403
|
+
return Math.min(...o) >= t;
|
|
404
|
+
}
|
|
405
|
+
return !0;
|
|
406
|
+
}
|
|
407
|
+
function U(e, t) {
|
|
408
|
+
return (o) => {
|
|
409
|
+
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
410
|
+
const n = (t[1] - t[0]) / (e[1] - e[0]);
|
|
411
|
+
return t[0] + n * (o - e[0]);
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
function Ce(e) {
|
|
415
|
+
return (String(e).split(".")[1] || "").length;
|
|
416
|
+
}
|
|
417
|
+
function Me(e, t) {
|
|
418
|
+
const o = Math.pow(10, t);
|
|
419
|
+
return Math.round(e * o) / o;
|
|
420
|
+
}
|
|
421
|
+
var ke = q, He = te, Ne = ne, ze = oe;
|
|
422
|
+
export {
|
|
423
|
+
ke as R,
|
|
424
|
+
He as T,
|
|
425
|
+
Ne as a,
|
|
426
|
+
ze as b
|
|
427
|
+
};
|
package/dist/main.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export { Decorate } from './components/Decorate';
|
|
|
47
47
|
export type { DecorateProps } from './components/Decorate';
|
|
48
48
|
export { Dot } from './components/Dot';
|
|
49
49
|
export type { DotProps, DotSize } from './components/Dot';
|
|
50
|
-
export { Flyout, FLYOUT_OUTLET_ID } from './components/Flyout';
|
|
50
|
+
export { Flyout, FLYOUT_OUTLET_ID, FLYOUT_ROOT_ID, FLYOUT_ROOT_SHRINK_CLASSNAME, } from './components/Flyout';
|
|
51
51
|
export type { FlyoutSize, FlyoutProps } from './components/Flyout';
|
|
52
52
|
export { Logos } from './components/Logos';
|
|
53
53
|
export type { LogoNames } from './components/Logos';
|
|
@@ -111,6 +111,8 @@ export { Shroud } from './components/Shroud';
|
|
|
111
111
|
export type { ShroudProps } from './components/Shroud';
|
|
112
112
|
export { Slider } from './components/Slider';
|
|
113
113
|
export type { SliderProps } from './components/Slider';
|
|
114
|
+
export { Range, RangeInput, RangeWithInputs, } from './components/Range';
|
|
115
|
+
export type { RangeProps, RangeInputProps, RangeWithInputsProps, } from './components/Range';
|
|
114
116
|
export { Spacer } from './components/Spacer';
|
|
115
117
|
export type { SpacerProps } from './components/Spacer';
|
|
116
118
|
export { Style, useContextualStyle } from './components/Style';
|