@axa-fr/canopee-react 1.8.1-alpha.1 → 2.0.0-alpha.22

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 (211) hide show
  1. package/dist/client.d.ts +11 -6
  2. package/dist/client.js +11 -6
  3. package/dist/distributeur/Action/Action.d.ts +8 -2
  4. package/dist/distributeur/Action/Action.js +4 -4
  5. package/dist/distributeur/Button/Button.d.ts +8 -5
  6. package/dist/distributeur/Button/Button.js +2 -2
  7. package/dist/distributeur/Form/Checkbox/Checkbox.d.ts +6 -3
  8. package/dist/distributeur/Form/Checkbox/Checkbox.js +4 -4
  9. package/dist/distributeur/Form/Checkbox/CheckboxInput.d.ts +6 -3
  10. package/dist/distributeur/Form/Checkbox/CheckboxInput.js +4 -4
  11. package/dist/distributeur/Form/Checkbox/CheckboxItem.d.ts +7 -3
  12. package/dist/distributeur/Form/Checkbox/CheckboxItem.js +4 -4
  13. package/dist/distributeur/Form/Choice/Choice.d.ts +6 -3
  14. package/dist/distributeur/Form/Choice/Choice.js +4 -4
  15. package/dist/distributeur/Form/Choice/ChoiceInput.d.ts +6 -3
  16. package/dist/distributeur/Form/Choice/ChoiceInput.js +2 -4
  17. package/dist/distributeur/Form/Date/Date.d.ts +4 -1
  18. package/dist/distributeur/Form/Date/Date.js +4 -4
  19. package/dist/distributeur/Form/Date/DateInput.d.ts +4 -1
  20. package/dist/distributeur/Form/Date/DateInput.js +2 -4
  21. package/dist/distributeur/Form/Experimental/Input.d.ts +5 -1
  22. package/dist/distributeur/Form/Experimental/Input.js +4 -4
  23. package/dist/distributeur/Form/Experimental/TextInput.d.ts +4 -1
  24. package/dist/distributeur/Form/Experimental/TextInput.js +4 -4
  25. package/dist/distributeur/Form/Number/Number.d.ts +4 -1
  26. package/dist/distributeur/Form/Number/Number.js +4 -4
  27. package/dist/distributeur/Form/Pass/Pass.d.ts +4 -1
  28. package/dist/distributeur/Form/Pass/Pass.js +4 -4
  29. package/dist/distributeur/Form/Radio/Radio.d.ts +12 -23
  30. package/dist/distributeur/Form/Radio/Radio.js +4 -4
  31. package/dist/distributeur/Form/Radio/RadioInput.d.ts +6 -3
  32. package/dist/distributeur/Form/Radio/RadioInput.js +4 -4
  33. package/dist/distributeur/Form/Radio/RadioItem.d.ts +4 -1
  34. package/dist/distributeur/Form/Radio/RadioItem.js +4 -4
  35. package/dist/distributeur/Form/Select/Select.d.ts +9 -325
  36. package/dist/distributeur/Form/Select/Select.js +5 -5
  37. package/dist/distributeur/Form/Select/SelectBase.d.ts +10 -6
  38. package/dist/distributeur/Form/Select/SelectBase.js +4 -4
  39. package/dist/distributeur/Form/Select/SelectDefault.d.ts +4 -1
  40. package/dist/distributeur/Form/Select/SelectDefault.js +4 -4
  41. package/dist/distributeur/Form/Select/SelectDefaultWithOptions.d.ts +4 -1
  42. package/dist/distributeur/Form/Select/SelectDefaultWithOptions.js +5 -12
  43. package/dist/distributeur/Form/Select/SelectInput.d.ts +9 -376
  44. package/dist/distributeur/Form/Select/SelectInput.js +2 -4
  45. package/dist/distributeur/Form/Text/Text.d.ts +4 -1
  46. package/dist/distributeur/Form/Text/Text.js +4 -4
  47. package/dist/distributeur/Form/Text/TextInput.d.ts +4 -1
  48. package/dist/distributeur/Form/Text/TextInput.js +2 -4
  49. package/dist/distributeur/Form/Textarea/Textarea.d.ts +7 -2
  50. package/dist/distributeur/Form/Textarea/Textarea.js +4 -4
  51. package/dist/distributeur/Form/Textarea/TextareaInput.d.ts +4 -1
  52. package/dist/distributeur/Form/Textarea/TextareaInput.js +2 -4
  53. package/dist/distributeur/Layout/Footer/Footer.d.ts +5 -3
  54. package/dist/distributeur/Layout/Footer/Footer.js +2 -2
  55. package/dist/distributeur/Layout/Header/Name/Name.js +1 -1
  56. package/dist/distributeur/Layout/Header/NavBar/NavBarItem/NavBarItemBase.js +1 -1
  57. package/dist/distributeur/Link/Link.d.ts +4 -1
  58. package/dist/distributeur/Link/Link.js +3 -4
  59. package/dist/distributeur/Link/LinkAnchor.d.ts +4 -1
  60. package/dist/distributeur/Link/LinkAnchor.js +4 -4
  61. package/dist/distributeur/Loader/ItemLoader.d.ts +4 -0
  62. package/dist/distributeur/Loader/ItemLoader.js +8 -0
  63. package/dist/distributeur/Loader/Loader.d.ts +7 -10
  64. package/dist/distributeur/Loader/Loader.js +12 -27
  65. package/dist/distributeur/Loader/SquareLoader.d.ts +15 -0
  66. package/dist/distributeur/Loader/SquareLoader.js +33 -0
  67. package/dist/distributeur/ModalAgent/BooleanModal.d.ts +4 -1
  68. package/dist/distributeur/ModalAgent/BooleanModal.js +4 -4
  69. package/dist/distributeur/ModalAgent/Modal.d.ts +4 -1
  70. package/dist/distributeur/ModalAgent/Modal.js +4 -4
  71. package/dist/distributeur/Steps/VerticalStep.d.ts +2 -8
  72. package/dist/distributeur/Svg/svgInjector.js +1 -0
  73. package/dist/distributeur/Tag/Tag.d.ts +4 -1
  74. package/dist/distributeur/Tag/Tag.js +4 -4
  75. package/dist/distributeur/Title/Title.d.ts +4 -1
  76. package/dist/distributeur/Title/Title.js +4 -4
  77. package/dist/distributeur.d.ts +12 -6
  78. package/dist/distributeur.js +4 -1
  79. package/dist/prospect-client/AppName/AppName.d.ts +44 -0
  80. package/dist/prospect-client/AppName/AppName.js +23 -0
  81. package/dist/prospect-client/Card/CardApollo.d.ts +1 -1
  82. package/dist/prospect-client/Card/CardApollo.js +1 -1
  83. package/dist/prospect-client/Card/CardCommon.d.ts +30 -2
  84. package/dist/prospect-client/Card/CardCommon.js +18 -1
  85. package/dist/prospect-client/Card/CardLF.d.ts +1 -1
  86. package/dist/prospect-client/Card/CardLF.js +1 -1
  87. package/dist/prospect-client/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionCommon.d.ts +4 -1
  88. package/dist/prospect-client/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionCommon.js +3 -3
  89. package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.d.ts +4 -1
  90. package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.js +2 -2
  91. package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextApollo.d.ts +4 -1
  92. package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextApollo.js +1 -2
  93. package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.d.ts +4 -1
  94. package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.js +4 -4
  95. package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextLF.d.ts +4 -1
  96. package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextLF.js +1 -2
  97. package/dist/prospect-client/Form/Dropdown/DropdownCommon.d.ts +4 -1
  98. package/dist/prospect-client/Form/Dropdown/DropdownCommon.js +4 -4
  99. package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadApollo.d.ts +4 -1
  100. package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadApollo.js +1 -2
  101. package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadCommon.d.ts +4 -1
  102. package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadCommon.js +4 -4
  103. package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadLF.d.ts +4 -1
  104. package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadLF.js +1 -2
  105. package/dist/prospect-client/Form/FileUpload/InputFile/InputFileApollo.d.ts +4 -1
  106. package/dist/prospect-client/Form/FileUpload/InputFile/InputFileApollo.js +3 -4
  107. package/dist/prospect-client/Form/FileUpload/InputFile/InputFileCommon.d.ts +4 -1
  108. package/dist/prospect-client/Form/FileUpload/InputFile/InputFileCommon.js +4 -6
  109. package/dist/prospect-client/Form/FileUpload/InputFile/InputFileLF.d.ts +4 -1
  110. package/dist/prospect-client/Form/FileUpload/InputFile/InputFileLF.js +1 -2
  111. package/dist/prospect-client/Form/InputDate/InputDateApollo.d.ts +4 -1
  112. package/dist/prospect-client/Form/InputDate/InputDateApollo.js +1 -2
  113. package/dist/prospect-client/Form/InputDate/InputDateAtom.d.ts +4 -1
  114. package/dist/prospect-client/Form/InputDate/InputDateAtom.js +2 -2
  115. package/dist/prospect-client/Form/InputDate/InputDateCommon.d.ts +4 -1
  116. package/dist/prospect-client/Form/InputDate/InputDateCommon.js +4 -4
  117. package/dist/prospect-client/Form/InputDate/InputDateLF.d.ts +4 -1
  118. package/dist/prospect-client/Form/InputDate/InputDateLF.js +1 -2
  119. package/dist/prospect-client/Form/InputDate/InputDateTextAtom.d.ts +4 -1
  120. package/dist/prospect-client/Form/InputDate/InputDateTextAtom.js +4 -4
  121. package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.d.ts +4 -1
  122. package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.js +4 -4
  123. package/dist/prospect-client/Form/InputText/InputTextApollo.d.ts +4 -1
  124. package/dist/prospect-client/Form/InputText/InputTextApollo.js +1 -2
  125. package/dist/prospect-client/Form/InputText/InputTextCommon.d.ts +4 -1
  126. package/dist/prospect-client/Form/InputText/InputTextCommon.js +4 -4
  127. package/dist/prospect-client/Form/InputText/InputTextLF.d.ts +4 -1
  128. package/dist/prospect-client/Form/InputText/InputTextLF.js +1 -2
  129. package/dist/prospect-client/Form/InputTextAtom/InputTextAtomCommon.d.ts +4 -1
  130. package/dist/prospect-client/Form/InputTextAtom/InputTextAtomCommon.js +4 -4
  131. package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectApollo.d.ts +7 -0
  132. package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectApollo.js +6 -0
  133. package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectCommon.d.ts +8 -0
  134. package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectCommon.js +9 -0
  135. package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectLF.d.ts +7 -0
  136. package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectLF.js +6 -0
  137. package/dist/prospect-client/Form/Radio/CardRadio/CardRadioApollo.d.ts +3 -0
  138. package/dist/prospect-client/Form/Radio/CardRadio/CardRadioApollo.js +6 -0
  139. package/dist/prospect-client/Form/Radio/{CardRadioOption/CardRadioOptionCommon.d.ts → CardRadio/CardRadioCommon.d.ts} +7 -4
  140. package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.js +16 -0
  141. package/dist/prospect-client/Form/Radio/CardRadio/CardRadioLF.d.ts +3 -0
  142. package/dist/prospect-client/Form/Radio/CardRadio/CardRadioLF.js +6 -0
  143. package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupApollo.js +2 -2
  144. package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.d.ts +6 -6
  145. package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.js +3 -3
  146. package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF.js +2 -2
  147. package/dist/prospect-client/Form/Radio/Radio/RadioCommon.d.ts +4 -1
  148. package/dist/prospect-client/Form/Radio/Radio/RadioCommon.js +3 -3
  149. package/dist/prospect-client/Form/TextArea/TextAreaApollo.d.ts +4 -1
  150. package/dist/prospect-client/Form/TextArea/TextAreaApollo.js +1 -2
  151. package/dist/prospect-client/Form/TextArea/TextAreaCommon.d.ts +4 -1
  152. package/dist/prospect-client/Form/TextArea/TextAreaCommon.js +4 -4
  153. package/dist/prospect-client/Form/TextArea/TextAreaLF.d.ts +4 -1
  154. package/dist/prospect-client/Form/TextArea/TextAreaLF.js +1 -2
  155. package/dist/prospect-client/Header/HeaderApollo.d.ts +4 -0
  156. package/dist/prospect-client/Header/HeaderApollo.js +8 -0
  157. package/dist/prospect-client/Header/HeaderCommon.d.ts +22 -0
  158. package/dist/prospect-client/Header/HeaderCommon.js +37 -0
  159. package/dist/prospect-client/Header/HeaderLF.d.ts +4 -0
  160. package/dist/prospect-client/Header/HeaderLF.js +8 -0
  161. package/dist/prospect-client/ItemMenu/ItemMenuApollo.d.ts +2 -0
  162. package/dist/prospect-client/ItemMenu/ItemMenuApollo.js +2 -0
  163. package/dist/prospect-client/ItemMenu/ItemMenuCommon.d.ts +22 -0
  164. package/dist/prospect-client/ItemMenu/ItemMenuCommon.js +18 -0
  165. package/dist/prospect-client/ItemMenu/ItemMenuLF.d.ts +2 -0
  166. package/dist/prospect-client/ItemMenu/ItemMenuLF.js +2 -0
  167. package/dist/prospect-client/ItemTabBar/ItemTabBarCommon.d.ts +4 -1
  168. package/dist/prospect-client/ItemTabBar/ItemTabBarCommon.js +4 -4
  169. package/dist/prospect-client/List/ClickItem/ClickItemCommon.d.ts +1 -0
  170. package/dist/prospect-client/List/List/ListCommon.d.ts +27 -2
  171. package/dist/prospect-client/List/List/ListCommon.js +12 -0
  172. package/dist/prospect-client/Loader/LoaderCommon.d.ts +4 -1
  173. package/dist/prospect-client/Loader/LoaderCommon.js +4 -4
  174. package/dist/prospect-client/MenuBurger/MenuBurgerApollo.d.ts +4 -0
  175. package/dist/prospect-client/MenuBurger/MenuBurgerApollo.js +8 -0
  176. package/dist/prospect-client/MenuBurger/MenuBurgerCommon.d.ts +60 -0
  177. package/dist/prospect-client/MenuBurger/MenuBurgerCommon.js +34 -0
  178. package/dist/prospect-client/MenuBurger/MenuBurgerLF.d.ts +4 -0
  179. package/dist/prospect-client/MenuBurger/MenuBurgerLF.js +8 -0
  180. package/dist/prospect-client/Modal/ModalApollo.d.ts +4 -1
  181. package/dist/prospect-client/Modal/ModalApollo.js +2 -3
  182. package/dist/prospect-client/Modal/ModalCommon.d.ts +4 -1
  183. package/dist/prospect-client/Modal/ModalCommon.js +1 -2
  184. package/dist/prospect-client/Modal/ModalLF.d.ts +4 -1
  185. package/dist/prospect-client/Modal/ModalLF.js +2 -3
  186. package/dist/prospect-client/Modal/components/ModalCore.d.ts +4 -1
  187. package/dist/prospect-client/Modal/components/ModalCore.js +3 -3
  188. package/dist/prospect-client/TabMenu/TabMenu.d.ts +36 -0
  189. package/dist/prospect-client/TabMenu/TabMenu.helpers.d.ts +1 -0
  190. package/dist/prospect-client/TabMenu/TabMenu.helpers.js +12 -0
  191. package/dist/prospect-client/TabMenu/TabMenu.js +39 -0
  192. package/dist/prospect-client/TagList/TagListApollo.d.ts +4 -0
  193. package/dist/prospect-client/TagList/TagListApollo.js +5 -0
  194. package/dist/prospect-client/TagList/TagListCommon.d.ts +10 -0
  195. package/dist/prospect-client/TagList/TagListCommon.js +16 -0
  196. package/dist/prospect-client/TagList/TagListLF.d.ts +4 -0
  197. package/dist/prospect-client/TagList/TagListLF.js +5 -0
  198. package/dist/prospect-client/Toggle/ToggleApollo.d.ts +4 -1
  199. package/dist/prospect-client/Toggle/ToggleApollo.js +1 -2
  200. package/dist/prospect-client/Toggle/ToggleCommon.d.ts +4 -3
  201. package/dist/prospect-client/Toggle/ToggleCommon.js +4 -4
  202. package/dist/prospect-client/Toggle/ToggleLF.d.ts +4 -1
  203. package/dist/prospect-client/Toggle/ToggleLF.js +1 -2
  204. package/dist/prospect.d.ts +10 -5
  205. package/dist/prospect.js +10 -5
  206. package/package.json +3 -3
  207. package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionApollo.d.ts +0 -3
  208. package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionApollo.js +0 -6
  209. package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionCommon.js +0 -16
  210. package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionLF.d.ts +0 -3
  211. package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionLF.js +0 -6
@@ -1,12 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import "@axa-fr/canopee-css/distributeur/Link/Link.css";
3
- import { forwardRef } from "react";
4
3
  import { CustomLink } from "./CustomLink";
5
4
  import { LinkAnchor } from "./LinkAnchor";
6
- export const Link = forwardRef((props, ref) => {
5
+ export const Link = ({ ...props }) => {
7
6
  if ("render" in props) {
8
7
  return _jsx(CustomLink, { ...props });
9
8
  }
10
- return _jsx(LinkAnchor, { ...props, ref: ref });
11
- });
9
+ return _jsx(LinkAnchor, { ...props });
10
+ };
12
11
  Link.displayName = "Link";
@@ -8,5 +8,8 @@ type AnchorLinkProps = {
8
8
  variant?: "default" | "reverse";
9
9
  };
10
10
  type LinkComponentProps = ComponentPropsWithRef<"a"> & AnchorLinkProps;
11
- declare const LinkAnchor: import("react").ForwardRefExoticComponent<Omit<LinkComponentProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
11
+ declare const LinkAnchor: {
12
+ ({ className, target, rel, leftIcon, children, rightIcon, disabled, variant, ...restProps }: LinkComponentProps): import("react/jsx-runtime").JSX.Element;
13
+ displayName: string;
14
+ };
12
15
  export { LinkAnchor, type LinkComponentProps };
@@ -1,13 +1,13 @@
1
1
  import { jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import classnames from "classnames";
3
- import { forwardRef, } from "react";
3
+ import {} from "react";
4
4
  import { Svg } from "../Svg";
5
5
  import { linkClassName } from "./linkClassName";
6
- const LinkAnchor = forwardRef(({ className, target, rel, leftIcon, children, rightIcon, disabled, variant, ...restProps }, ref) => {
6
+ const LinkAnchor = ({ className, target, rel, leftIcon, children, rightIcon, disabled, variant, ...restProps }) => {
7
7
  const finalClassName = classnames(linkClassName, className, {
8
8
  [`${linkClassName}--reverse`]: variant === "reverse",
9
9
  });
10
- return (_jsxs("a", { className: finalClassName, rel: target === "_blank" ? "noopener noreferrer" : rel, "aria-disabled": disabled ?? restProps["aria-disabled"], ref: ref, target: target, ...restProps, children: [leftIcon, children, rightIcon] }));
11
- });
10
+ return (_jsxs("a", { className: finalClassName, rel: target === "_blank" ? "noopener noreferrer" : rel, "aria-disabled": disabled ?? restProps["aria-disabled"], target: target, ...restProps, children: [leftIcon, children, rightIcon] }));
11
+ };
12
12
  LinkAnchor.displayName = "LinkAnchor";
13
13
  export { LinkAnchor };
@@ -0,0 +1,4 @@
1
+ export type ItemLoaderVariant = "inline" | "fullscreen" | "content";
2
+ export declare const ItemLoader: ({ variant }: {
3
+ variant: ItemLoaderVariant;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Loader from "@axa-fr/canopee-css/Item_Loader.svg";
3
+ import LoaderInverse from "@axa-fr/canopee-css/Item_Loader_Inverse.svg";
4
+ const DEFAULT_CLASS_NAME = "af-loader";
5
+ export const ItemLoader = ({ variant }) => {
6
+ const isInverse = variant === "fullscreen";
7
+ return (_jsx("img", { className: `${DEFAULT_CLASS_NAME}__icon`, src: isInverse ? LoaderInverse : Loader, "aria-hidden": "true", alt: "" }));
8
+ };
@@ -1,13 +1,10 @@
1
1
  import "@axa-fr/canopee-css/distributeur/Loader/Loader.css";
2
- import { type ReactNode } from "react";
3
- type LoaderMode = "none" | "get" | "post" | "delete" | "update" | "error";
4
- type LoaderProps = {
2
+ import type { ReactNode } from "react";
3
+ import { type ItemLoaderVariant } from "./ItemLoader";
4
+ export type LoaderProps = {
5
5
  className?: string;
6
- mode: LoaderMode;
7
- text?: string;
8
- children: ReactNode;
9
- /** @deprecated Use `className` instead. */
10
- classModifier?: string;
6
+ text: string;
7
+ variant?: ItemLoaderVariant;
8
+ children?: ReactNode;
11
9
  };
12
- export declare const Loader: ({ className, text, children, classModifier, mode, }: LoaderProps) => import("react/jsx-runtime").JSX.Element;
13
- export {};
10
+ export declare const Loader: ({ className, text, variant, children, }: LoaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,31 +1,16 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import "@axa-fr/canopee-css/distributeur/Loader/Loader.css";
3
- import {} from "react";
4
3
  import { getClassName } from "../utilities/helpers/getClassName";
5
- const getText = (index) => {
6
- switch (index) {
7
- case "get":
8
- return "Chargement en cours";
9
- case "post":
10
- return "Sauvegarde en cours";
11
- case "delete":
12
- return "Suppression en cours";
13
- case "update":
14
- return "Mise à jour en cours";
15
- case "error":
16
- return "Une erreur est survenue lors du chargement du composant";
17
- default:
18
- return "";
4
+ import { ItemLoader } from "./ItemLoader";
5
+ const LOADER_CLASS_NAME = "af-loader";
6
+ export const Loader = ({ className, text, variant = "fullscreen", children, }) => {
7
+ const loader = (_jsxs("section", { role: "alert", "aria-live": "assertive", "aria-busy": "true", className: getClassName({
8
+ baseClassName: LOADER_CLASS_NAME,
9
+ modifiers: [variant !== "inline" && variant],
10
+ className,
11
+ }), children: [_jsx(ItemLoader, { variant: variant }), _jsx("p", { className: `${LOADER_CLASS_NAME}__text`, children: text })] }));
12
+ if (variant === "fullscreen" && children) {
13
+ return (_jsxs(_Fragment, { children: [children, loader] }));
19
14
  }
20
- };
21
- export const Loader = ({ className, text, children, classModifier, mode = "none", }) => {
22
- const componentClassName = getClassName({
23
- baseClassName: "af-loader",
24
- modifiers: classModifier?.split(" "),
25
- className,
26
- });
27
- const message = text || getText(mode);
28
- const isLoaderVisible = mode !== "none";
29
- const isLoaderInError = mode === "error";
30
- return (_jsxs("div", { className: componentClassName, children: [children, isLoaderVisible ? (_jsx("div", { className: `${componentClassName} af-loader-on`, children: _jsxs("div", { className: "af-spinner", role: "alert", "aria-live": "assertive", "aria-busy": !isLoaderInError, "aria-label": message, children: [!isLoaderInError && _jsx("div", { className: "af-spinner__animation" }), _jsx("div", { className: "af-spinner__caption", children: message })] }) })) : null] }));
15
+ return loader;
31
16
  };
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from "react";
2
+ import "@axa-fr/canopee-css/distributeur/Loader/SquareLoader.css";
3
+ export type SquareLoaderProps = {
4
+ className?: string;
5
+ mode?: LoaderMode;
6
+ text?: string;
7
+ children?: ReactNode;
8
+ /** @deprecated Use `className` instead. */
9
+ classModifier?: string;
10
+ };
11
+ export type LoaderMode = "none" | "get" | "post" | "delete" | "update" | "error";
12
+ /**
13
+ * @deprecated Use `Loader` with `variant="fullscreen"` instead.
14
+ */
15
+ export declare const SquareLoader: ({ className, text, children, classModifier, mode, }: SquareLoaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getClassName } from "../utilities/helpers/getClassName";
3
+ import "@axa-fr/canopee-css/distributeur/Loader/SquareLoader.css";
4
+ const getText = (index) => {
5
+ switch (index) {
6
+ case "get":
7
+ return "Chargement en cours";
8
+ case "post":
9
+ return "Sauvegarde en cours";
10
+ case "delete":
11
+ return "Suppression en cours";
12
+ case "update":
13
+ return "Mise à jour en cours";
14
+ case "error":
15
+ return "Une erreur est survenue lors du chargement du composant";
16
+ default:
17
+ return "";
18
+ }
19
+ };
20
+ /**
21
+ * @deprecated Use `Loader` with `variant="fullscreen"` instead.
22
+ */
23
+ export const SquareLoader = ({ className, text, children, classModifier, mode = "none", }) => {
24
+ const componentClassName = getClassName({
25
+ baseClassName: "af-square-loader",
26
+ modifiers: classModifier?.split(" "),
27
+ className,
28
+ });
29
+ const message = text || getText(mode);
30
+ const isLoaderVisible = mode !== "none";
31
+ const isLoaderInError = mode === "error";
32
+ return (_jsxs("div", { className: componentClassName, children: [children, isLoaderVisible ? (_jsx("div", { className: `${componentClassName} af-square-loader-on`, children: isLoaderInError ? (_jsx("div", { className: "af-spinner", role: "alert", "aria-live": "assertive", "aria-busy": "false", "aria-label": message, children: _jsx("div", { className: "af-spinner__caption", children: message }) })) : (_jsxs("div", { className: "af-spinner", role: "alert", "aria-live": "assertive", "aria-busy": "true", "aria-label": message, children: [_jsx("div", { className: "af-spinner__animation" }), _jsx("div", { className: "af-spinner__caption", children: message })] })) })) : null] }));
33
+ };
@@ -36,5 +36,8 @@ export type BooleanModalProps = React.DetailedHTMLProps<React.DialogHTMLAttribut
36
36
  */
37
37
  classModifier?: string;
38
38
  };
39
- declare const BooleanModal: React.ForwardRefExoticComponent<Omit<BooleanModalProps, "ref"> & React.RefAttributes<HTMLDialogElement>>;
39
+ declare const BooleanModal: {
40
+ ({ children, title, submitTitle, cancelTitle, className, classModifier, onCancel, onSubmit, closeButtonAriaLabel, ...props }: BooleanModalProps): import("react/jsx-runtime").JSX.Element;
41
+ displayName: string;
42
+ };
40
43
  export { BooleanModal };
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React, { forwardRef } from "react";
2
+ import React, {} from "react";
3
3
  import { Button, Modal, getComponentClassName } from "../../distributeur";
4
4
  import { Body } from "./components/Body";
5
5
  import { Footer } from "./components/Footer";
6
6
  import { Header } from "./components/Header";
7
7
  const defaultClassName = "af-modal";
8
- const BooleanModal = forwardRef(({ children, title, submitTitle = "Valider", cancelTitle = "Annuler", className = defaultClassName, classModifier, onCancel, onSubmit, closeButtonAriaLabel, ...props }, ref) => {
8
+ const BooleanModal = ({ children, title, submitTitle = "Valider", cancelTitle = "Annuler", className = defaultClassName, classModifier, onCancel, onSubmit, closeButtonAriaLabel, ...props }) => {
9
9
  const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
10
- return (_jsxs(Modal, { className: componentClassName, onOutsideTap: onCancel, title: title, ref: ref, ...props, children: [_jsx(Header, { title: title, onCancel: onCancel, closeButtonAriaLabel: closeButtonAriaLabel }), _jsx(Body, { children: children }), _jsxs(Footer, { children: [_jsx(Button, { variant: "secondary", onClick: onCancel, children: cancelTitle }), _jsx(Button, { onClick: onSubmit, variant: "validated", children: submitTitle })] })] }));
11
- });
10
+ return (_jsxs(Modal, { className: componentClassName, onOutsideTap: onCancel, title: title, ...props, children: [_jsx(Header, { title: title, onCancel: onCancel, closeButtonAriaLabel: closeButtonAriaLabel }), _jsx(Body, { children: children }), _jsxs(Footer, { children: [_jsx(Button, { variant: "secondary", onClick: onCancel, children: cancelTitle }), _jsx(Button, { onClick: onSubmit, variant: "validated", children: submitTitle })] })] }));
11
+ };
12
12
  BooleanModal.displayName = "BooleanModal";
13
13
  export { BooleanModal };
@@ -21,5 +21,8 @@ export type ModalProps = React.DetailedHTMLProps<React.DialogHTMLAttributes<HTML
21
21
  */
22
22
  ref?: React.Ref<HTMLDialogElement>;
23
23
  };
24
- declare const Modal: import("react").ForwardRefExoticComponent<Omit<ModalProps, "ref"> & import("react").RefAttributes<HTMLDialogElement>>;
24
+ declare const Modal: {
25
+ ({ className, title, onOutsideTap, children, classModifier, size, ...props }: ModalProps): import("react/jsx-runtime").JSX.Element;
26
+ displayName: string;
27
+ };
25
28
  export { Modal };
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
2
+ import {} from "react";
3
3
  import { getComponentClassName } from "../utilities";
4
- const Modal = forwardRef(({ className, title = "", onOutsideTap, children, classModifier, size, ...props }, ref) => {
4
+ const Modal = ({ className, title = "", onOutsideTap, children, classModifier, size, ...props }) => {
5
5
  // If size is set to 'lg' or 'sm', use it as the classModifier, otherwise use the provided classModifier
6
6
  let effectiveClassModifier;
7
7
  if (size) {
@@ -18,7 +18,7 @@ const Modal = forwardRef(({ className, title = "", onOutsideTap, children, class
18
18
  const componentClassName = getComponentClassName(className, effectiveClassModifier, "af-modal");
19
19
  return (
20
20
  // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events
21
- _jsx("dialog", { "aria-label": title, className: componentClassName, onClick: onOutsideTap, ref: ref, ...props, children: _jsx("div", { className: "af-modal__dialog", onClick: (event) => event.stopPropagation(), children: _jsx("div", { className: "af-modal__content", children: children }) }) }));
22
- });
21
+ _jsx("dialog", { "aria-label": title, className: componentClassName, onClick: onOutsideTap, ...props, children: _jsx("div", { className: "af-modal__dialog", onClick: (event) => event.stopPropagation(), children: _jsx("div", { className: "af-modal__content", children: children }) }) }));
22
+ };
23
23
  Modal.displayName = "Modal";
24
24
  export { Modal };
@@ -34,17 +34,11 @@ type Props = {
34
34
  /** Labels for different states for accessibility purposes
35
35
  * @default
36
36
  * {
37
- * validatedState: "validée",
38
- * editState: "en cours de modification",
39
- * lockedState: "verrouillée",
40
- * }
37
+ * validatedState: "validée", * editState: "en cours de modification", * lockedState: "verrouillée", * }
41
38
  * @example
42
39
  * ```json
43
40
  * {
44
- * validatedState: "completed",
45
- * editState: "being edited",
46
- * lockedState: "locked",
47
- * }
41
+ * validatedState: "completed", * editState: "being edited", * lockedState: "locked", * }
48
42
  * ```
49
43
  * will change the aria-labels of the step to "Étape verticale ${title} (completed)" when validated, "Étape verticale ${title} (being edited)" when in edition and "Étape verticale ${title} (locked)" when locked.
50
44
  */
@@ -18,6 +18,7 @@ export const svgInjector = (element, { beforeEach = () => { }, ...options } = {}
18
18
  ...options,
19
19
  beforeEach: (svg) => {
20
20
  DOMPurify.sanitize(svg, {
21
+ ADD_ATTR: ["to", "from"],
21
22
  USE_PROFILES: { svg: true, svgFilters: true },
22
23
  IN_PLACE: true,
23
24
  });
@@ -28,5 +28,8 @@ type TagProps = ComponentPropsWithRef<"span"> & {
28
28
  * @param {React.Ref<HTMLSpanElement>} ref - The ref to the span element.
29
29
  * @returns {JSX.Element} The rendered Tag component.
30
30
  */
31
- export declare const Tag: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<TagProps>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
31
+ export declare const Tag: {
32
+ ({ children, className, classModifier, variant, ...otherProps }: PropsWithChildren<TagProps>): import("react/jsx-runtime").JSX.Element;
33
+ displayName: string;
34
+ };
32
35
  export {};
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import "@axa-fr/canopee-css/distributeur/Tag/Tag.css";
3
- import { forwardRef, } from "react";
3
+ import {} from "react";
4
4
  import { getClassName } from "../utilities/helpers/getClassName";
5
5
  /**
6
6
  * Tag component to display a label with various styles.
@@ -14,7 +14,7 @@ import { getClassName } from "../utilities/helpers/getClassName";
14
14
  * @param {React.Ref<HTMLSpanElement>} ref - The ref to the span element.
15
15
  * @returns {JSX.Element} The rendered Tag component.
16
16
  */
17
- export const Tag = forwardRef(({ children, className, classModifier, variant, ...otherProps }, ref) => {
17
+ export const Tag = ({ children, className, classModifier, variant, ...otherProps }) => {
18
18
  const actualModifier = variant || classModifier || "default";
19
19
  const componentClassName = getClassName({
20
20
  baseClassName: "af-tag",
@@ -27,6 +27,6 @@ export const Tag = forwardRef(({ children, className, classModifier, variant, ..
27
27
  modifiers: [actualModifier],
28
28
  className,
29
29
  });
30
- return (_jsx("span", { ref: ref, className: `${componentClassName} ${badgeClassName}`, ...otherProps, children: children }));
31
- });
30
+ return (_jsx("span", { className: `${componentClassName} ${badgeClassName}`, ...otherProps, children: children }));
31
+ };
32
32
  Tag.displayName = "Tag";
@@ -9,5 +9,8 @@ type TitleProps = ComponentPropsWithRef<"h2"> & {
9
9
  contentRight?: ReactNode;
10
10
  withDivider?: boolean;
11
11
  };
12
- export declare const Title: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<TitleProps>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
12
+ export declare const Title: {
13
+ ({ className, classModifier, children, heading: Heading, contentLeft, contentRight, withDivider, ...otherProps }: PropsWithChildren<TitleProps>): import("react/jsx-runtime").JSX.Element;
14
+ displayName: string;
15
+ };
13
16
  export {};
@@ -1,9 +1,9 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import "@axa-fr/canopee-css/distributeur/Title/Title.css";
3
- import { forwardRef, } from "react";
3
+ import {} from "react";
4
4
  import { getClassName } from "../utilities/helpers/getClassName";
5
5
  const baseClass = "af-title";
6
- export const Title = forwardRef(({ className, classModifier, children, heading: Heading = "h2", contentLeft, contentRight, withDivider = true, ...otherProps }, ref) => {
6
+ export const Title = ({ className, classModifier, children, heading: Heading = "h2", contentLeft, contentRight, withDivider = true, ...otherProps }) => {
7
7
  const modifiers = classModifier?.split(" ") ?? [];
8
8
  if (!withDivider) {
9
9
  modifiers.push("without-divider");
@@ -13,6 +13,6 @@ export const Title = forwardRef(({ className, classModifier, children, heading:
13
13
  modifiers,
14
14
  className,
15
15
  });
16
- return (_jsxs("div", { className: `${baseClass}--container`, children: [_jsxs(Heading, { ref: ref, className: componentClassName, ...otherProps, children: [children, contentLeft] }), contentRight ? (_jsx("div", { className: `${baseClass}__content-right`, children: contentRight })) : null] }));
17
- });
16
+ return (_jsxs("div", { className: `${baseClass}--container`, children: [_jsxs(Heading, { className: componentClassName, ...otherProps, children: [children, contentLeft] }), contentRight ? (_jsx("div", { className: "content-right", children: contentRight })) : null] }));
17
+ };
18
18
  Title.displayName = "Title";
@@ -1,6 +1,7 @@
1
+ import "@axa-fr/canopee-css/distributeur/common/layers.css";
2
+ import "@axa-fr/canopee-css/distributeur/common/reboot.css";
1
3
  import "@axa-fr/canopee-css/distributeur/common/grid.css";
2
4
  import "@axa-fr/canopee-css/distributeur/common/icons.css";
3
- import "@axa-fr/canopee-css/distributeur/common/reboot.css";
4
5
  import "@axa-fr/canopee-css/distributeur/common/tokens.css";
5
6
  import "@axa-fr/canopee-css/distributeur/Form/core/FormCore.css";
6
7
  import "@fontsource/source-sans-pro/400.css";
@@ -42,11 +43,14 @@ export { Tabs } from "./distributeur/Tabs/Tabs";
42
43
  export { Title } from "./distributeur/Title/Title";
43
44
  export { getComponentClassName } from "./distributeur/utilities";
44
45
  /** @deprecated Use `Tag` instead. */
45
- declare const Badge: import("react").ForwardRefExoticComponent<Omit<import("react").PropsWithChildren<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
46
- classModifier?: string;
47
- variant?: import("./distributeur").TagVariants;
48
- disabled?: boolean;
49
- }>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
46
+ declare const Badge: {
47
+ ({ children, className, classModifier, variant, ...otherProps }: import("react").PropsWithChildren<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
48
+ classModifier?: string;
49
+ variant?: import("./distributeur").TagVariants;
50
+ disabled?: boolean;
51
+ }>): import("react/jsx-runtime").JSX.Element;
52
+ displayName: string;
53
+ };
50
54
  export type { TagVariants } from "./distributeur/Tag/Tag";
51
55
  export { Badge, Tag };
52
56
  /**
@@ -61,6 +65,8 @@ export * from "./distributeur/Table";
61
65
  export { Alert, Message };
62
66
  export { HelpButton } from "./distributeur/HelpButton";
63
67
  export { Loader } from "./distributeur/Loader/Loader";
68
+ export { ItemLoader, type ItemLoaderVariant, } from "./distributeur/Loader/ItemLoader";
69
+ export { SquareLoader } from "./distributeur/Loader/SquareLoader";
64
70
  export { CardData } from "./distributeur/CardData/CardData";
65
71
  export type { CardDataVariant } from "./distributeur/CardData/CardData";
66
72
  export { EditorialMessage, type EditorialMessageProps, type EditorialMessageType, } from "./distributeur/EditorialMessage/EditorialMessage";
@@ -1,6 +1,7 @@
1
+ import "@axa-fr/canopee-css/distributeur/common/layers.css";
2
+ import "@axa-fr/canopee-css/distributeur/common/reboot.css";
1
3
  import "@axa-fr/canopee-css/distributeur/common/grid.css";
2
4
  import "@axa-fr/canopee-css/distributeur/common/icons.css";
3
- import "@axa-fr/canopee-css/distributeur/common/reboot.css";
4
5
  import "@axa-fr/canopee-css/distributeur/common/tokens.css";
5
6
  import "@axa-fr/canopee-css/distributeur/Form/core/FormCore.css";
6
7
  import "@fontsource/source-sans-pro/400.css";
@@ -54,6 +55,8 @@ export * from "./distributeur/Table";
54
55
  export { Alert, Message };
55
56
  export { HelpButton } from "./distributeur/HelpButton";
56
57
  export { Loader } from "./distributeur/Loader/Loader";
58
+ export { ItemLoader, } from "./distributeur/Loader/ItemLoader";
59
+ export { SquareLoader } from "./distributeur/Loader/SquareLoader";
57
60
  export { CardData } from "./distributeur/CardData/CardData";
58
61
  export { EditorialMessage, } from "./distributeur/EditorialMessage/EditorialMessage";
59
62
  export { Timeline, } from "./distributeur/Timeline/Timeline";
@@ -0,0 +1,44 @@
1
+ import type { ComponentPropsWithoutRef, ElementType } from "react";
2
+ import "@axa-fr/canopee-css/prospect/AppName/AppNameAll.css";
3
+ /**
4
+ * Props for the AppName component.
5
+ */
6
+ export type AppNameProps = ComponentPropsWithoutRef<"div"> & {
7
+ /**
8
+ * Application name displayed next to the AXA logo.
9
+ */
10
+ label: string;
11
+ /**
12
+ * Alt text for the AXA logo image.
13
+ * @default "Logo AXA"
14
+ */
15
+ logoAlt?: string;
16
+ /**
17
+ * Props forwarded to the `LogoLinkComponent` (defaults to `<a>`).
18
+ * @example { href: "/" }
19
+ * @example { to: "/" } // for React Router Link
20
+ */
21
+ logoLinkProps?: Record<string, unknown>;
22
+ /**
23
+ * Element or component used to wrap the logo.
24
+ * Accepts native HTML elements (`"a"`) or custom components (e.g. `Link` from React Router or the DS).
25
+ * `logoLinkProps` are forwarded to it.
26
+ * @default "a"
27
+ * @example "a"
28
+ * @example Link // from react-router-dom or the DS
29
+ */
30
+ LogoLinkComponent?: ElementType;
31
+ };
32
+ /**
33
+ * Displays the application name alongside the AXA logo.
34
+ * The logo can optionally be wrapped in a native anchor or a custom link component.
35
+ *
36
+ * @component
37
+ * @param {AppNameProps} props - AppName props.
38
+ * @param {string} props.label - Application name displayed next to the logo.
39
+ * @param {string} [props.logoAlt="Logo AXA"] - Alt text for the AXA logo image.
40
+ * @param {Record<string, unknown>} [props.logoLinkProps] - Props forwarded to the wrapping anchor or `LogoLinkComponent`.
41
+ * @param {ElementType} [props.LogoLinkComponent="a"] - Element or component used to wrap the logo. Accepts `"a"` or any custom link component (e.g. React Router `Link`).
42
+ * @returns {JSX.Element} The rendered AppName component.
43
+ */
44
+ export declare const AppName: ({ label, className, logoAlt, logoLinkProps, LogoLinkComponent, ...props }: AppNameProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import logoAxa from "@axa-fr/canopee-css/logo-axa.svg";
3
+ import { getClassName } from "../utilities/getClassName";
4
+ import "@axa-fr/canopee-css/prospect/AppName/AppNameAll.css";
5
+ /**
6
+ * Displays the application name alongside the AXA logo.
7
+ * The logo can optionally be wrapped in a native anchor or a custom link component.
8
+ *
9
+ * @component
10
+ * @param {AppNameProps} props - AppName props.
11
+ * @param {string} props.label - Application name displayed next to the logo.
12
+ * @param {string} [props.logoAlt="Logo AXA"] - Alt text for the AXA logo image.
13
+ * @param {Record<string, unknown>} [props.logoLinkProps] - Props forwarded to the wrapping anchor or `LogoLinkComponent`.
14
+ * @param {ElementType} [props.LogoLinkComponent="a"] - Element or component used to wrap the logo. Accepts `"a"` or any custom link component (e.g. React Router `Link`).
15
+ * @returns {JSX.Element} The rendered AppName component.
16
+ */
17
+ export const AppName = ({ label, className, logoAlt = "Logo AXA", logoLinkProps, LogoLinkComponent = "a", ...props }) => {
18
+ const logo = (_jsx("img", { src: logoAxa, alt: logoAlt, className: "af-app-name__logo" }));
19
+ return (_jsxs("div", { className: getClassName({
20
+ baseClassName: "af-app-name",
21
+ className,
22
+ }), ...props, children: [LogoLinkComponent ? (_jsx(LogoLinkComponent, { className: "af-app-name__logo-link", ...logoLinkProps, children: logo })) : (logo), _jsx("span", { className: "af-app-name__label", children: label })] }));
23
+ };
@@ -1,2 +1,2 @@
1
1
  import "@axa-fr/canopee-css/prospect/Card/CardApollo.css";
2
- export { type CardCommonProps as CardProps, CardCommon as Card, } from "./CardCommon";
2
+ export { cardVariants, type CardVariants, type CardCommonProps as CardProps, CardCommon as Card, } from "./CardCommon";
@@ -1,2 +1,2 @@
1
1
  import "@axa-fr/canopee-css/prospect/Card/CardApollo.css";
2
- export { CardCommon as Card, } from "./CardCommon";
2
+ export { cardVariants, CardCommon as Card, } from "./CardCommon";
@@ -1,4 +1,32 @@
1
1
  import type { ComponentProps, ElementType } from "react";
2
2
  import { type PolymorphicComponent } from "../utilities/types/PolymorphicComponent";
3
- export type CardCommonProps<T extends ElementType> = PolymorphicComponent<T, ComponentProps<"div">>;
4
- export declare const CardCommon: <T extends ElementType = "div">({ as, children, className, ...props }: CardCommonProps<T>) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const cardVariants: {
4
+ readonly unstyled: "unstyled";
5
+ };
6
+ export type CardVariants = keyof typeof cardVariants;
7
+ /**
8
+ * Props for the Card component.
9
+ *
10
+ * @template T - The element type rendered by the card (defaults to `"div"`).
11
+ */
12
+ export type CardCommonProps<T extends ElementType> = PolymorphicComponent<T, ComponentProps<"div"> & {
13
+ /**
14
+ * Visual variant of the card.
15
+ * - `"unstyled"` — removes border and padding.
16
+ */
17
+ variant?: CardVariants;
18
+ }>;
19
+ /**
20
+ * Polymorphic card wrapper that adds padding and a border.
21
+ * The underlying HTML element can be changed via the `as` prop.
22
+ *
23
+ * @component
24
+ * @template T - The element type rendered by the card.
25
+ * @param {CardCommonProps<T>} props - Card props.
26
+ * @param {ElementType} [props.as="div"] - HTML element or component to render as.
27
+ * @param {CardVariants} [props.variant] - Visual variant of the card.
28
+ * @param {string} [props.className] - Additional CSS class applied to the root element.
29
+ * @param {ReactNode} [props.children] - Content rendered inside the card.
30
+ * @returns {JSX.Element} The rendered Card component.
31
+ */
32
+ export declare const CardCommon: <T extends ElementType = "div">({ as, children, className, variant, ...props }: CardCommonProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,27 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import {} from "../utilities/types/PolymorphicComponent";
3
3
  import { getClassName } from "../utilities/getClassName";
4
- export const CardCommon = ({ as, children, className, ...props }) => {
4
+ export const cardVariants = {
5
+ unstyled: "unstyled",
6
+ };
7
+ /**
8
+ * Polymorphic card wrapper that adds padding and a border.
9
+ * The underlying HTML element can be changed via the `as` prop.
10
+ *
11
+ * @component
12
+ * @template T - The element type rendered by the card.
13
+ * @param {CardCommonProps<T>} props - Card props.
14
+ * @param {ElementType} [props.as="div"] - HTML element or component to render as.
15
+ * @param {CardVariants} [props.variant] - Visual variant of the card.
16
+ * @param {string} [props.className] - Additional CSS class applied to the root element.
17
+ * @param {ReactNode} [props.children] - Content rendered inside the card.
18
+ * @returns {JSX.Element} The rendered Card component.
19
+ */
20
+ export const CardCommon = ({ as, children, className, variant, ...props }) => {
5
21
  const Component = as || "div";
6
22
  return (_jsx(Component, { className: getClassName({
7
23
  baseClassName: "af-card",
24
+ modifiers: [variant],
8
25
  className,
9
26
  }), ...props, children: children }));
10
27
  };
@@ -1,2 +1,2 @@
1
1
  import "@axa-fr/canopee-css/client/Card/CardLF.css";
2
- export { type CardCommonProps as CardProps, CardCommon as Card, } from "./CardCommon";
2
+ export { cardVariants, type CardVariants, type CardCommonProps as CardProps, CardCommon as Card, } from "./CardCommon";
@@ -1,2 +1,2 @@
1
1
  import "@axa-fr/canopee-css/client/Card/CardLF.css";
2
- export { CardCommon as Card, } from "./CardCommon";
2
+ export { cardVariants, CardCommon as Card, } from "./CardCommon";
@@ -12,5 +12,8 @@ export type CardCheckboxOptionCommonProps = CardCheckboxOptionProps & {
12
12
  CheckboxComponent: ComponentType<CheckboxProps>;
13
13
  IconComponent: ComponentType<IconProps>;
14
14
  };
15
- declare const CardCheckboxOptionCommon: import("react").ForwardRefExoticComponent<Omit<CardCheckboxOptionCommonProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
15
+ declare const CardCheckboxOptionCommon: {
16
+ ({ label, type, description, subtitle, icon, className, CheckboxComponent, IconComponent, ...inputProps }: CardCheckboxOptionCommonProps): import("react/jsx-runtime").JSX.Element;
17
+ displayName: string;
18
+ };
16
19
  export { CardCheckboxOptionCommon };
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- const CardCheckboxOptionCommon = forwardRef(({ label, type = "vertical", description, subtitle, icon, className, CheckboxComponent, IconComponent, ...inputProps }, ref) => (_jsxs("label", { className: [
2
+ import {} from "react";
3
+ const CardCheckboxOptionCommon = ({ label, type = "vertical", description, subtitle, icon, className, CheckboxComponent, IconComponent, ...inputProps }) => (_jsxs("label", { className: [
4
4
  "af-card-checkbox-option",
5
5
  type === "horizontal" && "af-card-checkbox-option--horizontal",
6
6
  className,
7
7
  ]
8
8
  .filter(Boolean)
9
- .join(" "), children: [icon ? _jsx(IconComponent, { src: icon, role: "presentation" }) : null, _jsxs("div", { className: "af-card-checkbox-option__content", children: [_jsx("p", { className: "af-card-checkbox-option__label", children: label }), Boolean(description) && (_jsx("p", { className: "af-card-checkbox-option__description", children: description })), Boolean(subtitle) && (_jsx("p", { className: "af-card-checkbox-option__subtitle", children: subtitle }))] }), _jsx(CheckboxComponent, { ...inputProps, ref: ref })] })));
9
+ .join(" "), children: [icon ? _jsx(IconComponent, { src: icon, role: "presentation" }) : null, _jsxs("div", { className: "af-card-checkbox-option__content", children: [_jsx("p", { className: "af-card-checkbox-option__label", children: label }), Boolean(description) && (_jsx("p", { className: "af-card-checkbox-option__description", children: description })), Boolean(subtitle) && (_jsx("p", { className: "af-card-checkbox-option__subtitle", children: subtitle }))] }), _jsx(CheckboxComponent, { ...inputProps })] }));
10
10
  CardCheckboxOptionCommon.displayName = "CardCheckboxOptionCommon";
11
11
  export { CardCheckboxOptionCommon };
@@ -5,4 +5,7 @@ export type CheckboxProps = {
5
5
  /** @deprecated Use `aria-invalid` instead */
6
6
  hasError?: boolean;
7
7
  } & Omit<ComponentProps<"input">, "disabled" | "type">;
8
- export declare const Checkbox: import("react").ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
8
+ export declare const Checkbox: {
9
+ ({ errorId, hasError, className, ...inputProps }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
10
+ displayName: string;
11
+ };
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- export const Checkbox = forwardRef(({ errorId, hasError, className, ...inputProps }, ref) => (_jsx("input", { "aria-errormessage": errorId, "aria-invalid": hasError, ...inputProps, className: ["af-checkbox", className].filter(Boolean).join(" "), ref: ref, type: "checkbox" })));
2
+ import {} from "react";
3
+ export const Checkbox = ({ errorId, hasError, className, ...inputProps }) => (_jsx("input", { "aria-errormessage": errorId, "aria-invalid": hasError, ...inputProps, className: ["af-checkbox", className].filter(Boolean).join(" "), type: "checkbox" }));
4
4
  Checkbox.displayName = "Checkbox";