@axa-fr/canopee-react 2.0.0-alpha.27 → 2.0.0-alpha.29

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 (58) hide show
  1. package/dist/client.d.ts +8 -14
  2. package/dist/client.js +8 -14
  3. package/dist/prospect-client/AccordionCore/AccordionCoreCommon.d.ts +1 -5
  4. package/dist/prospect-client/AccordionCore/AccordionCoreCommon.js +3 -3
  5. package/dist/prospect-client/CardMessage/CardMessageCommon.js +6 -4
  6. package/dist/prospect-client/ContentItemDuoAction/ContentItemDuoActionCommon.d.ts +2 -2
  7. package/dist/prospect-client/ContentItemDuoAction/ContentItemDuoActionCommon.js +5 -2
  8. package/dist/prospect-client/ContentItemMono/ContentItemMonoCommon.d.ts +0 -4
  9. package/dist/prospect-client/ContentItemMono/ContentItemMonoCommon.js +2 -3
  10. package/dist/prospect-client/DataAgent/DataAgentCommon.js +2 -2
  11. package/dist/prospect-client/Divider/DividerCommon.js +6 -2
  12. package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxCommon.d.ts +1 -17
  13. package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxCommon.js +4 -4
  14. package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.d.ts +2 -7
  15. package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.js +1 -1
  16. package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.d.ts +1 -5
  17. package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.js +3 -3
  18. package/dist/prospect-client/Form/Dropdown/DropdownCommon.d.ts +2 -10
  19. package/dist/prospect-client/Form/Dropdown/DropdownCommon.js +3 -3
  20. package/dist/prospect-client/Form/InputDate/InputDateCommon.d.ts +2 -10
  21. package/dist/prospect-client/Form/InputDate/InputDateCommon.js +4 -5
  22. package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.d.ts +2 -10
  23. package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.js +8 -5
  24. package/dist/prospect-client/Form/InputText/InputTextCommon.d.ts +3 -11
  25. package/dist/prospect-client/Form/InputText/InputTextCommon.js +6 -5
  26. package/dist/prospect-client/Form/ItemLabel/ItemLabelCommon.d.ts +2 -22
  27. package/dist/prospect-client/Form/ItemLabel/ItemLabelCommon.js +4 -5
  28. package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.d.ts +1 -5
  29. package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.js +2 -2
  30. package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.d.ts +1 -25
  31. package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.js +4 -6
  32. package/dist/prospect-client/Form/TextArea/TextAreaCommon.d.ts +2 -6
  33. package/dist/prospect-client/Form/TextArea/TextAreaCommon.js +3 -3
  34. package/dist/prospect-client/Icon/IconCommon.d.ts +1 -1
  35. package/dist/prospect-client/Icon/IconCommon.js +8 -9
  36. package/dist/prospect-client/ItemTabBar/ItemTabBarCommon.js +5 -2
  37. package/dist/prospect-client/Link/LinkCommon.d.ts +1 -5
  38. package/dist/prospect-client/Link/LinkCommon.js +2 -2
  39. package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoCommon.d.ts +1 -5
  40. package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoCommon.js +3 -7
  41. package/dist/prospect-client/Modal/ModalApollo.d.ts +1 -1
  42. package/dist/prospect-client/Modal/ModalApollo.js +1 -3
  43. package/dist/prospect-client/Modal/ModalCommon.d.ts +1 -1
  44. package/dist/prospect-client/Modal/ModalCommon.js +1 -1
  45. package/dist/prospect-client/Modal/ModalLF.d.ts +1 -1
  46. package/dist/prospect-client/Modal/ModalLF.js +1 -3
  47. package/dist/prospect-client/Modal/components/ModalCoreHeaderCommon.d.ts +0 -7
  48. package/dist/prospect-client/Modal/components/ModalCoreHeaderCommon.js +2 -12
  49. package/dist/prospect-client/Modal/types.d.ts +0 -15
  50. package/dist/prospect-client/ProgressBarGroup/ProgressBarGroupCommon.d.ts +1 -5
  51. package/dist/prospect-client/ProgressBarGroup/ProgressBarGroupCommon.js +1 -1
  52. package/dist/prospect-client/Tag/TagCommon.js +6 -2
  53. package/dist/prospect-client/Toggle/ToggleCommon.js +2 -2
  54. package/dist/prospect.d.ts +1 -3
  55. package/dist/prospect.js +1 -3
  56. package/package.json +2 -2
  57. package/dist/prospect-client/utilities/getComponentClassName.d.ts +0 -4
  58. package/dist/prospect-client/utilities/getComponentClassName.js +0 -30
package/dist/client.d.ts CHANGED
@@ -16,9 +16,7 @@ export { ContentItemMono } from "./prospect-client/ContentItemMono/ContentItemMo
16
16
  export { DataAgent, type DataAgentProps, } from "./prospect-client/DataAgent/DataAgentLF";
17
17
  export { Divider } from "./prospect-client/Divider/DividerLF";
18
18
  export { Fieldset, type FieldsetProps, } from "./prospect-client/Fieldset/FieldsetLF";
19
- export { CardCheckbox,
20
- /** @deprecated Use `CardCheckbox` instead. */
21
- CardCheckbox as CheckboxCard, } from "./prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxLF";
19
+ export { CardCheckbox } from "./prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxLF";
22
20
  export { CardCheckboxOption } from "./prospect-client/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionLF";
23
21
  export { Checkbox } from "./prospect-client/Form/Checkbox/Checkbox/CheckboxLF";
24
22
  export { CheckboxText } from "./prospect-client/Form/Checkbox/CheckboxText/CheckboxTextLF";
@@ -26,14 +24,10 @@ export { Dropdown } from "./prospect-client/Form/Dropdown/DropdownLF";
26
24
  export { FileUpload } from "./prospect-client/Form/FileUpload/FileUpload/FileUploadLF";
27
25
  export { InputFile } from "./prospect-client/Form/FileUpload/InputFile/InputFileLF";
28
26
  export { ItemFile } from "./prospect-client/Form/FileUpload/ItemFile/ItemFileLF";
29
- export {
30
- /** @deprecated Use `InputDate` instead. */
31
- InputDate as DateInput, InputDate, } from "./prospect-client/Form/InputDate/InputDateLF";
27
+ export { InputDate } from "./prospect-client/Form/InputDate/InputDateLF";
32
28
  export { type OptionType } from "./prospect-client/Form/InputPhone/InputPhone.types";
33
29
  export { InputPhone } from "./prospect-client/Form/InputPhone/InputPhoneLF";
34
- export { InputText,
35
- /** @deprecated Use `InputText` instead. */
36
- InputText as TextInput, } from "./prospect-client/Form/InputText/InputTextLF";
30
+ export { InputText } from "./prospect-client/Form/InputText/InputTextLF";
37
31
  export { InputTextAtom } from "./prospect-client/Form/InputTextAtom/InputTextAtomLF";
38
32
  export { ItemLabel } from "./prospect-client/Form/ItemLabel/ItemLabelLF";
39
33
  export { ItemMessage, itemMessageVariants, type ItemMessageVariants, } from "./prospect-client/Form/ItemMessage/ItemMessageLF";
@@ -44,13 +38,11 @@ export { Radio } from "./prospect-client/Form/Radio/Radio/RadioLF";
44
38
  export { RadioText, type RadioTextProps, } from "./prospect-client/Form/Radio/RadioText/RadioTextLF";
45
39
  export { TextArea } from "./prospect-client/Form/TextArea/TextAreaLF";
46
40
  export { DebugGrid } from "./prospect-client/Grid/DebugGridLF";
47
- export { Heading, type HeadingLevel, type HeadingProps, } from "./prospect-client/Heading/HeadingLF";
48
41
  export { Header, type HeaderProps } from "./prospect-client/Header/HeaderLF";
42
+ export { Heading, type HeadingLevel, type HeadingProps, } from "./prospect-client/Heading/HeadingLF";
49
43
  export { Icon, iconSizeVariants, iconVariants, type IconSizeVariants, type IconVariants, } from "./prospect-client/Icon/IconLF";
50
- export { ItemTabBar, type ItemTabBarProps, } from "./prospect-client/ItemTabBar/ItemTabBarLF";
51
44
  export { ItemMenu, type ItemMenuProps, } from "./prospect-client/ItemMenu/ItemMenuLF";
52
- export { MenuBurger, type MenuBurgerProps, } from "./prospect-client/MenuBurger/MenuBurgerLF";
53
- export { TabMenu, type TabMenuProps } from "./prospect-client/TabMenu/TabMenu";
45
+ export { ItemTabBar, type ItemTabBarProps, } from "./prospect-client/ItemTabBar/ItemTabBarLF";
54
46
  export { ExitLayout, type ExitLayoutProps, type ExitLayoutWithSubComponents, ExitLayoutSkeleton, type ExitLayoutSkeletonProps, } from "./prospect-client/Layout/ExitLayout/ExitLayoutLF";
55
47
  export { Footer, type FooterProps, } from "./prospect-client/Layout/Footer/FooterLF";
56
48
  export { FormLayout, type FormLayoutProps, } from "./prospect-client/Layout/FormLayout/FormLayout";
@@ -60,9 +52,10 @@ export { ClickItem, clickItemStates, clickItemVariants, type ClickItemStates, ty
60
52
  export { ContentItemDuo } from "./prospect-client/List/ContentItemDuo/ContentItemDuoLF";
61
53
  export { List, type ListProps } from "./prospect-client/List/List/ListLF";
62
54
  export { Loader, type LoaderProps } from "./prospect-client/Loader/LoaderLF";
55
+ export { MenuBurger, type MenuBurgerProps, } from "./prospect-client/MenuBurger/MenuBurgerLF";
63
56
  export { Message, messageVariants, type MessageVariants, } from "./prospect-client/Message/MessageLF";
64
- export { MultiMessage, type MultiMessageItem, type MultiMessageProps, } from "./prospect-client/MultiMessage/MultiMessageLF";
65
57
  export { Modal, ModalCore, ModalCoreBody, ModalCoreFooter, ModalCoreHeader, } from "./prospect-client/Modal/ModalLF";
58
+ export { MultiMessage, type MultiMessageItem, type MultiMessageProps, } from "./prospect-client/MultiMessage/MultiMessageLF";
66
59
  export { ErrorPage, type ErrorPageProps, } from "./prospect-client/pages/ErrorPage/ErrorPageLF";
67
60
  export { ValidPage, type ValidPageProps, } from "./prospect-client/pages/ValidPage/ValidPageLF";
68
61
  export { ItemPagination, type ItemPaginationProps, } from "./prospect-client/Pagination/ItemPagination/ItemPaginationLF";
@@ -78,6 +71,7 @@ export { Svg } from "./prospect-client/Svg/Svg";
78
71
  export { TabBar, tabBarDirection, type TabBarDirection, type TabBarProps, } from "./prospect-client/TabBar/TabBarLF";
79
72
  export { Table, type BodyColorVariants, type HeadColorVariants, type RowSizeVariants, type TableProps, } from "./prospect-client/Table/TableLF";
80
73
  export { TableMobileCard, type TableMobileCardProps, } from "./prospect-client/TableMobileCard/TableMobileCard";
74
+ export { TabMenu, type TabMenuProps } from "./prospect-client/TabMenu/TabMenu";
81
75
  export { Tag, tagVariants, type TagVariants, } from "./prospect-client/Tag/TagLF";
82
76
  export { TagList, type TagListProps, } from "./prospect-client/TagList/TagListLF";
83
77
  export { TimelineVertical } from "./prospect-client/TimelineVertical/TimelineVerticalLF";
package/dist/client.js CHANGED
@@ -16,9 +16,7 @@ export { ContentItemMono } from "./prospect-client/ContentItemMono/ContentItemMo
16
16
  export { DataAgent, } from "./prospect-client/DataAgent/DataAgentLF";
17
17
  export { Divider } from "./prospect-client/Divider/DividerLF";
18
18
  export { Fieldset, } from "./prospect-client/Fieldset/FieldsetLF";
19
- export { CardCheckbox,
20
- /** @deprecated Use `CardCheckbox` instead. */
21
- CardCheckbox as CheckboxCard, } from "./prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxLF";
19
+ export { CardCheckbox } from "./prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxLF";
22
20
  export { CardCheckboxOption } from "./prospect-client/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionLF";
23
21
  export { Checkbox } from "./prospect-client/Form/Checkbox/Checkbox/CheckboxLF";
24
22
  export { CheckboxText } from "./prospect-client/Form/Checkbox/CheckboxText/CheckboxTextLF";
@@ -26,14 +24,10 @@ export { Dropdown } from "./prospect-client/Form/Dropdown/DropdownLF";
26
24
  export { FileUpload } from "./prospect-client/Form/FileUpload/FileUpload/FileUploadLF";
27
25
  export { InputFile } from "./prospect-client/Form/FileUpload/InputFile/InputFileLF";
28
26
  export { ItemFile } from "./prospect-client/Form/FileUpload/ItemFile/ItemFileLF";
29
- export {
30
- /** @deprecated Use `InputDate` instead. */
31
- InputDate as DateInput, InputDate, } from "./prospect-client/Form/InputDate/InputDateLF";
27
+ export { InputDate } from "./prospect-client/Form/InputDate/InputDateLF";
32
28
  export {} from "./prospect-client/Form/InputPhone/InputPhone.types";
33
29
  export { InputPhone } from "./prospect-client/Form/InputPhone/InputPhoneLF";
34
- export { InputText,
35
- /** @deprecated Use `InputText` instead. */
36
- InputText as TextInput, } from "./prospect-client/Form/InputText/InputTextLF";
30
+ export { InputText } from "./prospect-client/Form/InputText/InputTextLF";
37
31
  export { InputTextAtom } from "./prospect-client/Form/InputTextAtom/InputTextAtomLF";
38
32
  export { ItemLabel } from "./prospect-client/Form/ItemLabel/ItemLabelLF";
39
33
  export { ItemMessage, itemMessageVariants, } from "./prospect-client/Form/ItemMessage/ItemMessageLF";
@@ -44,13 +38,11 @@ export { Radio } from "./prospect-client/Form/Radio/Radio/RadioLF";
44
38
  export { RadioText, } from "./prospect-client/Form/Radio/RadioText/RadioTextLF";
45
39
  export { TextArea } from "./prospect-client/Form/TextArea/TextAreaLF";
46
40
  export { DebugGrid } from "./prospect-client/Grid/DebugGridLF";
47
- export { Heading, } from "./prospect-client/Heading/HeadingLF";
48
41
  export { Header } from "./prospect-client/Header/HeaderLF";
42
+ export { Heading, } from "./prospect-client/Heading/HeadingLF";
49
43
  export { Icon, iconSizeVariants, iconVariants, } from "./prospect-client/Icon/IconLF";
50
- export { ItemTabBar, } from "./prospect-client/ItemTabBar/ItemTabBarLF";
51
44
  export { ItemMenu, } from "./prospect-client/ItemMenu/ItemMenuLF";
52
- export { MenuBurger, } from "./prospect-client/MenuBurger/MenuBurgerLF";
53
- export { TabMenu } from "./prospect-client/TabMenu/TabMenu";
45
+ export { ItemTabBar, } from "./prospect-client/ItemTabBar/ItemTabBarLF";
54
46
  export { ExitLayout, ExitLayoutSkeleton, } from "./prospect-client/Layout/ExitLayout/ExitLayoutLF";
55
47
  export { Footer, } from "./prospect-client/Layout/Footer/FooterLF";
56
48
  export { FormLayout, } from "./prospect-client/Layout/FormLayout/FormLayout";
@@ -60,9 +52,10 @@ export { ClickItem, clickItemStates, clickItemVariants, } from "./prospect-clien
60
52
  export { ContentItemDuo } from "./prospect-client/List/ContentItemDuo/ContentItemDuoLF";
61
53
  export { List } from "./prospect-client/List/List/ListLF";
62
54
  export { Loader } from "./prospect-client/Loader/LoaderLF";
55
+ export { MenuBurger, } from "./prospect-client/MenuBurger/MenuBurgerLF";
63
56
  export { Message, messageVariants, } from "./prospect-client/Message/MessageLF";
64
- export { MultiMessage, } from "./prospect-client/MultiMessage/MultiMessageLF";
65
57
  export { Modal, ModalCore, ModalCoreBody, ModalCoreFooter, ModalCoreHeader, } from "./prospect-client/Modal/ModalLF";
58
+ export { MultiMessage, } from "./prospect-client/MultiMessage/MultiMessageLF";
66
59
  export { ErrorPage, } from "./prospect-client/pages/ErrorPage/ErrorPageLF";
67
60
  export { ValidPage, } from "./prospect-client/pages/ValidPage/ValidPageLF";
68
61
  export { ItemPagination, } from "./prospect-client/Pagination/ItemPagination/ItemPaginationLF";
@@ -78,6 +71,7 @@ export { Svg } from "./prospect-client/Svg/Svg";
78
71
  export { TabBar, tabBarDirection, } from "./prospect-client/TabBar/TabBarLF";
79
72
  export { Table, } from "./prospect-client/Table/TableLF";
80
73
  export { TableMobileCard, } from "./prospect-client/TableMobileCard/TableMobileCard";
74
+ export { TabMenu } from "./prospect-client/TabMenu/TabMenu";
81
75
  export { Tag, tagVariants, } from "./prospect-client/Tag/TagLF";
82
76
  export { TagList, } from "./prospect-client/TagList/TagListLF";
83
77
  export { TimelineVertical } from "./prospect-client/TimelineVertical/TimelineVerticalLF";
@@ -3,10 +3,6 @@ import type { IconProps } from "../Icon/IconCommon";
3
3
  type SummaryOnClick = MouseEventHandler<HTMLElement>;
4
4
  export type AccordionCoreProps = {
5
5
  summary: ReactNode;
6
- /**
7
- * @deprecated use `open` instead
8
- */
9
- isOpen?: boolean;
10
6
  summaryProps?: Omit<ComponentProps<"summary">, "onClick">;
11
7
  onClick?: SummaryOnClick;
12
8
  showArrowAsClickIcon?: boolean;
@@ -15,5 +11,5 @@ export type AccordionCoreProps = {
15
11
  export type AccordionPropsCommonProps = AccordionCoreProps & {
16
12
  IconComponent: ComponentType<IconProps>;
17
13
  };
18
- export declare const AccordionCoreCommon: ({ summary, children, className, summaryProps, isOpen, IconComponent, onClick, showArrowAsClickIcon, arrowIconVariant, ...detailsProps }: AccordionPropsCommonProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const AccordionCoreCommon: ({ summary, children, className, summaryProps, IconComponent, onClick, showArrowAsClickIcon, arrowIconVariant, ...detailsProps }: AccordionPropsCommonProps) => import("react/jsx-runtime").JSX.Element;
19
15
  export {};
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, } from "react";
3
2
  import keyboardDown from "@material-symbols/svg-400/rounded/keyboard_arrow_down-fill.svg";
3
+ import { useCallback, } from "react";
4
4
  import { getClassName } from "../utilities/getClassName";
5
- export const AccordionCoreCommon = ({ summary, children, className, summaryProps, isOpen = false, IconComponent, onClick, showArrowAsClickIcon = true, arrowIconVariant, ...detailsProps }) => {
5
+ export const AccordionCoreCommon = ({ summary, children, className, summaryProps, IconComponent, onClick, showArrowAsClickIcon = true, arrowIconVariant, ...detailsProps }) => {
6
6
  const handleSummaryClick = useCallback((event) => {
7
7
  if (onClick) {
8
8
  event.preventDefault();
@@ -12,7 +12,7 @@ export const AccordionCoreCommon = ({ summary, children, className, summaryProps
12
12
  return (_jsxs("details", { className: getClassName({
13
13
  baseClassName: "af-apollo-accordion",
14
14
  className,
15
- }), open: isOpen, ...detailsProps, children: [_jsxs("summary", { onClick: handleSummaryClick, tabIndex: 0, ...summaryProps, className: getClassName({
15
+ }), ...detailsProps, children: [_jsxs("summary", { onClick: handleSummaryClick, tabIndex: 0, ...summaryProps, className: getClassName({
16
16
  baseClassName: "af-apollo-accordion__summary",
17
17
  className: summaryProps?.className,
18
18
  }), children: [summary, _jsx("div", { className: getClassName({
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
- import { getComponentClassName } from "../utilities/getComponentClassName";
3
+ import { getClassName } from "../utilities/getClassName";
4
4
  export const cardMessageVariants = {
5
5
  info: "info",
6
6
  warning: "warning",
@@ -8,8 +8,10 @@ export const cardMessageVariants = {
8
8
  neutral: "neutral",
9
9
  };
10
10
  export const CardMessage = ({ variant = "info", title, text, className, ...props }) => {
11
- const componentClassName = useMemo(() => {
12
- return getComponentClassName("af-card-message", className, variant);
13
- }, [className, variant]);
11
+ const componentClassName = useMemo(() => getClassName({
12
+ baseClassName: "af-card-message",
13
+ modifiers: [variant],
14
+ className,
15
+ }), [className, variant]);
14
16
  return (_jsxs("div", { ...props, className: componentClassName, children: [title ? _jsx("span", { className: "af-card-message--title", children: title }) : null, _jsx("span", { className: "af-card-message--text", children: text })] }));
15
17
  };
@@ -1,7 +1,7 @@
1
1
  import { type ComponentType, type ReactElement } from "react";
2
- import type { ToggleProps } from "../Toggle/ToggleCommon";
3
- import type { ContentItemProps } from "../ContentItemMono/ContentItemMonoCommon";
4
2
  import type { ButtonProps } from "../Button/ButtonCommon";
3
+ import type { ContentItemProps } from "../ContentItemMono/ContentItemMonoCommon";
4
+ import type { ToggleProps } from "../Toggle/ToggleCommon";
5
5
  export declare const ContentItemDuoActionState: {
6
6
  readonly edit: "edit";
7
7
  readonly toggle: "toggle";
@@ -1,11 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import {} from "react";
3
- import { getComponentClassName } from "../utilities/getComponentClassName";
3
+ import { getClassName } from "../utilities/getClassName";
4
4
  export const ContentItemDuoActionState = {
5
5
  edit: "edit",
6
6
  toggle: "toggle",
7
7
  };
8
8
  export const ContentItemDuoActionCommon = ({ className, state, ContentItemMonoComponent, contentItemProps, ToggleComponent, ...props }) => {
9
- const componentClassName = getComponentClassName("af-content-item-duo-action", className);
9
+ const componentClassName = getClassName({
10
+ baseClassName: "af-content-item-duo-action",
11
+ className,
12
+ });
10
13
  return (_jsxs("div", { className: componentClassName, children: [_jsx(ContentItemMonoComponent, { ...contentItemProps }), _jsx("div", { className: "af-action-container", children: state === "edit" ? (props.buttons) : (_jsx(ToggleComponent, { ...props.toggleProps })) })] }));
11
14
  };
@@ -14,10 +14,6 @@ export type ContentMonoItemIconProps = {
14
14
  title?: string;
15
15
  subtitle1?: string;
16
16
  subtitle2?: string;
17
- /**
18
- * @deprecated Use `iconProps` instead.
19
- */
20
- icon?: string;
21
17
  iconProps?: IconProps;
22
18
  };
23
19
  export type ContentMonoItemStickProps = {
@@ -4,13 +4,12 @@ import { Icon } from "../Icon/IconCommon";
4
4
  import { ContentItemMonoCore, } from "./ContentItemMonoCore";
5
5
  export const getContentItemCoreProps = ({ IconComponent, type, ...props }) => {
6
6
  if (type === "icon") {
7
- const { icon, iconProps, title, subtitle1, subtitle2 } = props;
7
+ const { iconProps, title, subtitle1, subtitle2 } = props;
8
8
  return {
9
9
  title,
10
10
  primarySubtitle: subtitle1,
11
11
  subtitle: subtitle2,
12
- leftComponent: (iconProps && _jsx(IconComponent, { "data-testid": "icon", ...iconProps })) ||
13
- (icon && _jsx(IconComponent, { "data-testid": "icon", src: icon })),
12
+ leftComponent: iconProps && (_jsx(IconComponent, { "data-testid": "icon", ...iconProps })),
14
13
  };
15
14
  }
16
15
  if (type === "picture") {
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { Fragment, useMemo, } from "react";
3
3
  import { Divider } from "../Divider/DividerCommon";
4
4
  import { BREAKPOINT } from "../utilities/constants";
5
- import { getComponentClassName } from "../utilities/getComponentClassName";
5
+ import { getClassName } from "../utilities/getClassName";
6
6
  import { useIsSmallScreen } from "../utilities/hook/useIsSmallScreen";
7
7
  export const DataAgentCommon = ({ className, agentProps, agentContractProps, contents, clickContents, texteOrias, DividerComponent, ContentItemMonoComponent, ClickItemComponent, isCompact = true, variant = "default", }) => {
8
- const componentClassName = useMemo(() => getComponentClassName("af-data-agent", className), [className]);
8
+ const componentClassName = useMemo(() => getClassName({ baseClassName: "af-data-agent", className }), [className]);
9
9
  const isMobile = useIsSmallScreen(BREAKPOINT.SM);
10
10
  const renderForDefaultLayout = () => (_jsxs(_Fragment, { children: [_jsxs("section", { className: "af-data-agent__intro", children: [_jsx(ContentItemMonoComponent, { ...agentProps, type: "picture" }), agentContractProps ? (_jsx(ContentItemMonoComponent, { ...agentContractProps, type: "stick" })) : null] }), _jsx(DividerComponent, {}), contents && contents?.length > 0 ? (_jsx("section", { className: "af-data-agent__info-content", children: contents.map((content) => (_jsxs(Fragment, { children: [_jsx(ContentItemMonoComponent, { ...content, type: "icon" }), _jsx(DividerComponent, { className: "af-data-agent__line" })] }, `content--${crypto.randomUUID()}`))) })) : null, clickContents && clickContents?.length > 0 ? (_jsx("section", { className: "af-data-agent__info-click-content", children: clickContents.map((clickContent) => (_jsxs(Fragment, { children: [_jsx(ClickItemComponent, { ...clickContent, variant: "small" }), _jsx(DividerComponent, { className: "af-data-agent__line" })] }, `clickContent--${crypto.randomUUID()}`))) })) : null, Boolean(texteOrias) && (_jsx("p", { className: "af-data-agent__text-orias", children: texteOrias }))] }));
11
11
  const renderForMobileLayout = () => (_jsx("section", { className: "af-data-agent__intro", children: _jsx(ClickItemComponent, { ...agentProps, basePictureProps: {
@@ -1,7 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
- import { getComponentClassName } from "../utilities/getComponentClassName";
3
+ import { getClassName } from "../utilities/getClassName";
4
4
  export const Divider = ({ className, classModifier }) => {
5
- const componentClassName = useMemo(() => getComponentClassName("af-divider", className, classModifier), [className, classModifier]);
5
+ const componentClassName = useMemo(() => getClassName({
6
+ baseClassName: "af-divider",
7
+ className,
8
+ modifiers: classModifier?.split(" ").filter(Boolean) ?? [],
9
+ }), [className, classModifier]);
6
10
  return _jsx("hr", { className: componentClassName });
7
11
  };
@@ -7,25 +7,9 @@ type CheckboxOption = Omit<CardCheckboxOptionProps, "name" | "type">;
7
7
  export type CardCheckboxProps = Omit<CardCheckboxOptionProps, "value" | "label" | "type" | "icon" | "description" | "subtitle" | "children"> & {
8
8
  type?: "vertical" | "horizontal";
9
9
  mode?: "text";
10
- /**
11
- * @deprecated Use `label` instead.
12
- */
13
- labelGroup?: string;
14
- /**
15
- * @deprecated Use `description` instead.
16
- */
17
- descriptionGroup?: string;
18
10
  label: ReactNode;
19
11
  description?: ReactNode;
20
- /**
21
- * @deprecated Use `required` instead.
22
- */
23
- isRequired?: boolean;
24
12
  options: CheckboxOption[];
25
- /**
26
- * @deprecated Use `message` and messageType instead.
27
- */
28
- error?: string;
29
13
  containerProps?: GridContainerProps<"fieldset">;
30
14
  } & Partial<ItemMessageProps>;
31
15
  type CardCheckboxCommonProps = CardCheckboxProps & {
@@ -34,7 +18,7 @@ type CardCheckboxCommonProps = CardCheckboxProps & {
34
18
  ItemMessageComponent: ComponentType<ItemMessageProps>;
35
19
  };
36
20
  export declare const CardCheckboxCommon: {
37
- ({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, type, error, name, id, onChange, CardCheckboxItemComponent, CheckboxTextComponent, ItemMessageComponent, message, messageType, containerProps, mode, ...inputProps }: CardCheckboxCommonProps): import("react/jsx-runtime").JSX.Element;
21
+ ({ className, label, description, required, options, type, name, id, onChange, CardCheckboxItemComponent, CheckboxTextComponent, ItemMessageComponent, message, messageType, containerProps, mode, ...inputProps }: CardCheckboxCommonProps): import("react/jsx-runtime").JSX.Element;
38
22
  displayName: string;
39
23
  };
40
24
  export {};
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useId, useRef, } from "react";
3
- export const CardCheckboxCommon = ({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, type = "vertical", error, name, id, onChange = () => { }, CardCheckboxItemComponent, CheckboxTextComponent, ItemMessageComponent, message, messageType = "error", containerProps, mode, ...inputProps }) => {
3
+ export const CardCheckboxCommon = ({ className, label, description, required, options, type = "vertical", name, id, onChange = () => { }, CardCheckboxItemComponent, CheckboxTextComponent, ItemMessageComponent, message, messageType = "error", containerProps, mode, ...inputProps }) => {
4
4
  const generatedId = useId();
5
5
  const cardCheckboxId = id || generatedId;
6
6
  const messageId = `${cardCheckboxId}-error`;
@@ -23,10 +23,10 @@ export const CardCheckboxCommon = ({ className, labelGroup, descriptionGroup, la
23
23
  }
24
24
  onChange(event);
25
25
  };
26
- const hasError = (Boolean(message) && messageType === "error") || Boolean(error);
27
- return (_jsxs("fieldset", { className: ["af-card-checkbox", className].filter(Boolean).join(" "), id: cardCheckboxId, ...containerProps, children: [_jsxs("legend", { className: "af-card-checkbox__legend", children: [_jsxs("p", { className: "af-card-checkbox__label", children: [label, labelGroup, required || isRequired ? _jsx("span", { "aria-hidden": true, children: "*" }) : null] }), description || descriptionGroup ? (_jsxs("p", { className: "af-card-checkbox__description", children: [description, descriptionGroup] })) : null] }), _jsx("div", { className: [
26
+ const hasError = Boolean(message) && messageType === "error";
27
+ return (_jsxs("fieldset", { className: ["af-card-checkbox", className].filter(Boolean).join(" "), id: cardCheckboxId, ...containerProps, children: [_jsxs("legend", { className: "af-card-checkbox__legend", children: [_jsxs("p", { className: "af-card-checkbox__label", children: [label, required ? _jsx("span", { "aria-hidden": true, children: "*" }) : null] }), description ? (_jsx("p", { className: "af-card-checkbox__description", children: description })) : null] }), _jsx("div", { className: [
28
28
  "af-card-checkbox__options",
29
29
  `af-card-checkbox__options--${type}`,
30
- ].join(" "), ref: cardCheckboxOptionsRef, children: options.map((cardCheckboxItemProps) => (_jsx(CheckboxItemComponent, { id: `${cardCheckboxId}-${cardCheckboxItemProps.value}`, required: required, onChange: handleChange, ...inputProps, ...cardCheckboxItemProps, type: type, "aria-invalid": hasError || undefined, "aria-errormessage": hasError ? messageId : undefined, name: name }, `${name ?? cardCheckboxId}-${cardCheckboxItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: messageId, message: message || error, messageType: messageType })] }));
30
+ ].join(" "), ref: cardCheckboxOptionsRef, children: options.map((cardCheckboxItemProps) => (_jsx(CheckboxItemComponent, { id: `${cardCheckboxId}-${cardCheckboxItemProps.value}`, required: required, onChange: handleChange, ...inputProps, ...cardCheckboxItemProps, type: type, "aria-invalid": hasError || undefined, "aria-errormessage": hasError ? messageId : undefined, name: name }, `${name ?? cardCheckboxId}-${cardCheckboxItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: messageId, message: message, messageType: messageType })] }));
31
31
  };
32
32
  CardCheckboxCommon.displayName = "CardCheckboxCommon";
@@ -1,11 +1,6 @@
1
1
  import { type ComponentProps } from "react";
2
- export type CheckboxProps = {
3
- /** @deprecated Use `aria-errormessage` instead */
4
- errorId?: string;
5
- /** @deprecated Use `aria-invalid` instead */
6
- hasError?: boolean;
7
- } & Omit<ComponentProps<"input">, "disabled" | "type">;
2
+ export type CheckboxProps = Omit<ComponentProps<"input">, "disabled" | "type">;
8
3
  export declare const Checkbox: {
9
- ({ errorId, hasError, className, ...inputProps }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
4
+ ({ className, ...inputProps }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
10
5
  displayName: string;
11
6
  };
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
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" }));
3
+ export const Checkbox = ({ className, ...inputProps }) => (_jsx("input", { ...inputProps, className: ["af-checkbox", className].filter(Boolean).join(" "), type: "checkbox" }));
4
4
  Checkbox.displayName = "Checkbox";
@@ -4,10 +4,6 @@ import type { ItemMessageProps } from "../../ItemMessage/ItemMessageCommon";
4
4
  import type { CheckboxProps } from "../Checkbox/CheckboxCommon";
5
5
  export type CheckboxTextProps = {
6
6
  label: string | ReactNode;
7
- /**
8
- * @deprecated Use `message` and messageType instead.
9
- */
10
- errorMessage?: string;
11
7
  containerProps?: GridContainerProps;
12
8
  } & Omit<CheckboxProps, "aria-errormessage" | "aria-invalid"> & Partial<ItemMessageProps>;
13
9
  export type CheckboxTextCommonProps = CheckboxTextProps & {
@@ -15,7 +11,7 @@ export type CheckboxTextCommonProps = CheckboxTextProps & {
15
11
  ItemMessageComponent: ComponentType<ItemMessageProps>;
16
12
  };
17
13
  declare const CheckboxTextCommon: {
18
- ({ label, errorMessage, id, message, messageType, CheckboxComponent, ItemMessageComponent, containerProps, ...inputProps }: CheckboxTextCommonProps): import("react/jsx-runtime").JSX.Element;
14
+ ({ label, id, message, messageType, CheckboxComponent, ItemMessageComponent, containerProps, ...inputProps }: CheckboxTextCommonProps): import("react/jsx-runtime").JSX.Element;
19
15
  displayName: string;
20
16
  };
21
17
  export { CheckboxTextCommon };
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
- const CheckboxTextCommon = ({ label, errorMessage, id, message, messageType, CheckboxComponent, ItemMessageComponent, containerProps, ...inputProps }) => {
3
+ const CheckboxTextCommon = ({ label, id, message, messageType = "error", CheckboxComponent, ItemMessageComponent, containerProps, ...inputProps }) => {
4
4
  const generatedId = useId();
5
5
  const inputId = id ?? generatedId;
6
6
  const messageId = `${inputId}-error`;
7
- const hasError = (Boolean(message) && messageType === "error") || Boolean(errorMessage);
8
- return (_jsxs("div", { className: "af-checkbox-text", ...containerProps, children: [_jsxs("label", { htmlFor: inputId, children: [_jsx(CheckboxComponent, { id: inputId, ...inputProps, "aria-errormessage": hasError ? messageId : undefined, "aria-invalid": hasError || undefined }), _jsx("span", { className: "af-checkbox-text__label-content", children: label })] }), _jsx(ItemMessageComponent, { message: message || errorMessage, id: messageId, messageType: messageType })] }));
7
+ const hasError = Boolean(message) && messageType === "error";
8
+ return (_jsxs("div", { className: "af-checkbox-text", ...containerProps, children: [_jsxs("label", { htmlFor: inputId, children: [_jsx(CheckboxComponent, { id: inputId, ...inputProps, "aria-errormessage": hasError ? messageId : undefined, "aria-invalid": hasError || undefined }), _jsx("span", { className: "af-checkbox-text__label-content", children: label })] }), _jsx(ItemMessageComponent, { message: message, id: messageId, messageType: messageType })] }));
9
9
  };
10
10
  CheckboxTextCommon.displayName = "CheckboxTextCommon";
11
11
  export { CheckboxTextCommon };
@@ -6,25 +6,17 @@ export type DropdownProps = ComponentPropsWithRef<"select"> & {
6
6
  id?: string;
7
7
  classModifier?: string;
8
8
  label?: ItemLabelProps["children"];
9
- /**
10
- * @deprecated Use `message` and messageType instead.
11
- */
12
- error?: string;
13
- /**
14
- * @deprecated Use `message` and messageType instead.
15
- */
16
- success?: string;
17
9
  placeholder?: string;
18
10
  description?: string;
19
11
  helper?: string;
20
12
  containerProps?: GridContainerProps;
21
- } & Pick<ItemLabelProps, "buttonLabel" | "moreButtonLabel" | "onButtonClick" | "onMoreButtonClick" | "sideButtonLabel" | "onSideButtonClick"> & Pick<ItemMessageProps, "message" | "messageType">;
13
+ } & Pick<ItemLabelProps, "moreButtonLabel" | "onMoreButtonClick" | "sideButtonLabel" | "onSideButtonClick"> & Pick<ItemMessageProps, "message" | "messageType">;
22
14
  type DropdownCommonProps = DropdownProps & {
23
15
  ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabelCommon>, "ButtonComponent">>;
24
16
  ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
25
17
  };
26
18
  declare const DropdownCommon: {
27
- ({ id, required, label, error, placeholder, children, helper, success, message, messageType, description, buttonLabel, moreButtonLabel, onButtonClick, onMoreButtonClick, sideButtonLabel, onSideButtonClick, ItemLabelComponent, ItemMessageComponent, containerProps, ...otherProps }: DropdownCommonProps): import("react/jsx-runtime").JSX.Element;
19
+ ({ id, required, label, placeholder, children, helper, message, messageType, description, moreButtonLabel, onMoreButtonClick, sideButtonLabel, onSideButtonClick, ItemLabelComponent, ItemMessageComponent, containerProps, ...otherProps }: DropdownCommonProps): import("react/jsx-runtime").JSX.Element;
28
20
  displayName: string;
29
21
  };
30
22
  export { DropdownCommon };
@@ -3,14 +3,14 @@ import classNames from "classnames";
3
3
  import { useId, } from "react";
4
4
  import { ItemLabelCommon, } from "../ItemLabel/ItemLabelCommon";
5
5
  import { ItemMessage, } from "../ItemMessage/ItemMessageCommon";
6
- const DropdownCommon = ({ id, required, label, error, placeholder, children, helper, success, message, messageType, description, buttonLabel, moreButtonLabel, onButtonClick, onMoreButtonClick, sideButtonLabel, onSideButtonClick, ItemLabelComponent, ItemMessageComponent, containerProps, ...otherProps }) => {
6
+ const DropdownCommon = ({ id, required, label, placeholder, children, helper, message, messageType = "error", description, moreButtonLabel, onMoreButtonClick, sideButtonLabel, onSideButtonClick, ItemLabelComponent, ItemMessageComponent, containerProps, ...otherProps }) => {
7
7
  const idMessage = useId();
8
8
  let inputId = useId();
9
9
  inputId = id || inputId;
10
- const hasError = (Boolean(message) && messageType === "error") || Boolean(error);
10
+ const hasError = Boolean(message) && messageType === "error";
11
11
  const hasWarning = !hasError && Boolean(message) && messageType === "warning";
12
12
  const classname = classNames("af-form__dropdown-input", hasError && "af-form__dropdown-input--error", hasWarning && "af-form__dropdown-input--warning");
13
- return (_jsxs("div", { className: "af-form__dropdown-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel ?? buttonLabel, onMoreButtonClick: onMoreButtonClick ?? onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, htmlFor: inputId, children: label }), _jsxs("select", { className: classname, ...otherProps, id: inputId, children: [Boolean(placeholder) && _jsx("option", { value: "", children: placeholder }), children] }), helper ? _jsx("span", { className: "af-form__input-helper", children: helper }) : null, _jsx(ItemMessageComponent, { id: idMessage, message: message || error || success, messageType: messageType || (error ? "error" : "success") })] }));
13
+ return (_jsxs("div", { className: "af-form__dropdown-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel, onMoreButtonClick: onMoreButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, htmlFor: inputId, children: label }), _jsxs("select", { className: classname, ...otherProps, id: inputId, children: [Boolean(placeholder) && _jsx("option", { value: "", children: placeholder }), children] }), helper ? _jsx("span", { className: "af-form__input-helper", children: helper }) : null, _jsx(ItemMessageComponent, { id: idMessage, message: message, messageType: messageType })] }));
14
14
  };
15
15
  DropdownCommon.displayName = "Dropdown";
16
16
  export { DropdownCommon };
@@ -10,24 +10,16 @@ export type InputDateProps = Omit<ComponentPropsWithRef<"input">, "value" | "min
10
10
  min?: InputDateAtomProps["min"];
11
11
  max?: InputDateAtomProps["max"];
12
12
  helper?: string;
13
- /**
14
- * @deprecated Use `message` and messageType instead.
15
- */
16
- error?: string;
17
- /**
18
- * @deprecated Use `message` and messageType instead.
19
- */
20
- success?: string;
21
13
  hidePicker?: boolean;
22
14
  label: ItemLabelProps["children"];
23
15
  containerProps?: GridContainerProps;
24
- } & Partial<Pick<ItemLabelProps, "description" | "buttonLabel" | "moreButtonLabel" | "onButtonClick" | "onMoreButtonClick"> & ItemMessageProps>;
16
+ } & Partial<Pick<ItemLabelProps, "description" | "moreButtonLabel" | "onMoreButtonClick"> & ItemMessageProps>;
25
17
  type InputDateCommonProps = InputDateProps & {
26
18
  ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabelCommon>, "ButtonComponent">>;
27
19
  ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
28
20
  };
29
21
  declare const InputDateCommon: {
30
- ({ className, classModifier, helper, error, success, message, messageType, label, description, buttonLabel, moreButtonLabel, onButtonClick, onMoreButtonClick, ItemLabelComponent, ItemMessageComponent, required, hidePicker, max, min, containerProps, ...otherProps }: InputDateCommonProps): import("react/jsx-runtime").JSX.Element;
22
+ ({ className, classModifier, helper, message, messageType, label, description, moreButtonLabel, onMoreButtonClick, ItemLabelComponent, ItemMessageComponent, required, hidePicker, max, min, containerProps, ...otherProps }: InputDateCommonProps): import("react/jsx-runtime").JSX.Element;
31
23
  displayName: string;
32
24
  };
33
25
  export { InputDateCommon };
@@ -5,20 +5,19 @@ import { ItemLabelCommon, } from "../ItemLabel/ItemLabelCommon";
5
5
  import { ItemMessage, } from "../ItemMessage/ItemMessageCommon";
6
6
  import { InputDateAtom } from "./InputDateAtom";
7
7
  import { InputDateTextAtom } from "./InputDateTextAtom";
8
- const InputDateCommon = ({ className, classModifier = "", helper, error, success, message, messageType, label, description, buttonLabel, moreButtonLabel, onButtonClick, onMoreButtonClick, ItemLabelComponent, ItemMessageComponent, required, hidePicker, max, min, containerProps, ...otherProps }) => {
8
+ const InputDateCommon = ({ className, classModifier = "", helper, message, messageType = "error", label, description, moreButtonLabel, onMoreButtonClick, ItemLabelComponent, ItemMessageComponent, required, hidePicker, max, min, containerProps, ...otherProps }) => {
9
9
  let inputId = useId();
10
10
  inputId = otherProps.id ?? inputId;
11
11
  const idMessage = useId();
12
12
  const idHelp = useId();
13
13
  const ariaDescribedbyIds = [
14
14
  helper && idHelp,
15
- ((Boolean(message) && messageType === "success") || Boolean(success)) &&
16
- idMessage,
15
+ Boolean(message) && messageType === "success" && idMessage,
17
16
  ].filter(Boolean);
18
17
  const ariaDescribedby = ariaDescribedbyIds.length
19
18
  ? ariaDescribedbyIds.join(" ")
20
19
  : undefined;
21
- const hasError = (Boolean(message) && messageType === "error") || Boolean(error);
20
+ const hasError = Boolean(message) && messageType === "error";
22
21
  const ariaErrormessage = hasError ? idMessage : undefined;
23
22
  const ariaInvalid = hasError || undefined;
24
23
  const hasWarning = Boolean(message) && messageType === "warning" && !hasError;
@@ -27,7 +26,7 @@ const InputDateCommon = ({ className, classModifier = "", helper, error, success
27
26
  modifiers: [...classModifier.split(" "), hasWarning && "warning"],
28
27
  className,
29
28
  });
30
- return (_jsxs("div", { className: "af-form__input-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel ?? buttonLabel, onMoreButtonClick: onMoreButtonClick ?? onButtonClick, required: required, htmlFor: inputId, children: label }), hidePicker ? (_jsx(InputDateTextAtom, { ...otherProps, id: inputId, className: componentClassName, "aria-errormessage": ariaErrormessage, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, required: required })) : (_jsx(InputDateAtom, { ...otherProps, id: inputId, className: componentClassName, "aria-errormessage": ariaErrormessage, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, required: required, max: max, min: min })), helper ? (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })) : null, _jsx(ItemMessageComponent, { id: idMessage, message: message || error || success, messageType: messageType || (error ? "error" : "success") })] }));
29
+ return (_jsxs("div", { className: "af-form__input-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel, onMoreButtonClick: onMoreButtonClick, required: required, htmlFor: inputId, children: label }), hidePicker ? (_jsx(InputDateTextAtom, { ...otherProps, id: inputId, className: componentClassName, "aria-errormessage": ariaErrormessage, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, required: required })) : (_jsx(InputDateAtom, { ...otherProps, id: inputId, className: componentClassName, "aria-errormessage": ariaErrormessage, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, required: required, max: max, min: min })), helper ? (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })) : null, _jsx(ItemMessageComponent, { id: idMessage, message: message, messageType: messageType })] }));
31
30
  };
32
31
  InputDateCommon.displayName = "InputDate";
33
32
  export { InputDateCommon };
@@ -9,14 +9,6 @@ import { type OptionType } from "./InputPhone.types";
9
9
  export type InputPhoneProps = ComponentPropsWithRef<"input"> & {
10
10
  classModifier?: string;
11
11
  helper?: string;
12
- /**
13
- * @deprecated Use `message` and messageType instead.
14
- */
15
- error?: string;
16
- /**
17
- * @deprecated Use `message` and messageType instead.
18
- */
19
- success?: string;
20
12
  defaultCountry?: string;
21
13
  showSelect?: boolean;
22
14
  disabled?: boolean;
@@ -26,7 +18,7 @@ export type InputPhoneProps = ComponentPropsWithRef<"input"> & {
26
18
  mask?: (value: string) => string;
27
19
  label: ItemLabelProps["children"];
28
20
  containerProps?: GridContainerProps;
29
- } & Pick<ItemLabelProps, "description" | "moreButtonLabel" | "buttonLabel" | "onMoreButtonClick" | "onButtonClick" | "sideButtonLabel" | "onSideButtonClick"> & Pick<ItemMessageProps, "message" | "messageType">;
21
+ } & Pick<ItemLabelProps, "description" | "moreButtonLabel" | "onMoreButtonClick" | "sideButtonLabel" | "onSideButtonClick"> & Pick<ItemMessageProps, "message" | "messageType">;
30
22
  type InputPhoneCommonProps = InputPhoneProps & {
31
23
  ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabelCommon>, "ButtonComponent">>;
32
24
  ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
@@ -34,7 +26,7 @@ type InputPhoneCommonProps = InputPhoneProps & {
34
26
  IconComponent: ComponentType<ComponentProps<typeof Icon>>;
35
27
  };
36
28
  declare const InputPhoneCommon: {
37
- ({ className, classModifier, helper, error, success, message, messageType, defaultCountry, showSelect, disabled, label, description, buttonLabel, moreButtonLabel, onButtonClick, onMoreButtonClick, required, sideButtonLabel, onSideButtonClick, countryCodeOptions, onChangeSelect, onChangeInput, mask, ItemLabelComponent, ItemMessageComponent, InputTextComponent, IconComponent, "aria-errormessage": ariaErrormessage, containerProps, ...otherProps }: InputPhoneCommonProps): import("react/jsx-runtime").JSX.Element;
29
+ ({ className, classModifier, helper, message, messageType, defaultCountry, showSelect, disabled, label, description, moreButtonLabel, onMoreButtonClick, required, sideButtonLabel, onSideButtonClick, countryCodeOptions, onChangeSelect, onChangeInput, mask, ItemLabelComponent, ItemMessageComponent, InputTextComponent, IconComponent, "aria-errormessage": ariaErrormessage, containerProps, ...otherProps }: InputPhoneCommonProps): import("react/jsx-runtime").JSX.Element;
38
30
  displayName: string;
39
31
  };
40
32
  export { InputPhoneCommon };
@@ -7,13 +7,16 @@ import { ItemMessage, } from "../ItemMessage/ItemMessageCommon";
7
7
  import { CountryCodeSelect } from "./CountryCodeSelect";
8
8
  import {} from "./InputPhone.types";
9
9
  import { maskFrenchPhoneNumber } from "./maskFrenchPhoneNumber";
10
- const InputPhoneCommon = ({ className, classModifier = "", helper, error, success, message, messageType, defaultCountry, showSelect, disabled, label, description, buttonLabel, moreButtonLabel, onButtonClick, onMoreButtonClick, required, sideButtonLabel, onSideButtonClick, countryCodeOptions = [], onChangeSelect, onChangeInput, mask = maskFrenchPhoneNumber, ItemLabelComponent, ItemMessageComponent, InputTextComponent, IconComponent, "aria-errormessage": ariaErrormessage, containerProps, ...otherProps }) => {
10
+ const InputPhoneCommon = ({ className, classModifier = "", helper, message, messageType = "error", defaultCountry, showSelect, disabled, label, description, moreButtonLabel, onMoreButtonClick, required, sideButtonLabel, onSideButtonClick, countryCodeOptions = [], onChangeSelect, onChangeInput, mask = maskFrenchPhoneNumber, ItemLabelComponent, ItemMessageComponent, InputTextComponent, IconComponent, "aria-errormessage": ariaErrormessage, containerProps, ...otherProps }) => {
11
11
  let inputId = useId();
12
12
  inputId = otherProps.id || inputId;
13
13
  const idMessage = useId();
14
14
  const idHelp = useId();
15
- const ariaDescribedby = [helper && idHelp, success && idMessage].filter(Boolean);
16
- const hasError = (Boolean(message) && messageType === "error") || Boolean(error);
15
+ const ariaDescribedby = [
16
+ helper && idHelp,
17
+ message && messageType === "success" && idMessage,
18
+ ].filter(Boolean);
19
+ const hasError = Boolean(message) && messageType === "error";
17
20
  /**
18
21
  * Gère le changement de valeur du champ numéro de téléphone.
19
22
  * - Récupère une fonction de masquage (mask) depuis les props ou utilise une version par défaut.
@@ -29,9 +32,9 @@ const InputPhoneCommon = ({ className, classModifier = "", helper, error, succes
29
32
  const maskedValue = mask(rawValue);
30
33
  onChangeInput?.(maskedValue);
31
34
  };
32
- return (_jsxs("div", { className: "af-form__input-phone-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel ?? buttonLabel, onMoreButtonClick: onMoreButtonClick ?? onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, htmlFor: inputId, children: label }), _jsxs("div", { className: "af-form__input-phone-fields", children: [showSelect ? (_jsx("div", { className: "af-form__country-code-wrapper", children: _jsx(CountryCodeSelect, { options: countryCodeOptions, defaultCountry: defaultCountry, onChangeSelect: onChangeSelect, IconComponent: IconComponent, disabled: disabled }) })) : null, _jsx(InputTextComponent, { ...otherProps, className: ["af-form__input-phone", className]
35
+ return (_jsxs("div", { className: "af-form__input-phone-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel, onMoreButtonClick: onMoreButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, htmlFor: inputId, children: label }), _jsxs("div", { className: "af-form__input-phone-fields", children: [showSelect ? (_jsx("div", { className: "af-form__country-code-wrapper", children: _jsx(CountryCodeSelect, { options: countryCodeOptions, defaultCountry: defaultCountry, onChangeSelect: onChangeSelect, IconComponent: IconComponent, disabled: disabled }) })) : null, _jsx(InputTextComponent, { ...otherProps, className: ["af-form__input-phone", className]
33
36
  .filter(Boolean)
34
- .join(" "), classModifier: classModifier, error: hasError ? messageType || error : undefined, type: "tel", required: required, placeholder: otherProps.placeholder, "aria-errormessage": ariaErrormessage, value: otherProps.value, onChange: handleChangeNumber, disabled: disabled, idMessage: hasError ? idMessage : undefined, idHelp: ariaDescribedby.length > 0 ? ariaDescribedby.join(" ") : undefined, id: inputId })] }), helper ? (_jsx("span", { id: idHelp, className: "af-form__input-phone-helper", children: helper })) : null, _jsx(ItemMessageComponent, { id: idMessage, message: message || error || success, messageType: messageType || (error ? "error" : "success") })] }));
37
+ .join(" "), classModifier: classModifier, error: hasError ? messageType : undefined, type: "tel", required: required, placeholder: otherProps.placeholder, "aria-errormessage": ariaErrormessage, value: otherProps.value, onChange: handleChangeNumber, disabled: disabled, idMessage: hasError ? idMessage : undefined, idHelp: ariaDescribedby.length > 0 ? ariaDescribedby.join(" ") : undefined, id: inputId })] }), helper ? (_jsx("span", { id: idHelp, className: "af-form__input-phone-helper", children: helper })) : null, _jsx(ItemMessageComponent, { id: idMessage, message: message, messageType: messageType })] }));
35
38
  };
36
39
  InputPhoneCommon.displayName = "InputPhone";
37
40
  export { InputPhoneCommon };