@axa-fr/canopee-react 1.3.1-alpha.2 → 1.3.1-alpha.3
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.
|
@@ -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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/canopee-react",
|
|
3
|
-
"version": "1.3.1-alpha.
|
|
3
|
+
"version": "1.3.1-alpha.3",
|
|
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.1-alpha.
|
|
48
|
+
"@axa-fr/canopee-css": "1.3.1-alpha.3",
|
|
49
49
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
50
50
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
51
51
|
"react": ">= 18"
|