@purpurds/radio-card-group 8.8.0 → 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/LICENSE.txt +3 -3
- package/dist/radio-card-group.cjs.js +1 -17
- package/dist/radio-card-group.cjs.js.map +1 -1
- package/dist/radio-card-group.es.js +356 -387
- package/dist/radio-card-group.es.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +26 -26
- package/src/radio-card-group.test.tsx +9 -5
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as d, jsxs as E, Fragment as ze } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import
|
|
3
|
+
import P, { useState as Ue, forwardRef as le, isValidElement as je, Children as ne, cloneElement as Ve } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
function Ke(e) {
|
|
6
6
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
7
7
|
}
|
|
8
|
-
var oe = { exports: {} };
|
|
9
|
-
/*!
|
|
10
|
-
Copyright (c) 2018 Jed Watson.
|
|
11
|
-
Licensed under the MIT License (MIT), see
|
|
12
|
-
http://jedwatson.github.io/classnames
|
|
13
|
-
*/
|
|
14
|
-
var ae;
|
|
8
|
+
var oe = { exports: {} }, ae;
|
|
15
9
|
function Be() {
|
|
16
10
|
return ae || (ae = 1, (function(e) {
|
|
17
11
|
(function() {
|
|
18
12
|
var t = {}.hasOwnProperty;
|
|
19
13
|
function n() {
|
|
20
|
-
for (var r = "",
|
|
21
|
-
var u = arguments[
|
|
22
|
-
u && (r =
|
|
14
|
+
for (var r = "", o = 0; o < arguments.length; o++) {
|
|
15
|
+
var u = arguments[o];
|
|
16
|
+
u && (r = i(r, a(u)));
|
|
23
17
|
}
|
|
24
18
|
return r;
|
|
25
19
|
}
|
|
@@ -32,20 +26,20 @@ function Be() {
|
|
|
32
26
|
return n.apply(null, r);
|
|
33
27
|
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
34
28
|
return r.toString();
|
|
35
|
-
var
|
|
29
|
+
var o = "";
|
|
36
30
|
for (var u in r)
|
|
37
|
-
t.call(r, u) && r[u] && (
|
|
38
|
-
return
|
|
31
|
+
t.call(r, u) && r[u] && (o = i(o, u));
|
|
32
|
+
return o;
|
|
39
33
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
34
|
+
function i(r, o) {
|
|
35
|
+
return o ? r ? r + " " + o : r + o : r;
|
|
42
36
|
}
|
|
43
37
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
44
38
|
})();
|
|
45
39
|
})(oe)), oe.exports;
|
|
46
40
|
}
|
|
47
41
|
var We = Be();
|
|
48
|
-
const
|
|
42
|
+
const He = /* @__PURE__ */ Ke(We), F = {
|
|
49
43
|
"purpur-heading": "_purpur-heading_vo751_1",
|
|
50
44
|
"purpur-heading--hyphens": "_purpur-heading--hyphens_vo751_8",
|
|
51
45
|
"purpur-heading--negative": "_purpur-heading--negative_vo751_11",
|
|
@@ -65,33 +59,33 @@ const qe = /* @__PURE__ */ Ke(We), k = {
|
|
|
65
59
|
"purpur-heading--display-50": "_purpur-heading--display-50_vo751_92",
|
|
66
60
|
"purpur-heading--display-100": "_purpur-heading--display-100_vo751_98",
|
|
67
61
|
"purpur-heading--display-200": "_purpur-heading--display-200_vo751_104"
|
|
68
|
-
},
|
|
62
|
+
}, qe = {
|
|
69
63
|
TITLE100: "title-100"
|
|
70
64
|
}, D = "purpur-heading", fe = ({
|
|
71
65
|
children: e,
|
|
72
66
|
className: t = "",
|
|
73
67
|
enableHyphenation: n = !1,
|
|
74
68
|
negative: a = !1,
|
|
75
|
-
tag:
|
|
76
|
-
variant: r =
|
|
77
|
-
...
|
|
69
|
+
tag: i,
|
|
70
|
+
variant: r = qe.TITLE100,
|
|
71
|
+
...o
|
|
78
72
|
}) => {
|
|
79
|
-
const u =
|
|
73
|
+
const u = i, p = He([
|
|
80
74
|
t,
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
F[D],
|
|
76
|
+
F[`${D}--${r}`],
|
|
83
77
|
{
|
|
84
|
-
[
|
|
85
|
-
[
|
|
78
|
+
[F[`${D}--hyphens`]]: n,
|
|
79
|
+
[F[`${D}--negative`]]: a
|
|
86
80
|
}
|
|
87
81
|
]);
|
|
88
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ d(u, { className: p, ...o, children: e });
|
|
89
83
|
};
|
|
90
84
|
fe.displayName = "Heading";
|
|
91
|
-
function
|
|
92
|
-
return function(
|
|
93
|
-
if (e
|
|
94
|
-
return t
|
|
85
|
+
function A(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
86
|
+
return function(i) {
|
|
87
|
+
if (e?.(i), n === !1 || !i.defaultPrevented)
|
|
88
|
+
return t?.(i);
|
|
95
89
|
};
|
|
96
90
|
}
|
|
97
91
|
function ie(e, t) {
|
|
@@ -99,96 +93,94 @@ function ie(e, t) {
|
|
|
99
93
|
return e(t);
|
|
100
94
|
e != null && (e.current = t);
|
|
101
95
|
}
|
|
102
|
-
function
|
|
96
|
+
function me(...e) {
|
|
103
97
|
return (t) => {
|
|
104
98
|
let n = !1;
|
|
105
|
-
const a = e.map((
|
|
106
|
-
const r = ie(
|
|
99
|
+
const a = e.map((i) => {
|
|
100
|
+
const r = ie(i, t);
|
|
107
101
|
return !n && typeof r == "function" && (n = !0), r;
|
|
108
102
|
});
|
|
109
103
|
if (n)
|
|
110
104
|
return () => {
|
|
111
|
-
for (let
|
|
112
|
-
const r = a[
|
|
113
|
-
typeof r == "function" ? r() : ie(e[
|
|
105
|
+
for (let i = 0; i < a.length; i++) {
|
|
106
|
+
const r = a[i];
|
|
107
|
+
typeof r == "function" ? r() : ie(e[i], null);
|
|
114
108
|
}
|
|
115
109
|
};
|
|
116
110
|
};
|
|
117
111
|
}
|
|
118
112
|
function T(...e) {
|
|
119
|
-
return s.useCallback(
|
|
113
|
+
return s.useCallback(me(...e), e);
|
|
120
114
|
}
|
|
121
115
|
function j(e, t = []) {
|
|
122
116
|
let n = [];
|
|
123
|
-
function a(r,
|
|
124
|
-
const u = s.createContext(
|
|
125
|
-
n = [...n,
|
|
126
|
-
const c = (
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
return /* @__PURE__ */ l(h.Provider, { value: v, children: d });
|
|
117
|
+
function a(r, o) {
|
|
118
|
+
const u = s.createContext(o), p = n.length;
|
|
119
|
+
n = [...n, o];
|
|
120
|
+
const c = (l) => {
|
|
121
|
+
const { scope: g, children: m, ..._ } = l, h = g?.[e]?.[p] || u, v = s.useMemo(() => _, Object.values(_));
|
|
122
|
+
return /* @__PURE__ */ d(h.Provider, { value: v, children: m });
|
|
130
123
|
};
|
|
131
124
|
c.displayName = r + "Provider";
|
|
132
|
-
function
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if (
|
|
136
|
-
|
|
137
|
-
throw new Error(`\`${f}\` must be used within \`${r}\``);
|
|
125
|
+
function f(l, g) {
|
|
126
|
+
const m = g?.[e]?.[p] || u, _ = s.useContext(m);
|
|
127
|
+
if (_) return _;
|
|
128
|
+
if (o !== void 0) return o;
|
|
129
|
+
throw new Error(`\`${l}\` must be used within \`${r}\``);
|
|
138
130
|
}
|
|
139
|
-
return [c,
|
|
131
|
+
return [c, f];
|
|
140
132
|
}
|
|
141
|
-
const
|
|
142
|
-
const r = n.map((
|
|
133
|
+
const i = () => {
|
|
134
|
+
const r = n.map((o) => s.createContext(o));
|
|
143
135
|
return function(u) {
|
|
144
|
-
const p =
|
|
136
|
+
const p = u?.[e] || r;
|
|
145
137
|
return s.useMemo(
|
|
146
138
|
() => ({ [`__scope${e}`]: { ...u, [e]: p } }),
|
|
147
139
|
[u, p]
|
|
148
140
|
);
|
|
149
141
|
};
|
|
150
142
|
};
|
|
151
|
-
return
|
|
143
|
+
return i.scopeName = e, [a, Ye(i, ...t)];
|
|
152
144
|
}
|
|
153
145
|
function Ye(...e) {
|
|
154
146
|
const t = e[0];
|
|
155
147
|
if (e.length === 1) return t;
|
|
156
148
|
const n = () => {
|
|
157
|
-
const a = e.map((
|
|
158
|
-
useScope:
|
|
159
|
-
scopeName:
|
|
149
|
+
const a = e.map((i) => ({
|
|
150
|
+
useScope: i(),
|
|
151
|
+
scopeName: i.scopeName
|
|
160
152
|
}));
|
|
161
153
|
return function(r) {
|
|
162
|
-
const
|
|
163
|
-
const
|
|
164
|
-
return { ...u, ...
|
|
154
|
+
const o = a.reduce((u, { useScope: p, scopeName: c }) => {
|
|
155
|
+
const l = p(r)[`__scope${c}`];
|
|
156
|
+
return { ...u, ...l };
|
|
165
157
|
}, {});
|
|
166
|
-
return s.useMemo(() => ({ [`__scope${t.scopeName}`]:
|
|
158
|
+
return s.useMemo(() => ({ [`__scope${t.scopeName}`]: o }), [o]);
|
|
167
159
|
};
|
|
168
160
|
};
|
|
169
161
|
return n.scopeName = t.scopeName, n;
|
|
170
162
|
}
|
|
171
163
|
// @__NO_SIDE_EFFECTS__
|
|
172
164
|
function Y(e) {
|
|
173
|
-
const t = /* @__PURE__ */ Xe(e), n = s.forwardRef((a,
|
|
174
|
-
const { children: r, ...
|
|
165
|
+
const t = /* @__PURE__ */ Xe(e), n = s.forwardRef((a, i) => {
|
|
166
|
+
const { children: r, ...o } = a, u = s.Children.toArray(r), p = u.find(Je);
|
|
175
167
|
if (p) {
|
|
176
|
-
const c = p.props.children,
|
|
177
|
-
return /* @__PURE__ */
|
|
168
|
+
const c = p.props.children, f = u.map((l) => l === p ? s.Children.count(c) > 1 ? s.Children.only(null) : s.isValidElement(c) ? c.props.children : null : l);
|
|
169
|
+
return /* @__PURE__ */ d(t, { ...o, ref: i, children: s.isValidElement(c) ? s.cloneElement(c, void 0, f) : null });
|
|
178
170
|
}
|
|
179
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ d(t, { ...o, ref: i, children: r });
|
|
180
172
|
});
|
|
181
173
|
return n.displayName = `${e}.Slot`, n;
|
|
182
174
|
}
|
|
183
175
|
// @__NO_SIDE_EFFECTS__
|
|
184
176
|
function Xe(e) {
|
|
185
177
|
const t = s.forwardRef((n, a) => {
|
|
186
|
-
const { children:
|
|
187
|
-
if (s.isValidElement(
|
|
188
|
-
const
|
|
189
|
-
return
|
|
178
|
+
const { children: i, ...r } = n;
|
|
179
|
+
if (s.isValidElement(i)) {
|
|
180
|
+
const o = er(i), u = Qe(r, i.props);
|
|
181
|
+
return i.type !== s.Fragment && (u.ref = a ? me(a, o) : o), s.cloneElement(i, u);
|
|
190
182
|
}
|
|
191
|
-
return s.Children.count(
|
|
183
|
+
return s.Children.count(i) > 1 ? s.Children.only(null) : null;
|
|
192
184
|
});
|
|
193
185
|
return t.displayName = `${e}.SlotClone`, t;
|
|
194
186
|
}
|
|
@@ -199,17 +191,16 @@ function Je(e) {
|
|
|
199
191
|
function Qe(e, t) {
|
|
200
192
|
const n = { ...t };
|
|
201
193
|
for (const a in t) {
|
|
202
|
-
const
|
|
203
|
-
/^on[A-Z]/.test(a) ?
|
|
204
|
-
r(...u),
|
|
205
|
-
} :
|
|
194
|
+
const i = e[a], r = t[a];
|
|
195
|
+
/^on[A-Z]/.test(a) ? i && r ? n[a] = (...u) => {
|
|
196
|
+
r(...u), i(...u);
|
|
197
|
+
} : i && (n[a] = i) : a === "style" ? n[a] = { ...i, ...r } : a === "className" && (n[a] = [i, r].filter(Boolean).join(" "));
|
|
206
198
|
}
|
|
207
199
|
return { ...e, ...n };
|
|
208
200
|
}
|
|
209
201
|
function er(e) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
202
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
203
|
+
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);
|
|
213
204
|
}
|
|
214
205
|
var rr = [
|
|
215
206
|
"a",
|
|
@@ -229,53 +220,53 @@ var rr = [
|
|
|
229
220
|
"svg",
|
|
230
221
|
"ul"
|
|
231
222
|
], M = rr.reduce((e, t) => {
|
|
232
|
-
const n = /* @__PURE__ */ Y(`Primitive.${t}`), a = s.forwardRef((
|
|
233
|
-
const { asChild:
|
|
234
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */
|
|
223
|
+
const n = /* @__PURE__ */ Y(`Primitive.${t}`), a = s.forwardRef((i, r) => {
|
|
224
|
+
const { asChild: o, ...u } = i, p = o ? n : t;
|
|
225
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ d(p, { ...u, ref: r });
|
|
235
226
|
});
|
|
236
227
|
return a.displayName = `Primitive.${t}`, { ...e, [t]: a };
|
|
237
228
|
}, {});
|
|
238
229
|
function tr(e) {
|
|
239
|
-
const t = e + "CollectionProvider", [n, a] = j(t), [
|
|
230
|
+
const t = e + "CollectionProvider", [n, a] = j(t), [i, r] = n(
|
|
240
231
|
t,
|
|
241
232
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
242
|
-
),
|
|
243
|
-
const { scope: v, children:
|
|
244
|
-
return /* @__PURE__ */
|
|
233
|
+
), o = (h) => {
|
|
234
|
+
const { scope: v, children: b } = h, y = P.useRef(null), S = P.useRef(/* @__PURE__ */ new Map()).current;
|
|
235
|
+
return /* @__PURE__ */ d(i, { scope: v, itemMap: S, collectionRef: y, children: b });
|
|
245
236
|
};
|
|
246
|
-
|
|
247
|
-
const u = e + "CollectionSlot", p = /* @__PURE__ */ Y(u), c =
|
|
237
|
+
o.displayName = t;
|
|
238
|
+
const u = e + "CollectionSlot", p = /* @__PURE__ */ Y(u), c = P.forwardRef(
|
|
248
239
|
(h, v) => {
|
|
249
|
-
const { scope:
|
|
250
|
-
return /* @__PURE__ */
|
|
240
|
+
const { scope: b, children: y } = h, S = r(u, b), N = T(v, S.collectionRef);
|
|
241
|
+
return /* @__PURE__ */ d(p, { ref: N, children: y });
|
|
251
242
|
}
|
|
252
243
|
);
|
|
253
244
|
c.displayName = u;
|
|
254
|
-
const
|
|
245
|
+
const f = e + "CollectionItemSlot", l = "data-radix-collection-item", g = /* @__PURE__ */ Y(f), m = P.forwardRef(
|
|
255
246
|
(h, v) => {
|
|
256
|
-
const { scope:
|
|
257
|
-
return
|
|
247
|
+
const { scope: b, children: y, ...S } = h, N = P.useRef(null), O = T(v, N), x = r(f, b);
|
|
248
|
+
return P.useEffect(() => (x.itemMap.set(N, { ref: N, ...S }), () => void x.itemMap.delete(N))), /* @__PURE__ */ d(g, { [l]: "", ref: O, children: y });
|
|
258
249
|
}
|
|
259
250
|
);
|
|
260
|
-
|
|
261
|
-
function
|
|
251
|
+
m.displayName = f;
|
|
252
|
+
function _(h) {
|
|
262
253
|
const v = r(e + "CollectionConsumer", h);
|
|
263
|
-
return
|
|
264
|
-
const
|
|
265
|
-
if (!
|
|
266
|
-
const
|
|
254
|
+
return P.useCallback(() => {
|
|
255
|
+
const y = v.collectionRef.current;
|
|
256
|
+
if (!y) return [];
|
|
257
|
+
const S = Array.from(y.querySelectorAll(`[${l}]`));
|
|
267
258
|
return Array.from(v.itemMap.values()).sort(
|
|
268
|
-
(x,
|
|
259
|
+
(x, k) => S.indexOf(x.ref.current) - S.indexOf(k.ref.current)
|
|
269
260
|
);
|
|
270
261
|
}, [v.collectionRef, v.itemMap]);
|
|
271
262
|
}
|
|
272
263
|
return [
|
|
273
|
-
{ Provider:
|
|
274
|
-
|
|
264
|
+
{ Provider: o, Slot: c, ItemSlot: m },
|
|
265
|
+
_,
|
|
275
266
|
a
|
|
276
267
|
];
|
|
277
268
|
}
|
|
278
|
-
var U = globalThis
|
|
269
|
+
var U = globalThis?.document ? s.useLayoutEffect : () => {
|
|
279
270
|
}, nr = s[" useId ".trim().toString()] || (() => {
|
|
280
271
|
}), or = 0;
|
|
281
272
|
function ar(e) {
|
|
@@ -288,37 +279,34 @@ function J(e) {
|
|
|
288
279
|
const t = s.useRef(e);
|
|
289
280
|
return s.useEffect(() => {
|
|
290
281
|
t.current = e;
|
|
291
|
-
}), s.useMemo(() => (...n) =>
|
|
292
|
-
var a;
|
|
293
|
-
return (a = t.current) == null ? void 0 : a.call(t, ...n);
|
|
294
|
-
}, []);
|
|
282
|
+
}), s.useMemo(() => (...n) => t.current?.(...n), []);
|
|
295
283
|
}
|
|
296
|
-
function
|
|
284
|
+
function _e({
|
|
297
285
|
prop: e,
|
|
298
286
|
defaultProp: t,
|
|
299
287
|
onChange: n = () => {
|
|
300
288
|
}
|
|
301
289
|
}) {
|
|
302
|
-
const [a,
|
|
290
|
+
const [a, i] = ir({ defaultProp: t, onChange: n }), r = e !== void 0, o = r ? e : a, u = J(n), p = s.useCallback(
|
|
303
291
|
(c) => {
|
|
304
292
|
if (r) {
|
|
305
|
-
const
|
|
306
|
-
|
|
293
|
+
const l = typeof c == "function" ? c(e) : c;
|
|
294
|
+
l !== e && u(l);
|
|
307
295
|
} else
|
|
308
|
-
|
|
296
|
+
i(c);
|
|
309
297
|
},
|
|
310
|
-
[r, e,
|
|
298
|
+
[r, e, i, u]
|
|
311
299
|
);
|
|
312
|
-
return [
|
|
300
|
+
return [o, p];
|
|
313
301
|
}
|
|
314
302
|
function ir({
|
|
315
303
|
defaultProp: e,
|
|
316
304
|
onChange: t
|
|
317
305
|
}) {
|
|
318
|
-
const n = s.useState(e), [a] = n,
|
|
306
|
+
const n = s.useState(e), [a] = n, i = s.useRef(a), r = J(t);
|
|
319
307
|
return s.useEffect(() => {
|
|
320
|
-
|
|
321
|
-
}, [a,
|
|
308
|
+
i.current !== a && (r(a), i.current = a);
|
|
309
|
+
}, [a, i, r]), n;
|
|
322
310
|
}
|
|
323
311
|
var ur = s.createContext(void 0);
|
|
324
312
|
function ge(e) {
|
|
@@ -329,76 +317,76 @@ var B = "rovingFocusGroup.onEntryFocus", sr = { bubbles: !1, cancelable: !0 }, V
|
|
|
329
317
|
V,
|
|
330
318
|
[cr]
|
|
331
319
|
), [dr, lr] = pr(V), ye = s.forwardRef(
|
|
332
|
-
(e, t) => /* @__PURE__ */
|
|
320
|
+
(e, t) => /* @__PURE__ */ d(X.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(X.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ d(fr, { ...e, ref: t }) }) })
|
|
333
321
|
);
|
|
334
322
|
ye.displayName = V;
|
|
335
323
|
var fr = s.forwardRef((e, t) => {
|
|
336
324
|
const {
|
|
337
325
|
__scopeRovingFocusGroup: n,
|
|
338
326
|
orientation: a,
|
|
339
|
-
loop:
|
|
327
|
+
loop: i = !1,
|
|
340
328
|
dir: r,
|
|
341
|
-
currentTabStopId:
|
|
329
|
+
currentTabStopId: o,
|
|
342
330
|
defaultCurrentTabStopId: u,
|
|
343
331
|
onCurrentTabStopIdChange: p,
|
|
344
332
|
onEntryFocus: c,
|
|
345
|
-
preventScrollOnEntryFocus:
|
|
346
|
-
...
|
|
347
|
-
} = e, g = s.useRef(null),
|
|
348
|
-
prop:
|
|
333
|
+
preventScrollOnEntryFocus: f = !1,
|
|
334
|
+
...l
|
|
335
|
+
} = e, g = s.useRef(null), m = T(t, g), _ = ge(r), [h = null, v] = _e({
|
|
336
|
+
prop: o,
|
|
349
337
|
defaultProp: u,
|
|
350
338
|
onChange: p
|
|
351
|
-
}), [
|
|
339
|
+
}), [b, y] = s.useState(!1), S = J(c), N = he(n), O = s.useRef(!1), [x, k] = s.useState(0);
|
|
352
340
|
return s.useEffect(() => {
|
|
353
341
|
const R = g.current;
|
|
354
342
|
if (R)
|
|
355
|
-
return R.addEventListener(B,
|
|
356
|
-
}, [
|
|
343
|
+
return R.addEventListener(B, S), () => R.removeEventListener(B, S);
|
|
344
|
+
}, [S]), /* @__PURE__ */ d(
|
|
357
345
|
dr,
|
|
358
346
|
{
|
|
359
347
|
scope: n,
|
|
360
348
|
orientation: a,
|
|
361
|
-
dir:
|
|
362
|
-
loop:
|
|
349
|
+
dir: _,
|
|
350
|
+
loop: i,
|
|
363
351
|
currentTabStopId: h,
|
|
364
352
|
onItemFocus: s.useCallback(
|
|
365
353
|
(R) => v(R),
|
|
366
354
|
[v]
|
|
367
355
|
),
|
|
368
|
-
onItemShiftTab: s.useCallback(() =>
|
|
356
|
+
onItemShiftTab: s.useCallback(() => y(!0), []),
|
|
369
357
|
onFocusableItemAdd: s.useCallback(
|
|
370
|
-
() =>
|
|
358
|
+
() => k((R) => R + 1),
|
|
371
359
|
[]
|
|
372
360
|
),
|
|
373
361
|
onFocusableItemRemove: s.useCallback(
|
|
374
|
-
() =>
|
|
362
|
+
() => k((R) => R - 1),
|
|
375
363
|
[]
|
|
376
364
|
),
|
|
377
|
-
children: /* @__PURE__ */
|
|
365
|
+
children: /* @__PURE__ */ d(
|
|
378
366
|
M.div,
|
|
379
367
|
{
|
|
380
|
-
tabIndex:
|
|
368
|
+
tabIndex: b || x === 0 ? -1 : 0,
|
|
381
369
|
"data-orientation": a,
|
|
382
|
-
...
|
|
383
|
-
ref:
|
|
370
|
+
...l,
|
|
371
|
+
ref: m,
|
|
384
372
|
style: { outline: "none", ...e.style },
|
|
385
|
-
onMouseDown:
|
|
386
|
-
|
|
373
|
+
onMouseDown: A(e.onMouseDown, () => {
|
|
374
|
+
O.current = !0;
|
|
387
375
|
}),
|
|
388
|
-
onFocus:
|
|
389
|
-
const
|
|
390
|
-
if (R.target === R.currentTarget &&
|
|
376
|
+
onFocus: A(e.onFocus, (R) => {
|
|
377
|
+
const Fe = !O.current;
|
|
378
|
+
if (R.target === R.currentTarget && Fe && !b) {
|
|
391
379
|
const te = new CustomEvent(B, sr);
|
|
392
380
|
if (R.currentTarget.dispatchEvent(te), !te.defaultPrevented) {
|
|
393
|
-
const K = N().filter((
|
|
381
|
+
const K = N().filter((w) => w.focusable), De = K.find((w) => w.active), Ge = K.find((w) => w.id === h), Le = [De, Ge, ...K].filter(
|
|
394
382
|
Boolean
|
|
395
|
-
).map((
|
|
396
|
-
|
|
383
|
+
).map((w) => w.ref.current);
|
|
384
|
+
Ce(Le, f);
|
|
397
385
|
}
|
|
398
386
|
}
|
|
399
|
-
|
|
387
|
+
O.current = !1;
|
|
400
388
|
}),
|
|
401
|
-
onBlur:
|
|
389
|
+
onBlur: A(e.onBlur, () => y(!1))
|
|
402
390
|
}
|
|
403
391
|
)
|
|
404
392
|
}
|
|
@@ -408,49 +396,49 @@ var fr = s.forwardRef((e, t) => {
|
|
|
408
396
|
const {
|
|
409
397
|
__scopeRovingFocusGroup: n,
|
|
410
398
|
focusable: a = !0,
|
|
411
|
-
active:
|
|
399
|
+
active: i = !1,
|
|
412
400
|
tabStopId: r,
|
|
413
|
-
...
|
|
414
|
-
} = e, u = ar(), p = r || u, c = lr(be, n),
|
|
401
|
+
...o
|
|
402
|
+
} = e, u = ar(), p = r || u, c = lr(be, n), f = c.currentTabStopId === p, l = he(n), { onFocusableItemAdd: g, onFocusableItemRemove: m } = c;
|
|
415
403
|
return s.useEffect(() => {
|
|
416
404
|
if (a)
|
|
417
|
-
return g(), () =>
|
|
418
|
-
}, [a, g,
|
|
405
|
+
return g(), () => m();
|
|
406
|
+
}, [a, g, m]), /* @__PURE__ */ d(
|
|
419
407
|
X.ItemSlot,
|
|
420
408
|
{
|
|
421
409
|
scope: n,
|
|
422
410
|
id: p,
|
|
423
411
|
focusable: a,
|
|
424
|
-
active:
|
|
425
|
-
children: /* @__PURE__ */
|
|
412
|
+
active: i,
|
|
413
|
+
children: /* @__PURE__ */ d(
|
|
426
414
|
M.span,
|
|
427
415
|
{
|
|
428
|
-
tabIndex:
|
|
416
|
+
tabIndex: f ? 0 : -1,
|
|
429
417
|
"data-orientation": c.orientation,
|
|
430
|
-
...
|
|
418
|
+
...o,
|
|
431
419
|
ref: t,
|
|
432
|
-
onMouseDown:
|
|
433
|
-
a ? c.onItemFocus(p) :
|
|
420
|
+
onMouseDown: A(e.onMouseDown, (_) => {
|
|
421
|
+
a ? c.onItemFocus(p) : _.preventDefault();
|
|
434
422
|
}),
|
|
435
|
-
onFocus:
|
|
436
|
-
onKeyDown:
|
|
437
|
-
if (
|
|
423
|
+
onFocus: A(e.onFocus, () => c.onItemFocus(p)),
|
|
424
|
+
onKeyDown: A(e.onKeyDown, (_) => {
|
|
425
|
+
if (_.key === "Tab" && _.shiftKey) {
|
|
438
426
|
c.onItemShiftTab();
|
|
439
427
|
return;
|
|
440
428
|
}
|
|
441
|
-
if (
|
|
442
|
-
const h = gr(
|
|
429
|
+
if (_.target !== _.currentTarget) return;
|
|
430
|
+
const h = gr(_, c.orientation, c.dir);
|
|
443
431
|
if (h !== void 0) {
|
|
444
|
-
if (
|
|
445
|
-
|
|
446
|
-
let
|
|
447
|
-
if (h === "last")
|
|
432
|
+
if (_.metaKey || _.ctrlKey || _.altKey || _.shiftKey) return;
|
|
433
|
+
_.preventDefault();
|
|
434
|
+
let b = l().filter((y) => y.focusable).map((y) => y.ref.current);
|
|
435
|
+
if (h === "last") b.reverse();
|
|
448
436
|
else if (h === "prev" || h === "next") {
|
|
449
|
-
h === "prev" &&
|
|
450
|
-
const
|
|
451
|
-
|
|
437
|
+
h === "prev" && b.reverse();
|
|
438
|
+
const y = b.indexOf(_.currentTarget);
|
|
439
|
+
b = c.loop ? hr(b, y + 1) : b.slice(y + 1);
|
|
452
440
|
}
|
|
453
|
-
setTimeout(() =>
|
|
441
|
+
setTimeout(() => Ce(b));
|
|
454
442
|
}
|
|
455
443
|
})
|
|
456
444
|
}
|
|
@@ -460,7 +448,7 @@ var fr = s.forwardRef((e, t) => {
|
|
|
460
448
|
}
|
|
461
449
|
);
|
|
462
450
|
Re.displayName = be;
|
|
463
|
-
var
|
|
451
|
+
var mr = {
|
|
464
452
|
ArrowLeft: "prev",
|
|
465
453
|
ArrowUp: "prev",
|
|
466
454
|
ArrowRight: "next",
|
|
@@ -470,15 +458,15 @@ var _r = {
|
|
|
470
458
|
PageDown: "last",
|
|
471
459
|
End: "last"
|
|
472
460
|
};
|
|
473
|
-
function
|
|
461
|
+
function _r(e, t) {
|
|
474
462
|
return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
475
463
|
}
|
|
476
464
|
function gr(e, t, n) {
|
|
477
|
-
const a =
|
|
465
|
+
const a = _r(e.key, n);
|
|
478
466
|
if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(a)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(a)))
|
|
479
|
-
return
|
|
467
|
+
return mr[a];
|
|
480
468
|
}
|
|
481
|
-
function
|
|
469
|
+
function Ce(e, t = !1) {
|
|
482
470
|
const n = document.activeElement;
|
|
483
471
|
for (const a of e)
|
|
484
472
|
if (a === n || (a.focus({ preventScroll: t }), document.activeElement !== n)) return;
|
|
@@ -492,17 +480,17 @@ function br(e) {
|
|
|
492
480
|
return U(() => {
|
|
493
481
|
if (e) {
|
|
494
482
|
n({ width: e.offsetWidth, height: e.offsetHeight });
|
|
495
|
-
const a = new ResizeObserver((
|
|
496
|
-
if (!Array.isArray(
|
|
483
|
+
const a = new ResizeObserver((i) => {
|
|
484
|
+
if (!Array.isArray(i) || !i.length)
|
|
497
485
|
return;
|
|
498
|
-
const r =
|
|
499
|
-
let
|
|
486
|
+
const r = i[0];
|
|
487
|
+
let o, u;
|
|
500
488
|
if ("borderBoxSize" in r) {
|
|
501
489
|
const p = r.borderBoxSize, c = Array.isArray(p) ? p[0] : p;
|
|
502
|
-
|
|
490
|
+
o = c.inlineSize, u = c.blockSize;
|
|
503
491
|
} else
|
|
504
|
-
|
|
505
|
-
n({ width:
|
|
492
|
+
o = e.offsetWidth, u = e.offsetHeight;
|
|
493
|
+
n({ width: o, height: u });
|
|
506
494
|
});
|
|
507
495
|
return a.observe(e, { box: "border-box" }), () => a.unobserve(e);
|
|
508
496
|
} else
|
|
@@ -513,16 +501,16 @@ function Rr(e) {
|
|
|
513
501
|
const t = s.useRef({ value: e, previous: e });
|
|
514
502
|
return s.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
515
503
|
}
|
|
516
|
-
function
|
|
504
|
+
function Cr(e, t) {
|
|
517
505
|
return s.useReducer((n, a) => t[n][a] ?? n, e);
|
|
518
506
|
}
|
|
519
|
-
var
|
|
520
|
-
const { present: t, children: n } = e, a =
|
|
521
|
-
return typeof n == "function" || a.isPresent ? s.cloneElement(
|
|
507
|
+
var Se = (e) => {
|
|
508
|
+
const { present: t, children: n } = e, a = Sr(t), i = typeof n == "function" ? n({ present: a.isPresent }) : s.Children.only(n), r = T(a.ref, Nr(i));
|
|
509
|
+
return typeof n == "function" || a.isPresent ? s.cloneElement(i, { ref: r }) : null;
|
|
522
510
|
};
|
|
523
|
-
|
|
524
|
-
function
|
|
525
|
-
const [t, n] = s.useState(), a = s.useRef({}),
|
|
511
|
+
Se.displayName = "Presence";
|
|
512
|
+
function Sr(e) {
|
|
513
|
+
const [t, n] = s.useState(), a = s.useRef({}), i = s.useRef(e), r = s.useRef("none"), o = e ? "mounted" : "unmounted", [u, p] = Cr(o, {
|
|
526
514
|
mounted: {
|
|
527
515
|
UNMOUNT: "unmounted",
|
|
528
516
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -539,27 +527,27 @@ function Cr(e) {
|
|
|
539
527
|
const c = G(a.current);
|
|
540
528
|
r.current = u === "mounted" ? c : "none";
|
|
541
529
|
}, [u]), U(() => {
|
|
542
|
-
const c = a.current,
|
|
543
|
-
if (
|
|
544
|
-
const g = r.current,
|
|
545
|
-
e ? p("MOUNT") :
|
|
530
|
+
const c = a.current, f = i.current;
|
|
531
|
+
if (f !== e) {
|
|
532
|
+
const g = r.current, m = G(c);
|
|
533
|
+
e ? p("MOUNT") : m === "none" || c?.display === "none" ? p("UNMOUNT") : p(f && g !== m ? "ANIMATION_OUT" : "UNMOUNT"), i.current = e;
|
|
546
534
|
}
|
|
547
535
|
}, [e, p]), U(() => {
|
|
548
536
|
if (t) {
|
|
549
537
|
let c;
|
|
550
|
-
const
|
|
551
|
-
const h = G(a.current).includes(
|
|
552
|
-
if (
|
|
538
|
+
const f = t.ownerDocument.defaultView ?? window, l = (m) => {
|
|
539
|
+
const h = G(a.current).includes(m.animationName);
|
|
540
|
+
if (m.target === t && h && (p("ANIMATION_END"), !i.current)) {
|
|
553
541
|
const v = t.style.animationFillMode;
|
|
554
|
-
t.style.animationFillMode = "forwards", c =
|
|
542
|
+
t.style.animationFillMode = "forwards", c = f.setTimeout(() => {
|
|
555
543
|
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = v);
|
|
556
544
|
});
|
|
557
545
|
}
|
|
558
|
-
}, g = (
|
|
559
|
-
|
|
546
|
+
}, g = (m) => {
|
|
547
|
+
m.target === t && (r.current = G(a.current));
|
|
560
548
|
};
|
|
561
|
-
return t.addEventListener("animationstart", g), t.addEventListener("animationcancel",
|
|
562
|
-
|
|
549
|
+
return t.addEventListener("animationstart", g), t.addEventListener("animationcancel", l), t.addEventListener("animationend", l), () => {
|
|
550
|
+
f.clearTimeout(c), t.removeEventListener("animationstart", g), t.removeEventListener("animationcancel", l), t.removeEventListener("animationend", l);
|
|
563
551
|
};
|
|
564
552
|
} else
|
|
565
553
|
p("ANIMATION_END");
|
|
@@ -571,54 +559,53 @@ function Cr(e) {
|
|
|
571
559
|
};
|
|
572
560
|
}
|
|
573
561
|
function G(e) {
|
|
574
|
-
return
|
|
562
|
+
return e?.animationName || "none";
|
|
575
563
|
}
|
|
576
564
|
function Nr(e) {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
565
|
+
let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
566
|
+
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);
|
|
580
567
|
}
|
|
581
|
-
var Q = "Radio", [Ir, Ne] = j(Q), [
|
|
568
|
+
var Q = "Radio", [Ir, Ne] = j(Q), [Er, Ar] = Ir(Q), Ie = s.forwardRef(
|
|
582
569
|
(e, t) => {
|
|
583
570
|
const {
|
|
584
571
|
__scopeRadio: n,
|
|
585
572
|
name: a,
|
|
586
|
-
checked:
|
|
573
|
+
checked: i = !1,
|
|
587
574
|
required: r,
|
|
588
|
-
disabled:
|
|
575
|
+
disabled: o,
|
|
589
576
|
value: u = "on",
|
|
590
577
|
onCheck: p,
|
|
591
578
|
form: c,
|
|
592
|
-
...
|
|
593
|
-
} = e, [
|
|
594
|
-
return /* @__PURE__ */
|
|
595
|
-
/* @__PURE__ */
|
|
579
|
+
...f
|
|
580
|
+
} = e, [l, g] = s.useState(null), m = T(t, (v) => g(v)), _ = s.useRef(!1), h = l ? c || !!l.closest("form") : !0;
|
|
581
|
+
return /* @__PURE__ */ E(Er, { scope: n, checked: i, disabled: o, children: [
|
|
582
|
+
/* @__PURE__ */ d(
|
|
596
583
|
M.button,
|
|
597
584
|
{
|
|
598
585
|
type: "button",
|
|
599
586
|
role: "radio",
|
|
600
|
-
"aria-checked":
|
|
601
|
-
"data-state":
|
|
602
|
-
"data-disabled":
|
|
603
|
-
disabled:
|
|
587
|
+
"aria-checked": i,
|
|
588
|
+
"data-state": we(i),
|
|
589
|
+
"data-disabled": o ? "" : void 0,
|
|
590
|
+
disabled: o,
|
|
604
591
|
value: u,
|
|
605
|
-
...
|
|
606
|
-
ref:
|
|
607
|
-
onClick:
|
|
608
|
-
|
|
592
|
+
...f,
|
|
593
|
+
ref: m,
|
|
594
|
+
onClick: A(e.onClick, (v) => {
|
|
595
|
+
i || p?.(), h && (_.current = v.isPropagationStopped(), _.current || v.stopPropagation());
|
|
609
596
|
})
|
|
610
597
|
}
|
|
611
598
|
),
|
|
612
|
-
h && /* @__PURE__ */
|
|
613
|
-
|
|
599
|
+
h && /* @__PURE__ */ d(
|
|
600
|
+
wr,
|
|
614
601
|
{
|
|
615
|
-
control:
|
|
616
|
-
bubbles: !
|
|
602
|
+
control: l,
|
|
603
|
+
bubbles: !_.current,
|
|
617
604
|
name: a,
|
|
618
605
|
value: u,
|
|
619
|
-
checked:
|
|
606
|
+
checked: i,
|
|
620
607
|
required: r,
|
|
621
|
-
disabled:
|
|
608
|
+
disabled: o,
|
|
622
609
|
form: c,
|
|
623
610
|
style: { transform: "translateX(-100%)" }
|
|
624
611
|
}
|
|
@@ -627,36 +614,36 @@ var Q = "Radio", [Ir, Ne] = j(Q), [Ar, wr] = Ir(Q), Ie = s.forwardRef(
|
|
|
627
614
|
}
|
|
628
615
|
);
|
|
629
616
|
Ie.displayName = Q;
|
|
630
|
-
var
|
|
617
|
+
var Ee = "RadioIndicator", Ae = s.forwardRef(
|
|
631
618
|
(e, t) => {
|
|
632
|
-
const { __scopeRadio: n, forceMount: a, ...
|
|
633
|
-
return /* @__PURE__ */
|
|
619
|
+
const { __scopeRadio: n, forceMount: a, ...i } = e, r = Ar(Ee, n);
|
|
620
|
+
return /* @__PURE__ */ d(Se, { present: a || r.checked, children: /* @__PURE__ */ d(
|
|
634
621
|
M.span,
|
|
635
622
|
{
|
|
636
|
-
"data-state":
|
|
623
|
+
"data-state": we(r.checked),
|
|
637
624
|
"data-disabled": r.disabled ? "" : void 0,
|
|
638
|
-
...
|
|
625
|
+
...i,
|
|
639
626
|
ref: t
|
|
640
627
|
}
|
|
641
628
|
) });
|
|
642
629
|
}
|
|
643
630
|
);
|
|
644
|
-
|
|
645
|
-
var
|
|
646
|
-
const { control: t, checked: n, bubbles: a = !0, ...
|
|
631
|
+
Ae.displayName = Ee;
|
|
632
|
+
var wr = (e) => {
|
|
633
|
+
const { control: t, checked: n, bubbles: a = !0, ...i } = e, r = s.useRef(null), o = Rr(n), u = br(t);
|
|
647
634
|
return s.useEffect(() => {
|
|
648
|
-
const p = r.current, c = window.HTMLInputElement.prototype,
|
|
649
|
-
if (
|
|
635
|
+
const p = r.current, c = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(c, "checked").set;
|
|
636
|
+
if (o !== n && l) {
|
|
650
637
|
const g = new Event("click", { bubbles: a });
|
|
651
|
-
|
|
638
|
+
l.call(p, n), p.dispatchEvent(g);
|
|
652
639
|
}
|
|
653
|
-
}, [
|
|
640
|
+
}, [o, n, a]), /* @__PURE__ */ d(
|
|
654
641
|
"input",
|
|
655
642
|
{
|
|
656
643
|
type: "radio",
|
|
657
644
|
"aria-hidden": !0,
|
|
658
645
|
defaultChecked: n,
|
|
659
|
-
...
|
|
646
|
+
...i,
|
|
660
647
|
tabIndex: -1,
|
|
661
648
|
ref: r,
|
|
662
649
|
style: {
|
|
@@ -670,56 +657,56 @@ var Er = (e) => {
|
|
|
670
657
|
}
|
|
671
658
|
);
|
|
672
659
|
};
|
|
673
|
-
function
|
|
660
|
+
function we(e) {
|
|
674
661
|
return e ? "checked" : "unchecked";
|
|
675
662
|
}
|
|
676
|
-
var
|
|
663
|
+
var Pr = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], ee = "RadioGroup", [Or] = j(ee, [
|
|
677
664
|
ve,
|
|
678
665
|
Ne
|
|
679
|
-
]),
|
|
666
|
+
]), Pe = ve(), Oe = Ne(), [xr, Tr] = Or(ee), xe = s.forwardRef(
|
|
680
667
|
(e, t) => {
|
|
681
668
|
const {
|
|
682
669
|
__scopeRadioGroup: n,
|
|
683
670
|
name: a,
|
|
684
|
-
defaultValue:
|
|
671
|
+
defaultValue: i,
|
|
685
672
|
value: r,
|
|
686
|
-
required:
|
|
673
|
+
required: o = !1,
|
|
687
674
|
disabled: u = !1,
|
|
688
675
|
orientation: p,
|
|
689
676
|
dir: c,
|
|
690
|
-
loop:
|
|
691
|
-
onValueChange:
|
|
677
|
+
loop: f = !0,
|
|
678
|
+
onValueChange: l,
|
|
692
679
|
...g
|
|
693
|
-
} = e,
|
|
680
|
+
} = e, m = Pe(n), _ = ge(c), [h, v] = _e({
|
|
694
681
|
prop: r,
|
|
695
|
-
defaultProp:
|
|
696
|
-
onChange:
|
|
682
|
+
defaultProp: i,
|
|
683
|
+
onChange: l
|
|
697
684
|
});
|
|
698
|
-
return /* @__PURE__ */
|
|
685
|
+
return /* @__PURE__ */ d(
|
|
699
686
|
xr,
|
|
700
687
|
{
|
|
701
688
|
scope: n,
|
|
702
689
|
name: a,
|
|
703
|
-
required:
|
|
690
|
+
required: o,
|
|
704
691
|
disabled: u,
|
|
705
692
|
value: h,
|
|
706
693
|
onValueChange: v,
|
|
707
|
-
children: /* @__PURE__ */
|
|
694
|
+
children: /* @__PURE__ */ d(
|
|
708
695
|
vr,
|
|
709
696
|
{
|
|
710
697
|
asChild: !0,
|
|
711
|
-
...
|
|
698
|
+
...m,
|
|
712
699
|
orientation: p,
|
|
713
|
-
dir:
|
|
714
|
-
loop:
|
|
715
|
-
children: /* @__PURE__ */
|
|
700
|
+
dir: _,
|
|
701
|
+
loop: f,
|
|
702
|
+
children: /* @__PURE__ */ d(
|
|
716
703
|
M.div,
|
|
717
704
|
{
|
|
718
705
|
role: "radiogroup",
|
|
719
|
-
"aria-required":
|
|
706
|
+
"aria-required": o,
|
|
720
707
|
"aria-orientation": p,
|
|
721
708
|
"data-disabled": u ? "" : void 0,
|
|
722
|
-
dir:
|
|
709
|
+
dir: _,
|
|
723
710
|
...g,
|
|
724
711
|
ref: t
|
|
725
712
|
}
|
|
@@ -733,38 +720,37 @@ var Or = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], ee = "RadioGroup",
|
|
|
733
720
|
xe.displayName = ee;
|
|
734
721
|
var Te = "RadioGroupItem", $e = s.forwardRef(
|
|
735
722
|
(e, t) => {
|
|
736
|
-
const { __scopeRadioGroup: n, disabled: a, ...
|
|
723
|
+
const { __scopeRadioGroup: n, disabled: a, ...i } = e, r = Tr(Te, n), o = r.disabled || a, u = Pe(n), p = Oe(n), c = s.useRef(null), f = T(t, c), l = r.value === i.value, g = s.useRef(!1);
|
|
737
724
|
return s.useEffect(() => {
|
|
738
|
-
const
|
|
739
|
-
|
|
740
|
-
},
|
|
741
|
-
return document.addEventListener("keydown",
|
|
742
|
-
document.removeEventListener("keydown",
|
|
725
|
+
const m = (h) => {
|
|
726
|
+
Pr.includes(h.key) && (g.current = !0);
|
|
727
|
+
}, _ = () => g.current = !1;
|
|
728
|
+
return document.addEventListener("keydown", m), document.addEventListener("keyup", _), () => {
|
|
729
|
+
document.removeEventListener("keydown", m), document.removeEventListener("keyup", _);
|
|
743
730
|
};
|
|
744
|
-
}, []), /* @__PURE__ */
|
|
731
|
+
}, []), /* @__PURE__ */ d(
|
|
745
732
|
yr,
|
|
746
733
|
{
|
|
747
734
|
asChild: !0,
|
|
748
735
|
...u,
|
|
749
|
-
focusable: !
|
|
750
|
-
active:
|
|
751
|
-
children: /* @__PURE__ */
|
|
736
|
+
focusable: !o,
|
|
737
|
+
active: l,
|
|
738
|
+
children: /* @__PURE__ */ d(
|
|
752
739
|
Ie,
|
|
753
740
|
{
|
|
754
|
-
disabled:
|
|
741
|
+
disabled: o,
|
|
755
742
|
required: r.required,
|
|
756
|
-
checked:
|
|
743
|
+
checked: l,
|
|
757
744
|
...p,
|
|
758
|
-
...
|
|
745
|
+
...i,
|
|
759
746
|
name: r.name,
|
|
760
|
-
ref:
|
|
761
|
-
onCheck: () => r.onValueChange(
|
|
762
|
-
onKeyDown:
|
|
763
|
-
|
|
747
|
+
ref: f,
|
|
748
|
+
onCheck: () => r.onValueChange(i.value),
|
|
749
|
+
onKeyDown: A((m) => {
|
|
750
|
+
m.key === "Enter" && m.preventDefault();
|
|
764
751
|
}),
|
|
765
|
-
onFocus:
|
|
766
|
-
|
|
767
|
-
g.current && ((d = c.current) == null || d.click());
|
|
752
|
+
onFocus: A(i.onFocus, () => {
|
|
753
|
+
g.current && c.current?.click();
|
|
768
754
|
})
|
|
769
755
|
}
|
|
770
756
|
)
|
|
@@ -775,30 +761,25 @@ var Te = "RadioGroupItem", $e = s.forwardRef(
|
|
|
775
761
|
$e.displayName = Te;
|
|
776
762
|
var $r = "RadioGroupIndicator", Me = s.forwardRef(
|
|
777
763
|
(e, t) => {
|
|
778
|
-
const { __scopeRadioGroup: n, ...a } = e,
|
|
779
|
-
return /* @__PURE__ */
|
|
764
|
+
const { __scopeRadioGroup: n, ...a } = e, i = Oe(n);
|
|
765
|
+
return /* @__PURE__ */ d(Ae, { ...i, ...a, ref: t });
|
|
780
766
|
}
|
|
781
767
|
);
|
|
782
768
|
Me.displayName = $r;
|
|
783
|
-
var Mr = xe,
|
|
769
|
+
var Mr = xe, kr = $e, Fr = Me;
|
|
784
770
|
function Dr(e) {
|
|
785
771
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
786
772
|
}
|
|
787
773
|
var W = { exports: {} };
|
|
788
|
-
/*!
|
|
789
|
-
Copyright (c) 2018 Jed Watson.
|
|
790
|
-
Licensed under the MIT License (MIT), see
|
|
791
|
-
http://jedwatson.github.io/classnames
|
|
792
|
-
*/
|
|
793
774
|
var ue;
|
|
794
775
|
function Gr() {
|
|
795
776
|
return ue || (ue = 1, (function(e) {
|
|
796
777
|
(function() {
|
|
797
778
|
var t = {}.hasOwnProperty;
|
|
798
779
|
function n() {
|
|
799
|
-
for (var r = "",
|
|
800
|
-
var u = arguments[
|
|
801
|
-
u && (r =
|
|
780
|
+
for (var r = "", o = 0; o < arguments.length; o++) {
|
|
781
|
+
var u = arguments[o];
|
|
782
|
+
u && (r = i(r, a.call(this, u)));
|
|
802
783
|
}
|
|
803
784
|
return r;
|
|
804
785
|
}
|
|
@@ -811,13 +792,13 @@ function Gr() {
|
|
|
811
792
|
return n.apply(this, r);
|
|
812
793
|
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
813
794
|
return r.toString();
|
|
814
|
-
var
|
|
795
|
+
var o = "";
|
|
815
796
|
for (var u in r)
|
|
816
|
-
t.call(r, u) && r[u] && (
|
|
817
|
-
return
|
|
797
|
+
t.call(r, u) && r[u] && (o = i(o, this && this[u] || u));
|
|
798
|
+
return o;
|
|
818
799
|
}
|
|
819
|
-
function
|
|
820
|
-
return
|
|
800
|
+
function i(r, o) {
|
|
801
|
+
return o ? r ? r + " " + o : r + o : r;
|
|
821
802
|
}
|
|
822
803
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
823
804
|
})();
|
|
@@ -844,25 +825,19 @@ const zr = /* @__PURE__ */ Dr(Lr), Ur = {
|
|
|
844
825
|
"purpur-radio-card-group__item-image-placeholder": "_purpur-radio-card-group__item-image-placeholder_19msf_167",
|
|
845
826
|
"purpur-radio-card-group__item-image-placeholder--loaded": "_purpur-radio-card-group__item-image-placeholder--loaded_19msf_172",
|
|
846
827
|
"purpur-radio-card-group__item-children": "_purpur-radio-card-group__item-children_19msf_175"
|
|
847
|
-
},
|
|
828
|
+
}, C = zr.bind(Ur);
|
|
848
829
|
function jr(e) {
|
|
849
830
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
850
831
|
}
|
|
851
|
-
var se = { exports: {} };
|
|
852
|
-
/*!
|
|
853
|
-
Copyright (c) 2018 Jed Watson.
|
|
854
|
-
Licensed under the MIT License (MIT), see
|
|
855
|
-
http://jedwatson.github.io/classnames
|
|
856
|
-
*/
|
|
857
|
-
var ce;
|
|
832
|
+
var se = { exports: {} }, ce;
|
|
858
833
|
function Vr() {
|
|
859
834
|
return ce || (ce = 1, (function(e) {
|
|
860
835
|
(function() {
|
|
861
836
|
var t = {}.hasOwnProperty;
|
|
862
837
|
function n() {
|
|
863
|
-
for (var r = "",
|
|
864
|
-
var u = arguments[
|
|
865
|
-
u && (r =
|
|
838
|
+
for (var r = "", o = 0; o < arguments.length; o++) {
|
|
839
|
+
var u = arguments[o];
|
|
840
|
+
u && (r = i(r, a.call(this, u)));
|
|
866
841
|
}
|
|
867
842
|
return r;
|
|
868
843
|
}
|
|
@@ -875,13 +850,13 @@ function Vr() {
|
|
|
875
850
|
return n.apply(this, r);
|
|
876
851
|
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
877
852
|
return r.toString();
|
|
878
|
-
var
|
|
853
|
+
var o = "";
|
|
879
854
|
for (var u in r)
|
|
880
|
-
t.call(r, u) && r[u] && (
|
|
881
|
-
return
|
|
855
|
+
t.call(r, u) && r[u] && (o = i(o, this && this[u] || u));
|
|
856
|
+
return o;
|
|
882
857
|
}
|
|
883
|
-
function
|
|
884
|
-
return
|
|
858
|
+
function i(r, o) {
|
|
859
|
+
return o ? r ? r + " " + o : r + o : r;
|
|
885
860
|
}
|
|
886
861
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
887
862
|
})();
|
|
@@ -903,43 +878,37 @@ const Br = /* @__PURE__ */ jr(Kr), Wr = {
|
|
|
903
878
|
"purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1rh57_60",
|
|
904
879
|
"purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1rh57_67",
|
|
905
880
|
"purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1rh57_75"
|
|
906
|
-
},
|
|
881
|
+
}, Hr = Br.bind(Wr), qr = {
|
|
907
882
|
PARAGRAPH100: "paragraph-100"
|
|
908
883
|
}, $ = "purpur-paragraph", Z = ({
|
|
909
884
|
children: e,
|
|
910
885
|
className: t,
|
|
911
886
|
disabled: n,
|
|
912
887
|
enableHyphenation: a = !1,
|
|
913
|
-
negative:
|
|
914
|
-
variant: r =
|
|
915
|
-
...
|
|
888
|
+
negative: i = !1,
|
|
889
|
+
variant: r = qr.PARAGRAPH100,
|
|
890
|
+
...o
|
|
916
891
|
}) => {
|
|
917
|
-
const u =
|
|
892
|
+
const u = Hr(t, $, `${$}--${r}`, {
|
|
918
893
|
[`${$}--hyphens`]: a,
|
|
919
894
|
[`${$}--disabled`]: n,
|
|
920
|
-
[`${$}--negative`]:
|
|
895
|
+
[`${$}--negative`]: i
|
|
921
896
|
});
|
|
922
|
-
return /* @__PURE__ */
|
|
897
|
+
return /* @__PURE__ */ d("p", { ...o, className: u, children: e });
|
|
923
898
|
};
|
|
924
899
|
Z.displayName = "Paragraph";
|
|
925
900
|
function Yr(e) {
|
|
926
901
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
927
902
|
}
|
|
928
|
-
var pe = { exports: {} };
|
|
929
|
-
/*!
|
|
930
|
-
Copyright (c) 2018 Jed Watson.
|
|
931
|
-
Licensed under the MIT License (MIT), see
|
|
932
|
-
http://jedwatson.github.io/classnames
|
|
933
|
-
*/
|
|
934
|
-
var de;
|
|
903
|
+
var pe = { exports: {} }, de;
|
|
935
904
|
function Xr() {
|
|
936
905
|
return de || (de = 1, (function(e) {
|
|
937
906
|
(function() {
|
|
938
907
|
var t = {}.hasOwnProperty;
|
|
939
908
|
function n() {
|
|
940
|
-
for (var r = "",
|
|
941
|
-
var u = arguments[
|
|
942
|
-
u && (r =
|
|
909
|
+
for (var r = "", o = 0; o < arguments.length; o++) {
|
|
910
|
+
var u = arguments[o];
|
|
911
|
+
u && (r = i(r, a.call(this, u)));
|
|
943
912
|
}
|
|
944
913
|
return r;
|
|
945
914
|
}
|
|
@@ -952,13 +921,13 @@ function Xr() {
|
|
|
952
921
|
return n.apply(this, r);
|
|
953
922
|
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
954
923
|
return r.toString();
|
|
955
|
-
var
|
|
924
|
+
var o = "";
|
|
956
925
|
for (var u in r)
|
|
957
|
-
t.call(r, u) && r[u] && (
|
|
958
|
-
return
|
|
926
|
+
t.call(r, u) && r[u] && (o = i(o, this && this[u] || u));
|
|
927
|
+
return o;
|
|
959
928
|
}
|
|
960
|
-
function
|
|
961
|
-
return
|
|
929
|
+
function i(r, o) {
|
|
930
|
+
return o ? r ? r + " " + o : r + o : r;
|
|
962
931
|
}
|
|
963
932
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
964
933
|
})();
|
|
@@ -975,38 +944,38 @@ const Jr = /* @__PURE__ */ Yr(Zr), Qr = "_loading_rzc29_1", et = {
|
|
|
975
944
|
"purpur-skeleton--md": "_purpur-skeleton--md_rzc29_42",
|
|
976
945
|
"purpur-skeleton--lg": "_purpur-skeleton--lg_rzc29_45",
|
|
977
946
|
"purpur-skeleton--full": "_purpur-skeleton--full_rzc29_48"
|
|
978
|
-
}, rt = Jr.bind(et),
|
|
947
|
+
}, rt = Jr.bind(et), H = "purpur-skeleton", ke = ({
|
|
979
948
|
className: e,
|
|
980
949
|
radius: t = "xs",
|
|
981
950
|
negative: n = !1,
|
|
982
951
|
...a
|
|
983
952
|
}) => {
|
|
984
|
-
const
|
|
953
|
+
const i = rt(
|
|
985
954
|
e,
|
|
986
|
-
|
|
987
|
-
`${
|
|
988
|
-
`${
|
|
955
|
+
H,
|
|
956
|
+
`${H}--${n ? "negative" : "default"}`,
|
|
957
|
+
`${H}--${t}`
|
|
989
958
|
);
|
|
990
|
-
return /* @__PURE__ */
|
|
959
|
+
return /* @__PURE__ */ d("div", { className: i, ...a });
|
|
991
960
|
};
|
|
992
|
-
|
|
993
|
-
const L = "purpur-radio-card-group__item-image", tt = (e) => !!
|
|
961
|
+
ke.displayName = "Skeleton";
|
|
962
|
+
const L = "purpur-radio-card-group__item-image", tt = (e) => !!e?.src && !!e.altText, nt = ({
|
|
994
963
|
src: e,
|
|
995
964
|
altText: t,
|
|
996
965
|
noPlaceholder: n,
|
|
997
966
|
loading: a = "lazy",
|
|
998
|
-
["data-testid"]:
|
|
967
|
+
["data-testid"]: i
|
|
999
968
|
}) => {
|
|
1000
|
-
const [r,
|
|
969
|
+
const [r, o] = Ue(!1), u = () => o(!0), p = C(L, {
|
|
1001
970
|
[`${L}--loaded`]: r
|
|
1002
|
-
}), c =
|
|
971
|
+
}), c = C(`${L}-placeholder`, {
|
|
1003
972
|
[`${L}-placeholder--loaded`]: r
|
|
1004
973
|
});
|
|
1005
|
-
return /* @__PURE__ */
|
|
1006
|
-
/* @__PURE__ */
|
|
974
|
+
return /* @__PURE__ */ E(ze, { children: [
|
|
975
|
+
/* @__PURE__ */ d(
|
|
1007
976
|
"img",
|
|
1008
977
|
{
|
|
1009
|
-
"data-testid":
|
|
978
|
+
"data-testid": i,
|
|
1010
979
|
className: p,
|
|
1011
980
|
src: e,
|
|
1012
981
|
alt: t,
|
|
@@ -1014,45 +983,45 @@ const L = "purpur-radio-card-group__item-image", tt = (e) => !!(e != null && e.s
|
|
|
1014
983
|
onLoad: u
|
|
1015
984
|
}
|
|
1016
985
|
),
|
|
1017
|
-
!n && /* @__PURE__ */
|
|
986
|
+
!n && /* @__PURE__ */ d(ke, { className: c })
|
|
1018
987
|
] });
|
|
1019
|
-
}, I = "purpur-radio-card-group__item",
|
|
988
|
+
}, I = "purpur-radio-card-group__item", q = (e, { disabled: t }) => typeof e == "function" ? e({ disabled: t }) : e, re = le(
|
|
1020
989
|
({ title: e, ...t }, n) => {
|
|
1021
|
-
const { ["data-testid"]: a, body:
|
|
1022
|
-
return /* @__PURE__ */
|
|
1023
|
-
/* @__PURE__ */
|
|
1024
|
-
|
|
990
|
+
const { ["data-testid"]: a, body: i, children: r, disabled: o, id: u, image: p, value: c } = t, f = { ...t };
|
|
991
|
+
return /* @__PURE__ */ E("div", { className: C(`${I}-container`), ref: n, children: [
|
|
992
|
+
/* @__PURE__ */ E(
|
|
993
|
+
kr,
|
|
1025
994
|
{
|
|
1026
|
-
className:
|
|
995
|
+
className: C(I),
|
|
1027
996
|
"data-testid": a,
|
|
1028
|
-
disabled:
|
|
997
|
+
disabled: o,
|
|
1029
998
|
id: u,
|
|
1030
999
|
value: c,
|
|
1031
1000
|
children: [
|
|
1032
|
-
p && /* @__PURE__ */
|
|
1033
|
-
/* @__PURE__ */
|
|
1034
|
-
/* @__PURE__ */
|
|
1035
|
-
typeof e == "string" ? /* @__PURE__ */
|
|
1001
|
+
p && /* @__PURE__ */ d("span", { className: C(`${I}-image-container`), children: tt(p) ? /* @__PURE__ */ d(nt, { ...p, "data-testid": a && `${a}-image` }) : q(p, f) }),
|
|
1002
|
+
/* @__PURE__ */ E("span", { className: C(`${I}-content`), children: [
|
|
1003
|
+
/* @__PURE__ */ E("span", { className: C(`${I}-top-container`), children: [
|
|
1004
|
+
typeof e == "string" ? /* @__PURE__ */ d(
|
|
1036
1005
|
Z,
|
|
1037
1006
|
{
|
|
1038
|
-
className:
|
|
1007
|
+
className: C(`${I}-title`),
|
|
1039
1008
|
"data-testid": a && `${a}-title`,
|
|
1040
1009
|
variant: "paragraph-100",
|
|
1041
|
-
disabled:
|
|
1010
|
+
disabled: o,
|
|
1042
1011
|
children: e
|
|
1043
1012
|
}
|
|
1044
|
-
) :
|
|
1045
|
-
/* @__PURE__ */
|
|
1013
|
+
) : q(e, f),
|
|
1014
|
+
/* @__PURE__ */ d("span", { className: C(`${I}-radio`), children: /* @__PURE__ */ d(Fr, { className: C(`${I}-indicator`) }) })
|
|
1046
1015
|
] }),
|
|
1047
|
-
|
|
1016
|
+
i && /* @__PURE__ */ d("span", { className: C(`${I}-bottom-container`), children: typeof i == "string" ? /* @__PURE__ */ d(
|
|
1048
1017
|
Z,
|
|
1049
1018
|
{
|
|
1050
1019
|
"data-testid": a && `${a}-body`,
|
|
1051
1020
|
variant: "paragraph-100",
|
|
1052
|
-
disabled:
|
|
1053
|
-
children:
|
|
1021
|
+
disabled: o,
|
|
1022
|
+
children: i
|
|
1054
1023
|
}
|
|
1055
|
-
) :
|
|
1024
|
+
) : q(i, f) })
|
|
1056
1025
|
] })
|
|
1057
1026
|
]
|
|
1058
1027
|
}
|
|
@@ -1062,41 +1031,41 @@ const L = "purpur-radio-card-group__item-image", tt = (e) => !!(e != null && e.s
|
|
|
1062
1031
|
}
|
|
1063
1032
|
);
|
|
1064
1033
|
re.displayName = "RadioCardItem";
|
|
1065
|
-
const ot = (e) => je(e) &&
|
|
1034
|
+
const ot = (e) => je(e) && e?.type === re, pt = ["horizontal", "vertical"], dt = ["right", "left"], z = "purpur-radio-card-group", at = le(
|
|
1066
1035
|
({
|
|
1067
1036
|
"data-testid": e,
|
|
1068
1037
|
"aria-labelledby": t,
|
|
1069
1038
|
children: n,
|
|
1070
1039
|
className: a,
|
|
1071
|
-
items:
|
|
1040
|
+
items: i,
|
|
1072
1041
|
heading: r,
|
|
1073
|
-
headingTag:
|
|
1042
|
+
headingTag: o = "h2",
|
|
1074
1043
|
loop: u = !0,
|
|
1075
1044
|
orientation: p = "vertical",
|
|
1076
1045
|
radioPosition: c = "right",
|
|
1077
|
-
...
|
|
1078
|
-
},
|
|
1046
|
+
...f
|
|
1047
|
+
}, l) => {
|
|
1079
1048
|
const g = ne.toArray(n).filter(ot);
|
|
1080
|
-
return /* @__PURE__ */
|
|
1081
|
-
r && /* @__PURE__ */
|
|
1049
|
+
return /* @__PURE__ */ E("div", { className: C(a, `${z}__container`), ref: l, children: [
|
|
1050
|
+
r && /* @__PURE__ */ E(
|
|
1082
1051
|
fe,
|
|
1083
1052
|
{
|
|
1084
1053
|
"data-testid": e ? `${e}-heading` : void 0,
|
|
1085
|
-
id: `${
|
|
1086
|
-
tag:
|
|
1054
|
+
id: `${f.id}-heading`,
|
|
1055
|
+
tag: o,
|
|
1087
1056
|
variant: "subsection-100",
|
|
1088
1057
|
children: [
|
|
1089
|
-
|
|
1058
|
+
f.required && /* @__PURE__ */ d("span", { "aria-hidden": !0, children: "* " }),
|
|
1090
1059
|
r
|
|
1091
1060
|
]
|
|
1092
1061
|
}
|
|
1093
1062
|
),
|
|
1094
|
-
(!!
|
|
1063
|
+
(!!i?.length || g.length) && /* @__PURE__ */ E(
|
|
1095
1064
|
Mr,
|
|
1096
1065
|
{
|
|
1097
|
-
...
|
|
1098
|
-
"aria-labelledby": t || (r ? `${
|
|
1099
|
-
className:
|
|
1066
|
+
...f,
|
|
1067
|
+
"aria-labelledby": t || (r ? `${f.id}-heading` : void 0),
|
|
1068
|
+
className: C(
|
|
1100
1069
|
z,
|
|
1101
1070
|
`${z}--${p}`,
|
|
1102
1071
|
`${z}--radio-${c}`
|
|
@@ -1104,18 +1073,18 @@ const ot = (e) => je(e) && (e == null ? void 0 : e.type) === re, pt = ["horizont
|
|
|
1104
1073
|
"data-testid": e,
|
|
1105
1074
|
loop: u,
|
|
1106
1075
|
children: [
|
|
1107
|
-
|
|
1076
|
+
i?.map((m) => /* @__PURE__ */ d(
|
|
1108
1077
|
re,
|
|
1109
1078
|
{
|
|
1110
|
-
...
|
|
1111
|
-
disabled:
|
|
1079
|
+
...m,
|
|
1080
|
+
disabled: m.disabled || f.disabled,
|
|
1112
1081
|
"data-testid": e ? `${e}-item` : void 0
|
|
1113
1082
|
},
|
|
1114
|
-
|
|
1083
|
+
m.id
|
|
1115
1084
|
)),
|
|
1116
1085
|
ne.map(
|
|
1117
1086
|
g,
|
|
1118
|
-
(
|
|
1087
|
+
(m) => Ve(m, { disabled: m.props.disabled || f.disabled })
|
|
1119
1088
|
)
|
|
1120
1089
|
]
|
|
1121
1090
|
}
|