@axa-fr/canopee-react 1.8.1-alpha.1 → 2.0.0-RC.1
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 +21 -19
- package/dist/client.js +21 -19
- 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 +8 -4
- package/dist/distributeur/Action/Action.js +4 -5
- package/dist/distributeur/Button/Button.d.ts +9 -7
- package/dist/distributeur/Button/Button.js +8 -2
- 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 +6 -3
- package/dist/distributeur/Form/Checkbox/Checkbox.js +11 -6
- package/dist/distributeur/Form/Checkbox/CheckboxInput.d.ts +6 -3
- package/dist/distributeur/Form/Checkbox/CheckboxInput.js +5 -5
- package/dist/distributeur/Form/Checkbox/CheckboxItem.d.ts +7 -5
- package/dist/distributeur/Form/Checkbox/CheckboxItem.js +5 -5
- package/dist/distributeur/Form/Choice/Choice.d.ts +6 -5
- package/dist/distributeur/Form/Choice/Choice.js +4 -4
- package/dist/distributeur/Form/Choice/ChoiceInput.d.ts +6 -3
- package/dist/distributeur/Form/Choice/ChoiceInput.js +2 -4
- package/dist/distributeur/Form/Date/Date.d.ts +5 -3
- package/dist/distributeur/Form/Date/Date.js +5 -5
- package/dist/distributeur/Form/Date/DateInput.d.ts +4 -1
- package/dist/distributeur/Form/Date/DateInput.js +2 -4
- package/dist/distributeur/Form/Experimental/DateInput.d.ts +31 -0
- package/dist/distributeur/Form/Experimental/DateInput.js +27 -0
- package/dist/distributeur/Form/Experimental/Input.d.ts +5 -1
- package/dist/distributeur/Form/Experimental/Input.js +4 -4
- 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/TextInput.d.ts +4 -1
- package/dist/distributeur/Form/Experimental/TextInput.js +4 -4
- 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 +5 -5
- package/dist/distributeur/Form/Number/Number.js +6 -7
- package/dist/distributeur/Form/Number/NumberInput.js +1 -1
- package/dist/distributeur/Form/Radio/Radio.d.ts +12 -23
- package/dist/distributeur/Form/Radio/Radio.js +4 -4
- package/dist/distributeur/Form/Radio/RadioInput.d.ts +6 -3
- package/dist/distributeur/Form/Radio/RadioInput.js +4 -4
- package/dist/distributeur/Form/Radio/RadioItem.d.ts +4 -3
- package/dist/distributeur/Form/Radio/RadioItem.js +5 -5
- package/dist/distributeur/Form/Select/Select.d.ts +8 -340
- package/dist/distributeur/Form/Select/Select.js +5 -6
- package/dist/distributeur/Form/Select/SelectBase.d.ts +6 -23
- package/dist/distributeur/Form/Select/SelectBase.js +4 -9
- package/dist/distributeur/Form/Select/SelectDefault.d.ts +7 -4
- package/dist/distributeur/Form/Select/SelectDefault.js +4 -4
- package/dist/distributeur/Form/Select/SelectInput.d.ts +9 -376
- package/dist/distributeur/Form/Select/SelectInput.js +2 -4
- 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 +5 -3
- package/dist/distributeur/Form/Text/Text.js +5 -5
- package/dist/distributeur/Form/Text/TextInput.d.ts +4 -1
- package/dist/distributeur/Form/Text/TextInput.js +2 -4
- package/dist/distributeur/Form/Textarea/Textarea.d.ts +8 -4
- package/dist/distributeur/Form/Textarea/Textarea.js +5 -5
- package/dist/distributeur/Form/Textarea/TextareaInput.d.ts +4 -1
- package/dist/distributeur/Form/Textarea/TextareaInput.js +2 -4
- 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/Footer/Footer.d.ts +5 -3
- package/dist/distributeur/Layout/Footer/Footer.js +2 -2
- 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 +2 -3
- 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 +7 -4
- 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/Link.d.ts +4 -1
- package/dist/distributeur/Link/Link.js +3 -4
- package/dist/distributeur/Link/LinkAnchor.d.ts +8 -7
- package/dist/distributeur/Link/LinkAnchor.js +5 -5
- package/dist/distributeur/Loader/ItemLoader.d.ts +4 -0
- package/dist/distributeur/Loader/ItemLoader.js +8 -0
- package/dist/distributeur/Loader/Loader.d.ts +7 -10
- package/dist/distributeur/Loader/Loader.js +12 -27
- package/dist/distributeur/Loader/SquareLoader.d.ts +15 -0
- package/dist/distributeur/Loader/SquareLoader.js +33 -0
- package/dist/distributeur/Messages/Message.d.ts +2 -6
- package/dist/distributeur/Messages/Message.js +3 -14
- package/dist/distributeur/ModalAgent/BooleanModal.d.ts +4 -6
- package/dist/distributeur/ModalAgent/BooleanModal.js +9 -6
- package/dist/distributeur/ModalAgent/Modal.d.ts +5 -7
- package/dist/distributeur/ModalAgent/Modal.js +10 -19
- 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/Steps/VerticalStep.d.ts +2 -8
- package/dist/distributeur/Summary/index.d.ts +1 -1
- package/dist/distributeur/Summary/index.js +1 -2
- package/dist/distributeur/Svg/svgInjector.js +1 -0
- 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 +4 -6
- package/dist/distributeur/Tag/Tag.js +5 -5
- package/dist/distributeur/Title/Title.d.ts +4 -3
- package/dist/distributeur/Title/Title.js +5 -5
- 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 +13 -21
- package/dist/distributeur.js +12 -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.d.ts +1 -2
- package/dist/prospect-client/Divider/DividerCommon.js +3 -3
- 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/CardCheckboxOption/CardCheckboxOptionCommon.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionCommon.js +3 -3
- package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.d.ts +2 -3
- package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.js +7 -3
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextApollo.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextApollo.js +2 -3
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.d.ts +5 -6
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.js +5 -5
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextLF.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextLF.js +2 -3
- package/dist/prospect-client/Form/Dropdown/DropdownApollo.js +1 -1
- package/dist/prospect-client/Form/Dropdown/DropdownCommon.d.ts +7 -13
- package/dist/prospect-client/Form/Dropdown/DropdownCommon.js +6 -6
- package/dist/prospect-client/Form/Dropdown/DropdownLF.js +1 -1
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadApollo.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadApollo.js +1 -2
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadCommon.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadCommon.js +4 -4
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadLF.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadLF.js +1 -2
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileApollo.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileApollo.js +4 -5
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileCommon.d.ts +5 -2
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileCommon.js +5 -7
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileLF.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileLF.js +2 -3
- 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.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateApollo.js +2 -3
- package/dist/prospect-client/Form/InputDate/InputDateAtom.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateAtom.js +2 -2
- package/dist/prospect-client/Form/InputDate/InputDateCommon.d.ts +7 -13
- package/dist/prospect-client/Form/InputDate/InputDateCommon.js +8 -9
- package/dist/prospect-client/Form/InputDate/InputDateLF.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateLF.js +2 -3
- package/dist/prospect-client/Form/InputDate/InputDateTextAtom.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateTextAtom.js +4 -4
- package/dist/prospect-client/Form/InputPhone/InputPhoneApollo.js +1 -1
- package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.d.ts +7 -13
- package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.js +12 -8
- package/dist/prospect-client/Form/InputPhone/InputPhoneLF.js +1 -1
- package/dist/prospect-client/Form/InputText/InputTextApollo.d.ts +4 -1
- package/dist/prospect-client/Form/InputText/InputTextApollo.js +2 -3
- package/dist/prospect-client/Form/InputText/InputTextCommon.d.ts +7 -13
- package/dist/prospect-client/Form/InputText/InputTextCommon.js +9 -8
- package/dist/prospect-client/Form/InputText/InputTextLF.d.ts +4 -1
- package/dist/prospect-client/Form/InputText/InputTextLF.js +2 -3
- package/dist/prospect-client/Form/InputTextAtom/InputTextAtomCommon.d.ts +4 -2
- package/dist/prospect-client/Form/InputTextAtom/InputTextAtomCommon.js +4 -5
- 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/ItemMultiSelect/ItemMultiSelectApollo.d.ts +7 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectApollo.js +6 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectCommon.d.ts +8 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectCommon.js +9 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectLF.d.ts +7 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectLF.js +6 -0
- 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/CardRadioApollo.d.ts +3 -0
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioApollo.js +6 -0
- package/dist/prospect-client/Form/Radio/{CardRadioOption/CardRadioOptionCommon.d.ts → CardRadio/CardRadioCommon.d.ts} +7 -8
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.js +16 -0
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioLF.d.ts +3 -0
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioLF.js +6 -0
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupApollo.js +3 -3
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.d.ts +9 -33
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.js +6 -8
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF.js +3 -3
- package/dist/prospect-client/Form/Radio/Radio/RadioCommon.d.ts +2 -2
- package/dist/prospect-client/Form/Radio/Radio/RadioCommon.js +7 -5
- package/dist/prospect-client/Form/TextArea/TextAreaApollo.d.ts +4 -1
- package/dist/prospect-client/Form/TextArea/TextAreaApollo.js +2 -3
- package/dist/prospect-client/Form/TextArea/TextAreaCommon.d.ts +7 -8
- package/dist/prospect-client/Form/TextArea/TextAreaCommon.js +6 -6
- package/dist/prospect-client/Form/TextArea/TextAreaLF.d.ts +4 -1
- package/dist/prospect-client/Form/TextArea/TextAreaLF.js +2 -3
- 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/ItemMenu/ItemMenuApollo.d.ts +2 -0
- package/dist/prospect-client/ItemMenu/ItemMenuApollo.js +2 -0
- package/dist/prospect-client/ItemMenu/ItemMenuCommon.d.ts +22 -0
- package/dist/prospect-client/ItemMenu/ItemMenuCommon.js +18 -0
- package/dist/prospect-client/ItemMenu/ItemMenuLF.d.ts +2 -0
- package/dist/prospect-client/ItemMenu/ItemMenuLF.js +2 -0
- package/dist/prospect-client/ItemTabBar/ItemTabBarCommon.d.ts +4 -1
- package/dist/prospect-client/ItemTabBar/ItemTabBarCommon.js +9 -6
- 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/Loader/LoaderCommon.d.ts +4 -1
- package/dist/prospect-client/Loader/LoaderCommon.js +4 -4
- 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 +4 -1
- package/dist/prospect-client/Modal/ModalApollo.js +2 -5
- package/dist/prospect-client/Modal/ModalCommon.d.ts +4 -1
- package/dist/prospect-client/Modal/ModalCommon.js +1 -2
- package/dist/prospect-client/Modal/ModalLF.d.ts +4 -1
- package/dist/prospect-client/Modal/ModalLF.js +2 -5
- package/dist/prospect-client/Modal/components/ModalCore.d.ts +4 -1
- package/dist/prospect-client/Modal/components/ModalCore.js +3 -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/TabBar/TabBarCommon.js +6 -3
- package/dist/prospect-client/TabMenu/TabMenu.d.ts +36 -0
- package/dist/prospect-client/TabMenu/TabMenu.helpers.d.ts +1 -0
- package/dist/prospect-client/TabMenu/TabMenu.helpers.js +12 -0
- package/dist/prospect-client/TabMenu/TabMenu.js +39 -0
- package/dist/prospect-client/Tag/TagCommon.js +6 -2
- package/dist/prospect-client/TagList/TagListApollo.d.ts +4 -0
- package/dist/prospect-client/TagList/TagListApollo.js +5 -0
- package/dist/prospect-client/TagList/TagListCommon.d.ts +10 -0
- package/dist/prospect-client/TagList/TagListCommon.js +16 -0
- package/dist/prospect-client/TagList/TagListLF.d.ts +4 -0
- package/dist/prospect-client/TagList/TagListLF.js +5 -0
- package/dist/prospect-client/Toggle/ToggleApollo.d.ts +4 -1
- package/dist/prospect-client/Toggle/ToggleApollo.js +1 -2
- package/dist/prospect-client/Toggle/ToggleCommon.d.ts +4 -3
- package/dist/prospect-client/Toggle/ToggleCommon.js +5 -5
- package/dist/prospect-client/Toggle/ToggleLF.d.ts +4 -1
- package/dist/prospect-client/Toggle/ToggleLF.js +1 -2
- package/dist/prospect.d.ts +17 -11
- package/dist/prospect.js +17 -11
- package/package.json +3 -3
- package/dist/distributeur/Form/Pass/Pass.d.ts +0 -12
- 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 -23
- package/dist/distributeur/Form/Select/SelectDefaultWithOptions.js +0 -39
- 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/Form/Radio/CardRadioOption/CardRadioOptionApollo.d.ts +0 -3
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionApollo.js +0 -6
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionCommon.js +0 -16
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionLF.d.ts +0 -3
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionLF.js +0 -6
- 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,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as _createElement } from "react";
|
|
3
|
-
import React, {
|
|
3
|
+
import React, {} from "react";
|
|
4
4
|
import { CheckboxItem } from "./CheckboxItem";
|
|
5
5
|
import { CheckboxModes } from "./CheckboxModes";
|
|
6
|
+
import { getClassName } from "../../utilities";
|
|
6
7
|
const defaultClassName = (mode) => {
|
|
7
8
|
switch (mode) {
|
|
8
9
|
case CheckboxModes.default:
|
|
@@ -13,18 +14,22 @@ const defaultClassName = (mode) => {
|
|
|
13
14
|
return `af-form__checkbox-${mode}`;
|
|
14
15
|
}
|
|
15
16
|
};
|
|
16
|
-
const CheckboxInner =
|
|
17
|
-
const
|
|
17
|
+
const CheckboxInner = ({ id, name, options, disabled, children, values = [], mode = CheckboxModes.default, onChange = () => { }, className, ...otherProps }) => {
|
|
18
|
+
const itemClassName = defaultClassName(mode);
|
|
19
|
+
const componentClassName = getClassName({
|
|
20
|
+
baseClassName: "af-form__checkbox-container",
|
|
21
|
+
className,
|
|
22
|
+
});
|
|
18
23
|
const handleOnChange = ({ target: { value, checked }, }) => {
|
|
19
24
|
const newValues = checked
|
|
20
25
|
? [...values, value]
|
|
21
26
|
: values.filter((v) => v !== value);
|
|
22
27
|
onChange({ values: newValues, target: { value, checked }, id, name });
|
|
23
28
|
};
|
|
24
|
-
return (_jsx("div", { className:
|
|
29
|
+
return (_jsx("div", { className: componentClassName, children: options.map((option) => {
|
|
25
30
|
const isChecked = values ? values.indexOf(option.value) >= 0 : false;
|
|
26
|
-
return (_createElement(CheckboxItem, { ...otherProps, onChange: handleOnChange, key: option.value, className:
|
|
31
|
+
return (_createElement(CheckboxItem, { ...otherProps, onChange: handleOnChange, key: option.value, className: itemClassName, isChecked: isChecked, name: name, disabled: option.disabled || disabled, ...option }, children));
|
|
27
32
|
}) }));
|
|
28
|
-
}
|
|
33
|
+
};
|
|
29
34
|
CheckboxInner.displayName = "Checkbox";
|
|
30
35
|
export const Checkbox = CheckboxInner;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
2
|
import { type ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Checkbox } from "./Checkbox";
|
|
4
|
-
type Props = Omit<
|
|
5
|
-
declare const CheckboxInput:
|
|
4
|
+
type Props = Omit<ComponentPropsWithRef<typeof Checkbox> & ConsumerFieldProps, "placeholder">;
|
|
5
|
+
declare const CheckboxInput: {
|
|
6
|
+
({ label, mode, options, children, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
6
9
|
export { CheckboxInput };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import {} from "react";
|
|
3
3
|
import { Field, useOptionsWithId } from "../core";
|
|
4
4
|
import { Checkbox } from "./Checkbox";
|
|
5
5
|
import { CheckboxModes } from "./CheckboxModes";
|
|
6
|
-
const CheckboxInput =
|
|
6
|
+
const CheckboxInput = ({ label, mode = "default", options, children, ...otherProps }) => {
|
|
7
7
|
const newOptions = useOptionsWithId(options);
|
|
8
|
-
return (_jsx(Field, { label: label, labelPosition: mode === CheckboxModes.classic ? "top" : "center", roleContainer: "group", ...otherProps, renderInput: ({
|
|
9
|
-
return (_jsxs(_Fragment, { children: [_jsx(Checkbox, { id: id, mode: mode, options: newOptions,
|
|
8
|
+
return (_jsx(Field, { label: label, labelPosition: mode === CheckboxModes.classic ? "top" : "center", roleContainer: "group", ...otherProps, renderInput: ({ inputClassName, id, ariaInvalid, errorId, ...props }) => {
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsx(Checkbox, { id: id, mode: mode, options: newOptions, className: inputClassName, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }), children] }));
|
|
10
10
|
} }));
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
12
|
CheckboxInput.displayName = "CheckboxInput";
|
|
13
13
|
export { CheckboxInput };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Checkbox/Checkbox.css";
|
|
3
|
-
|
|
4
|
-
/** @deprecated Use `className` instead. */
|
|
5
|
-
classModifier?: string;
|
|
3
|
+
type Props = Omit<ComponentPropsWithRef<"input">, "type"> & {
|
|
6
4
|
optionClassName?: string;
|
|
7
5
|
children?: ReactNode;
|
|
8
6
|
label?: ReactNode;
|
|
9
7
|
isChecked?: boolean;
|
|
10
8
|
variant?: "error" | "warning";
|
|
11
|
-
}
|
|
9
|
+
};
|
|
10
|
+
declare const CheckboxItem: {
|
|
11
|
+
({ disabled, value, id, children, label, isChecked, className, variant, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
12
14
|
export { CheckboxItem };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import check from "@material-symbols/svg-700/sharp/check.svg";
|
|
3
|
-
import {
|
|
3
|
+
import { useId } from "react";
|
|
4
4
|
import { getOptionClassName } from "../core";
|
|
5
5
|
import "@axa-fr/canopee-css/distributeur/Form/Checkbox/Checkbox.css";
|
|
6
6
|
import { Svg } from "../../Svg";
|
|
7
|
-
const CheckboxItem =
|
|
7
|
+
const CheckboxItem = ({ disabled = false, value = "", id, children, label, isChecked, className, variant, ...otherProps }) => {
|
|
8
8
|
const newLabel = children || label;
|
|
9
9
|
const generatedId = useId();
|
|
10
10
|
const newId = id ?? generatedId; // id is required on this component
|
|
11
|
-
const optionClassName = getOptionClassName(className ?? "",
|
|
12
|
-
return (_jsxs("div", { className: optionClassName, children: [_jsx("input", { ...otherProps, className: "af-form__input-checkbox", value: value, id: newId, disabled: disabled, checked: isChecked, type: "checkbox"
|
|
13
|
-
}
|
|
11
|
+
const optionClassName = getOptionClassName(className ?? "", "af-form__checkbox", disabled, variant);
|
|
12
|
+
return (_jsxs("div", { className: optionClassName, children: [_jsx("input", { ...otherProps, className: "af-form__input-checkbox", value: value, id: newId, disabled: disabled, checked: isChecked, type: "checkbox" }), _jsxs("label", { className: "af-form__label", htmlFor: newId, children: [_jsx("span", { className: "af-form__indicator", children: _jsx(Svg, { role: "presentation", className: "ok-icon", src: check }) }), _jsx("span", { className: "af-form__description", children: newLabel })] })] }));
|
|
13
|
+
};
|
|
14
14
|
CheckboxItem.displayName = "CheckboxItem";
|
|
15
15
|
export { CheckboxItem };
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
2
|
import { Radio } from "../Radio";
|
|
3
3
|
import { type Option } from "../core";
|
|
4
|
-
type Props = Omit<
|
|
4
|
+
type Props = Omit<ComponentPropsWithRef<typeof Radio>, "options" | "value"> & {
|
|
5
5
|
id: string;
|
|
6
6
|
name?: string;
|
|
7
7
|
options?: Array<Omit<Option, "value"> & {
|
|
8
8
|
value: boolean;
|
|
9
9
|
}>;
|
|
10
10
|
value?: boolean | string;
|
|
11
|
-
/** @deprecated Use `className` instead. */
|
|
12
|
-
classModifier?: string;
|
|
13
11
|
};
|
|
14
|
-
declare const Choice:
|
|
12
|
+
declare const Choice: {
|
|
13
|
+
({ children, value, options, name, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
15
16
|
export { Choice };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useId } from "react";
|
|
3
3
|
import { Radio } from "../Radio";
|
|
4
4
|
import { useOptionsWithId } from "../core";
|
|
5
5
|
const defaultOptions = [
|
|
6
6
|
{ label: "Oui", value: true },
|
|
7
7
|
{ label: "Non", value: false },
|
|
8
8
|
];
|
|
9
|
-
const Choice =
|
|
9
|
+
const Choice = ({ children, value, options = defaultOptions, name, ...otherProps }) => {
|
|
10
10
|
const choiceOptions = useOptionsWithId(options.map((o) => ({
|
|
11
11
|
...o,
|
|
12
12
|
value: `${o.value}`,
|
|
13
13
|
})));
|
|
14
14
|
const generatedId = useId();
|
|
15
|
-
return (_jsx(Radio, { ...otherProps, mode: "default",
|
|
16
|
-
}
|
|
15
|
+
return (_jsx(Radio, { ...otherProps, mode: "default", name: name ?? `choice_${generatedId}`, value: value?.toString(), options: choiceOptions, children: children }));
|
|
16
|
+
};
|
|
17
17
|
Choice.displayName = "Choice";
|
|
18
18
|
export { Choice };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
2
|
import { type ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Choice } from "./Choice";
|
|
4
|
-
type Props =
|
|
5
|
-
declare const ChoiceInput:
|
|
4
|
+
type Props = ComponentPropsWithRef<typeof Choice> & ConsumerFieldProps;
|
|
5
|
+
declare const ChoiceInput: {
|
|
6
|
+
({ label, options, children, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
6
9
|
export { ChoiceInput };
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import {} from "react";
|
|
3
3
|
import { Field } from "../core";
|
|
4
4
|
import { Choice } from "./Choice";
|
|
5
5
|
const defaultOptions = [
|
|
6
6
|
{ label: "Oui", value: true },
|
|
7
7
|
{ label: "Non", value: false },
|
|
8
8
|
];
|
|
9
|
-
const ChoiceInput =
|
|
10
|
-
return (_jsx(Field, { label: label, roleContainer: "radiogroup", ...otherProps, renderInput: ({ classModifier, id, errorId, ariaInvalid, ...props }) => (_jsxs(_Fragment, { children: [_jsx(Choice, { id: id, ref: inputRef, classModifier: classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, options: options, ...props }), children] })) }));
|
|
11
|
-
});
|
|
9
|
+
const ChoiceInput = ({ label, options = defaultOptions, children, ...otherProps }) => (_jsx(Field, { label: label, roleContainer: "radiogroup", ...otherProps, renderInput: ({ inputClassName, id, errorId, ariaInvalid, ...props }) => (_jsxs(_Fragment, { children: [_jsx(Choice, { id: id, className: inputClassName, "aria-describedby": errorId, "aria-invalid": ariaInvalid, options: options, ...props }), children] })) }));
|
|
12
10
|
ChoiceInput.displayName = "ChoiceInput";
|
|
13
11
|
export { ChoiceInput };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Form/Date/Date.css";
|
|
2
2
|
import { type ComponentPropsWithRef } from "react";
|
|
3
3
|
type Props = Omit<ComponentPropsWithRef<"input">, "value"> & {
|
|
4
|
-
/** @deprecated Use `className` and the native `disabled`/`required` props instead. */
|
|
5
|
-
classModifier?: string;
|
|
6
4
|
defaultValue?: Date | string;
|
|
7
5
|
value?: Date | string;
|
|
6
|
+
hasInfobulle?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const Date: {
|
|
9
|
+
({ className, defaultValue, value, hasInfobulle, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
8
11
|
};
|
|
9
|
-
declare const Date: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
12
|
export { Date };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Date/Date.css";
|
|
3
|
-
import {
|
|
3
|
+
import {} from "react";
|
|
4
4
|
import { formatDateInputValue } from "../../utilities/helpers/date";
|
|
5
5
|
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
6
|
-
const Date =
|
|
6
|
+
const Date = ({ className, defaultValue, value, hasInfobulle, ...otherProps }) => {
|
|
7
7
|
const componentClassName = getClassName({
|
|
8
8
|
baseClassName: "af-form__input-date",
|
|
9
|
-
modifiers:
|
|
9
|
+
modifiers: [hasInfobulle && "hasinfobulle"],
|
|
10
10
|
className,
|
|
11
11
|
});
|
|
12
|
-
return (_jsx("input", { className: componentClassName
|
|
13
|
-
}
|
|
12
|
+
return (_jsx("input", { className: `${componentClassName} af-form__input-text`, type: "date", defaultValue: formatDateInputValue(defaultValue), value: formatDateInputValue(value), ...otherProps }));
|
|
13
|
+
};
|
|
14
14
|
Date.displayName = "Date";
|
|
15
15
|
export { Date };
|
|
@@ -4,5 +4,8 @@ import { Date } from "./Date";
|
|
|
4
4
|
type Props = ConsumerFieldProps & ComponentProps<typeof Date> & {
|
|
5
5
|
helpMessage?: ReactNode;
|
|
6
6
|
};
|
|
7
|
-
declare const DateInput:
|
|
7
|
+
declare const DateInput: {
|
|
8
|
+
({ children, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
8
11
|
export { DateInput };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import {} from "react";
|
|
3
3
|
import { Field } from "../core";
|
|
4
4
|
import { Date } from "./Date";
|
|
5
|
-
const DateInput =
|
|
6
|
-
return (_jsx(Field, { classNameSuffix: "date", ...otherProps, renderInput: ({ id, classModifier, ariaInvalid, errorId, ...props }) => (_jsxs(_Fragment, { children: [_jsx(Date, { id: id, classModifier: classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }), children] })) }));
|
|
7
|
-
});
|
|
5
|
+
const DateInput = ({ children, ...otherProps }) => (_jsx(Field, { ...otherProps, renderInput: ({ id, inputClassName, ariaInvalid, errorId, ...props }) => (_jsxs(_Fragment, { children: [_jsx(Date, { id: id, className: inputClassName, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }), children] })) }));
|
|
8
6
|
DateInput.displayName = "DateInput";
|
|
9
7
|
export { DateInput };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
import { Input } from "./Input";
|
|
3
|
+
import type { InputBaseProps } from "./types";
|
|
4
|
+
export type DateInputProps = Omit<ComponentProps<typeof Input>, "children" | "type" | "value" | "defaultValue" | "min" | "max"> & InputBaseProps & {
|
|
5
|
+
/**
|
|
6
|
+
* The value of the date input, as a `Date` or an ISO date string (`YYYY-MM-DD`).
|
|
7
|
+
*/
|
|
8
|
+
value?: Date | string;
|
|
9
|
+
/**
|
|
10
|
+
* The default value of the date input, as a `Date` or an ISO date string (`YYYY-MM-DD`).
|
|
11
|
+
*/
|
|
12
|
+
defaultValue?: Date | string;
|
|
13
|
+
/**
|
|
14
|
+
* The earliest selectable date, as a `Date` or an ISO date string (`YYYY-MM-DD`).
|
|
15
|
+
*/
|
|
16
|
+
min?: Date | string;
|
|
17
|
+
/**
|
|
18
|
+
* The latest selectable date, as a `Date` or an ISO date string (`YYYY-MM-DD`).
|
|
19
|
+
*/
|
|
20
|
+
max?: Date | string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* This component renders a label, a date input field and optionnally help and error messages.
|
|
24
|
+
* It can be customized to render the label on top, or on the left of the input.
|
|
25
|
+
* It also supports adding a unit on the right of the input.
|
|
26
|
+
*/
|
|
27
|
+
declare const DateInput: {
|
|
28
|
+
({ contentRight, id, labelPosition, inputClassName: inputClassNameProp, labelClassName: labelClassNameProp, helpMessage, containerClassName, required, label, errorMessage, value, defaultValue, min, max, ...props }: DateInputProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
export { DateInput };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {} from "react";
|
|
3
|
+
import { formatDateInputValue } from "../../utilities/helpers/date";
|
|
4
|
+
import { Input } from "./Input";
|
|
5
|
+
import { InputContainer } from "./InputContainer";
|
|
6
|
+
import { InputUnit } from "./InputUnit";
|
|
7
|
+
import { ItemMessage } from "./ItemMessage";
|
|
8
|
+
import { Label } from "./Label";
|
|
9
|
+
import { useInput } from "./useInput.hook";
|
|
10
|
+
/**
|
|
11
|
+
* This component renders a label, a date input field and optionnally help and error messages.
|
|
12
|
+
* It can be customized to render the label on top, or on the left of the input.
|
|
13
|
+
* It also supports adding a unit on the right of the input.
|
|
14
|
+
*/
|
|
15
|
+
const DateInput = ({ contentRight, id, labelPosition, inputClassName: inputClassNameProp, labelClassName: labelClassNameProp, helpMessage, containerClassName, required, label, errorMessage, value, defaultValue, min, max, ...props }) => {
|
|
16
|
+
const { describedBy, errorId, helperId, inputClassName, inputId, isContainerVertical, isInvalid, labelClassName, } = useInput({
|
|
17
|
+
id,
|
|
18
|
+
labelPosition,
|
|
19
|
+
inputClassName: inputClassNameProp,
|
|
20
|
+
labelClassName: labelClassNameProp,
|
|
21
|
+
errorMessage,
|
|
22
|
+
helpMessage,
|
|
23
|
+
});
|
|
24
|
+
return (_jsxs(InputContainer, { vertical: isContainerVertical, className: containerClassName, children: [_jsx(Label, { htmlFor: inputId, required: required, className: labelClassName, children: label }), _jsx(Input, { ...props, type: "date", value: formatDateInputValue(value), defaultValue: formatDateInputValue(defaultValue), min: formatDateInputValue(min), max: formatDateInputValue(max), className: inputClassName, id: inputId, "aria-describedby": describedBy, "aria-invalid": isInvalid }), contentRight ? _jsx(InputUnit, { children: contentRight }) : null, helpMessage ? (_jsx(ItemMessage, { id: helperId, children: helpMessage })) : null, errorMessage ? (_jsx(ItemMessage, { variant: "error", id: errorId, children: errorMessage })) : null] }));
|
|
25
|
+
};
|
|
26
|
+
DateInput.displayName = "DateInput";
|
|
27
|
+
export { DateInput };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Input.css";
|
|
2
|
-
|
|
2
|
+
import { type ComponentPropsWithRef } from "react";
|
|
3
|
+
declare const Input: {
|
|
4
|
+
({ className, ...otherProps }: ComponentPropsWithRef<"input">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
3
7
|
export { Input };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Input.css";
|
|
3
|
-
import {
|
|
3
|
+
import {} from "react";
|
|
4
4
|
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
5
|
-
const Input =
|
|
5
|
+
const Input = ({ className, ...otherProps }) => {
|
|
6
6
|
const componentClassName = getClassName({
|
|
7
7
|
baseClassName: "af-input__input",
|
|
8
8
|
className,
|
|
9
9
|
});
|
|
10
|
-
return
|
|
11
|
-
}
|
|
10
|
+
return _jsx("input", { className: componentClassName, ...otherProps });
|
|
11
|
+
};
|
|
12
12
|
Input.displayName = "Input";
|
|
13
13
|
export { Input };
|
|
@@ -3,6 +3,9 @@ import type { PropsWithChildren } from "react";
|
|
|
3
3
|
type InputContainerProps = PropsWithChildren<{
|
|
4
4
|
vertical?: boolean;
|
|
5
5
|
className?: string;
|
|
6
|
+
component?: "div" | "fieldset";
|
|
7
|
+
"aria-labelledby"?: string;
|
|
8
|
+
"aria-describedby"?: string;
|
|
6
9
|
}>;
|
|
7
|
-
export declare const InputContainer: ({ children, vertical, className, }: InputContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const InputContainer: ({ children, vertical, className, component: Component, ...props }: InputContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
11
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Experimental/InputContainer.css";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
-
export const InputContainer = ({ children, vertical, className, }) => {
|
|
4
|
+
export const InputContainer = ({ children, vertical, className, component: Component = "div", ...props }) => {
|
|
5
5
|
const containerClass = classNames("af-input__container", { "af-input__container--vertical": vertical }, className);
|
|
6
|
-
return _jsx(
|
|
6
|
+
return (_jsx(Component, { className: containerClass, ...props, children: children }));
|
|
7
7
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Form/Experimental/InputUnit.css";
|
|
2
2
|
import type { PropsWithChildren } from "react";
|
|
3
|
-
export declare const InputUnit: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const InputUnit: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Experimental/InputUnit.css";
|
|
3
|
-
export const InputUnit = ({ children }) =>
|
|
3
|
+
export const InputUnit = ({ children }) => children ? _jsx("span", { className: "af-input__unit", children: children }) : null;
|
|
@@ -24,5 +24,5 @@ type Props = {
|
|
|
24
24
|
*/
|
|
25
25
|
id?: string;
|
|
26
26
|
};
|
|
27
|
-
export declare const ItemMessage: ({ variant, children, className, id }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const ItemMessage: ({ variant, children, className, id }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
28
28
|
export {};
|
|
@@ -15,5 +15,5 @@ export const ItemMessage = ({ variant, children, className, id }) => {
|
|
|
15
15
|
modifiers: [variant],
|
|
16
16
|
});
|
|
17
17
|
const icon = variant ? iconByVariant[variant] : null;
|
|
18
|
-
return (_jsxs("div", { className: componentClassName, id: id, children: [icon ? _jsx(Svg, { src: icon, className: "af-item-message__icon" }) : null, children] }));
|
|
18
|
+
return children ? (_jsxs("div", { className: componentClassName, id: id, children: [icon ? _jsx(Svg, { src: icon, className: "af-item-message__icon" }) : null, children] })) : null;
|
|
19
19
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Label.css";
|
|
2
2
|
import type { ComponentProps } from "react";
|
|
3
|
-
type LabelProps = ComponentProps<"label"> & {
|
|
3
|
+
export type LabelProps = ComponentProps<"label"> & {
|
|
4
4
|
/**
|
|
5
5
|
* Whether the label is required or not.
|
|
6
6
|
* This will add a `*` after the label text.
|
|
@@ -10,4 +10,3 @@ type LabelProps = ComponentProps<"label"> & {
|
|
|
10
10
|
required?: boolean;
|
|
11
11
|
};
|
|
12
12
|
export declare const Label: ({ children, required, ...props }: LabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Label.css";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
export type LegendProps = ComponentProps<"span"> & {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the label is required or not.
|
|
6
|
+
* This will add a `*` after the label text.
|
|
7
|
+
* This is purely presentational and does not enforce any validation logic.
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
required?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const Legend: ({ children, required, ...props }: LegendProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Label.css";
|
|
3
|
+
export const Legend = ({ children, required = false, ...props }) => (_jsxs("span", { className: "af-label", ...props, children: [children, required ? (_jsx("span", { className: "af-label__required", "aria-hidden": true, children: "*" })) : null] }));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Radio.css";
|
|
2
|
+
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Radio/AddRadioCard.css";
|
|
3
|
+
export type AddRadioCardProps = {
|
|
4
|
+
orientation?: "horizontal" | "vertical";
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const AddRadioCard: ({ orientation, onClick, }: AddRadioCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Radio.css";
|
|
3
|
+
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Radio/AddRadioCard.css";
|
|
4
|
+
import AddIcon from "@material-symbols/svg-400/rounded/add_circle-fill.svg";
|
|
5
|
+
import { CardButton } from "../../../CardButton/CardButton";
|
|
6
|
+
import { Svg } from "../../../Svg";
|
|
7
|
+
import { getClassName } from "../../../utilities/helpers/getClassName";
|
|
8
|
+
export const AddRadioCard = ({ orientation = "horizontal", onClick, }) => {
|
|
9
|
+
const addRadioCardClassName = getClassName({
|
|
10
|
+
baseClassName: "af-radio-add-card",
|
|
11
|
+
modifiers: [orientation],
|
|
12
|
+
});
|
|
13
|
+
return (_jsx(CardButton, { className: addRadioCardClassName, onClick: onClick, icon: _jsx(Svg, { src: AddIcon, "aria-hidden": "true", className: "af-basecard__icon" }), orientation: orientation, children: _jsx("span", { className: "af-radiocard__label", children: "Ajouter" }) }));
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Radio.css";
|
|
2
|
+
import type { ChangeEvent, InputHTMLAttributes } from "react";
|
|
3
|
+
export type RadioButtonProps = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
10
|
+
label: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
} & InputHTMLAttributes<HTMLInputElement>;
|
|
13
|
+
export declare const RadioButton: ({ id, name, label, onChange, ...props }: RadioButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Radio.css";
|
|
3
|
+
export const RadioButton = ({ id, name, label, onChange, ...props }) => (_jsxs("label", { className: "af-radio__button", htmlFor: id, children: [label, _jsx("input", { type: "radio", id: id, name: name, onChange: onChange, ...props })] }));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type RadioItemProps } from "./RadioItem";
|
|
3
|
+
export type RadioCardProps = {
|
|
4
|
+
label?: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
action?: ReactNode;
|
|
7
|
+
orientation?: "horizontal" | "vertical";
|
|
8
|
+
name: string;
|
|
9
|
+
} & RadioItemProps;
|
|
10
|
+
export declare const RadioCard: ({ id, icon, label, action, orientation, ...props }: RadioCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {} from "react";
|
|
3
|
+
import { CardButton } from "../../../CardButton/CardButton";
|
|
4
|
+
import { Svg } from "../../../Svg";
|
|
5
|
+
import { RadioItem } from "./RadioItem";
|
|
6
|
+
import { getClassName } from "../../../utilities/helpers/getClassName";
|
|
7
|
+
export const RadioCard = ({ id, icon, label, action, orientation = "horizontal", ...props }) => {
|
|
8
|
+
const radioCardClassName = getClassName({
|
|
9
|
+
baseClassName: "af-radiocard",
|
|
10
|
+
modifiers: [orientation],
|
|
11
|
+
});
|
|
12
|
+
return (_jsxs("div", { className: radioCardClassName, children: [_jsxs(CardButton, { component: "label", htmlFor: id, className: "af-radio__card", orientation: orientation, children: [_jsx(RadioItem, { id: id, ...props }), typeof icon === "string" ? (_jsx(Svg, { className: "af-basecard__icon", src: icon })) : (icon), _jsx("span", { className: "af-radiocard__label", children: label })] }), action ? _jsx("span", { className: "af-radiocard__action", children: action }) : null] }));
|
|
13
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type RadioGroupProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
orientation?: "horizontal" | "vertical";
|
|
6
|
+
variant?: "button" | "card";
|
|
7
|
+
};
|
|
8
|
+
export declare const RadioGroup: ({ children, orientation, variant, className, }: RadioGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getClassName } from "../../../utilities/helpers/getClassName";
|
|
3
|
+
export const RadioGroup = ({ children, orientation = "horizontal", variant = "button", className, }) => {
|
|
4
|
+
const finalClassName = getClassName({
|
|
5
|
+
baseClassName: "af-radio__group",
|
|
6
|
+
modifiers: [orientation, variant],
|
|
7
|
+
className,
|
|
8
|
+
});
|
|
9
|
+
return _jsx("div", { className: finalClassName, children: children });
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { InputBaseProps } from "../types";
|
|
3
|
+
import { type RadioButtonProps } from "./RadioButton";
|
|
4
|
+
import { type RadioCardProps } from "./RadioCard";
|
|
5
|
+
export type RadioInputPropsButtonVariant = InputBaseProps & {
|
|
6
|
+
variant?: "button";
|
|
7
|
+
options: RadioButtonProps[];
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export type RadioInputPropsCardVariant = InputBaseProps & {
|
|
11
|
+
variant: "card";
|
|
12
|
+
showAddButton?: boolean;
|
|
13
|
+
orientation?: "horizontal" | "vertical";
|
|
14
|
+
onAdd: () => void;
|
|
15
|
+
options: RadioCardProps[];
|
|
16
|
+
};
|
|
17
|
+
export type RadioInputProps = RadioInputPropsCardVariant | RadioInputPropsButtonVariant;
|
|
18
|
+
export declare const RadioInput: ({ contentRight, id, labelPosition, inputClassName: inputClassNameProp, labelClassName: labelClassNameProp, helpMessage, containerClassName, required, label, errorMessage, ...props }: RadioInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { InputContainer } from "../InputContainer";
|
|
3
|
+
import { InputUnit } from "../InputUnit";
|
|
4
|
+
import { ItemMessage } from "../ItemMessage";
|
|
5
|
+
import { Legend } from "../Legend";
|
|
6
|
+
import { useInput } from "../useInput.hook";
|
|
7
|
+
import {} from "./RadioButton";
|
|
8
|
+
import {} from "./RadioCard";
|
|
9
|
+
import { RadioGroup } from "./RadioGroup";
|
|
10
|
+
import { RadioInputOptions } from "./_radioInputOptions";
|
|
11
|
+
function getLabelPosition(labelPosition, orientation) {
|
|
12
|
+
if (labelPosition) {
|
|
13
|
+
return labelPosition;
|
|
14
|
+
}
|
|
15
|
+
if (orientation === "vertical") {
|
|
16
|
+
return "topLeft";
|
|
17
|
+
}
|
|
18
|
+
return "centerLeft";
|
|
19
|
+
}
|
|
20
|
+
export const RadioInput = ({ contentRight, id, labelPosition, inputClassName: inputClassNameProp, labelClassName: labelClassNameProp, helpMessage, containerClassName, required, label, errorMessage, ...props }) => {
|
|
21
|
+
const variant = props.variant || "button";
|
|
22
|
+
const { describedBy, errorId, helperId, inputId, isContainerVertical, isInvalid, labelClassName, } = useInput({
|
|
23
|
+
id,
|
|
24
|
+
labelPosition: getLabelPosition(labelPosition, props.variant === "card" ? props.orientation : undefined),
|
|
25
|
+
inputClassName: inputClassNameProp,
|
|
26
|
+
labelClassName: labelClassNameProp,
|
|
27
|
+
errorMessage,
|
|
28
|
+
helpMessage,
|
|
29
|
+
});
|
|
30
|
+
const labelId = `${inputId}-label`;
|
|
31
|
+
return (_jsxs(InputContainer, { vertical: isContainerVertical, className: `${containerClassName} af-radio__input-container`, component: "fieldset", "aria-labelledby": labelId, "aria-describedby": describedBy, children: [_jsx(Legend, { id: labelId, required: required, className: labelClassName, children: label }), _jsx(RadioGroup, { variant: variant, className: inputClassNameProp, orientation: props.variant === "card"
|
|
32
|
+
? props.orientation || "horizontal"
|
|
33
|
+
: undefined, children: _jsx(RadioInputOptions, { inputId: inputId, isInvalid: isInvalid, describedBy: describedBy, ...props }) }), _jsx(InputUnit, { children: contentRight }), _jsx(ItemMessage, { id: helperId, children: helpMessage }), _jsx(ItemMessage, { variant: "error", id: errorId, children: errorMessage })] }));
|
|
34
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Radio.css";
|
|
2
|
+
import type { InputHTMLAttributes } from "react";
|
|
3
|
+
export type RadioItemProps = InputHTMLAttributes<HTMLInputElement>;
|
|
4
|
+
export declare const RadioItem: ({ className, ...props }: RadioItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Radio.css";
|
|
3
|
+
import { getClassName } from "../../../utilities/helpers/getClassName";
|
|
4
|
+
export const RadioItem = ({ className, ...props }) => {
|
|
5
|
+
const finalClassName = getClassName({
|
|
6
|
+
baseClassName: "af-radio__item",
|
|
7
|
+
className,
|
|
8
|
+
});
|
|
9
|
+
return _jsx("input", { type: "radio", className: finalClassName, ...props });
|
|
10
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type RadioItemProps } from "./RadioItem";
|
|
3
|
+
export type RadioTextProps = {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
} & RadioItemProps;
|
|
6
|
+
export declare const RadioText: ({ id, label, ...props }: RadioTextProps) => import("react/jsx-runtime").JSX.Element;
|