@axa-fr/canopee-react 2.0.0-alpha.8 → 2.0.0-alpha.80
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.
- package/dist/client.d.ts +17 -17
- package/dist/client.js +17 -17
- package/dist/distributeur/Accordion/Accordion.d.ts +1 -3
- package/dist/distributeur/Accordion/Accordion.js +2 -5
- package/dist/distributeur/Accordion/CollapseCard.d.ts +1 -3
- package/dist/distributeur/Accordion/CollapseCard.js +2 -4
- package/dist/distributeur/Accordion/Header.d.ts +1 -3
- package/dist/distributeur/Accordion/Header.js +1 -2
- package/dist/distributeur/Action/Action.d.ts +1 -3
- package/dist/distributeur/Action/Action.js +2 -3
- package/dist/distributeur/Button/Button.d.ts +3 -4
- package/dist/distributeur/Button/Button.js +7 -1
- package/dist/distributeur/ButtonMultiActions/ButtonMultiActions.d.ts +10 -0
- package/dist/distributeur/ButtonMultiActions/ButtonMultiActions.js +51 -0
- package/dist/distributeur/ButtonMultiActions/index.d.ts +2 -0
- package/dist/distributeur/ButtonMultiActions/index.js +1 -0
- package/dist/distributeur/Card/BaseCard.d.ts +14 -0
- package/dist/distributeur/Card/BaseCard.js +23 -0
- package/dist/distributeur/CardButton/CardButton.d.ts +18 -0
- package/dist/distributeur/CardButton/CardButton.js +12 -0
- package/dist/distributeur/ClickableGhost.d.ts +36 -0
- package/dist/distributeur/ClickableGhost.js +26 -0
- package/dist/distributeur/Form/Checkbox/Checkbox.d.ts +1 -1
- package/dist/distributeur/Form/Checkbox/Checkbox.js +9 -4
- package/dist/distributeur/Form/Checkbox/CheckboxInput.js +2 -2
- package/dist/distributeur/Form/Checkbox/CheckboxItem.d.ts +1 -3
- package/dist/distributeur/Form/Checkbox/CheckboxItem.js +2 -2
- package/dist/distributeur/Form/Choice/Choice.d.ts +0 -2
- package/dist/distributeur/Form/Choice/ChoiceInput.js +1 -1
- package/dist/distributeur/Form/Date/Date.d.ts +2 -3
- package/dist/distributeur/Form/Date/Date.js +3 -3
- package/dist/distributeur/Form/Date/DateInput.js +1 -1
- package/dist/distributeur/Form/Experimental/DateInput.d.ts +31 -0
- package/dist/distributeur/Form/Experimental/DateInput.js +27 -0
- package/dist/distributeur/Form/Experimental/InputContainer.d.ts +4 -1
- package/dist/distributeur/Form/Experimental/InputContainer.js +2 -2
- package/dist/distributeur/Form/Experimental/InputUnit.d.ts +1 -1
- package/dist/distributeur/Form/Experimental/InputUnit.js +1 -1
- package/dist/distributeur/Form/Experimental/ItemMessage.d.ts +1 -1
- package/dist/distributeur/Form/Experimental/ItemMessage.js +1 -1
- package/dist/distributeur/Form/Experimental/Label.d.ts +1 -2
- package/dist/distributeur/Form/Experimental/Legend.d.ts +12 -0
- package/dist/distributeur/Form/Experimental/Legend.js +3 -0
- package/dist/distributeur/Form/Experimental/Radio/AddRadioCard.d.ts +7 -0
- package/dist/distributeur/Form/Experimental/Radio/AddRadioCard.js +14 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioButton.d.ts +13 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioButton.js +3 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioCard.d.ts +10 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioCard.js +13 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioGroup.d.ts +8 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioGroup.js +10 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioInput.d.ts +18 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioInput.js +34 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioItem.d.ts +4 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioItem.js +10 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioText.d.ts +6 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioText.js +3 -0
- package/dist/distributeur/Form/Experimental/Radio/_radioInputOptions.d.ts +8 -0
- package/dist/distributeur/Form/Experimental/Radio/_radioInputOptions.js +7 -0
- package/dist/distributeur/Form/Experimental/Select.d.ts +8 -0
- package/dist/distributeur/Form/Experimental/Select.js +16 -0
- package/dist/distributeur/Form/Experimental/SelectInput.d.ts +36 -0
- package/dist/distributeur/Form/Experimental/SelectInput.js +26 -0
- package/dist/distributeur/Form/Experimental/index.d.ts +11 -0
- package/dist/distributeur/Form/Experimental/index.js +9 -0
- package/dist/distributeur/Form/Experimental/types.d.ts +1 -1
- package/dist/distributeur/Form/Experimental/useInput.hook.js +1 -1
- package/dist/distributeur/Form/File/File.d.ts +1 -3
- package/dist/distributeur/Form/File/File.js +1 -2
- package/dist/distributeur/Form/File/FileInput.d.ts +3 -1
- package/dist/distributeur/Form/File/FileInput.js +2 -2
- package/dist/distributeur/Form/File/FileLine.d.ts +1 -2
- package/dist/distributeur/Form/File/FileLine.js +6 -3
- package/dist/distributeur/Form/File/FileTable.d.ts +1 -2
- package/dist/distributeur/Form/File/FileTable.js +6 -3
- package/dist/distributeur/Form/MultiSelect/MultiSelectInput.js +1 -1
- package/dist/distributeur/Form/NestedQuestion/NestedQuestion.js +7 -3
- package/dist/distributeur/Form/Number/Number.d.ts +4 -7
- package/dist/distributeur/Form/Number/Number.js +4 -5
- package/dist/distributeur/Form/Number/NumberInput.js +1 -1
- package/dist/distributeur/Form/Radio/Radio.d.ts +1 -1
- package/dist/distributeur/Form/Radio/RadioInput.js +1 -1
- package/dist/distributeur/Form/Radio/RadioItem.d.ts +1 -3
- package/dist/distributeur/Form/Radio/RadioItem.js +2 -2
- package/dist/distributeur/Form/Select/Select.d.ts +3 -19
- package/dist/distributeur/Form/Select/Select.js +3 -4
- package/dist/distributeur/Form/Select/SelectBase.d.ts +3 -24
- package/dist/distributeur/Form/Select/SelectBase.js +2 -7
- package/dist/distributeur/Form/Select/SelectDefault.d.ts +3 -3
- package/dist/distributeur/Form/Select/SelectInput.js +1 -1
- package/dist/distributeur/Form/Select/index.d.ts +0 -1
- package/dist/distributeur/Form/Select/index.js +0 -1
- package/dist/distributeur/Form/Text/Text.d.ts +2 -3
- package/dist/distributeur/Form/Text/Text.js +3 -3
- package/dist/distributeur/Form/Text/TextInput.js +1 -1
- package/dist/distributeur/Form/Textarea/Textarea.d.ts +2 -3
- package/dist/distributeur/Form/Textarea/Textarea.js +3 -3
- package/dist/distributeur/Form/Textarea/TextareaInput.js +1 -1
- package/dist/distributeur/Form/core/Field.d.ts +4 -23
- package/dist/distributeur/Form/core/Field.js +23 -16
- package/dist/distributeur/Form/core/FieldError.js +5 -2
- package/dist/distributeur/Form/core/getOptionClassName.d.ts +1 -1
- package/dist/distributeur/Form/core/getOptionClassName.js +2 -6
- package/dist/distributeur/Form/core/index.d.ts +0 -8
- package/dist/distributeur/Form/core/index.js +0 -4
- package/dist/distributeur/HelpButton/index.d.ts +1 -1
- package/dist/distributeur/HelpButton/index.js +4 -6
- package/dist/distributeur/ItemFormHelper/ItemFormHelper.d.ts +8 -0
- package/dist/distributeur/ItemFormHelper/ItemFormHelper.js +31 -0
- package/dist/distributeur/Layout/Header/Header.d.ts +1 -3
- package/dist/distributeur/Layout/Header/Header.js +1 -2
- package/dist/distributeur/Layout/Header/HeaderTitle/HeaderTitle.d.ts +1 -2
- package/dist/distributeur/Layout/Header/HeaderTitle/HeaderTitle.js +7 -4
- package/dist/distributeur/Layout/Header/Infos/Infos.d.ts +1 -3
- package/dist/distributeur/Layout/Header/Infos/Infos.js +1 -2
- package/dist/distributeur/Layout/Header/Name/Name.d.ts +1 -3
- package/dist/distributeur/Layout/Header/Name/Name.js +1 -2
- package/dist/distributeur/Layout/Header/NavBar/NavBar.js +1 -6
- package/dist/distributeur/Layout/Header/NavBar/NavBarBase.d.ts +1 -3
- package/dist/distributeur/Layout/Header/NavBar/NavBarBase.js +7 -3
- package/dist/distributeur/Layout/Header/NavBar/NavBarItem/NavBarItem.d.ts +2 -2
- package/dist/distributeur/Layout/Header/NavBar/NavBarItem/NavBarItem.js +10 -3
- package/dist/distributeur/Layout/Header/NavBar/NavBarItem/NavBarItemBase.d.ts +1 -2
- package/dist/distributeur/Layout/Header/NavBar/NavBarItem/NavBarItemBase.js +6 -3
- package/dist/distributeur/Layout/Header/User/User.d.ts +1 -11
- package/dist/distributeur/Layout/Header/User/User.js +1 -2
- package/dist/distributeur/Link/LinkAnchor.d.ts +4 -6
- package/dist/distributeur/Link/LinkAnchor.js +2 -2
- package/dist/distributeur/Messages/Message.d.ts +2 -6
- package/dist/distributeur/Messages/Message.js +3 -14
- package/dist/distributeur/ModalAgent/BooleanModal.d.ts +1 -6
- package/dist/distributeur/ModalAgent/BooleanModal.js +7 -4
- package/dist/distributeur/ModalAgent/Modal.d.ts +2 -7
- package/dist/distributeur/ModalAgent/Modal.js +7 -16
- package/dist/distributeur/ModalAgent/components/Body.d.ts +2 -5
- package/dist/distributeur/ModalAgent/components/Body.js +1 -2
- package/dist/distributeur/ModalAgent/components/Footer.d.ts +2 -5
- package/dist/distributeur/ModalAgent/components/Footer.js +1 -2
- package/dist/distributeur/ModalAgent/components/Header.d.ts +1 -11
- package/dist/distributeur/ModalAgent/components/Header.js +2 -3
- package/dist/distributeur/ModalAgent/components/HeaderBase.d.ts +2 -5
- package/dist/distributeur/ModalAgent/components/HeaderBase.js +1 -2
- package/dist/distributeur/Popover/AnimatedPopover.d.ts +1 -3
- package/dist/distributeur/Popover/AnimatedPopover.js +1 -2
- package/dist/distributeur/Popover/Popover.d.ts +1 -3
- package/dist/distributeur/Popover/Popover.js +2 -2
- package/dist/distributeur/Popover/Popover.types.d.ts +0 -2
- package/dist/distributeur/Popover/PopoverBase.d.ts +1 -3
- package/dist/distributeur/Popover/PopoverBase.js +2 -2
- package/dist/distributeur/Popover/PopoverClick.d.ts +1 -1
- package/dist/distributeur/Popover/PopoverClick.js +2 -2
- package/dist/distributeur/Popover/PopoverOver.d.ts +1 -1
- package/dist/distributeur/Popover/PopoverOver.js +2 -2
- package/dist/distributeur/Restitution/ArticleRestitution.d.ts +2 -5
- package/dist/distributeur/Restitution/ArticleRestitution.js +1 -2
- package/dist/distributeur/Restitution/HeaderRestitution.d.ts +1 -3
- package/dist/distributeur/Restitution/HeaderRestitution.js +1 -2
- package/dist/distributeur/Restitution/Restitution.d.ts +1 -3
- package/dist/distributeur/Restitution/Restitution.js +2 -2
- package/dist/distributeur/Restitution/SectionRestitution.d.ts +1 -3
- package/dist/distributeur/Restitution/SectionRestitution.js +1 -2
- package/dist/distributeur/Restitution/SectionRestitutionColumn.d.ts +1 -3
- package/dist/distributeur/Restitution/SectionRestitutionColumn.js +1 -2
- package/dist/distributeur/Restitution/SectionRestitutionRow.d.ts +1 -3
- package/dist/distributeur/Restitution/SectionRestitutionRow.js +5 -9
- package/dist/distributeur/Restitution/SectionRestitutionTitle.d.ts +1 -3
- package/dist/distributeur/Restitution/SectionRestitutionTitle.js +1 -2
- package/dist/distributeur/Steps/Step.d.ts +1 -1
- package/dist/distributeur/Steps/Step.js +4 -4
- package/dist/distributeur/Steps/StepBase.d.ts +1 -3
- package/dist/distributeur/Steps/StepBase.js +1 -2
- package/dist/distributeur/Steps/Steps.d.ts +1 -3
- package/dist/distributeur/Steps/Steps.js +1 -2
- package/dist/distributeur/Summary/index.d.ts +1 -1
- package/dist/distributeur/Summary/index.js +1 -2
- package/dist/distributeur/Table/Pagination/Items.d.ts +1 -2
- package/dist/distributeur/Table/Pagination/Items.js +8 -8
- package/dist/distributeur/Table/Pagination/Pager.d.ts +1 -2
- package/dist/distributeur/Table/Pagination/Pager.js +6 -3
- package/dist/distributeur/Table/Pagination/Paging.d.ts +1 -1
- package/dist/distributeur/Table/Pagination/Paging.js +6 -3
- package/dist/distributeur/Table/TBody.d.ts +1 -5
- package/dist/distributeur/Table/TBody.js +1 -2
- package/dist/distributeur/Table/THead.d.ts +2 -5
- package/dist/distributeur/Table/THead.js +1 -2
- package/dist/distributeur/Table/Table.d.ts +6 -33
- package/dist/distributeur/Table/Table.js +1 -10
- package/dist/distributeur/Table/Td.d.ts +1 -5
- package/dist/distributeur/Table/Td.js +1 -2
- package/dist/distributeur/Table/Th.d.ts +2 -4
- package/dist/distributeur/Table/Th.js +2 -2
- package/dist/distributeur/Table/Tr.d.ts +2 -5
- package/dist/distributeur/Table/Tr.js +1 -2
- package/dist/distributeur/Table/index.d.ts +1 -1
- package/dist/distributeur/Tabs/components/Tab.d.ts +0 -4
- package/dist/distributeur/Tabs/components/TabsStateless.d.ts +3 -7
- package/dist/distributeur/Tabs/components/TabsStateless.js +2 -2
- package/dist/distributeur/Tag/Tag.d.ts +1 -6
- package/dist/distributeur/Tag/Tag.js +2 -2
- package/dist/distributeur/Title/Title.d.ts +1 -3
- package/dist/distributeur/Title/Title.js +3 -3
- package/dist/distributeur/utilities.d.ts +1 -1
- package/dist/distributeur/utilities.js +1 -1
- package/dist/distributeur-experimental.d.ts +2 -0
- package/dist/distributeur-experimental.js +2 -0
- package/dist/distributeur.d.ts +10 -24
- package/dist/distributeur.js +9 -17
- package/dist/prospect-client/AccordionCore/AccordionCoreCommon.d.ts +3 -5
- package/dist/prospect-client/AccordionCore/AccordionCoreCommon.js +10 -4
- package/dist/prospect-client/AppName/AppName.d.ts +44 -0
- package/dist/prospect-client/AppName/AppName.js +23 -0
- package/dist/prospect-client/Card/CardApollo.d.ts +1 -1
- package/dist/prospect-client/Card/CardApollo.js +1 -1
- package/dist/prospect-client/Card/CardCommon.d.ts +30 -2
- package/dist/prospect-client/Card/CardCommon.js +18 -1
- package/dist/prospect-client/Card/CardLF.d.ts +1 -1
- package/dist/prospect-client/Card/CardLF.js +1 -1
- package/dist/prospect-client/CardMessage/CardMessageCommon.js +6 -4
- package/dist/prospect-client/ContentItemDuoAction/ContentItemDuoActionCommon.d.ts +2 -2
- package/dist/prospect-client/ContentItemDuoAction/ContentItemDuoActionCommon.js +5 -2
- package/dist/prospect-client/ContentItemMono/ContentItemMonoCommon.d.ts +0 -4
- package/dist/prospect-client/ContentItemMono/ContentItemMonoCommon.js +2 -3
- package/dist/prospect-client/DataAgent/DataAgentCommon.js +2 -2
- package/dist/prospect-client/Divider/DividerCommon.js +6 -2
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxApollo.d.ts +1 -0
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxApollo.js +1 -1
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxCommon.d.ts +2 -18
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxCommon.js +4 -4
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxLF.d.ts +1 -0
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxLF.js +1 -1
- package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.d.ts +2 -6
- package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.js +6 -2
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextApollo.js +1 -1
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.d.ts +2 -6
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.js +3 -3
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextLF.js +1 -1
- package/dist/prospect-client/Form/Dropdown/DropdownApollo.js +1 -1
- package/dist/prospect-client/Form/Dropdown/DropdownCommon.d.ts +4 -12
- package/dist/prospect-client/Form/Dropdown/DropdownCommon.js +4 -4
- package/dist/prospect-client/Form/Dropdown/DropdownLF.js +1 -1
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileApollo.js +1 -1
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileCommon.d.ts +1 -1
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileCommon.js +1 -1
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileLF.js +1 -1
- package/dist/prospect-client/Form/FileUpload/ItemFile/ItemFileApollo.js +1 -1
- package/dist/prospect-client/Form/FileUpload/ItemFile/ItemFileCommon.d.ts +1 -1
- package/dist/prospect-client/Form/FileUpload/ItemFile/ItemFileLF.js +1 -1
- package/dist/prospect-client/Form/InputDate/InputDateApollo.js +1 -1
- package/dist/prospect-client/Form/InputDate/InputDateCommon.d.ts +4 -12
- package/dist/prospect-client/Form/InputDate/InputDateCommon.js +5 -6
- package/dist/prospect-client/Form/InputDate/InputDateLF.js +1 -1
- package/dist/prospect-client/Form/InputPhone/InputPhoneApollo.js +1 -1
- package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.d.ts +4 -12
- package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.js +10 -6
- package/dist/prospect-client/Form/InputPhone/InputPhoneLF.js +1 -1
- package/dist/prospect-client/Form/InputText/InputTextApollo.js +1 -1
- package/dist/prospect-client/Form/InputText/InputTextCommon.d.ts +4 -12
- package/dist/prospect-client/Form/InputText/InputTextCommon.js +7 -6
- package/dist/prospect-client/Form/InputText/InputTextLF.js +1 -1
- package/dist/prospect-client/Form/ItemLabel/ItemLabelCommon.d.ts +2 -22
- package/dist/prospect-client/Form/ItemLabel/ItemLabelCommon.js +4 -5
- package/dist/prospect-client/Form/ItemMessage/{ItemMessageCommon.d.ts → ItemMessage.d.ts} +1 -0
- package/dist/prospect-client/Form/ItemMessage/{ItemMessageCommon.js → ItemMessage.js} +10 -9
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListApollo.d.ts +4 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListApollo.js +5 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListCommon.d.ts +11 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListCommon.js +2 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListLF.d.ts +4 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListLF.js +5 -0
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.d.ts +1 -5
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.js +4 -4
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupApollo.js +1 -1
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.d.ts +6 -30
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.js +5 -7
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF.js +1 -1
- package/dist/prospect-client/Form/Radio/Radio/RadioCommon.d.ts +2 -5
- package/dist/prospect-client/Form/Radio/Radio/RadioCommon.js +6 -4
- package/dist/prospect-client/Form/TextArea/TextAreaApollo.js +1 -1
- package/dist/prospect-client/Form/TextArea/TextAreaCommon.d.ts +4 -8
- package/dist/prospect-client/Form/TextArea/TextAreaCommon.js +4 -4
- package/dist/prospect-client/Form/TextArea/TextAreaLF.js +1 -1
- package/dist/prospect-client/Header/HeaderApollo.d.ts +4 -0
- package/dist/prospect-client/Header/HeaderApollo.js +8 -0
- package/dist/prospect-client/Header/HeaderCommon.d.ts +22 -0
- package/dist/prospect-client/Header/HeaderCommon.js +37 -0
- package/dist/prospect-client/Header/HeaderLF.d.ts +4 -0
- package/dist/prospect-client/Header/HeaderLF.js +8 -0
- package/dist/prospect-client/Icon/IconCommon.d.ts +1 -1
- package/dist/prospect-client/Icon/IconCommon.js +8 -9
- package/dist/prospect-client/ItemTabBar/ItemTabBarCommon.js +5 -2
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutApollo.d.ts +12 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutApollo.js +12 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutLF.d.ts +12 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutLF.js +12 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutSkeleton.d.ts +23 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutSkeleton.js +17 -0
- package/dist/prospect-client/Link/LinkCommon.d.ts +1 -5
- package/dist/prospect-client/Link/LinkCommon.js +2 -2
- package/dist/prospect-client/List/ClickItem/ClickItemCommon.d.ts +1 -0
- package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoApollo.js +1 -1
- package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoCommon.d.ts +3 -7
- package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoCommon.js +3 -7
- package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoLF.js +1 -1
- package/dist/prospect-client/List/List/ListCommon.d.ts +27 -2
- package/dist/prospect-client/List/List/ListCommon.js +12 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerApollo.d.ts +4 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerApollo.js +8 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerCommon.d.ts +60 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerCommon.js +34 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerLF.d.ts +4 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerLF.js +8 -0
- package/dist/prospect-client/MessageBar/MessageBarAction.d.ts +8 -0
- package/dist/prospect-client/MessageBar/MessageBarAction.js +11 -0
- package/dist/prospect-client/MessageBar/MessageBarApollo.d.ts +5 -0
- package/dist/prospect-client/MessageBar/MessageBarApollo.js +7 -0
- package/dist/prospect-client/MessageBar/MessageBarCommon.d.ts +26 -0
- package/dist/prospect-client/MessageBar/MessageBarCommon.js +33 -0
- package/dist/prospect-client/MessageBar/MessageBarDescription.d.ts +6 -0
- package/dist/prospect-client/MessageBar/MessageBarDescription.js +8 -0
- package/dist/prospect-client/MessageBar/MessageBarLF.d.ts +5 -0
- package/dist/prospect-client/MessageBar/MessageBarLF.js +7 -0
- package/dist/prospect-client/MessageBar/MessageBarSummary.d.ts +11 -0
- package/dist/prospect-client/MessageBar/MessageBarSummary.js +2 -0
- package/dist/prospect-client/MessageBar/types.d.ts +1 -0
- package/dist/prospect-client/MessageBar/types.js +1 -0
- package/dist/prospect-client/Modal/ModalApollo.d.ts +1 -1
- package/dist/prospect-client/Modal/ModalApollo.js +1 -3
- package/dist/prospect-client/Modal/ModalCommon.d.ts +1 -1
- package/dist/prospect-client/Modal/ModalCommon.js +1 -1
- package/dist/prospect-client/Modal/ModalLF.d.ts +1 -1
- package/dist/prospect-client/Modal/ModalLF.js +1 -3
- package/dist/prospect-client/Modal/components/ModalCoreHeaderCommon.d.ts +0 -7
- package/dist/prospect-client/Modal/components/ModalCoreHeaderCommon.js +2 -12
- package/dist/prospect-client/Modal/types.d.ts +0 -15
- package/dist/prospect-client/ProgressBarGroup/ProgressBarGroupCommon.d.ts +1 -5
- package/dist/prospect-client/ProgressBarGroup/ProgressBarGroupCommon.js +1 -1
- package/dist/prospect-client/Skeleton/Skeleton.d.ts +61 -0
- package/dist/prospect-client/Skeleton/Skeleton.js +41 -0
- package/dist/prospect-client/SkeletonGrid/SkeletonGrid.d.ts +51 -0
- package/dist/prospect-client/SkeletonGrid/SkeletonGrid.js +37 -0
- package/dist/prospect-client/SkeletonList/SkeletonListApollo.d.ts +7 -0
- package/dist/prospect-client/SkeletonList/SkeletonListApollo.js +8 -2
- package/dist/prospect-client/SkeletonList/SkeletonListCommon.d.ts +21 -4
- package/dist/prospect-client/SkeletonList/SkeletonListCommon.js +18 -2
- package/dist/prospect-client/SkeletonList/SkeletonListLF.d.ts +7 -0
- package/dist/prospect-client/SkeletonList/SkeletonListLF.js +8 -2
- package/dist/prospect-client/Stepper/StepperApollo.js +3 -1
- package/dist/prospect-client/Stepper/StepperCommon.d.ts +13 -7
- package/dist/prospect-client/Stepper/StepperCommon.js +3 -4
- package/dist/prospect-client/Stepper/StepperLF.js +3 -1
- package/dist/prospect-client/TabMenu/TabMenu.js +1 -1
- package/dist/prospect-client/Tag/TagCommon.js +6 -2
- package/dist/prospect-client/Toggle/ToggleCommon.js +2 -2
- package/dist/prospect.d.ts +11 -7
- package/dist/prospect.js +11 -7
- package/package.json +2 -2
- package/dist/distributeur/Form/Pass/Pass.d.ts +0 -15
- package/dist/distributeur/Form/Pass/Pass.js +0 -13
- package/dist/distributeur/Form/Pass/PassInput.d.ts +0 -13
- package/dist/distributeur/Form/Pass/PassInput.js +0 -34
- package/dist/distributeur/Form/Pass/index.d.ts +0 -2
- package/dist/distributeur/Form/Pass/index.js +0 -2
- package/dist/distributeur/Form/Select/SelectDefaultWithOptions.d.ts +0 -26
- package/dist/distributeur/Form/Select/SelectDefaultWithOptions.js +0 -32
- package/dist/distributeur/Form/Slider/Slider.d.ts +0 -28
- package/dist/distributeur/Form/Slider/Slider.js +0 -40
- package/dist/distributeur/Form/Slider/SliderInput.d.ts +0 -9
- package/dist/distributeur/Form/Slider/SliderInput.js +0 -11
- package/dist/distributeur/Form/Slider/index.d.ts +0 -3
- package/dist/distributeur/Form/Slider/index.js +0 -3
- package/dist/distributeur/Form/core/Deprecated/Field.d.ts +0 -21
- package/dist/distributeur/Form/core/Deprecated/Field.js +0 -20
- package/dist/distributeur/Form/core/Deprecated/FieldForm.d.ts +0 -103
- package/dist/distributeur/Form/core/Deprecated/FieldForm.js +0 -162
- package/dist/distributeur/Form/core/Deprecated/FieldInput.d.ts +0 -16
- package/dist/distributeur/Form/core/Deprecated/FieldInput.js +0 -14
- package/dist/distributeur/Form/core/useInputClassModifier.d.ts +0 -4
- package/dist/distributeur/Form/core/useInputClassModifier.js +0 -13
- package/dist/distributeur/Layout/Header/HeaderTitle/HeaderTitle.helpers.d.ts +0 -1
- package/dist/distributeur/Layout/Header/HeaderTitle/HeaderTitle.helpers.js +0 -6
- package/dist/distributeur/utilities/helpers/getComponentClassName.d.ts +0 -20
- package/dist/distributeur/utilities/helpers/getComponentClassName.js +0 -54
- package/dist/prospect-client/Form/ItemMessage/ItemMessageApollo.d.ts +0 -2
- package/dist/prospect-client/Form/ItemMessage/ItemMessageApollo.js +0 -2
- package/dist/prospect-client/Form/ItemMessage/ItemMessageLF.d.ts +0 -2
- package/dist/prospect-client/Form/ItemMessage/ItemMessageLF.js +0 -2
- package/dist/prospect-client/Skeleton/SkeletonApollo.d.ts +0 -2
- package/dist/prospect-client/Skeleton/SkeletonApollo.js +0 -2
- package/dist/prospect-client/Skeleton/SkeletonCommon.d.ts +0 -19
- package/dist/prospect-client/Skeleton/SkeletonCommon.js +0 -11
- package/dist/prospect-client/Skeleton/SkeletonLF.d.ts +0 -2
- package/dist/prospect-client/Skeleton/SkeletonLF.js +0 -2
- package/dist/prospect-client/utilities/getComponentClassName.d.ts +0 -4
- package/dist/prospect-client/utilities/getComponentClassName.js +0 -30
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ComponentProps, type ComponentPropsWithRef, type ComponentType } from "react";
|
|
2
2
|
import type { GridContainerProps } from "../../utilities/types/GridContainerProps";
|
|
3
3
|
import { ItemLabelCommon, type ItemLabelProps } from "../ItemLabel/ItemLabelCommon";
|
|
4
|
-
import {
|
|
4
|
+
import { type ItemMessageProps } from "../ItemMessage/ItemMessage";
|
|
5
5
|
import { type InputDateAtomProps } from "./InputDateAtom";
|
|
6
6
|
export type InputDateProps = Omit<ComponentPropsWithRef<"input">, "value" | "min" | "max"> & {
|
|
7
7
|
classModifier?: string;
|
|
@@ -10,24 +10,16 @@ export type InputDateProps = Omit<ComponentPropsWithRef<"input">, "value" | "min
|
|
|
10
10
|
min?: InputDateAtomProps["min"];
|
|
11
11
|
max?: InputDateAtomProps["max"];
|
|
12
12
|
helper?: string;
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Use `message` and messageType instead.
|
|
15
|
-
*/
|
|
16
|
-
error?: string;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Use `message` and messageType instead.
|
|
19
|
-
*/
|
|
20
|
-
success?: string;
|
|
21
13
|
hidePicker?: boolean;
|
|
22
14
|
label: ItemLabelProps["children"];
|
|
23
15
|
containerProps?: GridContainerProps;
|
|
24
|
-
} & Partial<Pick<ItemLabelProps, "description" | "
|
|
16
|
+
} & Partial<Pick<ItemLabelProps, "description" | "moreButtonLabel" | "onMoreButtonClick"> & ItemMessageProps>;
|
|
25
17
|
type InputDateCommonProps = InputDateProps & {
|
|
26
18
|
ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabelCommon>, "ButtonComponent">>;
|
|
27
|
-
ItemMessageComponent: ComponentType<
|
|
19
|
+
ItemMessageComponent: ComponentType<ItemMessageProps>;
|
|
28
20
|
};
|
|
29
21
|
declare const InputDateCommon: {
|
|
30
|
-
({ className, classModifier, helper,
|
|
22
|
+
({ className, classModifier, helper, message, messageType, label, description, moreButtonLabel, onMoreButtonClick, ItemLabelComponent, ItemMessageComponent, required, hidePicker, max, min, containerProps, ...otherProps }: InputDateCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
31
23
|
displayName: string;
|
|
32
24
|
};
|
|
33
25
|
export { InputDateCommon };
|
|
@@ -2,23 +2,22 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useId, } from "react";
|
|
3
3
|
import { getClassName } from "../../utilities/getClassName";
|
|
4
4
|
import { ItemLabelCommon, } from "../ItemLabel/ItemLabelCommon";
|
|
5
|
-
import {
|
|
5
|
+
import {} from "../ItemMessage/ItemMessage";
|
|
6
6
|
import { InputDateAtom } from "./InputDateAtom";
|
|
7
7
|
import { InputDateTextAtom } from "./InputDateTextAtom";
|
|
8
|
-
const InputDateCommon = ({ className, classModifier = "", helper,
|
|
8
|
+
const InputDateCommon = ({ className, classModifier = "", helper, message, messageType = "error", label, description, moreButtonLabel, onMoreButtonClick, ItemLabelComponent, ItemMessageComponent, required, hidePicker, max, min, containerProps, ...otherProps }) => {
|
|
9
9
|
let inputId = useId();
|
|
10
10
|
inputId = otherProps.id ?? inputId;
|
|
11
11
|
const idMessage = useId();
|
|
12
12
|
const idHelp = useId();
|
|
13
13
|
const ariaDescribedbyIds = [
|
|
14
14
|
helper && idHelp,
|
|
15
|
-
|
|
16
|
-
idMessage,
|
|
15
|
+
Boolean(message) && messageType === "success" && idMessage,
|
|
17
16
|
].filter(Boolean);
|
|
18
17
|
const ariaDescribedby = ariaDescribedbyIds.length
|
|
19
18
|
? ariaDescribedbyIds.join(" ")
|
|
20
19
|
: undefined;
|
|
21
|
-
const hasError =
|
|
20
|
+
const hasError = Boolean(message) && messageType === "error";
|
|
22
21
|
const ariaErrormessage = hasError ? idMessage : undefined;
|
|
23
22
|
const ariaInvalid = hasError || undefined;
|
|
24
23
|
const hasWarning = Boolean(message) && messageType === "warning" && !hasError;
|
|
@@ -27,7 +26,7 @@ const InputDateCommon = ({ className, classModifier = "", helper, error, success
|
|
|
27
26
|
modifiers: [...classModifier.split(" "), hasWarning && "warning"],
|
|
28
27
|
className,
|
|
29
28
|
});
|
|
30
|
-
return (_jsxs("div", { className: "af-form__input-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel
|
|
29
|
+
return (_jsxs("div", { className: "af-form__input-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel, onMoreButtonClick: onMoreButtonClick, required: required, htmlFor: inputId, children: label }), hidePicker ? (_jsx(InputDateTextAtom, { ...otherProps, id: inputId, className: componentClassName, "aria-errormessage": ariaErrormessage, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, required: required })) : (_jsx(InputDateAtom, { ...otherProps, id: inputId, className: componentClassName, "aria-errormessage": ariaErrormessage, "aria-invalid": ariaInvalid, "aria-describedby": ariaDescribedby, required: required, max: max, min: min })), helper ? (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })) : null, _jsx(ItemMessageComponent, { id: idMessage, message: message, messageType: messageType })] }));
|
|
31
30
|
};
|
|
32
31
|
InputDateCommon.displayName = "InputDate";
|
|
33
32
|
export { InputDateCommon };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/client/Form/InputDate/InputDateLF.css";
|
|
3
3
|
import { ItemLabel } from "../ItemLabel/ItemLabelLF";
|
|
4
|
-
import { ItemMessage } from "../ItemMessage/
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessage";
|
|
5
5
|
import { InputDateCommon } from "./InputDateCommon";
|
|
6
6
|
export const InputDate = ({ ...props }) => (_jsx(InputDateCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage }));
|
|
7
7
|
InputDate.displayName = "InputDate";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/prospect/Form/InputPhone/InputPhoneApollo.css";
|
|
3
3
|
import { ItemLabel } from "../ItemLabel/ItemLabelApollo";
|
|
4
|
-
import { ItemMessage } from "../ItemMessage/
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessage";
|
|
5
5
|
import { InputPhoneCommon } from "./InputPhoneCommon";
|
|
6
6
|
import { InputTextAtom } from "../InputTextAtom/InputTextAtomApollo";
|
|
7
7
|
import { Icon } from "../../Icon/IconApollo";
|
|
@@ -4,19 +4,11 @@ import { Icon } from "../../Icon/IconCommon";
|
|
|
4
4
|
import type { GridContainerProps } from "../../utilities/types/GridContainerProps";
|
|
5
5
|
import { InputTextAtom } from "../InputTextAtom/InputTextAtomCommon";
|
|
6
6
|
import { ItemLabelCommon, type ItemLabelProps } from "../ItemLabel/ItemLabelCommon";
|
|
7
|
-
import {
|
|
7
|
+
import { type ItemMessageProps } from "../ItemMessage/ItemMessage";
|
|
8
8
|
import { type OptionType } from "./InputPhone.types";
|
|
9
9
|
export type InputPhoneProps = ComponentPropsWithRef<"input"> & {
|
|
10
10
|
classModifier?: string;
|
|
11
11
|
helper?: string;
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Use `message` and messageType instead.
|
|
14
|
-
*/
|
|
15
|
-
error?: string;
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated Use `message` and messageType instead.
|
|
18
|
-
*/
|
|
19
|
-
success?: string;
|
|
20
12
|
defaultCountry?: string;
|
|
21
13
|
showSelect?: boolean;
|
|
22
14
|
disabled?: boolean;
|
|
@@ -26,15 +18,15 @@ export type InputPhoneProps = ComponentPropsWithRef<"input"> & {
|
|
|
26
18
|
mask?: (value: string) => string;
|
|
27
19
|
label: ItemLabelProps["children"];
|
|
28
20
|
containerProps?: GridContainerProps;
|
|
29
|
-
} & Pick<ItemLabelProps, "description" | "moreButtonLabel" | "
|
|
21
|
+
} & Pick<ItemLabelProps, "description" | "moreButtonLabel" | "onMoreButtonClick" | "sideButtonLabel" | "onSideButtonClick"> & Pick<ItemMessageProps, "message" | "messageType">;
|
|
30
22
|
type InputPhoneCommonProps = InputPhoneProps & {
|
|
31
23
|
ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabelCommon>, "ButtonComponent">>;
|
|
32
|
-
ItemMessageComponent: ComponentType<
|
|
24
|
+
ItemMessageComponent: ComponentType<ItemMessageProps>;
|
|
33
25
|
InputTextComponent: ComponentType<ComponentProps<typeof InputTextAtom>>;
|
|
34
26
|
IconComponent: ComponentType<ComponentProps<typeof Icon>>;
|
|
35
27
|
};
|
|
36
28
|
declare const InputPhoneCommon: {
|
|
37
|
-
({ className, classModifier, helper,
|
|
29
|
+
({ className, classModifier, helper, message, messageType, defaultCountry, showSelect, disabled, label, description, moreButtonLabel, onMoreButtonClick, required, sideButtonLabel, onSideButtonClick, countryCodeOptions, onChangeSelect, onChangeInput, mask, ItemLabelComponent, ItemMessageComponent, InputTextComponent, IconComponent, "aria-errormessage": ariaErrormessage, containerProps, ...otherProps }: InputPhoneCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
38
30
|
displayName: string;
|
|
39
31
|
};
|
|
40
32
|
export { InputPhoneCommon };
|
|
@@ -3,17 +3,21 @@ import { useId, } from "react";
|
|
|
3
3
|
import { Icon } from "../../Icon/IconCommon";
|
|
4
4
|
import { InputTextAtom } from "../InputTextAtom/InputTextAtomCommon";
|
|
5
5
|
import { ItemLabelCommon, } from "../ItemLabel/ItemLabelCommon";
|
|
6
|
-
import {
|
|
6
|
+
import {} from "../ItemMessage/ItemMessage";
|
|
7
7
|
import { CountryCodeSelect } from "./CountryCodeSelect";
|
|
8
8
|
import {} from "./InputPhone.types";
|
|
9
9
|
import { maskFrenchPhoneNumber } from "./maskFrenchPhoneNumber";
|
|
10
|
-
const InputPhoneCommon = ({ className, classModifier = "", helper,
|
|
10
|
+
const InputPhoneCommon = ({ className, classModifier = "", helper, message, messageType = "error", defaultCountry, showSelect, disabled, label, description, moreButtonLabel, onMoreButtonClick, required, sideButtonLabel, onSideButtonClick, countryCodeOptions = [], onChangeSelect, onChangeInput, mask = maskFrenchPhoneNumber, ItemLabelComponent, ItemMessageComponent, InputTextComponent, IconComponent, "aria-errormessage": ariaErrormessage, containerProps, ...otherProps }) => {
|
|
11
11
|
let inputId = useId();
|
|
12
12
|
inputId = otherProps.id || inputId;
|
|
13
13
|
const idMessage = useId();
|
|
14
14
|
const idHelp = useId();
|
|
15
|
-
const ariaDescribedby = [
|
|
16
|
-
|
|
15
|
+
const ariaDescribedby = [
|
|
16
|
+
helper && idHelp,
|
|
17
|
+
message && messageType === "success" && idMessage,
|
|
18
|
+
].filter(Boolean);
|
|
19
|
+
const hasError = Boolean(message) && messageType === "error";
|
|
20
|
+
const hasWarning = Boolean(message) && messageType === "warning" && !hasError;
|
|
17
21
|
/**
|
|
18
22
|
* Gère le changement de valeur du champ numéro de téléphone.
|
|
19
23
|
* - Récupère une fonction de masquage (mask) depuis les props ou utilise une version par défaut.
|
|
@@ -29,9 +33,9 @@ const InputPhoneCommon = ({ className, classModifier = "", helper, error, succes
|
|
|
29
33
|
const maskedValue = mask(rawValue);
|
|
30
34
|
onChangeInput?.(maskedValue);
|
|
31
35
|
};
|
|
32
|
-
return (_jsxs("div", { className: "af-form__input-phone-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel
|
|
36
|
+
return (_jsxs("div", { className: "af-form__input-phone-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel, onMoreButtonClick: onMoreButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, htmlFor: inputId, children: label }), _jsxs("div", { className: "af-form__input-phone-fields", children: [showSelect ? (_jsx("div", { className: "af-form__country-code-wrapper", children: _jsx(CountryCodeSelect, { options: countryCodeOptions, defaultCountry: defaultCountry, onChangeSelect: onChangeSelect, IconComponent: IconComponent, disabled: disabled }) })) : null, _jsx(InputTextComponent, { ...otherProps, className: ["af-form__input-phone", className]
|
|
33
37
|
.filter(Boolean)
|
|
34
|
-
.join(" "), classModifier: classModifier, error: hasError ? messageType
|
|
38
|
+
.join(" "), classModifier: classModifier, error: hasError ? messageType : undefined, warning: hasWarning ? "warning" : undefined, type: "tel", required: required, placeholder: otherProps.placeholder, "aria-errormessage": ariaErrormessage, value: otherProps.value, onChange: handleChangeNumber, disabled: disabled, idMessage: hasError ? idMessage : undefined, idHelp: ariaDescribedby.length > 0 ? ariaDescribedby.join(" ") : undefined, id: inputId })] }), helper ? (_jsx("span", { id: idHelp, className: "af-form__input-phone-helper", children: helper })) : null, _jsx(ItemMessageComponent, { id: idMessage, message: message, messageType: messageType })] }));
|
|
35
39
|
};
|
|
36
40
|
InputPhoneCommon.displayName = "InputPhone";
|
|
37
41
|
export { InputPhoneCommon };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/client/Form/InputPhone/InputPhoneLF.css";
|
|
3
3
|
import { ItemLabel } from "../ItemLabel/ItemLabelLF";
|
|
4
|
-
import { ItemMessage } from "../ItemMessage/
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessage";
|
|
5
5
|
import { InputPhoneCommon } from "./InputPhoneCommon";
|
|
6
6
|
import { InputTextAtom } from "../InputTextAtom/InputTextAtomLF";
|
|
7
7
|
import { Icon } from "../../Icon/IconLF";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/prospect/Form/InputText/InputTextApollo.css";
|
|
3
3
|
import { ItemLabel } from "../ItemLabel/ItemLabelApollo";
|
|
4
|
-
import { ItemMessage } from "../ItemMessage/
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessage";
|
|
5
5
|
import { InputTextCommon } from "./InputTextCommon";
|
|
6
6
|
import { InputTextAtom } from "../InputTextAtom/InputTextAtomApollo";
|
|
7
7
|
export const InputText = ({ ...props }) => (_jsx(InputTextCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage, InputTextAtomComponent: InputTextAtom }));
|
|
@@ -1,30 +1,22 @@
|
|
|
1
1
|
import { type ComponentProps, type ComponentType, type ReactNode } from "react";
|
|
2
2
|
import { InputTextAtom } from "../InputTextAtom/InputTextAtomCommon";
|
|
3
3
|
import { ItemLabelCommon, type ItemLabelProps } from "../ItemLabel/ItemLabelCommon";
|
|
4
|
-
import {
|
|
4
|
+
import { type ItemMessageProps } from "../ItemMessage/ItemMessage";
|
|
5
5
|
import type { GridContainerProps } from "../../utilities/types/GridContainerProps";
|
|
6
6
|
export type InputTextProps = ComponentProps<"input"> & {
|
|
7
7
|
unit?: ReactNode;
|
|
8
8
|
classModifier?: string;
|
|
9
9
|
label?: ItemLabelProps["children"];
|
|
10
10
|
helper?: string;
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use `message` and messageType instead.
|
|
13
|
-
*/
|
|
14
|
-
error?: string;
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated Use `message` and messageType instead.
|
|
17
|
-
*/
|
|
18
|
-
success?: string;
|
|
19
11
|
containerProps?: GridContainerProps;
|
|
20
|
-
} & Pick<ItemLabelProps, "description" | "moreButtonLabel" | "
|
|
12
|
+
} & Pick<ItemLabelProps, "description" | "moreButtonLabel" | "onMoreButtonClick" | "sideButtonLabel" | "onSideButtonClick"> & Pick<ItemMessageProps, "message" | "messageType">;
|
|
21
13
|
type InputTextCommonProps = InputTextProps & {
|
|
22
14
|
ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabelCommon>, "ButtonComponent">>;
|
|
23
|
-
ItemMessageComponent: ComponentType<
|
|
15
|
+
ItemMessageComponent: ComponentType<ItemMessageProps>;
|
|
24
16
|
InputTextAtomComponent: ComponentType<ComponentProps<typeof InputTextAtom>>;
|
|
25
17
|
};
|
|
26
18
|
declare const InputTextCommon: {
|
|
27
|
-
({ unit, className, classModifier, helper,
|
|
19
|
+
({ unit, className, classModifier, helper, message, messageType, label, description, moreButtonLabel, onMoreButtonClick, required, sideButtonLabel, onSideButtonClick, ItemLabelComponent, ItemMessageComponent, InputTextAtomComponent, containerProps, ...otherProps }: InputTextCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
28
20
|
displayName: string;
|
|
29
21
|
};
|
|
30
22
|
export { InputTextCommon };
|
|
@@ -2,16 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useId, } from "react";
|
|
3
3
|
import { InputTextAtom } from "../InputTextAtom/InputTextAtomCommon";
|
|
4
4
|
import { ItemLabelCommon, } from "../ItemLabel/ItemLabelCommon";
|
|
5
|
-
import {
|
|
6
|
-
const InputTextCommon = ({ unit, className, classModifier = "", helper,
|
|
5
|
+
import {} from "../ItemMessage/ItemMessage";
|
|
6
|
+
const InputTextCommon = ({ unit, className, classModifier = "", helper, message, messageType = "error", label, description, moreButtonLabel, onMoreButtonClick, required, sideButtonLabel, onSideButtonClick, ItemLabelComponent, ItemMessageComponent, InputTextAtomComponent, containerProps, ...otherProps }) => {
|
|
7
7
|
let inputId = useId();
|
|
8
8
|
inputId = otherProps.id || inputId;
|
|
9
9
|
const idMessage = useId();
|
|
10
10
|
const idHelp = useId();
|
|
11
|
-
const ariaDescribedby = [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const ariaDescribedby = [
|
|
12
|
+
helper && idHelp,
|
|
13
|
+
message && messageType === "success" && idMessage,
|
|
14
|
+
].filter(Boolean);
|
|
15
|
+
return (_jsxs("div", { className: "af-form__input-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel, onMoreButtonClick: onMoreButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, htmlFor: inputId, children: label }), _jsx(InputTextAtomComponent, { id: inputId, unit: unit, className: className, classModifier: classModifier, error: message && messageType === "error" ? messageType : undefined, warning: message && messageType === "warning" ? messageType : undefined, required: required, idMessage: message ? 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: message, messageType: messageType })] }));
|
|
15
16
|
};
|
|
16
17
|
InputTextCommon.displayName = "InputText";
|
|
17
18
|
export { InputTextCommon };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/client/Form/InputText/InputTextLF.css";
|
|
3
3
|
import { ItemLabel } from "../ItemLabel/ItemLabelLF";
|
|
4
|
-
import { ItemMessage } from "../ItemMessage/
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessage";
|
|
5
5
|
import { InputTextCommon } from "./InputTextCommon";
|
|
6
6
|
import { InputTextAtom } from "../InputTextAtom/InputTextAtomLF";
|
|
7
7
|
export const InputText = ({ ...props }) => (_jsx(InputTextCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage, InputTextAtomComponent: InputTextAtom }));
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { type ComponentProps, type ComponentType, type MouseEventHandler, type ReactNode } from "react";
|
|
2
2
|
import type { ButtonProps } from "../../Button/ButtonCommon";
|
|
3
3
|
export type ItemLabelProps = ComponentProps<"label"> & {
|
|
4
|
-
/**
|
|
5
|
-
* Label text content
|
|
6
|
-
* @deprecated use `children` instead.
|
|
7
|
-
*/
|
|
8
|
-
label?: ReactNode;
|
|
9
4
|
/**
|
|
10
5
|
* Additional description text that enriches the label.
|
|
11
6
|
* @example "Phone bill, EDF receipt, etc."
|
|
@@ -15,11 +10,6 @@ export type ItemLabelProps = ComponentProps<"label"> & {
|
|
|
15
10
|
* Shows a visual asterisk (*) indicator next to the label.
|
|
16
11
|
*/
|
|
17
12
|
required?: boolean;
|
|
18
|
-
/**
|
|
19
|
-
* ID of the associated input element
|
|
20
|
-
* @deprecated use `htmlFor` instead.
|
|
21
|
-
*/
|
|
22
|
-
inputId?: string;
|
|
23
13
|
/**
|
|
24
14
|
* Label content for the side action button.
|
|
25
15
|
* When provided, renders a secondary button next to the main label.
|
|
@@ -33,16 +23,6 @@ export type ItemLabelProps = ComponentProps<"label"> & {
|
|
|
33
23
|
* Additional props to pass to the side button component.
|
|
34
24
|
*/
|
|
35
25
|
sideButtonProps?: Omit<Partial<ButtonProps>, "children" | "onClick" | "variant" | "className">;
|
|
36
|
-
/**
|
|
37
|
-
* Label content for the more button
|
|
38
|
-
* @deprecated use `moreButtonLabel` instead.
|
|
39
|
-
*/
|
|
40
|
-
buttonLabel?: ReactNode;
|
|
41
|
-
/**
|
|
42
|
-
* Click handler for the info button
|
|
43
|
-
* @deprecated use `onMoreButtonClick` instead.
|
|
44
|
-
*/
|
|
45
|
-
onButtonClick?: MouseEventHandler<HTMLButtonElement>;
|
|
46
26
|
/**
|
|
47
27
|
* Label content for the more button
|
|
48
28
|
* When provided, renders an more button with an info icon.
|
|
@@ -92,7 +72,7 @@ export type ItemLabelCommonProps = ItemLabelProps & {
|
|
|
92
72
|
* description="Accepted: PDF, JPG, PNG (max 5MB)"
|
|
93
73
|
* sideButtonLabel="Browse"
|
|
94
74
|
* onSideButtonClick={handleBrowse}
|
|
95
|
-
*
|
|
75
|
+
* moreButtonLabel="Help"
|
|
96
76
|
* onMoreButtonClick={handleShowHelp}
|
|
97
77
|
* ButtonComponent={Button}
|
|
98
78
|
* >
|
|
@@ -100,4 +80,4 @@ export type ItemLabelCommonProps = ItemLabelProps & {
|
|
|
100
80
|
* </ItemLabelCommon>
|
|
101
81
|
* ```
|
|
102
82
|
*/
|
|
103
|
-
export declare const ItemLabelCommon: ({
|
|
83
|
+
export declare const ItemLabelCommon: ({ children, description, required, className, style, "aria-describedby": ariaDescribedby, sideButtonLabel, onSideButtonClick, sideButtonProps, moreButtonLabel, onMoreButtonClick, ButtonComponent, moreButtonProps, ...props }: ItemLabelCommonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -34,7 +34,7 @@ import { Svg } from "../../Svg/Svg";
|
|
|
34
34
|
* description="Accepted: PDF, JPG, PNG (max 5MB)"
|
|
35
35
|
* sideButtonLabel="Browse"
|
|
36
36
|
* onSideButtonClick={handleBrowse}
|
|
37
|
-
*
|
|
37
|
+
* moreButtonLabel="Help"
|
|
38
38
|
* onMoreButtonClick={handleShowHelp}
|
|
39
39
|
* ButtonComponent={Button}
|
|
40
40
|
* >
|
|
@@ -42,14 +42,13 @@ import { Svg } from "../../Svg/Svg";
|
|
|
42
42
|
* </ItemLabelCommon>
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
export const ItemLabelCommon = ({
|
|
45
|
+
export const ItemLabelCommon = ({ children, description, required, className, style, "aria-describedby": ariaDescribedby, sideButtonLabel, onSideButtonClick, sideButtonProps, moreButtonLabel, onMoreButtonClick, ButtonComponent, moreButtonProps, ...props }) => {
|
|
46
46
|
const idDescription = useId();
|
|
47
|
-
const contentLabel = children ?? label;
|
|
48
47
|
const describedByIds = [description ? idDescription : null, ariaDescribedby]
|
|
49
48
|
.filter(Boolean)
|
|
50
49
|
.join(" ");
|
|
51
|
-
if (!
|
|
50
|
+
if (!children) {
|
|
52
51
|
return null;
|
|
53
52
|
}
|
|
54
|
-
return (_jsxs("div", { className: ["af-item-label", className].filter(Boolean).join(" "), style: style, children: [_jsxs("label", {
|
|
53
|
+
return (_jsxs("div", { className: ["af-item-label", className].filter(Boolean).join(" "), style: style, children: [_jsxs("label", { className: "af-item-label__label", "aria-describedby": describedByIds || undefined, ...props, children: [children, required ? _jsx("span", { "aria-hidden": "true", children: "*" }) : null] }), sideButtonLabel ? (_jsx(ButtonComponent, { ...sideButtonProps, 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, moreButtonLabel ? (_jsx(ButtonComponent, { iconLeft: _jsx(Svg, { src: infoIcon, role: "presentation" }), ...moreButtonProps, variant: "ghost", className: "af-item-label__more", onClick: onMoreButtonClick, children: moreButtonLabel })) : null] }));
|
|
55
54
|
};
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/prospect/Form/ItemMessage/ItemMessageAll.css";
|
|
2
3
|
import successIcon from "@material-symbols/svg-400/outlined/check_circle-fill.svg";
|
|
3
4
|
import errorIcon from "@material-symbols/svg-400/outlined/error-fill.svg";
|
|
4
5
|
import warningIcon from "@material-symbols/svg-400/outlined/warning-fill.svg";
|
|
5
|
-
import {
|
|
6
|
+
import { Icon } from "../../Icon/IconCommon";
|
|
6
7
|
export const itemMessageVariants = {
|
|
7
8
|
error: "error",
|
|
8
9
|
success: "success",
|
|
9
10
|
warning: "warning",
|
|
10
11
|
};
|
|
12
|
+
const getIcon = (messageType) => {
|
|
13
|
+
if (messageType === "success")
|
|
14
|
+
return successIcon;
|
|
15
|
+
if (messageType === "warning")
|
|
16
|
+
return warningIcon;
|
|
17
|
+
return errorIcon;
|
|
18
|
+
};
|
|
11
19
|
export const ItemMessage = ({ message, id, messageType = "error", }) => {
|
|
12
20
|
if (!message) {
|
|
13
21
|
return null;
|
|
14
22
|
}
|
|
15
|
-
|
|
16
|
-
if (messageType === "success")
|
|
17
|
-
return successIcon;
|
|
18
|
-
if (messageType === "warning")
|
|
19
|
-
return warningIcon;
|
|
20
|
-
return errorIcon;
|
|
21
|
-
};
|
|
22
|
-
return (_jsxs("small", { id: id, className: `af-item-message af-item-message--${messageType}`, role: messageType === "success" ? undefined : "alert", "aria-live": "assertive", children: [_jsx(Svg, { src: getIcon(), className: "af-item-message__icon", "aria-hidden": "true" }), _jsx("span", { className: "af-item-message__message", children: message })] }));
|
|
23
|
+
return (_jsxs("small", { id: id, className: `af-item-message af-item-message--${messageType}`, role: messageType === "success" ? undefined : "alert", "aria-live": "assertive", children: [_jsx(Icon, { src: getIcon(messageType), size: "XS", variant: messageType, "aria-hidden": "true" }), _jsx("span", { className: "af-item-message__message", children: message })] }));
|
|
23
24
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/canopee-css/prospect/Form/MultiSelectList/MultiSelectListAll.css";
|
|
2
|
+
import { type MultiSelectListProps } from "./MultiSelectListCommon";
|
|
3
|
+
export type { MultiSelectListProps } from "./MultiSelectListCommon";
|
|
4
|
+
export declare const MultiSelectList: (props: MultiSelectListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/prospect/Form/MultiSelectList/MultiSelectListAll.css";
|
|
3
|
+
import { ItemMultiSelect } from "../ItemMultiSelect/ItemMultiSelectApollo";
|
|
4
|
+
import { MultiSelectListCommon, } from "./MultiSelectListCommon";
|
|
5
|
+
export const MultiSelectList = (props) => (_jsx(MultiSelectListCommon, { ...props, ItemMultiSelectComponent: ItemMultiSelect }));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
import type { ListProps } from "../../List/List/ListCommon";
|
|
3
|
+
import type { ItemMultiSelectCommonProps } from "../ItemMultiSelect/ItemMultiSelectCommon";
|
|
4
|
+
export type MultiSelectListProps = Omit<ListProps, "children" | "separator" | "onChange"> & {
|
|
5
|
+
items: Omit<ItemMultiSelectCommonProps, "Checkbox">[];
|
|
6
|
+
};
|
|
7
|
+
type MultiSelectListCommonProps = MultiSelectListProps & {
|
|
8
|
+
ItemMultiSelectComponent: ComponentType<Omit<ItemMultiSelectCommonProps, "Checkbox">>;
|
|
9
|
+
};
|
|
10
|
+
export declare const MultiSelectListCommon: ({ items, ItemMultiSelectComponent, }: MultiSelectListCommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const MultiSelectListCommon = ({ items, ItemMultiSelectComponent, }) => (_jsx("ul", { className: "af-multi-select-list", children: items.map((item, index) => (_jsx("li", { children: _jsx(ItemMultiSelectComponent, { ...item, variant: index % 2 === 0 ? "primary" : "secondary" }) }, item.id))) }));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/canopee-css/client/Form/MultiSelectList/MultiSelectListAll.css";
|
|
2
|
+
import { type MultiSelectListProps } from "./MultiSelectListCommon";
|
|
3
|
+
export type { MultiSelectListProps } from "./MultiSelectListCommon";
|
|
4
|
+
export declare const MultiSelectList: (props: MultiSelectListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/client/Form/MultiSelectList/MultiSelectListAll.css";
|
|
3
|
+
import { ItemMultiSelect } from "../ItemMultiSelect/ItemMultiSelectLF";
|
|
4
|
+
import { MultiSelectListCommon, } from "./MultiSelectListCommon";
|
|
5
|
+
export const MultiSelectList = (props) => (_jsx(MultiSelectListCommon, { ...props, ItemMultiSelectComponent: ItemMultiSelect }));
|
|
@@ -8,10 +8,6 @@ type BaseCardRadioProps = Omit<ComponentProps<typeof Radio>, "size"> & {
|
|
|
8
8
|
subtitle?: ReactNode;
|
|
9
9
|
};
|
|
10
10
|
export type CardRadioProps = BaseCardRadioProps & {
|
|
11
|
-
/**
|
|
12
|
-
* @deprecated Use `position` instead.
|
|
13
|
-
*/
|
|
14
|
-
type?: "vertical" | "horizontal";
|
|
15
11
|
position?: "vertical" | "horizontal";
|
|
16
12
|
icon?: ComponentProps<typeof IconCommon>["src"];
|
|
17
13
|
src?: ComponentProps<typeof BasePicture>["src"];
|
|
@@ -22,7 +18,7 @@ export type CardRadioCommonProps = CardRadioProps & {
|
|
|
22
18
|
IconComponent: ComponentType<ComponentProps<typeof IconCommon>>;
|
|
23
19
|
};
|
|
24
20
|
export declare const CardRadioCommon: {
|
|
25
|
-
({ label, position,
|
|
21
|
+
({ label, position, description, subtitle, icon, src, basePictureProps, variant, className, RadioComponent, IconComponent, ...inputProps }: CardRadioCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
26
22
|
displayName: string;
|
|
27
23
|
};
|
|
28
24
|
export {};
|
|
@@ -2,15 +2,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import {} from "react";
|
|
3
3
|
import { BasePicture } from "../../../BasePicture/BasePicture";
|
|
4
4
|
import { getClassName } from "../../../utilities/getClassName";
|
|
5
|
-
export const CardRadioCommon = ({ label, position,
|
|
6
|
-
const isCardRadioHorizontal =
|
|
5
|
+
export const CardRadioCommon = ({ label, position, description, subtitle, icon, src, basePictureProps, variant, className, RadioComponent, IconComponent, ...inputProps }) => {
|
|
6
|
+
const isCardRadioHorizontal = position === "horizontal";
|
|
7
7
|
return (_jsxs("label", { className: getClassName({
|
|
8
8
|
baseClassName: "af-card-radio",
|
|
9
9
|
modifiers: [
|
|
10
|
-
|
|
10
|
+
variant === "error" && "invalid",
|
|
11
11
|
isCardRadioHorizontal && "horizontal",
|
|
12
12
|
],
|
|
13
13
|
className,
|
|
14
|
-
}), children: [icon ? _jsx(IconComponent, { src: icon, role: "presentation" }) : null, isCardRadioHorizontal && src ? (_jsx(BasePicture, { src: src, ...basePictureProps })) : null, _jsxs("div", { className: "af-card-radio__content", children: [_jsx("p", { className: "af-card-radio__label", children: label }), Boolean(description) && (_jsx("p", { className: "af-card-radio__description", children: description })), Boolean(subtitle) && (_jsx("p", { className: "af-card-radio__subtitle", children: subtitle }))] }), _jsx(RadioComponent, { ...inputProps,
|
|
14
|
+
}), children: [icon ? _jsx(IconComponent, { src: icon, role: "presentation" }) : null, isCardRadioHorizontal && src ? (_jsx(BasePicture, { src: src, ...basePictureProps })) : null, _jsxs("div", { className: "af-card-radio__content", children: [_jsx("p", { className: "af-card-radio__label", children: label }), Boolean(description) && (_jsx("p", { className: "af-card-radio__description", children: description })), Boolean(subtitle) && (_jsx("p", { className: "af-card-radio__subtitle", children: subtitle }))] }), _jsx(RadioComponent, { ...inputProps, variant: variant })] }));
|
|
15
15
|
};
|
|
16
16
|
CardRadioCommon.displayName = "CardRadioCommon";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ItemMessage } from "../../ItemMessage/
|
|
2
|
+
import { ItemMessage } from "../../ItemMessage/ItemMessage";
|
|
3
3
|
import { CardRadio } from "../CardRadio/CardRadioApollo";
|
|
4
4
|
import { CardRadioGroupCommon, } from "./CardRadioGroupCommon";
|
|
5
5
|
import "@axa-fr/canopee-css/prospect/Form/Radio/CardRadioGroup/CardRadioGroupApollo.css";
|
|
@@ -1,46 +1,22 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentType, type PropsWithChildren, type ReactNode } from "react";
|
|
2
2
|
import type { GridContainerProps } from "../../../utilities/types/GridContainerProps";
|
|
3
|
-
import {
|
|
3
|
+
import { type ItemMessageProps } from "../../ItemMessage/ItemMessage";
|
|
4
4
|
import { type CardRadioProps } from "../CardRadio/CardRadioCommon";
|
|
5
|
-
type RadioOption = Omit<CardRadioProps, "name" | "type" | "
|
|
6
|
-
export type CardRadioGroupProps = Omit<CardRadioProps, "value" | "label" | "type" | "
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use `position` and `cardStyle` instead.
|
|
9
|
-
*/
|
|
10
|
-
type?: "vertical" | "horizontal";
|
|
5
|
+
type RadioOption = Omit<CardRadioProps, "name" | "type" | "variant">;
|
|
6
|
+
export type CardRadioGroupProps = Omit<CardRadioProps, "value" | "label" | "type" | "variant" | "icon" | "src" | "basePictureProps" | "description" | "subtitle" | "children" | "position"> & {
|
|
11
7
|
cardStyle?: CardRadioProps["position"];
|
|
12
8
|
position?: "line" | "column";
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Use `label` instead.
|
|
15
|
-
*/
|
|
16
|
-
labelGroup?: string;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Use `description` instead.
|
|
19
|
-
*/
|
|
20
|
-
descriptionGroup?: string;
|
|
21
9
|
label: ReactNode;
|
|
22
10
|
description?: ReactNode;
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated Use `required` instead.
|
|
25
|
-
*/
|
|
26
|
-
isRequired?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated This prop is deprecated. To check an option, use the `checked` property in each item of the `options` array.
|
|
29
|
-
*/
|
|
30
|
-
value?: number | string;
|
|
31
11
|
options: RadioOption[];
|
|
32
|
-
/**
|
|
33
|
-
* @deprecated Use `message` and messageType instead.
|
|
34
|
-
*/
|
|
35
|
-
error?: ReactNode;
|
|
36
12
|
containerProps?: GridContainerProps<"fieldset">;
|
|
37
13
|
} & PropsWithChildren & Partial<ItemMessageProps>;
|
|
38
14
|
export type CardRadioCommonProps = CardRadioGroupProps & {
|
|
39
15
|
CardRadioComponent: ComponentType<CardRadioProps>;
|
|
40
|
-
ItemMessageComponent: ComponentType<
|
|
16
|
+
ItemMessageComponent: ComponentType<ItemMessageProps>;
|
|
41
17
|
};
|
|
42
18
|
declare const CardRadioGroupCommon: {
|
|
43
|
-
({ className,
|
|
19
|
+
({ className, label, description, required, options, cardStyle, position, message, messageType, name, id, CardRadioComponent, ItemMessageComponent, containerProps, ...inputProps }: CardRadioCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
44
20
|
displayName: string;
|
|
45
21
|
};
|
|
46
22
|
export { CardRadioGroupCommon };
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId, } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import {} from "../../ItemMessage/ItemMessage";
|
|
4
4
|
import {} from "../CardRadio/CardRadioCommon";
|
|
5
|
-
const CardRadioGroupCommon = ({ className,
|
|
5
|
+
const CardRadioGroupCommon = ({ className, label, description, required, options, cardStyle, position = cardStyle === "vertical" ? "column" : "line", message, messageType = "error", name, id, CardRadioComponent, ItemMessageComponent, containerProps, ...inputProps }) => {
|
|
6
6
|
const generatedId = useId();
|
|
7
7
|
const cardRadioGroupId = id ?? generatedId;
|
|
8
8
|
const messageId = `${cardRadioGroupId}-error`;
|
|
9
|
-
const hasError =
|
|
10
|
-
return (_jsxs("fieldset", { className: ["af-card-radio-group", className].filter(Boolean).join(" "), role: "radiogroup", "aria-required": Boolean(required) || undefined, "aria-invalid": hasError || undefined, "aria-errormessage": hasError ? messageId : undefined, id: cardRadioGroupId, ...containerProps, children: [_jsxs("legend", { className: "af-card-radio-group__legend", children: [_jsxs("p", { className: "af-card-radio-group__label", children: [label,
|
|
9
|
+
const hasError = Boolean(message) && messageType === "error";
|
|
10
|
+
return (_jsxs("fieldset", { className: ["af-card-radio-group", className].filter(Boolean).join(" "), role: "radiogroup", "aria-required": Boolean(required) || undefined, "aria-invalid": hasError || undefined, "aria-errormessage": hasError ? messageId : undefined, id: cardRadioGroupId, ...containerProps, children: [_jsxs("legend", { className: "af-card-radio-group__legend", children: [_jsxs("p", { className: "af-card-radio-group__label", children: [label, required ? _jsx("span", { "aria-hidden": true, children: "*" }) : null] }), description ? (_jsx("p", { className: "af-card-radio-group__description", children: description })) : null] }), _jsx("div", { className: [
|
|
11
11
|
"af-card-radio-group__options",
|
|
12
12
|
`af-card-radio-group__options--${position}`,
|
|
13
|
-
].join(" "), children: options.map((cardRadioItemProps) => (_jsx(CardRadioComponent, { id: `${cardRadioGroupId}-${cardRadioItemProps.value}`,
|
|
14
|
-
? value === cardRadioItemProps.value
|
|
15
|
-
: undefined, required: required, position: cardStyle ?? type, ...inputProps, ...cardRadioItemProps, isInvalid: hasError, name: name }, `${name ?? cardRadioGroupId}-${cardRadioItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: messageId, message: message || error, messageType: messageType })] }));
|
|
13
|
+
].join(" "), children: options.map((cardRadioItemProps) => (_jsx(CardRadioComponent, { id: `${cardRadioGroupId}-${cardRadioItemProps.value}`, required: required, position: cardStyle, ...inputProps, ...cardRadioItemProps, variant: hasError ? "error" : undefined, name: name }, `${name ?? cardRadioGroupId}-${cardRadioItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: messageId, message: message, messageType: messageType })] }));
|
|
16
14
|
};
|
|
17
15
|
CardRadioGroupCommon.displayName = "CardRadioGroupCommon";
|
|
18
16
|
export { CardRadioGroupCommon };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ItemMessage } from "../../ItemMessage/
|
|
2
|
+
import { ItemMessage } from "../../ItemMessage/ItemMessage";
|
|
3
3
|
import { CardRadio } from "../CardRadio/CardRadioLF";
|
|
4
4
|
import { CardRadioGroupCommon, } from "./CardRadioGroupCommon";
|
|
5
5
|
import "@axa-fr/canopee-css/client/Form/Radio/CardRadioGroup/CardRadioGroupLF.css";
|