@purpurds/autocomplete 5.23.0 → 5.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +3 -3
- package/dist/autocomplete.cjs.js +10 -10
- package/dist/autocomplete.cjs.js.map +1 -1
- package/dist/autocomplete.es.js +246 -244
- package/dist/autocomplete.es.js.map +1 -1
- package/package.json +9 -9
package/dist/autocomplete.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as s, jsxs as A, Fragment as dt } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as O, Children as D, isValidElement as T, createElement as W, cloneElement as sr, useEffect as Ar, useId as _t, Fragment as ft, useRef as Y, useCallback as vt, useState as ar } from "react";
|
|
3
3
|
import "react-dom";
|
|
4
4
|
function mt(t) {
|
|
5
5
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
@@ -276,7 +276,7 @@ var Br = { exports: {} };
|
|
|
276
276
|
})();
|
|
277
277
|
})(Br);
|
|
278
278
|
var Rt = Br.exports;
|
|
279
|
-
const Dt = /* @__PURE__ */ Et(Rt),
|
|
279
|
+
const Dt = /* @__PURE__ */ Et(Rt), G = {
|
|
280
280
|
"purpur-paragraph": "_purpur-paragraph_1rh57_1",
|
|
281
281
|
"purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
|
|
282
282
|
"purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
|
|
@@ -302,7 +302,7 @@ const Dt = /* @__PURE__ */ Et(Rt), H = {
|
|
|
302
302
|
ADDITIONAL100MEDIUM: "additional-100-medium",
|
|
303
303
|
OVERLINE100: "overline-100",
|
|
304
304
|
OVERLINE200: "overline-200"
|
|
305
|
-
},
|
|
305
|
+
}, H = "purpur-paragraph", Er = ({
|
|
306
306
|
["data-testid"]: t,
|
|
307
307
|
children: a,
|
|
308
308
|
className: n,
|
|
@@ -312,47 +312,47 @@ const Dt = /* @__PURE__ */ Et(Rt), H = {
|
|
|
312
312
|
variant: e = Tt.PARAGRAPH100,
|
|
313
313
|
...u
|
|
314
314
|
}) => {
|
|
315
|
-
const
|
|
315
|
+
const f = Dt([
|
|
316
316
|
n,
|
|
317
|
-
H
|
|
318
|
-
|
|
317
|
+
G[H],
|
|
318
|
+
G[`${H}--${e}`],
|
|
319
319
|
{
|
|
320
|
-
[
|
|
321
|
-
[
|
|
322
|
-
[
|
|
320
|
+
[G[`${H}--hyphens`]]: o,
|
|
321
|
+
[G[`${H}--disabled`]]: i,
|
|
322
|
+
[G[`${H}--negative`]]: r
|
|
323
323
|
}
|
|
324
324
|
]);
|
|
325
|
-
return /* @__PURE__ */ s("p", { ...u, className:
|
|
325
|
+
return /* @__PURE__ */ s("p", { ...u, className: f, "data-testid": t, children: a });
|
|
326
326
|
};
|
|
327
327
|
Er.displayName = "Paragraph";
|
|
328
|
-
const xr = Ir.bind(Lr),
|
|
328
|
+
const xr = Ir.bind(Lr), k = "purpur-listbox", lr = O(
|
|
329
329
|
(t, a) => {
|
|
330
|
-
const { disabled: n, highlighted: i, hovered: o, selected: r, children: e, noninteractive: u, ...
|
|
331
|
-
[`${
|
|
332
|
-
[`${
|
|
333
|
-
[`${
|
|
334
|
-
[`${
|
|
335
|
-
[`${
|
|
330
|
+
const { disabled: n, highlighted: i, hovered: o, selected: r, children: e, noninteractive: u, ...f } = t, h = xr(`${k}-item`, f.className, {
|
|
331
|
+
[`${k}-item--highlighted`]: i,
|
|
332
|
+
[`${k}-item--selected`]: r,
|
|
333
|
+
[`${k}-item--hovered`]: o,
|
|
334
|
+
[`${k}-item--disabled`]: n,
|
|
335
|
+
[`${k}-item--noninteractive`]: u
|
|
336
336
|
});
|
|
337
|
-
return /* @__PURE__ */
|
|
337
|
+
return /* @__PURE__ */ A(
|
|
338
338
|
"li",
|
|
339
339
|
{
|
|
340
|
-
...
|
|
340
|
+
...f,
|
|
341
341
|
ref: a,
|
|
342
|
-
className:
|
|
342
|
+
className: h,
|
|
343
343
|
"aria-selected": !!r,
|
|
344
344
|
role: "option",
|
|
345
345
|
"aria-disabled": !!n,
|
|
346
346
|
children: [
|
|
347
347
|
typeof e == "string" ? /* @__PURE__ */ s(Er, { children: e }) : e,
|
|
348
|
-
r && /* @__PURE__ */ s(kr, { size: "xs", className: xr(`${
|
|
348
|
+
r && /* @__PURE__ */ s(kr, { size: "xs", className: xr(`${k}-item__icon`) })
|
|
349
349
|
]
|
|
350
350
|
}
|
|
351
351
|
);
|
|
352
352
|
}
|
|
353
|
-
), Ft = (t) =>
|
|
353
|
+
), Ft = (t) => T(t) && (t == null ? void 0 : t.type) === lr;
|
|
354
354
|
lr.displayName = "ListBoxItem";
|
|
355
|
-
const Gt = Ir.bind(Lr), Ht = "purpur-listbox",
|
|
355
|
+
const Gt = Ir.bind(Lr), Ht = "purpur-listbox", J = O(
|
|
356
356
|
({ children: t, ...a }, n) => /* @__PURE__ */ s(
|
|
357
357
|
"ul",
|
|
358
358
|
{
|
|
@@ -360,12 +360,12 @@ const Gt = Ir.bind(Lr), Ht = "purpur-listbox", Q = P(
|
|
|
360
360
|
ref: n,
|
|
361
361
|
className: Gt(Ht, a.className),
|
|
362
362
|
role: "listbox",
|
|
363
|
-
children:
|
|
363
|
+
children: D.toArray(t).filter(Ft)
|
|
364
364
|
}
|
|
365
365
|
)
|
|
366
366
|
);
|
|
367
|
-
|
|
368
|
-
|
|
367
|
+
J.Item = lr;
|
|
368
|
+
J.displayName = "ListBox";
|
|
369
369
|
const Vt = {
|
|
370
370
|
SM: "sm",
|
|
371
371
|
MD: "md",
|
|
@@ -410,10 +410,10 @@ var Rr = { exports: {} };
|
|
|
410
410
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
411
411
|
})();
|
|
412
412
|
})(Rr);
|
|
413
|
-
var
|
|
414
|
-
const br = /* @__PURE__ */ Zt(
|
|
413
|
+
var Xt = Rr.exports;
|
|
414
|
+
const br = /* @__PURE__ */ Zt(Xt), Kt = "_rotate_1xozj_1", Ut = "_dash_1xozj_1", V = {
|
|
415
415
|
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
416
|
-
rotate:
|
|
416
|
+
rotate: Kt,
|
|
417
417
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
|
|
418
418
|
"purpur-spinner--xs": "_purpur-spinner--xs_1xozj_8",
|
|
419
419
|
"purpur-spinner--sm": "_purpur-spinner--sm_1xozj_12",
|
|
@@ -423,7 +423,7 @@ const br = /* @__PURE__ */ Zt(Kt), Xt = "_rotate_1xozj_1", Ut = "_dash_1xozj_1",
|
|
|
423
423
|
dash: Ut,
|
|
424
424
|
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_1xozj_33",
|
|
425
425
|
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_1xozj_36"
|
|
426
|
-
},
|
|
426
|
+
}, Z = "purpur-spinner", Yt = {
|
|
427
427
|
XXS: "xxs",
|
|
428
428
|
XS: "xs",
|
|
429
429
|
SM: "sm",
|
|
@@ -438,15 +438,15 @@ const br = /* @__PURE__ */ Zt(Kt), Xt = "_rotate_1xozj_1", Ut = "_dash_1xozj_1",
|
|
|
438
438
|
}) => /* @__PURE__ */ s(
|
|
439
439
|
"div",
|
|
440
440
|
{
|
|
441
|
-
className: br([Z
|
|
441
|
+
className: br([V[Z], V[`${Z}--${i}`]]),
|
|
442
442
|
"data-testid": t,
|
|
443
443
|
...o,
|
|
444
444
|
children: /* @__PURE__ */ s("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ s(
|
|
445
445
|
"circle",
|
|
446
446
|
{
|
|
447
|
-
className: br(
|
|
448
|
-
[
|
|
449
|
-
[
|
|
447
|
+
className: br(V[`${Z}__circle`], {
|
|
448
|
+
[V[`${Z}__circle--disabled`]]: a,
|
|
449
|
+
[V[`${Z}__circle--negative`]]: n
|
|
450
450
|
}),
|
|
451
451
|
cx: "25",
|
|
452
452
|
cy: "25",
|
|
@@ -455,7 +455,7 @@ const br = /* @__PURE__ */ Zt(Kt), Xt = "_rotate_1xozj_1", Ut = "_dash_1xozj_1",
|
|
|
455
455
|
) })
|
|
456
456
|
}
|
|
457
457
|
);
|
|
458
|
-
function
|
|
458
|
+
function Wt(t) {
|
|
459
459
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
460
460
|
}
|
|
461
461
|
var Dr = { exports: {} };
|
|
@@ -494,8 +494,8 @@ var Dr = { exports: {} };
|
|
|
494
494
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
495
495
|
})();
|
|
496
496
|
})(Dr);
|
|
497
|
-
var
|
|
498
|
-
const re = /* @__PURE__ */ Qt
|
|
497
|
+
var Qt = Dr.exports;
|
|
498
|
+
const re = /* @__PURE__ */ Wt(Qt), te = {
|
|
499
499
|
"purpur-button": "_purpur-button_1acxn_1",
|
|
500
500
|
"purpur-button--sm": "_purpur-button--sm_1acxn_33",
|
|
501
501
|
"purpur-button--icon-only": "_purpur-button--icon-only_1acxn_36",
|
|
@@ -516,7 +516,7 @@ const re = /* @__PURE__ */ Qt(Wt), te = {
|
|
|
516
516
|
"purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_1acxn_160",
|
|
517
517
|
"purpur-button--text-negative": "_purpur-button--text-negative_1acxn_175",
|
|
518
518
|
"purpur-button--text": "_purpur-button--text_1acxn_175"
|
|
519
|
-
}, ee = re.bind(te),
|
|
519
|
+
}, ee = re.bind(te), z = "purpur-button", ne = ({
|
|
520
520
|
children: t,
|
|
521
521
|
className: a,
|
|
522
522
|
["data-testid"]: n,
|
|
@@ -525,48 +525,48 @@ const re = /* @__PURE__ */ Qt(Wt), te = {
|
|
|
525
525
|
iconOnly: r,
|
|
526
526
|
loading: e = !1,
|
|
527
527
|
negative: u = !1,
|
|
528
|
-
onClick:
|
|
529
|
-
size:
|
|
530
|
-
variant:
|
|
528
|
+
onClick: f,
|
|
529
|
+
size: h = "md",
|
|
530
|
+
variant: g,
|
|
531
531
|
type: j = "button",
|
|
532
|
-
...
|
|
533
|
-
},
|
|
534
|
-
if (r &&
|
|
532
|
+
...x
|
|
533
|
+
}, c) => {
|
|
534
|
+
if (r && g === "destructive")
|
|
535
535
|
return null;
|
|
536
|
-
const
|
|
536
|
+
const w = ee(
|
|
537
537
|
[
|
|
538
|
-
|
|
539
|
-
`${
|
|
540
|
-
`${
|
|
538
|
+
z,
|
|
539
|
+
`${z}--${u ? `${g}-negative` : g}`,
|
|
540
|
+
`${z}--${h}`
|
|
541
541
|
],
|
|
542
542
|
{
|
|
543
|
-
[`${
|
|
544
|
-
[`${
|
|
545
|
-
[`${
|
|
546
|
-
[`${
|
|
543
|
+
[`${z}--icon-only`]: r,
|
|
544
|
+
[`${z}--negative`]: u,
|
|
545
|
+
[`${z}--full-width`]: o,
|
|
546
|
+
[`${z}--disabled`]: i || e
|
|
547
547
|
},
|
|
548
548
|
a
|
|
549
|
-
),
|
|
550
|
-
i || e ?
|
|
551
|
-
},
|
|
552
|
-
return /* @__PURE__ */
|
|
549
|
+
), P = (d) => {
|
|
550
|
+
i || e ? d.preventDefault() : f && f(d);
|
|
551
|
+
}, M = !!x["aria-disabled"] || i || e;
|
|
552
|
+
return /* @__PURE__ */ A(
|
|
553
553
|
"button",
|
|
554
554
|
{
|
|
555
|
-
className:
|
|
555
|
+
className: w,
|
|
556
556
|
"data-testid": n,
|
|
557
557
|
type: j,
|
|
558
|
-
ref:
|
|
559
|
-
"aria-disabled":
|
|
560
|
-
onClick:
|
|
561
|
-
...
|
|
558
|
+
ref: c,
|
|
559
|
+
"aria-disabled": M,
|
|
560
|
+
onClick: P,
|
|
561
|
+
...x,
|
|
562
562
|
children: [
|
|
563
|
-
e && /* @__PURE__ */ s(Jt, { size:
|
|
563
|
+
e && /* @__PURE__ */ s(Jt, { size: h === Vt.LG ? "xs" : "xxs", negative: u, disabled: M }),
|
|
564
564
|
" ",
|
|
565
565
|
t
|
|
566
566
|
]
|
|
567
567
|
}
|
|
568
568
|
);
|
|
569
|
-
}, Tr =
|
|
569
|
+
}, Tr = O(ne);
|
|
570
570
|
Tr.displayName = "Button";
|
|
571
571
|
function ue(t) {
|
|
572
572
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
@@ -702,7 +702,7 @@ const me = /* @__PURE__ */ fe(ve), yr = {
|
|
|
702
702
|
className: n,
|
|
703
703
|
relevant: i = "additions text",
|
|
704
704
|
...o
|
|
705
|
-
}) => /* @__PURE__ */
|
|
705
|
+
}) => /* @__PURE__ */ A(
|
|
706
706
|
"div",
|
|
707
707
|
{
|
|
708
708
|
className: me([n, yr[wr]]),
|
|
@@ -834,22 +834,22 @@ const je = /* @__PURE__ */ we($e), Se = {
|
|
|
834
834
|
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>',
|
|
835
835
|
keywords: ["close"],
|
|
836
836
|
category: "utility"
|
|
837
|
-
},
|
|
837
|
+
}, Xr = (t) => /* @__PURE__ */ s(
|
|
838
838
|
cr,
|
|
839
839
|
{
|
|
840
840
|
...t,
|
|
841
841
|
svg: Ne
|
|
842
842
|
}
|
|
843
843
|
);
|
|
844
|
-
|
|
845
|
-
const
|
|
844
|
+
Xr.displayName = "IconCheckCircleFilled";
|
|
845
|
+
const Kr = (t) => /* @__PURE__ */ s(
|
|
846
846
|
cr,
|
|
847
847
|
{
|
|
848
848
|
...t,
|
|
849
849
|
svg: Ae
|
|
850
850
|
}
|
|
851
851
|
);
|
|
852
|
-
|
|
852
|
+
Kr.displayName = "IconClose";
|
|
853
853
|
const Oe = je.bind(Se), Sr = "purpur-icon", Pe = "md", Me = (t) => t.filter((a) => Object.keys(a).length >= 1).map((a) => `${a.name}="${a.value}"`).join(" "), Ce = ({ content: t = "", title: a } = {}) => {
|
|
854
854
|
const n = [
|
|
855
855
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
@@ -882,14 +882,14 @@ const Oe = je.bind(Se), Sr = "purpur-icon", Pe = "md", Me = (t) => t.filter((a)
|
|
|
882
882
|
);
|
|
883
883
|
};
|
|
884
884
|
cr.displayName = "Icon";
|
|
885
|
-
function
|
|
886
|
-
return
|
|
885
|
+
function F() {
|
|
886
|
+
return F = Object.assign ? Object.assign.bind() : function(t) {
|
|
887
887
|
for (var a = 1; a < arguments.length; a++) {
|
|
888
888
|
var n = arguments[a];
|
|
889
889
|
for (var i in n) ({}).hasOwnProperty.call(n, i) && (t[i] = n[i]);
|
|
890
890
|
}
|
|
891
891
|
return t;
|
|
892
|
-
},
|
|
892
|
+
}, F.apply(null, arguments);
|
|
893
893
|
}
|
|
894
894
|
function Le(t, a) {
|
|
895
895
|
typeof t == "function" ? t(a) : t != null && (t.current = a);
|
|
@@ -899,30 +899,30 @@ function qe(...t) {
|
|
|
899
899
|
(n) => Le(n, a)
|
|
900
900
|
);
|
|
901
901
|
}
|
|
902
|
-
const Ur = /* @__PURE__ */
|
|
903
|
-
const { children: n, ...i } = t, o =
|
|
902
|
+
const Ur = /* @__PURE__ */ O((t, a) => {
|
|
903
|
+
const { children: n, ...i } = t, o = D.toArray(n), r = o.find(ze);
|
|
904
904
|
if (r) {
|
|
905
|
-
const e = r.props.children, u = o.map((
|
|
906
|
-
return /* @__PURE__ */ W(pr,
|
|
905
|
+
const e = r.props.children, u = o.map((f) => f === r ? D.count(e) > 1 ? D.only(null) : /* @__PURE__ */ T(e) ? e.props.children : null : f);
|
|
906
|
+
return /* @__PURE__ */ W(pr, F({}, i, {
|
|
907
907
|
ref: a
|
|
908
|
-
}), /* @__PURE__ */
|
|
908
|
+
}), /* @__PURE__ */ T(e) ? /* @__PURE__ */ sr(e, void 0, u) : null);
|
|
909
909
|
}
|
|
910
|
-
return /* @__PURE__ */ W(pr,
|
|
910
|
+
return /* @__PURE__ */ W(pr, F({}, i, {
|
|
911
911
|
ref: a
|
|
912
912
|
}), n);
|
|
913
913
|
});
|
|
914
914
|
Ur.displayName = "Slot";
|
|
915
|
-
const pr = /* @__PURE__ */
|
|
915
|
+
const pr = /* @__PURE__ */ O((t, a) => {
|
|
916
916
|
const { children: n, ...i } = t;
|
|
917
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ T(n) ? /* @__PURE__ */ sr(n, {
|
|
918
918
|
...Be(i, n.props),
|
|
919
919
|
ref: a ? qe(a, n.ref) : n.ref
|
|
920
|
-
}) :
|
|
920
|
+
}) : D.count(n) > 1 ? D.only(null) : null;
|
|
921
921
|
});
|
|
922
922
|
pr.displayName = "SlotClone";
|
|
923
923
|
const ke = ({ children: t }) => /* @__PURE__ */ W(ft, null, t);
|
|
924
924
|
function ze(t) {
|
|
925
|
-
return /* @__PURE__ */
|
|
925
|
+
return /* @__PURE__ */ T(t) && t.type === ke;
|
|
926
926
|
}
|
|
927
927
|
function Be(t, a) {
|
|
928
928
|
const n = {
|
|
@@ -963,11 +963,11 @@ const Ee = [
|
|
|
963
963
|
"svg",
|
|
964
964
|
"ul"
|
|
965
965
|
], Re = Ee.reduce((t, a) => {
|
|
966
|
-
const n = /* @__PURE__ */
|
|
966
|
+
const n = /* @__PURE__ */ O((i, o) => {
|
|
967
967
|
const { asChild: r, ...e } = i, u = r ? Ur : a;
|
|
968
968
|
return Ar(() => {
|
|
969
969
|
window[Symbol.for("radix-ui")] = !0;
|
|
970
|
-
}, []), /* @__PURE__ */ W(u,
|
|
970
|
+
}, []), /* @__PURE__ */ W(u, F({}, e, {
|
|
971
971
|
ref: o
|
|
972
972
|
}));
|
|
973
973
|
});
|
|
@@ -975,7 +975,7 @@ const Ee = [
|
|
|
975
975
|
...t,
|
|
976
976
|
[a]: n
|
|
977
977
|
};
|
|
978
|
-
}, {}), De = /* @__PURE__ */
|
|
978
|
+
}, {}), De = /* @__PURE__ */ O((t, a) => /* @__PURE__ */ W(Re.label, F({}, t, {
|
|
979
979
|
ref: a,
|
|
980
980
|
onMouseDown: (n) => {
|
|
981
981
|
var i;
|
|
@@ -1084,10 +1084,10 @@ var Jr = { exports: {} };
|
|
|
1084
1084
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
1085
1085
|
})();
|
|
1086
1086
|
})(Jr);
|
|
1087
|
-
var
|
|
1088
|
-
const Nr = /* @__PURE__ */ Ze(
|
|
1087
|
+
var Xe = Jr.exports;
|
|
1088
|
+
const Nr = /* @__PURE__ */ Ze(Xe), Ke = "_rotate_1xozj_1", Ue = "_dash_1xozj_1", X = {
|
|
1089
1089
|
"purpur-spinner": "_purpur-spinner_1xozj_1",
|
|
1090
|
-
rotate:
|
|
1090
|
+
rotate: Ke,
|
|
1091
1091
|
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
|
|
1092
1092
|
"purpur-spinner--xs": "_purpur-spinner--xs_1xozj_8",
|
|
1093
1093
|
"purpur-spinner--sm": "_purpur-spinner--sm_1xozj_12",
|
|
@@ -1097,7 +1097,7 @@ const Nr = /* @__PURE__ */ Ze(Ke), Xe = "_rotate_1xozj_1", Ue = "_dash_1xozj_1",
|
|
|
1097
1097
|
dash: Ue,
|
|
1098
1098
|
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_1xozj_33",
|
|
1099
1099
|
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_1xozj_36"
|
|
1100
|
-
},
|
|
1100
|
+
}, K = "purpur-spinner", Ye = {
|
|
1101
1101
|
XXS: "xxs",
|
|
1102
1102
|
XS: "xs",
|
|
1103
1103
|
SM: "sm",
|
|
@@ -1112,15 +1112,15 @@ const Nr = /* @__PURE__ */ Ze(Ke), Xe = "_rotate_1xozj_1", Ue = "_dash_1xozj_1",
|
|
|
1112
1112
|
}) => /* @__PURE__ */ s(
|
|
1113
1113
|
"div",
|
|
1114
1114
|
{
|
|
1115
|
-
className: Nr([X[
|
|
1115
|
+
className: Nr([X[K], X[`${K}--${i}`]]),
|
|
1116
1116
|
"data-testid": t,
|
|
1117
1117
|
...o,
|
|
1118
1118
|
children: /* @__PURE__ */ s("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ s(
|
|
1119
1119
|
"circle",
|
|
1120
1120
|
{
|
|
1121
|
-
className: Nr(X[`${
|
|
1122
|
-
[X[`${
|
|
1123
|
-
[X[`${
|
|
1121
|
+
className: Nr(X[`${K}__circle`], {
|
|
1122
|
+
[X[`${K}__circle--disabled`]]: a,
|
|
1123
|
+
[X[`${K}__circle--negative`]]: n
|
|
1124
1124
|
}),
|
|
1125
1125
|
cx: "25",
|
|
1126
1126
|
cy: "25",
|
|
@@ -1129,10 +1129,10 @@ const Nr = /* @__PURE__ */ Ze(Ke), Xe = "_rotate_1xozj_1", Ue = "_dash_1xozj_1",
|
|
|
1129
1129
|
) })
|
|
1130
1130
|
}
|
|
1131
1131
|
);
|
|
1132
|
-
function
|
|
1132
|
+
function We(t) {
|
|
1133
1133
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1134
1134
|
}
|
|
1135
|
-
var
|
|
1135
|
+
var Wr = { exports: {} };
|
|
1136
1136
|
/*!
|
|
1137
1137
|
Copyright (c) 2018 Jed Watson.
|
|
1138
1138
|
Licensed under the MIT License (MIT), see
|
|
@@ -1167,9 +1167,9 @@ var Qr = { exports: {} };
|
|
|
1167
1167
|
}
|
|
1168
1168
|
t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
|
|
1169
1169
|
})();
|
|
1170
|
-
})(
|
|
1171
|
-
var
|
|
1172
|
-
const rn = /* @__PURE__ */ Qe
|
|
1170
|
+
})(Wr);
|
|
1171
|
+
var Qe = Wr.exports;
|
|
1172
|
+
const rn = /* @__PURE__ */ We(Qe), tn = {
|
|
1173
1173
|
"purpur-text-field": "_purpur-text-field_nj9f4_1",
|
|
1174
1174
|
"purpur-text-field__label": "_purpur-text-field__label_nj9f4_7",
|
|
1175
1175
|
"purpur-text-field__label-text": "_purpur-text-field__label-text_nj9f4_13",
|
|
@@ -1186,38 +1186,39 @@ const rn = /* @__PURE__ */ Qe(We), tn = {
|
|
|
1186
1186
|
"purpur-text-field__input--error": "_purpur-text-field__input--error_nj9f4_94",
|
|
1187
1187
|
"purpur-text-field__adornment-container": "_purpur-text-field__adornment-container_nj9f4_106",
|
|
1188
1188
|
"purpur-text-field__valid-icon": "_purpur-text-field__valid-icon_nj9f4_111"
|
|
1189
|
-
}, en = (t) =>
|
|
1189
|
+
}, en = (t) => Y(t), N = rn.bind(tn), m = "purpur-text-field", nn = ({
|
|
1190
1190
|
["data-testid"]: t,
|
|
1191
1191
|
className: a,
|
|
1192
1192
|
clearButtonAllyLabel: n,
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1193
|
+
beforeField: i,
|
|
1194
|
+
afterField: o,
|
|
1195
|
+
endAdornment: r,
|
|
1196
|
+
errorText: e,
|
|
1197
|
+
helperText: u,
|
|
1198
|
+
label: f,
|
|
1199
|
+
loading: h = !1,
|
|
1200
|
+
onClear: g,
|
|
1201
|
+
startAdornment: j,
|
|
1202
|
+
valid: x = !1,
|
|
1203
|
+
...c
|
|
1204
|
+
}, w) => {
|
|
1205
|
+
var P;
|
|
1206
|
+
const M = _t(), d = c.id ?? M, l = (v) => t ? `${t}-${v}` : void 0, b = x && !e, $ = u ? `${d}-helper-text` : void 0, B = [j].filter((v) => !!v), E = (typeof c.value == "number" ? c.value !== void 0 : (P = c.value) == null ? void 0 : P.length) && !c.disabled && !c.readOnly && !h && g && n, I = en(null), Q = (v) => {
|
|
1207
|
+
I.current = v, typeof w == "function" ? w(v) : w && (w.current = v);
|
|
1207
1208
|
}, rr = () => {
|
|
1208
|
-
var
|
|
1209
|
-
|
|
1210
|
-
},
|
|
1211
|
-
|
|
1209
|
+
var v;
|
|
1210
|
+
g == null || g(), (v = I.current) == null || v.focus();
|
|
1211
|
+
}, L = [
|
|
1212
|
+
h && /* @__PURE__ */ s(
|
|
1212
1213
|
Je,
|
|
1213
1214
|
{
|
|
1214
|
-
disabled:
|
|
1215
|
+
disabled: c.disabled,
|
|
1215
1216
|
size: "xs",
|
|
1216
1217
|
"data-testid": l("spinner")
|
|
1217
1218
|
},
|
|
1218
1219
|
"spinner"
|
|
1219
1220
|
),
|
|
1220
|
-
|
|
1221
|
+
E && /* @__PURE__ */ s(
|
|
1221
1222
|
Tr,
|
|
1222
1223
|
{
|
|
1223
1224
|
variant: "tertiary-purple",
|
|
@@ -1226,88 +1227,89 @@ const rn = /* @__PURE__ */ Qe(We), tn = {
|
|
|
1226
1227
|
"aria-label": n ?? "",
|
|
1227
1228
|
"data-testid": l("clear-button"),
|
|
1228
1229
|
tabIndex: -1,
|
|
1229
|
-
children: /* @__PURE__ */ s(
|
|
1230
|
+
children: /* @__PURE__ */ s(Kr, { size: "xs" })
|
|
1230
1231
|
},
|
|
1231
1232
|
"clear-button"
|
|
1232
1233
|
),
|
|
1233
|
-
|
|
1234
|
-
|
|
1234
|
+
b && /* @__PURE__ */ s(
|
|
1235
|
+
Xr,
|
|
1235
1236
|
{
|
|
1236
1237
|
"data-testid": l("valid-icon"),
|
|
1237
|
-
className:
|
|
1238
|
+
className: N(`${m}__valid-icon`)
|
|
1238
1239
|
},
|
|
1239
1240
|
"valid-icon"
|
|
1240
1241
|
)
|
|
1241
|
-
].filter((
|
|
1242
|
-
`${
|
|
1242
|
+
].filter((v) => !!v), R = N([
|
|
1243
|
+
`${m}__input-container`,
|
|
1243
1244
|
{
|
|
1244
|
-
[`${
|
|
1245
|
-
[`${
|
|
1246
|
-
[`${
|
|
1247
|
-
[`${
|
|
1248
|
-
[`${
|
|
1245
|
+
[`${m}__input-container--start-adornment`]: B.length,
|
|
1246
|
+
[`${m}__input-container--end-adornment`]: L.length || r,
|
|
1247
|
+
[`${m}__input-container--disabled`]: c.disabled,
|
|
1248
|
+
[`${m}__input-container--has-clear-button`]: E,
|
|
1249
|
+
[`${m}__input-container--readonly`]: c.readOnly && !c.disabled
|
|
1249
1250
|
}
|
|
1250
1251
|
]);
|
|
1251
|
-
return /* @__PURE__ */
|
|
1252
|
-
|
|
1252
|
+
return /* @__PURE__ */ A("div", { className: N(a, m), children: [
|
|
1253
|
+
f && /* @__PURE__ */ s(
|
|
1253
1254
|
Ve,
|
|
1254
1255
|
{
|
|
1255
|
-
htmlFor:
|
|
1256
|
-
className:
|
|
1256
|
+
htmlFor: d,
|
|
1257
|
+
className: N(`${m}__label`),
|
|
1257
1258
|
"data-testid": l("label"),
|
|
1258
|
-
disabled:
|
|
1259
|
-
children: `${
|
|
1259
|
+
disabled: c.disabled,
|
|
1260
|
+
children: `${c.required ? "* " : ""}${f}`
|
|
1260
1261
|
}
|
|
1261
1262
|
),
|
|
1262
|
-
/* @__PURE__ */
|
|
1263
|
-
|
|
1264
|
-
|
|
1263
|
+
/* @__PURE__ */ A("div", { className: N(`${m}__field-row`), children: [
|
|
1264
|
+
!!i && i,
|
|
1265
|
+
/* @__PURE__ */ A("div", { className: R, children: [
|
|
1266
|
+
!!B.length && /* @__PURE__ */ s(
|
|
1265
1267
|
"div",
|
|
1266
1268
|
{
|
|
1267
1269
|
"data-testid": l("start-adornments"),
|
|
1268
|
-
className:
|
|
1269
|
-
children:
|
|
1270
|
+
className: N(`${m}__adornment-container`),
|
|
1271
|
+
children: B
|
|
1270
1272
|
}
|
|
1271
1273
|
),
|
|
1272
1274
|
/* @__PURE__ */ s(
|
|
1273
1275
|
"input",
|
|
1274
1276
|
{
|
|
1275
|
-
...
|
|
1276
|
-
id:
|
|
1277
|
-
ref:
|
|
1277
|
+
...c,
|
|
1278
|
+
id: d,
|
|
1279
|
+
ref: Q,
|
|
1278
1280
|
"data-testid": l("input"),
|
|
1279
|
-
"aria-describedby":
|
|
1280
|
-
"aria-invalid":
|
|
1281
|
-
className:
|
|
1282
|
-
`${
|
|
1281
|
+
"aria-describedby": c["aria-describedby"] || $,
|
|
1282
|
+
"aria-invalid": c["aria-invalid"] || !!e,
|
|
1283
|
+
className: N([
|
|
1284
|
+
`${m}__input`,
|
|
1283
1285
|
{
|
|
1284
|
-
[`${
|
|
1285
|
-
[`${
|
|
1286
|
+
[`${m}__input--valid`]: b,
|
|
1287
|
+
[`${m}__input--error`]: !!e
|
|
1286
1288
|
}
|
|
1287
1289
|
])
|
|
1288
1290
|
}
|
|
1289
1291
|
),
|
|
1290
|
-
/* @__PURE__ */ s("div", { className:
|
|
1291
|
-
(!!
|
|
1292
|
+
/* @__PURE__ */ s("div", { className: N(`${m}__frame`) }),
|
|
1293
|
+
(!!L.length || r) && /* @__PURE__ */ A(
|
|
1292
1294
|
"div",
|
|
1293
1295
|
{
|
|
1294
1296
|
"data-testid": l("end-adornments"),
|
|
1295
|
-
className:
|
|
1297
|
+
className: N(`${m}__adornment-container`),
|
|
1296
1298
|
children: [
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
+
L,
|
|
1300
|
+
r
|
|
1299
1301
|
]
|
|
1300
1302
|
}
|
|
1301
1303
|
)
|
|
1302
1304
|
] }),
|
|
1303
|
-
!!
|
|
1305
|
+
!!o && o
|
|
1304
1306
|
] }),
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
+
$ && /* @__PURE__ */ s(ye, { "data-testid": l("helper-text"), id: $, children: u }),
|
|
1308
|
+
e && /* @__PURE__ */ s(ge, { "data-testid": l("error-text"), children: e })
|
|
1307
1309
|
] });
|
|
1308
|
-
},
|
|
1309
|
-
|
|
1310
|
-
const un = (t) =>
|
|
1310
|
+
}, Qr = O(nn);
|
|
1311
|
+
Qr.displayName = "TextField";
|
|
1312
|
+
const un = (t) => T(t) && t.type.displayName === Qr.displayName;
|
|
1311
1313
|
function an(t) {
|
|
1312
1314
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1313
1315
|
}
|
|
@@ -1354,7 +1356,7 @@ const pn = /* @__PURE__ */ an(on), sn = {
|
|
|
1354
1356
|
"purpur-autocomplete__chevron-button": "_purpur-autocomplete__chevron-button_1u8x6_9",
|
|
1355
1357
|
"purpur-autocomplete__chevron-icon": "_purpur-autocomplete__chevron-icon_1u8x6_15",
|
|
1356
1358
|
"purpur-autocomplete__chevron-icon--up": "_purpur-autocomplete__chevron-icon--up_1u8x6_19"
|
|
1357
|
-
}, ln = (t) =>
|
|
1359
|
+
}, ln = (t) => Y(t), cn = (t, a) => {
|
|
1358
1360
|
const n = vt(
|
|
1359
1361
|
(i) => {
|
|
1360
1362
|
t && !t.contains(i.target) && a();
|
|
@@ -1373,57 +1375,57 @@ const pn = /* @__PURE__ */ an(on), sn = {
|
|
|
1373
1375
|
id: r,
|
|
1374
1376
|
listboxLabel: e,
|
|
1375
1377
|
listboxMaxHeight: u,
|
|
1376
|
-
onInputChange:
|
|
1377
|
-
openOnFocus:
|
|
1378
|
-
noOptionsText:
|
|
1378
|
+
onInputChange: f,
|
|
1379
|
+
openOnFocus: h,
|
|
1380
|
+
noOptionsText: g,
|
|
1379
1381
|
onSelect: j,
|
|
1380
|
-
options:
|
|
1381
|
-
selectedOption:
|
|
1382
|
-
["data-testid"]:
|
|
1382
|
+
options: x,
|
|
1383
|
+
selectedOption: c,
|
|
1384
|
+
["data-testid"]: w
|
|
1383
1385
|
}) => {
|
|
1384
|
-
const [
|
|
1385
|
-
((typeof i == "string" ? i : n) || (
|
|
1386
|
-
),
|
|
1387
|
-
function
|
|
1388
|
-
return
|
|
1386
|
+
const [P, M] = ar(
|
|
1387
|
+
((typeof i == "string" ? i : n) || (c == null ? void 0 : c.label)) ?? ""
|
|
1388
|
+
), d = typeof i == "string" ? i : P, [l, b] = ar(a ? x[0] : void 0), $ = Y(null), B = ln(null), E = Y(null), I = Y({}), [Q, rr] = ar(!1);
|
|
1389
|
+
function L(p) {
|
|
1390
|
+
return w ? `${w}-${p}` : void 0;
|
|
1389
1391
|
}
|
|
1390
|
-
const
|
|
1391
|
-
|
|
1392
|
+
const R = () => {
|
|
1393
|
+
rr(!1), b(void 0);
|
|
1392
1394
|
};
|
|
1393
|
-
cn(
|
|
1394
|
-
const
|
|
1395
|
-
|
|
1396
|
-
|
|
1395
|
+
cn(B.current, R);
|
|
1396
|
+
const v = ({ eventType: p }) => {
|
|
1397
|
+
rr(!0), c && requestAnimationFrame(() => {
|
|
1398
|
+
b({ ...c, isSetByClickEvent: p === "CLICK" }), nr(I.current[c.id]);
|
|
1397
1399
|
});
|
|
1398
1400
|
}, tt = (p) => {
|
|
1399
1401
|
if (o)
|
|
1400
|
-
return
|
|
1402
|
+
return x.filter((y) => o(p, y));
|
|
1401
1403
|
if (!p)
|
|
1402
|
-
return
|
|
1404
|
+
return x;
|
|
1403
1405
|
const _ = p.toUpperCase().split(" ") || [];
|
|
1404
|
-
return
|
|
1405
|
-
(
|
|
1406
|
-
(
|
|
1406
|
+
return x.filter(
|
|
1407
|
+
(y) => _.every(
|
|
1408
|
+
(S) => (y.value || y.label).toUpperCase().includes(S)
|
|
1407
1409
|
)
|
|
1408
1410
|
);
|
|
1409
|
-
}, dr = (p) =>
|
|
1410
|
-
|
|
1411
|
+
}, dr = (p) => c && (c == null ? void 0 : c.label) === p ? x : tt(p), C = dr(d), er = (p) => {
|
|
1412
|
+
f == null || f(p), M(p);
|
|
1411
1413
|
}, nr = (p) => {
|
|
1412
1414
|
var _;
|
|
1413
1415
|
if (p) {
|
|
1414
|
-
const
|
|
1415
|
-
(
|
|
1416
|
+
const y = p.getBoundingClientRect(), S = ((_ = E.current) == null ? void 0 : _.getBoundingClientRect()) || { top: 0, bottom: 0 };
|
|
1417
|
+
(y.top < S.top || y.bottom > S.bottom) && p.scrollIntoView({ block: "nearest" });
|
|
1416
1418
|
}
|
|
1417
1419
|
}, _r = (p) => {
|
|
1418
1420
|
var _;
|
|
1419
|
-
p && ((_ = $.current) == null || _.focus(), er(p.label), j == null || j(p)),
|
|
1421
|
+
p && ((_ = $.current) == null || _.focus(), er(p.label), j == null || j(p)), R();
|
|
1420
1422
|
}, et = (p) => {
|
|
1421
|
-
const _ = a && !
|
|
1422
|
-
return p === "ArrowDown" ?
|
|
1423
|
-
},
|
|
1424
|
-
!
|
|
1423
|
+
const _ = a && !l ? 0 : C.findIndex((S) => S && (l == null ? void 0 : l.id) === S.id), y = C.length;
|
|
1424
|
+
return p === "ArrowDown" ? C[(_ ?? -1) + 1] || C[0] : C[(_ ?? y) - 1] || C[y - 1];
|
|
1425
|
+
}, q = Q && (!!C.length || !!g), nt = (p) => {
|
|
1426
|
+
!q && v({ eventType: "KEYBOARD" });
|
|
1425
1427
|
const _ = et(p);
|
|
1426
|
-
|
|
1428
|
+
b(_), _ && nr(I.current[_.id]);
|
|
1427
1429
|
}, ut = (p) => {
|
|
1428
1430
|
switch (p.key) {
|
|
1429
1431
|
case "ArrowUp":
|
|
@@ -1431,58 +1433,58 @@ const pn = /* @__PURE__ */ an(on), sn = {
|
|
|
1431
1433
|
p.preventDefault(), nt(p.key);
|
|
1432
1434
|
break;
|
|
1433
1435
|
case "Enter": {
|
|
1434
|
-
const _ =
|
|
1435
|
-
|
|
1436
|
+
const _ = l || (a ? x[0] : void 0);
|
|
1437
|
+
q && _r(_), !q && v({ eventType: "KEYBOARD" });
|
|
1436
1438
|
break;
|
|
1437
1439
|
}
|
|
1438
1440
|
case "Escape":
|
|
1439
1441
|
case "Tab":
|
|
1440
|
-
|
|
1442
|
+
R();
|
|
1441
1443
|
break;
|
|
1442
1444
|
}
|
|
1443
1445
|
}, at = (p) => {
|
|
1444
1446
|
const _ = dr(p.target.value);
|
|
1445
|
-
er(p.target.value),
|
|
1447
|
+
er(p.target.value), b(void 0), !q && v({ eventType: "KEYBOARD" }), a && _[0] && nr(I.current[_[0].id]);
|
|
1446
1448
|
}, it = () => {
|
|
1447
|
-
|
|
1449
|
+
q ? R() : v({ eventType: "CLICK" });
|
|
1448
1450
|
}, ot = () => {
|
|
1449
1451
|
var p;
|
|
1450
|
-
!
|
|
1452
|
+
!Q && h && v({ eventType: "KEYBOARD" }), (p = $.current) == null || p.select();
|
|
1451
1453
|
}, pt = () => {
|
|
1452
1454
|
t && setTimeout(() => {
|
|
1453
1455
|
var p, _;
|
|
1454
|
-
!((p = $.current) != null && p.contains(document.activeElement)) && !((_ =
|
|
1456
|
+
!((p = $.current) != null && p.contains(document.activeElement)) && !((_ = E.current) != null && _.contains(document.activeElement)) && er(c ? c.label : "");
|
|
1455
1457
|
});
|
|
1456
1458
|
}, st = {
|
|
1457
1459
|
maxHeight: typeof u == "number" ? `${u}px` : u
|
|
1458
1460
|
}, fr = {
|
|
1459
1461
|
"aria-label": e,
|
|
1460
|
-
"aria-expanded":
|
|
1461
|
-
"data-testid":
|
|
1462
|
+
"aria-expanded": q,
|
|
1463
|
+
"data-testid": L("listbox"),
|
|
1462
1464
|
id: `${r}-listbox`,
|
|
1463
|
-
ref:
|
|
1464
|
-
onMouseLeave: () =>
|
|
1465
|
+
ref: E,
|
|
1466
|
+
onMouseLeave: () => b(void 0),
|
|
1465
1467
|
style: u ? st : void 0
|
|
1466
1468
|
}, vr = (p) => `${r}-listbox-item-${p.id}`, lt = (p, _) => {
|
|
1467
|
-
const
|
|
1469
|
+
const y = () => p.id !== (l == null ? void 0 : l.id) && b({ ...p, isSetByClickEvent: !0 }), S = (p.id === (l == null ? void 0 : l.id) || !!a && !l && _ === 0) && !(l != null && l.isSetByClickEvent);
|
|
1468
1470
|
return {
|
|
1469
|
-
"data-testid":
|
|
1471
|
+
"data-testid": L(`listbox-item-${p.id}`),
|
|
1470
1472
|
id: vr(p),
|
|
1471
1473
|
key: p.id,
|
|
1472
|
-
onMouseMove:
|
|
1474
|
+
onMouseMove: y,
|
|
1473
1475
|
onMouseUp: () => _r(p),
|
|
1474
|
-
ref: (ur) => ur && (
|
|
1476
|
+
ref: (ur) => ur && (I.current[p.id] = ur),
|
|
1475
1477
|
tabIndex: -1,
|
|
1476
|
-
selected: p.id === (
|
|
1478
|
+
selected: p.id === (c == null ? void 0 : c.id),
|
|
1477
1479
|
disabled: p.disabled,
|
|
1478
|
-
highlighted:
|
|
1479
|
-
hovered: p.id === (
|
|
1480
|
+
highlighted: S,
|
|
1481
|
+
hovered: p.id === (l == null ? void 0 : l.id) && !!(l != null && l.isSetByClickEvent)
|
|
1480
1482
|
};
|
|
1481
1483
|
}, ct = {
|
|
1482
|
-
"aria-activedescendant":
|
|
1484
|
+
"aria-activedescendant": l ? vr(l) : void 0,
|
|
1483
1485
|
"aria-autocomplete": "list",
|
|
1484
1486
|
"aria-controls": fr.id,
|
|
1485
|
-
"data-testid":
|
|
1487
|
+
"data-testid": L("input"),
|
|
1486
1488
|
autoComplete: "off",
|
|
1487
1489
|
id: `${r}-input`,
|
|
1488
1490
|
onChange: at,
|
|
@@ -1492,46 +1494,46 @@ const pn = /* @__PURE__ */ an(on), sn = {
|
|
|
1492
1494
|
onBlur: pt,
|
|
1493
1495
|
ref: $,
|
|
1494
1496
|
role: "combobox",
|
|
1495
|
-
value:
|
|
1497
|
+
value: d
|
|
1496
1498
|
};
|
|
1497
1499
|
return {
|
|
1498
1500
|
id: r,
|
|
1499
1501
|
inputProps: ct,
|
|
1500
|
-
internalRef:
|
|
1501
|
-
optionsToShow:
|
|
1502
|
-
showListbox:
|
|
1503
|
-
noOptionsText:
|
|
1502
|
+
internalRef: B,
|
|
1503
|
+
optionsToShow: C,
|
|
1504
|
+
showListbox: q,
|
|
1505
|
+
noOptionsText: g,
|
|
1504
1506
|
combobox: t,
|
|
1505
1507
|
getListBoxItemProps: lt,
|
|
1506
1508
|
listboxProps: fr
|
|
1507
1509
|
};
|
|
1508
|
-
}, tr = pn.bind(sn),
|
|
1510
|
+
}, tr = pn.bind(sn), U = "purpur-autocomplete", _n = ({ className: t, renderInput: a, renderOption: n, ...i }, o) => {
|
|
1509
1511
|
const {
|
|
1510
1512
|
id: r,
|
|
1511
1513
|
inputProps: e,
|
|
1512
1514
|
internalRef: u,
|
|
1513
|
-
optionsToShow:
|
|
1514
|
-
showListbox:
|
|
1515
|
-
noOptionsText:
|
|
1515
|
+
optionsToShow: f,
|
|
1516
|
+
showListbox: h,
|
|
1517
|
+
noOptionsText: g,
|
|
1516
1518
|
combobox: j,
|
|
1517
|
-
getListBoxItemProps:
|
|
1518
|
-
listboxProps:
|
|
1519
|
-
} = dn(i),
|
|
1520
|
-
const { key:
|
|
1521
|
-
return /* @__PURE__ */ s(
|
|
1522
|
-
},
|
|
1523
|
-
u.current =
|
|
1524
|
-
},
|
|
1525
|
-
const
|
|
1526
|
-
if (j &&
|
|
1527
|
-
const
|
|
1528
|
-
|
|
1519
|
+
getListBoxItemProps: x,
|
|
1520
|
+
listboxProps: c
|
|
1521
|
+
} = dn(i), w = (d, l) => {
|
|
1522
|
+
const { key: b, ...$ } = x(d, l);
|
|
1523
|
+
return /* @__PURE__ */ s(J.Item, { ...$, children: n ? n == null ? void 0 : n(d) : d.label }, b);
|
|
1524
|
+
}, P = (d) => {
|
|
1525
|
+
u.current = d, typeof o == "function" ? o(d) : o && (o.current = d);
|
|
1526
|
+
}, M = () => {
|
|
1527
|
+
const d = a(e);
|
|
1528
|
+
if (j && g && d && un(d)) {
|
|
1529
|
+
const b = /* @__PURE__ */ A(dt, { children: [
|
|
1530
|
+
d.props.endAdornment,
|
|
1529
1531
|
/* @__PURE__ */ s(
|
|
1530
1532
|
"button",
|
|
1531
1533
|
{
|
|
1532
1534
|
"data-testid": "chevron button",
|
|
1533
1535
|
type: "button",
|
|
1534
|
-
className: tr(`${
|
|
1536
|
+
className: tr(`${U}__chevron-button`),
|
|
1535
1537
|
onClick: () => {
|
|
1536
1538
|
e.onFocus(), e.onMouseDown();
|
|
1537
1539
|
},
|
|
@@ -1540,23 +1542,23 @@ const pn = /* @__PURE__ */ an(on), sn = {
|
|
|
1540
1542
|
Pr,
|
|
1541
1543
|
{
|
|
1542
1544
|
size: "sm",
|
|
1543
|
-
className: tr(`${
|
|
1544
|
-
[`${
|
|
1545
|
+
className: tr(`${U}__chevron-icon`, {
|
|
1546
|
+
[`${U}__chevron-icon--up`]: h
|
|
1545
1547
|
})
|
|
1546
1548
|
}
|
|
1547
1549
|
)
|
|
1548
1550
|
}
|
|
1549
1551
|
)
|
|
1550
1552
|
] });
|
|
1551
|
-
return sr(
|
|
1553
|
+
return sr(d, { endAdornment: b });
|
|
1552
1554
|
}
|
|
1553
|
-
return
|
|
1555
|
+
return d;
|
|
1554
1556
|
};
|
|
1555
|
-
return /* @__PURE__ */
|
|
1556
|
-
|
|
1557
|
-
|
|
1557
|
+
return /* @__PURE__ */ A("div", { id: r, ref: P, className: tr([t, U]), children: [
|
|
1558
|
+
M(),
|
|
1559
|
+
h && /* @__PURE__ */ s(J, { ...c, className: tr(`${U}__listbox`), children: f.length ? f.filter((d) => !!d).map(w) : /* @__PURE__ */ s(J.Item, { noninteractive: !0, children: g }) })
|
|
1558
1560
|
] });
|
|
1559
|
-
}, fn =
|
|
1561
|
+
}, fn = O(_n);
|
|
1560
1562
|
fn.displayName = "Autocomplete";
|
|
1561
1563
|
export {
|
|
1562
1564
|
fn as Autocomplete,
|