asma-ui-core 3.81.1 → 3.81.3

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.
@@ -153,6 +153,7 @@ function Y({ items: i, expanded: n, onToggleExpanded: d, leadSlot: s, actionSlot
153
153
  }),
154
154
  /* @__PURE__ */ e("div", {
155
155
  "aria-hidden": !0,
156
+ inert: "true",
156
157
  className: h.measureLayer,
157
158
  children: /* @__PURE__ */ I("div", {
158
159
  className: h.measureRow,
@@ -1,37 +1,37 @@
1
- import { cn as a } from "../../../helpers/cn.js";
1
+ import { cn as o } from "../../../helpers/cn.js";
2
2
  import { StyledChip as f } from "../chip/StyledChip.js";
3
3
  import { StyledCheckbox as v } from "../../inputs/checkbox/base-ui/StyledCheckbox.js";
4
4
  import { StyledRadio as u } from "../../inputs/radio-button/base-ui/StyledRadio.js";
5
5
  import i from "./StyledInteractiveChip.module.js";
6
6
  import { forwardRef as x } from "react";
7
- import { jsx as o } from "react/jsx-runtime";
8
- var y = "[&[data-testid][role=button]]:border-2 [&[data-testid][role=button]]:border-gama-400 [&[data-testid][role=button]]:bg-gama-25", S = { paddingLeft: "6px" }, h = x(({ type: r = "checkbox", checked: t, size: l = "small", ariaLabel: n, ...e }, c) => {
9
- const d = r === "checkbox", m = n ?? (typeof e.label == "string" ? e.label : void 0), s = !e.readOnly && !d && !!t, b = d ? /* @__PURE__ */ o(v, {
7
+ import { jsx as r } from "react/jsx-runtime";
8
+ var y = "[&[data-testid][role=button]]:border-2 [&[data-testid][role=button]]:border-gama-400 [&[data-testid][role=button]]:bg-gama-25", S = { paddingLeft: "6px" }, h = x(({ type: l = "checkbox", checked: t, size: d = "small", ariaLabel: n, ...e }, c) => {
9
+ const a = l === "checkbox", m = n ?? (typeof e.label == "string" ? e.label : void 0), s = !e.readOnly && !a && !!t, b = a ? /* @__PURE__ */ r(v, {
10
10
  dataTest: e.dataTest,
11
11
  disableRipple: !0,
12
12
  checked: t,
13
- size: l,
13
+ size: d,
14
14
  readOnly: e.readOnly,
15
15
  decorative: !0,
16
- className: a("pointer-events-none", i.control)
17
- }) : /* @__PURE__ */ o(u, {
16
+ className: o("pointer-events-none", i.control)
17
+ }) : /* @__PURE__ */ r(u, {
18
18
  dataTest: e.dataTest,
19
19
  checked: t,
20
- size: l,
20
+ size: d,
21
21
  decorative: !0,
22
- className: a("pointer-events-none", i.control)
22
+ className: o("pointer-events-none", i.control)
23
23
  });
24
- return /* @__PURE__ */ o(f, {
24
+ return /* @__PURE__ */ r(f, {
25
25
  ref: c,
26
26
  "aria-label": m,
27
- role: r,
27
+ role: l,
28
28
  "aria-checked": !!t,
29
- "aria-readonly": e.readOnly,
29
+ "aria-readonly": a ? e.readOnly : void 0,
30
30
  avatar: b,
31
31
  clickable: !0,
32
32
  tabIndex: 0,
33
33
  ...e,
34
- className: a(s && y, e.className),
34
+ className: o(s && y, e.className),
35
35
  sx: {
36
36
  ...S,
37
37
  ...e.sx
@@ -1,11 +1,11 @@
1
1
  import { cn as u } from "../../../helpers/cn.js";
2
2
  import { HelperRow as ft } from "../../../helpers/HelperRow.js";
3
- import { useHelperSlot as ht } from "../../../helpers/useHelperSlot.js";
3
+ import { useHelperSlot as pt } from "../../../helpers/useHelperSlot.js";
4
4
  import y from "./StyledSlider.module.js";
5
- import { useId as pt, useRef as O, useState as Q } from "react";
5
+ import { useId as ht, useRef as O, useState as Q } from "react";
6
6
  import { jsx as b, jsxs as H } from "react/jsx-runtime";
7
- var U = (i, l, o) => o === l ? 0 : Math.min(100, Math.max(0, (i - l) / (o - l) * 100)), mt = (i) => Array.isArray(i) ? [i[0] ?? 0, i[1] ?? 0] : null, wt = ({ dataTest: i, min: l = 0, max: o = 100, step: h = 1, value: w, defaultValue: W, disabled: p, size: z = "medium", orientation: C = "horizontal", marks: M, name: Z, className: k, classes: s, slotProps: x, error: v, errorText: tt, helperText: L, reserveHelperText: et, ariaLabel: S, ariaLabelledBy: rt, onChange: A, onChangeCommitted: _ }) => {
8
- const j = pt(), n = C === "vertical", a = z === "small" ? 6 : 8, d = O(null), g = O(null), [lt, N] = Q(null), [nt, F] = Q(W ?? l), I = lt ?? w ?? nt, c = mt(I), f = c !== null, B = v ? tt ?? L : L, { show: K, role: ot } = ht("StyledSlider", v, B, et), V = (M === !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(M) ? M : []).filter((t) => t.value >= l && t.value <= o), X = f ? Math.min(c[0], c[1]) : l, R = f ? Math.max(c[0], c[1]) : I, Y = (t) => f ? t >= X && t <= R : t <= R, $ = f ? U(X, l, o) : 0, q = U(R, l, o) - $, at = n ? {
7
+ var U = (i, l, o) => o === l ? 0 : Math.min(100, Math.max(0, (i - l) / (o - l) * 100)), mt = (i) => Array.isArray(i) ? [i[0] ?? 0, i[1] ?? 0] : null, wt = ({ dataTest: i, min: l = 0, max: o = 100, step: h = 1, value: w, defaultValue: W, disabled: s, size: z = "medium", orientation: C = "horizontal", marks: M, name: Z, className: k, classes: d, slotProps: x, error: v, errorText: tt, helperText: L, reserveHelperText: et, ariaLabel: S, ariaLabelledBy: rt, onChange: A, onChangeCommitted: _ }) => {
8
+ const j = ht(), n = C === "vertical", a = z === "small" ? 6 : 8, f = O(null), g = O(null), [lt, N] = Q(null), [nt, F] = Q(W ?? l), I = lt ?? w ?? nt, c = mt(I), p = c !== null, B = v ? tt ?? L : L, { show: K, role: ot } = pt("StyledSlider", v, B, et), V = (M === !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(M) ? M : []).filter((t) => t.value >= l && t.value <= o), X = p ? Math.min(c[0], c[1]) : l, R = p ? Math.max(c[0], c[1]) : I, Y = (t) => p ? t >= X && t <= R : t <= R, $ = p ? U(X, l, o) : 0, q = U(R, l, o) - $, at = n ? {
9
9
  bottom: `${$}%`,
10
10
  height: `${q}%`
11
11
  } : {
@@ -17,24 +17,24 @@ var U = (i, l, o) => o === l ? 0 : Math.min(100, Math.max(0, (i - l) / (o - l) *
17
17
  }, T = (t) => {
18
18
  const r = t.currentTarget.getBoundingClientRect(), e = n ? 1 - (t.clientY - (r.top + a)) / (r.height - a * 2) : (t.clientX - (r.left + a)) / (r.width - a * 2), m = l + Math.round(Math.min(1, Math.max(0, e)) * ((o - l) / h)) * h;
19
19
  return Math.min(o, Math.max(l, m));
20
- }, ct = (t) => f && Math.abs((c?.[1] ?? l) - t) < Math.abs((c?.[0] ?? l) - t) ? 1 : 0, ut = (t) => {
21
- if (p) return;
20
+ }, ct = (t) => p && Math.abs((c?.[1] ?? l) - t) < Math.abs((c?.[0] ?? l) - t) ? 1 : 0, ut = (t) => {
21
+ if (s) return;
22
22
  const r = T(t), e = ct(r);
23
- d.current = e, g.current = t.pointerId, t.currentTarget.setPointerCapture(t.pointerId);
23
+ f.current = e, g.current = t.pointerId, t.currentTarget.setPointerCapture(t.pointerId);
24
24
  const m = P(r, e);
25
25
  N(m), A?.(t, m, e);
26
26
  }, it = (t) => {
27
- if (p || d.current === null || t.pointerId !== g.current) return;
28
- const r = d.current, e = P(T(t), r);
27
+ if (s || f.current === null || t.pointerId !== g.current) return;
28
+ const r = f.current, e = P(T(t), r);
29
29
  N(e), A?.(t, e, r);
30
30
  }, st = (t) => {
31
- if (p || d.current === null || t.pointerId !== g.current) return;
32
- const r = d.current, e = P(T(t), r);
33
- w === void 0 && F(e), _?.(t, e), t.currentTarget.hasPointerCapture(t.pointerId) && t.currentTarget.releasePointerCapture(t.pointerId), N(null), d.current = null, g.current = null;
31
+ if (s || f.current === null || t.pointerId !== g.current) return;
32
+ const r = f.current, e = P(T(t), r);
33
+ w === void 0 && F(e), _?.(t, e), t.currentTarget.hasPointerCapture(t.pointerId) && t.currentTarget.releasePointerCapture(t.pointerId), N(null), f.current = null, g.current = null;
34
34
  }, dt = (t) => {
35
- d.current === null || t.pointerId !== g.current || (N(null), d.current = null, g.current = null);
35
+ f.current === null || t.pointerId !== g.current || (N(null), f.current = null, g.current = null);
36
36
  }, P = (t, r) => {
37
- if (!f) return t;
37
+ if (!p) return t;
38
38
  const e = [c?.[0] ?? 0, c?.[1] ?? 0];
39
39
  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;
40
40
  }, G = (t, r, e, m) => {
@@ -42,27 +42,27 @@ var U = (i, l, o) => o === l ? 0 : Math.min(100, Math.max(0, (i - l) / (o - l) *
42
42
  w === void 0 && F(J), t && t(r, J, m);
43
43
  }, D = (t, r) => /* @__PURE__ */ b("input", {
44
44
  type: "range",
45
- "data-testid": f ? `${i}-thumb-${t}` : i,
45
+ "data-testid": p ? `${i}-thumb-${t}` : i,
46
46
  name: Z,
47
47
  min: l,
48
48
  max: o,
49
49
  step: h,
50
50
  value: r,
51
- disabled: p,
51
+ disabled: s,
52
52
  "aria-orientation": C,
53
53
  "aria-label": typeof S == "function" ? S(t) : S,
54
54
  "aria-labelledby": rt,
55
55
  "aria-invalid": v ? !0 : void 0,
56
56
  "aria-describedby": K ? j : void 0,
57
- className: u(y.SliderInput, n ? y.Vertical : y.Horizontal, !n && "z-0", z === "small" && y.Small, p && y.Disabled, s?.thumb, x?.thumb?.className),
57
+ className: u(y.SliderInput, n ? y.Vertical : y.Horizontal, !n && "z-0", z === "small" && y.Small, s && y.Disabled, d?.thumb, x?.thumb?.className),
58
58
  onChange: (e) => G(A, e, Number(e.currentTarget.value), t),
59
59
  onKeyUp: (e) => G(_, e, Number(e.currentTarget.value), t)
60
60
  }, t);
61
61
  return /* @__PURE__ */ H("div", {
62
- className: u("relative flex", n ? "h-full w-8 flex-col items-center" : "mt-px w-full flex-col", s?.root, k),
62
+ className: u("relative flex", n ? "h-full w-8 flex-col items-center" : "mt-px w-full flex-col", d?.root, k),
63
63
  children: [
64
64
  /* @__PURE__ */ H("div", {
65
- className: u("relative", n ? "h-full w-8" : "h-4 w-full"),
65
+ className: u("relative", n ? "h-full w-8" : "h-4 w-full", s ? "cursor-default" : "cursor-pointer"),
66
66
  style: { touchAction: "none" },
67
67
  onPointerDown: ut,
68
68
  onPointerMove: it,
@@ -78,20 +78,20 @@ var U = (i, l, o) => o === l ? 0 : Math.min(100, Math.max(0, (i - l) / (o - l) *
78
78
  right: a
79
79
  },
80
80
  children: [
81
- /* @__PURE__ */ b("div", { className: u("absolute inset-0 rounded-full bg-delta-100", s?.rail, x?.rail?.className) }),
81
+ /* @__PURE__ */ b("div", { className: u("absolute inset-0 rounded-full bg-delta-100", d?.rail, x?.rail?.className) }),
82
82
  /* @__PURE__ */ b("div", {
83
- className: u("absolute rounded-full", n ? "left-0 w-full" : "top-0 h-full", p ? "bg-delta-200" : "bg-gama-500", s?.track),
83
+ className: u("absolute rounded-full", n ? "left-0 w-full" : "top-0 h-full", s ? "bg-delta-200" : "bg-gama-500", d?.track),
84
84
  style: at
85
85
  }),
86
86
  V.map((t) => {
87
87
  const r = Y(t.value);
88
88
  return /* @__PURE__ */ b("span", {
89
- 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", r ? u(p ? "border-delta-200 bg-delta-200" : "border-gama-500 bg-gama-500", s?.markActive) : u("border-delta-300 bg-white", s?.mark)),
89
+ 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", r ? u(s ? "border-delta-200 bg-delta-200" : "border-gama-500 bg-gama-500", d?.markActive) : u("border-delta-300 bg-white", d?.mark)),
90
90
  style: E(t.value)
91
91
  }, t.value);
92
92
  })
93
93
  ]
94
- }), f ? [D(0, c[0]), D(1, c[1])] : D(0, I)]
94
+ }), p ? [D(0, c[0]), D(1, c[1])] : D(0, I)]
95
95
  }),
96
96
  V.some((t) => t.label != null) && /* @__PURE__ */ b("div", {
97
97
  className: u(n ? "pointer-events-none absolute inset-x-0" : "relative mt-[14px] h-6"),
@@ -103,7 +103,7 @@ var U = (i, l, o) => o === l ? 0 : Math.min(100, Math.max(0, (i - l) / (o - l) *
103
103
  marginRight: a
104
104
  },
105
105
  children: V.map((t) => t.label == null ? null : /* @__PURE__ */ b("span", {
106
- className: u("absolute text-base font-semibold text-delta-700", n ? "left-[37px] translate-y-1/2" : "-translate-x-1/2", Y(t.value) && s?.markLabelActive, s?.markLabel, x?.markLabel?.className),
106
+ className: u("absolute text-base font-semibold text-delta-700", n ? "left-[37px] translate-y-1/2" : "-translate-x-1/2", Y(t.value) && d?.markLabelActive, d?.markLabel, x?.markLabel?.className),
107
107
  style: E(t.value),
108
108
  children: t.label
109
109
  }, t.value))
@@ -1,29 +1,31 @@
1
- import { cn as a } from "../../helpers/cn.js";
2
- import { resolveSx as v } from "../../helpers/sx.js";
3
- import { cloneElement as u, isValidElement as s } from "react";
4
- import { jsx as b, jsxs as g } from "react/jsx-runtime";
5
- var h = {
1
+ import { cn as o } from "../../helpers/cn.js";
2
+ import { resolveSx as h } from "../../helpers/sx.js";
3
+ import { cloneElement as g, isValidElement as t, useId as C } from "react";
4
+ import { jsx as y, jsxs as A } from "react/jsx-runtime";
5
+ var E = {
6
6
  end: "flex-row",
7
7
  start: "flex-row-reverse",
8
8
  top: "flex-col-reverse",
9
9
  bottom: "flex-col"
10
- }, k = ({ control: e, label: t, checked: o, disabled: n, name: i, value: m, labelPlacement: d = "end", className: c, sx: f, onChange: p }) => {
11
- const l = s(e) ? e.props : {}, r = n ?? l.disabled ?? !1, x = s(e) ? u(e, {
12
- checked: l.checked ?? o,
13
- onChange: l.onChange ?? p,
14
- disabled: r,
15
- name: l.name ?? i,
16
- value: l.value ?? m
17
- }) : e;
18
- return /* @__PURE__ */ g("label", {
19
- className: a("m-0 inline-flex items-center gap-2 align-middle text-delta-800", r ? "cursor-default" : "cursor-pointer", h[d], c),
10
+ }, k = ({ control: l, label: a, checked: i, disabled: d, name: m, value: c, labelPlacement: b = "end", className: f, sx: x, onChange: p }) => {
11
+ const e = t(l) ? l.props : {}, s = d ?? e.disabled ?? !1, r = C(), u = e["aria-label"] != null || e["aria-labelledby"] != null, n = t(l) && a != null && !u, v = t(l) ? g(l, {
12
+ checked: e.checked ?? i,
13
+ onChange: e.onChange ?? p,
14
+ disabled: s,
15
+ name: e.name ?? m,
16
+ value: e.value ?? c,
17
+ ...n ? { "aria-labelledby": r } : {}
18
+ }) : l;
19
+ return /* @__PURE__ */ A("label", {
20
+ className: o("m-0 inline-flex items-center gap-2 align-middle text-delta-800", s ? "cursor-default" : "cursor-pointer", E[b], f),
20
21
  style: {
21
22
  fontFamily: "Roboto, Helvetica, Arial, sans-serif",
22
- ...v(f)
23
+ ...h(x)
23
24
  },
24
- children: [x, t != null && /* @__PURE__ */ b("span", {
25
- className: a("text-sm leading-5 tracking-[0.00938em]", r && "text-delta-300"),
26
- children: t
25
+ children: [v, a != null && /* @__PURE__ */ y("span", {
26
+ id: n ? r : void 0,
27
+ className: o("text-sm leading-5 tracking-[0.00938em]", s && "text-delta-300"),
28
+ children: a
27
29
  })]
28
30
  });
29
31
  };
@@ -1,11 +1,11 @@
1
1
  import { ChevronRightIcon as f } from "../../../../components/icons/chevron-right-icon/ChevronRightIcon.js";
2
2
  import { ChevronLeftIcon as u } from "../../../../components/icons/chevron-left-icon/ChevronLeftIcon.js";
3
- import { StyledButton as e } from "../../../shared-components/button/StyledButton.js";
3
+ import { StyledButton as a } from "../../../shared-components/button/StyledButton.js";
4
4
  import { jsx as t, jsxs as s } from "react/jsx-runtime";
5
5
  import { useNavigation as y } from "react-day-picker";
6
6
  import { isDate as v, isValid as x } from "date-fns";
7
- var j = ({ onClose: m, isNb: n, selected: i, removeSelection: h, setMonth: a, onClear: d, required: p }) => {
8
- const { nextMonth: l, previousMonth: r } = y(), c = i == null ? !1 : Array.isArray(i) ? i.length > 0 : v(i) ? x(i) : typeof i == "object" ? Object.values(i).some(Boolean) : !0;
7
+ var j = ({ onClose: m, isNb: e, selected: i, removeSelection: h, setMonth: n, onClear: d, required: p }) => {
8
+ const { nextMonth: r, previousMonth: l } = y(), c = i == null ? !1 : Array.isArray(i) ? i.length > 0 : v(i) ? x(i) : typeof i == "object" ? Object.values(i).some(Boolean) : !0;
9
9
  return /* @__PURE__ */ s("div", {
10
10
  style: {
11
11
  marginTop: "8px",
@@ -13,16 +13,16 @@ var j = ({ onClose: m, isNb: n, selected: i, removeSelection: h, setMonth: a, on
13
13
  justifyContent: "space-between"
14
14
  },
15
15
  children: [
16
- /* @__PURE__ */ t(e, {
16
+ /* @__PURE__ */ t(a, {
17
17
  dataTest: "",
18
18
  variant: "text",
19
19
  onClick: (o) => {
20
- d ? d() : h(o), a(new Date(Date.now()));
20
+ d ? d() : h(o), n(new Date(Date.now()));
21
21
  },
22
22
  size: "small",
23
23
  disabled: !!p || !c,
24
24
  style: { minWidth: "60px" },
25
- children: n ? "Nullstill" : "Clear"
25
+ children: e ? "Nullstill" : "Clear"
26
26
  }),
27
27
  /* @__PURE__ */ s("div", {
28
28
  style: {
@@ -30,13 +30,14 @@ var j = ({ onClose: m, isNb: n, selected: i, removeSelection: h, setMonth: a, on
30
30
  gap: 8
31
31
  },
32
32
  children: [
33
- /* @__PURE__ */ t(e, {
33
+ /* @__PURE__ */ t(a, {
34
34
  dataTest: "",
35
+ "aria-label": e ? "Forrige maned" : "Previous month",
35
36
  variant: "outlined",
36
37
  size: "small",
37
- disabled: !r,
38
+ disabled: !l,
38
39
  onClick: () => {
39
- r && a(r);
40
+ l && n(l);
40
41
  },
41
42
  style: { minWidth: "25px" },
42
43
  children: /* @__PURE__ */ t(u, {
@@ -44,22 +45,23 @@ var j = ({ onClose: m, isNb: n, selected: i, removeSelection: h, setMonth: a, on
44
45
  height: 20
45
46
  })
46
47
  }),
47
- /* @__PURE__ */ t(e, {
48
+ /* @__PURE__ */ t(a, {
48
49
  dataTest: "",
49
50
  size: "small",
50
51
  onClick: () => {
51
- a(new Date(Date.now()));
52
+ n(new Date(Date.now()));
52
53
  },
53
54
  variant: "outlined",
54
- children: n ? "I dag" : "Today"
55
+ children: e ? "I dag" : "Today"
55
56
  }),
56
- /* @__PURE__ */ t(e, {
57
+ /* @__PURE__ */ t(a, {
57
58
  dataTest: "",
59
+ "aria-label": e ? "Neste maned" : "Next month",
58
60
  variant: "outlined",
59
61
  size: "small",
60
- disabled: !l,
62
+ disabled: !r,
61
63
  onClick: () => {
62
- l && a(l);
64
+ r && n(r);
63
65
  },
64
66
  style: { minWidth: "25px" },
65
67
  children: /* @__PURE__ */ t(f, {
@@ -69,7 +71,7 @@ var j = ({ onClose: m, isNb: n, selected: i, removeSelection: h, setMonth: a, on
69
71
  })
70
72
  ]
71
73
  }),
72
- /* @__PURE__ */ t(e, {
74
+ /* @__PURE__ */ t(a, {
73
75
  dataTest: "",
74
76
  variant: "contained",
75
77
  size: "small",
@@ -77,7 +79,7 @@ var j = ({ onClose: m, isNb: n, selected: i, removeSelection: h, setMonth: a, on
77
79
  m?.(o, "backdropClick");
78
80
  },
79
81
  style: { minWidth: "60px" },
80
- children: n ? "Velg" : "Select"
82
+ children: e ? "Velg" : "Select"
81
83
  })
82
84
  ]
83
85
  });
@@ -1,12 +1,12 @@
1
1
  import { StyledButton as e } from "../../../shared-components/button/StyledButton.js";
2
2
  import { TimePickerBody as d } from "./TimePickerBody.js";
3
- import { EraserIcon as s } from "../../../shared-components/EraserIcon.js";
4
- import { CheckIcon as c } from "../../../shared-components/CheckIcon.js";
5
- import { Fragment as p, jsx as t, jsxs as r } from "react/jsx-runtime";
6
- var g = ({ dataTest: n, value: i, onSelect: a, handleClear: m, onConfirm: o }) => /* @__PURE__ */ r(p, { children: [/* @__PURE__ */ t(d, {
7
- dataTest: `${n}-time-picker-body`,
3
+ import { EraserIcon as l } from "../../../shared-components/EraserIcon.js";
4
+ import { CheckIcon as s } from "../../../shared-components/CheckIcon.js";
5
+ import { Fragment as c, jsx as t, jsxs as r } from "react/jsx-runtime";
6
+ var b = ({ dataTest: a, value: i, onSelect: m, handleClear: n, onConfirm: o }) => /* @__PURE__ */ r(c, { children: [/* @__PURE__ */ t(d, {
7
+ dataTest: `${a}-time-picker-body`,
8
8
  value: i,
9
- onSelect: a
9
+ onSelect: m
10
10
  }), /* @__PURE__ */ r("div", {
11
11
  style: {
12
12
  display: "flex",
@@ -17,21 +17,23 @@ var g = ({ dataTest: n, value: i, onSelect: a, handleClear: m, onConfirm: o }) =
17
17
  children: [/* @__PURE__ */ t(e, {
18
18
  dataTest: "time-picker-erase-button",
19
19
  "data-testid": "time-picker-erase-button",
20
+ "aria-label": "Clear time",
20
21
  variant: "text",
21
- onClick: m,
22
+ onClick: n,
22
23
  size: "small",
23
24
  disabled: !i,
24
25
  style: {
25
26
  minWidth: "40px",
26
27
  marginLeft: "10px"
27
28
  },
28
- children: /* @__PURE__ */ t(s, {
29
+ children: /* @__PURE__ */ t(l, {
29
30
  width: 24,
30
31
  height: 24
31
32
  })
32
33
  }), /* @__PURE__ */ t(e, {
33
34
  dataTest: "time-picker-confirm-button",
34
35
  "data-testid": "time-picker-confirm-button",
36
+ "aria-label": "Confirm time",
35
37
  variant: "contained",
36
38
  size: "small",
37
39
  onClick: o,
@@ -39,12 +41,12 @@ var g = ({ dataTest: n, value: i, onSelect: a, handleClear: m, onConfirm: o }) =
39
41
  minWidth: "40px",
40
42
  marginRight: "16px"
41
43
  },
42
- children: /* @__PURE__ */ t(c, {
44
+ children: /* @__PURE__ */ t(s, {
43
45
  width: 20,
44
46
  height: 20
45
47
  })
46
48
  })]
47
49
  })] });
48
50
  export {
49
- g as TimePickerPanel
51
+ b as TimePickerPanel
50
52
  };
@@ -17,5 +17,15 @@ export interface FormControlLabelProps {
17
17
  * Native replacement for MUI `FormControlLabel` — a `<label>` that pairs a form control with a
18
18
  * text label and forwards `checked`/`onChange`/`disabled`/`name`/`value` into the control (MUI's
19
19
  * clone behavior). Public props preserved (DEC-003). TASK-203.
20
+ *
21
+ * The label text carries an `id` and is wired to the control with `aria-labelledby` (ASMA-8143).
22
+ * Without it every checkbox/radio placed here failed axe `label`: `StyledCheckbox`/`StyledRadio`
23
+ * render their own `<label>` around the real `<input>`, so nesting them inside this `<label>`
24
+ * produces nested labels, and axe resolves an input's implicit label with `closest('label')` — it
25
+ * finds the *inner* one, which holds only the visual box and no text. `<button role="switch">` had
26
+ * the same gap for `button-name`: `<label>` does not name a non-labelable element at all.
27
+ * `aria-labelledby` names the control from the same visible text either way, so the accessible name
28
+ * is unchanged and no markup moves. A control that already sets `aria-label`/`aria-labelledby`
29
+ * keeps its own.
20
30
  */
21
31
  export declare const StyledFormControlLabel: ({ control, label, checked, disabled, name, value, labelPlacement, className, sx, onChange, }: FormControlLabelProps) => JSX.Element;
@@ -8,6 +8,15 @@ type StyledCheckboxProps = {
8
8
  hideWrapper?: boolean;
9
9
  className?: string;
10
10
  onChange?: (event: ChangeEvent<HTMLInputElement>, checked: boolean) => void;
11
+ /**
12
+ * Renders the identical visual box (same classes, same `data-*` state attributes — no visual
13
+ * change) with NO real `<input>` at all, for use as a pure state indicator inside a widget that
14
+ * already owns selection itself. A real `<input type="checkbox">` nested inside such a widget is
15
+ * an axe `nested-interactive` violation, and axe is explicit that `aria-hidden`/`tabIndex={-1}`
16
+ * do NOT satisfy the check — only removing the input does. Mirrors the `decorative` prop on the
17
+ * main `src/components/inputs/checkbox/base-ui/StyledCheckbox`.
18
+ */
19
+ decorative?: boolean;
11
20
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size' | 'checked' | 'type'>;
12
21
  export declare const IndeterminateIcon: (props: SVGProps<SVGSVGElement>) => JSX.Element;
13
22
  export declare const CheckIcon: (props: SVGProps<SVGSVGElement>) => JSX.Element;
@@ -1,21 +1,21 @@
1
1
  import { SELECT_COLUMN_ID as p } from "../../types.js";
2
- import s from "../StyledTable.module.js";
3
- import { StyledCheckbox as c } from "../../shared-components/StyledCheckbox.js";
2
+ import a from "../StyledTable.module.js";
3
+ import { StyledCheckbox as n } from "../../shared-components/StyledCheckbox.js";
4
4
  import { StyledTooltip as u } from "../../shared-components/tooltip/index.js";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
- var a = (t) => {
7
- t.preventDefault(), t.stopPropagation();
8
- }, i = (t, l) => {
9
- t.key !== "Enter" && t.key !== " " || (t.preventDefault(), t.stopPropagation(), l());
10
- }, w = (t) => t === "no" ? {
6
+ var s = (o) => {
7
+ o.preventDefault(), o.stopPropagation();
8
+ }, i = (o, l) => {
9
+ o.key !== "Enter" && o.key !== " " || (o.preventDefault(), o.stopPropagation(), l());
10
+ }, w = (o) => o === "no" ? {
11
11
  selectAll: "Velg alle rader",
12
12
  selectRow: (l) => `Velg rad ${l}`
13
13
  } : {
14
14
  selectAll: "Select all rows",
15
15
  selectRow: (l) => `Select row ${l}`
16
16
  };
17
- function k(t, l, d) {
18
- const n = w(d);
17
+ function x(o, l, d) {
18
+ const c = w(d);
19
19
  return {
20
20
  id: p,
21
21
  minSize: 38,
@@ -24,18 +24,17 @@ function k(t, l, d) {
24
24
  header: ({ table: e }) => /* @__PURE__ */ r("div", {
25
25
  role: "checkbox",
26
26
  tabIndex: 0,
27
- "aria-label": n.selectAll,
27
+ "aria-label": c.selectAll,
28
28
  "aria-checked": e.getIsSomeRowsSelected() ? "mixed" : e.getIsAllRowsSelected(),
29
- className: s["select-control"],
29
+ className: a["select-control"],
30
30
  onClick: () => e.toggleAllRowsSelected(),
31
- onMouseDown: a,
32
- onMouseUp: a,
33
- onKeyDown: (o) => i(o, () => e.toggleAllRowsSelected()),
34
- children: /* @__PURE__ */ r(c, {
31
+ onMouseDown: s,
32
+ onMouseUp: s,
33
+ onKeyDown: (t) => i(t, () => e.toggleAllRowsSelected()),
34
+ children: /* @__PURE__ */ r(n, {
35
35
  size: "small",
36
36
  dataTest: "cell-select-all",
37
- "aria-hidden": !0,
38
- tabIndex: -1,
37
+ decorative: !0,
39
38
  checked: e.getIsAllRowsSelected(),
40
39
  indeterminate: e.getIsSomeRowsSelected(),
41
40
  className: "pointer-events-none",
@@ -43,46 +42,45 @@ function k(t, l, d) {
43
42
  })
44
43
  }),
45
44
  cell: ({ cell: e }) => {
46
- const o = !e.row.getCanSelect();
45
+ const t = !e.row.getCanSelect();
47
46
  return /* @__PURE__ */ r("div", {
48
47
  role: "checkbox",
49
- tabIndex: o ? -1 : 0,
50
- "aria-label": n.selectRow(e.row.index + 1),
48
+ tabIndex: t ? -1 : 0,
49
+ "aria-label": c.selectRow(e.row.index + 1),
51
50
  "aria-checked": e.row.getIsSelected(),
52
- "aria-disabled": o,
51
+ "aria-disabled": t,
53
52
  style: { height: l ?? "auto" },
54
- className: s["select-control"],
53
+ className: a["select-control"],
55
54
  onClick: () => {
56
- o || e.row.toggleSelected();
55
+ t || e.row.toggleSelected();
57
56
  },
58
- onMouseDown: a,
59
- onMouseUp: a,
57
+ onMouseDown: s,
58
+ onMouseUp: s,
60
59
  onKeyDown: (m) => {
61
- o || i(m, () => e.row.toggleSelected());
60
+ t || i(m, () => e.row.toggleSelected());
62
61
  },
63
62
  children: /* @__PURE__ */ r(u, {
64
63
  arrow: !0,
65
64
  placement: "top-start",
66
65
  title: e.row.getRowSelectionTooltip(),
67
66
  children: /* @__PURE__ */ r("span", {
68
- className: o ? s["cursor-not-allowed"] : void 0,
69
- children: /* @__PURE__ */ r(c, {
67
+ className: t ? a["cursor-not-allowed"] : void 0,
68
+ children: /* @__PURE__ */ r(n, {
70
69
  size: "small",
71
70
  dataTest: "cell-select",
72
- "aria-hidden": !0,
73
- tabIndex: -1,
71
+ decorative: !0,
74
72
  checked: e.row.getIsSelected(),
75
73
  hideWrapper: !0,
76
- disabled: o,
74
+ disabled: t,
77
75
  className: "pointer-events-none"
78
76
  })
79
77
  })
80
78
  })
81
79
  });
82
80
  },
83
- fixedLeft: t
81
+ fixedLeft: o
84
82
  };
85
83
  }
86
84
  export {
87
- k as selectColumn
85
+ x as selectColumn
88
86
  };
@@ -1,8 +1,8 @@
1
1
  import { SHOW_FULL_TEXT_ID as i } from "../../types.js";
2
- import { ChevronDownIcon as s } from "../../shared-components/ChevronDownIcon.js";
3
- import { StyledButton as l } from "../../shared-components/button/StyledButton.js";
2
+ import { ChevronDownIcon as l } from "../../shared-components/ChevronDownIcon.js";
3
+ import { StyledButton as s } from "../../shared-components/button/StyledButton.js";
4
4
  import { jsx as o } from "react/jsx-runtime";
5
- function f(e, n) {
5
+ function f(e, r) {
6
6
  return {
7
7
  id: i,
8
8
  minSize: 38,
@@ -11,24 +11,25 @@ function f(e, n) {
11
11
  enableHiding: !1,
12
12
  enableSorting: !1,
13
13
  header: () => null,
14
- cell: (r) => /* @__PURE__ */ o(u, {
15
- info: r,
16
- rowHeight: n
14
+ cell: (n) => /* @__PURE__ */ o(u, {
15
+ info: n,
16
+ rowHeight: r
17
17
  }),
18
18
  fixedLeft: e
19
19
  };
20
20
  }
21
- function u({ info: e, rowHeight: n }) {
22
- const r = e.row.getCanExpand(), a = e.row.isExpanded();
21
+ function u({ info: e, rowHeight: r }) {
22
+ const n = e.row.getCanExpand(), a = e.row.isExpanded();
23
23
  return /* @__PURE__ */ o("div", {
24
24
  className: "flex w-full items-center justify-center",
25
- style: { height: n ?? "auto" },
26
- children: /* @__PURE__ */ o(l, {
25
+ style: { height: r ?? "auto" },
26
+ children: /* @__PURE__ */ o(s, {
27
27
  dataTest: "expand-text-button",
28
+ "aria-label": a ? "Collapse text" : "Show full text",
28
29
  size: "small",
29
30
  variant: "textGray",
30
31
  onClick: (t) => {
31
- t.stopPropagation(), r && e.row.getToggleExpandedHandler()(), e.row.toggleExpand();
32
+ t.stopPropagation(), n && e.row.getToggleExpandedHandler()(), e.row.toggleExpand();
32
33
  },
33
34
  onMouseDown: (t) => {
34
35
  t.preventDefault(), t.stopPropagation();
@@ -36,7 +37,7 @@ function u({ info: e, rowHeight: n }) {
36
37
  onMouseUp: (t) => {
37
38
  t.preventDefault(), t.stopPropagation();
38
39
  },
39
- startIcon: /* @__PURE__ */ o(s, {
40
+ startIcon: /* @__PURE__ */ o(l, {
40
41
  className: "block size-5 shrink-0",
41
42
  width: 20,
42
43
  height: 20,
@@ -1,20 +1,20 @@
1
- import { cn as m } from "../../helpers/cn.js";
1
+ import { cn as x } from "../../helpers/cn.js";
2
2
  import e from "./StyledCheckbox.module.js";
3
- import L, { useEffect as C, useRef as f } from "react";
4
- import { jsx as o, jsxs as k } from "react/jsx-runtime";
5
- var E = (t) => /* @__PURE__ */ k("svg", {
3
+ import P, { useEffect as v, useRef as b } from "react";
4
+ import { Fragment as $, jsx as t, jsxs as l } from "react/jsx-runtime";
5
+ var y = (r) => /* @__PURE__ */ l("svg", {
6
6
  viewBox: "0 0 24 24",
7
7
  width: "100%",
8
8
  height: "100%",
9
9
  fill: "none",
10
- ...t,
11
- children: [/* @__PURE__ */ o("title", { children: "Indeterminate icon" }), /* @__PURE__ */ o("path", {
10
+ ...r,
11
+ children: [/* @__PURE__ */ t("title", { children: "Indeterminate icon" }), /* @__PURE__ */ t("path", {
12
12
  d: "M6 12H18",
13
13
  stroke: "currentColor",
14
- strokeWidth: t.strokeWidth ?? 3,
14
+ strokeWidth: r.strokeWidth ?? 3,
15
15
  strokeLinecap: "round"
16
16
  })]
17
- }), H = (t) => /* @__PURE__ */ k("svg", {
17
+ }), B = (r) => /* @__PURE__ */ l("svg", {
18
18
  viewBox: "0 0 24 24",
19
19
  width: "100%",
20
20
  height: "100%",
@@ -23,56 +23,62 @@ var E = (t) => /* @__PURE__ */ k("svg", {
23
23
  strokeWidth: 2,
24
24
  strokeLinecap: "round",
25
25
  strokeLinejoin: "round",
26
- ...t,
27
- children: [/* @__PURE__ */ o("title", { children: "Check icon" }), /* @__PURE__ */ o("path", { d: "M4 12l5 5L20 6" })]
28
- }), M = ({ dataTest: t, size: l = "medium", disabled: d, readOnly: c, indeterminate: n = !1, checked: h, disableRipple: x, hideWrapper: v, className: b, onChange: g, ...I }) => {
29
- const a = !!v, s = !x && !a && !d && !c, p = f(null), u = f(null);
30
- C(() => {
31
- p.current && (p.current.indeterminate = n);
26
+ ...r,
27
+ children: [/* @__PURE__ */ t("title", { children: "Check icon" }), /* @__PURE__ */ t("path", { d: "M4 12l5 5L20 6" })]
28
+ }), _ = ({ dataTest: r, size: d = "medium", disabled: h, readOnly: a, indeterminate: n = !1, checked: p, disableRipple: g, hideWrapper: I, className: N, onChange: R, decorative: w, ...W }) => {
29
+ const c = !!I, s = !g && !c && !h && !a, u = b(null), m = b(null);
30
+ v(() => {
31
+ u.current && (u.current.indeterminate = n);
32
32
  }, [n]);
33
- const R = m(e.CheckboxWrapper, !a && e[`size-${l}`], a && e.HideWrapper, n && e.Indeterminate, c && e.ReadOnly, s && e.CheckboxHover, b), w = m(e.Checkbox, e[`size-${l}`], n && e.Indeterminate), N = n ? E : H, W = L.useCallback((r) => {
34
- if (r.stopPropagation(), !s) return;
33
+ const k = x(e.CheckboxWrapper, !c && e[`size-${d}`], c && e.HideWrapper, n && e.Indeterminate, a && e.ReadOnly, s && e.CheckboxHover, N), L = x(e.Checkbox, e[`size-${d}`], n && e.Indeterminate), E = n ? y : B, H = P.useCallback((o) => {
34
+ if (o.stopPropagation(), !s) return;
35
35
  const i = document.createElement("span");
36
- i.className = e.CheckboxRipple ?? "", i.addEventListener("animationend", () => i.remove(), { once: !0 }), u.current?.appendChild(i);
36
+ i.className = e.CheckboxRipple ?? "", i.addEventListener("animationend", () => i.remove(), { once: !0 }), m.current?.appendChild(i);
37
37
  }, [s]);
38
- return C(() => {
39
- const r = u.current;
40
- return () => r?.replaceChildren();
41
- }, []), /* @__PURE__ */ k("label", {
42
- className: R,
43
- "data-test": t,
44
- onPointerDown: W,
45
- "data-checked": h && !n ? "" : void 0,
46
- "data-unchecked": !h && !n ? "" : void 0,
38
+ v(() => {
39
+ const o = m.current;
40
+ return () => o?.replaceChildren();
41
+ }, []);
42
+ const j = (o) => {
43
+ a || R?.(o, o.target.checked);
44
+ }, C = {
45
+ "data-checked": p && !n ? "" : void 0,
46
+ "data-unchecked": !p && !n ? "" : void 0,
47
47
  "data-indeterminate": n ? "" : void 0,
48
- "data-disabled": d ? "" : void 0,
49
- children: [
50
- /* @__PURE__ */ o("input", {
51
- ref: p,
52
- type: "checkbox",
53
- className: "sr-only",
54
- checked: h,
55
- disabled: d,
56
- readOnly: c,
57
- onChange: (r) => {
58
- c || g?.(r, r.target.checked);
59
- },
60
- ...I
61
- }),
62
- !a && s && /* @__PURE__ */ o("span", {
63
- ref: u,
64
- className: e.CheckboxRippleContainer
65
- }),
66
- /* @__PURE__ */ o("span", {
67
- className: w,
68
- children: /* @__PURE__ */ o("span", {
69
- className: e.Indicator,
70
- children: /* @__PURE__ */ o(N, { strokeWidth: l === "small" ? 3 : 2 })
71
- })
72
- })
73
- ]
48
+ "data-disabled": h ? "" : void 0
49
+ }, f = /* @__PURE__ */ l($, { children: [!c && s && /* @__PURE__ */ t("span", {
50
+ ref: m,
51
+ className: e.CheckboxRippleContainer
52
+ }), /* @__PURE__ */ t("span", {
53
+ className: L,
54
+ children: /* @__PURE__ */ t("span", {
55
+ className: e.Indicator,
56
+ children: /* @__PURE__ */ t(E, { strokeWidth: d === "small" ? 3 : 2 })
57
+ })
58
+ })] });
59
+ return w ? /* @__PURE__ */ t("span", {
60
+ "aria-hidden": "true",
61
+ className: k,
62
+ "data-test": r,
63
+ ...C,
64
+ children: f
65
+ }) : /* @__PURE__ */ l("label", {
66
+ className: k,
67
+ "data-test": r,
68
+ onPointerDown: H,
69
+ ...C,
70
+ children: [/* @__PURE__ */ t("input", {
71
+ ref: u,
72
+ type: "checkbox",
73
+ className: "sr-only",
74
+ checked: p,
75
+ disabled: h,
76
+ readOnly: a,
77
+ onChange: j,
78
+ ...W
79
+ }), f]
74
80
  });
75
81
  };
76
82
  export {
77
- M as StyledCheckbox
83
+ _ as StyledCheckbox
78
84
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.81.1",
6
+ "version": "3.81.3",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",