@axa-fr/design-system-apollo-react 1.0.5-alpha.392 → 1.0.5-alpha.398

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 (47) hide show
  1. package/dist/Accordion/AccordionCommon.js +1 -1
  2. package/dist/Accordion/AccordionTagDateContainer/AccordionTagDateContainerCommon.js +1 -1
  3. package/dist/Button/ButtonCommon.js +1 -1
  4. package/dist/CardMessage/CardMessageCommon.js +1 -1
  5. package/dist/ContentItemMono/ContentItemMonoCore.js +1 -1
  6. package/dist/DataAgent/DataAgentCommon.js +1 -1
  7. package/dist/Form/Checkbox/CardCheckbox/CardCheckboxCommon.js +1 -1
  8. package/dist/Form/Checkbox/CardCheckbox/CardCheckboxItem.js +1 -1
  9. package/dist/Form/Dropdown/DropdownCommon.js +1 -1
  10. package/dist/Form/InputDate/InputDateCommon.js +1 -1
  11. package/dist/Form/InputPhone/InputPhoneCommon.js +1 -1
  12. package/dist/Form/InputText/InputTextCommon.js +1 -1
  13. package/dist/Form/ItemLabel/ItemLabelCommon.js +1 -1
  14. package/dist/Form/ItemMessage/ItemMessageCommon.d.ts +2 -1
  15. package/dist/Form/Radio/CardRadio/CardRadioApollo.d.ts +1 -1
  16. package/dist/Form/Radio/CardRadio/CardRadioApollo.js +3 -4
  17. package/dist/Form/Radio/CardRadio/CardRadioCommon.d.ts +27 -12
  18. package/dist/Form/Radio/CardRadio/CardRadioCommon.js +10 -17
  19. package/dist/Form/Radio/CardRadio/CardRadioLF.d.ts +1 -1
  20. package/dist/Form/Radio/CardRadio/CardRadioLF.js +3 -4
  21. package/dist/Form/Radio/CardRadioOption/CardRadioOptionApollo.d.ts +3 -0
  22. package/dist/Form/Radio/CardRadioOption/CardRadioOptionApollo.js +6 -0
  23. package/dist/Form/Radio/CardRadioOption/CardRadioOptionCommon.d.ts +15 -0
  24. package/dist/Form/Radio/CardRadioOption/CardRadioOptionCommon.js +11 -0
  25. package/dist/Form/Radio/CardRadioOption/CardRadioOptionLF.d.ts +3 -0
  26. package/dist/Form/Radio/CardRadioOption/CardRadioOptionLF.js +6 -0
  27. package/dist/Form/TextArea/TextAreaApollo.d.ts +1 -1
  28. package/dist/Form/TextArea/TextAreaCommon.js +1 -1
  29. package/dist/Form/TextArea/TextAreaLF.d.ts +1 -1
  30. package/dist/Heading/HeadingApollo.js +1 -1
  31. package/dist/Heading/HeadingCommon.js +1 -1
  32. package/dist/Heading/HeadingLF.js +1 -1
  33. package/dist/Heading/HeadingWithSubheadings.js +1 -1
  34. package/dist/Link/LinkCommon.js +3 -2
  35. package/dist/List/ClickItem/components/ClickItemContentCommon.js +1 -1
  36. package/dist/List/ContentItemDuo/ContentItemDuoCommon.js +1 -1
  37. package/dist/Message/MessageCommon.js +1 -1
  38. package/dist/Modal/components/ModalCoreHeaderCommon.js +1 -1
  39. package/dist/index.d.ts +1 -0
  40. package/dist/index.js +1 -0
  41. package/dist/indexLF.d.ts +1 -0
  42. package/dist/indexLF.js +1 -0
  43. package/package.json +3 -3
  44. package/dist/Form/Radio/CardRadio/CardRadioItem.d.ts +0 -13
  45. package/dist/Form/Radio/CardRadio/CardRadioItem.js +0 -2
  46. package/dist/Form/Radio/CardRadio/types.d.ts +0 -11
  47. package/dist/Form/Radio/CardRadio/types.js +0 -1
@@ -7,5 +7,5 @@ export const accordionVariants = {
7
7
  };
8
8
  export const AccordionCommon = ({ variant = accordionVariants.primary, className, children, icon, title, subtitle, tagLabel, tagProps, dateLabel, dateProps, info1, info2, AccordionCoreComponent, AccordionTagDateContainerComponent, IconComponent, ...accordionCoreProps }) => {
9
9
  const componentClassName = useMemo(() => getComponentClassName("af-apollo-accordion", className, variant), [className, variant]);
10
- return (_jsx(AccordionCoreComponent, { className: componentClassName, summary: _jsxs(_Fragment, { children: [icon && (_jsx(IconComponent, { role: "presentation", src: icon, variant: "primary", size: "S", className: "af-accordion__icon" })), title && _jsx("p", { className: "af-accordion__title", children: title }), subtitle && _jsx("p", { className: "af-accordion__subtitle", children: subtitle }), _jsx(AccordionTagDateContainerComponent, { tagLabel: tagLabel, dateLabel: dateLabel, tagProps: tagProps, dateProps: dateProps }), info1 && _jsx("p", { className: "af-accordion__info1", children: info1 }), info2 && _jsx("p", { className: "af-accordion__info2", children: info2 })] }), ...accordionCoreProps, children: children }));
10
+ return (_jsx(AccordionCoreComponent, { className: componentClassName, summary: _jsxs(_Fragment, { children: [icon ? (_jsx(IconComponent, { role: "presentation", src: icon, variant: "primary", size: "S", className: "af-accordion__icon" })) : null, title ? _jsx("p", { className: "af-accordion__title", children: title }) : null, subtitle ? (_jsx("p", { className: "af-accordion__subtitle", children: subtitle })) : null, _jsx(AccordionTagDateContainerComponent, { tagLabel: tagLabel, dateLabel: dateLabel, tagProps: tagProps, dateProps: dateProps }), info1 ? _jsx("p", { className: "af-accordion__info1", children: info1 }) : null, info2 ? _jsx("p", { className: "af-accordion__info2", children: info2 }) : null] }), ...accordionCoreProps, children: children }));
11
11
  };
@@ -5,5 +5,5 @@ export const AccordionTagDateContainerCommon = ({ dateLabel, dateProps, tagLabel
5
5
  if (!isShowing) {
6
6
  return null;
7
7
  }
8
- return (_jsxs(_Fragment, { children: [tagLabel && (_jsx("div", { className: "af-accordion__tag-container", children: _jsx(TagComponent, { variant: "warning", ...tagProps, children: tagLabel }) })), dateLabel && (_jsx("time", { className: "af-accordion__date", ...dateProps, children: dateLabel }))] }));
8
+ return (_jsxs(_Fragment, { children: [tagLabel ? (_jsx("div", { className: "af-accordion__tag-container", children: _jsx(TagComponent, { variant: "warning", ...tagProps, children: tagLabel }) })) : null, dateLabel ? (_jsx("time", { className: "af-accordion__date", ...dateProps, children: dateLabel })) : null] }));
9
9
  };
@@ -10,4 +10,4 @@ export const buttonVariants = {
10
10
  };
11
11
  export const ButtonCommon = ({ children, className, variant = "primary", iconLeft, iconRight, disabled, loading, SpinnerComponent, ...args }) => (_jsxs("button", { className: ["af-btn-client", `af-btn-client--${variant}`, className]
12
12
  .filter(Boolean)
13
- .join(" "), disabled: disabled || loading, type: "button", ...args, children: [iconLeft, children, iconRight, (disabled || loading) && _jsx(SpinnerComponent, { size: 24, variant: "gray" })] }));
13
+ .join(" "), disabled: disabled || loading, type: "button", ...args, children: [iconLeft, children, iconRight, disabled || loading ? _jsx(SpinnerComponent, { size: 24, variant: "gray" }) : null] }));
@@ -11,5 +11,5 @@ export const CardMessage = ({ variant = "info", title, text, className, ...props
11
11
  const componentClassName = useMemo(() => {
12
12
  return getComponentClassName("af-card-message", className, variant);
13
13
  }, [className, variant]);
14
- return (_jsxs("div", { ...props, className: componentClassName, children: [title && _jsx("span", { className: "af-card-message--title", children: title }), _jsx("span", { className: "af-card-message--text", children: text })] }));
14
+ 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
15
  };
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  export const ContentItemMonoCore = ({ size = "medium", leftComponent, title, primarySubtitle, subtitle, }) => {
3
- return (_jsxs("div", { "data-testid": "container", className: `af-content-item-mono ${size}`, children: [leftComponent, _jsxs("div", { className: "text-content", children: [_jsx("span", { className: "title", children: title }), primarySubtitle && (_jsx("span", { className: "subtitle-primary", children: primarySubtitle })), subtitle && _jsx("span", { className: "subtitle", children: subtitle })] })] }));
3
+ return (_jsxs("div", { "data-testid": "container", className: `af-content-item-mono ${size}`, children: [leftComponent, _jsxs("div", { className: "text-content", children: [_jsx("span", { className: "title", children: title }), primarySubtitle ? (_jsx("span", { className: "subtitle-primary", children: primarySubtitle })) : null, subtitle ? _jsx("span", { className: "subtitle", children: subtitle }) : null] })] }));
4
4
  };
@@ -6,7 +6,7 @@ import { BREAKPOINT } from "../utilities/constants";
6
6
  export const DataAgentCommon = ({ className, agentProps, agentContractProps, contents, clickContents, texteOrias, DividerComponent, ContentItemMonoComponent, ClickItemComponent, }) => {
7
7
  const componentClassName = useMemo(() => getComponentClassName("af-data-agent", className), [className]);
8
8
  const isMobile = useIsSmallScreen(BREAKPOINT.SM);
9
- const renderForDefaultLayout = () => (_jsxs(_Fragment, { children: [_jsxs("section", { className: "af-data-agent__intro", children: [_jsx(ContentItemMonoComponent, { ...agentProps, type: "picture" }), agentContractProps && (_jsx(ContentItemMonoComponent, { ...agentContractProps, type: "stick" }))] }), _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()}`))) })), 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()}`))) })), Boolean(texteOrias) && (_jsx("p", { className: "af-data-agent__text-orias", children: texteOrias }))] }));
9
+ 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 }))] }));
10
10
  const renderForMobileLayout = () => (_jsx("section", { className: "af-data-agent__intro", children: _jsx(ClickItemComponent, { ...agentProps, basePictureProps: {
11
11
  src: agentProps.picture,
12
12
  alt: agentProps.title,
@@ -10,6 +10,6 @@ export const CardCheckboxCommon = ({ className, labelGroup, descriptionGroup, Ch
10
10
  const errorId = useId();
11
11
  const isMobile = useIsSmallScreen(BREAKPOINT.SM);
12
12
  const size = isMobile ? "M" : "L";
13
- return (_jsxs("fieldset", { className: componentClassName, children: [labelGroup && (_jsxs("legend", { className: "af-card-checkbox__legend", children: [_jsxs("p", { children: [labelGroup, isRequired && _jsx("span", { "aria-hidden": true, children: "\u00A0*" })] }), descriptionGroup && (_jsx("p", { className: "af-card-checkbox__description", children: descriptionGroup }))] })), _jsxs("div", { className: "af-card-checkbox__choices", children: [_jsx("ul", { className: checkboxGroupClassName, children: options.map(({ hasError, ...optionProps }) => (_jsx("li", { children: _jsx(CardCheckboxItem, { ...inputProps, size: size, errorId: errorId, onChange: onChange, CheckboxComponent: CheckboxComponent, IconComponent: IconComponent, hasError: Boolean(error) || hasError, ...optionProps }) }, crypto.randomUUID()))) }), _jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" })] })] }));
13
+ return (_jsxs("fieldset", { className: componentClassName, children: [labelGroup ? (_jsxs("legend", { className: "af-card-checkbox__legend", children: [_jsxs("p", { children: [labelGroup, isRequired ? _jsx("span", { "aria-hidden": true, children: "\u00A0*" }) : null] }), descriptionGroup ? (_jsx("p", { className: "af-card-checkbox__description", children: descriptionGroup })) : null] })) : null, _jsxs("div", { className: "af-card-checkbox__choices", children: [_jsx("ul", { className: checkboxGroupClassName, children: options.map(({ hasError, ...optionProps }) => (_jsx("li", { children: _jsx(CardCheckboxItem, { ...inputProps, size: size, errorId: errorId, onChange: onChange, CheckboxComponent: CheckboxComponent, IconComponent: IconComponent, hasError: Boolean(error) || hasError, ...optionProps }) }, crypto.randomUUID()))) }), _jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" })] })] }));
14
14
  };
15
15
  CardCheckboxCommon.displayName = "CardCheckboxCommon";
@@ -3,5 +3,5 @@ import { useId } from "react";
3
3
  export const CardCheckboxItem = ({ CheckboxComponent, IconComponent, id, label, description, subtitle, icon, errorId, hasError, size, ...inputProps }) => {
4
4
  let inputId = useId();
5
5
  inputId = id ?? inputId;
6
- return (_jsxs("label", { htmlFor: inputId, className: "af-card-checkbox-label", "aria-invalid": hasError, children: [_jsx(CheckboxComponent, { id: inputId, errorId: errorId, hasError: hasError, ...inputProps }), _jsxs("div", { className: "af-card-checkbox-content", children: [icon && _jsx(IconComponent, { src: icon, size: size }), _jsxs("div", { className: "af-card-checkbox-content-description", children: [_jsx("span", { children: label }), description && _jsx("span", { children: description }), subtitle && _jsx("span", { children: subtitle })] })] })] }));
6
+ return (_jsxs("label", { htmlFor: inputId, className: "af-card-checkbox-label", "aria-invalid": hasError, children: [_jsx(CheckboxComponent, { id: inputId, errorId: errorId, hasError: hasError, ...inputProps }), _jsxs("div", { className: "af-card-checkbox-content", children: [icon ? _jsx(IconComponent, { src: icon, size: size }) : null, _jsxs("div", { className: "af-card-checkbox-content-description", children: [_jsx("span", { children: label }), description ? _jsx("span", { children: description }) : null, subtitle ? _jsx("span", { children: subtitle }) : null] })] })] }));
7
7
  };
@@ -6,7 +6,7 @@ const Dropdown = forwardRef(({ id, required, label, error, placeholder, children
6
6
  let inputId = useId();
7
7
  inputId = id || inputId;
8
8
  const classname = classNames("af-form__dropdown-input", error && "af-form__dropdown-input--error");
9
- return (_jsxs("div", { children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId }), _jsxs("select", { className: classname, ...otherProps, ref: inputRef, id: inputId, children: [Boolean(placeholder) && (_jsx("option", { disabled: true, value: "", children: placeholder })), children] }), helper && _jsx("span", { className: "af-form__input-helper", children: helper }), _jsx(ItemMessageComponent, { id: idMessage, message: error || success, messageType: error ? "error" : "success" })] }));
9
+ return (_jsxs("div", { children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId }), _jsxs("select", { className: classname, ...otherProps, ref: inputRef, id: inputId, children: [Boolean(placeholder) && (_jsx("option", { disabled: true, value: "", children: placeholder })), children] }), helper ? (_jsx("span", { className: "af-form__input-helper", children: helper })) : null, _jsx(ItemMessageComponent, { id: idMessage, message: error || success, messageType: error ? "error" : "success" })] }));
10
10
  });
11
11
  Dropdown.displayName = "Dropdown";
12
12
  export { Dropdown };
@@ -9,7 +9,7 @@ const InputDate = forwardRef(({ className, classModifier = "", defaultValue, val
9
9
  const idMessage = useId();
10
10
  const idHelp = useId();
11
11
  const ariaDescribedby = [helper && idHelp, success && idMessage].filter(Boolean);
12
- return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, required: required, inputId: inputId }), _jsx("input", { ...otherProps, id: inputId, className: componentClassName, type: "date", ref: inputRef, defaultValue: formatInputDateValue(defaultValue), value: formatInputDateValue(value), "aria-errormessage": ariaErrormessage ?? (error ? idMessage : undefined), "aria-invalid": Boolean(error ?? ariaErrormessage), "aria-describedby": ariaDescribedby.length > 0 ? ariaDescribedby.join(" ") : undefined, required: required, min: formatInputDateValue(min), max: formatInputDateValue(max) }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })), _jsx(ItemMessageComponent, { id: idMessage, message: error || success, messageType: error ? "error" : "success" })] }));
12
+ return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, required: required, inputId: inputId }), _jsx("input", { ...otherProps, id: inputId, className: componentClassName, type: "date", ref: inputRef, defaultValue: formatInputDateValue(defaultValue), value: formatInputDateValue(value), "aria-errormessage": ariaErrormessage ?? (error ? idMessage : undefined), "aria-invalid": Boolean(error ?? ariaErrormessage), "aria-describedby": ariaDescribedby.length > 0 ? ariaDescribedby.join(" ") : undefined, required: required, min: formatInputDateValue(min), max: formatInputDateValue(max) }), helper ? (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })) : null, _jsx(ItemMessageComponent, { id: idMessage, message: error || success, messageType: error ? "error" : "success" })] }));
13
13
  });
14
14
  InputDate.displayName = "InputDate";
15
15
  export { InputDate };
@@ -25,7 +25,7 @@ const InputPhoneCommon = forwardRef(({ className, classModifier = "", helper, er
25
25
  const maskedValue = mask(rawValue);
26
26
  onChangeInput?.(maskedValue);
27
27
  };
28
- return (_jsxs("div", { className: "af-form__input-phone-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId }), _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 }) })), _jsx(InputTextComponent, { ...otherProps, className: componentClassName, ref: inputRef, error: error, type: "tel", required: required, placeholder: otherProps.placeholder, "aria-errormessage": ariaErrormessage, value: otherProps.value, onChange: handleChangeNumber, disabled: disabled, idMessage: error ? idMessage : undefined, idHelp: ariaDescribedby.length > 0 ? ariaDescribedby.join(" ") : undefined, id: inputId })] }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-phone-helper", children: helper })), _jsx(ItemMessageComponent, { id: idMessage, message: error || success, messageType: error ? "error" : "success" })] }));
28
+ return (_jsxs("div", { className: "af-form__input-phone-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId }), _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: componentClassName, ref: inputRef, error: error, type: "tel", required: required, placeholder: otherProps.placeholder, "aria-errormessage": ariaErrormessage, value: otherProps.value, onChange: handleChangeNumber, disabled: disabled, idMessage: error ? 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: error || success, messageType: error ? "error" : "success" })] }));
29
29
  });
30
30
  InputPhoneCommon.displayName = "InputPhone";
31
31
  export { InputPhoneCommon };
@@ -8,7 +8,7 @@ const InputText = forwardRef(({ unit, className, classModifier = "", helper, err
8
8
  const idMessage = useId();
9
9
  const idHelp = useId();
10
10
  const ariaDescribedby = [helper && idHelp, success && idMessage].filter(Boolean);
11
- return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId }), _jsx(InputTextAtomComponent, { id: inputId, ref: inputRef, unit: unit, className: componentClassName, error: error, required: required, idMessage: error ? idMessage : undefined, idHelp: ariaDescribedby.length > 0 ? ariaDescribedby.join(" ") : undefined, ...otherProps }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })), _jsx(ItemMessageComponent, { id: idMessage, message: error || success, messageType: error ? "error" : "success" })] }));
11
+ return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId }), _jsx(InputTextAtomComponent, { id: inputId, ref: inputRef, unit: unit, className: componentClassName, error: error, required: required, idMessage: error ? idMessage : undefined, idHelp: ariaDescribedby.length > 0 ? ariaDescribedby.join(" ") : undefined, ...otherProps }), helper ? (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })) : null, _jsx(ItemMessageComponent, { id: idMessage, message: error || success, messageType: error ? "error" : "success" })] }));
12
12
  });
13
13
  InputText.displayName = "InputText";
14
14
  export { InputText };
@@ -7,5 +7,5 @@ export const ItemLabel = ({ label, description, required, inputId, sideButtonLab
7
7
  if (!label && !description && !buttonLabel && !sideButtonLabel) {
8
8
  return null;
9
9
  }
10
- return (_jsxs("div", { className: "af-item-label", children: [label && (_jsxs("label", { htmlFor: inputId, "aria-describedby": description ? idDescription : undefined, className: "af-item-label__label", children: [label, " ", required && _jsx("span", { "aria-hidden": true, children: " *" })] })), sideButtonLabel && (_jsx(ButtonComponent, { variant: "ghost", onClick: onSideButtonClick, className: "af-item-label__sidebutton", children: sideButtonLabel })), description && (_jsx("span", { id: idDescription, className: "af-item-label__description", children: description })), buttonLabel && (_jsx(ButtonComponent, { className: "af-item-label__more", variant: "ghost", iconLeft: _jsx(Svg, { src: infoIcon, "aria-hidden": "true" }), onClick: onButtonClick, children: buttonLabel }))] }));
10
+ return (_jsxs("div", { className: "af-item-label", children: [label ? (_jsxs("label", { htmlFor: inputId, "aria-describedby": description ? idDescription : undefined, className: "af-item-label__label", children: [label, " ", required ? _jsx("span", { "aria-hidden": true, children: " *" }) : null] })) : null, sideButtonLabel ? (_jsx(ButtonComponent, { variant: "ghost", onClick: onSideButtonClick, className: "af-item-label__sidebutton", children: sideButtonLabel })) : null, description ? (_jsx("span", { id: idDescription, className: "af-item-label__description", children: description })) : null, buttonLabel ? (_jsx(ButtonComponent, { className: "af-item-label__more", variant: "ghost", iconLeft: _jsx(Svg, { src: infoIcon, "aria-hidden": "true" }), onClick: onButtonClick, children: buttonLabel })) : null] }));
11
11
  };
@@ -1,5 +1,6 @@
1
+ import type { ReactNode } from "react";
1
2
  type ItemMessageProps = {
2
- message?: string;
3
+ message?: ReactNode;
3
4
  id?: string;
4
5
  messageType?: "error" | "success";
5
6
  };
@@ -1,5 +1,5 @@
1
- import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadio/CardRadioApollo.scss";
2
1
  import { type CardRadioProps } from "./CardRadioCommon";
2
+ import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadio/CardRadioApollo.scss";
3
3
  export declare const CardRadio: {
4
4
  (props: CardRadioProps): import("react/jsx-runtime").JSX.Element;
5
5
  displayName: string;
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadio/CardRadioApollo.scss";
3
- import { Icon } from "../../../Icon/IconApollo";
2
+ import { CardRadioOption } from "../CardRadioOption/CardRadioOptionApollo";
4
3
  import { CardRadioCommon } from "./CardRadioCommon";
5
- import { Radio } from "../Radio/RadioApollo";
6
4
  import { ItemMessage } from "../../ItemMessage/ItemMessageApollo";
7
- export const CardRadio = (props) => (_jsx(CardRadioCommon, { ...props, IconComponent: Icon, RadioComponent: Radio, ItemMessageComponent: ItemMessage }));
5
+ import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadio/CardRadioApollo.scss";
6
+ export const CardRadio = (props) => (_jsx(CardRadioCommon, { ...props, CardRadioOptionComponent: CardRadioOption, ItemMessageComponent: ItemMessage }));
8
7
  CardRadio.displayName = "CardRadio";
@@ -1,21 +1,36 @@
1
- import { type ComponentProps, type ComponentType } from "react";
1
+ import { type ComponentProps, type ComponentType, type PropsWithChildren, type ReactNode } from "react";
2
2
  import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
3
- import type { Radio } from "../Radio/RadioCommon";
4
- import type { IconComponent, RadioComponent, TCardRadioItemOption } from "./types";
5
- export type CardRadioProps = Omit<ComponentProps<typeof Radio>, "size"> & {
6
- type: "vertical" | "horizontal";
3
+ import { type CardRadioOptionProps } from "../CardRadioOption/CardRadioOptionCommon";
4
+ type RadioOption = Omit<CardRadioOptionProps, "name" | "type" | "isInvalid">;
5
+ export type CardRadioProps = Omit<CardRadioOptionProps, "value" | "label" | "type" | "isInvalid" | "icon" | "description" | "subtitle" | "children"> & {
6
+ type?: "vertical" | "horizontal";
7
+ /**
8
+ * @deprecated Use `label` instead.
9
+ */
7
10
  labelGroup?: string;
11
+ /**
12
+ * @deprecated Use `description` instead.
13
+ */
8
14
  descriptionGroup?: string;
15
+ label: ReactNode;
16
+ description?: ReactNode;
17
+ /**
18
+ * @deprecated Use `required` instead.
19
+ */
9
20
  isRequired?: boolean;
21
+ /**
22
+ * @deprecated This prop is deprecated. To check an option, use the `checked` property in each item of the `options` array.
23
+ */
10
24
  value?: number | string;
11
- options: TCardRadioItemOption[];
12
- error?: string;
13
- };
14
- export type CardRadioCommonProps = CardRadioProps & RadioComponent & IconComponent & {
25
+ options: RadioOption[];
26
+ error?: ReactNode;
27
+ } & PropsWithChildren;
28
+ export type CardRadioCommonProps = CardRadioProps & {
29
+ CardRadioOptionComponent: ComponentType<CardRadioOptionProps>;
15
30
  ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
16
31
  };
17
- declare const CardRadioCommon: {
18
- ({ className, labelGroup, descriptionGroup, RadioComponent, IconComponent, isRequired, options, type, error, name, value, onChange, ItemMessageComponent, ...inputProps }: CardRadioCommonProps): import("react/jsx-runtime").JSX.Element;
32
+ export declare const CardRadioCommon: {
33
+ ({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, type, error, name, value, id, CardRadioOptionComponent, ItemMessageComponent, ...inputProps }: CardRadioCommonProps): import("react/jsx-runtime").JSX.Element;
19
34
  displayName: string;
20
35
  };
21
- export { CardRadioCommon };
36
+ export {};
@@ -1,21 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useId } from "react";
3
- import { BREAKPOINT } from "../../../utilities/constants";
4
- import { getComponentClassName } from "../../../utilities/getComponentClassName";
5
- import { useIsSmallScreen } from "../../../utilities/hook/useIsSmallScreen";
6
- import { CardRadioItem } from "./CardRadioItem";
7
- const CardRadioCommon = ({ className, labelGroup, descriptionGroup, RadioComponent, IconComponent, isRequired, options, type = "vertical", error, name, value, onChange, ItemMessageComponent, ...inputProps }) => {
8
- const componentClassName = getComponentClassName("af-card-radio__container", className);
9
- const RadioGroupClassName = getComponentClassName("af-card-radio-group", className, type);
10
- const cardRadioId = useId();
11
- const errorId = `${cardRadioId}:error`;
12
- const isMobile = useIsSmallScreen(BREAKPOINT.SM);
13
- const size = isMobile
14
- ? "M"
15
- : "L";
16
- return (_jsxs("fieldset", { className: componentClassName, "aria-invalid": Boolean(error), "aria-errormessage": error ? errorId : undefined, children: [labelGroup && (_jsxs("legend", { className: "af-card-radio__legend", children: [_jsxs("p", { children: [labelGroup, isRequired && _jsx("span", { "aria-hidden": true, children: "\u00A0*" })] }), descriptionGroup && (_jsx("p", { className: "af-card-radio__description", children: descriptionGroup }))] })), _jsx("div", { className: RadioGroupClassName, children: options.map((cardRadioItemProps) => (_jsx(CardRadioItem, { name: name, onChange: onChange, size: size, RadioComponent: RadioComponent, IconComponent: IconComponent, isInvalid: Boolean(error), checked: value !== undefined
2
+ import { useId, } from "react";
3
+ export const CardRadioCommon = ({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, type = "vertical", error, name, value, id, CardRadioOptionComponent, ItemMessageComponent, ...inputProps }) => {
4
+ const generatedId = useId();
5
+ const cardRadioId = id ?? generatedId;
6
+ const errorId = `${cardRadioId}-error`;
7
+ return (_jsxs("fieldset", { className: ["af-card-radio", className].filter(Boolean).join(" "), role: "radiogroup", "aria-required": required ? true : undefined, "aria-invalid": error ? true : undefined, "aria-errormessage": error ? errorId : undefined, id: cardRadioId, children: [_jsxs("legend", { className: "af-card-radio__legend", children: [_jsxs("p", { className: "af-card-radio__label", children: [label, labelGroup, required || isRequired ? _jsx("span", { "aria-hidden": true, children: "*" }) : null] }), description || descriptionGroup ? (_jsxs("p", { className: "af-card-radio__description", children: [description, descriptionGroup] })) : null] }), _jsx("div", { className: [
8
+ "af-card-radio__options",
9
+ `af-card-radio__options--${type}`,
10
+ ].join(" "), children: options.map((cardRadioItemProps) => (_jsx(CardRadioOptionComponent, { id: `${cardRadioId}-${cardRadioItemProps.value}`, checked: value !== undefined
17
11
  ? value === cardRadioItemProps.value
18
- : undefined, ...inputProps, ...cardRadioItemProps }, `${name ?? cardRadioId}-${cardRadioItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" })] }));
12
+ : undefined, ...inputProps, ...cardRadioItemProps, type: type, isInvalid: Boolean(error), name: name }, `${name ?? cardRadioId}-${cardRadioItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" })] }));
19
13
  };
20
14
  CardRadioCommon.displayName = "CardRadioCommon";
21
- export { CardRadioCommon };
@@ -1,5 +1,5 @@
1
- import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadio/CardRadioLF.scss";
2
1
  import { type CardRadioProps } from "./CardRadioCommon";
2
+ import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadio/CardRadioLF.scss";
3
3
  export declare const CardRadio: {
4
4
  (props: CardRadioProps): import("react/jsx-runtime").JSX.Element;
5
5
  displayName: string;
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadio/CardRadioLF.scss";
3
- import { Icon } from "../../../Icon/IconLF";
2
+ import { CardRadioOption } from "../CardRadioOption/CardRadioOptionLF";
4
3
  import { CardRadioCommon } from "./CardRadioCommon";
5
- import { Radio } from "../Radio/RadioLF";
6
4
  import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
7
- export const CardRadio = (props) => (_jsx(CardRadioCommon, { ...props, IconComponent: Icon, RadioComponent: Radio, ItemMessageComponent: ItemMessage }));
5
+ import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadio/CardRadioLF.scss";
6
+ export const CardRadio = (props) => (_jsx(CardRadioCommon, { ...props, CardRadioOptionComponent: CardRadioOption, ItemMessageComponent: ItemMessage }));
8
7
  CardRadio.displayName = "CardRadio";
@@ -0,0 +1,3 @@
1
+ import { type CardRadioOptionProps } from "./CardRadioOptionCommon";
2
+ import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadioOption/CardRadioOptionApollo.scss";
3
+ export declare const CardRadioOption: (props: CardRadioOptionProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Icon } from "../../../Icon/IconApollo";
3
+ import { Radio } from "../Radio/RadioApollo";
4
+ import { CardRadioOptionCommon, } from "./CardRadioOptionCommon";
5
+ import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadioOption/CardRadioOptionApollo.scss";
6
+ export const CardRadioOption = (props) => (_jsx(CardRadioOptionCommon, { ...props, RadioComponent: Radio, IconComponent: Icon }));
@@ -0,0 +1,15 @@
1
+ import { type ComponentProps, type ComponentType, type ReactNode } from "react";
2
+ import type { Icon as IconCommon } from "../../../Icon/IconCommon";
3
+ import type { Radio } from "../Radio/RadioCommon";
4
+ export type CardRadioOptionProps = Omit<ComponentProps<typeof Radio>, "size"> & {
5
+ label: ReactNode;
6
+ type?: "vertical" | "horizontal";
7
+ description?: ReactNode;
8
+ subtitle?: ReactNode;
9
+ icon?: ComponentProps<typeof IconCommon>["src"];
10
+ };
11
+ export type CardRadioOptionCommonProps = CardRadioOptionProps & {
12
+ RadioComponent: ComponentType<ComponentProps<typeof Radio>>;
13
+ IconComponent: ComponentType<ComponentProps<typeof IconCommon>>;
14
+ };
15
+ export declare const CardRadioOptionCommon: import("react").ForwardRefExoticComponent<Omit<CardRadioOptionCommonProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, } from "react";
3
+ export const CardRadioOptionCommon = forwardRef(({ label, type = "vertical", description, subtitle, icon, isInvalid, className, RadioComponent, IconComponent, ...inputProps }, ref) => (_jsxs("label", { className: [
4
+ "af-card-radio-option",
5
+ isInvalid && "af-card-radio-option--invalid",
6
+ type === "horizontal" && "af-card-radio-option--horizontal",
7
+ className,
8
+ ]
9
+ .filter(Boolean)
10
+ .join(" "), children: [icon ? _jsx(IconComponent, { src: icon, role: "presentation" }) : null, _jsxs("div", { className: "af-card-radio-option__content", children: [_jsx("p", { className: "af-card-radio-option__label", children: label }), Boolean(description) && (_jsx("p", { className: "af-card-radio-option__description", children: description })), Boolean(subtitle) && (_jsx("p", { className: "af-card-radio-option__subtitle", children: subtitle }))] }), _jsx(RadioComponent, { ...inputProps, isInvalid: isInvalid, ref: ref })] })));
11
+ CardRadioOptionCommon.displayName = "CardRadioOptionCommon";
@@ -0,0 +1,3 @@
1
+ import { type CardRadioOptionProps } from "./CardRadioOptionCommon";
2
+ import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadioOption/CardRadioOptionLF.scss";
3
+ export declare const CardRadioOption: (props: CardRadioOptionProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Icon } from "../../../Icon/IconLF";
3
+ import { Radio } from "../Radio/RadioLF";
4
+ import { CardRadioOptionCommon, } from "./CardRadioOptionCommon";
5
+ import "@axa-fr/design-system-apollo-css/dist/Form/Radio/CardRadioOption/CardRadioOptionLF.scss";
6
+ export const CardRadioOption = (props) => (_jsx(CardRadioOptionCommon, { ...props, RadioComponent: Radio, IconComponent: Icon }));
@@ -19,7 +19,7 @@ export declare const TextArea: import("react").ForwardRefExoticComponent<Omit<Om
19
19
  ItemMessageComponent: import("react").ComponentType<ComponentProps<typeof ItemMessage>>;
20
20
  onButtonClick?: import("react").MouseEventHandler<HTMLButtonElement>;
21
21
  } & Partial<{
22
- message?: string;
22
+ message?: import("react").ReactNode;
23
23
  id?: string;
24
24
  messageType?: "error" | "success";
25
25
  }>, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>, "ItemMessageComponent" | "ItemLabelComponent">, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -7,7 +7,7 @@ const TextArea = forwardRef(({ className, classModifier = "", label, description
7
7
  inputId = otherProps.id || inputId;
8
8
  const idHelp = useId();
9
9
  const idError = useId();
10
- return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId }), _jsx("textarea", { id: inputId, className: componentClassName, ref: inputRef, "aria-errormessage": error ? idError : undefined, "aria-describedby": helper ? idHelp : undefined, "aria-invalid": Boolean(error), ...otherProps }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })), _jsx(ItemMessageComponent, { id: idError, message: error })] }));
10
+ return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId }), _jsx("textarea", { id: inputId, className: componentClassName, ref: inputRef, "aria-errormessage": error ? idError : undefined, "aria-describedby": helper ? idHelp : undefined, "aria-invalid": Boolean(error), ...otherProps }), helper ? (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })) : null, _jsx(ItemMessageComponent, { id: idError, message: error })] }));
11
11
  });
12
12
  TextArea.displayName = "TextArea";
13
13
  export { TextArea };
@@ -19,7 +19,7 @@ export declare const TextArea: import("react").ForwardRefExoticComponent<Omit<Om
19
19
  ItemMessageComponent: import("react").ComponentType<ComponentProps<typeof ItemMessage>>;
20
20
  onButtonClick?: import("react").MouseEventHandler<HTMLButtonElement>;
21
21
  } & Partial<{
22
- message?: string;
22
+ message?: import("react").ReactNode;
23
23
  id?: string;
24
24
  messageType?: "error" | "success";
25
25
  }>, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>, "ItemMessageComponent" | "ItemLabelComponent">, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -2,4 +2,4 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import "@axa-fr/design-system-apollo-css/dist/Heading/HeadingApollo.scss";
3
3
  import { DEFAULT_TAG_PROPS, HeadingCommon } from "./HeadingCommon";
4
4
  import { Tag } from "../Tag/TagApollo";
5
- export const Heading = ({ tag, tagProps = {}, ...props }) => (_jsx(HeadingCommon, { ...props, tag: tag && (_jsx(Tag, { ...DEFAULT_TAG_PROPS, ...tagProps, children: tag })) }));
5
+ export const Heading = ({ tag, tagProps = {}, ...props }) => (_jsx(HeadingCommon, { ...props, tag: tag ? (_jsx(Tag, { ...DEFAULT_TAG_PROPS, ...tagProps, children: tag })) : null }));
@@ -5,4 +5,4 @@ import { HeadingWithSubheadings } from "./HeadingWithSubheadings";
5
5
  export const DEFAULT_TAG_PROPS = {
6
6
  variant: "neutral",
7
7
  };
8
- export const HeadingCommon = ({ children: title, className, firstSubtitle, secondSubtitle, level = 1, icon, iconProps = {}, tag, ...props }) => (_jsxs("div", { className: classNames("af-heading", className), ...props, children: [tag && level < 3 && _jsx("div", { className: "af-heading__label", children: tag }), icon && level === 1 && (_jsx(Icon, { src: icon, size: "L", hasBackground: true, variant: "secondary", ...iconProps, className: classNames("af-heading__icon", iconProps.className) })), _jsx(HeadingWithSubheadings, { title: title, firstSubtitle: firstSubtitle, titleComponent: `h${level}`, secondSubtitle: secondSubtitle })] }));
8
+ export const HeadingCommon = ({ children: title, className, firstSubtitle, secondSubtitle, level = 1, icon, iconProps = {}, tag, ...props }) => (_jsxs("div", { className: classNames("af-heading", className), ...props, children: [tag && level < 3 ? _jsx("div", { className: "af-heading__label", children: tag }) : null, icon && level === 1 ? (_jsx(Icon, { src: icon, size: "L", hasBackground: true, variant: "secondary", ...iconProps, className: classNames("af-heading__icon", iconProps.className) })) : null, _jsx(HeadingWithSubheadings, { title: title, firstSubtitle: firstSubtitle, titleComponent: `h${level}`, secondSubtitle: secondSubtitle })] }));
@@ -2,4 +2,4 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import "@axa-fr/design-system-apollo-css/dist/Heading/HeadingLF.scss";
3
3
  import { DEFAULT_TAG_PROPS, HeadingCommon } from "./HeadingCommon";
4
4
  import { Tag } from "../Tag/TagLF";
5
- export const Heading = ({ tag, tagProps = {}, ...props }) => (_jsx(HeadingCommon, { ...props, tag: tag && (_jsx(Tag, { ...DEFAULT_TAG_PROPS, ...tagProps, children: tag })) }));
5
+ export const Heading = ({ tag, tagProps = {}, ...props }) => (_jsx(HeadingCommon, { ...props, tag: tag ? (_jsx(Tag, { ...DEFAULT_TAG_PROPS, ...tagProps, children: tag })) : null }));
@@ -1,2 +1,2 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const HeadingWithSubheadings = ({ title, firstSubtitle, secondSubtitle, titleComponent: TitleComponent = "h1", }) => (_jsxs("hgroup", { className: "af-heading__title-container", children: [_jsx(TitleComponent, { className: "af-heading__title", children: title }), firstSubtitle && _jsx("p", { className: "af-heading__subtitle", children: firstSubtitle }), TitleComponent === "h1" && secondSubtitle && (_jsx("p", { className: "af-heading__subtitle", children: secondSubtitle }))] }));
2
+ export const HeadingWithSubheadings = ({ title, firstSubtitle, secondSubtitle, titleComponent: TitleComponent = "h1", }) => (_jsxs("hgroup", { className: "af-heading__title-container", children: [_jsx(TitleComponent, { className: "af-heading__title", children: title }), firstSubtitle ? (_jsx("p", { className: "af-heading__subtitle", children: firstSubtitle })) : null, TitleComponent === "h1" && secondSubtitle ? (_jsx("p", { className: "af-heading__subtitle", children: secondSubtitle })) : null] }));
@@ -14,6 +14,7 @@ export const Link = ({ href, variant = "underline", openInNewTab = false, leftIc
14
14
  rel: "noopener noreferrer",
15
15
  };
16
16
  const componentClassName = useMemo(() => getComponentClassName("af-link", className, `${classModifier}${!className && openInNewTab ? " openInNewTab" : ""} ${variant}`), [classModifier, className, openInNewTab, variant]);
17
- return (_jsxs("a", { className: componentClassName, href: href, ...newTabProps, ...props, children: [leftIcon, children, (openInNewTab || Boolean(rightIcon)) &&
18
- (rightIcon ?? _jsx(Svg, { src: openInNew }))] }));
17
+ return (_jsxs("a", { className: componentClassName, href: href, ...newTabProps, ...props, children: [leftIcon, children, openInNewTab || Boolean(rightIcon)
18
+ ? (rightIcon ?? _jsx(Svg, { src: openInNew }))
19
+ : null] }));
19
20
  };
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  export const ClickItemContentCommon = ({ title, subtitle, textSecondary, textTertiary, tagLabel, tagProps, TagComponent, }) => {
3
- return (_jsxs(_Fragment, { children: [_jsx("p", { className: "af-apollo-click-item__title", children: title }), subtitle && _jsx("p", { className: "af-apollo-click-item__subtitle", children: subtitle }), textSecondary && (_jsx("p", { className: "af-apollo-click-item__secondary", children: textSecondary })), textTertiary && (_jsx("p", { className: "af-apollo-click-item__tertiary", children: textTertiary })), tagLabel && (_jsx("div", { className: "af-apollo-click-item__tag-container", children: _jsx(TagComponent, { ...tagProps, children: tagLabel }) }))] }));
3
+ return (_jsxs(_Fragment, { children: [_jsx("p", { className: "af-apollo-click-item__title", children: title }), subtitle ? (_jsx("p", { className: "af-apollo-click-item__subtitle", children: subtitle })) : null, textSecondary ? (_jsx("p", { className: "af-apollo-click-item__secondary", children: textSecondary })) : null, textTertiary ? (_jsx("p", { className: "af-apollo-click-item__tertiary", children: textTertiary })) : null, tagLabel ? (_jsx("div", { className: "af-apollo-click-item__tag-container", children: _jsx(TagComponent, { ...tagProps, children: tagLabel }) })) : null] }));
4
4
  };
@@ -9,5 +9,5 @@ export const ContentItemDuo = ({ label, value, isVertical = false, className, cl
9
9
  }
10
10
  return getComponentClassName("af-content-item-duo", className, classModifiers.filter(Boolean).join(" "));
11
11
  }, [classModifier, className, isVertical]);
12
- return (_jsxs("div", { className: componentClassName, children: [_jsx("p", { className: "af-content-item-duo__label", children: label }), typeof value === "string" ? (_jsx("p", { className: "af-content-item-duo__value", children: value })) : (_jsx("div", { className: "af-content-item-duo__value", children: value })), buttonText && (_jsx("div", { className: "af-content-item-duo__button", children: _jsx(ButtonComponent, { variant: "ghost", onClick: onButtonClick, children: buttonText }) }))] }));
12
+ return (_jsxs("div", { className: componentClassName, children: [_jsx("p", { className: "af-content-item-duo__label", children: label }), typeof value === "string" ? (_jsx("p", { className: "af-content-item-duo__value", children: value })) : (_jsx("div", { className: "af-content-item-duo__value", children: value })), buttonText ? (_jsx("div", { className: "af-content-item-duo__button", children: _jsx(ButtonComponent, { variant: "ghost", onClick: onButtonClick, children: buttonText }) })) : null] }));
13
13
  };
@@ -24,5 +24,5 @@ export const Message = ({ variant = messageVariants.information, className, titl
24
24
  const icon = useMemo(() => getIconFromType(variant), [variant]);
25
25
  return (_jsxs("div", { className: ["af-message", `af-message--${variant}`, className]
26
26
  .filter(Boolean)
27
- .join(" "), role: "alert", children: [_jsx(Svg, { src: icon, width: iconSize, height: iconSize, className: "af-message__icon", role: "presentation" }), _jsxs("div", { className: "af-message__content", children: [title && _jsx(Heading, { className: "af-message__title", children: title }), children, action && _jsx("div", { className: "af-message__action", children: action })] })] }));
27
+ .join(" "), role: "alert", children: [_jsx(Svg, { src: icon, width: iconSize, height: iconSize, className: "af-message__icon", role: "presentation" }), _jsxs("div", { className: "af-message__content", children: [title ? (_jsx(Heading, { className: "af-message__title", children: title })) : null, children, action ? _jsx("div", { className: "af-message__action", children: action }) : null] })] }));
28
28
  };
@@ -1,4 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import close from "@material-symbols/svg-400/rounded/close.svg";
3
3
  import { ClickIcon } from "../../ClickIcon/ClickIconCommon";
4
- export const ModalCoreHeaderCommon = ({ className, headingComponent: HeadingComponent, headingProps, iconComponent: IconComponent, iconProps, onClose, closeButtonAriaLabel = "Fermer la boite de dialogue", ...props }) => (_jsxs("header", { className: ["af-apollo-modal__header", className].filter(Boolean).join(" "), ...props, children: [_jsx(ClickIcon, { className: "af-apollo-modal__header-close-btn", src: close, onClick: onClose, "aria-label": closeButtonAriaLabel }), _jsxs("div", { className: "af-apollo-modal__header-title", children: [IconComponent && iconProps && _jsx(IconComponent, { size: "M", ...iconProps }), _jsx(HeadingComponent, { level: 2, ...headingProps })] })] }));
4
+ export const ModalCoreHeaderCommon = ({ className, headingComponent: HeadingComponent, headingProps, iconComponent: IconComponent, iconProps, onClose, closeButtonAriaLabel = "Fermer la boite de dialogue", ...props }) => (_jsxs("header", { className: ["af-apollo-modal__header", className].filter(Boolean).join(" "), ...props, children: [_jsx(ClickIcon, { className: "af-apollo-modal__header-close-btn", src: close, onClick: onClose, "aria-label": closeButtonAriaLabel }), _jsxs("div", { className: "af-apollo-modal__header-title", children: [IconComponent && iconProps ? (_jsx(IconComponent, { size: "M", ...iconProps })) : null, _jsx(HeadingComponent, { level: 2, ...headingProps })] })] }));
package/dist/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export { ItemMessage } from "./Form/ItemMessage/ItemMessageApollo";
23
23
  export { ItemFile, itemFileVariants } from "./Form/ItemFile/ItemFileApollo";
24
24
  export { TextArea } from "./Form/TextArea/TextAreaApollo";
25
25
  export { Radio } from "./Form/Radio/Radio/RadioApollo";
26
+ export { CardRadioOption } from "./Form/Radio/CardRadioOption/CardRadioOptionApollo";
26
27
  export { CardRadio } from "./Form/Radio/CardRadio/CardRadioApollo";
27
28
  export { InputText } from "./Form/InputText/InputTextApollo";
28
29
  export { DebugGrid } from "./Grid/DebugGridApollo";
package/dist/index.js CHANGED
@@ -23,6 +23,7 @@ export { ItemMessage } from "./Form/ItemMessage/ItemMessageApollo";
23
23
  export { ItemFile, itemFileVariants } from "./Form/ItemFile/ItemFileApollo";
24
24
  export { TextArea } from "./Form/TextArea/TextAreaApollo";
25
25
  export { Radio } from "./Form/Radio/Radio/RadioApollo";
26
+ export { CardRadioOption } from "./Form/Radio/CardRadioOption/CardRadioOptionApollo";
26
27
  export { CardRadio } from "./Form/Radio/CardRadio/CardRadioApollo";
27
28
  export { InputText } from "./Form/InputText/InputTextApollo";
28
29
  export { DebugGrid } from "./Grid/DebugGridApollo";
package/dist/indexLF.d.ts CHANGED
@@ -26,6 +26,7 @@ export { ItemFile, itemFileVariants } from "./Form/ItemFile/ItemFileLF";
26
26
  export { ItemMessage } from "./Form/ItemMessage/ItemMessageLF";
27
27
  export { TextArea } from "./Form/TextArea/TextAreaLF";
28
28
  export { Radio } from "./Form/Radio/Radio/RadioLF";
29
+ export { CardRadioOption } from "./Form/Radio/CardRadioOption/CardRadioOptionLF";
29
30
  export { CardRadio } from "./Form/Radio/CardRadio/CardRadioLF";
30
31
  export { InputText,
31
32
  /** @deprecated Use `InputText` instead. */
package/dist/indexLF.js CHANGED
@@ -26,6 +26,7 @@ export { ItemFile, itemFileVariants } from "./Form/ItemFile/ItemFileLF";
26
26
  export { ItemMessage } from "./Form/ItemMessage/ItemMessageLF";
27
27
  export { TextArea } from "./Form/TextArea/TextAreaLF";
28
28
  export { Radio } from "./Form/Radio/Radio/RadioLF";
29
+ export { CardRadioOption } from "./Form/Radio/CardRadioOption/CardRadioOptionLF";
29
30
  export { CardRadio } from "./Form/Radio/CardRadio/CardRadioLF";
30
31
  export { InputText,
31
32
  /** @deprecated Use `InputText` instead. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-apollo-react",
3
- "version": "1.0.5-alpha.392",
3
+ "version": "1.0.5-alpha.398",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -46,8 +46,8 @@
46
46
  },
47
47
  "homepage": "https://github.com/AxaFrance/design-system#readme",
48
48
  "peerDependencies": {
49
- "@axa-fr/design-system-apollo-css": "1.0.5-alpha.392",
50
- "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.392",
49
+ "@axa-fr/design-system-apollo-css": "1.0.5-alpha.398",
50
+ "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.398",
51
51
  "@material-symbols/svg-400": ">= 0.19.0",
52
52
  "react": ">= 18"
53
53
  },
@@ -1,13 +0,0 @@
1
- import { type ComponentProps, type ComponentType } from "react";
2
- import type { Icon as IconCommon } from "../../../Icon/IconCommon";
3
- import type { Radio } from "../Radio/RadioCommon";
4
- export type TCardRadioItemProps = Omit<ComponentProps<typeof Radio>, "size"> & {
5
- label: string;
6
- description?: string;
7
- subtitle?: string;
8
- icon?: ComponentProps<typeof IconCommon>["src"];
9
- size: ComponentProps<typeof IconCommon>["size"];
10
- RadioComponent: ComponentType<ComponentProps<typeof Radio>>;
11
- IconComponent: ComponentType<ComponentProps<typeof IconCommon>>;
12
- };
13
- export declare const CardRadioItem: ({ label, description, subtitle, icon, size, RadioComponent, IconComponent, ...inputProps }: TCardRadioItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const CardRadioItem = ({ label, description, subtitle, icon, size, RadioComponent, IconComponent, ...inputProps }) => (_jsxs("label", { className: "af-card-radio-label", children: [_jsx(RadioComponent, { ...inputProps }), _jsxs("div", { className: "af-card-radio-content", children: [icon && _jsx(IconComponent, { src: icon, size: size, role: "presentation" }), _jsxs("div", { className: "af-card-radio-content-description", children: [_jsx("span", { children: label }), description && _jsx("span", { children: description }), subtitle && _jsx("span", { children: subtitle })] })] })] }));
@@ -1,11 +0,0 @@
1
- import type { ComponentProps, ComponentType } from "react";
2
- import type { Icon } from "../../../indexLF";
3
- import type { RadioProps } from "../Radio/RadioCommon";
4
- import type { TCardRadioItemProps } from "./CardRadioItem";
5
- export type TCardRadioItemOption = Omit<TCardRadioItemProps, "RadioComponent" | "IconComponent" | "size" | "name">;
6
- export type RadioComponent = {
7
- RadioComponent: ComponentType<RadioProps>;
8
- };
9
- export type IconComponent = {
10
- IconComponent: ComponentType<ComponentProps<typeof Icon>>;
11
- };
@@ -1 +0,0 @@
1
- export {};