@purpurds/toggle 3.7.1 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +3 -3
- package/dist/toggle.cjs.js +5 -5
- package/dist/toggle.cjs.js.map +1 -1
- package/dist/toggle.es.js +318 -318
- package/dist/toggle.es.js.map +1 -1
- package/package.json +6 -7
- package/dist/toggle.system.js +0 -18
- package/dist/toggle.system.js.map +0 -1
package/dist/toggle.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
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 z, useEffect as A, Fragment as ee, useCallback as X, createContext as Z, useMemo as E, useContext as fe, useRef as D, useState as $, useLayoutEffect as re } from "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
function ge(e) {
|
|
5
5
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
6
6
|
}
|
|
7
|
-
var
|
|
7
|
+
var te = { exports: {} };
|
|
8
8
|
/*!
|
|
9
9
|
Copyright (c) 2018 Jed Watson.
|
|
10
10
|
Licensed under the MIT License (MIT), see
|
|
@@ -13,34 +13,34 @@ var re = { exports: {} };
|
|
|
13
13
|
(function(e) {
|
|
14
14
|
(function() {
|
|
15
15
|
var n = {}.hasOwnProperty;
|
|
16
|
-
function
|
|
17
|
-
for (var
|
|
16
|
+
function t() {
|
|
17
|
+
for (var r = "", a = 0; a < arguments.length; a++) {
|
|
18
18
|
var u = arguments[a];
|
|
19
|
-
u && (
|
|
19
|
+
u && (r = c(r, o.call(this, u)));
|
|
20
20
|
}
|
|
21
|
-
return
|
|
21
|
+
return r;
|
|
22
22
|
}
|
|
23
|
-
function o(
|
|
24
|
-
if (typeof
|
|
25
|
-
return this && this[
|
|
26
|
-
if (typeof
|
|
23
|
+
function o(r) {
|
|
24
|
+
if (typeof r == "string" || typeof r == "number")
|
|
25
|
+
return this && this[r] || r;
|
|
26
|
+
if (typeof r != "object")
|
|
27
27
|
return "";
|
|
28
|
-
if (Array.isArray(
|
|
29
|
-
return
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
28
|
+
if (Array.isArray(r))
|
|
29
|
+
return t.apply(this, r);
|
|
30
|
+
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
31
|
+
return r.toString();
|
|
32
32
|
var a = "";
|
|
33
|
-
for (var u in
|
|
34
|
-
n.call(
|
|
33
|
+
for (var u in r)
|
|
34
|
+
n.call(r, u) && r[u] && (a = c(a, this && this[u] || u));
|
|
35
35
|
return a;
|
|
36
36
|
}
|
|
37
|
-
function c(
|
|
38
|
-
return a ?
|
|
37
|
+
function c(r, a) {
|
|
38
|
+
return a ? r ? r + " " + a : r + a : r;
|
|
39
39
|
}
|
|
40
|
-
e.exports ? (
|
|
40
|
+
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
41
41
|
})();
|
|
42
|
-
})(
|
|
43
|
-
var he =
|
|
42
|
+
})(te);
|
|
43
|
+
var he = te.exports;
|
|
44
44
|
const be = /* @__PURE__ */ ge(he), _e = {
|
|
45
45
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
46
46
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
@@ -54,112 +54,112 @@ 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(" "),
|
|
58
|
-
const
|
|
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 } = {}) => {
|
|
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
|
], o = n ? `<title>${n}</title>` : "";
|
|
64
|
-
return `<svg ${ye(
|
|
65
|
-
},
|
|
64
|
+
return `<svg ${ye(t)}>${o}${e}</svg>`;
|
|
65
|
+
}, we = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Se = ({
|
|
66
66
|
["data-testid"]: e,
|
|
67
67
|
svg: n,
|
|
68
|
-
allyTitle:
|
|
68
|
+
allyTitle: t,
|
|
69
69
|
className: o = "",
|
|
70
70
|
size: c = $e,
|
|
71
|
-
...
|
|
71
|
+
...r
|
|
72
72
|
}) => {
|
|
73
|
-
const a =
|
|
74
|
-
content:
|
|
75
|
-
title:
|
|
73
|
+
const a = xe({
|
|
74
|
+
content: we(n.svg),
|
|
75
|
+
title: t
|
|
76
76
|
}), u = me(o, J, `${J}--${c}`);
|
|
77
|
-
return /* @__PURE__ */
|
|
77
|
+
return /* @__PURE__ */ x(
|
|
78
78
|
"span",
|
|
79
79
|
{
|
|
80
|
-
"aria-label":
|
|
80
|
+
"aria-label": t,
|
|
81
81
|
className: u,
|
|
82
82
|
"data-testid": e,
|
|
83
83
|
dangerouslySetInnerHTML: { __html: a },
|
|
84
|
-
...
|
|
84
|
+
...r
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
87
|
};
|
|
88
88
|
function q() {
|
|
89
89
|
return q = Object.assign ? Object.assign.bind() : function(e) {
|
|
90
90
|
for (var n = 1; n < arguments.length; n++) {
|
|
91
|
-
var
|
|
92
|
-
for (var o in
|
|
93
|
-
Object.prototype.hasOwnProperty.call(
|
|
91
|
+
var t = arguments[n];
|
|
92
|
+
for (var o in t)
|
|
93
|
+
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
94
94
|
}
|
|
95
95
|
return e;
|
|
96
96
|
}, q.apply(this, arguments);
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
return
|
|
98
|
+
function j() {
|
|
99
|
+
return j = Object.assign ? Object.assign.bind() : function(e) {
|
|
100
100
|
for (var n = 1; n < arguments.length; n++) {
|
|
101
|
-
var
|
|
102
|
-
for (var o in
|
|
103
|
-
Object.prototype.hasOwnProperty.call(
|
|
101
|
+
var t = arguments[n];
|
|
102
|
+
for (var o in t)
|
|
103
|
+
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
104
104
|
}
|
|
105
105
|
return e;
|
|
106
|
-
},
|
|
106
|
+
}, j.apply(this, arguments);
|
|
107
107
|
}
|
|
108
108
|
function Pe(e, n) {
|
|
109
109
|
typeof e == "function" ? e(n) : e != null && (e.current = n);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function ke(...e) {
|
|
112
112
|
return (n) => e.forEach(
|
|
113
|
-
(
|
|
113
|
+
(t) => Pe(t, n)
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
|
-
const ne = /* @__PURE__ */
|
|
117
|
-
const { children:
|
|
118
|
-
if (
|
|
119
|
-
const a =
|
|
120
|
-
return /* @__PURE__ */ _(F,
|
|
116
|
+
const ne = /* @__PURE__ */ w((e, n) => {
|
|
117
|
+
const { children: t, ...o } = e, c = y.toArray(t), r = c.find(Ae);
|
|
118
|
+
if (r) {
|
|
119
|
+
const a = r.props.children, u = c.map((i) => i === r ? y.count(a) > 1 ? y.only(null) : /* @__PURE__ */ k(a) ? a.props.children : null : i);
|
|
120
|
+
return /* @__PURE__ */ _(F, j({}, o, {
|
|
121
121
|
ref: n
|
|
122
|
-
}), /* @__PURE__ */
|
|
122
|
+
}), /* @__PURE__ */ k(a) ? /* @__PURE__ */ z(a, void 0, u) : null);
|
|
123
123
|
}
|
|
124
|
-
return /* @__PURE__ */ _(F,
|
|
124
|
+
return /* @__PURE__ */ _(F, j({}, o, {
|
|
125
125
|
ref: n
|
|
126
|
-
}),
|
|
126
|
+
}), t);
|
|
127
127
|
});
|
|
128
128
|
ne.displayName = "Slot";
|
|
129
|
-
const F = /* @__PURE__ */
|
|
130
|
-
const { children:
|
|
131
|
-
return /* @__PURE__ */
|
|
132
|
-
...
|
|
133
|
-
ref: n ?
|
|
134
|
-
}) : y.count(
|
|
129
|
+
const F = /* @__PURE__ */ w((e, n) => {
|
|
130
|
+
const { children: t, ...o } = e;
|
|
131
|
+
return /* @__PURE__ */ k(t) ? /* @__PURE__ */ z(t, {
|
|
132
|
+
...De(o, t.props),
|
|
133
|
+
ref: n ? ke(n, t.ref) : t.ref
|
|
134
|
+
}) : y.count(t) > 1 ? y.only(null) : null;
|
|
135
135
|
});
|
|
136
136
|
F.displayName = "SlotClone";
|
|
137
|
-
const
|
|
138
|
-
function
|
|
139
|
-
return /* @__PURE__ */
|
|
137
|
+
const Oe = ({ children: e }) => /* @__PURE__ */ _(ee, null, e);
|
|
138
|
+
function Ae(e) {
|
|
139
|
+
return /* @__PURE__ */ k(e) && e.type === Oe;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
const
|
|
141
|
+
function De(e, n) {
|
|
142
|
+
const t = {
|
|
143
143
|
...n
|
|
144
144
|
};
|
|
145
145
|
for (const o in n) {
|
|
146
|
-
const c = e[o],
|
|
147
|
-
/^on[A-Z]/.test(o) ? c &&
|
|
148
|
-
|
|
149
|
-
} : c && (
|
|
146
|
+
const c = e[o], r = n[o];
|
|
147
|
+
/^on[A-Z]/.test(o) ? c && r ? t[o] = (...a) => {
|
|
148
|
+
r(...a), c(...a);
|
|
149
|
+
} : c && (t[o] = c) : o === "style" ? t[o] = {
|
|
150
150
|
...c,
|
|
151
|
-
...
|
|
152
|
-
} : o === "className" && (
|
|
151
|
+
...r
|
|
152
|
+
} : o === "className" && (t[o] = [
|
|
153
153
|
c,
|
|
154
|
-
|
|
154
|
+
r
|
|
155
155
|
].filter(Boolean).join(" "));
|
|
156
156
|
}
|
|
157
157
|
return {
|
|
158
158
|
...e,
|
|
159
|
-
...
|
|
159
|
+
...t
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
const
|
|
162
|
+
const Ce = [
|
|
163
163
|
"a",
|
|
164
164
|
"button",
|
|
165
165
|
"div",
|
|
@@ -176,26 +176,26 @@ const De = [
|
|
|
176
176
|
"span",
|
|
177
177
|
"svg",
|
|
178
178
|
"ul"
|
|
179
|
-
],
|
|
180
|
-
const
|
|
181
|
-
const { asChild:
|
|
182
|
-
return
|
|
179
|
+
], Ne = Ce.reduce((e, n) => {
|
|
180
|
+
const t = /* @__PURE__ */ w((o, c) => {
|
|
181
|
+
const { asChild: r, ...a } = o, u = r ? ne : n;
|
|
182
|
+
return A(() => {
|
|
183
183
|
window[Symbol.for("radix-ui")] = !0;
|
|
184
|
-
}, []), /* @__PURE__ */ _(u,
|
|
184
|
+
}, []), /* @__PURE__ */ _(u, j({}, a, {
|
|
185
185
|
ref: c
|
|
186
186
|
}));
|
|
187
187
|
});
|
|
188
|
-
return
|
|
188
|
+
return t.displayName = `Primitive.${n}`, {
|
|
189
189
|
...e,
|
|
190
|
-
[n]:
|
|
190
|
+
[n]: t
|
|
191
191
|
};
|
|
192
|
-
}, {}),
|
|
192
|
+
}, {}), Ee = /* @__PURE__ */ w((e, n) => /* @__PURE__ */ _(Ne.label, q({}, e, {
|
|
193
193
|
ref: n,
|
|
194
|
-
onMouseDown: (
|
|
194
|
+
onMouseDown: (t) => {
|
|
195
195
|
var o;
|
|
196
|
-
(o = e.onMouseDown) === null || o === void 0 || o.call(e,
|
|
196
|
+
(o = e.onMouseDown) === null || o === void 0 || o.call(e, t), !t.defaultPrevented && t.detail > 1 && t.preventDefault();
|
|
197
197
|
}
|
|
198
|
-
}))),
|
|
198
|
+
}))), je = Ee;
|
|
199
199
|
function Re(e) {
|
|
200
200
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
201
201
|
}
|
|
@@ -208,53 +208,53 @@ var oe = { exports: {} };
|
|
|
208
208
|
(function(e) {
|
|
209
209
|
(function() {
|
|
210
210
|
var n = {}.hasOwnProperty;
|
|
211
|
-
function
|
|
212
|
-
for (var
|
|
211
|
+
function t() {
|
|
212
|
+
for (var r = "", a = 0; a < arguments.length; a++) {
|
|
213
213
|
var u = arguments[a];
|
|
214
|
-
u && (
|
|
214
|
+
u && (r = c(r, o(u)));
|
|
215
215
|
}
|
|
216
|
-
return
|
|
216
|
+
return r;
|
|
217
217
|
}
|
|
218
|
-
function o(
|
|
219
|
-
if (typeof
|
|
220
|
-
return
|
|
221
|
-
if (typeof
|
|
218
|
+
function o(r) {
|
|
219
|
+
if (typeof r == "string" || typeof r == "number")
|
|
220
|
+
return r;
|
|
221
|
+
if (typeof r != "object")
|
|
222
222
|
return "";
|
|
223
|
-
if (Array.isArray(
|
|
224
|
-
return
|
|
225
|
-
if (
|
|
226
|
-
return
|
|
223
|
+
if (Array.isArray(r))
|
|
224
|
+
return t.apply(null, r);
|
|
225
|
+
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
226
|
+
return r.toString();
|
|
227
227
|
var a = "";
|
|
228
|
-
for (var u in
|
|
229
|
-
n.call(
|
|
228
|
+
for (var u in r)
|
|
229
|
+
n.call(r, u) && r[u] && (a = c(a, u));
|
|
230
230
|
return a;
|
|
231
231
|
}
|
|
232
|
-
function c(
|
|
233
|
-
return a ?
|
|
232
|
+
function c(r, a) {
|
|
233
|
+
return a ? r ? r + " " + a : r + a : r;
|
|
234
234
|
}
|
|
235
|
-
e.exports ? (
|
|
235
|
+
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
236
236
|
})();
|
|
237
237
|
})(oe);
|
|
238
238
|
var Me = oe.exports;
|
|
239
|
-
const
|
|
239
|
+
const ze = /* @__PURE__ */ Re(Me), K = {
|
|
240
240
|
"purpur-label": "_purpur-label_1jub8_1",
|
|
241
241
|
"purpur-label--disabled": "_purpur-label--disabled_1jub8_9"
|
|
242
|
-
}, Q = "purpur-label",
|
|
242
|
+
}, Q = "purpur-label", He = ({
|
|
243
243
|
children: e,
|
|
244
244
|
className: n,
|
|
245
|
-
htmlFor:
|
|
245
|
+
htmlFor: t,
|
|
246
246
|
"data-testid": o,
|
|
247
247
|
disabled: c,
|
|
248
|
-
...
|
|
248
|
+
...r
|
|
249
249
|
}) => {
|
|
250
|
-
const a =
|
|
250
|
+
const a = ze([
|
|
251
251
|
n,
|
|
252
252
|
K[Q],
|
|
253
253
|
{ [K[`${Q}--disabled`]]: c }
|
|
254
254
|
]);
|
|
255
|
-
return /* @__PURE__ */
|
|
255
|
+
return /* @__PURE__ */ x(je, { className: a, "data-testid": o, htmlFor: t, ...r, children: e });
|
|
256
256
|
};
|
|
257
|
-
function
|
|
257
|
+
function Le(e) {
|
|
258
258
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
259
259
|
}
|
|
260
260
|
var ae = { exports: {} };
|
|
@@ -266,49 +266,49 @@ var ae = { exports: {} };
|
|
|
266
266
|
(function(e) {
|
|
267
267
|
(function() {
|
|
268
268
|
var n = {}.hasOwnProperty;
|
|
269
|
-
function
|
|
270
|
-
for (var
|
|
269
|
+
function t() {
|
|
270
|
+
for (var r = "", a = 0; a < arguments.length; a++) {
|
|
271
271
|
var u = arguments[a];
|
|
272
|
-
u && (
|
|
272
|
+
u && (r = c(r, o(u)));
|
|
273
273
|
}
|
|
274
|
-
return
|
|
274
|
+
return r;
|
|
275
275
|
}
|
|
276
|
-
function o(
|
|
277
|
-
if (typeof
|
|
278
|
-
return
|
|
279
|
-
if (typeof
|
|
276
|
+
function o(r) {
|
|
277
|
+
if (typeof r == "string" || typeof r == "number")
|
|
278
|
+
return r;
|
|
279
|
+
if (typeof r != "object")
|
|
280
280
|
return "";
|
|
281
|
-
if (Array.isArray(
|
|
282
|
-
return
|
|
283
|
-
if (
|
|
284
|
-
return
|
|
281
|
+
if (Array.isArray(r))
|
|
282
|
+
return t.apply(null, r);
|
|
283
|
+
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
284
|
+
return r.toString();
|
|
285
285
|
var a = "";
|
|
286
|
-
for (var u in
|
|
287
|
-
n.call(
|
|
286
|
+
for (var u in r)
|
|
287
|
+
n.call(r, u) && r[u] && (a = c(a, u));
|
|
288
288
|
return a;
|
|
289
289
|
}
|
|
290
|
-
function c(
|
|
291
|
-
return a ?
|
|
290
|
+
function c(r, a) {
|
|
291
|
+
return a ? r ? r + " " + a : r + a : r;
|
|
292
292
|
}
|
|
293
|
-
e.exports ? (
|
|
293
|
+
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
294
294
|
})();
|
|
295
295
|
})(ae);
|
|
296
|
-
var
|
|
297
|
-
const
|
|
298
|
-
"purpur-paragraph": "_purpur-
|
|
299
|
-
"purpur-paragraph--disabled": "_purpur-paragraph--
|
|
300
|
-
"purpur-paragraph--hyphens": "_purpur-paragraph--
|
|
301
|
-
"purpur-paragraph--paragraph-100": "_purpur-paragraph--paragraph-
|
|
302
|
-
"purpur-paragraph--paragraph-100-medium": "_purpur-paragraph--paragraph-100-
|
|
303
|
-
"purpur-paragraph--paragraph-100-bold": "_purpur-paragraph--paragraph-100-
|
|
304
|
-
"purpur-paragraph--paragraph-200": "_purpur-paragraph--paragraph-
|
|
305
|
-
"purpur-paragraph--preamble-100": "_purpur-paragraph--preamble-
|
|
306
|
-
"purpur-paragraph--preamble-200": "_purpur-paragraph--preamble-
|
|
307
|
-
"purpur-paragraph--additional-100": "_purpur-paragraph--additional-
|
|
308
|
-
"purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-
|
|
309
|
-
"purpur-paragraph--overline-100": "_purpur-paragraph--overline-
|
|
310
|
-
"purpur-paragraph--overline-200": "_purpur-paragraph--overline-
|
|
311
|
-
},
|
|
296
|
+
var Xe = ae.exports;
|
|
297
|
+
const Be = /* @__PURE__ */ Le(Xe), H = {
|
|
298
|
+
"purpur-paragraph": "_purpur-paragraph_1fzxr_1",
|
|
299
|
+
"purpur-paragraph--disabled": "_purpur-paragraph--disabled_1fzxr_7",
|
|
300
|
+
"purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1fzxr_10",
|
|
301
|
+
"purpur-paragraph--paragraph-100": "_purpur-paragraph--paragraph-100_1fzxr_13",
|
|
302
|
+
"purpur-paragraph--paragraph-100-medium": "_purpur-paragraph--paragraph-100-medium_1fzxr_19",
|
|
303
|
+
"purpur-paragraph--paragraph-100-bold": "_purpur-paragraph--paragraph-100-bold_1fzxr_26",
|
|
304
|
+
"purpur-paragraph--paragraph-200": "_purpur-paragraph--paragraph-200_1fzxr_33",
|
|
305
|
+
"purpur-paragraph--preamble-100": "_purpur-paragraph--preamble-100_1fzxr_39",
|
|
306
|
+
"purpur-paragraph--preamble-200": "_purpur-paragraph--preamble-200_1fzxr_45",
|
|
307
|
+
"purpur-paragraph--additional-100": "_purpur-paragraph--additional-100_1fzxr_51",
|
|
308
|
+
"purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1fzxr_57",
|
|
309
|
+
"purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1fzxr_64",
|
|
310
|
+
"purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1fzxr_71"
|
|
311
|
+
}, Te = {
|
|
312
312
|
PARAGRAPH100: "paragraph-100",
|
|
313
313
|
PARAGRAPH100MEDIUM: "paragraph-100-medium",
|
|
314
314
|
PARAGRAPH100BOLD: "paragraph-100-bold",
|
|
@@ -319,39 +319,39 @@ const Te = /* @__PURE__ */ Xe(Be), L = {
|
|
|
319
319
|
ADDITIONAL100MEDIUM: "additional-100-medium",
|
|
320
320
|
OVERLINE100: "overline-100",
|
|
321
321
|
OVERLINE200: "overline-200"
|
|
322
|
-
},
|
|
322
|
+
}, L = "purpur-paragraph", Ie = ({
|
|
323
323
|
["data-testid"]: e,
|
|
324
324
|
children: n,
|
|
325
|
-
className:
|
|
325
|
+
className: t = "",
|
|
326
326
|
disabled: o,
|
|
327
327
|
enableHyphenation: c = !1,
|
|
328
|
-
variant:
|
|
328
|
+
variant: r = Te.PARAGRAPH100,
|
|
329
329
|
...a
|
|
330
330
|
}) => {
|
|
331
|
-
const u =
|
|
332
|
-
|
|
333
|
-
L
|
|
334
|
-
|
|
331
|
+
const u = Be([
|
|
332
|
+
t,
|
|
333
|
+
H[L],
|
|
334
|
+
H[`${L}--${r}`],
|
|
335
335
|
{
|
|
336
|
-
[
|
|
337
|
-
[
|
|
336
|
+
[H[`${L}--hyphens`]]: c,
|
|
337
|
+
[H[`${L}--disabled`]]: o
|
|
338
338
|
}
|
|
339
339
|
]);
|
|
340
|
-
return /* @__PURE__ */
|
|
340
|
+
return /* @__PURE__ */ x("p", { ...a, className: u, "data-testid": e, children: n });
|
|
341
341
|
};
|
|
342
342
|
function R() {
|
|
343
343
|
return R = Object.assign ? Object.assign.bind() : function(e) {
|
|
344
344
|
for (var n = 1; n < arguments.length; n++) {
|
|
345
|
-
var
|
|
346
|
-
for (var o in
|
|
347
|
-
Object.prototype.hasOwnProperty.call(
|
|
345
|
+
var t = arguments[n];
|
|
346
|
+
for (var o in t)
|
|
347
|
+
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
348
348
|
}
|
|
349
349
|
return e;
|
|
350
350
|
}, R.apply(this, arguments);
|
|
351
351
|
}
|
|
352
|
-
function qe(e, n, { checkForDefaultPrevented:
|
|
352
|
+
function qe(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
|
|
353
353
|
return function(c) {
|
|
354
|
-
if (e == null || e(c),
|
|
354
|
+
if (e == null || e(c), t === !1 || !c.defaultPrevented)
|
|
355
355
|
return n == null ? void 0 : n(c);
|
|
356
356
|
};
|
|
357
357
|
}
|
|
@@ -360,22 +360,22 @@ function Fe(e, n) {
|
|
|
360
360
|
}
|
|
361
361
|
function ce(...e) {
|
|
362
362
|
return (n) => e.forEach(
|
|
363
|
-
(
|
|
363
|
+
(t) => Fe(t, n)
|
|
364
364
|
);
|
|
365
365
|
}
|
|
366
366
|
function Ve(...e) {
|
|
367
|
-
return
|
|
367
|
+
return X(ce(...e), e);
|
|
368
368
|
}
|
|
369
369
|
function Ue(e, n = []) {
|
|
370
|
-
let
|
|
371
|
-
function o(
|
|
372
|
-
const u = /* @__PURE__ */ Z(a), i =
|
|
373
|
-
|
|
374
|
-
...
|
|
370
|
+
let t = [];
|
|
371
|
+
function o(r, a) {
|
|
372
|
+
const u = /* @__PURE__ */ Z(a), i = t.length;
|
|
373
|
+
t = [
|
|
374
|
+
...t,
|
|
375
375
|
a
|
|
376
376
|
];
|
|
377
377
|
function s(l) {
|
|
378
|
-
const { scope: p, children: v, ...f } = l, g = (p == null ? void 0 : p[e][i]) || u, d =
|
|
378
|
+
const { scope: p, children: v, ...f } = l, g = (p == null ? void 0 : p[e][i]) || u, d = E(
|
|
379
379
|
() => f,
|
|
380
380
|
Object.values(f)
|
|
381
381
|
);
|
|
@@ -389,18 +389,18 @@ function Ue(e, n = []) {
|
|
|
389
389
|
return f;
|
|
390
390
|
if (a !== void 0)
|
|
391
391
|
return a;
|
|
392
|
-
throw new Error(`\`${l}\` must be used within \`${
|
|
392
|
+
throw new Error(`\`${l}\` must be used within \`${r}\``);
|
|
393
393
|
}
|
|
394
|
-
return s.displayName =
|
|
394
|
+
return s.displayName = r + "Provider", [
|
|
395
395
|
s,
|
|
396
396
|
h
|
|
397
397
|
];
|
|
398
398
|
}
|
|
399
399
|
const c = () => {
|
|
400
|
-
const
|
|
400
|
+
const r = t.map((a) => /* @__PURE__ */ Z(a));
|
|
401
401
|
return function(u) {
|
|
402
|
-
const i = (u == null ? void 0 : u[e]) ||
|
|
403
|
-
return
|
|
402
|
+
const i = (u == null ? void 0 : u[e]) || r;
|
|
403
|
+
return E(
|
|
404
404
|
() => ({
|
|
405
405
|
[`__scope${e}`]: {
|
|
406
406
|
...u,
|
|
@@ -423,22 +423,22 @@ function We(...e) {
|
|
|
423
423
|
const n = e[0];
|
|
424
424
|
if (e.length === 1)
|
|
425
425
|
return n;
|
|
426
|
-
const
|
|
426
|
+
const t = () => {
|
|
427
427
|
const o = e.map(
|
|
428
428
|
(c) => ({
|
|
429
429
|
useScope: c(),
|
|
430
430
|
scopeName: c.scopeName
|
|
431
431
|
})
|
|
432
432
|
);
|
|
433
|
-
return function(
|
|
433
|
+
return function(r) {
|
|
434
434
|
const a = o.reduce((u, { useScope: i, scopeName: s }) => {
|
|
435
|
-
const l = i(
|
|
435
|
+
const l = i(r)[`__scope${s}`];
|
|
436
436
|
return {
|
|
437
437
|
...u,
|
|
438
438
|
...l
|
|
439
439
|
};
|
|
440
440
|
}, {});
|
|
441
|
-
return
|
|
441
|
+
return E(
|
|
442
442
|
() => ({
|
|
443
443
|
[`__scope${n.scopeName}`]: a
|
|
444
444
|
}),
|
|
@@ -448,33 +448,33 @@ function We(...e) {
|
|
|
448
448
|
);
|
|
449
449
|
};
|
|
450
450
|
};
|
|
451
|
-
return
|
|
451
|
+
return t.scopeName = n.scopeName, t;
|
|
452
452
|
}
|
|
453
453
|
function ue(e) {
|
|
454
|
-
const n =
|
|
455
|
-
return
|
|
454
|
+
const n = D(e);
|
|
455
|
+
return A(() => {
|
|
456
456
|
n.current = e;
|
|
457
|
-
}),
|
|
458
|
-
() => (...
|
|
457
|
+
}), E(
|
|
458
|
+
() => (...t) => {
|
|
459
459
|
var o;
|
|
460
|
-
return (o = n.current) === null || o === void 0 ? void 0 : o.call(n, ...
|
|
460
|
+
return (o = n.current) === null || o === void 0 ? void 0 : o.call(n, ...t);
|
|
461
461
|
},
|
|
462
462
|
[]
|
|
463
463
|
);
|
|
464
464
|
}
|
|
465
|
-
function Ge({ prop: e, defaultProp: n, onChange:
|
|
465
|
+
function Ge({ prop: e, defaultProp: n, onChange: t = () => {
|
|
466
466
|
} }) {
|
|
467
467
|
const [o, c] = Ze({
|
|
468
468
|
defaultProp: n,
|
|
469
|
-
onChange:
|
|
470
|
-
}),
|
|
471
|
-
if (
|
|
469
|
+
onChange: t
|
|
470
|
+
}), r = e !== void 0, a = r ? e : o, u = ue(t), i = X((s) => {
|
|
471
|
+
if (r) {
|
|
472
472
|
const l = typeof s == "function" ? s(e) : s;
|
|
473
473
|
l !== e && u(l);
|
|
474
474
|
} else
|
|
475
475
|
c(s);
|
|
476
476
|
}, [
|
|
477
|
-
|
|
477
|
+
r,
|
|
478
478
|
e,
|
|
479
479
|
c,
|
|
480
480
|
u
|
|
@@ -485,45 +485,45 @@ function Ge({ prop: e, defaultProp: n, onChange: r = () => {
|
|
|
485
485
|
];
|
|
486
486
|
}
|
|
487
487
|
function Ze({ defaultProp: e, onChange: n }) {
|
|
488
|
-
const
|
|
489
|
-
return
|
|
490
|
-
c.current !== o && (
|
|
488
|
+
const t = $(e), [o] = t, c = D(o), r = ue(n);
|
|
489
|
+
return A(() => {
|
|
490
|
+
c.current !== o && (r(o), c.current = o);
|
|
491
491
|
}, [
|
|
492
492
|
o,
|
|
493
493
|
c,
|
|
494
|
-
|
|
495
|
-
]),
|
|
494
|
+
r
|
|
495
|
+
]), t;
|
|
496
496
|
}
|
|
497
497
|
function Je(e) {
|
|
498
|
-
const n =
|
|
498
|
+
const n = D({
|
|
499
499
|
value: e,
|
|
500
500
|
previous: e
|
|
501
501
|
});
|
|
502
|
-
return
|
|
502
|
+
return E(() => (n.current.value !== e && (n.current.previous = n.current.value, n.current.value = e), n.current.previous), [
|
|
503
503
|
e
|
|
504
504
|
]);
|
|
505
505
|
}
|
|
506
|
-
const Ke = globalThis != null && globalThis.document ?
|
|
506
|
+
const Ke = globalThis != null && globalThis.document ? re : () => {
|
|
507
507
|
};
|
|
508
508
|
function Qe(e) {
|
|
509
|
-
const [n,
|
|
509
|
+
const [n, t] = $(void 0);
|
|
510
510
|
return Ke(() => {
|
|
511
511
|
if (e) {
|
|
512
|
-
|
|
512
|
+
t({
|
|
513
513
|
width: e.offsetWidth,
|
|
514
514
|
height: e.offsetHeight
|
|
515
515
|
});
|
|
516
516
|
const o = new ResizeObserver((c) => {
|
|
517
517
|
if (!Array.isArray(c) || !c.length)
|
|
518
518
|
return;
|
|
519
|
-
const
|
|
519
|
+
const r = c[0];
|
|
520
520
|
let a, u;
|
|
521
|
-
if ("borderBoxSize" in
|
|
522
|
-
const i =
|
|
521
|
+
if ("borderBoxSize" in r) {
|
|
522
|
+
const i = r.borderBoxSize, s = Array.isArray(i) ? i[0] : i;
|
|
523
523
|
a = s.inlineSize, u = s.blockSize;
|
|
524
524
|
} else
|
|
525
525
|
a = e.offsetWidth, u = e.offsetHeight;
|
|
526
|
-
|
|
526
|
+
t({
|
|
527
527
|
width: a,
|
|
528
528
|
height: u
|
|
529
529
|
});
|
|
@@ -532,7 +532,7 @@ function Qe(e) {
|
|
|
532
532
|
box: "border-box"
|
|
533
533
|
}), () => o.unobserve(e);
|
|
534
534
|
} else
|
|
535
|
-
|
|
535
|
+
t(void 0);
|
|
536
536
|
}, [
|
|
537
537
|
e
|
|
538
538
|
]), n;
|
|
@@ -540,60 +540,60 @@ function Qe(e) {
|
|
|
540
540
|
function M() {
|
|
541
541
|
return M = Object.assign ? Object.assign.bind() : function(e) {
|
|
542
542
|
for (var n = 1; n < arguments.length; n++) {
|
|
543
|
-
var
|
|
544
|
-
for (var o in
|
|
545
|
-
Object.prototype.hasOwnProperty.call(
|
|
543
|
+
var t = arguments[n];
|
|
544
|
+
for (var o in t)
|
|
545
|
+
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
546
546
|
}
|
|
547
547
|
return e;
|
|
548
548
|
}, M.apply(this, arguments);
|
|
549
549
|
}
|
|
550
|
-
const ie = /* @__PURE__ */
|
|
551
|
-
const { children:
|
|
552
|
-
if (
|
|
553
|
-
const a =
|
|
550
|
+
const ie = /* @__PURE__ */ w((e, n) => {
|
|
551
|
+
const { children: t, ...o } = e, c = y.toArray(t), r = c.find(er);
|
|
552
|
+
if (r) {
|
|
553
|
+
const a = r.props.children, u = c.map((i) => i === r ? y.count(a) > 1 ? y.only(null) : /* @__PURE__ */ k(a) ? a.props.children : null : i);
|
|
554
554
|
return /* @__PURE__ */ _(V, M({}, o, {
|
|
555
555
|
ref: n
|
|
556
|
-
}), /* @__PURE__ */
|
|
556
|
+
}), /* @__PURE__ */ k(a) ? /* @__PURE__ */ z(a, void 0, u) : null);
|
|
557
557
|
}
|
|
558
558
|
return /* @__PURE__ */ _(V, M({}, o, {
|
|
559
559
|
ref: n
|
|
560
|
-
}),
|
|
560
|
+
}), t);
|
|
561
561
|
});
|
|
562
562
|
ie.displayName = "Slot";
|
|
563
|
-
const V = /* @__PURE__ */
|
|
564
|
-
const { children:
|
|
565
|
-
return /* @__PURE__ */
|
|
566
|
-
...
|
|
567
|
-
ref: n ? ce(n,
|
|
568
|
-
}) : y.count(
|
|
563
|
+
const V = /* @__PURE__ */ w((e, n) => {
|
|
564
|
+
const { children: t, ...o } = e;
|
|
565
|
+
return /* @__PURE__ */ k(t) ? /* @__PURE__ */ z(t, {
|
|
566
|
+
...rr(o, t.props),
|
|
567
|
+
ref: n ? ce(n, t.ref) : t.ref
|
|
568
|
+
}) : y.count(t) > 1 ? y.only(null) : null;
|
|
569
569
|
});
|
|
570
570
|
V.displayName = "SlotClone";
|
|
571
571
|
const Ye = ({ children: e }) => /* @__PURE__ */ _(ee, null, e);
|
|
572
|
-
function
|
|
573
|
-
return /* @__PURE__ */
|
|
572
|
+
function er(e) {
|
|
573
|
+
return /* @__PURE__ */ k(e) && e.type === Ye;
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
const
|
|
575
|
+
function rr(e, n) {
|
|
576
|
+
const t = {
|
|
577
577
|
...n
|
|
578
578
|
};
|
|
579
579
|
for (const o in n) {
|
|
580
|
-
const c = e[o],
|
|
581
|
-
/^on[A-Z]/.test(o) ? c &&
|
|
582
|
-
|
|
583
|
-
} : c && (
|
|
580
|
+
const c = e[o], r = n[o];
|
|
581
|
+
/^on[A-Z]/.test(o) ? c && r ? t[o] = (...u) => {
|
|
582
|
+
r(...u), c(...u);
|
|
583
|
+
} : c && (t[o] = c) : o === "style" ? t[o] = {
|
|
584
584
|
...c,
|
|
585
|
-
...
|
|
586
|
-
} : o === "className" && (
|
|
585
|
+
...r
|
|
586
|
+
} : o === "className" && (t[o] = [
|
|
587
587
|
c,
|
|
588
|
-
|
|
588
|
+
r
|
|
589
589
|
].filter(Boolean).join(" "));
|
|
590
590
|
}
|
|
591
591
|
return {
|
|
592
592
|
...e,
|
|
593
|
-
...
|
|
593
|
+
...t
|
|
594
594
|
};
|
|
595
595
|
}
|
|
596
|
-
const
|
|
596
|
+
const tr = [
|
|
597
597
|
"a",
|
|
598
598
|
"button",
|
|
599
599
|
"div",
|
|
@@ -610,30 +610,30 @@ const rt = [
|
|
|
610
610
|
"span",
|
|
611
611
|
"svg",
|
|
612
612
|
"ul"
|
|
613
|
-
], se =
|
|
614
|
-
const
|
|
615
|
-
const { asChild:
|
|
616
|
-
return
|
|
613
|
+
], se = tr.reduce((e, n) => {
|
|
614
|
+
const t = /* @__PURE__ */ w((o, c) => {
|
|
615
|
+
const { asChild: r, ...a } = o, u = r ? ie : n;
|
|
616
|
+
return A(() => {
|
|
617
617
|
window[Symbol.for("radix-ui")] = !0;
|
|
618
618
|
}, []), /* @__PURE__ */ _(u, M({}, a, {
|
|
619
619
|
ref: c
|
|
620
620
|
}));
|
|
621
621
|
});
|
|
622
|
-
return
|
|
622
|
+
return t.displayName = `Primitive.${n}`, {
|
|
623
623
|
...e,
|
|
624
|
-
[n]:
|
|
624
|
+
[n]: t
|
|
625
625
|
};
|
|
626
|
-
}, {}), le = "Switch", [
|
|
627
|
-
const { __scopeSwitch:
|
|
626
|
+
}, {}), le = "Switch", [nr, yr] = Ue(le), [or, ar] = nr(le), cr = /* @__PURE__ */ w((e, n) => {
|
|
627
|
+
const { __scopeSwitch: t, name: o, checked: c, defaultChecked: r, required: a, disabled: u, value: i = "on", onCheckedChange: s, ...h } = e, [l, p] = $(null), v = Ve(
|
|
628
628
|
n,
|
|
629
629
|
(m) => p(m)
|
|
630
|
-
), f =
|
|
630
|
+
), f = D(!1), g = l ? !!l.closest("form") : !0, [d = !1, b] = Ge({
|
|
631
631
|
prop: c,
|
|
632
|
-
defaultProp:
|
|
632
|
+
defaultProp: r,
|
|
633
633
|
onChange: s
|
|
634
634
|
});
|
|
635
|
-
return /* @__PURE__ */ _(
|
|
636
|
-
scope:
|
|
635
|
+
return /* @__PURE__ */ _(or, {
|
|
636
|
+
scope: t,
|
|
637
637
|
checked: d,
|
|
638
638
|
disabled: u
|
|
639
639
|
}, /* @__PURE__ */ _(se.button, R({
|
|
@@ -649,10 +649,10 @@ const rt = [
|
|
|
649
649
|
ref: v,
|
|
650
650
|
onClick: qe(e.onClick, (m) => {
|
|
651
651
|
b(
|
|
652
|
-
(
|
|
652
|
+
(O) => !O
|
|
653
653
|
), g && (f.current = m.isPropagationStopped(), f.current || m.stopPropagation());
|
|
654
654
|
})
|
|
655
|
-
})), g && /* @__PURE__ */ _(
|
|
655
|
+
})), g && /* @__PURE__ */ _(sr, {
|
|
656
656
|
control: l,
|
|
657
657
|
bubbles: !f.current,
|
|
658
658
|
name: o,
|
|
@@ -664,35 +664,35 @@ const rt = [
|
|
|
664
664
|
transform: "translateX(-100%)"
|
|
665
665
|
}
|
|
666
666
|
}));
|
|
667
|
-
}),
|
|
668
|
-
const { __scopeSwitch:
|
|
667
|
+
}), ur = "SwitchThumb", ir = /* @__PURE__ */ w((e, n) => {
|
|
668
|
+
const { __scopeSwitch: t, ...o } = e, c = ar(ur, t);
|
|
669
669
|
return /* @__PURE__ */ _(se.span, R({
|
|
670
670
|
"data-state": pe(c.checked),
|
|
671
671
|
"data-disabled": c.disabled ? "" : void 0
|
|
672
672
|
}, o, {
|
|
673
673
|
ref: n
|
|
674
674
|
}));
|
|
675
|
-
}),
|
|
676
|
-
const { control: n, checked:
|
|
677
|
-
return
|
|
678
|
-
const i =
|
|
679
|
-
if (a !==
|
|
675
|
+
}), sr = (e) => {
|
|
676
|
+
const { control: n, checked: t, bubbles: o = !0, ...c } = e, r = D(null), a = Je(t), u = Qe(n);
|
|
677
|
+
return A(() => {
|
|
678
|
+
const i = r.current, s = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(s, "checked").set;
|
|
679
|
+
if (a !== t && l) {
|
|
680
680
|
const p = new Event("click", {
|
|
681
681
|
bubbles: o
|
|
682
682
|
});
|
|
683
|
-
l.call(i,
|
|
683
|
+
l.call(i, t), i.dispatchEvent(p);
|
|
684
684
|
}
|
|
685
685
|
}, [
|
|
686
686
|
a,
|
|
687
|
-
|
|
687
|
+
t,
|
|
688
688
|
o
|
|
689
689
|
]), /* @__PURE__ */ _("input", R({
|
|
690
690
|
type: "checkbox",
|
|
691
691
|
"aria-hidden": !0,
|
|
692
|
-
defaultChecked:
|
|
692
|
+
defaultChecked: t
|
|
693
693
|
}, c, {
|
|
694
694
|
tabIndex: -1,
|
|
695
|
-
ref:
|
|
695
|
+
ref: r,
|
|
696
696
|
style: {
|
|
697
697
|
...e.style,
|
|
698
698
|
...u,
|
|
@@ -706,8 +706,8 @@ const rt = [
|
|
|
706
706
|
function pe(e) {
|
|
707
707
|
return e ? "checked" : "unchecked";
|
|
708
708
|
}
|
|
709
|
-
const
|
|
710
|
-
function
|
|
709
|
+
const lr = cr, pr = ir;
|
|
710
|
+
function dr(e) {
|
|
711
711
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
712
712
|
}
|
|
713
713
|
var de = { exports: {} };
|
|
@@ -719,35 +719,35 @@ var de = { exports: {} };
|
|
|
719
719
|
(function(e) {
|
|
720
720
|
(function() {
|
|
721
721
|
var n = {}.hasOwnProperty;
|
|
722
|
-
function
|
|
723
|
-
for (var
|
|
722
|
+
function t() {
|
|
723
|
+
for (var r = "", a = 0; a < arguments.length; a++) {
|
|
724
724
|
var u = arguments[a];
|
|
725
|
-
u && (
|
|
725
|
+
u && (r = c(r, o(u)));
|
|
726
726
|
}
|
|
727
|
-
return
|
|
727
|
+
return r;
|
|
728
728
|
}
|
|
729
|
-
function o(
|
|
730
|
-
if (typeof
|
|
731
|
-
return
|
|
732
|
-
if (typeof
|
|
729
|
+
function o(r) {
|
|
730
|
+
if (typeof r == "string" || typeof r == "number")
|
|
731
|
+
return r;
|
|
732
|
+
if (typeof r != "object")
|
|
733
733
|
return "";
|
|
734
|
-
if (Array.isArray(
|
|
735
|
-
return
|
|
736
|
-
if (
|
|
737
|
-
return
|
|
734
|
+
if (Array.isArray(r))
|
|
735
|
+
return t.apply(null, r);
|
|
736
|
+
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
737
|
+
return r.toString();
|
|
738
738
|
var a = "";
|
|
739
|
-
for (var u in
|
|
740
|
-
n.call(
|
|
739
|
+
for (var u in r)
|
|
740
|
+
n.call(r, u) && r[u] && (a = c(a, u));
|
|
741
741
|
return a;
|
|
742
742
|
}
|
|
743
|
-
function c(
|
|
744
|
-
return a ?
|
|
743
|
+
function c(r, a) {
|
|
744
|
+
return a ? r ? r + " " + a : r + a : r;
|
|
745
745
|
}
|
|
746
|
-
e.exports ? (
|
|
746
|
+
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
747
747
|
})();
|
|
748
748
|
})(de);
|
|
749
|
-
var
|
|
750
|
-
const I = /* @__PURE__ */
|
|
749
|
+
var fr = de.exports;
|
|
750
|
+
const I = /* @__PURE__ */ dr(fr), S = {
|
|
751
751
|
"purpur-toggle": "_purpur-toggle_1xng6_1",
|
|
752
752
|
"purpur-toggle__track": "_purpur-toggle__track_1xng6_7",
|
|
753
753
|
"purpur-toggle__checkmark-container": "_purpur-toggle__checkmark-container_1xng6_45",
|
|
@@ -757,13 +757,13 @@ const I = /* @__PURE__ */ dt(ft), S = {
|
|
|
757
757
|
"purpur-toggle__label--right": "_purpur-toggle__label--right_1xng6_100",
|
|
758
758
|
"purpur-toggle__label--left": "_purpur-toggle__label--left_1xng6_103",
|
|
759
759
|
"purpur-toggle__container": "_purpur-toggle__container_1xng6_106"
|
|
760
|
-
}, Y = (e) => e && "touches" in e,
|
|
760
|
+
}, Y = (e) => e && "touches" in e, gr = ({
|
|
761
761
|
children: e,
|
|
762
762
|
disabled: n,
|
|
763
|
-
onStart:
|
|
763
|
+
onStart: t,
|
|
764
764
|
onDrag: o,
|
|
765
765
|
onStop: c,
|
|
766
|
-
bounds:
|
|
766
|
+
bounds: r,
|
|
767
767
|
position: a,
|
|
768
768
|
style: u
|
|
769
769
|
}) => {
|
|
@@ -771,77 +771,77 @@ const I = /* @__PURE__ */ dt(ft), S = {
|
|
|
771
771
|
if (!n) {
|
|
772
772
|
b.preventDefault();
|
|
773
773
|
const m = Y(b.nativeEvent) ? b.nativeEvent.touches[0].clientX : b.nativeEvent.clientX;
|
|
774
|
-
l(m),
|
|
774
|
+
l(m), t == null || t();
|
|
775
775
|
}
|
|
776
|
-
}, g =
|
|
776
|
+
}, g = X(
|
|
777
777
|
(b) => {
|
|
778
778
|
if (typeof h != "number")
|
|
779
779
|
return;
|
|
780
|
-
const
|
|
781
|
-
if (!
|
|
780
|
+
const O = (Y(b) ? b.touches[0].clientX : b.clientX) - h;
|
|
781
|
+
if (!O)
|
|
782
782
|
return;
|
|
783
|
-
const
|
|
784
|
-
!p && Math.abs(
|
|
785
|
-
const
|
|
786
|
-
s(
|
|
783
|
+
const C = a + O;
|
|
784
|
+
!p && Math.abs(C) && v(!0);
|
|
785
|
+
const B = C > r.right ? r.right : C < r.left ? r.left : C;
|
|
786
|
+
s(B), o == null || o({ x: B });
|
|
787
787
|
},
|
|
788
788
|
[o, s, p, h]
|
|
789
|
-
), d =
|
|
789
|
+
), d = X(() => {
|
|
790
790
|
l(void 0), s(void 0), v(!1), c == null || c();
|
|
791
791
|
}, [c, l]);
|
|
792
|
-
return
|
|
792
|
+
return A(() => (window.addEventListener("mousemove", g), window.addEventListener("touchmove", g), () => {
|
|
793
793
|
window.removeEventListener("mousemove", g), window.removeEventListener("touchmove", g);
|
|
794
|
-
}), [g]),
|
|
794
|
+
}), [g]), A(() => (window.addEventListener("mouseup", d), window.addEventListener("touchend", d), () => {
|
|
795
795
|
window.removeEventListener("mouseup", d), window.removeEventListener("touchend", d);
|
|
796
|
-
}), [d]),
|
|
796
|
+
}), [d]), k(e) ? z(y.only(e), {
|
|
797
797
|
onMouseDown: f,
|
|
798
798
|
onTouchStart: f,
|
|
799
799
|
style: { ...u, transform: `translateX(${p ? i : a}px)` }
|
|
800
800
|
}) : null;
|
|
801
|
-
},
|
|
801
|
+
}, hr = ({ checked: e, onChange: n }) => {
|
|
802
802
|
var U, W;
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
-
var
|
|
806
|
-
l(((
|
|
807
|
-
}, [(U = o.current) == null ? void 0 : U.clientHeight, (W =
|
|
803
|
+
const t = D(null), o = D(null), [c, r] = $(void 0), [a, u] = $(!1), [i, s] = $(0), [h, l] = $(0), [p, v] = $(0);
|
|
804
|
+
re(() => {
|
|
805
|
+
var N, T;
|
|
806
|
+
l(((N = o.current) == null ? void 0 : N.clientHeight) || 0), v(((T = t.current) == null ? void 0 : T.clientHeight) || 0);
|
|
807
|
+
}, [(U = o.current) == null ? void 0 : U.clientHeight, (W = t.current) == null ? void 0 : W.clientHeight]);
|
|
808
808
|
const f = (p || 0) - h, g = h + f, d = f / 2, b = g / 2, m = typeof c == "number" && (e ? c < b : c > b);
|
|
809
809
|
return {
|
|
810
|
-
trackRef:
|
|
810
|
+
trackRef: t,
|
|
811
811
|
thumbRef: o,
|
|
812
812
|
isDragging: a,
|
|
813
813
|
bounds: { left: d, right: g },
|
|
814
814
|
position: e ? g : d,
|
|
815
|
-
onDrag: ({ x:
|
|
816
|
-
|
|
815
|
+
onDrag: ({ x: N }) => {
|
|
816
|
+
r(N), Math.abs((e ? g : d) - N) > 2 && u(!0);
|
|
817
817
|
},
|
|
818
818
|
onStop: () => {
|
|
819
819
|
u(!1), a && s(Date.now()), m && (n == null || n(!e));
|
|
820
820
|
},
|
|
821
821
|
onChangeWithDrag: () => {
|
|
822
|
-
Date.now() - i > 50 && (n == null || n(!e)),
|
|
822
|
+
Date.now() - i > 50 && (n == null || n(!e)), r(void 0);
|
|
823
823
|
}
|
|
824
824
|
};
|
|
825
|
-
}, P = "purpur-toggle",
|
|
825
|
+
}, P = "purpur-toggle", br = ({
|
|
826
826
|
["data-testid"]: e,
|
|
827
827
|
className: n,
|
|
828
|
-
label:
|
|
828
|
+
label: t,
|
|
829
829
|
onChange: o,
|
|
830
830
|
labelPosition: c = "right",
|
|
831
|
-
checked:
|
|
831
|
+
checked: r,
|
|
832
832
|
disableDrag: a,
|
|
833
833
|
defaultChecked: u,
|
|
834
834
|
...i
|
|
835
835
|
}, s) => {
|
|
836
836
|
const [h, l] = $(
|
|
837
|
-
typeof
|
|
838
|
-
), p = !!(typeof
|
|
837
|
+
typeof r == "boolean" ? r : !!u
|
|
838
|
+
), p = !!(typeof r == "boolean" ? r : h), { thumbRef: v, trackRef: f, isDragging: g, onChangeWithDrag: d, ...b } = hr({
|
|
839
839
|
checked: p,
|
|
840
|
-
onChange: (
|
|
841
|
-
i.disabled || (o == null || o(
|
|
840
|
+
onChange: (O) => {
|
|
841
|
+
i.disabled || (o == null || o(O), l(O));
|
|
842
842
|
}
|
|
843
|
-
}), m = () => /* @__PURE__ */
|
|
844
|
-
|
|
843
|
+
}), m = () => /* @__PURE__ */ x(
|
|
844
|
+
He,
|
|
845
845
|
{
|
|
846
846
|
htmlFor: i.id,
|
|
847
847
|
"data-testid": e && `${e}-label`,
|
|
@@ -850,13 +850,13 @@ const I = /* @__PURE__ */ dt(ft), S = {
|
|
|
850
850
|
S[`${P}__label`],
|
|
851
851
|
S[`${P}__label--${c}`]
|
|
852
852
|
),
|
|
853
|
-
children: /* @__PURE__ */
|
|
853
|
+
children: /* @__PURE__ */ x(Ie, { variant: "paragraph-100", disabled: i.disabled, children: t })
|
|
854
854
|
}
|
|
855
855
|
);
|
|
856
856
|
return /* @__PURE__ */ G("div", { className: I([n, S[`${P}__container`]]), children: [
|
|
857
|
-
|
|
858
|
-
/* @__PURE__ */
|
|
859
|
-
|
|
857
|
+
t && c === "left" && m(),
|
|
858
|
+
/* @__PURE__ */ x(
|
|
859
|
+
lr,
|
|
860
860
|
{
|
|
861
861
|
...i,
|
|
862
862
|
ref: s,
|
|
@@ -866,7 +866,7 @@ const I = /* @__PURE__ */ dt(ft), S = {
|
|
|
866
866
|
onCheckedChange: d,
|
|
867
867
|
checked: p,
|
|
868
868
|
children: /* @__PURE__ */ G("span", { ref: f, className: S[`${P}__track`], children: [
|
|
869
|
-
/* @__PURE__ */
|
|
869
|
+
/* @__PURE__ */ x("span", { className: S[`${P}__checkmark-container`], children: /* @__PURE__ */ x(
|
|
870
870
|
Se,
|
|
871
871
|
{
|
|
872
872
|
className: S[`${P}__checkmark`],
|
|
@@ -874,8 +874,8 @@ const I = /* @__PURE__ */ dt(ft), S = {
|
|
|
874
874
|
size: "xxs"
|
|
875
875
|
}
|
|
876
876
|
) }),
|
|
877
|
-
/* @__PURE__ */
|
|
878
|
-
|
|
877
|
+
/* @__PURE__ */ x(gr, { disabled: a, ...b, children: /* @__PURE__ */ x(
|
|
878
|
+
pr,
|
|
879
879
|
{
|
|
880
880
|
ref: v,
|
|
881
881
|
"data-testid": e && `${e}-thumb`,
|
|
@@ -890,11 +890,11 @@ const I = /* @__PURE__ */ dt(ft), S = {
|
|
|
890
890
|
] })
|
|
891
891
|
}
|
|
892
892
|
),
|
|
893
|
-
|
|
893
|
+
t && c === "right" && m()
|
|
894
894
|
] });
|
|
895
|
-
},
|
|
896
|
-
|
|
895
|
+
}, _r = w(br);
|
|
896
|
+
_r.displayName = "Toggle";
|
|
897
897
|
export {
|
|
898
|
-
|
|
898
|
+
_r as Toggle
|
|
899
899
|
};
|
|
900
900
|
//# sourceMappingURL=toggle.es.js.map
|