@axa-fr/design-system-slash-react 1.2.1-alpha.47 → 1.2.1-alpha.52
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/Card/Card.d.ts +13 -0
- package/dist/Card/Card.js +6 -0
- package/dist/Svg/Svg.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Card/Card.css";
|
|
3
|
+
type CardProps = ComponentProps<"button"> & {
|
|
4
|
+
/** By default : *vertical* */
|
|
5
|
+
orientation?: "vertical" | "horizontal";
|
|
6
|
+
/** icon url, for exemple from "@material-symbols" :
|
|
7
|
+
*
|
|
8
|
+
* import villaIcon from "@material-symbols/svg-400/outlined/villa.svg"; */
|
|
9
|
+
iconSrc?: string;
|
|
10
|
+
error?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const Card: ({ children, className, iconSrc, orientation, error, ...otherProps }: CardProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { Svg } from "../Svg";
|
|
4
|
+
import "@axa-fr/design-system-slash-css/dist/Card/Card.css";
|
|
5
|
+
const DEFAULT_CLASS_NAME = "af-card";
|
|
6
|
+
export const Card = ({ children, className, iconSrc, orientation = "vertical", error = false, ...otherProps }) => (_jsxs("button", { type: "button", className: classNames(DEFAULT_CLASS_NAME, error && `${DEFAULT_CLASS_NAME}--error`, orientation === "horizontal" && `${DEFAULT_CLASS_NAME}--${orientation}`, className), ...otherProps, children: [iconSrc ? _jsx(Svg, { src: iconSrc }) : null, children] }));
|
package/dist/Svg/Svg.js
CHANGED
|
@@ -46,5 +46,5 @@ export const Svg = ({ src, alt, width = 24, height = 24, ...props }) => {
|
|
|
46
46
|
if (hasError) {
|
|
47
47
|
return alt ? (_jsx("span", { ...props, children: alt })) : null;
|
|
48
48
|
}
|
|
49
|
-
return _jsx("svg", { ref: rootRef, "data-src": src, ...props });
|
|
49
|
+
return _jsx("svg", { ref: rootRef, "data-src": src, role: "presentation", ...props });
|
|
50
50
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { Message } from "./Messages/Message";
|
|
|
6
6
|
export { Action } from "./Action/Action";
|
|
7
7
|
export { Badge } from "./Badge/Badge";
|
|
8
8
|
export { Button } from "./Button/Button";
|
|
9
|
+
export { Card } from "./Card/Card";
|
|
9
10
|
export { Checkbox, CheckboxInput, CheckboxItem, CheckboxModes, } from "./Form/Checkbox";
|
|
10
11
|
export { Choice, ChoiceInput } from "./Form/Choice";
|
|
11
12
|
export { LegacyField as Field, FieldError, FieldForm, FieldInput, FormClassManager, HelpMessage, InputList, MessageTypes, } from "./Form/core";
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { Message } from "./Messages/Message";
|
|
|
6
6
|
export { Action } from "./Action/Action";
|
|
7
7
|
export { Badge } from "./Badge/Badge";
|
|
8
8
|
export { Button } from "./Button/Button";
|
|
9
|
+
export { Card } from "./Card/Card";
|
|
9
10
|
export { Checkbox, CheckboxInput, CheckboxItem, CheckboxModes, } from "./Form/Checkbox";
|
|
10
11
|
export { Choice, ChoiceInput } from "./Form/Choice";
|
|
11
12
|
export { LegacyField as Field, FieldError, FieldForm, FieldInput, FormClassManager, HelpMessage, InputList, MessageTypes, } from "./Form/core";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/design-system-slash-react",
|
|
3
|
-
"version": "1.2.1-alpha.
|
|
3
|
+
"version": "1.2.1-alpha.52",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@axa-fr/design-system-slash-css": "1.2.1-alpha.
|
|
50
|
+
"@axa-fr/design-system-slash-css": "1.2.1-alpha.52",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|