@axa-fr/design-system-look-and-feel-react 1.0.5-alpha.252 → 1.0.5-alpha.254

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,5 +1,5 @@
1
- import { ComponentPropsWithRef } from "react";
2
1
  import "@axa-fr/design-system-look-and-feel-css/dist/Form/FileUpload/FileUpload.scss";
2
+ import { ComponentPropsWithRef } from "react";
3
3
  type Props = Omit<ComponentPropsWithRef<"input">, "required"> & {
4
4
  id: string;
5
5
  label?: string;
@@ -1,15 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useId } from "react";
2
+ import { Button, ItemMessage, Spinner, Svg, } from "@axa-fr/design-system-apollo-react/lf";
3
3
  import "@axa-fr/design-system-look-and-feel-css/dist/Form/FileUpload/FileUpload.scss";
4
- import visibility from "@material-symbols/svg-400/outlined/visibility-fill.svg";
5
- import close from "@material-symbols/svg-400/outlined/close-fill.svg";
4
+ import plus from "@material-symbols/svg-400/outlined/add_circle-fill.svg";
6
5
  import check from "@material-symbols/svg-400/outlined/check_circle-fill.svg";
6
+ import close from "@material-symbols/svg-400/outlined/close-fill.svg";
7
7
  import error from "@material-symbols/svg-400/outlined/error-fill.svg";
8
- import errorO from "@material-symbols/svg-400/outlined/error.svg";
9
- import plus from "@material-symbols/svg-400/outlined/add_circle-fill.svg";
8
+ import visibility from "@material-symbols/svg-400/outlined/visibility-fill.svg";
10
9
  import classNames from "classnames";
11
- import { Spinner, Svg, Button } from "@axa-fr/design-system-apollo-react/lf";
12
- import { InputError } from "../InputError";
10
+ import { useId } from "react";
13
11
  function getReadableFileSizeString(fileSizeInBytes) {
14
12
  let i = -1;
15
13
  let fileSizeInBytesCopy = fileSizeInBytes;
@@ -31,13 +29,13 @@ const FileUpload = ({ id, label, buttonLabel, instructions, dropzoneDescription,
31
29
  }
32
30
  return (_jsx(Svg, { src: check, className: "af-form__file-title-container-icon-success" }));
33
31
  };
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 }) => {
32
+ return (_jsxs("div", { children: [_jsxs("label", { className: "af-form__group--label", htmlFor: id, children: [label, " ", required ? "*" : ""] }), _jsxs("div", { className: "af-form__file-input-container", children: [_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(ItemMessage, { 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
33
  const effectiveSize = getReadableFileSizeString(size);
36
34
  const isInError = errors
37
35
  ? errors.some((fileError) => fileError.id === fileId)
38
36
  : false;
39
37
  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(Button, { "aria-label": "Visualiser", onClick: () => onView(fileId), variant: "ghost", iconLeft: _jsx(Svg, { src: visibility }) })), onDelete && (_jsx(Button, { "aria-label": "Supprimer", onClick: () => onDelete(fileId), variant: "ghost", iconLeft: _jsx(Svg, { 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));
38
+ 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(Button, { "aria-label": "Visualiser", onClick: () => onView(fileId), variant: "ghost", iconLeft: _jsx(Svg, { src: visibility }) })), onDelete && (_jsx(Button, { "aria-label": "Supprimer", onClick: () => onDelete(fileId), variant: "ghost", iconLeft: _jsx(Svg, { src: close }) }))] })] }), isInError && _jsx(ItemMessage, { message: errorMessage })] }, fileId));
41
39
  }) })] }))] }));
42
40
  };
43
41
  FileUpload.displayName = "FileUpload";
@@ -1,14 +1 @@
1
- import { type ReactNode } from "react";
2
- type ContentItemDuoProps = {
3
- label: string;
4
- value: ReactNode;
5
- isVertical?: boolean;
6
- className?: string;
7
- classModifier?: string;
8
- isShowingDoneIcon?: boolean;
9
- isShowingCloseIcon?: boolean;
10
- buttonText?: string;
11
- onButtonClick?: () => void;
12
- };
13
- export declare const ContentItemDuo: ({ label, value, isVertical, className, classModifier, isShowingDoneIcon, isShowingCloseIcon, buttonText, onButtonClick, }: ContentItemDuoProps) => import("react/jsx-runtime").JSX.Element;
14
- export {};
1
+ export { ContentItemDuo } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,17 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import checkIcon from "@material-symbols/svg-400/outlined/check.svg";
3
- import closeIcon from "@material-symbols/svg-400/outlined/close.svg";
4
- import { useMemo } from "react";
5
- import { Button, Svg } from "../..";
6
- import { getComponentClassName } from "../../utilities";
7
- export const ContentItemDuo = ({ label, value, isVertical = false, className, classModifier, isShowingDoneIcon = false, isShowingCloseIcon = false, buttonText, onButtonClick, }) => {
8
- const componentClassName = useMemo(() => {
9
- const classModifiers = [classModifier];
10
- if (isVertical) {
11
- classModifiers.push("vertical");
12
- }
13
- return getComponentClassName("af-content-item-duo", className, classModifiers.filter(Boolean).join(" "));
14
- }, [classModifier, className, isVertical]);
15
- const iconContainerModifier = useMemo(() => ` af-content-item-duo__icon--${isShowingDoneIcon ? "done" : "close"}`, [isShowingDoneIcon]);
16
- return (_jsxs("div", { className: componentClassName, children: [(isShowingDoneIcon || isShowingCloseIcon) && (_jsxs("div", { className: `af-content-item-duo__icon${iconContainerModifier}`, children: [isShowingDoneIcon && _jsx(Svg, { src: checkIcon }), isShowingCloseIcon && _jsx(Svg, { src: closeIcon })] })), _jsx("p", { className: "af-content-item-duo__label", children: label }), typeof value === "string" ? (_jsx("p", { className: "af-content-item-duo__value", children: value })) : (_jsx("div", { className: "af-content-item-duo__value", children: value })), buttonText && (_jsx("div", { className: "af-content-item-duo__button", children: _jsx(Button, { variant: "ghost", onClick: onButtonClick, children: buttonText }) }))] }));
17
- };
1
+ export { ContentItemDuo } from "@axa-fr/design-system-apollo-react/lf";
package/dist/index.d.ts CHANGED
@@ -25,7 +25,7 @@ export { BurgerMenu, Header, NavBar, PreviousLink } from "./Layout/Header";
25
25
  export { Link } from "./Link/Link";
26
26
  export { List } from "./List";
27
27
  export { ClickItem, createClickItemParent } from "./List/ClickItem";
28
- export { ContentItemDuo } from "./List/ContentItemDuo";
28
+ export { ContentItemDuo } from "./List/ContentItemDuo/ContentItemDuo";
29
29
  export { ContentItemMono, ContentItemMonoSize } from "./List/ContentItemMono";
30
30
  export { ContentTabItem, ContentTabList } from "./List/ContentTabList";
31
31
  export { Spinner, type SpinnerVariants, spinnerVariants, } from "./Spinner/Spinner";
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ export { BurgerMenu, Header, NavBar, PreviousLink } from "./Layout/Header";
24
24
  export { Link } from "./Link/Link";
25
25
  export { List } from "./List";
26
26
  export { ClickItem, createClickItemParent } from "./List/ClickItem";
27
- export { ContentItemDuo } from "./List/ContentItemDuo";
27
+ export { ContentItemDuo } from "./List/ContentItemDuo/ContentItemDuo";
28
28
  export { ContentItemMono, ContentItemMonoSize } from "./List/ContentItemMono";
29
29
  export { ContentTabItem, ContentTabList } from "./List/ContentTabList";
30
30
  export { Spinner, spinnerVariants, } from "./Spinner/Spinner";
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-alpha.252",
3
+ "version": "1.0.5-alpha.254",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -47,10 +47,10 @@
47
47
  },
48
48
  "homepage": "https://github.com/AxaFrance/design-system#readme",
49
49
  "peerDependencies": {
50
- "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.252",
50
+ "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.254",
51
51
  "@material-symbols/svg-400": ">= 0.19.0",
52
52
  "react": ">= 18",
53
- "@axa-fr/design-system-apollo-react": "1.0.5-alpha.252"
53
+ "@axa-fr/design-system-apollo-react": "1.0.5-alpha.254"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
56
  "@material-symbols/svg-400": {
@@ -1,2 +0,0 @@
1
- import "@axa-fr/design-system-look-and-feel-css/dist/List/ContentItemDuo/ContentItemDuo.scss";
2
- export { ContentItemDuo } from "./ContentItemDuo";
@@ -1,2 +0,0 @@
1
- import "@axa-fr/design-system-look-and-feel-css/dist/List/ContentItemDuo/ContentItemDuo.scss";
2
- export { ContentItemDuo } from "./ContentItemDuo";