@purpurds/radio-card-group 4.1.0 → 4.1.1

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.
@@ -1,8 +1,8 @@
1
- import { jsx as v, jsxs as M, Fragment as Le } from "react/jsx-runtime";
1
+ import { jsx as v, jsxs as k, Fragment as Le } from "react/jsx-runtime";
2
2
  import * as be from "react";
3
- import S, { useCallback as k, createContext as ae, useMemo as D, createElement as m, useContext as _e, forwardRef as C, Children as P, isValidElement as G, cloneElement as W, Fragment as De, useEffect as T, useLayoutEffect as Ge, useRef as R, useState as F, useReducer as Ue } from "react";
4
- import { flushSync as ze } from "react-dom";
5
- function je(e) {
3
+ import A, { useCallback as M, createContext as ae, useMemo as D, createElement as m, useContext as _e, forwardRef as R, Children as w, isValidElement as G, cloneElement as W, Fragment as De, useEffect as O, useLayoutEffect as Ge, useRef as S, useState as F, useReducer as Ue } from "react";
4
+ import { flushSync as je } from "react-dom";
5
+ function Be(e) {
6
6
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
7
7
  }
8
8
  var me = { exports: {} };
@@ -41,8 +41,8 @@ var me = { exports: {} };
41
41
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
42
42
  })();
43
43
  })(me);
44
- var Be = me.exports;
45
- const Ve = /* @__PURE__ */ je(Be), Q = {
44
+ var ze = me.exports;
45
+ const Ve = /* @__PURE__ */ Be(ze), Q = {
46
46
  "purpur-heading": "_purpur-heading_1abfh_1",
47
47
  "purpur-heading--hyphens": "_purpur-heading--hyphens_1abfh_8",
48
48
  "purpur-heading--subsection-100": "_purpur-heading--subsection-100_1abfh_11",
@@ -85,17 +85,17 @@ const Ve = /* @__PURE__ */ je(Be), Q = {
85
85
  ]);
86
86
  return /* @__PURE__ */ v(i, { ...a, className: s, "data-testid": e, children: o });
87
87
  };
88
- function A() {
89
- return A = Object.assign ? Object.assign.bind() : function(e) {
88
+ function I() {
89
+ return I = Object.assign ? Object.assign.bind() : function(e) {
90
90
  for (var o = 1; o < arguments.length; o++) {
91
91
  var t = arguments[o];
92
92
  for (var n in t)
93
93
  Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
94
94
  }
95
95
  return e;
96
- }, A.apply(this, arguments);
96
+ }, I.apply(this, arguments);
97
97
  }
98
- function N(e, o, { checkForDefaultPrevented: t = !0 } = {}) {
98
+ function x(e, o, { checkForDefaultPrevented: t = !0 } = {}) {
99
99
  return function(c) {
100
100
  if (e == null || e(c), t === !1 || !c.defaultPrevented)
101
101
  return o == null ? void 0 : o(c);
@@ -110,7 +110,7 @@ function $e(...e) {
110
110
  );
111
111
  }
112
112
  function L(...e) {
113
- return k($e(...e), e);
113
+ return M($e(...e), e);
114
114
  }
115
115
  function X(e, o = []) {
116
116
  let t = [];
@@ -196,35 +196,35 @@ function Ye(...e) {
196
196
  };
197
197
  return t.scopeName = o.scopeName, t;
198
198
  }
199
- function O() {
200
- return O = Object.assign ? Object.assign.bind() : function(e) {
199
+ function P() {
200
+ return P = Object.assign ? Object.assign.bind() : function(e) {
201
201
  for (var o = 1; o < arguments.length; o++) {
202
202
  var t = arguments[o];
203
203
  for (var n in t)
204
204
  Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
205
205
  }
206
206
  return e;
207
- }, O.apply(this, arguments);
207
+ }, P.apply(this, arguments);
208
208
  }
209
- const H = /* @__PURE__ */ C((e, o) => {
210
- const { children: t, ...n } = e, c = P.toArray(t), r = c.find(Xe);
209
+ const H = /* @__PURE__ */ R((e, o) => {
210
+ const { children: t, ...n } = e, c = w.toArray(t), r = c.find(Xe);
211
211
  if (r) {
212
- const a = r.props.children, i = c.map((s) => s === r ? P.count(a) > 1 ? P.only(null) : /* @__PURE__ */ G(a) ? a.props.children : null : s);
213
- return /* @__PURE__ */ m(ce, O({}, n, {
212
+ const a = r.props.children, i = c.map((s) => s === r ? w.count(a) > 1 ? w.only(null) : /* @__PURE__ */ G(a) ? a.props.children : null : s);
213
+ return /* @__PURE__ */ m(ce, P({}, n, {
214
214
  ref: o
215
215
  }), /* @__PURE__ */ G(a) ? /* @__PURE__ */ W(a, void 0, i) : null);
216
216
  }
217
- return /* @__PURE__ */ m(ce, O({}, n, {
217
+ return /* @__PURE__ */ m(ce, P({}, n, {
218
218
  ref: o
219
219
  }), t);
220
220
  });
221
221
  H.displayName = "Slot";
222
- const ce = /* @__PURE__ */ C((e, o) => {
222
+ const ce = /* @__PURE__ */ R((e, o) => {
223
223
  const { children: t, ...n } = e;
224
224
  return /* @__PURE__ */ G(t) ? /* @__PURE__ */ W(t, {
225
225
  ...Ze(n, t.props),
226
226
  ref: o ? $e(o, t.ref) : t.ref
227
- }) : P.count(t) > 1 ? P.only(null) : null;
227
+ }) : w.count(t) > 1 ? w.only(null) : null;
228
228
  });
229
229
  ce.displayName = "SlotClone";
230
230
  const We = ({ children: e }) => /* @__PURE__ */ m(De, null, e);
@@ -270,11 +270,11 @@ const Je = [
270
270
  "svg",
271
271
  "ul"
272
272
  ], U = Je.reduce((e, o) => {
273
- const t = /* @__PURE__ */ C((n, c) => {
273
+ const t = /* @__PURE__ */ R((n, c) => {
274
274
  const { asChild: r, ...a } = n, i = r ? H : o;
275
- return T(() => {
275
+ return O(() => {
276
276
  window[Symbol.for("radix-ui")] = !0;
277
- }, []), /* @__PURE__ */ m(i, O({}, a, {
277
+ }, []), /* @__PURE__ */ m(i, P({}, a, {
278
278
  ref: c
279
279
  }));
280
280
  });
@@ -290,30 +290,30 @@ function Qe(e) {
290
290
  },
291
291
  itemMap: /* @__PURE__ */ new Map()
292
292
  }), a = (p) => {
293
- const { scope: d, children: _ } = p, g = S.useRef(null), $ = S.useRef(/* @__PURE__ */ new Map()).current;
294
- return /* @__PURE__ */ S.createElement(c, {
293
+ const { scope: d, children: _ } = p, g = A.useRef(null), $ = A.useRef(/* @__PURE__ */ new Map()).current;
294
+ return /* @__PURE__ */ A.createElement(c, {
295
295
  scope: d,
296
296
  itemMap: $,
297
297
  collectionRef: g
298
298
  }, _);
299
- }, i = e + "CollectionSlot", s = /* @__PURE__ */ S.forwardRef((p, d) => {
299
+ }, i = e + "CollectionSlot", s = /* @__PURE__ */ A.forwardRef((p, d) => {
300
300
  const { scope: _, children: g } = p, $ = r(i, _), h = L(d, $.collectionRef);
301
- return /* @__PURE__ */ S.createElement(H, {
301
+ return /* @__PURE__ */ A.createElement(H, {
302
302
  ref: h
303
303
  }, g);
304
- }), u = e + "CollectionItemSlot", b = "data-radix-collection-item", l = /* @__PURE__ */ S.forwardRef((p, d) => {
305
- const { scope: _, children: g, ...$ } = p, h = S.useRef(null), z = L(d, h), E = r(u, _);
306
- return S.useEffect(() => (E.itemMap.set(h, {
304
+ }), u = e + "CollectionItemSlot", b = "data-radix-collection-item", l = /* @__PURE__ */ A.forwardRef((p, d) => {
305
+ const { scope: _, children: g, ...$ } = p, h = A.useRef(null), j = L(d, h), E = r(u, _);
306
+ return A.useEffect(() => (E.itemMap.set(h, {
307
307
  ref: h,
308
308
  ...$
309
- }), () => void E.itemMap.delete(h))), /* @__PURE__ */ S.createElement(H, {
309
+ }), () => void E.itemMap.delete(h))), /* @__PURE__ */ A.createElement(H, {
310
310
  [b]: "",
311
- ref: z
311
+ ref: j
312
312
  }, g);
313
313
  });
314
314
  function f(p) {
315
315
  const d = r(e + "CollectionConsumer", p);
316
- return S.useCallback(() => {
316
+ return A.useCallback(() => {
317
317
  const g = d.collectionRef.current;
318
318
  if (!g)
319
319
  return [];
@@ -351,8 +351,8 @@ function tr(e) {
351
351
  ]), e || (o ? `radix-${o}` : "");
352
352
  }
353
353
  function ue(e) {
354
- const o = R(e);
355
- return T(() => {
354
+ const o = S(e);
355
+ return O(() => {
356
356
  o.current = e;
357
357
  }), D(
358
358
  () => (...t) => {
@@ -367,7 +367,7 @@ function he({ prop: e, defaultProp: o, onChange: t = () => {
367
367
  const [n, c] = or({
368
368
  defaultProp: o,
369
369
  onChange: t
370
- }), r = e !== void 0, a = r ? e : n, i = ue(t), s = k((u) => {
370
+ }), r = e !== void 0, a = r ? e : n, i = ue(t), s = M((u) => {
371
371
  if (r) {
372
372
  const l = typeof u == "function" ? u(e) : u;
373
373
  l !== e && i(l);
@@ -385,8 +385,8 @@ function he({ prop: e, defaultProp: o, onChange: t = () => {
385
385
  ];
386
386
  }
387
387
  function or({ defaultProp: e, onChange: o }) {
388
- const t = F(e), [n] = t, c = R(n), r = ue(o);
389
- return T(() => {
388
+ const t = F(e), [n] = t, c = S(n), r = ue(o);
389
+ return O(() => {
390
390
  c.current !== n && (r(n), c.current = n);
391
391
  }, [
392
392
  n,
@@ -404,19 +404,19 @@ const re = "rovingFocusGroup.onEntryFocus", ar = {
404
404
  cancelable: !0
405
405
  }, se = "RovingFocusGroup", [ie, ve, cr] = Qe(se), [ir, ye] = X(se, [
406
406
  cr
407
- ]), [ur, sr] = ir(se), dr = /* @__PURE__ */ C((e, o) => /* @__PURE__ */ m(ie.Provider, {
407
+ ]), [ur, sr] = ir(se), dr = /* @__PURE__ */ R((e, o) => /* @__PURE__ */ m(ie.Provider, {
408
408
  scope: e.__scopeRovingFocusGroup
409
409
  }, /* @__PURE__ */ m(ie.Slot, {
410
410
  scope: e.__scopeRovingFocusGroup
411
- }, /* @__PURE__ */ m(pr, O({}, e, {
411
+ }, /* @__PURE__ */ m(pr, P({}, e, {
412
412
  ref: o
413
- }))))), pr = /* @__PURE__ */ C((e, o) => {
414
- const { __scopeRovingFocusGroup: t, orientation: n, loop: c = !1, dir: r, currentTabStopId: a, defaultCurrentTabStopId: i, onCurrentTabStopIdChange: s, onEntryFocus: u, ...b } = e, l = R(null), f = L(o, l), p = ge(r), [d = null, _] = he({
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, ...b } = e, l = S(null), f = L(o, l), p = ge(r), [d = null, _] = he({
415
415
  prop: a,
416
416
  defaultProp: i,
417
417
  onChange: s
418
- }), [g, $] = F(!1), h = ue(u), z = ve(t), E = R(!1), [Z, pe] = F(0);
419
- return T(() => {
418
+ }), [g, $] = F(!1), h = ue(u), j = ve(t), E = S(!1), [Z, pe] = F(0);
419
+ return O(() => {
420
420
  const y = l.current;
421
421
  if (y)
422
422
  return y.addEventListener(re, h), () => y.removeEventListener(re, h);
@@ -428,29 +428,29 @@ const re = "rovingFocusGroup.onEntryFocus", ar = {
428
428
  dir: p,
429
429
  loop: c,
430
430
  currentTabStopId: d,
431
- onItemFocus: k(
431
+ onItemFocus: M(
432
432
  (y) => _(y),
433
433
  [
434
434
  _
435
435
  ]
436
436
  ),
437
- onItemShiftTab: k(
437
+ onItemShiftTab: M(
438
438
  () => $(!0),
439
439
  []
440
440
  ),
441
- onFocusableItemAdd: k(
441
+ onFocusableItemAdd: M(
442
442
  () => pe(
443
443
  (y) => y + 1
444
444
  ),
445
445
  []
446
446
  ),
447
- onFocusableItemRemove: k(
447
+ onFocusableItemRemove: M(
448
448
  () => pe(
449
449
  (y) => y - 1
450
450
  ),
451
451
  []
452
452
  )
453
- }, /* @__PURE__ */ m(U.div, O({
453
+ }, /* @__PURE__ */ m(U.div, P({
454
454
  tabIndex: g || Z === 0 ? -1 : 0,
455
455
  "data-orientation": n
456
456
  }, b, {
@@ -459,40 +459,40 @@ const re = "rovingFocusGroup.onEntryFocus", ar = {
459
459
  outline: "none",
460
460
  ...e.style
461
461
  },
462
- onMouseDown: N(e.onMouseDown, () => {
462
+ onMouseDown: x(e.onMouseDown, () => {
463
463
  E.current = !0;
464
464
  }),
465
- onFocus: N(e.onFocus, (y) => {
466
- const we = !E.current;
467
- if (y.target === y.currentTarget && we && !g) {
465
+ onFocus: x(e.onFocus, (y) => {
466
+ const Te = !E.current;
467
+ if (y.target === y.currentTarget && Te && !g) {
468
468
  const le = new CustomEvent(re, ar);
469
469
  if (y.currentTarget.dispatchEvent(le), !le.defaultPrevented) {
470
- const J = z().filter(
471
- (w) => w.focusable
472
- ), Me = J.find(
473
- (w) => w.active
470
+ const J = j().filter(
471
+ (T) => T.focusable
474
472
  ), ke = J.find(
475
- (w) => w.id === d
473
+ (T) => T.active
474
+ ), Me = J.find(
475
+ (T) => T.id === d
476
476
  ), Fe = [
477
- Me,
478
477
  ke,
478
+ Me,
479
479
  ...J
480
480
  ].filter(Boolean).map(
481
- (w) => w.ref.current
481
+ (T) => T.ref.current
482
482
  );
483
- xe(Fe);
483
+ Ce(Fe);
484
484
  }
485
485
  }
486
486
  E.current = !1;
487
487
  }),
488
- onBlur: N(
488
+ onBlur: x(
489
489
  e.onBlur,
490
490
  () => $(!1)
491
491
  )
492
492
  })));
493
- }), lr = "RovingFocusGroupItem", fr = /* @__PURE__ */ C((e, o) => {
493
+ }), lr = "RovingFocusGroupItem", fr = /* @__PURE__ */ R((e, o) => {
494
494
  const { __scopeRovingFocusGroup: t, focusable: n = !0, active: c = !1, tabStopId: r, ...a } = e, i = tr(), s = r || i, u = sr(lr, t), b = u.currentTabStopId === s, l = ve(t), { onFocusableItemAdd: f, onFocusableItemRemove: p } = u;
495
- return T(() => {
495
+ return O(() => {
496
496
  if (n)
497
497
  return f(), () => p();
498
498
  }, [
@@ -504,19 +504,19 @@ const re = "rovingFocusGroup.onEntryFocus", ar = {
504
504
  id: s,
505
505
  focusable: n,
506
506
  active: c
507
- }, /* @__PURE__ */ m(U.span, O({
507
+ }, /* @__PURE__ */ m(U.span, P({
508
508
  tabIndex: b ? 0 : -1,
509
509
  "data-orientation": u.orientation
510
510
  }, a, {
511
511
  ref: o,
512
- onMouseDown: N(e.onMouseDown, (d) => {
512
+ onMouseDown: x(e.onMouseDown, (d) => {
513
513
  n ? u.onItemFocus(s) : d.preventDefault();
514
514
  }),
515
- onFocus: N(
515
+ onFocus: x(
516
516
  e.onFocus,
517
517
  () => u.onItemFocus(s)
518
518
  ),
519
- onKeyDown: N(e.onKeyDown, (d) => {
519
+ onKeyDown: x(e.onKeyDown, (d) => {
520
520
  if (d.key === "Tab" && d.shiftKey) {
521
521
  u.onItemShiftTab();
522
522
  return;
@@ -539,7 +539,7 @@ const re = "rovingFocusGroup.onEntryFocus", ar = {
539
539
  $ = u.loop ? $r($, h + 1) : $.slice(h + 1);
540
540
  }
541
541
  setTimeout(
542
- () => xe($)
542
+ () => Ce($)
543
543
  );
544
544
  }
545
545
  })
@@ -568,7 +568,7 @@ function mr(e, o, t) {
568
568
  ].includes(n)))
569
569
  return br[n];
570
570
  }
571
- function xe(e) {
571
+ function Ce(e) {
572
572
  const o = document.activeElement;
573
573
  for (const t of e)
574
574
  if (t === o || (t.focus(), document.activeElement !== o))
@@ -613,7 +613,7 @@ function vr(e) {
613
613
  ]), o;
614
614
  }
615
615
  function yr(e) {
616
- const o = R({
616
+ const o = S({
617
617
  value: e,
618
618
  previous: e
619
619
  });
@@ -621,23 +621,23 @@ function yr(e) {
621
621
  e
622
622
  ]);
623
623
  }
624
- function xr(e, o) {
624
+ function Cr(e, o) {
625
625
  return Ue((t, n) => {
626
626
  const c = o[t][n];
627
627
  return c ?? t;
628
628
  }, e);
629
629
  }
630
- const Ce = (e) => {
631
- const { present: o, children: t } = e, n = Cr(o), c = typeof t == "function" ? t({
630
+ const Re = (e) => {
631
+ const { present: o, children: t } = e, n = Rr(o), c = typeof t == "function" ? t({
632
632
  present: n.isPresent
633
- }) : P.only(t), r = L(n.ref, c.ref);
633
+ }) : w.only(t), r = L(n.ref, c.ref);
634
634
  return typeof t == "function" || n.isPresent ? /* @__PURE__ */ W(c, {
635
635
  ref: r
636
636
  }) : null;
637
637
  };
638
- Ce.displayName = "Presence";
639
- function Cr(e) {
640
- const [o, t] = F(), n = R({}), c = R(e), r = R("none"), a = e ? "mounted" : "unmounted", [i, s] = xr(a, {
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
641
  mounted: {
642
642
  UNMOUNT: "unmounted",
643
643
  ANIMATION_OUT: "unmountSuspended"
@@ -650,15 +650,15 @@ function Cr(e) {
650
650
  MOUNT: "mounted"
651
651
  }
652
652
  });
653
- return T(() => {
654
- const u = j(n.current);
653
+ return O(() => {
654
+ const u = B(n.current);
655
655
  r.current = i === "mounted" ? u : "none";
656
656
  }, [
657
657
  i
658
658
  ]), Y(() => {
659
659
  const u = n.current, b = c.current;
660
660
  if (b !== e) {
661
- const f = r.current, p = j(u);
661
+ const f = r.current, p = B(u);
662
662
  e ? s("MOUNT") : p === "none" || (u == null ? void 0 : u.display) === "none" ? s("UNMOUNT") : s(b && f !== p ? "ANIMATION_OUT" : "UNMOUNT"), c.current = e;
663
663
  }
664
664
  }, [
@@ -667,12 +667,12 @@ function Cr(e) {
667
667
  ]), Y(() => {
668
668
  if (o) {
669
669
  const u = (l) => {
670
- const p = j(n.current).includes(l.animationName);
671
- l.target === o && p && ze(
670
+ const p = B(n.current).includes(l.animationName);
671
+ l.target === o && p && je(
672
672
  () => s("ANIMATION_END")
673
673
  );
674
674
  }, b = (l) => {
675
- l.target === o && (r.current = j(n.current));
675
+ l.target === o && (r.current = B(n.current));
676
676
  };
677
677
  return o.addEventListener("animationstart", b), o.addEventListener("animationcancel", u), o.addEventListener("animationend", u), () => {
678
678
  o.removeEventListener("animationstart", b), o.removeEventListener("animationcancel", u), o.removeEventListener("animationend", u);
@@ -687,37 +687,37 @@ function Cr(e) {
687
687
  "mounted",
688
688
  "unmountSuspended"
689
689
  ].includes(i),
690
- ref: k((u) => {
690
+ ref: M((u) => {
691
691
  u && (n.current = getComputedStyle(u)), t(u);
692
692
  }, [])
693
693
  };
694
694
  }
695
- function j(e) {
695
+ function B(e) {
696
696
  return (e == null ? void 0 : e.animationName) || "none";
697
697
  }
698
- const Re = "Radio", [Rr, Se] = X(Re), [Sr, Ar] = Rr(Re), Ir = /* @__PURE__ */ C((e, o) => {
698
+ const Se = "Radio", [Sr, Ae] = X(Se), [Ar, Ir] = Sr(Se), Nr = /* @__PURE__ */ R((e, o) => {
699
699
  const { __scopeRadio: t, name: n, checked: c = !1, required: r, disabled: a, value: i = "on", onCheck: s, ...u } = e, [b, l] = F(null), f = L(
700
700
  o,
701
701
  (_) => l(_)
702
- ), p = R(!1), d = b ? !!b.closest("form") : !0;
703
- return /* @__PURE__ */ m(Sr, {
702
+ ), p = S(!1), d = b ? !!b.closest("form") : !0;
703
+ return /* @__PURE__ */ m(Ar, {
704
704
  scope: t,
705
705
  checked: c,
706
706
  disabled: a
707
- }, /* @__PURE__ */ m(U.button, A({
707
+ }, /* @__PURE__ */ m(U.button, I({
708
708
  type: "button",
709
709
  role: "radio",
710
710
  "aria-checked": c,
711
- "data-state": Ae(c),
711
+ "data-state": Ie(c),
712
712
  "data-disabled": a ? "" : void 0,
713
713
  disabled: a,
714
714
  value: i
715
715
  }, u, {
716
716
  ref: f,
717
- onClick: N(e.onClick, (_) => {
717
+ onClick: x(e.onClick, (_) => {
718
718
  c || s == null || s(), d && (p.current = _.isPropagationStopped(), p.current || _.stopPropagation());
719
719
  })
720
- })), d && /* @__PURE__ */ m(Pr, {
720
+ })), d && /* @__PURE__ */ m(wr, {
721
721
  control: b,
722
722
  bubbles: !p.current,
723
723
  name: n,
@@ -729,19 +729,19 @@ const Re = "Radio", [Rr, Se] = X(Re), [Sr, Ar] = Rr(Re), Ir = /* @__PURE__ */ C(
729
729
  transform: "translateX(-100%)"
730
730
  }
731
731
  }));
732
- }), Nr = "RadioIndicator", Er = /* @__PURE__ */ C((e, o) => {
733
- const { __scopeRadio: t, forceMount: n, ...c } = e, r = Ar(Nr, t);
734
- return /* @__PURE__ */ m(Ce, {
732
+ }), xr = "RadioIndicator", Er = /* @__PURE__ */ R((e, o) => {
733
+ const { __scopeRadio: t, forceMount: n, ...c } = e, r = Ir(xr, t);
734
+ return /* @__PURE__ */ m(Re, {
735
735
  present: n || r.checked
736
- }, /* @__PURE__ */ m(U.span, A({
737
- "data-state": Ae(r.checked),
736
+ }, /* @__PURE__ */ m(U.span, I({
737
+ "data-state": Ie(r.checked),
738
738
  "data-disabled": r.disabled ? "" : void 0
739
739
  }, c, {
740
740
  ref: o
741
741
  })));
742
- }), Pr = (e) => {
743
- const { control: o, checked: t, bubbles: n = !0, ...c } = e, r = R(null), a = yr(t), i = vr(o);
744
- return T(() => {
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
745
  const s = r.current, u = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(u, "checked").set;
746
746
  if (a !== t && l) {
747
747
  const f = new Event("click", {
@@ -753,7 +753,7 @@ const Re = "Radio", [Rr, Se] = X(Re), [Sr, Ar] = Rr(Re), Ir = /* @__PURE__ */ C(
753
753
  a,
754
754
  t,
755
755
  n
756
- ]), /* @__PURE__ */ m("input", A({
756
+ ]), /* @__PURE__ */ m("input", I({
757
757
  type: "radio",
758
758
  "aria-hidden": !0,
759
759
  defaultChecked: t
@@ -770,37 +770,37 @@ const Re = "Radio", [Rr, Se] = X(Re), [Sr, Ar] = Rr(Re), Ir = /* @__PURE__ */ C(
770
770
  }
771
771
  }));
772
772
  };
773
- function Ae(e) {
773
+ function Ie(e) {
774
774
  return e ? "checked" : "unchecked";
775
775
  }
776
- const Or = [
776
+ const Pr = [
777
777
  "ArrowUp",
778
778
  "ArrowDown",
779
779
  "ArrowLeft",
780
780
  "ArrowRight"
781
- ], Ie = "RadioGroup", [Tr, pt] = X(Ie, [
781
+ ], Ne = "RadioGroup", [Or, pt] = X(Ne, [
782
782
  ye,
783
- Se
784
- ]), Ne = ye(), Ee = Se(), [wr, Mr] = Tr(Ie), kr = /* @__PURE__ */ C((e, o) => {
785
- const { __scopeRadioGroup: t, name: n, defaultValue: c, value: r, required: a = !1, disabled: i = !1, orientation: s, dir: u, loop: b = !0, onValueChange: l, ...f } = e, p = Ne(t), d = ge(u), [_, g] = he({
783
+ Ae
784
+ ]), xe = ye(), Ee = Ae(), [Tr, kr] = Or(Ne), Mr = /* @__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: b = !0, onValueChange: l, ...f } = e, p = xe(t), d = ge(u), [_, g] = he({
786
786
  prop: r,
787
787
  defaultProp: c,
788
788
  onChange: l
789
789
  });
790
- return /* @__PURE__ */ m(wr, {
790
+ return /* @__PURE__ */ m(Tr, {
791
791
  scope: t,
792
792
  name: n,
793
793
  required: a,
794
794
  disabled: i,
795
795
  value: _,
796
796
  onValueChange: g
797
- }, /* @__PURE__ */ m(hr, A({
797
+ }, /* @__PURE__ */ m(hr, I({
798
798
  asChild: !0
799
799
  }, p, {
800
800
  orientation: s,
801
801
  dir: d,
802
802
  loop: b
803
- }), /* @__PURE__ */ m(U.div, A({
803
+ }), /* @__PURE__ */ m(U.div, I({
804
804
  role: "radiogroup",
805
805
  "aria-required": a,
806
806
  "aria-orientation": s,
@@ -809,21 +809,21 @@ const Or = [
809
809
  }, f, {
810
810
  ref: o
811
811
  }))));
812
- }), Fr = "RadioGroupItem", Lr = /* @__PURE__ */ C((e, o) => {
813
- const { __scopeRadioGroup: t, disabled: n, ...c } = e, r = Mr(Fr, t), a = r.disabled || n, i = Ne(t), s = Ee(t), u = R(null), b = L(o, u), l = r.value === c.value, f = R(!1);
814
- return T(() => {
812
+ }), Fr = "RadioGroupItem", Lr = /* @__PURE__ */ R((e, o) => {
813
+ const { __scopeRadioGroup: t, disabled: n, ...c } = e, r = kr(Fr, t), a = r.disabled || n, i = xe(t), s = Ee(t), u = S(null), b = L(o, u), l = r.value === c.value, f = S(!1);
814
+ return O(() => {
815
815
  const p = (_) => {
816
- Or.includes(_.key) && (f.current = !0);
816
+ Pr.includes(_.key) && (f.current = !0);
817
817
  }, d = () => f.current = !1;
818
818
  return document.addEventListener("keydown", p), document.addEventListener("keyup", d), () => {
819
819
  document.removeEventListener("keydown", p), document.removeEventListener("keyup", d);
820
820
  };
821
- }, []), /* @__PURE__ */ m(gr, A({
821
+ }, []), /* @__PURE__ */ m(gr, I({
822
822
  asChild: !0
823
823
  }, i, {
824
824
  focusable: !a,
825
825
  active: l
826
- }), /* @__PURE__ */ m(Ir, A({
826
+ }), /* @__PURE__ */ m(Nr, I({
827
827
  disabled: a,
828
828
  required: r.required,
829
829
  checked: l
@@ -831,24 +831,24 @@ const Or = [
831
831
  name: r.name,
832
832
  ref: b,
833
833
  onCheck: () => r.onValueChange(c.value),
834
- onKeyDown: N((p) => {
834
+ onKeyDown: x((p) => {
835
835
  p.key === "Enter" && p.preventDefault();
836
836
  }),
837
- onFocus: N(c.onFocus, () => {
837
+ onFocus: x(c.onFocus, () => {
838
838
  var p;
839
839
  f.current && ((p = u.current) === null || p === void 0 || p.click());
840
840
  })
841
841
  })));
842
- }), Dr = /* @__PURE__ */ C((e, o) => {
842
+ }), Dr = /* @__PURE__ */ R((e, o) => {
843
843
  const { __scopeRadioGroup: t, ...n } = e, c = Ee(t);
844
- return /* @__PURE__ */ m(Er, A({}, c, n, {
844
+ return /* @__PURE__ */ m(Er, I({}, c, n, {
845
845
  ref: o
846
846
  }));
847
- }), Gr = kr, Ur = Lr, zr = Dr;
848
- function jr(e) {
847
+ }), Gr = Mr, Ur = Lr, jr = Dr;
848
+ function Br(e) {
849
849
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
850
850
  }
851
- var Pe = { exports: {} };
851
+ var we = { exports: {} };
852
852
  /*!
853
853
  Copyright (c) 2018 Jed Watson.
854
854
  Licensed under the MIT License (MIT), see
@@ -883,9 +883,9 @@ var Pe = { exports: {} };
883
883
  }
884
884
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
885
885
  })();
886
- })(Pe);
887
- var Br = Pe.exports;
888
- const Vr = /* @__PURE__ */ jr(Br), qr = {
886
+ })(we);
887
+ var zr = we.exports;
888
+ const Vr = /* @__PURE__ */ Br(zr), qr = {
889
889
  "purpur-radio-card-group": "_purpur-radio-card-group_19msf_1",
890
890
  "purpur-radio-card-group--vertical": "_purpur-radio-card-group--vertical_19msf_5",
891
891
  "purpur-radio-card-group--horizontal": "_purpur-radio-card-group--horizontal_19msf_9",
@@ -905,11 +905,11 @@ const Vr = /* @__PURE__ */ jr(Br), qr = {
905
905
  "purpur-radio-card-group__item-image-placeholder": "_purpur-radio-card-group__item-image-placeholder_19msf_167",
906
906
  "purpur-radio-card-group__item-image-placeholder--loaded": "_purpur-radio-card-group__item-image-placeholder--loaded_19msf_172",
907
907
  "purpur-radio-card-group__item-children": "_purpur-radio-card-group__item-children_19msf_175"
908
- }, x = Vr.bind(qr);
908
+ }, C = Vr.bind(qr);
909
909
  function Kr(e) {
910
910
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
911
911
  }
912
- var Oe = { exports: {} };
912
+ var Pe = { exports: {} };
913
913
  /*!
914
914
  Copyright (c) 2018 Jed Watson.
915
915
  Licensed under the MIT License (MIT), see
@@ -944,22 +944,22 @@ var Oe = { exports: {} };
944
944
  }
945
945
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
946
946
  })();
947
- })(Oe);
948
- var Hr = Oe.exports;
949
- const Yr = /* @__PURE__ */ Kr(Hr), B = {
950
- "purpur-paragraph": "_purpur-paragraph_1fzxr_1",
951
- "purpur-paragraph--disabled": "_purpur-paragraph--disabled_1fzxr_7",
952
- "purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1fzxr_10",
953
- "purpur-paragraph--paragraph-100": "_purpur-paragraph--paragraph-100_1fzxr_13",
954
- "purpur-paragraph--paragraph-100-medium": "_purpur-paragraph--paragraph-100-medium_1fzxr_19",
955
- "purpur-paragraph--paragraph-100-bold": "_purpur-paragraph--paragraph-100-bold_1fzxr_26",
956
- "purpur-paragraph--paragraph-200": "_purpur-paragraph--paragraph-200_1fzxr_33",
957
- "purpur-paragraph--preamble-100": "_purpur-paragraph--preamble-100_1fzxr_39",
958
- "purpur-paragraph--preamble-200": "_purpur-paragraph--preamble-200_1fzxr_45",
959
- "purpur-paragraph--additional-100": "_purpur-paragraph--additional-100_1fzxr_51",
960
- "purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1fzxr_57",
961
- "purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1fzxr_64",
962
- "purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1fzxr_71"
947
+ })(Pe);
948
+ var Hr = Pe.exports;
949
+ const Yr = /* @__PURE__ */ Kr(Hr), z = {
950
+ "purpur-paragraph": "_purpur-paragraph_5wbko_1",
951
+ "purpur-paragraph--disabled": "_purpur-paragraph--disabled_5wbko_7",
952
+ "purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_5wbko_10",
953
+ "purpur-paragraph--paragraph-100": "_purpur-paragraph--paragraph-100_5wbko_13",
954
+ "purpur-paragraph--paragraph-100-medium": "_purpur-paragraph--paragraph-100-medium_5wbko_19",
955
+ "purpur-paragraph--paragraph-100-bold": "_purpur-paragraph--paragraph-100-bold_5wbko_26",
956
+ "purpur-paragraph--paragraph-200": "_purpur-paragraph--paragraph-200_5wbko_33",
957
+ "purpur-paragraph--preamble-100": "_purpur-paragraph--preamble-100_5wbko_39",
958
+ "purpur-paragraph--preamble-200": "_purpur-paragraph--preamble-200_5wbko_45",
959
+ "purpur-paragraph--additional-100": "_purpur-paragraph--additional-100_5wbko_51",
960
+ "purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_5wbko_57",
961
+ "purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_5wbko_64",
962
+ "purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_5wbko_72"
963
963
  }, Wr = {
964
964
  PARAGRAPH100: "paragraph-100",
965
965
  PARAGRAPH100MEDIUM: "paragraph-100-medium",
@@ -982,11 +982,11 @@ const Yr = /* @__PURE__ */ Kr(Hr), B = {
982
982
  }) => {
983
983
  const i = Yr([
984
984
  t,
985
- B[V],
986
- B[`${V}--${r}`],
985
+ z[V],
986
+ z[`${V}--${r}`],
987
987
  {
988
- [B[`${V}--hyphens`]]: c,
989
- [B[`${V}--disabled`]]: n
988
+ [z[`${V}--hyphens`]]: c,
989
+ [z[`${V}--disabled`]]: n
990
990
  }
991
991
  ]);
992
992
  return /* @__PURE__ */ v("p", { ...a, className: i, "data-testid": e, children: o });
@@ -994,7 +994,7 @@ const Yr = /* @__PURE__ */ Kr(Hr), B = {
994
994
  function Xr(e) {
995
995
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
996
996
  }
997
- var Te = { exports: {} };
997
+ var Oe = { exports: {} };
998
998
  /*!
999
999
  Copyright (c) 2018 Jed Watson.
1000
1000
  Licensed under the MIT License (MIT), see
@@ -1029,8 +1029,8 @@ var Te = { exports: {} };
1029
1029
  }
1030
1030
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
1031
1031
  })();
1032
- })(Te);
1033
- var Zr = Te.exports;
1032
+ })(Oe);
1033
+ var Zr = Oe.exports;
1034
1034
  const Jr = /* @__PURE__ */ Xr(Zr), Qr = "_loading_93tal_1", te = {
1035
1035
  "purpur-skeleton": "_purpur-skeleton_93tal_1",
1036
1036
  loading: Qr,
@@ -1063,12 +1063,12 @@ const Jr = /* @__PURE__ */ Xr(Zr), Qr = "_loading_93tal_1", te = {
1063
1063
  loading: n = "lazy",
1064
1064
  ["data-testid"]: c
1065
1065
  }) => {
1066
- const [r, a] = F(!1), i = () => a(!0), s = x(q, {
1066
+ const [r, a] = F(!1), i = () => a(!0), s = C(q, {
1067
1067
  [`${q}--loaded`]: r
1068
- }), u = x(`${q}-placeholder`, {
1068
+ }), u = C(`${q}-placeholder`, {
1069
1069
  [`${q}-placeholder--loaded`]: r
1070
1070
  });
1071
- return /* @__PURE__ */ M(Le, { children: [
1071
+ return /* @__PURE__ */ k(Le, { children: [
1072
1072
  /* @__PURE__ */ v(
1073
1073
  "img",
1074
1074
  {
@@ -1082,7 +1082,7 @@ const Jr = /* @__PURE__ */ Xr(Zr), Qr = "_loading_93tal_1", te = {
1082
1082
  ),
1083
1083
  !t && /* @__PURE__ */ v(et, { className: u })
1084
1084
  ] });
1085
- }, I = "purpur-radio-card-group__item", ne = (e, { disabled: o }) => typeof e == "function" ? e({ disabled: o }) : e, ot = (e, o) => {
1085
+ }, N = "purpur-radio-card-group__item", ne = (e, { disabled: o }) => typeof e == "function" ? e({ disabled: o }) : e, ot = (e, o) => {
1086
1086
  const {
1087
1087
  ["data-testid"]: t,
1088
1088
  body: n,
@@ -1094,33 +1094,33 @@ const Jr = /* @__PURE__ */ Xr(Zr), Qr = "_loading_93tal_1", te = {
1094
1094
  title: u,
1095
1095
  value: b
1096
1096
  } = e;
1097
- return /* @__PURE__ */ M("div", { className: x(`${I}-container`), ref: o, children: [
1098
- /* @__PURE__ */ M(
1097
+ return /* @__PURE__ */ k("div", { className: C(`${N}-container`), ref: o, children: [
1098
+ /* @__PURE__ */ k(
1099
1099
  Ur,
1100
1100
  {
1101
- className: x(I),
1101
+ className: C(N),
1102
1102
  "data-testid": t,
1103
1103
  disabled: r,
1104
1104
  id: a,
1105
1105
  required: s,
1106
1106
  value: b,
1107
1107
  children: [
1108
- i && /* @__PURE__ */ v("span", { className: x(`${I}-image-container`), children: rt(i) ? /* @__PURE__ */ v(tt, { ...i, "data-testid": t && `${t}-image` }) : ne(i, e) }),
1109
- /* @__PURE__ */ M("span", { className: x(`${I}-content`), children: [
1110
- /* @__PURE__ */ M("span", { className: x(`${I}-top-container`), children: [
1108
+ i && /* @__PURE__ */ v("span", { className: C(`${N}-image-container`), children: rt(i) ? /* @__PURE__ */ v(tt, { ...i, "data-testid": t && `${t}-image` }) : ne(i, e) }),
1109
+ /* @__PURE__ */ k("span", { className: C(`${N}-content`), children: [
1110
+ /* @__PURE__ */ k("span", { className: C(`${N}-top-container`), children: [
1111
1111
  typeof u == "string" ? /* @__PURE__ */ v(
1112
1112
  fe,
1113
1113
  {
1114
- className: x(`${I}-title`),
1114
+ className: C(`${N}-title`),
1115
1115
  "data-testid": t && `${t}-title`,
1116
1116
  variant: "paragraph-100",
1117
1117
  disabled: r,
1118
1118
  children: u
1119
1119
  }
1120
1120
  ) : ne(u, e),
1121
- /* @__PURE__ */ v("span", { className: x(`${I}-radio`), children: /* @__PURE__ */ v(zr, { className: x(`${I}-indicator`) }) })
1121
+ /* @__PURE__ */ v("span", { className: C(`${N}-radio`), children: /* @__PURE__ */ v(jr, { className: C(`${N}-indicator`) }) })
1122
1122
  ] }),
1123
- n && /* @__PURE__ */ v("span", { className: x(`${I}-bottom-container`), children: typeof n == "string" ? /* @__PURE__ */ v(
1123
+ n && /* @__PURE__ */ v("span", { className: C(`${N}-bottom-container`), children: typeof n == "string" ? /* @__PURE__ */ v(
1124
1124
  fe,
1125
1125
  {
1126
1126
  "data-testid": t && `${t}-body`,
@@ -1135,7 +1135,7 @@ const Jr = /* @__PURE__ */ Xr(Zr), Qr = "_loading_93tal_1", te = {
1135
1135
  ),
1136
1136
  c
1137
1137
  ] });
1138
- }, de = C(ot);
1138
+ }, de = R(ot);
1139
1139
  de.displayName = "RadioCardItem";
1140
1140
  const nt = (e) => G(e) && (e == null ? void 0 : e.type) === de, K = "purpur-radio-card-group", at = ({
1141
1141
  "data-testid": e,
@@ -1149,8 +1149,8 @@ const nt = (e) => G(e) && (e == null ? void 0 : e.type) === de, K = "purpur-radi
1149
1149
  radioPosition: s = "right",
1150
1150
  ...u
1151
1151
  }, b) => {
1152
- const l = P.toArray(t).filter(nt);
1153
- return /* @__PURE__ */ M("div", { className: x(n, `${K}__container`), ref: b, children: [
1152
+ const l = w.toArray(t).filter(nt);
1153
+ return /* @__PURE__ */ k("div", { className: C(n, `${K}__container`), ref: b, children: [
1154
1154
  r && /* @__PURE__ */ v(
1155
1155
  Ke,
1156
1156
  {
@@ -1161,12 +1161,12 @@ const nt = (e) => G(e) && (e == null ? void 0 : e.type) === de, K = "purpur-radi
1161
1161
  children: `${u.required ? "* " : ""}${r}`
1162
1162
  }
1163
1163
  ),
1164
- (!!(c != null && c.length) || l.length) && /* @__PURE__ */ M(
1164
+ (!!(c != null && c.length) || l.length) && /* @__PURE__ */ k(
1165
1165
  Gr,
1166
1166
  {
1167
1167
  ...u,
1168
1168
  "aria-labelledby": o || (r ? `${u.id}-label` : void 0),
1169
- className: x(
1169
+ className: C(
1170
1170
  K,
1171
1171
  `${K}--${i}`,
1172
1172
  `${K}--radio-${s}`
@@ -1183,7 +1183,7 @@ const nt = (e) => G(e) && (e == null ? void 0 : e.type) === de, K = "purpur-radi
1183
1183
  },
1184
1184
  f.id
1185
1185
  )),
1186
- P.map(
1186
+ w.map(
1187
1187
  l,
1188
1188
  (f) => W(f, { disabled: f.props.disabled || u.disabled })
1189
1189
  )
@@ -1191,7 +1191,7 @@ const nt = (e) => G(e) && (e == null ? void 0 : e.type) === de, K = "purpur-radi
1191
1191
  }
1192
1192
  )
1193
1193
  ] });
1194
- }, ct = C(at);
1194
+ }, ct = R(at);
1195
1195
  ct.displayName = "RadioCardGroup";
1196
1196
  export {
1197
1197
  ct as RadioCardGroup,