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