@axa-fr/canopee-react 2.0.0-alpha.74 → 2.0.0-alpha.76

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 (179) hide show
  1. package/dist/distributeur/Accordion/Accordion.d.ts +1 -3
  2. package/dist/distributeur/Accordion/Accordion.js +2 -5
  3. package/dist/distributeur/Accordion/CollapseCard.d.ts +1 -3
  4. package/dist/distributeur/Accordion/CollapseCard.js +2 -4
  5. package/dist/distributeur/Accordion/Header.d.ts +1 -3
  6. package/dist/distributeur/Accordion/Header.js +1 -2
  7. package/dist/distributeur/Action/Action.d.ts +1 -3
  8. package/dist/distributeur/Action/Action.js +2 -3
  9. package/dist/distributeur/Form/Checkbox/Checkbox.d.ts +1 -1
  10. package/dist/distributeur/Form/Checkbox/Checkbox.js +9 -4
  11. package/dist/distributeur/Form/Checkbox/CheckboxInput.js +2 -2
  12. package/dist/distributeur/Form/Checkbox/CheckboxItem.d.ts +1 -3
  13. package/dist/distributeur/Form/Checkbox/CheckboxItem.js +2 -2
  14. package/dist/distributeur/Form/Choice/Choice.d.ts +0 -2
  15. package/dist/distributeur/Form/Choice/ChoiceInput.js +1 -1
  16. package/dist/distributeur/Form/Date/Date.d.ts +2 -3
  17. package/dist/distributeur/Form/Date/Date.js +3 -3
  18. package/dist/distributeur/Form/Date/DateInput.js +1 -1
  19. package/dist/distributeur/Form/File/File.d.ts +1 -3
  20. package/dist/distributeur/Form/File/File.js +1 -2
  21. package/dist/distributeur/Form/File/FileInput.d.ts +3 -1
  22. package/dist/distributeur/Form/File/FileInput.js +2 -2
  23. package/dist/distributeur/Form/File/FileLine.d.ts +1 -2
  24. package/dist/distributeur/Form/File/FileLine.js +6 -3
  25. package/dist/distributeur/Form/File/FileTable.d.ts +1 -2
  26. package/dist/distributeur/Form/File/FileTable.js +6 -3
  27. package/dist/distributeur/Form/MultiSelect/MultiSelectInput.js +1 -1
  28. package/dist/distributeur/Form/NestedQuestion/NestedQuestion.js +7 -3
  29. package/dist/distributeur/Form/Number/Number.d.ts +4 -7
  30. package/dist/distributeur/Form/Number/Number.js +4 -5
  31. package/dist/distributeur/Form/Number/NumberInput.js +1 -1
  32. package/dist/distributeur/Form/Radio/Radio.d.ts +1 -1
  33. package/dist/distributeur/Form/Radio/RadioInput.js +1 -1
  34. package/dist/distributeur/Form/Radio/RadioItem.d.ts +1 -3
  35. package/dist/distributeur/Form/Radio/RadioItem.js +2 -2
  36. package/dist/distributeur/Form/Select/Select.d.ts +3 -19
  37. package/dist/distributeur/Form/Select/Select.js +3 -4
  38. package/dist/distributeur/Form/Select/SelectBase.d.ts +3 -24
  39. package/dist/distributeur/Form/Select/SelectBase.js +2 -7
  40. package/dist/distributeur/Form/Select/SelectDefault.d.ts +3 -3
  41. package/dist/distributeur/Form/Select/SelectInput.js +1 -1
  42. package/dist/distributeur/Form/Select/index.d.ts +0 -1
  43. package/dist/distributeur/Form/Select/index.js +0 -1
  44. package/dist/distributeur/Form/Text/Text.d.ts +2 -3
  45. package/dist/distributeur/Form/Text/Text.js +3 -3
  46. package/dist/distributeur/Form/Text/TextInput.js +1 -1
  47. package/dist/distributeur/Form/Textarea/Textarea.d.ts +2 -3
  48. package/dist/distributeur/Form/Textarea/Textarea.js +3 -3
  49. package/dist/distributeur/Form/Textarea/TextareaInput.js +1 -1
  50. package/dist/distributeur/Form/core/Field.d.ts +4 -23
  51. package/dist/distributeur/Form/core/Field.js +25 -16
  52. package/dist/distributeur/Form/core/FieldError.js +5 -2
  53. package/dist/distributeur/Form/core/getOptionClassName.d.ts +1 -1
  54. package/dist/distributeur/Form/core/getOptionClassName.js +2 -6
  55. package/dist/distributeur/Form/core/index.d.ts +0 -8
  56. package/dist/distributeur/Form/core/index.js +0 -4
  57. package/dist/distributeur/HelpButton/index.d.ts +1 -1
  58. package/dist/distributeur/HelpButton/index.js +4 -6
  59. package/dist/distributeur/Layout/Header/Header.d.ts +1 -3
  60. package/dist/distributeur/Layout/Header/Header.js +1 -2
  61. package/dist/distributeur/Layout/Header/HeaderTitle/HeaderTitle.d.ts +1 -2
  62. package/dist/distributeur/Layout/Header/HeaderTitle/HeaderTitle.js +7 -4
  63. package/dist/distributeur/Layout/Header/Infos/Infos.d.ts +1 -3
  64. package/dist/distributeur/Layout/Header/Infos/Infos.js +1 -2
  65. package/dist/distributeur/Layout/Header/Name/Name.d.ts +1 -3
  66. package/dist/distributeur/Layout/Header/Name/Name.js +1 -2
  67. package/dist/distributeur/Layout/Header/NavBar/NavBar.js +1 -6
  68. package/dist/distributeur/Layout/Header/NavBar/NavBarBase.d.ts +1 -3
  69. package/dist/distributeur/Layout/Header/NavBar/NavBarBase.js +7 -3
  70. package/dist/distributeur/Layout/Header/NavBar/NavBarItem/NavBarItem.d.ts +2 -2
  71. package/dist/distributeur/Layout/Header/NavBar/NavBarItem/NavBarItem.js +10 -3
  72. package/dist/distributeur/Layout/Header/NavBar/NavBarItem/NavBarItemBase.d.ts +1 -2
  73. package/dist/distributeur/Layout/Header/NavBar/NavBarItem/NavBarItemBase.js +6 -3
  74. package/dist/distributeur/Layout/Header/User/User.d.ts +1 -11
  75. package/dist/distributeur/Layout/Header/User/User.js +1 -2
  76. package/dist/distributeur/Messages/Message.d.ts +2 -6
  77. package/dist/distributeur/Messages/Message.js +3 -14
  78. package/dist/distributeur/ModalAgent/BooleanModal.d.ts +1 -6
  79. package/dist/distributeur/ModalAgent/BooleanModal.js +7 -4
  80. package/dist/distributeur/ModalAgent/Modal.d.ts +2 -7
  81. package/dist/distributeur/ModalAgent/Modal.js +7 -16
  82. package/dist/distributeur/ModalAgent/components/Body.d.ts +2 -5
  83. package/dist/distributeur/ModalAgent/components/Body.js +1 -2
  84. package/dist/distributeur/ModalAgent/components/Footer.d.ts +2 -5
  85. package/dist/distributeur/ModalAgent/components/Footer.js +1 -2
  86. package/dist/distributeur/ModalAgent/components/Header.d.ts +1 -11
  87. package/dist/distributeur/ModalAgent/components/Header.js +2 -3
  88. package/dist/distributeur/ModalAgent/components/HeaderBase.d.ts +2 -5
  89. package/dist/distributeur/ModalAgent/components/HeaderBase.js +1 -2
  90. package/dist/distributeur/Popover/AnimatedPopover.d.ts +1 -3
  91. package/dist/distributeur/Popover/AnimatedPopover.js +1 -2
  92. package/dist/distributeur/Popover/Popover.d.ts +1 -3
  93. package/dist/distributeur/Popover/Popover.js +2 -2
  94. package/dist/distributeur/Popover/Popover.types.d.ts +0 -2
  95. package/dist/distributeur/Popover/PopoverBase.d.ts +1 -3
  96. package/dist/distributeur/Popover/PopoverBase.js +2 -2
  97. package/dist/distributeur/Popover/PopoverClick.d.ts +1 -1
  98. package/dist/distributeur/Popover/PopoverClick.js +2 -2
  99. package/dist/distributeur/Popover/PopoverOver.d.ts +1 -1
  100. package/dist/distributeur/Popover/PopoverOver.js +2 -2
  101. package/dist/distributeur/Restitution/ArticleRestitution.d.ts +2 -5
  102. package/dist/distributeur/Restitution/ArticleRestitution.js +1 -2
  103. package/dist/distributeur/Restitution/HeaderRestitution.d.ts +1 -3
  104. package/dist/distributeur/Restitution/HeaderRestitution.js +1 -2
  105. package/dist/distributeur/Restitution/Restitution.d.ts +1 -3
  106. package/dist/distributeur/Restitution/Restitution.js +2 -2
  107. package/dist/distributeur/Restitution/SectionRestitution.d.ts +1 -3
  108. package/dist/distributeur/Restitution/SectionRestitution.js +1 -2
  109. package/dist/distributeur/Restitution/SectionRestitutionColumn.d.ts +1 -3
  110. package/dist/distributeur/Restitution/SectionRestitutionColumn.js +1 -2
  111. package/dist/distributeur/Restitution/SectionRestitutionRow.d.ts +1 -3
  112. package/dist/distributeur/Restitution/SectionRestitutionRow.js +5 -9
  113. package/dist/distributeur/Restitution/SectionRestitutionTitle.d.ts +1 -3
  114. package/dist/distributeur/Restitution/SectionRestitutionTitle.js +1 -2
  115. package/dist/distributeur/Steps/Step.d.ts +1 -1
  116. package/dist/distributeur/Steps/Step.js +4 -4
  117. package/dist/distributeur/Steps/StepBase.d.ts +1 -3
  118. package/dist/distributeur/Steps/StepBase.js +1 -2
  119. package/dist/distributeur/Steps/Steps.d.ts +1 -3
  120. package/dist/distributeur/Steps/Steps.js +1 -2
  121. package/dist/distributeur/Summary/index.d.ts +1 -1
  122. package/dist/distributeur/Summary/index.js +1 -2
  123. package/dist/distributeur/Table/Pagination/Items.d.ts +1 -2
  124. package/dist/distributeur/Table/Pagination/Items.js +8 -8
  125. package/dist/distributeur/Table/Pagination/Pager.d.ts +1 -2
  126. package/dist/distributeur/Table/Pagination/Pager.js +6 -3
  127. package/dist/distributeur/Table/Pagination/Paging.d.ts +1 -1
  128. package/dist/distributeur/Table/Pagination/Paging.js +6 -3
  129. package/dist/distributeur/Table/TBody.d.ts +1 -5
  130. package/dist/distributeur/Table/TBody.js +1 -2
  131. package/dist/distributeur/Table/THead.d.ts +2 -5
  132. package/dist/distributeur/Table/THead.js +1 -2
  133. package/dist/distributeur/Table/Table.d.ts +6 -33
  134. package/dist/distributeur/Table/Table.js +1 -10
  135. package/dist/distributeur/Table/Td.d.ts +1 -5
  136. package/dist/distributeur/Table/Td.js +1 -2
  137. package/dist/distributeur/Table/Th.d.ts +2 -4
  138. package/dist/distributeur/Table/Th.js +2 -2
  139. package/dist/distributeur/Table/Tr.d.ts +2 -5
  140. package/dist/distributeur/Table/Tr.js +1 -2
  141. package/dist/distributeur/Table/index.d.ts +1 -1
  142. package/dist/distributeur/Tabs/components/Tab.d.ts +0 -4
  143. package/dist/distributeur/Tabs/components/TabsStateless.d.ts +3 -7
  144. package/dist/distributeur/Tabs/components/TabsStateless.js +2 -2
  145. package/dist/distributeur/Tag/Tag.d.ts +1 -6
  146. package/dist/distributeur/Tag/Tag.js +2 -2
  147. package/dist/distributeur/Title/Title.d.ts +1 -3
  148. package/dist/distributeur/Title/Title.js +2 -2
  149. package/dist/distributeur/utilities.d.ts +1 -1
  150. package/dist/distributeur/utilities.js +1 -1
  151. package/dist/distributeur.d.ts +5 -24
  152. package/dist/distributeur.js +5 -17
  153. package/package.json +2 -2
  154. package/dist/distributeur/Form/Pass/Pass.d.ts +0 -15
  155. package/dist/distributeur/Form/Pass/Pass.js +0 -13
  156. package/dist/distributeur/Form/Pass/PassInput.d.ts +0 -13
  157. package/dist/distributeur/Form/Pass/PassInput.js +0 -34
  158. package/dist/distributeur/Form/Pass/index.d.ts +0 -2
  159. package/dist/distributeur/Form/Pass/index.js +0 -2
  160. package/dist/distributeur/Form/Select/SelectDefaultWithOptions.d.ts +0 -26
  161. package/dist/distributeur/Form/Select/SelectDefaultWithOptions.js +0 -32
  162. package/dist/distributeur/Form/Slider/Slider.d.ts +0 -28
  163. package/dist/distributeur/Form/Slider/Slider.js +0 -40
  164. package/dist/distributeur/Form/Slider/SliderInput.d.ts +0 -9
  165. package/dist/distributeur/Form/Slider/SliderInput.js +0 -11
  166. package/dist/distributeur/Form/Slider/index.d.ts +0 -3
  167. package/dist/distributeur/Form/Slider/index.js +0 -3
  168. package/dist/distributeur/Form/core/Deprecated/Field.d.ts +0 -21
  169. package/dist/distributeur/Form/core/Deprecated/Field.js +0 -20
  170. package/dist/distributeur/Form/core/Deprecated/FieldForm.d.ts +0 -103
  171. package/dist/distributeur/Form/core/Deprecated/FieldForm.js +0 -162
  172. package/dist/distributeur/Form/core/Deprecated/FieldInput.d.ts +0 -16
  173. package/dist/distributeur/Form/core/Deprecated/FieldInput.js +0 -14
  174. package/dist/distributeur/Form/core/useInputClassModifier.d.ts +0 -4
  175. package/dist/distributeur/Form/core/useInputClassModifier.js +0 -13
  176. package/dist/distributeur/Layout/Header/HeaderTitle/HeaderTitle.helpers.d.ts +0 -1
  177. package/dist/distributeur/Layout/Header/HeaderTitle/HeaderTitle.helpers.js +0 -6
  178. package/dist/distributeur/utilities/helpers/getComponentClassName.d.ts +0 -20
  179. package/dist/distributeur/utilities/helpers/getComponentClassName.js +0 -54
@@ -7,8 +7,6 @@ import "@axa-fr/canopee-css/distributeur/Form/core/FormCore.css";
7
7
  import "@fontsource/source-sans-pro/400.css";
8
8
  import "@fontsource/source-sans-pro/600.css";
9
9
  import "@fontsource/source-sans-pro/700.css";
10
- import { Message } from "./distributeur/Messages/Message";
11
- import { Tag } from "./distributeur/Tag/Tag";
12
10
  export { Action } from "./distributeur/Action/Action";
13
11
  export { Button } from "./distributeur/Button/Button";
14
12
  export type { ButtonVariant } from "./distributeur/Button/Button";
@@ -16,16 +14,14 @@ export { Card } from "./distributeur/Card/Card";
16
14
  export { Divider } from "./distributeur/Divider/Divider";
17
15
  export { Checkbox, CheckboxInput, CheckboxItem, CheckboxModes, } from "./distributeur/Form/Checkbox";
18
16
  export { Choice, ChoiceInput } from "./distributeur/Form/Choice";
19
- export { LegacyField as Field, FieldError, FieldForm, FieldInput, FormClassManager, HelpMessage, InputList, MessageTypes, } from "./distributeur/Form/core";
17
+ export { Field, FieldError, FormClassManager, HelpMessage, InputList, MessageTypes, } from "./distributeur/Form/core";
20
18
  export { Date, DateInput } from "./distributeur/Form/Date";
21
19
  export { File, FileInput, FileTable, type FilePreview, } from "./distributeur/Form/File";
22
20
  export { MultiSelect, MultiSelectInput } from "./distributeur/Form/MultiSelect";
23
21
  export { NestedQuestion } from "./distributeur/Form/NestedQuestion/NestedQuestion";
24
22
  export { Number, NumberInput } from "./distributeur/Form/Number";
25
- export { Pass, PassInput } from "./distributeur/Form/Pass";
26
23
  export { Radio, RadioInput, RadioItem, RadioModes, } from "./distributeur/Form/Radio";
27
- export { Select, SelectBase, SelectInput } from "./distributeur/Form/Select";
28
- export { Slider, SliderInput } from "./distributeur/Form/Slider";
24
+ export { Select, SelectInput } from "./distributeur/Form/Select";
29
25
  export { Text, TextInput } from "./distributeur/Form/Text";
30
26
  export { Textarea, TextareaInput } from "./distributeur/Form/Textarea";
31
27
  export { Footer } from "./distributeur/Layout/Footer";
@@ -42,32 +38,17 @@ export { Summary } from "./distributeur/Summary";
42
38
  export { Svg } from "./distributeur/Svg";
43
39
  export { Tabs } from "./distributeur/Tabs/Tabs";
44
40
  export { Title } from "./distributeur/Title/Title";
45
- export { getComponentClassName } from "./distributeur/utilities";
46
- /** @deprecated Use `Tag` instead. */
47
- declare const Badge: {
48
- ({ children, className, classModifier, variant, ...otherProps }: import("react").PropsWithChildren<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
49
- classModifier?: string;
50
- variant?: import("./distributeur").TagVariants;
51
- disabled?: boolean;
52
- }>): import("react/jsx-runtime").JSX.Element;
53
- displayName: string;
54
- };
41
+ export { getClassName } from "./distributeur/utilities";
55
42
  export type { TagVariants } from "./distributeur/Tag/Tag";
56
- export { Badge, Tag };
57
- /**
58
- * @deprecated `Alert` has been renamed `Message` in order to comply with UX naming of components. Use `Message` instead.
59
- * @see {@link Message}
60
- */
61
- declare const Alert: ({ className, onClose, icon, title, children, classModifier, variant, closeButtonAriaLabel, }: import("react").PropsWithChildren<import("./distributeur").MessageProps>) => import("react/jsx-runtime").JSX.Element;
43
+ export { Tag } from "./distributeur/Tag/Tag";
62
44
  export * from "./distributeur/Accordion";
63
45
  export { type MessageProps, type MessageVariants, } from "./distributeur/Messages/Message";
64
46
  export * from "./distributeur/Popover";
65
47
  export * from "./distributeur/Table";
66
- export { Alert, Message };
48
+ export { Message } from "./distributeur/Messages/Message";
67
49
  export { HelpButton } from "./distributeur/HelpButton";
68
50
  export { Loader } from "./distributeur/Loader/Loader";
69
51
  export { ItemLoader, type ItemLoaderVariant, } from "./distributeur/Loader/ItemLoader";
70
- export { SquareLoader } from "./distributeur/Loader/SquareLoader";
71
52
  export { CardData } from "./distributeur/CardData/CardData";
72
53
  export type { CardDataVariant } from "./distributeur/CardData/CardData";
73
54
  export { EditorialMessage, type EditorialMessageProps, type EditorialMessageType, } from "./distributeur/EditorialMessage/EditorialMessage";
@@ -7,24 +7,20 @@ import "@axa-fr/canopee-css/distributeur/Form/core/FormCore.css";
7
7
  import "@fontsource/source-sans-pro/400.css";
8
8
  import "@fontsource/source-sans-pro/600.css";
9
9
  import "@fontsource/source-sans-pro/700.css";
10
- import { Message } from "./distributeur/Messages/Message";
11
- import { Tag } from "./distributeur/Tag/Tag";
12
10
  export { Action } from "./distributeur/Action/Action";
13
11
  export { Button } from "./distributeur/Button/Button";
14
12
  export { Card } from "./distributeur/Card/Card";
15
13
  export { Divider } from "./distributeur/Divider/Divider";
16
14
  export { Checkbox, CheckboxInput, CheckboxItem, CheckboxModes, } from "./distributeur/Form/Checkbox";
17
15
  export { Choice, ChoiceInput } from "./distributeur/Form/Choice";
18
- export { LegacyField as Field, FieldError, FieldForm, FieldInput, FormClassManager, HelpMessage, InputList, MessageTypes, } from "./distributeur/Form/core";
16
+ export { Field, FieldError, FormClassManager, HelpMessage, InputList, MessageTypes, } from "./distributeur/Form/core";
19
17
  export { Date, DateInput } from "./distributeur/Form/Date";
20
18
  export { File, FileInput, FileTable, } from "./distributeur/Form/File";
21
19
  export { MultiSelect, MultiSelectInput } from "./distributeur/Form/MultiSelect";
22
20
  export { NestedQuestion } from "./distributeur/Form/NestedQuestion/NestedQuestion";
23
21
  export { Number, NumberInput } from "./distributeur/Form/Number";
24
- export { Pass, PassInput } from "./distributeur/Form/Pass";
25
22
  export { Radio, RadioInput, RadioItem, RadioModes, } from "./distributeur/Form/Radio";
26
- export { Select, SelectBase, SelectInput } from "./distributeur/Form/Select";
27
- export { Slider, SliderInput } from "./distributeur/Form/Slider";
23
+ export { Select, SelectInput } from "./distributeur/Form/Select";
28
24
  export { Text, TextInput } from "./distributeur/Form/Text";
29
25
  export { Textarea, TextareaInput } from "./distributeur/Form/Textarea";
30
26
  export { Footer } from "./distributeur/Layout/Footer";
@@ -40,24 +36,16 @@ export { Summary } from "./distributeur/Summary";
40
36
  export { Svg } from "./distributeur/Svg";
41
37
  export { Tabs } from "./distributeur/Tabs/Tabs";
42
38
  export { Title } from "./distributeur/Title/Title";
43
- export { getComponentClassName } from "./distributeur/utilities";
44
- /** @deprecated Use `Tag` instead. */
45
- const Badge = Tag;
46
- export { Badge, Tag };
47
- /**
48
- * @deprecated `Alert` has been renamed `Message` in order to comply with UX naming of components. Use `Message` instead.
49
- * @see {@link Message}
50
- */
51
- const Alert = Message;
39
+ export { getClassName } from "./distributeur/utilities";
40
+ export { Tag } from "./distributeur/Tag/Tag";
52
41
  export * from "./distributeur/Accordion";
53
42
  export {} from "./distributeur/Messages/Message";
54
43
  export * from "./distributeur/Popover";
55
44
  export * from "./distributeur/Table";
56
- export { Alert, Message };
45
+ export { Message } from "./distributeur/Messages/Message";
57
46
  export { HelpButton } from "./distributeur/HelpButton";
58
47
  export { Loader } from "./distributeur/Loader/Loader";
59
48
  export { ItemLoader, } from "./distributeur/Loader/ItemLoader";
60
- export { SquareLoader } from "./distributeur/Loader/SquareLoader";
61
49
  export { CardData } from "./distributeur/CardData/CardData";
62
50
  export { EditorialMessage, } from "./distributeur/EditorialMessage/EditorialMessage";
63
51
  export { Timeline, } from "./distributeur/Timeline/Timeline";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/canopee-react",
3
- "version": "2.0.0-alpha.74",
3
+ "version": "2.0.0-alpha.76",
4
4
  "description": "Package React - Design System Canopée",
5
5
  "exports": {
6
6
  "./distributeur": {
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "homepage": "https://github.com/AxaFrance/design-system#readme",
55
55
  "peerDependencies": {
56
- "@axa-fr/canopee-css": "2.0.0-alpha.74",
56
+ "@axa-fr/canopee-css": "2.0.0-alpha.76",
57
57
  "@material-symbols/svg-400": ">= 0.19.0",
58
58
  "@material-symbols/svg-700": ">= 0.19.0",
59
59
  "react": ">= 19"
@@ -1,15 +0,0 @@
1
- import { type ComponentPropsWithRef } from "react";
2
- import "@axa-fr/canopee-css/distributeur/Form/Pass/Pass.css";
3
- type Props = Omit<ComponentPropsWithRef<"input">, "type" | "role"> & {
4
- type?: "text" | "password";
5
- classModifier?: string;
6
- onToggleType: () => void;
7
- };
8
- /**
9
- * @deprecated The Pass component is deprecated and will be removed in a future release
10
- */
11
- declare const Pass: {
12
- ({ onToggleType, type, className, classModifier, ...inputProps }: Props): import("react/jsx-runtime").JSX.Element;
13
- displayName: string;
14
- };
15
- export { Pass };
@@ -1,13 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import {} from "react";
3
- import { getComponentClassName } from "../../utilities";
4
- import "@axa-fr/canopee-css/distributeur/Form/Pass/Pass.css";
5
- /**
6
- * @deprecated The Pass component is deprecated and will be removed in a future release
7
- */
8
- const Pass = ({ onToggleType, type = "password", className, classModifier, ...inputProps }) => {
9
- const componentClassName = getComponentClassName(className, classModifier, "af-form__pass");
10
- return (_jsxs("div", { className: componentClassName, children: [_jsx("div", { className: "af-form__pass-strength" }), _jsx("input", { ...inputProps, role: type === "password" ? "password" : "textbox", className: "af-form__input-text", type: type, required: classModifier?.includes("required") }), _jsx("button", { className: "af-form__pass-btn", type: "button", "aria-label": "show password", onClick: onToggleType, children: _jsx("i", { className: `glyphicon glyphicon-eye${type === "text" ? "-close" : "-open"}` }) })] }));
11
- };
12
- Pass.displayName = "Pass";
13
- export { Pass };
@@ -1,13 +0,0 @@
1
- import { type ComponentProps, type ReactNode } from "react";
2
- import { type ConsumerFieldProps } from "../core";
3
- import { Pass } from "./Pass";
4
- type PassProps = ComponentProps<typeof Pass>;
5
- type Props = Omit<ConsumerFieldProps & PassProps & {
6
- helpMessage?: ReactNode;
7
- score?: string;
8
- }, "onToggleType" | "type">;
9
- /**
10
- * @deprecated The PassInput component is deprecated and will be removed in a future release
11
- */
12
- declare const PassInput: ({ children, score, classModifier, disabled, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
13
- export { PassInput };
@@ -1,34 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useState } from "react";
3
- import { Field } from "../core";
4
- import { Pass } from "./Pass";
5
- const strengthList = {
6
- 0: "bad",
7
- 1: "okay",
8
- 2: "good",
9
- 3: "verygood",
10
- 4: "excellent",
11
- };
12
- const calculateStrength = (score) => {
13
- if (score === null || score === undefined) {
14
- return null;
15
- }
16
- const scoreToNumber = Number(score);
17
- let strength = Number.isNaN(scoreToNumber) ? 0 : scoreToNumber;
18
- if (strength > 4) {
19
- strength = 4;
20
- }
21
- if (strength < 0) {
22
- strength = 0;
23
- }
24
- return strengthList[strength];
25
- };
26
- /**
27
- * @deprecated The PassInput component is deprecated and will be removed in a future release
28
- */
29
- const PassInput = ({ children, score, classModifier, disabled, ...props }) => {
30
- const strength = calculateStrength(score);
31
- const [type, setType] = useState("password");
32
- return (_jsx(Field, { ...props, classModifier: classModifier, renderInput: ({ id, classModifier: modifier, ariaInvalid, errorId, ...inputProps }) => (_jsxs(_Fragment, { children: [_jsx(Pass, { ...inputProps, type: type, id: id, disabled: disabled, classModifier: `${modifier} ${strength}`, "aria-describedby": errorId, "aria-invalid": ariaInvalid, onToggleType: () => setType(type === "password" ? "text" : "password") }), children] })) }));
33
- };
34
- export { PassInput };
@@ -1,2 +0,0 @@
1
- export { PassInput } from "./PassInput";
2
- export { Pass } from "./Pass";
@@ -1,2 +0,0 @@
1
- export { PassInput } from "./PassInput";
2
- export { Pass } from "./Pass";
@@ -1,26 +0,0 @@
1
- import { type ComponentPropsWithRef, type OptionHTMLAttributes } from "react";
2
- import { SelectBase } from "./SelectBase";
3
- type Props = ComponentPropsWithRef<typeof SelectBase> & {
4
- options: OptionHTMLAttributes<HTMLOptionElement>[];
5
- forceDisplayPlaceholder?: boolean;
6
- placeholder?: string;
7
- };
8
- /**
9
- * @deprecated Use `SelectDefault` instead
10
- * Instead of
11
- * ```jsx
12
- * <SelectDefaultWithOptions options={[{ value: "1", label: "Option 1" }]} />
13
- * ```
14
- * you can now do something like :
15
- * ```jsx
16
- * <SelectDefault>
17
- * <option value="1">Option 1</option>
18
- * </SelectDefault>
19
- * ```
20
- * It allows you to use the `optgroup` tag for example.
21
- */
22
- export declare const SelectDefaultWithOptions: {
23
- ({ onChange, forceDisplayPlaceholder, value, defaultValue, required, placeholder, options, id, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
24
- displayName: string;
25
- };
26
- export {};
@@ -1,32 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useId, useMemo, useState, } from "react";
3
- import { SelectBase } from "./SelectBase";
4
- /**
5
- * @deprecated Use `SelectDefault` instead
6
- * Instead of
7
- * ```jsx
8
- * <SelectDefaultWithOptions options={[{ value: "1", label: "Option 1" }]} />
9
- * ```
10
- * you can now do something like :
11
- * ```jsx
12
- * <SelectDefault>
13
- * <option value="1">Option 1</option>
14
- * </SelectDefault>
15
- * ```
16
- * It allows you to use the `optgroup` tag for example.
17
- */
18
- export const SelectDefaultWithOptions = ({ onChange, forceDisplayPlaceholder = false, value, defaultValue, required, placeholder = "- Select -", options, id, ...otherProps }) => {
19
- const [hasHandleChangeOnce, setHasHandleChangeOnce] = useState(false);
20
- const generatedId = useId();
21
- const inputId = id ?? generatedId;
22
- const newOptions = useMemo(() => (hasHandleChangeOnce || defaultValue || value) && required
23
- ? options
24
- : [{ value: "", label: placeholder }, ...options], [hasHandleChangeOnce, options, defaultValue, value, required, placeholder]);
25
- return (_jsx(SelectBase, { ...otherProps, id: inputId, value: value, defaultValue: defaultValue, options: newOptions, onChange: (e) => {
26
- if (onChange) {
27
- onChange(e);
28
- }
29
- setHasHandleChangeOnce(!forceDisplayPlaceholder);
30
- } }));
31
- };
32
- SelectDefaultWithOptions.displayName = "SelectDefaultWithOptions";
@@ -1,28 +0,0 @@
1
- import RcSlider from "rc-slider";
2
- import { type ComponentProps, type ReactNode } from "react";
3
- type RcSliderProps = ComponentProps<typeof RcSlider>;
4
- type Props = Omit<RcSliderProps, "marks" | "onChange" | "onChangeComplete"> & {
5
- /** @deprecated Use `className` instead. */
6
- classModifier?: string;
7
- options: {
8
- value: number;
9
- label?: string | ReactNode;
10
- }[];
11
- id: string;
12
- name: string;
13
- onChange?: (selectedValue: {
14
- id: string;
15
- name: string;
16
- value: number;
17
- }) => void;
18
- onChangeComplete?: (selectedValue: {
19
- id: string;
20
- name: string;
21
- value: number;
22
- }) => void;
23
- };
24
- /**
25
- * @deprecated Slider is deprecated and will be removed in a future major release.
26
- */
27
- declare const Slider: ({ options, value, defaultValue, className, classModifier, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
28
- export { Slider };
@@ -1,40 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import RcSlider from "rc-slider";
3
- import { useCallback, useMemo, } from "react";
4
- import { getClassName } from "../../utilities/helpers/getClassName";
5
- /**
6
- * @deprecated Slider is deprecated and will be removed in a future major release.
7
- */
8
- const Slider = ({ options, value, defaultValue, className, classModifier, ...otherProps }) => {
9
- const defaultValueIndex = useMemo(() => {
10
- const newDefaultValueIndex = options.findIndex((opt) => opt.value === (defaultValue || value));
11
- return newDefaultValueIndex !== -1 ? newDefaultValueIndex : undefined;
12
- }, [defaultValue, options, value]);
13
- const valueIndex = useMemo(() => {
14
- const newValueIndex = options.findIndex((opt) => opt.value === value);
15
- return newValueIndex !== -1 ? newValueIndex : undefined;
16
- }, [value, options]);
17
- const marks = useMemo(() => [...options]
18
- .sort((optA, optB) => optA.value - optB.value)
19
- .reduce((prevMarks, { value: optValue, label: optLabel }, index) => {
20
- const newMarks = { ...prevMarks };
21
- newMarks[index] = optLabel || optValue;
22
- return newMarks;
23
- }, {}), [options]);
24
- const componentClassName = useMemo(() => getClassName({
25
- baseClassName: "af-slider",
26
- modifiers: classModifier?.split(" "),
27
- className,
28
- }), [className, classModifier]);
29
- const formatOnChange = useCallback((newValueIndex, onChange) => {
30
- if (onChange && !Array.isArray(newValueIndex)) {
31
- onChange({
32
- id: otherProps.id,
33
- name: otherProps.name,
34
- value: options[newValueIndex].value,
35
- });
36
- }
37
- }, [options, otherProps.id, otherProps.name]);
38
- return (_jsx(RcSlider, { ...otherProps, min: 0, max: options.length - 1, onChange: (newValueIndex) => formatOnChange(newValueIndex, otherProps.onChange), onChangeComplete: (newValueIndex) => formatOnChange(newValueIndex, otherProps.onChangeComplete), marks: marks, step: null, className: componentClassName, defaultValue: defaultValueIndex, value: valueIndex, disabled: otherProps.disabled || classModifier?.includes("disabled"), "aria-required": classModifier?.includes("required") }));
39
- };
40
- export { Slider };
@@ -1,9 +0,0 @@
1
- import { type ComponentProps } from "react";
2
- import { type ConsumerFieldProps } from "../core";
3
- import { Slider } from "./Slider";
4
- type Props = ConsumerFieldProps & ComponentProps<typeof Slider>;
5
- /**
6
- * @deprecated This component is deprecated and will be removed in a future major release.
7
- */
8
- declare const SliderInput: ({ children, name, options, label, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
9
- export { SliderInput };
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import {} from "react";
3
- import { Field } from "../core";
4
- import { Slider } from "./Slider";
5
- /**
6
- * @deprecated This component is deprecated and will be removed in a future major release.
7
- */
8
- const SliderInput = ({ children, name, options, label, ...props }) => {
9
- return (_jsx(Field, { label: label, ...props, renderInput: ({ id, classModifier, ...sliderProps }) => (_jsxs(_Fragment, { children: [_jsx(Slider, { id: id, classModifier: classModifier, name: name, options: options, ...sliderProps }), children] })) }));
10
- };
11
- export { SliderInput };
@@ -1,3 +0,0 @@
1
- import "@axa-fr/canopee-css/distributeur/Form/Slider/Slider.css";
2
- export { Slider } from "./Slider";
3
- export { SliderInput } from "./SliderInput";
@@ -1,3 +0,0 @@
1
- import "@axa-fr/canopee-css/distributeur/Form/Slider/Slider.css";
2
- export { Slider } from "./Slider";
3
- export { SliderInput } from "./SliderInput";
@@ -1,21 +0,0 @@
1
- import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
- import { FieldForm } from "./FieldForm";
3
- type FieldProps = Omit<ComponentPropsWithoutRef<typeof FieldForm>, "children"> & {
4
- label: ReactNode;
5
- children?: ReactNode;
6
- id?: string;
7
- classModifier?: string;
8
- classNameContainerLabel?: string;
9
- classNameContainerInput?: string;
10
- isVisible?: boolean;
11
- roleContainer?: string;
12
- ariaLabelContainer?: string;
13
- isLabelContainerLinkedToInput?: boolean;
14
- errorId?: string;
15
- };
16
- /**
17
- * @deprecated This component is deprecated and will be removed in future versions. Use components with labels instead, such as `TextInput`
18
- * or `SelectInput`.
19
- */
20
- export declare const LegacyField: ({ id, message, messageType, label, children, forceDisplayMessage, classModifier, className, classNameContainerLabel, classNameContainerInput, isVisible, roleContainer, ariaLabelContainer, isLabelContainerLinkedToInput, errorId, }: FieldProps) => import("react/jsx-runtime").JSX.Element | null;
21
- export {};
@@ -1,20 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import classNames from "classnames";
3
- import {} from "react";
4
- import { getComponentClassName } from "../../../utilities";
5
- import { FieldError } from "../FieldError";
6
- import { MessageTypes } from "../MessageTypes";
7
- import { FieldForm } from "./FieldForm";
8
- /**
9
- * @deprecated This component is deprecated and will be removed in future versions. Use components with labels instead, such as `TextInput`
10
- * or `SelectInput`.
11
- */
12
- export const LegacyField = ({ id = "", message = "", messageType = MessageTypes.error, label, children, forceDisplayMessage, classModifier = "", className, classNameContainerLabel = "col-md-2", classNameContainerInput = "col-md-10", isVisible = true, roleContainer, ariaLabelContainer, isLabelContainerLinkedToInput = true, errorId, }) => {
13
- if (!isVisible) {
14
- return null;
15
- }
16
- const componentClassName = getComponentClassName(className, classModifier, "row af-form__group");
17
- return (_jsxs("div", { className: componentClassName, role: roleContainer, "aria-label": ariaLabelContainer, children: [_jsx("div", { className: classNameContainerLabel, children: _jsx("label", { className: classNames({
18
- "af-form__group-label--required": classModifier.includes("required"),
19
- }, "af-form__group-label"), htmlFor: isLabelContainerLinkedToInput ? id : undefined, children: label }) }), _jsxs(FieldForm, { className: classNameContainerInput, message: message, messageType: messageType, forceDisplayMessage: forceDisplayMessage, children: [children, _jsx(FieldError, { message: message, messageType: messageType, errorId: errorId })] })] }));
20
- };
@@ -1,103 +0,0 @@
1
- import { type BaseSyntheticEvent, type Dispatch, type ReactElement, type ReactNode, type SetStateAction } from "react";
2
- import { FormClassManager } from "../FormClassManager";
3
- import { MessageTypes } from "../MessageTypes";
4
- type TMessage = {
5
- message?: string;
6
- messageType?: MessageTypes;
7
- };
8
- declare const INITIAL_STATE: {
9
- hasLostFocusOnce: boolean;
10
- hasFocus: boolean;
11
- hasChange: boolean;
12
- memory: TMessage;
13
- };
14
- type EventFunction = {
15
- onChange?: (event: BaseSyntheticEvent) => void;
16
- onBlur?: (event: BaseSyntheticEvent) => void;
17
- onFocus?: (event: BaseSyntheticEvent) => void;
18
- };
19
- type FieldFormProps = TMessage & {
20
- className?: string;
21
- classModifier?: string;
22
- forceDisplayMessage?: boolean;
23
- children: ReactNode;
24
- setStateMemoryFn?: typeof setStateMemory;
25
- onChangeByStateFn?: typeof onChangeByState;
26
- setStateOnBlurFn?: typeof setStateOnBlur;
27
- setStateOnFocusFn?: typeof setStateOnFocus;
28
- initialState?: typeof INITIAL_STATE;
29
- };
30
- type SetState = (prevState: typeof INITIAL_STATE) => typeof INITIAL_STATE;
31
- export declare const setStateMemory: ({ message, messageType }: TMessage) => SetState;
32
- export declare const setStateHasChange: () => SetState;
33
- export declare const onChangeByState: (setState: Dispatch<SetStateAction<{
34
- hasLostFocusOnce: boolean;
35
- hasFocus: boolean;
36
- hasChange: boolean;
37
- memory: TMessage;
38
- }>>, stateHasChange: boolean, setStateHasChangeFn?: () => SetState) => false | void;
39
- export declare const setStateOnBlur: () => SetState;
40
- export declare const setStateOnFocus: ({ message, messageType }: TMessage) => SetState;
41
- type GetMessageInfoProps = typeof INITIAL_STATE & Required<Pick<FieldFormProps, "message" | "messageType" | "forceDisplayMessage">>;
42
- export declare const getMessageInfo: ({ forceDisplayMessage, hasLostFocusOnce, hasFocus, memory, hasChange, message, messageType, }: GetMessageInfoProps) => Pick<FieldFormProps, "message" | "messageType">;
43
- type EventWrapperProps = {
44
- props: EventFunction;
45
- } & Pick<AddPropsClone, "wrapper">;
46
- export declare const eventWrapper: ({ wrapper, props }: EventWrapperProps) => {
47
- onChange: (ev: BaseSyntheticEvent) => void;
48
- onBlur: (ev: BaseSyntheticEvent) => void;
49
- onFocus: (ev: BaseSyntheticEvent) => void;
50
- };
51
- type AddPropsClone = Omit<RenderChildrenProps, "children"> & {
52
- child: ReactElement<Record<string, unknown>>;
53
- classModifier: string;
54
- name: string;
55
- getMessageClassModifierFn?: typeof FormClassManager.getMessageClassModifier;
56
- eventWrapperFn?: ({ wrapper, props }: EventWrapperProps) => {
57
- onChange: (ev: BaseSyntheticEvent) => void;
58
- onBlur: (ev: BaseSyntheticEvent) => void;
59
- onFocus: (ev: BaseSyntheticEvent) => void;
60
- };
61
- };
62
- export declare const addPropsClone: ({ message, messageType, classModifier, wrapper, child, name, getMessageClassModifierFn, eventWrapperFn, }: AddPropsClone) => {
63
- isVisible: boolean;
64
- message?: undefined;
65
- classModifier?: undefined;
66
- } | {
67
- message: string | undefined;
68
- isVisible?: undefined;
69
- classModifier?: undefined;
70
- } | {
71
- classModifier: string;
72
- isVisible?: undefined;
73
- message?: undefined;
74
- } | {
75
- classModifier: string;
76
- onChange: (ev: BaseSyntheticEvent) => void;
77
- onBlur: (ev: BaseSyntheticEvent) => void;
78
- onFocus: (ev: BaseSyntheticEvent) => void;
79
- isVisible?: undefined;
80
- message?: undefined;
81
- } | {
82
- onChange: (ev: BaseSyntheticEvent) => void;
83
- onBlur: (ev: BaseSyntheticEvent) => void;
84
- onFocus: (ev: BaseSyntheticEvent) => void;
85
- isVisible?: undefined;
86
- message?: undefined;
87
- classModifier?: undefined;
88
- } | {
89
- isVisible?: undefined;
90
- message?: undefined;
91
- classModifier?: undefined;
92
- };
93
- type RenderChildrenProps = {
94
- wrapper: EventFunction;
95
- } & Partial<Pick<FieldFormProps, "children">> & ReturnType<typeof getMessageInfo>;
96
- export declare const renderedChildren: ({ children, wrapper, message, messageType, }: RenderChildrenProps) => ReactNode;
97
- /**
98
- * @deprecated This component is deprecated and will be removed in future versions.
99
- * This was an internal component used to manage the state of the form fields.
100
- * It is not recommended to use it directly in your code as it is not a public API.
101
- */
102
- export declare const FieldForm: ({ children, message, messageType, className, classModifier, forceDisplayMessage, setStateMemoryFn, onChangeByStateFn, setStateOnBlurFn, setStateOnFocusFn, initialState, }: FieldFormProps) => import("react/jsx-runtime").JSX.Element;
103
- export {};