@purpurds/toggle 5.28.1 → 5.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/toggle.es.js CHANGED
@@ -1,10 +1,10 @@
1
- import { jsx as x, jsxs as G } from "react/jsx-runtime";
2
- import { forwardRef as w, Children as y, isValidElement as k, createElement as _, cloneElement as L, useEffect as D, Fragment as K, useCallback as X, createContext as Z, useMemo as H, useContext as fe, useRef as C, useState as $, useLayoutEffect as Q } from "react";
1
+ import { jsx as w, jsxs as F } from "react/jsx-runtime";
2
+ import { forwardRef as S, Children as $, isValidElement as A, createElement as v, cloneElement as B, useEffect as C, Fragment as Y, useCallback as z, createContext as W, useMemo as j, useContext as pe, useRef as x, useState as y, useLayoutEffect as de } from "react";
3
3
  import "react-dom";
4
- function ge(e) {
4
+ function fe(e) {
5
5
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
6
6
  }
7
- var ee = { exports: {} };
7
+ var K = { exports: {} };
8
8
  /*!
9
9
  Copyright (c) 2018 Jed Watson.
10
10
  Licensed under the MIT License (MIT), see
@@ -15,8 +15,8 @@ var ee = { exports: {} };
15
15
  var n = {}.hasOwnProperty;
16
16
  function t() {
17
17
  for (var r = "", o = 0; o < arguments.length; o++) {
18
- var u = arguments[o];
19
- u && (r = c(r, a.call(this, u)));
18
+ var c = arguments[o];
19
+ c && (r = i(r, a.call(this, c)));
20
20
  }
21
21
  return r;
22
22
  }
@@ -30,18 +30,18 @@ var ee = { exports: {} };
30
30
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
31
31
  return r.toString();
32
32
  var o = "";
33
- for (var u in r)
34
- n.call(r, u) && r[u] && (o = c(o, this && this[u] || u));
33
+ for (var c in r)
34
+ n.call(r, c) && r[c] && (o = i(o, this && this[c] || c));
35
35
  return o;
36
36
  }
37
- function c(r, o) {
37
+ function i(r, o) {
38
38
  return o ? r ? r + " " + o : r + o : r;
39
39
  }
40
40
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
41
41
  })();
42
- })(ee);
43
- var he = ee.exports;
44
- const be = /* @__PURE__ */ ge(he), _e = {
42
+ })(K);
43
+ var he = K.exports;
44
+ const ge = /* @__PURE__ */ fe(he), be = {
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",
@@ -54,93 +54,93 @@ const be = /* @__PURE__ */ ge(he), _e = {
54
54
  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>',
55
55
  keywords: ["checkmark-bold"],
56
56
  category: "utility"
57
- }, me = be.bind(_e), J = "purpur-icon", $e = "md", ye = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), xe = ({ content: e = "", title: n } = {}) => {
57
+ }, _e = ge.bind(be), U = "purpur-icon", me = "md", $e = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), ye = ({ 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 ${ye(t)}>${a}${e}</svg>`;
65
- }, we = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), re = ({
64
+ return `<svg ${$e(t)}>${a}${e}</svg>`;
65
+ }, we = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Q = ({
66
66
  ["data-testid"]: e,
67
67
  svg: n,
68
68
  allyTitle: t,
69
69
  className: a,
70
- size: c = $e,
70
+ size: i = me,
71
71
  ...r
72
72
  }) => {
73
- const o = xe({
73
+ const o = ye({
74
74
  content: we(n.svg),
75
75
  title: t
76
- }), u = me(a, J, `${J}--${c}`);
77
- return /* @__PURE__ */ x(
76
+ }), c = _e(a, U, `${U}--${i}`);
77
+ return /* @__PURE__ */ w(
78
78
  "span",
79
79
  {
80
80
  "aria-label": t,
81
- className: u,
81
+ className: c,
82
82
  "data-testid": e,
83
83
  dangerouslySetInnerHTML: { __html: o },
84
84
  ...r
85
85
  }
86
86
  );
87
87
  };
88
- re.displayName = "Icon";
89
- function E() {
90
- return E = Object.assign ? Object.assign.bind() : function(e) {
88
+ Q.displayName = "Icon";
89
+ function O() {
90
+ return O = Object.assign ? Object.assign.bind() : function(e) {
91
91
  for (var n = 1; n < arguments.length; n++) {
92
92
  var t = arguments[n];
93
93
  for (var a in t) ({}).hasOwnProperty.call(t, a) && (e[a] = t[a]);
94
94
  }
95
95
  return e;
96
- }, E.apply(null, arguments);
96
+ }, O.apply(null, arguments);
97
97
  }
98
- function Se(e, n) {
98
+ function xe(e, n) {
99
99
  typeof e == "function" ? e(n) : e != null && (e.current = n);
100
100
  }
101
- function Pe(...e) {
101
+ function Se(...e) {
102
102
  return (n) => e.forEach(
103
- (t) => Se(t, n)
103
+ (t) => xe(t, n)
104
104
  );
105
105
  }
106
- const te = /* @__PURE__ */ w((e, n) => {
107
- const { children: t, ...a } = e, c = y.toArray(t), r = c.find(Ae);
106
+ const ee = /* @__PURE__ */ S((e, n) => {
107
+ const { children: t, ...a } = e, i = $.toArray(t), r = i.find(ke);
108
108
  if (r) {
109
- const o = r.props.children, u = c.map((i) => i === r ? y.count(o) > 1 ? y.only(null) : /* @__PURE__ */ k(o) ? o.props.children : null : i);
110
- return /* @__PURE__ */ _(F, E({}, a, {
109
+ const o = r.props.children, c = i.map((u) => u === r ? $.count(o) > 1 ? $.only(null) : /* @__PURE__ */ A(o) ? o.props.children : null : u);
110
+ return /* @__PURE__ */ v(T, O({}, a, {
111
111
  ref: n
112
- }), /* @__PURE__ */ k(o) ? /* @__PURE__ */ L(o, void 0, u) : null);
112
+ }), /* @__PURE__ */ A(o) ? /* @__PURE__ */ B(o, void 0, c) : null);
113
113
  }
114
- return /* @__PURE__ */ _(F, E({}, a, {
114
+ return /* @__PURE__ */ v(T, O({}, a, {
115
115
  ref: n
116
116
  }), t);
117
117
  });
118
- te.displayName = "Slot";
119
- const F = /* @__PURE__ */ w((e, n) => {
118
+ ee.displayName = "Slot";
119
+ const T = /* @__PURE__ */ S((e, n) => {
120
120
  const { children: t, ...a } = e;
121
- return /* @__PURE__ */ k(t) ? /* @__PURE__ */ L(t, {
122
- ...Ne(a, t.props),
123
- ref: n ? Pe(n, t.ref) : t.ref
124
- }) : y.count(t) > 1 ? y.only(null) : null;
121
+ return /* @__PURE__ */ A(t) ? /* @__PURE__ */ B(t, {
122
+ ...Ae(a, t.props),
123
+ ref: n ? Se(n, t.ref) : t.ref
124
+ }) : $.count(t) > 1 ? $.only(null) : null;
125
125
  });
126
- F.displayName = "SlotClone";
127
- const ke = ({ children: e }) => /* @__PURE__ */ _(K, null, e);
128
- function Ae(e) {
129
- return /* @__PURE__ */ k(e) && e.type === ke;
126
+ T.displayName = "SlotClone";
127
+ const Pe = ({ children: e }) => /* @__PURE__ */ v(Y, null, e);
128
+ function ke(e) {
129
+ return /* @__PURE__ */ A(e) && e.type === Pe;
130
130
  }
131
- function Ne(e, n) {
131
+ function Ae(e, n) {
132
132
  const t = {
133
133
  ...n
134
134
  };
135
135
  for (const a in n) {
136
- const c = e[a], r = n[a];
137
- /^on[A-Z]/.test(a) ? c && r ? t[a] = (...o) => {
138
- r(...o), c(...o);
139
- } : c && (t[a] = c) : a === "style" ? t[a] = {
140
- ...c,
136
+ const i = e[a], r = n[a];
137
+ /^on[A-Z]/.test(a) ? i && r ? t[a] = (...o) => {
138
+ r(...o), i(...o);
139
+ } : i && (t[a] = i) : a === "style" ? t[a] = {
140
+ ...i,
141
141
  ...r
142
142
  } : a === "className" && (t[a] = [
143
- c,
143
+ i,
144
144
  r
145
145
  ].filter(Boolean).join(" "));
146
146
  }
@@ -149,7 +149,7 @@ function Ne(e, n) {
149
149
  ...t
150
150
  };
151
151
  }
152
- const De = [
152
+ const Ce = [
153
153
  "a",
154
154
  "button",
155
155
  "div",
@@ -166,30 +166,30 @@ const De = [
166
166
  "span",
167
167
  "svg",
168
168
  "ul"
169
- ], Ce = De.reduce((e, n) => {
170
- const t = /* @__PURE__ */ w((a, c) => {
171
- const { asChild: r, ...o } = a, u = r ? te : n;
172
- return D(() => {
169
+ ], Ne = Ce.reduce((e, n) => {
170
+ const t = /* @__PURE__ */ S((a, i) => {
171
+ const { asChild: r, ...o } = a, c = r ? ee : n;
172
+ return C(() => {
173
173
  window[Symbol.for("radix-ui")] = !0;
174
- }, []), /* @__PURE__ */ _(u, E({}, o, {
175
- ref: c
174
+ }, []), /* @__PURE__ */ v(c, O({}, o, {
175
+ ref: i
176
176
  }));
177
177
  });
178
178
  return t.displayName = `Primitive.${n}`, {
179
179
  ...e,
180
180
  [n]: t
181
181
  };
182
- }, {}), Ee = /* @__PURE__ */ w((e, n) => /* @__PURE__ */ _(Ce.label, E({}, e, {
182
+ }, {}), De = /* @__PURE__ */ S((e, n) => /* @__PURE__ */ v(Ne.label, O({}, e, {
183
183
  ref: n,
184
184
  onMouseDown: (t) => {
185
185
  var a;
186
186
  (a = e.onMouseDown) === null || a === void 0 || a.call(e, t), !t.defaultPrevented && t.detail > 1 && t.preventDefault();
187
187
  }
188
- }))), Oe = Ee;
189
- function Re(e) {
188
+ }))), Ee = De;
189
+ function Oe(e) {
190
190
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
191
191
  }
192
- var ne = { exports: {} };
192
+ var re = { exports: {} };
193
193
  /*!
194
194
  Copyright (c) 2018 Jed Watson.
195
195
  Licensed under the MIT License (MIT), see
@@ -200,8 +200,8 @@ var ne = { exports: {} };
200
200
  var n = {}.hasOwnProperty;
201
201
  function t() {
202
202
  for (var r = "", o = 0; o < arguments.length; o++) {
203
- var u = arguments[o];
204
- u && (r = c(r, a(u)));
203
+ var c = arguments[o];
204
+ c && (r = i(r, a(c)));
205
205
  }
206
206
  return r;
207
207
  }
@@ -215,44 +215,44 @@ var ne = { exports: {} };
215
215
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
216
216
  return r.toString();
217
217
  var o = "";
218
- for (var u in r)
219
- n.call(r, u) && r[u] && (o = c(o, u));
218
+ for (var c in r)
219
+ n.call(r, c) && r[c] && (o = i(o, c));
220
220
  return o;
221
221
  }
222
- function c(r, o) {
222
+ function i(r, o) {
223
223
  return o ? r ? r + " " + o : r + o : r;
224
224
  }
225
225
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
226
226
  })();
227
- })(ne);
228
- var Me = ne.exports;
229
- const je = /* @__PURE__ */ Re(Me), z = {
227
+ })(re);
228
+ var Re = re.exports;
229
+ const Me = /* @__PURE__ */ Oe(Re), X = {
230
230
  "purpur-label": "_purpur-label_12cfi_1",
231
231
  "purpur-label--negative": "_purpur-label--negative_12cfi_9",
232
232
  "purpur-label--disabled": "_purpur-label--disabled_12cfi_12"
233
- }, I = "purpur-label", He = ({
233
+ }, H = "purpur-label", ze = ({
234
234
  children: e,
235
235
  className: n,
236
236
  htmlFor: t,
237
237
  "data-testid": a,
238
- disabled: c,
238
+ disabled: i,
239
239
  negative: r = !1,
240
240
  ...o
241
241
  }) => {
242
- const u = je([
242
+ const c = Me([
243
243
  n,
244
- z[I],
244
+ X[H],
245
245
  {
246
- [z[`${I}--disabled`]]: c,
247
- [z[`${I}--negative`]]: r
246
+ [X[`${H}--disabled`]]: i,
247
+ [X[`${H}--negative`]]: r
248
248
  }
249
249
  ]);
250
- return /* @__PURE__ */ x(Oe, { className: u, "data-testid": a, htmlFor: t, ...o, children: e });
250
+ return /* @__PURE__ */ w(Ee, { className: c, "data-testid": a, htmlFor: t, ...o, children: e });
251
251
  };
252
- function Le(e) {
252
+ function je(e) {
253
253
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
254
254
  }
255
- var oe = { exports: {} };
255
+ var te = { exports: {} };
256
256
  /*!
257
257
  Copyright (c) 2018 Jed Watson.
258
258
  Licensed under the MIT License (MIT), see
@@ -263,8 +263,8 @@ var oe = { exports: {} };
263
263
  var n = {}.hasOwnProperty;
264
264
  function t() {
265
265
  for (var r = "", o = 0; o < arguments.length; o++) {
266
- var u = arguments[o];
267
- u && (r = c(r, a(u)));
266
+ var c = arguments[o];
267
+ c && (r = i(r, a(c)));
268
268
  }
269
269
  return r;
270
270
  }
@@ -278,18 +278,18 @@ var oe = { exports: {} };
278
278
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
279
279
  return r.toString();
280
280
  var o = "";
281
- for (var u in r)
282
- n.call(r, u) && r[u] && (o = c(o, u));
281
+ for (var c in r)
282
+ n.call(r, c) && r[c] && (o = i(o, c));
283
283
  return o;
284
284
  }
285
- function c(r, o) {
285
+ function i(r, o) {
286
286
  return o ? r ? r + " " + o : r + o : r;
287
287
  }
288
288
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
289
289
  })();
290
- })(oe);
291
- var Xe = oe.exports;
292
- const Be = /* @__PURE__ */ Le(Xe), M = {
290
+ })(te);
291
+ var Be = te.exports;
292
+ const Le = /* @__PURE__ */ je(Be), R = {
293
293
  "purpur-paragraph": "_purpur-paragraph_1rh57_1",
294
294
  "purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
295
295
  "purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
@@ -304,7 +304,7 @@ const Be = /* @__PURE__ */ Le(Xe), M = {
304
304
  "purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1rh57_60",
305
305
  "purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1rh57_67",
306
306
  "purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1rh57_75"
307
- }, Te = {
307
+ }, Xe = {
308
308
  PARAGRAPH100: "paragraph-100",
309
309
  PARAGRAPH100MEDIUM: "paragraph-100-medium",
310
310
  PARAGRAPH100BOLD: "paragraph-100-bold",
@@ -315,124 +315,124 @@ const Be = /* @__PURE__ */ Le(Xe), M = {
315
315
  ADDITIONAL100MEDIUM: "additional-100-medium",
316
316
  OVERLINE100: "overline-100",
317
317
  OVERLINE200: "overline-200"
318
- }, j = "purpur-paragraph", ae = ({
318
+ }, M = "purpur-paragraph", ne = ({
319
319
  ["data-testid"]: e,
320
320
  children: n,
321
321
  className: t,
322
322
  disabled: a,
323
- enableHyphenation: c = !1,
323
+ enableHyphenation: i = !1,
324
324
  negative: r = !1,
325
- variant: o = Te.PARAGRAPH100,
326
- ...u
325
+ variant: o = Xe.PARAGRAPH100,
326
+ ...c
327
327
  }) => {
328
- const i = Be([
328
+ const u = Le([
329
329
  t,
330
- M[j],
331
- M[`${j}--${o}`],
330
+ R[M],
331
+ R[`${M}--${o}`],
332
332
  {
333
- [M[`${j}--hyphens`]]: c,
334
- [M[`${j}--disabled`]]: a,
335
- [M[`${j}--negative`]]: r
333
+ [R[`${M}--hyphens`]]: i,
334
+ [R[`${M}--disabled`]]: a,
335
+ [R[`${M}--negative`]]: r
336
336
  }
337
337
  ]);
338
- return /* @__PURE__ */ x("p", { ...u, className: i, "data-testid": e, children: n });
338
+ return /* @__PURE__ */ w("p", { ...c, className: u, "data-testid": e, children: n });
339
339
  };
340
- ae.displayName = "Paragraph";
341
- function N() {
342
- return N = Object.assign ? Object.assign.bind() : function(e) {
340
+ ne.displayName = "Paragraph";
341
+ function D() {
342
+ return D = Object.assign ? Object.assign.bind() : function(e) {
343
343
  for (var n = 1; n < arguments.length; n++) {
344
344
  var t = arguments[n];
345
345
  for (var a in t) ({}).hasOwnProperty.call(t, a) && (e[a] = t[a]);
346
346
  }
347
347
  return e;
348
- }, N.apply(null, arguments);
348
+ }, D.apply(null, arguments);
349
349
  }
350
- function ze(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
351
- return function(c) {
352
- if (e == null || e(c), t === !1 || !c.defaultPrevented) return n == null ? void 0 : n(c);
350
+ function He(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
351
+ return function(i) {
352
+ if (e == null || e(i), t === !1 || !i.defaultPrevented) return n == null ? void 0 : n(i);
353
353
  };
354
354
  }
355
355
  function Ie(e, n) {
356
356
  typeof e == "function" ? e(n) : e != null && (e.current = n);
357
357
  }
358
- function ce(...e) {
358
+ function oe(...e) {
359
359
  return (n) => e.forEach(
360
360
  (t) => Ie(t, n)
361
361
  );
362
362
  }
363
- function qe(...e) {
364
- return X(ce(...e), e);
363
+ function Te(...e) {
364
+ return z(oe(...e), e);
365
365
  }
366
- function Fe(e, n = []) {
366
+ function qe(e, n = []) {
367
367
  let t = [];
368
368
  function a(r, o) {
369
- const u = /* @__PURE__ */ Z(o), i = t.length;
369
+ const c = /* @__PURE__ */ W(o), u = t.length;
370
370
  t = [
371
371
  ...t,
372
372
  o
373
373
  ];
374
374
  function s(l) {
375
- const { scope: p, children: v, ...f } = l, g = (p == null ? void 0 : p[e][i]) || u, d = H(
376
- () => f,
377
- Object.values(f)
375
+ const { scope: p, children: f, ...d } = l, b = (p == null ? void 0 : p[e][u]) || c, h = j(
376
+ () => d,
377
+ Object.values(d)
378
378
  );
379
- return /* @__PURE__ */ _(g.Provider, {
380
- value: d
381
- }, v);
379
+ return /* @__PURE__ */ v(b.Provider, {
380
+ value: h
381
+ }, f);
382
382
  }
383
- function h(l, p) {
384
- const v = (p == null ? void 0 : p[e][i]) || u, f = fe(v);
385
- if (f) return f;
383
+ function g(l, p) {
384
+ const f = (p == null ? void 0 : p[e][u]) || c, d = pe(f);
385
+ if (d) return d;
386
386
  if (o !== void 0) return o;
387
387
  throw new Error(`\`${l}\` must be used within \`${r}\``);
388
388
  }
389
389
  return s.displayName = r + "Provider", [
390
390
  s,
391
- h
391
+ g
392
392
  ];
393
393
  }
394
- const c = () => {
395
- const r = t.map((o) => /* @__PURE__ */ Z(o));
396
- return function(u) {
397
- const i = (u == null ? void 0 : u[e]) || r;
398
- return H(
394
+ const i = () => {
395
+ const r = t.map((o) => /* @__PURE__ */ W(o));
396
+ return function(c) {
397
+ const u = (c == null ? void 0 : c[e]) || r;
398
+ return j(
399
399
  () => ({
400
400
  [`__scope${e}`]: {
401
- ...u,
402
- [e]: i
401
+ ...c,
402
+ [e]: u
403
403
  }
404
404
  }),
405
405
  [
406
- u,
407
- i
406
+ c,
407
+ u
408
408
  ]
409
409
  );
410
410
  };
411
411
  };
412
- return c.scopeName = e, [
412
+ return i.scopeName = e, [
413
413
  a,
414
- Ue(c, ...n)
414
+ Fe(i, ...n)
415
415
  ];
416
416
  }
417
- function Ue(...e) {
417
+ function Fe(...e) {
418
418
  const n = e[0];
419
419
  if (e.length === 1) return n;
420
420
  const t = () => {
421
421
  const a = e.map(
422
- (c) => ({
423
- useScope: c(),
424
- scopeName: c.scopeName
422
+ (i) => ({
423
+ useScope: i(),
424
+ scopeName: i.scopeName
425
425
  })
426
426
  );
427
427
  return function(r) {
428
- const o = a.reduce((u, { useScope: i, scopeName: s }) => {
429
- const l = i(r)[`__scope${s}`];
428
+ const o = a.reduce((c, { useScope: u, scopeName: s }) => {
429
+ const l = u(r)[`__scope${s}`];
430
430
  return {
431
- ...u,
431
+ ...c,
432
432
  ...l
433
433
  };
434
434
  }, {});
435
- return H(
435
+ return j(
436
436
  () => ({
437
437
  [`__scope${n.scopeName}`]: o
438
438
  }),
@@ -444,11 +444,11 @@ function Ue(...e) {
444
444
  };
445
445
  return t.scopeName = n.scopeName, t;
446
446
  }
447
- function ue(e) {
448
- const n = C(e);
449
- return D(() => {
447
+ function ae(e) {
448
+ const n = x(e);
449
+ return C(() => {
450
450
  n.current = e;
451
- }), H(
451
+ }), j(
452
452
  () => (...t) => {
453
453
  var a;
454
454
  return (a = n.current) === null || a === void 0 ? void 0 : a.call(n, ...t);
@@ -456,68 +456,68 @@ function ue(e) {
456
456
  []
457
457
  );
458
458
  }
459
- function Ve({ prop: e, defaultProp: n, onChange: t = () => {
459
+ function We({ prop: e, defaultProp: n, onChange: t = () => {
460
460
  } }) {
461
- const [a, c] = We({
461
+ const [a, i] = Ue({
462
462
  defaultProp: n,
463
463
  onChange: t
464
- }), r = e !== void 0, o = r ? e : a, u = ue(t), i = X((s) => {
464
+ }), r = e !== void 0, o = r ? e : a, c = ae(t), u = z((s) => {
465
465
  if (r) {
466
466
  const l = typeof s == "function" ? s(e) : s;
467
- l !== e && u(l);
468
- } else c(s);
467
+ l !== e && c(l);
468
+ } else i(s);
469
469
  }, [
470
470
  r,
471
471
  e,
472
- c,
473
- u
472
+ i,
473
+ c
474
474
  ]);
475
475
  return [
476
476
  o,
477
- i
477
+ u
478
478
  ];
479
479
  }
480
- function We({ defaultProp: e, onChange: n }) {
481
- const t = $(e), [a] = t, c = C(a), r = ue(n);
482
- return D(() => {
483
- c.current !== a && (r(a), c.current = a);
480
+ function Ue({ defaultProp: e, onChange: n }) {
481
+ const t = y(e), [a] = t, i = x(a), r = ae(n);
482
+ return C(() => {
483
+ i.current !== a && (r(a), i.current = a);
484
484
  }, [
485
485
  a,
486
- c,
486
+ i,
487
487
  r
488
488
  ]), t;
489
489
  }
490
- function Ge(e) {
491
- const n = C({
490
+ function Ve(e) {
491
+ const n = x({
492
492
  value: e,
493
493
  previous: e
494
494
  });
495
- return H(() => (n.current.value !== e && (n.current.previous = n.current.value, n.current.value = e), n.current.previous), [
495
+ return j(() => (n.current.value !== e && (n.current.previous = n.current.value, n.current.value = e), n.current.previous), [
496
496
  e
497
497
  ]);
498
498
  }
499
- const Ze = globalThis != null && globalThis.document ? Q : () => {
499
+ const Ge = globalThis != null && globalThis.document ? de : () => {
500
500
  };
501
- function Je(e) {
502
- const [n, t] = $(void 0);
503
- return Ze(() => {
501
+ function Ze(e) {
502
+ const [n, t] = y(void 0);
503
+ return Ge(() => {
504
504
  if (e) {
505
505
  t({
506
506
  width: e.offsetWidth,
507
507
  height: e.offsetHeight
508
508
  });
509
- const a = new ResizeObserver((c) => {
510
- if (!Array.isArray(c) || !c.length) return;
511
- const r = c[0];
512
- let o, u;
509
+ const a = new ResizeObserver((i) => {
510
+ if (!Array.isArray(i) || !i.length) return;
511
+ const r = i[0];
512
+ let o, c;
513
513
  if ("borderBoxSize" in r) {
514
- const i = r.borderBoxSize, s = Array.isArray(i) ? i[0] : i;
515
- o = s.inlineSize, u = s.blockSize;
514
+ const u = r.borderBoxSize, s = Array.isArray(u) ? u[0] : u;
515
+ o = s.inlineSize, c = s.blockSize;
516
516
  } else
517
- o = e.offsetWidth, u = e.offsetHeight;
517
+ o = e.offsetWidth, c = e.offsetHeight;
518
518
  t({
519
519
  width: o,
520
- height: u
520
+ height: c
521
521
  });
522
522
  });
523
523
  return a.observe(e, {
@@ -529,44 +529,44 @@ function Je(e) {
529
529
  e
530
530
  ]), n;
531
531
  }
532
- const ie = /* @__PURE__ */ w((e, n) => {
533
- const { children: t, ...a } = e, c = y.toArray(t), r = c.find(Ke);
532
+ const ie = /* @__PURE__ */ S((e, n) => {
533
+ const { children: t, ...a } = e, i = $.toArray(t), r = i.find(Ye);
534
534
  if (r) {
535
- const o = r.props.children, u = c.map((i) => i === r ? y.count(o) > 1 ? y.only(null) : /* @__PURE__ */ k(o) ? o.props.children : null : i);
536
- return /* @__PURE__ */ _(U, N({}, a, {
535
+ const o = r.props.children, c = i.map((u) => u === r ? $.count(o) > 1 ? $.only(null) : /* @__PURE__ */ A(o) ? o.props.children : null : u);
536
+ return /* @__PURE__ */ v(q, D({}, a, {
537
537
  ref: n
538
- }), /* @__PURE__ */ k(o) ? /* @__PURE__ */ L(o, void 0, u) : null);
538
+ }), /* @__PURE__ */ A(o) ? /* @__PURE__ */ B(o, void 0, c) : null);
539
539
  }
540
- return /* @__PURE__ */ _(U, N({}, a, {
540
+ return /* @__PURE__ */ v(q, D({}, a, {
541
541
  ref: n
542
542
  }), t);
543
543
  });
544
544
  ie.displayName = "Slot";
545
- const U = /* @__PURE__ */ w((e, n) => {
545
+ const q = /* @__PURE__ */ S((e, n) => {
546
546
  const { children: t, ...a } = e;
547
- return /* @__PURE__ */ k(t) ? /* @__PURE__ */ L(t, {
548
- ...Qe(a, t.props),
549
- ref: n ? ce(n, t.ref) : t.ref
550
- }) : y.count(t) > 1 ? y.only(null) : null;
547
+ return /* @__PURE__ */ A(t) ? /* @__PURE__ */ B(t, {
548
+ ...Ke(a, t.props),
549
+ ref: n ? oe(n, t.ref) : t.ref
550
+ }) : $.count(t) > 1 ? $.only(null) : null;
551
551
  });
552
- U.displayName = "SlotClone";
553
- const Ye = ({ children: e }) => /* @__PURE__ */ _(K, null, e);
554
- function Ke(e) {
555
- return /* @__PURE__ */ k(e) && e.type === Ye;
552
+ q.displayName = "SlotClone";
553
+ const Je = ({ children: e }) => /* @__PURE__ */ v(Y, null, e);
554
+ function Ye(e) {
555
+ return /* @__PURE__ */ A(e) && e.type === Je;
556
556
  }
557
- function Qe(e, n) {
557
+ function Ke(e, n) {
558
558
  const t = {
559
559
  ...n
560
560
  };
561
561
  for (const a in n) {
562
- const c = e[a], r = n[a];
563
- /^on[A-Z]/.test(a) ? c && r ? t[a] = (...u) => {
564
- r(...u), c(...u);
565
- } : c && (t[a] = c) : a === "style" ? t[a] = {
566
- ...c,
562
+ const i = e[a], r = n[a];
563
+ /^on[A-Z]/.test(a) ? i && r ? t[a] = (...c) => {
564
+ r(...c), i(...c);
565
+ } : i && (t[a] = i) : a === "style" ? t[a] = {
566
+ ...i,
567
567
  ...r
568
568
  } : a === "className" && (t[a] = [
569
- c,
569
+ i,
570
570
  r
571
571
  ].filter(Boolean).join(" "));
572
572
  }
@@ -575,7 +575,7 @@ function Qe(e, n) {
575
575
  ...t
576
576
  };
577
577
  }
578
- const er = [
578
+ const Qe = [
579
579
  "a",
580
580
  "button",
581
581
  "div",
@@ -592,92 +592,92 @@ const er = [
592
592
  "span",
593
593
  "svg",
594
594
  "ul"
595
- ], se = er.reduce((e, n) => {
596
- const t = /* @__PURE__ */ w((a, c) => {
597
- const { asChild: r, ...o } = a, u = r ? ie : n;
598
- return D(() => {
595
+ ], ce = Qe.reduce((e, n) => {
596
+ const t = /* @__PURE__ */ S((a, i) => {
597
+ const { asChild: r, ...o } = a, c = r ? ie : n;
598
+ return C(() => {
599
599
  window[Symbol.for("radix-ui")] = !0;
600
- }, []), /* @__PURE__ */ _(u, N({}, o, {
601
- ref: c
600
+ }, []), /* @__PURE__ */ v(c, D({}, o, {
601
+ ref: i
602
602
  }));
603
603
  });
604
604
  return t.displayName = `Primitive.${n}`, {
605
605
  ...e,
606
606
  [n]: t
607
607
  };
608
- }, {}), le = "Switch", [rr, mr] = Fe(le), [tr, nr] = rr(le), or = /* @__PURE__ */ w((e, n) => {
609
- const { __scopeSwitch: t, name: a, checked: c, defaultChecked: r, required: o, disabled: u, value: i = "on", onCheckedChange: s, ...h } = e, [l, p] = $(null), v = qe(
608
+ }, {}), ue = "Switch", [er, mr] = qe(ue), [rr, tr] = er(ue), nr = /* @__PURE__ */ S((e, n) => {
609
+ const { __scopeSwitch: t, name: a, checked: i, defaultChecked: r, required: o, disabled: c, value: u = "on", onCheckedChange: s, ...g } = e, [l, p] = y(null), f = Te(
610
610
  n,
611
611
  (m) => p(m)
612
- ), f = C(!1), g = l ? !!l.closest("form") : !0, [d = !1, b] = Ve({
613
- prop: c,
612
+ ), d = x(!1), b = l ? !!l.closest("form") : !0, [h = !1, _] = We({
613
+ prop: i,
614
614
  defaultProp: r,
615
615
  onChange: s
616
616
  });
617
- return /* @__PURE__ */ _(tr, {
617
+ return /* @__PURE__ */ v(rr, {
618
618
  scope: t,
619
- checked: d,
620
- disabled: u
621
- }, /* @__PURE__ */ _(se.button, N({
619
+ checked: h,
620
+ disabled: c
621
+ }, /* @__PURE__ */ v(ce.button, D({
622
622
  type: "button",
623
623
  role: "switch",
624
- "aria-checked": d,
624
+ "aria-checked": h,
625
625
  "aria-required": o,
626
- "data-state": pe(d),
627
- "data-disabled": u ? "" : void 0,
628
- disabled: u,
629
- value: i
630
- }, h, {
631
- ref: v,
632
- onClick: ze(e.onClick, (m) => {
633
- b(
634
- (A) => !A
635
- ), g && (f.current = m.isPropagationStopped(), f.current || m.stopPropagation());
626
+ "data-state": se(h),
627
+ "data-disabled": c ? "" : void 0,
628
+ disabled: c,
629
+ value: u
630
+ }, g, {
631
+ ref: f,
632
+ onClick: He(e.onClick, (m) => {
633
+ _(
634
+ (N) => !N
635
+ ), b && (d.current = m.isPropagationStopped(), d.current || m.stopPropagation());
636
636
  })
637
- })), g && /* @__PURE__ */ _(ur, {
637
+ })), b && /* @__PURE__ */ v(ir, {
638
638
  control: l,
639
- bubbles: !f.current,
639
+ bubbles: !d.current,
640
640
  name: a,
641
- value: i,
642
- checked: d,
641
+ value: u,
642
+ checked: h,
643
643
  required: o,
644
- disabled: u,
644
+ disabled: c,
645
645
  style: {
646
646
  transform: "translateX(-100%)"
647
647
  }
648
648
  }));
649
- }), ar = "SwitchThumb", cr = /* @__PURE__ */ w((e, n) => {
650
- const { __scopeSwitch: t, ...a } = e, c = nr(ar, t);
651
- return /* @__PURE__ */ _(se.span, N({
652
- "data-state": pe(c.checked),
653
- "data-disabled": c.disabled ? "" : void 0
649
+ }), or = "SwitchThumb", ar = /* @__PURE__ */ S((e, n) => {
650
+ const { __scopeSwitch: t, ...a } = e, i = tr(or, t);
651
+ return /* @__PURE__ */ v(ce.span, D({
652
+ "data-state": se(i.checked),
653
+ "data-disabled": i.disabled ? "" : void 0
654
654
  }, a, {
655
655
  ref: n
656
656
  }));
657
- }), ur = (e) => {
658
- const { control: n, checked: t, bubbles: a = !0, ...c } = e, r = C(null), o = Ge(t), u = Je(n);
659
- return D(() => {
660
- const i = r.current, s = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(s, "checked").set;
657
+ }), ir = (e) => {
658
+ const { control: n, checked: t, bubbles: a = !0, ...i } = e, r = x(null), o = Ve(t), c = Ze(n);
659
+ return C(() => {
660
+ const u = r.current, s = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(s, "checked").set;
661
661
  if (o !== t && l) {
662
662
  const p = new Event("click", {
663
663
  bubbles: a
664
664
  });
665
- l.call(i, t), i.dispatchEvent(p);
665
+ l.call(u, t), u.dispatchEvent(p);
666
666
  }
667
667
  }, [
668
668
  o,
669
669
  t,
670
670
  a
671
- ]), /* @__PURE__ */ _("input", N({
671
+ ]), /* @__PURE__ */ v("input", D({
672
672
  type: "checkbox",
673
673
  "aria-hidden": !0,
674
674
  defaultChecked: t
675
- }, c, {
675
+ }, i, {
676
676
  tabIndex: -1,
677
677
  ref: r,
678
678
  style: {
679
679
  ...e.style,
680
- ...u,
680
+ ...c,
681
681
  position: "absolute",
682
682
  pointerEvents: "none",
683
683
  opacity: 0,
@@ -685,14 +685,14 @@ const er = [
685
685
  }
686
686
  }));
687
687
  };
688
- function pe(e) {
688
+ function se(e) {
689
689
  return e ? "checked" : "unchecked";
690
690
  }
691
- const ir = or, sr = cr;
692
- function lr(e) {
691
+ const cr = nr, ur = ar;
692
+ function sr(e) {
693
693
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
694
694
  }
695
- var de = { exports: {} };
695
+ var le = { exports: {} };
696
696
  /*!
697
697
  Copyright (c) 2018 Jed Watson.
698
698
  Licensed under the MIT License (MIT), see
@@ -703,8 +703,8 @@ var de = { exports: {} };
703
703
  var n = {}.hasOwnProperty;
704
704
  function t() {
705
705
  for (var r = "", o = 0; o < arguments.length; o++) {
706
- var u = arguments[o];
707
- u && (r = c(r, a(u)));
706
+ var c = arguments[o];
707
+ c && (r = i(r, a(c)));
708
708
  }
709
709
  return r;
710
710
  }
@@ -718,153 +718,187 @@ var de = { exports: {} };
718
718
  if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
719
719
  return r.toString();
720
720
  var o = "";
721
- for (var u in r)
722
- n.call(r, u) && r[u] && (o = c(o, u));
721
+ for (var c in r)
722
+ n.call(r, c) && r[c] && (o = i(o, c));
723
723
  return o;
724
724
  }
725
- function c(r, o) {
725
+ function i(r, o) {
726
726
  return o ? r ? r + " " + o : r + o : r;
727
727
  }
728
728
  e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
729
729
  })();
730
- })(de);
731
- var pr = de.exports;
732
- const q = /* @__PURE__ */ lr(pr), S = {
733
- "purpur-toggle": "_purpur-toggle_1xng6_1",
734
- "purpur-toggle__track": "_purpur-toggle__track_1xng6_7",
735
- "purpur-toggle__checkmark-container": "_purpur-toggle__checkmark-container_1xng6_45",
736
- "purpur-toggle__thumb": "_purpur-toggle__thumb_1xng6_60",
737
- "purpur-toggle__thumb--dragging": "_purpur-toggle__thumb--dragging_1xng6_80",
738
- "purpur-toggle__checkmark": "_purpur-toggle__checkmark_1xng6_45",
739
- "purpur-toggle__label--right": "_purpur-toggle__label--right_1xng6_100",
740
- "purpur-toggle__label--left": "_purpur-toggle__label--left_1xng6_103",
741
- "purpur-toggle__container": "_purpur-toggle__container_1xng6_106"
742
- }, Y = (e) => e && "touches" in e, dr = ({
730
+ })(le);
731
+ var lr = le.exports;
732
+ const I = /* @__PURE__ */ sr(lr), V = (e) => e && "touches" in e, pr = ({
743
733
  children: e,
744
734
  disabled: n,
745
735
  onStart: t,
746
736
  onDrag: a,
747
- onStop: c,
737
+ onStop: i,
748
738
  bounds: r,
749
739
  position: o,
750
- style: u
740
+ style: c
751
741
  }) => {
752
- const [i, s] = $(void 0), [h, l] = $(void 0), [p, v] = $(!1), f = (b) => {
742
+ const [u, s] = y(void 0), [g, l] = y(void 0), [p, f] = y(!1), d = (_) => {
753
743
  if (!n) {
754
- b.preventDefault();
755
- const m = Y(b.nativeEvent) ? b.nativeEvent.touches[0].clientX : b.nativeEvent.clientX;
744
+ _.preventDefault();
745
+ const m = V(_.nativeEvent) ? _.nativeEvent.touches[0].clientX : _.nativeEvent.clientX;
756
746
  l(m), t == null || t();
757
747
  }
758
- }, g = X(
759
- (b) => {
760
- if (typeof h != "number")
748
+ }, b = z(
749
+ (_) => {
750
+ if (typeof g != "number")
761
751
  return;
762
- const A = (Y(b) ? b.touches[0].clientX : b.clientX) - h;
763
- if (!A)
752
+ const N = (V(_) ? _.touches[0].clientX : _.clientX) - g;
753
+ if (!N)
764
754
  return;
765
- const O = o + A;
766
- !p && Math.abs(O) && v(!0);
767
- const B = O > r.right ? r.right : O < r.left ? r.left : O;
768
- s(B), a == null || a({ x: B });
755
+ const E = o + N;
756
+ !p && Math.abs(E) && f(!0);
757
+ const L = E > r.right ? r.right : E < r.left ? r.left : E;
758
+ s(L), a == null || a({ x: L });
769
759
  },
770
- [a, s, p, h]
771
- ), d = X(() => {
772
- l(void 0), s(void 0), v(!1), c == null || c();
773
- }, [c, l]);
774
- return D(() => (window.addEventListener("mousemove", g), window.addEventListener("touchmove", g), () => {
775
- window.removeEventListener("mousemove", g), window.removeEventListener("touchmove", g);
776
- }), [g]), D(() => (window.addEventListener("mouseup", d), window.addEventListener("touchend", d), () => {
777
- window.removeEventListener("mouseup", d), window.removeEventListener("touchend", d);
778
- }), [d]), k(e) ? L(y.only(e), {
779
- onMouseDown: f,
780
- onTouchStart: f,
781
- style: { ...u, transform: `translateX(${p ? i : o}px)` }
760
+ [a, s, p, g]
761
+ ), h = z(() => {
762
+ l(void 0), s(void 0), f(!1), i == null || i();
763
+ }, [i, l]);
764
+ return C(() => (window.addEventListener("mousemove", b), window.addEventListener("touchmove", b), () => {
765
+ window.removeEventListener("mousemove", b), window.removeEventListener("touchmove", b);
766
+ }), [b]), C(() => (window.addEventListener("mouseup", h), window.addEventListener("touchend", h), () => {
767
+ window.removeEventListener("mouseup", h), window.removeEventListener("touchend", h);
768
+ }), [h]), A(e) ? B($.only(e), {
769
+ onMouseDown: d,
770
+ onTouchStart: d,
771
+ style: { ...c, transform: `translateX(${p ? u : o}px)` }
782
772
  }) : null;
783
- }, fr = ({ checked: e, onChange: n }) => {
784
- var V, W;
785
- const t = C(null), a = C(null), [c, r] = $(void 0), [o, u] = $(!1), [i, s] = $(0), [h, l] = $(0), [p, v] = $(0);
786
- Q(() => {
787
- var R, T;
788
- l(((R = a.current) == null ? void 0 : R.clientHeight) || 0), v(((T = t.current) == null ? void 0 : T.clientHeight) || 0);
789
- }, [(V = a.current) == null ? void 0 : V.clientHeight, (W = t.current) == null ? void 0 : W.clientHeight]);
790
- const f = (p || 0) - h, g = h + f, d = f / 2, b = g / 2, m = typeof c == "number" && (e ? c < b : c > b);
773
+ }, G = {
774
+ width: void 0,
775
+ height: void 0
776
+ };
777
+ function Z(e) {
778
+ const { ref: n, box: t = "content-box", round: a } = e, [{ width: i, height: r }, o] = y(G), c = dr(), u = x({ ...G }), s = x(void 0);
779
+ return s.current = e.onResize, C(() => {
780
+ if (!n.current || typeof window > "u" || !("ResizeObserver" in window))
781
+ return;
782
+ const g = new ResizeObserver(([l]) => {
783
+ const p = (
784
+ // eslint-disable-next-line no-nested-ternary
785
+ t === "border-box" ? "borderBoxSize" : t === "device-pixel-content-box" ? "devicePixelContentBoxSize" : "contentBoxSize"
786
+ ), f = J(l, p, "inlineSize"), d = J(l, p, "blockSize");
787
+ if (u.current.width !== f || u.current.height !== d) {
788
+ const h = {
789
+ width: f && a ? Math.round(f) : f,
790
+ height: d && a ? Math.round(d) : d
791
+ };
792
+ u.current.width = f, u.current.height = d, s.current ? s.current(h) : c() && o(h);
793
+ }
794
+ });
795
+ return g.observe(n.current, { box: t }), () => {
796
+ g.disconnect();
797
+ };
798
+ }, [t, n, c, a]), { width: i, height: r };
799
+ }
800
+ function J(e, n, t) {
801
+ return e[n] ? Array.isArray(e[n]) ? e[n][0][t] : (
802
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
803
+ // @ts-ignore Support Firefox's non-standard behavior
804
+ e[n][t]
805
+ ) : n === "contentBoxSize" ? e.contentRect[t === "inlineSize" ? "width" : "height"] : void 0;
806
+ }
807
+ function dr() {
808
+ const e = x(!1);
809
+ return C(() => (e.current = !0, () => {
810
+ e.current = !1;
811
+ }), []), z(() => e.current, []);
812
+ }
813
+ const fr = ({ checked: e, onChange: n }) => {
814
+ const t = x(null), a = x(null), [i, r] = y(void 0), [o, c] = y(!1), [u, s] = y(0), { height: g = 0 } = Z({ ref: a, round: !0 }), { height: l = 0 } = Z({ ref: t, round: !0 }), p = (l || 0) - g, f = g + p, d = p / 2, b = f / 2, h = typeof i == "number" && (e ? i < b : i > b);
791
815
  return {
792
816
  trackRef: t,
793
817
  thumbRef: a,
794
818
  isDragging: o,
795
- bounds: { left: d, right: g },
796
- position: e ? g : d,
797
- onDrag: ({ x: R }) => {
798
- r(R), Math.abs((e ? g : d) - R) > 2 && u(!0);
819
+ bounds: { left: d, right: f },
820
+ position: e ? f : d,
821
+ onDrag: ({ x: E }) => {
822
+ r(E), Math.abs((e ? f : d) - E) > 2 && c(!0);
799
823
  },
800
824
  onStop: () => {
801
- u(!1), o && s(Date.now()), m && (n == null || n(!e));
825
+ c(!1), o && s(Date.now()), h && (n == null || n(!e));
802
826
  },
803
827
  onChangeWithDrag: () => {
804
- Date.now() - i > 50 && (n == null || n(!e)), r(void 0);
828
+ Date.now() - u > 50 && (n == null || n(!e)), r(void 0);
805
829
  }
806
830
  };
807
- }, P = "purpur-toggle", gr = ({
831
+ }, P = {
832
+ "purpur-toggle": "_purpur-toggle_1xng6_1",
833
+ "purpur-toggle__track": "_purpur-toggle__track_1xng6_7",
834
+ "purpur-toggle__checkmark-container": "_purpur-toggle__checkmark-container_1xng6_45",
835
+ "purpur-toggle__thumb": "_purpur-toggle__thumb_1xng6_60",
836
+ "purpur-toggle__thumb--dragging": "_purpur-toggle__thumb--dragging_1xng6_80",
837
+ "purpur-toggle__checkmark": "_purpur-toggle__checkmark_1xng6_45",
838
+ "purpur-toggle__label--right": "_purpur-toggle__label--right_1xng6_100",
839
+ "purpur-toggle__label--left": "_purpur-toggle__label--left_1xng6_103",
840
+ "purpur-toggle__container": "_purpur-toggle__container_1xng6_106"
841
+ }, k = "purpur-toggle", hr = ({
808
842
  ["data-testid"]: e,
809
843
  className: n,
810
844
  label: t,
811
845
  onChange: a,
812
- labelPosition: c = "right",
846
+ labelPosition: i = "right",
813
847
  checked: r,
814
848
  disableDrag: o,
815
- defaultChecked: u,
816
- ...i
849
+ defaultChecked: c,
850
+ ...u
817
851
  }, s) => {
818
- const [h, l] = $(
819
- typeof r == "boolean" ? r : !!u
820
- ), p = !!(typeof r == "boolean" ? r : h), { thumbRef: v, trackRef: f, isDragging: g, onChangeWithDrag: d, ...b } = fr({
852
+ const [g, l] = y(
853
+ typeof r == "boolean" ? r : !!c
854
+ ), p = !!(typeof r == "boolean" ? r : g), { thumbRef: f, trackRef: d, isDragging: b, onChangeWithDrag: h, ..._ } = fr({
821
855
  checked: p,
822
- onChange: (A) => {
823
- i.disabled || (a == null || a(A), l(A));
856
+ onChange: (N) => {
857
+ u.disabled || (a == null || a(N), l(N));
824
858
  }
825
- }), m = () => /* @__PURE__ */ x(
826
- He,
859
+ }), m = () => /* @__PURE__ */ w(
860
+ ze,
827
861
  {
828
- htmlFor: i.id,
862
+ htmlFor: u.id,
829
863
  "data-testid": e && `${e}-label`,
830
- disabled: i.disabled,
831
- className: q(
832
- S[`${P}__label`],
833
- S[`${P}__label--${c}`]
864
+ disabled: u.disabled,
865
+ className: I(
866
+ P[`${k}__label`],
867
+ P[`${k}__label--${i}`]
834
868
  ),
835
- children: /* @__PURE__ */ x(ae, { variant: "paragraph-100", disabled: i.disabled, children: t })
869
+ children: /* @__PURE__ */ w(ne, { variant: "paragraph-100", disabled: u.disabled, children: t })
836
870
  }
837
871
  );
838
- return /* @__PURE__ */ G("div", { className: q([n, S[`${P}__container`]]), children: [
839
- t && c === "left" && m(),
840
- /* @__PURE__ */ x(
841
- ir,
872
+ return /* @__PURE__ */ F("div", { className: I([n, P[`${k}__container`]]), children: [
873
+ t && i === "left" && m(),
874
+ /* @__PURE__ */ w(
875
+ cr,
842
876
  {
843
- ...i,
877
+ ...u,
844
878
  ref: s,
845
- id: i.id,
879
+ id: u.id,
846
880
  "data-testid": e,
847
- className: S[P],
848
- onCheckedChange: d,
881
+ className: P[k],
882
+ onCheckedChange: h,
849
883
  checked: p,
850
- children: /* @__PURE__ */ G("span", { ref: f, className: S[`${P}__track`], children: [
851
- /* @__PURE__ */ x("span", { className: S[`${P}__checkmark-container`], children: /* @__PURE__ */ x(
852
- re,
884
+ children: /* @__PURE__ */ F("span", { ref: d, className: P[`${k}__track`], children: [
885
+ /* @__PURE__ */ w("span", { className: P[`${k}__checkmark-container`], children: /* @__PURE__ */ w(
886
+ Q,
853
887
  {
854
- className: S[`${P}__checkmark`],
888
+ className: P[`${k}__checkmark`],
855
889
  svg: ve,
856
890
  size: "xxs"
857
891
  }
858
892
  ) }),
859
- /* @__PURE__ */ x(dr, { disabled: o, ...b, children: /* @__PURE__ */ x(
860
- sr,
893
+ /* @__PURE__ */ w(pr, { disabled: o, ..._, children: /* @__PURE__ */ w(
894
+ ur,
861
895
  {
862
- ref: v,
896
+ ref: f,
863
897
  "data-testid": e && `${e}-thumb`,
864
- className: q([
865
- S[`${P}__thumb`],
898
+ className: I([
899
+ P[`${k}__thumb`],
866
900
  {
867
- [S[`${P}__thumb--dragging`]]: g
901
+ [P[`${k}__thumb--dragging`]]: b
868
902
  }
869
903
  ])
870
904
  }
@@ -872,11 +906,11 @@ const q = /* @__PURE__ */ lr(pr), S = {
872
906
  ] })
873
907
  }
874
908
  ),
875
- t && c === "right" && m()
909
+ t && i === "right" && m()
876
910
  ] });
877
- }, hr = w(gr);
878
- hr.displayName = "Toggle";
911
+ }, gr = S(hr);
912
+ gr.displayName = "Toggle";
879
913
  export {
880
- hr as Toggle
914
+ gr as Toggle
881
915
  };
882
916
  //# sourceMappingURL=toggle.es.js.map