@purpurds/radio-card-group 4.3.0 → 4.4.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/classnames.d.ts +1 -1
- package/dist/radio-card-group.cjs.js +2 -2
- package/dist/radio-card-group.cjs.js.map +1 -1
- package/dist/radio-card-group.d.ts +5 -4
- package/dist/radio-card-group.es.js +85 -85
- package/dist/radio-card-group.es.js.map +1 -1
- package/dist/radio-card-item-image.d.ts +2 -1
- package/dist/radio-card-item.d.ts +3 -2
- package/package.json +16 -16
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { RadioCardItemProps } from './radio-card-item';
|
|
2
|
+
import { default as React, ReactNode, Ref } from 'react';
|
|
3
|
+
|
|
3
4
|
export type RadioCardGroupItem = RadioCardItemProps & {
|
|
4
5
|
ref?: Ref<HTMLDivElement>;
|
|
5
6
|
};
|
|
@@ -68,6 +69,6 @@ export type RadioCardGroupProps = {
|
|
|
68
69
|
children?: ReactNode;
|
|
69
70
|
};
|
|
70
71
|
export declare const RadioCardGroup: React.ForwardRefExoticComponent<RadioCardGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
71
|
-
export type { RadioCardItemProps } from
|
|
72
|
-
export { RadioCardItem } from
|
|
72
|
+
export type { RadioCardItemProps } from './radio-card-item';
|
|
73
|
+
export { RadioCardItem } from './radio-card-item';
|
|
73
74
|
//# sourceMappingURL=radio-card-group.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as v, jsxs as M, Fragment as Le } from "react/jsx-runtime";
|
|
2
2
|
import * as _e from "react";
|
|
3
|
-
import A, { useCallback as k, createContext as ae, useMemo as z, createElement as
|
|
3
|
+
import A, { useCallback as k, createContext as ae, useMemo as z, createElement as b, useContext as me, forwardRef as R, Children as P, isValidElement as U, cloneElement as Z, Fragment as De, useEffect as T, useLayoutEffect as Ge, useRef as S, useState as F, useReducer as ze } from "react";
|
|
4
4
|
import { flushSync as Ue } from "react-dom";
|
|
5
5
|
function je(e) {
|
|
6
6
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
7
7
|
}
|
|
8
|
-
var
|
|
8
|
+
var be = { exports: {} };
|
|
9
9
|
/*!
|
|
10
10
|
Copyright (c) 2018 Jed Watson.
|
|
11
11
|
Licensed under the MIT License (MIT), see
|
|
@@ -40,8 +40,8 @@ var me = { exports: {} };
|
|
|
40
40
|
}
|
|
41
41
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
42
42
|
})();
|
|
43
|
-
})(
|
|
44
|
-
var Be =
|
|
43
|
+
})(be);
|
|
44
|
+
var Be = be.exports;
|
|
45
45
|
const Ve = /* @__PURE__ */ je(Be), V = {
|
|
46
46
|
"purpur-heading": "_purpur-heading_1g237_1",
|
|
47
47
|
"purpur-heading--hyphens": "_purpur-heading--hyphens_1g237_8",
|
|
@@ -88,17 +88,17 @@ const Ve = /* @__PURE__ */ je(Be), V = {
|
|
|
88
88
|
]);
|
|
89
89
|
return /* @__PURE__ */ v(s, { ...c, className: u, "data-testid": e, children: n });
|
|
90
90
|
};
|
|
91
|
-
function
|
|
92
|
-
return
|
|
91
|
+
function I() {
|
|
92
|
+
return I = Object.assign ? Object.assign.bind() : function(e) {
|
|
93
93
|
for (var n = 1; n < arguments.length; n++) {
|
|
94
94
|
var t = arguments[n];
|
|
95
95
|
for (var o in t)
|
|
96
96
|
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
97
97
|
}
|
|
98
98
|
return e;
|
|
99
|
-
},
|
|
99
|
+
}, I.apply(this, arguments);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function x(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
|
|
102
102
|
return function(i) {
|
|
103
103
|
if (e == null || e(i), t === !1 || !i.defaultPrevented)
|
|
104
104
|
return n == null ? void 0 : n(i);
|
|
@@ -124,16 +124,16 @@ function J(e, n = []) {
|
|
|
124
124
|
a
|
|
125
125
|
];
|
|
126
126
|
function u(l) {
|
|
127
|
-
const { scope: f, children: p, ...d } = l,
|
|
127
|
+
const { scope: f, children: p, ...d } = l, m = (f == null ? void 0 : f[e][s]) || c, h = z(
|
|
128
128
|
() => d,
|
|
129
129
|
Object.values(d)
|
|
130
130
|
);
|
|
131
|
-
return /* @__PURE__ */ m
|
|
131
|
+
return /* @__PURE__ */ b(m.Provider, {
|
|
132
132
|
value: h
|
|
133
133
|
}, p);
|
|
134
134
|
}
|
|
135
135
|
function _(l, f) {
|
|
136
|
-
const p = (f == null ? void 0 : f[e][s]) || c, d =
|
|
136
|
+
const p = (f == null ? void 0 : f[e][s]) || c, d = me(p);
|
|
137
137
|
if (d)
|
|
138
138
|
return d;
|
|
139
139
|
if (a !== void 0)
|
|
@@ -213,11 +213,11 @@ const W = /* @__PURE__ */ R((e, n) => {
|
|
|
213
213
|
const { children: t, ...o } = e, i = P.toArray(t), r = i.find(Xe);
|
|
214
214
|
if (r) {
|
|
215
215
|
const a = r.props.children, c = i.map((s) => s === r ? P.count(a) > 1 ? P.only(null) : /* @__PURE__ */ U(a) ? a.props.children : null : s);
|
|
216
|
-
return /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ b(ie, O({}, o, {
|
|
217
217
|
ref: n
|
|
218
218
|
}), /* @__PURE__ */ U(a) ? /* @__PURE__ */ Z(a, void 0, c) : null);
|
|
219
219
|
}
|
|
220
|
-
return /* @__PURE__ */
|
|
220
|
+
return /* @__PURE__ */ b(ie, O({}, o, {
|
|
221
221
|
ref: n
|
|
222
222
|
}), t);
|
|
223
223
|
});
|
|
@@ -230,7 +230,7 @@ const ie = /* @__PURE__ */ R((e, n) => {
|
|
|
230
230
|
}) : P.count(t) > 1 ? P.only(null) : null;
|
|
231
231
|
});
|
|
232
232
|
ie.displayName = "SlotClone";
|
|
233
|
-
const We = ({ children: e }) => /* @__PURE__ */
|
|
233
|
+
const We = ({ children: e }) => /* @__PURE__ */ b(De, null, e);
|
|
234
234
|
function Xe(e) {
|
|
235
235
|
return /* @__PURE__ */ U(e) && e.type === We;
|
|
236
236
|
}
|
|
@@ -277,7 +277,7 @@ const Je = [
|
|
|
277
277
|
const { asChild: r, ...a } = o, c = r ? W : n;
|
|
278
278
|
return T(() => {
|
|
279
279
|
window[Symbol.for("radix-ui")] = !0;
|
|
280
|
-
}, []), /* @__PURE__ */
|
|
280
|
+
}, []), /* @__PURE__ */ b(c, O({}, a, {
|
|
281
281
|
ref: i
|
|
282
282
|
}));
|
|
283
283
|
});
|
|
@@ -293,19 +293,19 @@ function Qe(e) {
|
|
|
293
293
|
},
|
|
294
294
|
itemMap: /* @__PURE__ */ new Map()
|
|
295
295
|
}), a = (p) => {
|
|
296
|
-
const { scope: d, children:
|
|
296
|
+
const { scope: d, children: m } = p, h = A.useRef(null), $ = A.useRef(/* @__PURE__ */ new Map()).current;
|
|
297
297
|
return /* @__PURE__ */ A.createElement(i, {
|
|
298
298
|
scope: d,
|
|
299
299
|
itemMap: $,
|
|
300
300
|
collectionRef: h
|
|
301
|
-
},
|
|
301
|
+
}, m);
|
|
302
302
|
}, c = e + "CollectionSlot", s = /* @__PURE__ */ A.forwardRef((p, d) => {
|
|
303
|
-
const { scope:
|
|
303
|
+
const { scope: m, children: h } = p, $ = r(c, m), g = L(d, $.collectionRef);
|
|
304
304
|
return /* @__PURE__ */ A.createElement(W, {
|
|
305
305
|
ref: g
|
|
306
306
|
}, h);
|
|
307
307
|
}), u = e + "CollectionItemSlot", _ = "data-radix-collection-item", l = /* @__PURE__ */ A.forwardRef((p, d) => {
|
|
308
|
-
const { scope:
|
|
308
|
+
const { scope: m, children: h, ...$ } = p, g = A.useRef(null), B = L(d, g), E = r(u, m);
|
|
309
309
|
return A.useEffect(() => (E.itemMap.set(g, {
|
|
310
310
|
ref: g,
|
|
311
311
|
...$
|
|
@@ -346,12 +346,12 @@ let rr = 0;
|
|
|
346
346
|
function tr(e) {
|
|
347
347
|
const [n, t] = _e.useState(er());
|
|
348
348
|
return X(() => {
|
|
349
|
-
|
|
349
|
+
t(
|
|
350
350
|
(o) => o ?? String(rr++)
|
|
351
351
|
);
|
|
352
352
|
}, [
|
|
353
353
|
e
|
|
354
|
-
]),
|
|
354
|
+
]), n ? `radix-${n}` : "";
|
|
355
355
|
}
|
|
356
356
|
function ue(e) {
|
|
357
357
|
const n = S(e);
|
|
@@ -399,7 +399,7 @@ function nr({ defaultProp: e, onChange: n }) {
|
|
|
399
399
|
}
|
|
400
400
|
const or = /* @__PURE__ */ ae(void 0);
|
|
401
401
|
function he(e) {
|
|
402
|
-
const n =
|
|
402
|
+
const n = me(or);
|
|
403
403
|
return e || n || "ltr";
|
|
404
404
|
}
|
|
405
405
|
const re = "rovingFocusGroup.onEntryFocus", ar = {
|
|
@@ -407,14 +407,14 @@ const re = "rovingFocusGroup.onEntryFocus", ar = {
|
|
|
407
407
|
cancelable: !0
|
|
408
408
|
}, se = "RovingFocusGroup", [ce, ve, ir] = Qe(se), [cr, ye] = J(se, [
|
|
409
409
|
ir
|
|
410
|
-
]), [ur, sr] = cr(se), dr = /* @__PURE__ */ R((e, n) => /* @__PURE__ */
|
|
410
|
+
]), [ur, sr] = cr(se), dr = /* @__PURE__ */ R((e, n) => /* @__PURE__ */ b(ce.Provider, {
|
|
411
411
|
scope: e.__scopeRovingFocusGroup
|
|
412
|
-
}, /* @__PURE__ */
|
|
412
|
+
}, /* @__PURE__ */ b(ce.Slot, {
|
|
413
413
|
scope: e.__scopeRovingFocusGroup
|
|
414
|
-
}, /* @__PURE__ */
|
|
414
|
+
}, /* @__PURE__ */ b(pr, O({}, e, {
|
|
415
415
|
ref: n
|
|
416
416
|
}))))), pr = /* @__PURE__ */ R((e, n) => {
|
|
417
|
-
const { __scopeRovingFocusGroup: t, orientation: o, loop: i = !1, dir: r, currentTabStopId: a, defaultCurrentTabStopId: c, onCurrentTabStopIdChange: s, onEntryFocus: u, ..._ } = e, l = S(null), f = L(n, l), p = he(r), [d = null,
|
|
417
|
+
const { __scopeRovingFocusGroup: t, orientation: o, loop: i = !1, dir: r, currentTabStopId: a, defaultCurrentTabStopId: c, onCurrentTabStopIdChange: s, onEntryFocus: u, ..._ } = e, l = S(null), f = L(n, l), p = he(r), [d = null, m] = ge({
|
|
418
418
|
prop: a,
|
|
419
419
|
defaultProp: c,
|
|
420
420
|
onChange: s
|
|
@@ -425,16 +425,16 @@ const re = "rovingFocusGroup.onEntryFocus", ar = {
|
|
|
425
425
|
return y.addEventListener(re, g), () => y.removeEventListener(re, g);
|
|
426
426
|
}, [
|
|
427
427
|
g
|
|
428
|
-
]), /* @__PURE__ */
|
|
428
|
+
]), /* @__PURE__ */ b(ur, {
|
|
429
429
|
scope: t,
|
|
430
430
|
orientation: o,
|
|
431
431
|
dir: p,
|
|
432
432
|
loop: i,
|
|
433
433
|
currentTabStopId: d,
|
|
434
434
|
onItemFocus: k(
|
|
435
|
-
(y) =>
|
|
435
|
+
(y) => m(y),
|
|
436
436
|
[
|
|
437
|
-
|
|
437
|
+
m
|
|
438
438
|
]
|
|
439
439
|
),
|
|
440
440
|
onItemShiftTab: k(
|
|
@@ -453,7 +453,7 @@ const re = "rovingFocusGroup.onEntryFocus", ar = {
|
|
|
453
453
|
),
|
|
454
454
|
[]
|
|
455
455
|
)
|
|
456
|
-
}, /* @__PURE__ */
|
|
456
|
+
}, /* @__PURE__ */ b(j.div, O({
|
|
457
457
|
tabIndex: h || Q === 0 ? -1 : 0,
|
|
458
458
|
"data-orientation": o
|
|
459
459
|
}, _, {
|
|
@@ -462,10 +462,10 @@ const re = "rovingFocusGroup.onEntryFocus", ar = {
|
|
|
462
462
|
outline: "none",
|
|
463
463
|
...e.style
|
|
464
464
|
},
|
|
465
|
-
onMouseDown:
|
|
465
|
+
onMouseDown: x(e.onMouseDown, () => {
|
|
466
466
|
E.current = !0;
|
|
467
467
|
}),
|
|
468
|
-
onFocus:
|
|
468
|
+
onFocus: x(e.onFocus, (y) => {
|
|
469
469
|
const we = !E.current;
|
|
470
470
|
if (y.target === y.currentTarget && we && !h) {
|
|
471
471
|
const le = new CustomEvent(re, ar);
|
|
@@ -488,7 +488,7 @@ const re = "rovingFocusGroup.onEntryFocus", ar = {
|
|
|
488
488
|
}
|
|
489
489
|
E.current = !1;
|
|
490
490
|
}),
|
|
491
|
-
onBlur:
|
|
491
|
+
onBlur: x(
|
|
492
492
|
e.onBlur,
|
|
493
493
|
() => $(!1)
|
|
494
494
|
)
|
|
@@ -502,42 +502,42 @@ const re = "rovingFocusGroup.onEntryFocus", ar = {
|
|
|
502
502
|
o,
|
|
503
503
|
f,
|
|
504
504
|
p
|
|
505
|
-
]), /* @__PURE__ */
|
|
505
|
+
]), /* @__PURE__ */ b(ce.ItemSlot, {
|
|
506
506
|
scope: t,
|
|
507
507
|
id: s,
|
|
508
508
|
focusable: o,
|
|
509
509
|
active: i
|
|
510
|
-
}, /* @__PURE__ */
|
|
510
|
+
}, /* @__PURE__ */ b(j.span, O({
|
|
511
511
|
tabIndex: _ ? 0 : -1,
|
|
512
512
|
"data-orientation": u.orientation
|
|
513
513
|
}, a, {
|
|
514
514
|
ref: n,
|
|
515
|
-
onMouseDown:
|
|
515
|
+
onMouseDown: x(e.onMouseDown, (d) => {
|
|
516
516
|
o ? u.onItemFocus(s) : d.preventDefault();
|
|
517
517
|
}),
|
|
518
|
-
onFocus:
|
|
518
|
+
onFocus: x(
|
|
519
519
|
e.onFocus,
|
|
520
520
|
() => u.onItemFocus(s)
|
|
521
521
|
),
|
|
522
|
-
onKeyDown:
|
|
522
|
+
onKeyDown: x(e.onKeyDown, (d) => {
|
|
523
523
|
if (d.key === "Tab" && d.shiftKey) {
|
|
524
524
|
u.onItemShiftTab();
|
|
525
525
|
return;
|
|
526
526
|
}
|
|
527
527
|
if (d.target !== d.currentTarget)
|
|
528
528
|
return;
|
|
529
|
-
const
|
|
530
|
-
if (
|
|
529
|
+
const m = br(d, u.orientation, u.dir);
|
|
530
|
+
if (m !== void 0) {
|
|
531
531
|
d.preventDefault();
|
|
532
532
|
let $ = l().filter(
|
|
533
533
|
(g) => g.focusable
|
|
534
534
|
).map(
|
|
535
535
|
(g) => g.ref.current
|
|
536
536
|
);
|
|
537
|
-
if (
|
|
537
|
+
if (m === "last")
|
|
538
538
|
$.reverse();
|
|
539
|
-
else if (
|
|
540
|
-
|
|
539
|
+
else if (m === "prev" || m === "next") {
|
|
540
|
+
m === "prev" && $.reverse();
|
|
541
541
|
const g = $.indexOf(d.currentTarget);
|
|
542
542
|
$ = u.loop ? $r($, g + 1) : $.slice(g + 1);
|
|
543
543
|
}
|
|
@@ -557,11 +557,11 @@ const re = "rovingFocusGroup.onEntryFocus", ar = {
|
|
|
557
557
|
PageDown: "last",
|
|
558
558
|
End: "last"
|
|
559
559
|
};
|
|
560
|
-
function
|
|
560
|
+
function mr(e, n) {
|
|
561
561
|
return n !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
562
562
|
}
|
|
563
|
-
function
|
|
564
|
-
const o =
|
|
563
|
+
function br(e, n, t) {
|
|
564
|
+
const o = mr(e.key, t);
|
|
565
565
|
if (!(n === "vertical" && [
|
|
566
566
|
"ArrowLeft",
|
|
567
567
|
"ArrowRight"
|
|
@@ -698,29 +698,29 @@ function Rr(e) {
|
|
|
698
698
|
function K(e) {
|
|
699
699
|
return (e == null ? void 0 : e.animationName) || "none";
|
|
700
700
|
}
|
|
701
|
-
const Se = "Radio", [Sr, Ae] = J(Se), [Ar,
|
|
701
|
+
const Se = "Radio", [Sr, Ae] = J(Se), [Ar, Ir] = Sr(Se), Nr = /* @__PURE__ */ R((e, n) => {
|
|
702
702
|
const { __scopeRadio: t, name: o, checked: i = !1, required: r, disabled: a, value: c = "on", onCheck: s, ...u } = e, [_, l] = F(null), f = L(
|
|
703
703
|
n,
|
|
704
|
-
(
|
|
704
|
+
(m) => l(m)
|
|
705
705
|
), p = S(!1), d = _ ? !!_.closest("form") : !0;
|
|
706
|
-
return /* @__PURE__ */
|
|
706
|
+
return /* @__PURE__ */ b(Ar, {
|
|
707
707
|
scope: t,
|
|
708
708
|
checked: i,
|
|
709
709
|
disabled: a
|
|
710
|
-
}, /* @__PURE__ */
|
|
710
|
+
}, /* @__PURE__ */ b(j.button, I({
|
|
711
711
|
type: "button",
|
|
712
712
|
role: "radio",
|
|
713
713
|
"aria-checked": i,
|
|
714
|
-
"data-state":
|
|
714
|
+
"data-state": Ie(i),
|
|
715
715
|
"data-disabled": a ? "" : void 0,
|
|
716
716
|
disabled: a,
|
|
717
717
|
value: c
|
|
718
718
|
}, u, {
|
|
719
719
|
ref: f,
|
|
720
|
-
onClick:
|
|
721
|
-
i || s == null || s(), d && (p.current =
|
|
720
|
+
onClick: x(e.onClick, (m) => {
|
|
721
|
+
i || s == null || s(), d && (p.current = m.isPropagationStopped(), p.current || m.stopPropagation());
|
|
722
722
|
})
|
|
723
|
-
})), d && /* @__PURE__ */
|
|
723
|
+
})), d && /* @__PURE__ */ b(Pr, {
|
|
724
724
|
control: _,
|
|
725
725
|
bubbles: !p.current,
|
|
726
726
|
name: o,
|
|
@@ -732,12 +732,12 @@ const Se = "Radio", [Sr, Ae] = J(Se), [Ar, Nr] = Sr(Se), xr = /* @__PURE__ */ R(
|
|
|
732
732
|
transform: "translateX(-100%)"
|
|
733
733
|
}
|
|
734
734
|
}));
|
|
735
|
-
}),
|
|
736
|
-
const { __scopeRadio: t, forceMount: o, ...i } = e, r =
|
|
737
|
-
return /* @__PURE__ */
|
|
735
|
+
}), xr = "RadioIndicator", Er = /* @__PURE__ */ R((e, n) => {
|
|
736
|
+
const { __scopeRadio: t, forceMount: o, ...i } = e, r = Ir(xr, t);
|
|
737
|
+
return /* @__PURE__ */ b(Re, {
|
|
738
738
|
present: o || r.checked
|
|
739
|
-
}, /* @__PURE__ */
|
|
740
|
-
"data-state":
|
|
739
|
+
}, /* @__PURE__ */ b(j.span, I({
|
|
740
|
+
"data-state": Ie(r.checked),
|
|
741
741
|
"data-disabled": r.disabled ? "" : void 0
|
|
742
742
|
}, i, {
|
|
743
743
|
ref: n
|
|
@@ -756,7 +756,7 @@ const Se = "Radio", [Sr, Ae] = J(Se), [Ar, Nr] = Sr(Se), xr = /* @__PURE__ */ R(
|
|
|
756
756
|
a,
|
|
757
757
|
t,
|
|
758
758
|
o
|
|
759
|
-
]), /* @__PURE__ */
|
|
759
|
+
]), /* @__PURE__ */ b("input", I({
|
|
760
760
|
type: "radio",
|
|
761
761
|
"aria-hidden": !0,
|
|
762
762
|
defaultChecked: t
|
|
@@ -773,7 +773,7 @@ const Se = "Radio", [Sr, Ae] = J(Se), [Ar, Nr] = Sr(Se), xr = /* @__PURE__ */ R(
|
|
|
773
773
|
}
|
|
774
774
|
}));
|
|
775
775
|
};
|
|
776
|
-
function
|
|
776
|
+
function Ie(e) {
|
|
777
777
|
return e ? "checked" : "unchecked";
|
|
778
778
|
}
|
|
779
779
|
const Or = [
|
|
@@ -781,29 +781,29 @@ const Or = [
|
|
|
781
781
|
"ArrowDown",
|
|
782
782
|
"ArrowLeft",
|
|
783
783
|
"ArrowRight"
|
|
784
|
-
],
|
|
784
|
+
], Ne = "RadioGroup", [Tr, pt] = J(Ne, [
|
|
785
785
|
ye,
|
|
786
786
|
Ae
|
|
787
|
-
]),
|
|
788
|
-
const { __scopeRadioGroup: t, name: o, defaultValue: i, value: r, required: a = !1, disabled: c = !1, orientation: s, dir: u, loop: _ = !0, onValueChange: l, ...f } = e, p =
|
|
787
|
+
]), xe = ye(), Ee = Ae(), [wr, Mr] = Tr(Ne), kr = /* @__PURE__ */ R((e, n) => {
|
|
788
|
+
const { __scopeRadioGroup: t, name: o, defaultValue: i, value: r, required: a = !1, disabled: c = !1, orientation: s, dir: u, loop: _ = !0, onValueChange: l, ...f } = e, p = xe(t), d = he(u), [m, h] = ge({
|
|
789
789
|
prop: r,
|
|
790
790
|
defaultProp: i,
|
|
791
791
|
onChange: l
|
|
792
792
|
});
|
|
793
|
-
return /* @__PURE__ */
|
|
793
|
+
return /* @__PURE__ */ b(wr, {
|
|
794
794
|
scope: t,
|
|
795
795
|
name: o,
|
|
796
796
|
required: a,
|
|
797
797
|
disabled: c,
|
|
798
|
-
value:
|
|
798
|
+
value: m,
|
|
799
799
|
onValueChange: h
|
|
800
|
-
}, /* @__PURE__ */
|
|
800
|
+
}, /* @__PURE__ */ b(gr, I({
|
|
801
801
|
asChild: !0
|
|
802
802
|
}, p, {
|
|
803
803
|
orientation: s,
|
|
804
804
|
dir: d,
|
|
805
805
|
loop: _
|
|
806
|
-
}), /* @__PURE__ */
|
|
806
|
+
}), /* @__PURE__ */ b(j.div, I({
|
|
807
807
|
role: "radiogroup",
|
|
808
808
|
"aria-required": a,
|
|
809
809
|
"aria-orientation": s,
|
|
@@ -813,20 +813,20 @@ const Or = [
|
|
|
813
813
|
ref: n
|
|
814
814
|
}))));
|
|
815
815
|
}), Fr = "RadioGroupItem", Lr = /* @__PURE__ */ R((e, n) => {
|
|
816
|
-
const { __scopeRadioGroup: t, disabled: o, ...i } = e, r = Mr(Fr, t), a = r.disabled || o, c =
|
|
816
|
+
const { __scopeRadioGroup: t, disabled: o, ...i } = e, r = Mr(Fr, t), a = r.disabled || o, c = xe(t), s = Ee(t), u = S(null), _ = L(n, u), l = r.value === i.value, f = S(!1);
|
|
817
817
|
return T(() => {
|
|
818
|
-
const p = (
|
|
819
|
-
Or.includes(
|
|
818
|
+
const p = (m) => {
|
|
819
|
+
Or.includes(m.key) && (f.current = !0);
|
|
820
820
|
}, d = () => f.current = !1;
|
|
821
821
|
return document.addEventListener("keydown", p), document.addEventListener("keyup", d), () => {
|
|
822
822
|
document.removeEventListener("keydown", p), document.removeEventListener("keyup", d);
|
|
823
823
|
};
|
|
824
|
-
}, []), /* @__PURE__ */
|
|
824
|
+
}, []), /* @__PURE__ */ b(hr, I({
|
|
825
825
|
asChild: !0
|
|
826
826
|
}, c, {
|
|
827
827
|
focusable: !a,
|
|
828
828
|
active: l
|
|
829
|
-
}), /* @__PURE__ */
|
|
829
|
+
}), /* @__PURE__ */ b(Nr, I({
|
|
830
830
|
disabled: a,
|
|
831
831
|
required: r.required,
|
|
832
832
|
checked: l
|
|
@@ -834,17 +834,17 @@ const Or = [
|
|
|
834
834
|
name: r.name,
|
|
835
835
|
ref: _,
|
|
836
836
|
onCheck: () => r.onValueChange(i.value),
|
|
837
|
-
onKeyDown:
|
|
837
|
+
onKeyDown: x((p) => {
|
|
838
838
|
p.key === "Enter" && p.preventDefault();
|
|
839
839
|
}),
|
|
840
|
-
onFocus:
|
|
840
|
+
onFocus: x(i.onFocus, () => {
|
|
841
841
|
var p;
|
|
842
842
|
f.current && ((p = u.current) === null || p === void 0 || p.click());
|
|
843
843
|
})
|
|
844
844
|
})));
|
|
845
845
|
}), Dr = /* @__PURE__ */ R((e, n) => {
|
|
846
846
|
const { __scopeRadioGroup: t, ...o } = e, i = Ee(t);
|
|
847
|
-
return /* @__PURE__ */
|
|
847
|
+
return /* @__PURE__ */ b(Er, I({}, i, o, {
|
|
848
848
|
ref: n
|
|
849
849
|
}));
|
|
850
850
|
}), Gr = kr, zr = Lr, Ur = Dr;
|
|
@@ -1088,7 +1088,7 @@ const Jr = /* @__PURE__ */ Xr(Zr), Qr = "_loading_93tal_1", te = {
|
|
|
1088
1088
|
),
|
|
1089
1089
|
!t && /* @__PURE__ */ v(et, { className: u })
|
|
1090
1090
|
] });
|
|
1091
|
-
},
|
|
1091
|
+
}, N = "purpur-radio-card-group__item", oe = (e, { disabled: n }) => typeof e == "function" ? e({ disabled: n }) : e, nt = (e, n) => {
|
|
1092
1092
|
const {
|
|
1093
1093
|
["data-testid"]: t,
|
|
1094
1094
|
body: o,
|
|
@@ -1100,33 +1100,33 @@ const Jr = /* @__PURE__ */ Xr(Zr), Qr = "_loading_93tal_1", te = {
|
|
|
1100
1100
|
title: u,
|
|
1101
1101
|
value: _
|
|
1102
1102
|
} = e;
|
|
1103
|
-
return /* @__PURE__ */ M("div", { className: C(`${
|
|
1103
|
+
return /* @__PURE__ */ M("div", { className: C(`${N}-container`), ref: n, children: [
|
|
1104
1104
|
/* @__PURE__ */ M(
|
|
1105
1105
|
zr,
|
|
1106
1106
|
{
|
|
1107
|
-
className: C(
|
|
1107
|
+
className: C(N),
|
|
1108
1108
|
"data-testid": t,
|
|
1109
1109
|
disabled: r,
|
|
1110
1110
|
id: a,
|
|
1111
1111
|
required: s,
|
|
1112
1112
|
value: _,
|
|
1113
1113
|
children: [
|
|
1114
|
-
c && /* @__PURE__ */ v("span", { className: C(`${
|
|
1115
|
-
/* @__PURE__ */ M("span", { className: C(`${
|
|
1116
|
-
/* @__PURE__ */ M("span", { className: C(`${
|
|
1114
|
+
c && /* @__PURE__ */ v("span", { className: C(`${N}-image-container`), children: rt(c) ? /* @__PURE__ */ v(tt, { ...c, "data-testid": t && `${t}-image` }) : oe(c, e) }),
|
|
1115
|
+
/* @__PURE__ */ M("span", { className: C(`${N}-content`), children: [
|
|
1116
|
+
/* @__PURE__ */ M("span", { className: C(`${N}-top-container`), children: [
|
|
1117
1117
|
typeof u == "string" ? /* @__PURE__ */ v(
|
|
1118
1118
|
fe,
|
|
1119
1119
|
{
|
|
1120
|
-
className: C(`${
|
|
1120
|
+
className: C(`${N}-title`),
|
|
1121
1121
|
"data-testid": t && `${t}-title`,
|
|
1122
1122
|
variant: "paragraph-100",
|
|
1123
1123
|
disabled: r,
|
|
1124
1124
|
children: u
|
|
1125
1125
|
}
|
|
1126
1126
|
) : oe(u, e),
|
|
1127
|
-
/* @__PURE__ */ v("span", { className: C(`${
|
|
1127
|
+
/* @__PURE__ */ v("span", { className: C(`${N}-radio`), children: /* @__PURE__ */ v(Ur, { className: C(`${N}-indicator`) }) })
|
|
1128
1128
|
] }),
|
|
1129
|
-
o && /* @__PURE__ */ v("span", { className: C(`${
|
|
1129
|
+
o && /* @__PURE__ */ v("span", { className: C(`${N}-bottom-container`), children: typeof o == "string" ? /* @__PURE__ */ v(
|
|
1130
1130
|
fe,
|
|
1131
1131
|
{
|
|
1132
1132
|
"data-testid": t && `${t}-body`,
|