@purpurds/text-field 5.13.0 → 5.15.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/text-field.cjs.js +10 -10
- package/dist/text-field.cjs.js.map +1 -1
- package/dist/text-field.es.js +176 -187
- package/dist/text-field.es.js.map +1 -1
- package/package.json +8 -8
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
|
|
2
|
+
import { forwardRef as y, Children as z, isValidElement as M, createElement as A, cloneElement as U, useEffect as vr, Fragment as xr, useRef as mr, useId as gr } from "react";
|
|
3
3
|
import "react-dom";
|
|
4
|
-
const
|
|
4
|
+
const br = {
|
|
5
5
|
SM: "sm",
|
|
6
6
|
MD: "md",
|
|
7
7
|
LG: "lg"
|
|
8
8
|
};
|
|
9
|
-
function
|
|
9
|
+
function yr(t) {
|
|
10
10
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
11
11
|
}
|
|
12
|
-
var
|
|
12
|
+
var W = { exports: {} };
|
|
13
13
|
/*!
|
|
14
14
|
Copyright (c) 2018 Jed Watson.
|
|
15
15
|
Licensed under the MIT License (MIT), see
|
|
@@ -44,11 +44,11 @@ var J = { exports: {} };
|
|
|
44
44
|
}
|
|
45
45
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
46
46
|
})();
|
|
47
|
-
})(
|
|
48
|
-
var
|
|
49
|
-
const
|
|
47
|
+
})(W);
|
|
48
|
+
var hr = W.exports;
|
|
49
|
+
const Z = /* @__PURE__ */ yr(hr), $r = "_rotate_1xozj_1", wr = "_dash_1xozj_1", j = {
|
|
50
50
|
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
51
|
-
rotate:
|
|
51
|
+
rotate: $r,
|
|
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",
|
|
@@ -58,30 +58,30 @@ const R = /* @__PURE__ */ hr($r), jr = "_rotate_1xozj_1", wr = "_dash_1xozj_1",
|
|
|
58
58
|
dash: wr,
|
|
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
|
-
},
|
|
61
|
+
}, S = "purpur-spinner", jr = {
|
|
62
62
|
XXS: "xxs",
|
|
63
63
|
XS: "xs",
|
|
64
64
|
SM: "sm",
|
|
65
65
|
MD: "md",
|
|
66
66
|
LG: "lg"
|
|
67
|
-
},
|
|
67
|
+
}, Sr = ({
|
|
68
68
|
["data-testid"]: t,
|
|
69
69
|
disabled: u = !1,
|
|
70
70
|
negative: n = !1,
|
|
71
|
-
size: a =
|
|
71
|
+
size: a = jr.SM,
|
|
72
72
|
...o
|
|
73
73
|
}) => /* @__PURE__ */ p(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
|
-
className:
|
|
76
|
+
className: Z([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:
|
|
83
|
-
[j[`${
|
|
84
|
-
[j[`${
|
|
82
|
+
className: Z(j[`${S}__circle`], {
|
|
83
|
+
[j[`${S}__circle--disabled`]]: u,
|
|
84
|
+
[j[`${S}__circle--negative`]]: n
|
|
85
85
|
}),
|
|
86
86
|
cx: "25",
|
|
87
87
|
cy: "25",
|
|
@@ -93,7 +93,7 @@ const R = /* @__PURE__ */ hr($r), jr = "_rotate_1xozj_1", wr = "_dash_1xozj_1",
|
|
|
93
93
|
function Nr(t) {
|
|
94
94
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
95
95
|
}
|
|
96
|
-
var
|
|
96
|
+
var K = { exports: {} };
|
|
97
97
|
/*!
|
|
98
98
|
Copyright (c) 2018 Jed Watson.
|
|
99
99
|
Licensed under the MIT License (MIT), see
|
|
@@ -128,9 +128,9 @@ var Q = { exports: {} };
|
|
|
128
128
|
}
|
|
129
129
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
130
130
|
})();
|
|
131
|
-
})(
|
|
132
|
-
var
|
|
133
|
-
const
|
|
131
|
+
})(K);
|
|
132
|
+
var Or = K.exports;
|
|
133
|
+
const zr = /* @__PURE__ */ Nr(Or), Mr = {
|
|
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 Mr = /* @__PURE__ */ Nr(zr), Ar = {
|
|
|
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
|
+
}, Ar = zr.bind(Mr), x = "purpur-button", Cr = ({
|
|
155
155
|
children: t,
|
|
156
156
|
className: u,
|
|
157
157
|
["data-testid"]: n,
|
|
@@ -162,16 +162,16 @@ const Mr = /* @__PURE__ */ Nr(zr), Ar = {
|
|
|
162
162
|
negative: i = !1,
|
|
163
163
|
onClick: f,
|
|
164
164
|
size: v = "md",
|
|
165
|
-
variant:
|
|
166
|
-
type:
|
|
165
|
+
variant: h,
|
|
166
|
+
type: C = "button",
|
|
167
167
|
...l
|
|
168
168
|
}, m) => {
|
|
169
|
-
if (r &&
|
|
169
|
+
if (r && h === "destructive")
|
|
170
170
|
return null;
|
|
171
|
-
const
|
|
171
|
+
const q = Ar(
|
|
172
172
|
[
|
|
173
173
|
x,
|
|
174
|
-
`${x}--${i ? `${
|
|
174
|
+
`${x}--${i ? `${h}-negative` : h}`,
|
|
175
175
|
`${x}--${v}`
|
|
176
176
|
],
|
|
177
177
|
{
|
|
@@ -181,32 +181,32 @@ const Mr = /* @__PURE__ */ Nr(zr), Ar = {
|
|
|
181
181
|
[`${x}--disabled`]: a || e
|
|
182
182
|
},
|
|
183
183
|
u
|
|
184
|
-
),
|
|
185
|
-
a || e ?
|
|
184
|
+
), $ = (w) => {
|
|
185
|
+
a || e ? w.preventDefault() : f && f(w);
|
|
186
186
|
}, c = !!l["aria-disabled"] || a || e;
|
|
187
187
|
return /* @__PURE__ */ g(
|
|
188
188
|
"button",
|
|
189
189
|
{
|
|
190
|
-
className:
|
|
190
|
+
className: q,
|
|
191
191
|
"data-testid": n,
|
|
192
|
-
type:
|
|
192
|
+
type: C,
|
|
193
193
|
ref: m,
|
|
194
194
|
"aria-disabled": c,
|
|
195
|
-
onClick:
|
|
195
|
+
onClick: $,
|
|
196
196
|
...l,
|
|
197
197
|
children: [
|
|
198
|
-
e && /* @__PURE__ */ p(
|
|
198
|
+
e && /* @__PURE__ */ p(Sr, { size: v === br.LG ? "xs" : "xxs", negative: i, disabled: c }),
|
|
199
199
|
" ",
|
|
200
200
|
t
|
|
201
201
|
]
|
|
202
202
|
}
|
|
203
203
|
);
|
|
204
|
-
},
|
|
205
|
-
|
|
206
|
-
function
|
|
204
|
+
}, Q = y(Cr);
|
|
205
|
+
Q.displayName = "Button";
|
|
206
|
+
function qr(t) {
|
|
207
207
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
208
208
|
}
|
|
209
|
-
var
|
|
209
|
+
var rr = { exports: {} };
|
|
210
210
|
/*!
|
|
211
211
|
Copyright (c) 2018 Jed Watson.
|
|
212
212
|
Licensed under the MIT License (MIT), see
|
|
@@ -241,9 +241,9 @@ var tr = { exports: {} };
|
|
|
241
241
|
}
|
|
242
242
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
243
243
|
})();
|
|
244
|
-
})(
|
|
245
|
-
var
|
|
246
|
-
const
|
|
244
|
+
})(rr);
|
|
245
|
+
var Lr = rr.exports;
|
|
246
|
+
const Br = /* @__PURE__ */ qr(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 Dr = /* @__PURE__ */ Br(Ir), Fr = {
|
|
|
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
|
+
}, Ir = {
|
|
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
|
+
}, Er = Br.bind(Dr), R = "purpur-icon", Fr = "md", Pr = (t) => t.filter((u) => Object.keys(u).length >= 1).map((u) => `${u.name}="${u.value}"`).join(" "), kr = ({ 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
|
-
}, Xr = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(),
|
|
266
|
+
return `<svg ${Pr(n)}>${a}${t}</svg>`;
|
|
267
|
+
}, Xr = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Zr = ({
|
|
268
268
|
["data-testid"]: t,
|
|
269
269
|
svg: u,
|
|
270
270
|
allyTitle: n,
|
|
271
271
|
className: a,
|
|
272
|
-
size: o =
|
|
272
|
+
size: o = Fr,
|
|
273
273
|
...r
|
|
274
274
|
}) => {
|
|
275
|
-
const e =
|
|
275
|
+
const e = kr({
|
|
276
276
|
content: Xr(u.svg),
|
|
277
277
|
title: n
|
|
278
|
-
}), i =
|
|
278
|
+
}), i = Er(a, R, `${R}--${o}`);
|
|
279
279
|
return /* @__PURE__ */ p(
|
|
280
280
|
"span",
|
|
281
281
|
{
|
|
@@ -287,10 +287,10 @@ const Dr = /* @__PURE__ */ Br(Ir), Fr = {
|
|
|
287
287
|
}
|
|
288
288
|
);
|
|
289
289
|
};
|
|
290
|
-
function
|
|
290
|
+
function Rr(t) {
|
|
291
291
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
292
292
|
}
|
|
293
|
-
var
|
|
293
|
+
var tr = { exports: {} };
|
|
294
294
|
/*!
|
|
295
295
|
Copyright (c) 2018 Jed Watson.
|
|
296
296
|
Licensed under the MIT License (MIT), see
|
|
@@ -325,12 +325,12 @@ var er = { exports: {} };
|
|
|
325
325
|
}
|
|
326
326
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
327
327
|
})();
|
|
328
|
-
})(
|
|
329
|
-
var Vr =
|
|
330
|
-
const
|
|
328
|
+
})(tr);
|
|
329
|
+
var Vr = tr.exports;
|
|
330
|
+
const Tr = /* @__PURE__ */ Rr(Vr), V = {
|
|
331
331
|
"purpur-field-error-text": "_purpur-field-error-text_1u768_1",
|
|
332
332
|
"purpur-field-error-text__icon": "_purpur-field-error-text__icon_1u768_12"
|
|
333
|
-
},
|
|
333
|
+
}, T = "purpur-field-error-text", Gr = ({
|
|
334
334
|
["data-testid"]: t,
|
|
335
335
|
children: u,
|
|
336
336
|
className: n,
|
|
@@ -339,21 +339,21 @@ const Gr = /* @__PURE__ */ Tr(Vr), V = {
|
|
|
339
339
|
}) => /* @__PURE__ */ g(
|
|
340
340
|
"div",
|
|
341
341
|
{
|
|
342
|
-
className:
|
|
342
|
+
className: Tr([n, V[T]]),
|
|
343
343
|
"data-testid": t,
|
|
344
344
|
"aria-live": "assertive",
|
|
345
345
|
"aria-relevant": a,
|
|
346
346
|
...o,
|
|
347
347
|
children: [
|
|
348
|
-
/* @__PURE__ */ p(
|
|
348
|
+
/* @__PURE__ */ p(Zr, { svg: Ir, size: "xs", className: V[`${T}__icon`] }),
|
|
349
349
|
u
|
|
350
350
|
]
|
|
351
351
|
}
|
|
352
352
|
);
|
|
353
|
-
function
|
|
353
|
+
function Hr(t) {
|
|
354
354
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
355
355
|
}
|
|
356
|
-
var
|
|
356
|
+
var er = { exports: {} };
|
|
357
357
|
/*!
|
|
358
358
|
Copyright (c) 2018 Jed Watson.
|
|
359
359
|
Licensed under the MIT License (MIT), see
|
|
@@ -388,12 +388,12 @@ var nr = { exports: {} };
|
|
|
388
388
|
}
|
|
389
389
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
390
390
|
})();
|
|
391
|
-
})(
|
|
392
|
-
var
|
|
393
|
-
const
|
|
391
|
+
})(er);
|
|
392
|
+
var Yr = er.exports;
|
|
393
|
+
const Jr = /* @__PURE__ */ Hr(Yr), G = {
|
|
394
394
|
"purpur-field-helper-text": "_purpur-field-helper-text_atw6b_1",
|
|
395
395
|
"purpur-field-helper-text--disabled": "_purpur-field-helper-text--disabled_atw6b_9"
|
|
396
|
-
},
|
|
396
|
+
}, H = "purpur-field-helper-text", Ur = ({
|
|
397
397
|
["data-testid"]: t,
|
|
398
398
|
children: u,
|
|
399
399
|
className: n,
|
|
@@ -401,19 +401,19 @@ const Ur = /* @__PURE__ */ Wr(Kr), H = {
|
|
|
401
401
|
id: o,
|
|
402
402
|
...r
|
|
403
403
|
}) => {
|
|
404
|
-
const e =
|
|
404
|
+
const e = Jr([
|
|
405
405
|
n,
|
|
406
|
-
H
|
|
406
|
+
G[H],
|
|
407
407
|
{
|
|
408
|
-
[
|
|
408
|
+
[G[`${H}--disabled`]]: a
|
|
409
409
|
}
|
|
410
410
|
]);
|
|
411
411
|
return /* @__PURE__ */ p("span", { id: o, className: e, "data-testid": t, ...r, children: u });
|
|
412
412
|
};
|
|
413
|
-
function
|
|
413
|
+
function Wr(t) {
|
|
414
414
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
415
415
|
}
|
|
416
|
-
var
|
|
416
|
+
var nr = { exports: {} };
|
|
417
417
|
/*!
|
|
418
418
|
Copyright (c) 2018 Jed Watson.
|
|
419
419
|
Licensed under the MIT License (MIT), see
|
|
@@ -448,9 +448,9 @@ var ir = { exports: {} };
|
|
|
448
448
|
}
|
|
449
449
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
450
450
|
})();
|
|
451
|
-
})(
|
|
452
|
-
var
|
|
453
|
-
const
|
|
451
|
+
})(nr);
|
|
452
|
+
var Kr = nr.exports;
|
|
453
|
+
const Qr = /* @__PURE__ */ Wr(Kr), rt = {
|
|
454
454
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
455
455
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
456
456
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -458,52 +458,52 @@ const rt = /* @__PURE__ */ Jr(Qr), tt = {
|
|
|
458
458
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
459
459
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
460
460
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
461
|
-
},
|
|
461
|
+
}, tt = {
|
|
462
462
|
name: "check-circle-filled",
|
|
463
463
|
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>',
|
|
464
464
|
keywords: ["check-circle-filled"],
|
|
465
465
|
category: "status"
|
|
466
|
-
},
|
|
466
|
+
}, et = {
|
|
467
467
|
name: "close",
|
|
468
468
|
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
469
|
keywords: ["close"],
|
|
470
470
|
category: "utility"
|
|
471
|
-
},
|
|
472
|
-
|
|
471
|
+
}, ir = (t) => /* @__PURE__ */ p(
|
|
472
|
+
ar,
|
|
473
473
|
{
|
|
474
474
|
...t,
|
|
475
|
-
svg:
|
|
475
|
+
svg: tt
|
|
476
476
|
}
|
|
477
477
|
);
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
|
|
478
|
+
ir.displayName = "IconCheckCircleFilled";
|
|
479
|
+
const ur = (t) => /* @__PURE__ */ p(
|
|
480
|
+
ar,
|
|
481
481
|
{
|
|
482
482
|
...t,
|
|
483
|
-
svg:
|
|
483
|
+
svg: et
|
|
484
484
|
}
|
|
485
485
|
);
|
|
486
|
-
|
|
487
|
-
const
|
|
486
|
+
ur.displayName = "IconClose";
|
|
487
|
+
const nt = Qr.bind(rt), Y = "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
488
|
const n = [
|
|
489
489
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
490
490
|
{ name: "fill", value: "currentColor" },
|
|
491
491
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
492
492
|
u ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
493
493
|
], a = u ? `<title>${u}</title>` : "";
|
|
494
|
-
return `<svg ${
|
|
495
|
-
},
|
|
494
|
+
return `<svg ${ut(n)}>${a}${t}</svg>`;
|
|
495
|
+
}, ot = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), ar = ({
|
|
496
496
|
["data-testid"]: t,
|
|
497
497
|
svg: u,
|
|
498
498
|
allyTitle: n,
|
|
499
499
|
className: a,
|
|
500
|
-
size: o =
|
|
500
|
+
size: o = it,
|
|
501
501
|
...r
|
|
502
502
|
}) => {
|
|
503
|
-
const e =
|
|
504
|
-
content:
|
|
503
|
+
const e = at({
|
|
504
|
+
content: ot(u.svg),
|
|
505
505
|
title: n
|
|
506
|
-
}), i =
|
|
506
|
+
}), i = nt(a, Y, `${Y}--${o}`);
|
|
507
507
|
return /* @__PURE__ */ p(
|
|
508
508
|
"span",
|
|
509
509
|
{
|
|
@@ -515,60 +515,49 @@ const it = rt.bind(tt), K = "purpur-icon", ut = "md", at = (t) => t.filter((u) =
|
|
|
515
515
|
}
|
|
516
516
|
);
|
|
517
517
|
};
|
|
518
|
-
function
|
|
519
|
-
return
|
|
520
|
-
for (var u = 1; u < arguments.length; u++) {
|
|
521
|
-
var n = arguments[u];
|
|
522
|
-
for (var a in n)
|
|
523
|
-
Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]);
|
|
524
|
-
}
|
|
525
|
-
return t;
|
|
526
|
-
}, P.apply(this, arguments);
|
|
527
|
-
}
|
|
528
|
-
function A() {
|
|
529
|
-
return A = Object.assign ? Object.assign.bind() : function(t) {
|
|
518
|
+
function b() {
|
|
519
|
+
return b = Object.assign ? Object.assign.bind() : function(t) {
|
|
530
520
|
for (var u = 1; u < arguments.length; u++) {
|
|
531
521
|
var n = arguments[u];
|
|
532
|
-
for (var a in n)
|
|
533
|
-
Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]);
|
|
522
|
+
for (var a in n) ({}).hasOwnProperty.call(n, a) && (t[a] = n[a]);
|
|
534
523
|
}
|
|
535
524
|
return t;
|
|
536
|
-
},
|
|
525
|
+
}, b.apply(null, arguments);
|
|
537
526
|
}
|
|
538
|
-
function
|
|
527
|
+
function pt(t, u) {
|
|
539
528
|
typeof t == "function" ? t(u) : t != null && (t.current = u);
|
|
540
529
|
}
|
|
541
|
-
function
|
|
530
|
+
function lt(...t) {
|
|
542
531
|
return (u) => t.forEach(
|
|
543
|
-
(n) =>
|
|
532
|
+
(n) => pt(n, u)
|
|
544
533
|
);
|
|
545
534
|
}
|
|
546
|
-
const
|
|
547
|
-
const { children: n, ...a } = t, o =
|
|
535
|
+
const or = /* @__PURE__ */ y((t, u) => {
|
|
536
|
+
const { children: n, ...a } = t, o = z.toArray(n), r = o.find(ct);
|
|
548
537
|
if (r) {
|
|
549
|
-
const e = r.props.children, i = o.map((f) => f === r ?
|
|
550
|
-
return /* @__PURE__ */
|
|
538
|
+
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
|
+
return /* @__PURE__ */ A(F, b({}, a, {
|
|
551
540
|
ref: u
|
|
552
|
-
}), /* @__PURE__ */
|
|
541
|
+
}), /* @__PURE__ */ M(e) ? /* @__PURE__ */ U(e, void 0, i) : null);
|
|
553
542
|
}
|
|
554
|
-
return /* @__PURE__ */
|
|
543
|
+
return /* @__PURE__ */ A(F, b({}, a, {
|
|
555
544
|
ref: u
|
|
556
545
|
}), n);
|
|
557
546
|
});
|
|
558
|
-
|
|
559
|
-
const
|
|
547
|
+
or.displayName = "Slot";
|
|
548
|
+
const F = /* @__PURE__ */ y((t, u) => {
|
|
560
549
|
const { children: n, ...a } = t;
|
|
561
|
-
return /* @__PURE__ */
|
|
562
|
-
...
|
|
563
|
-
ref: u ?
|
|
564
|
-
}) :
|
|
550
|
+
return /* @__PURE__ */ M(n) ? /* @__PURE__ */ U(n, {
|
|
551
|
+
...dt(a, n.props),
|
|
552
|
+
ref: u ? lt(u, n.ref) : n.ref
|
|
553
|
+
}) : z.count(n) > 1 ? z.only(null) : null;
|
|
565
554
|
});
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
function
|
|
569
|
-
return /* @__PURE__ */
|
|
555
|
+
F.displayName = "SlotClone";
|
|
556
|
+
const st = ({ children: t }) => /* @__PURE__ */ A(xr, null, t);
|
|
557
|
+
function ct(t) {
|
|
558
|
+
return /* @__PURE__ */ M(t) && t.type === st;
|
|
570
559
|
}
|
|
571
|
-
function
|
|
560
|
+
function dt(t, u) {
|
|
572
561
|
const n = {
|
|
573
562
|
...u
|
|
574
563
|
};
|
|
@@ -589,7 +578,7 @@ function _t(t, u) {
|
|
|
589
578
|
...n
|
|
590
579
|
};
|
|
591
580
|
}
|
|
592
|
-
const
|
|
581
|
+
const _t = [
|
|
593
582
|
"a",
|
|
594
583
|
"button",
|
|
595
584
|
"div",
|
|
@@ -606,12 +595,12 @@ const ft = [
|
|
|
606
595
|
"span",
|
|
607
596
|
"svg",
|
|
608
597
|
"ul"
|
|
609
|
-
],
|
|
610
|
-
const n = /* @__PURE__ */
|
|
611
|
-
const { asChild: r, ...e } = a, i = r ?
|
|
612
|
-
return
|
|
598
|
+
], ft = _t.reduce((t, u) => {
|
|
599
|
+
const n = /* @__PURE__ */ y((a, o) => {
|
|
600
|
+
const { asChild: r, ...e } = a, i = r ? or : u;
|
|
601
|
+
return vr(() => {
|
|
613
602
|
window[Symbol.for("radix-ui")] = !0;
|
|
614
|
-
}, []), /* @__PURE__ */
|
|
603
|
+
}, []), /* @__PURE__ */ A(i, b({}, e, {
|
|
615
604
|
ref: o
|
|
616
605
|
}));
|
|
617
606
|
});
|
|
@@ -619,17 +608,17 @@ const ft = [
|
|
|
619
608
|
...t,
|
|
620
609
|
[u]: n
|
|
621
610
|
};
|
|
622
|
-
}, {}),
|
|
611
|
+
}, {}), vt = /* @__PURE__ */ y((t, u) => /* @__PURE__ */ A(ft.label, b({}, t, {
|
|
623
612
|
ref: u,
|
|
624
613
|
onMouseDown: (n) => {
|
|
625
614
|
var a;
|
|
626
615
|
(a = t.onMouseDown) === null || a === void 0 || a.call(t, n), !n.defaultPrevented && n.detail > 1 && n.preventDefault();
|
|
627
616
|
}
|
|
628
|
-
}))),
|
|
629
|
-
function
|
|
617
|
+
}))), xt = vt;
|
|
618
|
+
function mt(t) {
|
|
630
619
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
631
620
|
}
|
|
632
|
-
var
|
|
621
|
+
var pr = { exports: {} };
|
|
633
622
|
/*!
|
|
634
623
|
Copyright (c) 2018 Jed Watson.
|
|
635
624
|
Licensed under the MIT License (MIT), see
|
|
@@ -664,13 +653,13 @@ var lr = { exports: {} };
|
|
|
664
653
|
}
|
|
665
654
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
666
655
|
})();
|
|
667
|
-
})(
|
|
668
|
-
var
|
|
669
|
-
const
|
|
656
|
+
})(pr);
|
|
657
|
+
var gt = pr.exports;
|
|
658
|
+
const bt = /* @__PURE__ */ mt(gt), I = {
|
|
670
659
|
"purpur-label": "_purpur-label_12cfi_1",
|
|
671
660
|
"purpur-label--negative": "_purpur-label--negative_12cfi_9",
|
|
672
661
|
"purpur-label--disabled": "_purpur-label--disabled_12cfi_12"
|
|
673
|
-
},
|
|
662
|
+
}, E = "purpur-label", yt = ({
|
|
674
663
|
children: t,
|
|
675
664
|
className: u,
|
|
676
665
|
htmlFor: n,
|
|
@@ -679,20 +668,20 @@ const yt = /* @__PURE__ */ gt(bt), F = {
|
|
|
679
668
|
negative: r = !1,
|
|
680
669
|
...e
|
|
681
670
|
}) => {
|
|
682
|
-
const i =
|
|
671
|
+
const i = bt([
|
|
683
672
|
u,
|
|
684
|
-
|
|
673
|
+
I[E],
|
|
685
674
|
{
|
|
686
|
-
[
|
|
687
|
-
[
|
|
675
|
+
[I[`${E}--disabled`]]: o,
|
|
676
|
+
[I[`${E}--negative`]]: r
|
|
688
677
|
}
|
|
689
678
|
]);
|
|
690
|
-
return /* @__PURE__ */ p(
|
|
679
|
+
return /* @__PURE__ */ p(xt, { className: i, "data-testid": a, htmlFor: n, ...e, children: t });
|
|
691
680
|
};
|
|
692
|
-
function
|
|
681
|
+
function ht(t) {
|
|
693
682
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
694
683
|
}
|
|
695
|
-
var
|
|
684
|
+
var lr = { exports: {} };
|
|
696
685
|
/*!
|
|
697
686
|
Copyright (c) 2018 Jed Watson.
|
|
698
687
|
Licensed under the MIT License (MIT), see
|
|
@@ -727,9 +716,9 @@ var sr = { exports: {} };
|
|
|
727
716
|
}
|
|
728
717
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
729
718
|
})();
|
|
730
|
-
})(
|
|
731
|
-
var
|
|
732
|
-
const
|
|
719
|
+
})(lr);
|
|
720
|
+
var $t = lr.exports;
|
|
721
|
+
const J = /* @__PURE__ */ ht($t), wt = "_rotate_1xozj_1", jt = "_dash_1xozj_1", N = {
|
|
733
722
|
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
734
723
|
rotate: wt,
|
|
735
724
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
|
|
@@ -738,10 +727,10 @@ const U = /* @__PURE__ */ $t(jt), wt = "_rotate_1xozj_1", St = "_dash_1xozj_1",
|
|
|
738
727
|
"purpur-spinner--md": "_purpur-spinner--md_1xozj_16",
|
|
739
728
|
"purpur-spinner--lg": "_purpur-spinner--lg_1xozj_20",
|
|
740
729
|
"purpur-spinner__circle": "_purpur-spinner__circle_1xozj_24",
|
|
741
|
-
dash:
|
|
730
|
+
dash: jt,
|
|
742
731
|
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_1xozj_33",
|
|
743
732
|
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_1xozj_36"
|
|
744
|
-
}, O = "purpur-spinner",
|
|
733
|
+
}, O = "purpur-spinner", St = {
|
|
745
734
|
XXS: "xxs",
|
|
746
735
|
XS: "xs",
|
|
747
736
|
SM: "sm",
|
|
@@ -751,20 +740,20 @@ const U = /* @__PURE__ */ $t(jt), wt = "_rotate_1xozj_1", St = "_dash_1xozj_1",
|
|
|
751
740
|
["data-testid"]: t,
|
|
752
741
|
disabled: u = !1,
|
|
753
742
|
negative: n = !1,
|
|
754
|
-
size: a =
|
|
743
|
+
size: a = St.SM,
|
|
755
744
|
...o
|
|
756
745
|
}) => /* @__PURE__ */ p(
|
|
757
746
|
"div",
|
|
758
747
|
{
|
|
759
|
-
className:
|
|
748
|
+
className: J([N[O], N[`${O}--${a}`]]),
|
|
760
749
|
"data-testid": t,
|
|
761
750
|
...o,
|
|
762
751
|
children: /* @__PURE__ */ p("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ p(
|
|
763
752
|
"circle",
|
|
764
753
|
{
|
|
765
|
-
className:
|
|
766
|
-
[
|
|
767
|
-
[
|
|
754
|
+
className: J(N[`${O}__circle`], {
|
|
755
|
+
[N[`${O}__circle--disabled`]]: u,
|
|
756
|
+
[N[`${O}__circle--negative`]]: n
|
|
768
757
|
}),
|
|
769
758
|
cx: "25",
|
|
770
759
|
cy: "25",
|
|
@@ -773,10 +762,10 @@ const U = /* @__PURE__ */ $t(jt), wt = "_rotate_1xozj_1", St = "_dash_1xozj_1",
|
|
|
773
762
|
) })
|
|
774
763
|
}
|
|
775
764
|
);
|
|
776
|
-
function
|
|
765
|
+
function Ot(t) {
|
|
777
766
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
778
767
|
}
|
|
779
|
-
var
|
|
768
|
+
var sr = { exports: {} };
|
|
780
769
|
/*!
|
|
781
770
|
Copyright (c) 2018 Jed Watson.
|
|
782
771
|
Licensed under the MIT License (MIT), see
|
|
@@ -811,9 +800,9 @@ var cr = { exports: {} };
|
|
|
811
800
|
}
|
|
812
801
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
813
802
|
})();
|
|
814
|
-
})(
|
|
815
|
-
var
|
|
816
|
-
const
|
|
803
|
+
})(sr);
|
|
804
|
+
var zt = sr.exports;
|
|
805
|
+
const Mt = /* @__PURE__ */ Ot(zt), At = {
|
|
817
806
|
"purpur-text-field": "_purpur-text-field_nj9f4_1",
|
|
818
807
|
"purpur-text-field__label": "_purpur-text-field__label_nj9f4_7",
|
|
819
808
|
"purpur-text-field__label-text": "_purpur-text-field__label-text_nj9f4_13",
|
|
@@ -830,7 +819,7 @@ const At = /* @__PURE__ */ zt(Mt), qt = {
|
|
|
830
819
|
"purpur-text-field__input--error": "_purpur-text-field__input--error_nj9f4_94",
|
|
831
820
|
"purpur-text-field__adornment-container": "_purpur-text-field__adornment-container_nj9f4_106",
|
|
832
821
|
"purpur-text-field__valid-icon": "_purpur-text-field__valid-icon_nj9f4_111"
|
|
833
|
-
}, Ct = (t) =>
|
|
822
|
+
}, Ct = (t) => mr(t), _ = Mt.bind(At), s = "purpur-text-field", qt = ({
|
|
834
823
|
["data-testid"]: t,
|
|
835
824
|
className: u,
|
|
836
825
|
clearButtonAllyLabel: n,
|
|
@@ -841,16 +830,16 @@ const At = /* @__PURE__ */ zt(Mt), qt = {
|
|
|
841
830
|
label: i,
|
|
842
831
|
loading: f = !1,
|
|
843
832
|
onClear: v,
|
|
844
|
-
startAdornment:
|
|
845
|
-
valid:
|
|
833
|
+
startAdornment: h,
|
|
834
|
+
valid: C = !1,
|
|
846
835
|
...l
|
|
847
836
|
}, m) => {
|
|
848
837
|
var X;
|
|
849
|
-
const
|
|
850
|
-
|
|
851
|
-
},
|
|
838
|
+
const q = gr(), $ = l.id ?? q, c = (d) => t ? `${t}-${d}` : void 0, w = C && !r, L = e ? `${$}-helper-text` : void 0, B = [h].filter((d) => !!d), P = (typeof l.value == "number" ? l.value !== void 0 : (X = l.value) == null ? void 0 : X.length) && !l.disabled && !l.readOnly && !f && v && n, k = Ct(null), dr = (d) => {
|
|
839
|
+
k.current = d, typeof m == "function" ? m(d) : m && (m.current = d);
|
|
840
|
+
}, _r = () => {
|
|
852
841
|
var d;
|
|
853
|
-
v == null || v(), (d =
|
|
842
|
+
v == null || v(), (d = k.current) == null || d.focus();
|
|
854
843
|
}, D = [
|
|
855
844
|
f && /* @__PURE__ */ p(
|
|
856
845
|
Nt,
|
|
@@ -861,42 +850,42 @@ const At = /* @__PURE__ */ zt(Mt), qt = {
|
|
|
861
850
|
},
|
|
862
851
|
"spinner"
|
|
863
852
|
),
|
|
864
|
-
|
|
865
|
-
|
|
853
|
+
P && /* @__PURE__ */ p(
|
|
854
|
+
Q,
|
|
866
855
|
{
|
|
867
856
|
variant: "tertiary-purple",
|
|
868
|
-
onClick:
|
|
857
|
+
onClick: _r,
|
|
869
858
|
iconOnly: !0,
|
|
870
859
|
"aria-label": n ?? "",
|
|
871
860
|
"data-testid": c("clear-button"),
|
|
872
861
|
tabIndex: -1,
|
|
873
|
-
children: /* @__PURE__ */ p(
|
|
862
|
+
children: /* @__PURE__ */ p(ur, { size: "xs" })
|
|
874
863
|
},
|
|
875
864
|
"clear-button"
|
|
876
865
|
),
|
|
877
|
-
|
|
878
|
-
|
|
866
|
+
w && /* @__PURE__ */ p(
|
|
867
|
+
ir,
|
|
879
868
|
{
|
|
880
869
|
"data-testid": c("valid-icon"),
|
|
881
870
|
className: _(`${s}__valid-icon`)
|
|
882
871
|
},
|
|
883
872
|
"valid-icon"
|
|
884
873
|
)
|
|
885
|
-
].filter((d) => !!d),
|
|
874
|
+
].filter((d) => !!d), fr = _([
|
|
886
875
|
`${s}__input-container`,
|
|
887
876
|
{
|
|
888
|
-
[`${s}__input-container--start-adornment`]:
|
|
877
|
+
[`${s}__input-container--start-adornment`]: B.length,
|
|
889
878
|
[`${s}__input-container--end-adornment`]: D.length || o,
|
|
890
879
|
[`${s}__input-container--disabled`]: l.disabled,
|
|
891
|
-
[`${s}__input-container--has-clear-button`]:
|
|
880
|
+
[`${s}__input-container--has-clear-button`]: P,
|
|
892
881
|
[`${s}__input-container--readonly`]: l.readOnly && !l.disabled
|
|
893
882
|
}
|
|
894
883
|
]);
|
|
895
884
|
return /* @__PURE__ */ g("div", { className: _(u, s), children: [
|
|
896
885
|
i && /* @__PURE__ */ p(
|
|
897
|
-
|
|
886
|
+
yt,
|
|
898
887
|
{
|
|
899
|
-
htmlFor:
|
|
888
|
+
htmlFor: $,
|
|
900
889
|
className: _(`${s}__label`),
|
|
901
890
|
"data-testid": c("label"),
|
|
902
891
|
disabled: l.disabled,
|
|
@@ -904,28 +893,28 @@ const At = /* @__PURE__ */ zt(Mt), qt = {
|
|
|
904
893
|
}
|
|
905
894
|
),
|
|
906
895
|
/* @__PURE__ */ g("div", { className: _(`${s}__field-row`), children: [
|
|
907
|
-
/* @__PURE__ */ g("div", { className:
|
|
908
|
-
!!
|
|
896
|
+
/* @__PURE__ */ g("div", { className: fr, children: [
|
|
897
|
+
!!B.length && /* @__PURE__ */ p(
|
|
909
898
|
"div",
|
|
910
899
|
{
|
|
911
900
|
"data-testid": c("start-adornments"),
|
|
912
901
|
className: _(`${s}__adornment-container`),
|
|
913
|
-
children:
|
|
902
|
+
children: B
|
|
914
903
|
}
|
|
915
904
|
),
|
|
916
905
|
/* @__PURE__ */ p(
|
|
917
906
|
"input",
|
|
918
907
|
{
|
|
919
908
|
...l,
|
|
920
|
-
id:
|
|
921
|
-
ref:
|
|
909
|
+
id: $,
|
|
910
|
+
ref: dr,
|
|
922
911
|
"data-testid": c("input"),
|
|
923
|
-
"aria-describedby": l["aria-describedby"] ||
|
|
912
|
+
"aria-describedby": l["aria-describedby"] || L,
|
|
924
913
|
"aria-invalid": l["aria-invalid"] || !!r,
|
|
925
914
|
className: _([
|
|
926
915
|
`${s}__input`,
|
|
927
916
|
{
|
|
928
|
-
[`${s}__input--valid`]:
|
|
917
|
+
[`${s}__input--valid`]: w,
|
|
929
918
|
[`${s}__input--error`]: !!r
|
|
930
919
|
}
|
|
931
920
|
])
|
|
@@ -946,14 +935,14 @@ const At = /* @__PURE__ */ zt(Mt), qt = {
|
|
|
946
935
|
] }),
|
|
947
936
|
!!a && a
|
|
948
937
|
] }),
|
|
949
|
-
|
|
950
|
-
r && /* @__PURE__ */ p(
|
|
938
|
+
L && /* @__PURE__ */ p(Ur, { "data-testid": c("helper-text"), id: L, children: e }),
|
|
939
|
+
r && /* @__PURE__ */ p(Gr, { "data-testid": c("error-text"), children: r })
|
|
951
940
|
] });
|
|
952
|
-
},
|
|
953
|
-
|
|
954
|
-
const
|
|
941
|
+
}, cr = y(qt);
|
|
942
|
+
cr.displayName = "TextField";
|
|
943
|
+
const Et = (t) => M(t) && t.type.displayName === cr.displayName;
|
|
955
944
|
export {
|
|
956
|
-
|
|
957
|
-
|
|
945
|
+
cr as TextField,
|
|
946
|
+
Et as isTextField
|
|
958
947
|
};
|
|
959
948
|
//# sourceMappingURL=text-field.es.js.map
|