asma-ui-core 3.107.3 → 3.108.1

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,45 +1,45 @@
1
- import { ACTIONS_COLUMN_ID as q } from "../types.js";
2
- import { useRootContext as pe } from "../context/RootContext.js";
1
+ import { ACTIONS_COLUMN_ID as q, INTERNAL_COLUMN_IDS as pe } from "../types.js";
2
+ import { useRootContext as xe } from "../context/RootContext.js";
3
3
  import n from "./StyledTable.module.js";
4
- import { compact as xe } from "../../helpers/arrays.js";
4
+ import { compact as be } from "../../helpers/arrays.js";
5
5
  import K from "clsx";
6
- import { Fragment as be, useCallback as G, useEffect as Ce, useLayoutEffect as Re, useMemo as m, useRef as Se, useState as De } from "react";
6
+ import { Fragment as Ce, useCallback as G, useEffect as Re, useLayoutEffect as Se, useMemo as m, useRef as De, useState as Ne } from "react";
7
7
  import { Fragment as ve, jsx as s, jsxs as C } from "react/jsx-runtime";
8
8
  import { useSortable as ye } from "@dnd-kit/sortable";
9
- import { flexRender as Ne } from "@tanstack/react-table";
10
- import { CSS as Fe } from "@dnd-kit/utilities";
11
- var ke = (R) => {
9
+ import { flexRender as Ee } from "@tanstack/react-table";
10
+ import { CSS as Ie } from "@dnd-kit/utilities";
11
+ var Fe = (R) => {
12
12
  const t = R.closest("table");
13
13
  if (!t) return !1;
14
14
  const r = Array.from(document.querySelectorAll('a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])')).find((g) => !t.contains(g) && !!(t.compareDocumentPosition(g) & Node.DOCUMENT_POSITION_FOLLOWING));
15
15
  return r ? (r.focus(), document.activeElement === r) : !1;
16
16
  };
17
17
  function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWindow: { paddingLeft: h, paddingRight: p, indexes: T } }) {
18
- const { loading: V, getRowClassName: l, activeRowId: w, rowHeight: x, onRowClick: S, expandArrow: Y, enableDnd: A, disableDndForRow: J, tdClassName: B, customSubRowData: L, renderSubRows: Q, defaultExpanded: X, actions: D, customActionsNode: Z, textExpandArrow: M, enableMultiRowSelection: ee, enableRowSelection: te, singleSelectionRow: ne } = R, v = J?.(t), { transform: ie, transition: oe, setNodeRef: H, isDragging: O } = ye({
18
+ const { loading: V, getRowClassName: l, activeRowId: L, rowHeight: x, onRowClick: S, expandArrow: Y, enableDnd: w, disableDndForRow: J, tdClassName: A, customSubRowData: M, renderSubRows: Q, defaultExpanded: X, actions: D, customActionsNode: Z, textExpandArrow: B, enableMultiRowSelection: ee, enableRowSelection: te, singleSelectionRow: ne } = R, N = J?.(t), { transform: ie, transition: oe, setNodeRef: O, isDragging: _ } = ye({
19
19
  id: t.original.id,
20
- disabled: !A || v
20
+ disabled: !w || N
21
21
  }), se = {
22
- transform: Fe.Transform.toString(ie),
22
+ transform: Ie.Transform.toString(ie),
23
23
  transition: oe,
24
- opacity: O ? 0.8 : 1,
25
- zIndex: O ? 1 : 0,
24
+ opacity: _ ? 0.8 : 1,
25
+ zIndex: _ ? 1 : 0,
26
26
  position: "relative"
27
- }, { isResizing: le, disableResizingFlag: ae } = pe(), y = t.isExpanded(), b = Se(null), [ce, de] = De(void 0);
28
- Re(() => {
29
- !y && b.current && de(b.current.cells[0]?.clientHeight ?? b.current.offsetHeight);
30
- }, [y]);
27
+ }, { isResizing: le, disableResizingFlag: ae } = xe(), v = t.isExpanded(), b = De(null), [ce, de] = Ne(void 0);
28
+ Se(() => {
29
+ !v && b.current && de(b.current.cells[0]?.clientHeight ?? b.current.offsetHeight);
30
+ }, [v]);
31
31
  const re = G((e) => {
32
- b.current = e, v || H(e);
33
- }, [v, H]), U = y ? ce ?? x : x;
34
- Ce(() => {
32
+ b.current = e, N || O(e);
33
+ }, [N, O]), H = v ? ce ?? x : x;
34
+ Re(() => {
35
35
  X && t.getCanExpand() && !t.getIsExpanded() && t.toggleExpand();
36
36
  }, []);
37
- const W = (e) => {
37
+ const U = (e) => {
38
38
  t.getCanExpand() && !Y && t.getToggleExpandedHandler()(), document.getElementById(t.id)?.focus();
39
39
  const i = window.getSelection()?.type !== "Range" && !le, o = S instanceof Function;
40
- !o && M && i ? t.toggleExpand() : o && i && S(e, t), ae();
40
+ !o && B && i ? t.toggleExpand() : o && i && S(e, t), ae();
41
41
  }, ue = (e) => {
42
- e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || W(e);
42
+ e.target.classList.contains("MuiModal-backdrop") || e.target.nodeName === "INPUT" || e.target.nodeName === "BUTTON" || e.target.nodeName === "LI" || e.target.closest("li") || U(e);
43
43
  }, fe = (e) => {
44
44
  if (e.target === e.currentTarget)
45
45
  switch (e.key) {
@@ -51,7 +51,7 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
51
51
  }
52
52
  const i = e.currentTarget.closest("table")?.querySelector('thead tr[tabindex="0"]');
53
53
  i && (e.preventDefault(), i.focus());
54
- } else (t.focusNextRow() || ke(e.currentTarget)) && e.preventDefault();
54
+ } else (t.focusNextRow() || Fe(e.currentTarget)) && e.preventDefault();
55
55
  break;
56
56
  case "ArrowDown":
57
57
  t.focusNextRow() && e.preventDefault();
@@ -60,32 +60,32 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
60
60
  t.focusPrevRow() && e.preventDefault();
61
61
  break;
62
62
  case "Enter":
63
- e.preventDefault(), W(e);
63
+ e.preventDefault(), U(e);
64
64
  break;
65
65
  }
66
66
  }, u = t.getVisibleCells().map((e, i, o) => ({
67
67
  ...e,
68
68
  left: o.slice(0, i).reduce((c, d) => c + (d.column.getSize() ?? 0), 0)
69
- })), _ = m(() => u.filter((e) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), [u]), a = m(() => u.filter((e) => !!e.column.columnDef.fixedRight || e.column.id === "actions").map((e, i, o) => ({
69
+ })), z = m(() => u.filter((e) => !e.column.columnDef.fixedLeft && !e.column.columnDef.fixedRight && e.column.id !== "actions"), [u]), a = m(() => u.filter((e) => !!e.column.columnDef.fixedRight || e.column.id === "actions").map((e, i, o) => ({
70
70
  ...e,
71
71
  right: o.slice(i + 1).reduce((c, d) => c + (d.column.getSize() ?? 0), 0)
72
- })), [u]), z = m(() => a.some((e) => e.column.id === q), [a]), P = !!D || !!Z, $ = m(() => a.some((e) => !!e.column.columnDef.fixedRight), [a]), f = m(() => u.filter((e) => e.column.columnDef.fixedLeft), [u]), N = !ee && !te && ne, F = t.getIsSelected() && N, k = S instanceof Function, j = T.length > 0 ? xe(T.map((e) => _[e])) : _, E = G((e, i) => {
73
- const o = e.column.id === q, c = e.column.columnDef.fixedLeft, d = !!e.column.columnDef.fixedRight, me = e.id === f.at(-1)?.id, ge = e.id === a.at(0)?.id && !o, he = t.isExpanded(), I = i === 0;
72
+ })), [u]), W = m(() => a.some((e) => e.column.id === q), [a]), P = !!D || !!Z, $ = m(() => a.some((e) => !!e.column.columnDef.fixedRight), [a]), f = m(() => u.filter((e) => e.column.columnDef.fixedLeft), [u]), y = !ee && !te && ne, E = t.getIsSelected() && y, I = S instanceof Function, j = T.length > 0 ? be(T.map((e) => z[e])) : z, F = G((e, i) => {
73
+ const o = e.column.id === q, c = e.column.columnDef.fixedLeft, d = !!e.column.columnDef.fixedRight, me = e.id === f.at(-1)?.id, ge = e.id === a.at(0)?.id && !o, he = t.isExpanded(), k = i === 0;
74
74
  return /* @__PURE__ */ s("td", {
75
- className: K(n["t-cell"], k && "cursor-pointer", B, o && n["action-cell"], o && (!P || $) && n["action-cell--no-shadow"], o && !!D && f.length && n.shadowed, o && (l?.(t) ? l?.(t) : n["action-cell-default-background"]), c && n["fixed-cell"], d && n["fixed-right-cell"], me && n.shadowed, ge && n["shadowed-right"], t.getIsSelected() && n.selected, c && (l?.(t) ? l?.(t) : n["fixed-cell-default-background"]), d && (l?.(t) ? l?.(t) : n["fixed-right-cell-default-background"]), he && n.expanded_row, !!F && n["single-selection"]),
75
+ className: K(n["t-cell"], !pe.includes(e.column.id) && e.column.getSize() > 64 && n["data-cell"], e.column.id === "select" && n["select-cell"], I && "cursor-pointer", A, o && n["action-cell"], o && (!P || $) && n["action-cell--no-shadow"], o && !!D && f.length && n.shadowed, o && (l?.(t) ? l?.(t) : n["action-cell-default-background"]), c && n["fixed-cell"], d && n["fixed-right-cell"], me && n.shadowed, ge && n["shadowed-right"], t.getIsSelected() && n.selected, c && (l?.(t) ? l?.(t) : n["fixed-cell-default-background"]), d && (l?.(t) ? l?.(t) : n["fixed-right-cell-default-background"]), he && n.expanded_row, !!E && n["single-selection"]),
76
76
  style: {
77
77
  left: c ? e.left : void 0,
78
- right: d ? e.right + (z ? -1 : 0) : void 0
78
+ right: d ? e.right + (W ? -1 : 0) : void 0
79
79
  },
80
80
  children: /* @__PURE__ */ C("div", {
81
81
  style: {
82
82
  display: "flex",
83
83
  alignItems: "center",
84
- minWidth: I ? 32 : void 0,
85
- minHeight: U,
84
+ minWidth: k ? 32 : void 0,
85
+ minHeight: H,
86
86
  position: "relative"
87
87
  },
88
- children: [I && F && /* @__PURE__ */ s("span", {
88
+ children: [k && E && /* @__PURE__ */ s("span", {
89
89
  style: {
90
90
  display: "inline-flex",
91
91
  alignItems: "center",
@@ -94,42 +94,42 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
94
94
  top: "50%",
95
95
  transform: "translateY(-50%)"
96
96
  },
97
- children: /* @__PURE__ */ s(Ee, {})
97
+ children: /* @__PURE__ */ s(ke, {})
98
98
  }), /* @__PURE__ */ s("span", {
99
99
  style: {
100
- marginLeft: I && N ? 30 : 0,
100
+ marginLeft: k && y ? 30 : 0,
101
101
  width: "100%"
102
102
  },
103
- children: Ne(e.column.columnDef.cell, e.getContext())
103
+ children: Ee(e.column.columnDef.cell, e.getContext())
104
104
  })]
105
105
  })
106
106
  }, e.id);
107
107
  }, [
108
- F,
108
+ E,
109
109
  D,
110
- U,
110
+ H,
111
111
  l,
112
- k,
113
- z,
112
+ I,
113
+ W,
114
114
  $,
115
115
  f,
116
116
  a,
117
117
  t,
118
118
  P,
119
- N,
120
- B
119
+ y,
120
+ A
121
121
  ]);
122
- return /* @__PURE__ */ C(be, { children: [/* @__PURE__ */ C("tr", {
122
+ return /* @__PURE__ */ C(Ce, { children: [/* @__PURE__ */ C("tr", {
123
123
  "aria-selected": t.getIsSelected() || t.isFocused() ? "true" : "false",
124
124
  tabIndex: t.isFocused() || r === 0 && !g ? 0 : -1,
125
125
  "data-index": r,
126
126
  "data-test": t.id,
127
- "data-active": w != null && t.id === w ? "true" : void 0,
127
+ "data-active": L != null && t.id === L ? "true" : void 0,
128
128
  id: t.id,
129
129
  className: K(n["t-row"], V && n["is-loading"], l?.(t)),
130
130
  style: {
131
131
  height: x ? `${x}px` : "inherit",
132
- ...A && se
132
+ ...w && se
133
133
  },
134
134
  ref: re,
135
135
  onFocus: (e) => {
@@ -137,11 +137,11 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
137
137
  },
138
138
  onMouseUp: ue,
139
139
  onMouseDown: (e) => {
140
- e.detail > 1 && !k && M && e.preventDefault();
140
+ e.detail > 1 && !I && B && e.preventDefault();
141
141
  },
142
142
  onKeyDownCapture: fe,
143
143
  children: [
144
- f.map((e, i) => E(e, i)),
144
+ f.map((e, i) => F(e, i)),
145
145
  h > 0 && /* @__PURE__ */ s("td", {
146
146
  "aria-hidden": !0,
147
147
  className: n["t-cell"],
@@ -153,7 +153,7 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
153
153
  border: "none"
154
154
  }
155
155
  }),
156
- j.map((e, i) => E(e, f.length + i)),
156
+ j.map((e, i) => F(e, f.length + i)),
157
157
  p > 0 && /* @__PURE__ */ s("td", {
158
158
  "aria-hidden": !0,
159
159
  className: n["t-cell"],
@@ -165,14 +165,14 @@ function We({ styledTableProps: R, row: t, index: r, hasFocusedRow: g, columnWin
165
165
  border: "none"
166
166
  }
167
167
  }),
168
- a.map((e, i) => E(e, f.length + j.length + i))
168
+ a.map((e, i) => F(e, f.length + j.length + i))
169
169
  ]
170
- }), t.getIsExpanded() && /* @__PURE__ */ s(ve, { children: L && Q?.({
171
- rows: L.get(t.original.id.toString()) ?? [],
170
+ }), t.getIsExpanded() && /* @__PURE__ */ s(ve, { children: M && Q?.({
171
+ rows: M.get(t.original.id.toString()) ?? [],
172
172
  row: t.original
173
173
  }) })] }, t.id);
174
174
  }
175
- var Ee = () => /* @__PURE__ */ C("svg", {
175
+ var ke = () => /* @__PURE__ */ C("svg", {
176
176
  xmlns: "http://www.w3.org/2000/svg",
177
177
  width: "20",
178
178
  height: "20",
@@ -1,30 +1,30 @@
1
- import { ACTIONS_COLUMN_ID as R, INTERNAL_COLUMN_IDS as y } from "../../types.js";
1
+ import { ACTIONS_COLUMN_ID as C, INTERNAL_COLUMN_IDS as S } from "../../types.js";
2
2
  import { useRootContext as G } from "../../context/RootContext.js";
3
3
  import n from "../StyledTable.module.js";
4
4
  import { DropUpIcon as A } from "../../shared-components/DropUpIcon.js";
5
- import { DropDownIcon as w } from "../../shared-components/DropDownIcon.js";
6
- import { getTableHeaderStyle as F } from "../../helpers/getTableHeaderStyle.js";
7
- import C from "clsx";
8
- import { useMemo as l } from "react";
9
- import { jsx as i, jsxs as k } from "react/jsx-runtime";
10
- import { flexRender as B } from "@tanstack/react-table";
11
- function J({ styledTableProps: D, header: o, tableCanResize: S = !1, left: _, right: N, tableWidth: b }) {
12
- const { hideHeader: c = !1, enableResizing: r = !1, actions: h, customActionsNode: z } = D, { isResizing: a, enableResizingFlag: m, disableResizingFlag: u } = G(), d = o.column.columnDef.fixedLeft, g = !!o.column.columnDef.fixedRight, f = o.column.id === R, I = !!h || !!z, p = l(() => o.headerGroup.headers.some((e) => e.id === R), [o.headerGroup.headers]), H = l(() => o.headerGroup.headers.some((e) => !!e.column.columnDef.fixedRight), [o.headerGroup.headers]), v = l(() => o.headerGroup.headers[o.headerGroup.headers.length - (p ? 2 : 1)], [o.headerGroup.headers, p]), t = o.column.getCanSort(), x = o.column.getIsSorted(), T = t ? x === "asc" ? "ascending" : x === "desc" ? "descending" : "none" : void 0;
13
- return /* @__PURE__ */ i("th", {
5
+ import { DropDownIcon as L } from "../../shared-components/DropDownIcon.js";
6
+ import { getTableHeaderStyle as w } from "../../helpers/getTableHeaderStyle.js";
7
+ import D from "clsx";
8
+ import { useMemo as i } from "react";
9
+ import { jsx as l, jsxs as F } from "react/jsx-runtime";
10
+ import { flexRender as M } from "@tanstack/react-table";
11
+ function Q({ styledTableProps: R, header: o, tableCanResize: _ = !1, left: N, right: b, tableWidth: z }) {
12
+ const { hideHeader: c = !1, enableResizing: r = !1, actions: I, customActionsNode: H } = R, { isResizing: a, enableResizingFlag: m, disableResizingFlag: u } = G(), d = o.column.columnDef.fixedLeft, g = !!o.column.columnDef.fixedRight, f = o.column.id === C, T = !!I || !!H, p = i(() => o.headerGroup.headers.some((e) => e.id === C), [o.headerGroup.headers]), h = i(() => o.headerGroup.headers.some((e) => !!e.column.columnDef.fixedRight), [o.headerGroup.headers]), v = i(() => o.headerGroup.headers[o.headerGroup.headers.length - (p ? 2 : 1)], [o.headerGroup.headers, p]), t = o.column.getCanSort(), x = o.column.getIsSorted(), y = t ? x === "asc" ? "ascending" : x === "desc" ? "descending" : "none" : void 0;
13
+ return /* @__PURE__ */ l("th", {
14
14
  colSpan: o.colSpan,
15
- "aria-sort": T,
16
- className: C(n["t-cell"], c && n["hide-header"], f && n["t-cell__actions"], f && (!I || H) && n["t-cell__actions--no-shadow"], d && n["t-cell__fixed"], g && n["t-cell__fixed-right"]),
15
+ "aria-sort": y,
16
+ className: D(n["t-cell"], !S.includes(o.column.id) && o.column.getSize() > 64 && n["data-cell"], o.column.id === "select" && n["select-cell"], c && n["hide-header"], f && n["t-cell__actions"], f && (!T || h) && n["t-cell__actions--no-shadow"], d && n["t-cell__fixed"], g && n["t-cell__fixed-right"]),
17
17
  style: {
18
- ...F({
18
+ ...w({
19
19
  enableResizing: r,
20
20
  header: o,
21
- tableWidth: b
21
+ tableWidth: z
22
22
  }),
23
- ...d && { left: _ },
24
- ...g && { right: N }
23
+ ...d && { left: N },
24
+ ...g && { right: b }
25
25
  },
26
- children: /* @__PURE__ */ k("div", {
27
- className: C("flex items-center justify-start", c ? n["hide-table-header"] : n["show-table-header"], t && n["sortable-column"], o.column.columnDef.className),
26
+ children: /* @__PURE__ */ F("div", {
27
+ className: D("flex items-center justify-start", c ? n["hide-table-header"] : n["show-table-header"], t && n["sortable-column"], o.column.columnDef.className),
28
28
  role: t ? "button" : void 0,
29
29
  tabIndex: t ? 0 : void 0,
30
30
  onClick: (e) => {
@@ -38,15 +38,15 @@ function J({ styledTableProps: D, header: o, tableCanResize: S = !1, left: _, ri
38
38
  !a && s && s(e), u();
39
39
  } : void 0,
40
40
  children: [
41
- /* @__PURE__ */ i("div", {
41
+ /* @__PURE__ */ l("div", {
42
42
  className: n["header-content"],
43
- children: B(o.column.columnDef.header, o.getContext())
43
+ children: M(o.column.columnDef.header, o.getContext())
44
44
  }),
45
45
  {
46
- asc: /* @__PURE__ */ i(A, { className: n["sort-icon"] }),
47
- desc: /* @__PURE__ */ i(w, { className: n["sort-icon"] })
46
+ asc: /* @__PURE__ */ l(A, { className: n["sort-icon"] }),
47
+ desc: /* @__PURE__ */ l(L, { className: n["sort-icon"] })
48
48
  }[o.column.getIsSorted()] ?? null,
49
- S && (r ? !0 : o.id !== v?.id) && o.column.getCanResize() && !y.includes(o.column.id) && /* @__PURE__ */ i("div", {
49
+ _ && (r ? !0 : o.id !== v?.id) && o.column.getCanResize() && !S.includes(o.column.id) && /* @__PURE__ */ l("div", {
50
50
  onDoubleClick: () => o.column.resetSize(),
51
51
  onMouseDown: (e) => {
52
52
  e.stopPropagation(), m(), o.getResizeHandler()(e);
@@ -61,5 +61,5 @@ function J({ styledTableProps: D, header: o, tableCanResize: S = !1, left: _, ri
61
61
  }, o.id);
62
62
  }
63
63
  export {
64
- J as TableHeaderCell
64
+ Q as TableHeaderCell
65
65
  };
@@ -1,82 +1,77 @@
1
1
  import { cn as x } from "../../helpers/cn.js";
2
2
  import e from "./StyledCheckbox.module.js";
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", {
3
+ import F, { useEffect as v, useRef as b } from "react";
4
+ import { Fragment as P, jsx as t, jsxs as l } from "react/jsx-runtime";
5
+ var $ = (o) => /* @__PURE__ */ l("svg", {
6
6
  viewBox: "0 0 24 24",
7
7
  width: "100%",
8
8
  height: "100%",
9
9
  fill: "none",
10
- ...r,
10
+ ...o,
11
11
  children: [/* @__PURE__ */ t("title", { children: "Indeterminate icon" }), /* @__PURE__ */ t("path", {
12
12
  d: "M6 12H18",
13
13
  stroke: "currentColor",
14
- strokeWidth: r.strokeWidth ?? 3,
14
+ strokeWidth: o.strokeWidth ?? 3,
15
15
  strokeLinecap: "round"
16
16
  })]
17
- }), B = (r) => /* @__PURE__ */ l("svg", {
18
- viewBox: "0 0 24 24",
17
+ }), j = () => /* @__PURE__ */ l("svg", {
18
+ viewBox: "0 0 16 16",
19
19
  width: "100%",
20
20
  height: "100%",
21
- fill: "none",
22
- stroke: "currentColor",
23
- strokeWidth: 2,
24
- strokeLinecap: "round",
25
- strokeLinejoin: "round",
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);
21
+ fill: "currentColor",
22
+ children: [/* @__PURE__ */ t("title", { children: "Check icon" }), /* @__PURE__ */ t("path", { d: "M6 12.4L2 8.4L3.4 7L6 9.6L12.6 3L14 4.4L6 12.4Z" })]
23
+ }), _ = ({ dataTest: o, size: m = "medium", disabled: d, readOnly: a, indeterminate: r = !1, checked: h, disableRipple: g, hideWrapper: L, className: N, onChange: R, decorative: w, ...I }) => {
24
+ const c = !!L, s = !g && !c && !d && !a, p = b(null), u = b(null);
30
25
  v(() => {
31
- u.current && (u.current.indeterminate = n);
32
- }, [n]);
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;
26
+ p.current && (p.current.indeterminate = r);
27
+ }, [r]);
28
+ const C = x(e.CheckboxWrapper, !c && e[`size-${m}`], c && e.HideWrapper, r && e.Indeterminate, a && e.ReadOnly, s && e.CheckboxHover, N), W = x(e.Checkbox, e[`size-${m}`], r && e.Indeterminate), E = r ? $ : j, H = F.useCallback((n) => {
29
+ if (n.stopPropagation(), !s) return;
35
30
  const i = document.createElement("span");
36
- i.className = e.CheckboxRipple ?? "", i.addEventListener("animationend", () => i.remove(), { once: !0 }), m.current?.appendChild(i);
31
+ i.className = e.CheckboxRipple ?? "", i.addEventListener("animationend", () => i.remove(), { once: !0 }), u.current?.appendChild(i);
37
32
  }, [s]);
38
33
  v(() => {
39
- const o = m.current;
40
- return () => o?.replaceChildren();
34
+ const n = u.current;
35
+ return () => n?.replaceChildren();
41
36
  }, []);
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
- "data-indeterminate": n ? "" : void 0,
48
- "data-disabled": h ? "" : void 0
49
- }, f = /* @__PURE__ */ l($, { children: [!c && s && /* @__PURE__ */ t("span", {
50
- ref: m,
37
+ const y = (n) => {
38
+ a || R?.(n, n.target.checked);
39
+ }, f = {
40
+ "data-checked": h && !r ? "" : void 0,
41
+ "data-unchecked": !h && !r ? "" : void 0,
42
+ "data-indeterminate": r ? "" : void 0,
43
+ "data-disabled": d ? "" : void 0
44
+ }, k = /* @__PURE__ */ l(P, { children: [!c && s && /* @__PURE__ */ t("span", {
45
+ ref: u,
51
46
  className: e.CheckboxRippleContainer
52
47
  }), /* @__PURE__ */ t("span", {
53
- className: L,
48
+ className: W,
54
49
  children: /* @__PURE__ */ t("span", {
55
50
  className: e.Indicator,
56
- children: /* @__PURE__ */ t(E, { strokeWidth: d === "small" ? 3 : 2 })
51
+ children: /* @__PURE__ */ t(E, {})
57
52
  })
58
53
  })] });
59
54
  return w ? /* @__PURE__ */ t("span", {
60
55
  "aria-hidden": "true",
61
- className: k,
62
- "data-test": r,
63
- ...C,
64
- children: f
56
+ className: C,
57
+ "data-test": o,
58
+ ...f,
59
+ children: k
65
60
  }) : /* @__PURE__ */ l("label", {
66
- className: k,
67
- "data-test": r,
61
+ className: C,
62
+ "data-test": o,
68
63
  onPointerDown: H,
69
- ...C,
64
+ ...f,
70
65
  children: [/* @__PURE__ */ t("input", {
71
- ref: u,
66
+ ref: p,
72
67
  type: "checkbox",
73
68
  className: "sr-only",
74
- checked: p,
75
- disabled: h,
69
+ checked: h,
70
+ disabled: d,
76
71
  readOnly: a,
77
- onChange: j,
78
- ...W
79
- }), f]
72
+ onChange: y,
73
+ ...I
74
+ }), k]
80
75
  });
81
76
  };
82
77
  export {
@@ -1,17 +1,17 @@
1
- var e = "_CheckboxWrapper_1bp3w_1", _ = "_Checkbox_1bp3w_1", p = "_Indeterminate_1bp3w_28", r = "_ReadOnly_1bp3w_55", a = "_Indicator_1bp3w_64", b = "_HideWrapper_1bp3w_68", i = "_CheckboxHover_1bp3w_75", o = "_CheckboxRippleContainer_1bp3w_75", l = "_CheckboxRipple_1bp3w_75", d = "_ripple_1bp3w_1", c = {
1
+ var e = "_CheckboxWrapper_k9tu2_1", _ = "_Checkbox_k9tu2_1", r = "_Indeterminate_k9tu2_29", a = "_ReadOnly_k9tu2_56", t = "_Indicator_k9tu2_65", k = "_HideWrapper_k9tu2_69", p = "_CheckboxHover_k9tu2_76", i = "_CheckboxRippleContainer_k9tu2_76", o = "_CheckboxRipple_k9tu2_76", u = "_ripple_k9tu2_1", l = {
2
2
  CheckboxWrapper: e,
3
- "size-small": "_size-small_1bp3w_11",
4
- "size-medium": "_size-medium_1bp3w_15",
3
+ "size-small": "_size-small_k9tu2_12",
4
+ "size-medium": "_size-medium_k9tu2_16",
5
5
  Checkbox: _,
6
- Indeterminate: p,
7
- ReadOnly: r,
8
- Indicator: a,
9
- HideWrapper: b,
10
- CheckboxHover: i,
11
- CheckboxRippleContainer: o,
12
- CheckboxRipple: l,
13
- ripple: d
6
+ Indeterminate: r,
7
+ ReadOnly: a,
8
+ Indicator: t,
9
+ HideWrapper: k,
10
+ CheckboxHover: p,
11
+ CheckboxRippleContainer: i,
12
+ CheckboxRipple: o,
13
+ ripple: u
14
14
  };
15
15
  export {
16
- c as default
16
+ l as default
17
17
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.107.3",
6
+ "version": "3.108.1",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",