@axa-fr/canopee-react 2.0.0-alpha.67 → 2.0.0-alpha.68

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,6 +1,7 @@
1
1
  import { type ComponentProps } from "react";
2
- export type CheckboxProps = Omit<ComponentProps<"input">, "disabled" | "type">;
3
- export declare const Checkbox: {
4
- ({ className, ...inputProps }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
5
- displayName: string;
6
- };
2
+ export type CheckboxProps = {
3
+ /** @deprecated Use `aria-errormessage` instead */
4
+ errorId?: string;
5
+ variant?: "error" | "warning";
6
+ } & Omit<ComponentProps<"input">, "disabled" | "type">;
7
+ export declare const Checkbox: ({ errorId, variant, className, ref, ...inputProps }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import {} from "react";
3
- export const Checkbox = ({ className, ...inputProps }) => (_jsx("input", { ...inputProps, className: ["af-checkbox", className].filter(Boolean).join(" "), type: "checkbox" }));
4
- Checkbox.displayName = "Checkbox";
3
+ import { getClassName } from "../../../utilities/getClassName";
4
+ export const Checkbox = ({ errorId, variant, className, ref, ...inputProps }) => (_jsx("input", { "aria-errormessage": errorId, "aria-invalid": variant === "error" || undefined, ...inputProps, className: getClassName({
5
+ baseClassName: "af-checkbox",
6
+ modifiers: [variant],
7
+ className,
8
+ }), ref: ref, type: "checkbox" }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/canopee-react",
3
- "version": "2.0.0-alpha.67",
3
+ "version": "2.0.0-alpha.68",
4
4
  "description": "Package React - Design System Canopée",
5
5
  "exports": {
6
6
  "./distributeur": {
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "homepage": "https://github.com/AxaFrance/design-system#readme",
55
55
  "peerDependencies": {
56
- "@axa-fr/canopee-css": "2.0.0-alpha.67",
56
+ "@axa-fr/canopee-css": "2.0.0-alpha.68",
57
57
  "@material-symbols/svg-400": ">= 0.19.0",
58
58
  "@material-symbols/svg-700": ">= 0.19.0",
59
59
  "react": ">= 19"