@drjoshcsimmons/scl 0.2.4 → 0.2.7
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/index100.js +12 -178
- package/dist/index101.js +5 -54
- package/dist/index102.js +25 -30
- package/dist/index103.js +55 -30
- package/dist/index104.js +30 -15
- package/dist/index105.js +219 -30
- package/dist/index106.js +7 -46
- package/dist/index107.js +29 -47
- package/dist/index108.js +177 -51
- package/dist/index109.js +650 -30
- package/dist/index11.js +2 -2
- package/dist/index110.js +30 -13
- package/dist/index111.js +44 -646
- package/dist/index112.js +46 -7
- package/dist/index113.js +6 -48
- package/dist/index115.js +47 -11
- package/dist/index116.js +10 -204
- package/dist/index117.js +20 -21
- package/dist/index118.js +9 -400
- package/dist/index119.js +32 -15
- package/dist/index12.js +1 -1
- package/dist/index120.js +12 -3
- package/dist/index121.js +206 -38
- package/dist/index122.js +22 -18
- package/dist/index123.js +400 -6
- package/dist/index125.js +2 -25
- package/dist/index126.js +53 -29
- package/dist/index127.js +65 -5
- package/dist/index128.js +25 -2
- package/dist/index129.js +29 -53
- package/dist/index13.js +2 -2
- package/dist/index130.js +5 -65
- package/dist/index131.js +2 -5
- package/dist/index132.js +2 -3
- package/dist/index133.js +5 -24
- package/dist/index134.js +3 -113
- package/dist/index135.js +23 -15
- package/dist/index136.js +107 -519
- package/dist/index137.js +14 -126
- package/dist/index138.js +516 -125
- package/dist/index139.js +128 -2
- package/dist/index14.js +2 -2
- package/dist/index140.js +134 -2
- package/dist/index141.js +1 -1
- package/dist/index145.js +1 -1
- package/dist/index15.js +2 -2
- package/dist/index17.js +4 -4
- package/dist/index18.js +2 -2
- package/dist/index20.js +1 -1
- package/dist/index21.js +1 -1
- package/dist/index22.js +1 -1
- package/dist/index23.js +2 -2
- package/dist/index24.js +1 -1
- package/dist/index25.js +3 -3
- package/dist/index26.js +1 -1
- package/dist/index27.js +2 -2
- package/dist/index29.js +1 -1
- package/dist/index31.js +1 -1
- package/dist/index33.js +1 -1
- package/dist/index36.js +1 -1
- package/dist/index37.js +1 -1
- package/dist/index45.js +1 -1
- package/dist/index46.js +1 -1
- package/dist/index48.js +70 -57
- package/dist/index49.js +114 -107
- package/dist/index50.js +517 -112
- package/dist/index51.js +227 -402
- package/dist/index52.js +12 -860
- package/dist/index53.js +60 -9
- package/dist/index54.js +18 -9
- package/dist/index55.js +12 -130
- package/dist/index56.js +9 -530
- package/dist/index57.js +302 -153
- package/dist/index58.js +12 -82
- package/dist/index59.js +80 -16
- package/dist/index6.js +1 -1
- package/dist/index60.js +91 -197
- package/dist/index61.js +435 -11
- package/dist/index62.js +245 -27
- package/dist/index63.js +215 -300
- package/dist/index64.js +3 -4
- package/dist/index65.js +11 -260
- package/dist/index66.js +336 -12
- package/dist/index67.js +160 -21
- package/dist/index68.js +18 -221
- package/dist/index69.js +860 -11
- package/dist/index7.js +1 -1
- package/dist/index70.js +9 -241
- package/dist/index71.js +30 -72
- package/dist/index72.js +254 -12
- package/dist/index73.js +212 -225
- package/dist/index74.js +103 -321
- package/dist/index75.js +235 -248
- package/dist/index77.js +1 -1
- package/dist/index80.js +1 -1
- package/dist/index81.js +1 -1
- package/dist/index82.js +1 -1
- package/dist/index84.js +55 -4
- package/dist/index85.js +10 -68
- package/dist/index86.js +4 -9
- package/dist/index87.js +30 -4
- package/dist/index88.js +12 -5
- package/dist/index89.js +8 -24
- package/dist/index9.js +1 -1
- package/dist/index90.js +64 -120
- package/dist/index91.js +3 -14
- package/dist/index92.js +115 -125
- package/dist/index93.js +128 -212
- package/dist/index94.js +1 -1
- package/dist/index95.js +13 -46
- package/dist/index96.js +8 -10
- package/dist/index97.js +50 -30
- package/dist/index98.js +47 -49
- package/dist/index99.js +30 -9
- package/package.json +5 -3
package/dist/index51.js
CHANGED
|
@@ -1,437 +1,262 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { useControllableState as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
}), k = d.useRef(p);
|
|
47
|
-
function H(R) {
|
|
48
|
-
const x = ye(p, R);
|
|
49
|
-
V(R, x);
|
|
50
|
-
}
|
|
51
|
-
function se(R) {
|
|
52
|
-
V(R, f.current);
|
|
53
|
-
}
|
|
54
|
-
function ae() {
|
|
55
|
-
const R = k.current[f.current];
|
|
56
|
-
p[f.current] !== R && u(p);
|
|
57
|
-
}
|
|
58
|
-
function V(R, x, { commit: E } = { commit: !1 }) {
|
|
59
|
-
const F = Ce(c), N = Me(Math.round((R - n) / c) * c + n, F), B = $(N, [n, a]);
|
|
60
|
-
A((_ = []) => {
|
|
61
|
-
const y = Pe(_, B, x);
|
|
62
|
-
if (_e(y, l * c)) {
|
|
63
|
-
f.current = y.indexOf(B);
|
|
64
|
-
const Y = String(y) !== String(_);
|
|
65
|
-
return Y && E && u(y), Y ? y : _;
|
|
66
|
-
} else
|
|
67
|
-
return _;
|
|
68
|
-
});
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import { composeEventHandlers as p } from "./index79.js";
|
|
3
|
+
import { useComposedRefs as _ } from "./index78.js";
|
|
4
|
+
import { createContextScope as V, createContext as q } from "./index76.js";
|
|
5
|
+
import { useId as R } from "./index82.js";
|
|
6
|
+
import { useControllableState as K } from "./index80.js";
|
|
7
|
+
import { DismissableLayer as U } from "./index92.js";
|
|
8
|
+
import { FocusScope as Y } from "./index93.js";
|
|
9
|
+
import { Portal as Z } from "./index94.js";
|
|
10
|
+
import { Presence as h } from "./index90.js";
|
|
11
|
+
import { Primitive as m } from "./index81.js";
|
|
12
|
+
import { useFocusGuards as z } from "./index95.js";
|
|
13
|
+
import J from "./index96.js";
|
|
14
|
+
import { hideOthers as Q } from "./index97.js";
|
|
15
|
+
import { createSlot as X } from "./index98.js";
|
|
16
|
+
import { jsx as i, jsxs as P, Fragment as O } from "react/jsx-runtime";
|
|
17
|
+
var v = "Dialog", [I, Ne] = V(v), [ee, u] = I(v), x = (e) => {
|
|
18
|
+
const {
|
|
19
|
+
__scopeDialog: o,
|
|
20
|
+
children: n,
|
|
21
|
+
open: a,
|
|
22
|
+
defaultOpen: r,
|
|
23
|
+
onOpenChange: t,
|
|
24
|
+
modal: c = !0
|
|
25
|
+
} = e, l = s.useRef(null), d = s.useRef(null), [g, C] = K({
|
|
26
|
+
prop: a,
|
|
27
|
+
defaultProp: r ?? !1,
|
|
28
|
+
onChange: t,
|
|
29
|
+
caller: v
|
|
30
|
+
});
|
|
31
|
+
return /* @__PURE__ */ i(
|
|
32
|
+
ee,
|
|
33
|
+
{
|
|
34
|
+
scope: o,
|
|
35
|
+
triggerRef: l,
|
|
36
|
+
contentRef: d,
|
|
37
|
+
contentId: R(),
|
|
38
|
+
titleId: R(),
|
|
39
|
+
descriptionId: R(),
|
|
40
|
+
open: g,
|
|
41
|
+
onOpenChange: C,
|
|
42
|
+
onOpenToggle: s.useCallback(() => C((H) => !H), [C]),
|
|
43
|
+
modal: c,
|
|
44
|
+
children: n
|
|
69
45
|
}
|
|
70
|
-
|
|
71
|
-
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
x.displayName = v;
|
|
49
|
+
var A = "DialogTrigger", T = s.forwardRef(
|
|
50
|
+
(e, o) => {
|
|
51
|
+
const { __scopeDialog: n, ...a } = e, r = u(A, n), t = _(o, r.triggerRef);
|
|
52
|
+
return /* @__PURE__ */ i(
|
|
53
|
+
m.button,
|
|
72
54
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
orientation: r,
|
|
82
|
-
form: P,
|
|
83
|
-
children: /* @__PURE__ */ v(z.Provider, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(z.Slot, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(
|
|
84
|
-
b,
|
|
85
|
-
{
|
|
86
|
-
"aria-disabled": s,
|
|
87
|
-
"data-disabled": s ? "" : void 0,
|
|
88
|
-
...g,
|
|
89
|
-
ref: t,
|
|
90
|
-
onPointerDown: C(g.onPointerDown, () => {
|
|
91
|
-
s || (k.current = p);
|
|
92
|
-
}),
|
|
93
|
-
min: n,
|
|
94
|
-
max: a,
|
|
95
|
-
inverted: w,
|
|
96
|
-
onSlideStart: s ? void 0 : H,
|
|
97
|
-
onSlideMove: s ? void 0 : se,
|
|
98
|
-
onSlideEnd: s ? void 0 : ae,
|
|
99
|
-
onHomeKeyDown: () => !s && V(n, 0, { commit: !0 }),
|
|
100
|
-
onEndKeyDown: () => !s && V(a, p.length - 1, { commit: !0 }),
|
|
101
|
-
onStepKeyDown: ({ event: R, direction: x }) => {
|
|
102
|
-
if (!s) {
|
|
103
|
-
const N = j.includes(R.key) || R.shiftKey && X.includes(R.key) ? 10 : 1, B = f.current, _ = p[B], y = c * N * x;
|
|
104
|
-
V(_ + y, B, { commit: !0 });
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
) }) })
|
|
55
|
+
type: "button",
|
|
56
|
+
"aria-haspopup": "dialog",
|
|
57
|
+
"aria-expanded": r.open,
|
|
58
|
+
"aria-controls": r.contentId,
|
|
59
|
+
"data-state": N(r.open),
|
|
60
|
+
...a,
|
|
61
|
+
ref: t,
|
|
62
|
+
onClick: p(e.onClick, r.onOpenToggle)
|
|
109
63
|
}
|
|
110
64
|
);
|
|
111
65
|
}
|
|
112
66
|
);
|
|
113
|
-
|
|
114
|
-
var [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
inverted: c,
|
|
126
|
-
onSlideStart: r,
|
|
127
|
-
onSlideMove: s,
|
|
128
|
-
onSlideEnd: l,
|
|
129
|
-
onStepKeyDown: h,
|
|
130
|
-
...S
|
|
131
|
-
} = e, [i, u] = d.useState(null), w = M(t, (b) => u(b)), P = d.useRef(void 0), g = de(a), m = g === "ltr", f = m && !c || !m && c;
|
|
132
|
-
function D(b) {
|
|
133
|
-
const p = P.current || i.getBoundingClientRect(), A = [0, p.width], H = U(A, f ? [o, n] : [n, o]);
|
|
134
|
-
return P.current = p, H(b - p.left);
|
|
135
|
-
}
|
|
136
|
-
return /* @__PURE__ */ v(
|
|
137
|
-
J,
|
|
138
|
-
{
|
|
139
|
-
scope: e.__scopeSlider,
|
|
140
|
-
startEdge: f ? "left" : "right",
|
|
141
|
-
endEdge: f ? "right" : "left",
|
|
142
|
-
direction: f ? 1 : -1,
|
|
143
|
-
size: "width",
|
|
144
|
-
children: /* @__PURE__ */ v(
|
|
145
|
-
Z,
|
|
146
|
-
{
|
|
147
|
-
dir: g,
|
|
148
|
-
"data-orientation": "horizontal",
|
|
149
|
-
...S,
|
|
150
|
-
ref: w,
|
|
151
|
-
style: {
|
|
152
|
-
...S.style,
|
|
153
|
-
"--radix-slider-thumb-transform": "translateX(-50%)"
|
|
154
|
-
},
|
|
155
|
-
onSlideStart: (b) => {
|
|
156
|
-
const p = D(b.clientX);
|
|
157
|
-
r == null || r(p);
|
|
158
|
-
},
|
|
159
|
-
onSlideMove: (b) => {
|
|
160
|
-
const p = D(b.clientX);
|
|
161
|
-
s == null || s(p);
|
|
162
|
-
},
|
|
163
|
-
onSlideEnd: () => {
|
|
164
|
-
P.current = void 0, l == null || l();
|
|
165
|
-
},
|
|
166
|
-
onStepKeyDown: (b) => {
|
|
167
|
-
const A = G[f ? "from-left" : "from-right"].includes(b.key);
|
|
168
|
-
h == null || h({ event: b, direction: A ? -1 : 1 });
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
)
|
|
172
|
-
}
|
|
173
|
-
);
|
|
67
|
+
T.displayName = A;
|
|
68
|
+
var E = "DialogPortal", [te, b] = I(E, {
|
|
69
|
+
forceMount: void 0
|
|
70
|
+
}), M = (e) => {
|
|
71
|
+
const { __scopeDialog: o, forceMount: n, children: a, container: r } = e, t = u(E, o);
|
|
72
|
+
return /* @__PURE__ */ i(te, { scope: o, forceMount: n, children: s.Children.map(a, (c) => /* @__PURE__ */ i(h, { present: n || t.open, children: /* @__PURE__ */ i(Z, { asChild: !0, container: r, children: c }) })) });
|
|
73
|
+
};
|
|
74
|
+
M.displayName = E;
|
|
75
|
+
var D = "DialogOverlay", w = s.forwardRef(
|
|
76
|
+
(e, o) => {
|
|
77
|
+
const n = b(D, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, t = u(D, e.__scopeDialog);
|
|
78
|
+
return t.modal ? /* @__PURE__ */ i(h, { present: a || t.open, children: /* @__PURE__ */ i(re, { ...r, ref: o }) }) : null;
|
|
174
79
|
}
|
|
175
|
-
)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
J,
|
|
193
|
-
{
|
|
194
|
-
scope: e.__scopeSlider,
|
|
195
|
-
startEdge: w ? "bottom" : "top",
|
|
196
|
-
endEdge: w ? "top" : "bottom",
|
|
197
|
-
size: "height",
|
|
198
|
-
direction: w ? 1 : -1,
|
|
199
|
-
children: /* @__PURE__ */ v(
|
|
200
|
-
Z,
|
|
201
|
-
{
|
|
202
|
-
"data-orientation": "vertical",
|
|
203
|
-
...h,
|
|
204
|
-
ref: i,
|
|
205
|
-
style: {
|
|
206
|
-
...h.style,
|
|
207
|
-
"--radix-slider-thumb-transform": "translateY(50%)"
|
|
208
|
-
},
|
|
209
|
-
onSlideStart: (g) => {
|
|
210
|
-
const m = P(g.clientY);
|
|
211
|
-
c == null || c(m);
|
|
212
|
-
},
|
|
213
|
-
onSlideMove: (g) => {
|
|
214
|
-
const m = P(g.clientY);
|
|
215
|
-
r == null || r(m);
|
|
216
|
-
},
|
|
217
|
-
onSlideEnd: () => {
|
|
218
|
-
u.current = void 0, s == null || s();
|
|
219
|
-
},
|
|
220
|
-
onStepKeyDown: (g) => {
|
|
221
|
-
const f = G[w ? "from-bottom" : "from-top"].includes(g.key);
|
|
222
|
-
l == null || l({ event: g, direction: f ? -1 : 1 });
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
)
|
|
226
|
-
}
|
|
80
|
+
);
|
|
81
|
+
w.displayName = D;
|
|
82
|
+
var oe = X("DialogOverlay.RemoveScroll"), re = s.forwardRef(
|
|
83
|
+
(e, o) => {
|
|
84
|
+
const { __scopeDialog: n, ...a } = e, r = u(D, n);
|
|
85
|
+
return (
|
|
86
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
87
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
88
|
+
/* @__PURE__ */ i(J, { as: oe, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
|
|
89
|
+
m.div,
|
|
90
|
+
{
|
|
91
|
+
"data-state": N(r.open),
|
|
92
|
+
...a,
|
|
93
|
+
ref: o,
|
|
94
|
+
style: { pointerEvents: "auto", ...a.style }
|
|
95
|
+
}
|
|
96
|
+
) })
|
|
227
97
|
);
|
|
228
98
|
}
|
|
229
|
-
),
|
|
230
|
-
(e,
|
|
231
|
-
const {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
99
|
+
), f = "DialogContent", S = s.forwardRef(
|
|
100
|
+
(e, o) => {
|
|
101
|
+
const n = b(f, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, t = u(f, e.__scopeDialog);
|
|
102
|
+
return /* @__PURE__ */ i(h, { present: a || t.open, children: t.modal ? /* @__PURE__ */ i(ne, { ...r, ref: o }) : /* @__PURE__ */ i(ae, { ...r, ref: o }) });
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
S.displayName = f;
|
|
106
|
+
var ne = s.forwardRef(
|
|
107
|
+
(e, o) => {
|
|
108
|
+
const n = u(f, e.__scopeDialog), a = s.useRef(null), r = _(o, n.contentRef, a);
|
|
109
|
+
return s.useEffect(() => {
|
|
110
|
+
const t = a.current;
|
|
111
|
+
if (t) return Q(t);
|
|
112
|
+
}, []), /* @__PURE__ */ i(
|
|
113
|
+
F,
|
|
243
114
|
{
|
|
244
|
-
...
|
|
245
|
-
ref:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
u.setPointerCapture(i.pointerId), i.preventDefault(), S.thumbs.has(u) ? u.focus() : n(i);
|
|
115
|
+
...e,
|
|
116
|
+
ref: r,
|
|
117
|
+
trapFocus: n.open,
|
|
118
|
+
disableOutsidePointerEvents: !0,
|
|
119
|
+
onCloseAutoFocus: p(e.onCloseAutoFocus, (t) => {
|
|
120
|
+
var c;
|
|
121
|
+
t.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
|
|
252
122
|
}),
|
|
253
|
-
|
|
254
|
-
|
|
123
|
+
onPointerDownOutside: p(e.onPointerDownOutside, (t) => {
|
|
124
|
+
const c = t.detail.originalEvent, l = c.button === 0 && c.ctrlKey === !0;
|
|
125
|
+
(c.button === 2 || l) && t.preventDefault();
|
|
255
126
|
}),
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
);
|
|
262
|
-
}
|
|
263
|
-
), ee = "SliderTrack", te = d.forwardRef(
|
|
264
|
-
(e, t) => {
|
|
265
|
-
const { __scopeSlider: o, ...n } = e, a = T(ee, o);
|
|
266
|
-
return /* @__PURE__ */ v(
|
|
267
|
-
K.span,
|
|
268
|
-
{
|
|
269
|
-
"data-disabled": a.disabled ? "" : void 0,
|
|
270
|
-
"data-orientation": a.orientation,
|
|
271
|
-
...n,
|
|
272
|
-
ref: t
|
|
127
|
+
onFocusOutside: p(
|
|
128
|
+
e.onFocusOutside,
|
|
129
|
+
(t) => t.preventDefault()
|
|
130
|
+
)
|
|
273
131
|
}
|
|
274
132
|
);
|
|
275
133
|
}
|
|
276
|
-
)
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
(u) => ie(u, a.min, a.max)
|
|
282
|
-
), S = l > 1 ? Math.min(...h) : 0, i = 100 - Math.max(...h);
|
|
283
|
-
return /* @__PURE__ */ v(
|
|
284
|
-
K.span,
|
|
134
|
+
), ae = s.forwardRef(
|
|
135
|
+
(e, o) => {
|
|
136
|
+
const n = u(f, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
|
|
137
|
+
return /* @__PURE__ */ i(
|
|
138
|
+
F,
|
|
285
139
|
{
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
140
|
+
...e,
|
|
141
|
+
ref: o,
|
|
142
|
+
trapFocus: !1,
|
|
143
|
+
disableOutsidePointerEvents: !1,
|
|
144
|
+
onCloseAutoFocus: (t) => {
|
|
145
|
+
var c, l;
|
|
146
|
+
(c = e.onCloseAutoFocus) == null || c.call(e, t), t.defaultPrevented || (a.current || (l = n.triggerRef.current) == null || l.focus(), t.preventDefault()), a.current = !1, r.current = !1;
|
|
147
|
+
},
|
|
148
|
+
onInteractOutside: (t) => {
|
|
149
|
+
var d, g;
|
|
150
|
+
(d = e.onInteractOutside) == null || d.call(e, t), t.defaultPrevented || (a.current = !0, t.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
151
|
+
const c = t.target;
|
|
152
|
+
((g = n.triggerRef.current) == null ? void 0 : g.contains(c)) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && r.current && t.preventDefault();
|
|
294
153
|
}
|
|
295
154
|
}
|
|
296
155
|
);
|
|
297
156
|
}
|
|
298
|
-
)
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
if (l)
|
|
313
|
-
return r.thumbs.add(l), () => {
|
|
314
|
-
r.thumbs.delete(l);
|
|
315
|
-
};
|
|
316
|
-
}, [l, r.thumbs]), /* @__PURE__ */ pe(
|
|
317
|
-
"span",
|
|
318
|
-
{
|
|
319
|
-
style: {
|
|
320
|
-
transform: "var(--radix-slider-thumb-transform)",
|
|
321
|
-
position: "absolute",
|
|
322
|
-
[s.startEdge]: `calc(${P}% + ${f}px)`
|
|
323
|
-
},
|
|
324
|
-
children: [
|
|
325
|
-
/* @__PURE__ */ v(z.ItemSlot, { scope: e.__scopeSlider, children: /* @__PURE__ */ v(
|
|
326
|
-
K.span,
|
|
157
|
+
), F = s.forwardRef(
|
|
158
|
+
(e, o) => {
|
|
159
|
+
const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: t, ...c } = e, l = u(f, n), d = s.useRef(null), g = _(o, d);
|
|
160
|
+
return z(), /* @__PURE__ */ P(O, { children: [
|
|
161
|
+
/* @__PURE__ */ i(
|
|
162
|
+
Y,
|
|
163
|
+
{
|
|
164
|
+
asChild: !0,
|
|
165
|
+
loop: !0,
|
|
166
|
+
trapped: a,
|
|
167
|
+
onMountAutoFocus: r,
|
|
168
|
+
onUnmountAutoFocus: t,
|
|
169
|
+
children: /* @__PURE__ */ i(
|
|
170
|
+
U,
|
|
327
171
|
{
|
|
328
|
-
role: "
|
|
329
|
-
|
|
330
|
-
"aria-
|
|
331
|
-
"aria-
|
|
332
|
-
"
|
|
333
|
-
"aria-orientation": r.orientation,
|
|
334
|
-
"data-orientation": r.orientation,
|
|
335
|
-
"data-disabled": r.disabled ? "" : void 0,
|
|
336
|
-
tabIndex: r.disabled ? void 0 : 0,
|
|
172
|
+
role: "dialog",
|
|
173
|
+
id: l.contentId,
|
|
174
|
+
"aria-describedby": l.descriptionId,
|
|
175
|
+
"aria-labelledby": l.titleId,
|
|
176
|
+
"data-state": N(l.open),
|
|
337
177
|
...c,
|
|
338
|
-
ref:
|
|
339
|
-
|
|
340
|
-
onFocus: C(e.onFocus, () => {
|
|
341
|
-
r.valueIndexToChangeRef.current = n;
|
|
342
|
-
})
|
|
178
|
+
ref: g,
|
|
179
|
+
onDismiss: () => l.onOpenChange(!1)
|
|
343
180
|
}
|
|
344
|
-
) }),
|
|
345
|
-
i && /* @__PURE__ */ v(
|
|
346
|
-
re,
|
|
347
|
-
{
|
|
348
|
-
name: a ?? (r.name ? r.name + (r.values.length > 1 ? "[]" : "") : void 0),
|
|
349
|
-
form: r.form,
|
|
350
|
-
value: w
|
|
351
|
-
},
|
|
352
|
-
n
|
|
353
181
|
)
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
/* @__PURE__ */ P(O, { children: [
|
|
185
|
+
/* @__PURE__ */ i(ie, { titleId: l.titleId }),
|
|
186
|
+
/* @__PURE__ */ i(ce, { contentRef: d, descriptionId: l.descriptionId })
|
|
187
|
+
] })
|
|
188
|
+
] });
|
|
189
|
+
}
|
|
190
|
+
), y = "DialogTitle", W = s.forwardRef(
|
|
191
|
+
(e, o) => {
|
|
192
|
+
const { __scopeDialog: n, ...a } = e, r = u(y, n);
|
|
193
|
+
return /* @__PURE__ */ i(m.h2, { id: r.titleId, ...a, ref: o });
|
|
357
194
|
}
|
|
358
195
|
);
|
|
359
|
-
|
|
360
|
-
var
|
|
361
|
-
(
|
|
362
|
-
const
|
|
363
|
-
return
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
K.input,
|
|
196
|
+
W.displayName = y;
|
|
197
|
+
var k = "DialogDescription", G = s.forwardRef(
|
|
198
|
+
(e, o) => {
|
|
199
|
+
const { __scopeDialog: n, ...a } = e, r = u(k, n);
|
|
200
|
+
return /* @__PURE__ */ i(m.p, { id: r.descriptionId, ...a, ref: o });
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
G.displayName = k;
|
|
204
|
+
var L = "DialogClose", $ = s.forwardRef(
|
|
205
|
+
(e, o) => {
|
|
206
|
+
const { __scopeDialog: n, ...a } = e, r = u(L, n);
|
|
207
|
+
return /* @__PURE__ */ i(
|
|
208
|
+
m.button,
|
|
373
209
|
{
|
|
374
|
-
|
|
375
|
-
...
|
|
376
|
-
ref:
|
|
377
|
-
|
|
210
|
+
type: "button",
|
|
211
|
+
...a,
|
|
212
|
+
ref: o,
|
|
213
|
+
onClick: p(e.onClick, () => r.onOpenChange(!1))
|
|
378
214
|
}
|
|
379
215
|
);
|
|
380
216
|
}
|
|
381
217
|
);
|
|
382
|
-
|
|
383
|
-
function
|
|
384
|
-
|
|
385
|
-
return n[o] = t, n.sort((a, c) => a - c);
|
|
386
|
-
}
|
|
387
|
-
function ie(e, t, o) {
|
|
388
|
-
const c = 100 / (o - t) * (e - t);
|
|
389
|
-
return $(c, [0, 100]);
|
|
390
|
-
}
|
|
391
|
-
function xe(e, t) {
|
|
392
|
-
return t > 2 ? `Value ${e + 1} of ${t}` : t === 2 ? ["Minimum", "Maximum"][e] : void 0;
|
|
393
|
-
}
|
|
394
|
-
function ye(e, t) {
|
|
395
|
-
if (e.length === 1) return 0;
|
|
396
|
-
const o = e.map((a) => Math.abs(a - t)), n = Math.min(...o);
|
|
397
|
-
return o.indexOf(n);
|
|
398
|
-
}
|
|
399
|
-
function De(e, t, o) {
|
|
400
|
-
const n = e / 2, c = U([0, 50], [0, n]);
|
|
401
|
-
return (n - c(t) * o) * o;
|
|
402
|
-
}
|
|
403
|
-
function Ee(e) {
|
|
404
|
-
return e.slice(0, -1).map((t, o) => e[o + 1] - t);
|
|
405
|
-
}
|
|
406
|
-
function _e(e, t) {
|
|
407
|
-
if (t > 0) {
|
|
408
|
-
const o = Ee(e);
|
|
409
|
-
return Math.min(...o) >= t;
|
|
410
|
-
}
|
|
411
|
-
return !0;
|
|
412
|
-
}
|
|
413
|
-
function U(e, t) {
|
|
414
|
-
return (o) => {
|
|
415
|
-
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
416
|
-
const n = (t[1] - t[0]) / (e[1] - e[0]);
|
|
417
|
-
return t[0] + n * (o - e[0]);
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
function Ce(e) {
|
|
421
|
-
return (String(e).split(".")[1] || "").length;
|
|
422
|
-
}
|
|
423
|
-
function Me(e, t) {
|
|
424
|
-
const o = Math.pow(10, t);
|
|
425
|
-
return Math.round(e * o) / o;
|
|
218
|
+
$.displayName = L;
|
|
219
|
+
function N(e) {
|
|
220
|
+
return e ? "open" : "closed";
|
|
426
221
|
}
|
|
427
|
-
var
|
|
222
|
+
var B = "DialogTitleWarning", [Pe, j] = q(B, {
|
|
223
|
+
contentName: f,
|
|
224
|
+
titleName: y,
|
|
225
|
+
docsSlug: "dialog"
|
|
226
|
+
}), ie = ({ titleId: e }) => {
|
|
227
|
+
const o = j(B), n = `\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
|
|
228
|
+
|
|
229
|
+
If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
230
|
+
|
|
231
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;
|
|
232
|
+
return s.useEffect(() => {
|
|
233
|
+
e && (document.getElementById(e) || console.error(n));
|
|
234
|
+
}, [n, e]), null;
|
|
235
|
+
}, se = "DialogDescriptionWarning", ce = ({ contentRef: e, descriptionId: o }) => {
|
|
236
|
+
const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${j(se).contentName}}.`;
|
|
237
|
+
return s.useEffect(() => {
|
|
238
|
+
var t;
|
|
239
|
+
const r = (t = e.current) == null ? void 0 : t.getAttribute("aria-describedby");
|
|
240
|
+
o && r && (document.getElementById(o) || console.warn(a));
|
|
241
|
+
}, [a, e, o]), null;
|
|
242
|
+
}, Oe = x, Ie = T, xe = M, Ae = w, Te = S, be = W, Me = G, we = $;
|
|
428
243
|
export {
|
|
429
|
-
|
|
244
|
+
we as Close,
|
|
245
|
+
Te as Content,
|
|
246
|
+
Me as Description,
|
|
247
|
+
x as Dialog,
|
|
248
|
+
$ as DialogClose,
|
|
249
|
+
S as DialogContent,
|
|
250
|
+
G as DialogDescription,
|
|
251
|
+
w as DialogOverlay,
|
|
252
|
+
M as DialogPortal,
|
|
253
|
+
W as DialogTitle,
|
|
254
|
+
T as DialogTrigger,
|
|
255
|
+
Ae as Overlay,
|
|
256
|
+
xe as Portal,
|
|
430
257
|
Oe as Root,
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
Ye as Thumb,
|
|
436
|
-
Ue as Track
|
|
258
|
+
be as Title,
|
|
259
|
+
Ie as Trigger,
|
|
260
|
+
Pe as WarningProvider,
|
|
261
|
+
Ne as createDialogScope
|
|
437
262
|
};
|