@purpurds/autocomplete 5.12.0 → 5.14.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.
@@ -1,5 +1,5 @@
1
1
  import { jsx as s, jsxs as O, Fragment as ot } from "react/jsx-runtime";
2
- import { forwardRef as P, Children as R, isValidElement as q, createElement as W, cloneElement as lr, useEffect as Nr, useId as pt, Fragment as st, useRef as Y, useCallback as lt, useState as ur } from "react";
2
+ import { forwardRef as P, Children as k, isValidElement as q, createElement as J, cloneElement as lr, useEffect as Nr, useId as pt, Fragment as st, useRef as Y, useCallback as lt, useState as ur } from "react";
3
3
  import "react-dom";
4
4
  function ct(t) {
5
5
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
@@ -67,7 +67,7 @@ const _t = /* @__PURE__ */ ct(dt), ft = {
67
67
  }
68
68
  );
69
69
  Or.displayName = "IconChevronDown";
70
- const xt = _t.bind(ft), mr = "purpur-icon", gt = "md", bt = (t) => t.filter((a) => Object.keys(a).length >= 1).map((a) => `${a.name}="${a.value}"`).join(" "), ht = ({ content: t = "", title: a } = {}) => {
70
+ const gt = _t.bind(ft), mr = "purpur-icon", xt = "md", bt = (t) => t.filter((a) => Object.keys(a).length >= 1).map((a) => `${a.name}="${a.value}"`).join(" "), ht = ({ content: t = "", title: a } = {}) => {
71
71
  const n = [
72
72
  { name: "xmlns", value: "http://www.w3.org/2000/svg" },
73
73
  { name: "fill", value: "currentColor" },
@@ -80,13 +80,13 @@ const xt = _t.bind(ft), mr = "purpur-icon", gt = "md", bt = (t) => t.filter((a)
80
80
  svg: a,
81
81
  allyTitle: n,
82
82
  className: i,
83
- size: o = gt,
83
+ size: o = xt,
84
84
  ...r
85
85
  }) => {
86
86
  const e = ht({
87
87
  content: yt(a.svg),
88
88
  title: n
89
- }), u = xt(i, mr, `${mr}--${o}`);
89
+ }), u = gt(i, mr, `${mr}--${o}`);
90
90
  return /* @__PURE__ */ s(
91
91
  "span",
92
92
  {
@@ -105,7 +105,7 @@ const xt = _t.bind(ft), mr = "purpur-icon", gt = "md", bt = (t) => t.filter((a)
105
105
  function $t(t) {
106
106
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
107
107
  }
108
- var Cr = { exports: {} };
108
+ var Lr = { exports: {} };
109
109
  /*!
110
110
  Copyright (c) 2018 Jed Watson.
111
111
  Licensed under the MIT License (MIT), see
@@ -140,9 +140,9 @@ var Cr = { exports: {} };
140
140
  }
141
141
  t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
142
142
  })();
143
- })(Cr);
144
- var jt = Cr.exports;
145
- const xr = /* @__PURE__ */ $t(jt), St = "_rotate_1xozj_1", Nt = "_dash_1xozj_1", G = {
143
+ })(Lr);
144
+ var jt = Lr.exports;
145
+ const gr = /* @__PURE__ */ $t(jt), St = "_rotate_1xozj_1", Nt = "_dash_1xozj_1", G = {
146
146
  "purpur-spinner": "_purpur-spinner_1xozj_1",
147
147
  rotate: St,
148
148
  "purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4",
@@ -154,7 +154,7 @@ const xr = /* @__PURE__ */ $t(jt), St = "_rotate_1xozj_1", Nt = "_dash_1xozj_1",
154
154
  dash: Nt,
155
155
  "purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_1xozj_33",
156
156
  "purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_1xozj_36"
157
- }, K = "purpur-spinner", At = {
157
+ }, V = "purpur-spinner", At = {
158
158
  XXS: "xxs",
159
159
  XS: "xs",
160
160
  SM: "sm",
@@ -169,15 +169,15 @@ const xr = /* @__PURE__ */ $t(jt), St = "_rotate_1xozj_1", Nt = "_dash_1xozj_1",
169
169
  }) => /* @__PURE__ */ s(
170
170
  "div",
171
171
  {
172
- className: xr([G[K], G[`${K}--${i}`]]),
172
+ className: gr([G[V], G[`${V}--${i}`]]),
173
173
  "data-testid": t,
174
174
  ...o,
175
175
  children: /* @__PURE__ */ s("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ s(
176
176
  "circle",
177
177
  {
178
- className: xr(G[`${K}__circle`], {
179
- [G[`${K}__circle--disabled`]]: a,
180
- [G[`${K}__circle--negative`]]: n
178
+ className: gr(G[`${V}__circle`], {
179
+ [G[`${V}__circle--disabled`]]: a,
180
+ [G[`${V}__circle--negative`]]: n
181
181
  }),
182
182
  cx: "25",
183
183
  cy: "25",
@@ -225,8 +225,8 @@ var Mr = { exports: {} };
225
225
  t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
226
226
  })();
227
227
  })(Mr);
228
- var Ct = Mr.exports;
229
- const Mt = /* @__PURE__ */ Pt(Ct), Lt = {
228
+ var Lt = Mr.exports;
229
+ const Mt = /* @__PURE__ */ Pt(Lt), Ct = {
230
230
  "purpur-button": "_purpur-button_1acxn_1",
231
231
  "purpur-button--sm": "_purpur-button--sm_1acxn_33",
232
232
  "purpur-button--icon-only": "_purpur-button--icon-only_1acxn_36",
@@ -247,7 +247,7 @@ const Mt = /* @__PURE__ */ Pt(Ct), Lt = {
247
247
  "purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_1acxn_160",
248
248
  "purpur-button--text-negative": "_purpur-button--text-negative_1acxn_175",
249
249
  "purpur-button--text": "_purpur-button--text_1acxn_175"
250
- }, It = Mt.bind(Lt), B = "purpur-button", Bt = ({
250
+ }, It = Mt.bind(Ct), z = "purpur-button", zt = ({
251
251
  children: t,
252
252
  className: a,
253
253
  ["data-testid"]: n,
@@ -266,18 +266,18 @@ const Mt = /* @__PURE__ */ Pt(Ct), Lt = {
266
266
  return null;
267
267
  const j = It(
268
268
  [
269
- B,
270
- `${B}--${u ? `${y}-negative` : y}`,
271
- `${B}--${b}`
269
+ z,
270
+ `${z}--${u ? `${y}-negative` : y}`,
271
+ `${z}--${b}`
272
272
  ],
273
273
  {
274
- [`${B}--icon-only`]: r,
275
- [`${B}--negative`]: u,
276
- [`${B}--full-width`]: o,
277
- [`${B}--disabled`]: i || e
274
+ [`${z}--icon-only`]: r,
275
+ [`${z}--negative`]: u,
276
+ [`${z}--full-width`]: o,
277
+ [`${z}--disabled`]: i || e
278
278
  },
279
279
  a
280
- ), L = (l) => {
280
+ ), C = (l) => {
281
281
  i || e ? l.preventDefault() : v && v(l);
282
282
  }, w = !!d["aria-disabled"] || i || e;
283
283
  return /* @__PURE__ */ O(
@@ -288,7 +288,7 @@ const Mt = /* @__PURE__ */ Pt(Ct), Lt = {
288
288
  type: $,
289
289
  ref: _,
290
290
  "aria-disabled": w,
291
- onClick: L,
291
+ onClick: C,
292
292
  ...d,
293
293
  children: [
294
294
  e && /* @__PURE__ */ s(Ot, { size: b === wt.LG ? "xs" : "xxs", negative: u, disabled: w }),
@@ -297,9 +297,9 @@ const Mt = /* @__PURE__ */ Pt(Ct), Lt = {
297
297
  ]
298
298
  }
299
299
  );
300
- }, Lr = P(Bt);
301
- Lr.displayName = "Button";
302
- function zt(t) {
300
+ }, Cr = P(zt);
301
+ Cr.displayName = "Button";
302
+ function Bt(t) {
303
303
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
304
304
  }
305
305
  var Ir = { exports: {} };
@@ -338,8 +338,8 @@ var Ir = { exports: {} };
338
338
  t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
339
339
  })();
340
340
  })(Ir);
341
- var kt = Ir.exports;
342
- const Rt = /* @__PURE__ */ zt(kt), qt = {
341
+ var Rt = Ir.exports;
342
+ const kt = /* @__PURE__ */ Bt(Rt), qt = {
343
343
  "purpur-icon": "_purpur-icon_8u1lq_1",
344
344
  "purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
345
345
  "purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
@@ -352,7 +352,7 @@ const Rt = /* @__PURE__ */ zt(kt), qt = {
352
352
  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>',
353
353
  keywords: ["error-filled"],
354
354
  category: "status"
355
- }, Dt = Rt.bind(qt), gr = "purpur-icon", Tt = "md", Ft = (t) => t.filter((a) => Object.keys(a).length >= 1).map((a) => `${a.name}="${a.value}"`).join(" "), Gt = ({ content: t = "", title: a } = {}) => {
355
+ }, Dt = kt.bind(qt), xr = "purpur-icon", Tt = "md", Ft = (t) => t.filter((a) => Object.keys(a).length >= 1).map((a) => `${a.name}="${a.value}"`).join(" "), Gt = ({ content: t = "", title: a } = {}) => {
356
356
  const n = [
357
357
  { name: "xmlns", value: "http://www.w3.org/2000/svg" },
358
358
  { name: "fill", value: "currentColor" },
@@ -360,7 +360,7 @@ const Rt = /* @__PURE__ */ zt(kt), qt = {
360
360
  a ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
361
361
  ], i = a ? `<title>${a}</title>` : "";
362
362
  return `<svg ${Ft(n)}>${i}${t}</svg>`;
363
- }, Kt = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Zt = ({
363
+ }, Vt = (t) => t.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Zt = ({
364
364
  ["data-testid"]: t,
365
365
  svg: a,
366
366
  allyTitle: n,
@@ -369,9 +369,9 @@ const Rt = /* @__PURE__ */ zt(kt), qt = {
369
369
  ...r
370
370
  }) => {
371
371
  const e = Gt({
372
- content: Kt(a.svg),
372
+ content: Vt(a.svg),
373
373
  title: n
374
- }), u = Dt(i, gr, `${gr}--${o}`);
374
+ }), u = Dt(i, xr, `${xr}--${o}`);
375
375
  return /* @__PURE__ */ s(
376
376
  "span",
377
377
  {
@@ -386,7 +386,7 @@ const Rt = /* @__PURE__ */ zt(kt), qt = {
386
386
  function Ht(t) {
387
387
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
388
388
  }
389
- var Br = { exports: {} };
389
+ var zr = { exports: {} };
390
390
  /*!
391
391
  Copyright (c) 2018 Jed Watson.
392
392
  Licensed under the MIT License (MIT), see
@@ -421,12 +421,12 @@ var Br = { exports: {} };
421
421
  }
422
422
  t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
423
423
  })();
424
- })(Br);
425
- var Vt = Br.exports;
426
- const Ut = /* @__PURE__ */ Ht(Vt), br = {
424
+ })(zr);
425
+ var Kt = zr.exports;
426
+ const Xt = /* @__PURE__ */ Ht(Kt), br = {
427
427
  "purpur-field-error-text": "_purpur-field-error-text_1u768_1",
428
428
  "purpur-field-error-text__icon": "_purpur-field-error-text__icon_1u768_12"
429
- }, hr = "purpur-field-error-text", Xt = ({
429
+ }, hr = "purpur-field-error-text", Ut = ({
430
430
  ["data-testid"]: t,
431
431
  children: a,
432
432
  className: n,
@@ -435,7 +435,7 @@ const Ut = /* @__PURE__ */ Ht(Vt), br = {
435
435
  }) => /* @__PURE__ */ O(
436
436
  "div",
437
437
  {
438
- className: Ut([n, br[hr]]),
438
+ className: Xt([n, br[hr]]),
439
439
  "data-testid": t,
440
440
  "aria-live": "assertive",
441
441
  "aria-relevant": i,
@@ -449,7 +449,7 @@ const Ut = /* @__PURE__ */ Ht(Vt), br = {
449
449
  function Yt(t) {
450
450
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
451
451
  }
452
- var zr = { exports: {} };
452
+ var Br = { exports: {} };
453
453
  /*!
454
454
  Copyright (c) 2018 Jed Watson.
455
455
  Licensed under the MIT License (MIT), see
@@ -484,12 +484,12 @@ var zr = { exports: {} };
484
484
  }
485
485
  t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
486
486
  })();
487
- })(zr);
488
- var Wt = zr.exports;
489
- const Jt = /* @__PURE__ */ Yt(Wt), yr = {
487
+ })(Br);
488
+ var Jt = Br.exports;
489
+ const Qt = /* @__PURE__ */ Yt(Jt), yr = {
490
490
  "purpur-field-helper-text": "_purpur-field-helper-text_atw6b_1",
491
491
  "purpur-field-helper-text--disabled": "_purpur-field-helper-text--disabled_atw6b_9"
492
- }, wr = "purpur-field-helper-text", Qt = ({
492
+ }, wr = "purpur-field-helper-text", Wt = ({
493
493
  ["data-testid"]: t,
494
494
  children: a,
495
495
  className: n,
@@ -497,7 +497,7 @@ const Jt = /* @__PURE__ */ Yt(Wt), yr = {
497
497
  id: o,
498
498
  ...r
499
499
  }) => {
500
- const e = Jt([
500
+ const e = Qt([
501
501
  n,
502
502
  yr[wr],
503
503
  {
@@ -509,7 +509,7 @@ const Jt = /* @__PURE__ */ Yt(Wt), yr = {
509
509
  function re(t) {
510
510
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
511
511
  }
512
- var kr = { exports: {} };
512
+ var Rr = { exports: {} };
513
513
  /*!
514
514
  Copyright (c) 2018 Jed Watson.
515
515
  Licensed under the MIT License (MIT), see
@@ -544,8 +544,8 @@ var kr = { exports: {} };
544
544
  }
545
545
  t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
546
546
  })();
547
- })(kr);
548
- var te = kr.exports;
547
+ })(Rr);
548
+ var te = Rr.exports;
549
549
  const ee = /* @__PURE__ */ re(te), ne = {
550
550
  "purpur-icon": "_purpur-icon_8u1lq_1",
551
551
  "purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
@@ -564,14 +564,14 @@ const ee = /* @__PURE__ */ re(te), ne = {
564
564
  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>',
565
565
  keywords: ["close"],
566
566
  category: "utility"
567
- }, Rr = (t) => /* @__PURE__ */ s(
567
+ }, kr = (t) => /* @__PURE__ */ s(
568
568
  Er,
569
569
  {
570
570
  ...t,
571
571
  svg: ue
572
572
  }
573
573
  );
574
- Rr.displayName = "IconCheckCircleFilled";
574
+ kr.displayName = "IconCheckCircleFilled";
575
575
  const qr = (t) => /* @__PURE__ */ s(
576
576
  Er,
577
577
  {
@@ -621,15 +621,15 @@ function or() {
621
621
  return t;
622
622
  }, or.apply(this, arguments);
623
623
  }
624
- function J() {
625
- return J = Object.assign ? Object.assign.bind() : function(t) {
624
+ function Q() {
625
+ return Q = Object.assign ? Object.assign.bind() : function(t) {
626
626
  for (var a = 1; a < arguments.length; a++) {
627
627
  var n = arguments[a];
628
628
  for (var i in n)
629
629
  Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
630
630
  }
631
631
  return t;
632
- }, J.apply(this, arguments);
632
+ }, Q.apply(this, arguments);
633
633
  }
634
634
  function ce(t, a) {
635
635
  typeof t == "function" ? t(a) : t != null && (t.current = a);
@@ -640,14 +640,14 @@ function de(...t) {
640
640
  );
641
641
  }
642
642
  const Dr = /* @__PURE__ */ P((t, a) => {
643
- const { children: n, ...i } = t, o = R.toArray(n), r = o.find(fe);
643
+ const { children: n, ...i } = t, o = k.toArray(n), r = o.find(fe);
644
644
  if (r) {
645
- const e = r.props.children, u = o.map((v) => v === r ? R.count(e) > 1 ? R.only(null) : /* @__PURE__ */ q(e) ? e.props.children : null : v);
646
- return /* @__PURE__ */ W(pr, J({}, i, {
645
+ const e = r.props.children, u = o.map((v) => v === r ? k.count(e) > 1 ? k.only(null) : /* @__PURE__ */ q(e) ? e.props.children : null : v);
646
+ return /* @__PURE__ */ J(pr, Q({}, i, {
647
647
  ref: a
648
648
  }), /* @__PURE__ */ q(e) ? /* @__PURE__ */ lr(e, void 0, u) : null);
649
649
  }
650
- return /* @__PURE__ */ W(pr, J({}, i, {
650
+ return /* @__PURE__ */ J(pr, Q({}, i, {
651
651
  ref: a
652
652
  }), n);
653
653
  });
@@ -657,10 +657,10 @@ const pr = /* @__PURE__ */ P((t, a) => {
657
657
  return /* @__PURE__ */ q(n) ? /* @__PURE__ */ lr(n, {
658
658
  ...ve(i, n.props),
659
659
  ref: a ? de(a, n.ref) : n.ref
660
- }) : R.count(n) > 1 ? R.only(null) : null;
660
+ }) : k.count(n) > 1 ? k.only(null) : null;
661
661
  });
662
662
  pr.displayName = "SlotClone";
663
- const _e = ({ children: t }) => /* @__PURE__ */ W(st, null, t);
663
+ const _e = ({ children: t }) => /* @__PURE__ */ J(st, null, t);
664
664
  function fe(t) {
665
665
  return /* @__PURE__ */ q(t) && t.type === _e;
666
666
  }
@@ -702,12 +702,12 @@ const me = [
702
702
  "span",
703
703
  "svg",
704
704
  "ul"
705
- ], xe = me.reduce((t, a) => {
705
+ ], ge = me.reduce((t, a) => {
706
706
  const n = /* @__PURE__ */ P((i, o) => {
707
707
  const { asChild: r, ...e } = i, u = r ? Dr : a;
708
708
  return Nr(() => {
709
709
  window[Symbol.for("radix-ui")] = !0;
710
- }, []), /* @__PURE__ */ W(u, J({}, e, {
710
+ }, []), /* @__PURE__ */ J(u, Q({}, e, {
711
711
  ref: o
712
712
  }));
713
713
  });
@@ -715,13 +715,13 @@ const me = [
715
715
  ...t,
716
716
  [a]: n
717
717
  };
718
- }, {}), ge = /* @__PURE__ */ P((t, a) => /* @__PURE__ */ W(xe.label, or({}, t, {
718
+ }, {}), xe = /* @__PURE__ */ P((t, a) => /* @__PURE__ */ J(ge.label, or({}, t, {
719
719
  ref: a,
720
720
  onMouseDown: (n) => {
721
721
  var i;
722
722
  (i = t.onMouseDown) === null || i === void 0 || i.call(t, n), !n.defaultPrevented && n.detail > 1 && n.preventDefault();
723
723
  }
724
- }))), be = ge;
724
+ }))), be = xe;
725
725
  function he(t) {
726
726
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
727
727
  }
@@ -869,7 +869,7 @@ const jr = /* @__PURE__ */ je(Se), Ne = "_rotate_1xozj_1", Ae = "_dash_1xozj_1",
869
869
  ) })
870
870
  }
871
871
  );
872
- function Ce(t) {
872
+ function Le(t) {
873
873
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
874
874
  }
875
875
  var Gr = { exports: {} };
@@ -909,7 +909,7 @@ var Gr = { exports: {} };
909
909
  })();
910
910
  })(Gr);
911
911
  var Me = Gr.exports;
912
- const Le = /* @__PURE__ */ Ce(Me), Ie = {
912
+ const Ce = /* @__PURE__ */ Le(Me), Ie = {
913
913
  "purpur-text-field": "_purpur-text-field_nj9f4_1",
914
914
  "purpur-text-field__label": "_purpur-text-field__label_nj9f4_7",
915
915
  "purpur-text-field__label-text": "_purpur-text-field__label-text_nj9f4_13",
@@ -926,7 +926,7 @@ const Le = /* @__PURE__ */ Ce(Me), Ie = {
926
926
  "purpur-text-field__input--error": "_purpur-text-field__input--error_nj9f4_94",
927
927
  "purpur-text-field__adornment-container": "_purpur-text-field__adornment-container_nj9f4_106",
928
928
  "purpur-text-field__valid-icon": "_purpur-text-field__valid-icon_nj9f4_111"
929
- }, Be = (t) => Y(t), A = Le.bind(Ie), x = "purpur-text-field", ze = ({
929
+ }, ze = (t) => Y(t), A = Ce.bind(Ie), g = "purpur-text-field", Be = ({
930
930
  ["data-testid"]: t,
931
931
  className: a,
932
932
  clearButtonAllyLabel: n,
@@ -942,12 +942,12 @@ const Le = /* @__PURE__ */ Ce(Me), Ie = {
942
942
  ...d
943
943
  }, _) => {
944
944
  var j;
945
- const L = pt(), w = d.id ?? L, l = (m) => t ? `${t}-${m}` : void 0, c = $ && !r, g = e ? `${w}-helper-text` : void 0, S = [y].filter((m) => !!m), E = (typeof d.value == "number" ? d.value !== void 0 : (j = d.value) == null ? void 0 : j.length) && !d.disabled && !d.readOnly && !v && b && n, D = Be(null), z = (m) => {
945
+ const C = pt(), w = d.id ?? C, l = (m) => t ? `${t}-${m}` : void 0, c = $ && !r, x = e ? `${w}-helper-text` : void 0, S = [y].filter((m) => !!m), E = (typeof d.value == "number" ? d.value !== void 0 : (j = d.value) == null ? void 0 : j.length) && !d.disabled && !d.readOnly && !v && b && n, D = ze(null), B = (m) => {
946
946
  D.current = m, typeof _ == "function" ? _(m) : _ && (_.current = m);
947
- }, Q = () => {
947
+ }, W = () => {
948
948
  var m;
949
949
  b == null || b(), (m = D.current) == null || m.focus();
950
- }, k = [
950
+ }, R = [
951
951
  v && /* @__PURE__ */ s(
952
952
  Pe,
953
953
  {
@@ -958,10 +958,10 @@ const Le = /* @__PURE__ */ Ce(Me), Ie = {
958
958
  "spinner"
959
959
  ),
960
960
  E && /* @__PURE__ */ s(
961
- Lr,
961
+ Cr,
962
962
  {
963
963
  variant: "tertiary-purple",
964
- onClick: Q,
964
+ onClick: W,
965
965
  iconOnly: !0,
966
966
  "aria-label": n ?? "",
967
967
  "data-testid": l("clear-button"),
@@ -971,41 +971,41 @@ const Le = /* @__PURE__ */ Ce(Me), Ie = {
971
971
  "clear-button"
972
972
  ),
973
973
  c && /* @__PURE__ */ s(
974
- Rr,
974
+ kr,
975
975
  {
976
976
  "data-testid": l("valid-icon"),
977
- className: A(`${x}__valid-icon`)
977
+ className: A(`${g}__valid-icon`)
978
978
  },
979
979
  "valid-icon"
980
980
  )
981
981
  ].filter((m) => !!m), T = A([
982
- `${x}__input-container`,
982
+ `${g}__input-container`,
983
983
  {
984
- [`${x}__input-container--start-adornment`]: S.length,
985
- [`${x}__input-container--end-adornment`]: k.length || o,
986
- [`${x}__input-container--disabled`]: d.disabled,
987
- [`${x}__input-container--has-clear-button`]: E,
988
- [`${x}__input-container--readonly`]: d.readOnly && !d.disabled
984
+ [`${g}__input-container--start-adornment`]: S.length,
985
+ [`${g}__input-container--end-adornment`]: R.length || o,
986
+ [`${g}__input-container--disabled`]: d.disabled,
987
+ [`${g}__input-container--has-clear-button`]: E,
988
+ [`${g}__input-container--readonly`]: d.readOnly && !d.disabled
989
989
  }
990
990
  ]);
991
- return /* @__PURE__ */ O("div", { className: A(a, x), children: [
991
+ return /* @__PURE__ */ O("div", { className: A(a, g), children: [
992
992
  u && /* @__PURE__ */ s(
993
993
  $e,
994
994
  {
995
995
  htmlFor: w,
996
- className: A(`${x}__label`),
996
+ className: A(`${g}__label`),
997
997
  "data-testid": l("label"),
998
998
  disabled: d.disabled,
999
999
  children: `${d.required ? "* " : ""}${u}`
1000
1000
  }
1001
1001
  ),
1002
- /* @__PURE__ */ O("div", { className: A(`${x}__field-row`), children: [
1002
+ /* @__PURE__ */ O("div", { className: A(`${g}__field-row`), children: [
1003
1003
  /* @__PURE__ */ O("div", { className: T, children: [
1004
1004
  !!S.length && /* @__PURE__ */ s(
1005
1005
  "div",
1006
1006
  {
1007
1007
  "data-testid": l("start-adornments"),
1008
- className: A(`${x}__adornment-container`),
1008
+ className: A(`${g}__adornment-container`),
1009
1009
  children: S
1010
1010
  }
1011
1011
  ),
@@ -1014,27 +1014,27 @@ const Le = /* @__PURE__ */ Ce(Me), Ie = {
1014
1014
  {
1015
1015
  ...d,
1016
1016
  id: w,
1017
- ref: z,
1017
+ ref: B,
1018
1018
  "data-testid": l("input"),
1019
- "aria-describedby": d["aria-describedby"] || g,
1019
+ "aria-describedby": d["aria-describedby"] || x,
1020
1020
  "aria-invalid": d["aria-invalid"] || !!r,
1021
1021
  className: A([
1022
- `${x}__input`,
1022
+ `${g}__input`,
1023
1023
  {
1024
- [`${x}__input--valid`]: c,
1025
- [`${x}__input--error`]: !!r
1024
+ [`${g}__input--valid`]: c,
1025
+ [`${g}__input--error`]: !!r
1026
1026
  }
1027
1027
  ])
1028
1028
  }
1029
1029
  ),
1030
- /* @__PURE__ */ s("div", { className: A(`${x}__frame`) }),
1031
- (!!k.length || o) && /* @__PURE__ */ O(
1030
+ /* @__PURE__ */ s("div", { className: A(`${g}__frame`) }),
1031
+ (!!R.length || o) && /* @__PURE__ */ O(
1032
1032
  "div",
1033
1033
  {
1034
1034
  "data-testid": l("end-adornments"),
1035
- className: A(`${x}__adornment-container`),
1035
+ className: A(`${g}__adornment-container`),
1036
1036
  children: [
1037
- k,
1037
+ R,
1038
1038
  o
1039
1039
  ]
1040
1040
  }
@@ -1042,13 +1042,13 @@ const Le = /* @__PURE__ */ Ce(Me), Ie = {
1042
1042
  ] }),
1043
1043
  !!i && i
1044
1044
  ] }),
1045
- g && /* @__PURE__ */ s(Qt, { "data-testid": l("helper-text"), id: g, children: e }),
1046
- r && /* @__PURE__ */ s(Xt, { "data-testid": l("error-text"), children: r })
1045
+ x && /* @__PURE__ */ s(Wt, { "data-testid": l("helper-text"), id: x, children: e }),
1046
+ r && /* @__PURE__ */ s(Ut, { "data-testid": l("error-text"), children: r })
1047
1047
  ] });
1048
- }, Kr = P(ze);
1049
- Kr.displayName = "TextField";
1050
- const ke = (t) => q(t) && t.type.displayName === Kr.displayName;
1051
- function Re(t) {
1048
+ }, Vr = P(Be);
1049
+ Vr.displayName = "TextField";
1050
+ const Re = (t) => q(t) && t.type.displayName === Vr.displayName;
1051
+ function ke(t) {
1052
1052
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1053
1053
  }
1054
1054
  var Zr = { exports: {} };
@@ -1088,7 +1088,7 @@ var Zr = { exports: {} };
1088
1088
  })();
1089
1089
  })(Zr);
1090
1090
  var qe = Zr.exports;
1091
- const Hr = /* @__PURE__ */ Re(qe), Ee = {
1091
+ const Hr = /* @__PURE__ */ ke(qe), Ee = {
1092
1092
  "purpur-autocomplete": "_purpur-autocomplete_1u8x6_1",
1093
1093
  "purpur-autocomplete__listbox": "_purpur-autocomplete__listbox_1u8x6_4",
1094
1094
  "purpur-autocomplete__chevron-button": "_purpur-autocomplete__chevron-button_1u8x6_9",
@@ -1098,7 +1098,7 @@ const Hr = /* @__PURE__ */ Re(qe), Ee = {
1098
1098
  function De(t) {
1099
1099
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
1100
1100
  }
1101
- var Vr = { exports: {} };
1101
+ var Kr = { exports: {} };
1102
1102
  /*!
1103
1103
  Copyright (c) 2018 Jed Watson.
1104
1104
  Licensed under the MIT License (MIT), see
@@ -1133,9 +1133,9 @@ var Vr = { exports: {} };
1133
1133
  }
1134
1134
  t.exports ? (n.default = n, t.exports = n) : window.classNames = n;
1135
1135
  })();
1136
- })(Vr);
1137
- var Te = Vr.exports;
1138
- const Fe = /* @__PURE__ */ De(Te), V = {
1136
+ })(Kr);
1137
+ var Te = Kr.exports;
1138
+ const Fe = /* @__PURE__ */ De(Te), K = {
1139
1139
  "purpur-paragraph": "_purpur-paragraph_1rh57_1",
1140
1140
  "purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
1141
1141
  "purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
@@ -1161,7 +1161,7 @@ const Fe = /* @__PURE__ */ De(Te), V = {
1161
1161
  ADDITIONAL100MEDIUM: "additional-100-medium",
1162
1162
  OVERLINE100: "overline-100",
1163
1163
  OVERLINE200: "overline-200"
1164
- }, U = "purpur-paragraph", Ur = ({
1164
+ }, X = "purpur-paragraph", Xr = ({
1165
1165
  ["data-testid"]: t,
1166
1166
  children: a,
1167
1167
  className: n,
@@ -1173,18 +1173,18 @@ const Fe = /* @__PURE__ */ De(Te), V = {
1173
1173
  }) => {
1174
1174
  const v = Fe([
1175
1175
  n,
1176
- V[U],
1177
- V[`${U}--${e}`],
1176
+ K[X],
1177
+ K[`${X}--${e}`],
1178
1178
  {
1179
- [V[`${U}--hyphens`]]: o,
1180
- [V[`${U}--disabled`]]: i,
1181
- [V[`${U}--negative`]]: r
1179
+ [K[`${X}--hyphens`]]: o,
1180
+ [K[`${X}--disabled`]]: i,
1181
+ [K[`${X}--negative`]]: r
1182
1182
  }
1183
1183
  ]);
1184
1184
  return /* @__PURE__ */ s("p", { ...u, className: v, "data-testid": t, children: a });
1185
1185
  };
1186
- Ur.displayName = "Paragraph";
1187
- const Ke = {
1186
+ Xr.displayName = "Paragraph";
1187
+ const Ve = {
1188
1188
  "purpur-listbox": "_purpur-listbox_qhoi7_1",
1189
1189
  "purpur-listbox-item": "_purpur-listbox-item_qhoi7_15",
1190
1190
  "purpur-listbox-item--hovered": "_purpur-listbox-item--hovered_qhoi7_29",
@@ -1202,7 +1202,7 @@ const Ke = {
1202
1202
  Nr(() => (document.addEventListener("mousedown", n), () => {
1203
1203
  document.removeEventListener("mousedown", n);
1204
1204
  }), [n]);
1205
- }, Ve = ({
1205
+ }, Ke = ({
1206
1206
  combobox: t,
1207
1207
  highlightFirstOption: a,
1208
1208
  defaultInputValue: n,
@@ -1219,19 +1219,19 @@ const Ke = {
1219
1219
  selectedOption: _,
1220
1220
  ["data-testid"]: j
1221
1221
  }) => {
1222
- const [L, w] = ur(
1222
+ const [C, w] = ur(
1223
1223
  ((typeof i == "string" ? i : n) || (_ == null ? void 0 : _.label)) ?? ""
1224
- ), l = typeof i == "string" ? i : L, [c, g] = ur(a ? d[0] : void 0), S = Y(null), E = Ze(null), D = Y(null), z = Y({}), [Q, k] = ur(!1);
1224
+ ), l = typeof i == "string" ? i : C, [c, x] = ur(a ? d[0] : void 0), S = Y(null), E = Ze(null), D = Y(null), B = Y({}), [W, R] = ur(!1);
1225
1225
  function T(p) {
1226
1226
  return j ? `${j}-${p}` : void 0;
1227
1227
  }
1228
1228
  const m = () => {
1229
- k(!1), g(void 0);
1229
+ R(!1), x(void 0);
1230
1230
  };
1231
1231
  He(E.current, m);
1232
1232
  const F = ({ eventType: p }) => {
1233
- k(!0), _ && requestAnimationFrame(() => {
1234
- g({ ..._, isSetByClickEvent: p === "CLICK" }), er(z.current[_.id]);
1233
+ R(!0), _ && requestAnimationFrame(() => {
1234
+ x({ ..._, isSetByClickEvent: p === "CLICK" }), er(B.current[_.id]);
1235
1235
  });
1236
1236
  }, Yr = (p) => {
1237
1237
  if (o)
@@ -1244,7 +1244,7 @@ const Ke = {
1244
1244
  (N) => (h.value || h.label).toUpperCase().includes(N)
1245
1245
  )
1246
1246
  );
1247
- }, dr = (p) => _ && (_ == null ? void 0 : _.label) === p ? d : Yr(p), C = dr(l), tr = (p) => {
1247
+ }, dr = (p) => _ && (_ == null ? void 0 : _.label) === p ? d : Yr(p), L = dr(l), tr = (p) => {
1248
1248
  v == null || v(p), w(p);
1249
1249
  }, er = (p) => {
1250
1250
  var f;
@@ -1255,18 +1255,18 @@ const Ke = {
1255
1255
  }, _r = (p) => {
1256
1256
  var f;
1257
1257
  p && ((f = S.current) == null || f.focus(), tr(p.label), $ == null || $(p)), m();
1258
- }, Wr = (p) => {
1259
- const f = a && !c ? 0 : C.findIndex((N) => N && (c == null ? void 0 : c.id) === N.id), h = C.length;
1260
- return p === "ArrowDown" ? C[(f ?? -1) + 1] || C[0] : C[(f ?? h) - 1] || C[h - 1];
1261
- }, I = Q && (!!C.length || !!y), Jr = (p) => {
1258
+ }, Jr = (p) => {
1259
+ const f = a && !c ? 0 : L.findIndex((N) => N && (c == null ? void 0 : c.id) === N.id), h = L.length;
1260
+ return p === "ArrowDown" ? L[(f ?? -1) + 1] || L[0] : L[(f ?? h) - 1] || L[h - 1];
1261
+ }, I = W && (!!L.length || !!y), Qr = (p) => {
1262
1262
  !I && F({ eventType: "KEYBOARD" });
1263
- const f = Wr(p);
1264
- g(f), f && er(z.current[f.id]);
1265
- }, Qr = (p) => {
1263
+ const f = Jr(p);
1264
+ x(f), f && er(B.current[f.id]);
1265
+ }, Wr = (p) => {
1266
1266
  switch (p.key) {
1267
1267
  case "ArrowUp":
1268
1268
  case "ArrowDown":
1269
- p.preventDefault(), Jr(p.key);
1269
+ p.preventDefault(), Qr(p.key);
1270
1270
  break;
1271
1271
  case "Enter": {
1272
1272
  const f = c || (a ? d[0] : void 0);
@@ -1280,12 +1280,12 @@ const Ke = {
1280
1280
  }
1281
1281
  }, rt = (p) => {
1282
1282
  const f = dr(p.target.value);
1283
- tr(p.target.value), g(void 0), !I && F({ eventType: "KEYBOARD" }), a && f[0] && er(z.current[f[0].id]);
1283
+ tr(p.target.value), x(void 0), !I && F({ eventType: "KEYBOARD" }), a && f[0] && er(B.current[f[0].id]);
1284
1284
  }, tt = () => {
1285
1285
  I ? m() : F({ eventType: "CLICK" });
1286
1286
  }, et = () => {
1287
1287
  var p;
1288
- !Q && b && F({ eventType: "KEYBOARD" }), (p = S.current) == null || p.select();
1288
+ !W && b && F({ eventType: "KEYBOARD" }), (p = S.current) == null || p.select();
1289
1289
  }, nt = () => {
1290
1290
  t && tr((_ == null ? void 0 : _.label) ?? "");
1291
1291
  }, ut = {
@@ -1296,17 +1296,17 @@ const Ke = {
1296
1296
  "data-testid": T("listbox"),
1297
1297
  id: `${r}-listbox`,
1298
1298
  ref: D,
1299
- onMouseLeave: () => g(void 0),
1299
+ onMouseLeave: () => x(void 0),
1300
1300
  style: u ? ut : void 0
1301
1301
  }, vr = (p) => `${r}-listbox-item-${p.id}`, at = (p, f) => {
1302
- const h = () => p.id !== (c == null ? void 0 : c.id) && g({ ...p, isSetByClickEvent: !0 }), N = (p.id === (c == null ? void 0 : c.id) || !!a && !c && f === 0) && !(c != null && c.isSetByClickEvent);
1302
+ const h = () => p.id !== (c == null ? void 0 : c.id) && x({ ...p, isSetByClickEvent: !0 }), N = (p.id === (c == null ? void 0 : c.id) || !!a && !c && f === 0) && !(c != null && c.isSetByClickEvent);
1303
1303
  return {
1304
1304
  "data-testid": T(`listbox-item-${p.id}`),
1305
1305
  id: vr(p),
1306
1306
  key: p.id,
1307
1307
  onMouseMove: h,
1308
1308
  onMouseUp: () => _r(p),
1309
- ref: (nr) => nr && (z.current[p.id] = nr),
1309
+ ref: (nr) => nr && (B.current[p.id] = nr),
1310
1310
  tabIndex: -1,
1311
1311
  selected: p.id === (_ == null ? void 0 : _.id),
1312
1312
  disabled: p.disabled,
@@ -1323,7 +1323,7 @@ const Ke = {
1323
1323
  onChange: rt,
1324
1324
  onMouseDown: tt,
1325
1325
  onFocus: et,
1326
- onKeyDown: Qr,
1326
+ onKeyDown: Wr,
1327
1327
  onBlur: nt,
1328
1328
  ref: S,
1329
1329
  role: "combobox",
@@ -1333,14 +1333,14 @@ const Ke = {
1333
1333
  id: r,
1334
1334
  inputProps: it,
1335
1335
  internalRef: E,
1336
- optionsToShow: C,
1336
+ optionsToShow: L,
1337
1337
  showListbox: I,
1338
1338
  noOptionsText: y,
1339
1339
  combobox: t,
1340
1340
  getListBoxItemProps: at,
1341
1341
  listboxProps: fr
1342
1342
  };
1343
- }, sr = Hr.bind(Ke), M = "purpur-listbox", Xr = P(
1343
+ }, sr = Hr.bind(Ve), M = "purpur-listbox", Ur = P(
1344
1344
  ({ children: t, ...a }, n) => /* @__PURE__ */ s(
1345
1345
  "ul",
1346
1346
  {
@@ -1348,11 +1348,11 @@ const Ke = {
1348
1348
  ref: n,
1349
1349
  className: sr(M, a.className),
1350
1350
  role: "listbox",
1351
- children: R.toArray(t).filter(Ue)
1351
+ children: k.toArray(t).filter(Xe)
1352
1352
  }
1353
1353
  )
1354
1354
  );
1355
- Xr.displayName = "ListBox";
1355
+ Ur.displayName = "ListBox";
1356
1356
  const cr = P((t, a) => {
1357
1357
  const { disabled: n, highlighted: i, hovered: o, selected: r, children: e, noninteractive: u, ...v } = t, b = sr(`${M}-item`, v.className, {
1358
1358
  [`${M}-item--highlighted`]: i,
@@ -1371,17 +1371,17 @@ const cr = P((t, a) => {
1371
1371
  role: "option",
1372
1372
  "aria-disabled": !!n,
1373
1373
  children: [
1374
- typeof e == "string" ? /* @__PURE__ */ s(Ur, { children: e }) : e,
1374
+ typeof e == "string" ? /* @__PURE__ */ s(Xr, { children: e }) : e,
1375
1375
  r && /* @__PURE__ */ s(Pr, { svg: vt, size: "xs", className: sr(`${M}-item__icon`) })
1376
1376
  ]
1377
1377
  }
1378
1378
  );
1379
1379
  });
1380
1380
  cr.displayName = "ListBoxItem";
1381
- function Ue(t) {
1381
+ function Xe(t) {
1382
1382
  return q(t) && (t == null ? void 0 : t.type) === cr;
1383
1383
  }
1384
- const Xe = Xr, Sr = cr, rr = Hr.bind(Ee), X = "purpur-autocomplete", Ye = ({ className: t, renderInput: a, renderOption: n, ...i }, o) => {
1384
+ const Ue = Ur, Sr = cr, rr = Hr.bind(Ee), U = "purpur-autocomplete", Ye = ({ className: t, renderInput: a, renderOption: n, ...i }, o) => {
1385
1385
  const {
1386
1386
  id: r,
1387
1387
  inputProps: e,
@@ -1392,22 +1392,22 @@ const Xe = Xr, Sr = cr, rr = Hr.bind(Ee), X = "purpur-autocomplete", Ye = ({ cla
1392
1392
  combobox: $,
1393
1393
  getListBoxItemProps: d,
1394
1394
  listboxProps: _
1395
- } = Ve(i), j = (l, c) => {
1396
- const { key: g, ...S } = d(l, c);
1397
- return /* @__PURE__ */ s(Sr, { ...S, children: n ? n == null ? void 0 : n(l) : l.label }, g);
1398
- }, L = (l) => {
1395
+ } = Ke(i), j = (l, c) => {
1396
+ const { key: x, ...S } = d(l, c);
1397
+ return /* @__PURE__ */ s(Sr, { ...S, children: n ? n == null ? void 0 : n(l) : l.label }, x);
1398
+ }, C = (l) => {
1399
1399
  u.current = l, typeof o == "function" ? o(l) : o && (o.current = l);
1400
1400
  }, w = () => {
1401
1401
  const l = a(e);
1402
- if ($ && y && l && ke(l)) {
1403
- const g = /* @__PURE__ */ O(ot, { children: [
1402
+ if ($ && y && l && Re(l)) {
1403
+ const x = /* @__PURE__ */ O(ot, { children: [
1404
1404
  l.props.endAdornment,
1405
1405
  /* @__PURE__ */ s(
1406
1406
  "button",
1407
1407
  {
1408
1408
  "data-testid": "chevron button",
1409
1409
  type: "button",
1410
- className: rr(`${X}__chevron-button`),
1410
+ className: rr(`${U}__chevron-button`),
1411
1411
  onClick: () => {
1412
1412
  e.onFocus(), e.onMouseDown();
1413
1413
  },
@@ -1416,26 +1416,26 @@ const Xe = Xr, Sr = cr, rr = Hr.bind(Ee), X = "purpur-autocomplete", Ye = ({ cla
1416
1416
  Or,
1417
1417
  {
1418
1418
  size: "sm",
1419
- className: rr(`${X}__chevron-icon`, {
1420
- [`${X}__chevron-icon--up`]: b
1419
+ className: rr(`${U}__chevron-icon`, {
1420
+ [`${U}__chevron-icon--up`]: b
1421
1421
  })
1422
1422
  }
1423
1423
  )
1424
1424
  }
1425
1425
  )
1426
1426
  ] });
1427
- return lr(l, { endAdornment: g });
1427
+ return lr(l, { endAdornment: x });
1428
1428
  }
1429
1429
  return l;
1430
1430
  };
1431
- return /* @__PURE__ */ O("div", { id: r, ref: L, className: rr([t, X]), children: [
1431
+ return /* @__PURE__ */ O("div", { id: r, ref: C, className: rr([t, U]), children: [
1432
1432
  w(),
1433
- b && /* @__PURE__ */ s(Xe, { ..._, className: rr(`${X}__listbox`), children: v.length ? v.filter((l) => !!l).map(j) : /* @__PURE__ */ s(Sr, { noninteractive: !0, children: y }) })
1433
+ b && /* @__PURE__ */ s(Ue, { ..._, className: rr(`${U}__listbox`), children: v.length ? v.filter((l) => !!l).map(j) : /* @__PURE__ */ s(Sr, { noninteractive: !0, children: y }) })
1434
1434
  ] });
1435
- }, We = P(Ye);
1436
- We.displayName = "Autocomplete";
1435
+ }, Je = P(Ye);
1436
+ Je.displayName = "Autocomplete";
1437
1437
  export {
1438
- We as Autocomplete,
1439
- Ve as useAutocomplete
1438
+ Je as Autocomplete,
1439
+ Ke as useAutocomplete
1440
1440
  };
1441
1441
  //# sourceMappingURL=autocomplete.es.js.map