@purpurds/text-field 6.12.5 → 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 +6 -6
- package/dist/styles.css +1 -1
- package/dist/text-field.cjs.js +10 -10
- package/dist/text-field.cjs.js.map +1 -1
- package/dist/text-field.d.ts +2 -2
- package/dist/text-field.d.ts.map +1 -1
- package/dist/text-field.es.js +167 -167
- package/dist/text-field.es.js.map +1 -1
- package/package.json +8 -8
- package/src/text-field.module.scss +9 -10
- package/src/text-field.test.tsx +2 -2
- package/src/text-field.tsx +7 -6
package/dist/text-field.es.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as x, jsx as o, Fragment as jr } from "react/jsx-runtime";
|
|
2
2
|
import * as c from "react";
|
|
3
3
|
import { forwardRef as _r, useRef as Sr, useId as Nr, isValidElement as Or } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
const
|
|
5
|
+
const qr = {
|
|
6
6
|
LG: "lg"
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function zr(t) {
|
|
9
9
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
10
10
|
}
|
|
11
|
-
var
|
|
11
|
+
var F = { exports: {} };
|
|
12
12
|
/*!
|
|
13
13
|
Copyright (c) 2018 Jed Watson.
|
|
14
14
|
Licensed under the MIT License (MIT), see
|
|
@@ -22,7 +22,7 @@ function kr() {
|
|
|
22
22
|
function n() {
|
|
23
23
|
for (var r = "", e = 0; e < arguments.length; e++) {
|
|
24
24
|
var i = arguments[e];
|
|
25
|
-
i && (r =
|
|
25
|
+
i && (r = l(r, a(i)));
|
|
26
26
|
}
|
|
27
27
|
return r;
|
|
28
28
|
}
|
|
@@ -37,18 +37,18 @@ function kr() {
|
|
|
37
37
|
return r.toString();
|
|
38
38
|
var e = "";
|
|
39
39
|
for (var i in r)
|
|
40
|
-
u.call(r, i) && r[i] && (e =
|
|
40
|
+
u.call(r, i) && r[i] && (e = l(e, i));
|
|
41
41
|
return e;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function l(r, e) {
|
|
44
44
|
return e ? r ? r + " " + e : r + e : r;
|
|
45
45
|
}
|
|
46
46
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
47
47
|
})();
|
|
48
|
-
}(
|
|
48
|
+
}(F)), F.exports;
|
|
49
49
|
}
|
|
50
50
|
var Mr = kr();
|
|
51
|
-
const Z = /* @__PURE__ */
|
|
51
|
+
const Z = /* @__PURE__ */ zr(Mr), Cr = "_rotate_1xozj_1", Ar = "_dash_1xozj_1", $ = {
|
|
52
52
|
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
53
53
|
rotate: Cr,
|
|
54
54
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
|
|
@@ -67,14 +67,14 @@ const Z = /* @__PURE__ */ qr(Mr), Cr = "_rotate_1xozj_1", Ar = "_dash_1xozj_1",
|
|
|
67
67
|
disabled: u = !1,
|
|
68
68
|
negative: n = !1,
|
|
69
69
|
size: a = Rr.SM,
|
|
70
|
-
...
|
|
71
|
-
}) => /* @__PURE__ */
|
|
70
|
+
...l
|
|
71
|
+
}) => /* @__PURE__ */ o(
|
|
72
72
|
"div",
|
|
73
73
|
{
|
|
74
74
|
className: Z([$[w], $[`${w}--${a}`]]),
|
|
75
75
|
"data-testid": t,
|
|
76
|
-
...
|
|
77
|
-
children: /* @__PURE__ */
|
|
76
|
+
...l,
|
|
77
|
+
children: /* @__PURE__ */ o("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ o(
|
|
78
78
|
"circle",
|
|
79
79
|
{
|
|
80
80
|
className: Z($[`${w}__circle`], {
|
|
@@ -105,7 +105,7 @@ function Er() {
|
|
|
105
105
|
function n() {
|
|
106
106
|
for (var r = "", e = 0; e < arguments.length; e++) {
|
|
107
107
|
var i = arguments[e];
|
|
108
|
-
i && (r =
|
|
108
|
+
i && (r = l(r, a.call(this, i)));
|
|
109
109
|
}
|
|
110
110
|
return r;
|
|
111
111
|
}
|
|
@@ -120,10 +120,10 @@ function Er() {
|
|
|
120
120
|
return r.toString();
|
|
121
121
|
var e = "";
|
|
122
122
|
for (var i in r)
|
|
123
|
-
u.call(r, i) && r[i] && (e =
|
|
123
|
+
u.call(r, i) && r[i] && (e = l(e, this && this[i] || i));
|
|
124
124
|
return e;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function l(r, e) {
|
|
127
127
|
return e ? r ? r + " " + e : r + e : r;
|
|
128
128
|
}
|
|
129
129
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
@@ -131,7 +131,7 @@ function Er() {
|
|
|
131
131
|
}(T)), T.exports;
|
|
132
132
|
}
|
|
133
133
|
var Pr = Er();
|
|
134
|
-
const Vr = /* @__PURE__ */ Ir(Pr),
|
|
134
|
+
const Vr = /* @__PURE__ */ Ir(Pr), Dr = {
|
|
135
135
|
"purpur-button": "_purpur-button_w455q_1",
|
|
136
136
|
"purpur-button--xs": "_purpur-button--xs_w455q_33",
|
|
137
137
|
"purpur-button--icon-only": "_purpur-button--icon-only_w455q_36",
|
|
@@ -153,51 +153,51 @@ const Vr = /* @__PURE__ */ Ir(Pr), Fr = {
|
|
|
153
153
|
"purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_w455q_166",
|
|
154
154
|
"purpur-button--text-negative": "_purpur-button--text-negative_w455q_181",
|
|
155
155
|
"purpur-button--text": "_purpur-button--text_w455q_181"
|
|
156
|
-
},
|
|
156
|
+
}, Fr = Vr.bind(Dr), m = "purpur-button", Lr = ({
|
|
157
157
|
children: t,
|
|
158
158
|
className: u,
|
|
159
159
|
["data-testid"]: n,
|
|
160
160
|
disabled: a = !1,
|
|
161
|
-
fullWidth:
|
|
161
|
+
fullWidth: l = !1,
|
|
162
162
|
iconOnly: r,
|
|
163
163
|
loading: e = !1,
|
|
164
164
|
negative: i = !1,
|
|
165
165
|
onClick: v,
|
|
166
166
|
size: h = "md",
|
|
167
|
-
variant:
|
|
167
|
+
variant: g,
|
|
168
168
|
type: O = "button",
|
|
169
169
|
...N
|
|
170
170
|
}, p) => {
|
|
171
|
-
if (r &&
|
|
171
|
+
if (r && g === "destructive")
|
|
172
172
|
return null;
|
|
173
|
-
const
|
|
173
|
+
const y = Fr(
|
|
174
174
|
[
|
|
175
|
-
|
|
176
|
-
`${
|
|
177
|
-
`${
|
|
175
|
+
m,
|
|
176
|
+
`${m}--${i ? `${g}-negative` : g}`,
|
|
177
|
+
`${m}--${h}`
|
|
178
178
|
],
|
|
179
179
|
{
|
|
180
|
-
[`${
|
|
181
|
-
[`${
|
|
182
|
-
[`${
|
|
183
|
-
[`${
|
|
180
|
+
[`${m}--icon-only`]: r,
|
|
181
|
+
[`${m}--negative`]: i,
|
|
182
|
+
[`${m}--full-width`]: l,
|
|
183
|
+
[`${m}--disabled`]: a || e
|
|
184
184
|
},
|
|
185
185
|
u
|
|
186
|
-
),
|
|
186
|
+
), q = (d) => {
|
|
187
187
|
a || e ? d.preventDefault() : v && v(d);
|
|
188
|
-
},
|
|
189
|
-
return /* @__PURE__ */
|
|
188
|
+
}, b = !!N["aria-disabled"] || a || e;
|
|
189
|
+
return /* @__PURE__ */ x(
|
|
190
190
|
"button",
|
|
191
191
|
{
|
|
192
|
-
className:
|
|
192
|
+
className: y,
|
|
193
193
|
"data-testid": n,
|
|
194
194
|
type: O,
|
|
195
195
|
ref: p,
|
|
196
|
-
"aria-disabled":
|
|
197
|
-
onClick:
|
|
196
|
+
"aria-disabled": b,
|
|
197
|
+
onClick: q,
|
|
198
198
|
...N,
|
|
199
199
|
children: [
|
|
200
|
-
e && /* @__PURE__ */
|
|
200
|
+
e && /* @__PURE__ */ o(Br, { size: h === qr.LG ? "xs" : "xxs", negative: i, disabled: b }),
|
|
201
201
|
" ",
|
|
202
202
|
t
|
|
203
203
|
]
|
|
@@ -222,7 +222,7 @@ function Tr() {
|
|
|
222
222
|
function n() {
|
|
223
223
|
for (var r = "", e = 0; e < arguments.length; e++) {
|
|
224
224
|
var i = arguments[e];
|
|
225
|
-
i && (r =
|
|
225
|
+
i && (r = l(r, a.call(this, i)));
|
|
226
226
|
}
|
|
227
227
|
return r;
|
|
228
228
|
}
|
|
@@ -237,10 +237,10 @@ function Tr() {
|
|
|
237
237
|
return r.toString();
|
|
238
238
|
var e = "";
|
|
239
239
|
for (var i in r)
|
|
240
|
-
u.call(r, i) && r[i] && (e =
|
|
240
|
+
u.call(r, i) && r[i] && (e = l(e, this && this[i] || i));
|
|
241
241
|
return e;
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function l(r, e) {
|
|
244
244
|
return e ? r ? r + " " + e : r + e : r;
|
|
245
245
|
}
|
|
246
246
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
@@ -269,17 +269,16 @@ const Gr = /* @__PURE__ */ Zr(Wr), Hr = {
|
|
|
269
269
|
svg: u,
|
|
270
270
|
allyTitle: n,
|
|
271
271
|
className: a,
|
|
272
|
-
size:
|
|
272
|
+
size: l = Xr,
|
|
273
273
|
...r
|
|
274
274
|
}) => {
|
|
275
275
|
const e = Jr({
|
|
276
276
|
content: Kr(u.svg),
|
|
277
277
|
title: n
|
|
278
|
-
}), i = Ur(a, U, `${U}--${
|
|
279
|
-
return /* @__PURE__ */
|
|
278
|
+
}), i = Ur(a, U, `${U}--${l}`);
|
|
279
|
+
return /* @__PURE__ */ o(
|
|
280
280
|
"span",
|
|
281
281
|
{
|
|
282
|
-
"aria-label": n,
|
|
283
282
|
className: i,
|
|
284
283
|
"data-testid": t,
|
|
285
284
|
dangerouslySetInnerHTML: { __html: e },
|
|
@@ -311,7 +310,7 @@ function tt() {
|
|
|
311
310
|
function n() {
|
|
312
311
|
for (var r = "", e = 0; e < arguments.length; e++) {
|
|
313
312
|
var i = arguments[e];
|
|
314
|
-
i && (r =
|
|
313
|
+
i && (r = l(r, a(i)));
|
|
315
314
|
}
|
|
316
315
|
return r;
|
|
317
316
|
}
|
|
@@ -326,10 +325,10 @@ function tt() {
|
|
|
326
325
|
return r.toString();
|
|
327
326
|
var e = "";
|
|
328
327
|
for (var i in r)
|
|
329
|
-
u.call(r, i) && r[i] && (e =
|
|
328
|
+
u.call(r, i) && r[i] && (e = l(e, i));
|
|
330
329
|
return e;
|
|
331
330
|
}
|
|
332
|
-
function
|
|
331
|
+
function l(r, e) {
|
|
333
332
|
return e ? r ? r + " " + e : r + e : r;
|
|
334
333
|
}
|
|
335
334
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
@@ -343,9 +342,9 @@ const nt = /* @__PURE__ */ rt(et), J = {
|
|
|
343
342
|
}, K = "purpur-field-error-text", it = ({
|
|
344
343
|
children: t,
|
|
345
344
|
className: u,
|
|
346
|
-
relevant: n = "additions text",
|
|
345
|
+
["aria-relevant"]: n = "additions text",
|
|
347
346
|
...a
|
|
348
|
-
}) => /* @__PURE__ */
|
|
347
|
+
}) => /* @__PURE__ */ x(
|
|
349
348
|
"div",
|
|
350
349
|
{
|
|
351
350
|
className: nt([u, J[K]]),
|
|
@@ -353,7 +352,7 @@ const nt = /* @__PURE__ */ rt(et), J = {
|
|
|
353
352
|
"aria-relevant": n,
|
|
354
353
|
...a,
|
|
355
354
|
children: [
|
|
356
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ o(vr, { svg: Qr, size: "xs", className: J[`${K}__icon`] }),
|
|
357
356
|
t
|
|
358
357
|
]
|
|
359
358
|
}
|
|
@@ -375,7 +374,7 @@ function at() {
|
|
|
375
374
|
function n() {
|
|
376
375
|
for (var r = "", e = 0; e < arguments.length; e++) {
|
|
377
376
|
var i = arguments[e];
|
|
378
|
-
i && (r =
|
|
377
|
+
i && (r = l(r, a(i)));
|
|
379
378
|
}
|
|
380
379
|
return r;
|
|
381
380
|
}
|
|
@@ -390,18 +389,18 @@ function at() {
|
|
|
390
389
|
return r.toString();
|
|
391
390
|
var e = "";
|
|
392
391
|
for (var i in r)
|
|
393
|
-
u.call(r, i) && r[i] && (e =
|
|
392
|
+
u.call(r, i) && r[i] && (e = l(e, i));
|
|
394
393
|
return e;
|
|
395
394
|
}
|
|
396
|
-
function
|
|
395
|
+
function l(r, e) {
|
|
397
396
|
return e ? r ? r + " " + e : r + e : r;
|
|
398
397
|
}
|
|
399
398
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
400
399
|
})();
|
|
401
400
|
}(Q)), Q.exports;
|
|
402
401
|
}
|
|
403
|
-
var
|
|
404
|
-
const
|
|
402
|
+
var lt = at();
|
|
403
|
+
const ot = /* @__PURE__ */ ut(lt), tr = {
|
|
405
404
|
"purpur-field-helper-text": "_purpur-field-helper-text_atw6b_1",
|
|
406
405
|
"purpur-field-helper-text--disabled": "_purpur-field-helper-text--disabled_atw6b_9"
|
|
407
406
|
}, er = "purpur-field-helper-text", pt = ({
|
|
@@ -409,16 +408,16 @@ const lt = /* @__PURE__ */ ut(ot), tr = {
|
|
|
409
408
|
className: u,
|
|
410
409
|
disabled: n,
|
|
411
410
|
id: a,
|
|
412
|
-
...
|
|
411
|
+
...l
|
|
413
412
|
}) => {
|
|
414
|
-
const r =
|
|
413
|
+
const r = ot([
|
|
415
414
|
u,
|
|
416
415
|
tr[er],
|
|
417
416
|
{
|
|
418
417
|
[tr[`${er}--disabled`]]: n
|
|
419
418
|
}
|
|
420
419
|
]);
|
|
421
|
-
return /* @__PURE__ */
|
|
420
|
+
return /* @__PURE__ */ o("span", { id: a, className: r, ...l, children: t });
|
|
422
421
|
};
|
|
423
422
|
function st(t) {
|
|
424
423
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
@@ -437,7 +436,7 @@ function ct() {
|
|
|
437
436
|
function n() {
|
|
438
437
|
for (var r = "", e = 0; e < arguments.length; e++) {
|
|
439
438
|
var i = arguments[e];
|
|
440
|
-
i && (r =
|
|
439
|
+
i && (r = l(r, a.call(this, i)));
|
|
441
440
|
}
|
|
442
441
|
return r;
|
|
443
442
|
}
|
|
@@ -452,10 +451,10 @@ function ct() {
|
|
|
452
451
|
return r.toString();
|
|
453
452
|
var e = "";
|
|
454
453
|
for (var i in r)
|
|
455
|
-
u.call(r, i) && r[i] && (e =
|
|
454
|
+
u.call(r, i) && r[i] && (e = l(e, this && this[i] || i));
|
|
456
455
|
return e;
|
|
457
456
|
}
|
|
458
|
-
function
|
|
457
|
+
function l(r, e) {
|
|
459
458
|
return e ? r ? r + " " + e : r + e : r;
|
|
460
459
|
}
|
|
461
460
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
@@ -471,30 +470,29 @@ const _t = /* @__PURE__ */ st(dt), ft = {
|
|
|
471
470
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
472
471
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
473
472
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
474
|
-
}, vt = _t.bind(ft), ur = "purpur-icon",
|
|
473
|
+
}, vt = _t.bind(ft), ur = "purpur-icon", gt = "md", mt = (t) => t.filter((u) => Object.keys(u).length >= 1).map((u) => `${u.name}="${u.value}"`).join(" "), xt = ({ content: t = "", title: u } = {}) => {
|
|
475
474
|
const n = [
|
|
476
475
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
477
476
|
{ name: "fill", value: "currentColor" },
|
|
478
477
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
479
478
|
u ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
480
479
|
], a = u ? `<title>${u}</title>` : "";
|
|
481
|
-
return `<svg ${
|
|
480
|
+
return `<svg ${mt(n)}>${a}${t}</svg>`;
|
|
482
481
|
}, yt = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), I = ({
|
|
483
482
|
["data-testid"]: t,
|
|
484
483
|
svg: u,
|
|
485
484
|
allyTitle: n,
|
|
486
485
|
className: a,
|
|
487
|
-
size:
|
|
486
|
+
size: l = gt,
|
|
488
487
|
...r
|
|
489
488
|
}) => {
|
|
490
489
|
const e = xt({
|
|
491
490
|
content: yt(u.svg),
|
|
492
491
|
title: n
|
|
493
|
-
}), i = vt(a, ur, `${ur}--${
|
|
494
|
-
return /* @__PURE__ */
|
|
492
|
+
}), i = vt(a, ur, `${ur}--${l}`);
|
|
493
|
+
return /* @__PURE__ */ o(
|
|
495
494
|
"span",
|
|
496
495
|
{
|
|
497
|
-
"aria-label": n,
|
|
498
496
|
className: i,
|
|
499
497
|
"data-testid": t,
|
|
500
498
|
dangerouslySetInnerHTML: { __html: e },
|
|
@@ -508,15 +506,15 @@ const bt = {
|
|
|
508
506
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm4.712-12.491a.875.875 0 1 0-1.424-1.018l-4.4 6.16-2.27-2.27a.875.875 0 0 0-1.237 1.238l3 3a.875.875 0 0 0 1.331-.11l5-7Z" clip-rule="evenodd"/></svg>',
|
|
509
507
|
keywords: ["check-circle-filled"],
|
|
510
508
|
category: "status"
|
|
511
|
-
},
|
|
512
|
-
|
|
509
|
+
}, gr = (t) => /* @__PURE__ */ o(I, { ...t, svg: bt });
|
|
510
|
+
gr.displayName = "IconCheckCircleFilled";
|
|
513
511
|
const ht = {
|
|
514
512
|
name: "close",
|
|
515
513
|
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>',
|
|
516
514
|
keywords: ["close"],
|
|
517
515
|
category: "utility"
|
|
518
|
-
},
|
|
519
|
-
|
|
516
|
+
}, mr = (t) => /* @__PURE__ */ o(I, { ...t, svg: ht });
|
|
517
|
+
mr.displayName = "IconClose";
|
|
520
518
|
function ar(t, u) {
|
|
521
519
|
if (typeof t == "function")
|
|
522
520
|
return t(u);
|
|
@@ -525,55 +523,55 @@ function ar(t, u) {
|
|
|
525
523
|
function $t(...t) {
|
|
526
524
|
return (u) => {
|
|
527
525
|
let n = !1;
|
|
528
|
-
const a = t.map((
|
|
529
|
-
const r = ar(
|
|
526
|
+
const a = t.map((l) => {
|
|
527
|
+
const r = ar(l, u);
|
|
530
528
|
return !n && typeof r == "function" && (n = !0), r;
|
|
531
529
|
});
|
|
532
530
|
if (n)
|
|
533
531
|
return () => {
|
|
534
|
-
for (let
|
|
535
|
-
const r = a[
|
|
536
|
-
typeof r == "function" ? r() : ar(t[
|
|
532
|
+
for (let l = 0; l < a.length; l++) {
|
|
533
|
+
const r = a[l];
|
|
534
|
+
typeof r == "function" ? r() : ar(t[l], null);
|
|
537
535
|
}
|
|
538
536
|
};
|
|
539
537
|
};
|
|
540
538
|
}
|
|
541
539
|
var xr = c.forwardRef((t, u) => {
|
|
542
|
-
const { children: n, ...a } = t,
|
|
540
|
+
const { children: n, ...a } = t, l = c.Children.toArray(n), r = l.find(jt);
|
|
543
541
|
if (r) {
|
|
544
|
-
const e = r.props.children, i =
|
|
545
|
-
return /* @__PURE__ */
|
|
542
|
+
const e = r.props.children, i = l.map((v) => v === r ? c.Children.count(e) > 1 ? c.Children.only(null) : c.isValidElement(e) ? e.props.children : null : v);
|
|
543
|
+
return /* @__PURE__ */ o(B, { ...a, ref: u, children: c.isValidElement(e) ? c.cloneElement(e, void 0, i) : null });
|
|
546
544
|
}
|
|
547
|
-
return /* @__PURE__ */
|
|
545
|
+
return /* @__PURE__ */ o(B, { ...a, ref: u, children: n });
|
|
548
546
|
});
|
|
549
547
|
xr.displayName = "Slot";
|
|
550
548
|
var B = c.forwardRef((t, u) => {
|
|
551
549
|
const { children: n, ...a } = t;
|
|
552
550
|
if (c.isValidElement(n)) {
|
|
553
|
-
const
|
|
554
|
-
return n.type !== c.Fragment && (r.ref = u ? $t(u,
|
|
551
|
+
const l = Nt(n), r = St(a, n.props);
|
|
552
|
+
return n.type !== c.Fragment && (r.ref = u ? $t(u, l) : l), c.cloneElement(n, r);
|
|
555
553
|
}
|
|
556
554
|
return c.Children.count(n) > 1 ? c.Children.only(null) : null;
|
|
557
555
|
});
|
|
558
556
|
B.displayName = "SlotClone";
|
|
559
|
-
var wt = ({ children: t }) => /* @__PURE__ */
|
|
557
|
+
var wt = ({ children: t }) => /* @__PURE__ */ o(jr, { children: t });
|
|
560
558
|
function jt(t) {
|
|
561
559
|
return c.isValidElement(t) && t.type === wt;
|
|
562
560
|
}
|
|
563
561
|
function St(t, u) {
|
|
564
562
|
const n = { ...u };
|
|
565
563
|
for (const a in u) {
|
|
566
|
-
const
|
|
567
|
-
/^on[A-Z]/.test(a) ?
|
|
568
|
-
r(...e),
|
|
569
|
-
} :
|
|
564
|
+
const l = t[a], r = u[a];
|
|
565
|
+
/^on[A-Z]/.test(a) ? l && r ? n[a] = (...e) => {
|
|
566
|
+
r(...e), l(...e);
|
|
567
|
+
} : l && (n[a] = l) : a === "style" ? n[a] = { ...l, ...r } : a === "className" && (n[a] = [l, r].filter(Boolean).join(" "));
|
|
570
568
|
}
|
|
571
569
|
return { ...t, ...n };
|
|
572
570
|
}
|
|
573
571
|
function Nt(t) {
|
|
574
572
|
var u, n;
|
|
575
|
-
let a = (u = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : u.get,
|
|
576
|
-
return
|
|
573
|
+
let a = (u = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : u.get, l = a && "isReactWarning" in a && a.isReactWarning;
|
|
574
|
+
return l ? t.ref : (a = (n = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : n.get, l = a && "isReactWarning" in a && a.isReactWarning, l ? t.props.ref : t.props.ref || t.ref);
|
|
577
575
|
}
|
|
578
576
|
var Ot = [
|
|
579
577
|
"a",
|
|
@@ -592,14 +590,14 @@ var Ot = [
|
|
|
592
590
|
"span",
|
|
593
591
|
"svg",
|
|
594
592
|
"ul"
|
|
595
|
-
],
|
|
596
|
-
const n = c.forwardRef((a,
|
|
593
|
+
], qt = Ot.reduce((t, u) => {
|
|
594
|
+
const n = c.forwardRef((a, l) => {
|
|
597
595
|
const { asChild: r, ...e } = a, i = r ? xr : u;
|
|
598
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */
|
|
596
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ o(i, { ...e, ref: l });
|
|
599
597
|
});
|
|
600
598
|
return n.displayName = `Primitive.${u}`, { ...t, [u]: n };
|
|
601
|
-
}, {}),
|
|
602
|
-
|
|
599
|
+
}, {}), zt = "Label", yr = c.forwardRef((t, u) => /* @__PURE__ */ o(
|
|
600
|
+
qt.label,
|
|
603
601
|
{
|
|
604
602
|
...t,
|
|
605
603
|
ref: u,
|
|
@@ -609,26 +607,26 @@ var Ot = [
|
|
|
609
607
|
}
|
|
610
608
|
}
|
|
611
609
|
));
|
|
612
|
-
yr.displayName =
|
|
610
|
+
yr.displayName = zt;
|
|
613
611
|
var kt = yr;
|
|
614
612
|
function Mt(t) {
|
|
615
613
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
616
614
|
}
|
|
617
|
-
var
|
|
615
|
+
var lr = { exports: {} };
|
|
618
616
|
/*!
|
|
619
617
|
Copyright (c) 2018 Jed Watson.
|
|
620
618
|
Licensed under the MIT License (MIT), see
|
|
621
619
|
http://jedwatson.github.io/classnames
|
|
622
620
|
*/
|
|
623
|
-
var
|
|
621
|
+
var or;
|
|
624
622
|
function Ct() {
|
|
625
|
-
return
|
|
623
|
+
return or || (or = 1, function(t) {
|
|
626
624
|
(function() {
|
|
627
625
|
var u = {}.hasOwnProperty;
|
|
628
626
|
function n() {
|
|
629
627
|
for (var r = "", e = 0; e < arguments.length; e++) {
|
|
630
628
|
var i = arguments[e];
|
|
631
|
-
i && (r =
|
|
629
|
+
i && (r = l(r, a(i)));
|
|
632
630
|
}
|
|
633
631
|
return r;
|
|
634
632
|
}
|
|
@@ -643,15 +641,15 @@ function Ct() {
|
|
|
643
641
|
return r.toString();
|
|
644
642
|
var e = "";
|
|
645
643
|
for (var i in r)
|
|
646
|
-
u.call(r, i) && r[i] && (e =
|
|
644
|
+
u.call(r, i) && r[i] && (e = l(e, i));
|
|
647
645
|
return e;
|
|
648
646
|
}
|
|
649
|
-
function
|
|
647
|
+
function l(r, e) {
|
|
650
648
|
return e ? r ? r + " " + e : r + e : r;
|
|
651
649
|
}
|
|
652
650
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
653
651
|
})();
|
|
654
|
-
}(
|
|
652
|
+
}(lr)), lr.exports;
|
|
655
653
|
}
|
|
656
654
|
var At = Ct();
|
|
657
655
|
const Rt = /* @__PURE__ */ Mt(At), C = {
|
|
@@ -661,20 +659,19 @@ const Rt = /* @__PURE__ */ Mt(At), C = {
|
|
|
661
659
|
}, A = "purpur-label", Bt = ({
|
|
662
660
|
children: t,
|
|
663
661
|
className: u,
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
...r
|
|
662
|
+
disabled: n,
|
|
663
|
+
negative: a = !1,
|
|
664
|
+
...l
|
|
668
665
|
}) => {
|
|
669
|
-
const
|
|
666
|
+
const r = Rt([
|
|
670
667
|
u,
|
|
671
668
|
C[A],
|
|
672
669
|
{
|
|
673
|
-
[C[`${A}--disabled`]]:
|
|
674
|
-
[C[`${A}--negative`]]:
|
|
670
|
+
[C[`${A}--disabled`]]: n,
|
|
671
|
+
[C[`${A}--negative`]]: a
|
|
675
672
|
}
|
|
676
673
|
]);
|
|
677
|
-
return /* @__PURE__ */
|
|
674
|
+
return /* @__PURE__ */ o(kt, { className: r, ...l, children: t });
|
|
678
675
|
};
|
|
679
676
|
function It(t) {
|
|
680
677
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
@@ -693,7 +690,7 @@ function Et() {
|
|
|
693
690
|
function n() {
|
|
694
691
|
for (var r = "", e = 0; e < arguments.length; e++) {
|
|
695
692
|
var i = arguments[e];
|
|
696
|
-
i && (r =
|
|
693
|
+
i && (r = l(r, a(i)));
|
|
697
694
|
}
|
|
698
695
|
return r;
|
|
699
696
|
}
|
|
@@ -708,10 +705,10 @@ function Et() {
|
|
|
708
705
|
return r.toString();
|
|
709
706
|
var e = "";
|
|
710
707
|
for (var i in r)
|
|
711
|
-
u.call(r, i) && r[i] && (e =
|
|
708
|
+
u.call(r, i) && r[i] && (e = l(e, i));
|
|
712
709
|
return e;
|
|
713
710
|
}
|
|
714
|
-
function
|
|
711
|
+
function l(r, e) {
|
|
715
712
|
return e ? r ? r + " " + e : r + e : r;
|
|
716
713
|
}
|
|
717
714
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
@@ -719,7 +716,7 @@ function Et() {
|
|
|
719
716
|
}(pr)), pr.exports;
|
|
720
717
|
}
|
|
721
718
|
var Pt = Et();
|
|
722
|
-
const cr = /* @__PURE__ */ It(Pt), Vt = "_rotate_1xozj_1",
|
|
719
|
+
const cr = /* @__PURE__ */ It(Pt), Vt = "_rotate_1xozj_1", Dt = "_dash_1xozj_1", j = {
|
|
723
720
|
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
724
721
|
rotate: Vt,
|
|
725
722
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
|
|
@@ -728,24 +725,24 @@ const cr = /* @__PURE__ */ It(Pt), Vt = "_rotate_1xozj_1", Ft = "_dash_1xozj_1",
|
|
|
728
725
|
"purpur-spinner--md": "_purpur-spinner--md_1xozj_16",
|
|
729
726
|
"purpur-spinner--lg": "_purpur-spinner--lg_1xozj_20",
|
|
730
727
|
"purpur-spinner__circle": "_purpur-spinner__circle_1xozj_24",
|
|
731
|
-
dash:
|
|
728
|
+
dash: Dt,
|
|
732
729
|
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_1xozj_33",
|
|
733
730
|
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_1xozj_36"
|
|
734
|
-
}, S = "purpur-spinner",
|
|
731
|
+
}, S = "purpur-spinner", Ft = {
|
|
735
732
|
SM: "sm"
|
|
736
733
|
}, Lt = ({
|
|
737
734
|
["data-testid"]: t,
|
|
738
735
|
disabled: u = !1,
|
|
739
736
|
negative: n = !1,
|
|
740
|
-
size: a =
|
|
741
|
-
...
|
|
742
|
-
}) => /* @__PURE__ */
|
|
737
|
+
size: a = Ft.SM,
|
|
738
|
+
...l
|
|
739
|
+
}) => /* @__PURE__ */ o(
|
|
743
740
|
"div",
|
|
744
741
|
{
|
|
745
742
|
className: cr([j[S], j[`${S}--${a}`]]),
|
|
746
743
|
"data-testid": t,
|
|
747
|
-
...
|
|
748
|
-
children: /* @__PURE__ */
|
|
744
|
+
...l,
|
|
745
|
+
children: /* @__PURE__ */ o("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ o(
|
|
749
746
|
"circle",
|
|
750
747
|
{
|
|
751
748
|
className: cr(j[`${S}__circle`], {
|
|
@@ -776,7 +773,7 @@ function Tt() {
|
|
|
776
773
|
function n() {
|
|
777
774
|
for (var r = "", e = 0; e < arguments.length; e++) {
|
|
778
775
|
var i = arguments[e];
|
|
779
|
-
i && (r =
|
|
776
|
+
i && (r = l(r, a.call(this, i)));
|
|
780
777
|
}
|
|
781
778
|
return r;
|
|
782
779
|
}
|
|
@@ -791,10 +788,10 @@ function Tt() {
|
|
|
791
788
|
return r.toString();
|
|
792
789
|
var e = "";
|
|
793
790
|
for (var i in r)
|
|
794
|
-
u.call(r, i) && r[i] && (e =
|
|
791
|
+
u.call(r, i) && r[i] && (e = l(e, this && this[i] || i));
|
|
795
792
|
return e;
|
|
796
793
|
}
|
|
797
|
-
function
|
|
794
|
+
function l(r, e) {
|
|
798
795
|
return e ? r ? r + " " + e : r + e : r;
|
|
799
796
|
}
|
|
800
797
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
@@ -803,46 +800,46 @@ function Tt() {
|
|
|
803
800
|
}
|
|
804
801
|
var Wt = Tt();
|
|
805
802
|
const Gt = /* @__PURE__ */ Zt(Wt), Ht = {
|
|
806
|
-
"purpur-text-field": "_purpur-text-
|
|
807
|
-
"purpur-text-field__label": "_purpur-text-
|
|
808
|
-
"purpur-text-field__label-text": "_purpur-text-field__label-
|
|
809
|
-
"purpur-text-field__field-row": "_purpur-text-field__field-
|
|
810
|
-
"purpur-text-field__frame": "_purpur-text-
|
|
811
|
-
"purpur-text-field__input-container": "_purpur-text-field__input-
|
|
812
|
-
"purpur-text-field__input-container--disabled": "_purpur-text-field__input-container--
|
|
813
|
-
"purpur-text-field__input-container--readonly": "_purpur-text-field__input-container--
|
|
814
|
-
"purpur-text-field__input-container--has-clear-button": "_purpur-text-field__input-container--has-clear-
|
|
815
|
-
"purpur-text-field__input-container--end-adornment": "_purpur-text-field__input-container--end-
|
|
816
|
-
"purpur-text-field__input": "_purpur-text-
|
|
817
|
-
"purpur-text-field__input-container--start-adornment": "_purpur-text-field__input-container--start-
|
|
818
|
-
"purpur-text-field__input--valid": "_purpur-text-field__input--
|
|
819
|
-
"purpur-text-field__input--error": "_purpur-text-field__input--
|
|
820
|
-
"purpur-text-field__adornment-container": "_purpur-text-field__adornment-
|
|
821
|
-
"purpur-text-field__valid-icon": "_purpur-text-field__valid-
|
|
803
|
+
"purpur-text-field": "_purpur-text-field_3gl1k_1",
|
|
804
|
+
"purpur-text-field__label": "_purpur-text-field__label_3gl1k_7",
|
|
805
|
+
"purpur-text-field__label-text": "_purpur-text-field__label-text_3gl1k_12",
|
|
806
|
+
"purpur-text-field__field-row": "_purpur-text-field__field-row_3gl1k_15",
|
|
807
|
+
"purpur-text-field__frame": "_purpur-text-field__frame_3gl1k_19",
|
|
808
|
+
"purpur-text-field__input-container": "_purpur-text-field__input-container_3gl1k_26",
|
|
809
|
+
"purpur-text-field__input-container--disabled": "_purpur-text-field__input-container--disabled_3gl1k_37",
|
|
810
|
+
"purpur-text-field__input-container--readonly": "_purpur-text-field__input-container--readonly_3gl1k_40",
|
|
811
|
+
"purpur-text-field__input-container--has-clear-button": "_purpur-text-field__input-container--has-clear-button_3gl1k_43",
|
|
812
|
+
"purpur-text-field__input-container--end-adornment": "_purpur-text-field__input-container--end-adornment_3gl1k_46",
|
|
813
|
+
"purpur-text-field__input": "_purpur-text-field__input_3gl1k_26",
|
|
814
|
+
"purpur-text-field__input-container--start-adornment": "_purpur-text-field__input-container--start-adornment_3gl1k_52",
|
|
815
|
+
"purpur-text-field__input--valid": "_purpur-text-field__input--valid_3gl1k_94",
|
|
816
|
+
"purpur-text-field__input--error": "_purpur-text-field__input--error_3gl1k_94",
|
|
817
|
+
"purpur-text-field__adornment-container": "_purpur-text-field__adornment-container_3gl1k_106",
|
|
818
|
+
"purpur-text-field__valid-icon": "_purpur-text-field__valid-icon_3gl1k_111"
|
|
822
819
|
}, Ut = (t) => Sr(t), f = Gt.bind(Ht), s = "purpur-text-field", Xt = ({
|
|
823
820
|
["data-testid"]: t,
|
|
824
821
|
className: u,
|
|
825
|
-
|
|
822
|
+
clearButtonAriaLabel: n,
|
|
826
823
|
beforeField: a,
|
|
827
|
-
afterField:
|
|
824
|
+
afterField: l,
|
|
828
825
|
endAdornment: r,
|
|
829
826
|
errorText: e,
|
|
830
827
|
helperText: i,
|
|
831
828
|
label: v,
|
|
832
829
|
loading: h = !1,
|
|
833
|
-
onClear:
|
|
830
|
+
onClear: g,
|
|
834
831
|
startAdornment: O,
|
|
835
832
|
valid: N = !1,
|
|
836
833
|
...p
|
|
837
|
-
},
|
|
838
|
-
var
|
|
839
|
-
const
|
|
840
|
-
V.current = _, typeof
|
|
834
|
+
}, y) => {
|
|
835
|
+
var D;
|
|
836
|
+
const q = Nr(), b = p.id ?? q, d = (_) => t ? `${t}-${_}` : void 0, E = N && !e, z = i ? `${b}-helper-text` : void 0, k = [O].filter((_) => !!_), P = (typeof p.value == "number" ? p.value !== void 0 : (D = p.value) == null ? void 0 : D.length) && !p.disabled && !p.readOnly && !h && g && n, V = Ut(null), hr = (_) => {
|
|
837
|
+
V.current = _, typeof y == "function" ? y(_) : y && (y.current = _);
|
|
841
838
|
}, $r = () => {
|
|
842
839
|
var _;
|
|
843
|
-
|
|
840
|
+
g == null || g(), (_ = V.current) == null || _.focus();
|
|
844
841
|
}, M = [
|
|
845
|
-
h && /* @__PURE__ */
|
|
842
|
+
h && /* @__PURE__ */ o(
|
|
846
843
|
Lt,
|
|
847
844
|
{
|
|
848
845
|
disabled: p.disabled,
|
|
@@ -851,7 +848,7 @@ const Gt = /* @__PURE__ */ Zt(Wt), Ht = {
|
|
|
851
848
|
},
|
|
852
849
|
"spinner"
|
|
853
850
|
),
|
|
854
|
-
P && /* @__PURE__ */
|
|
851
|
+
P && /* @__PURE__ */ o(
|
|
855
852
|
fr,
|
|
856
853
|
{
|
|
857
854
|
variant: "tertiary-purple",
|
|
@@ -860,12 +857,12 @@ const Gt = /* @__PURE__ */ Zt(Wt), Ht = {
|
|
|
860
857
|
"aria-label": n ?? "",
|
|
861
858
|
"data-testid": d("clear-button"),
|
|
862
859
|
tabIndex: -1,
|
|
863
|
-
children: /* @__PURE__ */
|
|
860
|
+
children: /* @__PURE__ */ o(mr, { size: "xs" })
|
|
864
861
|
},
|
|
865
862
|
"clear-button"
|
|
866
863
|
),
|
|
867
|
-
E && /* @__PURE__ */
|
|
868
|
-
|
|
864
|
+
E && /* @__PURE__ */ o(
|
|
865
|
+
gr,
|
|
869
866
|
{
|
|
870
867
|
"data-testid": d("valid-icon"),
|
|
871
868
|
className: f(`${s}__valid-icon`)
|
|
@@ -882,21 +879,24 @@ const Gt = /* @__PURE__ */ Zt(Wt), Ht = {
|
|
|
882
879
|
[`${s}__input-container--readonly`]: p.readOnly && !p.disabled
|
|
883
880
|
}
|
|
884
881
|
]);
|
|
885
|
-
return /* @__PURE__ */
|
|
886
|
-
v && /* @__PURE__ */
|
|
882
|
+
return /* @__PURE__ */ x("div", { className: f(u, s), children: [
|
|
883
|
+
v && /* @__PURE__ */ x(
|
|
887
884
|
Bt,
|
|
888
885
|
{
|
|
889
|
-
htmlFor:
|
|
886
|
+
htmlFor: b,
|
|
890
887
|
className: f(`${s}__label`),
|
|
891
888
|
"data-testid": d("label"),
|
|
892
889
|
disabled: p.disabled,
|
|
893
|
-
children:
|
|
890
|
+
children: [
|
|
891
|
+
p.required && /* @__PURE__ */ o("span", { "aria-hidden": !0, children: "*" }),
|
|
892
|
+
v
|
|
893
|
+
]
|
|
894
894
|
}
|
|
895
895
|
),
|
|
896
|
-
/* @__PURE__ */
|
|
896
|
+
/* @__PURE__ */ x("div", { className: f(`${s}__field-row`), children: [
|
|
897
897
|
!!a && a,
|
|
898
|
-
/* @__PURE__ */
|
|
899
|
-
!!k.length && /* @__PURE__ */
|
|
898
|
+
/* @__PURE__ */ x("div", { className: wr, children: [
|
|
899
|
+
!!k.length && /* @__PURE__ */ o(
|
|
900
900
|
"div",
|
|
901
901
|
{
|
|
902
902
|
"data-testid": d("start-adornments"),
|
|
@@ -904,14 +904,14 @@ const Gt = /* @__PURE__ */ Zt(Wt), Ht = {
|
|
|
904
904
|
children: k
|
|
905
905
|
}
|
|
906
906
|
),
|
|
907
|
-
/* @__PURE__ */
|
|
907
|
+
/* @__PURE__ */ o(
|
|
908
908
|
"input",
|
|
909
909
|
{
|
|
910
910
|
...p,
|
|
911
|
-
id:
|
|
911
|
+
id: b,
|
|
912
912
|
ref: hr,
|
|
913
913
|
"data-testid": d("input"),
|
|
914
|
-
"aria-describedby": p["aria-describedby"] ||
|
|
914
|
+
"aria-describedby": p["aria-describedby"] || z,
|
|
915
915
|
"aria-invalid": p["aria-invalid"] || !!e,
|
|
916
916
|
className: f([
|
|
917
917
|
`${s}__input`,
|
|
@@ -922,8 +922,8 @@ const Gt = /* @__PURE__ */ Zt(Wt), Ht = {
|
|
|
922
922
|
])
|
|
923
923
|
}
|
|
924
924
|
),
|
|
925
|
-
/* @__PURE__ */
|
|
926
|
-
(!!M.length || r) && /* @__PURE__ */
|
|
925
|
+
/* @__PURE__ */ o("div", { className: f(`${s}__frame`) }),
|
|
926
|
+
(!!M.length || r) && /* @__PURE__ */ x(
|
|
927
927
|
"div",
|
|
928
928
|
{
|
|
929
929
|
"data-testid": d("end-adornments"),
|
|
@@ -935,10 +935,10 @@ const Gt = /* @__PURE__ */ Zt(Wt), Ht = {
|
|
|
935
935
|
}
|
|
936
936
|
)
|
|
937
937
|
] }),
|
|
938
|
-
!!
|
|
938
|
+
!!l && l
|
|
939
939
|
] }),
|
|
940
|
-
|
|
941
|
-
e && /* @__PURE__ */
|
|
940
|
+
z && /* @__PURE__ */ o(pt, { "data-testid": d("helper-text"), id: z, children: i }),
|
|
941
|
+
e && /* @__PURE__ */ o(it, { "data-testid": d("error-text"), children: e })
|
|
942
942
|
] });
|
|
943
943
|
}, br = _r(Xt);
|
|
944
944
|
br.displayName = "TextField";
|