asma-ui-core 3.95.0 → 3.96.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,44 +1,45 @@
1
- import { cn as $ } from "../../../../helpers/cn.js";
2
- import { LoadingIcon as X } from "../../../icons/loading-icon/LoadingIcon.js";
3
- import { CheckIcon as Y } from "../../../icons/check-icon/CheckIcon.js";
4
- import { PlusIconCircle as Z } from "../../../icons/plus-icon-circle/PlusIconCircle.js";
5
- import { StyledChip as j } from "../../../data-display/chip/StyledChip.js";
6
- import { StyledCheckbox as ee } from "../../checkbox/base-ui/StyledCheckbox.js";
7
- import { StyledTooltip as D } from "../../../data-display/tooltip/StyledTooltip.js";
8
- import { StyledInputField as te } from "../../input-field/StyledInputField.js";
9
- import { StyledSelectAutocomplete as le } from "../../select-autocomplete/StyledSelectAutocomplete.js";
10
- import { DynamicInteractiveChipGroup as ae } from "./DynamicInteractiveChipGroup.js";
11
- import { createElement as L, forwardRef as re, useCallback as f, useState as oe } from "react";
12
- import { Fragment as q, jsx as l, jsxs as C } from "react/jsx-runtime";
13
- var xe = re((T, E) => {
14
- const [F, O] = oe(!1), { options: k, dataTest: h, value: g, readOnly: u, multiple: o, required: K, onChange: x, size: z, title: v, noOptionsText: H, placeholder: _, disabled: S, helperText: R, disableHelperText: I, error: N, valueKey: A = "value", labelKey: G = "label", renderLabel: i, getOptionTooltip: P, startAdornment: W, autocompleteProps: n, loading: m, maxTags: J, onFocus: M, onBlur: Q } = T, s = (e) => typeof e == "object" ? e?.[G]?.toString() ?? "" : e?.toString() ?? "", p = f((e) => typeof e == "object" ? e?.[A] : e, [A]), V = f((e, t) => p(e) === p(t), [p]), y = (e) => {
1
+ import { cn as j } from "../../../../helpers/cn.js";
2
+ import { LoadingIcon as Y } from "../../../icons/loading-icon/LoadingIcon.js";
3
+ import { CheckIcon as Z } from "../../../icons/check-icon/CheckIcon.js";
4
+ import { PlusIconCircle as ee } from "../../../icons/plus-icon-circle/PlusIconCircle.js";
5
+ import { StyledChip as D } from "../../../data-display/chip/StyledChip.js";
6
+ import { StyledCheckbox as te } from "../../checkbox/base-ui/StyledCheckbox.js";
7
+ import { StyledTooltip as L } from "../../../data-display/tooltip/StyledTooltip.js";
8
+ import { StyledInputField as le } from "../../input-field/StyledInputField.js";
9
+ import { StyledSelectAutocomplete as ae } from "../../select-autocomplete/StyledSelectAutocomplete.js";
10
+ import { DynamicInteractiveChipGroup as re } from "./DynamicInteractiveChipGroup.js";
11
+ import { createElement as q, forwardRef as oe, useCallback as f, useState as ne } from "react";
12
+ import { Fragment as z, jsx as l, jsxs as T } from "react/jsx-runtime";
13
+ var ve = oe((O, E) => {
14
+ const [F, S] = ne(!1), { options: k, dataTest: h, value: g, readOnly: u, multiple: o, required: K, onChange: x, size: H, rowSize: v = "compact", title: y, noOptionsText: _, placeholder: R, disabled: I, helperText: G, disableHelperText: N, error: A, valueKey: P = "value", labelKey: W = "label", renderLabel: i, getOptionTooltip: V, startAdornment: J, autocompleteProps: n, loading: m, maxTags: M, onFocus: Q, onBlur: U } = O, s = (e) => typeof e == "object" ? e?.[W]?.toString() ?? "" : e?.toString() ?? "", p = f((e) => typeof e == "object" ? e?.[P] : e, [P]), B = f((e, t) => p(e) === p(t), [p]), w = (e) => {
15
15
  const t = p(e);
16
16
  return t == null ? "" : typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t) : e == null ? "" : s(e);
17
- }, B = f((e) => {
18
- O(!0), n?.onOpen?.(e);
19
- }, [n]), U = f((e, t) => {
20
- O(!1), n?.onClose?.(e, t);
17
+ }, $ = f((e) => {
18
+ S(!0), n?.onOpen?.(e);
19
+ }, [n]), X = f((e, t) => {
20
+ S(!1), n?.onClose?.(e, t);
21
21
  }, [n]);
22
- if (o && u) return /* @__PURE__ */ l(ae, { ...T });
23
- const w = v ? `${h}-title` : void 0;
24
- return /* @__PURE__ */ C("div", {
22
+ if (o && u) return /* @__PURE__ */ l(re, { ...O });
23
+ const C = y ? `${h}-title` : void 0;
24
+ return /* @__PURE__ */ T("div", {
25
25
  className: "flex w-full flex-col gap-y-1",
26
- children: [v && /* @__PURE__ */ l("span", {
27
- id: w,
26
+ children: [y && /* @__PURE__ */ l("span", {
27
+ id: C,
28
28
  className: "text-base font-semibold text-delta-800",
29
- children: v
30
- }), /* @__PURE__ */ l(le, {
29
+ children: y
30
+ }), /* @__PURE__ */ l(ae, {
31
31
  open: F,
32
- onOpen: B,
33
- onClose: U,
32
+ onOpen: $,
33
+ onClose: X,
34
34
  disableCloseOnSelect: o,
35
35
  dataTest: h,
36
- disabled: !!S || !!m,
37
- noOptionsText: H,
36
+ disabled: !!I || !!m,
37
+ noOptionsText: _,
38
38
  loading: m,
39
39
  readOnly: u,
40
40
  value: g,
41
- size: z,
41
+ size: H,
42
+ rowSize: v,
42
43
  disableClearable: K,
43
44
  options: k,
44
45
  fullWidth: !0,
@@ -48,14 +49,14 @@ var xe = re((T, E) => {
48
49
  x(t);
49
50
  },
50
51
  filterSelectedOptions: !1,
51
- isOptionEqualToValue: n?.isOptionEqualToValue ?? V,
52
+ isOptionEqualToValue: n?.isOptionEqualToValue ?? B,
52
53
  autoHeight: !0,
53
54
  multiple: o,
54
55
  renderValue: o ? (e) => {
55
56
  if (!Array.isArray(e)) return null;
56
- const t = e, d = J ?? k.length, a = t.slice(0, d), c = t.length - d;
57
- return [...a.map((r) => /* @__PURE__ */ l(j, {
58
- dataTest: `${y(r)}-chip`,
57
+ const t = e, d = M ?? k.length, a = t.slice(0, d), c = t.length - d;
58
+ return [...a.map((r) => /* @__PURE__ */ l(D, {
59
+ dataTest: `${w(r)}-chip`,
59
60
  readOnly: u,
60
61
  variant: "outlined",
61
62
  label: i ? i(r) : s(r),
@@ -63,47 +64,47 @@ var xe = re((T, E) => {
63
64
  root: "h-fit w-fit min-h-[32px]",
64
65
  label: "block whitespace-normal"
65
66
  },
66
- disabled: !!S || !!m,
67
+ disabled: !!I || !!m,
67
68
  deleteButtonTabIndex: -1,
68
69
  onDelete: () => {
69
- Array.isArray(g) && x(g.filter((b) => !V(b, r)));
70
+ Array.isArray(g) && x(g.filter((b) => !B(b, r)));
70
71
  }
71
- }, y(r))), c > 0 ? /* @__PURE__ */ l(j, {
72
+ }, w(r))), c > 0 ? /* @__PURE__ */ l(D, {
72
73
  dataTest: "remaining-count-tag-chip",
73
74
  label: `+${c}`,
74
75
  variant: "outlined",
75
76
  tabIndex: -1,
76
- onClick: B
77
+ onClick: $
77
78
  }, "remaining-count") : null];
78
79
  } : void 0,
79
- popupIcon: m ? /* @__PURE__ */ l(X, {
80
+ popupIcon: m ? /* @__PURE__ */ l(Y, {
80
81
  height: 24,
81
82
  width: 24
82
- }) : o ? /* @__PURE__ */ l(Z, {
83
+ }) : o ? /* @__PURE__ */ l(ee, {
83
84
  height: 24,
84
85
  width: 24
85
86
  }) : void 0,
86
87
  renderOption: (e, t, d) => {
87
- const a = typeof t == "object" ? !!t?.disabled : !1, c = P ? P(t) : null;
88
+ const a = typeof t == "object" ? !!t?.disabled : !1, c = V ? V(t) : null;
88
89
  if (o) {
89
90
  const b = d.selected;
90
- return /* @__PURE__ */ L("li", {
91
+ return /* @__PURE__ */ q("li", {
91
92
  ...e,
92
93
  role: "option",
93
94
  "aria-selected": b,
94
95
  key: e.id,
95
96
  onClick: a ? void 0 : e.onClick,
96
- className: $("relative flex min-h-10 cursor-pointer items-center gap-x-1 bg-white px-2 text-base aria-selected:bg-gama-50 hover:bg-delta-50", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
97
+ className: j("relative flex cursor-pointer items-center gap-x-1 bg-white px-2 text-base aria-selected:bg-gama-50 hover:bg-delta-50", v === "regular" ? "min-h-12" : "min-h-10", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
97
98
  "aria-disabled": a
98
99
  }, e["data-active"] !== void 0 && /* @__PURE__ */ l("span", {
99
100
  "aria-hidden": "true",
100
101
  className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
101
- }), /* @__PURE__ */ l(D, {
102
+ }), /* @__PURE__ */ l(L, {
102
103
  arrow: !0,
103
104
  title: c,
104
- children: /* @__PURE__ */ C(q, { children: [/* @__PURE__ */ l(ee, {
105
+ children: /* @__PURE__ */ T(z, { children: [/* @__PURE__ */ l(te, {
105
106
  disabled: a,
106
- dataTest: `${y(t)}-checkbox`,
107
+ dataTest: `${w(t)}-checkbox`,
107
108
  size: "small",
108
109
  decorative: !0,
109
110
  className: "min-w-[36px]",
@@ -115,23 +116,23 @@ var xe = re((T, E) => {
115
116
  }));
116
117
  }
117
118
  const r = d.selected;
118
- return /* @__PURE__ */ L("li", {
119
+ return /* @__PURE__ */ q("li", {
119
120
  ...e,
120
121
  role: "option",
121
122
  "aria-selected": r,
122
123
  key: e.id,
123
- className: $("relative flex min-h-10 cursor-pointer items-center gap-x-1 px-2 text-base aria-selected:bg-gama-50 hover:bg-delta-50", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
124
+ className: j("relative flex cursor-pointer items-center gap-x-1 px-2 text-base aria-selected:bg-gama-50 hover:bg-delta-50", v === "regular" ? "min-h-12" : "min-h-10", a && "cursor-not-allowed bg-delta-50 aria-selected:!bg-delta-50 hover:!bg-delta-50 [&_*]:cursor-not-allowed"),
124
125
  onClick: a ? void 0 : e.onClick,
125
126
  "aria-disabled": a
126
127
  }, e["data-active"] !== void 0 && /* @__PURE__ */ l("span", {
127
128
  "aria-hidden": "true",
128
129
  className: "border-l-solid pointer-events-none absolute inset-y-0 left-0 border-l-[3px] border-focus-ring"
129
- }), /* @__PURE__ */ l(D, {
130
+ }), /* @__PURE__ */ l(L, {
130
131
  arrow: !0,
131
132
  title: c,
132
- children: /* @__PURE__ */ C(q, { children: [/* @__PURE__ */ l("span", {
133
+ children: /* @__PURE__ */ T(z, { children: [/* @__PURE__ */ l("span", {
133
134
  className: "w-5 min-w-5",
134
- children: r && /* @__PURE__ */ l(Y, {
135
+ children: r && /* @__PURE__ */ l(Z, {
135
136
  className: "size-5 min-h-5 min-w-5 text-gama-500",
136
137
  height: 20,
137
138
  width: 20
@@ -142,30 +143,30 @@ var xe = re((T, E) => {
142
143
  })] })
143
144
  }));
144
145
  },
145
- renderInput: (e) => /* @__PURE__ */ l(te, {
146
+ renderInput: (e) => /* @__PURE__ */ l(le, {
146
147
  dataTest: `${h}-input-field`,
147
148
  ...e,
148
149
  inputRef: E,
149
- error: N,
150
- helperText: I ? void 0 : R,
151
- reserveHelperText: I ? !1 : N !== void 0,
150
+ error: A,
151
+ helperText: N ? void 0 : G,
152
+ reserveHelperText: N ? !1 : A !== void 0,
152
153
  variant: "outlined",
153
154
  label: "",
154
- placeholder: _,
155
+ placeholder: R,
155
156
  readOnly: u,
156
- onFocus: M,
157
- onBlur: Q,
157
+ onFocus: Q,
158
+ onBlur: U,
158
159
  onKeyDown: e.onKeyDown,
159
160
  autoComplete: "off",
160
161
  slotProps: {
161
162
  ...e.slotProps,
162
163
  input: {
163
164
  ...e.slotProps?.input ?? {},
164
- startAdornment: W ?? e.slotProps?.input?.startAdornment
165
+ startAdornment: J ?? e.slotProps?.input?.startAdornment
165
166
  },
166
167
  htmlInput: {
167
168
  ...e.slotProps?.htmlInput ?? {},
168
- ...w ? { "aria-labelledby": w } : {}
169
+ ...C ? { "aria-labelledby": C } : {}
169
170
  }
170
171
  }
171
172
  }),
@@ -174,5 +175,5 @@ var xe = re((T, E) => {
174
175
  });
175
176
  });
176
177
  export {
177
- xe as DynamicSelectAutocomplete
178
+ ve as DynamicSelectAutocomplete
178
179
  };
@@ -1,23 +1,23 @@
1
1
  import { cn as E } from "../../../helpers/cn.js";
2
- import { ChevronDownIcon as rt } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
3
- import { CloseIcon as ot } from "../../icons/close-icon/CloseIcon.js";
4
- import { CheckIcon as st } from "../../icons/check-icon/CheckIcon.js";
5
- import { PlusIconCircle as nt } from "../../icons/plus-icon-circle/PlusIconCircle.js";
6
- import { StyledChip as at } from "../../data-display/chip/StyledChip.js";
2
+ import { ChevronDownIcon as ot } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
3
+ import { CloseIcon as st } from "../../icons/close-icon/CloseIcon.js";
4
+ import { CheckIcon as nt } from "../../icons/check-icon/CheckIcon.js";
5
+ import { PlusIconCircle as at } from "../../icons/plus-icon-circle/PlusIconCircle.js";
6
+ import { StyledChip as it } from "../../data-display/chip/StyledChip.js";
7
7
  import { StyledCheckbox as ie } from "../checkbox/base-ui/StyledCheckbox.js";
8
- import { TOP_LAYER_PROPS as it, TOP_LAYER_RESET_STYLE as ct, getOpenModalDialogAncestor as dt, shouldUsePopoverTopLayer as ut, useTopLayerRef as pt } from "../../../hooks/useTopLayer.hook.js";
9
- import { LoadingIcon as ft } from "../../../table/shared-components/LoadingIcon.js";
8
+ import { TOP_LAYER_PROPS as ct, TOP_LAYER_RESET_STYLE as dt, getOpenModalDialogAncestor as ut, shouldUsePopoverTopLayer as pt, useTopLayerRef as ft } from "../../../hooks/useTopLayer.hook.js";
9
+ import { LoadingIcon as mt } from "../../../table/shared-components/LoadingIcon.js";
10
10
  import W from "./StyledSelectAutocomplete.module.js";
11
11
  import { useEffect as ce, useMemo as U, useRef as de, useState as D } from "react";
12
12
  import { jsx as s, jsxs as I } from "react/jsx-runtime";
13
- import { FloatingPortal as mt, autoUpdate as ht, flip as bt, offset as gt, shift as xt, size as yt, useDismiss as wt, useFloating as kt, useInteractions as vt, useMergeRefs as ue, useRole as Dt } from "@floating-ui/react";
14
- var It = (l) => typeof l == "object" && l !== null && "label" in l ? String(l.label) : String(l), At = (l) => typeof l == "object" && l !== null && "disabled" in l && !!l.disabled;
15
- function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, getOptionLabel: fe, getOptionKey: S, isOptionEqualToValue: V, renderOption: B, renderValue: T, filterOptions: _, loading: Y, loadingText: me = "Loading…", noOptionsText: he = "No options", disabled: C, readOnly: g, error: be, helperText: ge, size: xe = "small", disableClearable: ye, disableCloseOnSelect: we, popupIcon: ke, autoHeight: ve, multiple: De, allowSelectAll: F, selectAllLabel: Ie = "Select all", fullWidth: Ae, classes: Ne, inputValue: M, onInputChange: Se, open: q, onOpen: Ce, onClose: Me, className: Re, wrapperClassName: Pe, getOptionDisabled: $e, slotProps: G }) {
16
- const r = De === !0, d = fe ?? It, R = (e, t) => V ? V(e, t) : e === t, [Le, Ee] = D(!1), a = q ?? Le, u = (e) => {
17
- e && (g || C) || (q === void 0 && Ee(e), e ? Ce?.() : (x(null), Me?.()));
18
- }, [_e, J] = D(""), h = M ?? _e, P = (e, t, n) => {
13
+ import { FloatingPortal as ht, autoUpdate as bt, flip as gt, offset as xt, shift as wt, size as yt, useDismiss as kt, useFloating as vt, useInteractions as Dt, useMergeRefs as ue, useRole as It } from "@floating-ui/react";
14
+ var Nt = (l) => typeof l == "object" && l !== null && "label" in l ? String(l.label) : String(l), At = (l) => typeof l == "object" && l !== null && "disabled" in l && !!l.disabled;
15
+ function Ht({ dataTest: l, options: b, renderInput: pe, value: N, onChange: A, getOptionLabel: fe, getOptionKey: C, isOptionEqualToValue: V, renderOption: B, renderValue: T, filterOptions: _, loading: Y, loadingText: me = "Loading…", noOptionsText: he = "No options", disabled: S, readOnly: g, error: be, helperText: ge, size: xe = "small", rowSize: we = "compact", disableClearable: ye, disableCloseOnSelect: ke, popupIcon: ve, autoHeight: De, multiple: Ie, allowSelectAll: F, selectAllLabel: Ne = "Select all", fullWidth: Ae, classes: Ce, inputValue: M, onInputChange: Se, open: q, onOpen: Me, onClose: Re, className: Pe, wrapperClassName: $e, getOptionDisabled: Le, slotProps: G }) {
16
+ const r = Ie === !0, d = fe ?? Nt, R = (e, t) => V ? V(e, t) : e === t, [Ee, _e] = D(!1), a = q ?? Ee, u = (e) => {
17
+ e && (g || S) || (q === void 0 && _e(e), e ? Me?.() : (x(null), Re?.()));
18
+ }, [Fe, J] = D(""), h = M ?? Fe, P = (e, t, n) => {
19
19
  M === void 0 && J(t), Se?.(e, t, n);
20
- }, [o, x] = D(null), Q = `${l}-listbox`, X = de([]), Z = de(null), [Fe, Oe] = D(null), [K, je] = D(null), i = r ? Array.isArray(A) ? A : [] : [], y = r ? null : A ?? null, ee = !r && y !== null ? d(y) : "";
20
+ }, [o, x] = D(null), Q = `${l}-listbox`, X = de([]), Z = de(null), [Oe, je] = D(null), [K, ze] = D(null), i = r ? Array.isArray(N) ? N : [] : [], w = r ? null : N ?? null, ee = !r && w !== null ? d(w) : "";
21
21
  ce(() => {
22
22
  M !== void 0 || r || J(ee);
23
23
  }, [
@@ -25,10 +25,10 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
25
25
  r,
26
26
  ee
27
27
  ]);
28
- const O = (e) => r ? i.some((t) => R(e, t)) : y !== null && R(e, y), $ = (e) => $e?.(e) ?? At(e), te = U(() => {
28
+ const O = (e) => r ? i.some((t) => R(e, t)) : w !== null && R(e, w), $ = (e) => Le?.(e) ?? At(e), te = U(() => {
29
29
  const e = [...b];
30
30
  if (_) return _(e, { inputValue: h });
31
- const t = !r && y !== null ? d(y).toLowerCase() : null;
31
+ const t = !r && w !== null ? d(w).toLowerCase() : null;
32
32
  if (!h || h.toLowerCase() === t) return e;
33
33
  const n = h.toLowerCase();
34
34
  return e.filter((f) => d(f).toLowerCase().includes(n));
@@ -36,7 +36,7 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
36
36
  b,
37
37
  h,
38
38
  _,
39
- A
39
+ N
40
40
  ]), p = U(() => te.slice(0, 100), [te]), le = p.flatMap((e, t) => $(e) ? [] : [t]), c = F && r ? [-1, ...le] : le, k = p.findIndex(O);
41
41
  ce(() => {
42
42
  if (!a) return;
@@ -50,37 +50,37 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
50
50
  K,
51
51
  k
52
52
  ]);
53
- const { refs: L, floatingStyles: ze, context: re } = kt({
53
+ const { refs: L, floatingStyles: He, context: re } = vt({
54
54
  open: a,
55
55
  onOpenChange: u,
56
56
  placement: "bottom-start",
57
57
  strategy: "fixed",
58
- whileElementsMounted: ht,
58
+ whileElementsMounted: bt,
59
59
  middleware: [
60
- gt(0),
61
- bt({ padding: 8 }),
62
- xt({ padding: 8 }),
60
+ xt(0),
61
+ gt({ padding: 8 }),
62
+ wt({ padding: 8 }),
63
63
  yt({ apply({ rects: e, availableHeight: t }) {
64
- Oe(e.reference.width), je(ve ? t - 8 : Math.min(t - 8, 320));
64
+ je(e.reference.width), ze(De ? t - 8 : Math.min(t - 8, 320));
65
65
  } })
66
66
  ]
67
- }), { getReferenceProps: He, getFloatingProps: We, getItemProps: Ue } = vt([wt(re), Dt(re, { role: "listbox" })]), Ve = ue([L.setReference]), oe = U(() => a ? dt(L.reference.current) : void 0, [a, L]), j = ut(oe), Be = ue([pt(L.setFloating, j)]), Te = (e) => c.includes(k) ? k : c[e === 1 ? 0 : c.length - 1] ?? null, Ye = (e) => {
67
+ }), { getReferenceProps: We, getFloatingProps: Ue, getItemProps: Ve } = Dt([kt(re), It(re, { role: "listbox" })]), Be = ue([L.setReference]), oe = U(() => a ? ut(L.reference.current) : void 0, [a, L]), j = pt(oe), Te = ue([ft(L.setFloating, j)]), Ye = (e) => c.includes(k) ? k : c[e === 1 ? 0 : c.length - 1] ?? null, qe = (e) => {
68
68
  c.length !== 0 && x((t) => {
69
69
  const n = c.indexOf(t ?? k);
70
70
  return n === -1 ? c[e === 1 ? 0 : c.length - 1] ?? null : c[Math.min(Math.max(n + e, 0), c.length - 1)] ?? null;
71
71
  });
72
- }, v = (e, t, n = !r || !we) => {
72
+ }, v = (e, t, n = !r || !ke) => {
73
73
  if (r) {
74
- const f = i.some((m) => R(t, m)), w = f ? i.filter((m) => !R(t, m)) : [...i, t];
75
- N?.(e, w, f ? "removeOption" : "selectOption", { option: t }), P(e, "", "reset"), n && u(!1);
74
+ const f = i.some((m) => R(t, m)), y = f ? i.filter((m) => !R(t, m)) : [...i, t];
75
+ A?.(e, y, f ? "removeOption" : "selectOption", { option: t }), P(e, "", "reset"), n && u(!1);
76
76
  } else
77
- N?.(e, t, "selectOption", { option: t }), P(e, d(t), "reset"), n && u(!1);
77
+ A?.(e, t, "selectOption", { option: t }), P(e, d(t), "reset"), n && u(!1);
78
78
  }, se = (e) => {
79
- N?.(e, r ? [] : null, "clear", void 0), P(e, "", "clear");
79
+ A?.(e, r ? [] : null, "clear", void 0), P(e, "", "clear");
80
80
  }, z = (e) => {
81
81
  const t = b.length > 0 && i.length === b.length;
82
- N?.(e, t ? [] : b, t ? "clear" : "selectOption", void 0);
83
- }, qe = (e) => {
82
+ A?.(e, t ? [] : b, t ? "clear" : "selectOption", void 0);
83
+ }, Ge = (e) => {
84
84
  if (e.key === "Backspace" && h === "" && ne) {
85
85
  const t = i[i.length - 1];
86
86
  r ? t !== void 0 && v(e, t, !1) : se(e);
@@ -94,10 +94,10 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
94
94
  $(t) || v(e, t, !0);
95
95
  } else if (e.key === "ArrowDown" || e.key === "ArrowUp") {
96
96
  if (e.preventDefault(), !a) {
97
- x(Te(e.key === "ArrowDown" ? 1 : -1)), u(!0);
97
+ x(Ye(e.key === "ArrowDown" ? 1 : -1)), u(!0);
98
98
  return;
99
99
  }
100
- Ye(e.key === "ArrowDown" ? 1 : -1);
100
+ qe(e.key === "ArrowDown" ? 1 : -1);
101
101
  } else if (e.key === "Home" || e.key === "End")
102
102
  e.preventDefault(), x(c[e.key === "Home" ? 0 : c.length - 1] ?? null);
103
103
  else if (e.key === " " && o === -1)
@@ -107,21 +107,21 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
107
107
  const t = p[o];
108
108
  $(t) || v(e, t, !1);
109
109
  } else e.key === "Escape" && a ? (e.preventDefault(), e.stopPropagation(), u(!1)) : e.key === "Tab" && u(!1);
110
- }, ne = !ye && !g && !C && (r ? i.length > 0 : y !== null);
110
+ }, ne = !ye && !g && !S && (r ? i.length > 0 : w !== null);
111
111
  let ae;
112
112
  a && o != null && (o === -1 || p[o] !== void 0) && (ae = o === -1 ? `${l}-select-all` : `${l}-option-${o}`);
113
- const Ge = (e) => {
114
- e.preventDefault(), !(C || g) && (Z.current?.focus(), u(!a));
115
- }, Je = r ? T ? T(i, ({ index: e }) => ({ "data-index": e })) : i.map((e, t) => /* @__PURE__ */ s(at, {
113
+ const Je = (e) => {
114
+ e.preventDefault(), !(S || g) && (Z.current?.focus(), u(!a));
115
+ }, Qe = r ? T ? T(i, ({ index: e }) => ({ "data-index": e })) : i.map((e, t) => /* @__PURE__ */ s(it, {
116
116
  dataTest: `selected-chip-${d(e)}`,
117
117
  label: d(e),
118
118
  readOnly: g,
119
119
  deleteButtonTabIndex: -1,
120
120
  onDelete: g ? void 0 : (n) => v(n, e)
121
- }, S ? S(e) : `${d(e)}-${t}`)) : void 0, Qe = /* @__PURE__ */ I("span", {
121
+ }, C ? C(e) : `${d(e)}-${t}`)) : void 0, Xe = /* @__PURE__ */ I("span", {
122
122
  className: "flex items-center gap-1",
123
123
  children: [
124
- Y && /* @__PURE__ */ s(ft, {
124
+ Y && /* @__PURE__ */ s(mt, {
125
125
  width: 20,
126
126
  height: 20,
127
127
  className: "animate-spin"
@@ -134,7 +134,7 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
134
134
  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",
135
135
  onMouseDown: (e) => e.preventDefault(),
136
136
  onClick: se,
137
- children: /* @__PURE__ */ s(ot, {
137
+ children: /* @__PURE__ */ s(st, {
138
138
  width: 20,
139
139
  height: 20,
140
140
  className: "text-delta-700"
@@ -148,20 +148,20 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
148
148
  "data-testid": `${l}-popup-indicator`,
149
149
  className: "flex cursor-pointer items-center border-0 bg-transparent",
150
150
  onMouseDown: (e) => e.preventDefault(),
151
- onClick: Ge,
152
- children: ke ?? (r ? /* @__PURE__ */ s(nt, {
151
+ onClick: Je,
152
+ children: ve ?? (r ? /* @__PURE__ */ s(at, {
153
153
  width: 24,
154
154
  height: 24,
155
155
  className: "text-delta-700"
156
- }) : /* @__PURE__ */ s(rt, {
156
+ }) : /* @__PURE__ */ s(ot, {
157
157
  width: 24,
158
158
  height: 24,
159
159
  className: E(W["select-custom-icon"], a && W["select-custom-icon-open"], "text-delta-700")
160
160
  }))
161
161
  })
162
162
  ]
163
- }), Xe = {
164
- disabled: C,
163
+ }), Ze = {
164
+ disabled: S,
165
165
  size: xe,
166
166
  fullWidth: !0,
167
167
  error: be,
@@ -170,10 +170,10 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
170
170
  onChange: (e) => {
171
171
  x(null), P(e, e.target.value, "input"), a || u(!0);
172
172
  },
173
- onKeyDown: qe,
173
+ onKeyDown: Ge,
174
174
  slotProps: {
175
175
  htmlInput: {
176
- ...He(),
176
+ ...We(),
177
177
  ref: Z,
178
178
  onClick: () => u(!0),
179
179
  role: "combobox",
@@ -185,15 +185,15 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
185
185
  readOnly: g
186
186
  },
187
187
  input: {
188
- ref: Ve,
189
- startAdornment: Je,
190
- endAdornment: Qe
188
+ ref: Be,
189
+ startAdornment: Qe,
190
+ endAdornment: Xe
191
191
  }
192
192
  }
193
- }, Ze = E("asma-pressable", "relative box-border flex min-h-10 cursor-pointer items-center gap-x-3 px-3 py-1.5 text-base text-delta-800", "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, n) => {
194
- const { key: f, ...w } = e;
193
+ }, Ke = E("asma-pressable", "relative box-border flex cursor-pointer items-center gap-x-3 px-3 py-1.5 text-base text-delta-800", we === "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"), et = (e, t, n) => {
194
+ const { key: f, ...y } = e;
195
195
  return /* @__PURE__ */ I("li", {
196
- ...w,
196
+ ...y,
197
197
  children: [
198
198
  e["data-active"] !== void 0 && /* @__PURE__ */ s("span", {
199
199
  "aria-hidden": "true",
@@ -203,11 +203,12 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
203
203
  dataTest: `${l}-${d(t)}-checkbox`,
204
204
  checked: n.selected,
205
205
  size: "medium",
206
+ checkboxClassName: "!h-4 !w-4",
206
207
  hideWrapper: !0,
207
208
  decorative: !0
208
209
  }) : /* @__PURE__ */ s("span", {
209
210
  className: "w-5",
210
- children: n.selected && /* @__PURE__ */ s(st, {
211
+ children: n.selected && /* @__PURE__ */ s(nt, {
211
212
  width: 20,
212
213
  height: 20,
213
214
  className: "text-gama-500"
@@ -219,16 +220,16 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
219
220
  })
220
221
  ]
221
222
  }, f);
222
- }, et = (e, t) => {
223
+ }, tt = (e, t) => {
223
224
  const n = $(e), f = {
224
- ...Ue({
225
+ ...Ve({
225
226
  onMouseDown: (m) => m.preventDefault(),
226
227
  onClick: (m) => {
227
228
  n || v(m, e);
228
229
  },
229
230
  onMouseMove: () => x(null)
230
231
  }),
231
- key: S ? String(S(e)) : `${d(e)}-${t}`,
232
+ key: C ? String(C(e)) : `${d(e)}-${t}`,
232
233
  ref: (m) => {
233
234
  X.current[t] = m;
234
235
  },
@@ -237,34 +238,34 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
237
238
  "aria-selected": O(e),
238
239
  "aria-disabled": n || void 0,
239
240
  "data-active": o === t ? "" : void 0,
240
- className: Ze
241
- }, w = {
241
+ className: Ke
242
+ }, y = {
242
243
  selected: O(e),
243
244
  index: t,
244
245
  inputValue: h
245
246
  };
246
- return B ? B(f, e, w) : Ke(f, e, w);
247
- }, tt = !!(F && r), H = b.length > 0 && i.length === b.length, lt = i.length > 0 && !H;
247
+ return B ? B(f, e, y) : et(f, e, y);
248
+ }, lt = !!(F && r), H = b.length > 0 && i.length === b.length, rt = i.length > 0 && !H;
248
249
  return /* @__PURE__ */ I("div", {
249
- className: E(W.styledSelectAutocompleteWrapper, !Ae && "w-auto", Pe, Re),
250
- children: [pe(Xe), a && /* @__PURE__ */ s(mt, {
250
+ className: E(W.styledSelectAutocompleteWrapper, !Ae && "w-auto", $e, Pe),
251
+ children: [pe(Ze), a && /* @__PURE__ */ s(ht, {
251
252
  root: oe,
252
253
  children: /* @__PURE__ */ I("ul", {
253
- ref: Be,
254
- ...j ? it : {},
254
+ ref: Te,
255
+ ...j ? ct : {},
255
256
  style: {
256
- ...j ? ct : {},
257
- ...ze,
258
- width: Fe ?? void 0,
257
+ ...j ? dt : {},
258
+ ...He,
259
+ width: Oe ?? void 0,
259
260
  maxHeight: K ?? void 0,
260
261
  fontFamily: "Roboto, Helvetica, Arial, sans-serif",
261
262
  ...G?.popper?.style
262
263
  },
263
- ...We(),
264
+ ...Ue(),
264
265
  id: Q,
265
266
  role: "listbox",
266
267
  "aria-multiselectable": r ? !0 : void 0,
267
- className: E("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)]", tt && "py-0", "[&>li:not(:last-child)]:border-0 [&>li:not(:last-child)]:border-b", "[&>li:not(:last-child)]:border-solid [&>li:not(:last-child)]:border-delta-200", Ne?.listbox, G?.popper?.className),
268
+ className: E("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)]", lt && "py-0", "[&>li:not(:last-child)]:border-0 [&>li:not(:last-child)]:border-b", "[&>li:not(:last-child)]:border-solid [&>li:not(:last-child)]:border-delta-200", Ce?.listbox, G?.popper?.className),
268
269
  children: [F && r && /* @__PURE__ */ I("li", {
269
270
  id: `${l}-select-all`,
270
271
  role: "option",
@@ -283,14 +284,15 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
283
284
  /* @__PURE__ */ s(ie, {
284
285
  dataTest: `${l}-select-all`,
285
286
  checked: H,
286
- indeterminate: lt,
287
+ indeterminate: rt,
287
288
  size: "medium",
289
+ checkboxClassName: "!h-4 !w-4",
288
290
  hideWrapper: !0,
289
291
  decorative: !0
290
292
  }),
291
293
  /* @__PURE__ */ s("span", {
292
294
  className: "flex-1 truncate",
293
- children: Ie
295
+ children: Ne
294
296
  })
295
297
  ]
296
298
  }), Y ? /* @__PURE__ */ s("li", {
@@ -301,11 +303,11 @@ function zt({ dataTest: l, options: b, renderInput: pe, value: A, onChange: N, g
301
303
  role: "presentation",
302
304
  className: "px-3 py-2 text-sm text-delta-600",
303
305
  children: he
304
- }) : p.map(et)]
306
+ }) : p.map(tt)]
305
307
  })
306
308
  })]
307
309
  });
308
310
  }
309
311
  export {
310
- zt as StyledSelectAutocomplete
312
+ Ht as StyledSelectAutocomplete
311
313
  };
@@ -34,6 +34,12 @@ interface DynamicSelectCommonProps<TOption extends DynamicSelectOption> {
34
34
  title?: string;
35
35
  /** @figmaProp none — app size (chips/buttons). Defaults to `'medium'`. */
36
36
  size?: 'small' | 'medium';
37
+ /**
38
+ * Option-row density in the autocomplete dropdown. `'compact'` (default) matches the Figma Menus
39
+ * item at 40px; `'regular'` gives a roomier 48px row. Rows still grow taller when a label wraps.
40
+ * No effect on the chip-group variant (≤5 options).
41
+ */
42
+ rowSize?: 'compact' | 'regular';
37
43
  /** Placeholder text shown in the autocomplete input when no value is selected. */
38
44
  placeholder?: string;
39
45
  /** @figmaProp State = true→"Disabled" */
@@ -82,6 +82,13 @@ export interface StyledSelectAutocompleteProps<T, Multiple extends boolean | und
82
82
  helperText?: ReactNode;
83
83
  /** @figmaProp none — FieldSize (both render the 40px field) */
84
84
  size?: 'small' | 'medium';
85
+ /**
86
+ * Option-row density in the popover. `'compact'` (default) matches the Figma Menus item at 40px
87
+ * (`min-h-10`); `'regular'` gives a roomier 48px row (`min-h-12`). Rows still grow taller when a
88
+ * label wraps to a second line — this only sets the minimum. Does not affect the 32px select-all
89
+ * header, the input field, or single-select rows' left check column.
90
+ */
91
+ rowSize?: 'compact' | 'regular';
85
92
  /** @figmaProp Clear (trigger clear button) */
86
93
  disableClearable?: boolean;
87
94
  freeSolo?: boolean;
@@ -125,5 +132,5 @@ export interface StyledSelectAutocompleteProps<T, Multiple extends boolean | und
125
132
  * ponytail: `freeSolo` is accepted (arbitrary input is emitted via onInputChange) but not turned
126
133
  * into option values; exact keyboard-parity edge cases are Chromatic/axe-gated.
127
134
  */
128
- export declare function StyledSelectAutocomplete<T, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false>({ dataTest, options, renderInput, value, onChange, getOptionLabel, getOptionKey, isOptionEqualToValue, renderOption, renderValue, filterOptions, loading, loadingText, noOptionsText, disabled, readOnly, error, helperText, size, disableClearable, disableCloseOnSelect, popupIcon, autoHeight, multiple, allowSelectAll, selectAllLabel, fullWidth, classes, inputValue: controlledInput, onInputChange, open: controlledOpen, onOpen, onClose, className, wrapperClassName, getOptionDisabled, slotProps, }: StyledSelectAutocompleteProps<T, Multiple, DisableClearable, FreeSolo>): JSX.Element;
135
+ export declare function StyledSelectAutocomplete<T, Multiple extends boolean | undefined = false, DisableClearable extends boolean | undefined = false, FreeSolo extends boolean | undefined = false>({ dataTest, options, renderInput, value, onChange, getOptionLabel, getOptionKey, isOptionEqualToValue, renderOption, renderValue, filterOptions, loading, loadingText, noOptionsText, disabled, readOnly, error, helperText, size, rowSize, disableClearable, disableCloseOnSelect, popupIcon, autoHeight, multiple, allowSelectAll, selectAllLabel, fullWidth, classes, inputValue: controlledInput, onInputChange, open: controlledOpen, onOpen, onClose, className, wrapperClassName, getOptionDisabled, slotProps, }: StyledSelectAutocompleteProps<T, Multiple, DisableClearable, FreeSolo>): JSX.Element;
129
136
  export {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.95.0",
6
+ "version": "3.96.0",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",