asma-ui-core 3.32.4 → 3.33.0

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,9 +1,9 @@
1
1
  import { cn as C } from "../../../../helpers/cn.js";
2
2
  import e from "./StyledCheckbox.module.js";
3
- import p, { useEffect as E } from "react";
3
+ import p, { useEffect as L } from "react";
4
4
  import { jsx as t, jsxs as k } from "react/jsx-runtime";
5
5
  import { Checkbox as f } from "@base-ui/react/checkbox";
6
- var L = (n) => /* @__PURE__ */ k("svg", {
6
+ var H = (n) => /* @__PURE__ */ k("svg", {
7
7
  viewBox: "0 0 24 24",
8
8
  width: "100%",
9
9
  height: "100%",
@@ -15,7 +15,7 @@ var L = (n) => /* @__PURE__ */ k("svg", {
15
15
  strokeWidth: n.strokeWidth ?? 3,
16
16
  strokeLinecap: "round"
17
17
  })]
18
- }), H = (n) => /* @__PURE__ */ k("svg", {
18
+ }), j = (n) => /* @__PURE__ */ k("svg", {
19
19
  viewBox: "0 0 24 24",
20
20
  width: "100%",
21
21
  height: "100%",
@@ -26,21 +26,21 @@ var L = (n) => /* @__PURE__ */ k("svg", {
26
26
  strokeLinejoin: "round",
27
27
  ...n,
28
28
  children: [/* @__PURE__ */ t("title", { children: "Check icon" }), /* @__PURE__ */ t("path", { d: "M4 12l5 5L20 6" })]
29
- }), S = ({ dataTest: n, size: h = "medium", disabled: m, readOnly: c, indeterminate: a = !1, checked: x, disableRipple: b, hideWrapper: v, className: I, onChange: u, ...i }) => {
30
- const s = !!v, l = !b && !s && !m && !c, R = C(e.CheckboxWrapper, !s && e[`size-${h}`], s && e.HideWrapper, a && e.Indeterminate, c && e.ReadOnly, l && e.CheckboxHover, I), g = C(e.Checkbox, e[`size-${h}`], a && e.Indeterminate), w = a ? L : H, d = p.useRef(null), W = p.useCallback((o) => {
29
+ }), _ = ({ dataTest: n, size: h = "medium", disabled: m, readOnly: c, indeterminate: a = !1, checked: x, disableRipple: b, hideWrapper: v, className: I, checkboxClassName: R, onChange: u, ...i }) => {
30
+ const s = !!v, l = !b && !s && !m && !c, g = C(e.CheckboxWrapper, !s && e[`size-${h}`], s && e.HideWrapper, a && e.Indeterminate, c && e.ReadOnly, l && e.CheckboxHover, I), w = C(e.Checkbox, e[`size-${h}`], a && e.Indeterminate, R), W = a ? H : j, d = p.useRef(null), N = p.useCallback((o) => {
31
31
  if (o.stopPropagation(), !l) return;
32
32
  const r = document.createElement("span");
33
33
  e.CheckboxRipple && (r.className = e.CheckboxRipple), r.addEventListener("animationend", () => {
34
34
  r.remove();
35
35
  }, { once: !0 }), d.current?.appendChild(r);
36
36
  }, [l]);
37
- E(() => {
37
+ L(() => {
38
38
  const o = d.current;
39
39
  return () => {
40
40
  o?.replaceChildren();
41
41
  };
42
42
  }, []);
43
- const N = p.useCallback((o) => {
43
+ const E = p.useCallback((o) => {
44
44
  if (c) return;
45
45
  const r = { target: {
46
46
  name: i.name,
@@ -55,27 +55,27 @@ var L = (n) => /* @__PURE__ */ k("svg", {
55
55
  c
56
56
  ]);
57
57
  return /* @__PURE__ */ k(f.Root, {
58
- className: R,
58
+ className: g,
59
59
  "data-testid": n,
60
60
  checked: x,
61
61
  disabled: m,
62
62
  readOnly: c,
63
63
  indeterminate: a,
64
- onPointerDown: W,
65
- onCheckedChange: N,
64
+ onPointerDown: N,
65
+ onCheckedChange: E,
66
66
  ...i,
67
67
  children: [!s && l && /* @__PURE__ */ t("span", {
68
68
  ref: d,
69
69
  className: e.CheckboxRippleContainer
70
70
  }), /* @__PURE__ */ t("span", {
71
- className: g,
71
+ className: w,
72
72
  children: /* @__PURE__ */ t(f.Indicator, {
73
73
  className: e.Indicator,
74
- children: /* @__PURE__ */ t(w, { strokeWidth: h === "small" ? 3 : 2 })
74
+ children: /* @__PURE__ */ t(W, { strokeWidth: h === "small" ? 3 : 2 })
75
75
  })
76
76
  })]
77
77
  });
78
78
  };
79
79
  export {
80
- S as StyledCheckbox
80
+ _ as StyledCheckbox
81
81
  };
@@ -8,6 +8,7 @@ type StyledCheckboxProps = {
8
8
  disableRipple?: boolean;
9
9
  hideWrapper?: boolean;
10
10
  className?: string;
11
+ checkboxClassName?: string;
11
12
  onChange?: (event: React.ChangeEvent<HTMLInputElement>, checked: boolean) => void;
12
13
  } & Omit<React.ComponentProps<typeof Checkbox.Root>, 'children'>;
13
14
  export declare const IndeterminateIcon: (props: SVGProps<SVGSVGElement>) => JSX.Element;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.32.4",
6
+ "version": "3.33.0",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",