@axa-fr/canopee-react 1.8.0 → 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,37 +1,44 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { useId } from "react";
|
|
4
|
-
import { FieldError, FormClassManager, HelpMessage, MessageTypes
|
|
5
|
-
import {
|
|
4
|
+
import { FieldError, FormClassManager, HelpMessage, MessageTypes } from ".";
|
|
5
|
+
import { getClassName } from "../../utilities";
|
|
6
6
|
import { useAriaInvalid } from "./useAriaInvalid";
|
|
7
7
|
function isIdDefined(id) {
|
|
8
8
|
return typeof id === "string" && id.length > 0;
|
|
9
9
|
}
|
|
10
|
-
export const Field = ({ classNameContainerInput = "col-md-10", classNameContainerLabel = "col-md-2", className, label, forceDisplayMessage, message, messageType, required,
|
|
10
|
+
export const Field = ({ classNameContainerInput = "col-md-10", classNameContainerLabel = "col-md-2", className, label, forceDisplayMessage, message, messageType, required, disabled = false, hasInfobulle, helpMessage, id, roleContainer, ariaLabelContainer, isLabelContainerLinkedToInput = true, labelPosition = "center", fieldClassNameSuffix = "text", renderInput, appendChildren, ...otherProps }) => {
|
|
11
11
|
const inputUseId = useId();
|
|
12
12
|
const inputId = isIdDefined(id) ? id : inputUseId;
|
|
13
|
-
const actualRequired = required || classModifier.includes("required");
|
|
14
13
|
const isInvalid = useAriaInvalid(message, forceDisplayMessage, messageType);
|
|
15
14
|
const errorId = forceDisplayMessage || helpMessage ? `${inputId}-description` : undefined;
|
|
16
|
-
const { inputClassModifier, inputFieldClassModifier } = useInputClassModifier(classModifier, disabled, false, actualRequired);
|
|
17
15
|
const labelId = useId();
|
|
18
|
-
if (!isVisible) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
16
|
const isGroup = roleContainer === "radiogroup" || roleContainer === "group";
|
|
22
17
|
const LabelElement = isGroup ? "div" : "label";
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
const fieldModifiers = [
|
|
19
|
+
disabled && "disabled",
|
|
20
|
+
required && "required",
|
|
21
|
+
forceDisplayMessage && FormClassManager.getModifier(messageType),
|
|
22
|
+
];
|
|
23
|
+
const inputClassName = getClassName({
|
|
24
|
+
baseClassName: `af-form__input-${fieldClassNameSuffix}`,
|
|
25
|
+
modifiers: [...fieldModifiers, hasInfobulle && `hasinfobulle`],
|
|
26
|
+
});
|
|
27
|
+
const fieldContainerClassName = getClassName({
|
|
28
|
+
baseClassName: `af-form__${fieldClassNameSuffix}`,
|
|
29
|
+
modifiers: fieldModifiers,
|
|
30
|
+
});
|
|
31
|
+
const groupClassName = getClassName({
|
|
32
|
+
baseClassName: "af-form__group",
|
|
33
|
+
className,
|
|
34
|
+
});
|
|
28
35
|
return (_jsxs("div", { className: classNames("row", groupClassName, {
|
|
29
|
-
"af-form__group--required":
|
|
36
|
+
"af-form__group--required": required,
|
|
30
37
|
"af-form__group--label-top": labelPosition === "top",
|
|
31
38
|
}), role: roleContainer, "aria-invalid": isGroup ? isInvalid : undefined, "aria-required": isGroup ? required : undefined, "aria-label": ariaLabelContainer, "aria-labelledby": isGroup ? labelId : undefined, "aria-errormessage": isGroup && isInvalid ? errorId : undefined, children: [_jsx("div", { className: classNameContainerLabel, children: _jsx(LabelElement, { className: classNames("af-form__group-label", {
|
|
32
|
-
"af-form__group-label--required":
|
|
39
|
+
"af-form__group-label--required": required,
|
|
33
40
|
}), htmlFor: isLabelContainerLinkedToInput ? inputId : undefined, id: labelId, children: label }) }), _jsxs("div", { className: classNameContainerInput, children: [_jsx("div", { className: fieldContainerClassName, children: renderInput({
|
|
34
|
-
|
|
41
|
+
inputClassName,
|
|
35
42
|
id: inputId,
|
|
36
43
|
errorId,
|
|
37
44
|
disabled,
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { getClassName } from "../../utilities";
|
|
3
3
|
import { MessageTypes } from "./MessageTypes";
|
|
4
4
|
const DEFAULT_CLASS_NAME = "af-form__message";
|
|
5
5
|
export const FieldError = ({ message = null, messageType = MessageTypes.error, errorId = undefined, }) => {
|
|
6
|
-
const className =
|
|
6
|
+
const className = getClassName({
|
|
7
|
+
baseClassName: DEFAULT_CLASS_NAME,
|
|
8
|
+
modifiers: [messageType],
|
|
9
|
+
});
|
|
7
10
|
return (message && (_jsxs("small", { className: className, children: [_jsx("span", { className: "glyphicon glyphicon-exclamation-sign" }), _jsx("span", { id: errorId, role: "alert", className: `af-form__${messageType}-text`, children: message })] })));
|
|
8
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getOptionClassName(className: string,
|
|
1
|
+
export declare function getOptionClassName(className: string, defaultClassName: string, disabled: boolean, variant?: string): string;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
2
|
-
export function getOptionClassName(className,
|
|
2
|
+
export function getOptionClassName(className, defaultClassName, disabled, variant) {
|
|
3
3
|
return getClassName({
|
|
4
4
|
baseClassName: className || defaultClassName,
|
|
5
|
-
modifiers: [
|
|
6
|
-
variant,
|
|
7
|
-
...(classModifier?.split(" ") ?? []),
|
|
8
|
-
disabled && "disabled",
|
|
9
|
-
],
|
|
5
|
+
modifiers: [variant, disabled && "disabled"],
|
|
10
6
|
className,
|
|
11
7
|
});
|
|
12
8
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
export { LegacyField } from "./Deprecated/Field";
|
|
3
|
-
export { FieldForm } from "./Deprecated/FieldForm";
|
|
4
|
-
export { FieldInput } from "./Deprecated/FieldInput";
|
|
5
2
|
export { Field } from "./Field";
|
|
6
3
|
export type { ConsumerFieldProps } from "./Field";
|
|
7
4
|
export { FieldError } from "./FieldError";
|
|
@@ -11,16 +8,11 @@ export { InputList } from "./InputList";
|
|
|
11
8
|
export { MessageTypes } from "./MessageTypes";
|
|
12
9
|
export { getFirstId } from "./getFirstId";
|
|
13
10
|
export { getOptionClassName } from "./getOptionClassName";
|
|
14
|
-
export { useInputClassModifier } from "./useInputClassModifier";
|
|
15
11
|
export { useOptionsWithId } from "./useOptionsWithId";
|
|
16
12
|
export type Option = {
|
|
17
13
|
id?: string;
|
|
18
14
|
icon?: ReactNode;
|
|
19
15
|
label: ReactNode;
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated Ne semble pas utilisé
|
|
22
|
-
*/
|
|
23
|
-
description?: ReactNode;
|
|
24
16
|
value: string;
|
|
25
17
|
} & React.InputHTMLAttributes<HTMLInputElement>;
|
|
26
18
|
type BaseFormEvent = {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export { LegacyField } from "./Deprecated/Field";
|
|
2
|
-
export { FieldForm } from "./Deprecated/FieldForm";
|
|
3
|
-
export { FieldInput } from "./Deprecated/FieldInput";
|
|
4
1
|
export { Field } from "./Field";
|
|
5
2
|
export { FieldError } from "./FieldError";
|
|
6
3
|
export { FormClassManager } from "./FormClassManager";
|
|
@@ -9,5 +6,4 @@ export { InputList } from "./InputList";
|
|
|
9
6
|
export { MessageTypes } from "./MessageTypes";
|
|
10
7
|
export { getFirstId } from "./getFirstId";
|
|
11
8
|
export { getOptionClassName } from "./getOptionClassName";
|
|
12
|
-
export { useInputClassModifier } from "./useInputClassModifier";
|
|
13
9
|
export { useOptionsWithId } from "./useOptionsWithId";
|
|
@@ -5,5 +5,5 @@ type HelpProps = Omit<ComponentPropsWithoutRef<typeof Popover>, "popoverElement"
|
|
|
5
5
|
helpButtonContent?: ReactNode;
|
|
6
6
|
variant?: "default" | "inverse";
|
|
7
7
|
};
|
|
8
|
-
export declare const HelpButton: ({ className,
|
|
8
|
+
export declare const HelpButton: ({ className, children, mode, placement, variant, helpButtonContent, }: HelpProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -5,13 +5,11 @@ import info from "@material-symbols/svg-400/rounded/info_i-fill.svg";
|
|
|
5
5
|
import { Popover } from "../Popover";
|
|
6
6
|
import { getClassName } from "../utilities/helpers/getClassName";
|
|
7
7
|
import { Svg } from "../Svg";
|
|
8
|
-
export const HelpButton = ({ className,
|
|
8
|
+
export const HelpButton = ({ className, children, mode = "click", placement = "right", variant = "default", helpButtonContent = _jsx(Svg, { src: info, alt: "Help" }), }) => {
|
|
9
9
|
const buttonClassName = classNames("btn", getClassName({
|
|
10
10
|
baseClassName: "af-btn--circle",
|
|
11
|
-
modifiers: [
|
|
12
|
-
|
|
13
|
-
...(variant === "inverse" ? ["inverse"] : []),
|
|
14
|
-
],
|
|
11
|
+
modifiers: [variant === "inverse" && "inverse"],
|
|
12
|
+
className,
|
|
15
13
|
}));
|
|
16
|
-
return (_jsx(Popover, { className: classNames("af-help-button", className),
|
|
14
|
+
return (_jsx(Popover, { className: classNames("af-help-button", className), placement: placement, mode: mode, popoverElement: children, children: _jsx("div", { className: buttonClassName, children: helpButtonContent }) }));
|
|
17
15
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "@axa-fr/canopee-css/distributeur/ItemFormHelper/ItemFormHelper.css";
|
|
2
|
+
export type ItemFormHelperVariant = "todo" | "inprogress" | "validated";
|
|
3
|
+
export type ItemFormHelperProps = {
|
|
4
|
+
variant: ItemFormHelperVariant;
|
|
5
|
+
label?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const ItemFormHelper: ({ variant, label, className, }: ItemFormHelperProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/distributeur/ItemFormHelper/ItemFormHelper.css";
|
|
3
|
+
import checkSvg from "@material-symbols/svg-400/outlined/check.svg";
|
|
4
|
+
import toDoSvg from "@material-symbols/svg-400/outlined/circle.svg";
|
|
5
|
+
import wipSvg from "@material-symbols/svg-400/outlined/circle-fill.svg";
|
|
6
|
+
import { Svg } from "../Svg";
|
|
7
|
+
import { getClassName } from "../utilities/helpers/getClassName";
|
|
8
|
+
const variants = {
|
|
9
|
+
todo: {
|
|
10
|
+
icon: toDoSvg,
|
|
11
|
+
defaultLabel: "à compléter",
|
|
12
|
+
},
|
|
13
|
+
inprogress: {
|
|
14
|
+
icon: wipSvg,
|
|
15
|
+
defaultLabel: "en cours",
|
|
16
|
+
},
|
|
17
|
+
validated: {
|
|
18
|
+
icon: checkSvg,
|
|
19
|
+
defaultLabel: "validé",
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export const ItemFormHelper = ({ variant, label, className, }) => {
|
|
23
|
+
const { icon, defaultLabel } = variants[variant];
|
|
24
|
+
const displayLabel = label ?? defaultLabel;
|
|
25
|
+
const componentClassName = getClassName({
|
|
26
|
+
baseClassName: "af-item-form-helper",
|
|
27
|
+
modifiers: [variant],
|
|
28
|
+
className,
|
|
29
|
+
});
|
|
30
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsx(Svg, { src: icon, width: 12, height: 12 }), _jsx("span", { children: displayLabel })] }));
|
|
31
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Layout/Footer/Footer.css";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/common/breakpoints.css";
|
|
3
|
+
import { type PropsWithChildren } from "react";
|
|
3
4
|
type FooterProps = {
|
|
4
5
|
href?: string;
|
|
5
6
|
title?: string;
|
|
@@ -8,7 +9,8 @@ type FooterProps = {
|
|
|
8
9
|
className?: string;
|
|
9
10
|
version?: string;
|
|
10
11
|
};
|
|
11
|
-
export declare const Footer:
|
|
12
|
-
children
|
|
13
|
-
|
|
12
|
+
export declare const Footer: {
|
|
13
|
+
({ className, href, title, icon, alt, version, children, ...props }: PropsWithChildren<FooterProps>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
14
16
|
export {};
|
|
@@ -3,6 +3,6 @@ import "@axa-fr/canopee-css/distributeur/Layout/Footer/Footer.css";
|
|
|
3
3
|
import "@axa-fr/canopee-css/distributeur/common/breakpoints.css";
|
|
4
4
|
import logo from "@axa-fr/canopee-css/logo-axa.svg";
|
|
5
5
|
import classNames from "classnames";
|
|
6
|
-
import {
|
|
7
|
-
export const Footer =
|
|
6
|
+
import {} from "react";
|
|
7
|
+
export const Footer = ({ className = "af-footer", href = "https://www.axa.fr/", title = "Site Axa", icon = logo, alt = "Logo Axa", version, children = `© ${new Date().getFullYear()} AXA Tous droits réservés`, ...props }) => (_jsxs("footer", { className: classNames("af-container", className), ...props, children: [Boolean(icon) && (_jsx("a", { className: "af-logo", href: href, title: title, target: "_blank", rel: "noopener noreferrer", children: _jsx("img", { className: "af-logo__brand", src: icon, alt: alt }) })), _jsx("div", { className: "af-footer-content", children: children }), version ? (_jsxs("span", { className: "af-footer-version", children: ["Version ", version] })) : null] }));
|
|
8
8
|
Footer.displayName = "Footer";
|
|
@@ -2,9 +2,7 @@ import "@axa-fr/canopee-css/distributeur/Layout/Header/Header.css";
|
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
type Props = {
|
|
4
4
|
children: ReactNode;
|
|
5
|
-
/** @deprecated Use `className` instead. */
|
|
6
|
-
classModifier?: string;
|
|
7
5
|
className?: string;
|
|
8
6
|
};
|
|
9
|
-
declare const Header: ({
|
|
7
|
+
declare const Header: ({ className, children }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
8
|
export { Header };
|
|
@@ -4,10 +4,9 @@ import classNames from "classnames";
|
|
|
4
4
|
import {} from "react";
|
|
5
5
|
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
6
6
|
const defaultClassName = "af-header";
|
|
7
|
-
const Header = ({
|
|
7
|
+
const Header = ({ className, children }) => {
|
|
8
8
|
const componentClassName = getClassName({
|
|
9
9
|
baseClassName: defaultClassName,
|
|
10
|
-
modifiers: classModifier?.split(" "),
|
|
11
10
|
className,
|
|
12
11
|
});
|
|
13
12
|
return (_jsx("div", { className: classNames("af-container", componentClassName), children: _jsx("header", { className: `${defaultClassName}__content`, role: "banner", children: children }) }));
|
|
@@ -3,7 +3,6 @@ import type { ReactNode } from "react";
|
|
|
3
3
|
import { type AnchorNavBarItem } from "../AnchorNavBar/AnchorNavBar";
|
|
4
4
|
type Props = {
|
|
5
5
|
children?: ReactNode;
|
|
6
|
-
classModifier?: string;
|
|
7
6
|
className?: string;
|
|
8
7
|
isSticky?: boolean;
|
|
9
8
|
contentLeft?: ReactNode;
|
|
@@ -13,5 +12,5 @@ type Props = {
|
|
|
13
12
|
toggleMenu?: () => void;
|
|
14
13
|
anchorNavBarItems?: AnchorNavBarItem[];
|
|
15
14
|
};
|
|
16
|
-
declare const HeaderTitle: ({ children,
|
|
15
|
+
declare const HeaderTitle: ({ children, className, isSticky, contentLeft, contentRight, subtitle, title, toggleMenu, anchorNavBarItems, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
17
16
|
export { HeaderTitle };
|
|
@@ -2,13 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Layout/Header/HeaderTitle/HeaderTitle.css";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { Action } from "../../../Action/Action";
|
|
5
|
-
import {
|
|
5
|
+
import { getClassName } from "../../../utilities";
|
|
6
6
|
import { AnchorNavBar, } from "../AnchorNavBar/AnchorNavBar";
|
|
7
7
|
import { ToggleButton } from "../ToggleButton/ToggleButton";
|
|
8
|
-
import { getClassModifier } from "./HeaderTitle.helpers";
|
|
9
8
|
const defaultClassName = "af-title-bar";
|
|
10
|
-
const HeaderTitle = ({ children,
|
|
11
|
-
const componentClassName =
|
|
9
|
+
const HeaderTitle = ({ children, className, isSticky = true, contentLeft, contentRight, subtitle, title, toggleMenu, anchorNavBarItems, }) => {
|
|
10
|
+
const componentClassName = getClassName({
|
|
11
|
+
baseClassName: defaultClassName,
|
|
12
|
+
modifiers: [isSticky && "sticky"],
|
|
13
|
+
className,
|
|
14
|
+
});
|
|
12
15
|
const isAnchorNavBarPresent = anchorNavBarItems && anchorNavBarItems.length > 0;
|
|
13
16
|
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: classNames("af-container", componentClassName), children: [Boolean(toggleMenu) && (_jsx("div", { className: "burger-container", children: _jsx(ToggleButton, { idControl: "mainmenu", children: _jsx(Action, { className: "btn af-title-bar__mobile-menu af-btn--circle", id: "togglemenu", icon: "menu-hamburger", title: "Toggle menu", onClick: toggleMenu }) }) })), _jsxs("div", { className: `${defaultClassName}__leftSection`, children: [contentLeft, _jsxs("h1", { className: `${defaultClassName}__title`, children: [title, subtitle ? (_jsx("span", { className: `${defaultClassName}__subtitle`, children: subtitle })) : null] }), children] }), contentRight ? (_jsx("div", { className: `${defaultClassName}__rightSection`, children: contentRight })) : null] }), isAnchorNavBarPresent ? (_jsx(AnchorNavBar, { items: anchorNavBarItems })) : null] }));
|
|
14
17
|
};
|
|
@@ -6,10 +6,8 @@ export type TInfo = {
|
|
|
6
6
|
word: ReactNode;
|
|
7
7
|
};
|
|
8
8
|
type InfosProps = {
|
|
9
|
-
/** @deprecated Use `className` instead. */
|
|
10
|
-
classModifier?: string;
|
|
11
9
|
className?: string;
|
|
12
10
|
infos: TInfo[];
|
|
13
11
|
};
|
|
14
|
-
declare const Infos: ({ infos, className
|
|
12
|
+
declare const Infos: ({ infos, className }: InfosProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
13
|
export { Infos };
|
|
@@ -6,10 +6,9 @@ import { getClassName } from "../../../utilities/helpers/getClassName";
|
|
|
6
6
|
import "@axa-fr/canopee-css/distributeur/Layout/Header/Infos/Infos.css";
|
|
7
7
|
import { Svg } from "../../../Svg";
|
|
8
8
|
const defaultClassName = "af-contrat";
|
|
9
|
-
const Infos = ({ infos, className
|
|
9
|
+
const Infos = ({ infos, className }) => {
|
|
10
10
|
const componentClassName = getClassName({
|
|
11
11
|
baseClassName: defaultClassName,
|
|
12
|
-
modifiers: classModifier?.split(" "),
|
|
13
12
|
className,
|
|
14
13
|
});
|
|
15
14
|
return (_jsxs("div", { className: componentClassName, children: [_jsx(Svg, { className: "af-contrat__icon", src: infoIcon, "aria-hidden": "true" }), _jsx("dl", { className: `${defaultClassName}__list`, children: infos.map((info) => {
|
|
@@ -3,8 +3,6 @@ import "@axa-fr/canopee-css/distributeur/Layout/Header/Name/Name.css";
|
|
|
3
3
|
import { type MouseEvent } from "react";
|
|
4
4
|
type Props = {
|
|
5
5
|
alt?: string;
|
|
6
|
-
/** @deprecated Use `className` instead. */
|
|
7
|
-
classModifier?: string;
|
|
8
6
|
className?: string;
|
|
9
7
|
img?: string;
|
|
10
8
|
onClick?: (action: {
|
|
@@ -13,5 +11,5 @@ type Props = {
|
|
|
13
11
|
subtitle?: string;
|
|
14
12
|
title: string;
|
|
15
13
|
};
|
|
16
|
-
declare const Name: ({ alt,
|
|
14
|
+
declare const Name: ({ alt, className, img, onClick, subtitle, title, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
17
15
|
export { Name };
|
|
@@ -4,12 +4,11 @@ import "@axa-fr/canopee-css/distributeur/Layout/Header/Name/Name.css";
|
|
|
4
4
|
import {} from "react";
|
|
5
5
|
import { getClassName } from "../../../utilities/helpers/getClassName";
|
|
6
6
|
const defaultClassName = "af-header__name";
|
|
7
|
-
const Name = ({ alt = "logo",
|
|
7
|
+
const Name = ({ alt = "logo", className, img, onClick, subtitle, title, }) => {
|
|
8
8
|
const componentClassName = getClassName({
|
|
9
9
|
baseClassName: defaultClassName,
|
|
10
|
-
modifiers: classModifier?.split(" "),
|
|
11
10
|
className,
|
|
12
11
|
});
|
|
13
|
-
return (_jsxs("div", { className: componentClassName, children: [_jsx("a", { className: "af-logo", href: "/", onClick: (event) => onClick && onClick({ event }), children: _jsx("img", { className: "af-logo__brand", src: img, alt: alt }) }), _jsxs("
|
|
12
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsx("a", { className: "af-logo", href: "/", onClick: (event) => onClick && onClick({ event }), children: _jsx("img", { className: "af-logo__brand", src: img, alt: alt }) }), _jsxs("p", { className: "af-header__title", children: [title, _jsx("span", { className: "af-header__subtitle", children: subtitle })] })] }));
|
|
14
13
|
};
|
|
15
14
|
export { Name };
|
|
@@ -19,12 +19,7 @@ const NavBar = ({ positionInit = 0, children, ...otherProps }) => {
|
|
|
19
19
|
const isCurrent = index === position;
|
|
20
20
|
return React.cloneElement(child, {
|
|
21
21
|
key: `NavBarItem`,
|
|
22
|
-
|
|
23
|
-
child.props.classModifier,
|
|
24
|
-
isCurrent ? "active" : undefined,
|
|
25
|
-
]
|
|
26
|
-
.filter((c) => Boolean(c))
|
|
27
|
-
.join(" "),
|
|
22
|
+
active: isCurrent,
|
|
28
23
|
tabIndex: isCurrent ? 0 : -1,
|
|
29
24
|
index,
|
|
30
25
|
hasFocus: isMenuFocused && isCurrent,
|
|
@@ -6,8 +6,6 @@ type Props = {
|
|
|
6
6
|
isMenuFocused?: boolean;
|
|
7
7
|
onClick: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
8
8
|
className?: string;
|
|
9
|
-
/** @deprecated Use `className` instead. */
|
|
10
|
-
classModifier?: string;
|
|
11
9
|
handleKeys: (key: string) => void;
|
|
12
10
|
onFocus: (action: {
|
|
13
11
|
e: FocusEvent<HTMLUListElement>;
|
|
@@ -17,5 +15,5 @@ type Props = {
|
|
|
17
15
|
}) => void;
|
|
18
16
|
children?: ReactNode;
|
|
19
17
|
};
|
|
20
|
-
declare const NavBarBase: ({
|
|
18
|
+
declare const NavBarBase: ({ onClick, id, toggleMenuId, isMenuFocused, className, handleKeys, onFocus, onBlur, children, isVisible, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
21
19
|
export { NavBarBase };
|
|
@@ -2,13 +2,17 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { getClassName } from "../../../utilities/helpers/getClassName";
|
|
4
4
|
const defaultClassName = "af-nav-container";
|
|
5
|
-
const NavBarBase = ({
|
|
5
|
+
const NavBarBase = ({ onClick, id = "mainmenu", toggleMenuId = "togglemenu", isMenuFocused, className, handleKeys, onFocus, onBlur, children, isVisible, }) => {
|
|
6
6
|
const componentClassName = getClassName({
|
|
7
7
|
baseClassName: defaultClassName,
|
|
8
|
-
modifiers: classModifier?.split(" "),
|
|
9
8
|
className,
|
|
10
9
|
});
|
|
11
|
-
|
|
10
|
+
const navClassName = getClassName({
|
|
11
|
+
baseClassName: "af-nav",
|
|
12
|
+
modifiers: [isVisible && "open"],
|
|
13
|
+
className: "af-drawer left",
|
|
14
|
+
});
|
|
15
|
+
return (_jsxs("div", { className: classNames("af-container", componentClassName), children: [isVisible ? (_jsx("button", { "aria-controls": id, "aria-haspopup": "true", type: "button", onClick: onClick, className: "mask fade", id: `open-${toggleMenuId}`, "aria-label": "Close Menu" })) : null, _jsxs("nav", { className: navClassName, role: "navigation", "aria-label": "Menu principal", children: [_jsxs("div", { className: "af-nav__aside-header", children: [_jsx("h4", { className: "af-nav__aside-title", children: "Menu" }), _jsx("button", { "aria-controls": id, "aria-haspopup": "true", onClick: onClick, type: "button", className: "af-nav__aside-close", id: `close-${toggleMenuId}`, "aria-label": "Close Menu", children: "\u00D7" })] }), _jsx("ul", { onKeyDown: (e) => {
|
|
12
16
|
e.preventDefault();
|
|
13
17
|
handleKeys(e.key);
|
|
14
18
|
}, onFocus: (e) => {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactElement } from "react";
|
|
2
2
|
import { NavBarItemBase } from "./NavBarItemBase";
|
|
3
3
|
type ChildrenProps = {
|
|
4
|
-
classModifier?: string;
|
|
5
4
|
tabIndex?: number;
|
|
6
5
|
hasFocus?: boolean;
|
|
7
6
|
[key: string]: unknown;
|
|
@@ -9,6 +8,7 @@ type ChildrenProps = {
|
|
|
9
8
|
type Props = Omit<ComponentProps<typeof NavBarItemBase>, "handleKeys" | "isMenuOpen" | "position"> & {
|
|
10
9
|
ariaLabel?: string;
|
|
11
10
|
children?: ReactElement<ChildrenProps> | ReactElement<ChildrenProps>[];
|
|
11
|
+
active?: boolean;
|
|
12
12
|
};
|
|
13
|
-
declare const NavBarItem: ({ children, hasFocus, actionElt, ariaLabel, tabIndex, role, className, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const NavBarItem: ({ children, hasFocus, actionElt, ariaLabel, tabIndex, role, className, active, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export { NavBarItem };
|
|
@@ -2,8 +2,9 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import React, { useCallback, useState, } from "react";
|
|
3
3
|
import { getPosition } from "../NavBar.helpers";
|
|
4
4
|
import { NavBarItemBase } from "./NavBarItemBase";
|
|
5
|
+
import { getClassName } from "../../../../utilities";
|
|
5
6
|
const defaultClassName = "af-nav__item";
|
|
6
|
-
const NavBarItem = ({ children, hasFocus = false, actionElt, ariaLabel = "", tabIndex = -1, role = "menuitem", className =
|
|
7
|
+
const NavBarItem = ({ children, hasFocus = false, actionElt, ariaLabel = "", tabIndex = -1, role = "menuitem", className, active = false, ...otherProps }) => {
|
|
7
8
|
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
8
9
|
const [position, setPosition] = useState(0);
|
|
9
10
|
const moveBykey = useCallback((key) => {
|
|
@@ -44,11 +45,17 @@ const NavBarItem = ({ children, hasFocus = false, actionElt, ariaLabel = "", tab
|
|
|
44
45
|
}
|
|
45
46
|
}, [children, isMenuOpen, position, moveBykey, openMenu, closeMenu]);
|
|
46
47
|
const renderChild = useCallback((child, childIndex) => React.cloneElement(child, {
|
|
47
|
-
|
|
48
|
+
className: child.props.className,
|
|
49
|
+
"aria-current": childIndex === position && isMenuOpen ? "page" : undefined,
|
|
48
50
|
tabIndex: childIndex === position && isMenuOpen ? 0 : -1,
|
|
49
51
|
key: `child${childIndex}`,
|
|
50
52
|
hasFocus: hasFocus && position === childIndex && isMenuOpen,
|
|
51
53
|
}), [position, isMenuOpen, hasFocus]);
|
|
52
|
-
|
|
54
|
+
const componentClassName = getClassName({
|
|
55
|
+
baseClassName: defaultClassName,
|
|
56
|
+
modifiers: [active ? "active" : ""],
|
|
57
|
+
className,
|
|
58
|
+
});
|
|
59
|
+
return (_jsx(NavBarItemBase, { className: componentClassName, role: role, hasFocus: hasFocus, tabIndex: tabIndex, isMenuOpen: isMenuOpen, handleKeys: handleKeys, actionElt: actionElt, ...otherProps, children: children ? (_jsxs(_Fragment, { children: [_jsx("i", { className: "glyphicon glyphicon-arrow-xs-down" }, `icon${tabIndex}`), _jsx("ul", { className: "af-nav__list af-nav__list--children", role: "menu", "aria-label": ariaLabel, children: React.Children.map(children, renderChild) }, `list${tabIndex}`)] })) : null }));
|
|
53
60
|
};
|
|
54
61
|
export { NavBarItem };
|
|
@@ -4,7 +4,6 @@ type Props = HTMLAttributes<HTMLLIElement> & {
|
|
|
4
4
|
handleKeys: (event: KeyboardEvent<HTMLLIElement>) => void;
|
|
5
5
|
hasFocus?: boolean;
|
|
6
6
|
isMenuOpen?: boolean;
|
|
7
|
-
classModifier?: string;
|
|
8
7
|
};
|
|
9
|
-
export declare const NavBarItemBase: ({ tabIndex, role, children, hasFocus, handleKeys, isMenuOpen, className,
|
|
8
|
+
export declare const NavBarItemBase: ({ tabIndex, role, children, hasFocus, handleKeys, isMenuOpen, className, actionElt, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export {};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { getClassName } from "../../../../utilities";
|
|
4
4
|
import { handleLinkFocus } from "./NavBarItemBase.helpers";
|
|
5
|
-
export const NavBarItemBase = ({ tabIndex = -1, role = "menuitem", children, hasFocus, handleKeys, isMenuOpen, className,
|
|
6
|
-
const componentClassName =
|
|
5
|
+
export const NavBarItemBase = ({ tabIndex = -1, role = "menuitem", children, hasFocus, handleKeys, isMenuOpen, className, actionElt, ...otherProps }) => {
|
|
6
|
+
const componentClassName = getClassName({
|
|
7
|
+
baseClassName: "af-nav__item",
|
|
8
|
+
className,
|
|
9
|
+
});
|
|
7
10
|
const ref = useRef(null);
|
|
8
11
|
useEffect(() => {
|
|
9
12
|
handleLinkFocus(ref?.current, hasFocus, isMenuOpen);
|
|
@@ -15,5 +18,5 @@ export const NavBarItemBase = ({ tabIndex = -1, role = "menuitem", children, has
|
|
|
15
18
|
return (_jsxs("li", { className: `${componentClassName} ${openClass}`, role: "none", onKeyDown: (e) => {
|
|
16
19
|
e.preventDefault();
|
|
17
20
|
handleKeys(e);
|
|
18
|
-
}, children: [_jsx(actionElt.type, { ...actionElt.props, ...otherProps, role: role, tabIndex: tabIndex, "aria-expanded": isMenuOpen
|
|
21
|
+
}, children: [_jsx(actionElt.type, { ...actionElt.props, ...otherProps, role: role, tabIndex: tabIndex, "aria-expanded": isMenuOpen }, actionElt.key), children] }));
|
|
19
22
|
};
|
|
@@ -13,16 +13,6 @@ type Props = {
|
|
|
13
13
|
* Children elements to be rendered next to the user's name and role
|
|
14
14
|
*/
|
|
15
15
|
children?: ReactNode;
|
|
16
|
-
/**
|
|
17
|
-
* Class modifier to apply additional styles\
|
|
18
|
-
* @example
|
|
19
|
-
* ```tsx
|
|
20
|
-
* <User classModifier="custom-class" />
|
|
21
|
-
* ```
|
|
22
|
-
* This will apply the class `af-info-user--custom-class` to the component.
|
|
23
|
-
* @deprecated Use `className` instead.
|
|
24
|
-
*/
|
|
25
|
-
classModifier?: string;
|
|
26
16
|
/**
|
|
27
17
|
* classNames to override completely the component's style
|
|
28
18
|
*/
|
|
@@ -57,5 +47,5 @@ type Props = {
|
|
|
57
47
|
*/
|
|
58
48
|
title?: string;
|
|
59
49
|
};
|
|
60
|
-
declare const User: ({ children,
|
|
50
|
+
declare const User: ({ children, className, href, name, path, profile, onClick, title, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
61
51
|
export { User };
|
|
@@ -3,10 +3,9 @@ import "@axa-fr/canopee-css/distributeur/Layout/Header/User/User.css";
|
|
|
3
3
|
import { getClassName } from "../../../utilities/helpers/getClassName";
|
|
4
4
|
import { InnerUser } from "./InnerUser";
|
|
5
5
|
const defaultClassName = "af-info-user";
|
|
6
|
-
const User = ({ children,
|
|
6
|
+
const User = ({ children, className, href, name, path, profile, onClick, title = "Voir mon profil", }) => {
|
|
7
7
|
const componentClassName = getClassName({
|
|
8
8
|
baseClassName: defaultClassName,
|
|
9
|
-
modifiers: classModifier?.split(" "),
|
|
10
9
|
className,
|
|
11
10
|
});
|
|
12
11
|
return (_jsxs("div", { className: componentClassName, children: [href ? (_jsx("a", { "aria-label": "user info link", className: `${defaultClassName}__link`, href: href, title: title, onClick: (event) => onClick && onClick({ path, event }), children: _jsx(InnerUser, { name: name, profile: profile }) })) : (_jsx(InnerUser, { name: name, profile: profile })), children] }));
|
|
@@ -2,4 +2,7 @@ import "@axa-fr/canopee-css/distributeur/Link/Link.css";
|
|
|
2
2
|
import { type CustomLinkProps } from "./CustomLink";
|
|
3
3
|
import { type LinkComponentProps } from "./LinkAnchor";
|
|
4
4
|
export type LinkProps = LinkComponentProps | CustomLinkProps;
|
|
5
|
-
export declare const Link:
|
|
5
|
+
export declare const Link: {
|
|
6
|
+
({ ...props }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Link/Link.css";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { CustomLink } from "./CustomLink";
|
|
5
4
|
import { LinkAnchor } from "./LinkAnchor";
|
|
6
|
-
export const Link =
|
|
5
|
+
export const Link = ({ ...props }) => {
|
|
7
6
|
if ("render" in props) {
|
|
8
7
|
return _jsx(CustomLink, { ...props });
|
|
9
8
|
}
|
|
10
|
-
return _jsx(LinkAnchor, { ...props
|
|
11
|
-
}
|
|
9
|
+
return _jsx(LinkAnchor, { ...props });
|
|
10
|
+
};
|
|
12
11
|
Link.displayName = "Link";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
3
|
-
type AnchorLinkProps = {
|
|
4
|
-
leftIcon?: ReactElement<typeof Svg>;
|
|
5
|
-
rightIcon?: ReactElement<typeof Svg>;
|
|
1
|
+
import { type AnchorHTMLAttributes } from "react";
|
|
2
|
+
import { type ClickableComponentProps } from "../ClickableGhost";
|
|
3
|
+
type AnchorLinkProps = ClickableComponentProps & {
|
|
6
4
|
className?: string;
|
|
7
5
|
disabled?: boolean;
|
|
8
6
|
variant?: "default" | "reverse";
|
|
9
7
|
};
|
|
10
|
-
type LinkComponentProps =
|
|
11
|
-
declare const LinkAnchor:
|
|
8
|
+
type LinkComponentProps = AnchorHTMLAttributes<HTMLAnchorElement> & AnchorLinkProps;
|
|
9
|
+
declare const LinkAnchor: {
|
|
10
|
+
({ className, target, rel, leftIcon, children, rightIcon, disabled, variant, ...restProps }: LinkComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
12
13
|
export { LinkAnchor, type LinkComponentProps };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classnames from "classnames";
|
|
3
|
-
import {
|
|
4
|
-
import { Svg } from "../Svg";
|
|
3
|
+
import {} from "react";
|
|
5
4
|
import { linkClassName } from "./linkClassName";
|
|
6
|
-
|
|
5
|
+
import { ClickableGhost, } from "../ClickableGhost";
|
|
6
|
+
const LinkAnchor = ({ className, target, rel, leftIcon, children, rightIcon, disabled, variant, ...restProps }) => {
|
|
7
7
|
const finalClassName = classnames(linkClassName, className, {
|
|
8
8
|
[`${linkClassName}--reverse`]: variant === "reverse",
|
|
9
9
|
});
|
|
10
|
-
return (_jsxs("a",
|
|
11
|
-
}
|
|
10
|
+
return (_jsxs(ClickableGhost, { component: "a", className: finalClassName, rel: target === "_blank" ? "noopener noreferrer" : rel, "aria-disabled": disabled ?? restProps["aria-disabled"], target: target, ...restProps, children: [leftIcon, children, rightIcon] }));
|
|
11
|
+
};
|
|
12
12
|
LinkAnchor.displayName = "LinkAnchor";
|
|
13
13
|
export { LinkAnchor };
|