@axa-fr/design-system-look-and-feel-react 1.0.5-ci.111 → 1.0.5-ci.113
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.
@@ -31,24 +31,22 @@ const FileUpload = ({ id, label, buttonLabel, instructions, dropzoneDescription,
|
|
31
31
|
}
|
32
32
|
return (_jsx(Svg, { src: check, className: "af-form__file-title-container-icon-success" }));
|
33
33
|
};
|
34
|
-
return (_jsxs("div", { children: [_jsxs("label", { className: "af-form__group--label", htmlFor: id, children: [label, " ", required ? "*" : ""] }), _jsxs("div", { className: classNames("af-form__file-input", globalError && "af-form__file-input--error", (isMobile || (!withPadding && !dropzoneDescription)) && "is-mobile"), children: [_jsx("input", { type: "file", name: "file-input", id: id, "aria-errormessage": idError, "aria-invalid": Boolean(globalError), ...otherProps }), dropzoneDescription && (_jsxs("div", { className: "af-form__file-input-dropdown-text", children: [_jsx("p", { children: dropzoneDescription }), _jsx("p", { children: "ou" })] })), _jsx(Button, { variant: "tertiary", onClick: () => document.getElementById(id)?.click(), iconLeft: _jsx(Svg, { src: plus, className: "af-form__file-input-icon" }), children: buttonLabel })] }), globalError && _jsx(InputError, { id: idError, message: globalError }), instructions && (_jsx("small", { className: "af-form__file-input-help", children: instructions })), _jsxs("div", { className: "custom-table-file af-file-table", children: [filesListLabel && (_jsx("div", { className: "af-form__group--label af-form__files-list-label", children: filesListLabel })), _jsx("ul", { className: "af-form__file-list", children: files
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
}, className: "af-form__file-actions-icon", src: close }))] })] }), isInError && (_jsxs("small", { className: "af-form__file-error", children: [_jsx(Svg, { src: errorO, className: "af-form__file-error-icon", width: 18 }), errorMessage] }))] }, fileId));
|
51
|
-
}) })] })] }));
|
34
|
+
return (_jsxs("div", { children: [_jsxs("label", { className: "af-form__group--label", htmlFor: id, children: [label, " ", required ? "*" : ""] }), _jsxs("div", { className: classNames("af-form__file-input", globalError && "af-form__file-input--error", (isMobile || (!withPadding && !dropzoneDescription)) && "is-mobile"), children: [_jsx("input", { type: "file", name: "file-input", id: id, "aria-errormessage": idError, "aria-invalid": Boolean(globalError), ...otherProps }), dropzoneDescription && (_jsxs("div", { className: "af-form__file-input-dropdown-text", children: [_jsx("p", { children: dropzoneDescription }), _jsx("p", { children: "ou" })] })), _jsx(Button, { variant: "tertiary", onClick: () => document.getElementById(id)?.click(), iconLeft: _jsx(Svg, { src: plus, className: "af-form__file-input-icon" }), children: buttonLabel })] }), globalError && _jsx(InputError, { id: idError, message: globalError }), instructions && (_jsx("small", { className: "af-form__file-input-help", children: instructions })), files && files.length !== 0 && (_jsxs("div", { className: "custom-table-file af-file-table", children: [filesListLabel && (_jsx("div", { className: "af-form__group--label af-form__files-list-label", children: filesListLabel })), _jsx("ul", { className: "af-form__file-list", children: files.map(({ id: fileId, name, size, isLoading }) => {
|
35
|
+
const effectiveSize = getReadableFileSizeString(size);
|
36
|
+
const isInError = errors
|
37
|
+
? errors.some((fileError) => fileError.id === fileId)
|
38
|
+
: false;
|
39
|
+
const errorMessage = errors?.find((fileError) => fileError.id === fileId)?.message;
|
40
|
+
return (_jsxs("li", { className: "af-form__file-line", children: [_jsxs("div", { className: `af-form__file-line-container ${isInError ? "af-form__file-line-container--error" : ""}`, children: [_jsxs("div", { className: "af-form__file-title", children: [getIcon(isInError, isLoading), _jsxs("div", { children: [_jsx("span", { className: "af-form__file-name", children: name }), _jsx("span", { className: "af-form__file-size", children: effectiveSize })] })] }), _jsxs("div", { className: "af-form__file-actions", children: [onView && (_jsx(Svg, { tabIndex: 0, role: "button", "aria-label": "Visualiser", onClick: () => onView(fileId), onKeyDown: (e) => {
|
41
|
+
if (e.key === "Enter") {
|
42
|
+
onView(fileId);
|
43
|
+
}
|
44
|
+
}, className: "af-form__file-actions-icon", src: visibility })), onDelete && (_jsx(Svg, { tabIndex: 0, role: "button", "aria-label": "Supprimer", onClick: () => onDelete(fileId), onKeyDown: (e) => {
|
45
|
+
if (e.key === "Enter") {
|
46
|
+
onDelete(fileId);
|
47
|
+
}
|
48
|
+
}, className: "af-form__file-actions-icon", src: close }))] })] }), isInError && (_jsxs("small", { className: "af-form__file-error", children: [_jsx(Svg, { src: errorO, className: "af-form__file-error-icon", width: 18 }), errorMessage] }))] }, fileId));
|
49
|
+
}) })] }))] }));
|
52
50
|
};
|
53
51
|
FileUpload.displayName = "FileUpload";
|
54
52
|
export { FileUpload };
|
package/dist/Grid/DebugGrid.d.ts
CHANGED
@@ -1,5 +1 @@
|
|
1
|
-
|
2
|
-
export declare const DebugGrid: ({ cols, isCheckedByDefault, }: {
|
3
|
-
cols?: number;
|
4
|
-
isCheckedByDefault?: boolean;
|
5
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
1
|
+
export { DebugGrid } from "@axa-fr/design-system-apollo-react/lf";
|
package/dist/Grid/DebugGrid.js
CHANGED
@@ -1,9 +1 @@
|
|
1
|
-
|
2
|
-
import "@axa-fr/design-system-look-and-feel-css/dist/Grid/DebugGrid.scss";
|
3
|
-
import { useState } from "react";
|
4
|
-
import { Checkbox } from "../Form/Checkbox";
|
5
|
-
export const DebugGrid = ({ cols = 12, isCheckedByDefault = false, }) => {
|
6
|
-
const [checked, setChecked] = useState(isCheckedByDefault);
|
7
|
-
const handleChecked = () => setChecked(!checked);
|
8
|
-
return (_jsxs(_Fragment, { children: [_jsx(Checkbox, { className: "af-checkbox af-checkbox-select af-checkbox-select--debuggrid", label: "Grid", name: "debuggrid", checked: checked, onClick: handleChecked }), _jsx("div", { className: "debug-grid", children: _jsx("div", { className: "grid", children: [...Array(cols).keys()].map((col) => (_jsx("div", { className: "cols" }, col))) }) })] }));
|
9
|
-
};
|
1
|
+
export { DebugGrid } from "@axa-fr/design-system-apollo-react/lf";
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@axa-fr/design-system-look-and-feel-react",
|
3
|
-
"version": "1.0.5-ci.
|
3
|
+
"version": "1.0.5-ci.113",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -48,7 +48,7 @@
|
|
48
48
|
},
|
49
49
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
50
50
|
"peerDependencies": {
|
51
|
-
"@axa-fr/design-system-look-and-feel-css": "1.0.5-ci.
|
51
|
+
"@axa-fr/design-system-look-and-feel-css": "1.0.5-ci.113",
|
52
52
|
"@material-symbols/svg-400": ">= 0.19.0",
|
53
53
|
"react": ">= 18"
|
54
54
|
},
|