@purpurds/checkbox 5.25.0 → 5.25.1-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +5 -5
- package/dist/checkbox.cjs.js +7 -7
- package/dist/checkbox.cjs.js.map +1 -1
- package/dist/checkbox.es.js +118 -127
- package/dist/checkbox.es.js.map +1 -1
- package/package.json +6 -6
package/dist/checkbox.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as g, Children as v, isValidElement as
|
|
1
|
+
import { jsxs as I, jsx as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as g, Children as v, isValidElement as w, createElement as p, Fragment as Y, cloneElement as M, useEffect as C, useCallback as Z, useMemo as E, createContext as V, useContext as be, useRef as $, useState as z, useLayoutEffect as _e, useReducer as ge } from "react";
|
|
3
3
|
import { flushSync as $e } from "react-dom";
|
|
4
4
|
function xe(e) {
|
|
5
5
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -41,7 +41,7 @@ var Q = { exports: {} };
|
|
|
41
41
|
})();
|
|
42
42
|
})(Q);
|
|
43
43
|
var ye = Q.exports;
|
|
44
|
-
const
|
|
44
|
+
const we = /* @__PURE__ */ xe(ye), Ne = {
|
|
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,26 +54,26 @@ const Ne = /* @__PURE__ */ xe(ye), we = {
|
|
|
54
54
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 24" fill="currentColor"><path fill-rule="evenodd" d="M14.268 3.5c-.77-1.333-2.694-1.333-3.464 0l-8.66 15c-.77 1.333.192 3 1.732 3h17.32c1.54 0 2.502-1.667 1.733-3l-8.66-15Zm-.694 5.067-.247 6.876h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.917c0 .649-.585 1.234-1.25 1.234-.648 0-1.25-.585-1.25-1.234 0-.633.602-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z" clip-rule="evenodd"/></svg>',
|
|
55
55
|
keywords: ["error-filled"],
|
|
56
56
|
category: "status"
|
|
57
|
-
},
|
|
57
|
+
}, Ce = we.bind(Ne), K = "purpur-icon", ke = "md", Pe = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Oe = ({ 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 ${
|
|
65
|
-
},
|
|
64
|
+
return `<svg ${Pe(t)}>${a}${e}</svg>`;
|
|
65
|
+
}, Ae = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), ee = ({
|
|
66
66
|
["data-testid"]: e,
|
|
67
67
|
svg: n,
|
|
68
68
|
allyTitle: t,
|
|
69
69
|
className: a,
|
|
70
|
-
size: u =
|
|
70
|
+
size: u = ke,
|
|
71
71
|
...r
|
|
72
72
|
}) => {
|
|
73
|
-
const o =
|
|
74
|
-
content:
|
|
73
|
+
const o = Oe({
|
|
74
|
+
content: Ae(n.svg),
|
|
75
75
|
title: t
|
|
76
|
-
}), i =
|
|
76
|
+
}), i = Ce(a, K, `${K}--${u}`);
|
|
77
77
|
return /* @__PURE__ */ h(
|
|
78
78
|
"span",
|
|
79
79
|
{
|
|
@@ -86,7 +86,7 @@ const Ne = /* @__PURE__ */ xe(ye), we = {
|
|
|
86
86
|
);
|
|
87
87
|
};
|
|
88
88
|
ee.displayName = "Icon";
|
|
89
|
-
function
|
|
89
|
+
function je(e) {
|
|
90
90
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
91
91
|
}
|
|
92
92
|
var re = { exports: {} };
|
|
@@ -125,31 +125,31 @@ var re = { exports: {} };
|
|
|
125
125
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
126
126
|
})();
|
|
127
127
|
})(re);
|
|
128
|
-
var
|
|
129
|
-
const
|
|
128
|
+
var Ee = re.exports;
|
|
129
|
+
const Me = /* @__PURE__ */ je(Ee), X = {
|
|
130
130
|
"purpur-field-error-text": "_purpur-field-error-text_1u768_1",
|
|
131
131
|
"purpur-field-error-text__icon": "_purpur-field-error-text__icon_1u768_12"
|
|
132
|
-
},
|
|
132
|
+
}, G = "purpur-field-error-text", qe = ({
|
|
133
133
|
["data-testid"]: e,
|
|
134
134
|
children: n,
|
|
135
135
|
className: t,
|
|
136
136
|
relevant: a = "additions text",
|
|
137
137
|
...u
|
|
138
|
-
}) => /* @__PURE__ */
|
|
138
|
+
}) => /* @__PURE__ */ I(
|
|
139
139
|
"div",
|
|
140
140
|
{
|
|
141
|
-
className:
|
|
141
|
+
className: Me([t, X[G]]),
|
|
142
142
|
"data-testid": e,
|
|
143
143
|
"aria-live": "assertive",
|
|
144
144
|
"aria-relevant": a,
|
|
145
145
|
...u,
|
|
146
146
|
children: [
|
|
147
|
-
/* @__PURE__ */ h(ee, { svg: Se, size: "xs", className:
|
|
147
|
+
/* @__PURE__ */ h(ee, { svg: Se, size: "xs", className: X[`${G}__icon`] }),
|
|
148
148
|
n
|
|
149
149
|
]
|
|
150
150
|
}
|
|
151
151
|
);
|
|
152
|
-
function
|
|
152
|
+
function Re(e) {
|
|
153
153
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
154
154
|
}
|
|
155
155
|
var te = { exports: {} };
|
|
@@ -188,8 +188,8 @@ var te = { exports: {} };
|
|
|
188
188
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
189
189
|
})();
|
|
190
190
|
})(te);
|
|
191
|
-
var
|
|
192
|
-
const
|
|
191
|
+
var ze = te.exports;
|
|
192
|
+
const Be = /* @__PURE__ */ Re(ze), De = {
|
|
193
193
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
194
194
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
195
195
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -197,17 +197,17 @@ const Le = /* @__PURE__ */ De(Ie), qe = {
|
|
|
197
197
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
198
198
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
199
199
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
200
|
-
},
|
|
200
|
+
}, Le = {
|
|
201
201
|
name: "checkmark-bold",
|
|
202
202
|
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>',
|
|
203
203
|
keywords: ["checkmark-bold"],
|
|
204
204
|
category: "utility"
|
|
205
|
-
},
|
|
205
|
+
}, Ie = {
|
|
206
206
|
name: "minus-bold",
|
|
207
207
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M3 12c0-1.105.711-2 1.588-2h14.824c.877 0 1.588.895 1.588 2s-.711 2-1.588 2H4.588C3.711 14 3 13.105 3 12Z" clip-rule="evenodd"/></svg>',
|
|
208
208
|
keywords: ["minus-bold"],
|
|
209
209
|
category: "utility"
|
|
210
|
-
}, Te =
|
|
210
|
+
}, Te = Be.bind(De), W = "purpur-icon", Ue = "md", He = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Fe = ({ content: e = "", title: n } = {}) => {
|
|
211
211
|
const t = [
|
|
212
212
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
213
213
|
{ name: "fill", value: "currentColor" },
|
|
@@ -239,47 +239,47 @@ const Le = /* @__PURE__ */ De(Ie), qe = {
|
|
|
239
239
|
);
|
|
240
240
|
};
|
|
241
241
|
T.displayName = "Icon";
|
|
242
|
-
function
|
|
243
|
-
return
|
|
242
|
+
function P() {
|
|
243
|
+
return P = Object.assign ? Object.assign.bind() : function(e) {
|
|
244
244
|
for (var n = 1; n < arguments.length; n++) {
|
|
245
245
|
var t = arguments[n];
|
|
246
246
|
for (var a in t) ({}).hasOwnProperty.call(t, a) && (e[a] = t[a]);
|
|
247
247
|
}
|
|
248
248
|
return e;
|
|
249
|
-
},
|
|
249
|
+
}, P.apply(null, arguments);
|
|
250
250
|
}
|
|
251
251
|
function Ve(e, n) {
|
|
252
252
|
typeof e == "function" ? e(n) : e != null && (e.current = n);
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function Ke(...e) {
|
|
255
255
|
return (n) => e.forEach(
|
|
256
256
|
(t) => Ve(t, n)
|
|
257
257
|
);
|
|
258
258
|
}
|
|
259
259
|
const ne = /* @__PURE__ */ g((e, n) => {
|
|
260
|
-
const { children: t, ...a } = e, u = v.toArray(t), r = u.find(
|
|
260
|
+
const { children: t, ...a } = e, u = v.toArray(t), r = u.find(Ge);
|
|
261
261
|
if (r) {
|
|
262
|
-
const o = r.props.children, i = u.map((c) => c === r ? v.count(o) > 1 ? v.only(null) : /* @__PURE__ */
|
|
263
|
-
return /* @__PURE__ */ p(U,
|
|
262
|
+
const o = r.props.children, i = u.map((c) => c === r ? v.count(o) > 1 ? v.only(null) : /* @__PURE__ */ w(o) ? o.props.children : null : c);
|
|
263
|
+
return /* @__PURE__ */ p(U, P({}, a, {
|
|
264
264
|
ref: n
|
|
265
|
-
}), /* @__PURE__ */
|
|
265
|
+
}), /* @__PURE__ */ w(o) ? /* @__PURE__ */ M(o, void 0, i) : null);
|
|
266
266
|
}
|
|
267
|
-
return /* @__PURE__ */ p(U,
|
|
267
|
+
return /* @__PURE__ */ p(U, P({}, a, {
|
|
268
268
|
ref: n
|
|
269
269
|
}), t);
|
|
270
270
|
});
|
|
271
271
|
ne.displayName = "Slot";
|
|
272
272
|
const U = /* @__PURE__ */ g((e, n) => {
|
|
273
273
|
const { children: t, ...a } = e;
|
|
274
|
-
return /* @__PURE__ */
|
|
274
|
+
return /* @__PURE__ */ w(t) ? /* @__PURE__ */ M(t, {
|
|
275
275
|
...We(a, t.props),
|
|
276
|
-
ref: n ?
|
|
276
|
+
ref: n ? Ke(n, t.ref) : t.ref
|
|
277
277
|
}) : v.count(t) > 1 ? v.only(null) : null;
|
|
278
278
|
});
|
|
279
279
|
U.displayName = "SlotClone";
|
|
280
|
-
const
|
|
281
|
-
function
|
|
282
|
-
return /* @__PURE__ */
|
|
280
|
+
const Xe = ({ children: e }) => /* @__PURE__ */ p(Y, null, e);
|
|
281
|
+
function Ge(e) {
|
|
282
|
+
return /* @__PURE__ */ w(e) && e.type === Xe;
|
|
283
283
|
}
|
|
284
284
|
function We(e, n) {
|
|
285
285
|
const t = {
|
|
@@ -322,9 +322,9 @@ const Je = [
|
|
|
322
322
|
], Ye = Je.reduce((e, n) => {
|
|
323
323
|
const t = /* @__PURE__ */ g((a, u) => {
|
|
324
324
|
const { asChild: r, ...o } = a, i = r ? ne : n;
|
|
325
|
-
return
|
|
325
|
+
return C(() => {
|
|
326
326
|
window[Symbol.for("radix-ui")] = !0;
|
|
327
|
-
}, []), /* @__PURE__ */ p(i,
|
|
327
|
+
}, []), /* @__PURE__ */ p(i, P({}, o, {
|
|
328
328
|
ref: u
|
|
329
329
|
}));
|
|
330
330
|
});
|
|
@@ -332,7 +332,7 @@ const Je = [
|
|
|
332
332
|
...e,
|
|
333
333
|
[n]: t
|
|
334
334
|
};
|
|
335
|
-
}, {}), Qe = /* @__PURE__ */ g((e, n) => /* @__PURE__ */ p(Ye.label,
|
|
335
|
+
}, {}), Qe = /* @__PURE__ */ g((e, n) => /* @__PURE__ */ p(Ye.label, P({}, e, {
|
|
336
336
|
ref: n,
|
|
337
337
|
onMouseDown: (t) => {
|
|
338
338
|
var a;
|
|
@@ -379,11 +379,11 @@ var oe = { exports: {} };
|
|
|
379
379
|
})();
|
|
380
380
|
})(oe);
|
|
381
381
|
var tr = oe.exports;
|
|
382
|
-
const nr = /* @__PURE__ */ rr(tr),
|
|
382
|
+
const nr = /* @__PURE__ */ rr(tr), D = {
|
|
383
383
|
"purpur-label": "_purpur-label_12cfi_1",
|
|
384
384
|
"purpur-label--negative": "_purpur-label--negative_12cfi_9",
|
|
385
385
|
"purpur-label--disabled": "_purpur-label--disabled_12cfi_12"
|
|
386
|
-
},
|
|
386
|
+
}, L = "purpur-label", or = ({
|
|
387
387
|
children: e,
|
|
388
388
|
className: n,
|
|
389
389
|
htmlFor: t,
|
|
@@ -394,10 +394,10 @@ const nr = /* @__PURE__ */ rr(tr), q = {
|
|
|
394
394
|
}) => {
|
|
395
395
|
const i = nr([
|
|
396
396
|
n,
|
|
397
|
-
|
|
397
|
+
D[L],
|
|
398
398
|
{
|
|
399
|
-
[
|
|
400
|
-
[
|
|
399
|
+
[D[`${L}--disabled`]]: u,
|
|
400
|
+
[D[`${L}--negative`]]: r
|
|
401
401
|
}
|
|
402
402
|
]);
|
|
403
403
|
return /* @__PURE__ */ h(er, { className: i, "data-testid": a, htmlFor: t, ...o, children: e });
|
|
@@ -442,7 +442,7 @@ var ae = { exports: {} };
|
|
|
442
442
|
})();
|
|
443
443
|
})(ae);
|
|
444
444
|
var ir = ae.exports;
|
|
445
|
-
const ur = /* @__PURE__ */ ar(ir),
|
|
445
|
+
const ur = /* @__PURE__ */ ar(ir), A = {
|
|
446
446
|
"purpur-paragraph": "_purpur-paragraph_1rh57_1",
|
|
447
447
|
"purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
|
|
448
448
|
"purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
|
|
@@ -458,17 +458,8 @@ const ur = /* @__PURE__ */ ar(ir), O = {
|
|
|
458
458
|
"purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1rh57_67",
|
|
459
459
|
"purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1rh57_75"
|
|
460
460
|
}, cr = {
|
|
461
|
-
PARAGRAPH100: "paragraph-100"
|
|
462
|
-
|
|
463
|
-
PARAGRAPH100BOLD: "paragraph-100-bold",
|
|
464
|
-
PARAGRAPH200: "paragraph-200",
|
|
465
|
-
PREAMBLE100: "preamble-100",
|
|
466
|
-
PREAMBLE200: "preamble-200",
|
|
467
|
-
ADDITIONAL100: "additional-100",
|
|
468
|
-
ADDITIONAL100MEDIUM: "additional-100-medium",
|
|
469
|
-
OVERLINE100: "overline-100",
|
|
470
|
-
OVERLINE200: "overline-200"
|
|
471
|
-
}, E = "purpur-paragraph", ie = ({
|
|
461
|
+
PARAGRAPH100: "paragraph-100"
|
|
462
|
+
}, j = "purpur-paragraph", ie = ({
|
|
472
463
|
["data-testid"]: e,
|
|
473
464
|
children: n,
|
|
474
465
|
className: t,
|
|
@@ -480,25 +471,25 @@ const ur = /* @__PURE__ */ ar(ir), O = {
|
|
|
480
471
|
}) => {
|
|
481
472
|
const c = ur([
|
|
482
473
|
t,
|
|
483
|
-
|
|
484
|
-
|
|
474
|
+
A[j],
|
|
475
|
+
A[`${j}--${o}`],
|
|
485
476
|
{
|
|
486
|
-
[
|
|
487
|
-
[
|
|
488
|
-
[
|
|
477
|
+
[A[`${j}--hyphens`]]: u,
|
|
478
|
+
[A[`${j}--disabled`]]: a,
|
|
479
|
+
[A[`${j}--negative`]]: r
|
|
489
480
|
}
|
|
490
481
|
]);
|
|
491
482
|
return /* @__PURE__ */ h("p", { ...i, className: c, "data-testid": e, children: n });
|
|
492
483
|
};
|
|
493
484
|
ie.displayName = "Paragraph";
|
|
494
|
-
function
|
|
495
|
-
return
|
|
485
|
+
function N() {
|
|
486
|
+
return N = Object.assign ? Object.assign.bind() : function(e) {
|
|
496
487
|
for (var n = 1; n < arguments.length; n++) {
|
|
497
488
|
var t = arguments[n];
|
|
498
489
|
for (var a in t) ({}).hasOwnProperty.call(t, a) && (e[a] = t[a]);
|
|
499
490
|
}
|
|
500
491
|
return e;
|
|
501
|
-
},
|
|
492
|
+
}, N.apply(null, arguments);
|
|
502
493
|
}
|
|
503
494
|
function sr(e, n) {
|
|
504
495
|
typeof e == "function" ? e(n) : e != null && (e.current = n);
|
|
@@ -520,11 +511,11 @@ function lr(e, n = []) {
|
|
|
520
511
|
o
|
|
521
512
|
];
|
|
522
513
|
function s(l) {
|
|
523
|
-
const { scope: f, children: b, ..._ } = l,
|
|
514
|
+
const { scope: f, children: b, ..._ } = l, q = (f == null ? void 0 : f[e][c]) || i, x = E(
|
|
524
515
|
() => _,
|
|
525
516
|
Object.values(_)
|
|
526
517
|
);
|
|
527
|
-
return /* @__PURE__ */ p(
|
|
518
|
+
return /* @__PURE__ */ p(q.Provider, {
|
|
528
519
|
value: x
|
|
529
520
|
}, b);
|
|
530
521
|
}
|
|
@@ -543,7 +534,7 @@ function lr(e, n = []) {
|
|
|
543
534
|
const r = t.map((o) => /* @__PURE__ */ V(o));
|
|
544
535
|
return function(i) {
|
|
545
536
|
const c = (i == null ? void 0 : i[e]) || r;
|
|
546
|
-
return
|
|
537
|
+
return E(
|
|
547
538
|
() => ({
|
|
548
539
|
[`__scope${e}`]: {
|
|
549
540
|
...i,
|
|
@@ -580,7 +571,7 @@ function pr(...e) {
|
|
|
580
571
|
...l
|
|
581
572
|
};
|
|
582
573
|
}, {});
|
|
583
|
-
return
|
|
574
|
+
return E(
|
|
584
575
|
() => ({
|
|
585
576
|
[`__scope${n.scopeName}`]: o
|
|
586
577
|
}),
|
|
@@ -599,9 +590,9 @@ function J(e, n, { checkForDefaultPrevented: t = !0 } = {}) {
|
|
|
599
590
|
}
|
|
600
591
|
function se(e) {
|
|
601
592
|
const n = $(e);
|
|
602
|
-
return
|
|
593
|
+
return C(() => {
|
|
603
594
|
n.current = e;
|
|
604
|
-
}),
|
|
595
|
+
}), E(
|
|
605
596
|
() => (...t) => {
|
|
606
597
|
var a;
|
|
607
598
|
return (a = n.current) === null || a === void 0 ? void 0 : a.call(n, ...t);
|
|
@@ -631,8 +622,8 @@ function dr({ prop: e, defaultProp: n, onChange: t = () => {
|
|
|
631
622
|
];
|
|
632
623
|
}
|
|
633
624
|
function fr({ defaultProp: e, onChange: n }) {
|
|
634
|
-
const t =
|
|
635
|
-
return
|
|
625
|
+
const t = z(e), [a] = t, u = $(a), r = se(n);
|
|
626
|
+
return C(() => {
|
|
636
627
|
u.current !== a && (r(a), u.current = a);
|
|
637
628
|
}, [
|
|
638
629
|
a,
|
|
@@ -645,14 +636,14 @@ function hr(e) {
|
|
|
645
636
|
value: e,
|
|
646
637
|
previous: e
|
|
647
638
|
});
|
|
648
|
-
return
|
|
639
|
+
return E(() => (n.current.value !== e && (n.current.previous = n.current.value, n.current.value = e), n.current.previous), [
|
|
649
640
|
e
|
|
650
641
|
]);
|
|
651
642
|
}
|
|
652
643
|
const H = globalThis != null && globalThis.document ? _e : () => {
|
|
653
644
|
};
|
|
654
645
|
function mr(e) {
|
|
655
|
-
const [n, t] =
|
|
646
|
+
const [n, t] = z(void 0);
|
|
656
647
|
return H(() => {
|
|
657
648
|
if (e) {
|
|
658
649
|
t({
|
|
@@ -692,13 +683,13 @@ const le = (e) => {
|
|
|
692
683
|
const { present: n, children: t } = e, a = br(n), u = typeof t == "function" ? t({
|
|
693
684
|
present: a.isPresent
|
|
694
685
|
}) : v.only(t), r = ce(a.ref, u.ref);
|
|
695
|
-
return typeof t == "function" || a.isPresent ? /* @__PURE__ */
|
|
686
|
+
return typeof t == "function" || a.isPresent ? /* @__PURE__ */ M(u, {
|
|
696
687
|
ref: r
|
|
697
688
|
}) : null;
|
|
698
689
|
};
|
|
699
690
|
le.displayName = "Presence";
|
|
700
691
|
function br(e) {
|
|
701
|
-
const [n, t] =
|
|
692
|
+
const [n, t] = z(), a = $({}), u = $(e), r = $("none"), o = e ? "mounted" : "unmounted", [i, c] = vr(o, {
|
|
702
693
|
mounted: {
|
|
703
694
|
UNMOUNT: "unmounted",
|
|
704
695
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -711,15 +702,15 @@ function br(e) {
|
|
|
711
702
|
MOUNT: "mounted"
|
|
712
703
|
}
|
|
713
704
|
});
|
|
714
|
-
return
|
|
715
|
-
const s =
|
|
705
|
+
return C(() => {
|
|
706
|
+
const s = R(a.current);
|
|
716
707
|
r.current = i === "mounted" ? s : "none";
|
|
717
708
|
}, [
|
|
718
709
|
i
|
|
719
710
|
]), H(() => {
|
|
720
711
|
const s = a.current, d = u.current;
|
|
721
712
|
if (d !== e) {
|
|
722
|
-
const f = r.current, b =
|
|
713
|
+
const f = r.current, b = R(s);
|
|
723
714
|
e ? c("MOUNT") : b === "none" || (s == null ? void 0 : s.display) === "none" ? c("UNMOUNT") : c(d && f !== b ? "ANIMATION_OUT" : "UNMOUNT"), u.current = e;
|
|
724
715
|
}
|
|
725
716
|
}, [
|
|
@@ -728,12 +719,12 @@ function br(e) {
|
|
|
728
719
|
]), H(() => {
|
|
729
720
|
if (n) {
|
|
730
721
|
const s = (l) => {
|
|
731
|
-
const b =
|
|
722
|
+
const b = R(a.current).includes(l.animationName);
|
|
732
723
|
l.target === n && b && $e(
|
|
733
724
|
() => c("ANIMATION_END")
|
|
734
725
|
);
|
|
735
726
|
}, d = (l) => {
|
|
736
|
-
l.target === n && (r.current =
|
|
727
|
+
l.target === n && (r.current = R(a.current));
|
|
737
728
|
};
|
|
738
729
|
return n.addEventListener("animationstart", d), n.addEventListener("animationcancel", s), n.addEventListener("animationend", s), () => {
|
|
739
730
|
n.removeEventListener("animationstart", d), n.removeEventListener("animationcancel", s), n.removeEventListener("animationend", s);
|
|
@@ -753,25 +744,25 @@ function br(e) {
|
|
|
753
744
|
}, [])
|
|
754
745
|
};
|
|
755
746
|
}
|
|
756
|
-
function
|
|
747
|
+
function R(e) {
|
|
757
748
|
return (e == null ? void 0 : e.animationName) || "none";
|
|
758
749
|
}
|
|
759
750
|
const pe = /* @__PURE__ */ g((e, n) => {
|
|
760
751
|
const { children: t, ...a } = e, u = v.toArray(t), r = u.find(gr);
|
|
761
752
|
if (r) {
|
|
762
|
-
const o = r.props.children, i = u.map((c) => c === r ? v.count(o) > 1 ? v.only(null) : /* @__PURE__ */
|
|
763
|
-
return /* @__PURE__ */ p(F,
|
|
753
|
+
const o = r.props.children, i = u.map((c) => c === r ? v.count(o) > 1 ? v.only(null) : /* @__PURE__ */ w(o) ? o.props.children : null : c);
|
|
754
|
+
return /* @__PURE__ */ p(F, N({}, a, {
|
|
764
755
|
ref: n
|
|
765
|
-
}), /* @__PURE__ */
|
|
756
|
+
}), /* @__PURE__ */ w(o) ? /* @__PURE__ */ M(o, void 0, i) : null);
|
|
766
757
|
}
|
|
767
|
-
return /* @__PURE__ */ p(F,
|
|
758
|
+
return /* @__PURE__ */ p(F, N({}, a, {
|
|
768
759
|
ref: n
|
|
769
760
|
}), t);
|
|
770
761
|
});
|
|
771
762
|
pe.displayName = "Slot";
|
|
772
763
|
const F = /* @__PURE__ */ g((e, n) => {
|
|
773
764
|
const { children: t, ...a } = e;
|
|
774
|
-
return /* @__PURE__ */
|
|
765
|
+
return /* @__PURE__ */ w(t) ? /* @__PURE__ */ M(t, {
|
|
775
766
|
...$r(a, t.props),
|
|
776
767
|
ref: n ? ue(n, t.ref) : t.ref
|
|
777
768
|
}) : v.count(t) > 1 ? v.only(null) : null;
|
|
@@ -779,7 +770,7 @@ const F = /* @__PURE__ */ g((e, n) => {
|
|
|
779
770
|
F.displayName = "SlotClone";
|
|
780
771
|
const _r = ({ children: e }) => /* @__PURE__ */ p(Y, null, e);
|
|
781
772
|
function gr(e) {
|
|
782
|
-
return /* @__PURE__ */
|
|
773
|
+
return /* @__PURE__ */ w(e) && e.type === _r;
|
|
783
774
|
}
|
|
784
775
|
function $r(e, n) {
|
|
785
776
|
const t = {
|
|
@@ -822,9 +813,9 @@ const xr = [
|
|
|
822
813
|
], de = xr.reduce((e, n) => {
|
|
823
814
|
const t = /* @__PURE__ */ g((a, u) => {
|
|
824
815
|
const { asChild: r, ...o } = a, i = r ? pe : n;
|
|
825
|
-
return
|
|
816
|
+
return C(() => {
|
|
826
817
|
window[Symbol.for("radix-ui")] = !0;
|
|
827
|
-
}, []), /* @__PURE__ */ p(i,
|
|
818
|
+
}, []), /* @__PURE__ */ p(i, N({}, o, {
|
|
828
819
|
ref: u
|
|
829
820
|
}));
|
|
830
821
|
});
|
|
@@ -832,29 +823,29 @@ const xr = [
|
|
|
832
823
|
...e,
|
|
833
824
|
[n]: t
|
|
834
825
|
};
|
|
835
|
-
}, {}), fe = "Checkbox", [yr,
|
|
836
|
-
const { __scopeCheckbox: t, name: a, checked: u, defaultChecked: r, required: o, disabled: i, value: c = "on", onCheckedChange: s, ...d } = e, [l, f] =
|
|
826
|
+
}, {}), fe = "Checkbox", [yr, Ir] = lr(fe), [wr, Nr] = yr(fe), Sr = /* @__PURE__ */ g((e, n) => {
|
|
827
|
+
const { __scopeCheckbox: t, name: a, checked: u, defaultChecked: r, required: o, disabled: i, value: c = "on", onCheckedChange: s, ...d } = e, [l, f] = z(null), b = ce(
|
|
837
828
|
n,
|
|
838
829
|
(m) => f(m)
|
|
839
|
-
), _ = $(!1),
|
|
830
|
+
), _ = $(!1), q = l ? !!l.closest("form") : !0, [x = !1, B] = dr({
|
|
840
831
|
prop: u,
|
|
841
832
|
defaultProp: r,
|
|
842
833
|
onChange: s
|
|
843
834
|
}), ve = $(x);
|
|
844
|
-
return
|
|
835
|
+
return C(() => {
|
|
845
836
|
const m = l == null ? void 0 : l.form;
|
|
846
837
|
if (m) {
|
|
847
|
-
const
|
|
848
|
-
return m.addEventListener("reset",
|
|
838
|
+
const O = () => B(ve.current);
|
|
839
|
+
return m.addEventListener("reset", O), () => m.removeEventListener("reset", O);
|
|
849
840
|
}
|
|
850
841
|
}, [
|
|
851
842
|
l,
|
|
852
|
-
|
|
853
|
-
]), /* @__PURE__ */ p(
|
|
843
|
+
B
|
|
844
|
+
]), /* @__PURE__ */ p(wr, {
|
|
854
845
|
scope: t,
|
|
855
846
|
state: x,
|
|
856
847
|
disabled: i
|
|
857
|
-
}, /* @__PURE__ */ p(de.button,
|
|
848
|
+
}, /* @__PURE__ */ p(de.button, N({
|
|
858
849
|
type: "button",
|
|
859
850
|
role: "checkbox",
|
|
860
851
|
"aria-checked": S(x) ? "mixed" : x,
|
|
@@ -869,11 +860,11 @@ const xr = [
|
|
|
869
860
|
m.key === "Enter" && m.preventDefault();
|
|
870
861
|
}),
|
|
871
862
|
onClick: J(e.onClick, (m) => {
|
|
872
|
-
|
|
873
|
-
(
|
|
874
|
-
),
|
|
863
|
+
B(
|
|
864
|
+
(O) => S(O) ? !0 : !O
|
|
865
|
+
), q && (_.current = m.isPropagationStopped(), _.current || m.stopPropagation());
|
|
875
866
|
})
|
|
876
|
-
})),
|
|
867
|
+
})), q && /* @__PURE__ */ p(Pr, {
|
|
877
868
|
control: l,
|
|
878
869
|
bubbles: !_.current,
|
|
879
870
|
name: a,
|
|
@@ -885,11 +876,11 @@ const xr = [
|
|
|
885
876
|
transform: "translateX(-100%)"
|
|
886
877
|
}
|
|
887
878
|
}));
|
|
888
|
-
}),
|
|
889
|
-
const { __scopeCheckbox: t, forceMount: a, ...u } = e, r =
|
|
879
|
+
}), Cr = "CheckboxIndicator", kr = /* @__PURE__ */ g((e, n) => {
|
|
880
|
+
const { __scopeCheckbox: t, forceMount: a, ...u } = e, r = Nr(Cr, t);
|
|
890
881
|
return /* @__PURE__ */ p(le, {
|
|
891
882
|
present: a || S(r.state) || r.state === !0
|
|
892
|
-
}, /* @__PURE__ */ p(de.span,
|
|
883
|
+
}, /* @__PURE__ */ p(de.span, N({
|
|
893
884
|
"data-state": he(r.state),
|
|
894
885
|
"data-disabled": r.disabled ? "" : void 0
|
|
895
886
|
}, u, {
|
|
@@ -899,9 +890,9 @@ const xr = [
|
|
|
899
890
|
...e.style
|
|
900
891
|
}
|
|
901
892
|
})));
|
|
902
|
-
}),
|
|
893
|
+
}), Pr = (e) => {
|
|
903
894
|
const { control: n, checked: t, bubbles: a = !0, ...u } = e, r = $(null), o = hr(t), i = mr(n);
|
|
904
|
-
return
|
|
895
|
+
return C(() => {
|
|
905
896
|
const c = r.current, s = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(s, "checked").set;
|
|
906
897
|
if (o !== t && l) {
|
|
907
898
|
const f = new Event("click", {
|
|
@@ -913,7 +904,7 @@ const xr = [
|
|
|
913
904
|
o,
|
|
914
905
|
t,
|
|
915
906
|
a
|
|
916
|
-
]), /* @__PURE__ */ p("input",
|
|
907
|
+
]), /* @__PURE__ */ p("input", N({
|
|
917
908
|
type: "checkbox",
|
|
918
909
|
"aria-hidden": !0,
|
|
919
910
|
defaultChecked: S(t) ? !1 : t
|
|
@@ -936,8 +927,8 @@ function S(e) {
|
|
|
936
927
|
function he(e) {
|
|
937
928
|
return S(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
938
929
|
}
|
|
939
|
-
const
|
|
940
|
-
function
|
|
930
|
+
const Or = Sr, Ar = kr;
|
|
931
|
+
function jr(e) {
|
|
941
932
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
942
933
|
}
|
|
943
934
|
var me = { exports: {} };
|
|
@@ -976,8 +967,8 @@ var me = { exports: {} };
|
|
|
976
967
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
977
968
|
})();
|
|
978
969
|
})(me);
|
|
979
|
-
var
|
|
980
|
-
const
|
|
970
|
+
var Er = me.exports;
|
|
971
|
+
const Mr = /* @__PURE__ */ jr(Er), qr = {
|
|
981
972
|
"purpur-checkbox": "_purpur-checkbox_m4999_1",
|
|
982
973
|
"purpur-checkbox__box": "_purpur-checkbox__box_m4999_7",
|
|
983
974
|
"purpur-checkbox--error": "_purpur-checkbox--error_m4999_16",
|
|
@@ -986,7 +977,7 @@ const jr = /* @__PURE__ */ Er(Mr), Rr = {
|
|
|
986
977
|
"purpur-checkbox__label": "_purpur-checkbox__label_m4999_70",
|
|
987
978
|
"purpur-checkbox__wrapper": "_purpur-checkbox__wrapper_m4999_73",
|
|
988
979
|
"purpur-checkbox__container": "_purpur-checkbox__container_m4999_79"
|
|
989
|
-
},
|
|
980
|
+
}, k = Mr.bind(qr), Tr = ["indeterminate", !0, !1], y = "purpur-checkbox", Rr = ({
|
|
990
981
|
["data-testid"]: e,
|
|
991
982
|
checked: n,
|
|
992
983
|
className: t,
|
|
@@ -997,14 +988,14 @@ const jr = /* @__PURE__ */ Er(Mr), Rr = {
|
|
|
997
988
|
...i
|
|
998
989
|
}, c) => {
|
|
999
990
|
const s = u && !n, d = a && !n;
|
|
1000
|
-
return /* @__PURE__ */
|
|
1001
|
-
/* @__PURE__ */
|
|
991
|
+
return /* @__PURE__ */ I("div", { className: k([t, `${y}__wrapper`]), children: [
|
|
992
|
+
/* @__PURE__ */ I("div", { className: k([t, `${y}__container`]), children: [
|
|
1002
993
|
/* @__PURE__ */ h(
|
|
1003
|
-
|
|
994
|
+
Or,
|
|
1004
995
|
{
|
|
1005
996
|
...i,
|
|
1006
997
|
checked: n,
|
|
1007
|
-
className:
|
|
998
|
+
className: k([
|
|
1008
999
|
y,
|
|
1009
1000
|
{
|
|
1010
1001
|
[`${y}--error`]: s,
|
|
@@ -1014,19 +1005,19 @@ const jr = /* @__PURE__ */ Er(Mr), Rr = {
|
|
|
1014
1005
|
"data-testid": e,
|
|
1015
1006
|
onCheckedChange: o,
|
|
1016
1007
|
ref: c,
|
|
1017
|
-
children: /* @__PURE__ */ h("span", { className:
|
|
1008
|
+
children: /* @__PURE__ */ h("span", { className: k(`${y}__box`), children: /* @__PURE__ */ h(Ar, { className: k(`${y}__indicator`), children: n === "indeterminate" ? /* @__PURE__ */ h(
|
|
1018
1009
|
T,
|
|
1019
1010
|
{
|
|
1020
1011
|
"data-testid": e && `${e}-checked-icon`,
|
|
1021
1012
|
size: "xs",
|
|
1022
|
-
svg:
|
|
1013
|
+
svg: Ie
|
|
1023
1014
|
}
|
|
1024
1015
|
) : /* @__PURE__ */ h(
|
|
1025
1016
|
T,
|
|
1026
1017
|
{
|
|
1027
1018
|
"data-testid": e && `${e}-indeterminate-icon`,
|
|
1028
1019
|
size: "xs",
|
|
1029
|
-
svg:
|
|
1020
|
+
svg: Le
|
|
1030
1021
|
}
|
|
1031
1022
|
) }) })
|
|
1032
1023
|
}
|
|
@@ -1037,17 +1028,17 @@ const jr = /* @__PURE__ */ Er(Mr), Rr = {
|
|
|
1037
1028
|
htmlFor: i.id,
|
|
1038
1029
|
"data-testid": e && `${e}-label`,
|
|
1039
1030
|
disabled: i.disabled,
|
|
1040
|
-
className:
|
|
1031
|
+
className: k(`${y}__label`),
|
|
1041
1032
|
children: /* @__PURE__ */ h(ie, { variant: "paragraph-100", disabled: i.disabled, children: `${i.required ? "* " : ""}${r}` })
|
|
1042
1033
|
}
|
|
1043
1034
|
)
|
|
1044
1035
|
] }),
|
|
1045
|
-
s && /* @__PURE__ */ h(
|
|
1036
|
+
s && /* @__PURE__ */ h(qe, { "data-testid": e && `${e}-error-text`, children: u })
|
|
1046
1037
|
] });
|
|
1047
|
-
},
|
|
1048
|
-
|
|
1038
|
+
}, zr = g(Rr);
|
|
1039
|
+
zr.displayName = "Checkbox";
|
|
1049
1040
|
export {
|
|
1050
|
-
|
|
1041
|
+
zr as Checkbox,
|
|
1051
1042
|
Tr as checkedState
|
|
1052
1043
|
};
|
|
1053
1044
|
//# sourceMappingURL=checkbox.es.js.map
|