@axa-fr/canopee-react 1.7.1-alpha.10 → 1.7.1-alpha.12
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,8 +1,9 @@
|
|
|
1
|
-
import "@axa-fr/canopee-css/distributeur/
|
|
1
|
+
import "@axa-fr/canopee-css/distributeur/HelpButton/HelpButton.css";
|
|
2
2
|
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
3
3
|
import { Popover } from "../Popover";
|
|
4
4
|
type HelpProps = Omit<ComponentPropsWithoutRef<typeof Popover>, "popoverElement"> & {
|
|
5
5
|
helpButtonContent?: ReactNode;
|
|
6
|
+
variant?: "default" | "inverse";
|
|
6
7
|
};
|
|
7
|
-
export declare const HelpButton: ({ className, classModifier, children, mode, placement, helpButtonContent, }: HelpProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const HelpButton: ({ className, classModifier, children, mode, placement, variant, helpButtonContent, }: HelpProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "@axa-fr/canopee-css/distributeur/
|
|
2
|
+
import "@axa-fr/canopee-css/distributeur/HelpButton/HelpButton.css";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
+
import info from "@material-symbols/svg-400/rounded/info_i-fill.svg";
|
|
4
5
|
import { Popover } from "../Popover";
|
|
5
6
|
import { getClassName } from "../utilities/helpers/getClassName";
|
|
6
|
-
|
|
7
|
+
import { Svg } from "../Svg";
|
|
8
|
+
export const HelpButton = ({ className, classModifier, children, mode = "click", placement = "right", variant = "default", helpButtonContent = _jsx(Svg, { src: info, alt: "Help" }), }) => {
|
|
7
9
|
const buttonClassName = classNames("btn", getClassName({
|
|
8
10
|
baseClassName: "af-btn--circle",
|
|
9
|
-
modifiers:
|
|
11
|
+
modifiers: [
|
|
12
|
+
...(classModifier?.split(" ") ?? []),
|
|
13
|
+
...(variant === "inverse" ? ["inverse"] : []),
|
|
14
|
+
],
|
|
10
15
|
}));
|
|
11
|
-
return (_jsx(Popover, { className: className, classModifier: classModifier, placement: placement, mode: mode, popoverElement: children, children: _jsx("div", { className: buttonClassName, children: helpButtonContent }) }));
|
|
16
|
+
return (_jsx(Popover, { className: classNames("af-help-button", className), classModifier: classModifier, placement: placement, mode: mode, popoverElement: children, children: _jsx("div", { className: buttonClassName, children: helpButtonContent }) }));
|
|
12
17
|
};
|
|
@@ -18,5 +18,5 @@ export const AnimatedPopover = ({ placement, children, isOpen, target, className
|
|
|
18
18
|
elements: { reference: referenceElement, floating: popperElement },
|
|
19
19
|
middleware: [offset(12), arrow({ element: arrowRef })],
|
|
20
20
|
});
|
|
21
|
-
return (_jsxs("div", { className: componentClassName, children: [_jsx("div", { ref: setReferenceElement, className: "af-popover__container-over", role: "presentation", children: target }), isOpen ? (_jsxs("div", { ref: setPopperElement, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, style: floatingStyles, "data-popper-placement": placement, className: "af-popover__container-pop", children: [_jsx("div", { children: children }), _jsx(FloatingArrow, { ref: arrowRef, context: context, fill: "white" })] })) : null] }));
|
|
21
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsx("div", { ref: setReferenceElement, className: "af-popover__container-over", role: "presentation", children: target }), isOpen ? (_jsxs("div", { ref: setPopperElement, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, style: floatingStyles, "data-popper-placement": placement, className: "af-popover__container-pop", children: [_jsx("div", { children: children }), _jsx(FloatingArrow, { ref: arrowRef, context: context, fill: "white", width: 16, height: 10 })] })) : null] }));
|
|
22
22
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/canopee-react",
|
|
3
|
-
"version": "1.7.1-alpha.
|
|
3
|
+
"version": "1.7.1-alpha.12",
|
|
4
4
|
"description": "Package React - Design System Canopée",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./distributeur": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@axa-fr/canopee-css": "1.7.1-alpha.
|
|
52
|
+
"@axa-fr/canopee-css": "1.7.1-alpha.12",
|
|
53
53
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
54
54
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
55
55
|
"react": ">= 18"
|