@axa-fr/canopee-react 2.0.0-alpha.72 → 2.0.0-alpha.74
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,8 @@
|
|
|
1
|
+
import "@axa-fr/canopee-css/distributeur/ItemFormHelper/ItemFormHelper.css";
|
|
2
|
+
export type ItemFormHelperVariant = "todo" | "inprogress" | "validated";
|
|
3
|
+
export type ItemFormHelperProps = {
|
|
4
|
+
variant: ItemFormHelperVariant;
|
|
5
|
+
label?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const ItemFormHelper: ({ variant, label, className, }: ItemFormHelperProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/distributeur/ItemFormHelper/ItemFormHelper.css";
|
|
3
|
+
import checkSvg from "@material-symbols/svg-400/outlined/check.svg";
|
|
4
|
+
import toDoSvg from "@material-symbols/svg-400/outlined/circle.svg";
|
|
5
|
+
import wipSvg from "@material-symbols/svg-400/outlined/circle-fill.svg";
|
|
6
|
+
import { Svg } from "../Svg";
|
|
7
|
+
import { getClassName } from "../utilities/helpers/getClassName";
|
|
8
|
+
const variants = {
|
|
9
|
+
todo: {
|
|
10
|
+
icon: toDoSvg,
|
|
11
|
+
defaultLabel: "à compléter",
|
|
12
|
+
},
|
|
13
|
+
inprogress: {
|
|
14
|
+
icon: wipSvg,
|
|
15
|
+
defaultLabel: "en cours",
|
|
16
|
+
},
|
|
17
|
+
validated: {
|
|
18
|
+
icon: checkSvg,
|
|
19
|
+
defaultLabel: "validé",
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export const ItemFormHelper = ({ variant, label, className, }) => {
|
|
23
|
+
const { icon, defaultLabel } = variants[variant];
|
|
24
|
+
const displayLabel = label ?? defaultLabel;
|
|
25
|
+
const componentClassName = getClassName({
|
|
26
|
+
baseClassName: "af-item-form-helper",
|
|
27
|
+
modifiers: [variant],
|
|
28
|
+
className,
|
|
29
|
+
});
|
|
30
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsx(Svg, { src: icon, width: 12, height: 12 }), _jsx("span", { children: displayLabel })] }));
|
|
31
|
+
};
|
package/dist/distributeur.d.ts
CHANGED
|
@@ -74,3 +74,4 @@ export { EditorialMessage, type EditorialMessageProps, type EditorialMessageType
|
|
|
74
74
|
export { Timeline, type TimelineProps, type TimelineVariants, } from "./distributeur/Timeline/Timeline";
|
|
75
75
|
export { CardButton, type CardButtonProps, } from "./distributeur/CardButton/CardButton";
|
|
76
76
|
export { BaseCard, type BaseCardProps } from "./distributeur/Card/BaseCard";
|
|
77
|
+
export { ItemFormHelper, type ItemFormHelperProps, type ItemFormHelperVariant, } from "./distributeur/ItemFormHelper/ItemFormHelper";
|
package/dist/distributeur.js
CHANGED
|
@@ -63,3 +63,4 @@ export { EditorialMessage, } from "./distributeur/EditorialMessage/EditorialMess
|
|
|
63
63
|
export { Timeline, } from "./distributeur/Timeline/Timeline";
|
|
64
64
|
export { CardButton, } from "./distributeur/CardButton/CardButton";
|
|
65
65
|
export { BaseCard } from "./distributeur/Card/BaseCard";
|
|
66
|
+
export { ItemFormHelper, } from "./distributeur/ItemFormHelper/ItemFormHelper";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/canopee-react",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.74",
|
|
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.
|
|
56
|
+
"@axa-fr/canopee-css": "2.0.0-alpha.74",
|
|
57
57
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
58
58
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
59
59
|
"react": ">= 19"
|