@axa-fr/canopee-react 1.3.0 → 1.3.1-alpha.2
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,12 @@
|
|
|
1
|
-
import { ComponentPropsWithRef } from "react";
|
|
2
|
-
import { IconVariants } from "../Icon/IconCommon";
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
|
+
import { IconVariants, IconSizeVariants } from "../Icon/IconCommon";
|
|
3
|
+
export type ClickIconVariant = "default" | "ghost";
|
|
3
4
|
export type ClickIconProps = ComponentPropsWithRef<"button"> & {
|
|
4
5
|
src: string;
|
|
5
6
|
className?: string;
|
|
6
7
|
iconVariant?: IconVariants;
|
|
7
8
|
iconClassName?: string;
|
|
9
|
+
size?: IconSizeVariants;
|
|
10
|
+
variant?: ClickIconVariant;
|
|
8
11
|
};
|
|
9
|
-
export declare const ClickIcon: ({ src, className, iconVariant, iconClassName, ...props }: ClickIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const ClickIcon: ({ src, className, iconVariant, iconClassName, size, variant, ...props }: ClickIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Icon } from "../Icon/IconCommon";
|
|
3
|
-
|
|
2
|
+
import { Icon, iconSizeVariants, } from "../Icon/IconCommon";
|
|
3
|
+
import { getClassName } from "../utilities/getClassName";
|
|
4
|
+
export const ClickIcon = ({ src, className, iconVariant = "primary", iconClassName, size = "S", variant = "default", ...props }) => {
|
|
5
|
+
const componentClassName = getClassName({
|
|
6
|
+
baseClassName: "af-click-icon",
|
|
7
|
+
modifiers: [variant, iconSizeVariants[size]],
|
|
8
|
+
className,
|
|
9
|
+
});
|
|
10
|
+
return (_jsx("button", { type: "button", className: componentClassName, disabled: iconVariant === "disabled", ...props, children: _jsx(Icon, { src: src, variant: iconVariant, className: iconClassName, size: size }) }));
|
|
11
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/canopee-react",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1-alpha.2",
|
|
4
4
|
"description": "Package React - Design System Canopée",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./distributeur": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@axa-fr/canopee-css": "1.3.
|
|
48
|
+
"@axa-fr/canopee-css": "1.3.1-alpha.2",
|
|
49
49
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
50
50
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
51
51
|
"react": ">= 18"
|