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.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/inputs/select/StyledSelectItem.js +4 -4
- package/dist/components/inputs/slider/StyledSlider.js +156 -122
- package/dist/src/components/inputs/slider/StyledSlider.d.ts +12 -2
- package/dist/table/shared-components/StyledMenuItem.js +7 -7
- package/package.json +1 -1
- package/src/styles/touchHardening.interaction.test.tsx +4 -5
|
@@ -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
|
|
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 :
|
|
12
|
-
className: c("asma-pressable", "relative flex items-center gap-1 px-2 py-2
|
|
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
|
-
|
|
34
|
+
b as StyledSelectItem
|
|
35
35
|
};
|
|
@@ -1,174 +1,208 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { PlusIcon as
|
|
3
|
-
import { RemoveIcon as
|
|
4
|
-
import { StyledButton as
|
|
5
|
-
import { HelperRow as
|
|
6
|
-
import { useHelperSlot as
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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: `${
|
|
16
|
-
width: `${
|
|
17
|
-
},
|
|
18
|
-
const
|
|
19
|
-
return
|
|
20
|
-
},
|
|
21
|
-
const
|
|
22
|
-
return Math.min(
|
|
23
|
-
},
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
b.current = e,
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
if (
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
b.current === null || t.pointerId !==
|
|
39
|
-
},
|
|
40
|
-
if (
|
|
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
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
if (!
|
|
48
|
-
const e = [
|
|
49
|
-
return e[
|
|
50
|
-
},
|
|
51
|
-
const w =
|
|
52
|
-
|
|
53
|
-
},
|
|
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":
|
|
56
|
-
name:
|
|
57
|
-
min:
|
|
58
|
-
max:
|
|
89
|
+
"data-testid": f ? `${i}-thumb-${t}` : i,
|
|
90
|
+
name: q,
|
|
91
|
+
min: r,
|
|
92
|
+
max: a,
|
|
59
93
|
step: h,
|
|
60
|
-
value:
|
|
61
|
-
disabled:
|
|
62
|
-
"aria-orientation":
|
|
63
|
-
"aria-label": typeof
|
|
64
|
-
"aria-labelledby":
|
|
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":
|
|
67
|
-
className:
|
|
68
|
-
onChange: (e) =>
|
|
69
|
-
onKeyUp: (e) =>
|
|
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__ */
|
|
72
|
-
className:
|
|
105
|
+
return /* @__PURE__ */ x("div", {
|
|
106
|
+
className: u("flex max-w-[600px] flex-col gap-3", n && "h-full"),
|
|
73
107
|
children: [
|
|
74
|
-
!
|
|
108
|
+
!n && (D ?? $) && /* @__PURE__ */ x("div", {
|
|
75
109
|
className: "grid w-full grid-cols-2 gap-4",
|
|
76
|
-
children: [!
|
|
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__ */
|
|
85
|
-
className:
|
|
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
|
-
!
|
|
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:
|
|
93
|
-
startIcon: /* @__PURE__ */
|
|
126
|
+
disabled: s ?? vt,
|
|
127
|
+
startIcon: /* @__PURE__ */ c(At, {
|
|
94
128
|
width: 24,
|
|
95
129
|
height: 24
|
|
96
130
|
}),
|
|
97
|
-
onClick:
|
|
131
|
+
onClick: et("decrement")
|
|
98
132
|
}),
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
className:
|
|
101
|
-
children: [/* @__PURE__ */
|
|
102
|
-
className:
|
|
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:
|
|
105
|
-
onPointerMove:
|
|
106
|
-
onPointerUp:
|
|
107
|
-
onPointerCancel:
|
|
108
|
-
children: [/* @__PURE__ */
|
|
109
|
-
className:
|
|
110
|
-
style:
|
|
111
|
-
top:
|
|
112
|
-
bottom:
|
|
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:
|
|
115
|
-
right:
|
|
148
|
+
left: d,
|
|
149
|
+
right: d
|
|
116
150
|
},
|
|
117
151
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
className:
|
|
121
|
-
style:
|
|
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
|
-
|
|
124
|
-
const
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
-
className:
|
|
127
|
-
style:
|
|
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
|
-
}),
|
|
132
|
-
}),
|
|
133
|
-
className:
|
|
134
|
-
style:
|
|
135
|
-
top:
|
|
136
|
-
bottom:
|
|
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:
|
|
139
|
-
marginRight:
|
|
172
|
+
marginLeft: d,
|
|
173
|
+
marginRight: d
|
|
140
174
|
},
|
|
141
|
-
children:
|
|
142
|
-
className:
|
|
143
|
-
style:
|
|
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
|
-
!
|
|
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:
|
|
154
|
-
startIcon: /* @__PURE__ */
|
|
187
|
+
disabled: s ?? yt,
|
|
188
|
+
startIcon: /* @__PURE__ */ c(St, {
|
|
155
189
|
width: 24,
|
|
156
190
|
height: 24
|
|
157
191
|
}),
|
|
158
|
-
onClick:
|
|
192
|
+
onClick: et("increment")
|
|
159
193
|
})
|
|
160
194
|
]
|
|
161
195
|
}),
|
|
162
|
-
|
|
163
|
-
id:
|
|
164
|
-
role:
|
|
196
|
+
z && /* @__PURE__ */ c(Tt, {
|
|
197
|
+
id: J,
|
|
198
|
+
role: gt,
|
|
165
199
|
error: N,
|
|
166
|
-
message:
|
|
200
|
+
message: k,
|
|
167
201
|
className: "m-0 items-center"
|
|
168
202
|
})
|
|
169
203
|
]
|
|
170
204
|
});
|
|
171
|
-
}
|
|
205
|
+
}
|
|
172
206
|
export {
|
|
173
|
-
|
|
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
|
|
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
|
|
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 :
|
|
8
|
-
onKeyDown: (
|
|
9
|
-
e || (
|
|
7
|
+
onClick: e ? void 0 : t,
|
|
8
|
+
onKeyDown: (r) => {
|
|
9
|
+
e || (r.key === "Enter" || r.key === " ") && (r.preventDefault(), t?.(r));
|
|
10
10
|
},
|
|
11
|
-
onMouseDown:
|
|
11
|
+
onMouseDown: l,
|
|
12
12
|
onMouseUp: m,
|
|
13
|
-
className: u("flex items-center px-3 py-2
|
|
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
|
-
|
|
17
|
+
c as StyledMenuItem
|
|
18
18
|
};
|
package/package.json
CHANGED
|
@@ -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),
|
|
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
|
|
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).
|