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