@purpurds/autocomplete 8.4.0 → 8.5.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 +3 -3
- package/dist/autocomplete.cjs.js +15 -15
- package/dist/autocomplete.cjs.js.map +1 -1
- package/dist/autocomplete.es.js +355 -349
- package/dist/autocomplete.es.js.map +1 -1
- package/package.json +13 -13
package/dist/autocomplete.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as l, jsxs as O, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as Y, Children as
|
|
1
|
+
import { jsx as l, jsxs as O, Fragment as Nt } from "react/jsx-runtime";
|
|
2
|
+
import * as h from "react";
|
|
3
|
+
import { forwardRef as Y, Children as jt, isValidElement as Qr, useId as Ot, useRef as K, useCallback as At, useEffect as kt, useState as nr, cloneElement as Ct } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
|
-
function
|
|
5
|
+
function Pt(t) {
|
|
6
6
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
7
7
|
}
|
|
8
8
|
var vr = { exports: {} };
|
|
@@ -12,7 +12,7 @@ var vr = { exports: {} };
|
|
|
12
12
|
http://jedwatson.github.io/classnames
|
|
13
13
|
*/
|
|
14
14
|
var mr;
|
|
15
|
-
function
|
|
15
|
+
function qt() {
|
|
16
16
|
return mr || (mr = 1, (function(t) {
|
|
17
17
|
(function() {
|
|
18
18
|
var i = {}.hasOwnProperty;
|
|
@@ -44,8 +44,8 @@ function kt() {
|
|
|
44
44
|
})();
|
|
45
45
|
})(vr)), vr.exports;
|
|
46
46
|
}
|
|
47
|
-
var
|
|
48
|
-
const
|
|
47
|
+
var Rt = qt();
|
|
48
|
+
const Lt = /* @__PURE__ */ Pt(Rt), Mt = {
|
|
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,41 +53,41 @@ const Pt = /* @__PURE__ */ At(Ct), qt = {
|
|
|
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
|
+
}, Bt = Lt.bind(Mt), hr = "purpur-icon", Et = "md", Tt = (t) => t.filter((i) => Object.keys(i).length >= 1).map((i) => `${i.name}="${i.value}"`).join(" "), It = ({ content: t = "", title: i } = {}) => {
|
|
57
57
|
const n = [
|
|
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
|
i ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
62
62
|
], o = i ? `<title>${i}</title>` : "";
|
|
63
|
-
return `<svg ${
|
|
64
|
-
},
|
|
65
|
-
const r =
|
|
66
|
-
content:
|
|
63
|
+
return `<svg ${Tt(n)}>${o}${t}</svg>`;
|
|
64
|
+
}, zt = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Xr = ({ svg: t, allyTitle: i, className: n, size: o = Et, ...a }) => {
|
|
65
|
+
const r = It({
|
|
66
|
+
content: zt(t.svg),
|
|
67
67
|
title: i
|
|
68
|
-
}), e =
|
|
68
|
+
}), e = Bt(n, hr, `${hr}--${o}`);
|
|
69
69
|
return /* @__PURE__ */ l("span", { className: e, dangerouslySetInnerHTML: { __html: r }, ...a });
|
|
70
70
|
};
|
|
71
71
|
Xr.displayName = "Icon";
|
|
72
|
-
const
|
|
72
|
+
const Dt = {
|
|
73
73
|
name: "chevron-down",
|
|
74
74
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M20.136 7.864a.9.9 0 0 0-1.272 0L12 14.727 5.136 7.864a.9.9 0 0 0-1.272 1.272l7.5 7.5a.9.9 0 0 0 1.272 0l7.5-7.5a.9.9 0 0 0 0-1.272Z" clip-rule="evenodd"/></svg>',
|
|
75
75
|
keywords: ["chevron-down"],
|
|
76
76
|
category: "utility"
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
function
|
|
77
|
+
}, rt = (t) => /* @__PURE__ */ l(Xr, { ...t, svg: Dt });
|
|
78
|
+
rt.displayName = "IconChevronDown";
|
|
79
|
+
function Vt(t) {
|
|
80
80
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
81
81
|
}
|
|
82
|
-
var
|
|
82
|
+
var gr = { exports: {} };
|
|
83
83
|
/*!
|
|
84
84
|
Copyright (c) 2018 Jed Watson.
|
|
85
85
|
Licensed under the MIT License (MIT), see
|
|
86
86
|
http://jedwatson.github.io/classnames
|
|
87
87
|
*/
|
|
88
|
-
var
|
|
89
|
-
function
|
|
90
|
-
return
|
|
88
|
+
var br;
|
|
89
|
+
function Zt() {
|
|
90
|
+
return br || (br = 1, (function(t) {
|
|
91
91
|
(function() {
|
|
92
92
|
var i = {}.hasOwnProperty;
|
|
93
93
|
function n() {
|
|
@@ -116,10 +116,10 @@ function zt() {
|
|
|
116
116
|
}
|
|
117
117
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
118
118
|
})();
|
|
119
|
-
})(
|
|
119
|
+
})(gr)), gr.exports;
|
|
120
120
|
}
|
|
121
|
-
var
|
|
122
|
-
const
|
|
121
|
+
var Ht = Zt();
|
|
122
|
+
const tt = /* @__PURE__ */ Vt(Ht), et = {
|
|
123
123
|
"purpur-listbox": "_purpur-listbox_6c8yl_1",
|
|
124
124
|
"purpur-listbox-item": "_purpur-listbox-item_6c8yl_15",
|
|
125
125
|
"purpur-listbox-item--hovered": "_purpur-listbox-item--hovered_6c8yl_29",
|
|
@@ -128,18 +128,18 @@ const rt = /* @__PURE__ */ It(Dt), tt = {
|
|
|
128
128
|
"purpur-listbox-item--disabled": "_purpur-listbox-item--disabled_6c8yl_44",
|
|
129
129
|
"purpur-listbox-item__icon": "_purpur-listbox-item__icon_6c8yl_51"
|
|
130
130
|
};
|
|
131
|
-
function
|
|
131
|
+
function Ft(t) {
|
|
132
132
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
133
133
|
}
|
|
134
|
-
var
|
|
134
|
+
var yr = { exports: {} };
|
|
135
135
|
/*!
|
|
136
136
|
Copyright (c) 2018 Jed Watson.
|
|
137
137
|
Licensed under the MIT License (MIT), see
|
|
138
138
|
http://jedwatson.github.io/classnames
|
|
139
139
|
*/
|
|
140
|
-
var
|
|
141
|
-
function
|
|
142
|
-
return
|
|
140
|
+
var xr;
|
|
141
|
+
function Wt() {
|
|
142
|
+
return xr || (xr = 1, (function(t) {
|
|
143
143
|
(function() {
|
|
144
144
|
var i = {}.hasOwnProperty;
|
|
145
145
|
function n() {
|
|
@@ -168,10 +168,10 @@ function Zt() {
|
|
|
168
168
|
}
|
|
169
169
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
170
170
|
})();
|
|
171
|
-
})(
|
|
171
|
+
})(yr)), yr.exports;
|
|
172
172
|
}
|
|
173
|
-
var
|
|
174
|
-
const
|
|
173
|
+
var Gt = Wt();
|
|
174
|
+
const Kt = /* @__PURE__ */ Ft(Gt), Ut = {
|
|
175
175
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
176
176
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
177
177
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -179,30 +179,30 @@ const Ft = /* @__PURE__ */ Vt(Ht), Wt = {
|
|
|
179
179
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
180
180
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
181
181
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
182
|
-
},
|
|
182
|
+
}, Yt = Kt.bind(Ut), wr = "purpur-icon", Jt = "md", Qt = (t) => t.filter((i) => Object.keys(i).length >= 1).map((i) => `${i.name}="${i.value}"`).join(" "), Xt = ({ content: t = "", title: i } = {}) => {
|
|
183
183
|
const n = [
|
|
184
184
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
185
185
|
{ name: "fill", value: "currentColor" },
|
|
186
186
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
187
187
|
i ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
188
188
|
], o = i ? `<title>${i}</title>` : "";
|
|
189
|
-
return `<svg ${
|
|
190
|
-
},
|
|
191
|
-
const r =
|
|
192
|
-
content:
|
|
189
|
+
return `<svg ${Qt(n)}>${o}${t}</svg>`;
|
|
190
|
+
}, re = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), nt = ({ svg: t, allyTitle: i, className: n, size: o = Jt, ...a }) => {
|
|
191
|
+
const r = Xt({
|
|
192
|
+
content: re(t.svg),
|
|
193
193
|
title: i
|
|
194
|
-
}), e =
|
|
194
|
+
}), e = Yt(n, wr, `${wr}--${o}`);
|
|
195
195
|
return /* @__PURE__ */ l("span", { className: e, dangerouslySetInnerHTML: { __html: r }, ...a });
|
|
196
196
|
};
|
|
197
|
-
|
|
198
|
-
const
|
|
197
|
+
nt.displayName = "Icon";
|
|
198
|
+
const te = {
|
|
199
199
|
name: "checkmark",
|
|
200
200
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M21.06 3.795a.9.9 0 0 1 .145 1.264l-11.5 14.5a.9.9 0 0 1-1.341.077l-6-6a.9.9 0 0 1 1.272-1.272l5.286 5.286L19.795 3.94a.9.9 0 0 1 1.264-.145Z" clip-rule="evenodd"/></svg>',
|
|
201
201
|
keywords: ["checkmark"],
|
|
202
202
|
category: "utility"
|
|
203
|
-
},
|
|
204
|
-
|
|
205
|
-
function
|
|
203
|
+
}, ut = (t) => /* @__PURE__ */ l(nt, { ...t, svg: te });
|
|
204
|
+
ut.displayName = "IconCheckmark";
|
|
205
|
+
function ee(t) {
|
|
206
206
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
207
207
|
}
|
|
208
208
|
var $r = { exports: {} };
|
|
@@ -211,9 +211,9 @@ var $r = { exports: {} };
|
|
|
211
211
|
Licensed under the MIT License (MIT), see
|
|
212
212
|
http://jedwatson.github.io/classnames
|
|
213
213
|
*/
|
|
214
|
-
var
|
|
215
|
-
function
|
|
216
|
-
return
|
|
214
|
+
var Sr;
|
|
215
|
+
function ne() {
|
|
216
|
+
return Sr || (Sr = 1, (function(t) {
|
|
217
217
|
(function() {
|
|
218
218
|
var i = {}.hasOwnProperty;
|
|
219
219
|
function n() {
|
|
@@ -244,8 +244,8 @@ function re() {
|
|
|
244
244
|
})();
|
|
245
245
|
})($r)), $r.exports;
|
|
246
246
|
}
|
|
247
|
-
var
|
|
248
|
-
const
|
|
247
|
+
var ue = ne();
|
|
248
|
+
const ie = /* @__PURE__ */ ee(ue), ae = {
|
|
249
249
|
"purpur-paragraph": "_purpur-paragraph_1rh57_1",
|
|
250
250
|
"purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
|
|
251
251
|
"purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
|
|
@@ -260,26 +260,26 @@ const ee = /* @__PURE__ */ Qt(te), ne = {
|
|
|
260
260
|
"purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1rh57_60",
|
|
261
261
|
"purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1rh57_67",
|
|
262
262
|
"purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1rh57_75"
|
|
263
|
-
},
|
|
263
|
+
}, oe = ie.bind(ae), pe = {
|
|
264
264
|
PARAGRAPH100: "paragraph-100"
|
|
265
|
-
}, H = "purpur-paragraph",
|
|
265
|
+
}, H = "purpur-paragraph", it = ({
|
|
266
266
|
children: t,
|
|
267
267
|
className: i,
|
|
268
268
|
disabled: n,
|
|
269
269
|
enableHyphenation: o = !1,
|
|
270
270
|
negative: a = !1,
|
|
271
|
-
variant: r =
|
|
271
|
+
variant: r = pe.PARAGRAPH100,
|
|
272
272
|
...e
|
|
273
273
|
}) => {
|
|
274
|
-
const u =
|
|
274
|
+
const u = oe(i, H, `${H}--${r}`, {
|
|
275
275
|
[`${H}--hyphens`]: o,
|
|
276
276
|
[`${H}--disabled`]: n,
|
|
277
277
|
[`${H}--negative`]: a
|
|
278
278
|
});
|
|
279
279
|
return /* @__PURE__ */ l("p", { ...e, className: u, children: t });
|
|
280
280
|
};
|
|
281
|
-
|
|
282
|
-
const
|
|
281
|
+
it.displayName = "Paragraph";
|
|
282
|
+
const Nr = tt.bind(et), T = "purpur-listbox", pr = Y((t, i) => {
|
|
283
283
|
const {
|
|
284
284
|
disabled: n,
|
|
285
285
|
highlighted: o,
|
|
@@ -289,58 +289,58 @@ const Sr = rt.bind(tt), E = "purpur-listbox", pr = Y((t, i) => {
|
|
|
289
289
|
className: u,
|
|
290
290
|
noninteractive: v,
|
|
291
291
|
..._
|
|
292
|
-
} = t,
|
|
293
|
-
[`${
|
|
294
|
-
[`${
|
|
295
|
-
[`${
|
|
296
|
-
[`${
|
|
297
|
-
[`${
|
|
292
|
+
} = t, g = Nr(`${T}-item`, u, {
|
|
293
|
+
[`${T}-item--highlighted`]: o,
|
|
294
|
+
[`${T}-item--selected`]: r,
|
|
295
|
+
[`${T}-item--hovered`]: a,
|
|
296
|
+
[`${T}-item--disabled`]: n,
|
|
297
|
+
[`${T}-item--noninteractive`]: v
|
|
298
298
|
});
|
|
299
299
|
return /* @__PURE__ */ O(
|
|
300
300
|
"li",
|
|
301
301
|
{
|
|
302
302
|
..._,
|
|
303
303
|
ref: i,
|
|
304
|
-
className:
|
|
304
|
+
className: g,
|
|
305
305
|
"aria-selected": !!r,
|
|
306
306
|
role: "option",
|
|
307
307
|
"aria-disabled": !!n,
|
|
308
308
|
children: [
|
|
309
|
-
typeof e == "string" ? /* @__PURE__ */ l(
|
|
310
|
-
r && /* @__PURE__ */ l(
|
|
309
|
+
typeof e == "string" ? /* @__PURE__ */ l(it, { children: e }) : e,
|
|
310
|
+
r && /* @__PURE__ */ l(ut, { size: "xs", className: Nr(`${T}-item__icon`) })
|
|
311
311
|
]
|
|
312
312
|
}
|
|
313
313
|
);
|
|
314
|
-
}),
|
|
314
|
+
}), le = (t) => Qr(t) && (t == null ? void 0 : t.type) === pr;
|
|
315
315
|
pr.displayName = "ListBoxItem";
|
|
316
|
-
const
|
|
316
|
+
const se = tt.bind(et), ce = "purpur-listbox", U = Y(
|
|
317
317
|
({ children: t, ...i }, n) => /* @__PURE__ */ l(
|
|
318
318
|
"ul",
|
|
319
319
|
{
|
|
320
320
|
...i,
|
|
321
321
|
ref: n,
|
|
322
|
-
className:
|
|
322
|
+
className: se(ce, i.className),
|
|
323
323
|
role: "listbox",
|
|
324
|
-
children:
|
|
324
|
+
children: jt.toArray(t).filter(le)
|
|
325
325
|
}
|
|
326
326
|
)
|
|
327
327
|
);
|
|
328
328
|
U.Item = pr;
|
|
329
329
|
U.displayName = "ListBox";
|
|
330
|
-
const
|
|
330
|
+
const de = {
|
|
331
331
|
LG: "lg"
|
|
332
332
|
};
|
|
333
|
-
function
|
|
333
|
+
function _e(t) {
|
|
334
334
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
335
335
|
}
|
|
336
|
-
var
|
|
336
|
+
var jr = { exports: {} };
|
|
337
337
|
/*!
|
|
338
338
|
Copyright (c) 2018 Jed Watson.
|
|
339
339
|
Licensed under the MIT License (MIT), see
|
|
340
340
|
http://jedwatson.github.io/classnames
|
|
341
341
|
*/
|
|
342
342
|
var Or;
|
|
343
|
-
function
|
|
343
|
+
function fe() {
|
|
344
344
|
return Or || (Or = 1, (function(t) {
|
|
345
345
|
(function() {
|
|
346
346
|
var i = {}.hasOwnProperty;
|
|
@@ -370,29 +370,30 @@ function ce() {
|
|
|
370
370
|
}
|
|
371
371
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
372
372
|
})();
|
|
373
|
-
})(
|
|
373
|
+
})(jr)), jr.exports;
|
|
374
374
|
}
|
|
375
|
-
var
|
|
376
|
-
const
|
|
375
|
+
var ve = fe();
|
|
376
|
+
const me = /* @__PURE__ */ _e(ve), he = "_rotate_12t9p_1", ge = "_dash_12t9p_1", be = {
|
|
377
377
|
"purpur-spinner": "_purpur-spinner_12t9p_2",
|
|
378
|
-
rotate:
|
|
378
|
+
rotate: he,
|
|
379
379
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_12t9p_6",
|
|
380
380
|
"purpur-spinner--xs": "_purpur-spinner--xs_12t9p_10",
|
|
381
381
|
"purpur-spinner--sm": "_purpur-spinner--sm_12t9p_14",
|
|
382
382
|
"purpur-spinner--md": "_purpur-spinner--md_12t9p_18",
|
|
383
383
|
"purpur-spinner--lg": "_purpur-spinner--lg_12t9p_22",
|
|
384
384
|
"purpur-spinner__circle": "_purpur-spinner__circle_12t9p_26",
|
|
385
|
-
dash:
|
|
385
|
+
dash: ge,
|
|
386
386
|
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_12t9p_41",
|
|
387
387
|
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_12t9p_44"
|
|
388
|
-
}, Ar =
|
|
388
|
+
}, Ar = me.bind(be), F = "purpur-spinner", ye = {
|
|
389
389
|
SM: "sm"
|
|
390
|
-
},
|
|
390
|
+
}, at = ({
|
|
391
391
|
disabled: t = !1,
|
|
392
392
|
negative: i = !1,
|
|
393
|
-
size: n =
|
|
394
|
-
|
|
395
|
-
|
|
393
|
+
size: n = ye.SM,
|
|
394
|
+
className: o,
|
|
395
|
+
...a
|
|
396
|
+
}) => /* @__PURE__ */ l("div", { className: Ar(F, `${F}--${n}`, o), ...a, children: /* @__PURE__ */ l("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ l(
|
|
396
397
|
"circle",
|
|
397
398
|
{
|
|
398
399
|
className: Ar(`${F}__circle`, {
|
|
@@ -404,6 +405,7 @@ const _e = /* @__PURE__ */ se(de), fe = "_rotate_12t9p_1", ve = "_dash_12t9p_1",
|
|
|
404
405
|
r: "20"
|
|
405
406
|
}
|
|
406
407
|
) }) });
|
|
408
|
+
at.displayName = "Spinner";
|
|
407
409
|
function xe(t) {
|
|
408
410
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
409
411
|
}
|
|
@@ -414,7 +416,7 @@ var kr = { exports: {} };
|
|
|
414
416
|
http://jedwatson.github.io/classnames
|
|
415
417
|
*/
|
|
416
418
|
var Cr;
|
|
417
|
-
function
|
|
419
|
+
function we() {
|
|
418
420
|
return Cr || (Cr = 1, (function(t) {
|
|
419
421
|
(function() {
|
|
420
422
|
var i = {}.hasOwnProperty;
|
|
@@ -446,30 +448,31 @@ function be() {
|
|
|
446
448
|
})();
|
|
447
449
|
})(kr)), kr.exports;
|
|
448
450
|
}
|
|
449
|
-
var
|
|
450
|
-
const
|
|
451
|
-
"purpur-button": "_purpur-
|
|
452
|
-
"purpur-button--xs": "_purpur-button--
|
|
453
|
-
"purpur-button--icon-only": "_purpur-button--icon-
|
|
454
|
-
"purpur-button--sm": "_purpur-button--
|
|
455
|
-
"purpur-button--md": "_purpur-button--
|
|
456
|
-
"purpur-button--lg": "_purpur-button--
|
|
457
|
-
"purpur-button--full-width": "_purpur-button--full-
|
|
458
|
-
"purpur-button--primary": "_purpur-button--
|
|
459
|
-
"purpur-button--disabled": "_purpur-button--
|
|
460
|
-
"purpur-button--primary-negative": "_purpur-button--primary-
|
|
461
|
-
"purpur-button--secondary": "_purpur-button--
|
|
462
|
-
"purpur-button--secondary-negative": "_purpur-button--secondary-
|
|
463
|
-
"purpur-button--expressive": "_purpur-button--
|
|
464
|
-
"purpur-button--expressive-negative": "_purpur-button--expressive-
|
|
465
|
-
"purpur-button--negative": "_purpur-button--
|
|
466
|
-
"purpur-button--destructive": "_purpur-button--
|
|
467
|
-
"purpur-button--destructive-negative": "_purpur-button--destructive-
|
|
468
|
-
"purpur-button--tertiary-purple": "_purpur-button--tertiary-
|
|
469
|
-
"purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-
|
|
470
|
-
"purpur-button--text-negative": "_purpur-button--text-
|
|
471
|
-
"purpur-button--text": "_purpur-button--
|
|
472
|
-
|
|
451
|
+
var $e = we();
|
|
452
|
+
const Se = /* @__PURE__ */ xe($e), Ne = {
|
|
453
|
+
"purpur-button": "_purpur-button_10jh0_1",
|
|
454
|
+
"purpur-button--xs": "_purpur-button--xs_10jh0_22",
|
|
455
|
+
"purpur-button--icon-only": "_purpur-button--icon-only_10jh0_25",
|
|
456
|
+
"purpur-button--sm": "_purpur-button--sm_10jh0_28",
|
|
457
|
+
"purpur-button--md": "_purpur-button--md_10jh0_34",
|
|
458
|
+
"purpur-button--lg": "_purpur-button--lg_10jh0_40",
|
|
459
|
+
"purpur-button--full-width": "_purpur-button--full-width_10jh0_46",
|
|
460
|
+
"purpur-button--primary": "_purpur-button--primary_10jh0_64",
|
|
461
|
+
"purpur-button--disabled": "_purpur-button--disabled_10jh0_68",
|
|
462
|
+
"purpur-button--primary-negative": "_purpur-button--primary-negative_10jh0_74",
|
|
463
|
+
"purpur-button--secondary": "_purpur-button--secondary_10jh0_86",
|
|
464
|
+
"purpur-button--secondary-negative": "_purpur-button--secondary-negative_10jh0_97",
|
|
465
|
+
"purpur-button--expressive": "_purpur-button--expressive_10jh0_108",
|
|
466
|
+
"purpur-button--expressive-negative": "_purpur-button--expressive-negative_10jh0_118",
|
|
467
|
+
"purpur-button--negative": "_purpur-button--negative_10jh0_130",
|
|
468
|
+
"purpur-button--destructive": "_purpur-button--destructive_10jh0_137",
|
|
469
|
+
"purpur-button--destructive-negative": "_purpur-button--destructive-negative_10jh0_147",
|
|
470
|
+
"purpur-button--tertiary-purple": "_purpur-button--tertiary-purple_10jh0_157",
|
|
471
|
+
"purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_10jh0_170",
|
|
472
|
+
"purpur-button--text-negative": "_purpur-button--text-negative_10jh0_185",
|
|
473
|
+
"purpur-button--text": "_purpur-button--text_10jh0_185",
|
|
474
|
+
"purpur-button__spinner": "_purpur-button__spinner_10jh0_235"
|
|
475
|
+
}, Pr = Se.bind(Ne), L = "purpur-button", ot = Y(
|
|
473
476
|
({
|
|
474
477
|
children: t,
|
|
475
478
|
className: i,
|
|
@@ -481,43 +484,44 @@ const we = /* @__PURE__ */ xe(ye), $e = {
|
|
|
481
484
|
onClick: u,
|
|
482
485
|
size: v = "md",
|
|
483
486
|
variant: _,
|
|
484
|
-
type:
|
|
485
|
-
...
|
|
486
|
-
},
|
|
487
|
+
type: g = "button",
|
|
488
|
+
...b
|
|
489
|
+
}, N) => {
|
|
487
490
|
if (a && _ === "destructive")
|
|
488
491
|
return null;
|
|
489
|
-
const A =
|
|
492
|
+
const A = Pr(
|
|
490
493
|
[
|
|
491
|
-
|
|
492
|
-
`${
|
|
493
|
-
`${
|
|
494
|
+
L,
|
|
495
|
+
`${L}--${e ? `${_}-negative` : _}`,
|
|
496
|
+
`${L}--${v}`
|
|
494
497
|
],
|
|
495
498
|
{
|
|
496
|
-
[`${
|
|
497
|
-
[`${
|
|
498
|
-
[`${
|
|
499
|
-
[`${
|
|
499
|
+
[`${L}--icon-only`]: a,
|
|
500
|
+
[`${L}--negative`]: e,
|
|
501
|
+
[`${L}--full-width`]: o,
|
|
502
|
+
[`${L}--disabled`]: n || r
|
|
500
503
|
},
|
|
501
504
|
i
|
|
502
|
-
), f = (
|
|
503
|
-
n || r ?
|
|
504
|
-
}, $ = !!
|
|
505
|
+
), f = (S) => {
|
|
506
|
+
n || r ? S.preventDefault() : u && u(S);
|
|
507
|
+
}, $ = !!b["aria-disabled"] || n || r;
|
|
505
508
|
return /* @__PURE__ */ O(
|
|
506
509
|
"button",
|
|
507
510
|
{
|
|
508
511
|
className: A,
|
|
509
|
-
type:
|
|
510
|
-
ref:
|
|
512
|
+
type: g,
|
|
513
|
+
ref: N,
|
|
511
514
|
"aria-disabled": $,
|
|
512
515
|
onClick: f,
|
|
513
|
-
...
|
|
516
|
+
...b,
|
|
514
517
|
children: [
|
|
515
518
|
r && /* @__PURE__ */ l(
|
|
516
|
-
|
|
519
|
+
at,
|
|
517
520
|
{
|
|
518
|
-
size: v ===
|
|
521
|
+
size: v === de.LG ? "xs" : "xxs",
|
|
519
522
|
negative: e,
|
|
520
|
-
disabled:
|
|
523
|
+
disabled: $,
|
|
524
|
+
className: Pr(`${L}__spinner`)
|
|
521
525
|
}
|
|
522
526
|
),
|
|
523
527
|
" ",
|
|
@@ -527,19 +531,19 @@ const we = /* @__PURE__ */ xe(ye), $e = {
|
|
|
527
531
|
);
|
|
528
532
|
}
|
|
529
533
|
);
|
|
530
|
-
|
|
531
|
-
function
|
|
534
|
+
ot.displayName = "Button";
|
|
535
|
+
function je(t) {
|
|
532
536
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
533
537
|
}
|
|
534
|
-
var
|
|
538
|
+
var qr = { exports: {} };
|
|
535
539
|
/*!
|
|
536
540
|
Copyright (c) 2018 Jed Watson.
|
|
537
541
|
Licensed under the MIT License (MIT), see
|
|
538
542
|
http://jedwatson.github.io/classnames
|
|
539
543
|
*/
|
|
540
|
-
var
|
|
541
|
-
function
|
|
542
|
-
return
|
|
544
|
+
var Rr;
|
|
545
|
+
function Oe() {
|
|
546
|
+
return Rr || (Rr = 1, (function(t) {
|
|
543
547
|
(function() {
|
|
544
548
|
var i = {}.hasOwnProperty;
|
|
545
549
|
function n() {
|
|
@@ -568,10 +572,10 @@ function Ne() {
|
|
|
568
572
|
}
|
|
569
573
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
570
574
|
})();
|
|
571
|
-
})(
|
|
575
|
+
})(qr)), qr.exports;
|
|
572
576
|
}
|
|
573
|
-
var
|
|
574
|
-
const
|
|
577
|
+
var Ae = Oe();
|
|
578
|
+
const ke = /* @__PURE__ */ je(Ae), Ce = {
|
|
575
579
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
576
580
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
577
581
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -579,40 +583,40 @@ const Ae = /* @__PURE__ */ Se(Oe), ke = {
|
|
|
579
583
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
580
584
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
581
585
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
582
|
-
},
|
|
586
|
+
}, Pe = ke.bind(Ce), Lr = "purpur-icon", qe = "md", Re = (t) => t.filter((i) => Object.keys(i).length >= 1).map((i) => `${i.name}="${i.value}"`).join(" "), Le = ({ content: t = "", title: i } = {}) => {
|
|
583
587
|
const n = [
|
|
584
588
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
585
589
|
{ name: "fill", value: "currentColor" },
|
|
586
590
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
587
591
|
i ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
588
592
|
], o = i ? `<title>${i}</title>` : "";
|
|
589
|
-
return `<svg ${
|
|
590
|
-
},
|
|
591
|
-
const r =
|
|
592
|
-
content:
|
|
593
|
+
return `<svg ${Re(n)}>${o}${t}</svg>`;
|
|
594
|
+
}, Me = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), pt = ({ svg: t, allyTitle: i, className: n, size: o = qe, ...a }) => {
|
|
595
|
+
const r = Le({
|
|
596
|
+
content: Me(t.svg),
|
|
593
597
|
title: i
|
|
594
|
-
}), e =
|
|
598
|
+
}), e = Pe(n, Lr, `${Lr}--${o}`);
|
|
595
599
|
return /* @__PURE__ */ l("span", { className: e, dangerouslySetInnerHTML: { __html: r }, ...a });
|
|
596
600
|
};
|
|
597
|
-
|
|
598
|
-
const
|
|
601
|
+
pt.displayName = "Icon";
|
|
602
|
+
const Be = {
|
|
599
603
|
name: "error-filled",
|
|
600
604
|
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>',
|
|
601
605
|
keywords: ["error-filled"],
|
|
602
606
|
category: "status"
|
|
603
607
|
};
|
|
604
|
-
function
|
|
608
|
+
function Ee(t) {
|
|
605
609
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
606
610
|
}
|
|
607
|
-
var
|
|
611
|
+
var Mr = { exports: {} };
|
|
608
612
|
/*!
|
|
609
613
|
Copyright (c) 2018 Jed Watson.
|
|
610
614
|
Licensed under the MIT License (MIT), see
|
|
611
615
|
http://jedwatson.github.io/classnames
|
|
612
616
|
*/
|
|
613
|
-
var
|
|
614
|
-
function
|
|
615
|
-
return
|
|
617
|
+
var Br;
|
|
618
|
+
function Te() {
|
|
619
|
+
return Br || (Br = 1, (function(t) {
|
|
616
620
|
(function() {
|
|
617
621
|
var i = {}.hasOwnProperty;
|
|
618
622
|
function n() {
|
|
@@ -641,14 +645,14 @@ function Ee() {
|
|
|
641
645
|
}
|
|
642
646
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
643
647
|
})();
|
|
644
|
-
})(
|
|
648
|
+
})(Mr)), Mr.exports;
|
|
645
649
|
}
|
|
646
|
-
var
|
|
647
|
-
const
|
|
650
|
+
var Ie = Te();
|
|
651
|
+
const ze = /* @__PURE__ */ Ee(Ie), De = {
|
|
648
652
|
"purpur-field-error-text": "_purpur-field-error-text_u1cy2_1",
|
|
649
653
|
"purpur-field-error-text--negative": "_purpur-field-error-text--negative_u1cy2_11",
|
|
650
654
|
"purpur-field-error-text__icon": "_purpur-field-error-text__icon_u1cy2_14"
|
|
651
|
-
},
|
|
655
|
+
}, Er = ze.bind(De), ur = "purpur-field-error-text", Ve = ({
|
|
652
656
|
children: t,
|
|
653
657
|
className: i,
|
|
654
658
|
negative: n = !1,
|
|
@@ -657,30 +661,30 @@ const Ie = /* @__PURE__ */ Be(Te), ze = {
|
|
|
657
661
|
}) => /* @__PURE__ */ O(
|
|
658
662
|
"div",
|
|
659
663
|
{
|
|
660
|
-
className:
|
|
664
|
+
className: Er(i, ur, {
|
|
661
665
|
[`${ur}--negative`]: n
|
|
662
666
|
}),
|
|
663
667
|
"aria-live": "assertive",
|
|
664
668
|
"aria-relevant": o,
|
|
665
669
|
...a,
|
|
666
670
|
children: [
|
|
667
|
-
/* @__PURE__ */ l(
|
|
671
|
+
/* @__PURE__ */ l(pt, { svg: Be, size: "xs", className: Er(`${ur}__icon`) }),
|
|
668
672
|
t
|
|
669
673
|
]
|
|
670
674
|
}
|
|
671
675
|
);
|
|
672
|
-
function
|
|
676
|
+
function Ze(t) {
|
|
673
677
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
674
678
|
}
|
|
675
|
-
var
|
|
679
|
+
var Tr = { exports: {} };
|
|
676
680
|
/*!
|
|
677
681
|
Copyright (c) 2018 Jed Watson.
|
|
678
682
|
Licensed under the MIT License (MIT), see
|
|
679
683
|
http://jedwatson.github.io/classnames
|
|
680
684
|
*/
|
|
681
|
-
var
|
|
682
|
-
function
|
|
683
|
-
return
|
|
685
|
+
var Ir;
|
|
686
|
+
function He() {
|
|
687
|
+
return Ir || (Ir = 1, (function(t) {
|
|
684
688
|
(function() {
|
|
685
689
|
var i = {}.hasOwnProperty;
|
|
686
690
|
function n() {
|
|
@@ -709,14 +713,14 @@ function Ze() {
|
|
|
709
713
|
}
|
|
710
714
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
711
715
|
})();
|
|
712
|
-
})(
|
|
716
|
+
})(Tr)), Tr.exports;
|
|
713
717
|
}
|
|
714
|
-
var
|
|
715
|
-
const
|
|
718
|
+
var Fe = He();
|
|
719
|
+
const We = /* @__PURE__ */ Ze(Fe), Ge = {
|
|
716
720
|
"purpur-field-helper-text": "_purpur-field-helper-text_11nsh_1",
|
|
717
721
|
"purpur-field-helper-text--disabled": "_purpur-field-helper-text--disabled_11nsh_9",
|
|
718
722
|
"purpur-field-helper-text--negative": "_purpur-field-helper-text--negative_11nsh_12"
|
|
719
|
-
},
|
|
723
|
+
}, Ke = We.bind(Ge), ir = "purpur-field-helper-text", Ue = ({
|
|
720
724
|
children: t,
|
|
721
725
|
className: i,
|
|
722
726
|
disabled: n,
|
|
@@ -724,24 +728,24 @@ const Fe = /* @__PURE__ */ Ve(He), We = {
|
|
|
724
728
|
negative: a,
|
|
725
729
|
...r
|
|
726
730
|
}) => {
|
|
727
|
-
const e =
|
|
731
|
+
const e = Ke(i, ir, {
|
|
728
732
|
[`${ir}--disabled`]: n,
|
|
729
733
|
[`${ir}--negative`]: a
|
|
730
734
|
});
|
|
731
735
|
return /* @__PURE__ */ l("span", { id: o, className: e, ...r, children: t });
|
|
732
736
|
};
|
|
733
|
-
function
|
|
737
|
+
function Ye(t) {
|
|
734
738
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
735
739
|
}
|
|
736
|
-
var
|
|
740
|
+
var zr = { exports: {} };
|
|
737
741
|
/*!
|
|
738
742
|
Copyright (c) 2018 Jed Watson.
|
|
739
743
|
Licensed under the MIT License (MIT), see
|
|
740
744
|
http://jedwatson.github.io/classnames
|
|
741
745
|
*/
|
|
742
|
-
var
|
|
743
|
-
function
|
|
744
|
-
return
|
|
746
|
+
var Dr;
|
|
747
|
+
function Je() {
|
|
748
|
+
return Dr || (Dr = 1, (function(t) {
|
|
745
749
|
(function() {
|
|
746
750
|
var i = {}.hasOwnProperty;
|
|
747
751
|
function n() {
|
|
@@ -770,10 +774,10 @@ function Ye() {
|
|
|
770
774
|
}
|
|
771
775
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
772
776
|
})();
|
|
773
|
-
})(
|
|
777
|
+
})(zr)), zr.exports;
|
|
774
778
|
}
|
|
775
|
-
var
|
|
776
|
-
const Xe = /* @__PURE__ */
|
|
779
|
+
var Qe = Je();
|
|
780
|
+
const Xe = /* @__PURE__ */ Ye(Qe), rn = {
|
|
777
781
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
778
782
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
779
783
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -781,86 +785,86 @@ const Xe = /* @__PURE__ */ Ue(Je), Qe = {
|
|
|
781
785
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
782
786
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
783
787
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
784
|
-
},
|
|
788
|
+
}, tn = Xe.bind(rn), Vr = "purpur-icon", en = "md", nn = (t) => t.filter((i) => Object.keys(i).length >= 1).map((i) => `${i.name}="${i.value}"`).join(" "), un = ({ content: t = "", title: i } = {}) => {
|
|
785
789
|
const n = [
|
|
786
790
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
787
791
|
{ name: "fill", value: "currentColor" },
|
|
788
792
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
789
793
|
i ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
790
794
|
], o = i ? `<title>${i}</title>` : "";
|
|
791
|
-
return `<svg ${
|
|
792
|
-
},
|
|
793
|
-
const r =
|
|
794
|
-
content:
|
|
795
|
+
return `<svg ${nn(n)}>${o}${t}</svg>`;
|
|
796
|
+
}, an = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), lr = ({ svg: t, allyTitle: i, className: n, size: o = en, ...a }) => {
|
|
797
|
+
const r = un({
|
|
798
|
+
content: an(t.svg),
|
|
795
799
|
title: i
|
|
796
|
-
}), e =
|
|
800
|
+
}), e = tn(n, Vr, `${Vr}--${o}`);
|
|
797
801
|
return /* @__PURE__ */ l("span", { className: e, dangerouslySetInnerHTML: { __html: r }, ...a });
|
|
798
802
|
};
|
|
799
803
|
lr.displayName = "Icon";
|
|
800
|
-
const
|
|
804
|
+
const on = {
|
|
801
805
|
name: "check-circle-filled",
|
|
802
806
|
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>',
|
|
803
807
|
keywords: ["check-circle-filled"],
|
|
804
808
|
category: "status"
|
|
805
|
-
},
|
|
806
|
-
|
|
807
|
-
const
|
|
809
|
+
}, lt = (t) => /* @__PURE__ */ l(lr, { ...t, svg: on });
|
|
810
|
+
lt.displayName = "IconCheckCircleFilled";
|
|
811
|
+
const pn = {
|
|
808
812
|
name: "close",
|
|
809
813
|
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>',
|
|
810
814
|
keywords: ["close"],
|
|
811
815
|
category: "utility"
|
|
812
|
-
},
|
|
813
|
-
|
|
814
|
-
function
|
|
816
|
+
}, st = (t) => /* @__PURE__ */ l(lr, { ...t, svg: pn });
|
|
817
|
+
st.displayName = "IconClose";
|
|
818
|
+
function Zr(t, i) {
|
|
815
819
|
if (typeof t == "function")
|
|
816
820
|
return t(i);
|
|
817
821
|
t != null && (t.current = i);
|
|
818
822
|
}
|
|
819
|
-
function
|
|
823
|
+
function ln(...t) {
|
|
820
824
|
return (i) => {
|
|
821
825
|
let n = !1;
|
|
822
826
|
const o = t.map((a) => {
|
|
823
|
-
const r =
|
|
827
|
+
const r = Zr(a, i);
|
|
824
828
|
return !n && typeof r == "function" && (n = !0), r;
|
|
825
829
|
});
|
|
826
830
|
if (n)
|
|
827
831
|
return () => {
|
|
828
832
|
for (let a = 0; a < o.length; a++) {
|
|
829
833
|
const r = o[a];
|
|
830
|
-
typeof r == "function" ? r() :
|
|
834
|
+
typeof r == "function" ? r() : Zr(t[a], null);
|
|
831
835
|
}
|
|
832
836
|
};
|
|
833
837
|
};
|
|
834
838
|
}
|
|
835
839
|
// @__NO_SIDE_EFFECTS__
|
|
836
|
-
function
|
|
837
|
-
const i = /* @__PURE__ */
|
|
838
|
-
const { children: r, ...e } = o, u =
|
|
840
|
+
function sn(t) {
|
|
841
|
+
const i = /* @__PURE__ */ cn(t), n = h.forwardRef((o, a) => {
|
|
842
|
+
const { children: r, ...e } = o, u = h.Children.toArray(r), v = u.find(_n);
|
|
839
843
|
if (v) {
|
|
840
|
-
const _ = v.props.children,
|
|
841
|
-
return /* @__PURE__ */ l(i, { ...e, ref: a, children:
|
|
844
|
+
const _ = v.props.children, g = u.map((b) => b === v ? h.Children.count(_) > 1 ? h.Children.only(null) : h.isValidElement(_) ? _.props.children : null : b);
|
|
845
|
+
return /* @__PURE__ */ l(i, { ...e, ref: a, children: h.isValidElement(_) ? h.cloneElement(_, void 0, g) : null });
|
|
842
846
|
}
|
|
843
847
|
return /* @__PURE__ */ l(i, { ...e, ref: a, children: r });
|
|
844
848
|
});
|
|
845
849
|
return n.displayName = `${t}.Slot`, n;
|
|
846
850
|
}
|
|
847
851
|
// @__NO_SIDE_EFFECTS__
|
|
848
|
-
function
|
|
849
|
-
const i =
|
|
852
|
+
function cn(t) {
|
|
853
|
+
const i = h.forwardRef((n, o) => {
|
|
850
854
|
const { children: a, ...r } = n;
|
|
851
|
-
if (
|
|
852
|
-
const e =
|
|
853
|
-
return a.type !==
|
|
855
|
+
if (h.isValidElement(a)) {
|
|
856
|
+
const e = vn(a), u = fn(r, a.props);
|
|
857
|
+
return a.type !== h.Fragment && (u.ref = o ? ln(o, e) : e), h.cloneElement(a, u);
|
|
854
858
|
}
|
|
855
|
-
return
|
|
859
|
+
return h.Children.count(a) > 1 ? h.Children.only(null) : null;
|
|
856
860
|
});
|
|
857
861
|
return i.displayName = `${t}.SlotClone`, i;
|
|
858
862
|
}
|
|
859
|
-
var
|
|
860
|
-
function
|
|
861
|
-
return
|
|
863
|
+
var dn = Symbol("radix.slottable");
|
|
864
|
+
function _n(t) {
|
|
865
|
+
return h.isValidElement(t) && typeof t.type == "function" && "__radixId" in t.type && t.type.__radixId === dn;
|
|
862
866
|
}
|
|
863
|
-
function
|
|
867
|
+
function fn(t, i) {
|
|
864
868
|
const n = { ...i };
|
|
865
869
|
for (const o in i) {
|
|
866
870
|
const a = t[o], r = i[o];
|
|
@@ -871,12 +875,12 @@ function _n(t, i) {
|
|
|
871
875
|
}
|
|
872
876
|
return { ...t, ...n };
|
|
873
877
|
}
|
|
874
|
-
function
|
|
878
|
+
function vn(t) {
|
|
875
879
|
var i, n;
|
|
876
880
|
let o = (i = Object.getOwnPropertyDescriptor(t.props, "ref")) == null ? void 0 : i.get, a = o && "isReactWarning" in o && o.isReactWarning;
|
|
877
881
|
return a ? t.ref : (o = (n = Object.getOwnPropertyDescriptor(t, "ref")) == null ? void 0 : n.get, a = o && "isReactWarning" in o && o.isReactWarning, a ? t.props.ref : t.props.ref || t.ref);
|
|
878
882
|
}
|
|
879
|
-
var
|
|
883
|
+
var mn = [
|
|
880
884
|
"a",
|
|
881
885
|
"button",
|
|
882
886
|
"div",
|
|
@@ -894,14 +898,14 @@ var vn = [
|
|
|
894
898
|
"span",
|
|
895
899
|
"svg",
|
|
896
900
|
"ul"
|
|
897
|
-
],
|
|
898
|
-
const n = /* @__PURE__ */
|
|
901
|
+
], hn = mn.reduce((t, i) => {
|
|
902
|
+
const n = /* @__PURE__ */ sn(`Primitive.${i}`), o = h.forwardRef((a, r) => {
|
|
899
903
|
const { asChild: e, ...u } = a, v = e ? n : i;
|
|
900
904
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ l(v, { ...u, ref: r });
|
|
901
905
|
});
|
|
902
906
|
return o.displayName = `Primitive.${i}`, { ...t, [i]: o };
|
|
903
|
-
}, {}), gn = "Label",
|
|
904
|
-
|
|
907
|
+
}, {}), gn = "Label", ct = h.forwardRef((t, i) => /* @__PURE__ */ l(
|
|
908
|
+
hn.label,
|
|
905
909
|
{
|
|
906
910
|
...t,
|
|
907
911
|
ref: i,
|
|
@@ -911,20 +915,20 @@ var vn = [
|
|
|
911
915
|
}
|
|
912
916
|
}
|
|
913
917
|
));
|
|
914
|
-
|
|
915
|
-
var
|
|
916
|
-
function
|
|
918
|
+
ct.displayName = gn;
|
|
919
|
+
var bn = ct;
|
|
920
|
+
function yn(t) {
|
|
917
921
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
918
922
|
}
|
|
919
|
-
var
|
|
923
|
+
var Hr = { exports: {} };
|
|
920
924
|
/*!
|
|
921
925
|
Copyright (c) 2018 Jed Watson.
|
|
922
926
|
Licensed under the MIT License (MIT), see
|
|
923
927
|
http://jedwatson.github.io/classnames
|
|
924
928
|
*/
|
|
925
|
-
var
|
|
926
|
-
function
|
|
927
|
-
return
|
|
929
|
+
var Fr;
|
|
930
|
+
function xn() {
|
|
931
|
+
return Fr || (Fr = 1, (function(t) {
|
|
928
932
|
(function() {
|
|
929
933
|
var i = {}.hasOwnProperty;
|
|
930
934
|
function n() {
|
|
@@ -953,38 +957,38 @@ function bn() {
|
|
|
953
957
|
}
|
|
954
958
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
955
959
|
})();
|
|
956
|
-
})(
|
|
960
|
+
})(Hr)), Hr.exports;
|
|
957
961
|
}
|
|
958
|
-
var
|
|
959
|
-
const
|
|
962
|
+
var wn = xn();
|
|
963
|
+
const $n = /* @__PURE__ */ yn(wn), Sn = {
|
|
960
964
|
"purpur-label": "_purpur-label_1x80u_1",
|
|
961
965
|
"purpur-label--negative": "_purpur-label--negative_1x80u_8",
|
|
962
966
|
"purpur-label--disabled": "_purpur-label--disabled_1x80u_11"
|
|
963
|
-
},
|
|
967
|
+
}, Nn = $n.bind(Sn), ar = "purpur-label", jn = ({
|
|
964
968
|
children: t,
|
|
965
969
|
className: i,
|
|
966
970
|
disabled: n,
|
|
967
971
|
negative: o = !1,
|
|
968
972
|
...a
|
|
969
973
|
}) => {
|
|
970
|
-
const r =
|
|
974
|
+
const r = Nn(i, ar, {
|
|
971
975
|
[`${ar}--disabled`]: n,
|
|
972
976
|
[`${ar}--negative`]: o
|
|
973
977
|
});
|
|
974
|
-
return /* @__PURE__ */ l(
|
|
978
|
+
return /* @__PURE__ */ l(bn, { className: r, ...a, children: t });
|
|
975
979
|
};
|
|
976
|
-
function
|
|
980
|
+
function On(t) {
|
|
977
981
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
978
982
|
}
|
|
979
|
-
var
|
|
983
|
+
var Wr = { exports: {} };
|
|
980
984
|
/*!
|
|
981
985
|
Copyright (c) 2018 Jed Watson.
|
|
982
986
|
Licensed under the MIT License (MIT), see
|
|
983
987
|
http://jedwatson.github.io/classnames
|
|
984
988
|
*/
|
|
985
|
-
var
|
|
986
|
-
function
|
|
987
|
-
return
|
|
989
|
+
var Gr;
|
|
990
|
+
function An() {
|
|
991
|
+
return Gr || (Gr = 1, (function(t) {
|
|
988
992
|
(function() {
|
|
989
993
|
var i = {}.hasOwnProperty;
|
|
990
994
|
function n() {
|
|
@@ -1013,32 +1017,33 @@ function On() {
|
|
|
1013
1017
|
}
|
|
1014
1018
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
1015
1019
|
})();
|
|
1016
|
-
})(
|
|
1020
|
+
})(Wr)), Wr.exports;
|
|
1017
1021
|
}
|
|
1018
|
-
var
|
|
1019
|
-
const
|
|
1022
|
+
var kn = An();
|
|
1023
|
+
const Cn = /* @__PURE__ */ On(kn), Pn = "_rotate_12t9p_1", qn = "_dash_12t9p_1", Rn = {
|
|
1020
1024
|
"purpur-spinner": "_purpur-spinner_12t9p_2",
|
|
1021
|
-
rotate:
|
|
1025
|
+
rotate: Pn,
|
|
1022
1026
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_12t9p_6",
|
|
1023
1027
|
"purpur-spinner--xs": "_purpur-spinner--xs_12t9p_10",
|
|
1024
1028
|
"purpur-spinner--sm": "_purpur-spinner--sm_12t9p_14",
|
|
1025
1029
|
"purpur-spinner--md": "_purpur-spinner--md_12t9p_18",
|
|
1026
1030
|
"purpur-spinner--lg": "_purpur-spinner--lg_12t9p_22",
|
|
1027
1031
|
"purpur-spinner__circle": "_purpur-spinner__circle_12t9p_26",
|
|
1028
|
-
dash:
|
|
1032
|
+
dash: qn,
|
|
1029
1033
|
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_12t9p_41",
|
|
1030
1034
|
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_12t9p_44"
|
|
1031
|
-
},
|
|
1035
|
+
}, Kr = Cn.bind(Rn), W = "purpur-spinner", Ln = {
|
|
1032
1036
|
SM: "sm"
|
|
1033
|
-
},
|
|
1037
|
+
}, dt = ({
|
|
1034
1038
|
disabled: t = !1,
|
|
1035
1039
|
negative: i = !1,
|
|
1036
|
-
size: n =
|
|
1037
|
-
|
|
1038
|
-
|
|
1040
|
+
size: n = Ln.SM,
|
|
1041
|
+
className: o,
|
|
1042
|
+
...a
|
|
1043
|
+
}) => /* @__PURE__ */ l("div", { className: Kr(W, `${W}--${n}`, o), ...a, children: /* @__PURE__ */ l("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ l(
|
|
1039
1044
|
"circle",
|
|
1040
1045
|
{
|
|
1041
|
-
className:
|
|
1046
|
+
className: Kr(`${W}__circle`, {
|
|
1042
1047
|
[`${W}__circle--disabled`]: t,
|
|
1043
1048
|
[`${W}__circle--negative`]: i
|
|
1044
1049
|
}),
|
|
@@ -1047,18 +1052,19 @@ const kn = /* @__PURE__ */ Nn(An), Cn = "_rotate_12t9p_1", Pn = "_dash_12t9p_1",
|
|
|
1047
1052
|
r: "20"
|
|
1048
1053
|
}
|
|
1049
1054
|
) }) });
|
|
1055
|
+
dt.displayName = "Spinner";
|
|
1050
1056
|
function Mn(t) {
|
|
1051
1057
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1052
1058
|
}
|
|
1053
|
-
var
|
|
1059
|
+
var Ur = { exports: {} };
|
|
1054
1060
|
/*!
|
|
1055
1061
|
Copyright (c) 2018 Jed Watson.
|
|
1056
1062
|
Licensed under the MIT License (MIT), see
|
|
1057
1063
|
http://jedwatson.github.io/classnames
|
|
1058
1064
|
*/
|
|
1059
|
-
var
|
|
1065
|
+
var Yr;
|
|
1060
1066
|
function Bn() {
|
|
1061
|
-
return
|
|
1067
|
+
return Yr || (Yr = 1, (function(t) {
|
|
1062
1068
|
(function() {
|
|
1063
1069
|
var i = {}.hasOwnProperty;
|
|
1064
1070
|
function n() {
|
|
@@ -1087,7 +1093,7 @@ function Bn() {
|
|
|
1087
1093
|
}
|
|
1088
1094
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
1089
1095
|
})();
|
|
1090
|
-
})(
|
|
1096
|
+
})(Ur)), Ur.exports;
|
|
1091
1097
|
}
|
|
1092
1098
|
var En = Bn();
|
|
1093
1099
|
const Tn = /* @__PURE__ */ Mn(En), In = {
|
|
@@ -1107,7 +1113,7 @@ const Tn = /* @__PURE__ */ Mn(En), In = {
|
|
|
1107
1113
|
"purpur-text-field__input--error": "_purpur-text-field__input--error_3gl1k_94",
|
|
1108
1114
|
"purpur-text-field__adornment-container": "_purpur-text-field__adornment-container_3gl1k_106",
|
|
1109
1115
|
"purpur-text-field__valid-icon": "_purpur-text-field__valid-icon_3gl1k_111"
|
|
1110
|
-
}, zn = (t) => K(t), P = Tn.bind(In), m = "purpur-text-field",
|
|
1116
|
+
}, zn = (t) => K(t), P = Tn.bind(In), m = "purpur-text-field", _t = Y(
|
|
1111
1117
|
({
|
|
1112
1118
|
["data-testid"]: t,
|
|
1113
1119
|
className: i,
|
|
@@ -1119,63 +1125,63 @@ const Tn = /* @__PURE__ */ Mn(En), In = {
|
|
|
1119
1125
|
helperText: u,
|
|
1120
1126
|
hideRequiredAsterisk: v = !1,
|
|
1121
1127
|
label: _,
|
|
1122
|
-
loading:
|
|
1123
|
-
onClear:
|
|
1124
|
-
startAdornment:
|
|
1128
|
+
loading: g = !1,
|
|
1129
|
+
onClear: b,
|
|
1130
|
+
startAdornment: N,
|
|
1125
1131
|
valid: A = !1,
|
|
1126
1132
|
...f
|
|
1127
1133
|
}, $) => {
|
|
1128
|
-
var
|
|
1129
|
-
const
|
|
1130
|
-
k.current =
|
|
1134
|
+
var S;
|
|
1135
|
+
const j = Ot(), s = f.id ?? j, y = (x) => t ? `${t}-${x}` : void 0, q = A && !e, M = u ? `${s}-helper-text` : void 0, I = [N].filter((x) => !!x), d = (typeof f.value == "number" ? f.value !== void 0 : (S = f.value) == null ? void 0 : S.length) && !f.disabled && !f.readOnly && !g && b && n, k = zn(null), z = (x) => {
|
|
1136
|
+
k.current = x, typeof $ == "function" ? $(x) : $ && ($.current = x);
|
|
1131
1137
|
}, J = () => {
|
|
1132
|
-
var
|
|
1133
|
-
|
|
1134
|
-
},
|
|
1135
|
-
|
|
1136
|
-
|
|
1138
|
+
var x;
|
|
1139
|
+
b == null || b(), (x = k.current) == null || x.focus();
|
|
1140
|
+
}, B = [
|
|
1141
|
+
g && /* @__PURE__ */ l(
|
|
1142
|
+
dt,
|
|
1137
1143
|
{
|
|
1138
1144
|
disabled: f.disabled,
|
|
1139
1145
|
size: "xs",
|
|
1140
|
-
"data-testid":
|
|
1146
|
+
"data-testid": y("spinner")
|
|
1141
1147
|
},
|
|
1142
1148
|
"spinner"
|
|
1143
1149
|
),
|
|
1144
1150
|
d && /* @__PURE__ */ l(
|
|
1145
|
-
|
|
1151
|
+
ot,
|
|
1146
1152
|
{
|
|
1147
1153
|
variant: "tertiary-purple",
|
|
1148
1154
|
onClick: J,
|
|
1149
1155
|
iconOnly: !0,
|
|
1150
1156
|
"aria-label": n ?? "",
|
|
1151
|
-
"data-testid":
|
|
1157
|
+
"data-testid": y("clear-button"),
|
|
1152
1158
|
tabIndex: -1,
|
|
1153
|
-
children: /* @__PURE__ */ l(
|
|
1159
|
+
children: /* @__PURE__ */ l(st, { size: "xs" })
|
|
1154
1160
|
},
|
|
1155
1161
|
"clear-button"
|
|
1156
1162
|
),
|
|
1157
1163
|
q && /* @__PURE__ */ l(
|
|
1158
|
-
|
|
1164
|
+
lt,
|
|
1159
1165
|
{
|
|
1160
|
-
"data-testid":
|
|
1166
|
+
"data-testid": y("valid-icon"),
|
|
1161
1167
|
className: P(`${m}__valid-icon`)
|
|
1162
1168
|
},
|
|
1163
1169
|
"valid-icon"
|
|
1164
1170
|
)
|
|
1165
|
-
].filter((
|
|
1171
|
+
].filter((x) => !!x), D = P(`${m}__input-container`, {
|
|
1166
1172
|
[`${m}__input-container--start-adornment`]: I.length,
|
|
1167
|
-
[`${m}__input-container--end-adornment`]:
|
|
1173
|
+
[`${m}__input-container--end-adornment`]: B.length || r,
|
|
1168
1174
|
[`${m}__input-container--disabled`]: f.disabled,
|
|
1169
1175
|
[`${m}__input-container--has-clear-button`]: d,
|
|
1170
1176
|
[`${m}__input-container--readonly`]: f.readOnly && !f.disabled
|
|
1171
1177
|
});
|
|
1172
1178
|
return /* @__PURE__ */ O("div", { className: P(i, m), children: [
|
|
1173
1179
|
_ && /* @__PURE__ */ O(
|
|
1174
|
-
|
|
1180
|
+
jn,
|
|
1175
1181
|
{
|
|
1176
1182
|
htmlFor: s,
|
|
1177
1183
|
className: P(`${m}__label`),
|
|
1178
|
-
"data-testid":
|
|
1184
|
+
"data-testid": y("label"),
|
|
1179
1185
|
disabled: f.disabled,
|
|
1180
1186
|
children: [
|
|
1181
1187
|
f.required && !v && /* @__PURE__ */ l("span", { "aria-hidden": !0, children: "*" }),
|
|
@@ -1189,7 +1195,7 @@ const Tn = /* @__PURE__ */ Mn(En), In = {
|
|
|
1189
1195
|
!!I.length && /* @__PURE__ */ l(
|
|
1190
1196
|
"div",
|
|
1191
1197
|
{
|
|
1192
|
-
"data-testid":
|
|
1198
|
+
"data-testid": y("start-adornments"),
|
|
1193
1199
|
className: P(`${m}__adornment-container`),
|
|
1194
1200
|
children: I
|
|
1195
1201
|
}
|
|
@@ -1200,8 +1206,8 @@ const Tn = /* @__PURE__ */ Mn(En), In = {
|
|
|
1200
1206
|
...f,
|
|
1201
1207
|
id: s,
|
|
1202
1208
|
ref: z,
|
|
1203
|
-
"data-testid":
|
|
1204
|
-
"aria-describedby": f["aria-describedby"] ||
|
|
1209
|
+
"data-testid": y("input"),
|
|
1210
|
+
"aria-describedby": f["aria-describedby"] || M,
|
|
1205
1211
|
"aria-invalid": f["aria-invalid"] || !!e,
|
|
1206
1212
|
className: P([
|
|
1207
1213
|
`${m}__input`,
|
|
@@ -1213,13 +1219,13 @@ const Tn = /* @__PURE__ */ Mn(En), In = {
|
|
|
1213
1219
|
}
|
|
1214
1220
|
),
|
|
1215
1221
|
/* @__PURE__ */ l("div", { className: P(`${m}__frame`) }),
|
|
1216
|
-
(!!
|
|
1222
|
+
(!!B.length || r) && /* @__PURE__ */ O(
|
|
1217
1223
|
"div",
|
|
1218
1224
|
{
|
|
1219
|
-
"data-testid":
|
|
1225
|
+
"data-testid": y("end-adornments"),
|
|
1220
1226
|
className: P(`${m}__adornment-container`),
|
|
1221
1227
|
children: [
|
|
1222
|
-
|
|
1228
|
+
B,
|
|
1223
1229
|
r
|
|
1224
1230
|
]
|
|
1225
1231
|
}
|
|
@@ -1227,13 +1233,13 @@ const Tn = /* @__PURE__ */ Mn(En), In = {
|
|
|
1227
1233
|
] }),
|
|
1228
1234
|
!!a && a
|
|
1229
1235
|
] }),
|
|
1230
|
-
|
|
1231
|
-
e && /* @__PURE__ */ l(
|
|
1236
|
+
M && /* @__PURE__ */ l(Ue, { "data-testid": y("helper-text"), id: M, children: u }),
|
|
1237
|
+
e && /* @__PURE__ */ l(Ve, { "data-testid": y("error-text"), children: e })
|
|
1232
1238
|
] });
|
|
1233
1239
|
}
|
|
1234
1240
|
);
|
|
1235
|
-
|
|
1236
|
-
const Dn = (t) =>
|
|
1241
|
+
_t.displayName = "TextField";
|
|
1242
|
+
const Dn = (t) => Qr(t) && t.type.displayName === _t.displayName;
|
|
1237
1243
|
function Vn(t) {
|
|
1238
1244
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1239
1245
|
}
|
|
@@ -1243,9 +1249,9 @@ var or = { exports: {} };
|
|
|
1243
1249
|
Licensed under the MIT License (MIT), see
|
|
1244
1250
|
http://jedwatson.github.io/classnames
|
|
1245
1251
|
*/
|
|
1246
|
-
var
|
|
1252
|
+
var Jr;
|
|
1247
1253
|
function Zn() {
|
|
1248
|
-
return
|
|
1254
|
+
return Jr || (Jr = 1, (function(t) {
|
|
1249
1255
|
(function() {
|
|
1250
1256
|
var i = {}.hasOwnProperty;
|
|
1251
1257
|
function n() {
|
|
@@ -1284,13 +1290,13 @@ const Fn = /* @__PURE__ */ Vn(Hn), Wn = {
|
|
|
1284
1290
|
"purpur-autocomplete__chevron-icon": "_purpur-autocomplete__chevron-icon_1u8x6_15",
|
|
1285
1291
|
"purpur-autocomplete__chevron-icon--up": "_purpur-autocomplete__chevron-icon--up_1u8x6_19"
|
|
1286
1292
|
}, Gn = (t) => K(t), Kn = (t, i) => {
|
|
1287
|
-
const n =
|
|
1293
|
+
const n = At(
|
|
1288
1294
|
(o) => {
|
|
1289
1295
|
t && !t.contains(o.target) && i();
|
|
1290
1296
|
},
|
|
1291
1297
|
[i, t]
|
|
1292
1298
|
);
|
|
1293
|
-
|
|
1299
|
+
kt(() => (document.addEventListener("mousedown", n), () => {
|
|
1294
1300
|
document.removeEventListener("mousedown", n);
|
|
1295
1301
|
}), [n]);
|
|
1296
1302
|
}, Un = ({
|
|
@@ -1304,22 +1310,22 @@ const Fn = /* @__PURE__ */ Vn(Hn), Wn = {
|
|
|
1304
1310
|
listboxLabel: u,
|
|
1305
1311
|
listboxMaxHeight: v,
|
|
1306
1312
|
onInputBlur: _,
|
|
1307
|
-
onInputChange:
|
|
1308
|
-
onInputFocus:
|
|
1309
|
-
onInputKeyDown:
|
|
1313
|
+
onInputChange: g,
|
|
1314
|
+
onInputFocus: b,
|
|
1315
|
+
onInputKeyDown: N,
|
|
1310
1316
|
onInputMouseDown: A,
|
|
1311
1317
|
openOnFocus: f,
|
|
1312
1318
|
noOptionsText: $,
|
|
1313
|
-
onSelect:
|
|
1314
|
-
options:
|
|
1319
|
+
onSelect: S,
|
|
1320
|
+
options: j,
|
|
1315
1321
|
selectedOption: s,
|
|
1316
|
-
["data-testid"]:
|
|
1322
|
+
["data-testid"]: y
|
|
1317
1323
|
}) => {
|
|
1318
|
-
const [q,
|
|
1324
|
+
const [q, M] = nr(
|
|
1319
1325
|
((typeof a == "string" ? a : o) || (s == null ? void 0 : s.label)) ?? ""
|
|
1320
|
-
), I = typeof a == "string" ? a : q, [d, k] = nr(n ?
|
|
1321
|
-
function
|
|
1322
|
-
return
|
|
1326
|
+
), I = typeof a == "string" ? a : q, [d, k] = nr(n ? j[0] : void 0), z = K(null), J = Gn(null), B = K(null), D = K({}), [x, sr] = nr(!1);
|
|
1327
|
+
function X(p) {
|
|
1328
|
+
return y ? `${y}-${p}` : void 0;
|
|
1323
1329
|
}
|
|
1324
1330
|
const V = () => {
|
|
1325
1331
|
sr(!1), k(void 0);
|
|
@@ -1329,44 +1335,44 @@ const Fn = /* @__PURE__ */ Vn(Hn), Wn = {
|
|
|
1329
1335
|
sr(!0), s && requestAnimationFrame(() => {
|
|
1330
1336
|
k({ ...s, isSetByClickEvent: p === "CLICK" }), tr(D.current[s.id]);
|
|
1331
1337
|
});
|
|
1332
|
-
},
|
|
1338
|
+
}, ft = (p) => {
|
|
1333
1339
|
if (r)
|
|
1334
|
-
return
|
|
1340
|
+
return j.filter((w) => r(p, w));
|
|
1335
1341
|
if (!p)
|
|
1336
|
-
return
|
|
1342
|
+
return j;
|
|
1337
1343
|
const c = p.toUpperCase().split(" ") || [];
|
|
1338
|
-
return
|
|
1344
|
+
return j.filter(
|
|
1339
1345
|
(w) => c.every(
|
|
1340
1346
|
(C) => (w.value || w.label).toUpperCase().includes(C)
|
|
1341
1347
|
)
|
|
1342
1348
|
);
|
|
1343
|
-
}, cr = (p) => s && (s == null ? void 0 : s.label) === p ?
|
|
1344
|
-
|
|
1349
|
+
}, cr = (p) => s && (s == null ? void 0 : s.label) === p ? j : ft(p), R = cr(I), rr = (p) => {
|
|
1350
|
+
g == null || g(p), M(p);
|
|
1345
1351
|
}, tr = (p) => {
|
|
1346
1352
|
var c;
|
|
1347
1353
|
if (p) {
|
|
1348
|
-
const w = p.getBoundingClientRect(), C = ((c =
|
|
1354
|
+
const w = p.getBoundingClientRect(), C = ((c = B.current) == null ? void 0 : c.getBoundingClientRect()) || { top: 0, bottom: 0 };
|
|
1349
1355
|
(w.top < C.top || w.bottom > C.bottom) && p.scrollIntoView({ block: "nearest" });
|
|
1350
1356
|
}
|
|
1351
1357
|
}, dr = (p) => {
|
|
1352
1358
|
var c;
|
|
1353
|
-
p && ((c = z.current) == null || c.focus(), rr(p.label),
|
|
1354
|
-
},
|
|
1359
|
+
p && ((c = z.current) == null || c.focus(), rr(p.label), S == null || S(p)), V();
|
|
1360
|
+
}, vt = (p) => {
|
|
1355
1361
|
const c = n && !d ? 0 : R.findIndex((C) => C && (d == null ? void 0 : d.id) === C.id), w = R.length;
|
|
1356
1362
|
return p === "ArrowDown" ? R[(c ?? -1) + 1] || R[0] : R[(c ?? w) - 1] || R[w - 1];
|
|
1357
|
-
},
|
|
1358
|
-
!
|
|
1359
|
-
const c =
|
|
1363
|
+
}, E = x && (!!R.length || !!$), mt = (p) => {
|
|
1364
|
+
!E && Z({ eventType: "KEYBOARD" });
|
|
1365
|
+
const c = vt(p);
|
|
1360
1366
|
k(c), c && tr(D.current[c.id]);
|
|
1361
|
-
},
|
|
1362
|
-
switch (
|
|
1367
|
+
}, ht = (p) => {
|
|
1368
|
+
switch (N == null || N(p), p.key) {
|
|
1363
1369
|
case "ArrowUp":
|
|
1364
1370
|
case "ArrowDown":
|
|
1365
|
-
p.preventDefault(),
|
|
1371
|
+
p.preventDefault(), mt(p.key);
|
|
1366
1372
|
break;
|
|
1367
1373
|
case "Enter": {
|
|
1368
|
-
const c = d || (n ?
|
|
1369
|
-
|
|
1374
|
+
const c = d || (n ? j[0] : void 0);
|
|
1375
|
+
E && dr(c), !E && Z({ eventType: "KEYBOARD" });
|
|
1370
1376
|
break;
|
|
1371
1377
|
}
|
|
1372
1378
|
case "Escape":
|
|
@@ -1374,33 +1380,33 @@ const Fn = /* @__PURE__ */ Vn(Hn), Wn = {
|
|
|
1374
1380
|
V();
|
|
1375
1381
|
break;
|
|
1376
1382
|
}
|
|
1377
|
-
}, vt = (p) => {
|
|
1378
|
-
const c = cr(p.target.value);
|
|
1379
|
-
rr(p.target.value), k(void 0), !B && Z({ eventType: "KEYBOARD" }), n && c[0] && tr(D.current[c[0].id]);
|
|
1380
|
-
}, mt = (p) => {
|
|
1381
|
-
A == null || A(p), B ? V() : Z({ eventType: "CLICK" });
|
|
1382
1383
|
}, gt = (p) => {
|
|
1384
|
+
const c = cr(p.target.value);
|
|
1385
|
+
rr(p.target.value), k(void 0), !E && Z({ eventType: "KEYBOARD" }), n && c[0] && tr(D.current[c[0].id]);
|
|
1386
|
+
}, bt = (p) => {
|
|
1387
|
+
A == null || A(p), E ? V() : Z({ eventType: "CLICK" });
|
|
1388
|
+
}, yt = (p) => {
|
|
1383
1389
|
var c;
|
|
1384
|
-
|
|
1385
|
-
},
|
|
1390
|
+
b == null || b(p), !x && f && Z({ eventType: "KEYBOARD" }), (c = z.current) == null || c.select();
|
|
1391
|
+
}, xt = (p) => {
|
|
1386
1392
|
_ == null || _(p), setTimeout(() => {
|
|
1387
1393
|
var c, w;
|
|
1388
|
-
!((c = z.current) != null && c.contains(document.activeElement)) && !((w =
|
|
1394
|
+
!((c = z.current) != null && c.contains(document.activeElement)) && !((w = B.current) != null && w.contains(document.activeElement)) && (V(), t && rr(s ? s.label : ""));
|
|
1389
1395
|
});
|
|
1390
|
-
},
|
|
1396
|
+
}, wt = {
|
|
1391
1397
|
maxHeight: typeof v == "number" ? `${v}px` : v
|
|
1392
1398
|
}, _r = {
|
|
1393
1399
|
"aria-label": u,
|
|
1394
|
-
"aria-expanded":
|
|
1395
|
-
"data-testid":
|
|
1400
|
+
"aria-expanded": E,
|
|
1401
|
+
"data-testid": X("listbox"),
|
|
1396
1402
|
id: `${e}-listbox`,
|
|
1397
|
-
ref:
|
|
1403
|
+
ref: B,
|
|
1398
1404
|
onMouseLeave: () => k(void 0),
|
|
1399
|
-
style: v ?
|
|
1400
|
-
}, fr = (p) => `${e}-listbox-item-${p.id}`,
|
|
1405
|
+
style: v ? wt : void 0
|
|
1406
|
+
}, fr = (p) => `${e}-listbox-item-${p.id}`, $t = (p, c) => {
|
|
1401
1407
|
const w = () => p.id !== (d == null ? void 0 : d.id) && k({ ...p, isSetByClickEvent: !0 }), C = (p.id === (d == null ? void 0 : d.id) || !!n && !d && c === 0) && !(d != null && d.isSetByClickEvent);
|
|
1402
1408
|
return {
|
|
1403
|
-
"data-testid":
|
|
1409
|
+
"data-testid": X(`listbox-item-${p.id}`),
|
|
1404
1410
|
id: fr(p),
|
|
1405
1411
|
key: p.id,
|
|
1406
1412
|
onMouseMove: w,
|
|
@@ -1414,73 +1420,73 @@ const Fn = /* @__PURE__ */ Vn(Hn), Wn = {
|
|
|
1414
1420
|
highlighted: C,
|
|
1415
1421
|
hovered: p.id === (d == null ? void 0 : d.id) && !!(d != null && d.isSetByClickEvent)
|
|
1416
1422
|
};
|
|
1417
|
-
},
|
|
1423
|
+
}, St = {
|
|
1418
1424
|
"aria-activedescendant": d ? fr(d) : void 0,
|
|
1419
1425
|
"aria-autocomplete": "list",
|
|
1420
1426
|
"aria-controls": _r.id,
|
|
1421
|
-
"data-testid":
|
|
1427
|
+
"data-testid": X("input"),
|
|
1422
1428
|
autoComplete: "off",
|
|
1423
1429
|
id: `${e}-input`,
|
|
1424
|
-
onChange:
|
|
1425
|
-
onMouseDown:
|
|
1426
|
-
onFocus:
|
|
1427
|
-
onKeyDown:
|
|
1428
|
-
onBlur:
|
|
1430
|
+
onChange: gt,
|
|
1431
|
+
onMouseDown: bt,
|
|
1432
|
+
onFocus: yt,
|
|
1433
|
+
onKeyDown: ht,
|
|
1434
|
+
onBlur: xt,
|
|
1429
1435
|
ref: z,
|
|
1430
1436
|
role: "combobox",
|
|
1431
1437
|
value: I
|
|
1432
1438
|
};
|
|
1433
1439
|
return {
|
|
1434
1440
|
id: e,
|
|
1435
|
-
inputProps:
|
|
1441
|
+
inputProps: St,
|
|
1436
1442
|
internalRef: J,
|
|
1437
1443
|
optionsToShow: R,
|
|
1438
|
-
showListbox:
|
|
1444
|
+
showListbox: E,
|
|
1439
1445
|
noOptionsText: $,
|
|
1440
1446
|
combobox: t,
|
|
1441
1447
|
comboboxButtonAriaLabel: i,
|
|
1442
|
-
getListBoxItemProps:
|
|
1448
|
+
getListBoxItemProps: $t,
|
|
1443
1449
|
listboxProps: _r
|
|
1444
1450
|
};
|
|
1445
|
-
},
|
|
1451
|
+
}, Q = Fn.bind(Wn), G = "purpur-autocomplete", Yn = ({ className: t, renderInput: i, renderOption: n, ...o }, a) => {
|
|
1446
1452
|
const {
|
|
1447
1453
|
id: r,
|
|
1448
1454
|
inputProps: e,
|
|
1449
1455
|
internalRef: u,
|
|
1450
1456
|
optionsToShow: v,
|
|
1451
1457
|
showListbox: _,
|
|
1452
|
-
noOptionsText:
|
|
1453
|
-
combobox:
|
|
1454
|
-
comboboxButtonAriaLabel:
|
|
1458
|
+
noOptionsText: g,
|
|
1459
|
+
combobox: b,
|
|
1460
|
+
comboboxButtonAriaLabel: N,
|
|
1455
1461
|
getListBoxItemProps: A,
|
|
1456
1462
|
listboxProps: f
|
|
1457
|
-
} = Un(o), $ = (s,
|
|
1458
|
-
const { key: q, ...
|
|
1459
|
-
return /* @__PURE__ */ l(U.Item, { ...
|
|
1460
|
-
},
|
|
1463
|
+
} = Un(o), $ = (s, y) => {
|
|
1464
|
+
const { key: q, ...M } = A(s, y);
|
|
1465
|
+
return /* @__PURE__ */ l(U.Item, { ...M, children: n ? n == null ? void 0 : n(s) : s.label }, q);
|
|
1466
|
+
}, S = (s) => {
|
|
1461
1467
|
u.current = s, typeof a == "function" ? a(s) : a && (a.current = s);
|
|
1462
|
-
},
|
|
1468
|
+
}, j = () => {
|
|
1463
1469
|
const s = i(e);
|
|
1464
|
-
if (
|
|
1465
|
-
const q = /* @__PURE__ */ O(
|
|
1470
|
+
if (b && N && g && s && Dn(s)) {
|
|
1471
|
+
const q = /* @__PURE__ */ O(Nt, { children: [
|
|
1466
1472
|
s.props.endAdornment,
|
|
1467
1473
|
/* @__PURE__ */ l(
|
|
1468
1474
|
"button",
|
|
1469
1475
|
{
|
|
1470
1476
|
"data-testid": "chevron button",
|
|
1471
1477
|
type: "button",
|
|
1472
|
-
className:
|
|
1478
|
+
className: Q(`${G}__chevron-button`),
|
|
1473
1479
|
onClick: () => {
|
|
1474
1480
|
e.onFocus(void 0), e.onMouseDown(void 0);
|
|
1475
1481
|
},
|
|
1476
|
-
"aria-label":
|
|
1482
|
+
"aria-label": N,
|
|
1477
1483
|
"aria-expanded": _,
|
|
1478
1484
|
"aria-controls": f.id,
|
|
1479
1485
|
children: /* @__PURE__ */ l(
|
|
1480
|
-
|
|
1486
|
+
rt,
|
|
1481
1487
|
{
|
|
1482
1488
|
size: "sm",
|
|
1483
|
-
className:
|
|
1489
|
+
className: Q(`${G}__chevron-icon`, {
|
|
1484
1490
|
[`${G}__chevron-icon--up`]: _
|
|
1485
1491
|
})
|
|
1486
1492
|
}
|
|
@@ -1488,13 +1494,13 @@ const Fn = /* @__PURE__ */ Vn(Hn), Wn = {
|
|
|
1488
1494
|
}
|
|
1489
1495
|
)
|
|
1490
1496
|
] });
|
|
1491
|
-
return
|
|
1497
|
+
return Ct(s, { endAdornment: q });
|
|
1492
1498
|
}
|
|
1493
1499
|
return s;
|
|
1494
1500
|
};
|
|
1495
|
-
return /* @__PURE__ */ O("div", { id: r, ref:
|
|
1496
|
-
|
|
1497
|
-
_ && /* @__PURE__ */ l(U, { ...f, className:
|
|
1501
|
+
return /* @__PURE__ */ O("div", { id: r, ref: S, className: Q([t, G]), children: [
|
|
1502
|
+
j(),
|
|
1503
|
+
_ && /* @__PURE__ */ l(U, { ...f, className: Q(`${G}__listbox`), children: v.length ? v.filter((s) => !!s).map($) : /* @__PURE__ */ l(U.Item, { noninteractive: !0, children: g }) })
|
|
1498
1504
|
] });
|
|
1499
1505
|
}, Jn = Y(Yn);
|
|
1500
1506
|
Jn.displayName = "Autocomplete";
|