@axa-fr/design-system-slash-react 1.0.6-alpha.12 → 1.0.6-alpha.17

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,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.id}`))) })] }));
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 };
@@ -0,0 +1 @@
1
+ export declare const generateId: (item: object) => string;
@@ -0,0 +1,10 @@
1
+ let counter = 1;
2
+ const map = new WeakMap();
3
+ export const generateId = (item) => {
4
+ if (!map.has(item)) {
5
+ map.set(item, counter);
6
+ counter += 1;
7
+ return generateId(item);
8
+ }
9
+ return `id-${map.get(item)}`;
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-slash-react",
3
- "version": "1.0.6-alpha.12",
3
+ "version": "1.0.6-alpha.17",
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.6-alpha.12",
48
+ "@axa-fr/design-system-slash-css": "1.0.6-alpha.17",
49
49
  "@material-symbols/svg-400": ">= 0.19.0",
50
50
  "react": ">= 18"
51
51
  },
@@ -64,64 +64,12 @@
64
64
  "react-dropzone": "^11.5.3",
65
65
  "react-select": "^5.9.0"
66
66
  },
67
- "devDependencies": {
68
- "@chromatic-com/storybook": "^2.0.2",
69
- "@material-symbols/svg-400": "*",
70
- "@storybook/addon-essentials": "^8.3.5",
71
- "@storybook/addon-interactions": "^8.3.5",
72
- "@storybook/addon-links": "^8.3.5",
73
- "@storybook/addon-onboarding": "^8.3.5",
74
- "@storybook/blocks": "^8.3.5",
75
- "@storybook/manager-api": "^8.3.5",
76
- "@storybook/react": "^8.3.5",
77
- "@storybook/react-vite": "^8.3.5",
78
- "@storybook/test": "^8.3.5",
79
- "@storybook/theming": "^8.3.5",
80
- "@testing-library/dom": "^10.1.0",
81
- "@testing-library/jest-dom": "^6.5.0",
82
- "@testing-library/react": "^16.0.0",
83
- "@testing-library/user-event": "^14.5.2",
84
- "@types/dompurify": "^3.0.5",
85
- "@types/jest": "^29.5.12",
86
- "@types/jest-axe": "^3.5.9",
87
- "@types/node": "^20.14.9",
88
- "@types/react": "^18.3.2",
89
- "@typescript-eslint/eslint-plugin": "^8.17.0",
90
- "@typescript-eslint/parser": "^8.17.0",
91
- "@vitejs/plugin-react": "^4.3.1",
92
- "@vitest/coverage-v8": "^2.0.5",
93
- "@vitest/ui": "^2.1.2",
94
- "chromatic": "^11.12.0",
95
- "copyfiles": "^2.4.1",
96
- "eslint": "^8.57.0",
97
- "eslint-config-airbnb": "^19.0.4",
98
- "eslint-config-prettier": "^9.1.0",
99
- "eslint-import-resolver-typescript": "^3.6.1",
100
- "eslint-plugin-import": "^2.29.1",
101
- "eslint-plugin-jsx-a11y": "^6.8.0",
102
- "eslint-plugin-prettier": "^5.1.3",
103
- "eslint-plugin-react": "^7.36.1",
104
- "eslint-plugin-react-hooks": "^4.6.0",
105
- "eslint-plugin-storybook": "^0.9.0",
106
- "jest-axe": "^8.0.0",
107
- "jsdom": "^25.0.1",
108
- "prettier": "^3.3.3",
109
- "prop-types": "^15.8.1",
110
- "react": "^18.3.1",
111
- "react-dom": "^18.2.0",
112
- "rimraf": "^6.0.1",
113
- "storybook": "^8.3.5",
114
- "tsc-files": "^1.1.4",
115
- "typescript": "^5.6.3",
116
- "vitest": "^2.0.5"
117
- },
118
67
  "lint-staged": {
119
68
  "*.(js|jsx|ts|tsx)": "eslint --fix",
120
69
  "*.(ts|tsx)": "tsc-files --noEmit",
121
70
  "*.mdx": "prettier --write"
122
71
  },
123
72
  "volta": {
124
- "node": "20.10.0",
125
- "npm": "10.2.5"
73
+ "extends": "../../package.json"
126
74
  }
127
75
  }