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