asma-ui-core 3.115.0 → 3.116.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.
@@ -24,6 +24,7 @@ var Y = ({ readOnly: m, disabled: a, interactive: e, focusableDisabled: o, tabIn
24
24
  }, U = S(u, "width"), q = S(u, "max-width"), A = /* @__PURE__ */ X("div", {
25
25
  ref: W,
26
26
  "data-testid": m,
27
+ "data-chip": "",
27
28
  "aria-label": N,
28
29
  "data-hovered": K,
29
30
  "data-focus": P,
@@ -1,31 +1,31 @@
1
1
  import { CloseIcon as w } from "../../icons/close-icon/CloseIcon.js";
2
2
  import { StyledButton as y } from "../button/StyledButton.js";
3
- import { useShortViewportMediaQuery as g } from "../../../hooks/useMediaQuery.hook.js";
3
+ import { usePickerOneRowHeaderMediaQuery as g } from "../../../hooks/useMediaQuery.hook.js";
4
4
  import { StyledDialog as k } from "../../feedback/dialog/StyledDialog.js";
5
5
  import { PickerLiveRegion as N } from "./PickerLiveRegion.js";
6
6
  import { isKeyboardModality as S, trackInputModality as I } from "./inputModality.js";
7
7
  import { useVisualViewportHeight as R } from "./useVisualViewportHeight.js";
8
- import { useEffect as x, useRef as p } from "react";
8
+ import { useEffect as p, useRef as x } from "react";
9
9
  import { jsx as e, jsxs as m } from "react/jsx-runtime";
10
- var B = ({ open: o, onClose: t, dataTest: i, title: r, fallbackName: a, ...n }) => {
10
+ var B = ({ open: o, onClose: i, dataTest: t, title: r, fallbackName: a, ...n }) => {
11
11
  const l = r != null && r !== !1 && r !== "";
12
- return x(I, []), /* @__PURE__ */ e(k, {
12
+ return p(I, []), /* @__PURE__ */ e(k, {
13
13
  open: o,
14
- onClose: (f, s) => t(s),
15
- dataTest: i,
14
+ onClose: (f, s) => i(s),
15
+ dataTest: t,
16
16
  fullScreen: !0,
17
17
  showCloseIcon: !1,
18
18
  ariaLabel: l ? void 0 : a,
19
- children: /* @__PURE__ */ e($, {
19
+ children: /* @__PURE__ */ e(P, {
20
20
  ...n,
21
- dataTest: i,
21
+ dataTest: t,
22
22
  title: l ? r : void 0,
23
- onClose: t
23
+ onClose: i
24
24
  })
25
25
  });
26
- }, $ = ({ dataTest: o, title: t, closeLabel: i, search: r, headerRow: a, children: n, announcement: l, onClose: f }) => {
27
- const s = g(), v = R(), c = p(null), u = p(null);
28
- return x(() => {
26
+ }, P = ({ dataTest: o, title: i, closeLabel: t, search: r, headerRow: a, children: n, announcement: l, onClose: f }) => {
27
+ const s = g(), v = R(), c = x(null), u = x(null);
28
+ return p(() => {
29
29
  const b = requestAnimationFrame(() => {
30
30
  const h = c.current?.closest("dialog");
31
31
  if (!h || document.activeElement !== h || !S()) return;
@@ -44,9 +44,9 @@ var B = ({ open: o, onClose: t, dataTest: i, title: r, fallbackName: a, ...n })
44
44
  /* @__PURE__ */ m("div", {
45
45
  className: "flex items-start gap-2",
46
46
  children: [
47
- t !== void 0 && /* @__PURE__ */ e("h2", {
47
+ i !== void 0 && /* @__PURE__ */ e("h2", {
48
48
  className: "m-0 min-w-0 flex-1 break-words pl-4 pt-2 text-[20px] font-semibold leading-7 text-delta-800",
49
- children: t
49
+ children: i
50
50
  }),
51
51
  s && /* @__PURE__ */ e("div", {
52
52
  className: "min-w-0 max-w-[240px] flex-1 pt-2",
@@ -55,7 +55,7 @@ var B = ({ open: o, onClose: t, dataTest: i, title: r, fallbackName: a, ...n })
55
55
  /* @__PURE__ */ e(y, {
56
56
  dataTest: `${o}-close`,
57
57
  refLink: c,
58
- "aria-label": i,
58
+ "aria-label": t,
59
59
  variant: "textGray",
60
60
  startIcon: /* @__PURE__ */ e(w, {
61
61
  width: 24,
@@ -9,8 +9,7 @@ var a = {
9
9
  noMatches: "Ingen treff",
10
10
  matchCount: (e) => `${e} treff`,
11
11
  cleared: "Valget er fjernet",
12
- clearedAll: "Alle valg er fjernet",
13
- truncated: (e, l) => `Viser ${e} av ${l}. Søk for å finne flere.`
12
+ clearedAll: "Alle valg er fjernet"
14
13
  },
15
14
  en: {
16
15
  close: "Close",
@@ -22,13 +21,12 @@ var a = {
22
21
  noMatches: "No matches",
23
22
  matchCount: (e) => e === 1 ? "1 match" : `${e} matches`,
24
23
  cleared: "Selection cleared",
25
- clearedAll: "All selections cleared",
26
- truncated: (e, l) => `Showing ${e} of ${l}. Search to find more.`
24
+ clearedAll: "All selections cleared"
27
25
  }
28
- }, r = (e, l) => ({
26
+ }, c = (e, l) => ({
29
27
  ...a[e],
30
28
  ...l
31
29
  });
32
30
  export {
33
- r as getPickerText
31
+ c as getPickerText
34
32
  };
@@ -1,32 +1,39 @@
1
1
  import { cn as g } from "../../../helpers/cn.js";
2
- import { StyledSelectItem as w } from "../select/StyledSelectItem.js";
3
- import { useEffect as C, useRef as N } from "react";
4
- import { jsx as s, jsxs as m } from "react/jsx-runtime";
5
- var v = ({ dataTest: c, visible: i, selectedIso2: d, activeIndex: l, optionId: t, onSelect: f, listId: p, label: u, renderFlag: h, className: b, onKeyDown: r, onFocus: x }) => {
6
- const a = r !== void 0, o = N(null);
7
- return C(() => {
8
- l !== null && o.current?.querySelector(`#${CSS.escape(t(l))}`)?.scrollIntoView({ block: "nearest" });
2
+ import { StyledSelectItem as N } from "../select/StyledSelectItem.js";
3
+ import { useEffect as d, useRef as k } from "react";
4
+ import { jsx as s, jsxs as f } from "react/jsx-runtime";
5
+ var v = ({ dataTest: u, visible: a, selectedIso2: o, activeIndex: r, optionId: t, onSelect: p, listId: h, label: x, renderFlag: S, className: b, onKeyDown: c, onFocus: w, open: m }) => {
6
+ const i = c !== void 0, n = k(null);
7
+ return d(() => {
8
+ if (!m) return;
9
+ const e = requestAnimationFrame(() => {
10
+ const l = a.findIndex((C) => C.iso2 === o);
11
+ l < 0 || n.current?.querySelector(`#${CSS.escape(t(l))}`)?.scrollIntoView({ block: "center" });
12
+ });
13
+ return () => cancelAnimationFrame(e);
14
+ }, [m]), d(() => {
15
+ r !== null && n.current?.querySelector(`#${CSS.escape(t(r))}`)?.scrollIntoView({ block: "nearest" });
9
16
  }), /* @__PURE__ */ s("ul", {
10
- ref: o,
11
- id: p,
17
+ ref: n,
18
+ id: h,
12
19
  role: "listbox",
13
- "aria-label": u,
14
- "data-testid": `${c}-listbox`,
15
- tabIndex: a ? 0 : void 0,
16
- "aria-activedescendant": a && l !== null ? t(l) : void 0,
17
- onKeyDown: r,
18
- onFocus: x,
19
- className: g("m-0 min-h-0 flex-1 list-none overflow-y-auto p-0", a && i.length > 0 && "outline-none", "[&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", b),
20
- children: i.map((e, n) => /* @__PURE__ */ s(w, {
21
- id: t(n),
22
- selected: e.iso2 === d,
23
- active: n === l,
24
- onClick: () => f(e.iso2),
25
- children: /* @__PURE__ */ m("span", {
20
+ "aria-label": x,
21
+ "data-testid": `${u}-listbox`,
22
+ tabIndex: i ? 0 : void 0,
23
+ "aria-activedescendant": i && r !== null ? t(r) : void 0,
24
+ onKeyDown: c,
25
+ onFocus: w,
26
+ className: g("m-0 min-h-0 flex-1 list-none overflow-y-auto p-0", i && a.length > 0 && "outline-none", "[&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", b),
27
+ children: a.map((e, l) => /* @__PURE__ */ s(N, {
28
+ id: t(l),
29
+ selected: e.iso2 === o,
30
+ active: l === r,
31
+ onClick: () => p(e.iso2),
32
+ children: /* @__PURE__ */ f("span", {
26
33
  className: "flex w-full items-center justify-between gap-2",
27
- children: [/* @__PURE__ */ m("span", {
34
+ children: [/* @__PURE__ */ f("span", {
28
35
  className: "flex min-w-0 items-center gap-2",
29
- children: [h?.(e.iso2, "eager"), /* @__PURE__ */ s("span", {
36
+ children: [S?.(e.iso2, "eager"), /* @__PURE__ */ s("span", {
30
37
  className: "truncate",
31
38
  children: e.name
32
39
  })]
@@ -48,7 +48,8 @@ var ae = ({ dataTest: r, countries: y, value: s, onChange: O, disabled: c, selec
48
48
  label: g,
49
49
  renderFlag: x,
50
50
  onKeyDown: e ? z : void 0,
51
- onFocus: e && o.activeIndex === null ? () => o.openWithKeyboard(1) : void 0
51
+ onFocus: e && o.activeIndex === null ? () => o.openWithKeyboard(1) : void 0,
52
+ open: t
52
53
  }), S = {
53
54
  role: "combobox",
54
55
  "aria-activedescendant": o.activeIndex === null ? void 0 : o.optionId(o.activeIndex),
@@ -1,217 +1,219 @@
1
- import { cn as re } from "../../../helpers/cn.js";
1
+ import { cn as le } from "../../../helpers/cn.js";
2
2
  import { StyledCheckbox as Ne } from "../checkbox/base-ui/StyledCheckbox.js";
3
- import { StyledButton as K } from "../button/StyledButton.js";
3
+ import { StyledButton as B } from "../button/StyledButton.js";
4
4
  import { StyledSearchField as De } from "../search-field/StyledSearchField.js";
5
- import { useAnnouncer as $e } from "../full-screen-picker/PickerLiveRegion.js";
6
- import { nextActiveIndex as Se } from "./listboxCursor.js";
5
+ import { useAnnouncer as Se } from "../full-screen-picker/PickerLiveRegion.js";
6
+ import { nextActiveIndex as $e } from "./listboxCursor.js";
7
7
  import { FullScreenPicker as Ie } from "../full-screen-picker/FullScreenPicker.js";
8
- import { useEffect as ee, useMemo as _e, useRef as Me, useState as v } from "react";
9
- import { jsx as o, jsxs as b } from "react/jsx-runtime";
10
- var F = 50, Re = 500, le = "px-3 py-2 text-sm text-delta-600", te = "[&>div]:px-0";
11
- function Oe({ open: r, dataTest: t, listboxId: u, title: D, name: g, text: a, options: f, multiple: i, value: h, clearable: j, isEqual: x, isOptionDisabled: B, getLabel: E, getOptionKey: H, filterOptions: $, renderOptionRow: ne, optionRowClassName: W, loading: U, loadingText: oe, noOptionsText: ae, allowSelectAll: se, selectAllLabel: ce, onSelect: ie, onClear: de, onApply: ue, onCancel: fe }) {
12
- const [s, S] = v(""), [n, p] = v(null), [c, z] = v([]), [me, he] = v(!1), [pe, we] = v(!1), [ke, I, ye] = $e();
13
- r !== pe && (we(r), r && (S(""), p(null), z(Array.isArray(h) ? [...h] : []), he(!i && j && h !== null && !Array.isArray(h)), ye()));
14
- const _ = Me([]), O = i ? null : h, Q = (e) => i ? c.some((l) => x(e, l)) : O !== null && x(e, O), m = _e(() => {
8
+ import { useEffect as T, useMemo as _e, useRef as ee, useState as y } from "react";
9
+ import { jsx as n, jsxs as A } from "react/jsx-runtime";
10
+ var Me = 500, re = "px-3 py-2 text-sm text-delta-600", te = "[&>div]:px-0";
11
+ function ze({ open: l, dataTest: o, listboxId: u, title: N, name: v, text: a, options: f, multiple: d, value: m, clearable: H, isEqual: b, isOptionDisabled: K, getLabel: j, getOptionKey: E, filterOptions: D, renderOptionRow: ne, optionRowClassName: U, loading: S, loadingText: oe, noOptionsText: ae, allowSelectAll: ce, selectAllLabel: se, onSelect: ie, onClear: de, onApply: ue, onCancel: fe }) {
12
+ const [s, $] = y(""), [t, h] = y(null), [i, W] = y([]), [me, he] = y(!1), [pe, we] = y(!1), [ke, I, Ce] = Se();
13
+ l !== pe && (we(l), l && ($(""), h(null), W(Array.isArray(m) ? [...m] : []), he(!d && H && m !== null && !Array.isArray(m)), Ce()));
14
+ const _ = ee([]), z = d ? null : m, Q = (e) => d ? i.some((r) => b(e, r)) : z !== null && b(e, z), c = _e(() => {
15
15
  const e = [...f];
16
- if ($) return $(e, { inputValue: s });
17
- const l = s.trim().toLowerCase();
18
- return l ? e.filter((y) => E(y).toLowerCase().includes(l)) : e;
16
+ if (D) return D(e, { inputValue: s });
17
+ const r = s.trim().toLowerCase();
18
+ return r ? e.filter((k) => j(k).toLowerCase().includes(r)) : e;
19
19
  }, [
20
20
  f,
21
21
  s,
22
- $
23
- ]), d = m.slice(0, F), M = !!(se && i), w = M ? [-1, ...d.map((e, l) => l)] : d.map((e, l) => l), k = d.findIndex(Q), { noMatches: Y, matchCount: G } = a;
24
- ee(() => {
22
+ D
23
+ ]), M = !!(ce && d), p = M ? [-1, ...c.map((e, r) => r)] : c.map((e, r) => r), w = c.findIndex(Q), { noMatches: Y, matchCount: G } = a;
24
+ T(() => {
25
25
  if (s === "") return;
26
- const e = window.setTimeout(() => I(m.length === 0 ? Y : G(m.length)), Re);
26
+ const e = window.setTimeout(() => I(c.length === 0 ? Y : G(c.length)), Me);
27
27
  return () => window.clearTimeout(e);
28
28
  }, [
29
29
  I,
30
- m.length,
30
+ c.length,
31
31
  s,
32
32
  Y,
33
33
  G
34
- ]), ee(() => {
35
- r && k >= 0 && _.current[k]?.scrollIntoView({ block: "nearest" });
36
- }, [r]);
37
- const R = (e) => {
38
- p(e), e !== null && e >= 0 && _.current[e]?.scrollIntoView({ block: "nearest" });
39
- }, L = (e, l = a.selectedCount(e.length)) => {
40
- z(e), I(l);
41
- }, Ce = (e) => {
42
- L(c.some((l) => x(e, l)) ? c.filter((l) => !x(e, l)) : [...c, e]);
43
- }, A = f.length > 0 && c.length === f.length, J = () => L(A ? [] : [...f]), X = (e, l, y = !0) => {
44
- B(l) || (i ? Ce(l) : ie(e, l, y));
45
- }, P = (e, l) => {
46
- n === -1 ? J() : n !== null && d[n] !== void 0 && X(e, d[n], l);
47
- }, Z = (e) => {
48
- e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), R(Se(w, n, k, e.key === "ArrowDown" ? 1 : -1))) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), R(w[e.key === "Home" ? 0 : w.length - 1] ?? null)) : e.key === "Enter" ? (e.preventDefault(), P(e, !0)) : e.key === " " && s === "" && n !== null && (e.preventDefault(), P(e, !1));
34
+ ]);
35
+ const R = ee(!1);
36
+ T(() => {
37
+ if (!l) {
38
+ R.current = !1;
39
+ return;
40
+ }
41
+ R.current || S || (R.current = !0, w >= 0 && _.current[w]?.scrollIntoView({ block: "center" }));
42
+ }, [l, S]);
43
+ const L = (e) => {
44
+ h(e), e !== null && e >= 0 && _.current[e]?.scrollIntoView({ block: "nearest" });
45
+ }, V = (e, r = a.selectedCount(e.length)) => {
46
+ W(e), I(r);
47
+ }, ye = (e) => {
48
+ V(i.some((r) => b(e, r)) ? i.filter((r) => !b(e, r)) : [...i, e]);
49
+ }, g = f.length > 0 && i.length === f.length, J = () => V(g ? [] : [...f]), O = (e, r, k = !0) => {
50
+ K(r) || (d ? ye(r) : ie(e, r, k));
51
+ }, F = (e, r) => {
52
+ t === -1 ? J() : t !== null && c[t] !== void 0 && O(e, c[t], r);
53
+ }, X = (e) => {
54
+ e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), L($e(p, t, w, e.key === "ArrowDown" ? 1 : -1))) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), L(p[e.key === "Home" ? 0 : p.length - 1] ?? null)) : e.key === "Enter" ? (e.preventDefault(), F(e, !0)) : e.key === " " && s === "" && t !== null && (e.preventDefault(), F(e, !1));
49
55
  }, ve = (e) => {
50
56
  if (e.key !== " ") {
51
- Z(e);
57
+ X(e);
52
58
  return;
53
59
  }
54
- e.preventDefault(), P(e, !1);
60
+ e.preventDefault(), F(e, !1);
55
61
  }, be = () => {
56
- n === null && R(k >= 0 ? k : w[0] ?? null);
57
- }, q = (e) => `${t}-option-${e}`;
58
- let N;
59
- n === -1 && M ? N = `${t}-select-all` : n !== null && d[n] !== void 0 && (N = q(n));
60
- const ge = (e, l) => {
61
- const y = B(e), T = Q(e);
62
+ t === null && L(w >= 0 ? w : p[0] ?? null);
63
+ }, Z = (e) => `${o}-option-${e}`;
64
+ let x;
65
+ t === -1 && M ? x = `${o}-select-all` : t !== null && c[t] !== void 0 && (x = Z(t));
66
+ const ge = (e, r) => {
67
+ const k = K(e), q = Q(e);
62
68
  return ne({
63
- key: H ? String(H(e)) : `${E(e)}-${l}`,
69
+ key: E ? String(E(e)) : `${j(e)}-${r}`,
64
70
  ref: (C) => {
65
- _.current[l] = C;
71
+ _.current[r] = C;
66
72
  },
67
73
  role: "option",
68
- id: q(l),
69
- "aria-selected": T,
70
- "aria-disabled": y || void 0,
71
- "data-active": n === l ? "" : void 0,
72
- className: W,
74
+ id: Z(r),
75
+ "aria-selected": q,
76
+ "aria-disabled": k || void 0,
77
+ "data-active": t === r ? "" : void 0,
78
+ className: U,
73
79
  onMouseDown: (C) => C.preventDefault(),
74
- onClick: (C) => X(C, e),
75
- onMouseMove: () => p(null)
80
+ onClick: (C) => O(C, e),
81
+ onMouseMove: () => h(null)
76
82
  }, e, {
77
- selected: T,
78
- index: l,
83
+ selected: q,
84
+ index: r,
79
85
  inputValue: s,
80
86
  inPicker: !0
81
87
  });
82
- }, xe = r ? U ? /* @__PURE__ */ o("li", {
88
+ }, xe = l ? S ? /* @__PURE__ */ n("li", {
83
89
  role: "presentation",
84
- className: le,
90
+ className: re,
85
91
  children: oe
86
- }) : d.length === 0 ? /* @__PURE__ */ o("li", {
92
+ }) : c.length === 0 ? /* @__PURE__ */ n("li", {
87
93
  role: "presentation",
88
- className: le,
89
- "data-testid": `${t}-picker-empty`,
94
+ className: re,
95
+ "data-testid": `${o}-picker-empty`,
90
96
  children: s === "" ? ae : a.noMatches
91
- }) : d.map(ge) : null, Ae = /* @__PURE__ */ o(De, {
92
- dataTest: `${t}-picker-search`,
97
+ }) : c.map(ge) : null, Ae = /* @__PURE__ */ n(De, {
98
+ dataTest: `${o}-picker-search`,
93
99
  label: a.search,
94
100
  value: s,
95
101
  fullWidth: !0,
96
102
  onChange: (e) => {
97
- S(e.target.value), p(null);
103
+ $(e.target.value), h(null);
98
104
  },
99
105
  onClear: () => {
100
- S(""), p(null);
106
+ $(""), h(null);
101
107
  },
102
- onKeyDown: Z,
108
+ onKeyDown: X,
103
109
  autoComplete: "off",
104
110
  slotProps: { htmlInput: {
105
111
  role: "combobox",
106
112
  "aria-controls": u,
107
113
  "aria-expanded": !0,
108
- "aria-activedescendant": N,
114
+ "aria-activedescendant": x,
109
115
  "aria-autocomplete": "list"
110
116
  } }
111
117
  });
112
- let V;
113
- return i ? V = /* @__PURE__ */ o(Le, {
114
- dataTest: t,
115
- count: a.selectedCount(c.length),
116
- clearAllLabel: j ? a.clearAll : void 0,
117
- clearAllShown: c.length > 0,
118
+ let P;
119
+ return d ? P = /* @__PURE__ */ n(Re, {
120
+ dataTest: o,
121
+ count: a.selectedCount(i.length),
122
+ clearAllLabel: H ? a.clearAll : void 0,
123
+ clearAllShown: i.length > 0,
118
124
  doneLabel: a.done,
119
- onClearAll: () => L([], a.clearedAll),
120
- onDone: (e) => ue(e, c)
121
- }) : me && (V = /* @__PURE__ */ o(Pe, {
122
- dataTest: t,
125
+ onClearAll: () => V([], a.clearedAll),
126
+ onDone: (e) => ue(e, i)
127
+ }) : me && (P = /* @__PURE__ */ n(Le, {
128
+ dataTest: o,
123
129
  label: a.clearOne,
124
130
  onClear: de
125
- })), /* @__PURE__ */ b(Ie, {
126
- open: r,
131
+ })), /* @__PURE__ */ n(Ie, {
132
+ open: l,
127
133
  onClose: fe,
128
- dataTest: `${t}-picker`,
129
- title: D,
130
- fallbackName: g,
134
+ dataTest: `${o}-picker`,
135
+ title: N,
136
+ fallbackName: v,
131
137
  closeLabel: a.close,
132
138
  search: Ae,
133
- headerRow: V,
139
+ headerRow: P,
134
140
  announcement: ke,
135
- children: [/* @__PURE__ */ b("ul", {
141
+ children: /* @__PURE__ */ A("ul", {
136
142
  id: u,
137
143
  role: "listbox",
138
- "aria-label": g,
139
- "aria-multiselectable": i || void 0,
144
+ "aria-label": v,
145
+ "aria-multiselectable": d || void 0,
140
146
  tabIndex: 0,
141
- "aria-activedescendant": N,
147
+ "aria-activedescendant": x,
142
148
  onKeyDown: ve,
143
149
  onFocus: be,
144
- className: re("m-0 list-none p-0 [&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", w.length > 0 && "outline-none", "[&>li[role=option]]:pr-4 [&>li[role=option]]:text-delta-700", i ? "[&>li[aria-selected=true]:not(:hover)]:bg-white" : "[&>li[aria-selected=true]:not([aria-disabled=true])]:bg-gama-25 [&>li[role=option]]:gap-x-1 [&>li[role=option]]:pl-2"),
145
- children: [M && /* @__PURE__ */ b("li", {
146
- id: `${t}-select-all`,
150
+ className: le("m-0 list-none p-0 [&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", p.length > 0 && "outline-none", "[&>li[role=option]]:pr-4 [&>li[role=option]]:text-delta-700", d ? "[&>li[aria-selected=true]:not(:hover)]:bg-white" : "[&>li[aria-selected=true]:not([aria-disabled=true])]:bg-gama-25 [&>li[role=option]]:gap-x-1 [&>li[role=option]]:pl-2"),
151
+ children: [M && /* @__PURE__ */ A("li", {
152
+ id: `${o}-select-all`,
147
153
  role: "option",
148
- "aria-selected": A,
149
- "data-active": n === -1 ? "" : void 0,
154
+ "aria-selected": g,
155
+ "data-active": t === -1 ? "" : void 0,
150
156
  tabIndex: -1,
151
157
  onMouseDown: (e) => e.preventDefault(),
152
158
  onClick: J,
153
- className: W,
159
+ className: U,
154
160
  children: [
155
- n === -1 && /* @__PURE__ */ o("span", {
161
+ t === -1 && /* @__PURE__ */ n("span", {
156
162
  "aria-hidden": "true",
157
163
  className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
158
164
  }),
159
- /* @__PURE__ */ o(Ne, {
160
- dataTest: `${t}-picker-select-all`,
161
- checked: A,
162
- indeterminate: c.length > 0 && !A,
165
+ /* @__PURE__ */ n(Ne, {
166
+ dataTest: `${o}-picker-select-all`,
167
+ checked: g,
168
+ indeterminate: i.length > 0 && !g,
163
169
  size: "medium",
164
170
  checkboxClassName: "!h-4 !w-4",
165
171
  hideWrapper: !0,
166
172
  decorative: !0
167
173
  }),
168
- /* @__PURE__ */ o("span", {
174
+ /* @__PURE__ */ n("span", {
169
175
  className: "min-w-0 flex-1 break-words",
170
- children: ce
176
+ children: se
171
177
  })
172
178
  ]
173
179
  }), xe]
174
- }), !U && m.length > F && /* @__PURE__ */ o("p", {
175
- className: "m-0 px-3 py-2 text-sm text-delta-600",
176
- "data-testid": `${t}-picker-truncated`,
177
- children: a.truncated(F, m.length)
178
- })]
180
+ })
179
181
  });
180
182
  }
181
- var Le = ({ dataTest: r, count: t, clearAllLabel: u, clearAllShown: D, doneLabel: g, onClearAll: a, onDone: f }) => /* @__PURE__ */ b("div", {
182
- className: "flex items-center justify-between gap-6 px-4 py-2",
183
- "data-testid": `${r}-picker-selection-row`,
184
- children: [/* @__PURE__ */ b("div", {
185
- className: "flex min-w-0 flex-wrap items-center gap-x-1",
186
- children: [/* @__PURE__ */ o("span", {
183
+ var Re = ({ dataTest: l, count: o, clearAllLabel: u, clearAllShown: N, doneLabel: v, onClearAll: a, onDone: f }) => /* @__PURE__ */ A("div", {
184
+ className: "flex flex-wrap items-center gap-x-6 gap-y-2 px-4 py-2",
185
+ "data-testid": `${l}-picker-selection-row`,
186
+ children: [/* @__PURE__ */ A("div", {
187
+ className: "flex min-w-min flex-[1_1_0%] flex-wrap items-center gap-x-1",
188
+ children: [/* @__PURE__ */ n("span", {
187
189
  className: "text-base text-delta-600",
188
- "data-testid": `${r}-picker-count`,
189
- children: t
190
- }), u !== void 0 && /* @__PURE__ */ o(K, {
191
- dataTest: `${r}-picker-clear-all`,
190
+ "data-testid": `${l}-picker-count`,
191
+ children: o
192
+ }), u !== void 0 && /* @__PURE__ */ n(B, {
193
+ dataTest: `${l}-picker-clear-all`,
192
194
  variant: "text",
193
- className: re(te, !D && "invisible"),
195
+ className: le(te, !N && "invisible"),
194
196
  onClick: a,
195
197
  children: u
196
198
  })]
197
- }), /* @__PURE__ */ o(K, {
198
- dataTest: `${r}-picker-done`,
199
+ }), /* @__PURE__ */ n(B, {
200
+ dataTest: `${l}-picker-done`,
199
201
  variant: "contained",
200
- className: "shrink-0 whitespace-nowrap",
202
+ className: "ml-auto shrink-0 whitespace-nowrap",
201
203
  onClick: f,
202
- children: g
204
+ children: v
203
205
  })]
204
- }), Pe = ({ dataTest: r, label: t, onClear: u }) => /* @__PURE__ */ o("div", {
206
+ }), Le = ({ dataTest: l, label: o, onClear: u }) => /* @__PURE__ */ n("div", {
205
207
  className: "flex px-4 py-2",
206
- "data-testid": `${r}-picker-clear-row`,
207
- children: /* @__PURE__ */ o(K, {
208
- dataTest: `${r}-picker-clear`,
208
+ "data-testid": `${l}-picker-clear-row`,
209
+ children: /* @__PURE__ */ n(B, {
210
+ dataTest: `${l}-picker-clear`,
209
211
  variant: "text",
210
212
  className: te,
211
213
  onClick: u,
212
- children: t
214
+ children: o
213
215
  })
214
216
  });
215
217
  export {
216
- Oe as SelectAutocompletePicker
218
+ ze as SelectAutocompletePicker
217
219
  };