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.
@@ -1,146 +1,146 @@
1
1
  import { cn as D } from "../../../helpers/cn.js";
2
- import { TOP_LAYER_PROPS as xt, TOP_LAYER_RESET_STYLE as yt, getOpenModalDialogAncestor as kt, shouldUsePopoverTopLayer as vt, useTopLayerRef as wt } from "../../../hooks/useTopLayer.hook.js";
3
- import { ChevronDownIcon as Dt } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
4
- import { CloseIcon as It } from "../../icons/close-icon/CloseIcon.js";
5
- import { CheckIcon as Nt } from "../../icons/check-icon/CheckIcon.js";
6
- import { PlusIconCircle as Pt } from "../../icons/plus-icon-circle/PlusIconCircle.js";
2
+ import { TOP_LAYER_PROPS as kt, TOP_LAYER_RESET_STYLE as yt, getOpenModalDialogAncestor as vt, shouldUsePopoverTopLayer as wt, useTopLayerRef as Dt } from "../../../hooks/useTopLayer.hook.js";
3
+ import { ChevronDownIcon as It } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
4
+ import { CloseIcon as Nt } from "../../icons/close-icon/CloseIcon.js";
5
+ import { CheckIcon as Pt } from "../../icons/check-icon/CheckIcon.js";
6
+ import { PlusIconCircle as Ct } from "../../icons/plus-icon-circle/PlusIconCircle.js";
7
7
  import { StyledChip as At } from "../../data-display/chip/StyledChip.js";
8
8
  import { StyledCheckbox as ve } from "../checkbox/base-ui/StyledCheckbox.js";
9
- import { useFullScreenPickerMediaQuery as Ct } from "../../../hooks/useMediaQuery.hook.js";
10
- import { useBackCloses as St } from "../../../hooks/useBackCloses.hook.js";
11
- import { fieldWidthStyle as Rt } from "../field-styles.js";
12
- import { LoadingIcon as Mt } from "../../../table/shared-components/LoadingIcon.js";
13
- import { PickerLiveRegion as $t, useAnnouncer as _t } from "../full-screen-picker/PickerLiveRegion.js";
14
- import { getPickerText as Ft } from "../full-screen-picker/pickerCopy.js";
15
- import { readFieldName as Lt } from "./readFieldName.js";
16
- import { getDraftChanges as Et } from "./draftChanges.js";
17
- import { nextActiveIndex as Wt } from "./listboxCursor.js";
18
- import { SelectAutocompletePicker as jt } from "./SelectAutocompletePicker.js";
9
+ import { useFullScreenPickerMediaQuery as St } from "../../../hooks/useMediaQuery.hook.js";
10
+ import { useBackCloses as Rt } from "../../../hooks/useBackCloses.hook.js";
11
+ import { fieldWidthStyle as Mt } from "../field-styles.js";
12
+ import { LoadingIcon as $t } from "../../../table/shared-components/LoadingIcon.js";
13
+ import { PickerLiveRegion as Ft, useAnnouncer as _t } from "../full-screen-picker/PickerLiveRegion.js";
14
+ import { getPickerText as Lt } from "../full-screen-picker/pickerCopy.js";
15
+ import { readFieldName as Et } from "./readFieldName.js";
16
+ import { getDraftChanges as Wt } from "./draftChanges.js";
17
+ import { nextActiveIndex as jt } from "./listboxCursor.js";
18
+ import { SelectAutocompletePicker as zt } from "./SelectAutocompletePicker.js";
19
19
  import J from "./StyledSelectAutocomplete.module.js";
20
20
  import { useEffect as we, useMemo as X, useRef as De, useState as I } from "react";
21
- import { Fragment as zt, jsx as o, jsxs as N } from "react/jsx-runtime";
22
- import { FloatingPortal as Ht, autoUpdate as Bt, flip as Ut, offset as Vt, shift as Ot, size as Yt, useDismiss as qt, useFloating as Qt, useInteractions as Tt, useMergeRefs as Ie, useRole as Gt } from "@floating-ui/react";
23
- var Jt = (l) => typeof l == "object" && l !== null && "label" in l ? String(l.label) : String(l), Xt = (l) => typeof l == "object" && l !== null && "disabled" in l && !!l.disabled;
24
- function vl({ dataTest: l, options: h, renderInput: Ne, value: $, onChange: P, getOptionLabel: Pe, getOptionKey: A, isOptionEqualToValue: Z, renderOption: j, renderValue: K, filterOptions: _, loading: z, loadingText: ee = "Loading…", noOptionsText: te = "No options", disabled: F, readOnly: b, error: Ae, helperText: Ce, size: Se = "small", rowSize: Re = "compact", disableClearable: le, disableCloseOnSelect: Me, popupIcon: $e, autoHeight: _e, multiple: Fe, allowSelectAll: C, selectAllLabel: re = "Select all", width: oe = "full", fullWidth: Zt, classes: Le, inputValue: L, onInputChange: Ee, open: se, onOpen: We, onClose: je, className: ze, wrapperClassName: He, getOptionDisabled: Be, slotProps: ne, pickerTitle: H, pickerText: Ue, locale: Ve = "en", disableFullScreenPicker: Oe }) {
25
- const r = Fe === !0, k = Ct() && !Oe, [ae, Ye] = I({
21
+ import { Fragment as Bt, jsx as o, jsxs as N } from "react/jsx-runtime";
22
+ import { FloatingPortal as Ht, autoUpdate as Ut, flip as Vt, offset as Ot, shift as Yt, size as qt, useDismiss as Tt, useFloating as Qt, useInteractions as Gt, useMergeRefs as Ie, useRole as Jt } from "@floating-ui/react";
23
+ var Xt = (r) => typeof r == "object" && r !== null && "label" in r ? String(r.label) : String(r), Zt = (r) => typeof r == "object" && r !== null && "disabled" in r && !!r.disabled;
24
+ function wr({ dataTest: r, options: b, renderInput: Ne, value: F, onChange: P, getOptionLabel: Pe, getOptionKey: C, isOptionEqualToValue: Z, renderOption: z, renderValue: K, filterOptions: _, loading: B, loadingText: ee = "Loading…", noOptionsText: te = "No options", disabled: A, readOnly: p, error: Ce, helperText: Ae, size: Se = "small", rowSize: Re = "compact", disableClearable: re, disableCloseOnSelect: Me, popupIcon: $e, autoHeight: Fe, multiple: _e, allowSelectAll: S, selectAllLabel: le = "Select all", width: oe = "full", fullWidth: Kt, classes: Le, inputValue: L, onInputChange: Ee, open: ne, onOpen: We, onClose: je, className: ze, wrapperClassName: Be, getOptionDisabled: He, slotProps: se, pickerTitle: H, pickerText: Ue, locale: Ve = "en", disableFullScreenPicker: Oe }) {
25
+ const l = _e === !0, y = St() && !Oe, [ae, Ye] = I({
26
26
  label: "",
27
27
  name: ""
28
- }), [qe, Qe] = _t(), B = Ft(Ve, Ue), d = Pe ?? Jt, v = (e, t) => Z ? Z(e, t) : e === t, [Te, Ge] = I(!1), s = se ?? Te, i = (e) => {
29
- e && (b || F) || (se === void 0 && Ge(e), e && Ye(Lt(V.current)), e ? We?.() : (y(null), je?.()));
30
- }, [Je, ie] = I(""), g = L ?? Je, S = (e, t, a) => {
28
+ }), [qe, Te] = _t(), U = Lt(Ve, Ue), d = Pe ?? Xt, v = (e, t) => Z ? Z(e, t) : e === t, [Qe, Ge] = I(!1), n = ne ?? Qe, i = (e) => {
29
+ e && (p || A) || (ne === void 0 && Ge(e), e && Ye(Et(E.current)), e ? We?.() : (k(null), je?.()));
30
+ }, [Je, ie] = I(""), g = L ?? Je, R = (e, t, a) => {
31
31
  L === void 0 && ie(t), Ee?.(e, t, a);
32
- }, [n, y] = I(null), U = `${l}-listbox`, ce = De([]), V = De(null), [Xe, Ze] = I(null), [de, Ke] = I(null), c = r ? Array.isArray($) ? $ : [] : [], x = r ? null : $ ?? null, ue = !r && x !== null ? d(x) : "";
32
+ }, [s, k] = I(null), V = `${r}-listbox`, ce = De([]), E = De(null), [Xe, Ze] = I(null), [de, Ke] = I(null), c = l ? Array.isArray(F) ? F : [] : [], x = l ? null : F ?? null, ue = !l && x !== null ? d(x) : "";
33
33
  we(() => {
34
- L !== void 0 || r || ie(ue);
34
+ L !== void 0 || l || ie(ue);
35
35
  }, [
36
36
  L,
37
- r,
37
+ l,
38
38
  ue
39
39
  ]);
40
- const O = (e) => r ? c.some((t) => v(e, t)) : x !== null && v(e, x), R = (e) => Be?.(e) ?? Xt(e), pe = X(() => {
41
- const e = [...h];
40
+ const O = (e) => l ? c.some((t) => v(e, t)) : x !== null && v(e, x), M = (e) => He?.(e) ?? Zt(e), fe = X(() => {
41
+ const e = [...b];
42
42
  if (_) return _(e, { inputValue: g });
43
- const t = !r && x !== null ? d(x).toLowerCase() : null;
43
+ const t = !l && x !== null ? d(x).toLowerCase() : null;
44
44
  if (!g || g.toLowerCase() === t) return e;
45
45
  const a = g.toLowerCase();
46
46
  return e.filter((u) => d(u).toLowerCase().includes(a));
47
47
  }, [
48
- h,
48
+ b,
49
49
  g,
50
50
  _,
51
- $
52
- ]), p = X(() => pe.slice(0, 100), [pe]), fe = p.flatMap((e, t) => R(e) ? [] : [t]), Y = C && r ? [-1, ...fe] : fe, me = p.map((e, t) => t), E = C && r ? [-1, ...me] : me, M = p.findIndex(O);
51
+ F
52
+ ]), f = X(() => fe.slice(0, 100), [fe]), pe = f.flatMap((e, t) => M(e) ? [] : [t]), Y = S && l ? [-1, ...pe] : pe, me = f.map((e, t) => t), W = S && l ? [-1, ...me] : me, $ = f.findIndex(O);
53
53
  we(() => {
54
- if (!s) return;
55
- const e = n ?? M;
54
+ if (!n) return;
55
+ const e = s ?? $;
56
56
  if (e < 0) return;
57
57
  const t = requestAnimationFrame(() => ce.current[e]?.scrollIntoView({ block: "nearest" }));
58
58
  return () => cancelAnimationFrame(t);
59
59
  }, [
60
- n,
61
60
  s,
61
+ n,
62
62
  de,
63
- M
63
+ $
64
64
  ]);
65
- const { refs: W, floatingStyles: et, context: he } = Qt({
66
- open: s,
65
+ const { refs: j, floatingStyles: et, context: he } = Qt({
66
+ open: n,
67
67
  onOpenChange: i,
68
68
  placement: "bottom-start",
69
69
  strategy: "fixed",
70
- whileElementsMounted: Bt,
70
+ whileElementsMounted: Ut,
71
71
  middleware: [
72
- Vt(0),
73
- Ut({ padding: 8 }),
74
- Ot({ padding: 8 }),
75
- Yt({ apply({ rects: e, availableHeight: t }) {
76
- Ze(e.reference.width), Ke(_e ? t - 8 : Math.min(t - 8, 320));
72
+ Ot(0),
73
+ Vt({ padding: 8 }),
74
+ Yt({ padding: 8 }),
75
+ qt({ apply({ rects: e, availableHeight: t }) {
76
+ Ze(e.reference.width), Ke(Fe ? t - 8 : Math.min(t - 8, 320));
77
77
  } })
78
78
  ]
79
- }), { getReferenceProps: tt, getFloatingProps: lt, getItemProps: rt } = Tt([qt(he, { enabled: !k }), Gt(he, { role: "listbox" })]);
80
- St({
81
- active: s && !k,
79
+ }), { getReferenceProps: tt, getFloatingProps: rt, getItemProps: lt } = Gt([Tt(he, { enabled: !y }), Jt(he, { role: "listbox" })]);
80
+ Rt({
81
+ active: n && !y,
82
82
  requestClose: () => i(!1)
83
83
  });
84
- const ot = Ie([W.setReference]), be = X(() => s ? kt(W.reference.current) : void 0, [s, W]), q = vt(be), st = Ie([wt(W.setFloating, q)]), nt = (e) => Y.includes(M) ? M : Y[e === 1 ? 0 : Y.length - 1] ?? null, at = (e) => {
85
- E.length !== 0 && y((t) => Wt(E, t, M, e));
86
- }, w = (e, t, a = !r || !Me) => {
87
- if (r) {
88
- const u = c.some((m) => v(t, m)), f = u ? c.filter((m) => !v(t, m)) : [...c, t];
89
- P?.(e, f, u ? "removeOption" : "selectOption", { option: t }), S(e, "", "reset"), a && i(!1);
84
+ const ot = Ie([j.setReference]), be = X(() => n ? vt(j.reference.current) : void 0, [n, j]), q = wt(be), nt = Ie([Dt(j.setFloating, q)]), st = (e) => Y.includes($) ? $ : Y[e === 1 ? 0 : Y.length - 1] ?? null, at = (e) => {
85
+ W.length !== 0 && k((t) => jt(W, t, $, e));
86
+ }, w = (e, t, a = !l || !Me) => {
87
+ if (l) {
88
+ const u = c.some((h) => v(t, h)), m = u ? c.filter((h) => !v(t, h)) : [...c, t];
89
+ P?.(e, m, u ? "removeOption" : "selectOption", { option: t }), R(e, "", "reset"), a && i(!1);
90
90
  } else
91
- P?.(e, t, "selectOption", { option: t }), S(e, d(t), "reset"), a && i(!1);
92
- }, Q = (e) => {
93
- P?.(e, r ? [] : null, "clear", void 0), S(e, "", "clear");
91
+ P?.(e, t, "selectOption", { option: t }), R(e, d(t), "reset"), a && i(!1);
92
+ }, T = (e) => {
93
+ P?.(e, l ? [] : null, "clear", void 0), R(e, "", "clear");
94
94
  }, it = (e) => {
95
- Q(e), i(!1), Qe(B.cleared);
95
+ T(e), i(!1), Te(U.cleared);
96
96
  }, ct = (e, t) => {
97
- for (const { value: a, reason: u, option: f } of Et(c, t, v)) P?.(e, a, u, f === void 0 ? void 0 : { option: f });
98
- S(e, "", "reset"), i(!1);
99
- }, T = (e) => {
100
- const t = h.length > 0 && c.length === h.length;
101
- P?.(e, t ? [] : h, t ? "clear" : "selectOption", void 0);
97
+ for (const { value: a, reason: u, option: m } of Wt(c, t, v)) P?.(e, a, u, m === void 0 ? void 0 : { option: m });
98
+ R(e, "", "reset"), i(!1);
99
+ }, Q = (e) => {
100
+ const t = b.length > 0 && c.length === b.length;
101
+ P?.(e, t ? [] : b, t ? "clear" : "selectOption", void 0);
102
102
  }, dt = (e) => {
103
103
  if (e.key === "Backspace" && g === "" && ge) {
104
104
  const t = c[c.length - 1];
105
- r ? t !== void 0 && w(e, t, !1) : Q(e);
106
- } else if (e.key === "Enter" && !s)
105
+ l ? t !== void 0 && w(e, t, !1) : T(e);
106
+ } else if (e.key === "Enter" && !n)
107
107
  e.preventDefault(), i(!0);
108
- else if (e.key === "Enter" && n === -1)
109
- e.preventDefault(), T(e);
110
- else if (e.key === "Enter" && n != null && p[n] != null) {
108
+ else if (e.key === "Enter" && s === -1)
109
+ e.preventDefault(), Q(e);
110
+ else if (e.key === "Enter" && s != null && f[s] != null) {
111
111
  e.preventDefault();
112
- const t = p[n];
113
- R(t) || w(e, t, !0);
112
+ const t = f[s];
113
+ M(t) || w(e, t, !0);
114
114
  } else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
115
- if (e.preventDefault(), !s) {
116
- y(nt(e.key === "ArrowDown" ? 1 : -1)), i(!0);
115
+ if (e.preventDefault(), !n) {
116
+ k(st(e.key === "ArrowDown" ? 1 : -1)), i(!0);
117
117
  return;
118
118
  }
119
119
  at(e.key === "ArrowDown" ? 1 : -1);
120
120
  } else if (e.key === "Home" || e.key === "End")
121
- e.preventDefault(), y(E[e.key === "Home" ? 0 : E.length - 1] ?? null);
122
- else if (e.key === " " && n === -1)
123
- e.preventDefault(), T(e);
124
- else if (e.key === " " && n != null && p[n] != null) {
121
+ e.preventDefault(), k(W[e.key === "Home" ? 0 : W.length - 1] ?? null);
122
+ else if (e.key === " " && s === -1)
123
+ e.preventDefault(), Q(e);
124
+ else if (e.key === " " && s != null && f[s] != null) {
125
125
  e.preventDefault();
126
- const t = p[n];
127
- R(t) || w(e, t, !1);
128
- } else e.key === "Escape" && s ? (e.preventDefault(), e.stopPropagation(), i(!1)) : e.key === "Tab" && i(!1);
129
- }, ge = !le && !b && !F && (r ? c.length > 0 : x !== null);
126
+ const t = f[s];
127
+ M(t) || w(e, t, !1);
128
+ } else e.key === "Escape" && n ? (e.preventDefault(), e.stopPropagation(), i(!1)) : e.key === "Tab" && i(!1);
129
+ }, ge = !re && !p && !A && (l ? c.length > 0 : x !== null);
130
130
  let xe;
131
- s && n != null && (n === -1 || p[n] !== void 0) && (xe = n === -1 ? `${l}-select-all` : `${l}-option-${n}`);
131
+ n && s != null && (s === -1 || f[s] !== void 0) && (xe = s === -1 ? `${r}-select-all` : `${r}-option-${s}`);
132
132
  const ut = (e) => {
133
- e.preventDefault(), !(F || b) && (V.current?.focus(), i(!s));
134
- }, pt = r ? K ? K(c, ({ index: e }) => ({ "data-index": e })) : c.map((e, t) => /* @__PURE__ */ o(At, {
133
+ e.preventDefault(), !(A || p) && (E.current?.focus(), i(!n));
134
+ }, ft = l ? K ? K(c, ({ index: e }) => ({ "data-index": e })) : c.map((e, t) => /* @__PURE__ */ o(At, {
135
135
  dataTest: `selected-chip-${d(e)}`,
136
136
  label: d(e),
137
- readOnly: b,
137
+ readOnly: p,
138
138
  deleteButtonTabIndex: -1,
139
- onDelete: b ? void 0 : (a) => w(a, e)
140
- }, A ? A(e) : `${d(e)}-${t}`)) : void 0, ft = /* @__PURE__ */ N("span", {
139
+ onDelete: p ? void 0 : (a) => w(a, e)
140
+ }, C ? C(e) : `${d(e)}-${t}`)) : void 0, pt = /* @__PURE__ */ N("span", {
141
141
  className: "flex items-center gap-1",
142
142
  children: [
143
- z && /* @__PURE__ */ o(Mt, {
143
+ B && /* @__PURE__ */ o($t, {
144
144
  width: 20,
145
145
  height: 20,
146
146
  className: "animate-spin"
@@ -149,81 +149,86 @@ function vl({ dataTest: l, options: h, renderInput: Ne, value: $, onChange: P, g
149
149
  type: "button",
150
150
  tabIndex: -1,
151
151
  "aria-label": "Clear",
152
- "data-testid": `${l}-clear`,
152
+ "data-testid": `${r}-clear`,
153
153
  className: "invisible flex min-h-6 min-w-6 cursor-pointer items-center justify-center rounded-full border-0 bg-delta-50 group-focus-within:visible",
154
154
  onMouseDown: (e) => e.preventDefault(),
155
- onClick: Q,
156
- children: /* @__PURE__ */ o(It, {
155
+ onClick: T,
156
+ children: /* @__PURE__ */ o(Nt, {
157
157
  width: 20,
158
158
  height: 20,
159
159
  className: "text-delta-700"
160
160
  })
161
161
  }),
162
- b ? null : /* @__PURE__ */ o("button", {
162
+ p ? null : /* @__PURE__ */ o("button", {
163
163
  type: "button",
164
164
  tabIndex: -1,
165
165
  "aria-label": "Toggle options",
166
- "aria-expanded": s,
167
- "data-testid": `${l}-popup-indicator`,
166
+ "aria-expanded": n,
167
+ "data-testid": `${r}-popup-indicator`,
168
168
  className: "flex cursor-pointer items-center border-0 bg-transparent",
169
169
  onMouseDown: (e) => e.preventDefault(),
170
170
  onClick: ut,
171
- children: $e ?? (r ? /* @__PURE__ */ o(Pt, {
171
+ children: $e ?? (l ? /* @__PURE__ */ o(Ct, {
172
172
  width: 24,
173
173
  height: 24,
174
174
  className: "text-delta-700"
175
- }) : /* @__PURE__ */ o(Dt, {
175
+ }) : /* @__PURE__ */ o(It, {
176
176
  width: 24,
177
177
  height: 24,
178
- className: D(J["select-custom-icon"], s && J["select-custom-icon-open"], "text-delta-700")
178
+ className: D(J["select-custom-icon"], n && J["select-custom-icon-open"], "text-delta-700")
179
179
  }))
180
180
  })
181
181
  ]
182
- }), mt = {
183
- disabled: F,
182
+ }), mt = (e) => {
183
+ if (A || p || !(e.target instanceof Element)) return;
184
+ const t = e.target.closest('button, a, [role="button"], [data-chip]');
185
+ t && e.currentTarget.contains(t) || (E.current?.focus(), i(!0));
186
+ }, ht = {
187
+ disabled: A,
184
188
  size: Se,
185
189
  fullWidth: !0,
186
- error: Ae,
187
- helperText: Ce,
190
+ error: Ce,
191
+ helperText: Ae,
188
192
  value: g,
189
193
  onChange: (e) => {
190
- k || (y(null), S(e, e.target.value, "input"), s || i(!0));
194
+ y || (k(null), R(e, e.target.value, "input"), n || i(!0));
191
195
  },
192
196
  onKeyDown: dt,
193
197
  slotProps: {
194
198
  htmlInput: {
195
199
  ...tt(),
196
- ref: V,
200
+ ref: E,
197
201
  onClick: () => i(!0),
198
202
  role: "combobox",
199
203
  "aria-autocomplete": "list",
200
- "aria-expanded": s,
201
- "aria-controls": s ? U : void 0,
204
+ "aria-expanded": n,
205
+ "aria-controls": n ? V : void 0,
202
206
  "aria-activedescendant": xe,
203
207
  autoComplete: "off",
204
- readOnly: b,
205
- ...k ? {
208
+ readOnly: p,
209
+ ...y ? {
206
210
  inputMode: "none",
207
211
  "aria-haspopup": "dialog"
208
212
  } : {}
209
213
  },
210
214
  input: {
211
215
  ref: ot,
212
- startAdornment: pt,
213
- endAdornment: ft
216
+ startAdornment: ft,
217
+ endAdornment: pt,
218
+ onClick: mt
214
219
  }
215
220
  }
216
- }, ye = D("asma-pressable", "relative box-border flex cursor-pointer items-center gap-x-3 px-3 py-2 text-base text-delta-800", Re === "regular" ? "min-h-12" : "min-h-10", "aria-selected:bg-gama-50 hover:bg-delta-50", "aria-disabled:cursor-default aria-disabled:!bg-transparent aria-disabled:text-delta-300"), ke = (e, t, a) => {
217
- const { key: u, ...f } = e;
221
+ }, ke = D("asma-pressable", "relative box-border flex cursor-pointer items-center gap-x-3 px-3 py-2 text-base text-delta-800", Re === "regular" ? "min-h-12" : "min-h-10", "aria-selected:bg-gama-50 hover:bg-delta-50", "aria-disabled:cursor-default aria-disabled:!bg-transparent aria-disabled:text-delta-300"), ye = (e, t, a) => {
222
+ const { key: u, ...m } = e;
218
223
  return /* @__PURE__ */ N("li", {
219
- ...f,
224
+ ...m,
220
225
  children: [
221
226
  e["data-active"] !== void 0 && /* @__PURE__ */ o("span", {
222
227
  "aria-hidden": "true",
223
228
  className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
224
229
  }),
225
- r ? /* @__PURE__ */ o(ve, {
226
- dataTest: `${l}-${d(t)}-checkbox`,
230
+ l ? /* @__PURE__ */ o(ve, {
231
+ dataTest: `${r}-${d(t)}-checkbox`,
227
232
  checked: a.selected,
228
233
  size: "medium",
229
234
  checkboxClassName: "!h-4 !w-4",
@@ -231,7 +236,7 @@ function vl({ dataTest: l, options: h, renderInput: Ne, value: $, onChange: P, g
231
236
  decorative: !0
232
237
  }) : /* @__PURE__ */ o("span", {
233
238
  className: D("w-5", a.inPicker && "flex"),
234
- children: a.selected && /* @__PURE__ */ o(Nt, {
239
+ children: a.selected && /* @__PURE__ */ o(Pt, {
235
240
  width: 20,
236
241
  height: 20,
237
242
  className: "text-gama-500"
@@ -243,106 +248,106 @@ function vl({ dataTest: l, options: h, renderInput: Ne, value: $, onChange: P, g
243
248
  })
244
249
  ]
245
250
  }, u);
246
- }, ht = (e, t) => {
247
- const a = R(e), u = {
248
- ...rt({
249
- onMouseDown: (m) => m.preventDefault(),
250
- onClick: (m) => {
251
- a || w(m, e);
251
+ }, bt = (e, t) => {
252
+ const a = M(e), u = {
253
+ ...lt({
254
+ onMouseDown: (h) => h.preventDefault(),
255
+ onClick: (h) => {
256
+ a || w(h, e);
252
257
  },
253
- onMouseMove: () => y(null)
258
+ onMouseMove: () => k(null)
254
259
  }),
255
- key: A ? String(A(e)) : `${d(e)}-${t}`,
256
- ref: (m) => {
257
- ce.current[t] = m;
260
+ key: C ? String(C(e)) : `${d(e)}-${t}`,
261
+ ref: (h) => {
262
+ ce.current[t] = h;
258
263
  },
259
264
  role: "option",
260
- id: `${l}-option-${t}`,
265
+ id: `${r}-option-${t}`,
261
266
  "aria-selected": O(e),
262
267
  "aria-disabled": a || void 0,
263
- "data-active": n === t ? "" : void 0,
264
- className: ye
265
- }, f = {
268
+ "data-active": s === t ? "" : void 0,
269
+ className: ke
270
+ }, m = {
266
271
  selected: O(e),
267
272
  index: t,
268
273
  inputValue: g
269
274
  };
270
- return j ? j(u, e, f) : ke(u, e, f);
271
- }, bt = !!(C && r), G = h.length > 0 && c.length === h.length, gt = c.length > 0 && !G;
275
+ return z ? z(u, e, m) : ye(u, e, m);
276
+ }, gt = !!(S && l), G = b.length > 0 && c.length === b.length, xt = c.length > 0 && !G;
272
277
  return /* @__PURE__ */ N("div", {
273
- className: D(J.styledSelectAutocompleteWrapper, He, ze),
278
+ className: D(J.styledSelectAutocompleteWrapper, Be, ze),
274
279
  "data-field-width": oe,
275
- style: Rt(oe),
280
+ style: Mt(oe),
276
281
  children: [
277
- Ne(mt),
278
- k && /* @__PURE__ */ N(zt, { children: [/* @__PURE__ */ o($t, {
282
+ Ne(ht),
283
+ y && /* @__PURE__ */ N(Bt, { children: [/* @__PURE__ */ o(Ft, {
279
284
  announcement: qe,
280
- dataTest: `${l}-live`
281
- }), /* @__PURE__ */ o(jt, {
282
- open: s,
283
- dataTest: l,
284
- listboxId: U,
285
+ dataTest: `${r}-live`
286
+ }), /* @__PURE__ */ o(zt, {
287
+ open: n,
288
+ dataTest: r,
289
+ listboxId: V,
285
290
  title: H ?? (ae.label || void 0),
286
- name: typeof H == "string" ? H : ae.name || B.search,
287
- text: B,
288
- options: h,
289
- multiple: r,
290
- value: r ? c : x,
291
- clearable: !le && !b,
291
+ name: typeof H == "string" ? H : ae.name || U.search,
292
+ text: U,
293
+ options: b,
294
+ multiple: l,
295
+ value: l ? c : x,
296
+ clearable: !re && !p,
292
297
  isEqual: v,
293
- isOptionDisabled: R,
298
+ isOptionDisabled: M,
294
299
  getLabel: d,
295
- getOptionKey: A,
300
+ getOptionKey: C,
296
301
  filterOptions: _,
297
- renderOptionRow: j ?? ke,
298
- optionRowClassName: ye,
299
- loading: z,
302
+ renderOptionRow: z ?? ye,
303
+ optionRowClassName: ke,
304
+ loading: B,
300
305
  loadingText: ee,
301
306
  noOptionsText: te,
302
- allowSelectAll: C,
303
- selectAllLabel: re,
307
+ allowSelectAll: S,
308
+ selectAllLabel: le,
304
309
  onSelect: w,
305
310
  onClear: it,
306
311
  onApply: ct,
307
312
  onCancel: () => i(!1)
308
313
  })] }),
309
- s && !k && /* @__PURE__ */ o(Ht, {
314
+ n && !y && /* @__PURE__ */ o(Ht, {
310
315
  root: be,
311
316
  children: /* @__PURE__ */ N("ul", {
312
- ref: st,
313
- ...q ? xt : {},
317
+ ref: nt,
318
+ ...q ? kt : {},
314
319
  style: {
315
320
  ...q ? yt : {},
316
321
  ...et,
317
322
  width: Xe ?? void 0,
318
323
  maxHeight: de ?? void 0,
319
324
  fontFamily: "Roboto, Helvetica, Arial, sans-serif",
320
- ...ne?.popper?.style
325
+ ...se?.popper?.style
321
326
  },
322
- ...lt(),
323
- id: U,
327
+ ...rt(),
328
+ id: V,
324
329
  role: "listbox",
325
- "aria-multiselectable": r ? !0 : void 0,
326
- className: D("z-[1300] m-0 list-none overflow-auto rounded border border-solid border-delta-300 bg-white px-0 py-2 shadow-[0px_2px_4px_0px_rgba(34,33,51,0.15)]", bt && "py-0", "[&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", Le?.listbox, ne?.popper?.className),
327
- children: [C && r && /* @__PURE__ */ N("li", {
328
- id: `${l}-select-all`,
330
+ "aria-multiselectable": l ? !0 : void 0,
331
+ className: D("z-[1300] m-0 list-none overflow-auto rounded border border-solid border-delta-300 bg-white px-0 py-2 shadow-[0px_2px_4px_0px_rgba(34,33,51,0.15)]", gt && "py-0", "[&>li:not(:last-child)]:shadow-[inset_0_-1px_0_var(--colors-delta-200)]", Le?.listbox, se?.popper?.className),
332
+ children: [S && l && /* @__PURE__ */ N("li", {
333
+ id: `${r}-select-all`,
329
334
  role: "option",
330
335
  "aria-selected": G,
331
- "data-active": n === -1 ? "" : void 0,
336
+ "data-active": s === -1 ? "" : void 0,
332
337
  tabIndex: -1,
333
338
  onMouseDown: (e) => e.preventDefault(),
334
- onClick: T,
335
- onMouseMove: () => y(null),
339
+ onClick: Q,
340
+ onMouseMove: () => k(null),
336
341
  className: "relative box-border flex h-8 cursor-pointer items-center gap-x-3 bg-[var(--colors-gray-10)] px-3 text-xs font-semibold uppercase tracking-[0.2px] text-delta-600 hover:bg-delta-50",
337
342
  children: [
338
- n === -1 && /* @__PURE__ */ o("span", {
343
+ s === -1 && /* @__PURE__ */ o("span", {
339
344
  "aria-hidden": "true",
340
345
  className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
341
346
  }),
342
347
  /* @__PURE__ */ o(ve, {
343
- dataTest: `${l}-select-all`,
348
+ dataTest: `${r}-select-all`,
344
349
  checked: G,
345
- indeterminate: gt,
350
+ indeterminate: xt,
346
351
  size: "medium",
347
352
  checkboxClassName: "!h-4 !w-4",
348
353
  hideWrapper: !0,
@@ -350,23 +355,23 @@ function vl({ dataTest: l, options: h, renderInput: Ne, value: $, onChange: P, g
350
355
  }),
351
356
  /* @__PURE__ */ o("span", {
352
357
  className: "flex-1 truncate",
353
- children: re
358
+ children: le
354
359
  })
355
360
  ]
356
- }), z ? /* @__PURE__ */ o("li", {
361
+ }), B ? /* @__PURE__ */ o("li", {
357
362
  role: "presentation",
358
363
  className: "px-3 py-2 text-sm text-delta-600",
359
364
  children: ee
360
- }) : p.length === 0 ? /* @__PURE__ */ o("li", {
365
+ }) : f.length === 0 ? /* @__PURE__ */ o("li", {
361
366
  role: "presentation",
362
367
  className: "px-3 py-2 text-sm text-delta-600",
363
368
  children: te
364
- }) : p.map(ht)]
369
+ }) : f.map(bt)]
365
370
  })
366
371
  })
367
372
  ]
368
373
  });
369
374
  }
370
375
  export {
371
- vl as StyledSelectAutocomplete
376
+ wr as StyledSelectAutocomplete
372
377
  };
@@ -1,12 +1,12 @@
1
1
  import { useSyncExternalStore as o } from "react";
2
- function r(t) {
2
+ function e(t) {
3
3
  function i() {
4
4
  return window.matchMedia(t).matches;
5
5
  }
6
- function a(e) {
6
+ function a(r) {
7
7
  const n = window.matchMedia(t);
8
- return n.addEventListener("change", e), () => {
9
- n.removeEventListener("change", e);
8
+ return n.addEventListener("change", r), () => {
9
+ n.removeEventListener("change", r);
10
10
  };
11
11
  }
12
12
  function u() {
@@ -16,9 +16,10 @@ function r(t) {
16
16
  return o(a, i, u);
17
17
  };
18
18
  }
19
- var h = r("(max-width: 743px)"), c = r("(max-height: 480px)"), d = r("(max-width: 743px), (max-height: 480px)");
19
+ var h = e("(max-width: 743px)"), s = e("(max-height: 480px)"), c = e("(max-height: 480px) and (min-width: 480px)"), m = e("(max-width: 743px), (max-height: 480px)");
20
20
  export {
21
- d as useFullScreenPickerMediaQuery,
21
+ m as useFullScreenPickerMediaQuery,
22
22
  h as useMobileMediaQuery,
23
- c as useShortViewportMediaQuery
23
+ c as usePickerOneRowHeaderMediaQuery,
24
+ s as useShortViewportMediaQuery
24
25
  };
@@ -28,7 +28,8 @@ export interface FullScreenPickerProps {
28
28
  * search, optional selection/clear row; 1 px `border/separator` delta-200 under it) and one scrolling
29
29
  * **List**. Title = Mobile/Page title, SemiBold 20/28, `text-icon/title-label` delta-800, wraps.
30
30
  * Close = 40 × 40 Quaternary button with a 24 px ×. Search row = `pt-8 px-16`. On a short viewport
31
- * (`Variant2`, ≤ 480 px high) title, search (max 240 px) and close share the first row.
31
+ * (`Variant2`, ≤ 480 px high and ≥ 480 px wide — a phone in landscape, not an upright phone whose
32
+ * keyboard is up) title, search (max 240 px) and close share the first row.
32
33
  *
33
34
  * The shared shell for every full-screen picker in ui-core: `StyledSelectAutocomplete` and
34
35
  * `CountryCodeSelect` both render through it (ASMA-8468). Presentation only — the caller owns the
@@ -23,7 +23,6 @@ export interface PickerText {
23
23
  cleared: string;
24
24
  /** Announced after `clearAll`. */
25
25
  clearedAll: string;
26
- truncated: (shown: number, total: number) => string;
27
26
  }
28
27
  /** Default picker copy for `locale`, with any consumer overrides applied on top. */
29
28
  export declare const getPickerText: (locale: UiCoreLocale, overrides?: Partial<PickerText>) => PickerText;
@@ -20,9 +20,11 @@ export interface CountryCodeOptionsProps {
20
20
  onKeyDown?: (event: KeyboardEvent<HTMLElement>) => void;
21
21
  /** Tabbing into the list: put the active-row marker on a row. */
22
22
  onFocus?: () => void;
23
+ /** The list is showing: each opening starts at the chosen country (LIST-10, AC 17). */
24
+ open?: boolean;
23
25
  }
24
26
  /**
25
27
  * The country listbox. Presentation only — filtering, the active row and the keyboard live in
26
28
  * [[useCountryPicker]], so the desktop trigger and the mobile sheet render the same list.
27
29
  */
28
- export declare const CountryCodeOptions: ({ dataTest, visible, selectedIso2, activeIndex, optionId, onSelect, listId, label, renderFlag, className, onKeyDown, onFocus, }: CountryCodeOptionsProps) => JSX.Element;
30
+ export declare const CountryCodeOptions: ({ dataTest, visible, selectedIso2, activeIndex, optionId, onSelect, listId, label, renderFlag, className, onKeyDown, onFocus, open, }: CountryCodeOptionsProps) => JSX.Element;
@@ -29,6 +29,7 @@ export interface AutocompleteRenderInputParams {
29
29
  ref: React.Ref<HTMLDivElement>;
30
30
  startAdornment?: ReactNode;
31
31
  endAdornment?: ReactNode;
32
+ onClick?: (event: React.MouseEvent<HTMLElement>) => void;
32
33
  };
33
34
  };
34
35
  }