@purpurds/checkbox 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,7 +1,7 @@
1
- import { jsxs as B, jsx as f } from "react/jsx-runtime";
2
- import { forwardRef as g, Children as v, isValidElement as y, createElement as p, cloneElement as E, useEffect as O, Fragment as re, useCallback as Z, createContext as V, useMemo as A, useContext as _e, useRef as $, useState as q, useLayoutEffect as ge, useReducer as $e } from "react";
3
- import { flushSync as xe } from "react-dom";
4
- function ye(e) {
1
+ import { jsxs as z, jsx as f } from "react/jsx-runtime";
2
+ import { forwardRef as g, Children as b, isValidElement as x, createElement as p, cloneElement as E, useEffect as k, Fragment as re, useCallback as Z, createContext as V, useMemo as P, useContext as _e, useRef as $, useState as I, useLayoutEffect as ge, useReducer as $e } from "react";
3
+ import { flushSync as ye } from "react-dom";
4
+ function xe(e) {
5
5
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
6
6
  }
7
7
  var te = { exports: {} };
@@ -41,7 +41,7 @@ var te = { exports: {} };
41
41
  })();
42
42
  })(te);
43
43
  var we = te.exports;
44
- const Ne = /* @__PURE__ */ ye(we), Se = {
44
+ const Ne = /* @__PURE__ */ xe(we), Se = {
45
45
  "purpur-icon": "_purpur-icon_8u1lq_1",
46
46
  "purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
47
47
  "purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
@@ -49,31 +49,31 @@ const Ne = /* @__PURE__ */ ye(we), Se = {
49
49
  "purpur-icon--md": "_purpur-icon--md_8u1lq_16",
50
50
  "purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
51
51
  "purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
52
- }, Oe = {
52
+ }, ke = {
53
53
  name: "error-filled",
54
54
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 24" fill="currentColor"><path fill-rule="evenodd" d="M14.268 3.5c-.77-1.333-2.694-1.333-3.464 0l-8.66 15c-.77 1.333.192 3 1.732 3h17.32c1.54 0 2.502-1.667 1.733-3l-8.66-15Zm-.694 5.067-.247 6.876h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.917c0 .649-.585 1.234-1.25 1.234-.648 0-1.25-.585-1.25-1.234 0-.633.602-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z" clip-rule="evenodd"/></svg>',
55
55
  keywords: ["error-filled"],
56
56
  category: "status"
57
- }, Pe = Ne.bind(Se), G = "purpur-icon", Ae = "md", Ce = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), ke = ({ content: e = "", title: n } = {}) => {
57
+ }, Oe = Ne.bind(Se), G = "purpur-icon", Pe = "md", Ae = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Ce = ({ content: e = "", title: n } = {}) => {
58
58
  const t = [
59
59
  { name: "xmlns", value: "http://www.w3.org/2000/svg" },
60
60
  { name: "fill", value: "currentColor" },
61
61
  { name: "viewBox", value: "0 0 24 24" },
62
62
  n ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
63
63
  ], a = n ? `<title>${n}</title>` : "";
64
- return `<svg ${Ce(t)}>${a}${e}</svg>`;
64
+ return `<svg ${Ae(t)}>${a}${e}</svg>`;
65
65
  }, je = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Ee = ({
66
66
  ["data-testid"]: e,
67
67
  svg: n,
68
68
  allyTitle: t,
69
69
  className: a = "",
70
- size: i = Ae,
70
+ size: i = Pe,
71
71
  ...r
72
72
  }) => {
73
- const o = ke({
73
+ const o = Ce({
74
74
  content: je(n.svg),
75
75
  title: t
76
- }), u = Pe(a, G, `${G}--${i}`);
76
+ }), u = Oe(a, G, `${G}--${i}`);
77
77
  return /* @__PURE__ */ f(
78
78
  "span",
79
79
  {
@@ -124,31 +124,31 @@ var ne = { exports: {} };
124
124
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
125
125
  })();
126
126
  })(ne);
127
- var ze = ne.exports;
128
- const Re = /* @__PURE__ */ Me(ze), K = {
127
+ var Re = ne.exports;
128
+ const De = /* @__PURE__ */ Me(Re), K = {
129
129
  "purpur-field-error-text": "_purpur-field-error-text_1h4gy_1",
130
130
  "purpur-field-error-text__icon": "_purpur-field-error-text__icon_1h4gy_12"
131
- }, W = "purpur-field-error-text", De = ({
131
+ }, W = "purpur-field-error-text", qe = ({
132
132
  ["data-testid"]: e,
133
133
  children: n,
134
134
  className: t,
135
135
  relevant: a = "additions text",
136
136
  ...i
137
- }) => /* @__PURE__ */ B(
137
+ }) => /* @__PURE__ */ z(
138
138
  "div",
139
139
  {
140
- className: Re([t, K[W]]),
140
+ className: De([t, K[W]]),
141
141
  "data-testid": e,
142
142
  "aria-live": "assertive",
143
143
  "aria-relevant": a,
144
144
  ...i,
145
145
  children: [
146
- /* @__PURE__ */ f(Ee, { svg: Oe, size: "xs", className: K[`${W}__icon`] }),
146
+ /* @__PURE__ */ f(Ee, { svg: ke, size: "xs", className: K[`${W}__icon`] }),
147
147
  n
148
148
  ]
149
149
  }
150
150
  );
151
- function qe(e) {
151
+ function Ie(e) {
152
152
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
153
153
  }
154
154
  var oe = { exports: {} };
@@ -187,8 +187,8 @@ var oe = { exports: {} };
187
187
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
188
188
  })();
189
189
  })(oe);
190
- var Ie = oe.exports;
191
- const Le = /* @__PURE__ */ qe(Ie), Be = {
190
+ var Le = oe.exports;
191
+ const Be = /* @__PURE__ */ Ie(Le), ze = {
192
192
  "purpur-icon": "_purpur-icon_8u1lq_1",
193
193
  "purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
194
194
  "purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
@@ -206,7 +206,7 @@ const Le = /* @__PURE__ */ qe(Ie), Be = {
206
206
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M3 12c0-1.105.711-2 1.588-2h14.824c.877 0 1.588.895 1.588 2s-.711 2-1.588 2H4.588C3.711 14 3 13.105 3 12Z" clip-rule="evenodd"/></svg>',
207
207
  keywords: ["minus-bold"],
208
208
  category: "utility"
209
- }, He = Le.bind(Be), X = "purpur-icon", Fe = "md", Ze = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Ve = ({ content: e = "", title: n } = {}) => {
209
+ }, He = Be.bind(ze), X = "purpur-icon", Fe = "md", Ze = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Ve = ({ content: e = "", title: n } = {}) => {
210
210
  const t = [
211
211
  { name: "xmlns", value: "http://www.w3.org/2000/svg" },
212
212
  { name: "fill", value: "currentColor" },
@@ -247,15 +247,15 @@ function T() {
247
247
  return e;
248
248
  }, T.apply(this, arguments);
249
249
  }
250
- function C() {
251
- return C = Object.assign ? Object.assign.bind() : function(e) {
250
+ function A() {
251
+ return A = Object.assign ? Object.assign.bind() : function(e) {
252
252
  for (var n = 1; n < arguments.length; n++) {
253
253
  var t = arguments[n];
254
254
  for (var a in t)
255
255
  Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
256
256
  }
257
257
  return e;
258
- }, C.apply(this, arguments);
258
+ }, A.apply(this, arguments);
259
259
  }
260
260
  function Ke(e, n) {
261
261
  typeof e == "function" ? e(n) : e != null && (e.current = n);
@@ -266,29 +266,29 @@ function We(...e) {
266
266
  );
267
267
  }
268
268
  const ae = /* @__PURE__ */ g((e, n) => {
269
- const { children: t, ...a } = e, i = v.toArray(t), r = i.find(Je);
269
+ const { children: t, ...a } = e, i = b.toArray(t), r = i.find(Je);
270
270
  if (r) {
271
- const o = r.props.children, u = i.map((c) => c === r ? v.count(o) > 1 ? v.only(null) : /* @__PURE__ */ y(o) ? o.props.children : null : c);
272
- return /* @__PURE__ */ p(U, C({}, a, {
271
+ const o = r.props.children, u = i.map((c) => c === r ? b.count(o) > 1 ? b.only(null) : /* @__PURE__ */ x(o) ? o.props.children : null : c);
272
+ return /* @__PURE__ */ p(U, A({}, a, {
273
273
  ref: n
274
- }), /* @__PURE__ */ y(o) ? /* @__PURE__ */ E(o, void 0, u) : null);
274
+ }), /* @__PURE__ */ x(o) ? /* @__PURE__ */ E(o, void 0, u) : null);
275
275
  }
276
- return /* @__PURE__ */ p(U, C({}, a, {
276
+ return /* @__PURE__ */ p(U, A({}, a, {
277
277
  ref: n
278
278
  }), t);
279
279
  });
280
280
  ae.displayName = "Slot";
281
281
  const U = /* @__PURE__ */ g((e, n) => {
282
282
  const { children: t, ...a } = e;
283
- return /* @__PURE__ */ y(t) ? /* @__PURE__ */ E(t, {
283
+ return /* @__PURE__ */ x(t) ? /* @__PURE__ */ E(t, {
284
284
  ...Qe(a, t.props),
285
285
  ref: n ? We(n, t.ref) : t.ref
286
- }) : v.count(t) > 1 ? v.only(null) : null;
286
+ }) : b.count(t) > 1 ? b.only(null) : null;
287
287
  });
288
288
  U.displayName = "SlotClone";
289
289
  const Xe = ({ children: e }) => /* @__PURE__ */ p(re, null, e);
290
290
  function Je(e) {
291
- return /* @__PURE__ */ y(e) && e.type === Xe;
291
+ return /* @__PURE__ */ x(e) && e.type === Xe;
292
292
  }
293
293
  function Qe(e, n) {
294
294
  const t = {
@@ -331,9 +331,9 @@ const Ye = [
331
331
  ], er = Ye.reduce((e, n) => {
332
332
  const t = /* @__PURE__ */ g((a, i) => {
333
333
  const { asChild: r, ...o } = a, u = r ? ae : n;
334
- return O(() => {
334
+ return k(() => {
335
335
  window[Symbol.for("radix-ui")] = !0;
336
- }, []), /* @__PURE__ */ p(u, C({}, o, {
336
+ }, []), /* @__PURE__ */ p(u, A({}, o, {
337
337
  ref: i
338
338
  }));
339
339
  });
@@ -446,20 +446,20 @@ var ue = { exports: {} };
446
446
  })();
447
447
  })(ue);
448
448
  var cr = ue.exports;
449
- const sr = /* @__PURE__ */ ur(cr), z = {
450
- "purpur-paragraph": "_purpur-paragraph_1fzxr_1",
451
- "purpur-paragraph--disabled": "_purpur-paragraph--disabled_1fzxr_7",
452
- "purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1fzxr_10",
453
- "purpur-paragraph--paragraph-100": "_purpur-paragraph--paragraph-100_1fzxr_13",
454
- "purpur-paragraph--paragraph-100-medium": "_purpur-paragraph--paragraph-100-medium_1fzxr_19",
455
- "purpur-paragraph--paragraph-100-bold": "_purpur-paragraph--paragraph-100-bold_1fzxr_26",
456
- "purpur-paragraph--paragraph-200": "_purpur-paragraph--paragraph-200_1fzxr_33",
457
- "purpur-paragraph--preamble-100": "_purpur-paragraph--preamble-100_1fzxr_39",
458
- "purpur-paragraph--preamble-200": "_purpur-paragraph--preamble-200_1fzxr_45",
459
- "purpur-paragraph--additional-100": "_purpur-paragraph--additional-100_1fzxr_51",
460
- "purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1fzxr_57",
461
- "purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1fzxr_64",
462
- "purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1fzxr_71"
449
+ const sr = /* @__PURE__ */ ur(cr), R = {
450
+ "purpur-paragraph": "_purpur-paragraph_5wbko_1",
451
+ "purpur-paragraph--disabled": "_purpur-paragraph--disabled_5wbko_7",
452
+ "purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_5wbko_10",
453
+ "purpur-paragraph--paragraph-100": "_purpur-paragraph--paragraph-100_5wbko_13",
454
+ "purpur-paragraph--paragraph-100-medium": "_purpur-paragraph--paragraph-100-medium_5wbko_19",
455
+ "purpur-paragraph--paragraph-100-bold": "_purpur-paragraph--paragraph-100-bold_5wbko_26",
456
+ "purpur-paragraph--paragraph-200": "_purpur-paragraph--paragraph-200_5wbko_33",
457
+ "purpur-paragraph--preamble-100": "_purpur-paragraph--preamble-100_5wbko_39",
458
+ "purpur-paragraph--preamble-200": "_purpur-paragraph--preamble-200_5wbko_45",
459
+ "purpur-paragraph--additional-100": "_purpur-paragraph--additional-100_5wbko_51",
460
+ "purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_5wbko_57",
461
+ "purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_5wbko_64",
462
+ "purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_5wbko_72"
463
463
  }, lr = {
464
464
  PARAGRAPH100: "paragraph-100",
465
465
  PARAGRAPH100MEDIUM: "paragraph-100-medium",
@@ -471,7 +471,7 @@ const sr = /* @__PURE__ */ ur(cr), z = {
471
471
  ADDITIONAL100MEDIUM: "additional-100-medium",
472
472
  OVERLINE100: "overline-100",
473
473
  OVERLINE200: "overline-200"
474
- }, R = "purpur-paragraph", pr = ({
474
+ }, D = "purpur-paragraph", pr = ({
475
475
  ["data-testid"]: e,
476
476
  children: n,
477
477
  className: t = "",
@@ -482,24 +482,24 @@ const sr = /* @__PURE__ */ ur(cr), z = {
482
482
  }) => {
483
483
  const u = sr([
484
484
  t,
485
- z[R],
486
- z[`${R}--${r}`],
485
+ R[D],
486
+ R[`${D}--${r}`],
487
487
  {
488
- [z[`${R}--hyphens`]]: i,
489
- [z[`${R}--disabled`]]: a
488
+ [R[`${D}--hyphens`]]: i,
489
+ [R[`${D}--disabled`]]: a
490
490
  }
491
491
  ]);
492
492
  return /* @__PURE__ */ f("p", { ...o, className: u, "data-testid": e, children: n });
493
493
  };
494
- function k() {
495
- return k = Object.assign ? Object.assign.bind() : function(e) {
494
+ function C() {
495
+ return C = Object.assign ? Object.assign.bind() : function(e) {
496
496
  for (var n = 1; n < arguments.length; n++) {
497
497
  var t = arguments[n];
498
498
  for (var a in t)
499
499
  Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
500
500
  }
501
501
  return e;
502
- }, k.apply(this, arguments);
502
+ }, C.apply(this, arguments);
503
503
  }
504
504
  function dr(e, n) {
505
505
  typeof e == "function" ? e(n) : e != null && (e.current = n);
@@ -521,16 +521,16 @@ function fr(e, n = []) {
521
521
  o
522
522
  ];
523
523
  function s(l) {
524
- const { scope: d, children: b, ..._ } = l, M = (d == null ? void 0 : d[e][c]) || u, x = A(
524
+ const { scope: d, children: v, ..._ } = l, M = (d == null ? void 0 : d[e][c]) || u, y = P(
525
525
  () => _,
526
526
  Object.values(_)
527
527
  );
528
528
  return /* @__PURE__ */ p(M.Provider, {
529
- value: x
530
- }, b);
529
+ value: y
530
+ }, v);
531
531
  }
532
532
  function h(l, d) {
533
- const b = (d == null ? void 0 : d[e][c]) || u, _ = _e(b);
533
+ const v = (d == null ? void 0 : d[e][c]) || u, _ = _e(v);
534
534
  if (_)
535
535
  return _;
536
536
  if (o !== void 0)
@@ -546,7 +546,7 @@ function fr(e, n = []) {
546
546
  const r = t.map((o) => /* @__PURE__ */ V(o));
547
547
  return function(u) {
548
548
  const c = (u == null ? void 0 : u[e]) || r;
549
- return A(
549
+ return P(
550
550
  () => ({
551
551
  [`__scope${e}`]: {
552
552
  ...u,
@@ -584,7 +584,7 @@ function hr(...e) {
584
584
  ...l
585
585
  };
586
586
  }, {});
587
- return A(
587
+ return P(
588
588
  () => ({
589
589
  [`__scope${n.scopeName}`]: o
590
590
  }),
@@ -604,9 +604,9 @@ function ee(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
604
604
  }
605
605
  function le(e) {
606
606
  const n = $(e);
607
- return O(() => {
607
+ return k(() => {
608
608
  n.current = e;
609
- }), A(
609
+ }), P(
610
610
  () => (...t) => {
611
611
  var a;
612
612
  return (a = n.current) === null || a === void 0 ? void 0 : a.call(n, ...t);
@@ -616,7 +616,7 @@ function le(e) {
616
616
  }
617
617
  function mr({ prop: e, defaultProp: n, onChange: t = () => {
618
618
  } }) {
619
- const [a, i] = vr({
619
+ const [a, i] = br({
620
620
  defaultProp: n,
621
621
  onChange: t
622
622
  }), r = e !== void 0, o = r ? e : a, u = le(t), c = Z((s) => {
@@ -636,9 +636,9 @@ function mr({ prop: e, defaultProp: n, onChange: t = () => {
636
636
  c
637
637
  ];
638
638
  }
639
- function vr({ defaultProp: e, onChange: n }) {
640
- const t = q(e), [a] = t, i = $(a), r = le(n);
641
- return O(() => {
639
+ function br({ defaultProp: e, onChange: n }) {
640
+ const t = I(e), [a] = t, i = $(a), r = le(n);
641
+ return k(() => {
642
642
  i.current !== a && (r(a), i.current = a);
643
643
  }, [
644
644
  a,
@@ -646,19 +646,19 @@ function vr({ defaultProp: e, onChange: n }) {
646
646
  r
647
647
  ]), t;
648
648
  }
649
- function br(e) {
649
+ function vr(e) {
650
650
  const n = $({
651
651
  value: e,
652
652
  previous: e
653
653
  });
654
- return A(() => (n.current.value !== e && (n.current.previous = n.current.value, n.current.value = e), n.current.previous), [
654
+ return P(() => (n.current.value !== e && (n.current.previous = n.current.value, n.current.value = e), n.current.previous), [
655
655
  e
656
656
  ]);
657
657
  }
658
658
  const H = globalThis != null && globalThis.document ? ge : () => {
659
659
  };
660
660
  function _r(e) {
661
- const [n, t] = q(void 0);
661
+ const [n, t] = I(void 0);
662
662
  return H(() => {
663
663
  if (e) {
664
664
  t({
@@ -698,14 +698,14 @@ function gr(e, n) {
698
698
  const pe = (e) => {
699
699
  const { present: n, children: t } = e, a = $r(n), i = typeof t == "function" ? t({
700
700
  present: a.isPresent
701
- }) : v.only(t), r = se(a.ref, i.ref);
701
+ }) : b.only(t), r = se(a.ref, i.ref);
702
702
  return typeof t == "function" || a.isPresent ? /* @__PURE__ */ E(i, {
703
703
  ref: r
704
704
  }) : null;
705
705
  };
706
706
  pe.displayName = "Presence";
707
707
  function $r(e) {
708
- const [n, t] = q(), a = $({}), i = $(e), r = $("none"), o = e ? "mounted" : "unmounted", [u, c] = gr(o, {
708
+ const [n, t] = I(), a = $({}), i = $(e), r = $("none"), o = e ? "mounted" : "unmounted", [u, c] = gr(o, {
709
709
  mounted: {
710
710
  UNMOUNT: "unmounted",
711
711
  ANIMATION_OUT: "unmountSuspended"
@@ -718,16 +718,16 @@ function $r(e) {
718
718
  MOUNT: "mounted"
719
719
  }
720
720
  });
721
- return O(() => {
722
- const s = D(a.current);
721
+ return k(() => {
722
+ const s = q(a.current);
723
723
  r.current = u === "mounted" ? s : "none";
724
724
  }, [
725
725
  u
726
726
  ]), H(() => {
727
727
  const s = a.current, h = i.current;
728
728
  if (h !== e) {
729
- const d = r.current, b = D(s);
730
- e ? c("MOUNT") : b === "none" || (s == null ? void 0 : s.display) === "none" ? c("UNMOUNT") : c(h && d !== b ? "ANIMATION_OUT" : "UNMOUNT"), i.current = e;
729
+ const d = r.current, v = q(s);
730
+ e ? c("MOUNT") : v === "none" || (s == null ? void 0 : s.display) === "none" ? c("UNMOUNT") : c(h && d !== v ? "ANIMATION_OUT" : "UNMOUNT"), i.current = e;
731
731
  }
732
732
  }, [
733
733
  e,
@@ -735,12 +735,12 @@ function $r(e) {
735
735
  ]), H(() => {
736
736
  if (n) {
737
737
  const s = (l) => {
738
- const b = D(a.current).includes(l.animationName);
739
- l.target === n && b && xe(
738
+ const v = q(a.current).includes(l.animationName);
739
+ l.target === n && v && ye(
740
740
  () => c("ANIMATION_END")
741
741
  );
742
742
  }, h = (l) => {
743
- l.target === n && (r.current = D(a.current));
743
+ l.target === n && (r.current = q(a.current));
744
744
  };
745
745
  return n.addEventListener("animationstart", h), n.addEventListener("animationcancel", s), n.addEventListener("animationend", s), () => {
746
746
  n.removeEventListener("animationstart", h), n.removeEventListener("animationcancel", s), n.removeEventListener("animationend", s);
@@ -760,7 +760,7 @@ function $r(e) {
760
760
  }, [])
761
761
  };
762
762
  }
763
- function D(e) {
763
+ function q(e) {
764
764
  return (e == null ? void 0 : e.animationName) || "none";
765
765
  }
766
766
  function j() {
@@ -774,12 +774,12 @@ function j() {
774
774
  }, j.apply(this, arguments);
775
775
  }
776
776
  const de = /* @__PURE__ */ g((e, n) => {
777
- const { children: t, ...a } = e, i = v.toArray(t), r = i.find(yr);
777
+ const { children: t, ...a } = e, i = b.toArray(t), r = i.find(xr);
778
778
  if (r) {
779
- const o = r.props.children, u = i.map((c) => c === r ? v.count(o) > 1 ? v.only(null) : /* @__PURE__ */ y(o) ? o.props.children : null : c);
779
+ const o = r.props.children, u = i.map((c) => c === r ? b.count(o) > 1 ? b.only(null) : /* @__PURE__ */ x(o) ? o.props.children : null : c);
780
780
  return /* @__PURE__ */ p(F, j({}, a, {
781
781
  ref: n
782
- }), /* @__PURE__ */ y(o) ? /* @__PURE__ */ E(o, void 0, u) : null);
782
+ }), /* @__PURE__ */ x(o) ? /* @__PURE__ */ E(o, void 0, u) : null);
783
783
  }
784
784
  return /* @__PURE__ */ p(F, j({}, a, {
785
785
  ref: n
@@ -788,15 +788,15 @@ const de = /* @__PURE__ */ g((e, n) => {
788
788
  de.displayName = "Slot";
789
789
  const F = /* @__PURE__ */ g((e, n) => {
790
790
  const { children: t, ...a } = e;
791
- return /* @__PURE__ */ y(t) ? /* @__PURE__ */ E(t, {
791
+ return /* @__PURE__ */ x(t) ? /* @__PURE__ */ E(t, {
792
792
  ...wr(a, t.props),
793
793
  ref: n ? ce(n, t.ref) : t.ref
794
- }) : v.count(t) > 1 ? v.only(null) : null;
794
+ }) : b.count(t) > 1 ? b.only(null) : null;
795
795
  });
796
796
  F.displayName = "SlotClone";
797
- const xr = ({ children: e }) => /* @__PURE__ */ p(re, null, e);
798
- function yr(e) {
799
- return /* @__PURE__ */ y(e) && e.type === xr;
797
+ const yr = ({ children: e }) => /* @__PURE__ */ p(re, null, e);
798
+ function xr(e) {
799
+ return /* @__PURE__ */ x(e) && e.type === yr;
800
800
  }
801
801
  function wr(e, n) {
802
802
  const t = {
@@ -839,7 +839,7 @@ const Nr = [
839
839
  ], fe = Nr.reduce((e, n) => {
840
840
  const t = /* @__PURE__ */ g((a, i) => {
841
841
  const { asChild: r, ...o } = a, u = r ? de : n;
842
- return O(() => {
842
+ return k(() => {
843
843
  window[Symbol.for("radix-ui")] = !0;
844
844
  }, []), /* @__PURE__ */ p(u, j({}, o, {
845
845
  ref: i
@@ -849,45 +849,45 @@ const Nr = [
849
849
  ...e,
850
850
  [n]: t
851
851
  };
852
- }, {}), he = "Checkbox", [Sr, Tr] = fr(he), [Or, Pr] = Sr(he), Ar = /* @__PURE__ */ g((e, n) => {
853
- const { __scopeCheckbox: t, name: a, checked: i, defaultChecked: r, required: o, disabled: u, value: c = "on", onCheckedChange: s, ...h } = e, [l, d] = q(null), b = se(
852
+ }, {}), he = "Checkbox", [Sr, Tr] = fr(he), [kr, Or] = Sr(he), Pr = /* @__PURE__ */ g((e, n) => {
853
+ const { __scopeCheckbox: t, name: a, checked: i, defaultChecked: r, required: o, disabled: u, value: c = "on", onCheckedChange: s, ...h } = e, [l, d] = I(null), v = se(
854
854
  n,
855
855
  (m) => d(m)
856
- ), _ = $(!1), M = l ? !!l.closest("form") : !0, [x = !1, I] = mr({
856
+ ), _ = $(!1), M = l ? !!l.closest("form") : !0, [y = !1, L] = mr({
857
857
  prop: i,
858
858
  defaultProp: r,
859
859
  onChange: s
860
- }), be = $(x);
861
- return O(() => {
860
+ }), ve = $(y);
861
+ return k(() => {
862
862
  const m = l == null ? void 0 : l.form;
863
863
  if (m) {
864
- const P = () => I(be.current);
865
- return m.addEventListener("reset", P), () => m.removeEventListener("reset", P);
864
+ const O = () => L(ve.current);
865
+ return m.addEventListener("reset", O), () => m.removeEventListener("reset", O);
866
866
  }
867
867
  }, [
868
868
  l,
869
- I
870
- ]), /* @__PURE__ */ p(Or, {
869
+ L
870
+ ]), /* @__PURE__ */ p(kr, {
871
871
  scope: t,
872
- state: x,
872
+ state: y,
873
873
  disabled: u
874
- }, /* @__PURE__ */ p(fe.button, k({
874
+ }, /* @__PURE__ */ p(fe.button, C({
875
875
  type: "button",
876
876
  role: "checkbox",
877
- "aria-checked": S(x) ? "mixed" : x,
877
+ "aria-checked": S(y) ? "mixed" : y,
878
878
  "aria-required": o,
879
- "data-state": me(x),
879
+ "data-state": me(y),
880
880
  "data-disabled": u ? "" : void 0,
881
881
  disabled: u,
882
882
  value: c
883
883
  }, h, {
884
- ref: b,
884
+ ref: v,
885
885
  onKeyDown: ee(e.onKeyDown, (m) => {
886
886
  m.key === "Enter" && m.preventDefault();
887
887
  }),
888
888
  onClick: ee(e.onClick, (m) => {
889
- I(
890
- (P) => S(P) ? !0 : !P
889
+ L(
890
+ (O) => S(O) ? !0 : !O
891
891
  ), M && (_.current = m.isPropagationStopped(), _.current || m.stopPropagation());
892
892
  })
893
893
  })), M && /* @__PURE__ */ p(jr, {
@@ -895,18 +895,18 @@ const Nr = [
895
895
  bubbles: !_.current,
896
896
  name: a,
897
897
  value: c,
898
- checked: x,
898
+ checked: y,
899
899
  required: o,
900
900
  disabled: u,
901
901
  style: {
902
902
  transform: "translateX(-100%)"
903
903
  }
904
904
  }));
905
- }), Cr = "CheckboxIndicator", kr = /* @__PURE__ */ g((e, n) => {
906
- const { __scopeCheckbox: t, forceMount: a, ...i } = e, r = Pr(Cr, t);
905
+ }), Ar = "CheckboxIndicator", Cr = /* @__PURE__ */ g((e, n) => {
906
+ const { __scopeCheckbox: t, forceMount: a, ...i } = e, r = Or(Ar, t);
907
907
  return /* @__PURE__ */ p(pe, {
908
908
  present: a || S(r.state) || r.state === !0
909
- }, /* @__PURE__ */ p(fe.span, k({
909
+ }, /* @__PURE__ */ p(fe.span, C({
910
910
  "data-state": me(r.state),
911
911
  "data-disabled": r.disabled ? "" : void 0
912
912
  }, i, {
@@ -917,8 +917,8 @@ const Nr = [
917
917
  }
918
918
  })));
919
919
  }), jr = (e) => {
920
- const { control: n, checked: t, bubbles: a = !0, ...i } = e, r = $(null), o = br(t), u = _r(n);
921
- return O(() => {
920
+ const { control: n, checked: t, bubbles: a = !0, ...i } = e, r = $(null), o = vr(t), u = _r(n);
921
+ return k(() => {
922
922
  const c = r.current, s = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(s, "checked").set;
923
923
  if (o !== t && l) {
924
924
  const d = new Event("click", {
@@ -930,7 +930,7 @@ const Nr = [
930
930
  o,
931
931
  t,
932
932
  a
933
- ]), /* @__PURE__ */ p("input", k({
933
+ ]), /* @__PURE__ */ p("input", C({
934
934
  type: "checkbox",
935
935
  "aria-hidden": !0,
936
936
  defaultChecked: S(t) ? !1 : t
@@ -953,11 +953,11 @@ function S(e) {
953
953
  function me(e) {
954
954
  return S(e) ? "indeterminate" : e ? "checked" : "unchecked";
955
955
  }
956
- const Er = Ar, Mr = kr;
957
- function zr(e) {
956
+ const Er = Pr, Mr = Cr;
957
+ function Rr(e) {
958
958
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
959
959
  }
960
- var ve = { exports: {} };
960
+ var be = { exports: {} };
961
961
  /*!
962
962
  Copyright (c) 2018 Jed Watson.
963
963
  Licensed under the MIT License (MIT), see
@@ -992,9 +992,9 @@ var ve = { exports: {} };
992
992
  }
993
993
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
994
994
  })();
995
- })(ve);
996
- var Rr = ve.exports;
997
- const L = /* @__PURE__ */ zr(Rr), w = {
995
+ })(be);
996
+ var Dr = be.exports;
997
+ const B = /* @__PURE__ */ Rr(Dr), w = {
998
998
  "purpur-checkbox": "_purpur-checkbox_10fl8_1",
999
999
  "purpur-checkbox__box": "_purpur-checkbox__box_10fl8_7",
1000
1000
  "purpur-checkbox--error": "_purpur-checkbox--error_10fl8_16",
@@ -1002,7 +1002,7 @@ const L = /* @__PURE__ */ zr(Rr), w = {
1002
1002
  "purpur-checkbox__label": "_purpur-checkbox__label_10fl8_70",
1003
1003
  "purpur-checkbox__wrapper": "_purpur-checkbox__wrapper_10fl8_73",
1004
1004
  "purpur-checkbox__container": "_purpur-checkbox__container_10fl8_79"
1005
- }, N = "purpur-checkbox", Dr = ({
1005
+ }, N = "purpur-checkbox", qr = ({
1006
1006
  ["data-testid"]: e,
1007
1007
  checked: n,
1008
1008
  className: t,
@@ -1012,14 +1012,14 @@ const L = /* @__PURE__ */ zr(Rr), w = {
1012
1012
  ...o
1013
1013
  }, u) => {
1014
1014
  const c = a && !n;
1015
- return /* @__PURE__ */ B("div", { className: L([t, w[`${N}__wrapper`]]), children: [
1016
- /* @__PURE__ */ B("div", { className: L([t, w[`${N}__container`]]), children: [
1015
+ return /* @__PURE__ */ z("div", { className: B([t, w[`${N}__wrapper`]]), children: [
1016
+ /* @__PURE__ */ z("div", { className: B([t, w[`${N}__container`]]), children: [
1017
1017
  /* @__PURE__ */ f(
1018
1018
  Er,
1019
1019
  {
1020
1020
  ...o,
1021
1021
  checked: n,
1022
- className: L(w[N], {
1022
+ className: B(w[N], {
1023
1023
  [w[`${N}--error`]]: c
1024
1024
  }),
1025
1025
  "data-testid": e,
@@ -1053,11 +1053,11 @@ const L = /* @__PURE__ */ zr(Rr), w = {
1053
1053
  }
1054
1054
  )
1055
1055
  ] }),
1056
- c && /* @__PURE__ */ f(De, { "data-testid": e && `${e}-error-text`, children: a })
1056
+ c && /* @__PURE__ */ f(qe, { "data-testid": e && `${e}-error-text`, children: a })
1057
1057
  ] });
1058
- }, qr = g(Dr);
1059
- qr.displayName = "Checkbox";
1058
+ }, Ir = g(qr);
1059
+ Ir.displayName = "Checkbox";
1060
1060
  export {
1061
- qr as Checkbox
1061
+ Ir as Checkbox
1062
1062
  };
1063
1063
  //# sourceMappingURL=checkbox.es.js.map