asma-ui-core 3.101.5 → 3.101.7

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,15 +1,15 @@
1
1
  import { cn as c } from "../../../helpers/cn.js";
2
2
  import { CheckIcon as m } from "../../icons/check-icon/CheckIcon.js";
3
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", {
4
+ var b = ({ id: r, children: o, selected: t, active: l, disabled: a, className: n, onClick: s }) => /* @__PURE__ */ d("li", {
5
5
  id: r,
6
6
  role: "option",
7
7
  "aria-selected": !!t,
8
8
  "aria-disabled": a ? !0 : void 0,
9
9
  tabIndex: -1,
10
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),
11
+ onClick: a ? void 0 : s,
12
+ className: c("asma-pressable", "relative box-border flex min-h-10 items-center gap-1 px-2 py-2 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),
13
13
  children: [
14
14
  l && /* @__PURE__ */ e("span", {
15
15
  "aria-hidden": "true",
@@ -31,5 +31,5 @@ var f = ({ id: r, children: o, selected: t, active: l, disabled: a, className: s
31
31
  ]
32
32
  });
33
33
  export {
34
- f as StyledSelectItem
34
+ b as StyledSelectItem
35
35
  };
@@ -1,174 +1,208 @@
1
- import { cn as c } from "../../../helpers/cn.js";
2
- import { PlusIcon as yt } from "../../icons/plus-icon/PlusIcon.js";
3
- import { RemoveIcon as xt } from "../../icons/remove-icon/RemoveIcon.js";
4
- import { StyledButton as tt } from "../button/StyledButton.js";
5
- import { HelperRow as Nt } from "../../../helpers/HelperRow.js";
6
- import { useHelperSlot as Mt } from "../../../helpers/useHelperSlot.js";
7
- import x from "./StyledSlider.module.js";
8
- import { useId as Pt, useRef as et, useState as rt } from "react";
9
- import { jsx as i, jsxs as y } from "react/jsx-runtime";
10
- var j = (m, l, o) => o === l ? 0 : Math.min(100, Math.max(0, (m - l) / (o - l) * 100)), It = (m) => Array.isArray(m) ? [m[0] ?? 0, m[1] ?? 0] : null, Ut = ({ dataTest: m, min: l = 0, max: o = 100, step: h = 1, value: V, defaultValue: lt, disabled: u, size: B = "medium", orientation: F = "horizontal", marks: A, name: at, className: nt, classes: p, slotProps: R, error: N, errorText: ot, helperText: K, reserveHelperText: ct, fromLabel: T, toLabel: D, showButtons: X = !0, ariaLabel: $, ariaLabelledBy: it, onChange: M, onChangeCommitted: k }) => {
11
- const Y = Pt(), a = F === "vertical", s = B === "small" ? 6 : 8, b = et(null), g = et(null), [st, P] = rt(null), [ut, q] = rt(lt ?? l), v = st ?? V ?? ut, n = It(v), d = n !== null, E = N ? ot ?? K : K, { show: G, role: dt } = Mt("StyledSlider", N, E, ct), H = (A === !0 && Number.isFinite(h) && h > 0 && o > l ? Array.from({ length: Math.floor((o - l) / h) + 1 }, (t, r) => ({ value: l + h * r })) : Array.isArray(A) ? A : []).filter((t) => t.value >= l && t.value <= o), J = d ? Math.min(n[0], n[1]) : l, U = d ? Math.max(n[0], n[1]) : v, O = (t) => d ? t >= J && t <= U : t <= U, ft = d ? Math.min(n[0], n[1]) <= l : v <= l, ht = d ? Math.max(n[0], n[1]) >= o : v >= o, z = d ? j(J, l, o) : 0, Q = j(U, l, o) - z, mt = a ? {
12
- bottom: `${z}%`,
13
- height: `${Q}%`
1
+ import { cn as u } from "../../../helpers/cn.js";
2
+ import { PlusIcon as St } from "../../icons/plus-icon/PlusIcon.js";
3
+ import { RemoveIcon as At } from "../../icons/remove-icon/RemoveIcon.js";
4
+ import { StyledButton as rt } from "../button/StyledButton.js";
5
+ import { HelperRow as Tt } from "../../../helpers/HelperRow.js";
6
+ import { useHelperSlot as Vt } from "../../../helpers/useHelperSlot.js";
7
+ import { StyledInputField as Rt } from "../input-field/StyledInputField.js";
8
+ import { StyledSelectAutocomplete as Dt } from "../select-autocomplete/StyledSelectAutocomplete.js";
9
+ import M from "./StyledSlider.module.js";
10
+ import { useId as $t, useRef as nt, useState as ot } from "react";
11
+ import { jsx as c, jsxs as x } from "react/jsx-runtime";
12
+ var K = (i, r, a) => a === r ? 0 : Math.min(100, Math.max(0, (i - r) / (a - r) * 100)), Ct = (i) => Array.isArray(i) ? [i[0] ?? 0, i[1] ?? 0] : null, Ht = 10;
13
+ function Ut(i) {
14
+ return (i?.length ?? 0) > Ht;
15
+ }
16
+ function Bt({ dataTest: i, min: r = 0, max: a = 100, step: h = 1, value: T, defaultValue: at, disabled: s, size: X = "medium", orientation: Y = "horizontal", marks: V, name: q, className: ct, classes: p, slotProps: R, error: N, errorText: ut, helperText: B, reserveHelperText: it, fromLabel: D, toLabel: $, showButtons: G = !0, ariaLabel: g, ariaLabelledBy: C, onChange: P, onChangeCommitted: H, options: U, autocompleteClassName: st, autocompleteValue: dt, getOptionLabel: ft, isOptionEqualToValue: mt, onAutocompleteChange: ht }) {
17
+ const J = $t(), n = Y === "vertical", d = X === "small" ? 6 : 8, b = nt(null), v = nt(null), [pt, I] = ot(null), [bt, Q] = ot(at ?? r), y = pt ?? T ?? bt, o = Ct(y), f = o !== null, k = N ? ut ?? B : B, { show: z, role: gt } = Vt("StyledSlider", N, k, it);
18
+ if (U?.length && Ut(U)) return /* @__PURE__ */ c(Dt, {
19
+ dataTest: i,
20
+ disableClearable: !0,
21
+ className: u("min-w-[200px]", st),
22
+ size: "small",
23
+ disabled: s,
24
+ error: N,
25
+ helperText: z ? k : "",
26
+ options: U,
27
+ getOptionLabel: ft,
28
+ isOptionEqualToValue: mt,
29
+ value: dt,
30
+ onChange: ht,
31
+ renderInput: (t) => /* @__PURE__ */ c(Rt, {
32
+ dataTest: i,
33
+ ...t,
34
+ name: q,
35
+ slotProps: {
36
+ ...t.slotProps,
37
+ htmlInput: {
38
+ ...t.slotProps.htmlInput,
39
+ ...g ? { "aria-label": typeof g == "function" ? g(0) : g } : {},
40
+ ...C ? { "aria-labelledby": C } : {}
41
+ }
42
+ }
43
+ })
44
+ });
45
+ const _ = (V === !0 && Number.isFinite(h) && h > 0 && a > r ? Array.from({ length: Math.floor((a - r) / h) + 1 }, (t, l) => ({ value: r + h * l })) : Array.isArray(V) ? V : []).filter((t) => t.value >= r && t.value <= a), W = f ? Math.min(o[0], o[1]) : r, E = f ? Math.max(o[0], o[1]) : y, Z = (t) => f ? t >= W && t <= E : t <= E, vt = f ? Math.min(o[0], o[1]) <= r : y <= r, yt = f ? Math.max(o[0], o[1]) >= a : y >= a, F = f ? K(W, r, a) : 0, L = K(E, r, a) - F, wt = n ? {
46
+ bottom: `${F}%`,
47
+ height: `${L}%`
14
48
  } : {
15
- left: `${z}%`,
16
- width: `${Q}%`
17
- }, W = (t) => {
18
- const r = j(t, l, o);
19
- return a ? { bottom: `${r}%` } : { left: `${r}%` };
20
- }, C = (t) => {
21
- const r = t.currentTarget.getBoundingClientRect(), e = a ? 1 - (t.clientY - (r.top + s)) / (r.height - s * 2) : (t.clientX - (r.left + s)) / (r.width - s * 2), f = l + Math.round(Math.min(1, Math.max(0, e)) * ((o - l) / h)) * h;
22
- return Math.min(o, Math.max(l, f));
23
- }, pt = (t) => d && Math.abs((n?.[1] ?? l) - t) < Math.abs((n?.[0] ?? l) - t) ? 1 : 0, bt = (t) => {
24
- if (u) return;
25
- const r = C(t), e = pt(r);
26
- b.current = e, g.current = t.pointerId, t.currentTarget.setPointerCapture(t.pointerId);
27
- const f = I(r, e);
28
- P(f), M?.(t, f, e);
29
- }, gt = (t) => {
30
- if (u || b.current === null || t.pointerId !== g.current) return;
31
- const r = b.current, e = I(C(t), r);
32
- P(e), M?.(t, e, r);
33
- }, vt = (t) => {
34
- if (u || b.current === null || t.pointerId !== g.current) return;
35
- const r = b.current, e = I(C(t), r);
36
- V === void 0 && q(e), k?.(t, e), t.currentTarget.hasPointerCapture(t.pointerId) && t.currentTarget.releasePointerCapture(t.pointerId), P(null), b.current = null, g.current = null;
37
- }, wt = (t) => {
38
- b.current === null || t.pointerId !== g.current || (P(null), b.current = null, g.current = null);
39
- }, Z = (t) => (r) => {
40
- if (u) return;
49
+ left: `${F}%`,
50
+ width: `${L}%`
51
+ }, tt = (t) => {
52
+ const l = K(t, r, a);
53
+ return n ? { bottom: `${l}%` } : { left: `${l}%` };
54
+ }, O = (t) => {
55
+ const l = t.currentTarget.getBoundingClientRect(), e = n ? 1 - (t.clientY - (l.top + d)) / (l.height - d * 2) : (t.clientX - (l.left + d)) / (l.width - d * 2), m = r + Math.round(Math.min(1, Math.max(0, e)) * ((a - r) / h)) * h;
56
+ return Math.min(a, Math.max(r, m));
57
+ }, xt = (t) => f && Math.abs((o?.[1] ?? r) - t) < Math.abs((o?.[0] ?? r) - t) ? 1 : 0, Nt = (t) => {
58
+ if (s) return;
59
+ const l = O(t), e = xt(l);
60
+ b.current = e, v.current = t.pointerId, t.currentTarget.setPointerCapture(t.pointerId);
61
+ const m = S(l, e);
62
+ I(m), P?.(t, m, e);
63
+ }, Mt = (t) => {
64
+ if (s || b.current === null || t.pointerId !== v.current) return;
65
+ const l = b.current, e = S(O(t), l);
66
+ I(e), P?.(t, e, l);
67
+ }, Pt = (t) => {
68
+ if (s || b.current === null || t.pointerId !== v.current) return;
69
+ const l = b.current, e = S(O(t), l);
70
+ T === void 0 && Q(e), H?.(t, e), t.currentTarget.hasPointerCapture(t.pointerId) && t.currentTarget.releasePointerCapture(t.pointerId), I(null), b.current = null, v.current = null;
71
+ }, It = (t) => {
72
+ b.current === null || t.pointerId !== v.current || (I(null), b.current = null, v.current = null);
73
+ }, et = (t) => (l) => {
74
+ if (s) return;
41
75
  const e = t === "increment" ? h || 1 : -(h || 1);
42
- let f = 0, w;
43
- d ? (f = t === "increment" ? 1 : 0, w = t === "increment" ? Math.max(n[0], n[1]) : Math.min(n[0], n[1])) : w = v;
44
- const L = Math.min(o, Math.max(l, w + e));
45
- S(M, r, L, f), S(k, r, L, f);
46
- }, I = (t, r) => {
47
- if (!d) return t;
48
- const e = [n?.[0] ?? 0, n?.[1] ?? 0];
49
- return e[r] = t, r === 0 && e[0] > e[1] && (e[0] = e[1]), r === 1 && e[1] < e[0] && (e[1] = e[0]), e;
50
- }, S = (t, r, e, f) => {
51
- const w = I(e, f);
52
- V === void 0 && q(w), t && t(r, w, f);
53
- }, _ = (t, r) => /* @__PURE__ */ i("input", {
76
+ let m = 0, w;
77
+ f ? (m = t === "increment" ? 1 : 0, w = t === "increment" ? Math.max(o[0], o[1]) : Math.min(o[0], o[1])) : w = y;
78
+ const lt = Math.min(a, Math.max(r, w + e));
79
+ A(P, l, lt, m), A(H, l, lt, m);
80
+ }, S = (t, l) => {
81
+ if (!f) return t;
82
+ const e = [o?.[0] ?? 0, o?.[1] ?? 0];
83
+ return e[l] = t, l === 0 && e[0] > e[1] && (e[0] = e[1]), l === 1 && e[1] < e[0] && (e[1] = e[0]), e;
84
+ }, A = (t, l, e, m) => {
85
+ const w = S(e, m);
86
+ T === void 0 && Q(w), t && t(l, w, m);
87
+ }, j = (t, l) => /* @__PURE__ */ c("input", {
54
88
  type: "range",
55
- "data-testid": d ? `${m}-thumb-${t}` : m,
56
- name: at,
57
- min: l,
58
- max: o,
89
+ "data-testid": f ? `${i}-thumb-${t}` : i,
90
+ name: q,
91
+ min: r,
92
+ max: a,
59
93
  step: h,
60
- value: r,
61
- disabled: u,
62
- "aria-orientation": F,
63
- "aria-label": typeof $ == "function" ? $(t) : $,
64
- "aria-labelledby": it,
94
+ value: l,
95
+ disabled: s,
96
+ "aria-orientation": Y,
97
+ "aria-label": typeof g == "function" ? g(t) : g,
98
+ "aria-labelledby": C,
65
99
  "aria-invalid": N ? !0 : void 0,
66
- "aria-describedby": G ? Y : void 0,
67
- className: c(x.SliderInput, a ? x.Vertical : x.Horizontal, !a && "z-0", B === "small" && x.Small, u && x.Disabled, p?.thumb, R?.thumb?.className),
68
- onChange: (e) => S(M, e, Number(e.currentTarget.value), t),
69
- onKeyUp: (e) => S(k, e, Number(e.currentTarget.value), t)
100
+ "aria-describedby": z ? J : void 0,
101
+ className: u(M.SliderInput, n ? M.Vertical : M.Horizontal, !n && "z-0", X === "small" && M.Small, s && M.Disabled, p?.thumb, R?.thumb?.className),
102
+ onChange: (e) => A(P, e, Number(e.currentTarget.value), t),
103
+ onKeyUp: (e) => A(H, e, Number(e.currentTarget.value), t)
70
104
  }, t);
71
- return /* @__PURE__ */ y("div", {
72
- className: c("flex max-w-[600px] flex-col gap-3", a && "h-full"),
105
+ return /* @__PURE__ */ x("div", {
106
+ className: u("flex max-w-[600px] flex-col gap-3", n && "h-full"),
73
107
  children: [
74
- !a && (T ?? D) && /* @__PURE__ */ y("div", {
108
+ !n && (D ?? $) && /* @__PURE__ */ x("div", {
75
109
  className: "grid w-full grid-cols-2 gap-4",
76
- children: [!a && T && /* @__PURE__ */ i("span", {
110
+ children: [!n && D && /* @__PURE__ */ c("span", {
77
111
  className: "min-w-0 break-words text-left font-normal text-delta-800",
78
- children: T
79
- }), !a && D && /* @__PURE__ */ i("span", {
80
- className: "min-w-0 break-words text-right font-normal text-delta-800",
81
112
  children: D
113
+ }), !n && $ && /* @__PURE__ */ c("span", {
114
+ className: "min-w-0 break-words text-right font-normal text-delta-800",
115
+ children: $
82
116
  })]
83
117
  }),
84
- /* @__PURE__ */ y("div", {
85
- className: c("flex", !a && "w-full items-start gap-3", a && "h-full flex-col items-center"),
118
+ /* @__PURE__ */ x("div", {
119
+ className: u("flex", !n && "w-full items-start gap-3", n && "h-full flex-col items-center"),
86
120
  children: [
87
- !a && X && /* @__PURE__ */ i(tt, {
121
+ !n && G && /* @__PURE__ */ c(rt, {
88
122
  dataTest: "slider-from-button",
89
123
  "aria-label": "Decrease value",
90
124
  className: "-mt-0.5 w-8",
91
125
  variant: "outlined",
92
- disabled: u ?? ft,
93
- startIcon: /* @__PURE__ */ i(xt, {
126
+ disabled: s ?? vt,
127
+ startIcon: /* @__PURE__ */ c(At, {
94
128
  width: 24,
95
129
  height: 24
96
130
  }),
97
- onClick: Z("decrement")
131
+ onClick: et("decrement")
98
132
  }),
99
- /* @__PURE__ */ y("div", {
100
- className: c("relative flex", a ? "h-full w-8 flex-col items-center" : "mt-px w-full flex-col", p?.root, nt),
101
- children: [/* @__PURE__ */ y("div", {
102
- className: c("relative", a ? "h-full w-8" : "h-4 w-full", u ? "cursor-default" : "cursor-pointer"),
133
+ /* @__PURE__ */ x("div", {
134
+ className: u("relative flex", n ? "h-full w-8 flex-col items-center" : "mt-px w-full flex-col", p?.root, ct),
135
+ children: [/* @__PURE__ */ x("div", {
136
+ className: u("relative", n ? "h-full w-8" : "h-4 w-full", s ? "cursor-default" : "cursor-pointer"),
103
137
  style: { touchAction: "none" },
104
- onPointerDown: bt,
105
- onPointerMove: gt,
106
- onPointerUp: vt,
107
- onPointerCancel: wt,
108
- children: [/* @__PURE__ */ y("div", {
109
- className: c("absolute", a ? "left-1/2 w-1 -translate-x-1/2" : "top-[calc(50%+6px)] h-1 -translate-y-1/2"),
110
- style: a ? {
111
- top: s,
112
- bottom: s
138
+ onPointerDown: Nt,
139
+ onPointerMove: Mt,
140
+ onPointerUp: Pt,
141
+ onPointerCancel: It,
142
+ children: [/* @__PURE__ */ x("div", {
143
+ className: u("absolute", n ? "left-1/2 w-1 -translate-x-1/2" : "top-[calc(50%+6px)] h-1 -translate-y-1/2"),
144
+ style: n ? {
145
+ top: d,
146
+ bottom: d
113
147
  } : {
114
- left: s,
115
- right: s
148
+ left: d,
149
+ right: d
116
150
  },
117
151
  children: [
118
- /* @__PURE__ */ i("div", { className: c("absolute inset-0 rounded-full bg-delta-100", p?.rail, R?.rail?.className) }),
119
- /* @__PURE__ */ i("div", {
120
- className: c("absolute rounded-full", a ? "left-0 w-full" : "top-0 h-full", u ? "bg-delta-200" : "bg-gama-500", p?.track),
121
- style: mt
152
+ /* @__PURE__ */ c("div", { className: u("absolute inset-0 rounded-full bg-delta-100", p?.rail, R?.rail?.className) }),
153
+ /* @__PURE__ */ c("div", {
154
+ className: u("absolute rounded-full", n ? "left-0 w-full" : "top-0 h-full", s ? "bg-delta-200" : "bg-gama-500", p?.track),
155
+ style: wt
122
156
  }),
123
- H.map((t) => {
124
- const r = O(t.value);
125
- return /* @__PURE__ */ i("span", {
126
- className: c("absolute z-10 box-border h-2 w-2 -translate-x-1/2 rounded-full border border-solid", a ? "left-1/2 translate-y-1/2" : "top-1/2 -translate-y-1/2", r ? c(u ? "border-delta-200 bg-delta-200" : "border-gama-500 bg-gama-500", p?.markActive) : c("border-delta-300 bg-white", p?.mark)),
127
- style: W(t.value)
157
+ _.map((t) => {
158
+ const l = Z(t.value);
159
+ return /* @__PURE__ */ c("span", {
160
+ className: u("absolute z-10 box-border h-2 w-2 -translate-x-1/2 rounded-full border border-solid", n ? "left-1/2 translate-y-1/2" : "top-1/2 -translate-y-1/2", l ? u(s ? "border-delta-200 bg-delta-200" : "border-gama-500 bg-gama-500", p?.markActive) : u("border-delta-300 bg-white", p?.mark)),
161
+ style: tt(t.value)
128
162
  }, t.value);
129
163
  })
130
164
  ]
131
- }), d ? [_(0, n[0]), _(1, n[1])] : _(0, v)]
132
- }), H.some((t) => t.label != null) && /* @__PURE__ */ i("div", {
133
- className: c(a ? "pointer-events-none absolute inset-x-0" : "relative mt-[14px] h-6"),
134
- style: a ? {
135
- top: s,
136
- bottom: s
165
+ }), f ? [j(0, o[0]), j(1, o[1])] : j(0, y)]
166
+ }), _.some((t) => t.label != null) && /* @__PURE__ */ c("div", {
167
+ className: u(n ? "pointer-events-none absolute inset-x-0" : "relative mt-[14px] h-6"),
168
+ style: n ? {
169
+ top: d,
170
+ bottom: d
137
171
  } : {
138
- marginLeft: s,
139
- marginRight: s
172
+ marginLeft: d,
173
+ marginRight: d
140
174
  },
141
- children: H.map((t) => t.label == null ? null : /* @__PURE__ */ i("span", {
142
- className: c("absolute text-base font-semibold text-delta-700", a ? "left-[37px] translate-y-1/2" : "-translate-x-1/2", O(t.value) && p?.markLabelActive, p?.markLabel, R?.markLabel?.className),
143
- style: W(t.value),
175
+ children: _.map((t) => t.label == null ? null : /* @__PURE__ */ c("span", {
176
+ className: u("absolute text-base font-semibold text-delta-700", n ? "left-[37px] translate-y-1/2" : "-translate-x-1/2", Z(t.value) && p?.markLabelActive, p?.markLabel, R?.markLabel?.className),
177
+ style: tt(t.value),
144
178
  children: t.label
145
179
  }, t.value))
146
180
  })]
147
181
  }),
148
- !a && X && /* @__PURE__ */ i(tt, {
182
+ !n && G && /* @__PURE__ */ c(rt, {
149
183
  dataTest: "slider-to-button",
150
184
  "aria-label": "Increase value",
151
185
  className: "-mt-0.5 w-8",
152
186
  variant: "outlined",
153
- disabled: u ?? ht,
154
- startIcon: /* @__PURE__ */ i(yt, {
187
+ disabled: s ?? yt,
188
+ startIcon: /* @__PURE__ */ c(St, {
155
189
  width: 24,
156
190
  height: 24
157
191
  }),
158
- onClick: Z("increment")
192
+ onClick: et("increment")
159
193
  })
160
194
  ]
161
195
  }),
162
- G && /* @__PURE__ */ i(Nt, {
163
- id: Y,
164
- role: dt,
196
+ z && /* @__PURE__ */ c(Tt, {
197
+ id: J,
198
+ role: gt,
165
199
  error: N,
166
- message: E,
200
+ message: k,
167
201
  className: "m-0 items-center"
168
202
  })
169
203
  ]
170
204
  });
171
- };
205
+ }
172
206
  export {
173
- Ut as StyledSlider
207
+ Bt as StyledSlider
174
208
  };
@@ -1,4 +1,5 @@
1
1
  import { ReactNode, SyntheticEvent } from 'react';
2
+ import { AutocompleteChangeReason } from '../select-autocomplete';
2
3
  export interface SliderMark {
3
4
  value: number;
4
5
  label?: ReactNode;
@@ -31,7 +32,7 @@ interface SliderSlotProps {
31
32
  * DS slider: rail `delta-100` (4px), filled track + thumb + active dots `gama-500`, inactive dots
32
33
  * white/`delta-300`, scale numbers Body Base SemiBold 16/24 `delta-700`. Disabled → `delta-200`.
33
34
  */
34
- export interface StyledSliderProps {
35
+ export interface StyledSliderProps<T = unknown> {
35
36
  dataTest: string;
36
37
  min?: number;
37
38
  max?: number;
@@ -60,6 +61,15 @@ export interface StyledSliderProps {
60
61
  ariaLabelledBy?: string;
61
62
  onChange?: (event: SyntheticEvent, value: SliderValue, activeThumb: number) => void;
62
63
  onChangeCommitted?: (event: SyntheticEvent, value: SliderValue) => void;
64
+ /** Autocomplete options */
65
+ options?: readonly T[];
66
+ autocompleteClassName?: string;
67
+ autocompleteValue?: T | null;
68
+ getOptionLabel?: (option: T) => string;
69
+ isOptionEqualToValue?: (option: T, value: T) => boolean;
70
+ onAutocompleteChange?: (event: SyntheticEvent, value: T | null, reason: AutocompleteChangeReason, details?: {
71
+ option: T;
72
+ }) => void;
63
73
  }
64
74
  /**
65
75
  * Native range-input slider (replaces MUI `Slider`). Single value uses one `<input type="range">`;
@@ -70,5 +80,5 @@ export interface StyledSliderProps {
70
80
  * CI is the visual gate. Upgrade path: tune the 8px thumb inset if a diff shows misalignment.
71
81
  * TASK-204.
72
82
  */
73
- export declare const StyledSlider: ({ dataTest, min, max, step, value, defaultValue, disabled, size, orientation, marks, name, className, classes, slotProps, error, errorText, helperText, reserveHelperText, fromLabel, toLabel, showButtons, ariaLabel, ariaLabelledBy, onChange, onChangeCommitted, }: StyledSliderProps) => JSX.Element;
83
+ export declare function StyledSlider<T>({ dataTest, min, max, step, value, defaultValue, disabled, size, orientation, marks, name, className, classes, slotProps, error, errorText, helperText, reserveHelperText, fromLabel, toLabel, showButtons, ariaLabel, ariaLabelledBy, onChange, onChangeCommitted, options, autocompleteClassName, autocompleteValue, getOptionLabel, isOptionEqualToValue, onAutocompleteChange, }: StyledSliderProps<T>): JSX.Element;
74
84
  export {};
@@ -1,18 +1,18 @@
1
1
  import { cn as u } from "../../helpers/cn.js";
2
2
  import { jsx as x } from "react/jsx-runtime";
3
- var d = ({ children: o, disabled: e, selected: n, className: a, classes: l, onClick: r, onMouseDown: i, onMouseUp: m }) => /* @__PURE__ */ x("li", {
3
+ var c = ({ children: o, disabled: e, selected: n, className: a, classes: i, onClick: t, onMouseDown: l, onMouseUp: m }) => /* @__PURE__ */ x("li", {
4
4
  role: "menuitem",
5
5
  "aria-disabled": e ? !0 : void 0,
6
6
  tabIndex: -1,
7
- onClick: e ? void 0 : r,
8
- onKeyDown: (t) => {
9
- e || (t.key === "Enter" || t.key === " ") && (t.preventDefault(), r?.(t));
7
+ onClick: e ? void 0 : t,
8
+ onKeyDown: (r) => {
9
+ e || (r.key === "Enter" || r.key === " ") && (r.preventDefault(), t?.(r));
10
10
  },
11
- onMouseDown: i,
11
+ onMouseDown: l,
12
12
  onMouseUp: m,
13
- className: u("flex items-center px-3 py-2.5 text-base text-delta-700 outline-none", e ? "cursor-not-allowed" : "cursor-pointer hover:bg-delta-50", n && "bg-gama-50", l?.root, a, e && "aria-disabled:text-delta-300"),
13
+ className: u("box-border flex min-h-10 items-center px-3 py-2 text-base text-delta-700 outline-none", e ? "cursor-not-allowed" : "cursor-pointer hover:bg-delta-50", n && "bg-gama-50", i?.root, a, e && "aria-disabled:text-delta-300"),
14
14
  children: o
15
15
  });
16
16
  export {
17
- d as StyledMenuItem
17
+ c as StyledMenuItem
18
18
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.101.5",
6
+ "version": "3.101.7",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",
@@ -244,17 +244,16 @@ describe('ASMA-8220 touch hardening', () => {
244
244
  }
245
245
 
246
246
  // Designed heights survive: the chip's Figma 32px, the select trigger's 40px (kept in
247
- // step with StyledInputField), and the accordion trigger's 72px.
247
+ // step with StyledInputField), the Figma Menus item 40px option row (same as the
248
+ // StyledSelectAutocomplete compact row), and the accordion trigger's 72px.
248
249
  await expect(container.querySelector('[data-testid="chip"]')!.getBoundingClientRect().height).toBe(32)
249
250
  await expect(container.querySelector('[data-testid="select"]')!.getBoundingClientRect().height).toBe(40)
251
+ await expect(container.querySelector('[role="option"]')!.getBoundingClientRect().height).toBe(40)
250
252
  await expect(container.querySelector('[data-testid="accordion"]')!.getBoundingClientRect().height).toBe(72)
251
- // The chevron and the option row already clear 44px without any override.
253
+ // The chevron already clears 44px without any override.
252
254
  await expect(
253
255
  container.querySelector('[data-testid="chevron"]')!.getBoundingClientRect().height,
254
256
  ).toBeGreaterThanOrEqual(44)
255
- await expect(
256
- container.querySelector('[role="option"]')!.getBoundingClientRect().height,
257
- ).toBeGreaterThanOrEqual(44)
258
257
  // And the clear button stays the 18px icon in 2px padding it has always been — the one
259
258
  // opt-in here that does NOT reach 44px, deliberately: a hit area that big would sit over
260
259
  // the field's own text (see the comment at its call site).