asma-ui-core 3.86.1 → 3.87.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.
Files changed (50) hide show
  1. package/dist/asma-ui-core.css +1 -1
  2. package/dist/components/custom/pathfinder-card/PathfinderCard.js +28 -28
  3. package/dist/components/data-display/chip/StyledChip.js +33 -32
  4. package/dist/components/data-display/tooltip/StyledTooltip.js +76 -47
  5. package/dist/components/feedback/dialog/StyledDialog.js +62 -58
  6. package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +113 -105
  7. package/dist/components/feedback/minimizable-dialog/components/FullscreenBtn.js +10 -12
  8. package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +75 -67
  9. package/dist/components/feedback/snack-bar/StyledSnackbar.js +12 -10
  10. package/dist/components/feedback/snack-bar/components/StyledInfoSnackbar.js +10 -10
  11. package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +69 -71
  12. package/dist/components/inputs/input-field/StyledInputField.js +25 -24
  13. package/dist/components/inputs/phone-field/CountryCodeOptions.js +16 -15
  14. package/dist/components/inputs/phone-field/CountryCodeSelect.js +98 -85
  15. package/dist/components/inputs/phone-field/useCountryPicker.js +44 -24
  16. package/dist/components/inputs/search-field/StyledSearchField.js +10 -10
  17. package/dist/components/inputs/select/StyledSelect.js +16 -15
  18. package/dist/components/inputs/select/StyledSelectItem.js +9 -9
  19. package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +202 -175
  20. package/dist/components/inputs/switch/base-ui/StyledSwitch.js +22 -22
  21. package/dist/components/navigation/link/StyledLink.js +8 -8
  22. package/dist/components/navigation/listbox/Listbox.js +105 -54
  23. package/dist/components/navigation/menu/StyledMenu.js +22 -18
  24. package/dist/components/navigation/menu/StyledMenuItem.js +6 -6
  25. package/dist/components/navigation/title-chevron/StyledTitleChevron.js +7 -7
  26. package/dist/components/utils/accordion/base-ui/StyledAccordionDetails.js +26 -22
  27. package/dist/components/utils/accordion/base-ui/StyledAccordionSummary.js +14 -14
  28. package/dist/components/utils/copy-wrapper/CopyWrapper.module.js +2 -2
  29. package/dist/components/utils/popover/StyledPopover.js +102 -52
  30. package/dist/datetime/components/date-picker/StyledDatePicker.js +40 -34
  31. package/dist/datetime/components/date-picker/components/StyledCalendarPicker.js +5 -4
  32. package/dist/datetime/components/time-picker/StyledTimePicker.js +69 -56
  33. package/dist/helpers/focusable.js +5 -0
  34. package/dist/hooks/useFocusTrap.hook.js +24 -19
  35. package/dist/src/components/data-display/chip/StyledChip.d.ts +2 -0
  36. package/dist/src/components/inputs/dynamic-select/StyledDynamicSelect.d.ts +3 -4
  37. package/dist/src/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.test.d.ts +1 -0
  38. package/dist/src/components/inputs/phone-field/CountryCodeOptions.d.ts +1 -1
  39. package/dist/src/components/inputs/phone-field/useCountryPicker.d.ts +5 -2
  40. package/dist/src/components/navigation/listbox/Listbox.d.ts +3 -2
  41. package/dist/src/components/navigation/menu/StyledMenu.d.ts +3 -2
  42. package/dist/src/components/utils/accordion/base-ui/StyledAccordionDetails.d.ts +2 -1
  43. package/dist/src/components/utils/popover/StyledPopover.d.ts +9 -2
  44. package/dist/src/helpers/focusable.d.ts +8 -0
  45. package/dist/src/hooks/useFocusTrap.hook.d.ts +2 -1
  46. package/dist/table/components/columns/action-column/components/RowActionMenu.js +30 -34
  47. package/dist/table/components/table-footer/TablePagination.js +18 -17
  48. package/dist/table/components/table-footer/TableRowCountSelect.js +5 -4
  49. package/package.json +1 -1
  50. package/src/styles/touchHardening.interaction.test.tsx +269 -0
@@ -1,143 +1,156 @@
1
- import { cn as m } from "../../../helpers/cn.js";
2
- import { ChevronDownIcon as E } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
3
- import { useMobileMediaQuery as Q } from "../../../hooks/useMediaQuery.hook.js";
4
- import { StyledDialog as q } from "../../feedback/dialog/StyledDialog.js";
5
- import { StyledPopover as A } from "../../utils/popover/StyledPopover.js";
6
- import { notchedOutlineClass as F } from "../field-styles.js";
1
+ import { cn as f } from "../../../helpers/cn.js";
2
+ import { ChevronDownIcon as $ } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
3
+ import { useMobileMediaQuery as j } from "../../../hooks/useMediaQuery.hook.js";
4
+ import { StyledDialog as z } from "../../feedback/dialog/StyledDialog.js";
5
+ import { StyledPopover as Q } from "../../utils/popover/StyledPopover.js";
6
+ import { notchedOutlineClass as U } from "../field-styles.js";
7
7
  import { StyledSearchField as W } from "../search-field/StyledSearchField.js";
8
- import { CountryCodeOptions as B } from "./CountryCodeOptions.js";
8
+ import { CountryCodeOptions as q } from "./CountryCodeOptions.js";
9
9
  import { useCountryPicker as G } from "./useCountryPicker.js";
10
- import { useEffect as K, useId as H, useRef as h, useState as x } from "react";
11
- import { Fragment as J, jsx as e, jsxs as s } from "react/jsx-runtime";
12
- var re = ({ dataTest: r, countries: b, value: n, onChange: O, disabled: i, selectCountryLabel: g, searchPlaceholder: P, renderFlag: u, labelledBy: v, className: M }) => {
13
- const [t, w] = x(!1), [f, c] = x(""), [R, j] = x(null), y = h(null), C = h(null), I = h(!1), d = Q(), p = `${H()}-country-listbox`, N = b.find((a) => a.iso2 === n), k = N === void 0 ? "" : `+${N.dialCode}`, l = () => {
14
- w(!1), c("");
15
- }, D = (a) => {
16
- O(a), l();
17
- }, o = G({
18
- countries: b,
19
- selectedIso2: n,
20
- query: f,
21
- listId: p,
22
- onSelect: D,
23
- onDismiss: l
10
+ import { useEffect as K, useId as H, useRef as b, useState as m } from "react";
11
+ import { Fragment as J, jsx as n, jsxs as i } from "react/jsx-runtime";
12
+ var re = ({ dataTest: r, countries: g, value: s, onChange: A, disabled: c, selectCountryLabel: w, searchPlaceholder: E, renderFlag: h, labelledBy: F, className: O }) => {
13
+ const [t, d] = m(!1), [P, u] = m(!1), [x, a] = m(""), [B, M] = m(null), y = b(null), v = b(null), C = b(!1), p = j(), l = `${H()}-country-listbox`, I = g.find((o) => o.iso2 === s), k = I === void 0 ? "" : `+${I.dialCode}`, e = G({
14
+ countries: g,
15
+ selectedIso2: s,
16
+ query: x,
17
+ listId: l,
18
+ onSelect: (o, R = !0) => {
19
+ A(o), R && (d(!1), a(""));
20
+ },
21
+ onDismiss: () => {
22
+ d(!1), a("");
23
+ }
24
24
  });
25
25
  K(() => {
26
- t && !d && y.current?.focus();
27
- }, [t, d]), K(() => {
28
- I.current && !t && C.current?.focus(), I.current = t;
26
+ t && !p && y.current?.focus();
27
+ }, [t, p]), K(() => {
28
+ C.current && !t && v.current?.focus(), C.current = t;
29
29
  }, [t]);
30
- const S = /* @__PURE__ */ e(B, {
30
+ const N = /* @__PURE__ */ n(q, {
31
31
  dataTest: r,
32
- visible: o.visible,
33
- selectedIso2: n,
34
- activeIndex: o.activeIndex,
35
- optionId: o.optionId,
36
- onSelect: D,
37
- listId: p,
38
- label: g,
39
- renderFlag: u
40
- }), $ = {
32
+ visible: e.visible,
33
+ selectedIso2: s,
34
+ activeIndex: e.activeIndex,
35
+ optionId: e.optionId,
36
+ onSelect: e.select,
37
+ listId: l,
38
+ label: w,
39
+ renderFlag: h
40
+ }), D = {
41
41
  role: "combobox",
42
- "aria-activedescendant": o.visible.length > 0 ? o.optionId(o.activeIndex) : void 0,
42
+ "aria-activedescendant": e.activeIndex === null ? void 0 : e.optionId(e.activeIndex),
43
43
  "aria-autocomplete": "list",
44
- "aria-controls": p,
44
+ "aria-controls": l,
45
45
  "aria-expanded": !0
46
- }, z = t && !d;
47
- return /* @__PURE__ */ s(J, { children: [/* @__PURE__ */ s("div", {
48
- ref: j,
46
+ }, S = t && !p;
47
+ return /* @__PURE__ */ i(J, { children: [/* @__PURE__ */ i("div", {
48
+ ref: M,
49
49
  "data-testid": `${r}-shell`,
50
50
  style: { height: 40 },
51
- className: m("group relative flex w-32 shrink-0 items-center gap-1.5 rounded px-3 text-base", i ? "cursor-not-allowed text-delta-300" : "text-delta-800"),
52
- children: [/* @__PURE__ */ e("span", {
51
+ className: f("group relative flex w-32 shrink-0 items-center gap-1.5 rounded px-3 text-base", c ? "cursor-not-allowed text-delta-300" : "text-delta-800"),
52
+ children: [/* @__PURE__ */ n("span", {
53
53
  "aria-hidden": "true",
54
- className: m(F({
55
- disabled: i,
54
+ className: f(U({
55
+ focused: P || S,
56
+ disabled: c,
56
57
  notched: !1
57
- }), M)
58
- }), z ? /* @__PURE__ */ s("span", {
58
+ }), O)
59
+ }), S ? /* @__PURE__ */ i("span", {
59
60
  className: "relative z-[1] flex w-full items-center gap-1.5",
60
61
  children: [
61
- u?.(n, "eager"),
62
- /* @__PURE__ */ e("input", {
62
+ h?.(s, "eager"),
63
+ /* @__PURE__ */ n("input", {
63
64
  ref: y,
64
65
  role: "combobox",
65
66
  "data-testid": `${r}-search`,
66
67
  className: "w-12 min-w-0 border-0 bg-transparent p-0 text-base outline-none",
67
- value: f,
68
+ value: x,
68
69
  placeholder: k,
69
- onChange: (a) => c(a.target.value),
70
- onKeyDown: o.handleKeyDown,
71
- "aria-controls": p,
70
+ onChange: (o) => a(o.target.value),
71
+ onKeyDown: e.handleKeyDown,
72
+ "aria-controls": l,
72
73
  "aria-expanded": !0,
73
- "aria-activedescendant": $["aria-activedescendant"],
74
- "aria-autocomplete": "list"
74
+ "aria-activedescendant": D["aria-activedescendant"],
75
+ "aria-autocomplete": "list",
76
+ "aria-haspopup": "listbox",
77
+ onFocus: () => u(!0),
78
+ onBlur: () => u(!1)
75
79
  }),
76
- /* @__PURE__ */ e("button", {
80
+ /* @__PURE__ */ n("button", {
77
81
  type: "button",
78
82
  "data-testid": `${r}-collapse`,
79
- "aria-labelledby": v,
83
+ tabIndex: -1,
84
+ "aria-hidden": "true",
80
85
  "aria-expanded": !0,
81
- onClick: l,
82
- className: "ml-auto flex shrink-0 cursor-pointer border-0 bg-transparent p-0",
83
- children: /* @__PURE__ */ e(E, {
86
+ onClick: e.dismiss,
87
+ className: "ml-auto flex shrink-0 cursor-pointer border-0 bg-transparent p-0 outline-none focus:shadow-none focus:outline-none focus:ring-0",
88
+ children: /* @__PURE__ */ n($, {
84
89
  width: 20,
85
90
  height: 20,
86
91
  className: "flip-180"
87
92
  })
88
93
  })
89
94
  ]
90
- }) : /* @__PURE__ */ s("button", {
91
- ref: C,
95
+ }) : /* @__PURE__ */ i("button", {
96
+ ref: v,
92
97
  type: "button",
93
98
  "data-testid": r,
94
- disabled: i,
99
+ disabled: c,
95
100
  "aria-haspopup": "listbox",
96
101
  "aria-expanded": t,
97
- "aria-labelledby": v,
98
- onClick: () => w(!0),
99
- className: m("relative z-[1] flex w-full items-center gap-1.5 border-0 bg-transparent p-0 text-base", i ? "cursor-not-allowed text-delta-300" : "cursor-pointer text-delta-800"),
102
+ "aria-controls": t ? l : void 0,
103
+ "aria-labelledby": F,
104
+ role: "combobox",
105
+ onClick: () => d(!0),
106
+ onKeyDown: (o) => {
107
+ o.key !== "ArrowDown" && o.key !== "ArrowUp" || (o.preventDefault(), e.openWithKeyboard(o.key === "ArrowUp" ? -1 : 1), d(!0));
108
+ },
109
+ onFocus: () => u(!0),
110
+ onBlur: () => u(!1),
111
+ className: f("relative z-[1] flex w-full items-center gap-1.5 border-0 bg-transparent p-0 text-base outline-none focus:shadow-none focus:outline-none focus:ring-0", c ? "cursor-not-allowed text-delta-300" : "cursor-pointer text-delta-800"),
100
112
  children: [
101
- u?.(n, "eager"),
102
- /* @__PURE__ */ e("span", {
113
+ h?.(s, "eager"),
114
+ /* @__PURE__ */ n("span", {
103
115
  className: "w-12 text-left",
104
116
  children: k
105
117
  }),
106
- /* @__PURE__ */ e(E, {
118
+ /* @__PURE__ */ n($, {
107
119
  width: 20,
108
120
  height: 20,
109
- className: m("ml-auto shrink-0 transition-transform", t && "flip-180")
121
+ className: f("ml-auto shrink-0 transition-transform", t && "flip-180")
110
122
  })
111
123
  ]
112
124
  })]
113
- }), d ? /* @__PURE__ */ e(q, {
125
+ }), p ? /* @__PURE__ */ n(z, {
114
126
  open: t,
115
- onClose: l,
127
+ onClose: e.dismiss,
116
128
  dataTest: `${r}-dialog`,
117
- dialogTitle: g,
129
+ dialogTitle: w,
118
130
  showCloseIcon: !0,
119
131
  fullWidth: !0,
120
- children: /* @__PURE__ */ s("div", {
132
+ children: /* @__PURE__ */ i("div", {
121
133
  className: "flex min-h-0 flex-1 flex-col",
122
- children: [/* @__PURE__ */ e("div", {
134
+ children: [/* @__PURE__ */ n("div", {
123
135
  className: "shrink-0 p-4",
124
- children: /* @__PURE__ */ e(W, {
136
+ children: /* @__PURE__ */ n(W, {
125
137
  dataTest: `${r}-search`,
126
- label: P,
127
- value: f,
128
- onChange: (a) => c(a.target.value),
129
- onClear: () => c(""),
130
- onKeyDown: o.handleKeyDown,
131
- slotProps: { htmlInput: $ }
138
+ label: E,
139
+ value: x,
140
+ onChange: (o) => a(o.target.value),
141
+ onClear: () => a(""),
142
+ onKeyDown: e.handleKeyDown,
143
+ slotProps: { htmlInput: D }
132
144
  })
133
- }), S]
145
+ }), N]
134
146
  })
135
- }) : /* @__PURE__ */ e(A, {
147
+ }) : /* @__PURE__ */ n(Q, {
136
148
  open: t,
137
- anchorEl: R,
138
- onClose: l,
149
+ anchorEl: B,
150
+ onClose: e.dismiss,
151
+ tabIntoContent: !1,
139
152
  slotProps: { paper: { className: "flex max-h-80 w-80 flex-col overflow-hidden" } },
140
- children: S
153
+ children: N
141
154
  })] });
142
155
  };
143
156
  export {
@@ -1,48 +1,68 @@
1
- import { useMemo as m, useState as v } from "react";
2
- function D(r, i) {
3
- const n = i.trim();
4
- if (n.length === 0) return !0;
5
- const s = n.replace(/^\+/, "").replace(/\D/g, "");
6
- return s.length === 0 && !new RegExp("\\p{L}", "u").test(n) || r.name.toLocaleLowerCase().includes(n.toLocaleLowerCase()) ? !0 : s.length > 0 && r.dialCode.startsWith(s);
1
+ import { useMemo as m, useState as D } from "react";
2
+ function w(a, c) {
3
+ const o = c.trim();
4
+ if (o.length === 0) return !0;
5
+ const r = o.replace(/^\+/, "").replace(/\D/g, "");
6
+ return r.length === 0 && !new RegExp("\\p{L}", "u").test(o) || a.name.toLocaleLowerCase().includes(o.toLocaleLowerCase()) ? !0 : r.length > 0 && a.dialCode.startsWith(r);
7
7
  }
8
- function b({ countries: r, selectedIso2: i, query: n, listId: s, onSelect: f, onDismiss: d }) {
9
- const [p, a] = v(i), o = m(() => r.filter((e) => D(e, n)), [r, n]), l = o.findIndex((e) => e.iso2 === p), c = l >= 0 ? l : 0, h = (e) => `${s}-option-${e}`, u = (e) => {
10
- if (o.length === 0) return;
11
- const t = o[(c + e + o.length) % o.length];
12
- t !== void 0 && a(t.iso2);
8
+ function C({ countries: a, selectedIso2: c, query: o, listId: r, onSelect: v, onDismiss: b }) {
9
+ const [p, s] = D(null), n = m(() => a.filter((e) => w(e, o)), [a, o]), i = p === null || n.length === 0 ? null : Math.max(n.findIndex((e) => e.iso2 === p), 0), k = (e) => `${r}-option-${e}`, g = (e) => {
10
+ const t = e === 1 ? n[0] : n[n.length - 1], l = n.find((d) => d.iso2 === c) ?? t;
11
+ l !== void 0 && s(l.iso2);
12
+ }, h = (e) => {
13
+ if (n.length === 0) return;
14
+ const t = n.findIndex((d) => d.iso2 === c), l = n[((i ?? (t >= 0 ? t : e === 1 ? -1 : 0)) + e + n.length) % n.length];
15
+ l !== void 0 && s(l.iso2);
16
+ }, u = (e, t = !0) => {
17
+ t && s(null), v(e, t);
18
+ }, f = () => {
19
+ s(null), b();
13
20
  };
14
21
  return {
15
- visible: o,
16
- activeIndex: c,
17
- optionId: h,
22
+ visible: n,
23
+ activeIndex: i,
24
+ optionId: k,
25
+ openWithKeyboard: g,
26
+ select: u,
27
+ dismiss: f,
18
28
  handleKeyDown: (e) => {
19
29
  switch (e.key) {
20
30
  case "ArrowDown":
21
- e.preventDefault(), u(1);
31
+ e.preventDefault(), h(1);
22
32
  break;
23
33
  case "ArrowUp":
24
- e.preventDefault(), u(-1);
34
+ e.preventDefault(), h(-1);
25
35
  break;
26
36
  case "Home": {
27
37
  e.preventDefault();
28
- const t = o[0];
29
- t !== void 0 && a(t.iso2);
38
+ const t = n[0];
39
+ t !== void 0 && s(t.iso2);
30
40
  break;
31
41
  }
32
42
  case "End": {
33
43
  e.preventDefault();
34
- const t = o[o.length - 1];
35
- t !== void 0 && a(t.iso2);
44
+ const t = n[n.length - 1];
45
+ t !== void 0 && s(t.iso2);
46
+ break;
47
+ }
48
+ case " ": {
49
+ if (o !== "") break;
50
+ e.preventDefault();
51
+ const t = i === null ? void 0 : n[i];
52
+ t !== void 0 && u(t.iso2, !1);
36
53
  break;
37
54
  }
38
55
  case "Enter": {
39
56
  e.preventDefault();
40
- const t = o[c];
41
- t !== void 0 && f(t.iso2);
57
+ const t = i === null ? void 0 : n[i];
58
+ t !== void 0 && u(t.iso2);
42
59
  break;
43
60
  }
44
61
  case "Escape":
45
- e.preventDefault(), d();
62
+ e.preventDefault(), f();
63
+ break;
64
+ case "Tab":
65
+ f();
46
66
  break;
47
67
  default:
48
68
  break;
@@ -51,5 +71,5 @@ function b({ countries: r, selectedIso2: i, query: n, listId: s, onSelect: f, on
51
71
  };
52
72
  }
53
73
  export {
54
- b as useCountryPicker
74
+ C as useCountryPicker
55
75
  };
@@ -4,8 +4,8 @@ import { CloseIcon as f } from "../../icons/close-icon/CloseIcon.js";
4
4
  import { StyledInputField as v } from "../input-field/StyledInputField.js";
5
5
  import { useState as y } from "react";
6
6
  import { jsx as t } from "react/jsx-runtime";
7
- var F = ({ value: r, onClear: d, label: a, onFocus: c, onBlur: h, slotProps: o, ...n }) => {
8
- const [m, l] = y(!1), i = m || r, s = typeof a == "string" ? a : void 0;
7
+ var F = ({ value: r, onClear: d, label: i, onFocus: c, onBlur: h, slotProps: o, ...a }) => {
8
+ const [m, l] = y(!1), n = m || r, s = typeof i == "string" ? i : void 0;
9
9
  return /* @__PURE__ */ t("div", {
10
10
  className: "relative w-full",
11
11
  children: /* @__PURE__ */ t(v, {
@@ -13,8 +13,8 @@ var F = ({ value: r, onClear: d, label: a, onFocus: c, onBlur: h, slotProps: o,
13
13
  variant: "outlined",
14
14
  value: r,
15
15
  reserveHelperText: !1,
16
- label: i ? a : void 0,
17
- placeholder: i ? void 0 : s,
16
+ label: n ? i : void 0,
17
+ placeholder: n ? void 0 : s,
18
18
  onFocus: (e) => {
19
19
  l(!0), c?.(e);
20
20
  },
@@ -24,7 +24,7 @@ var F = ({ value: r, onClear: d, label: a, onFocus: c, onBlur: h, slotProps: o,
24
24
  slotProps: {
25
25
  ...o,
26
26
  htmlInput: {
27
- "aria-label": i ? void 0 : s,
27
+ "aria-label": n ? void 0 : s,
28
28
  ...o?.htmlInput,
29
29
  style: {
30
30
  overflow: "hidden",
@@ -39,7 +39,7 @@ var F = ({ value: r, onClear: d, label: a, onFocus: c, onBlur: h, slotProps: o,
39
39
  type: "button",
40
40
  "aria-label": "Clear",
41
41
  "data-testid": "styled-search-clear-icon",
42
- className: p("cursor-pointer rounded-full border-0 bg-delta-50", "flex items-center justify-center", "transform-gpu transition-all duration-300 ease-in-out", r ? "scale-100 opacity-100" : "pointer-events-none scale-75 opacity-0", n.readOnly && "-translate-x-[6.5px]"),
42
+ className: p("asma-pressable", "cursor-pointer rounded-full border-0 bg-delta-50", "flex items-center justify-center", "transform-gpu transition-all duration-300 ease-in-out", r ? "scale-100 opacity-100" : "pointer-events-none scale-75 opacity-0", a.readOnly && "-translate-x-[6.5px]"),
43
43
  style: {
44
44
  width: 24,
45
45
  height: 24,
@@ -55,7 +55,7 @@ var F = ({ value: r, onClear: d, label: a, onFocus: c, onBlur: h, slotProps: o,
55
55
  className: "pointer-events-none"
56
56
  })
57
57
  }) : null,
58
- startAdornment: i ? void 0 : /* @__PURE__ */ t("span", {
58
+ startAdornment: n ? void 0 : /* @__PURE__ */ t("span", {
59
59
  "data-testid": "styled-search-icon",
60
60
  className: "flex items-center",
61
61
  children: /* @__PURE__ */ t(u, {
@@ -68,10 +68,10 @@ var F = ({ value: r, onClear: d, label: a, onFocus: c, onBlur: h, slotProps: o,
68
68
  ...o?.input
69
69
  }
70
70
  },
71
- ...n,
71
+ ...a,
72
72
  sx: {
73
- width: n.fullWidth ? "100%" : "var(--dynamic-toolbar-search-width, 160px)",
74
- ...n.sx
73
+ width: a.fullWidth ? "100%" : "var(--dynamic-toolbar-search-width, 160px)",
74
+ ...a.sx
75
75
  }
76
76
  })
77
77
  });
@@ -8,11 +8,11 @@ import { useHelperRowBudget as Ge } from "../../../helpers/useHelperRowBudget.js
8
8
  import { useHelperSlot as Je } from "../../../helpers/useHelperSlot.js";
9
9
  import { outlineClass as Qe } from "../field-styles.js";
10
10
  import { useFormControlContext as Xe } from "../../miscellaneous/FormControlContext.js";
11
- import { Children as se, cloneElement as Ze, isValidElement as u, useEffect as B, useId as et, useRef as tt, useState as x } from "react";
11
+ import { Children as se, cloneElement as Ze, isValidElement as f, useEffect as B, useId as et, useRef as tt, useState as x } from "react";
12
12
  import { jsx as l, jsxs as L } from "react/jsx-runtime";
13
13
  import { FloatingPortal as ot, autoUpdate as rt, flip as st, offset as nt, shift as lt, size as it, useClick as at, useDismiss as ct, useFloating as dt, useInteractions as ut, useMergeRefs as ft, useRole as pt } from "@floating-ui/react";
14
- var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, errorText: ie, helperText: j, reserveHelperText: ae, expandHelperText: ce = !0, allowClear: U, disabled: de, readOnly: c, name: w, placeholder: S, displayEmpty: C, multiple: f, renderValue: V, fullWidth: ue, className: fe, style: pe, sx: me, variant: be, children: q, MenuProps: ge, onFocus: he, onBlur: ye, labelId: v }) => {
15
- const d = Xe(), A = `${T}-listbox`, R = be === "standard", p = le ?? d?.error ?? !1, n = de ?? d?.disabled ?? !1, Y = p ? ie ?? j : j, { show: F, role: xe } = Je("StyledSelect", p, Y, ae, c), z = et(), { fieldRef: we, rowRef: ve, rowStyle: Ae } = Ge(ce && F), [r, K] = x(!1), [k, I] = x(!1), [m, b] = x(null), [Re, W] = x(ne), O = M !== void 0, o = O ? M : Re, i = Array.isArray(o) ? o.length > 0 : o !== void 0 && o !== "" && o !== null, g = se.toArray(q), G = (e) => f ? Array.isArray(o) && o.includes(e) : e === o, s = g.flatMap((e, t) => u(e) && !e.props.disabled ? [t] : []), E = g.findIndex((e) => u(e) && G(e.props.value)), ke = (e = 1) => s.includes(E) ? E : s[e === 1 ? 0 : s.length - 1] ?? null, D = m === null ? void 0 : `${A}-option-${m}`, P = tt(null), h = (e) => {
14
+ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, errorText: ie, helperText: j, reserveHelperText: ae, expandHelperText: ce = !0, allowClear: U, disabled: de, readOnly: c, name: w, placeholder: S, displayEmpty: C, multiple: d, renderValue: V, fullWidth: ue, className: fe, style: pe, sx: me, variant: be, children: q, MenuProps: ge, onFocus: he, onBlur: ye, labelId: v }) => {
15
+ const u = Xe(), A = `${T}-listbox`, R = be === "standard", p = le ?? u?.error ?? !1, n = de ?? u?.disabled ?? !1, Y = p ? ie ?? j : j, { show: F, role: xe } = Je("StyledSelect", p, Y, ae, c), z = et(), { fieldRef: we, rowRef: ve, rowStyle: Ae } = Ge(ce && F), [r, K] = x(!1), [k, I] = x(!1), [m, b] = x(null), [Re, W] = x(ne), O = M !== void 0, o = O ? M : Re, i = Array.isArray(o) ? o.length > 0 : o !== void 0 && o !== "" && o !== null, g = se.toArray(q), G = (e) => d ? Array.isArray(o) && o.includes(e) : e === o, s = g.flatMap((e, t) => f(e) && !e.props.disabled ? [t] : []), E = g.findIndex((e) => f(e) && G(e.props.value)), ke = (e = 1) => s.includes(E) ? E : s[e === 1 ? 0 : s.length - 1] ?? null, D = m === null ? void 0 : `${A}-option-${m}`, P = tt(null), h = (e) => {
16
16
  K(e), e || b(null);
17
17
  }, { refs: { domReference: De, reference: J, setFloating: Se, setReference: Ce }, floatingStyles: Fe, context: N } = dt({
18
18
  open: r,
@@ -33,15 +33,15 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
33
33
  ct(N),
34
34
  pt(N, { role: "listbox" })
35
35
  ]), [Q, X] = x(), _ = ze(Q), Ee = ft([Ke(Se, _), P]);
36
- B(() => d?.setFocused(r || k), [
36
+ B(() => u?.setFocused(r || k), [
37
37
  r,
38
38
  k,
39
- d
40
- ]), B(() => d?.setFilled(i || !!S || !!C), [
39
+ u
40
+ ]), B(() => u?.setFilled(i || !!S || !!C), [
41
41
  i,
42
42
  S,
43
43
  C,
44
- d
44
+ u
45
45
  ]), B(() => {
46
46
  if (!r) return;
47
47
  const e = requestAnimationFrame(() => {
@@ -50,20 +50,20 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
50
50
  });
51
51
  return () => cancelAnimationFrame(e);
52
52
  }, [D, r]);
53
- const Z = (e, t, a = !f) => {
54
- const oe = f ? Array.isArray(o) && o.includes(e) ? o.filter(($e) => $e !== e) : [...Array.isArray(o) ? o : [], e] : e;
53
+ const Z = (e, t, a = !d) => {
54
+ const oe = d ? Array.isArray(o) && o.includes(e) ? o.filter(($e) => $e !== e) : [...Array.isArray(o) ? o : [], e] : e;
55
55
  O || W(oe), $?.({ target: {
56
56
  value: oe,
57
57
  name: w
58
58
  } }, t), a && (h(!1), requestAnimationFrame(() => De.current?.focus()));
59
59
  }, ee = () => {
60
- const e = f ? [] : "";
60
+ const e = d ? [] : "";
61
61
  O || W(e), $?.({ target: {
62
62
  value: e,
63
63
  name: w
64
64
  } }, null), h(!1), I(!1);
65
65
  }, Pe = se.map(q, (e, t) => {
66
- if (!u(e)) return e;
66
+ if (!f(e)) return e;
67
67
  const a = e.props.value;
68
68
  return Ze(e, {
69
69
  id: `${A}-option-${t}`,
@@ -73,7 +73,7 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
73
73
  b(null), Z(a, e.props.children);
74
74
  }
75
75
  });
76
- }), Ne = g.find((e) => u(e) && e.props.value === o), _e = V ? V(o) : f && Array.isArray(o) ? g.filter((e) => u(e) && o.includes(e.props.value)).map((e) => {
76
+ }), Ne = g.find((e) => f(e) && e.props.value === o), _e = V ? V(o) : d && Array.isArray(o) ? g.filter((e) => f(e) && o.includes(e.props.value)).map((e) => {
77
77
  const t = e.props.children;
78
78
  return typeof t == "string" || typeof t == "number" ? String(t) : "";
79
79
  }).join(", ") : Ne?.props.children, He = (e) => {
@@ -83,7 +83,7 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
83
83
  });
84
84
  }, te = (e) => {
85
85
  const t = m === null ? void 0 : g[m];
86
- !u(t) || t.props.disabled || Z(t.props.value, t.props.children, e);
86
+ !f(t) || t.props.disabled || Z(t.props.value, t.props.children, e);
87
87
  }, Be = (e = 1) => {
88
88
  X(re(J.current)), b(ke(e)), K(!0);
89
89
  }, Le = (e) => {
@@ -119,7 +119,7 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
119
119
  role: "combobox",
120
120
  "aria-haspopup": "listbox",
121
121
  "aria-expanded": r,
122
- "aria-controls": A,
122
+ "aria-controls": r ? A : void 0,
123
123
  "aria-activedescendant": r ? D : void 0,
124
124
  "aria-labelledby": v,
125
125
  "aria-label": v ? void 0 : w,
@@ -134,7 +134,7 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
134
134
  I(!1), ye?.(e);
135
135
  },
136
136
  style: { minWidth: i && !R ? 105 : void 0 },
137
- className: y("relative flex w-full items-center justify-between text-left outline-none", "h-10 rounded-lg border-0 px-3 text-base transition-colors", H ? "bg-gama-50" : "bg-transparent", Te, R && "min-w-0", n && "cursor-not-allowed", c && "pointer-events-none"),
137
+ className: y("relative flex w-full items-center justify-between text-left outline-none", "h-10 rounded-lg border-0 px-3 text-base transition-colors", "asma-touch-ready", H ? "bg-gama-50" : "bg-transparent", Te, R && "min-w-0", n && "cursor-not-allowed", c && "pointer-events-none"),
138
138
  children: [
139
139
  /* @__PURE__ */ l("span", {
140
140
  className: y("min-w-0 flex-1 truncate", !i && "text-delta-500"),
@@ -175,6 +175,7 @@ var Ct = ({ dataTest: T, value: M, defaultValue: ne, onChange: $, error: le, err
175
175
  ...Oe(),
176
176
  id: A,
177
177
  role: "listbox",
178
+ "aria-multiselectable": d ? !0 : void 0,
178
179
  "aria-labelledby": v,
179
180
  "aria-label": v ? void 0 : w,
180
181
  ..._ ? qe : {},
@@ -1,24 +1,24 @@
1
1
  import { cn as c } from "../../../helpers/cn.js";
2
- import { CheckIcon as d } from "../../icons/check-icon/CheckIcon.js";
3
- import { jsx as e, jsxs as m } from "react/jsx-runtime";
4
- var f = ({ id: r, children: o, selected: t, active: i, disabled: a, className: n, onClick: l }) => /* @__PURE__ */ m("li", {
2
+ import { CheckIcon as m } from "../../icons/check-icon/CheckIcon.js";
3
+ import { jsx as e, jsxs as d } from "react/jsx-runtime";
4
+ var f = ({ id: r, children: o, selected: t, active: l, disabled: a, className: s, onClick: n }) => /* @__PURE__ */ d("li", {
5
5
  id: r,
6
6
  role: "option",
7
- "aria-selected": t ? !0 : void 0,
7
+ "aria-selected": !!t,
8
8
  "aria-disabled": a ? !0 : void 0,
9
9
  tabIndex: -1,
10
- onMouseDown: (s) => s.preventDefault(),
11
- onClick: a ? void 0 : l,
12
- className: c("relative flex items-center gap-1 px-2 py-2.5 text-base outline-none", a ? "cursor-not-allowed text-delta-300" : "cursor-pointer text-delta-800 hover:bg-delta-50", t && "bg-gama-50", n),
10
+ onMouseDown: (i) => i.preventDefault(),
11
+ onClick: a ? void 0 : n,
12
+ className: c("asma-pressable", "relative flex items-center gap-1 px-2 py-2.5 text-base outline-none", a ? "cursor-not-allowed text-delta-300" : "cursor-pointer text-delta-800 hover:bg-delta-50", t && "bg-gama-50", s),
13
13
  children: [
14
- i && /* @__PURE__ */ e("span", {
14
+ l && /* @__PURE__ */ e("span", {
15
15
  "aria-hidden": "true",
16
16
  "data-select-active-indicator": !0,
17
17
  className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
18
18
  }),
19
19
  /* @__PURE__ */ e("span", {
20
20
  className: "flex w-6 justify-center",
21
- children: t && /* @__PURE__ */ e(d, {
21
+ children: t && /* @__PURE__ */ e(m, {
22
22
  width: 22,
23
23
  height: 22,
24
24
  className: "text-gama-500"