@axa-fr/design-system-apollo-react 1.0.3-alpha.184 → 1.0.3-alpha.186
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/Icon/IconApollo.d.ts +2 -0
- package/dist/Icon/IconApollo.js +2 -0
- package/dist/Icon/IconCommon.d.ts +21 -0
- package/dist/Icon/IconCommon.js +28 -0
- package/dist/Icon/IconLF.d.ts +2 -0
- package/dist/Icon/IconLF.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/indexLF.d.ts +1 -0
- package/dist/indexLF.js +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { Svg } from "../Svg/Svg";
|
|
3
|
+
export declare const iconVariants: {
|
|
4
|
+
readonly primary: "primary";
|
|
5
|
+
readonly secondary: "secondary";
|
|
6
|
+
readonly tertiary: "tertiary";
|
|
7
|
+
};
|
|
8
|
+
export type IconVariants = keyof typeof iconVariants;
|
|
9
|
+
export declare const iconSizeVariants: {
|
|
10
|
+
readonly L: "large";
|
|
11
|
+
readonly M: "medium";
|
|
12
|
+
readonly S: "small";
|
|
13
|
+
readonly XS: "extra-small";
|
|
14
|
+
};
|
|
15
|
+
export type IconSizeVariants = keyof typeof iconSizeVariants;
|
|
16
|
+
export type IconProps = ComponentProps<typeof Svg> & {
|
|
17
|
+
variant?: IconVariants;
|
|
18
|
+
size?: IconSizeVariants;
|
|
19
|
+
hasBackground?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const Icon: ({ variant, size, hasBackground, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { getComponentClassName } from "../utilities/getComponentClassName";
|
|
4
|
+
import { Svg } from "../Svg/Svg";
|
|
5
|
+
export const iconVariants = {
|
|
6
|
+
primary: "primary",
|
|
7
|
+
secondary: "secondary",
|
|
8
|
+
tertiary: "tertiary",
|
|
9
|
+
};
|
|
10
|
+
export const iconSizeVariants = {
|
|
11
|
+
L: "large",
|
|
12
|
+
M: "medium",
|
|
13
|
+
S: "small",
|
|
14
|
+
XS: "extra-small",
|
|
15
|
+
};
|
|
16
|
+
export const Icon = ({ variant = "primary", size = "S", hasBackground = false, ...props }) => {
|
|
17
|
+
const componentClassName = useMemo(() => {
|
|
18
|
+
const newClassModifier = [
|
|
19
|
+
variant,
|
|
20
|
+
iconSizeVariants[size],
|
|
21
|
+
hasBackground && "has-background",
|
|
22
|
+
]
|
|
23
|
+
.filter(Boolean)
|
|
24
|
+
.join(" ");
|
|
25
|
+
return getComponentClassName("af-icon", "", newClassModifier);
|
|
26
|
+
}, [variant, hasBackground, size]);
|
|
27
|
+
return (_jsx("div", { className: componentClassName, children: _jsx(Svg, { ...props }) }));
|
|
28
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -9,4 +9,5 @@ export { DebugGrid } from "./Grid/DebugGrid";
|
|
|
9
9
|
export { ItemMessage } from "./Form/ItemMessage/ItemMessageApollo";
|
|
10
10
|
export { ItemLabel } from "./Form/ItemLabel/ItemLabelApollo";
|
|
11
11
|
export { TextInput } from "./Form/TextInput/TextInputApollo";
|
|
12
|
+
export { Icon, iconVariants, type IconVariants, iconSizeVariants, type IconSizeVariants, } from "./Icon/IconApollo";
|
|
12
13
|
export { Divider } from "./Divider/DividerApollo";
|
package/dist/index.js
CHANGED
|
@@ -9,4 +9,5 @@ export { DebugGrid } from "./Grid/DebugGrid";
|
|
|
9
9
|
export { ItemMessage } from "./Form/ItemMessage/ItemMessageApollo";
|
|
10
10
|
export { ItemLabel } from "./Form/ItemLabel/ItemLabelApollo";
|
|
11
11
|
export { TextInput } from "./Form/TextInput/TextInputApollo";
|
|
12
|
+
export { Icon, iconVariants, iconSizeVariants, } from "./Icon/IconApollo";
|
|
12
13
|
export { Divider } from "./Divider/DividerApollo";
|
package/dist/indexLF.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export { DebugGrid } from "./Grid/DebugGrid";
|
|
|
8
8
|
export { ItemMessage } from "./Form/ItemMessage/ItemMessageLF";
|
|
9
9
|
export { ItemLabel } from "./Form/ItemLabel/ItemLabelLF";
|
|
10
10
|
export { TextInput } from "./Form/TextInput/TextInputLF";
|
|
11
|
+
export { Icon, iconVariants, type IconVariants, iconSizeVariants, type IconSizeVariants, } from "./Icon/IconLF";
|
|
11
12
|
export { Divider } from "./Divider/DividerLF";
|
package/dist/indexLF.js
CHANGED
|
@@ -8,4 +8,5 @@ export { DebugGrid } from "./Grid/DebugGrid";
|
|
|
8
8
|
export { ItemMessage } from "./Form/ItemMessage/ItemMessageLF";
|
|
9
9
|
export { ItemLabel } from "./Form/ItemLabel/ItemLabelLF";
|
|
10
10
|
export { TextInput } from "./Form/TextInput/TextInputLF";
|
|
11
|
+
export { Icon, iconVariants, iconSizeVariants, } from "./Icon/IconLF";
|
|
11
12
|
export { Divider } from "./Divider/DividerLF";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/design-system-apollo-react",
|
|
3
|
-
"version": "1.0.3-alpha.
|
|
3
|
+
"version": "1.0.3-alpha.186",
|
|
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": "1.0.3-alpha.
|
|
50
|
-
"@axa-fr/design-system-look-and-feel-css": "1.0.3-alpha.
|
|
49
|
+
"@axa-fr/design-system-apollo-css": "1.0.3-alpha.186",
|
|
50
|
+
"@axa-fr/design-system-look-and-feel-css": "1.0.3-alpha.186",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|