@axa-fr/design-system-look-and-feel-react 1.0.4 → 1.0.5-alpha.244

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.
Files changed (160) hide show
  1. package/dist/Accordion/AccordionTagDateContainer.d.ts +1 -1
  2. package/dist/Accordion/AccordionTagDateContainer.js +2 -2
  3. package/dist/AccordionCore/AccordionCore.js +1 -1
  4. package/dist/Alert/Alert.d.ts +3 -3
  5. package/dist/Alert/Alert.js +6 -6
  6. package/dist/BasePicture/BasePicture.d.ts +1 -0
  7. package/dist/BasePicture/BasePicture.js +1 -0
  8. package/dist/Button/Button.d.ts +2 -17
  9. package/dist/Button/Button.js +1 -15
  10. package/dist/Card/Card.js +1 -1
  11. package/dist/CardMessage/CardMessage.d.ts +1 -0
  12. package/dist/CardMessage/CardMessage.js +1 -0
  13. package/dist/ClickIcon/ClickIcon.d.ts +1 -0
  14. package/dist/ClickIcon/ClickIcon.js +1 -0
  15. package/dist/Divider/Divider.d.ts +1 -6
  16. package/dist/Divider/Divider.js +1 -7
  17. package/dist/Form/Checkbox/Checkbox.js +2 -2
  18. package/dist/Form/Checkbox/CheckboxSelect.d.ts +3 -3
  19. package/dist/Form/Checkbox/CheckboxSelect.js +5 -2
  20. package/dist/Form/Date/Date.d.ts +1 -0
  21. package/dist/Form/Date/Date.js +1 -0
  22. package/dist/Form/FileUpload/FileUpload.d.ts +7 -5
  23. package/dist/Form/FileUpload/FileUpload.js +14 -23
  24. package/dist/Form/ItemLabel/ItemLabel.d.ts +1 -0
  25. package/dist/Form/ItemLabel/ItemLabel.js +1 -0
  26. package/dist/Form/ItemMessage/ItemMessage.d.ts +1 -0
  27. package/dist/Form/ItemMessage/ItemMessage.js +1 -0
  28. package/dist/Form/Radio/Radio.js +2 -2
  29. package/dist/Form/Radio/RadioSelect.d.ts +2 -1
  30. package/dist/Form/Radio/RadioSelect.js +5 -2
  31. package/dist/Form/Select/Select.d.ts +1 -27
  32. package/dist/Form/Select/Select.js +1 -27
  33. package/dist/Form/Text/Text.d.ts +1 -13
  34. package/dist/Form/Text/Text.js +1 -18
  35. package/dist/Form/TextArea/TextArea.d.ts +1 -12
  36. package/dist/Form/TextArea/TextArea.js +1 -16
  37. package/dist/Form/core/FieldForm.d.ts +1 -1
  38. package/dist/Form/core/FieldForm.js +3 -2
  39. package/dist/Grid/DebugGrid.d.ts +1 -5
  40. package/dist/Grid/DebugGrid.js +1 -9
  41. package/dist/Icon/Icon.d.ts +1 -0
  42. package/dist/Icon/Icon.js +1 -0
  43. package/dist/IconBg/IconBg.js +1 -1
  44. package/dist/Layout/Header/BurgerMenu/BurgerMenu.d.ts +13 -0
  45. package/dist/Layout/Header/BurgerMenu/BurgerMenu.js +26 -0
  46. package/dist/Layout/Header/BurgerMenu/index.d.ts +1 -0
  47. package/dist/Layout/Header/BurgerMenu/index.js +1 -0
  48. package/dist/Layout/Header/Header.d.ts +6 -6
  49. package/dist/Layout/Header/Header.js +30 -4
  50. package/dist/Layout/Header/NavBar/NavBar.d.ts +3 -3
  51. package/dist/Layout/Header/NavBar/NavBar.js +10 -5
  52. package/dist/Layout/Header/PreviousLink/PreviousLink.d.ts +1 -1
  53. package/dist/Layout/Header/PreviousLink/PreviousLink.js +3 -1
  54. package/dist/Layout/Header/index.d.ts +3 -0
  55. package/dist/Layout/Header/index.js +3 -0
  56. package/dist/Link/Link.d.ts +1 -10
  57. package/dist/Link/Link.js +1 -14
  58. package/dist/List/ClickItem/ClickItem.d.ts +2 -0
  59. package/dist/List/ClickItem/ClickItem.js +9 -0
  60. package/dist/List/{ClickList/ClickItem → ClickItem}/index.d.ts +1 -0
  61. package/dist/List/{ClickList/ClickItem → ClickItem}/index.js +1 -0
  62. package/dist/List/ContentItemDuo/ContentItemDuo.d.ts +2 -1
  63. package/dist/List/ContentItemDuo/ContentItemDuo.js +3 -4
  64. package/dist/List/ContentItemMono/ContentItemMono.js +1 -1
  65. package/dist/List/ContentTabList/ContentTabItem/ContentTabItem.js +2 -2
  66. package/dist/Message/Message.d.ts +2 -0
  67. package/dist/Message/Message.js +1 -0
  68. package/dist/Modal/Modal.d.ts +12 -0
  69. package/dist/Modal/Modal.js +10 -0
  70. package/dist/Modal/ModalCore.d.ts +11 -0
  71. package/dist/Modal/ModalCore.js +6 -0
  72. package/dist/Modal/components/ModalCoreBody.d.ts +2 -0
  73. package/dist/Modal/components/ModalCoreBody.js +2 -0
  74. package/dist/Modal/components/ModalCoreFooter.d.ts +2 -0
  75. package/dist/Modal/components/ModalCoreFooter.js +2 -0
  76. package/dist/Modal/components/ModalCoreHeader.d.ts +12 -0
  77. package/dist/Modal/components/ModalCoreHeader.js +8 -0
  78. package/dist/Modal/index.d.ts +5 -0
  79. package/dist/Modal/index.js +5 -0
  80. package/dist/ProgressBar/ProgressBar.d.ts +1 -0
  81. package/dist/ProgressBar/ProgressBar.js +1 -0
  82. package/dist/ProgressBarGroup/ProgressBarGroup.d.ts +1 -0
  83. package/dist/ProgressBarGroup/ProgressBarGroup.js +1 -0
  84. package/dist/Skeleton/Skeleton.d.ts +1 -1
  85. package/dist/SkeletonList/SkeletonList.d.ts +1 -1
  86. package/dist/Spinner/Spinner.d.ts +2 -0
  87. package/dist/Spinner/Spinner.js +1 -0
  88. package/dist/Stepper/Stepper.d.ts +1 -12
  89. package/dist/Stepper/Stepper.js +1 -22
  90. package/dist/Tag/Tag.d.ts +2 -6
  91. package/dist/Tag/Tag.js +1 -7
  92. package/dist/TimelineVertical/TimelineVertical.d.ts +1 -0
  93. package/dist/TimelineVertical/TimelineVertical.js +1 -0
  94. package/dist/Title/Title.js +1 -1
  95. package/dist/Title/TitleWithSubtitles.d.ts +1 -1
  96. package/dist/Toggle/Toggle.d.ts +1 -0
  97. package/dist/Toggle/Toggle.js +1 -0
  98. package/dist/index.d.ts +27 -13
  99. package/dist/index.js +26 -12
  100. package/dist/utilities/helpers/getComponentClassName.d.ts +1 -1
  101. package/dist/utilities/helpers/getComponentClassName.js +6 -10
  102. package/package.json +38 -71
  103. package/dist/Divider/index.d.ts +0 -2
  104. package/dist/Divider/index.js +0 -2
  105. package/dist/Form/Select/CustomOption.d.ts +0 -4
  106. package/dist/Form/Select/CustomOption.js +0 -8
  107. package/dist/Form/Select/DropdownIndicator.d.ts +0 -4
  108. package/dist/Form/Select/DropdownIndicator.js +0 -11
  109. package/dist/Form/Select/index.d.ts +0 -1
  110. package/dist/Form/Select/index.js +0 -1
  111. package/dist/Form/Text/index.d.ts +0 -1
  112. package/dist/Form/Text/index.js +0 -1
  113. package/dist/Form/TextArea/index.d.ts +0 -2
  114. package/dist/Form/TextArea/index.js +0 -2
  115. package/dist/Grid/components/Card.d.ts +0 -3
  116. package/dist/Grid/components/Card.js +0 -2
  117. package/dist/Grid/components/Contacts.d.ts +0 -1
  118. package/dist/Grid/components/Contacts.js +0 -9
  119. package/dist/Grid/components/MainTitle.d.ts +0 -1
  120. package/dist/Grid/components/MainTitle.js +0 -4
  121. package/dist/Grid/components/MyFooter.d.ts +0 -1
  122. package/dist/Grid/components/MyFooter.js +0 -31
  123. package/dist/Grid/components/MyHeader.d.ts +0 -1
  124. package/dist/Grid/components/MyHeader.js +0 -9
  125. package/dist/Grid/components/MyList.d.ts +0 -1
  126. package/dist/Grid/components/MyList.js +0 -3
  127. package/dist/Grid/components/Offsets.d.ts +0 -1
  128. package/dist/Grid/components/Offsets.js +0 -7
  129. package/dist/Grid/renderExampleForm.d.ts +0 -1
  130. package/dist/Grid/renderExampleForm.js +0 -30
  131. package/dist/Grid/renderExamplePage.d.ts +0 -1
  132. package/dist/Grid/renderExamplePage.js +0 -9
  133. package/dist/Grid/renderWireframe.d.ts +0 -1
  134. package/dist/Grid/renderWireframe.js +0 -5
  135. package/dist/Link/index.d.ts +0 -2
  136. package/dist/Link/index.js +0 -2
  137. package/dist/List/ClickList/ClickItem/ClickItem.d.ts +0 -2
  138. package/dist/List/ClickList/ClickItem/ClickItem.js +0 -9
  139. package/dist/List/ClickList/ClickList.d.ts +0 -8
  140. package/dist/List/ClickList/ClickList.js +0 -4
  141. package/dist/List/ClickList/index.d.ts +0 -3
  142. package/dist/List/ClickList/index.js +0 -3
  143. package/dist/Loader/Loader.d.ts +0 -12
  144. package/dist/Loader/Loader.js +0 -11
  145. package/dist/Loader/index.d.ts +0 -1
  146. package/dist/Loader/index.js +0 -1
  147. package/dist/ModalClient/Modal.container.d.ts +0 -4
  148. package/dist/ModalClient/Modal.container.js +0 -45
  149. package/dist/ModalClient/Modal.d.ts +0 -4
  150. package/dist/ModalClient/Modal.hook.d.ts +0 -6
  151. package/dist/ModalClient/Modal.hook.js +0 -25
  152. package/dist/ModalClient/Modal.js +0 -6
  153. package/dist/ModalClient/index.d.ts +0 -1
  154. package/dist/ModalClient/index.js +0 -1
  155. package/dist/ModalClient/type.d.ts +0 -38
  156. package/dist/ModalClient/type.js +0 -1
  157. package/dist/Tag/index.d.ts +0 -2
  158. package/dist/Tag/index.js +0 -2
  159. /package/dist/List/{ClickList/ClickItem → ClickItem}/ClickItem.helpers.d.ts +0 -0
  160. /package/dist/List/{ClickList/ClickItem → ClickItem}/ClickItem.helpers.js +0 -0
@@ -1,5 +1,5 @@
1
1
  import { type ComponentProps } from "react";
2
- import { Tag } from "../Tag";
2
+ import { Tag } from "../Tag/Tag";
3
3
  type AccordionTagDateContainerProps = {
4
4
  tagLabel?: string;
5
5
  tagProps?: ComponentProps<typeof Tag>;
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
- import { Tag } from "../Tag";
3
+ import { Tag } from "../Tag/Tag";
4
4
  export const AccordionTagDateContainer = ({ tagLabel, tagProps, dateLabel, dateProps, }) => {
5
5
  const isShowing = useMemo(() => Boolean(tagLabel) || Boolean(dateLabel), [tagLabel, dateLabel]);
6
6
  if (!isShowing) {
7
7
  return null;
8
8
  }
9
- return (_jsxs("div", { className: "af-accordion__tag-date-container", children: [tagLabel && (_jsx("div", { className: "af-accordion__tag-container", children: _jsx(Tag, { classModifier: "warning", ...tagProps, children: tagLabel }) })), dateLabel && (_jsx("time", { className: "af-accordion__date", ...dateProps, children: dateLabel }))] }));
9
+ return (_jsxs("div", { className: "af-accordion__tag-date-container", children: [tagLabel && (_jsx("div", { className: "af-accordion__tag-container", children: _jsx(Tag, { variant: "warning", ...tagProps, children: tagLabel }) })), dateLabel && (_jsx("time", { className: "af-accordion__date", ...dateProps, children: dateLabel }))] }));
10
10
  };
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useCallback, useMemo, } from "react";
3
3
  import { getComponentClassName } from "../utilities";
4
4
  export const AccordionCore = ({ summary, children, className, classModifier, summaryProps, isOpen, onClick, ...detailsProps }) => {
5
- const componentClassName = useMemo(() => getComponentClassName(className, classModifier, "af-accordion"), [classModifier, className]);
5
+ const componentClassName = useMemo(() => getComponentClassName("af-accordion", className, classModifier), [classModifier, className]);
6
6
  const handleToggle = useCallback((event) => {
7
7
  if (onClick) {
8
8
  event.preventDefault();
@@ -1,7 +1,7 @@
1
- import { ComponentPropsWithoutRef, PropsWithChildren, ReactElement } from "react";
2
1
  import "@axa-fr/design-system-look-and-feel-css/dist/Alert/Alert.scss";
2
+ import { ComponentPropsWithoutRef, PropsWithChildren, ReactElement } from "react";
3
+ import { Button } from "../Button/Button";
3
4
  import { Link } from "../Link/Link";
4
- import { ButtonClient } from "../Button/Button";
5
5
  type Headings = "h2" | "h3" | "h4" | "h5" | "h6";
6
6
  export declare const alertTypes: {
7
7
  readonly validation: "validation";
@@ -14,7 +14,7 @@ export type AlertType = keyof typeof alertTypes;
14
14
  type AlertProps = {
15
15
  type: AlertType;
16
16
  title?: string;
17
- action?: ReactElement<typeof Link | typeof ButtonClient>;
17
+ action?: ReactElement<typeof Link | typeof Button>;
18
18
  iconSize?: number;
19
19
  heading?: Headings;
20
20
  } & ComponentPropsWithoutRef<"div">;
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo, } from "react";
3
- import wbIncandescentOutlined from "@material-symbols/svg-400/outlined/wb_incandescent.svg";
4
- import infoIcon from "@material-symbols/svg-400/outlined/info.svg";
2
+ import "@axa-fr/design-system-look-and-feel-css/dist/Alert/Alert.scss";
3
+ import checkCircleOutline from "@material-symbols/svg-400/outlined/check_circle.svg";
5
4
  import errorIcon from "@material-symbols/svg-400/outlined/emergency_home.svg";
6
5
  import errorOutline from "@material-symbols/svg-400/outlined/error.svg";
7
- import checkCircleOutline from "@material-symbols/svg-400/outlined/check_circle.svg";
8
- import "@axa-fr/design-system-look-and-feel-css/dist/Alert/Alert.scss";
6
+ import infoIcon from "@material-symbols/svg-400/outlined/info.svg";
7
+ import wbIncandescentOutlined from "@material-symbols/svg-400/outlined/wb_incandescent.svg";
8
+ import { useMemo, } from "react";
9
9
  import { Svg } from "../Svg";
10
10
  export const alertTypes = {
11
11
  validation: "validation",
@@ -23,5 +23,5 @@ const getIconFromType = (type) => ({
23
23
  })[type] || wbIncandescentOutlined;
24
24
  export const Alert = ({ type = alertTypes.information, title, children, action, iconSize = 24, heading: Heading = "h4", }) => {
25
25
  const icon = useMemo(() => getIconFromType(type), [type]);
26
- return (_jsxs("div", { className: `af-alert af-alert--${type}`, role: "alert", children: [_jsx(Svg, { src: icon, width: iconSize, height: iconSize, className: "af-alert__icon", "aria-hidden": true }), _jsxs("div", { className: "af-alert-client__content", children: [title && _jsx(Heading, { className: "af-alert__title", children: title }), children, action && _jsx("p", { className: "af-alert__action", children: action })] })] }));
26
+ return (_jsxs("div", { className: `af-alert af-alert--${type}`, role: "alert", children: [_jsx(Svg, { src: icon, width: iconSize, height: iconSize, className: "af-alert__icon", "aria-hidden": true }), _jsxs("div", { className: "af-alert-client__content", children: [title && _jsx(Heading, { className: "af-alert__title", children: title }), children, action && _jsx("div", { className: "af-alert__action", children: action })] })] }));
27
27
  };
@@ -0,0 +1 @@
1
+ export { BasePicture } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { BasePicture } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,17 +1,2 @@
1
- import "@axa-fr/design-system-look-and-feel-css/dist/Button/Button.scss";
2
- import { ComponentPropsWithoutRef, PropsWithChildren, ReactNode } from "react";
3
- export declare enum Variants {
4
- primary = "primary",
5
- business = "primary-business",
6
- secondary = "secondary",
7
- secondaryError = "secondary-error",
8
- tertiary = "tertiary",
9
- ghost = "ghost"
10
- }
11
- type ButtonProps = {
12
- variant?: Variants;
13
- iconLeft?: ReactNode;
14
- iconRight?: ReactNode;
15
- } & ComponentPropsWithoutRef<"button">;
16
- export declare const ButtonClient: ({ children, className, disabled, variant, iconLeft, iconRight, ...args }: PropsWithChildren<ButtonProps>) => import("react/jsx-runtime").JSX.Element;
17
- export {};
1
+ export { Button, buttonVariants } from "@axa-fr/design-system-apollo-react/lf";
2
+ export type { ButtonVariants } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,15 +1 @@
1
- import { jsxs as _jsxs } from "react/jsx-runtime";
2
- import "@axa-fr/design-system-look-and-feel-css/dist/Button/Button.scss";
3
- import classNames from "classnames";
4
- export var Variants;
5
- (function (Variants) {
6
- Variants["primary"] = "primary";
7
- Variants["business"] = "primary-business";
8
- Variants["secondary"] = "secondary";
9
- Variants["secondaryError"] = "secondary-error";
10
- Variants["tertiary"] = "tertiary";
11
- Variants["ghost"] = "ghost";
12
- })(Variants || (Variants = {}));
13
- export const ButtonClient = ({ children, className, disabled, variant, iconLeft, iconRight, ...args }) => {
14
- return (_jsxs("button", { className: classNames("af-btn-client", variant && `af-btn-client--${variant.toString()}`, className), disabled: disabled, type: "button", ...args, children: [iconLeft, children, iconRight] }));
15
- };
1
+ export { Button, buttonVariants } from "@axa-fr/design-system-apollo-react/lf";
package/dist/Card/Card.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
3
  import { getComponentClassName } from "../utilities";
4
4
  export const Card = ({ children, className, classModifier, onClick, ...otherProps }) => {
5
- const componentClassName = useMemo(() => getComponentClassName(className, classModifier, "af-card"), [className, classModifier]);
5
+ const componentClassName = useMemo(() => getComponentClassName("af-card", className, classModifier), [className, classModifier]);
6
6
  const Component = useMemo(() => (onClick ? "button" : "section"), [onClick]);
7
7
  return (_jsx(Component, { className: componentClassName, ...(onClick ? { type: "button", onClick } : {}), ...otherProps, children: children }));
8
8
  };
@@ -0,0 +1 @@
1
+ export { CardMessage, cardMessageVariants, type CardMessageVariants, } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { CardMessage, cardMessageVariants, } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { ClickIcon } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { ClickIcon } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,6 +1 @@
1
- type DividerProps = {
2
- className?: string;
3
- classModifier?: string;
4
- };
5
- export declare const Divider: ({ className, classModifier }: DividerProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
1
+ export { Divider } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,7 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
3
- import { getComponentClassName } from "../utilities";
4
- export const Divider = ({ className, classModifier }) => {
5
- const componentClassName = useMemo(() => getComponentClassName(className, classModifier, "af-divider"), [className, classModifier]);
6
- return _jsx("hr", { className: componentClassName });
7
- };
1
+ export { Divider } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import "@axa-fr/design-system-look-and-feel-css/dist/Form/Checkbox/Checkbox.scss";
3
3
  import checkBoxIcon from "@material-symbols/svg-400/outlined/check_box-fill.svg";
4
4
  import checkBoxOutlineBlankIcon from "@material-symbols/svg-400/outlined/check_box_outline_blank.svg";
@@ -10,7 +10,7 @@ const Checkbox = forwardRef(({ label, errorMessage, className, ...inputProps },
10
10
  const idError = useId();
11
11
  let inputId = useId();
12
12
  inputId = inputProps.id || inputId;
13
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: classNames("af-checkbox", className), children: _jsxs("label", { htmlFor: inputId, children: [_jsx("input", { ref: ref, ...inputProps, type: "checkbox", id: inputId, "aria-errormessage": idError, "aria-invalid": !!errorMessage }), _jsxs("div", { className: "af-checkbox__icons", children: [_jsx(Svg, { src: checkBoxOutlineBlankIcon, className: "af-checkbox__unchecked" }), _jsx(Svg, { src: checkBoxIcon, className: "af-checkbox__checked" })] }), label] }, inputProps.name) }), errorMessage && (_jsxs("div", { className: "af-checkbox__error", "aria-live": "assertive", id: idError, children: [_jsx(Svg, { src: errorOutline }), errorMessage] }))] }));
13
+ return (_jsxs("div", { children: [_jsx("div", { className: classNames("af-checkbox", className), children: _jsxs("label", { htmlFor: inputId, children: [_jsx("input", { ref: ref, ...inputProps, type: "checkbox", id: inputId, "aria-errormessage": idError, "aria-invalid": Boolean(errorMessage) }), _jsxs("div", { className: "af-checkbox__icons", children: [_jsx(Svg, { src: checkBoxOutlineBlankIcon, className: "af-checkbox__unchecked" }), _jsx(Svg, { src: checkBoxIcon, className: "af-checkbox__checked" })] }), label] }, inputProps.name) }), errorMessage && (_jsxs("div", { className: "af-checkbox__error", "aria-live": "assertive", id: idError, children: [_jsx(Svg, { src: errorOutline }), errorMessage] }))] }));
14
14
  });
15
15
  Checkbox.displayName = "Checkbox";
16
16
  export { Checkbox };
@@ -1,6 +1,6 @@
1
1
  import "@axa-fr/design-system-look-and-feel-css/dist/Form/Checkbox/Checkbox.scss";
2
- import React, { type ReactNode } from "react";
3
- type CheckboxProps = {
2
+ import React, { ComponentPropsWithRef, type ReactNode } from "react";
3
+ type CheckboxProps = ComponentPropsWithRef<"input"> & {
4
4
  type: "vertical" | "horizontal";
5
5
  labelGroup?: string;
6
6
  descriptionGroup?: string;
@@ -14,5 +14,5 @@ type CheckboxProps = {
14
14
  errorMessage?: string;
15
15
  onChange?: React.ChangeEventHandler;
16
16
  };
17
- export declare const CheckboxSelect: ({ labelGroup, descriptionGroup, isRequired, options, errorMessage, onChange, type, }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
17
+ export declare const CheckboxSelect: ({ className, labelGroup, descriptionGroup, isRequired, options, errorMessage, onChange, type, }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
18
18
  export {};
@@ -5,7 +5,10 @@ import checkBoxOutlineBlankIcon from "@material-symbols/svg-400/outlined/check_b
5
5
  import errorOutline from "@material-symbols/svg-400/outlined/error.svg";
6
6
  import { useId } from "react";
7
7
  import { Svg } from "../../Svg";
8
- export const CheckboxSelect = ({ labelGroup, descriptionGroup, isRequired, options, errorMessage, onChange, type = "vertical", }) => {
8
+ import { getComponentClassName } from "../../utilities/helpers/getComponentClassName";
9
+ export const CheckboxSelect = ({ className, labelGroup, descriptionGroup, isRequired, options, errorMessage, onChange, type = "vertical", }) => {
10
+ const componentClassName = getComponentClassName("af-checkbox__container", className);
11
+ const checkboxGroupClassName = getComponentClassName(`af-checkbox af-checkbox-select af-checkbox-select--${type}`, className);
9
12
  const optionId = useId();
10
- return (_jsxs("div", { className: "af-checkbox__container", children: [labelGroup && (_jsxs("span", { className: "af-checkbox__label", id: optionId, children: [labelGroup, isRequired && _jsx("span", { "aria-hidden": "true", children: "\u00A0*" })] })), descriptionGroup && (_jsx("span", { className: "af-checkbox__description", children: descriptionGroup })), _jsx("div", { role: "group", className: `af-checkbox af-checkbox-select af-checkbox-select--${type}`, children: options.map(({ label, description, subtitle, icon, ...inputProps }) => (_jsxs("label", { htmlFor: `id-${inputProps.name}`, children: [_jsx("input", { type: "checkbox", ...inputProps, id: `id-${inputProps.name}`, onChange: onChange, "aria-invalid": Boolean(errorMessage) && !inputProps.disabled }), _jsxs("div", { className: "af-checkbox__icons", children: [_jsx(Svg, { src: checkBoxOutlineBlankIcon, className: "af-checkbox__unchecked" }), _jsx(Svg, { src: checkBoxIcon, className: "af-checkbox__checked" })] }), _jsxs("div", { className: "af-checkbox__content", children: [icon, _jsxs("div", { className: "af-checkbox__content-description", children: [_jsx("span", { children: label }), description && _jsx("span", { children: description }), subtitle && _jsx("span", { children: subtitle })] })] })] }, inputProps.name))) }), errorMessage && (_jsxs("div", { className: "af-checkbox__error", "aria-live": "assertive", children: [_jsx(Svg, { src: errorOutline }), errorMessage] }))] }));
13
+ return (_jsxs("div", { className: componentClassName, children: [_jsxs("div", { className: "af-checkbox__label-container", children: [labelGroup && (_jsxs("span", { className: "af-checkbox__label", id: optionId, children: [labelGroup, isRequired && _jsx("span", { "aria-hidden": "true", children: "\u00A0*" })] })), descriptionGroup && (_jsx("span", { className: "af-checkbox__description", children: descriptionGroup }))] }), _jsx("div", { role: "group", className: checkboxGroupClassName, children: options.map(({ label, description, subtitle, icon, ...inputProps }) => (_jsxs("label", { htmlFor: `id-${inputProps.name}`, children: [_jsx("input", { type: "checkbox", ...inputProps, id: `id-${inputProps.name}`, onChange: onChange, "aria-invalid": Boolean(errorMessage) && !inputProps.disabled }), _jsxs("div", { className: "af-checkbox__icons", children: [_jsx(Svg, { src: checkBoxOutlineBlankIcon, className: "af-checkbox__unchecked" }), _jsx(Svg, { src: checkBoxIcon, className: "af-checkbox__checked" })] }), _jsxs("div", { className: "af-checkbox__content", children: [icon, _jsxs("div", { className: "af-checkbox__content-description", children: [_jsx("span", { children: label }), description && _jsx("span", { children: description }), subtitle && _jsx("span", { children: subtitle })] })] })] }, inputProps.name))) }), errorMessage && (_jsxs("div", { className: "af-checkbox__error", "aria-live": "assertive", children: [_jsx(Svg, { src: errorOutline }), errorMessage] }))] }));
11
14
  };
@@ -0,0 +1 @@
1
+ export { DateInput } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { DateInput } from "@axa-fr/design-system-apollo-react/lf";
@@ -6,27 +6,29 @@ type Props = Omit<ComponentPropsWithRef<"input">, "required"> & {
6
6
  buttonLabel?: string;
7
7
  dropzoneDescription?: string;
8
8
  instructions?: string;
9
+ filesListLabel?: string;
9
10
  required?: boolean;
10
- globalError: string;
11
- errors: Array<{
11
+ globalError?: string;
12
+ errors?: Array<{
12
13
  id?: string | undefined;
13
14
  message: string;
14
15
  }>;
15
- files: Array<{
16
+ files?: Array<{
16
17
  id: string;
17
18
  name: string;
18
19
  size: number;
19
20
  isLoading: boolean;
20
21
  }>;
21
- accept: string;
22
+ accept?: string;
22
23
  isMobile?: boolean;
24
+ withPadding?: boolean;
23
25
  onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
24
26
  onDrop?: (event: React.DragEvent<HTMLDivElement>) => void;
25
27
  onView?: (id: string) => void;
26
28
  onDelete?: (id: string) => void;
27
29
  };
28
30
  declare const FileUpload: {
29
- ({ id, label, buttonLabel, instructions, dropzoneDescription, required, files, errors, globalError, isMobile, onView, onDelete, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
31
+ ({ id, label, buttonLabel, instructions, dropzoneDescription, filesListLabel, required, files, errors, globalError, isMobile, withPadding, onView, onDelete, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
30
32
  displayName: string;
31
33
  };
32
34
  export { FileUpload };
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
3
  import "@axa-fr/design-system-look-and-feel-css/dist/Form/FileUpload/FileUpload.scss";
4
4
  import visibility from "@material-symbols/svg-400/outlined/visibility-fill.svg";
@@ -8,46 +8,37 @@ import error from "@material-symbols/svg-400/outlined/error-fill.svg";
8
8
  import errorO from "@material-symbols/svg-400/outlined/error.svg";
9
9
  import plus from "@material-symbols/svg-400/outlined/add_circle-fill.svg";
10
10
  import classNames from "classnames";
11
- import { Svg } from "../../Svg";
12
- import { Loader } from "../../Loader";
13
- import { Button } from "../..";
14
- import { Variants } from "../../Button/Button";
11
+ import { Spinner, Svg, Button } from "@axa-fr/design-system-apollo-react/lf";
15
12
  import { InputError } from "../InputError";
16
13
  function getReadableFileSizeString(fileSizeInBytes) {
17
14
  let i = -1;
18
15
  let fileSizeInBytesCopy = fileSizeInBytes;
19
16
  const byteUnits = [" Ko", " Mo", " Go"];
20
17
  do {
21
- fileSizeInBytesCopy /= 1024;
18
+ fileSizeInBytesCopy /= 1000;
22
19
  i += 1;
23
- } while (fileSizeInBytesCopy > 1024);
20
+ } while (fileSizeInBytesCopy > 1000);
24
21
  return Math.max(fileSizeInBytesCopy, 0.1).toFixed(1) + byteUnits[i];
25
22
  }
26
- const FileUpload = ({ id, label, buttonLabel, instructions, dropzoneDescription, required, files, errors, globalError, isMobile, onView, onDelete, ...otherProps }) => {
23
+ const FileUpload = ({ id, label, buttonLabel, instructions, dropzoneDescription, filesListLabel, required, files, errors, globalError, isMobile, withPadding = false, onView, onDelete, ...otherProps }) => {
27
24
  const idError = useId();
28
25
  const getIcon = (isInError, isLoading) => {
29
26
  if (isInError) {
30
27
  return (_jsx(Svg, { src: error, className: "af-form__file-title-container-icon-error" }));
31
28
  }
32
29
  if (isLoading) {
33
- return _jsx(Loader, { size: 18, border: 2 });
30
+ return _jsx(Spinner, { size: 24 });
34
31
  }
35
32
  return (_jsx(Svg, { src: check, className: "af-form__file-title-container-icon-success" }));
36
33
  };
37
- return (_jsxs(_Fragment, { 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 || !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: Variants.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 }), _jsx("small", { className: "af-form__file-input-help", children: instructions }), _jsx("div", { className: "custom-table-file af-file-table", children: _jsx("ul", { className: "af-form__file-list", children: files.map(({ id: fileId, name, size, isLoading }) => {
38
- const effectiveSize = getReadableFileSizeString(size);
39
- const isInError = errors.some((fileError) => fileError.id === fileId);
40
- const errorMessage = errors.find((fileError) => fileError.id === fileId)?.message;
41
- 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) => {
42
- if (e.key === "Enter") {
43
- onView(fileId);
44
- }
45
- }, className: "af-form__file-actions-icon", src: visibility })), onDelete && (_jsx(Svg, { tabIndex: 0, role: "button", "aria-label": "Supprimer", onClick: () => onDelete(fileId), onKeyDown: (e) => {
46
- if (e.key === "Enter") {
47
- onDelete(fileId);
48
- }
49
- }, 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));
50
- }) }) })] }));
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(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));
41
+ }) })] }))] }));
51
42
  };
52
43
  FileUpload.displayName = "FileUpload";
53
44
  export { FileUpload };
@@ -0,0 +1 @@
1
+ export { ItemLabel } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { ItemLabel } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { ItemMessage } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { ItemMessage } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import "@axa-fr/design-system-look-and-feel-css/dist/Form/Radio/Radio.scss";
3
3
  import radioIcon from "@material-symbols/svg-400/outlined/radio_button_checked.svg";
4
4
  import radioOutlineBlankIcon from "@material-symbols/svg-400/outlined/radio_button_unchecked.svg";
@@ -9,7 +9,7 @@ const Radio = forwardRef(({ label, errorMessage, ...inputProps }, ref) => {
9
9
  let inputId = useId();
10
10
  inputId = inputProps.id || inputId;
11
11
  const idError = useId();
12
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "af-radio", role: "radiogroup", "aria-invalid": Boolean(errorMessage), "aria-errormessage": idError, children: _jsxs("label", { htmlFor: inputId, children: [_jsx("input", { ref: ref, ...inputProps, type: "radio", id: inputId }), _jsxs("div", { className: "af-radio__icons", children: [_jsx(Svg, { src: radioOutlineBlankIcon, className: "af-radio__unchecked" }), _jsx(Svg, { src: radioIcon, className: "af-radio__checked" })] }), label] }, inputProps.name) }), errorMessage && _jsx(InputError, { id: idError, message: errorMessage })] }));
12
+ return (_jsxs("div", { children: [_jsx("div", { className: "af-radio", role: "radiogroup", "aria-invalid": Boolean(errorMessage), "aria-errormessage": idError, children: _jsxs("label", { htmlFor: inputId, children: [_jsx("input", { ref: ref, ...inputProps, type: "radio", id: inputId }), _jsxs("div", { className: "af-radio__icons", children: [_jsx(Svg, { src: radioOutlineBlankIcon, className: "af-radio__unchecked" }), _jsx(Svg, { src: radioIcon, className: "af-radio__checked" })] }), label] }, inputProps.name) }), errorMessage && _jsx(InputError, { id: idError, message: errorMessage })] }));
13
13
  });
14
14
  Radio.displayName = "Radio";
15
15
  export { Radio };
@@ -1,8 +1,9 @@
1
1
  import "@axa-fr/design-system-look-and-feel-css/dist/Form/Radio/Radio.scss";
2
2
  import React, { ComponentPropsWithRef, ReactNode } from "react";
3
- type RadioSelectProps = {
3
+ type RadioSelectProps = ComponentPropsWithRef<"input"> & {
4
4
  type: "vertical" | "horizontal";
5
5
  label?: string;
6
+ description?: string;
6
7
  isRequired?: boolean;
7
8
  options: ({
8
9
  label: ReactNode;
@@ -5,7 +5,10 @@ import radioOutlineBlankIcon from "@material-symbols/svg-400/outlined/radio_butt
5
5
  import { forwardRef, useCallback, useId, } from "react";
6
6
  import { Svg } from "../../Svg";
7
7
  import { InputError } from "../InputError";
8
- export const RadioSelect = forwardRef(({ id, label, options, errorMessage, onChange, type = "vertical", name, value, isDisabled, isRequired, ...rest }, ref) => {
8
+ import { getComponentClassName } from "../../utilities/helpers/getComponentClassName";
9
+ export const RadioSelect = forwardRef(({ className, id, label, description, options, errorMessage, onChange, type = "vertical", name, value, isDisabled, isRequired, ...rest }, ref) => {
10
+ const componentClassName = getComponentClassName("af-radio__container", className);
11
+ const radioGroupClassName = getComponentClassName(`af-radio af-radio-select af-radio-select--${type}`, className);
9
12
  const generatedId = useId();
10
13
  const optionId = id || generatedId;
11
14
  const getRef = useCallback((index, reference, val, inputVal) => {
@@ -14,6 +17,6 @@ export const RadioSelect = forwardRef(({ id, label, options, errorMessage, onCha
14
17
  }
15
18
  return null;
16
19
  }, []);
17
- return (_jsxs("div", { className: "af-radio__container", children: [label && (_jsxs("span", { className: "af-radio__label", id: optionId, children: [label, isRequired && _jsx("span", { "aria-hidden": "true", children: "\u00A0*" })] })), _jsx("div", { ...rest, role: "radiogroup", className: `af-radio af-radio-select af-radio-select--${type}`, "aria-invalid": Boolean(errorMessage), "aria-labelledby": optionId, "aria-errormessage": `${optionId}-error`, children: options.map(({ label: inputLabel, description, subtitle, icon, disabled: inputDisabled, ...inputProps }, idx) => (_jsxs("label", { htmlFor: `${optionId}-${inputLabel}`, children: [_jsx("input", { type: "radio", ...(isDisabled || inputDisabled ? { disabled: true } : null), ...inputProps, name: name, id: `${optionId}-${inputLabel}`, onChange: onChange, "aria-checked": value === inputProps.value, checked: value === inputProps.value, ref: getRef(idx, ref, value, inputProps.value) }), _jsxs("div", { className: "af-radio__icons", children: [_jsx(Svg, { src: radioOutlineBlankIcon, className: "af-radio__unchecked" }), _jsx(Svg, { src: radioIcon, className: "af-radio__checked" })] }), _jsxs("div", { className: "af-radio__content", children: [icon, _jsxs("div", { className: "af-radio__content-description", children: [_jsx("span", { children: inputLabel }), description && _jsx("span", { children: description }), subtitle && _jsx("span", { children: subtitle })] })] })] }, inputLabel))) }), errorMessage && (_jsx(InputError, { id: `${optionId}-error`, message: errorMessage }))] }));
20
+ return (_jsxs("div", { className: componentClassName, children: [_jsxs("div", { className: "af-radio__label-container", children: [label && (_jsxs("span", { className: "af-radio__label", id: optionId, children: [label, isRequired && _jsx("span", { "aria-hidden": "true", children: "\u00A0*" })] })), description && (_jsx("span", { className: "af-radio__description", children: description }))] }), _jsx("div", { ...rest, role: "radiogroup", className: radioGroupClassName, "aria-invalid": Boolean(errorMessage), "aria-labelledby": optionId, "aria-errormessage": `${optionId}-error`, children: options.map(({ label: inputLabel, description: inputDescription, subtitle, icon, disabled: inputDisabled, ...inputProps }, idx) => (_jsxs("label", { htmlFor: `${optionId}-${inputLabel}`, children: [_jsx("input", { type: "radio", ...(isDisabled || inputDisabled ? { disabled: true } : null), ...inputProps, name: name, id: `${optionId}-${inputLabel}`, onChange: onChange, "aria-checked": value === inputProps.value, checked: value === inputProps.value, ref: getRef(idx, ref, value, inputProps.value) }), _jsxs("div", { className: "af-radio__icons", children: [_jsx(Svg, { src: radioOutlineBlankIcon, className: "af-radio__unchecked" }), _jsx(Svg, { src: radioIcon, className: "af-radio__checked" })] }), _jsxs("div", { className: "af-radio__content", children: [icon, _jsxs("div", { className: "af-radio__content-description", children: [_jsx("span", { children: inputLabel }), inputDescription && _jsx("span", { children: inputDescription }), subtitle && _jsx("span", { children: subtitle })] })] })] }, inputLabel))) }), errorMessage && (_jsx(InputError, { id: `${optionId}-error`, message: errorMessage }))] }));
18
21
  });
19
22
  RadioSelect.displayName = "RadioSelect";
@@ -1,27 +1 @@
1
- import "@axa-fr/design-system-look-and-feel-css/dist/Form/Select/Select.scss";
2
- import ReactSelect, { ActionMeta, SingleValue } from "react-select";
3
- import { ComponentPropsWithoutRef, PropsWithChildren } from "react";
4
- type Option = {
5
- label: string;
6
- value: string | number;
7
- };
8
- type Props = Omit<ComponentPropsWithoutRef<ReactSelect>, "placeholder" | "noOptionsMessage"> & {
9
- id: string;
10
- label: string;
11
- options: {
12
- label: string;
13
- value?: string | number | readonly string[];
14
- }[];
15
- value: Option | null;
16
- errorLabel?: string;
17
- placeholder?: string;
18
- noOptionsMessage?: string;
19
- onChange: (newValue: SingleValue<Option>, actionMeta: ActionMeta<string>) => void;
20
- disabled?: boolean;
21
- required?: boolean;
22
- };
23
- declare const Select: {
24
- ({ id, required, disabled, label, errorLabel, noOptionsMessage, ...otherProps }: PropsWithChildren<Props>): import("react/jsx-runtime").JSX.Element;
25
- displayName: string;
26
- };
27
- export { Select };
1
+ export { Select } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,27 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import "@axa-fr/design-system-look-and-feel-css/dist/Form/Select/Select.scss";
3
- import ErrorOutline from "@material-symbols/svg-400/outlined/error.svg";
4
- import ReactSelect from "react-select";
5
- import classNames from "classnames";
6
- import { DropdownIndicator } from "./DropdownIndicator";
7
- import { Svg } from "../../Svg";
8
- import { CustomOption } from "./CustomOption";
9
- const Select = ({ id, required, disabled, label, errorLabel, noOptionsMessage, ...otherProps }) => {
10
- return (_jsxs(_Fragment, { children: [label && (_jsxs("label", { id: `${id}__label`, htmlFor: `${id}__input`, className: "af-form__select-label", children: [label, required && _jsx("span", { children: " *" })] })), _jsx(ReactSelect, { inputId: `${id}__input`, "aria-labelledby": `${id}__label`, "aria-errormessage": `${id}__error`, "aria-invalid": Boolean(errorLabel), unstyled: true, isDisabled: disabled, noOptionsMessage: () => noOptionsMessage || "Aucun résultat", components: {
11
- DropdownIndicator,
12
- Option: CustomOption,
13
- }, classNames: {
14
- control: () => "af-form__input-select",
15
- menu: () => "af-form__input-select-menu",
16
- menuList: () => "af-form__select-menu-list",
17
- container: ({ isFocused, isDisabled, selectProps: { menuIsOpen }, }) => classNames("af-form__input-select-container", isFocused && "af-form__input-select-container-focused", isDisabled && "af-form__input-select-container-disabled", errorLabel &&
18
- !isFocused &&
19
- !menuIsOpen &&
20
- "af-form__input-select-container-error"),
21
- option: ({ isSelected, isFocused, }) => classNames("af-form__input-select-menu-options", isSelected && "af-form__input-select-menu-options-selected", isFocused && "af-form__input-select-menu-options-focused"),
22
- singleValue: ({ isDisabled, }) => classNames("af-form__select-single-value", isDisabled && "af-form__select-single-value-disabled"),
23
- dropdownIndicator: () => "af-form__select-dropdown-indicator",
24
- }, className: "af-form__input-select", ...otherProps }), errorLabel && (_jsxs("div", { id: `${id}__error`, className: "af-form__select-error", "aria-live": "assertive", children: [_jsx(Svg, { src: ErrorOutline, width: 16, className: "af-form__select-error-icon" }), errorLabel] }))] }));
25
- };
26
- Select.displayName = "Select";
27
- export { Select };
1
+ export { Select } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,13 +1 @@
1
- import "@axa-fr/design-system-look-and-feel-css/dist/Form/Text/Text.scss";
2
- import { ComponentPropsWithRef, MouseEventHandler } from "react";
3
- type Props = ComponentPropsWithRef<"input"> & {
4
- classModifier?: string;
5
- helper?: string;
6
- error?: string;
7
- description?: string;
8
- label?: string;
9
- buttonLabel?: string;
10
- onButtonClick?: MouseEventHandler<HTMLButtonElement>;
11
- };
12
- declare const Text: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
13
- export { Text };
1
+ export { TextInput } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,18 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import "@axa-fr/design-system-look-and-feel-css/dist/Form/Text/Text.scss";
3
- import { forwardRef, useId, } from "react";
4
- import infoIcon from "@material-symbols/svg-400/outlined/info.svg";
5
- import { Button } from "../..";
6
- import { Variants } from "../../Button/Button";
7
- import { Svg } from "../../Svg";
8
- import { getComponentClassName } from "../../utilities";
9
- import { InputError } from "../InputError";
10
- const Text = forwardRef(({ className, classModifier = "", label, description, helper, error, buttonLabel, onButtonClick, required, ...otherProps }, inputRef) => {
11
- const componentClassName = getComponentClassName(className, classModifier, "af-form__input-text");
12
- let inputId = useId();
13
- inputId = otherProps.id || inputId;
14
- const idError = useId();
15
- return (_jsxs("div", { className: "af-form__input-container", children: [(label || description || buttonLabel) && (_jsxs("div", { className: "af-form__label-container", children: [_jsxs("label", { htmlFor: inputId, className: "af-form__input-label", children: [label, " ", required && _jsx("span", { children: " *" })] }), description && (_jsx("span", { className: "af-form__input-description", children: description })), buttonLabel && (_jsx(Button, { className: "af-form__input-more", variant: Variants.ghost, iconLeft: _jsx(Svg, { src: infoIcon }), onClick: onButtonClick, children: buttonLabel }))] })), _jsx("input", { id: inputId, className: componentClassName, type: "text", ref: inputRef, "aria-errormessage": idError, "aria-invalid": Boolean(error), ...otherProps }), helper && _jsx("span", { className: "af-form__input-helper", children: helper }), error && _jsx(InputError, { id: idError, message: error })] }));
16
- });
17
- Text.displayName = "Text";
18
- export { Text };
1
+ export { TextInput } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,12 +1 @@
1
- import { ComponentPropsWithRef, MouseEventHandler } from "react";
2
- type Props = ComponentPropsWithRef<"textarea"> & {
3
- classModifier?: string;
4
- helper?: string;
5
- error?: string;
6
- description?: string;
7
- label?: string;
8
- buttonLabel?: string;
9
- onButtonClick?: MouseEventHandler<HTMLButtonElement>;
10
- };
11
- declare const TextArea: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
12
- export { TextArea };
1
+ export { TextArea } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,16 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useId, } from "react";
3
- import infoIcon from "@material-symbols/svg-400/outlined/info.svg";
4
- import { getComponentClassName } from "../core";
5
- import { Button, Svg } from "../..";
6
- import { Variants } from "../../Button/Button";
7
- import { InputError } from "../InputError";
8
- const TextArea = forwardRef(({ className, classModifier = "", label, description, helper, error, buttonLabel, onButtonClick, required, ...otherProps }, inputRef) => {
9
- const componentClassName = getComponentClassName(className, classModifier, "af-form__input-textarea");
10
- let inputId = useId();
11
- inputId = otherProps.id || inputId;
12
- const idError = useId();
13
- return (_jsxs("div", { className: "af-form__input-container", children: [_jsxs("label", { htmlFor: inputId, className: "af-form__input-label", children: [label, " ", required && _jsx("span", { children: " *" })] }), description && (_jsx("span", { className: "af-form__input-description", children: description })), buttonLabel && (_jsx(Button, { className: "af-form__input-more", variant: Variants.ghost, iconLeft: _jsx(Svg, { src: infoIcon }), onClick: onButtonClick, children: buttonLabel })), _jsx("textarea", { id: inputId, className: componentClassName, ref: inputRef, "aria-errormessage": idError, "aria-invalid": Boolean(error), ...otherProps }), helper && _jsx("span", { className: "af-form__input-helper", children: helper }), error && _jsx(InputError, { id: idError, message: error })] }));
14
- });
15
- TextArea.displayName = "TextArea";
16
- export { TextArea };
1
+ export { TextArea } from "@axa-fr/design-system-apollo-react/lf";
@@ -49,7 +49,7 @@ export declare const eventWrapper: ({ wrapper, props }: EventWrapperProps) => {
49
49
  onFocus: (ev: BaseSyntheticEvent) => void;
50
50
  };
51
51
  type AddPropsClone = Omit<RenderChildrenProps, "children"> & {
52
- child: ReactElement;
52
+ child: ReactElement<Record<string, unknown>>;
53
53
  classModifier: string;
54
54
  name: string;
55
55
  getMessageClassModifierFn?: typeof FormClassManager.getMessageClassModifier;
@@ -101,7 +101,8 @@ export const renderedChildren = ({ children, wrapper, message, messageType, }) =
101
101
  };
102
102
  if (child.props.children) {
103
103
  const subChildren = renderedChildren({
104
- children: child.props.children,
104
+ children: child.props
105
+ .children,
105
106
  wrapper,
106
107
  message,
107
108
  messageType,
@@ -119,7 +120,7 @@ export const renderedChildren = ({ children, wrapper, message, messageType, }) =
119
120
  messageType,
120
121
  classModifier: props.classModifier,
121
122
  wrapper,
122
- child,
123
+ child: child,
123
124
  }),
124
125
  });
125
126
  });
@@ -1,5 +1 @@
1
- import "@axa-fr/design-system-look-and-feel-css/dist/Grid/DebugGrid.scss";
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";
@@ -1,9 +1 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
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";
@@ -0,0 +1 @@
1
+ export { Icon, iconVariants, type IconVariants, iconSizeVariants, type IconSizeVariants, } from "@axa-fr/design-system-apollo-react/lf";