@purpurds/checkbox 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,10 +1,11 @@
1
- import { jsxs as z, jsx as h } from "react/jsx-runtime";
2
- import { forwardRef as g, Children as b, isValidElement as N, createElement as p, cloneElement as j, useEffect as A, Fragment as Q, useCallback as Z, createContext as V, useMemo as M, useContext as _e, useRef as $, useState as I, useLayoutEffect as ve, useReducer as ge } from "react";
3
- import { flushSync as $e } from "react-dom";
4
- function xe(e) {
1
+ import { jsxs as A, jsx as p, Fragment as F } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { forwardRef as de } from "react";
4
+ import "react-dom";
5
+ function fe(e) {
5
6
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
6
7
  }
7
- var Y = { exports: {} };
8
+ var V = { exports: {} };
8
9
  /*!
9
10
  Copyright (c) 2018 Jed Watson.
10
11
  Licensed under the MIT License (MIT), see
@@ -12,36 +13,36 @@ var Y = { exports: {} };
12
13
  */
13
14
  (function(e) {
14
15
  (function() {
15
- var t = {}.hasOwnProperty;
16
- function n() {
16
+ var n = {}.hasOwnProperty;
17
+ function t() {
17
18
  for (var r = "", o = 0; o < arguments.length; o++) {
18
19
  var u = arguments[o];
19
- u && (r = i(r, a.call(this, u)));
20
+ u && (r = a(r, i.call(this, u)));
20
21
  }
21
22
  return r;
22
23
  }
23
- function a(r) {
24
+ function i(r) {
24
25
  if (typeof r == "string" || typeof r == "number")
25
26
  return this && this[r] || r;
26
27
  if (typeof r != "object")
27
28
  return "";
28
29
  if (Array.isArray(r))
29
- return n.apply(this, r);
30
+ return t.apply(this, r);
30
31
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
31
32
  return r.toString();
32
33
  var o = "";
33
34
  for (var u in r)
34
- t.call(r, u) && r[u] && (o = i(o, this && this[u] || u));
35
+ n.call(r, u) && r[u] && (o = a(o, this && this[u] || u));
35
36
  return o;
36
37
  }
37
- function i(r, o) {
38
+ function a(r, o) {
38
39
  return o ? r ? r + " " + o : r + o : r;
39
40
  }
40
- e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
41
+ e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
41
42
  })();
42
- })(Y);
43
- var ye = Y.exports;
44
- const Ne = /* @__PURE__ */ xe(ye), we = {
43
+ })(V);
44
+ var he = V.exports;
45
+ const me = /* @__PURE__ */ fe(he), ge = {
45
46
  "purpur-icon": "_purpur-icon_8u1lq_1",
46
47
  "purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
47
48
  "purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
@@ -49,30 +50,30 @@ const Ne = /* @__PURE__ */ xe(ye), we = {
49
50
  "purpur-icon--md": "_purpur-icon--md_8u1lq_16",
50
51
  "purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
51
52
  "purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
52
- }, Se = Ne.bind(we), G = "purpur-icon", Ae = "md", Ce = (e) => e.filter((t) => Object.keys(t).length >= 1).map((t) => `${t.name}="${t.value}"`).join(" "), ke = ({ content: e = "", title: t } = {}) => {
53
- const n = [
53
+ }, _e = me.bind(ge), L = "purpur-icon", ve = "md", be = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), ye = ({ content: e = "", title: n } = {}) => {
54
+ const t = [
54
55
  { name: "xmlns", value: "http://www.w3.org/2000/svg" },
55
56
  { name: "fill", value: "currentColor" },
56
57
  { name: "viewBox", value: "0 0 24 24" },
57
- t ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
58
- ], a = t ? `<title>${t}</title>` : "";
59
- return `<svg ${Ce(n)}>${a}${e}</svg>`;
60
- }, Pe = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), ee = ({
58
+ n ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
59
+ ], i = n ? `<title>${n}</title>` : "";
60
+ return `<svg ${be(t)}>${i}${e}</svg>`;
61
+ }, xe = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), H = ({
61
62
  ["data-testid"]: e,
62
- svg: t,
63
- allyTitle: n,
64
- className: a,
65
- size: i = Ae,
63
+ svg: n,
64
+ allyTitle: t,
65
+ className: i,
66
+ size: a = ve,
66
67
  ...r
67
68
  }) => {
68
- const o = ke({
69
- content: Pe(t.svg),
70
- title: n
71
- }), u = Se(a, G, `${G}--${i}`);
72
- return /* @__PURE__ */ h(
69
+ const o = ye({
70
+ content: xe(n.svg),
71
+ title: t
72
+ }), u = _e(i, L, `${L}--${a}`);
73
+ return /* @__PURE__ */ p(
73
74
  "span",
74
75
  {
75
- "aria-label": n,
76
+ "aria-label": t,
76
77
  className: u,
77
78
  "data-testid": e,
78
79
  dangerouslySetInnerHTML: { __html: o },
@@ -80,17 +81,17 @@ const Ne = /* @__PURE__ */ xe(ye), we = {
80
81
  }
81
82
  );
82
83
  };
83
- ee.displayName = "Icon";
84
- const Oe = {
84
+ H.displayName = "Icon";
85
+ const we = {
85
86
  name: "error-filled",
86
87
  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>',
87
88
  keywords: ["error-filled"],
88
89
  category: "status"
89
90
  };
90
- function Ee(e) {
91
+ function Ce(e) {
91
92
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
92
93
  }
93
- var re = { exports: {} };
94
+ var Z = { exports: {} };
94
95
  /*!
95
96
  Copyright (c) 2018 Jed Watson.
96
97
  Licensed under the MIT License (MIT), see
@@ -98,62 +99,62 @@ var re = { exports: {} };
98
99
  */
99
100
  (function(e) {
100
101
  (function() {
101
- var t = {}.hasOwnProperty;
102
- function n() {
102
+ var n = {}.hasOwnProperty;
103
+ function t() {
103
104
  for (var r = "", o = 0; o < arguments.length; o++) {
104
105
  var u = arguments[o];
105
- u && (r = i(r, a(u)));
106
+ u && (r = a(r, i(u)));
106
107
  }
107
108
  return r;
108
109
  }
109
- function a(r) {
110
+ function i(r) {
110
111
  if (typeof r == "string" || typeof r == "number")
111
112
  return r;
112
113
  if (typeof r != "object")
113
114
  return "";
114
115
  if (Array.isArray(r))
115
- return n.apply(null, r);
116
+ return t.apply(null, r);
116
117
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
117
118
  return r.toString();
118
119
  var o = "";
119
120
  for (var u in r)
120
- t.call(r, u) && r[u] && (o = i(o, u));
121
+ n.call(r, u) && r[u] && (o = a(o, u));
121
122
  return o;
122
123
  }
123
- function i(r, o) {
124
+ function a(r, o) {
124
125
  return o ? r ? r + " " + o : r + o : r;
125
126
  }
126
- e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
127
+ e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
127
128
  })();
128
- })(re);
129
- var Me = re.exports;
130
- const je = /* @__PURE__ */ Ee(Me), K = {
129
+ })(Z);
130
+ var Ne = Z.exports;
131
+ const Se = /* @__PURE__ */ Ce(Ne), q = {
131
132
  "purpur-field-error-text": "_purpur-field-error-text_1u768_1",
132
133
  "purpur-field-error-text__icon": "_purpur-field-error-text__icon_1u768_12"
133
- }, W = "purpur-field-error-text", Re = ({
134
+ }, z = "purpur-field-error-text", $e = ({
134
135
  ["data-testid"]: e,
135
- children: t,
136
- className: n,
137
- relevant: a = "additions text",
138
- ...i
139
- }) => /* @__PURE__ */ z(
136
+ children: n,
137
+ className: t,
138
+ relevant: i = "additions text",
139
+ ...a
140
+ }) => /* @__PURE__ */ A(
140
141
  "div",
141
142
  {
142
- className: je([n, K[W]]),
143
+ className: Se([t, q[z]]),
143
144
  "data-testid": e,
144
145
  "aria-live": "assertive",
145
- "aria-relevant": a,
146
- ...i,
146
+ "aria-relevant": i,
147
+ ...a,
147
148
  children: [
148
- /* @__PURE__ */ h(ee, { svg: Oe, size: "xs", className: K[`${W}__icon`] }),
149
- t
149
+ /* @__PURE__ */ p(H, { svg: we, size: "xs", className: q[`${z}__icon`] }),
150
+ n
150
151
  ]
151
152
  }
152
153
  );
153
- function De(e) {
154
+ function Pe(e) {
154
155
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
155
156
  }
156
- var ne = { exports: {} };
157
+ var G = { exports: {} };
157
158
  /*!
158
159
  Copyright (c) 2018 Jed Watson.
159
160
  Licensed under the MIT License (MIT), see
@@ -161,36 +162,36 @@ var ne = { exports: {} };
161
162
  */
162
163
  (function(e) {
163
164
  (function() {
164
- var t = {}.hasOwnProperty;
165
- function n() {
165
+ var n = {}.hasOwnProperty;
166
+ function t() {
166
167
  for (var r = "", o = 0; o < arguments.length; o++) {
167
168
  var u = arguments[o];
168
- u && (r = i(r, a.call(this, u)));
169
+ u && (r = a(r, i.call(this, u)));
169
170
  }
170
171
  return r;
171
172
  }
172
- function a(r) {
173
+ function i(r) {
173
174
  if (typeof r == "string" || typeof r == "number")
174
175
  return this && this[r] || r;
175
176
  if (typeof r != "object")
176
177
  return "";
177
178
  if (Array.isArray(r))
178
- return n.apply(this, r);
179
+ return t.apply(this, r);
179
180
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
180
181
  return r.toString();
181
182
  var o = "";
182
183
  for (var u in r)
183
- t.call(r, u) && r[u] && (o = i(o, this && this[u] || u));
184
+ n.call(r, u) && r[u] && (o = a(o, this && this[u] || u));
184
185
  return o;
185
186
  }
186
- function i(r, o) {
187
+ function a(r, o) {
187
188
  return o ? r ? r + " " + o : r + o : r;
188
189
  }
189
- e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
190
+ e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
190
191
  })();
191
- })(ne);
192
- var Ie = ne.exports;
193
- const qe = /* @__PURE__ */ De(Ie), Le = {
192
+ })(G);
193
+ var Ae = G.exports;
194
+ const ke = /* @__PURE__ */ Pe(Ae), Oe = {
194
195
  "purpur-icon": "_purpur-icon_8u1lq_1",
195
196
  "purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
196
197
  "purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
@@ -198,30 +199,30 @@ const qe = /* @__PURE__ */ De(Ie), Le = {
198
199
  "purpur-icon--md": "_purpur-icon--md_8u1lq_16",
199
200
  "purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
200
201
  "purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
201
- }, Be = qe.bind(Le), X = "purpur-icon", ze = "md", Te = (e) => e.filter((t) => Object.keys(t).length >= 1).map((t) => `${t.name}="${t.value}"`).join(" "), Ue = ({ content: e = "", title: t } = {}) => {
202
- const n = [
202
+ }, Re = ke.bind(Oe), B = "purpur-icon", Ee = "md", Me = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), je = ({ content: e = "", title: n } = {}) => {
203
+ const t = [
203
204
  { name: "xmlns", value: "http://www.w3.org/2000/svg" },
204
205
  { name: "fill", value: "currentColor" },
205
206
  { name: "viewBox", value: "0 0 24 24" },
206
- t ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
207
- ], a = t ? `<title>${t}</title>` : "";
208
- return `<svg ${Te(n)}>${a}${e}</svg>`;
209
- }, He = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), T = ({
207
+ n ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
208
+ ], i = n ? `<title>${n}</title>` : "";
209
+ return `<svg ${Me(t)}>${i}${e}</svg>`;
210
+ }, De = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), E = ({
210
211
  ["data-testid"]: e,
211
- svg: t,
212
- allyTitle: n,
213
- className: a,
214
- size: i = ze,
212
+ svg: n,
213
+ allyTitle: t,
214
+ className: i,
215
+ size: a = Ee,
215
216
  ...r
216
217
  }) => {
217
- const o = Ue({
218
- content: He(t.svg),
219
- title: n
220
- }), u = Be(a, X, `${X}--${i}`);
221
- return /* @__PURE__ */ h(
218
+ const o = je({
219
+ content: De(n.svg),
220
+ title: t
221
+ }), u = Re(i, B, `${B}--${a}`);
222
+ return /* @__PURE__ */ p(
222
223
  "span",
223
224
  {
224
- "aria-label": n,
225
+ "aria-label": t,
225
226
  className: u,
226
227
  "data-testid": e,
227
228
  dangerouslySetInnerHTML: { __html: o },
@@ -229,82 +230,77 @@ const qe = /* @__PURE__ */ De(Ie), Le = {
229
230
  }
230
231
  );
231
232
  };
232
- T.displayName = "Icon";
233
- const Fe = {
233
+ E.displayName = "Icon";
234
+ const Ie = {
234
235
  name: "checkmark-bold",
235
236
  svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M21.243 4.176a2 2 0 0 1 .324 2.81l-10.45 13.176a2.092 2.092 0 0 1-3.118.18l-5.413-5.413A2 2 0 1 1 5.414 12.1l3.9 3.9 9.118-11.5a2 2 0 0 1 2.81-.324Z" clip-rule="evenodd"/></svg>',
236
237
  keywords: ["checkmark-bold"],
237
238
  category: "utility"
238
- }, Ze = {
239
+ }, Le = {
239
240
  name: "minus-bold",
240
241
  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>',
241
242
  keywords: ["minus-bold"],
242
243
  category: "utility"
243
244
  };
244
- function k() {
245
- return k = Object.assign ? Object.assign.bind() : function(e) {
246
- for (var t = 1; t < arguments.length; t++) {
247
- var n = arguments[t];
248
- for (var a in n) ({}).hasOwnProperty.call(n, a) && (e[a] = n[a]);
249
- }
250
- return e;
251
- }, k.apply(null, arguments);
245
+ function W(e, n) {
246
+ if (typeof e == "function")
247
+ return e(n);
248
+ e != null && (e.current = n);
252
249
  }
253
- function Ve(e, t) {
254
- typeof e == "function" ? e(t) : e != null && (e.current = t);
255
- }
256
- function Ge(...e) {
257
- return (t) => e.forEach(
258
- (n) => Ve(n, t)
259
- );
250
+ function qe(...e) {
251
+ return (n) => {
252
+ let t = !1;
253
+ const i = e.map((a) => {
254
+ const r = W(a, n);
255
+ return !t && typeof r == "function" && (t = !0), r;
256
+ });
257
+ if (t)
258
+ return () => {
259
+ for (let a = 0; a < i.length; a++) {
260
+ const r = i[a];
261
+ typeof r == "function" ? r() : W(e[a], null);
262
+ }
263
+ };
264
+ };
260
265
  }
261
- const te = /* @__PURE__ */ g((e, t) => {
262
- const { children: n, ...a } = e, i = b.toArray(n), r = i.find(We);
266
+ var K = s.forwardRef((e, n) => {
267
+ const { children: t, ...i } = e, a = s.Children.toArray(t), r = a.find(Be);
263
268
  if (r) {
264
- const o = r.props.children, u = i.map((c) => c === r ? b.count(o) > 1 ? b.only(null) : /* @__PURE__ */ N(o) ? o.props.children : null : c);
265
- return /* @__PURE__ */ p(U, k({}, a, {
266
- ref: t
267
- }), /* @__PURE__ */ N(o) ? /* @__PURE__ */ j(o, void 0, u) : null);
269
+ const o = r.props.children, u = a.map((c) => c === r ? s.Children.count(o) > 1 ? s.Children.only(null) : s.isValidElement(o) ? o.props.children : null : c);
270
+ return /* @__PURE__ */ p(M, { ...i, ref: n, children: s.isValidElement(o) ? s.cloneElement(o, void 0, u) : null });
268
271
  }
269
- return /* @__PURE__ */ p(U, k({}, a, {
270
- ref: t
271
- }), n);
272
+ return /* @__PURE__ */ p(M, { ...i, ref: n, children: t });
272
273
  });
273
- te.displayName = "Slot";
274
- const U = /* @__PURE__ */ g((e, t) => {
275
- const { children: n, ...a } = e;
276
- return /* @__PURE__ */ N(n) ? /* @__PURE__ */ j(n, {
277
- ...Xe(a, n.props),
278
- ref: t ? Ge(t, n.ref) : n.ref
279
- }) : b.count(n) > 1 ? b.only(null) : null;
274
+ K.displayName = "Slot";
275
+ var M = s.forwardRef((e, n) => {
276
+ const { children: t, ...i } = e;
277
+ if (s.isValidElement(t)) {
278
+ const a = Te(t), r = We(i, t.props);
279
+ return t.type !== s.Fragment && (r.ref = n ? qe(n, a) : a), s.cloneElement(t, r);
280
+ }
281
+ return s.Children.count(t) > 1 ? s.Children.only(null) : null;
280
282
  });
281
- U.displayName = "SlotClone";
282
- const Ke = ({ children: e }) => /* @__PURE__ */ p(Q, null, e);
283
- function We(e) {
284
- return /* @__PURE__ */ N(e) && e.type === Ke;
283
+ M.displayName = "SlotClone";
284
+ var ze = ({ children: e }) => /* @__PURE__ */ p(F, { children: e });
285
+ function Be(e) {
286
+ return s.isValidElement(e) && e.type === ze;
285
287
  }
286
- function Xe(e, t) {
287
- const n = {
288
- ...t
289
- };
290
- for (const a in t) {
291
- const i = e[a], r = t[a];
292
- /^on[A-Z]/.test(a) ? i && r ? n[a] = (...o) => {
293
- r(...o), i(...o);
294
- } : i && (n[a] = i) : a === "style" ? n[a] = {
295
- ...i,
296
- ...r
297
- } : a === "className" && (n[a] = [
298
- i,
299
- r
300
- ].filter(Boolean).join(" "));
288
+ function We(e, n) {
289
+ const t = { ...n };
290
+ for (const i in n) {
291
+ const a = e[i], r = n[i];
292
+ /^on[A-Z]/.test(i) ? a && r ? t[i] = (...o) => {
293
+ r(...o), a(...o);
294
+ } : a && (t[i] = a) : i === "style" ? t[i] = { ...a, ...r } : i === "className" && (t[i] = [a, r].filter(Boolean).join(" "));
301
295
  }
302
- return {
303
- ...e,
304
- ...n
305
- };
296
+ return { ...e, ...t };
297
+ }
298
+ function Te(e) {
299
+ var n, t;
300
+ let i = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, a = i && "isReactWarning" in i && i.isReactWarning;
301
+ return a ? e.ref : (i = (t = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : t.get, a = i && "isReactWarning" in i && i.isReactWarning, a ? e.props.ref : e.props.ref || e.ref);
306
302
  }
307
- const Je = [
303
+ var Ue = [
308
304
  "a",
309
305
  "button",
310
306
  "div",
@@ -321,30 +317,29 @@ const Je = [
321
317
  "span",
322
318
  "svg",
323
319
  "ul"
324
- ], Qe = Je.reduce((e, t) => {
325
- const n = /* @__PURE__ */ g((a, i) => {
326
- const { asChild: r, ...o } = a, u = r ? te : t;
327
- return A(() => {
328
- window[Symbol.for("radix-ui")] = !0;
329
- }, []), /* @__PURE__ */ p(u, k({}, o, {
330
- ref: i
331
- }));
320
+ ], Fe = Ue.reduce((e, n) => {
321
+ const t = s.forwardRef((i, a) => {
322
+ const { asChild: r, ...o } = i, u = r ? K : n;
323
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ p(u, { ...o, ref: a });
332
324
  });
333
- return n.displayName = `Primitive.${t}`, {
325
+ return t.displayName = `Primitive.${n}`, { ...e, [n]: t };
326
+ }, {}), Ve = "Label", X = s.forwardRef((e, n) => /* @__PURE__ */ p(
327
+ Fe.label,
328
+ {
334
329
  ...e,
335
- [t]: n
336
- };
337
- }, {}), Ye = /* @__PURE__ */ g((e, t) => /* @__PURE__ */ p(Qe.label, k({}, e, {
338
- ref: t,
339
- onMouseDown: (n) => {
340
- var a;
341
- (a = e.onMouseDown) === null || a === void 0 || a.call(e, n), !n.defaultPrevented && n.detail > 1 && n.preventDefault();
330
+ ref: n,
331
+ onMouseDown: (t) => {
332
+ var i;
333
+ t.target.closest("button, input, select, textarea") || ((i = e.onMouseDown) == null || i.call(e, t), !t.defaultPrevented && t.detail > 1 && t.preventDefault());
334
+ }
342
335
  }
343
- }))), er = Ye;
344
- function rr(e) {
336
+ ));
337
+ X.displayName = Ve;
338
+ var He = X;
339
+ function Ze(e) {
345
340
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
346
341
  }
347
- var oe = { exports: {} };
342
+ var J = { exports: {} };
348
343
  /*!
349
344
  Copyright (c) 2018 Jed Watson.
350
345
  Licensed under the MIT License (MIT), see
@@ -352,62 +347,62 @@ var oe = { exports: {} };
352
347
  */
353
348
  (function(e) {
354
349
  (function() {
355
- var t = {}.hasOwnProperty;
356
- function n() {
350
+ var n = {}.hasOwnProperty;
351
+ function t() {
357
352
  for (var r = "", o = 0; o < arguments.length; o++) {
358
353
  var u = arguments[o];
359
- u && (r = i(r, a(u)));
354
+ u && (r = a(r, i(u)));
360
355
  }
361
356
  return r;
362
357
  }
363
- function a(r) {
358
+ function i(r) {
364
359
  if (typeof r == "string" || typeof r == "number")
365
360
  return r;
366
361
  if (typeof r != "object")
367
362
  return "";
368
363
  if (Array.isArray(r))
369
- return n.apply(null, r);
364
+ return t.apply(null, r);
370
365
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
371
366
  return r.toString();
372
367
  var o = "";
373
368
  for (var u in r)
374
- t.call(r, u) && r[u] && (o = i(o, u));
369
+ n.call(r, u) && r[u] && (o = a(o, u));
375
370
  return o;
376
371
  }
377
- function i(r, o) {
372
+ function a(r, o) {
378
373
  return o ? r ? r + " " + o : r + o : r;
379
374
  }
380
- e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
375
+ e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
381
376
  })();
382
- })(oe);
383
- var nr = oe.exports;
384
- const tr = /* @__PURE__ */ rr(nr), L = {
377
+ })(J);
378
+ var Ge = J.exports;
379
+ const Ke = /* @__PURE__ */ Ze(Ge), O = {
385
380
  "purpur-label": "_purpur-label_12cfi_1",
386
381
  "purpur-label--negative": "_purpur-label--negative_12cfi_9",
387
382
  "purpur-label--disabled": "_purpur-label--disabled_12cfi_12"
388
- }, B = "purpur-label", or = ({
383
+ }, R = "purpur-label", Xe = ({
389
384
  children: e,
390
- className: t,
391
- htmlFor: n,
392
- "data-testid": a,
393
- disabled: i,
385
+ className: n,
386
+ htmlFor: t,
387
+ "data-testid": i,
388
+ disabled: a,
394
389
  negative: r = !1,
395
390
  ...o
396
391
  }) => {
397
- const u = tr([
398
- t,
399
- L[B],
392
+ const u = Ke([
393
+ n,
394
+ O[R],
400
395
  {
401
- [L[`${B}--disabled`]]: i,
402
- [L[`${B}--negative`]]: r
396
+ [O[`${R}--disabled`]]: a,
397
+ [O[`${R}--negative`]]: r
403
398
  }
404
399
  ]);
405
- return /* @__PURE__ */ h(er, { className: u, "data-testid": a, htmlFor: n, ...o, children: e });
400
+ return /* @__PURE__ */ p(He, { className: u, "data-testid": i, htmlFor: t, ...o, children: e });
406
401
  };
407
- function ar(e) {
402
+ function Je(e) {
408
403
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
409
404
  }
410
- var ae = { exports: {} };
405
+ var Q = { exports: {} };
411
406
  /*!
412
407
  Copyright (c) 2018 Jed Watson.
413
408
  Licensed under the MIT License (MIT), see
@@ -415,36 +410,36 @@ var ae = { exports: {} };
415
410
  */
416
411
  (function(e) {
417
412
  (function() {
418
- var t = {}.hasOwnProperty;
419
- function n() {
413
+ var n = {}.hasOwnProperty;
414
+ function t() {
420
415
  for (var r = "", o = 0; o < arguments.length; o++) {
421
416
  var u = arguments[o];
422
- u && (r = i(r, a(u)));
417
+ u && (r = a(r, i(u)));
423
418
  }
424
419
  return r;
425
420
  }
426
- function a(r) {
421
+ function i(r) {
427
422
  if (typeof r == "string" || typeof r == "number")
428
423
  return r;
429
424
  if (typeof r != "object")
430
425
  return "";
431
426
  if (Array.isArray(r))
432
- return n.apply(null, r);
427
+ return t.apply(null, r);
433
428
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
434
429
  return r.toString();
435
430
  var o = "";
436
431
  for (var u in r)
437
- t.call(r, u) && r[u] && (o = i(o, u));
432
+ n.call(r, u) && r[u] && (o = a(o, u));
438
433
  return o;
439
434
  }
440
- function i(r, o) {
435
+ function a(r, o) {
441
436
  return o ? r ? r + " " + o : r + o : r;
442
437
  }
443
- e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
438
+ e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
444
439
  })();
445
- })(ae);
446
- var ur = ae.exports;
447
- const ir = /* @__PURE__ */ ar(ur), O = {
440
+ })(Q);
441
+ var Qe = Q.exports;
442
+ const Ye = /* @__PURE__ */ Je(Qe), S = {
448
443
  "purpur-paragraph": "_purpur-paragraph_1rh57_1",
449
444
  "purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
450
445
  "purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
@@ -459,7 +454,7 @@ const ir = /* @__PURE__ */ ar(ur), O = {
459
454
  "purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1rh57_60",
460
455
  "purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1rh57_67",
461
456
  "purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1rh57_75"
462
- }, cr = {
457
+ }, er = {
463
458
  PARAGRAPH100: "paragraph-100",
464
459
  PARAGRAPH100MEDIUM: "paragraph-100-medium",
465
460
  PARAGRAPH100BOLD: "paragraph-100-bold",
@@ -470,237 +465,183 @@ const ir = /* @__PURE__ */ ar(ur), O = {
470
465
  ADDITIONAL100MEDIUM: "additional-100-medium",
471
466
  OVERLINE100: "overline-100",
472
467
  OVERLINE200: "overline-200"
473
- }, E = "purpur-paragraph", ue = ({
468
+ }, $ = "purpur-paragraph", Y = ({
474
469
  ["data-testid"]: e,
475
- children: t,
476
- className: n,
477
- disabled: a,
478
- enableHyphenation: i = !1,
470
+ children: n,
471
+ className: t,
472
+ disabled: i,
473
+ enableHyphenation: a = !1,
479
474
  negative: r = !1,
480
- variant: o = cr.PARAGRAPH100,
475
+ variant: o = er.PARAGRAPH100,
481
476
  ...u
482
477
  }) => {
483
- const c = ir([
484
- n,
485
- O[E],
486
- O[`${E}--${o}`],
478
+ const c = Ye([
479
+ t,
480
+ S[$],
481
+ S[`${$}--${o}`],
487
482
  {
488
- [O[`${E}--hyphens`]]: i,
489
- [O[`${E}--disabled`]]: a,
490
- [O[`${E}--negative`]]: r
483
+ [S[`${$}--hyphens`]]: a,
484
+ [S[`${$}--disabled`]]: i,
485
+ [S[`${$}--negative`]]: r
491
486
  }
492
487
  ]);
493
- return /* @__PURE__ */ h("p", { ...u, className: c, "data-testid": e, children: t });
488
+ return /* @__PURE__ */ p("p", { ...u, className: c, "data-testid": e, children: n });
494
489
  };
495
- ue.displayName = "Paragraph";
496
- function w() {
497
- return w = Object.assign ? Object.assign.bind() : function(e) {
498
- for (var t = 1; t < arguments.length; t++) {
499
- var n = arguments[t];
500
- for (var a in n) ({}).hasOwnProperty.call(n, a) && (e[a] = n[a]);
501
- }
502
- return e;
503
- }, w.apply(null, arguments);
504
- }
505
- function sr(e, t) {
506
- typeof e == "function" ? e(t) : e != null && (e.current = t);
490
+ Y.displayName = "Paragraph";
491
+ function T(e, n) {
492
+ if (typeof e == "function")
493
+ return e(n);
494
+ e != null && (e.current = n);
507
495
  }
508
- function ie(...e) {
509
- return (t) => e.forEach(
510
- (n) => sr(n, t)
511
- );
496
+ function ee(...e) {
497
+ return (n) => {
498
+ let t = !1;
499
+ const i = e.map((a) => {
500
+ const r = T(a, n);
501
+ return !t && typeof r == "function" && (t = !0), r;
502
+ });
503
+ if (t)
504
+ return () => {
505
+ for (let a = 0; a < i.length; a++) {
506
+ const r = i[a];
507
+ typeof r == "function" ? r() : T(e[a], null);
508
+ }
509
+ };
510
+ };
512
511
  }
513
- function ce(...e) {
514
- return Z(ie(...e), e);
512
+ function re(...e) {
513
+ return s.useCallback(ee(...e), e);
515
514
  }
516
- function lr(e, t = []) {
517
- let n = [];
518
- function a(r, o) {
519
- const u = /* @__PURE__ */ V(o), c = n.length;
520
- n = [
521
- ...n,
522
- o
523
- ];
524
- function s(l) {
525
- const { scope: f, children: _, ...v } = l, R = (f == null ? void 0 : f[e][c]) || u, x = M(
526
- () => v,
527
- Object.values(v)
528
- );
529
- return /* @__PURE__ */ p(R.Provider, {
530
- value: x
531
- }, _);
532
- }
533
- function d(l, f) {
534
- const _ = (f == null ? void 0 : f[e][c]) || u, v = _e(_);
535
- if (v) return v;
515
+ function rr(e, n = []) {
516
+ let t = [];
517
+ function i(r, o) {
518
+ const u = s.createContext(o), c = t.length;
519
+ t = [...t, o];
520
+ const l = (h) => {
521
+ var b;
522
+ const { scope: d, children: m, ...g } = h, v = ((b = d == null ? void 0 : d[e]) == null ? void 0 : b[c]) || u, w = s.useMemo(() => g, Object.values(g));
523
+ return /* @__PURE__ */ p(v.Provider, { value: w, children: m });
524
+ };
525
+ l.displayName = r + "Provider";
526
+ function f(h, d) {
527
+ var v;
528
+ const m = ((v = d == null ? void 0 : d[e]) == null ? void 0 : v[c]) || u, g = s.useContext(m);
529
+ if (g) return g;
536
530
  if (o !== void 0) return o;
537
- throw new Error(`\`${l}\` must be used within \`${r}\``);
531
+ throw new Error(`\`${h}\` must be used within \`${r}\``);
538
532
  }
539
- return s.displayName = r + "Provider", [
540
- s,
541
- d
542
- ];
533
+ return [l, f];
543
534
  }
544
- const i = () => {
545
- const r = n.map((o) => /* @__PURE__ */ V(o));
535
+ const a = () => {
536
+ const r = t.map((o) => s.createContext(o));
546
537
  return function(u) {
547
538
  const c = (u == null ? void 0 : u[e]) || r;
548
- return M(
549
- () => ({
550
- [`__scope${e}`]: {
551
- ...u,
552
- [e]: c
553
- }
554
- }),
555
- [
556
- u,
557
- c
558
- ]
539
+ return s.useMemo(
540
+ () => ({ [`__scope${e}`]: { ...u, [e]: c } }),
541
+ [u, c]
559
542
  );
560
543
  };
561
544
  };
562
- return i.scopeName = e, [
563
- a,
564
- pr(i, ...t)
565
- ];
545
+ return a.scopeName = e, [i, tr(a, ...n)];
566
546
  }
567
- function pr(...e) {
568
- const t = e[0];
569
- if (e.length === 1) return t;
570
- const n = () => {
571
- const a = e.map(
572
- (i) => ({
573
- useScope: i(),
574
- scopeName: i.scopeName
575
- })
576
- );
547
+ function tr(...e) {
548
+ const n = e[0];
549
+ if (e.length === 1) return n;
550
+ const t = () => {
551
+ const i = e.map((a) => ({
552
+ useScope: a(),
553
+ scopeName: a.scopeName
554
+ }));
577
555
  return function(r) {
578
- const o = a.reduce((u, { useScope: c, scopeName: s }) => {
579
- const l = c(r)[`__scope${s}`];
580
- return {
581
- ...u,
582
- ...l
583
- };
556
+ const o = i.reduce((u, { useScope: c, scopeName: l }) => {
557
+ const h = c(r)[`__scope${l}`];
558
+ return { ...u, ...h };
584
559
  }, {});
585
- return M(
586
- () => ({
587
- [`__scope${t.scopeName}`]: o
588
- }),
589
- [
590
- o
591
- ]
592
- );
560
+ return s.useMemo(() => ({ [`__scope${n.scopeName}`]: o }), [o]);
593
561
  };
594
562
  };
595
- return n.scopeName = t.scopeName, n;
563
+ return t.scopeName = n.scopeName, t;
596
564
  }
597
- function J(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
598
- return function(i) {
599
- if (e == null || e(i), n === !1 || !i.defaultPrevented) return t == null ? void 0 : t(i);
565
+ function U(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
566
+ return function(a) {
567
+ if (e == null || e(a), t === !1 || !a.defaultPrevented)
568
+ return n == null ? void 0 : n(a);
600
569
  };
601
570
  }
602
- function se(e) {
603
- const t = $(e);
604
- return A(() => {
605
- t.current = e;
606
- }), M(
607
- () => (...n) => {
608
- var a;
609
- return (a = t.current) === null || a === void 0 ? void 0 : a.call(t, ...n);
571
+ function te(e) {
572
+ const n = s.useRef(e);
573
+ return s.useEffect(() => {
574
+ n.current = e;
575
+ }), s.useMemo(() => (...t) => {
576
+ var i;
577
+ return (i = n.current) == null ? void 0 : i.call(n, ...t);
578
+ }, []);
579
+ }
580
+ function nr({
581
+ prop: e,
582
+ defaultProp: n,
583
+ onChange: t = () => {
584
+ }
585
+ }) {
586
+ const [i, a] = or({ defaultProp: n, onChange: t }), r = e !== void 0, o = r ? e : i, u = te(t), c = s.useCallback(
587
+ (l) => {
588
+ if (r) {
589
+ const h = typeof l == "function" ? l(e) : l;
590
+ h !== e && u(h);
591
+ } else
592
+ a(l);
610
593
  },
611
- []
594
+ [r, e, a, u]
612
595
  );
596
+ return [o, c];
613
597
  }
614
- function dr({ prop: e, defaultProp: t, onChange: n = () => {
615
- } }) {
616
- const [a, i] = fr({
617
- defaultProp: t,
618
- onChange: n
619
- }), r = e !== void 0, o = r ? e : a, u = se(n), c = Z((s) => {
620
- if (r) {
621
- const l = typeof s == "function" ? s(e) : s;
622
- l !== e && u(l);
623
- } else i(s);
624
- }, [
625
- r,
626
- e,
627
- i,
628
- u
629
- ]);
630
- return [
631
- o,
632
- c
633
- ];
634
- }
635
- function fr({ defaultProp: e, onChange: t }) {
636
- const n = I(e), [a] = n, i = $(a), r = se(t);
637
- return A(() => {
638
- i.current !== a && (r(a), i.current = a);
639
- }, [
640
- a,
641
- i,
642
- r
643
- ]), n;
598
+ function or({
599
+ defaultProp: e,
600
+ onChange: n
601
+ }) {
602
+ const t = s.useState(e), [i] = t, a = s.useRef(i), r = te(n);
603
+ return s.useEffect(() => {
604
+ a.current !== i && (r(i), a.current = i);
605
+ }, [i, a, r]), t;
644
606
  }
645
- function hr(e) {
646
- const t = $({
647
- value: e,
648
- previous: e
649
- });
650
- return M(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [
651
- e
652
- ]);
607
+ function ir(e) {
608
+ const n = s.useRef({ value: e, previous: e });
609
+ return s.useMemo(() => (n.current.value !== e && (n.current.previous = n.current.value, n.current.value = e), n.current.previous), [e]);
653
610
  }
654
- const H = globalThis != null && globalThis.document ? ve : () => {
611
+ var j = globalThis != null && globalThis.document ? s.useLayoutEffect : () => {
655
612
  };
656
- function mr(e) {
657
- const [t, n] = I(void 0);
658
- return H(() => {
613
+ function ar(e) {
614
+ const [n, t] = s.useState(void 0);
615
+ return j(() => {
659
616
  if (e) {
660
- n({
661
- width: e.offsetWidth,
662
- height: e.offsetHeight
663
- });
664
- const a = new ResizeObserver((i) => {
665
- if (!Array.isArray(i) || !i.length) return;
666
- const r = i[0];
617
+ t({ width: e.offsetWidth, height: e.offsetHeight });
618
+ const i = new ResizeObserver((a) => {
619
+ if (!Array.isArray(a) || !a.length)
620
+ return;
621
+ const r = a[0];
667
622
  let o, u;
668
623
  if ("borderBoxSize" in r) {
669
- const c = r.borderBoxSize, s = Array.isArray(c) ? c[0] : c;
670
- o = s.inlineSize, u = s.blockSize;
624
+ const c = r.borderBoxSize, l = Array.isArray(c) ? c[0] : c;
625
+ o = l.inlineSize, u = l.blockSize;
671
626
  } else
672
627
  o = e.offsetWidth, u = e.offsetHeight;
673
- n({
674
- width: o,
675
- height: u
676
- });
628
+ t({ width: o, height: u });
677
629
  });
678
- return a.observe(e, {
679
- box: "border-box"
680
- }), () => a.unobserve(e);
630
+ return i.observe(e, { box: "border-box" }), () => i.unobserve(e);
681
631
  } else
682
- n(void 0);
683
- }, [
684
- e
685
- ]), t;
632
+ t(void 0);
633
+ }, [e]), n;
686
634
  }
687
- function br(e, t) {
688
- return ge((n, a) => {
689
- const i = t[n][a];
690
- return i ?? n;
691
- }, e);
635
+ function ur(e, n) {
636
+ return s.useReducer((t, i) => n[t][i] ?? t, e);
692
637
  }
693
- const le = (e) => {
694
- const { present: t, children: n } = e, a = _r(t), i = typeof n == "function" ? n({
695
- present: a.isPresent
696
- }) : b.only(n), r = ce(a.ref, i.ref);
697
- return typeof n == "function" || a.isPresent ? /* @__PURE__ */ j(i, {
698
- ref: r
699
- }) : null;
638
+ var ne = (e) => {
639
+ const { present: n, children: t } = e, i = sr(n), a = typeof t == "function" ? t({ present: i.isPresent }) : s.Children.only(t), r = re(i.ref, cr(a));
640
+ return typeof t == "function" || i.isPresent ? s.cloneElement(a, { ref: r }) : null;
700
641
  };
701
- le.displayName = "Presence";
702
- function _r(e) {
703
- const [t, n] = I(), a = $({}), i = $(e), r = $("none"), o = e ? "mounted" : "unmounted", [u, c] = br(o, {
642
+ ne.displayName = "Presence";
643
+ function sr(e) {
644
+ const [n, t] = s.useState(), i = s.useRef({}), a = s.useRef(e), r = s.useRef("none"), o = e ? "mounted" : "unmounted", [u, c] = ur(o, {
704
645
  mounted: {
705
646
  UNMOUNT: "unmounted",
706
647
  ANIMATION_OUT: "unmountSuspended"
@@ -713,98 +654,87 @@ function _r(e) {
713
654
  MOUNT: "mounted"
714
655
  }
715
656
  });
716
- return A(() => {
717
- const s = D(a.current);
718
- r.current = u === "mounted" ? s : "none";
719
- }, [
720
- u
721
- ]), H(() => {
722
- const s = a.current, d = i.current;
723
- if (d !== e) {
724
- const f = r.current, _ = D(s);
725
- e ? c("MOUNT") : _ === "none" || (s == null ? void 0 : s.display) === "none" ? c("UNMOUNT") : c(d && f !== _ ? "ANIMATION_OUT" : "UNMOUNT"), i.current = e;
726
- }
727
- }, [
728
- e,
729
- c
730
- ]), H(() => {
731
- if (t) {
732
- const s = (l) => {
733
- const _ = D(a.current).includes(l.animationName);
734
- l.target === t && _ && $e(
735
- () => c("ANIMATION_END")
736
- );
737
- }, d = (l) => {
738
- l.target === t && (r.current = D(a.current));
657
+ return s.useEffect(() => {
658
+ const l = P(i.current);
659
+ r.current = u === "mounted" ? l : "none";
660
+ }, [u]), j(() => {
661
+ const l = i.current, f = a.current;
662
+ if (f !== e) {
663
+ const d = r.current, m = P(l);
664
+ e ? c("MOUNT") : m === "none" || (l == null ? void 0 : l.display) === "none" ? c("UNMOUNT") : c(f && d !== m ? "ANIMATION_OUT" : "UNMOUNT"), a.current = e;
665
+ }
666
+ }, [e, c]), j(() => {
667
+ if (n) {
668
+ let l;
669
+ const f = n.ownerDocument.defaultView ?? window, h = (m) => {
670
+ const v = P(i.current).includes(m.animationName);
671
+ if (m.target === n && v && (c("ANIMATION_END"), !a.current)) {
672
+ const w = n.style.animationFillMode;
673
+ n.style.animationFillMode = "forwards", l = f.setTimeout(() => {
674
+ n.style.animationFillMode === "forwards" && (n.style.animationFillMode = w);
675
+ });
676
+ }
677
+ }, d = (m) => {
678
+ m.target === n && (r.current = P(i.current));
739
679
  };
740
- return t.addEventListener("animationstart", d), t.addEventListener("animationcancel", s), t.addEventListener("animationend", s), () => {
741
- t.removeEventListener("animationstart", d), t.removeEventListener("animationcancel", s), t.removeEventListener("animationend", s);
680
+ return n.addEventListener("animationstart", d), n.addEventListener("animationcancel", h), n.addEventListener("animationend", h), () => {
681
+ f.clearTimeout(l), n.removeEventListener("animationstart", d), n.removeEventListener("animationcancel", h), n.removeEventListener("animationend", h);
742
682
  };
743
683
  } else
744
684
  c("ANIMATION_END");
745
- }, [
746
- t,
747
- c
748
- ]), {
749
- isPresent: [
750
- "mounted",
751
- "unmountSuspended"
752
- ].includes(u),
753
- ref: Z((s) => {
754
- s && (a.current = getComputedStyle(s)), n(s);
685
+ }, [n, c]), {
686
+ isPresent: ["mounted", "unmountSuspended"].includes(u),
687
+ ref: s.useCallback((l) => {
688
+ l && (i.current = getComputedStyle(l)), t(l);
755
689
  }, [])
756
690
  };
757
691
  }
758
- function D(e) {
692
+ function P(e) {
759
693
  return (e == null ? void 0 : e.animationName) || "none";
760
694
  }
761
- const pe = /* @__PURE__ */ g((e, t) => {
762
- const { children: n, ...a } = e, i = b.toArray(n), r = i.find(gr);
695
+ function cr(e) {
696
+ var i, a;
697
+ let n = (i = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : i.get, t = n && "isReactWarning" in n && n.isReactWarning;
698
+ return t ? e.ref : (n = (a = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : a.get, t = n && "isReactWarning" in n && n.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
699
+ }
700
+ var oe = s.forwardRef((e, n) => {
701
+ const { children: t, ...i } = e, a = s.Children.toArray(t), r = a.find(pr);
763
702
  if (r) {
764
- const o = r.props.children, u = i.map((c) => c === r ? b.count(o) > 1 ? b.only(null) : /* @__PURE__ */ N(o) ? o.props.children : null : c);
765
- return /* @__PURE__ */ p(F, w({}, a, {
766
- ref: t
767
- }), /* @__PURE__ */ N(o) ? /* @__PURE__ */ j(o, void 0, u) : null);
703
+ const o = r.props.children, u = a.map((c) => c === r ? s.Children.count(o) > 1 ? s.Children.only(null) : s.isValidElement(o) ? o.props.children : null : c);
704
+ return /* @__PURE__ */ p(D, { ...i, ref: n, children: s.isValidElement(o) ? s.cloneElement(o, void 0, u) : null });
768
705
  }
769
- return /* @__PURE__ */ p(F, w({}, a, {
770
- ref: t
771
- }), n);
706
+ return /* @__PURE__ */ p(D, { ...i, ref: n, children: t });
772
707
  });
773
- pe.displayName = "Slot";
774
- const F = /* @__PURE__ */ g((e, t) => {
775
- const { children: n, ...a } = e;
776
- return /* @__PURE__ */ N(n) ? /* @__PURE__ */ j(n, {
777
- ...$r(a, n.props),
778
- ref: t ? ie(t, n.ref) : n.ref
779
- }) : b.count(n) > 1 ? b.only(null) : null;
708
+ oe.displayName = "Slot";
709
+ var D = s.forwardRef((e, n) => {
710
+ const { children: t, ...i } = e;
711
+ if (s.isValidElement(t)) {
712
+ const a = fr(t), r = dr(i, t.props);
713
+ return t.type !== s.Fragment && (r.ref = n ? ee(n, a) : a), s.cloneElement(t, r);
714
+ }
715
+ return s.Children.count(t) > 1 ? s.Children.only(null) : null;
780
716
  });
781
- F.displayName = "SlotClone";
782
- const vr = ({ children: e }) => /* @__PURE__ */ p(Q, null, e);
783
- function gr(e) {
784
- return /* @__PURE__ */ N(e) && e.type === vr;
717
+ D.displayName = "SlotClone";
718
+ var lr = ({ children: e }) => /* @__PURE__ */ p(F, { children: e });
719
+ function pr(e) {
720
+ return s.isValidElement(e) && e.type === lr;
785
721
  }
786
- function $r(e, t) {
787
- const n = {
788
- ...t
789
- };
790
- for (const a in t) {
791
- const i = e[a], r = t[a];
792
- /^on[A-Z]/.test(a) ? i && r ? n[a] = (...u) => {
793
- r(...u), i(...u);
794
- } : i && (n[a] = i) : a === "style" ? n[a] = {
795
- ...i,
796
- ...r
797
- } : a === "className" && (n[a] = [
798
- i,
799
- r
800
- ].filter(Boolean).join(" "));
722
+ function dr(e, n) {
723
+ const t = { ...n };
724
+ for (const i in n) {
725
+ const a = e[i], r = n[i];
726
+ /^on[A-Z]/.test(i) ? a && r ? t[i] = (...u) => {
727
+ r(...u), a(...u);
728
+ } : a && (t[i] = a) : i === "style" ? t[i] = { ...a, ...r } : i === "className" && (t[i] = [a, r].filter(Boolean).join(" "));
801
729
  }
802
- return {
803
- ...e,
804
- ...n
805
- };
730
+ return { ...e, ...t };
731
+ }
732
+ function fr(e) {
733
+ var i, a;
734
+ let n = (i = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : i.get, t = n && "isReactWarning" in n && n.isReactWarning;
735
+ return t ? e.ref : (n = (a = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : a.get, t = n && "isReactWarning" in n && n.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
806
736
  }
807
- const xr = [
737
+ var hr = [
808
738
  "a",
809
739
  "button",
810
740
  "div",
@@ -821,128 +751,134 @@ const xr = [
821
751
  "span",
822
752
  "svg",
823
753
  "ul"
824
- ], de = xr.reduce((e, t) => {
825
- const n = /* @__PURE__ */ g((a, i) => {
826
- const { asChild: r, ...o } = a, u = r ? pe : t;
827
- return A(() => {
828
- window[Symbol.for("radix-ui")] = !0;
829
- }, []), /* @__PURE__ */ p(u, w({}, o, {
830
- ref: i
831
- }));
754
+ ], ie = hr.reduce((e, n) => {
755
+ const t = s.forwardRef((i, a) => {
756
+ const { asChild: r, ...o } = i, u = r ? oe : n;
757
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ p(u, { ...o, ref: a });
832
758
  });
833
- return n.displayName = `Primitive.${t}`, {
834
- ...e,
835
- [t]: n
836
- };
837
- }, {}), fe = "Checkbox", [yr, zr] = lr(fe), [Nr, wr] = yr(fe), Sr = /* @__PURE__ */ g((e, t) => {
838
- const { __scopeCheckbox: n, name: a, checked: i, defaultChecked: r, required: o, disabled: u, value: c = "on", onCheckedChange: s, ...d } = e, [l, f] = I(null), _ = ce(
839
- t,
840
- (m) => f(m)
841
- ), v = $(!1), R = l ? !!l.closest("form") : !0, [x = !1, q] = dr({
842
- prop: i,
843
- defaultProp: r,
844
- onChange: s
845
- }), be = $(x);
846
- return A(() => {
847
- const m = l == null ? void 0 : l.form;
848
- if (m) {
849
- const P = () => q(be.current);
850
- return m.addEventListener("reset", P), () => m.removeEventListener("reset", P);
851
- }
852
- }, [
853
- l,
854
- q
855
- ]), /* @__PURE__ */ p(Nr, {
856
- scope: n,
857
- state: x,
858
- disabled: u
859
- }, /* @__PURE__ */ p(de.button, w({
860
- type: "button",
861
- role: "checkbox",
862
- "aria-checked": S(x) ? "mixed" : x,
863
- "aria-required": o,
864
- "data-state": he(x),
865
- "data-disabled": u ? "" : void 0,
866
- disabled: u,
867
- value: c
868
- }, d, {
869
- ref: _,
870
- onKeyDown: J(e.onKeyDown, (m) => {
871
- m.key === "Enter" && m.preventDefault();
872
- }),
873
- onClick: J(e.onClick, (m) => {
874
- q(
875
- (P) => S(P) ? !0 : !P
876
- ), R && (v.current = m.isPropagationStopped(), v.current || m.stopPropagation());
877
- })
878
- })), R && /* @__PURE__ */ p(kr, {
879
- control: l,
880
- bubbles: !v.current,
881
- name: a,
882
- value: c,
883
- checked: x,
884
- required: o,
885
- disabled: u,
886
- style: {
887
- transform: "translateX(-100%)"
888
- }
889
- }));
890
- }), Ar = "CheckboxIndicator", Cr = /* @__PURE__ */ g((e, t) => {
891
- const { __scopeCheckbox: n, forceMount: a, ...i } = e, r = wr(Ar, n);
892
- return /* @__PURE__ */ p(le, {
893
- present: a || S(r.state) || r.state === !0
894
- }, /* @__PURE__ */ p(de.span, w({
895
- "data-state": he(r.state),
896
- "data-disabled": r.disabled ? "" : void 0
897
- }, i, {
898
- ref: t,
899
- style: {
900
- pointerEvents: "none",
901
- ...e.style
902
- }
903
- })));
904
- }), kr = (e) => {
905
- const { control: t, checked: n, bubbles: a = !0, ...i } = e, r = $(null), o = hr(n), u = mr(t);
906
- return A(() => {
907
- const c = r.current, s = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(s, "checked").set;
908
- if (o !== n && l) {
909
- const f = new Event("click", {
910
- bubbles: a
911
- });
912
- c.indeterminate = S(n), l.call(c, S(n) ? !1 : n), c.dispatchEvent(f);
913
- }
914
- }, [
915
- o,
916
- n,
917
- a
918
- ]), /* @__PURE__ */ p("input", w({
919
- type: "checkbox",
920
- "aria-hidden": !0,
921
- defaultChecked: S(n) ? !1 : n
922
- }, i, {
923
- tabIndex: -1,
924
- ref: r,
925
- style: {
926
- ...e.style,
927
- ...u,
928
- position: "absolute",
929
- pointerEvents: "none",
930
- opacity: 0,
931
- margin: 0
759
+ return t.displayName = `Primitive.${n}`, { ...e, [n]: t };
760
+ }, {}), I = "Checkbox", [mr, Or] = rr(I), [gr, _r] = mr(I), ae = s.forwardRef(
761
+ (e, n) => {
762
+ const {
763
+ __scopeCheckbox: t,
764
+ name: i,
765
+ checked: a,
766
+ defaultChecked: r,
767
+ required: o,
768
+ disabled: u,
769
+ value: c = "on",
770
+ onCheckedChange: l,
771
+ form: f,
772
+ ...h
773
+ } = e, [d, m] = s.useState(null), g = re(n, (_) => m(_)), v = s.useRef(!1), w = d ? f || !!d.closest("form") : !0, [b = !1, k] = nr({
774
+ prop: a,
775
+ defaultProp: r,
776
+ onChange: l
777
+ }), pe = s.useRef(b);
778
+ return s.useEffect(() => {
779
+ const _ = d == null ? void 0 : d.form;
780
+ if (_) {
781
+ const N = () => k(pe.current);
782
+ return _.addEventListener("reset", N), () => _.removeEventListener("reset", N);
783
+ }
784
+ }, [d, k]), /* @__PURE__ */ A(gr, { scope: t, state: b, disabled: u, children: [
785
+ /* @__PURE__ */ p(
786
+ ie.button,
787
+ {
788
+ type: "button",
789
+ role: "checkbox",
790
+ "aria-checked": x(b) ? "mixed" : b,
791
+ "aria-required": o,
792
+ "data-state": ce(b),
793
+ "data-disabled": u ? "" : void 0,
794
+ disabled: u,
795
+ value: c,
796
+ ...h,
797
+ ref: g,
798
+ onKeyDown: U(e.onKeyDown, (_) => {
799
+ _.key === "Enter" && _.preventDefault();
800
+ }),
801
+ onClick: U(e.onClick, (_) => {
802
+ k((N) => x(N) ? !0 : !N), w && (v.current = _.isPropagationStopped(), v.current || _.stopPropagation());
803
+ })
804
+ }
805
+ ),
806
+ w && /* @__PURE__ */ p(
807
+ vr,
808
+ {
809
+ control: d,
810
+ bubbles: !v.current,
811
+ name: i,
812
+ value: c,
813
+ checked: b,
814
+ required: o,
815
+ disabled: u,
816
+ form: f,
817
+ style: { transform: "translateX(-100%)" },
818
+ defaultChecked: x(r) ? !1 : r
819
+ }
820
+ )
821
+ ] });
822
+ }
823
+ );
824
+ ae.displayName = I;
825
+ var ue = "CheckboxIndicator", se = s.forwardRef(
826
+ (e, n) => {
827
+ const { __scopeCheckbox: t, forceMount: i, ...a } = e, r = _r(ue, t);
828
+ return /* @__PURE__ */ p(ne, { present: i || x(r.state) || r.state === !0, children: /* @__PURE__ */ p(
829
+ ie.span,
830
+ {
831
+ "data-state": ce(r.state),
832
+ "data-disabled": r.disabled ? "" : void 0,
833
+ ...a,
834
+ ref: n,
835
+ style: { pointerEvents: "none", ...e.style }
836
+ }
837
+ ) });
838
+ }
839
+ );
840
+ se.displayName = ue;
841
+ var vr = (e) => {
842
+ const { control: n, checked: t, bubbles: i = !0, defaultChecked: a, ...r } = e, o = s.useRef(null), u = ir(t), c = ar(n);
843
+ s.useEffect(() => {
844
+ const f = o.current, h = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(h, "checked").set;
845
+ if (u !== t && m) {
846
+ const g = new Event("click", { bubbles: i });
847
+ f.indeterminate = x(t), m.call(f, x(t) ? !1 : t), f.dispatchEvent(g);
848
+ }
849
+ }, [u, t, i]);
850
+ const l = s.useRef(x(t) ? !1 : t);
851
+ return /* @__PURE__ */ p(
852
+ "input",
853
+ {
854
+ type: "checkbox",
855
+ "aria-hidden": !0,
856
+ defaultChecked: a ?? l.current,
857
+ ...r,
858
+ tabIndex: -1,
859
+ ref: o,
860
+ style: {
861
+ ...e.style,
862
+ ...c,
863
+ position: "absolute",
864
+ pointerEvents: "none",
865
+ opacity: 0,
866
+ margin: 0
867
+ }
932
868
  }
933
- }));
869
+ );
934
870
  };
935
- function S(e) {
871
+ function x(e) {
936
872
  return e === "indeterminate";
937
873
  }
938
- function he(e) {
939
- return S(e) ? "indeterminate" : e ? "checked" : "unchecked";
874
+ function ce(e) {
875
+ return x(e) ? "indeterminate" : e ? "checked" : "unchecked";
940
876
  }
941
- const Pr = Sr, Or = Cr;
942
- function Er(e) {
877
+ var br = ae, yr = se;
878
+ function xr(e) {
943
879
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
944
880
  }
945
- var me = { exports: {} };
881
+ var le = { exports: {} };
946
882
  /*!
947
883
  Copyright (c) 2018 Jed Watson.
948
884
  Licensed under the MIT License (MIT), see
@@ -950,36 +886,36 @@ var me = { exports: {} };
950
886
  */
951
887
  (function(e) {
952
888
  (function() {
953
- var t = {}.hasOwnProperty;
954
- function n() {
889
+ var n = {}.hasOwnProperty;
890
+ function t() {
955
891
  for (var r = "", o = 0; o < arguments.length; o++) {
956
892
  var u = arguments[o];
957
- u && (r = i(r, a.call(this, u)));
893
+ u && (r = a(r, i.call(this, u)));
958
894
  }
959
895
  return r;
960
896
  }
961
- function a(r) {
897
+ function i(r) {
962
898
  if (typeof r == "string" || typeof r == "number")
963
899
  return this && this[r] || r;
964
900
  if (typeof r != "object")
965
901
  return "";
966
902
  if (Array.isArray(r))
967
- return n.apply(this, r);
903
+ return t.apply(this, r);
968
904
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
969
905
  return r.toString();
970
906
  var o = "";
971
907
  for (var u in r)
972
- t.call(r, u) && r[u] && (o = i(o, this && this[u] || u));
908
+ n.call(r, u) && r[u] && (o = a(o, this && this[u] || u));
973
909
  return o;
974
910
  }
975
- function i(r, o) {
911
+ function a(r, o) {
976
912
  return o ? r ? r + " " + o : r + o : r;
977
913
  }
978
- e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
914
+ e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
979
915
  })();
980
- })(me);
981
- var Mr = me.exports;
982
- const jr = /* @__PURE__ */ Er(Mr), Rr = {
916
+ })(le);
917
+ var wr = le.exports;
918
+ const Cr = /* @__PURE__ */ xr(wr), Nr = {
983
919
  "purpur-checkbox": "_purpur-checkbox_m4999_1",
984
920
  "purpur-checkbox__box": "_purpur-checkbox__box_m4999_7",
985
921
  "purpur-checkbox--error": "_purpur-checkbox--error_m4999_16",
@@ -988,68 +924,68 @@ const jr = /* @__PURE__ */ Er(Mr), Rr = {
988
924
  "purpur-checkbox__label": "_purpur-checkbox__label_m4999_70",
989
925
  "purpur-checkbox__wrapper": "_purpur-checkbox__wrapper_m4999_73",
990
926
  "purpur-checkbox__container": "_purpur-checkbox__container_m4999_79"
991
- }, C = jr.bind(Rr), Tr = ["indeterminate", !0, !1], y = "purpur-checkbox", Dr = ({
927
+ }, C = Cr.bind(Nr), Rr = ["indeterminate", !0, !1], y = "purpur-checkbox", Sr = ({
992
928
  ["data-testid"]: e,
993
- checked: t,
994
- className: n,
995
- error: a = !1,
996
- errorText: i,
929
+ checked: n,
930
+ className: t,
931
+ error: i = !1,
932
+ errorText: a,
997
933
  label: r,
998
934
  onChange: o,
999
935
  ...u
1000
936
  }, c) => {
1001
- const s = i && !t, d = a && !t;
1002
- return /* @__PURE__ */ z("div", { className: C([n, `${y}__wrapper`]), children: [
1003
- /* @__PURE__ */ z("div", { className: C([n, `${y}__container`]), children: [
1004
- /* @__PURE__ */ h(
1005
- Pr,
937
+ const l = a && !n, f = i && !n;
938
+ return /* @__PURE__ */ A("div", { className: C([t, `${y}__wrapper`]), children: [
939
+ /* @__PURE__ */ A("div", { className: C([t, `${y}__container`]), children: [
940
+ /* @__PURE__ */ p(
941
+ br,
1006
942
  {
1007
943
  ...u,
1008
- checked: t,
944
+ checked: n,
1009
945
  className: C([
1010
946
  y,
1011
947
  {
1012
- [`${y}--error`]: s,
1013
- [`${y}--error-checkbox`]: d
948
+ [`${y}--error`]: l,
949
+ [`${y}--error-checkbox`]: f
1014
950
  }
1015
951
  ]),
1016
952
  "data-testid": e,
1017
953
  onCheckedChange: o,
1018
954
  ref: c,
1019
- children: /* @__PURE__ */ h("span", { className: C(`${y}__box`), children: /* @__PURE__ */ h(Or, { className: C(`${y}__indicator`), children: t === "indeterminate" ? /* @__PURE__ */ h(
1020
- T,
955
+ children: /* @__PURE__ */ p("span", { className: C(`${y}__box`), children: /* @__PURE__ */ p(yr, { className: C(`${y}__indicator`), children: n === "indeterminate" ? /* @__PURE__ */ p(
956
+ E,
1021
957
  {
1022
958
  "data-testid": e && `${e}-checked-icon`,
1023
959
  size: "xs",
1024
- svg: Ze
960
+ svg: Le
1025
961
  }
1026
- ) : /* @__PURE__ */ h(
1027
- T,
962
+ ) : /* @__PURE__ */ p(
963
+ E,
1028
964
  {
1029
965
  "data-testid": e && `${e}-indeterminate-icon`,
1030
966
  size: "xs",
1031
- svg: Fe
967
+ svg: Ie
1032
968
  }
1033
969
  ) }) })
1034
970
  }
1035
971
  ),
1036
- r && /* @__PURE__ */ h(
1037
- or,
972
+ r && /* @__PURE__ */ p(
973
+ Xe,
1038
974
  {
1039
975
  htmlFor: u.id,
1040
976
  "data-testid": e && `${e}-label`,
1041
977
  disabled: u.disabled,
1042
978
  className: C(`${y}__label`),
1043
- children: /* @__PURE__ */ h(ue, { variant: "paragraph-100", disabled: u.disabled, children: `${u.required ? "* " : ""}${r}` })
979
+ children: /* @__PURE__ */ p(Y, { variant: "paragraph-100", disabled: u.disabled, children: `${u.required ? "* " : ""}${r}` })
1044
980
  }
1045
981
  )
1046
982
  ] }),
1047
- s && /* @__PURE__ */ h(Re, { "data-testid": e && `${e}-error-text`, children: i })
983
+ l && /* @__PURE__ */ p($e, { "data-testid": e && `${e}-error-text`, children: a })
1048
984
  ] });
1049
- }, Ir = g(Dr);
1050
- Ir.displayName = "Checkbox";
985
+ }, $r = de(Sr);
986
+ $r.displayName = "Checkbox";
1051
987
  export {
1052
- Ir as Checkbox,
1053
- Tr as checkedState
988
+ $r as Checkbox,
989
+ Rr as checkedState
1054
990
  };
1055
991
  //# sourceMappingURL=checkbox.es.js.map