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