@axa-fr/canopee-react 1.3.0 → 1.3.1-alpha.14
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.
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/distributeur/EditorialMessage/EditorialMessage.d.ts +34 -0
- package/dist/distributeur/EditorialMessage/EditorialMessage.js +18 -0
- package/dist/distributeur.d.ts +1 -0
- package/dist/distributeur.js +1 -0
- package/dist/prospect-client/ClickIcon/ClickIconCommon.d.ts +6 -3
- package/dist/prospect-client/ClickIcon/ClickIconCommon.js +10 -2
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/client/common/rebootLF.css";
|
|
2
|
-
import "@axa-fr/canopee-css/client/common/
|
|
2
|
+
import "@axa-fr/canopee-css/client/common/tokens.css";
|
|
3
3
|
import "@axa-fr/canopee-css/client/Grid/Grid.css";
|
|
4
4
|
import "@fontsource/source-sans-pro";
|
|
5
5
|
export { AccordionContextual, accordionContextualVariants, type AccordionContextualVariants, } from "./prospect-client/AccordionContextual/AccordionContextualLF";
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/client/common/rebootLF.css";
|
|
2
|
-
import "@axa-fr/canopee-css/client/common/
|
|
2
|
+
import "@axa-fr/canopee-css/client/common/tokens.css";
|
|
3
3
|
import "@axa-fr/canopee-css/client/Grid/Grid.css";
|
|
4
4
|
import "@fontsource/source-sans-pro";
|
|
5
5
|
export { AccordionContextual, accordionContextualVariants, } from "./prospect-client/AccordionContextual/AccordionContextualLF";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "@axa-fr/canopee-css/distributeur/EditorialMessage/EditorialMessage.css";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
export type EditorialMessageType = "green" | "information" | "promotion";
|
|
4
|
+
export type EditorialMessageProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Type of the editorial message. Used to determine the style.
|
|
7
|
+
*/
|
|
8
|
+
type: EditorialMessageType;
|
|
9
|
+
/**
|
|
10
|
+
* Icon source for the editorial message.
|
|
11
|
+
*/
|
|
12
|
+
icon: string;
|
|
13
|
+
/**
|
|
14
|
+
* Additional class name(s) to apply to the component.
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
} & ({
|
|
18
|
+
/**
|
|
19
|
+
* Title of the message. Either title or children must be provided.
|
|
20
|
+
*/
|
|
21
|
+
title: string;
|
|
22
|
+
/**
|
|
23
|
+
* Content of message
|
|
24
|
+
*/
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
} | {
|
|
27
|
+
title?: string;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
});
|
|
30
|
+
/**
|
|
31
|
+
* This component is a visual element used to promote information about accessibility, promotions, eco-design...
|
|
32
|
+
* Its display does not depend on a user action.
|
|
33
|
+
*/
|
|
34
|
+
export declare const EditorialMessage: ({ children: message, type, title, icon, className, }: EditorialMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/distributeur/EditorialMessage/EditorialMessage.css";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { Svg } from "../Svg";
|
|
5
|
+
import { getClassName } from "../utilities/helpers/getClassName";
|
|
6
|
+
/**
|
|
7
|
+
* This component is a visual element used to promote information about accessibility, promotions, eco-design...
|
|
8
|
+
* Its display does not depend on a user action.
|
|
9
|
+
*/
|
|
10
|
+
export const EditorialMessage = ({ children: message, type, title, icon, className, }) => {
|
|
11
|
+
const computedClassName = getClassName({
|
|
12
|
+
baseClassName: `af-editorial-message`,
|
|
13
|
+
modifiers: [type],
|
|
14
|
+
className,
|
|
15
|
+
});
|
|
16
|
+
const titleId = useId();
|
|
17
|
+
return (_jsxs("article", { className: computedClassName, "aria-labelledby": titleId, children: [_jsx("div", { className: "af-editorial-message__icon", children: _jsx(Svg, { src: icon, role: "presentation" }) }), title ? (_jsx("h4", { className: "af-editorial-message__title", id: titleId, children: title })) : null, message ? (_jsx("div", { className: "af-editorial-message__content", children: message })) : null] }));
|
|
18
|
+
};
|
package/dist/distributeur.d.ts
CHANGED
|
@@ -61,3 +61,4 @@ export { HelpButton } from "./distributeur/HelpButton";
|
|
|
61
61
|
export { Loader } from "./distributeur/Loader/Loader";
|
|
62
62
|
export { CardData } from "./distributeur/CardData/CardData";
|
|
63
63
|
export type { CardDataVariant } from "./distributeur/CardData/CardData";
|
|
64
|
+
export { EditorialMessage, type EditorialMessageProps, type EditorialMessageType, } from "./distributeur/EditorialMessage/EditorialMessage";
|
package/dist/distributeur.js
CHANGED
|
@@ -52,3 +52,4 @@ export { Alert, Message };
|
|
|
52
52
|
export { HelpButton } from "./distributeur/HelpButton";
|
|
53
53
|
export { Loader } from "./distributeur/Loader/Loader";
|
|
54
54
|
export { CardData } from "./distributeur/CardData/CardData";
|
|
55
|
+
export { EditorialMessage, } from "./distributeur/EditorialMessage/EditorialMessage";
|
|
@@ -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.14",
|
|
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.14",
|
|
49
49
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
50
50
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
51
51
|
"react": ">= 18"
|