@axa-fr/design-system-apollo-react 2.0.4-alpha.80 → 2.0.4-alpha.82
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/Svg/Svg.d.ts +2 -1
- package/dist/Svg/Svg.js +3 -2
- package/package.json +3 -3
package/dist/Svg/Svg.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Svg/Svg.css";
|
|
1
2
|
import { type SVGAttributes } from "react";
|
|
2
3
|
type SvgProps = SVGAttributes<SVGSVGElement> & {
|
|
3
4
|
src: string;
|
|
@@ -6,5 +7,5 @@ type SvgProps = SVGAttributes<SVGSVGElement> & {
|
|
|
6
7
|
/**
|
|
7
8
|
* @deprecated Use Icon instead
|
|
8
9
|
*/
|
|
9
|
-
export declare const Svg: ({ src, alt, width, height, ...props }: SvgProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export declare const Svg: ({ className, src, alt, width, height, ...props }: SvgProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
11
|
export {};
|
package/dist/Svg/Svg.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Svg/Svg.css";
|
|
2
3
|
import React from "react";
|
|
3
4
|
import { svgInjector } from "./svgInjector";
|
|
4
5
|
const cloneAttributes = (from, to) => {
|
|
@@ -10,7 +11,7 @@ const cloneAttributes = (from, to) => {
|
|
|
10
11
|
/**
|
|
11
12
|
* @deprecated Use Icon instead
|
|
12
13
|
*/
|
|
13
|
-
export const Svg = ({ src, alt, width = 24, height = 24, ...props }) => {
|
|
14
|
+
export const Svg = ({ className, src, alt, width = 24, height = 24, ...props }) => {
|
|
14
15
|
const rootRef = React.useRef(null);
|
|
15
16
|
const [hasError, setHasError] = React.useState(false);
|
|
16
17
|
React.useLayoutEffect(() => {
|
|
@@ -49,5 +50,5 @@ export const Svg = ({ src, alt, width = 24, height = 24, ...props }) => {
|
|
|
49
50
|
if (hasError) {
|
|
50
51
|
return alt ? (_jsx("span", { ...props, children: alt })) : null;
|
|
51
52
|
}
|
|
52
|
-
return (_jsx("svg", { ref: rootRef, "data-src": src, width: width, height: height, ...props }));
|
|
53
|
+
return (_jsx("svg", { ref: rootRef, className: ["af-svg", className].filter(Boolean).join(" "), "data-src": src, width: width, height: height, ...props }));
|
|
53
54
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/design-system-apollo-react",
|
|
3
|
-
"version": "2.0.4-alpha.
|
|
3
|
+
"version": "2.0.4-alpha.82",
|
|
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": "2.0.4-alpha.
|
|
50
|
-
"@axa-fr/design-system-look-and-feel-css": "2.0.4-alpha.
|
|
49
|
+
"@axa-fr/design-system-apollo-css": "2.0.4-alpha.82",
|
|
50
|
+
"@axa-fr/design-system-look-and-feel-css": "2.0.4-alpha.82",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|