@purpurds/radio-card-group 6.12.5 → 7.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 +3 -3
- package/dist/radio-card-group.cjs.js +3 -3
- package/dist/radio-card-group.cjs.js.map +1 -1
- package/dist/radio-card-group.d.ts +8 -8
- package/dist/radio-card-group.d.ts.map +1 -1
- package/dist/radio-card-group.es.js +98 -105
- package/dist/radio-card-group.es.js.map +1 -1
- package/dist/radio-card-item.d.ts +0 -1
- package/dist/radio-card-item.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/radio-card-group.stories.tsx +6 -3
- package/src/radio-card-group.test.tsx +22 -20
- package/src/radio-card-group.tsx +14 -13
- package/src/radio-card-item.tsx +5 -24
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as f, Fragment as me, jsxs as
|
|
1
|
+
import { jsx as f, Fragment as me, jsxs as N } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import A, { useState as Ve, forwardRef as _e, isValidElement as Ke, Children as ae, cloneElement as Be } from "react";
|
|
4
4
|
import "react-dom";
|
|
@@ -45,7 +45,7 @@ function He() {
|
|
|
45
45
|
}(ie)), ie.exports;
|
|
46
46
|
}
|
|
47
47
|
var Ye = He();
|
|
48
|
-
const Xe = /* @__PURE__ */ We(Ye),
|
|
48
|
+
const Xe = /* @__PURE__ */ We(Ye), $ = {
|
|
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",
|
|
@@ -74,17 +74,17 @@ const Xe = /* @__PURE__ */ We(Ye), M = {
|
|
|
74
74
|
}) => {
|
|
75
75
|
const u = a, c = Xe([
|
|
76
76
|
t,
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
$[F],
|
|
78
|
+
$[`${F}--${r}`],
|
|
79
79
|
{
|
|
80
|
-
[
|
|
81
|
-
[
|
|
80
|
+
[$[`${F}--hyphens`]]: n,
|
|
81
|
+
[$[`${F}--negative`]]: o
|
|
82
82
|
}
|
|
83
83
|
]);
|
|
84
84
|
return /* @__PURE__ */ f(u, { className: c, ...i, children: e });
|
|
85
85
|
};
|
|
86
86
|
ge.displayName = "Heading";
|
|
87
|
-
function
|
|
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);
|
|
@@ -121,18 +121,18 @@ function j(e, t = []) {
|
|
|
121
121
|
n = [...n, i];
|
|
122
122
|
const p = (m) => {
|
|
123
123
|
var y;
|
|
124
|
-
const { scope:
|
|
124
|
+
const { scope: g, children: d, ...l } = m, h = ((y = g == null ? void 0 : g[e]) == null ? void 0 : y[c]) || u, v = s.useMemo(() => l, Object.values(l));
|
|
125
125
|
return /* @__PURE__ */ f(h.Provider, { value: v, children: d });
|
|
126
126
|
};
|
|
127
127
|
p.displayName = r + "Provider";
|
|
128
|
-
function
|
|
128
|
+
function _(m, g) {
|
|
129
129
|
var h;
|
|
130
|
-
const d = ((h =
|
|
130
|
+
const d = ((h = g == null ? void 0 : g[e]) == null ? void 0 : h[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}\``);
|
|
134
134
|
}
|
|
135
|
-
return [p,
|
|
135
|
+
return [p, _];
|
|
136
136
|
}
|
|
137
137
|
const a = () => {
|
|
138
138
|
const r = n.map((i) => s.createContext(i));
|
|
@@ -218,7 +218,7 @@ var nr = [
|
|
|
218
218
|
"span",
|
|
219
219
|
"svg",
|
|
220
220
|
"ul"
|
|
221
|
-
],
|
|
221
|
+
], M = nr.reduce((e, t) => {
|
|
222
222
|
const n = s.forwardRef((o, a) => {
|
|
223
223
|
const { asChild: r, ...i } = o, u = r ? q : t;
|
|
224
224
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ f(u, { ...i, ref: a });
|
|
@@ -241,19 +241,19 @@ function or(e) {
|
|
|
241
241
|
}
|
|
242
242
|
);
|
|
243
243
|
c.displayName = u;
|
|
244
|
-
const p = e + "CollectionItemSlot",
|
|
244
|
+
const p = e + "CollectionItemSlot", _ = "data-radix-collection-item", m = A.forwardRef(
|
|
245
245
|
(d, l) => {
|
|
246
246
|
const { scope: h, children: v, ...y } = d, b = A.useRef(null), E = P(l, b), O = r(p, h);
|
|
247
|
-
return A.useEffect(() => (O.itemMap.set(b, { ref: b, ...y }), () => void O.itemMap.delete(b))), /* @__PURE__ */ f(q, { [
|
|
247
|
+
return A.useEffect(() => (O.itemMap.set(b, { ref: b, ...y }), () => void O.itemMap.delete(b))), /* @__PURE__ */ f(q, { [_]: "", ref: E, children: v });
|
|
248
248
|
}
|
|
249
249
|
);
|
|
250
250
|
m.displayName = p;
|
|
251
|
-
function
|
|
251
|
+
function g(d) {
|
|
252
252
|
const l = r(e + "CollectionConsumer", d);
|
|
253
253
|
return A.useCallback(() => {
|
|
254
254
|
const v = l.collectionRef.current;
|
|
255
255
|
if (!v) return [];
|
|
256
|
-
const y = Array.from(v.querySelectorAll(`[${
|
|
256
|
+
const y = Array.from(v.querySelectorAll(`[${_}]`));
|
|
257
257
|
return Array.from(l.itemMap.values()).sort(
|
|
258
258
|
(O, x) => y.indexOf(O.ref.current) - y.indexOf(x.ref.current)
|
|
259
259
|
);
|
|
@@ -261,7 +261,7 @@ function or(e) {
|
|
|
261
261
|
}
|
|
262
262
|
return [
|
|
263
263
|
{ Provider: i, Slot: c, ItemSlot: m },
|
|
264
|
-
|
|
264
|
+
g,
|
|
265
265
|
o
|
|
266
266
|
];
|
|
267
267
|
}
|
|
@@ -332,15 +332,15 @@ var _r = s.forwardRef((e, t) => {
|
|
|
332
332
|
defaultCurrentTabStopId: u,
|
|
333
333
|
onCurrentTabStopIdChange: c,
|
|
334
334
|
onEntryFocus: p,
|
|
335
|
-
preventScrollOnEntryFocus:
|
|
335
|
+
preventScrollOnEntryFocus: _ = !1,
|
|
336
336
|
...m
|
|
337
|
-
} = e,
|
|
337
|
+
} = e, g = s.useRef(null), d = P(t, g), l = ye(r), [h = null, v] = ve({
|
|
338
338
|
prop: i,
|
|
339
339
|
defaultProp: u,
|
|
340
340
|
onChange: c
|
|
341
341
|
}), [y, b] = s.useState(!1), E = Q(p), O = be(n), x = s.useRef(!1), [Le, ne] = s.useState(0);
|
|
342
342
|
return s.useEffect(() => {
|
|
343
|
-
const R =
|
|
343
|
+
const R = g.current;
|
|
344
344
|
if (R)
|
|
345
345
|
return R.addEventListener(K, E), () => R.removeEventListener(K, E);
|
|
346
346
|
}, [E]), /* @__PURE__ */ f(
|
|
@@ -365,17 +365,17 @@ var _r = s.forwardRef((e, t) => {
|
|
|
365
365
|
[]
|
|
366
366
|
),
|
|
367
367
|
children: /* @__PURE__ */ f(
|
|
368
|
-
|
|
368
|
+
M.div,
|
|
369
369
|
{
|
|
370
370
|
tabIndex: y || Le === 0 ? -1 : 0,
|
|
371
371
|
"data-orientation": o,
|
|
372
372
|
...m,
|
|
373
373
|
ref: d,
|
|
374
374
|
style: { outline: "none", ...e.style },
|
|
375
|
-
onMouseDown:
|
|
375
|
+
onMouseDown: I(e.onMouseDown, () => {
|
|
376
376
|
x.current = !0;
|
|
377
377
|
}),
|
|
378
|
-
onFocus:
|
|
378
|
+
onFocus: I(e.onFocus, (R) => {
|
|
379
379
|
const qe = !x.current;
|
|
380
380
|
if (R.target === R.currentTarget && qe && !y) {
|
|
381
381
|
const oe = new CustomEvent(K, pr);
|
|
@@ -383,12 +383,12 @@ var _r = s.forwardRef((e, t) => {
|
|
|
383
383
|
const V = O().filter((w) => w.focusable), Ue = V.find((w) => w.active), je = V.find((w) => w.id === h), ze = [Ue, je, ...V].filter(
|
|
384
384
|
Boolean
|
|
385
385
|
).map((w) => w.ref.current);
|
|
386
|
-
Ie(ze,
|
|
386
|
+
Ie(ze, _);
|
|
387
387
|
}
|
|
388
388
|
}
|
|
389
389
|
x.current = !1;
|
|
390
390
|
}),
|
|
391
|
-
onBlur:
|
|
391
|
+
onBlur: I(e.onBlur, () => b(!1))
|
|
392
392
|
}
|
|
393
393
|
)
|
|
394
394
|
}
|
|
@@ -401,11 +401,11 @@ var _r = s.forwardRef((e, t) => {
|
|
|
401
401
|
active: a = !1,
|
|
402
402
|
tabStopId: r,
|
|
403
403
|
...i
|
|
404
|
-
} = e, u = ur(), c = r || u, p = mr(Se, n),
|
|
404
|
+
} = e, u = ur(), c = r || u, p = mr(Se, n), _ = p.currentTabStopId === c, m = be(n), { onFocusableItemAdd: g, onFocusableItemRemove: d } = p;
|
|
405
405
|
return s.useEffect(() => {
|
|
406
406
|
if (o)
|
|
407
|
-
return
|
|
408
|
-
}, [o,
|
|
407
|
+
return g(), () => d();
|
|
408
|
+
}, [o, g, d]), /* @__PURE__ */ f(
|
|
409
409
|
Z.ItemSlot,
|
|
410
410
|
{
|
|
411
411
|
scope: n,
|
|
@@ -413,17 +413,17 @@ var _r = s.forwardRef((e, t) => {
|
|
|
413
413
|
focusable: o,
|
|
414
414
|
active: a,
|
|
415
415
|
children: /* @__PURE__ */ f(
|
|
416
|
-
|
|
416
|
+
M.span,
|
|
417
417
|
{
|
|
418
|
-
tabIndex:
|
|
418
|
+
tabIndex: _ ? 0 : -1,
|
|
419
419
|
"data-orientation": p.orientation,
|
|
420
420
|
...i,
|
|
421
421
|
ref: t,
|
|
422
|
-
onMouseDown:
|
|
422
|
+
onMouseDown: I(e.onMouseDown, (l) => {
|
|
423
423
|
o ? p.onItemFocus(c) : l.preventDefault();
|
|
424
424
|
}),
|
|
425
|
-
onFocus:
|
|
426
|
-
onKeyDown:
|
|
425
|
+
onFocus: I(e.onFocus, () => p.onItemFocus(c)),
|
|
426
|
+
onKeyDown: I(e.onKeyDown, (l) => {
|
|
427
427
|
if (l.key === "Tab" && l.shiftKey) {
|
|
428
428
|
p.onItemShiftTab();
|
|
429
429
|
return;
|
|
@@ -529,27 +529,27 @@ function Ir(e) {
|
|
|
529
529
|
const p = D(o.current);
|
|
530
530
|
r.current = u === "mounted" ? p : "none";
|
|
531
531
|
}, [u]), U(() => {
|
|
532
|
-
const p = o.current,
|
|
533
|
-
if (
|
|
534
|
-
const
|
|
535
|
-
e ? c("MOUNT") : d === "none" || (p == null ? void 0 : p.display) === "none" ? c("UNMOUNT") : c(
|
|
532
|
+
const p = o.current, _ = a.current;
|
|
533
|
+
if (_ !== e) {
|
|
534
|
+
const g = r.current, d = D(p);
|
|
535
|
+
e ? c("MOUNT") : d === "none" || (p == null ? void 0 : p.display) === "none" ? c("UNMOUNT") : c(_ && g !== d ? "ANIMATION_OUT" : "UNMOUNT"), a.current = e;
|
|
536
536
|
}
|
|
537
537
|
}, [e, c]), U(() => {
|
|
538
538
|
if (t) {
|
|
539
539
|
let p;
|
|
540
|
-
const
|
|
540
|
+
const _ = t.ownerDocument.defaultView ?? window, m = (d) => {
|
|
541
541
|
const h = D(o.current).includes(d.animationName);
|
|
542
542
|
if (d.target === t && h && (c("ANIMATION_END"), !a.current)) {
|
|
543
543
|
const v = t.style.animationFillMode;
|
|
544
|
-
t.style.animationFillMode = "forwards", p =
|
|
544
|
+
t.style.animationFillMode = "forwards", p = _.setTimeout(() => {
|
|
545
545
|
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = v);
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
|
-
},
|
|
548
|
+
}, g = (d) => {
|
|
549
549
|
d.target === t && (r.current = D(o.current));
|
|
550
550
|
};
|
|
551
|
-
return t.addEventListener("animationstart",
|
|
552
|
-
|
|
551
|
+
return t.addEventListener("animationstart", g), t.addEventListener("animationcancel", m), t.addEventListener("animationend", m), () => {
|
|
552
|
+
_.clearTimeout(p), t.removeEventListener("animationstart", g), t.removeEventListener("animationcancel", m), t.removeEventListener("animationend", m);
|
|
553
553
|
};
|
|
554
554
|
} else
|
|
555
555
|
c("ANIMATION_END");
|
|
@@ -579,11 +579,11 @@ var ee = "Radio", [Ar, Ae] = j(ee), [Er, Or] = Ar(ee), Ee = s.forwardRef(
|
|
|
579
579
|
value: u = "on",
|
|
580
580
|
onCheck: c,
|
|
581
581
|
form: p,
|
|
582
|
-
...
|
|
583
|
-
} = e, [m,
|
|
584
|
-
return /* @__PURE__ */
|
|
582
|
+
..._
|
|
583
|
+
} = e, [m, g] = s.useState(null), d = P(t, (v) => g(v)), l = s.useRef(!1), h = m ? p || !!m.closest("form") : !0;
|
|
584
|
+
return /* @__PURE__ */ N(Er, { scope: n, checked: a, disabled: i, children: [
|
|
585
585
|
/* @__PURE__ */ f(
|
|
586
|
-
|
|
586
|
+
M.button,
|
|
587
587
|
{
|
|
588
588
|
type: "button",
|
|
589
589
|
role: "radio",
|
|
@@ -592,9 +592,9 @@ var ee = "Radio", [Ar, Ae] = j(ee), [Er, Or] = Ar(ee), Ee = s.forwardRef(
|
|
|
592
592
|
"data-disabled": i ? "" : void 0,
|
|
593
593
|
disabled: i,
|
|
594
594
|
value: u,
|
|
595
|
-
...
|
|
595
|
+
..._,
|
|
596
596
|
ref: d,
|
|
597
|
-
onClick:
|
|
597
|
+
onClick: I(e.onClick, (v) => {
|
|
598
598
|
a || c == null || c(), h && (l.current = v.isPropagationStopped(), l.current || v.stopPropagation());
|
|
599
599
|
})
|
|
600
600
|
}
|
|
@@ -621,7 +621,7 @@ var Oe = "RadioIndicator", Pe = s.forwardRef(
|
|
|
621
621
|
(e, t) => {
|
|
622
622
|
const { __scopeRadio: n, forceMount: o, ...a } = e, r = Or(Oe, n);
|
|
623
623
|
return /* @__PURE__ */ f(we, { present: o || r.checked, children: /* @__PURE__ */ f(
|
|
624
|
-
|
|
624
|
+
M.span,
|
|
625
625
|
{
|
|
626
626
|
"data-state": xe(r.checked),
|
|
627
627
|
"data-disabled": r.disabled ? "" : void 0,
|
|
@@ -637,8 +637,8 @@ var Pr = (e) => {
|
|
|
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 g = new Event("click", { bubbles: o });
|
|
641
|
+
m.call(c, n), c.dispatchEvent(g);
|
|
642
642
|
}
|
|
643
643
|
}, [i, n, o]), /* @__PURE__ */ f(
|
|
644
644
|
"input",
|
|
@@ -666,7 +666,7 @@ function xe(e) {
|
|
|
666
666
|
var xr = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], re = "RadioGroup", [kr, pt] = j(re, [
|
|
667
667
|
Re,
|
|
668
668
|
Ae
|
|
669
|
-
]), ke = Re(), Te = Ae(), [Tr,
|
|
669
|
+
]), ke = Re(), Te = Ae(), [Tr, Mr] = kr(re), Me = s.forwardRef(
|
|
670
670
|
(e, t) => {
|
|
671
671
|
const {
|
|
672
672
|
__scopeRadioGroup: n,
|
|
@@ -677,9 +677,9 @@ var xr = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], re = "RadioGroup",
|
|
|
677
677
|
disabled: u = !1,
|
|
678
678
|
orientation: c,
|
|
679
679
|
dir: p,
|
|
680
|
-
loop:
|
|
680
|
+
loop: _ = !0,
|
|
681
681
|
onValueChange: m,
|
|
682
|
-
...
|
|
682
|
+
...g
|
|
683
683
|
} = e, d = ke(n), l = ye(p), [h, v] = ve({
|
|
684
684
|
prop: r,
|
|
685
685
|
defaultProp: a,
|
|
@@ -701,16 +701,16 @@ var xr = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], re = "RadioGroup",
|
|
|
701
701
|
...d,
|
|
702
702
|
orientation: c,
|
|
703
703
|
dir: l,
|
|
704
|
-
loop:
|
|
704
|
+
loop: _,
|
|
705
705
|
children: /* @__PURE__ */ f(
|
|
706
|
-
|
|
706
|
+
M.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
|
+
...g,
|
|
714
714
|
ref: t
|
|
715
715
|
}
|
|
716
716
|
)
|
|
@@ -720,14 +720,14 @@ var xr = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], re = "RadioGroup",
|
|
|
720
720
|
);
|
|
721
721
|
}
|
|
722
722
|
);
|
|
723
|
-
|
|
724
|
-
var
|
|
723
|
+
Me.displayName = re;
|
|
724
|
+
var $e = "RadioGroupItem", Fe = s.forwardRef(
|
|
725
725
|
(e, t) => {
|
|
726
|
-
const { __scopeRadioGroup: n, disabled: o, ...a } = e, r = $
|
|
726
|
+
const { __scopeRadioGroup: n, disabled: o, ...a } = e, r = Mr($e, n), i = r.disabled || o, u = ke(n), c = Te(n), p = s.useRef(null), _ = P(t, p), m = r.value === a.value, g = s.useRef(!1);
|
|
727
727
|
return s.useEffect(() => {
|
|
728
728
|
const d = (h) => {
|
|
729
|
-
xr.includes(h.key) && (
|
|
730
|
-
}, l = () =>
|
|
729
|
+
xr.includes(h.key) && (g.current = !0);
|
|
730
|
+
}, l = () => g.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
|
};
|
|
@@ -747,14 +747,14 @@ var Me = "RadioGroupItem", Fe = s.forwardRef(
|
|
|
747
747
|
...c,
|
|
748
748
|
...a,
|
|
749
749
|
name: r.name,
|
|
750
|
-
ref:
|
|
750
|
+
ref: _,
|
|
751
751
|
onCheck: () => r.onValueChange(a.value),
|
|
752
|
-
onKeyDown:
|
|
752
|
+
onKeyDown: I((d) => {
|
|
753
753
|
d.key === "Enter" && d.preventDefault();
|
|
754
754
|
}),
|
|
755
|
-
onFocus:
|
|
755
|
+
onFocus: I(a.onFocus, () => {
|
|
756
756
|
var d;
|
|
757
|
-
|
|
757
|
+
g.current && ((d = p.current) == null || d.click());
|
|
758
758
|
})
|
|
759
759
|
}
|
|
760
760
|
)
|
|
@@ -762,15 +762,15 @@ var Me = "RadioGroupItem", Fe = s.forwardRef(
|
|
|
762
762
|
);
|
|
763
763
|
}
|
|
764
764
|
);
|
|
765
|
-
Fe.displayName =
|
|
766
|
-
var
|
|
765
|
+
Fe.displayName = $e;
|
|
766
|
+
var $r = "RadioGroupIndicator", De = s.forwardRef(
|
|
767
767
|
(e, t) => {
|
|
768
768
|
const { __scopeRadioGroup: n, ...o } = e, a = Te(n);
|
|
769
769
|
return /* @__PURE__ */ f(Pe, { ...a, ...o, ref: t });
|
|
770
770
|
}
|
|
771
771
|
);
|
|
772
|
-
De.displayName =
|
|
773
|
-
var Fr =
|
|
772
|
+
De.displayName = $r;
|
|
773
|
+
var Fr = Me, Dr = Fe, Gr = De;
|
|
774
774
|
function Lr(e) {
|
|
775
775
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
776
776
|
}
|
|
@@ -1000,7 +1000,7 @@ const G = "purpur-radio-card-group__item-image", et = (e) => !!(e != null && e.s
|
|
|
1000
1000
|
}), p = C(`${G}-placeholder`, {
|
|
1001
1001
|
[`${G}-placeholder--loaded`]: r
|
|
1002
1002
|
});
|
|
1003
|
-
return /* @__PURE__ */
|
|
1003
|
+
return /* @__PURE__ */ N(me, { children: [
|
|
1004
1004
|
/* @__PURE__ */ f(
|
|
1005
1005
|
"img",
|
|
1006
1006
|
{
|
|
@@ -1015,30 +1015,20 @@ const G = "purpur-radio-card-group__item-image", et = (e) => !!(e != null && e.s
|
|
|
1015
1015
|
!n && /* @__PURE__ */ f(Ge, { className: p })
|
|
1016
1016
|
] });
|
|
1017
1017
|
}, S = "purpur-radio-card-group__item", Y = (e, { disabled: t }) => typeof e == "function" ? e({ disabled: t }) : e, tt = ({ title: e, ...t }, n) => {
|
|
1018
|
-
const {
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
children: r,
|
|
1022
|
-
disabled: i,
|
|
1023
|
-
id: u,
|
|
1024
|
-
image: c,
|
|
1025
|
-
required: p,
|
|
1026
|
-
value: g
|
|
1027
|
-
} = t, m = { ...t };
|
|
1028
|
-
return /* @__PURE__ */ I("div", { className: C(`${S}-container`), ref: n, children: [
|
|
1029
|
-
/* @__PURE__ */ I(
|
|
1018
|
+
const { ["data-testid"]: o, body: a, children: r, disabled: i, id: u, image: c, value: p } = t, _ = { ...t };
|
|
1019
|
+
return /* @__PURE__ */ N("div", { className: C(`${S}-container`), ref: n, children: [
|
|
1020
|
+
/* @__PURE__ */ N(
|
|
1030
1021
|
Dr,
|
|
1031
1022
|
{
|
|
1032
1023
|
className: C(S),
|
|
1033
1024
|
"data-testid": o,
|
|
1034
1025
|
disabled: i,
|
|
1035
1026
|
id: u,
|
|
1036
|
-
|
|
1037
|
-
value: g,
|
|
1027
|
+
value: p,
|
|
1038
1028
|
children: [
|
|
1039
|
-
c && /* @__PURE__ */ f("span", { className: C(`${S}-image-container`), children: et(c) ? /* @__PURE__ */ f(rt, { ...c, "data-testid": o && `${o}-image` }) : Y(c,
|
|
1040
|
-
/* @__PURE__ */
|
|
1041
|
-
/* @__PURE__ */
|
|
1029
|
+
c && /* @__PURE__ */ f("span", { className: C(`${S}-image-container`), children: et(c) ? /* @__PURE__ */ f(rt, { ...c, "data-testid": o && `${o}-image` }) : Y(c, _) }),
|
|
1030
|
+
/* @__PURE__ */ N("span", { className: C(`${S}-content`), children: [
|
|
1031
|
+
/* @__PURE__ */ N("span", { className: C(`${S}-top-container`), children: [
|
|
1042
1032
|
typeof e == "string" ? /* @__PURE__ */ f(
|
|
1043
1033
|
J,
|
|
1044
1034
|
{
|
|
@@ -1048,7 +1038,7 @@ const G = "purpur-radio-card-group__item-image", et = (e) => !!(e != null && e.s
|
|
|
1048
1038
|
disabled: i,
|
|
1049
1039
|
children: e
|
|
1050
1040
|
}
|
|
1051
|
-
) : Y(e,
|
|
1041
|
+
) : Y(e, _),
|
|
1052
1042
|
/* @__PURE__ */ f("span", { className: C(`${S}-radio`), children: /* @__PURE__ */ f(Gr, { className: C(`${S}-indicator`) }) })
|
|
1053
1043
|
] }),
|
|
1054
1044
|
a && /* @__PURE__ */ f("span", { className: C(`${S}-bottom-container`), children: typeof a == "string" ? /* @__PURE__ */ f(
|
|
@@ -1059,7 +1049,7 @@ const G = "purpur-radio-card-group__item-image", et = (e) => !!(e != null && e.s
|
|
|
1059
1049
|
disabled: i,
|
|
1060
1050
|
children: a
|
|
1061
1051
|
}
|
|
1062
|
-
) : Y(a,
|
|
1052
|
+
) : Y(a, _) })
|
|
1063
1053
|
] })
|
|
1064
1054
|
]
|
|
1065
1055
|
}
|
|
@@ -1074,30 +1064,33 @@ const nt = (e) => Ke(e) && (e == null ? void 0 : e.type) === te, dt = ["horizont
|
|
|
1074
1064
|
children: n,
|
|
1075
1065
|
className: o,
|
|
1076
1066
|
items: a,
|
|
1077
|
-
|
|
1078
|
-
|
|
1067
|
+
heading: r,
|
|
1068
|
+
headingTag: i = "h2",
|
|
1079
1069
|
loop: u = !0,
|
|
1080
1070
|
orientation: c = "vertical",
|
|
1081
1071
|
radioPosition: p = "right",
|
|
1082
|
-
...
|
|
1072
|
+
..._
|
|
1083
1073
|
}, m) => {
|
|
1084
|
-
const
|
|
1085
|
-
return /* @__PURE__ */
|
|
1086
|
-
r && /* @__PURE__ */
|
|
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(
|
|
1087
1077
|
ge,
|
|
1088
1078
|
{
|
|
1089
|
-
"data-testid": e ? `${e}-
|
|
1090
|
-
id: `${
|
|
1079
|
+
"data-testid": e ? `${e}-heading` : void 0,
|
|
1080
|
+
id: `${_.id}-heading`,
|
|
1091
1081
|
tag: i,
|
|
1092
1082
|
variant: "subsection-100",
|
|
1093
|
-
children:
|
|
1083
|
+
children: [
|
|
1084
|
+
_.required && /* @__PURE__ */ f("span", { "aria-hidden": !0, children: "* " }),
|
|
1085
|
+
r
|
|
1086
|
+
]
|
|
1094
1087
|
}
|
|
1095
1088
|
),
|
|
1096
|
-
(!!(a != null && a.length) ||
|
|
1089
|
+
(!!(a != null && a.length) || g.length) && /* @__PURE__ */ N(
|
|
1097
1090
|
Fr,
|
|
1098
1091
|
{
|
|
1099
|
-
...
|
|
1100
|
-
"aria-labelledby": t || (r ? `${
|
|
1092
|
+
..._,
|
|
1093
|
+
"aria-labelledby": t || (r ? `${_.id}-heading` : void 0),
|
|
1101
1094
|
className: C(
|
|
1102
1095
|
L,
|
|
1103
1096
|
`${L}--${c}`,
|
|
@@ -1110,14 +1103,14 @@ const nt = (e) => Ke(e) && (e == null ? void 0 : e.type) === te, dt = ["horizont
|
|
|
1110
1103
|
te,
|
|
1111
1104
|
{
|
|
1112
1105
|
...d,
|
|
1113
|
-
disabled: d.disabled ||
|
|
1106
|
+
disabled: d.disabled || _.disabled,
|
|
1114
1107
|
"data-testid": e ? `${e}-item` : void 0
|
|
1115
1108
|
},
|
|
1116
1109
|
d.id
|
|
1117
1110
|
)),
|
|
1118
1111
|
ae.map(
|
|
1119
|
-
|
|
1120
|
-
(d) => Be(d, { disabled: d.props.disabled ||
|
|
1112
|
+
g,
|
|
1113
|
+
(d) => Be(d, { disabled: d.props.disabled || _.disabled })
|
|
1121
1114
|
)
|
|
1122
1115
|
]
|
|
1123
1116
|
}
|