@axa-fr/design-system-apollo-react 1.0.5-alpha.396 → 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.
@@ -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
  };
@@ -4,7 +4,7 @@ export const CardRadioCommon = ({ className, labelGroup, descriptionGroup, label
4
4
  const generatedId = useId();
5
5
  const cardRadioId = id ?? generatedId;
6
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: "*" })] }), (description || descriptionGroup) && (_jsxs("p", { className: "af-card-radio__description", children: [description, descriptionGroup] }))] }), _jsx("div", { className: [
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
8
  "af-card-radio__options",
9
9
  `af-card-radio__options--${type}`,
10
10
  ].join(" "), children: options.map((cardRadioItemProps) => (_jsx(CardRadioOptionComponent, { id: `${cardRadioId}-${cardRadioItemProps.value}`, checked: value !== undefined
@@ -7,5 +7,5 @@ export const CardRadioOptionCommon = forwardRef(({ label, type = "vertical", des
7
7
  className,
8
8
  ]
9
9
  .filter(Boolean)
10
- .join(" "), children: [icon && _jsx(IconComponent, { src: icon, role: "presentation" }), _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 })] })));
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
11
  CardRadioOptionCommon.displayName = "CardRadioOptionCommon";
@@ -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 };
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-apollo-react",
3
- "version": "1.0.5-alpha.396",
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.396",
50
- "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.396",
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
  },