@purpurds/checkbox 7.6.1 → 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/LICENSE.txt +5 -5
- package/dist/checkbox.cjs.js +8 -8
- package/dist/checkbox.cjs.js.map +1 -1
- package/dist/checkbox.d.ts +3 -59
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.es.js +284 -326
- package/dist/checkbox.es.js.map +1 -1
- package/package.json +8 -7
- package/src/checkbox.tsx +87 -86
package/dist/checkbox.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as S, jsx as p, Fragment as
|
|
1
|
+
import { jsxs as S, jsx as p, Fragment as ne } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { forwardRef as
|
|
3
|
+
import { forwardRef as be } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
function
|
|
5
|
+
function ye(r) {
|
|
6
6
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
7
7
|
}
|
|
8
|
-
var
|
|
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
|
|
15
|
-
function
|
|
16
|
-
return
|
|
14
|
+
var z;
|
|
15
|
+
function xe() {
|
|
16
|
+
return z || (z = 1, function(r) {
|
|
17
17
|
(function() {
|
|
18
18
|
var n = {}.hasOwnProperty;
|
|
19
19
|
function t() {
|
|
@@ -42,10 +42,10 @@ function Se() {
|
|
|
42
42
|
}
|
|
43
43
|
r.exports ? (t.default = t, r.exports = t) : window.classNames = t;
|
|
44
44
|
})();
|
|
45
|
-
}(
|
|
45
|
+
}(q)), q.exports;
|
|
46
46
|
}
|
|
47
|
-
var
|
|
48
|
-
const
|
|
47
|
+
var we = xe();
|
|
48
|
+
const $e = /* @__PURE__ */ ye(we), Se = {
|
|
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,76 +53,61 @@ const Ne = /* @__PURE__ */ $e(Ce), ke = {
|
|
|
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
|
+
}, Ne = $e.bind(Se), B = "purpur-icon", Ce = "md", ke = (r) => r.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Oe = ({ content: r = "", 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
62
|
], i = n ? `<title>${n}</title>` : "";
|
|
63
|
-
return `<svg ${
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
...e
|
|
71
|
-
}) => {
|
|
72
|
-
const o = Re({
|
|
73
|
-
content: Ee(n.svg),
|
|
74
|
-
title: t
|
|
75
|
-
}), u = Oe(i, I, `${I}--${a}`);
|
|
76
|
-
return /* @__PURE__ */ p(
|
|
77
|
-
"span",
|
|
78
|
-
{
|
|
79
|
-
className: u,
|
|
80
|
-
"data-testid": r,
|
|
81
|
-
dangerouslySetInnerHTML: { __html: o },
|
|
82
|
-
...e
|
|
83
|
-
}
|
|
84
|
-
);
|
|
63
|
+
return `<svg ${ke(t)}>${i}${r}</svg>`;
|
|
64
|
+
}, Pe = (r) => r.replace(/<(\/?)svg([^>]*)>/g, "").trim(), oe = ({ svg: r, allyTitle: n, className: t, size: i = Ce, ...a }) => {
|
|
65
|
+
const e = Oe({
|
|
66
|
+
content: Pe(r.svg),
|
|
67
|
+
title: n
|
|
68
|
+
}), o = Ne(t, B, `${B}--${i}`);
|
|
69
|
+
return /* @__PURE__ */ p("span", { className: o, dangerouslySetInnerHTML: { __html: e }, ...a });
|
|
85
70
|
};
|
|
86
|
-
|
|
87
|
-
const
|
|
71
|
+
oe.displayName = "Icon";
|
|
72
|
+
const Ae = {
|
|
88
73
|
name: "error-filled",
|
|
89
74
|
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>',
|
|
90
75
|
keywords: ["error-filled"],
|
|
91
76
|
category: "status"
|
|
92
77
|
};
|
|
93
|
-
function
|
|
78
|
+
function Re(r) {
|
|
94
79
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
95
80
|
}
|
|
96
|
-
var
|
|
81
|
+
var W = { exports: {} };
|
|
97
82
|
/*!
|
|
98
83
|
Copyright (c) 2018 Jed Watson.
|
|
99
84
|
Licensed under the MIT License (MIT), see
|
|
100
85
|
http://jedwatson.github.io/classnames
|
|
101
86
|
*/
|
|
102
|
-
var
|
|
103
|
-
function
|
|
104
|
-
return
|
|
87
|
+
var I;
|
|
88
|
+
function Ee() {
|
|
89
|
+
return I || (I = 1, function(r) {
|
|
105
90
|
(function() {
|
|
106
91
|
var n = {}.hasOwnProperty;
|
|
107
92
|
function t() {
|
|
108
93
|
for (var e = "", o = 0; o < arguments.length; o++) {
|
|
109
94
|
var u = arguments[o];
|
|
110
|
-
u && (e = a(e, i(u)));
|
|
95
|
+
u && (e = a(e, i.call(this, u)));
|
|
111
96
|
}
|
|
112
97
|
return e;
|
|
113
98
|
}
|
|
114
99
|
function i(e) {
|
|
115
100
|
if (typeof e == "string" || typeof e == "number")
|
|
116
|
-
return e;
|
|
101
|
+
return this && this[e] || e;
|
|
117
102
|
if (typeof e != "object")
|
|
118
103
|
return "";
|
|
119
104
|
if (Array.isArray(e))
|
|
120
|
-
return t.apply(
|
|
105
|
+
return t.apply(this, e);
|
|
121
106
|
if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
|
|
122
107
|
return e.toString();
|
|
123
108
|
var o = "";
|
|
124
109
|
for (var u in e)
|
|
125
|
-
n.call(e, u) && e[u] && (o = a(o, u));
|
|
110
|
+
n.call(e, u) && e[u] && (o = a(o, this && this[u] || u));
|
|
126
111
|
return o;
|
|
127
112
|
}
|
|
128
113
|
function a(e, o) {
|
|
@@ -130,13 +115,13 @@ function De() {
|
|
|
130
115
|
}
|
|
131
116
|
r.exports ? (t.default = t, r.exports = t) : window.classNames = t;
|
|
132
117
|
})();
|
|
133
|
-
}(
|
|
118
|
+
}(W)), W.exports;
|
|
134
119
|
}
|
|
135
|
-
var
|
|
136
|
-
const
|
|
120
|
+
var je = Ee();
|
|
121
|
+
const Me = /* @__PURE__ */ Re(je), De = {
|
|
137
122
|
"purpur-field-error-text": "_purpur-field-error-text_1lj7e_1",
|
|
138
123
|
"purpur-field-error-text__icon": "_purpur-field-error-text__icon_1lj7e_11"
|
|
139
|
-
},
|
|
124
|
+
}, L = Me.bind(De), U = "purpur-field-error-text", qe = ({
|
|
140
125
|
children: r,
|
|
141
126
|
className: n,
|
|
142
127
|
["aria-relevant"]: t = "additions text",
|
|
@@ -144,49 +129,49 @@ const ze = /* @__PURE__ */ Me(qe), V = {
|
|
|
144
129
|
}) => /* @__PURE__ */ S(
|
|
145
130
|
"div",
|
|
146
131
|
{
|
|
147
|
-
className:
|
|
132
|
+
className: L(n, U),
|
|
148
133
|
"aria-live": "assertive",
|
|
149
134
|
"aria-relevant": t,
|
|
150
135
|
...i,
|
|
151
136
|
children: [
|
|
152
|
-
/* @__PURE__ */ p(
|
|
137
|
+
/* @__PURE__ */ p(oe, { svg: Ae, size: "xs", className: L(`${U}__icon`) }),
|
|
153
138
|
r
|
|
154
139
|
]
|
|
155
140
|
}
|
|
156
141
|
);
|
|
157
|
-
function
|
|
142
|
+
function ze(r) {
|
|
158
143
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
159
144
|
}
|
|
160
|
-
var
|
|
145
|
+
var V = { exports: {} };
|
|
161
146
|
/*!
|
|
162
147
|
Copyright (c) 2018 Jed Watson.
|
|
163
148
|
Licensed under the MIT License (MIT), see
|
|
164
149
|
http://jedwatson.github.io/classnames
|
|
165
150
|
*/
|
|
166
|
-
var
|
|
167
|
-
function
|
|
168
|
-
return
|
|
151
|
+
var F;
|
|
152
|
+
function Be() {
|
|
153
|
+
return F || (F = 1, function(r) {
|
|
169
154
|
(function() {
|
|
170
155
|
var n = {}.hasOwnProperty;
|
|
171
156
|
function t() {
|
|
172
157
|
for (var e = "", o = 0; o < arguments.length; o++) {
|
|
173
158
|
var u = arguments[o];
|
|
174
|
-
u && (e = a(e, i(u)));
|
|
159
|
+
u && (e = a(e, i.call(this, u)));
|
|
175
160
|
}
|
|
176
161
|
return e;
|
|
177
162
|
}
|
|
178
163
|
function i(e) {
|
|
179
164
|
if (typeof e == "string" || typeof e == "number")
|
|
180
|
-
return e;
|
|
165
|
+
return this && this[e] || e;
|
|
181
166
|
if (typeof e != "object")
|
|
182
167
|
return "";
|
|
183
168
|
if (Array.isArray(e))
|
|
184
|
-
return t.apply(
|
|
169
|
+
return t.apply(this, e);
|
|
185
170
|
if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
|
|
186
171
|
return e.toString();
|
|
187
172
|
var o = "";
|
|
188
173
|
for (var u in e)
|
|
189
|
-
n.call(e, u) && e[u] && (o = a(o, u));
|
|
174
|
+
n.call(e, u) && e[u] && (o = a(o, this && this[u] || u));
|
|
190
175
|
return o;
|
|
191
176
|
}
|
|
192
177
|
function a(e, o) {
|
|
@@ -194,40 +179,36 @@ function Ie() {
|
|
|
194
179
|
}
|
|
195
180
|
r.exports ? (t.default = t, r.exports = t) : window.classNames = t;
|
|
196
181
|
})();
|
|
197
|
-
}(
|
|
182
|
+
}(V)), V.exports;
|
|
198
183
|
}
|
|
199
|
-
var
|
|
200
|
-
const
|
|
184
|
+
var We = Be();
|
|
185
|
+
const Ie = /* @__PURE__ */ ze(We), Le = {
|
|
201
186
|
"purpur-field-helper-text": "_purpur-field-helper-text_atw6b_1",
|
|
202
187
|
"purpur-field-helper-text--disabled": "_purpur-field-helper-text--disabled_atw6b_9"
|
|
203
|
-
},
|
|
188
|
+
}, Ue = Ie.bind(Le), T = "purpur-field-helper-text", Ve = ({
|
|
204
189
|
children: r,
|
|
205
190
|
className: n,
|
|
206
191
|
disabled: t,
|
|
207
192
|
id: i,
|
|
208
193
|
...a
|
|
209
194
|
}) => {
|
|
210
|
-
const e = Ue(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
{
|
|
214
|
-
[H[`${K}--disabled`]]: t
|
|
215
|
-
}
|
|
216
|
-
]);
|
|
195
|
+
const e = Ue(n, T, {
|
|
196
|
+
[`${T}--disabled`]: t
|
|
197
|
+
});
|
|
217
198
|
return /* @__PURE__ */ p("span", { id: i, className: e, ...a, children: r });
|
|
218
199
|
};
|
|
219
200
|
function Fe(r) {
|
|
220
201
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
221
202
|
}
|
|
222
|
-
var
|
|
203
|
+
var Z = { exports: {} };
|
|
223
204
|
/*!
|
|
224
205
|
Copyright (c) 2018 Jed Watson.
|
|
225
206
|
Licensed under the MIT License (MIT), see
|
|
226
207
|
http://jedwatson.github.io/classnames
|
|
227
208
|
*/
|
|
228
|
-
var
|
|
209
|
+
var H;
|
|
229
210
|
function Te() {
|
|
230
|
-
return
|
|
211
|
+
return H || (H = 1, function(r) {
|
|
231
212
|
(function() {
|
|
232
213
|
var n = {}.hasOwnProperty;
|
|
233
214
|
function t() {
|
|
@@ -256,7 +237,7 @@ function Te() {
|
|
|
256
237
|
}
|
|
257
238
|
r.exports ? (t.default = t, r.exports = t) : window.classNames = t;
|
|
258
239
|
})();
|
|
259
|
-
}(
|
|
240
|
+
}(Z)), Z.exports;
|
|
260
241
|
}
|
|
261
242
|
var Ze = Te();
|
|
262
243
|
const He = /* @__PURE__ */ Fe(Ze), Ke = {
|
|
@@ -267,7 +248,7 @@ const He = /* @__PURE__ */ Fe(Ze), Ke = {
|
|
|
267
248
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
268
249
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
269
250
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
270
|
-
}, Ge = He.bind(Ke),
|
|
251
|
+
}, Ge = He.bind(Ke), K = "purpur-icon", Xe = "md", Je = (r) => r.filter((n) => Object.keys(n).length >= 1).map((n) => `${n.name}="${n.value}"`).join(" "), Qe = ({ content: r = "", title: n } = {}) => {
|
|
271
252
|
const t = [
|
|
272
253
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
273
254
|
{ name: "fill", value: "currentColor" },
|
|
@@ -275,29 +256,14 @@ const He = /* @__PURE__ */ Fe(Ze), Ke = {
|
|
|
275
256
|
n ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
276
257
|
], i = n ? `<title>${n}</title>` : "";
|
|
277
258
|
return `<svg ${Je(t)}>${i}${r}</svg>`;
|
|
278
|
-
}, Ye = (r) => r.replace(/<(\/?)svg([^>]*)>/g, "").trim(),
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
...e
|
|
285
|
-
}) => {
|
|
286
|
-
const o = Qe({
|
|
287
|
-
content: Ye(n.svg),
|
|
288
|
-
title: t
|
|
289
|
-
}), u = Ge(i, J, `${J}--${a}`);
|
|
290
|
-
return /* @__PURE__ */ p(
|
|
291
|
-
"span",
|
|
292
|
-
{
|
|
293
|
-
className: u,
|
|
294
|
-
"data-testid": r,
|
|
295
|
-
dangerouslySetInnerHTML: { __html: o },
|
|
296
|
-
...e
|
|
297
|
-
}
|
|
298
|
-
);
|
|
259
|
+
}, Ye = (r) => r.replace(/<(\/?)svg([^>]*)>/g, "").trim(), R = ({ svg: r, allyTitle: n, className: t, size: i = Xe, ...a }) => {
|
|
260
|
+
const e = Qe({
|
|
261
|
+
content: Ye(r.svg),
|
|
262
|
+
title: n
|
|
263
|
+
}), o = Ge(t, K, `${K}--${i}`);
|
|
264
|
+
return /* @__PURE__ */ p("span", { className: o, dangerouslySetInnerHTML: { __html: e }, ...a });
|
|
299
265
|
};
|
|
300
|
-
|
|
266
|
+
R.displayName = "Icon";
|
|
301
267
|
const er = {
|
|
302
268
|
name: "checkmark-bold",
|
|
303
269
|
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>',
|
|
@@ -309,7 +275,7 @@ const er = {
|
|
|
309
275
|
keywords: ["minus-bold"],
|
|
310
276
|
category: "utility"
|
|
311
277
|
};
|
|
312
|
-
function
|
|
278
|
+
function G(r, n) {
|
|
313
279
|
if (typeof r == "function")
|
|
314
280
|
return r(n);
|
|
315
281
|
r != null && (r.current = n);
|
|
@@ -318,28 +284,28 @@ function tr(...r) {
|
|
|
318
284
|
return (n) => {
|
|
319
285
|
let t = !1;
|
|
320
286
|
const i = r.map((a) => {
|
|
321
|
-
const e =
|
|
287
|
+
const e = G(a, n);
|
|
322
288
|
return !t && typeof e == "function" && (t = !0), e;
|
|
323
289
|
});
|
|
324
290
|
if (t)
|
|
325
291
|
return () => {
|
|
326
292
|
for (let a = 0; a < i.length; a++) {
|
|
327
293
|
const e = i[a];
|
|
328
|
-
typeof e == "function" ? e() :
|
|
294
|
+
typeof e == "function" ? e() : G(r[a], null);
|
|
329
295
|
}
|
|
330
296
|
};
|
|
331
297
|
};
|
|
332
298
|
}
|
|
333
|
-
var
|
|
299
|
+
var ie = s.forwardRef((r, n) => {
|
|
334
300
|
const { children: t, ...i } = r, a = s.Children.toArray(t), e = a.find(or);
|
|
335
301
|
if (e) {
|
|
336
302
|
const o = e.props.children, u = a.map((c) => c === e ? s.Children.count(o) > 1 ? s.Children.only(null) : s.isValidElement(o) ? o.props.children : null : c);
|
|
337
|
-
return /* @__PURE__ */ p(
|
|
303
|
+
return /* @__PURE__ */ p(E, { ...i, ref: n, children: s.isValidElement(o) ? s.cloneElement(o, void 0, u) : null });
|
|
338
304
|
}
|
|
339
|
-
return /* @__PURE__ */ p(
|
|
305
|
+
return /* @__PURE__ */ p(E, { ...i, ref: n, children: t });
|
|
340
306
|
});
|
|
341
|
-
|
|
342
|
-
var
|
|
307
|
+
ie.displayName = "Slot";
|
|
308
|
+
var E = s.forwardRef((r, n) => {
|
|
343
309
|
const { children: t, ...i } = r;
|
|
344
310
|
if (s.isValidElement(t)) {
|
|
345
311
|
const a = ar(t), e = ir(i, t.props);
|
|
@@ -347,8 +313,8 @@ var M = s.forwardRef((r, n) => {
|
|
|
347
313
|
}
|
|
348
314
|
return s.Children.count(t) > 1 ? s.Children.only(null) : null;
|
|
349
315
|
});
|
|
350
|
-
|
|
351
|
-
var nr = ({ children: r }) => /* @__PURE__ */ p(
|
|
316
|
+
E.displayName = "SlotClone";
|
|
317
|
+
var nr = ({ children: r }) => /* @__PURE__ */ p(ne, { children: r });
|
|
352
318
|
function or(r) {
|
|
353
319
|
return s.isValidElement(r) && r.type === nr;
|
|
354
320
|
}
|
|
@@ -386,11 +352,11 @@ var ur = [
|
|
|
386
352
|
"ul"
|
|
387
353
|
], sr = ur.reduce((r, n) => {
|
|
388
354
|
const t = s.forwardRef((i, a) => {
|
|
389
|
-
const { asChild: e, ...o } = i, u = e ?
|
|
355
|
+
const { asChild: e, ...o } = i, u = e ? ie : n;
|
|
390
356
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ p(u, { ...o, ref: a });
|
|
391
357
|
});
|
|
392
358
|
return t.displayName = `Primitive.${n}`, { ...r, [n]: t };
|
|
393
|
-
}, {}), cr = "Label",
|
|
359
|
+
}, {}), cr = "Label", ae = s.forwardRef((r, n) => /* @__PURE__ */ p(
|
|
394
360
|
sr.label,
|
|
395
361
|
{
|
|
396
362
|
...r,
|
|
@@ -401,41 +367,41 @@ var ur = [
|
|
|
401
367
|
}
|
|
402
368
|
}
|
|
403
369
|
));
|
|
404
|
-
|
|
405
|
-
var lr =
|
|
370
|
+
ae.displayName = cr;
|
|
371
|
+
var lr = ae;
|
|
406
372
|
function pr(r) {
|
|
407
373
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
408
374
|
}
|
|
409
|
-
var
|
|
375
|
+
var X = { exports: {} };
|
|
410
376
|
/*!
|
|
411
377
|
Copyright (c) 2018 Jed Watson.
|
|
412
378
|
Licensed under the MIT License (MIT), see
|
|
413
379
|
http://jedwatson.github.io/classnames
|
|
414
380
|
*/
|
|
415
|
-
var
|
|
381
|
+
var J;
|
|
416
382
|
function dr() {
|
|
417
|
-
return
|
|
383
|
+
return J || (J = 1, function(r) {
|
|
418
384
|
(function() {
|
|
419
385
|
var n = {}.hasOwnProperty;
|
|
420
386
|
function t() {
|
|
421
387
|
for (var e = "", o = 0; o < arguments.length; o++) {
|
|
422
388
|
var u = arguments[o];
|
|
423
|
-
u && (e = a(e, i(u)));
|
|
389
|
+
u && (e = a(e, i.call(this, u)));
|
|
424
390
|
}
|
|
425
391
|
return e;
|
|
426
392
|
}
|
|
427
393
|
function i(e) {
|
|
428
394
|
if (typeof e == "string" || typeof e == "number")
|
|
429
|
-
return e;
|
|
395
|
+
return this && this[e] || e;
|
|
430
396
|
if (typeof e != "object")
|
|
431
397
|
return "";
|
|
432
398
|
if (Array.isArray(e))
|
|
433
|
-
return t.apply(
|
|
399
|
+
return t.apply(this, e);
|
|
434
400
|
if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
|
|
435
401
|
return e.toString();
|
|
436
402
|
var o = "";
|
|
437
403
|
for (var u in e)
|
|
438
|
-
n.call(e, u) && e[u] && (o = a(o, u));
|
|
404
|
+
n.call(e, u) && e[u] && (o = a(o, this && this[u] || u));
|
|
439
405
|
return o;
|
|
440
406
|
}
|
|
441
407
|
function a(e, o) {
|
|
@@ -443,63 +409,59 @@ function dr() {
|
|
|
443
409
|
}
|
|
444
410
|
r.exports ? (t.default = t, r.exports = t) : window.classNames = t;
|
|
445
411
|
})();
|
|
446
|
-
}(
|
|
412
|
+
}(X)), X.exports;
|
|
447
413
|
}
|
|
448
414
|
var fr = dr();
|
|
449
|
-
const hr = /* @__PURE__ */ pr(fr),
|
|
415
|
+
const hr = /* @__PURE__ */ pr(fr), mr = {
|
|
450
416
|
"purpur-label": "_purpur-label_1jndl_1",
|
|
451
417
|
"purpur-label--negative": "_purpur-label--negative_1jndl_8",
|
|
452
418
|
"purpur-label--disabled": "_purpur-label--disabled_1jndl_11"
|
|
453
|
-
},
|
|
419
|
+
}, gr = hr.bind(mr), P = "purpur-label", vr = ({
|
|
454
420
|
children: r,
|
|
455
421
|
className: n,
|
|
456
422
|
disabled: t,
|
|
457
423
|
negative: i = !1,
|
|
458
424
|
...a
|
|
459
425
|
}) => {
|
|
460
|
-
const e =
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
[A[`${R}--disabled`]]: t,
|
|
465
|
-
[A[`${R}--negative`]]: i
|
|
466
|
-
}
|
|
467
|
-
]);
|
|
426
|
+
const e = gr(n, P, {
|
|
427
|
+
[`${P}--disabled`]: t,
|
|
428
|
+
[`${P}--negative`]: i
|
|
429
|
+
});
|
|
468
430
|
return /* @__PURE__ */ p(lr, { className: e, ...a, children: r });
|
|
469
431
|
};
|
|
470
|
-
function
|
|
432
|
+
function _r(r) {
|
|
471
433
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
472
434
|
}
|
|
473
|
-
var
|
|
435
|
+
var Q = { exports: {} };
|
|
474
436
|
/*!
|
|
475
437
|
Copyright (c) 2018 Jed Watson.
|
|
476
438
|
Licensed under the MIT License (MIT), see
|
|
477
439
|
http://jedwatson.github.io/classnames
|
|
478
440
|
*/
|
|
479
|
-
var
|
|
480
|
-
function
|
|
481
|
-
return
|
|
441
|
+
var Y;
|
|
442
|
+
function br() {
|
|
443
|
+
return Y || (Y = 1, function(r) {
|
|
482
444
|
(function() {
|
|
483
445
|
var n = {}.hasOwnProperty;
|
|
484
446
|
function t() {
|
|
485
447
|
for (var e = "", o = 0; o < arguments.length; o++) {
|
|
486
448
|
var u = arguments[o];
|
|
487
|
-
u && (e = a(e, i(u)));
|
|
449
|
+
u && (e = a(e, i.call(this, u)));
|
|
488
450
|
}
|
|
489
451
|
return e;
|
|
490
452
|
}
|
|
491
453
|
function i(e) {
|
|
492
454
|
if (typeof e == "string" || typeof e == "number")
|
|
493
|
-
return e;
|
|
455
|
+
return this && this[e] || e;
|
|
494
456
|
if (typeof e != "object")
|
|
495
457
|
return "";
|
|
496
458
|
if (Array.isArray(e))
|
|
497
|
-
return t.apply(
|
|
459
|
+
return t.apply(this, e);
|
|
498
460
|
if (e.toString !== Object.prototype.toString && !e.toString.toString().includes("[native code]"))
|
|
499
461
|
return e.toString();
|
|
500
462
|
var o = "";
|
|
501
463
|
for (var u in e)
|
|
502
|
-
n.call(e, u) && e[u] && (o = a(o, u));
|
|
464
|
+
n.call(e, u) && e[u] && (o = a(o, this && this[u] || u));
|
|
503
465
|
return o;
|
|
504
466
|
}
|
|
505
467
|
function a(e, o) {
|
|
@@ -507,10 +469,10 @@ function gr() {
|
|
|
507
469
|
}
|
|
508
470
|
r.exports ? (t.default = t, r.exports = t) : window.classNames = t;
|
|
509
471
|
})();
|
|
510
|
-
}(
|
|
472
|
+
}(Q)), Q.exports;
|
|
511
473
|
}
|
|
512
|
-
var
|
|
513
|
-
const
|
|
474
|
+
var yr = br();
|
|
475
|
+
const xr = /* @__PURE__ */ _r(yr), wr = {
|
|
514
476
|
"purpur-paragraph": "_purpur-paragraph_1rh57_1",
|
|
515
477
|
"purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
|
|
516
478
|
"purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
|
|
@@ -525,70 +487,64 @@ const br = /* @__PURE__ */ vr(_r), N = {
|
|
|
525
487
|
"purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1rh57_60",
|
|
526
488
|
"purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1rh57_67",
|
|
527
489
|
"purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1rh57_75"
|
|
528
|
-
},
|
|
490
|
+
}, $r = xr.bind(wr), Sr = {
|
|
529
491
|
PARAGRAPH100: "paragraph-100"
|
|
530
|
-
},
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
...u
|
|
492
|
+
}, C = "purpur-paragraph", ue = ({
|
|
493
|
+
children: r,
|
|
494
|
+
className: n,
|
|
495
|
+
disabled: t,
|
|
496
|
+
enableHyphenation: i = !1,
|
|
497
|
+
negative: a = !1,
|
|
498
|
+
variant: e = Sr.PARAGRAPH100,
|
|
499
|
+
...o
|
|
539
500
|
}) => {
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
[N[`${k}--disabled`]]: i,
|
|
547
|
-
[N[`${k}--negative`]]: e
|
|
548
|
-
}
|
|
549
|
-
]);
|
|
550
|
-
return /* @__PURE__ */ p("p", { ...u, className: c, "data-testid": r, children: n });
|
|
501
|
+
const u = $r(n, C, `${C}--${e}`, {
|
|
502
|
+
[`${C}--hyphens`]: i,
|
|
503
|
+
[`${C}--disabled`]: t,
|
|
504
|
+
[`${C}--negative`]: a
|
|
505
|
+
});
|
|
506
|
+
return /* @__PURE__ */ p("p", { ...o, className: u, children: r });
|
|
551
507
|
};
|
|
552
|
-
|
|
553
|
-
function
|
|
508
|
+
ue.displayName = "Paragraph";
|
|
509
|
+
function ee(r, n) {
|
|
554
510
|
if (typeof r == "function")
|
|
555
511
|
return r(n);
|
|
556
512
|
r != null && (r.current = n);
|
|
557
513
|
}
|
|
558
|
-
function
|
|
514
|
+
function se(...r) {
|
|
559
515
|
return (n) => {
|
|
560
516
|
let t = !1;
|
|
561
517
|
const i = r.map((a) => {
|
|
562
|
-
const e =
|
|
518
|
+
const e = ee(a, n);
|
|
563
519
|
return !t && typeof e == "function" && (t = !0), e;
|
|
564
520
|
});
|
|
565
521
|
if (t)
|
|
566
522
|
return () => {
|
|
567
523
|
for (let a = 0; a < i.length; a++) {
|
|
568
524
|
const e = i[a];
|
|
569
|
-
typeof e == "function" ? e() :
|
|
525
|
+
typeof e == "function" ? e() : ee(r[a], null);
|
|
570
526
|
}
|
|
571
527
|
};
|
|
572
528
|
};
|
|
573
529
|
}
|
|
574
|
-
function
|
|
575
|
-
return s.useCallback(
|
|
530
|
+
function ce(...r) {
|
|
531
|
+
return s.useCallback(se(...r), r);
|
|
576
532
|
}
|
|
577
|
-
function
|
|
533
|
+
function Nr(r, n = []) {
|
|
578
534
|
let t = [];
|
|
579
535
|
function i(e, o) {
|
|
580
536
|
const u = s.createContext(o), c = t.length;
|
|
581
537
|
t = [...t, o];
|
|
582
538
|
const l = (f) => {
|
|
583
539
|
var b;
|
|
584
|
-
const { scope: d, children: m, ...
|
|
540
|
+
const { scope: d, children: m, ...g } = f, _ = ((b = d == null ? void 0 : d[r]) == null ? void 0 : b[c]) || u, $ = s.useMemo(() => g, Object.values(g));
|
|
585
541
|
return /* @__PURE__ */ p(_.Provider, { value: $, children: m });
|
|
586
542
|
};
|
|
587
543
|
l.displayName = e + "Provider";
|
|
588
544
|
function h(f, d) {
|
|
589
545
|
var _;
|
|
590
|
-
const m = ((_ = d == null ? void 0 : d[r]) == null ? void 0 : _[c]) || u,
|
|
591
|
-
if (
|
|
546
|
+
const m = ((_ = d == null ? void 0 : d[r]) == null ? void 0 : _[c]) || u, g = s.useContext(m);
|
|
547
|
+
if (g) return g;
|
|
592
548
|
if (o !== void 0) return o;
|
|
593
549
|
throw new Error(`\`${f}\` must be used within \`${e}\``);
|
|
594
550
|
}
|
|
@@ -604,9 +560,9 @@ function xr(r, n = []) {
|
|
|
604
560
|
);
|
|
605
561
|
};
|
|
606
562
|
};
|
|
607
|
-
return a.scopeName = r, [i,
|
|
563
|
+
return a.scopeName = r, [i, Cr(a, ...n)];
|
|
608
564
|
}
|
|
609
|
-
function
|
|
565
|
+
function Cr(...r) {
|
|
610
566
|
const n = r[0];
|
|
611
567
|
if (r.length === 1) return n;
|
|
612
568
|
const t = () => {
|
|
@@ -624,13 +580,13 @@ function wr(...r) {
|
|
|
624
580
|
};
|
|
625
581
|
return t.scopeName = n.scopeName, t;
|
|
626
582
|
}
|
|
627
|
-
function
|
|
583
|
+
function re(r, n, { checkForDefaultPrevented: t = !0 } = {}) {
|
|
628
584
|
return function(a) {
|
|
629
585
|
if (r == null || r(a), t === !1 || !a.defaultPrevented)
|
|
630
586
|
return n == null ? void 0 : n(a);
|
|
631
587
|
};
|
|
632
588
|
}
|
|
633
|
-
function
|
|
589
|
+
function le(r) {
|
|
634
590
|
const n = s.useRef(r);
|
|
635
591
|
return s.useEffect(() => {
|
|
636
592
|
n.current = r;
|
|
@@ -639,13 +595,13 @@ function fe(r) {
|
|
|
639
595
|
return (i = n.current) == null ? void 0 : i.call(n, ...t);
|
|
640
596
|
}, []);
|
|
641
597
|
}
|
|
642
|
-
function
|
|
598
|
+
function kr({
|
|
643
599
|
prop: r,
|
|
644
600
|
defaultProp: n,
|
|
645
601
|
onChange: t = () => {
|
|
646
602
|
}
|
|
647
603
|
}) {
|
|
648
|
-
const [i, a] =
|
|
604
|
+
const [i, a] = Or({ defaultProp: n, onChange: t }), e = r !== void 0, o = e ? r : i, u = le(t), c = s.useCallback(
|
|
649
605
|
(l) => {
|
|
650
606
|
if (e) {
|
|
651
607
|
const f = typeof l == "function" ? l(r) : l;
|
|
@@ -657,24 +613,24 @@ function $r({
|
|
|
657
613
|
);
|
|
658
614
|
return [o, c];
|
|
659
615
|
}
|
|
660
|
-
function
|
|
616
|
+
function Or({
|
|
661
617
|
defaultProp: r,
|
|
662
618
|
onChange: n
|
|
663
619
|
}) {
|
|
664
|
-
const t = s.useState(r), [i] = t, a = s.useRef(i), e =
|
|
620
|
+
const t = s.useState(r), [i] = t, a = s.useRef(i), e = le(n);
|
|
665
621
|
return s.useEffect(() => {
|
|
666
622
|
a.current !== i && (e(i), a.current = i);
|
|
667
623
|
}, [i, a, e]), t;
|
|
668
624
|
}
|
|
669
|
-
function
|
|
625
|
+
function Pr(r) {
|
|
670
626
|
const n = s.useRef({ value: r, previous: r });
|
|
671
627
|
return s.useMemo(() => (n.current.value !== r && (n.current.previous = n.current.value, n.current.value = r), n.current.previous), [r]);
|
|
672
628
|
}
|
|
673
|
-
var
|
|
629
|
+
var j = globalThis != null && globalThis.document ? s.useLayoutEffect : () => {
|
|
674
630
|
};
|
|
675
|
-
function
|
|
631
|
+
function Ar(r) {
|
|
676
632
|
const [n, t] = s.useState(void 0);
|
|
677
|
-
return
|
|
633
|
+
return j(() => {
|
|
678
634
|
if (r) {
|
|
679
635
|
t({ width: r.offsetWidth, height: r.offsetHeight });
|
|
680
636
|
const i = new ResizeObserver((a) => {
|
|
@@ -694,16 +650,16 @@ function Nr(r) {
|
|
|
694
650
|
t(void 0);
|
|
695
651
|
}, [r]), n;
|
|
696
652
|
}
|
|
697
|
-
function
|
|
653
|
+
function Rr(r, n) {
|
|
698
654
|
return s.useReducer((t, i) => n[t][i] ?? t, r);
|
|
699
655
|
}
|
|
700
|
-
var
|
|
701
|
-
const { present: n, children: t } = r, i =
|
|
656
|
+
var pe = (r) => {
|
|
657
|
+
const { present: n, children: t } = r, i = Er(n), a = typeof t == "function" ? t({ present: i.isPresent }) : s.Children.only(t), e = ce(i.ref, jr(a));
|
|
702
658
|
return typeof t == "function" || i.isPresent ? s.cloneElement(a, { ref: e }) : null;
|
|
703
659
|
};
|
|
704
|
-
|
|
705
|
-
function
|
|
706
|
-
const [n, t] = s.useState(), i = s.useRef({}), a = s.useRef(r), e = s.useRef("none"), o = r ? "mounted" : "unmounted", [u, c] =
|
|
660
|
+
pe.displayName = "Presence";
|
|
661
|
+
function Er(r) {
|
|
662
|
+
const [n, t] = s.useState(), i = s.useRef({}), a = s.useRef(r), e = s.useRef("none"), o = r ? "mounted" : "unmounted", [u, c] = Rr(o, {
|
|
707
663
|
mounted: {
|
|
708
664
|
UNMOUNT: "unmounted",
|
|
709
665
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -717,19 +673,19 @@ function Or(r) {
|
|
|
717
673
|
}
|
|
718
674
|
});
|
|
719
675
|
return s.useEffect(() => {
|
|
720
|
-
const l =
|
|
676
|
+
const l = k(i.current);
|
|
721
677
|
e.current = u === "mounted" ? l : "none";
|
|
722
|
-
}, [u]),
|
|
678
|
+
}, [u]), j(() => {
|
|
723
679
|
const l = i.current, h = a.current;
|
|
724
680
|
if (h !== r) {
|
|
725
|
-
const d = e.current, m =
|
|
681
|
+
const d = e.current, m = k(l);
|
|
726
682
|
r ? c("MOUNT") : m === "none" || (l == null ? void 0 : l.display) === "none" ? c("UNMOUNT") : c(h && d !== m ? "ANIMATION_OUT" : "UNMOUNT"), a.current = r;
|
|
727
683
|
}
|
|
728
|
-
}, [r, c]),
|
|
684
|
+
}, [r, c]), j(() => {
|
|
729
685
|
if (n) {
|
|
730
686
|
let l;
|
|
731
687
|
const h = n.ownerDocument.defaultView ?? window, f = (m) => {
|
|
732
|
-
const _ =
|
|
688
|
+
const _ = k(i.current).includes(m.animationName);
|
|
733
689
|
if (m.target === n && _ && (c("ANIMATION_END"), !a.current)) {
|
|
734
690
|
const $ = n.style.animationFillMode;
|
|
735
691
|
n.style.animationFillMode = "forwards", l = h.setTimeout(() => {
|
|
@@ -737,7 +693,7 @@ function Or(r) {
|
|
|
737
693
|
});
|
|
738
694
|
}
|
|
739
695
|
}, d = (m) => {
|
|
740
|
-
m.target === n && (e.current =
|
|
696
|
+
m.target === n && (e.current = k(i.current));
|
|
741
697
|
};
|
|
742
698
|
return n.addEventListener("animationstart", d), n.addEventListener("animationcancel", f), n.addEventListener("animationend", f), () => {
|
|
743
699
|
h.clearTimeout(l), n.removeEventListener("animationstart", d), n.removeEventListener("animationcancel", f), n.removeEventListener("animationend", f);
|
|
@@ -751,37 +707,37 @@ function Or(r) {
|
|
|
751
707
|
}, [])
|
|
752
708
|
};
|
|
753
709
|
}
|
|
754
|
-
function
|
|
710
|
+
function k(r) {
|
|
755
711
|
return (r == null ? void 0 : r.animationName) || "none";
|
|
756
712
|
}
|
|
757
|
-
function
|
|
713
|
+
function jr(r) {
|
|
758
714
|
var i, a;
|
|
759
715
|
let n = (i = Object.getOwnPropertyDescriptor(r.props, "ref")) == null ? void 0 : i.get, t = n && "isReactWarning" in n && n.isReactWarning;
|
|
760
716
|
return t ? r.ref : (n = (a = Object.getOwnPropertyDescriptor(r, "ref")) == null ? void 0 : a.get, t = n && "isReactWarning" in n && n.isReactWarning, t ? r.props.ref : r.props.ref || r.ref);
|
|
761
717
|
}
|
|
762
|
-
var
|
|
763
|
-
const { children: t, ...i } = r, a = s.Children.toArray(t), e = a.find(
|
|
718
|
+
var de = s.forwardRef((r, n) => {
|
|
719
|
+
const { children: t, ...i } = r, a = s.Children.toArray(t), e = a.find(Dr);
|
|
764
720
|
if (e) {
|
|
765
721
|
const o = e.props.children, u = a.map((c) => c === e ? s.Children.count(o) > 1 ? s.Children.only(null) : s.isValidElement(o) ? o.props.children : null : c);
|
|
766
|
-
return /* @__PURE__ */ p(
|
|
722
|
+
return /* @__PURE__ */ p(M, { ...i, ref: n, children: s.isValidElement(o) ? s.cloneElement(o, void 0, u) : null });
|
|
767
723
|
}
|
|
768
|
-
return /* @__PURE__ */ p(
|
|
724
|
+
return /* @__PURE__ */ p(M, { ...i, ref: n, children: t });
|
|
769
725
|
});
|
|
770
|
-
|
|
771
|
-
var
|
|
726
|
+
de.displayName = "Slot";
|
|
727
|
+
var M = s.forwardRef((r, n) => {
|
|
772
728
|
const { children: t, ...i } = r;
|
|
773
729
|
if (s.isValidElement(t)) {
|
|
774
|
-
const a =
|
|
775
|
-
return t.type !== s.Fragment && (e.ref = n ?
|
|
730
|
+
const a = zr(t), e = qr(i, t.props);
|
|
731
|
+
return t.type !== s.Fragment && (e.ref = n ? se(n, a) : a), s.cloneElement(t, e);
|
|
776
732
|
}
|
|
777
733
|
return s.Children.count(t) > 1 ? s.Children.only(null) : null;
|
|
778
734
|
});
|
|
779
|
-
|
|
780
|
-
var
|
|
781
|
-
function
|
|
782
|
-
return s.isValidElement(r) && r.type ===
|
|
735
|
+
M.displayName = "SlotClone";
|
|
736
|
+
var Mr = ({ children: r }) => /* @__PURE__ */ p(ne, { children: r });
|
|
737
|
+
function Dr(r) {
|
|
738
|
+
return s.isValidElement(r) && r.type === Mr;
|
|
783
739
|
}
|
|
784
|
-
function
|
|
740
|
+
function qr(r, n) {
|
|
785
741
|
const t = { ...n };
|
|
786
742
|
for (const i in n) {
|
|
787
743
|
const a = r[i], e = n[i];
|
|
@@ -791,12 +747,12 @@ function Er(r, n) {
|
|
|
791
747
|
}
|
|
792
748
|
return { ...r, ...t };
|
|
793
749
|
}
|
|
794
|
-
function
|
|
750
|
+
function zr(r) {
|
|
795
751
|
var i, a;
|
|
796
752
|
let n = (i = Object.getOwnPropertyDescriptor(r.props, "ref")) == null ? void 0 : i.get, t = n && "isReactWarning" in n && n.isReactWarning;
|
|
797
753
|
return t ? r.ref : (n = (a = Object.getOwnPropertyDescriptor(r, "ref")) == null ? void 0 : a.get, t = n && "isReactWarning" in n && n.isReactWarning, t ? r.props.ref : r.props.ref || r.ref);
|
|
798
754
|
}
|
|
799
|
-
var
|
|
755
|
+
var Br = [
|
|
800
756
|
"a",
|
|
801
757
|
"button",
|
|
802
758
|
"div",
|
|
@@ -813,13 +769,13 @@ var Mr = [
|
|
|
813
769
|
"span",
|
|
814
770
|
"svg",
|
|
815
771
|
"ul"
|
|
816
|
-
],
|
|
772
|
+
], fe = Br.reduce((r, n) => {
|
|
817
773
|
const t = s.forwardRef((i, a) => {
|
|
818
|
-
const { asChild: e, ...o } = i, u = e ?
|
|
774
|
+
const { asChild: e, ...o } = i, u = e ? de : n;
|
|
819
775
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ p(u, { ...o, ref: a });
|
|
820
776
|
});
|
|
821
777
|
return t.displayName = `Primitive.${n}`, { ...r, [n]: t };
|
|
822
|
-
}, {}),
|
|
778
|
+
}, {}), D = "Checkbox", [Wr, et] = Nr(D), [Ir, Lr] = Wr(D), he = s.forwardRef(
|
|
823
779
|
(r, n) => {
|
|
824
780
|
const {
|
|
825
781
|
__scopeCheckbox: t,
|
|
@@ -832,41 +788,41 @@ var Mr = [
|
|
|
832
788
|
onCheckedChange: l,
|
|
833
789
|
form: h,
|
|
834
790
|
...f
|
|
835
|
-
} = r, [d, m] = s.useState(null),
|
|
791
|
+
} = r, [d, m] = s.useState(null), g = ce(n, (v) => m(v)), _ = s.useRef(!1), $ = d ? h || !!d.closest("form") : !0, [b = !1, O] = kr({
|
|
836
792
|
prop: a,
|
|
837
793
|
defaultProp: e,
|
|
838
794
|
onChange: l
|
|
839
|
-
}),
|
|
795
|
+
}), _e = s.useRef(b);
|
|
840
796
|
return s.useEffect(() => {
|
|
841
|
-
const
|
|
842
|
-
if (
|
|
843
|
-
const
|
|
844
|
-
return
|
|
797
|
+
const v = d == null ? void 0 : d.form;
|
|
798
|
+
if (v) {
|
|
799
|
+
const N = () => O(_e.current);
|
|
800
|
+
return v.addEventListener("reset", N), () => v.removeEventListener("reset", N);
|
|
845
801
|
}
|
|
846
|
-
}, [d,
|
|
802
|
+
}, [d, O]), /* @__PURE__ */ S(Ir, { scope: t, state: b, disabled: u, children: [
|
|
847
803
|
/* @__PURE__ */ p(
|
|
848
|
-
|
|
804
|
+
fe.button,
|
|
849
805
|
{
|
|
850
806
|
type: "button",
|
|
851
807
|
role: "checkbox",
|
|
852
808
|
"aria-checked": x(b) ? "mixed" : b,
|
|
853
809
|
"aria-required": o,
|
|
854
|
-
"data-state":
|
|
810
|
+
"data-state": ve(b),
|
|
855
811
|
"data-disabled": u ? "" : void 0,
|
|
856
812
|
disabled: u,
|
|
857
813
|
value: c,
|
|
858
814
|
...f,
|
|
859
|
-
ref:
|
|
860
|
-
onKeyDown:
|
|
861
|
-
|
|
815
|
+
ref: g,
|
|
816
|
+
onKeyDown: re(r.onKeyDown, (v) => {
|
|
817
|
+
v.key === "Enter" && v.preventDefault();
|
|
862
818
|
}),
|
|
863
|
-
onClick:
|
|
864
|
-
|
|
819
|
+
onClick: re(r.onClick, (v) => {
|
|
820
|
+
O((N) => x(N) ? !0 : !N), $ && (_.current = v.isPropagationStopped(), _.current || v.stopPropagation());
|
|
865
821
|
})
|
|
866
822
|
}
|
|
867
823
|
),
|
|
868
824
|
$ && /* @__PURE__ */ p(
|
|
869
|
-
|
|
825
|
+
Ur,
|
|
870
826
|
{
|
|
871
827
|
control: d,
|
|
872
828
|
bubbles: !_.current,
|
|
@@ -883,14 +839,14 @@ var Mr = [
|
|
|
883
839
|
] });
|
|
884
840
|
}
|
|
885
841
|
);
|
|
886
|
-
|
|
887
|
-
var
|
|
842
|
+
he.displayName = D;
|
|
843
|
+
var me = "CheckboxIndicator", ge = s.forwardRef(
|
|
888
844
|
(r, n) => {
|
|
889
|
-
const { __scopeCheckbox: t, forceMount: i, ...a } = r, e =
|
|
890
|
-
return /* @__PURE__ */ p(
|
|
891
|
-
|
|
845
|
+
const { __scopeCheckbox: t, forceMount: i, ...a } = r, e = Lr(me, t);
|
|
846
|
+
return /* @__PURE__ */ p(pe, { present: i || x(e.state) || e.state === !0, children: /* @__PURE__ */ p(
|
|
847
|
+
fe.span,
|
|
892
848
|
{
|
|
893
|
-
"data-state":
|
|
849
|
+
"data-state": ve(e.state),
|
|
894
850
|
"data-disabled": e.disabled ? "" : void 0,
|
|
895
851
|
...a,
|
|
896
852
|
ref: n,
|
|
@@ -899,14 +855,14 @@ var _e = "CheckboxIndicator", be = s.forwardRef(
|
|
|
899
855
|
) });
|
|
900
856
|
}
|
|
901
857
|
);
|
|
902
|
-
|
|
903
|
-
var
|
|
904
|
-
const { control: n, checked: t, bubbles: i = !0, defaultChecked: a, ...e } = r, o = s.useRef(null), u =
|
|
858
|
+
ge.displayName = me;
|
|
859
|
+
var Ur = (r) => {
|
|
860
|
+
const { control: n, checked: t, bubbles: i = !0, defaultChecked: a, ...e } = r, o = s.useRef(null), u = Pr(t), c = Ar(n);
|
|
905
861
|
s.useEffect(() => {
|
|
906
862
|
const h = o.current, f = window.HTMLInputElement.prototype, m = Object.getOwnPropertyDescriptor(f, "checked").set;
|
|
907
863
|
if (u !== t && m) {
|
|
908
|
-
const
|
|
909
|
-
h.indeterminate = x(t), m.call(h, x(t) ? !1 : t), h.dispatchEvent(
|
|
864
|
+
const g = new Event("click", { bubbles: i });
|
|
865
|
+
h.indeterminate = x(t), m.call(h, x(t) ? !1 : t), h.dispatchEvent(g);
|
|
910
866
|
}
|
|
911
867
|
}, [u, t, i]);
|
|
912
868
|
const l = s.useRef(x(t) ? !1 : t);
|
|
@@ -933,22 +889,22 @@ var Wr = (r) => {
|
|
|
933
889
|
function x(r) {
|
|
934
890
|
return r === "indeterminate";
|
|
935
891
|
}
|
|
936
|
-
function
|
|
892
|
+
function ve(r) {
|
|
937
893
|
return x(r) ? "indeterminate" : r ? "checked" : "unchecked";
|
|
938
894
|
}
|
|
939
|
-
var
|
|
940
|
-
function
|
|
895
|
+
var Vr = he, Fr = ge;
|
|
896
|
+
function Tr(r) {
|
|
941
897
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
942
898
|
}
|
|
943
|
-
var
|
|
899
|
+
var A = { exports: {} };
|
|
944
900
|
/*!
|
|
945
901
|
Copyright (c) 2018 Jed Watson.
|
|
946
902
|
Licensed under the MIT License (MIT), see
|
|
947
903
|
http://jedwatson.github.io/classnames
|
|
948
904
|
*/
|
|
949
|
-
var
|
|
950
|
-
function
|
|
951
|
-
return
|
|
905
|
+
var te;
|
|
906
|
+
function Zr() {
|
|
907
|
+
return te || (te = 1, function(r) {
|
|
952
908
|
(function() {
|
|
953
909
|
var n = {}.hasOwnProperty;
|
|
954
910
|
function t() {
|
|
@@ -977,10 +933,10 @@ function Ur() {
|
|
|
977
933
|
}
|
|
978
934
|
r.exports ? (t.default = t, r.exports = t) : window.classNames = t;
|
|
979
935
|
})();
|
|
980
|
-
}(
|
|
936
|
+
}(A)), A.exports;
|
|
981
937
|
}
|
|
982
|
-
var
|
|
983
|
-
const
|
|
938
|
+
var Hr = Zr();
|
|
939
|
+
const Kr = /* @__PURE__ */ Tr(Hr), Gr = {
|
|
984
940
|
"purpur-checkbox": "_purpur-checkbox_150ck_1",
|
|
985
941
|
"purpur-checkbox__box": "_purpur-checkbox__box_150ck_7",
|
|
986
942
|
"purpur-checkbox--error": "_purpur-checkbox--error_150ck_16",
|
|
@@ -989,83 +945,85 @@ const Fr = /* @__PURE__ */ Lr(Vr), Tr = {
|
|
|
989
945
|
"purpur-checkbox__label-container": "_purpur-checkbox__label-container_150ck_70",
|
|
990
946
|
"purpur-checkbox__wrapper": "_purpur-checkbox__wrapper_150ck_76",
|
|
991
947
|
"purpur-checkbox__container": "_purpur-checkbox__container_150ck_82"
|
|
992
|
-
}, w =
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
/* @__PURE__ */ S("div", { className: w([t, `${y}
|
|
1006
|
-
/* @__PURE__ */
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
948
|
+
}, w = Kr.bind(Gr), rt = ["indeterminate", !0, !1], y = "purpur-checkbox", Xr = be(
|
|
949
|
+
({
|
|
950
|
+
["data-testid"]: r,
|
|
951
|
+
checked: n,
|
|
952
|
+
className: t,
|
|
953
|
+
error: i = !1,
|
|
954
|
+
errorText: a,
|
|
955
|
+
label: e,
|
|
956
|
+
helperText: o,
|
|
957
|
+
onChange: u,
|
|
958
|
+
...c
|
|
959
|
+
}, l) => {
|
|
960
|
+
const h = a && !n, f = i && !n;
|
|
961
|
+
return /* @__PURE__ */ S("div", { className: w([t, `${y}__wrapper`]), children: [
|
|
962
|
+
/* @__PURE__ */ S("div", { className: w([t, `${y}__container`]), children: [
|
|
963
|
+
/* @__PURE__ */ p(
|
|
964
|
+
Vr,
|
|
965
|
+
{
|
|
966
|
+
...c,
|
|
967
|
+
checked: n,
|
|
968
|
+
className: w([
|
|
969
|
+
y,
|
|
970
|
+
{
|
|
971
|
+
[`${y}--error`]: h,
|
|
972
|
+
[`${y}--error-checkbox`]: f
|
|
973
|
+
}
|
|
974
|
+
]),
|
|
975
|
+
"data-testid": r,
|
|
976
|
+
onCheckedChange: u,
|
|
977
|
+
ref: l,
|
|
978
|
+
children: /* @__PURE__ */ p("span", { className: w(`${y}__box`), children: /* @__PURE__ */ p(Fr, { className: w(`${y}__indicator`), children: n === "indeterminate" ? /* @__PURE__ */ p(
|
|
979
|
+
R,
|
|
980
|
+
{
|
|
981
|
+
"data-testid": r && `${r}-checked-icon`,
|
|
982
|
+
size: "xs",
|
|
983
|
+
svg: rr
|
|
984
|
+
}
|
|
985
|
+
) : /* @__PURE__ */ p(
|
|
986
|
+
R,
|
|
987
|
+
{
|
|
988
|
+
"data-testid": r && `${r}-indeterminate-icon`,
|
|
989
|
+
size: "xs",
|
|
990
|
+
svg: er
|
|
991
|
+
}
|
|
992
|
+
) }) })
|
|
993
|
+
}
|
|
994
|
+
),
|
|
995
|
+
/* @__PURE__ */ S("span", { className: w(`${y}__label-container`), children: [
|
|
996
|
+
e && /* @__PURE__ */ p(
|
|
997
|
+
vr,
|
|
1023
998
|
{
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
999
|
+
htmlFor: c.id,
|
|
1000
|
+
"data-testid": r && `${r}-label`,
|
|
1001
|
+
disabled: c.disabled,
|
|
1002
|
+
children: /* @__PURE__ */ S(ue, { variant: "paragraph-100", disabled: c.disabled, children: [
|
|
1003
|
+
c.required && /* @__PURE__ */ p("span", { "aria-hidden": !0, children: "* " }),
|
|
1004
|
+
e
|
|
1005
|
+
] })
|
|
1027
1006
|
}
|
|
1028
|
-
)
|
|
1029
|
-
|
|
1007
|
+
),
|
|
1008
|
+
o && /* @__PURE__ */ p(
|
|
1009
|
+
Ve,
|
|
1030
1010
|
{
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1011
|
+
className: w(`${y}__helper`),
|
|
1012
|
+
"data-testid": r && `${r}-helper-text`,
|
|
1013
|
+
disabled: c.disabled,
|
|
1014
|
+
id: `${c.id}-helper-text`,
|
|
1015
|
+
children: o
|
|
1034
1016
|
}
|
|
1035
|
-
)
|
|
1036
|
-
}
|
|
1037
|
-
),
|
|
1038
|
-
/* @__PURE__ */
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
"data-testid": r && `${r}-label`,
|
|
1044
|
-
disabled: c.disabled,
|
|
1045
|
-
children: /* @__PURE__ */ S(le, { variant: "paragraph-100", disabled: c.disabled, children: [
|
|
1046
|
-
c.required && /* @__PURE__ */ p("span", { "aria-hidden": !0, children: "* " }),
|
|
1047
|
-
e
|
|
1048
|
-
] })
|
|
1049
|
-
}
|
|
1050
|
-
),
|
|
1051
|
-
o && /* @__PURE__ */ p(
|
|
1052
|
-
Ve,
|
|
1053
|
-
{
|
|
1054
|
-
className: w(`${y}__helper`),
|
|
1055
|
-
"data-testid": r && `${r}-helper-text`,
|
|
1056
|
-
disabled: c.disabled,
|
|
1057
|
-
id: `${c.id}-helper-text`,
|
|
1058
|
-
children: o
|
|
1059
|
-
}
|
|
1060
|
-
)
|
|
1061
|
-
] })
|
|
1062
|
-
] }),
|
|
1063
|
-
h && /* @__PURE__ */ p(We, { "data-testid": r && `${r}-error-text`, children: a })
|
|
1064
|
-
] });
|
|
1065
|
-
}, Hr = we(Zr);
|
|
1066
|
-
Hr.displayName = "Checkbox";
|
|
1017
|
+
)
|
|
1018
|
+
] })
|
|
1019
|
+
] }),
|
|
1020
|
+
h && /* @__PURE__ */ p(qe, { "data-testid": r && `${r}-error-text`, children: a })
|
|
1021
|
+
] });
|
|
1022
|
+
}
|
|
1023
|
+
);
|
|
1024
|
+
Xr.displayName = "Checkbox";
|
|
1067
1025
|
export {
|
|
1068
|
-
|
|
1069
|
-
|
|
1026
|
+
Xr as Checkbox,
|
|
1027
|
+
rt as checkedState
|
|
1070
1028
|
};
|
|
1071
1029
|
//# sourceMappingURL=checkbox.es.js.map
|