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