@axa-fr/design-system-slash-react 1.0.6-alpha.7 → 1.1.0-RC.1
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/Form/Date/Date.js +4 -3
- package/dist/Layout/Header/Infos/Infos.js +3 -2
- package/dist/Popover/AnimatedPopover.d.ts +1 -1
- package/dist/Popover/AnimatedPopover.js +7 -19
- package/dist/Popover/Popover.d.ts +1 -1
- package/dist/Popover/Popover.types.d.ts +1 -1
- package/dist/Popover/PopoverBase.d.ts +1 -1
- package/dist/Popover/PopoverBase.js +1 -1
- package/dist/Popover/index.d.ts +1 -1
- package/dist/utilities/helpers/generateId.d.ts +1 -0
- package/dist/utilities/helpers/generateId.js +10 -0
- package/package.json +4 -57
package/dist/Form/Date/Date.js
CHANGED
|
@@ -3,9 +3,10 @@ import "@axa-fr/design-system-slash-css/dist/Form/Date/Date.scss";
|
|
|
3
3
|
import { forwardRef, useMemo } from "react";
|
|
4
4
|
import { getComponentClassName } from "../../utilities";
|
|
5
5
|
const formatDateValue = (dateValue) => {
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
6
|
+
const formattedDateValue = new globalThis.Date(dateValue);
|
|
7
|
+
const monthFormatted = `0${formattedDateValue.getMonth() + 1}`.slice(-2);
|
|
8
|
+
const dayFormatted = `0${formattedDateValue.getDate()}`.slice(-2);
|
|
9
|
+
return `${formattedDateValue.getFullYear()}-${monthFormatted}-${dayFormatted}`;
|
|
9
10
|
};
|
|
10
11
|
const Date = forwardRef(({ className, classModifier, defaultValue, value, ...otherProps }, ref) => {
|
|
11
12
|
const componentClassName = getComponentClassName(className, classModifier, "af-form__input-date");
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment } from "react";
|
|
3
|
-
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Infos/Infos.scss";
|
|
4
3
|
import { getComponentClassName } from "../../../utilities";
|
|
4
|
+
import { generateId } from "../../../utilities/helpers/generateId";
|
|
5
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Infos/Infos.scss";
|
|
5
6
|
const defaultClassName = "af-contrat";
|
|
6
7
|
const Infos = ({ infos, className, classModifier }) => {
|
|
7
8
|
const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
|
|
8
|
-
return (_jsxs("div", { className: componentClassName, children: [_jsx("i", { className: "glyphicon glyphicon-info-sign" }), _jsx("dl", { className: `${defaultClassName}__list`, children: infos.map((info) => (_jsxs(Fragment, { children: [_jsx("dt", { className: `${defaultClassName}__word`, children: info.word }), _jsx("dd", { className: `${defaultClassName}__def`, children: info.definition })] }, `info-${info
|
|
9
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsx("i", { className: "glyphicon glyphicon-info-sign" }), _jsx("dl", { className: `${defaultClassName}__list`, children: infos.map((info) => (_jsxs(Fragment, { children: [_jsx("dt", { className: `${defaultClassName}__word`, children: info.word }), _jsx("dd", { className: `${defaultClassName}__def`, children: info.definition })] }, `info-${generateId(info)}`))) })] }));
|
|
9
10
|
};
|
|
10
11
|
export { Infos };
|
|
@@ -1,29 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import {
|
|
2
|
+
import React, { useRef } from "react";
|
|
3
|
+
import { arrow, FloatingArrow, offset, useFloating, } from "@floating-ui/react";
|
|
4
4
|
import { getComponentClassName } from "../utilities";
|
|
5
5
|
const defaultClassName = "af-popover__container";
|
|
6
6
|
export const AnimatedPopover = ({ placement, children, isOpen, target, className, classModifier, onMouseEnter, onMouseLeave, }) => {
|
|
7
7
|
const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
|
|
8
8
|
const [referenceElement, setReferenceElement] = React.useState(null);
|
|
9
9
|
const [popperElement, setPopperElement] = React.useState(null);
|
|
10
|
-
const
|
|
11
|
-
const {
|
|
12
|
-
modifiers: [
|
|
13
|
-
{
|
|
14
|
-
name: "arrow",
|
|
15
|
-
options: {
|
|
16
|
-
element: arrowElement,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "offset",
|
|
21
|
-
options: {
|
|
22
|
-
offset: [0, 8],
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
],
|
|
10
|
+
const arrowRef = useRef(null);
|
|
11
|
+
const { floatingStyles, context } = useFloating({
|
|
26
12
|
placement,
|
|
13
|
+
elements: { reference: referenceElement, floating: popperElement },
|
|
14
|
+
middleware: [offset(12), arrow({ element: arrowRef })],
|
|
27
15
|
});
|
|
28
|
-
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:
|
|
16
|
+
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" })] }))] }));
|
|
29
17
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { AnimatedPopover } from "./AnimatedPopover";
|
|
3
3
|
import "@axa-fr/design-system-slash-css/dist/Popover/Popover.scss";
|
|
4
4
|
const defaultClassName = "af-popover__container";
|
|
5
|
-
const PopoverBase = ({ children, isOpen, placement = "
|
|
5
|
+
const PopoverBase = ({ children, isOpen, placement = "right", className = defaultClassName, classModifier, element, onMouseEnter, onMouseLeave, }) => {
|
|
6
6
|
return (_jsx(AnimatedPopover, { target: children, placement: placement, isOpen: isOpen, className: className, classModifier: classModifier, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: element }));
|
|
7
7
|
};
|
|
8
8
|
export { PopoverBase };
|
package/dist/Popover/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateId: (item: object) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/design-system-slash-react",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0-RC.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@axa-fr/design-system-slash-css": "1.0
|
|
48
|
+
"@axa-fr/design-system-slash-css": "1.1.0-RC.1",
|
|
49
49
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
50
50
|
"react": ">= 18"
|
|
51
51
|
},
|
|
@@ -55,74 +55,21 @@
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
+
"@floating-ui/react": "^0.27.2",
|
|
58
59
|
"@fontsource/source-sans-pro": "^5.0.8",
|
|
59
|
-
"@popperjs/core": "^2.11.8",
|
|
60
60
|
"@tanem/svg-injector": "^10.1.68",
|
|
61
61
|
"classnames": "^2.5.1",
|
|
62
62
|
"dompurify": "^3.1.5",
|
|
63
63
|
"rc-slider": "^11.1.7",
|
|
64
64
|
"react-dropzone": "^11.5.3",
|
|
65
|
-
"react-popper": "^2.3.0",
|
|
66
65
|
"react-select": "^5.9.0"
|
|
67
66
|
},
|
|
68
|
-
"devDependencies": {
|
|
69
|
-
"@chromatic-com/storybook": "^2.0.2",
|
|
70
|
-
"@material-symbols/svg-400": "*",
|
|
71
|
-
"@storybook/addon-essentials": "^8.3.5",
|
|
72
|
-
"@storybook/addon-interactions": "^8.3.5",
|
|
73
|
-
"@storybook/addon-links": "^8.3.5",
|
|
74
|
-
"@storybook/addon-onboarding": "^8.3.5",
|
|
75
|
-
"@storybook/blocks": "^8.3.5",
|
|
76
|
-
"@storybook/manager-api": "^8.3.5",
|
|
77
|
-
"@storybook/react": "^8.3.5",
|
|
78
|
-
"@storybook/react-vite": "^8.3.5",
|
|
79
|
-
"@storybook/test": "^8.3.5",
|
|
80
|
-
"@storybook/theming": "^8.3.5",
|
|
81
|
-
"@testing-library/dom": "^10.1.0",
|
|
82
|
-
"@testing-library/jest-dom": "^6.5.0",
|
|
83
|
-
"@testing-library/react": "^16.0.0",
|
|
84
|
-
"@testing-library/user-event": "^14.5.2",
|
|
85
|
-
"@types/dompurify": "^3.0.5",
|
|
86
|
-
"@types/jest": "^29.5.12",
|
|
87
|
-
"@types/jest-axe": "^3.5.9",
|
|
88
|
-
"@types/node": "^20.14.9",
|
|
89
|
-
"@types/react": "^18.3.2",
|
|
90
|
-
"@typescript-eslint/eslint-plugin": "^8.17.0",
|
|
91
|
-
"@typescript-eslint/parser": "^8.17.0",
|
|
92
|
-
"@vitejs/plugin-react": "^4.3.1",
|
|
93
|
-
"@vitest/coverage-v8": "^2.0.5",
|
|
94
|
-
"@vitest/ui": "^2.1.2",
|
|
95
|
-
"chromatic": "^11.12.0",
|
|
96
|
-
"copyfiles": "^2.4.1",
|
|
97
|
-
"eslint": "^8.57.0",
|
|
98
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
99
|
-
"eslint-config-prettier": "^9.1.0",
|
|
100
|
-
"eslint-import-resolver-typescript": "^3.6.1",
|
|
101
|
-
"eslint-plugin-import": "^2.29.1",
|
|
102
|
-
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
103
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
104
|
-
"eslint-plugin-react": "^7.36.1",
|
|
105
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
106
|
-
"eslint-plugin-storybook": "^0.9.0",
|
|
107
|
-
"jest-axe": "^8.0.0",
|
|
108
|
-
"jsdom": "^25.0.1",
|
|
109
|
-
"prettier": "^3.3.3",
|
|
110
|
-
"prop-types": "^15.8.1",
|
|
111
|
-
"react": "^18.3.1",
|
|
112
|
-
"react-dom": "^18.2.0",
|
|
113
|
-
"rimraf": "^6.0.1",
|
|
114
|
-
"storybook": "^8.3.5",
|
|
115
|
-
"tsc-files": "^1.1.4",
|
|
116
|
-
"typescript": "^5.6.3",
|
|
117
|
-
"vitest": "^2.0.5"
|
|
118
|
-
},
|
|
119
67
|
"lint-staged": {
|
|
120
68
|
"*.(js|jsx|ts|tsx)": "eslint --fix",
|
|
121
69
|
"*.(ts|tsx)": "tsc-files --noEmit",
|
|
122
70
|
"*.mdx": "prettier --write"
|
|
123
71
|
},
|
|
124
72
|
"volta": {
|
|
125
|
-
"
|
|
126
|
-
"npm": "10.2.5"
|
|
73
|
+
"extends": "../../package.json"
|
|
127
74
|
}
|
|
128
75
|
}
|