@purpurds/checkbox 6.12.4 → 7.0.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 +4 -4
- package/dist/checkbox.cjs.js +7 -7
- package/dist/checkbox.cjs.js.map +1 -1
- package/dist/checkbox.d.ts +8 -8
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.es.js +76 -76
- package/dist/checkbox.es.js.map +1 -1
- package/package.json +6 -6
- package/src/checkbox.test.tsx +7 -7
- package/src/checkbox.tsx +6 -5
package/dist/checkbox.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as k, jsx as p, Fragment as te } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import { forwardRef as _e } from "react";
|
|
4
4
|
import "react-dom";
|
|
@@ -45,7 +45,7 @@ function ye() {
|
|
|
45
45
|
}(W)), W.exports;
|
|
46
46
|
}
|
|
47
47
|
var xe = ye();
|
|
48
|
-
const we = /* @__PURE__ */ be(xe),
|
|
48
|
+
const we = /* @__PURE__ */ be(xe), Ce = {
|
|
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,7 +53,7 @@ const we = /* @__PURE__ */ be(xe), $e = {
|
|
|
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
|
-
},
|
|
56
|
+
}, Se = we.bind(Ce), I = "purpur-icon", $e = "md", Ne = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), ke = ({ 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" },
|
|
@@ -66,17 +66,16 @@ const we = /* @__PURE__ */ be(xe), $e = {
|
|
|
66
66
|
svg: n,
|
|
67
67
|
allyTitle: t,
|
|
68
68
|
className: i,
|
|
69
|
-
size: a =
|
|
69
|
+
size: a = $e,
|
|
70
70
|
...r
|
|
71
71
|
}) => {
|
|
72
72
|
const o = ke({
|
|
73
73
|
content: Pe(n.svg),
|
|
74
74
|
title: t
|
|
75
|
-
}), u =
|
|
75
|
+
}), u = Se(i, I, `${I}--${a}`);
|
|
76
76
|
return /* @__PURE__ */ p(
|
|
77
77
|
"span",
|
|
78
78
|
{
|
|
79
|
-
"aria-label": t,
|
|
80
79
|
className: u,
|
|
81
80
|
"data-testid": e,
|
|
82
81
|
dangerouslySetInnerHTML: { __html: o },
|
|
@@ -134,23 +133,23 @@ function Re() {
|
|
|
134
133
|
}(L)), L.exports;
|
|
135
134
|
}
|
|
136
135
|
var Ee = Re();
|
|
137
|
-
const Me = /* @__PURE__ */ Ae(Ee),
|
|
136
|
+
const Me = /* @__PURE__ */ Ae(Ee), U = {
|
|
138
137
|
"purpur-field-error-text": "_purpur-field-error-text_1lj7e_1",
|
|
139
138
|
"purpur-field-error-text__icon": "_purpur-field-error-text__icon_1lj7e_11"
|
|
140
|
-
},
|
|
139
|
+
}, V = "purpur-field-error-text", je = ({
|
|
141
140
|
children: e,
|
|
142
141
|
className: n,
|
|
143
|
-
relevant: t = "additions text",
|
|
142
|
+
["aria-relevant"]: t = "additions text",
|
|
144
143
|
...i
|
|
145
|
-
}) => /* @__PURE__ */
|
|
144
|
+
}) => /* @__PURE__ */ k(
|
|
146
145
|
"div",
|
|
147
146
|
{
|
|
148
|
-
className: Me([n,
|
|
147
|
+
className: Me([n, U[V]]),
|
|
149
148
|
"aria-live": "assertive",
|
|
150
149
|
"aria-relevant": t,
|
|
151
150
|
...i,
|
|
152
151
|
children: [
|
|
153
|
-
/* @__PURE__ */ p(ne, { svg: Oe, size: "xs", className:
|
|
152
|
+
/* @__PURE__ */ p(ne, { svg: Oe, size: "xs", className: U[`${V}__icon`] }),
|
|
154
153
|
e
|
|
155
154
|
]
|
|
156
155
|
}
|
|
@@ -158,7 +157,7 @@ const Me = /* @__PURE__ */ Ae(Ee), F = {
|
|
|
158
157
|
function De(e) {
|
|
159
158
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
160
159
|
}
|
|
161
|
-
var
|
|
160
|
+
var F = { exports: {} };
|
|
162
161
|
/*!
|
|
163
162
|
Copyright (c) 2018 Jed Watson.
|
|
164
163
|
Licensed under the MIT License (MIT), see
|
|
@@ -195,7 +194,7 @@ function qe() {
|
|
|
195
194
|
}
|
|
196
195
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
197
196
|
})();
|
|
198
|
-
}(
|
|
197
|
+
}(F)), F.exports;
|
|
199
198
|
}
|
|
200
199
|
var ze = qe();
|
|
201
200
|
const We = /* @__PURE__ */ De(ze), Be = {
|
|
@@ -206,7 +205,7 @@ const We = /* @__PURE__ */ De(ze), Be = {
|
|
|
206
205
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
207
206
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
208
207
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
209
|
-
}, Ie = We.bind(Be), H = "purpur-icon", Le = "md", Te = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "),
|
|
208
|
+
}, Ie = We.bind(Be), H = "purpur-icon", Le = "md", Te = (e) => e.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Ue = ({ content: e = "", title: n } = {}) => {
|
|
210
209
|
const t = [
|
|
211
210
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
212
211
|
{ name: "fill", value: "currentColor" },
|
|
@@ -214,7 +213,7 @@ const We = /* @__PURE__ */ De(ze), Be = {
|
|
|
214
213
|
n ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
215
214
|
], i = n ? `<title>${n}</title>` : "";
|
|
216
215
|
return `<svg ${Te(t)}>${i}${e}</svg>`;
|
|
217
|
-
},
|
|
216
|
+
}, Ve = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), M = ({
|
|
218
217
|
["data-testid"]: e,
|
|
219
218
|
svg: n,
|
|
220
219
|
allyTitle: t,
|
|
@@ -222,14 +221,13 @@ const We = /* @__PURE__ */ De(ze), Be = {
|
|
|
222
221
|
size: a = Le,
|
|
223
222
|
...r
|
|
224
223
|
}) => {
|
|
225
|
-
const o =
|
|
226
|
-
content:
|
|
224
|
+
const o = Ue({
|
|
225
|
+
content: Ve(n.svg),
|
|
227
226
|
title: t
|
|
228
227
|
}), u = Ie(i, H, `${H}--${a}`);
|
|
229
228
|
return /* @__PURE__ */ p(
|
|
230
229
|
"span",
|
|
231
230
|
{
|
|
232
|
-
"aria-label": t,
|
|
233
231
|
className: u,
|
|
234
232
|
"data-testid": e,
|
|
235
233
|
dangerouslySetInnerHTML: { __html: o },
|
|
@@ -238,7 +236,7 @@ const We = /* @__PURE__ */ De(ze), Be = {
|
|
|
238
236
|
);
|
|
239
237
|
};
|
|
240
238
|
M.displayName = "Icon";
|
|
241
|
-
const
|
|
239
|
+
const Fe = {
|
|
242
240
|
name: "checkmark-bold",
|
|
243
241
|
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>',
|
|
244
242
|
keywords: ["checkmark-bold"],
|
|
@@ -393,20 +391,19 @@ const ir = /* @__PURE__ */ tr(or), A = {
|
|
|
393
391
|
}, R = "purpur-label", ar = ({
|
|
394
392
|
children: e,
|
|
395
393
|
className: n,
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
...r
|
|
394
|
+
disabled: t,
|
|
395
|
+
negative: i = !1,
|
|
396
|
+
...a
|
|
400
397
|
}) => {
|
|
401
|
-
const
|
|
398
|
+
const r = ir([
|
|
402
399
|
n,
|
|
403
400
|
A[R],
|
|
404
401
|
{
|
|
405
|
-
[A[`${R}--disabled`]]:
|
|
406
|
-
[A[`${R}--negative`]]:
|
|
402
|
+
[A[`${R}--disabled`]]: t,
|
|
403
|
+
[A[`${R}--negative`]]: i
|
|
407
404
|
}
|
|
408
405
|
]);
|
|
409
|
-
return /* @__PURE__ */ p(rr, { className:
|
|
406
|
+
return /* @__PURE__ */ p(rr, { className: r, ...a, children: e });
|
|
410
407
|
};
|
|
411
408
|
function ur(e) {
|
|
412
409
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -451,7 +448,7 @@ function sr() {
|
|
|
451
448
|
}(J)), J.exports;
|
|
452
449
|
}
|
|
453
450
|
var cr = sr();
|
|
454
|
-
const lr = /* @__PURE__ */ ur(cr),
|
|
451
|
+
const lr = /* @__PURE__ */ ur(cr), $ = {
|
|
455
452
|
"purpur-paragraph": "_purpur-paragraph_1rh57_1",
|
|
456
453
|
"purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
|
|
457
454
|
"purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
|
|
@@ -480,12 +477,12 @@ const lr = /* @__PURE__ */ ur(cr), S = {
|
|
|
480
477
|
}) => {
|
|
481
478
|
const c = lr([
|
|
482
479
|
t,
|
|
483
|
-
|
|
484
|
-
|
|
480
|
+
$[N],
|
|
481
|
+
$[`${N}--${o}`],
|
|
485
482
|
{
|
|
486
|
-
[
|
|
487
|
-
[
|
|
488
|
-
[
|
|
483
|
+
[$[`${N}--hyphens`]]: a,
|
|
484
|
+
[$[`${N}--disabled`]]: i,
|
|
485
|
+
[$[`${N}--negative`]]: r
|
|
489
486
|
}
|
|
490
487
|
]);
|
|
491
488
|
return /* @__PURE__ */ p("p", { ...u, className: c, "data-testid": e, children: n });
|
|
@@ -522,14 +519,14 @@ function dr(e, n = []) {
|
|
|
522
519
|
t = [...t, o];
|
|
523
520
|
const l = (h) => {
|
|
524
521
|
var b;
|
|
525
|
-
const { scope: d, children: m, ...
|
|
522
|
+
const { scope: d, children: m, ...v } = h, _ = ((b = d == null ? void 0 : d[e]) == null ? void 0 : b[c]) || u, w = s.useMemo(() => v, Object.values(v));
|
|
526
523
|
return /* @__PURE__ */ p(_.Provider, { value: w, children: m });
|
|
527
524
|
};
|
|
528
525
|
l.displayName = r + "Provider";
|
|
529
526
|
function f(h, d) {
|
|
530
527
|
var _;
|
|
531
|
-
const m = ((_ = d == null ? void 0 : d[e]) == null ? void 0 : _[c]) || u,
|
|
532
|
-
if (
|
|
528
|
+
const m = ((_ = d == null ? void 0 : d[e]) == null ? void 0 : _[c]) || u, v = s.useContext(m);
|
|
529
|
+
if (v) return v;
|
|
533
530
|
if (o !== void 0) return o;
|
|
534
531
|
throw new Error(`\`${h}\` must be used within \`${r}\``);
|
|
535
532
|
}
|
|
@@ -607,13 +604,13 @@ function mr({
|
|
|
607
604
|
a.current !== i && (r(i), a.current = i);
|
|
608
605
|
}, [i, a, r]), t;
|
|
609
606
|
}
|
|
610
|
-
function
|
|
607
|
+
function vr(e) {
|
|
611
608
|
const n = s.useRef({ value: e, previous: e });
|
|
612
609
|
return s.useMemo(() => (n.current.value !== e && (n.current.previous = n.current.value, n.current.value = e), n.current.previous), [e]);
|
|
613
610
|
}
|
|
614
611
|
var D = globalThis != null && globalThis.document ? s.useLayoutEffect : () => {
|
|
615
612
|
};
|
|
616
|
-
function
|
|
613
|
+
function gr(e) {
|
|
617
614
|
const [n, t] = s.useState(void 0);
|
|
618
615
|
return D(() => {
|
|
619
616
|
if (e) {
|
|
@@ -658,19 +655,19 @@ function br(e) {
|
|
|
658
655
|
}
|
|
659
656
|
});
|
|
660
657
|
return s.useEffect(() => {
|
|
661
|
-
const l =
|
|
658
|
+
const l = P(i.current);
|
|
662
659
|
r.current = u === "mounted" ? l : "none";
|
|
663
660
|
}, [u]), D(() => {
|
|
664
661
|
const l = i.current, f = a.current;
|
|
665
662
|
if (f !== e) {
|
|
666
|
-
const d = r.current, m =
|
|
663
|
+
const d = r.current, m = P(l);
|
|
667
664
|
e ? c("MOUNT") : m === "none" || (l == null ? void 0 : l.display) === "none" ? c("UNMOUNT") : c(f && d !== m ? "ANIMATION_OUT" : "UNMOUNT"), a.current = e;
|
|
668
665
|
}
|
|
669
666
|
}, [e, c]), D(() => {
|
|
670
667
|
if (n) {
|
|
671
668
|
let l;
|
|
672
669
|
const f = n.ownerDocument.defaultView ?? window, h = (m) => {
|
|
673
|
-
const _ =
|
|
670
|
+
const _ = P(i.current).includes(m.animationName);
|
|
674
671
|
if (m.target === n && _ && (c("ANIMATION_END"), !a.current)) {
|
|
675
672
|
const w = n.style.animationFillMode;
|
|
676
673
|
n.style.animationFillMode = "forwards", l = f.setTimeout(() => {
|
|
@@ -678,7 +675,7 @@ function br(e) {
|
|
|
678
675
|
});
|
|
679
676
|
}
|
|
680
677
|
}, d = (m) => {
|
|
681
|
-
m.target === n && (r.current =
|
|
678
|
+
m.target === n && (r.current = P(i.current));
|
|
682
679
|
};
|
|
683
680
|
return n.addEventListener("animationstart", d), n.addEventListener("animationcancel", h), n.addEventListener("animationend", h), () => {
|
|
684
681
|
f.clearTimeout(l), n.removeEventListener("animationstart", d), n.removeEventListener("animationcancel", h), n.removeEventListener("animationend", h);
|
|
@@ -692,7 +689,7 @@ function br(e) {
|
|
|
692
689
|
}, [])
|
|
693
690
|
};
|
|
694
691
|
}
|
|
695
|
-
function
|
|
692
|
+
function P(e) {
|
|
696
693
|
return (e == null ? void 0 : e.animationName) || "none";
|
|
697
694
|
}
|
|
698
695
|
function yr(e) {
|
|
@@ -712,7 +709,7 @@ pe.displayName = "Slot";
|
|
|
712
709
|
var q = s.forwardRef((e, n) => {
|
|
713
710
|
const { children: t, ...i } = e;
|
|
714
711
|
if (s.isValidElement(t)) {
|
|
715
|
-
const a =
|
|
712
|
+
const a = Sr(t), r = Cr(i, t.props);
|
|
716
713
|
return t.type !== s.Fragment && (r.ref = n ? ue(n, a) : a), s.cloneElement(t, r);
|
|
717
714
|
}
|
|
718
715
|
return s.Children.count(t) > 1 ? s.Children.only(null) : null;
|
|
@@ -722,7 +719,7 @@ var xr = ({ children: e }) => /* @__PURE__ */ p(te, { children: e });
|
|
|
722
719
|
function wr(e) {
|
|
723
720
|
return s.isValidElement(e) && e.type === xr;
|
|
724
721
|
}
|
|
725
|
-
function
|
|
722
|
+
function Cr(e, n) {
|
|
726
723
|
const t = { ...n };
|
|
727
724
|
for (const i in n) {
|
|
728
725
|
const a = e[i], r = n[i];
|
|
@@ -732,12 +729,12 @@ function $r(e, n) {
|
|
|
732
729
|
}
|
|
733
730
|
return { ...e, ...t };
|
|
734
731
|
}
|
|
735
|
-
function
|
|
732
|
+
function Sr(e) {
|
|
736
733
|
var i, a;
|
|
737
734
|
let n = (i = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : i.get, t = n && "isReactWarning" in n && n.isReactWarning;
|
|
738
735
|
return t ? e.ref : (n = (a = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : a.get, t = n && "isReactWarning" in n && n.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
|
|
739
736
|
}
|
|
740
|
-
var
|
|
737
|
+
var $r = [
|
|
741
738
|
"a",
|
|
742
739
|
"button",
|
|
743
740
|
"div",
|
|
@@ -754,7 +751,7 @@ var Sr = [
|
|
|
754
751
|
"span",
|
|
755
752
|
"svg",
|
|
756
753
|
"ul"
|
|
757
|
-
], de =
|
|
754
|
+
], de = $r.reduce((e, n) => {
|
|
758
755
|
const t = s.forwardRef((i, a) => {
|
|
759
756
|
const { asChild: r, ...o } = i, u = r ? pe : n;
|
|
760
757
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ p(u, { ...o, ref: a });
|
|
@@ -773,18 +770,18 @@ var Sr = [
|
|
|
773
770
|
onCheckedChange: l,
|
|
774
771
|
form: f,
|
|
775
772
|
...h
|
|
776
|
-
} = e, [d, m] = s.useState(null),
|
|
773
|
+
} = e, [d, m] = s.useState(null), v = se(n, (g) => m(g)), _ = s.useRef(!1), w = d ? f || !!d.closest("form") : !0, [b = !1, O] = hr({
|
|
777
774
|
prop: a,
|
|
778
775
|
defaultProp: r,
|
|
779
776
|
onChange: l
|
|
780
|
-
}),
|
|
777
|
+
}), ge = s.useRef(b);
|
|
781
778
|
return s.useEffect(() => {
|
|
782
|
-
const
|
|
783
|
-
if (
|
|
784
|
-
const
|
|
785
|
-
return
|
|
779
|
+
const g = d == null ? void 0 : d.form;
|
|
780
|
+
if (g) {
|
|
781
|
+
const S = () => O(ge.current);
|
|
782
|
+
return g.addEventListener("reset", S), () => g.removeEventListener("reset", S);
|
|
786
783
|
}
|
|
787
|
-
}, [d, O]), /* @__PURE__ */
|
|
784
|
+
}, [d, O]), /* @__PURE__ */ k(kr, { scope: t, state: b, disabled: u, children: [
|
|
788
785
|
/* @__PURE__ */ p(
|
|
789
786
|
de.button,
|
|
790
787
|
{
|
|
@@ -792,17 +789,17 @@ var Sr = [
|
|
|
792
789
|
role: "checkbox",
|
|
793
790
|
"aria-checked": x(b) ? "mixed" : b,
|
|
794
791
|
"aria-required": o,
|
|
795
|
-
"data-state":
|
|
792
|
+
"data-state": ve(b),
|
|
796
793
|
"data-disabled": u ? "" : void 0,
|
|
797
794
|
disabled: u,
|
|
798
795
|
value: c,
|
|
799
796
|
...h,
|
|
800
|
-
ref:
|
|
801
|
-
onKeyDown: ee(e.onKeyDown, (
|
|
802
|
-
|
|
797
|
+
ref: v,
|
|
798
|
+
onKeyDown: ee(e.onKeyDown, (g) => {
|
|
799
|
+
g.key === "Enter" && g.preventDefault();
|
|
803
800
|
}),
|
|
804
|
-
onClick: ee(e.onClick, (
|
|
805
|
-
O((
|
|
801
|
+
onClick: ee(e.onClick, (g) => {
|
|
802
|
+
O((S) => x(S) ? !0 : !S), w && (_.current = g.isPropagationStopped(), _.current || g.stopPropagation());
|
|
806
803
|
})
|
|
807
804
|
}
|
|
808
805
|
),
|
|
@@ -831,7 +828,7 @@ var he = "CheckboxIndicator", me = s.forwardRef(
|
|
|
831
828
|
return /* @__PURE__ */ p(le, { present: i || x(r.state) || r.state === !0, children: /* @__PURE__ */ p(
|
|
832
829
|
de.span,
|
|
833
830
|
{
|
|
834
|
-
"data-state":
|
|
831
|
+
"data-state": ve(r.state),
|
|
835
832
|
"data-disabled": r.disabled ? "" : void 0,
|
|
836
833
|
...a,
|
|
837
834
|
ref: n,
|
|
@@ -842,12 +839,12 @@ var he = "CheckboxIndicator", me = s.forwardRef(
|
|
|
842
839
|
);
|
|
843
840
|
me.displayName = he;
|
|
844
841
|
var Or = (e) => {
|
|
845
|
-
const { control: n, checked: t, bubbles: i = !0, defaultChecked: a, ...r } = e, o = s.useRef(null), u =
|
|
842
|
+
const { control: n, checked: t, bubbles: i = !0, defaultChecked: a, ...r } = e, o = s.useRef(null), u = vr(t), c = gr(n);
|
|
846
843
|
s.useEffect(() => {
|
|
847
844
|
const f = o.current, h = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(h, "checked").set;
|
|
848
845
|
if (u !== t && m) {
|
|
849
|
-
const
|
|
850
|
-
f.indeterminate = x(t), m.call(f, x(t) ? !1 : t), f.dispatchEvent(
|
|
846
|
+
const v = new Event("click", { bubbles: i });
|
|
847
|
+
f.indeterminate = x(t), m.call(f, x(t) ? !1 : t), f.dispatchEvent(v);
|
|
851
848
|
}
|
|
852
849
|
}, [u, t, i]);
|
|
853
850
|
const l = s.useRef(x(t) ? !1 : t);
|
|
@@ -874,7 +871,7 @@ var Or = (e) => {
|
|
|
874
871
|
function x(e) {
|
|
875
872
|
return e === "indeterminate";
|
|
876
873
|
}
|
|
877
|
-
function
|
|
874
|
+
function ve(e) {
|
|
878
875
|
return x(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
879
876
|
}
|
|
880
877
|
var Ar = fe, Rr = me;
|
|
@@ -930,7 +927,7 @@ const Dr = /* @__PURE__ */ Er(jr), qr = {
|
|
|
930
927
|
"purpur-checkbox__label": "_purpur-checkbox__label_m4999_70",
|
|
931
928
|
"purpur-checkbox__wrapper": "_purpur-checkbox__wrapper_m4999_73",
|
|
932
929
|
"purpur-checkbox__container": "_purpur-checkbox__container_m4999_79"
|
|
933
|
-
},
|
|
930
|
+
}, C = Dr.bind(qr), Ur = ["indeterminate", !0, !1], y = "purpur-checkbox", zr = ({
|
|
934
931
|
["data-testid"]: e,
|
|
935
932
|
checked: n,
|
|
936
933
|
className: t,
|
|
@@ -941,14 +938,14 @@ const Dr = /* @__PURE__ */ Er(jr), qr = {
|
|
|
941
938
|
...u
|
|
942
939
|
}, c) => {
|
|
943
940
|
const l = a && !n, f = i && !n;
|
|
944
|
-
return /* @__PURE__ */
|
|
945
|
-
/* @__PURE__ */
|
|
941
|
+
return /* @__PURE__ */ k("div", { className: C([t, `${y}__wrapper`]), children: [
|
|
942
|
+
/* @__PURE__ */ k("div", { className: C([t, `${y}__container`]), children: [
|
|
946
943
|
/* @__PURE__ */ p(
|
|
947
944
|
Ar,
|
|
948
945
|
{
|
|
949
946
|
...u,
|
|
950
947
|
checked: n,
|
|
951
|
-
className:
|
|
948
|
+
className: C([
|
|
952
949
|
y,
|
|
953
950
|
{
|
|
954
951
|
[`${y}--error`]: l,
|
|
@@ -958,7 +955,7 @@ const Dr = /* @__PURE__ */ Er(jr), qr = {
|
|
|
958
955
|
"data-testid": e,
|
|
959
956
|
onCheckedChange: o,
|
|
960
957
|
ref: c,
|
|
961
|
-
children: /* @__PURE__ */ p("span", { className:
|
|
958
|
+
children: /* @__PURE__ */ p("span", { className: C(`${y}__box`), children: /* @__PURE__ */ p(Rr, { className: C(`${y}__indicator`), children: n === "indeterminate" ? /* @__PURE__ */ p(
|
|
962
959
|
M,
|
|
963
960
|
{
|
|
964
961
|
"data-testid": e && `${e}-checked-icon`,
|
|
@@ -970,7 +967,7 @@ const Dr = /* @__PURE__ */ Er(jr), qr = {
|
|
|
970
967
|
{
|
|
971
968
|
"data-testid": e && `${e}-indeterminate-icon`,
|
|
972
969
|
size: "xs",
|
|
973
|
-
svg:
|
|
970
|
+
svg: Fe
|
|
974
971
|
}
|
|
975
972
|
) }) })
|
|
976
973
|
}
|
|
@@ -981,8 +978,11 @@ const Dr = /* @__PURE__ */ Er(jr), qr = {
|
|
|
981
978
|
htmlFor: u.id,
|
|
982
979
|
"data-testid": e && `${e}-label`,
|
|
983
980
|
disabled: u.disabled,
|
|
984
|
-
className:
|
|
985
|
-
children: /* @__PURE__ */
|
|
981
|
+
className: C(`${y}__label`),
|
|
982
|
+
children: /* @__PURE__ */ k(ae, { variant: "paragraph-100", disabled: u.disabled, children: [
|
|
983
|
+
u.required && /* @__PURE__ */ p("span", { "aria-hidden": !0, children: "* " }),
|
|
984
|
+
r
|
|
985
|
+
] })
|
|
986
986
|
}
|
|
987
987
|
)
|
|
988
988
|
] }),
|
|
@@ -992,6 +992,6 @@ const Dr = /* @__PURE__ */ Er(jr), qr = {
|
|
|
992
992
|
Wr.displayName = "Checkbox";
|
|
993
993
|
export {
|
|
994
994
|
Wr as Checkbox,
|
|
995
|
-
|
|
995
|
+
Ur as checkedState
|
|
996
996
|
};
|
|
997
997
|
//# sourceMappingURL=checkbox.es.js.map
|