asma-ui-core 3.101.4 → 3.101.6

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,8 +1,8 @@
1
- import { resolveSx as v } from "../../../helpers/sx.js";
2
- import g from "clsx";
3
- import { useEffect as I, useRef as y } from "react";
4
- import { jsx as h, jsxs as T } from "react/jsx-runtime";
5
- var _ = {
1
+ import { resolveSx as g } from "../../../helpers/sx.js";
2
+ import y from "clsx";
3
+ import { useEffect as Z, useRef as h } from "react";
4
+ import { jsx as _, jsxs as G } from "react/jsx-runtime";
5
+ var w = {
6
6
  primary: {
7
7
  backgroundColor: "var(--colors-badge-background)",
8
8
  color: "var(--colors-badge-label)"
@@ -31,43 +31,47 @@ var _ = {
31
31
  backgroundColor: "var(--colors-warning-700)",
32
32
  color: "#fff"
33
33
  }
34
- }, Z = {
34
+ }, H = {
35
35
  "top-right": "top-0 right-0 translate-x-1/2 -translate-y-1/2 origin-[100%_0%]",
36
36
  "top-left": "top-0 left-0 -translate-x-1/2 -translate-y-1/2 origin-[0%_0%]",
37
37
  "bottom-right": "bottom-0 right-0 translate-x-1/2 translate-y-1/2 origin-[100%_100%]",
38
38
  "bottom-left": "bottom-0 left-0 -translate-x-1/2 translate-y-1/2 origin-[0%_100%]"
39
- }, w = "& .MuiBadge-badge", U = ({ color: s = "primary", dataTest: S, size: i = "medium", badgeContent: o, max: G, showZero: H, variant: k = "standard", purpose: j = "notification", statusMessage: c, invisible: A, anchorOrigin: d, children: f, className: u, sx: e, overlap: W, classes: X, slots: Y, slotProps: m, component: q, tabIndex: F, ...p }) => {
40
- const l = y(null), a = typeof o == "number" ? o : void 0, b = y(a);
41
- I(() => {
42
- a !== b.current && (b.current = a, l.current && (l.current.textContent = c ?? ""));
43
- }, [a, c]);
44
- const x = e && typeof e == "object" && !Array.isArray(e) ? e : {}, C = v(x[w]), O = v(Object.fromEntries(Object.entries(x).filter(([z]) => z !== w))), r = k === "dot", n = r && j !== "notification", t = r && f === void 0, R = !!A || !r && (o === 0 || o === void 0 || o === null), D = r ? null : typeof o == "number" && o > 99 ? "99+" : o, B = typeof o == "number" && o > 0 && o < 10, E = d?.vertical ?? "top", L = d?.horizontal ?? "right", N = s === "primary" && !n ? {
39
+ }, S = "& .MuiBadge-badge", P = ({ color: i = "primary", dataTest: k, size: c = "medium", badgeContent: o, max: W, showZero: X, variant: j = "standard", purpose: A = "notification", statusMessage: d, invisible: C, anchorOrigin: f, children: p, className: u, sx: e, overlap: Y, classes: q, slots: F, slotProps: m, component: J, tabIndex: K, "aria-label": a, ...O }) => {
40
+ const n = h(null), l = typeof o == "number" ? o : void 0, b = h(l);
41
+ Z(() => {
42
+ l !== b.current && (b.current = l, n.current && (n.current.textContent = d ?? ""));
43
+ }, [l, d]);
44
+ const x = e && typeof e == "object" && !Array.isArray(e) ? e : {}, R = g(x[S]), B = g(Object.fromEntries(Object.entries(x).filter(([T]) => T !== S))), r = j === "dot", s = r && A !== "notification", t = p === void 0, v = !!C || !r && (o === 0 || o === void 0 || o === null), D = r ? null : typeof o == "number" && o > 99 ? "99+" : o, E = typeof o == "number" && o > 0 && o < 10, N = f?.vertical ?? "top", $ = f?.horizontal ?? "right", z = i === "primary" && !s ? {
45
45
  borderColor: r ? "var(--colors-badge-border-dot)" : "var(--colors-badge-border-count)",
46
46
  borderStyle: "solid",
47
47
  borderWidth: r ? "var(--border-badge-dot)" : "var(--border-badge-count)"
48
- } : {}, $ = t && p["aria-label"] ? { role: "img" } : {};
49
- return /* @__PURE__ */ T("span", {
50
- className: t ? g("inline-flex shrink-0 align-middle", u) : "relative inline-flex shrink-0 align-middle",
51
- "data-testid": S,
52
- style: O,
53
- ...$,
54
- ...p,
48
+ } : {}, I = t && !v && a ? {
49
+ role: "img",
50
+ "aria-label": a
51
+ } : {}, L = !t && a ? { "aria-label": a } : {};
52
+ return /* @__PURE__ */ G("span", {
53
+ className: t ? y("inline-flex shrink-0 align-middle", u) : "relative inline-flex shrink-0 align-middle",
54
+ "data-testid": k,
55
+ style: B,
56
+ ...L,
57
+ ...I,
58
+ ...O,
55
59
  children: [
56
- f,
57
- !R && /* @__PURE__ */ h("span", {
60
+ p,
61
+ !v && /* @__PURE__ */ _("span", {
58
62
  "aria-hidden": "true",
59
- className: g("box-border flex items-center justify-center whitespace-nowrap font-roboto font-semibold", !t && "absolute z-[1]", !t && Z[`${E}-${L}`], n ? "h-[8px] w-[8px] min-w-[8px] rounded-full p-0" : r ? "h-[12px] w-[12px] min-w-[12px] rounded-full p-0" : i === "small" ? "h-[16px] w-max min-w-[16px] rounded-[20px] px-[4px] text-[0.75rem]" : "h-[20px] min-w-[20px] rounded-[20px] px-[6px] text-sm leading-5", !r && i === "medium" && B && "w-[20px]", !t && u, m?.badge?.className),
63
+ className: y("box-border flex items-center justify-center whitespace-nowrap font-roboto font-semibold", !t && "absolute z-[1]", !t && H[`${N}-${$}`], s ? "h-[8px] w-[8px] min-w-[8px] rounded-full p-0" : r ? "h-[12px] w-[12px] min-w-[12px] rounded-full p-0" : c === "small" ? "h-[16px] w-max min-w-[16px] rounded-[20px] px-[4px] text-[0.75rem]" : "h-[20px] min-w-[20px] rounded-[20px] px-[6px] text-sm leading-5", !r && c === "medium" && E && "w-[20px]", !t && u, m?.badge?.className),
60
64
  style: {
61
- ..._[s] ?? _.default,
62
- ...n ? { backgroundColor: "var(--colors-gama-500)" } : {},
63
- ...N,
64
- ...C,
65
+ ...w[i] ?? w.default,
66
+ ...s ? { backgroundColor: "var(--colors-gama-500)" } : {},
67
+ ...z,
68
+ ...R,
65
69
  ...m?.badge?.style
66
70
  },
67
71
  children: D
68
72
  }),
69
- /* @__PURE__ */ h("span", {
70
- ref: l,
73
+ /* @__PURE__ */ _("span", {
74
+ ref: n,
71
75
  "aria-atomic": "true",
72
76
  "aria-live": "polite",
73
77
  className: "sr-only",
@@ -77,5 +81,5 @@ var _ = {
77
81
  });
78
82
  };
79
83
  export {
80
- U as StyledBadge
84
+ P as StyledBadge
81
85
  };
@@ -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
  };
@@ -8,9 +8,10 @@ type StyledBadgePurpose = 'notification' | 'unread' | 'filter';
8
8
  * `dot` = 12px lime circle with a stronger 2px border. Other colors and `small` are legacy app
9
9
  * extensions with no matching Figma notification variant.
10
10
  *
11
- * Pass children to decorate them — the badge anchors to their corner. Pass none and a `dot` becomes
12
- * a flow element (Figma `Size=Dot`, node 44267-214524), for a table cell or a marker in a row, and
13
- * `className` then applies to the badge's own root so the caller can place it.
11
+ * Pass children to decorate them — the badge anchors to their corner. Pass none and the badge,
12
+ * count or dot, becomes a flow element (for the dot, Figma `Size=Dot`, node 44267-214524), for a
13
+ * table cell or a marker in a row, and `className` then applies to the badge's own root so the
14
+ * caller can place it.
14
15
  *
15
16
  * `purpose` selects Figma's `Parent`: the default notification dot, or the 8px solid primary dot
16
17
  * that marks something unread or a filter as active.
@@ -26,7 +27,7 @@ interface BadgeProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'> {
26
27
  showZero?: boolean;
27
28
  /**
28
29
  * @figmaProp Size = dot→"Dot" (12px) | standard→"Default" count badge
29
- * A `dot` with no children renders in normal flow rather than anchored to a corner.
30
+ * With no children the badge renders in normal flow rather than anchored to a corner.
30
31
  */
31
32
  variant?: 'standard' | 'dot';
32
33
  /**
@@ -64,5 +65,5 @@ type StyledBadgeProps = BadgeProps & {
64
65
  * The established styling API `sx={{ '& .MuiBadge-badge': {...} }}` is preserved by extracting that
65
66
  * slot and applying `resolveSx` to the badge span (DEC-007 slot-sx). Signature unchanged (DEC-003).
66
67
  */
67
- export declare const StyledBadge: ({ color, dataTest, size, badgeContent, max: _max, showZero: _showZero, variant, purpose, statusMessage, invisible, anchorOrigin, children, className, sx, overlap: _overlap, classes: _classes, slots: _slots, slotProps, component: _component, tabIndex: _tabIndex, ...props }: StyledBadgeProps) => JSX.Element;
68
+ export declare const StyledBadge: ({ color, dataTest, size, badgeContent, max: _max, showZero: _showZero, variant, purpose, statusMessage, invisible, anchorOrigin, children, className, sx, overlap: _overlap, classes: _classes, slots: _slots, slotProps, component: _component, tabIndex: _tabIndex, "aria-label": ariaLabel, ...props }: StyledBadgeProps) => JSX.Element;
68
69
  export {};
@@ -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 {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.101.4",
6
+ "version": "3.101.6",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",