@axa-fr/design-system-apollo-react 1.0.5-alpha.466 → 1.0.5-alpha.479
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.
|
@@ -2,6 +2,6 @@ import type { ReactNode } from "react";
|
|
|
2
2
|
export type ItemMessageProps = {
|
|
3
3
|
message?: ReactNode;
|
|
4
4
|
id?: string;
|
|
5
|
-
messageType?: "error" | "success";
|
|
5
|
+
messageType?: "error" | "success" | "warning";
|
|
6
6
|
};
|
|
7
7
|
export declare const ItemMessage: ({ message, id, messageType, }: ItemMessageProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import successIcon from "@material-symbols/svg-400/outlined/check_circle-fill.svg";
|
|
3
3
|
import errorIcon from "@material-symbols/svg-400/outlined/error-fill.svg";
|
|
4
|
+
import warningIcon from "@material-symbols/svg-400/outlined/warning-fill.svg";
|
|
4
5
|
import { Svg } from "../../Svg/Svg";
|
|
5
6
|
export const ItemMessage = ({ message, id, messageType = "error", }) => {
|
|
6
7
|
if (!message) {
|
|
7
8
|
return null;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
+
const getIcon = () => {
|
|
11
|
+
if (messageType === "success")
|
|
12
|
+
return successIcon;
|
|
13
|
+
if (messageType === "warning")
|
|
14
|
+
return warningIcon;
|
|
15
|
+
return errorIcon;
|
|
16
|
+
};
|
|
17
|
+
return (_jsxs("small", { id: id, className: `af-item-message af-item-message--${messageType}`, role: messageType === "success" ? undefined : "alert", "aria-live": "assertive", children: [_jsx(Svg, { src: getIcon(), className: "af-item-message__icon", "aria-hidden": "true" }), _jsx("span", { className: "af-item-message__message", children: message })] }));
|
|
10
18
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/design-system-apollo-react",
|
|
3
|
-
"version": "1.0.5-alpha.
|
|
3
|
+
"version": "1.0.5-alpha.479",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@axa-fr/design-system-apollo-css": "1.0.5-alpha.
|
|
50
|
-
"@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.
|
|
49
|
+
"@axa-fr/design-system-apollo-css": "1.0.5-alpha.479",
|
|
50
|
+
"@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.479",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|