@purpurds/text-field 5.20.1 → 5.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +6 -6
- package/dist/text-field.cjs.js +10 -10
- package/dist/text-field.cjs.js.map +1 -1
- package/dist/text-field.es.js +116 -114
- package/dist/text-field.es.js.map +1 -1
- package/package.json +14 -14
package/dist/text-field.es.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs as g, jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as y, Children as z, isValidElement as M, createElement as A, cloneElement as
|
|
2
|
+
import { forwardRef as y, Children as z, isValidElement as M, createElement as A, cloneElement as W, useEffect as xr, Fragment as mr, useRef as gr, useId as br } from "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
const
|
|
4
|
+
const yr = {
|
|
5
5
|
SM: "sm",
|
|
6
6
|
MD: "md",
|
|
7
7
|
LG: "lg"
|
|
8
8
|
};
|
|
9
|
-
function
|
|
9
|
+
function hr(t) {
|
|
10
10
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
11
11
|
}
|
|
12
|
-
var
|
|
12
|
+
var K = { exports: {} };
|
|
13
13
|
/*!
|
|
14
14
|
Copyright (c) 2018 Jed Watson.
|
|
15
15
|
Licensed under the MIT License (MIT), see
|
|
@@ -44,42 +44,42 @@ var W = { exports: {} };
|
|
|
44
44
|
}
|
|
45
45
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
46
46
|
})();
|
|
47
|
-
})(
|
|
48
|
-
var
|
|
49
|
-
const
|
|
47
|
+
})(K);
|
|
48
|
+
var $r = K.exports;
|
|
49
|
+
const R = /* @__PURE__ */ hr($r), wr = "_rotate_1xozj_1", jr = "_dash_1xozj_1", j = {
|
|
50
50
|
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
51
|
-
rotate:
|
|
51
|
+
rotate: wr,
|
|
52
52
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
|
|
53
53
|
"purpur-spinner--xs": "_purpur-spinner--xs_1xozj_8",
|
|
54
54
|
"purpur-spinner--sm": "_purpur-spinner--sm_1xozj_12",
|
|
55
55
|
"purpur-spinner--md": "_purpur-spinner--md_1xozj_16",
|
|
56
56
|
"purpur-spinner--lg": "_purpur-spinner--lg_1xozj_20",
|
|
57
57
|
"purpur-spinner__circle": "_purpur-spinner__circle_1xozj_24",
|
|
58
|
-
dash:
|
|
58
|
+
dash: jr,
|
|
59
59
|
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_1xozj_33",
|
|
60
60
|
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_1xozj_36"
|
|
61
|
-
}, S = "purpur-spinner",
|
|
61
|
+
}, S = "purpur-spinner", Sr = {
|
|
62
62
|
XXS: "xxs",
|
|
63
63
|
XS: "xs",
|
|
64
64
|
SM: "sm",
|
|
65
65
|
MD: "md",
|
|
66
66
|
LG: "lg"
|
|
67
|
-
},
|
|
67
|
+
}, Nr = ({
|
|
68
68
|
["data-testid"]: t,
|
|
69
69
|
disabled: u = !1,
|
|
70
70
|
negative: n = !1,
|
|
71
|
-
size: a =
|
|
71
|
+
size: a = Sr.SM,
|
|
72
72
|
...o
|
|
73
73
|
}) => /* @__PURE__ */ p(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
|
-
className:
|
|
76
|
+
className: R([j[S], j[`${S}--${a}`]]),
|
|
77
77
|
"data-testid": t,
|
|
78
78
|
...o,
|
|
79
79
|
children: /* @__PURE__ */ p("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ p(
|
|
80
80
|
"circle",
|
|
81
81
|
{
|
|
82
|
-
className:
|
|
82
|
+
className: R(j[`${S}__circle`], {
|
|
83
83
|
[j[`${S}__circle--disabled`]]: u,
|
|
84
84
|
[j[`${S}__circle--negative`]]: n
|
|
85
85
|
}),
|
|
@@ -90,10 +90,10 @@ const Z = /* @__PURE__ */ yr(hr), $r = "_rotate_1xozj_1", wr = "_dash_1xozj_1",
|
|
|
90
90
|
) })
|
|
91
91
|
}
|
|
92
92
|
);
|
|
93
|
-
function
|
|
93
|
+
function Or(t) {
|
|
94
94
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
95
95
|
}
|
|
96
|
-
var
|
|
96
|
+
var Q = { exports: {} };
|
|
97
97
|
/*!
|
|
98
98
|
Copyright (c) 2018 Jed Watson.
|
|
99
99
|
Licensed under the MIT License (MIT), see
|
|
@@ -128,9 +128,9 @@ var K = { exports: {} };
|
|
|
128
128
|
}
|
|
129
129
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
130
130
|
})();
|
|
131
|
-
})(
|
|
132
|
-
var
|
|
133
|
-
const
|
|
131
|
+
})(Q);
|
|
132
|
+
var zr = Q.exports;
|
|
133
|
+
const Mr = /* @__PURE__ */ Or(zr), Ar = {
|
|
134
134
|
"purpur-button": "_purpur-button_1acxn_1",
|
|
135
135
|
"purpur-button--sm": "_purpur-button--sm_1acxn_33",
|
|
136
136
|
"purpur-button--icon-only": "_purpur-button--icon-only_1acxn_36",
|
|
@@ -151,7 +151,7 @@ const zr = /* @__PURE__ */ Nr(Or), Mr = {
|
|
|
151
151
|
"purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_1acxn_160",
|
|
152
152
|
"purpur-button--text-negative": "_purpur-button--text-negative_1acxn_175",
|
|
153
153
|
"purpur-button--text": "_purpur-button--text_1acxn_175"
|
|
154
|
-
},
|
|
154
|
+
}, Cr = Mr.bind(Ar), x = "purpur-button", qr = ({
|
|
155
155
|
children: t,
|
|
156
156
|
className: u,
|
|
157
157
|
["data-testid"]: n,
|
|
@@ -168,7 +168,7 @@ const zr = /* @__PURE__ */ Nr(Or), Mr = {
|
|
|
168
168
|
}, m) => {
|
|
169
169
|
if (r && h === "destructive")
|
|
170
170
|
return null;
|
|
171
|
-
const q =
|
|
171
|
+
const q = Cr(
|
|
172
172
|
[
|
|
173
173
|
x,
|
|
174
174
|
`${x}--${i ? `${h}-negative` : h}`,
|
|
@@ -195,18 +195,18 @@ const zr = /* @__PURE__ */ Nr(Or), Mr = {
|
|
|
195
195
|
onClick: $,
|
|
196
196
|
...l,
|
|
197
197
|
children: [
|
|
198
|
-
e && /* @__PURE__ */ p(
|
|
198
|
+
e && /* @__PURE__ */ p(Nr, { size: v === yr.LG ? "xs" : "xxs", negative: i, disabled: c }),
|
|
199
199
|
" ",
|
|
200
200
|
t
|
|
201
201
|
]
|
|
202
202
|
}
|
|
203
203
|
);
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
function
|
|
204
|
+
}, rr = y(qr);
|
|
205
|
+
rr.displayName = "Button";
|
|
206
|
+
function Ir(t) {
|
|
207
207
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
208
208
|
}
|
|
209
|
-
var
|
|
209
|
+
var tr = { exports: {} };
|
|
210
210
|
/*!
|
|
211
211
|
Copyright (c) 2018 Jed Watson.
|
|
212
212
|
Licensed under the MIT License (MIT), see
|
|
@@ -241,9 +241,9 @@ var rr = { exports: {} };
|
|
|
241
241
|
}
|
|
242
242
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
243
243
|
})();
|
|
244
|
-
})(
|
|
245
|
-
var Lr =
|
|
246
|
-
const Br = /* @__PURE__ */
|
|
244
|
+
})(tr);
|
|
245
|
+
var Lr = tr.exports;
|
|
246
|
+
const Br = /* @__PURE__ */ Ir(Lr), Dr = {
|
|
247
247
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
248
248
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
249
249
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -251,31 +251,31 @@ const Br = /* @__PURE__ */ qr(Lr), Dr = {
|
|
|
251
251
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
252
252
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
253
253
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
254
|
-
},
|
|
254
|
+
}, Er = {
|
|
255
255
|
name: "error-filled",
|
|
256
256
|
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>',
|
|
257
257
|
keywords: ["error-filled"],
|
|
258
258
|
category: "status"
|
|
259
|
-
},
|
|
259
|
+
}, Fr = Br.bind(Dr), V = "purpur-icon", Pr = "md", kr = (t) => t.filter((u) => Object.keys(u).length >= 1).map((u) => `${u.name}="${u.value}"`).join(" "), Xr = ({ content: t = "", title: u } = {}) => {
|
|
260
260
|
const n = [
|
|
261
261
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
262
262
|
{ name: "fill", value: "currentColor" },
|
|
263
263
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
264
264
|
u ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
265
265
|
], a = u ? `<title>${u}</title>` : "";
|
|
266
|
-
return `<svg ${
|
|
267
|
-
},
|
|
266
|
+
return `<svg ${kr(n)}>${a}${t}</svg>`;
|
|
267
|
+
}, Zr = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), er = ({
|
|
268
268
|
["data-testid"]: t,
|
|
269
269
|
svg: u,
|
|
270
270
|
allyTitle: n,
|
|
271
271
|
className: a,
|
|
272
|
-
size: o =
|
|
272
|
+
size: o = Pr,
|
|
273
273
|
...r
|
|
274
274
|
}) => {
|
|
275
|
-
const e =
|
|
276
|
-
content:
|
|
275
|
+
const e = Xr({
|
|
276
|
+
content: Zr(u.svg),
|
|
277
277
|
title: n
|
|
278
|
-
}), i =
|
|
278
|
+
}), i = Fr(a, V, `${V}--${o}`);
|
|
279
279
|
return /* @__PURE__ */ p(
|
|
280
280
|
"span",
|
|
281
281
|
{
|
|
@@ -287,10 +287,11 @@ const Br = /* @__PURE__ */ qr(Lr), Dr = {
|
|
|
287
287
|
}
|
|
288
288
|
);
|
|
289
289
|
};
|
|
290
|
+
er.displayName = "Icon";
|
|
290
291
|
function Rr(t) {
|
|
291
292
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
292
293
|
}
|
|
293
|
-
var
|
|
294
|
+
var nr = { exports: {} };
|
|
294
295
|
/*!
|
|
295
296
|
Copyright (c) 2018 Jed Watson.
|
|
296
297
|
Licensed under the MIT License (MIT), see
|
|
@@ -325,12 +326,12 @@ var tr = { exports: {} };
|
|
|
325
326
|
}
|
|
326
327
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
327
328
|
})();
|
|
328
|
-
})(
|
|
329
|
-
var Vr =
|
|
330
|
-
const Tr = /* @__PURE__ */ Rr(Vr),
|
|
329
|
+
})(nr);
|
|
330
|
+
var Vr = nr.exports;
|
|
331
|
+
const Tr = /* @__PURE__ */ Rr(Vr), T = {
|
|
331
332
|
"purpur-field-error-text": "_purpur-field-error-text_1u768_1",
|
|
332
333
|
"purpur-field-error-text__icon": "_purpur-field-error-text__icon_1u768_12"
|
|
333
|
-
},
|
|
334
|
+
}, G = "purpur-field-error-text", Gr = ({
|
|
334
335
|
["data-testid"]: t,
|
|
335
336
|
children: u,
|
|
336
337
|
className: n,
|
|
@@ -339,13 +340,13 @@ const Tr = /* @__PURE__ */ Rr(Vr), V = {
|
|
|
339
340
|
}) => /* @__PURE__ */ g(
|
|
340
341
|
"div",
|
|
341
342
|
{
|
|
342
|
-
className: Tr([n,
|
|
343
|
+
className: Tr([n, T[G]]),
|
|
343
344
|
"data-testid": t,
|
|
344
345
|
"aria-live": "assertive",
|
|
345
346
|
"aria-relevant": a,
|
|
346
347
|
...o,
|
|
347
348
|
children: [
|
|
348
|
-
/* @__PURE__ */ p(
|
|
349
|
+
/* @__PURE__ */ p(er, { svg: Er, size: "xs", className: T[`${G}__icon`] }),
|
|
349
350
|
u
|
|
350
351
|
]
|
|
351
352
|
}
|
|
@@ -353,7 +354,7 @@ const Tr = /* @__PURE__ */ Rr(Vr), V = {
|
|
|
353
354
|
function Hr(t) {
|
|
354
355
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
355
356
|
}
|
|
356
|
-
var
|
|
357
|
+
var ir = { exports: {} };
|
|
357
358
|
/*!
|
|
358
359
|
Copyright (c) 2018 Jed Watson.
|
|
359
360
|
Licensed under the MIT License (MIT), see
|
|
@@ -388,12 +389,12 @@ var er = { exports: {} };
|
|
|
388
389
|
}
|
|
389
390
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
390
391
|
})();
|
|
391
|
-
})(
|
|
392
|
-
var Yr =
|
|
393
|
-
const Jr = /* @__PURE__ */ Hr(Yr),
|
|
392
|
+
})(ir);
|
|
393
|
+
var Yr = ir.exports;
|
|
394
|
+
const Jr = /* @__PURE__ */ Hr(Yr), H = {
|
|
394
395
|
"purpur-field-helper-text": "_purpur-field-helper-text_atw6b_1",
|
|
395
396
|
"purpur-field-helper-text--disabled": "_purpur-field-helper-text--disabled_atw6b_9"
|
|
396
|
-
},
|
|
397
|
+
}, Y = "purpur-field-helper-text", Ur = ({
|
|
397
398
|
["data-testid"]: t,
|
|
398
399
|
children: u,
|
|
399
400
|
className: n,
|
|
@@ -403,9 +404,9 @@ const Jr = /* @__PURE__ */ Hr(Yr), G = {
|
|
|
403
404
|
}) => {
|
|
404
405
|
const e = Jr([
|
|
405
406
|
n,
|
|
406
|
-
|
|
407
|
+
H[Y],
|
|
407
408
|
{
|
|
408
|
-
[
|
|
409
|
+
[H[`${Y}--disabled`]]: a
|
|
409
410
|
}
|
|
410
411
|
]);
|
|
411
412
|
return /* @__PURE__ */ p("span", { id: o, className: e, "data-testid": t, ...r, children: u });
|
|
@@ -413,7 +414,7 @@ const Jr = /* @__PURE__ */ Hr(Yr), G = {
|
|
|
413
414
|
function Wr(t) {
|
|
414
415
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
415
416
|
}
|
|
416
|
-
var
|
|
417
|
+
var ur = { exports: {} };
|
|
417
418
|
/*!
|
|
418
419
|
Copyright (c) 2018 Jed Watson.
|
|
419
420
|
Licensed under the MIT License (MIT), see
|
|
@@ -448,8 +449,8 @@ var nr = { exports: {} };
|
|
|
448
449
|
}
|
|
449
450
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
450
451
|
})();
|
|
451
|
-
})(
|
|
452
|
-
var Kr =
|
|
452
|
+
})(ur);
|
|
453
|
+
var Kr = ur.exports;
|
|
453
454
|
const Qr = /* @__PURE__ */ Wr(Kr), rt = {
|
|
454
455
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
455
456
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
@@ -468,23 +469,23 @@ const Qr = /* @__PURE__ */ Wr(Kr), rt = {
|
|
|
468
469
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',
|
|
469
470
|
keywords: ["close"],
|
|
470
471
|
category: "utility"
|
|
471
|
-
},
|
|
472
|
-
|
|
472
|
+
}, ar = (t) => /* @__PURE__ */ p(
|
|
473
|
+
P,
|
|
473
474
|
{
|
|
474
475
|
...t,
|
|
475
476
|
svg: tt
|
|
476
477
|
}
|
|
477
478
|
);
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
479
|
+
ar.displayName = "IconCheckCircleFilled";
|
|
480
|
+
const or = (t) => /* @__PURE__ */ p(
|
|
481
|
+
P,
|
|
481
482
|
{
|
|
482
483
|
...t,
|
|
483
484
|
svg: et
|
|
484
485
|
}
|
|
485
486
|
);
|
|
486
|
-
|
|
487
|
-
const nt = Qr.bind(rt),
|
|
487
|
+
or.displayName = "IconClose";
|
|
488
|
+
const nt = Qr.bind(rt), J = "purpur-icon", it = "md", ut = (t) => t.filter((u) => Object.keys(u).length >= 1).map((u) => `${u.name}="${u.value}"`).join(" "), at = ({ content: t = "", title: u } = {}) => {
|
|
488
489
|
const n = [
|
|
489
490
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
490
491
|
{ name: "fill", value: "currentColor" },
|
|
@@ -492,7 +493,7 @@ const nt = Qr.bind(rt), Y = "purpur-icon", it = "md", ut = (t) => t.filter((u) =
|
|
|
492
493
|
u ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
493
494
|
], a = u ? `<title>${u}</title>` : "";
|
|
494
495
|
return `<svg ${ut(n)}>${a}${t}</svg>`;
|
|
495
|
-
}, ot = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(),
|
|
496
|
+
}, ot = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), P = ({
|
|
496
497
|
["data-testid"]: t,
|
|
497
498
|
svg: u,
|
|
498
499
|
allyTitle: n,
|
|
@@ -503,7 +504,7 @@ const nt = Qr.bind(rt), Y = "purpur-icon", it = "md", ut = (t) => t.filter((u) =
|
|
|
503
504
|
const e = at({
|
|
504
505
|
content: ot(u.svg),
|
|
505
506
|
title: n
|
|
506
|
-
}), i = nt(a,
|
|
507
|
+
}), i = nt(a, J, `${J}--${o}`);
|
|
507
508
|
return /* @__PURE__ */ p(
|
|
508
509
|
"span",
|
|
509
510
|
{
|
|
@@ -515,6 +516,7 @@ const nt = Qr.bind(rt), Y = "purpur-icon", it = "md", ut = (t) => t.filter((u) =
|
|
|
515
516
|
}
|
|
516
517
|
);
|
|
517
518
|
};
|
|
519
|
+
P.displayName = "Icon";
|
|
518
520
|
function b() {
|
|
519
521
|
return b = Object.assign ? Object.assign.bind() : function(t) {
|
|
520
522
|
for (var u = 1; u < arguments.length; u++) {
|
|
@@ -532,28 +534,28 @@ function lt(...t) {
|
|
|
532
534
|
(n) => pt(n, u)
|
|
533
535
|
);
|
|
534
536
|
}
|
|
535
|
-
const
|
|
537
|
+
const pr = /* @__PURE__ */ y((t, u) => {
|
|
536
538
|
const { children: n, ...a } = t, o = z.toArray(n), r = o.find(ct);
|
|
537
539
|
if (r) {
|
|
538
540
|
const e = r.props.children, i = o.map((f) => f === r ? z.count(e) > 1 ? z.only(null) : /* @__PURE__ */ M(e) ? e.props.children : null : f);
|
|
539
541
|
return /* @__PURE__ */ A(F, b({}, a, {
|
|
540
542
|
ref: u
|
|
541
|
-
}), /* @__PURE__ */ M(e) ? /* @__PURE__ */
|
|
543
|
+
}), /* @__PURE__ */ M(e) ? /* @__PURE__ */ W(e, void 0, i) : null);
|
|
542
544
|
}
|
|
543
545
|
return /* @__PURE__ */ A(F, b({}, a, {
|
|
544
546
|
ref: u
|
|
545
547
|
}), n);
|
|
546
548
|
});
|
|
547
|
-
|
|
549
|
+
pr.displayName = "Slot";
|
|
548
550
|
const F = /* @__PURE__ */ y((t, u) => {
|
|
549
551
|
const { children: n, ...a } = t;
|
|
550
|
-
return /* @__PURE__ */ M(n) ? /* @__PURE__ */
|
|
552
|
+
return /* @__PURE__ */ M(n) ? /* @__PURE__ */ W(n, {
|
|
551
553
|
...dt(a, n.props),
|
|
552
554
|
ref: u ? lt(u, n.ref) : n.ref
|
|
553
555
|
}) : z.count(n) > 1 ? z.only(null) : null;
|
|
554
556
|
});
|
|
555
557
|
F.displayName = "SlotClone";
|
|
556
|
-
const st = ({ children: t }) => /* @__PURE__ */ A(
|
|
558
|
+
const st = ({ children: t }) => /* @__PURE__ */ A(mr, null, t);
|
|
557
559
|
function ct(t) {
|
|
558
560
|
return /* @__PURE__ */ M(t) && t.type === st;
|
|
559
561
|
}
|
|
@@ -597,8 +599,8 @@ const _t = [
|
|
|
597
599
|
"ul"
|
|
598
600
|
], ft = _t.reduce((t, u) => {
|
|
599
601
|
const n = /* @__PURE__ */ y((a, o) => {
|
|
600
|
-
const { asChild: r, ...e } = a, i = r ?
|
|
601
|
-
return
|
|
602
|
+
const { asChild: r, ...e } = a, i = r ? pr : u;
|
|
603
|
+
return xr(() => {
|
|
602
604
|
window[Symbol.for("radix-ui")] = !0;
|
|
603
605
|
}, []), /* @__PURE__ */ A(i, b({}, e, {
|
|
604
606
|
ref: o
|
|
@@ -618,7 +620,7 @@ const _t = [
|
|
|
618
620
|
function mt(t) {
|
|
619
621
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
620
622
|
}
|
|
621
|
-
var
|
|
623
|
+
var lr = { exports: {} };
|
|
622
624
|
/*!
|
|
623
625
|
Copyright (c) 2018 Jed Watson.
|
|
624
626
|
Licensed under the MIT License (MIT), see
|
|
@@ -653,9 +655,9 @@ var pr = { exports: {} };
|
|
|
653
655
|
}
|
|
654
656
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
655
657
|
})();
|
|
656
|
-
})(
|
|
657
|
-
var gt =
|
|
658
|
-
const bt = /* @__PURE__ */ mt(gt),
|
|
658
|
+
})(lr);
|
|
659
|
+
var gt = lr.exports;
|
|
660
|
+
const bt = /* @__PURE__ */ mt(gt), D = {
|
|
659
661
|
"purpur-label": "_purpur-label_12cfi_1",
|
|
660
662
|
"purpur-label--negative": "_purpur-label--negative_12cfi_9",
|
|
661
663
|
"purpur-label--disabled": "_purpur-label--disabled_12cfi_12"
|
|
@@ -670,10 +672,10 @@ const bt = /* @__PURE__ */ mt(gt), I = {
|
|
|
670
672
|
}) => {
|
|
671
673
|
const i = bt([
|
|
672
674
|
u,
|
|
673
|
-
|
|
675
|
+
D[E],
|
|
674
676
|
{
|
|
675
|
-
[
|
|
676
|
-
[
|
|
677
|
+
[D[`${E}--disabled`]]: o,
|
|
678
|
+
[D[`${E}--negative`]]: r
|
|
677
679
|
}
|
|
678
680
|
]);
|
|
679
681
|
return /* @__PURE__ */ p(xt, { className: i, "data-testid": a, htmlFor: n, ...e, children: t });
|
|
@@ -681,7 +683,7 @@ const bt = /* @__PURE__ */ mt(gt), I = {
|
|
|
681
683
|
function ht(t) {
|
|
682
684
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
683
685
|
}
|
|
684
|
-
var
|
|
686
|
+
var sr = { exports: {} };
|
|
685
687
|
/*!
|
|
686
688
|
Copyright (c) 2018 Jed Watson.
|
|
687
689
|
Licensed under the MIT License (MIT), see
|
|
@@ -716,9 +718,9 @@ var lr = { exports: {} };
|
|
|
716
718
|
}
|
|
717
719
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
718
720
|
})();
|
|
719
|
-
})(
|
|
720
|
-
var $t =
|
|
721
|
-
const
|
|
721
|
+
})(sr);
|
|
722
|
+
var $t = sr.exports;
|
|
723
|
+
const U = /* @__PURE__ */ ht($t), wt = "_rotate_1xozj_1", jt = "_dash_1xozj_1", N = {
|
|
722
724
|
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
723
725
|
rotate: wt,
|
|
724
726
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
|
|
@@ -745,13 +747,13 @@ const J = /* @__PURE__ */ ht($t), wt = "_rotate_1xozj_1", jt = "_dash_1xozj_1",
|
|
|
745
747
|
}) => /* @__PURE__ */ p(
|
|
746
748
|
"div",
|
|
747
749
|
{
|
|
748
|
-
className:
|
|
750
|
+
className: U([N[O], N[`${O}--${a}`]]),
|
|
749
751
|
"data-testid": t,
|
|
750
752
|
...o,
|
|
751
753
|
children: /* @__PURE__ */ p("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ p(
|
|
752
754
|
"circle",
|
|
753
755
|
{
|
|
754
|
-
className:
|
|
756
|
+
className: U(N[`${O}__circle`], {
|
|
755
757
|
[N[`${O}__circle--disabled`]]: u,
|
|
756
758
|
[N[`${O}__circle--negative`]]: n
|
|
757
759
|
}),
|
|
@@ -765,7 +767,7 @@ const J = /* @__PURE__ */ ht($t), wt = "_rotate_1xozj_1", jt = "_dash_1xozj_1",
|
|
|
765
767
|
function Ot(t) {
|
|
766
768
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
767
769
|
}
|
|
768
|
-
var
|
|
770
|
+
var cr = { exports: {} };
|
|
769
771
|
/*!
|
|
770
772
|
Copyright (c) 2018 Jed Watson.
|
|
771
773
|
Licensed under the MIT License (MIT), see
|
|
@@ -800,8 +802,8 @@ var sr = { exports: {} };
|
|
|
800
802
|
}
|
|
801
803
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
802
804
|
})();
|
|
803
|
-
})(
|
|
804
|
-
var zt =
|
|
805
|
+
})(cr);
|
|
806
|
+
var zt = cr.exports;
|
|
805
807
|
const Mt = /* @__PURE__ */ Ot(zt), At = {
|
|
806
808
|
"purpur-text-field": "_purpur-text-field_nj9f4_1",
|
|
807
809
|
"purpur-text-field__label": "_purpur-text-field__label_nj9f4_7",
|
|
@@ -819,7 +821,7 @@ const Mt = /* @__PURE__ */ Ot(zt), At = {
|
|
|
819
821
|
"purpur-text-field__input--error": "_purpur-text-field__input--error_nj9f4_94",
|
|
820
822
|
"purpur-text-field__adornment-container": "_purpur-text-field__adornment-container_nj9f4_106",
|
|
821
823
|
"purpur-text-field__valid-icon": "_purpur-text-field__valid-icon_nj9f4_111"
|
|
822
|
-
}, Ct = (t) =>
|
|
824
|
+
}, Ct = (t) => gr(t), _ = Mt.bind(At), s = "purpur-text-field", qt = ({
|
|
823
825
|
["data-testid"]: t,
|
|
824
826
|
className: u,
|
|
825
827
|
clearButtonAllyLabel: n,
|
|
@@ -834,13 +836,13 @@ const Mt = /* @__PURE__ */ Ot(zt), At = {
|
|
|
834
836
|
valid: C = !1,
|
|
835
837
|
...l
|
|
836
838
|
}, m) => {
|
|
837
|
-
var
|
|
838
|
-
const q =
|
|
839
|
-
|
|
840
|
-
},
|
|
839
|
+
var Z;
|
|
840
|
+
const q = br(), $ = l.id ?? q, c = (d) => t ? `${t}-${d}` : void 0, w = C && !r, I = e ? `${$}-helper-text` : void 0, L = [h].filter((d) => !!d), k = (typeof l.value == "number" ? l.value !== void 0 : (Z = l.value) == null ? void 0 : Z.length) && !l.disabled && !l.readOnly && !f && v && n, X = Ct(null), _r = (d) => {
|
|
841
|
+
X.current = d, typeof m == "function" ? m(d) : m && (m.current = d);
|
|
842
|
+
}, fr = () => {
|
|
841
843
|
var d;
|
|
842
|
-
v == null || v(), (d =
|
|
843
|
-
},
|
|
844
|
+
v == null || v(), (d = X.current) == null || d.focus();
|
|
845
|
+
}, B = [
|
|
844
846
|
f && /* @__PURE__ */ p(
|
|
845
847
|
Nt,
|
|
846
848
|
{
|
|
@@ -850,34 +852,34 @@ const Mt = /* @__PURE__ */ Ot(zt), At = {
|
|
|
850
852
|
},
|
|
851
853
|
"spinner"
|
|
852
854
|
),
|
|
853
|
-
|
|
854
|
-
|
|
855
|
+
k && /* @__PURE__ */ p(
|
|
856
|
+
rr,
|
|
855
857
|
{
|
|
856
858
|
variant: "tertiary-purple",
|
|
857
|
-
onClick:
|
|
859
|
+
onClick: fr,
|
|
858
860
|
iconOnly: !0,
|
|
859
861
|
"aria-label": n ?? "",
|
|
860
862
|
"data-testid": c("clear-button"),
|
|
861
863
|
tabIndex: -1,
|
|
862
|
-
children: /* @__PURE__ */ p(
|
|
864
|
+
children: /* @__PURE__ */ p(or, { size: "xs" })
|
|
863
865
|
},
|
|
864
866
|
"clear-button"
|
|
865
867
|
),
|
|
866
868
|
w && /* @__PURE__ */ p(
|
|
867
|
-
|
|
869
|
+
ar,
|
|
868
870
|
{
|
|
869
871
|
"data-testid": c("valid-icon"),
|
|
870
872
|
className: _(`${s}__valid-icon`)
|
|
871
873
|
},
|
|
872
874
|
"valid-icon"
|
|
873
875
|
)
|
|
874
|
-
].filter((d) => !!d),
|
|
876
|
+
].filter((d) => !!d), vr = _([
|
|
875
877
|
`${s}__input-container`,
|
|
876
878
|
{
|
|
877
|
-
[`${s}__input-container--start-adornment`]:
|
|
878
|
-
[`${s}__input-container--end-adornment`]:
|
|
879
|
+
[`${s}__input-container--start-adornment`]: L.length,
|
|
880
|
+
[`${s}__input-container--end-adornment`]: B.length || o,
|
|
879
881
|
[`${s}__input-container--disabled`]: l.disabled,
|
|
880
|
-
[`${s}__input-container--has-clear-button`]:
|
|
882
|
+
[`${s}__input-container--has-clear-button`]: k,
|
|
881
883
|
[`${s}__input-container--readonly`]: l.readOnly && !l.disabled
|
|
882
884
|
}
|
|
883
885
|
]);
|
|
@@ -893,13 +895,13 @@ const Mt = /* @__PURE__ */ Ot(zt), At = {
|
|
|
893
895
|
}
|
|
894
896
|
),
|
|
895
897
|
/* @__PURE__ */ g("div", { className: _(`${s}__field-row`), children: [
|
|
896
|
-
/* @__PURE__ */ g("div", { className:
|
|
897
|
-
!!
|
|
898
|
+
/* @__PURE__ */ g("div", { className: vr, children: [
|
|
899
|
+
!!L.length && /* @__PURE__ */ p(
|
|
898
900
|
"div",
|
|
899
901
|
{
|
|
900
902
|
"data-testid": c("start-adornments"),
|
|
901
903
|
className: _(`${s}__adornment-container`),
|
|
902
|
-
children:
|
|
904
|
+
children: L
|
|
903
905
|
}
|
|
904
906
|
),
|
|
905
907
|
/* @__PURE__ */ p(
|
|
@@ -907,9 +909,9 @@ const Mt = /* @__PURE__ */ Ot(zt), At = {
|
|
|
907
909
|
{
|
|
908
910
|
...l,
|
|
909
911
|
id: $,
|
|
910
|
-
ref:
|
|
912
|
+
ref: _r,
|
|
911
913
|
"data-testid": c("input"),
|
|
912
|
-
"aria-describedby": l["aria-describedby"] ||
|
|
914
|
+
"aria-describedby": l["aria-describedby"] || I,
|
|
913
915
|
"aria-invalid": l["aria-invalid"] || !!r,
|
|
914
916
|
className: _([
|
|
915
917
|
`${s}__input`,
|
|
@@ -921,13 +923,13 @@ const Mt = /* @__PURE__ */ Ot(zt), At = {
|
|
|
921
923
|
}
|
|
922
924
|
),
|
|
923
925
|
/* @__PURE__ */ p("div", { className: _(`${s}__frame`) }),
|
|
924
|
-
(!!
|
|
926
|
+
(!!B.length || o) && /* @__PURE__ */ g(
|
|
925
927
|
"div",
|
|
926
928
|
{
|
|
927
929
|
"data-testid": c("end-adornments"),
|
|
928
930
|
className: _(`${s}__adornment-container`),
|
|
929
931
|
children: [
|
|
930
|
-
|
|
932
|
+
B,
|
|
931
933
|
o
|
|
932
934
|
]
|
|
933
935
|
}
|
|
@@ -935,14 +937,14 @@ const Mt = /* @__PURE__ */ Ot(zt), At = {
|
|
|
935
937
|
] }),
|
|
936
938
|
!!a && a
|
|
937
939
|
] }),
|
|
938
|
-
|
|
940
|
+
I && /* @__PURE__ */ p(Ur, { "data-testid": c("helper-text"), id: I, children: e }),
|
|
939
941
|
r && /* @__PURE__ */ p(Gr, { "data-testid": c("error-text"), children: r })
|
|
940
942
|
] });
|
|
941
|
-
},
|
|
942
|
-
|
|
943
|
-
const Et = (t) => M(t) && t.type.displayName ===
|
|
943
|
+
}, dr = y(qt);
|
|
944
|
+
dr.displayName = "TextField";
|
|
945
|
+
const Et = (t) => M(t) && t.type.displayName === dr.displayName;
|
|
944
946
|
export {
|
|
945
|
-
|
|
947
|
+
dr as TextField,
|
|
946
948
|
Et as isTextField
|
|
947
949
|
};
|
|
948
950
|
//# sourceMappingURL=text-field.es.js.map
|