@axa-fr/design-system-slash-react 0.2.0-beta.278
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/Accordion/Client/Accordion.d.ts +8 -0
- package/dist/Accordion/Client/Accordion.js +7 -0
- package/dist/Accordion/Client/Accordion.stories.d.ts +8 -0
- package/dist/Accordion/Client/Accordion.stories.js +24 -0
- package/dist/Accordion/Client/AccordionItem.d.ts +6 -0
- package/dist/Accordion/Client/AccordionItem.js +10 -0
- package/dist/Action/Action.d.ts +8 -0
- package/dist/Action/Action.js +7 -0
- package/dist/Action/Action.stories.d.ts +6 -0
- package/dist/Action/Action.stories.js +30 -0
- package/dist/Alert/Alert.agent.d.ts +16 -0
- package/dist/Alert/Alert.agent.js +15 -0
- package/dist/Alert/Alert.agent.stories.d.ts +9 -0
- package/dist/Alert/Alert.agent.stories.js +54 -0
- package/dist/Alert/Alert.client.d.ts +11 -0
- package/dist/Alert/Alert.client.js +24 -0
- package/dist/Alert/Alert.client.stories.d.ts +5 -0
- package/dist/Alert/Alert.client.stories.js +25 -0
- package/dist/Badge/Badge.d.ts +8 -0
- package/dist/Badge/Badge.js +9 -0
- package/dist/Badge/Badge.stories.d.ts +7 -0
- package/dist/Badge/Badge.stories.js +69 -0
- package/dist/Button/Button.agent.d.ts +7 -0
- package/dist/Button/Button.agent.js +10 -0
- package/dist/Button/Button.agent.stories.d.ts +18 -0
- package/dist/Button/Button.agent.stories.js +97 -0
- package/dist/Button/Button.client.d.ts +17 -0
- package/dist/Button/Button.client.js +15 -0
- package/dist/Button/Button.client.stories.d.ts +22 -0
- package/dist/Button/Button.client.stories.js +99 -0
- package/dist/Card/Card.client.d.ts +6 -0
- package/dist/Card/Card.client.js +9 -0
- package/dist/Card/Card.client.stories.d.ts +6 -0
- package/dist/Card/Card.client.stories.js +40 -0
- package/dist/Card/__tests__/Card.client.test.d.ts +1 -0
- package/dist/Card/__tests__/Card.client.test.js +27 -0
- package/dist/Card/index.d.ts +2 -0
- package/dist/Card/index.js +2 -0
- package/dist/Form/Checkbox/Agent/Checkbox.d.ts +23 -0
- package/dist/Form/Checkbox/Agent/Checkbox.js +30 -0
- package/dist/Form/Checkbox/Agent/Checkbox.stories.d.ts +18 -0
- package/dist/Form/Checkbox/Agent/Checkbox.stories.js +108 -0
- package/dist/Form/Checkbox/Agent/CheckboxInput.d.ts +6 -0
- package/dist/Form/Checkbox/Agent/CheckboxInput.js +15 -0
- package/dist/Form/Checkbox/Agent/CheckboxItem.d.ts +10 -0
- package/dist/Form/Checkbox/Agent/CheckboxItem.js +13 -0
- package/dist/Form/Checkbox/Agent/CheckboxModes.d.ts +7 -0
- package/dist/Form/Checkbox/Agent/CheckboxModes.js +8 -0
- package/dist/Form/Checkbox/Agent/index.d.ts +4 -0
- package/dist/Form/Checkbox/Agent/index.js +4 -0
- package/dist/Form/Checkbox/Client/Checkbox.d.ts +7 -0
- package/dist/Form/Checkbox/Client/Checkbox.js +15 -0
- package/dist/Form/Checkbox/Client/Checkbox.stories.d.ts +6 -0
- package/dist/Form/Checkbox/Client/Checkbox.stories.js +38 -0
- package/dist/Form/Checkbox/Client/CheckboxSelect.d.ts +15 -0
- package/dist/Form/Checkbox/Client/CheckboxSelect.js +7 -0
- package/dist/Form/Checkbox/Client/CheckboxSelect.stories.d.ts +6 -0
- package/dist/Form/Checkbox/Client/CheckboxSelect.stories.js +55 -0
- package/dist/Form/Checkbox/Client/index.d.ts +2 -0
- package/dist/Form/Checkbox/Client/index.js +2 -0
- package/dist/Form/Choice/Choice.d.ts +12 -0
- package/dist/Form/Choice/Choice.js +17 -0
- package/dist/Form/Choice/Choice.stories.d.ts +9 -0
- package/dist/Form/Choice/Choice.stories.js +27 -0
- package/dist/Form/Choice/ChoiceInput.d.ts +6 -0
- package/dist/Form/Choice/ChoiceInput.js +19 -0
- package/dist/Form/Choice/ChoiceInput.stories.d.ts +9 -0
- package/dist/Form/Choice/ChoiceInput.stories.js +33 -0
- package/dist/Form/Choice/index.d.ts +2 -0
- package/dist/Form/Choice/index.js +2 -0
- package/dist/Form/Date/Date.d.ts +9 -0
- package/dist/Form/Date/Date.js +21 -0
- package/dist/Form/Date/Date.stories.d.ts +9 -0
- package/dist/Form/Date/Date.stories.js +28 -0
- package/dist/Form/Date/DateInput.d.ts +10 -0
- package/dist/Form/Date/DateInput.js +11 -0
- package/dist/Form/Date/DateInput.stories.d.ts +9 -0
- package/dist/Form/Date/DateInput.stories.js +54 -0
- package/dist/Form/Date/index.d.ts +2 -0
- package/dist/Form/Date/index.js +2 -0
- package/dist/Form/FileUpload/Client/FIleUpload.stories.d.ts +6 -0
- package/dist/Form/FileUpload/Client/FIleUpload.stories.js +54 -0
- package/dist/Form/FileUpload/Client/FileUpload.d.ts +32 -0
- package/dist/Form/FileUpload/Client/FileUpload.js +52 -0
- package/dist/Form/FileUpload/Client/index.d.ts +1 -0
- package/dist/Form/FileUpload/Client/index.js +1 -0
- package/dist/Form/InputError/InputError.d.ts +6 -0
- package/dist/Form/InputError/InputError.js +5 -0
- package/dist/Form/InputError/InputError.stories.d.ts +5 -0
- package/dist/Form/InputError/InputError.stories.js +12 -0
- package/dist/Form/InputError/index.d.ts +1 -0
- package/dist/Form/InputError/index.js +1 -0
- package/dist/Form/MultiSelect/MultiSelect.d.ts +20 -0
- package/dist/Form/MultiSelect/MultiSelect.js +54 -0
- package/dist/Form/MultiSelect/MultiSelect.stories.d.ts +10 -0
- package/dist/Form/MultiSelect/MultiSelect.stories.js +89 -0
- package/dist/Form/MultiSelect/MultiSelectInput.d.ts +9 -0
- package/dist/Form/MultiSelect/MultiSelectInput.js +12 -0
- package/dist/Form/MultiSelect/__tests__/MultiSelect.spec.d.ts +10 -0
- package/dist/Form/MultiSelect/__tests__/MultiSelect.spec.js +15 -0
- package/dist/Form/MultiSelect/__tests__/MultiSelectInput.spec.d.ts +1 -0
- package/dist/Form/MultiSelect/__tests__/MultiSelectInput.spec.js +9 -0
- package/dist/Form/MultiSelect/index.d.ts +2 -0
- package/dist/Form/MultiSelect/index.js +2 -0
- package/dist/Form/Number/Number.d.ts +7 -0
- package/dist/Form/Number/Number.js +12 -0
- package/dist/Form/Number/Number.stories.d.ts +9 -0
- package/dist/Form/Number/Number.stories.js +31 -0
- package/dist/Form/Number/NumberInput.d.ts +12 -0
- package/dist/Form/Number/NumberInput.js +13 -0
- package/dist/Form/Number/NumberInput.stories.d.ts +9 -0
- package/dist/Form/Number/NumberInput.stories.js +39 -0
- package/dist/Form/Number/index.d.ts +2 -0
- package/dist/Form/Number/index.js +2 -0
- package/dist/Form/Pass/Pass.d.ts +9 -0
- package/dist/Form/Pass/Pass.js +10 -0
- package/dist/Form/Pass/Pass.stories.d.ts +5 -0
- package/dist/Form/Pass/Pass.stories.js +32 -0
- package/dist/Form/Pass/PassInput.d.ts +10 -0
- package/dist/Form/Pass/PassInput.js +34 -0
- package/dist/Form/Pass/PassInput.stories.d.ts +5 -0
- package/dist/Form/Pass/PassInput.stories.js +59 -0
- package/dist/Form/Radio/Agent/Radio.d.ts +14 -0
- package/dist/Form/Radio/Agent/Radio.js +25 -0
- package/dist/Form/Radio/Agent/Radio.stories.d.ts +9 -0
- package/dist/Form/Radio/Agent/Radio.stories.js +44 -0
- package/dist/Form/Radio/Agent/RadioInput.d.ts +47 -0
- package/dist/Form/Radio/Agent/RadioInput.js +12 -0
- package/dist/Form/Radio/Agent/RadioInput.stories.d.ts +9 -0
- package/dist/Form/Radio/Agent/RadioInput.stories.js +46 -0
- package/dist/Form/Radio/Agent/RadioItem.d.ts +10 -0
- package/dist/Form/Radio/Agent/RadioItem.js +13 -0
- package/dist/Form/Radio/Agent/RadioItem.stories.d.ts +9 -0
- package/dist/Form/Radio/Agent/RadioItem.stories.js +28 -0
- package/dist/Form/Radio/Agent/index.d.ts +3 -0
- package/dist/Form/Radio/Agent/index.js +3 -0
- package/dist/Form/Radio/Client/Radio.d.ts +7 -0
- package/dist/Form/Radio/Client/Radio.js +14 -0
- package/dist/Form/Radio/Client/Radio.stories.d.ts +6 -0
- package/dist/Form/Radio/Client/Radio.stories.js +38 -0
- package/dist/Form/Radio/Client/RadioSelect.d.ts +17 -0
- package/dist/Form/Radio/Client/RadioSelect.js +16 -0
- package/dist/Form/Radio/Client/RadioSelect.stories.d.ts +6 -0
- package/dist/Form/Radio/Client/RadioSelect.stories.js +52 -0
- package/dist/Form/Radio/Client/index.d.ts +2 -0
- package/dist/Form/Radio/Client/index.js +2 -0
- package/dist/Form/Select/Agent/Select.d.ts +7 -0
- package/dist/Form/Select/Agent/Select.js +10 -0
- package/dist/Form/Select/Agent/Select.stories.d.ts +8 -0
- package/dist/Form/Select/Agent/Select.stories.js +35 -0
- package/dist/Form/Select/Agent/SelectBase.d.ts +8 -0
- package/dist/Form/Select/Agent/SelectBase.js +10 -0
- package/dist/Form/Select/Agent/SelectDefault.d.ts +8 -0
- package/dist/Form/Select/Agent/SelectDefault.js +19 -0
- package/dist/Form/Select/Agent/SelectInput.d.ts +8 -0
- package/dist/Form/Select/Agent/SelectInput.js +12 -0
- package/dist/Form/Select/Agent/SelectInput.stories.d.ts +9 -0
- package/dist/Form/Select/Agent/SelectInput.stories.js +82 -0
- package/dist/Form/Select/Agent/index.d.ts +3 -0
- package/dist/Form/Select/Agent/index.js +3 -0
- package/dist/Form/Select/Client/CustomOption.d.ts +4 -0
- package/dist/Form/Select/Client/CustomOption.js +8 -0
- package/dist/Form/Select/Client/DropdownIndicator.d.ts +4 -0
- package/dist/Form/Select/Client/DropdownIndicator.js +11 -0
- package/dist/Form/Select/Client/Select.d.ts +23 -0
- package/dist/Form/Select/Client/Select.js +27 -0
- package/dist/Form/Select/Client/Select.stories.d.ts +10 -0
- package/dist/Form/Select/Client/Select.stories.js +31 -0
- package/dist/Form/Select/Client/index.d.ts +1 -0
- package/dist/Form/Select/Client/index.js +1 -0
- package/dist/Form/Slider/Slider.agent.d.ts +24 -0
- package/dist/Form/Slider/Slider.agent.js +33 -0
- package/dist/Form/Slider/Slider.agent.stories.d.ts +10 -0
- package/dist/Form/Slider/Slider.agent.stories.js +39 -0
- package/dist/Form/Slider/SliderInput.agent.d.ts +8 -0
- package/dist/Form/Slider/SliderInput.agent.js +10 -0
- package/dist/Form/Slider/SliderInput.agent.stories.d.ts +10 -0
- package/dist/Form/Slider/SliderInput.agent.stories.js +45 -0
- package/dist/Form/Slider/index.d.ts +3 -0
- package/dist/Form/Slider/index.js +3 -0
- package/dist/Form/Text/Agent/Text.d.ts +7 -0
- package/dist/Form/Text/Agent/Text.js +10 -0
- package/dist/Form/Text/Agent/Text.stories.d.ts +9 -0
- package/dist/Form/Text/Agent/Text.stories.js +36 -0
- package/dist/Form/Text/Agent/TextInput.d.ts +11 -0
- package/dist/Form/Text/Agent/TextInput.js +15 -0
- package/dist/Form/Text/Agent/TextInput.stories.d.ts +9 -0
- package/dist/Form/Text/Agent/TextInput.stories.js +127 -0
- package/dist/Form/Text/Agent/index.d.ts +2 -0
- package/dist/Form/Text/Agent/index.js +2 -0
- package/dist/Form/Text/Agent/inputTypes.d.ts +2 -0
- package/dist/Form/Text/Agent/inputTypes.js +5 -0
- package/dist/Form/Text/Client/Text.d.ts +12 -0
- package/dist/Form/Text/Client/Text.js +12 -0
- package/dist/Form/Text/Client/Text.stories.d.ts +8 -0
- package/dist/Form/Text/Client/Text.stories.js +46 -0
- package/dist/Form/Text/Client/index.d.ts +1 -0
- package/dist/Form/Text/Client/index.js +1 -0
- package/dist/Form/Textarea/Textarea.d.ts +5 -0
- package/dist/Form/Textarea/Textarea.js +12 -0
- package/dist/Form/Textarea/Textarea.stories.d.ts +9 -0
- package/dist/Form/Textarea/Textarea.stories.js +31 -0
- package/dist/Form/Textarea/TextareaInput.d.ts +11 -0
- package/dist/Form/Textarea/TextareaInput.js +16 -0
- package/dist/Form/Textarea/TextareaInput.stories.d.ts +6 -0
- package/dist/Form/Textarea/TextareaInput.stories.js +35 -0
- package/dist/Form/Textarea/index.d.ts +2 -0
- package/dist/Form/Textarea/index.js +2 -0
- package/dist/Form/core/Field.d.ts +16 -0
- package/dist/Form/core/Field.js +12 -0
- package/dist/Form/core/FieldError.d.ts +7 -0
- package/dist/Form/core/FieldError.js +8 -0
- package/dist/Form/core/FieldForm.d.ts +59 -0
- package/dist/Form/core/FieldForm.js +151 -0
- package/dist/Form/core/FieldInput.d.ts +9 -0
- package/dist/Form/core/FieldInput.js +9 -0
- package/dist/Form/core/FormClassManager.d.ts +7 -0
- package/dist/Form/core/FormClassManager.js +33 -0
- package/dist/Form/core/HelpMessage.d.ts +7 -0
- package/dist/Form/core/HelpMessage.js +2 -0
- package/dist/Form/core/InputList.d.ts +8 -0
- package/dist/Form/core/InputList.js +4 -0
- package/dist/Form/core/MessageTypes.d.ts +5 -0
- package/dist/Form/core/MessageTypes.js +6 -0
- package/dist/Form/core/getComponentClassName.d.ts +1 -0
- package/dist/Form/core/getComponentClassName.js +27 -0
- package/dist/Form/core/getFirstId.d.ts +2 -0
- package/dist/Form/core/getFirstId.js +1 -0
- package/dist/Form/core/getOptionClassName.d.ts +1 -0
- package/dist/Form/core/getOptionClassName.js +10 -0
- package/dist/Form/core/index.d.ts +31 -0
- package/dist/Form/core/index.js +13 -0
- package/dist/Form/core/useInputClassModifier.d.ts +4 -0
- package/dist/Form/core/useInputClassModifier.js +12 -0
- package/dist/Form/core/useOptionsWithId.d.ts +2 -0
- package/dist/Form/core/useOptionsWithId.js +13 -0
- package/dist/IconBg/IconBg.client.d.ts +9 -0
- package/dist/IconBg/IconBg.client.js +13 -0
- package/dist/IconBg/IconBg.client.stories.d.ts +5 -0
- package/dist/IconBg/IconBg.client.stories.js +23 -0
- package/dist/IconBg/__tests__/IconBg.client.test.d.ts +1 -0
- package/dist/IconBg/__tests__/IconBg.client.test.js +22 -0
- package/dist/IconBg/index.d.ts +2 -0
- package/dist/IconBg/index.js +2 -0
- package/dist/Layout/Footer/Agent/Footer.d.ts +12 -0
- package/dist/Layout/Footer/Agent/Footer.js +6 -0
- package/dist/Layout/Footer/Agent/Footer.stories.d.ts +10 -0
- package/dist/Layout/Footer/Agent/Footer.stories.js +18 -0
- package/dist/Layout/Footer/Agent/index.d.ts +1 -0
- package/dist/Layout/Footer/Agent/index.js +1 -0
- package/dist/Layout/Footer/Client/DynamicIcons.d.ts +4 -0
- package/dist/Layout/Footer/Client/DynamicIcons.js +20 -0
- package/dist/Layout/Footer/Client/Footer.d.ts +14 -0
- package/dist/Layout/Footer/Client/Footer.js +16 -0
- package/dist/Layout/Footer/Client/Footer.stories.d.ts +14 -0
- package/dist/Layout/Footer/Client/Footer.stories.js +48 -0
- package/dist/Layout/Footer/Client/MenuIcons.d.ts +9 -0
- package/dist/Layout/Footer/Client/MenuIcons.js +8 -0
- package/dist/Layout/Footer/Client/MenuLink.d.ts +11 -0
- package/dist/Layout/Footer/Client/MenuLink.js +11 -0
- package/dist/Layout/Header/Agent/Header.agent.d.ts +9 -0
- package/dist/Layout/Header/Agent/Header.agent.js +9 -0
- package/dist/Layout/Header/Agent/Header.agent.stories.d.ts +6 -0
- package/dist/Layout/Header/Agent/Header.agent.stories.js +26 -0
- package/dist/Layout/Header/Agent/Infos/Infos.d.ts +14 -0
- package/dist/Layout/Header/Agent/Infos/Infos.js +10 -0
- package/dist/Layout/Header/Agent/Infos/Infos.stories.d.ts +5 -0
- package/dist/Layout/Header/Agent/Infos/Infos.stories.js +15 -0
- package/dist/Layout/Header/Agent/MenuTitleWrapper/MenuTitleWrapper.d.ts +8 -0
- package/dist/Layout/Header/Agent/MenuTitleWrapper/MenuTitleWrapper.js +14 -0
- package/dist/Layout/Header/Agent/MenuTitleWrapper/MenuTitleWrapper.stories.d.ts +6 -0
- package/dist/Layout/Header/Agent/MenuTitleWrapper/MenuTitleWrapper.stories.js +25 -0
- package/dist/Layout/Header/Agent/Name/Name.d.ts +16 -0
- package/dist/Layout/Header/Agent/Name/Name.js +10 -0
- package/dist/Layout/Header/Agent/Name/Name.stories.d.ts +5 -0
- package/dist/Layout/Header/Agent/Name/Name.stories.js +18 -0
- package/dist/Layout/Header/Agent/NavBar/NavBar.d.ts +12 -0
- package/dist/Layout/Header/Agent/NavBar/NavBar.helpers.d.ts +1 -0
- package/dist/Layout/Header/Agent/NavBar/NavBar.helpers.js +12 -0
- package/dist/Layout/Header/Agent/NavBar/NavBar.js +34 -0
- package/dist/Layout/Header/Agent/NavBar/NavBar.stories.d.ts +9 -0
- package/dist/Layout/Header/Agent/NavBar/NavBar.stories.js +32 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarBase.d.ts +20 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarBase.js +15 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarItem/NavBarItem.d.ts +8 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarItem/NavBarItem.js +54 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarItem/NavBarItem.stories.d.ts +11 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarItem/NavBarItem.stories.js +43 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarItem/NavBarItemBase.d.ts +10 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarItem/NavBarItemBase.helpers.d.ts +1 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarItem/NavBarItemBase.helpers.js +11 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarItem/NavBarItemBase.js +16 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarItem/NavBarItemLink.d.ts +8 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarItem/NavBarItemLink.js +4 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarItem/index.d.ts +3 -0
- package/dist/Layout/Header/Agent/NavBar/NavBarItem/index.js +3 -0
- package/dist/Layout/Header/Agent/NavBar/index.d.ts +4 -0
- package/dist/Layout/Header/Agent/NavBar/index.js +4 -0
- package/dist/Layout/Header/Agent/TitleHeader/TitleHeader.d.ts +13 -0
- package/dist/Layout/Header/Agent/TitleHeader/TitleHeader.helpers.d.ts +1 -0
- package/dist/Layout/Header/Agent/TitleHeader/TitleHeader.helpers.js +8 -0
- package/dist/Layout/Header/Agent/TitleHeader/TitleHeader.js +12 -0
- package/dist/Layout/Header/Agent/TitleHeader/TitleHeader.stories.d.ts +7 -0
- package/dist/Layout/Header/Agent/TitleHeader/TitleHeader.stories.js +45 -0
- package/dist/Layout/Header/Agent/ToggleButton/ToggleButton.d.ts +7 -0
- package/dist/Layout/Header/Agent/ToggleButton/ToggleButton.js +8 -0
- package/dist/Layout/Header/Agent/ToggleButton/ToggleButton.stories.d.ts +6 -0
- package/dist/Layout/Header/Agent/ToggleButton/ToggleButton.stories.js +19 -0
- package/dist/Layout/Header/Agent/User/InnerUser.d.ts +5 -0
- package/dist/Layout/Header/Agent/User/InnerUser.js +3 -0
- package/dist/Layout/Header/Agent/User/User.d.ts +18 -0
- package/dist/Layout/Header/Agent/User/User.js +10 -0
- package/dist/Layout/Header/Agent/User/User.stories.d.ts +6 -0
- package/dist/Layout/Header/Agent/User/User.stories.js +23 -0
- package/dist/Layout/Header/Agent/index.d.ts +7 -0
- package/dist/Layout/Header/Agent/index.js +7 -0
- package/dist/Layout/Header/Client/Header.client.d.ts +10 -0
- package/dist/Layout/Header/Client/Header.client.js +11 -0
- package/dist/Layout/Header/Client/Header.client.stories.d.ts +9 -0
- package/dist/Layout/Header/Client/Header.client.stories.js +57 -0
- package/dist/Layout/Header/Client/NavBar/NavBar.d.ts +8 -0
- package/dist/Layout/Header/Client/NavBar/NavBar.js +13 -0
- package/dist/Layout/Header/Client/NavBar/NavBar.stories.d.ts +8 -0
- package/dist/Layout/Header/Client/NavBar/NavBar.stories.js +22 -0
- package/dist/Layout/Header/Client/NavBar/index.d.ts +1 -0
- package/dist/Layout/Header/Client/NavBar/index.js +1 -0
- package/dist/Layout/Header/Client/PreviousLink/PreviousLink.d.ts +7 -0
- package/dist/Layout/Header/Client/PreviousLink/PreviousLink.js +13 -0
- package/dist/Layout/Header/Client/PreviousLink/PreviousLink.stories.d.ts +8 -0
- package/dist/Layout/Header/Client/PreviousLink/PreviousLink.stories.js +16 -0
- package/dist/Layout/Header/Client/PreviousLink/index.d.ts +1 -0
- package/dist/Layout/Header/Client/PreviousLink/index.js +1 -0
- package/dist/Layout/Header/Client/index.d.ts +1 -0
- package/dist/Layout/Header/Client/index.js +1 -0
- package/dist/Link/Link.client.d.ts +7 -0
- package/dist/Link/Link.client.js +11 -0
- package/dist/Link/Link.client.stories.d.ts +5 -0
- package/dist/Link/Link.client.stories.js +14 -0
- package/dist/List/ClickList/ClickList.client.d.ts +11 -0
- package/dist/List/ClickList/ClickList.client.js +6 -0
- package/dist/List/ClickList/ClickList.client.stories.d.ts +6 -0
- package/dist/List/ClickList/ClickList.client.stories.js +60 -0
- package/dist/List/ClickList/__tests__/ClickList.client.test.d.ts +1 -0
- package/dist/List/ClickList/__tests__/ClickList.client.test.js +18 -0
- package/dist/List/ClickList/index.d.ts +1 -0
- package/dist/List/ClickList/index.js +1 -0
- package/dist/List/ContentTabList/ContentTabItem/ContentTabItem.client.d.ts +6 -0
- package/dist/List/ContentTabList/ContentTabItem/ContentTabItem.client.js +6 -0
- package/dist/List/ContentTabList/ContentTabItem/__tests__/ContentTabItem.client.test.d.ts +1 -0
- package/dist/List/ContentTabList/ContentTabItem/__tests__/ContentTabItem.client.test.js +100 -0
- package/dist/List/ContentTabList/ContentTabItem/index.d.ts +2 -0
- package/dist/List/ContentTabList/ContentTabItem/index.js +1 -0
- package/dist/List/ContentTabList/ContentTabList.client.d.ts +8 -0
- package/dist/List/ContentTabList/ContentTabList.client.js +10 -0
- package/dist/List/ContentTabList/ContentTabList.client.stories.d.ts +7 -0
- package/dist/List/ContentTabList/ContentTabList.client.stories.js +78 -0
- package/dist/List/ContentTabList/__tests__/ContentTabList.client.test.d.ts +1 -0
- package/dist/List/ContentTabList/__tests__/ContentTabList.client.test.js +57 -0
- package/dist/List/ContentTabList/index.d.ts +1 -0
- package/dist/List/ContentTabList/index.js +1 -0
- package/dist/List/List.d.ts +6 -0
- package/dist/List/List.js +9 -0
- package/dist/List/List.stories.d.ts +5 -0
- package/dist/List/List.stories.js +52 -0
- package/dist/List/__tests__/List.test.d.ts +1 -0
- package/dist/List/__tests__/List.test.js +30 -0
- package/dist/List/index.d.ts +1 -0
- package/dist/List/index.js +1 -0
- package/dist/Loader/Client/Loader.d.ts +11 -0
- package/dist/Loader/Client/Loader.js +10 -0
- package/dist/Loader/Client/Loader.stories.d.ts +6 -0
- package/dist/Loader/Client/Loader.stories.js +15 -0
- package/dist/Loader/Client/index.d.ts +1 -0
- package/dist/Loader/Client/index.js +1 -0
- package/dist/ModalAgent/BooleanModal.d.ts +15 -0
- package/dist/ModalAgent/BooleanModal.js +11 -0
- package/dist/ModalAgent/Modal.d.ts +11 -0
- package/dist/ModalAgent/Modal.js +9 -0
- package/dist/ModalAgent/Modal.stories.d.ts +31 -0
- package/dist/ModalAgent/Modal.stories.js +84 -0
- package/dist/ModalAgent/components/Body.d.ts +5 -0
- package/dist/ModalAgent/components/Body.js +7 -0
- package/dist/ModalAgent/components/Footer.d.ts +5 -0
- package/dist/ModalAgent/components/Footer.js +7 -0
- package/dist/ModalAgent/components/Header.d.ts +10 -0
- package/dist/ModalAgent/components/Header.js +7 -0
- package/dist/ModalAgent/components/HeaderBase.d.ts +5 -0
- package/dist/ModalAgent/components/HeaderBase.js +7 -0
- package/dist/ModalAgent/index.d.ts +7 -0
- package/dist/ModalAgent/index.js +7 -0
- package/dist/ModalClient/Modal.client.d.ts +22 -0
- package/dist/ModalClient/Modal.client.js +39 -0
- package/dist/ModalClient/Modal.client.stories.d.ts +20 -0
- package/dist/ModalClient/Modal.client.stories.js +33 -0
- package/dist/Pagination/Pagination.client.d.ts +9 -0
- package/dist/Pagination/Pagination.client.js +15 -0
- package/dist/Pagination/Pagination.client.stories.d.ts +11 -0
- package/dist/Pagination/Pagination.client.stories.js +19 -0
- package/dist/Pagination/PaginationDesktop.client.d.ts +9 -0
- package/dist/Pagination/PaginationDesktop.client.js +31 -0
- package/dist/Pagination/PaginationMobile.client.d.ts +9 -0
- package/dist/Pagination/PaginationMobile.client.js +10 -0
- package/dist/Stepper/Stepper.client.d.ts +12 -0
- package/dist/Stepper/Stepper.client.js +22 -0
- package/dist/Stepper/Stepper.client.stories.d.ts +16 -0
- package/dist/Stepper/Stepper.client.stories.js +23 -0
- package/dist/Steps/Step.d.ts +8 -0
- package/dist/Steps/Step.js +15 -0
- package/dist/Steps/StepBase.d.ts +10 -0
- package/dist/Steps/StepBase.js +7 -0
- package/dist/Steps/StepCurrent.d.ts +5 -0
- package/dist/Steps/StepCurrent.js +4 -0
- package/dist/Steps/StepDisabled.d.ts +5 -0
- package/dist/Steps/StepDisabled.js +4 -0
- package/dist/Steps/StepLink.d.ts +10 -0
- package/dist/Steps/StepLink.js +7 -0
- package/dist/Steps/StepNoLink.d.ts +7 -0
- package/dist/Steps/StepNoLink.js +4 -0
- package/dist/Steps/Steps.d.ts +8 -0
- package/dist/Steps/Steps.js +8 -0
- package/dist/Steps/Steps.stories.d.ts +11 -0
- package/dist/Steps/Steps.stories.js +31 -0
- package/dist/Steps/__tests__/Step.spec.d.ts +1 -0
- package/dist/Steps/__tests__/Step.spec.js +9 -0
- package/dist/Steps/index.d.ts +4 -0
- package/dist/Steps/index.js +4 -0
- package/dist/Svg/Svg.agent.stories.d.ts +7 -0
- package/dist/Svg/Svg.agent.stories.js +38 -0
- package/dist/Svg/Svg.client.stories.d.ts +7 -0
- package/dist/Svg/Svg.client.stories.js +38 -0
- package/dist/Svg/Svg.d.ts +7 -0
- package/dist/Svg/Svg.js +47 -0
- package/dist/Svg/__tests__/Svg.test.d.ts +1 -0
- package/dist/Svg/__tests__/Svg.test.js +38 -0
- package/dist/Svg/index.d.ts +1 -0
- package/dist/Svg/index.js +1 -0
- package/dist/Svg/svgInjector.d.ts +12 -0
- package/dist/Svg/svgInjector.js +28 -0
- package/dist/Table/Pagination/Items.d.ts +14 -0
- package/dist/Table/Pagination/Items.js +13 -0
- package/dist/Table/Pagination/Li.d.ts +10 -0
- package/dist/Table/Pagination/Li.js +17 -0
- package/dist/Table/Pagination/LiPoint.d.ts +7 -0
- package/dist/Table/Pagination/LiPoint.js +8 -0
- package/dist/Table/Pagination/Pager.d.ts +15 -0
- package/dist/Table/Pagination/Pager.js +16 -0
- package/dist/Table/Pagination/PaginationButton.d.ts +12 -0
- package/dist/Table/Pagination/PaginationButton.js +14 -0
- package/dist/Table/Pagination/Paging.d.ts +14 -0
- package/dist/Table/Pagination/Paging.js +21 -0
- package/dist/Table/TBody.d.ts +6 -0
- package/dist/Table/TBody.js +7 -0
- package/dist/Table/THead.d.ts +6 -0
- package/dist/Table/THead.js +7 -0
- package/dist/Table/Table.d.ts +30 -0
- package/dist/Table/Table.js +20 -0
- package/dist/Table/Table.stories.d.ts +7 -0
- package/dist/Table/Table.stories.js +33 -0
- package/dist/Table/Td.d.ts +6 -0
- package/dist/Table/Td.js +7 -0
- package/dist/Table/Th.d.ts +6 -0
- package/dist/Table/Th.js +7 -0
- package/dist/Table/Tr.d.ts +6 -0
- package/dist/Table/Tr.js +7 -0
- package/dist/Table/index.d.ts +7 -0
- package/dist/Table/index.js +7 -0
- package/dist/Tabs/Agent/Tabs.agent.d.ts +8 -0
- package/dist/Tabs/Agent/Tabs.agent.js +6 -0
- package/dist/Tabs/Agent/Tabs.agent.stories.d.ts +6 -0
- package/dist/Tabs/Agent/Tabs.agent.stories.js +29 -0
- package/dist/Tabs/Agent/components/Pane.d.ts +8 -0
- package/dist/Tabs/Agent/components/Pane.js +8 -0
- package/dist/Tabs/Agent/components/Tab.d.ts +10 -0
- package/dist/Tabs/Agent/components/Tab.js +4 -0
- package/dist/Tabs/Agent/components/TabsCore.d.ts +10 -0
- package/dist/Tabs/Agent/components/TabsCore.js +17 -0
- package/dist/Tabs/Agent/components/TabsStateless.d.ts +13 -0
- package/dist/Tabs/Agent/components/TabsStateless.js +10 -0
- package/dist/Tabs/Agent/components/Title.d.ts +15 -0
- package/dist/Tabs/Agent/components/Title.js +13 -0
- package/dist/Tabs/Client/Tabs.client.d.ts +16 -0
- package/dist/Tabs/Client/Tabs.client.js +48 -0
- package/dist/Tabs/Client/Tabs.client.stories.d.ts +17 -0
- package/dist/Tabs/Client/Tabs.client.stories.js +89 -0
- package/dist/Tag/Tag.client.d.ts +6 -0
- package/dist/Tag/Tag.client.js +7 -0
- package/dist/Tag/Tag.client.stories.d.ts +5 -0
- package/dist/Tag/Tag.client.stories.js +22 -0
- package/dist/Tag/__test__/Tag.client.test.d.ts +1 -0
- package/dist/Tag/__test__/Tag.client.test.js +18 -0
- package/dist/Tag/index.d.ts +2 -0
- package/dist/Tag/index.js +2 -0
- package/dist/Title/Title.agent.d.ts +9 -0
- package/dist/Title/Title.agent.js +9 -0
- package/dist/Title/Title.agent.stories.d.ts +13 -0
- package/dist/Title/Title.agent.stories.js +58 -0
- package/dist/Title/__tests__/Title.test.d.ts +1 -0
- package/dist/Title/__tests__/Title.test.js +40 -0
- package/dist/agent.d.ts +25 -0
- package/dist/agent.js +25 -0
- package/dist/assets/svg/facebook.svg +1 -0
- package/dist/assets/svg/linkedin.svg +1 -0
- package/dist/assets/svg/twitterx.svg +1 -0
- package/dist/assets/svg/youtube.svg +1 -0
- package/dist/client.d.ts +26 -0
- package/dist/client.js +24 -0
- package/dist/utilities/hooks/useIsSmallScreen.d.ts +1 -0
- package/dist/utilities/hooks/useIsSmallScreen.js +14 -0
- package/dist/utilities.d.ts +1 -0
- package/dist/utilities.js +1 -0
- package/package.json +123 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { getComponentClassName } from "../agent";
|
|
4
|
+
export const IconBg = ({ children, className, classModifier, isDisabled = false, }) => {
|
|
5
|
+
const componentClassName = useMemo(() => {
|
|
6
|
+
let newClassModifier = classModifier;
|
|
7
|
+
if (isDisabled) {
|
|
8
|
+
newClassModifier += " disabled";
|
|
9
|
+
}
|
|
10
|
+
return getComponentClassName(className, newClassModifier, "af-icon-bg");
|
|
11
|
+
}, [classModifier, isDisabled, className]);
|
|
12
|
+
return _jsx("div", { className: componentClassName, children: children });
|
|
13
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import article from "@material-symbols/svg-400/outlined/article-fill.svg";
|
|
3
|
+
import { IconBg } from ".";
|
|
4
|
+
import { Svg } from "../Svg";
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "Client/Components/IconBg",
|
|
7
|
+
parameters: {
|
|
8
|
+
backgrounds: {
|
|
9
|
+
default: "dark",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
component: IconBg,
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
export const Default = {
|
|
16
|
+
name: "IconBg",
|
|
17
|
+
render: (args) => _jsx(IconBg, { ...args }),
|
|
18
|
+
args: {
|
|
19
|
+
children: _jsx(Svg, { src: article }),
|
|
20
|
+
isDisabled: false,
|
|
21
|
+
classModifier: "secondary",
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import { IconBg } from "..";
|
|
4
|
+
describe("IconBg", () => {
|
|
5
|
+
it("should render children", () => {
|
|
6
|
+
render(_jsx(IconBg, { children: "An IconBg" }));
|
|
7
|
+
const iconBg = screen.getByText("An IconBg");
|
|
8
|
+
expect(iconBg).toHaveClass("af-icon-bg");
|
|
9
|
+
});
|
|
10
|
+
it("should have custom class", () => {
|
|
11
|
+
render(_jsx(IconBg, { className: "custom-class", children: "An IconBg" }));
|
|
12
|
+
expect(screen.getByText("An IconBg")).toHaveClass("custom-class");
|
|
13
|
+
});
|
|
14
|
+
it("should have custom class with modifier", () => {
|
|
15
|
+
render(_jsx(IconBg, { className: "custom-class", classModifier: "modifier", children: "An IconBg" }));
|
|
16
|
+
expect(screen.getByText("An IconBg")).toHaveClass("custom-class custom-class--modifier");
|
|
17
|
+
});
|
|
18
|
+
it("should be disabled", () => {
|
|
19
|
+
render(_jsx(IconBg, { className: "custom-class", isDisabled: true, children: "An IconBg" }));
|
|
20
|
+
expect(screen.getByText("An IconBg")).toHaveClass("custom-class custom-class--disabled");
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Footer/Footer.agent.scss";
|
|
2
|
+
type FooterProps = {
|
|
3
|
+
href?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const Footer: import("react").ForwardRefExoticComponent<FooterProps & {
|
|
10
|
+
children?: import("react").ReactNode | undefined;
|
|
11
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import logo from "@axa-fr/design-system-slash-css/dist/common/assets/logo-axa.svg";
|
|
3
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Footer/Footer.agent.scss";
|
|
4
|
+
import { forwardRef } from "react";
|
|
5
|
+
export const Footer = forwardRef(({ className = "af-footer", href = "https://www.axa.fr/", title = "Site Axa", icon = logo, alt = "Logo Axa", children = `© ${new Date().getFullYear()} AXA Tous droits réservés`, ...props }, ref) => (_jsx("footer", { ref: ref, className: className, ...props, children: _jsxs("div", { className: "container-fluid container", children: [Boolean(icon) && (_jsx("a", { className: "af-logo", href: href, title: title, target: "blank", children: _jsx("img", { className: "af-logo__brand", src: icon, alt: alt }) })), _jsx("div", { className: "af-footer-content", children: children })] }) })));
|
|
6
|
+
Footer.displayName = "Footer";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Footer } from "./Footer";
|
|
3
|
+
declare const meta: Meta<typeof Footer>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type StoryProps = Omit<React.ComponentProps<typeof Footer>, "children"> & {
|
|
6
|
+
children: string;
|
|
7
|
+
};
|
|
8
|
+
type Story = StoryObj<StoryProps>;
|
|
9
|
+
export declare const FooterStory: Story;
|
|
10
|
+
export declare const FooterCoreStory: Story;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Footer } from "./Footer";
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Agent/Components/Footer",
|
|
5
|
+
component: Footer,
|
|
6
|
+
parameters: {
|
|
7
|
+
options: {},
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
export const FooterStory = {
|
|
12
|
+
name: "Default",
|
|
13
|
+
render: ({ children, ...args }) => _jsx(Footer, { ...args, children: children }),
|
|
14
|
+
};
|
|
15
|
+
export const FooterCoreStory = {
|
|
16
|
+
name: "Core with HTML children",
|
|
17
|
+
render: () => (_jsxs(Footer, { children: [_jsx("a", { href: "https://www.axa.fr/", target: "blank", children: _jsx("strong", { children: "@ 2018 AXA" }) }), _jsx("i", { children: "Tous droits r\u00E9serv\u00E9s" })] })),
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Footer } from "./Footer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Footer } from "./Footer";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import facebook from "../../../assets/svg/facebook.svg";
|
|
3
|
+
import linkedin from "../../../assets/svg/linkedin.svg";
|
|
4
|
+
import twitterx from "../../../assets/svg/twitterx.svg";
|
|
5
|
+
import youtube from "../../../assets/svg/youtube.svg";
|
|
6
|
+
import { Svg } from "../../../Svg";
|
|
7
|
+
export const DynamicIcon = ({ iconName, className, }) => {
|
|
8
|
+
switch (iconName) {
|
|
9
|
+
case "facebook":
|
|
10
|
+
return _jsx(Svg, { src: facebook, className: className });
|
|
11
|
+
case "twitter":
|
|
12
|
+
return _jsx(Svg, { src: twitterx, className: className });
|
|
13
|
+
case "youtube":
|
|
14
|
+
return _jsx(Svg, { src: youtube, className: className });
|
|
15
|
+
case "linkedin":
|
|
16
|
+
return _jsx(Svg, { src: linkedin, className: className });
|
|
17
|
+
default:
|
|
18
|
+
return iconName;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/common/reboot.scss";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Footer/Footer.client.scss";
|
|
3
|
+
import { FC } from "react";
|
|
4
|
+
import { SocialMedia } from "./MenuIcons";
|
|
5
|
+
import { Link } from "./MenuLink";
|
|
6
|
+
type Props = {
|
|
7
|
+
links: Link[];
|
|
8
|
+
socialMedias?: SocialMedia[];
|
|
9
|
+
copyright: string;
|
|
10
|
+
expandLinkText: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const Footer: FC<Props>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/common/reboot.scss";
|
|
3
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Footer/Footer.client.scss";
|
|
4
|
+
import expandMore from "@material-symbols/svg-400/outlined/keyboard_arrow_down.svg";
|
|
5
|
+
import classNames from "classnames";
|
|
6
|
+
import { useCallback, useState } from "react";
|
|
7
|
+
import { MenuIcons } from "./MenuIcons";
|
|
8
|
+
import { MenuLink } from "./MenuLink";
|
|
9
|
+
import { Svg } from "../../../Svg";
|
|
10
|
+
export const Footer = ({ links, socialMedias = [], copyright, expandLinkText, id, }) => {
|
|
11
|
+
const [isAboutOpen, setIsAboutOpen] = useState(false);
|
|
12
|
+
const handleClick = useCallback(() => {
|
|
13
|
+
setIsAboutOpen((isOpen) => !isOpen);
|
|
14
|
+
}, []);
|
|
15
|
+
return (_jsxs("footer", { id: id, className: "af-footer", children: [_jsxs("div", { className: "af-footer__footerTop", children: [_jsxs("nav", { className: "af-footer__menuTop", "aria-label": expandLinkText, children: [_jsxs("button", { type: "button", onClick: handleClick, className: "af-footer__menuAboutTrigger", children: [_jsx("span", { className: "af-footer__menuAboutTriggerText", children: expandLinkText }), _jsx(Svg, { src: expandMore, className: classNames("af-footer__icon", "af-footer__iconTrigger", isAboutOpen && "af-footer__iconTrigger--display") })] }), _jsx(MenuLink, { links: links, isAboutOpen: isAboutOpen })] }), _jsx(MenuIcons, { socialMedias: socialMedias })] }), _jsx("div", { className: "af-footer__footerBottom", children: _jsx("div", { className: "af-footer__footerBottomWidth", children: _jsx("span", { className: "af-footer__textCopyright", children: copyright }) }) })] }));
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Footer } from "./Footer";
|
|
3
|
+
import { SocialMedia } from "./MenuIcons";
|
|
4
|
+
import { Link } from "./MenuLink";
|
|
5
|
+
declare const meta: Meta<typeof Footer>;
|
|
6
|
+
export default meta;
|
|
7
|
+
type StoryProps = Omit<React.ComponentProps<typeof Footer>, "links" | "socialMedias" | "copyright" | "expandLinkText"> & {
|
|
8
|
+
links: Link[];
|
|
9
|
+
socialMedias?: SocialMedia[];
|
|
10
|
+
copyright: string;
|
|
11
|
+
expandLinkText: string;
|
|
12
|
+
};
|
|
13
|
+
type Story = StoryObj<StoryProps>;
|
|
14
|
+
export declare const Playground: Story;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Footer } from "./Footer";
|
|
3
|
+
const meta = {
|
|
4
|
+
component: Footer,
|
|
5
|
+
title: "Client/Components/Footer",
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered",
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
export const Playground = {
|
|
12
|
+
name: "Footer",
|
|
13
|
+
render: ({ links, socialMedias, copyright, expandLinkText }) => (_jsx(Footer, { links: links, socialMedias: socialMedias, copyright: copyright, expandLinkText: expandLinkText })),
|
|
14
|
+
args: {
|
|
15
|
+
links: [
|
|
16
|
+
{
|
|
17
|
+
link: "https://www.axa.fr/qui-sommes-nous.html",
|
|
18
|
+
text: "À propos",
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
link: "https://www.axa.fr/configuration-securite/mentions-legales.html",
|
|
22
|
+
text: "Mentions légales",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
link: "https://www.axa.fr/configuration-securite/donnees-personnelles.html",
|
|
26
|
+
text: "Données personnelles",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
link: "https://www.axa.fr/configuration-securite/politique-cookies.html",
|
|
30
|
+
text: "Cookies",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
socialMedias: [
|
|
34
|
+
{ icon: "facebook", link: "https://www.facebook.com/axafrance" },
|
|
35
|
+
{ icon: "twitter", link: "https://twitter.com/AXAFrance" },
|
|
36
|
+
{
|
|
37
|
+
icon: "youtube",
|
|
38
|
+
link: "https://www.youtube.com/user/AXAFranceChaine",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
icon: "linkedin",
|
|
42
|
+
link: "https://www.linkedin.com/company/axa-france/",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
expandLinkText: "Liens utiles",
|
|
46
|
+
copyright: `@AXA ${new Date().getFullYear()} - Tous droits réservés`,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type SocialMedia = {
|
|
2
|
+
icon: "facebook" | "twitter" | "youtube" | "linkedin";
|
|
3
|
+
link: string;
|
|
4
|
+
};
|
|
5
|
+
type MenuIconsProps = {
|
|
6
|
+
socialMedias: SocialMedia[];
|
|
7
|
+
};
|
|
8
|
+
export declare const MenuIcons: ({ socialMedias }: MenuIconsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DynamicIcon } from "./DynamicIcons";
|
|
3
|
+
export const MenuIcons = ({ socialMedias }) => {
|
|
4
|
+
if (socialMedias.length === 0) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
return (_jsx("nav", { className: "af-footer__footerMenuIcons", children: socialMedias.map((socialItem) => (_jsx("a", { "aria-label": `social media ${socialItem.icon}`, className: "af-footer__menuIconLinks", href: socialItem.link, target: "_blank", rel: "noopener noreferrer", children: _jsx(DynamicIcon, { iconName: socialItem.icon }) }, socialItem.icon))) }));
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type Link = {
|
|
2
|
+
link: string;
|
|
3
|
+
text: string;
|
|
4
|
+
openInCurrentTab?: boolean;
|
|
5
|
+
};
|
|
6
|
+
type MenuLinkProps = {
|
|
7
|
+
links: Link[];
|
|
8
|
+
isAboutOpen?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const MenuLink: ({ links, isAboutOpen }: MenuLinkProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { useIsSmallScreen } from "../../../utilities/hooks/useIsSmallScreen";
|
|
4
|
+
const BREAKPOINT_SMALL = 1024;
|
|
5
|
+
export const MenuLink = ({ links, isAboutOpen = false }) => {
|
|
6
|
+
const isSmallScreen = useIsSmallScreen(BREAKPOINT_SMALL);
|
|
7
|
+
if (links.length === 0) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
return (_jsx("div", { className: classNames("af-footer__menuLinks", isAboutOpen && "af-footer__menuLinks--display"), children: links.map((menuItem) => (_jsx("a", { className: "af-footer__linkItem", href: menuItem.link, target: menuItem.openInCurrentTab ? "_top" : "_blank", rel: "noreferrer", tabIndex: isSmallScreen && !isAboutOpen ? -1 : undefined, children: menuItem.text }, menuItem.text))) }));
|
|
11
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Agent/Header.agent.scss";
|
|
3
|
+
type Props = {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
classModifier?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const HeaderAgent: ({ classModifier, className, children }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { HeaderAgent };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Agent/Header.agent.scss";
|
|
3
|
+
import { getComponentClassName } from "../../../agent";
|
|
4
|
+
const defaultClassName = "af-header";
|
|
5
|
+
const HeaderAgent = ({ classModifier, className, children }) => {
|
|
6
|
+
const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
|
|
7
|
+
return (_jsx("div", { className: componentClassName, children: _jsx("div", { className: `container ${defaultClassName}__wrapper`, children: _jsx("header", { className: `${defaultClassName}__content`, role: "banner", children: children }) }) }));
|
|
8
|
+
};
|
|
9
|
+
export { HeaderAgent };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { HeaderAgent } from "./Header.agent";
|
|
3
|
+
declare const meta: Meta<typeof HeaderAgent>;
|
|
4
|
+
export default meta;
|
|
5
|
+
export declare const HeaderWithName: StoryObj<typeof HeaderAgent>;
|
|
6
|
+
export declare const HeaderWithNameAndInfos: StoryObj<typeof HeaderAgent>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import logo from "@axa-fr/design-system-slash-css/dist/common/assets/logo-axa.svg";
|
|
3
|
+
import { HeaderAgent } from "./Header.agent";
|
|
4
|
+
import { Infos } from "./Infos/Infos";
|
|
5
|
+
import { Name } from "./Name/Name";
|
|
6
|
+
const meta = {
|
|
7
|
+
component: HeaderAgent,
|
|
8
|
+
title: "Agent/Components/Header",
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
export const HeaderWithName = {
|
|
12
|
+
name: "Header With Name",
|
|
13
|
+
args: {
|
|
14
|
+
children: (_jsx(Name, { alt: "Logo React", img: logo, onClick: () => { }, subtitle: "Baseline", title: "Nom de l'application" })),
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
export const HeaderWithNameAndInfos = {
|
|
18
|
+
name: "Header With Name And Infos",
|
|
19
|
+
args: {
|
|
20
|
+
children: (_jsxs(_Fragment, { children: [_jsx(Name, { alt: "Logo React", img: logo, onClick: () => { }, subtitle: "Baseline", title: "Nom de l'application" }), _jsx(Infos, { infos: [
|
|
21
|
+
{ word: "Customer :", definition: "0123456789 - NOM" },
|
|
22
|
+
{ word: "Wallet:", definition: "000123456789" },
|
|
23
|
+
{ word: "Status :", definition: "New business" },
|
|
24
|
+
] })] })),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Agent/Infos/Infos.scss";
|
|
3
|
+
export type TInfo = {
|
|
4
|
+
definition: ReactNode;
|
|
5
|
+
id?: string;
|
|
6
|
+
word: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
type InfosProps = {
|
|
9
|
+
classModifier?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
infos: TInfo[];
|
|
12
|
+
};
|
|
13
|
+
declare const Infos: ({ infos, className, classModifier }: InfosProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export { Infos };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Agent/Infos/Infos.scss";
|
|
4
|
+
import { getComponentClassName } from "../../../../agent";
|
|
5
|
+
const defaultClassName = "af-contrat";
|
|
6
|
+
const Infos = ({ infos, className, classModifier }) => {
|
|
7
|
+
const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
|
|
8
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsx("i", { className: "glyphicon glyphicon-info-sign" }), _jsx("dl", { className: `${defaultClassName}__list`, children: infos.map((info) => (_jsxs(Fragment, { children: [_jsx("dt", { className: `${defaultClassName}__word`, children: info.word }), _jsx("dd", { className: `${defaultClassName}__def`, children: info.definition })] }, `info-${info.id}`))) })] }));
|
|
9
|
+
};
|
|
10
|
+
export { Infos };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Infos } from "./Infos";
|
|
2
|
+
const meta = {
|
|
3
|
+
component: Infos,
|
|
4
|
+
title: "Agent/Components/Header/Infos",
|
|
5
|
+
};
|
|
6
|
+
export default meta;
|
|
7
|
+
export const Default = {
|
|
8
|
+
args: {
|
|
9
|
+
infos: [
|
|
10
|
+
{ word: "Customer :", definition: "0123456789 - NOM" },
|
|
11
|
+
{ word: "Wallet:", definition: "000123456789" },
|
|
12
|
+
{ word: "Status :", definition: "New business" },
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type TMenuTitleWrapperProps = {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
menuVisible: boolean;
|
|
4
|
+
subtitle: string;
|
|
5
|
+
title: string;
|
|
6
|
+
};
|
|
7
|
+
declare const MenuTitleWrapper: ({ children, menuVisible, subtitle, title, }: TMenuTitleWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { MenuTitleWrapper };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { NavBar } from "../NavBar";
|
|
4
|
+
import { TitleHeader } from "../TitleHeader/TitleHeader";
|
|
5
|
+
const MenuTitleWrapper = ({ children, menuVisible, subtitle, title, }) => {
|
|
6
|
+
const [isMenuVisible, setIsMenuVisible] = useState(menuVisible);
|
|
7
|
+
const handleClick = useCallback(() => {
|
|
8
|
+
const { body } = document;
|
|
9
|
+
body.classList.toggle("af-menu-open");
|
|
10
|
+
setIsMenuVisible((prev) => !prev);
|
|
11
|
+
}, []);
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsx(NavBar, { isVisible: isMenuVisible, onClick: handleClick, children: children }), _jsx(TitleHeader, { title: title, subtitle: subtitle, toggleMenu: handleClick })] }));
|
|
13
|
+
};
|
|
14
|
+
export { MenuTitleWrapper };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { NavBar } from "../NavBar/NavBar";
|
|
3
|
+
import { MenuTitleWrapper } from "./MenuTitleWrapper";
|
|
4
|
+
declare const meta: Meta<typeof NavBar>;
|
|
5
|
+
export default meta;
|
|
6
|
+
export declare const Default: StoryObj<typeof MenuTitleWrapper>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { NavBar } from "../NavBar/NavBar";
|
|
3
|
+
import { NavBarItem } from "../NavBar/NavBarItem";
|
|
4
|
+
const meta = {
|
|
5
|
+
component: NavBar,
|
|
6
|
+
title: "Agent/Components/Header/MenuTitleWrapper",
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export const Default = {
|
|
10
|
+
args: {
|
|
11
|
+
children: [
|
|
12
|
+
_jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/#", children: "Home" }) }, "home"),
|
|
13
|
+
_jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/forms", children: "Forms" }) }, "forms"),
|
|
14
|
+
_jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/fileupload", children: "Fileupload" }) }, "fileupload"),
|
|
15
|
+
_jsxs(NavBarItem, { className: "af-nav__item af-nav__item--haschild", "aria-haspopup": "true", "aria-expanded": "false", ariaLabel: "Table", actionElt: _jsx("a", { className: "af-nav__link", href: "/table", children: "Table" }), children: [_jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/table/sous-lien-1", children: "Sous lien 1" }) }, "table-1"), _jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/table/sous-lien-2", children: "Sous lien 2" }) }, "table-2"), _jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/table/sous-lien-3", children: "Sous lien 3" }) }, "table-3"), _jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/table/sous-lien-4", children: "Sous lien 4" }) }, "table-4")] }, "table"),
|
|
16
|
+
_jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/accordion", children: "Accordion" }) }, "accordions"),
|
|
17
|
+
_jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/alerts", children: "Alerts" }) }, "alerts"),
|
|
18
|
+
_jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/validation", children: "Validation" }) }, "validation"),
|
|
19
|
+
_jsxs(NavBarItem, { className: "af-nav__item af-nav__item--haschild", "aria-haspopup": "true", "aria-expanded": "false", ariaLabel: "Table", actionElt: _jsx("a", { className: "af-nav__link", href: "/doc", children: "Doc" }), children: [_jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/doc/sous-lien-1", children: "Sous lien 1" }) }, "doc-1"), _jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/doc/sous-lien-2", children: "Sous lien 2" }) }, "doc-2"), _jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/doc/sous-lien-3", children: "Sous lien 3" }) }, "doc-3"), _jsx(NavBarItem, { actionElt: _jsx("a", { className: "af-nav__link", href: "/doc/sous-lien-4", children: "Sous lien 4" }) }, "doc-4")] }, "doc"),
|
|
20
|
+
],
|
|
21
|
+
menuVisible: false,
|
|
22
|
+
subtitle: "Sous titre",
|
|
23
|
+
title: "Toolkit Axa",
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MouseEvent } from "react";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Agent/Name/Name.scss";
|
|
3
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Agent/Logo/Logo.scss";
|
|
4
|
+
type Props = {
|
|
5
|
+
alt?: string;
|
|
6
|
+
classModifier?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
img?: string;
|
|
9
|
+
onClick?: (action: {
|
|
10
|
+
event: MouseEvent<HTMLAnchorElement>;
|
|
11
|
+
}) => void;
|
|
12
|
+
subtitle?: string;
|
|
13
|
+
title: string;
|
|
14
|
+
};
|
|
15
|
+
declare const Name: ({ alt, classModifier, className, img, onClick, subtitle, title, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export { Name };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Agent/Name/Name.scss";
|
|
3
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Agent/Logo/Logo.scss";
|
|
4
|
+
import { getComponentClassName } from "../../../../agent";
|
|
5
|
+
const defaultClassName = "af-header__name";
|
|
6
|
+
const Name = ({ alt = "logo", classModifier, className, img, onClick, subtitle, title, }) => {
|
|
7
|
+
const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
|
|
8
|
+
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("h2", { className: "af-header__title", children: [title, _jsx("span", { className: "af-header__subtitle", children: subtitle })] })] }));
|
|
9
|
+
};
|
|
10
|
+
export { Name };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import logo from "@axa-fr/design-system-slash-css/dist/common/assets/logo-axa.svg";
|
|
2
|
+
import { Name } from "./Name";
|
|
3
|
+
const meta = {
|
|
4
|
+
component: Name,
|
|
5
|
+
title: "Agent/Components/Header/Name",
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Default = {
|
|
9
|
+
args: {
|
|
10
|
+
alt: "Logo React",
|
|
11
|
+
img: logo,
|
|
12
|
+
subtitle: "Baseline",
|
|
13
|
+
title: "Nom de l'application",
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
onClick: { action: "onClick" },
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { type ReactNode } from "react";
|
|
2
|
+
type Props = {
|
|
3
|
+
id?: string;
|
|
4
|
+
toggleMenuId?: string;
|
|
5
|
+
positionInit?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
isVisible: boolean;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
onClick: (event: React.MouseEvent) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const NavBar: ({ positionInit, children, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export { NavBar };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getPosition: (max: number, position: number, direction: string) => number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const getPosition = (max, position, direction) => {
|
|
2
|
+
switch (direction) {
|
|
3
|
+
case "ArrowRight":
|
|
4
|
+
case "ArrowDown":
|
|
5
|
+
return position + 1 < max ? position + 1 : 0;
|
|
6
|
+
case "ArrowLeft":
|
|
7
|
+
case "ArrowUp":
|
|
8
|
+
return position - 1 < 0 ? max - 1 : position - 1;
|
|
9
|
+
default:
|
|
10
|
+
return position;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { isValidElement, useCallback, useMemo, useState, } from "react";
|
|
3
|
+
import { getPosition } from "./NavBar.helpers";
|
|
4
|
+
import { NavBarBase } from "./NavBarBase";
|
|
5
|
+
const NavBar = ({ positionInit = 0, children, ...otherProps }) => {
|
|
6
|
+
const [isMenuFocused, setIsMenuFocused] = useState(false);
|
|
7
|
+
const [position, setPosition] = useState(positionInit);
|
|
8
|
+
const validChildren = useMemo(() => (React.Children.map(children, (child) => isValidElement(child) && child) ?? []).filter((c) => Boolean(c)), [children]);
|
|
9
|
+
const handleKeys = useCallback((key) => {
|
|
10
|
+
if (key === "Escape") {
|
|
11
|
+
setIsMenuFocused(false);
|
|
12
|
+
}
|
|
13
|
+
if (key === "ArrowRight" || key === "ArrowLeft") {
|
|
14
|
+
const newPosition = getPosition(validChildren.length, position, key);
|
|
15
|
+
setPosition(newPosition);
|
|
16
|
+
}
|
|
17
|
+
}, [position, validChildren]);
|
|
18
|
+
return (_jsx(NavBarBase, { ...otherProps, onFocus: () => setIsMenuFocused(true), onBlur: () => setIsMenuFocused(false), handleKeys: handleKeys, isMenuFocused: isMenuFocused, children: React.Children.map(validChildren, (child, index) => {
|
|
19
|
+
const isCurrent = index === position;
|
|
20
|
+
return React.cloneElement(child, {
|
|
21
|
+
key: `NavBarItem`,
|
|
22
|
+
classModifier: [
|
|
23
|
+
child.props.classModifier,
|
|
24
|
+
isCurrent ? "active" : undefined,
|
|
25
|
+
]
|
|
26
|
+
.filter((c) => Boolean(c))
|
|
27
|
+
.join(" "),
|
|
28
|
+
tabIndex: isCurrent ? 0 : -1,
|
|
29
|
+
index,
|
|
30
|
+
hasFocus: isMenuFocused && isCurrent,
|
|
31
|
+
});
|
|
32
|
+
}) }));
|
|
33
|
+
};
|
|
34
|
+
export { NavBar };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type React from "react";
|
|
3
|
+
import { NavBar } from ".";
|
|
4
|
+
declare const meta: Meta<typeof NavBar>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type StoryProps = React.ComponentProps<typeof NavBar>;
|
|
7
|
+
type Story = StoryObj<StoryProps>;
|
|
8
|
+
export declare const NavBarBaseStory: Story;
|
|
9
|
+
export declare const NavBarBaseWithCustomableChildrenStory: Story;
|