@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,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import arrow from "@material-symbols/svg-400/outlined/arrow_right.svg";
|
|
3
|
+
import trash from "@material-symbols/svg-400/outlined/delete.svg";
|
|
4
|
+
import sync from "@material-symbols/svg-400/outlined/sync-fill.svg";
|
|
5
|
+
import { Svg } from "../Svg";
|
|
6
|
+
import { List } from "./List";
|
|
7
|
+
const meta = {
|
|
8
|
+
title: "Client/Components/List",
|
|
9
|
+
component: List,
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export const Default = {
|
|
13
|
+
name: "List",
|
|
14
|
+
render: (args) => _jsx(List, { ...args }),
|
|
15
|
+
args: {
|
|
16
|
+
children: [
|
|
17
|
+
_jsx("div", { children: _jsx("span", { children: "Pr\u00E9nom NOM" }) }, "list-item-1"),
|
|
18
|
+
_jsx("div", { children: _jsx("span", { children: "nom.pr\u00E9nom@mail.fr" }) }, "list-item-2"),
|
|
19
|
+
_jsxs("div", { style: {
|
|
20
|
+
display: "flex",
|
|
21
|
+
flexDirection: "row",
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
gap: "0.5rem",
|
|
24
|
+
}, children: [_jsx(Svg, { src: sync }), _jsxs("div", { style: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
flexDirection: "row",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
justifyContent: "space-between",
|
|
29
|
+
width: "100%",
|
|
30
|
+
}, children: [_jsx("span", { children: "Modifier le profil" }), _jsx(Svg, { src: arrow })] })] }, "list-item-3"),
|
|
31
|
+
_jsx("div", { style: {
|
|
32
|
+
display: "flex",
|
|
33
|
+
flexDirection: "row",
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
gap: "4rem",
|
|
36
|
+
}, children: _jsxs("div", { style: {
|
|
37
|
+
display: "flex",
|
|
38
|
+
flexDirection: "row",
|
|
39
|
+
alignItems: "center",
|
|
40
|
+
gap: "0.5rem",
|
|
41
|
+
}, children: [_jsx(Svg, { src: trash }), _jsx("span", { children: "Supprimer le profil" })] }) }, "list-element-3"),
|
|
42
|
+
],
|
|
43
|
+
classModifier: "",
|
|
44
|
+
},
|
|
45
|
+
argTypes: {
|
|
46
|
+
classModifier: {
|
|
47
|
+
options: ["", "large"],
|
|
48
|
+
control: { type: "select" },
|
|
49
|
+
defaultValue: "",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import { List } from "../List";
|
|
4
|
+
describe("List", () => {
|
|
5
|
+
it("should render children", () => {
|
|
6
|
+
const children = _jsx("div", { children: "Child 1" });
|
|
7
|
+
render(_jsx(List, { children: children }));
|
|
8
|
+
expect(screen.getByRole("list")).toHaveClass("af-list");
|
|
9
|
+
expect(screen.getByText("Child 1")).toBeInTheDocument();
|
|
10
|
+
expect(screen.queryByRole("separator")).toBeNull();
|
|
11
|
+
});
|
|
12
|
+
it("should render with empty children", () => {
|
|
13
|
+
const children = undefined;
|
|
14
|
+
render(_jsx(List, { children: children }));
|
|
15
|
+
expect(screen.getByRole("list")).toHaveClass("af-list");
|
|
16
|
+
expect(screen.queryByRole("separator")).toBeNull();
|
|
17
|
+
});
|
|
18
|
+
it("should render multiple children with separators", () => {
|
|
19
|
+
const children = [
|
|
20
|
+
_jsx("div", { children: "Child 1" }, "1"),
|
|
21
|
+
_jsx("div", { children: "Child 2" }, "2"),
|
|
22
|
+
_jsx("div", { children: "Child 3" }, "3"),
|
|
23
|
+
];
|
|
24
|
+
render(_jsx(List, { children: children }));
|
|
25
|
+
expect(screen.getByText("Child 1")).toBeInTheDocument();
|
|
26
|
+
expect(screen.getByText("Child 2")).toBeInTheDocument();
|
|
27
|
+
expect(screen.getByText("Child 3")).toBeInTheDocument();
|
|
28
|
+
expect(screen.getAllByRole("separator")).toHaveLength(2);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { List } from "./List";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { List } from "./List";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Loader/Loader.client.scss";
|
|
2
|
+
import { ComponentPropsWithRef } from "react";
|
|
3
|
+
type Props = ComponentPropsWithRef<"input"> & {
|
|
4
|
+
size: number;
|
|
5
|
+
border: number;
|
|
6
|
+
};
|
|
7
|
+
declare const Loader: {
|
|
8
|
+
({ size, border }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
export { Loader };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Loader/Loader.client.scss";
|
|
3
|
+
const Loader = ({ size = 60, border = 5 }) => (_jsx("div", { className: "af-loader__container", style: {
|
|
4
|
+
width: `${size}px`,
|
|
5
|
+
height: `${size}px`,
|
|
6
|
+
border: `${border}px solid #f3f3f3`,
|
|
7
|
+
borderTop: `${border}px solid #00008f`,
|
|
8
|
+
}, children: _jsx("div", { className: "af-loader__container-spin", "aria-hidden": "true" }) }));
|
|
9
|
+
Loader.displayName = "Loader";
|
|
10
|
+
export { Loader };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Loader } from "./Loader";
|
|
3
|
+
const meta = {
|
|
4
|
+
component: Loader,
|
|
5
|
+
title: "Client/Components/Loader",
|
|
6
|
+
};
|
|
7
|
+
export default meta;
|
|
8
|
+
export const LoaderStory = {
|
|
9
|
+
name: "Loader",
|
|
10
|
+
render: ({ ...args }) => _jsx(Loader, { ...args }),
|
|
11
|
+
args: {
|
|
12
|
+
size: 60,
|
|
13
|
+
border: 5,
|
|
14
|
+
},
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Loader } from "./Loader";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Loader } from "./Loader";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { type ReactNode, type Ref } from "react";
|
|
2
|
+
import { type HeaderProps } from "./components/Header";
|
|
3
|
+
export type BooleanModalProps = React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement> & HeaderProps & {
|
|
4
|
+
onSubmit: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
5
|
+
onCancel: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
6
|
+
id: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
submitTitle?: string;
|
|
9
|
+
cancelTitle?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
classModifier?: string;
|
|
12
|
+
ref?: Ref<HTMLDialogElement>;
|
|
13
|
+
};
|
|
14
|
+
declare const BooleanModal: ({ children, title, submitTitle, cancelTitle, className, classModifier, onCancel, onSubmit, closeButtonAriaLabel, ...props }: BooleanModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { BooleanModal };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, Modal, getComponentClassName } from "../agent";
|
|
3
|
+
import { Body } from "./components/Body";
|
|
4
|
+
import { Footer } from "./components/Footer";
|
|
5
|
+
import { Header } from "./components/Header";
|
|
6
|
+
const defaultClassName = "af-modal";
|
|
7
|
+
const BooleanModal = ({ children, title, submitTitle = "Valider", cancelTitle = "Annuler", className = defaultClassName, classModifier, onCancel, onSubmit, closeButtonAriaLabel, ...props }) => {
|
|
8
|
+
const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
|
|
9
|
+
return (_jsxs(Modal, { className: componentClassName, onOutsideTap: onCancel, title: title, ...props, children: [_jsx(Header, { title: title, onCancel: onCancel, closeButtonAriaLabel: closeButtonAriaLabel }), _jsx(Body, { children: children }), _jsxs(Footer, { children: [_jsx(Button, { classModifier: "reverse", onClick: onCancel, children: cancelTitle }), _jsx(Button, { onClick: onSubmit, children: submitTitle })] })] }));
|
|
10
|
+
};
|
|
11
|
+
export { BooleanModal };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type ModalProps = React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement> & {
|
|
3
|
+
className?: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
onOutsideTap: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
classModifier?: string;
|
|
8
|
+
ref?: React.Ref<HTMLDialogElement>;
|
|
9
|
+
};
|
|
10
|
+
declare const Modal: import("react").ForwardRefExoticComponent<Omit<ModalProps, "ref"> & import("react").RefAttributes<HTMLDialogElement>>;
|
|
11
|
+
export { Modal };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { getComponentClassName } from "../agent";
|
|
4
|
+
const Modal = forwardRef(({ className, title = "", onOutsideTap, children, classModifier, ...props }, ref) => {
|
|
5
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-modal");
|
|
6
|
+
return (_jsx("dialog", { "aria-describedby": title, className: componentClassName, onClick: onOutsideTap, ref: ref, ...props, children: _jsx("div", { className: "af-modal__dialog", onClick: (event) => event.stopPropagation(), children: _jsx("div", { className: "af-modal__content", children: children }) }) }));
|
|
7
|
+
});
|
|
8
|
+
Modal.displayName = "Modal";
|
|
9
|
+
export { Modal };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Modal/Modal.agent.scss";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import type { ReactElement, ReactNode } from "react";
|
|
4
|
+
import { BooleanModal } from "./BooleanModal";
|
|
5
|
+
import { Modal } from "./Modal";
|
|
6
|
+
declare const meta: Meta<typeof Modal>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type DefaultModalStoryProps = Omit<React.ComponentProps<typeof Modal>, "children"> & {
|
|
9
|
+
children: string;
|
|
10
|
+
bodyContent: string;
|
|
11
|
+
cancelButtonText: string;
|
|
12
|
+
saveButtonText: string;
|
|
13
|
+
};
|
|
14
|
+
type TDefaultModalStory = StoryObj<DefaultModalStoryProps>;
|
|
15
|
+
export declare const DefaultModalStory: TDefaultModalStory;
|
|
16
|
+
type CustomTitleModalStoryProps = Omit<React.ComponentProps<typeof Modal>, "title" | "children"> & {
|
|
17
|
+
title: ReactNode;
|
|
18
|
+
children: string;
|
|
19
|
+
bodyContent: string;
|
|
20
|
+
cancelButtonText: string;
|
|
21
|
+
saveButtonText: string;
|
|
22
|
+
};
|
|
23
|
+
type TCustomTitleModalStory = StoryObj<CustomTitleModalStoryProps>;
|
|
24
|
+
export declare const CustomTitleModalStory: TCustomTitleModalStory;
|
|
25
|
+
type BooleanModalStoryProps = React.ComponentProps<typeof BooleanModal> & {
|
|
26
|
+
bodyContent: ReactElement;
|
|
27
|
+
cancelButtonText: string;
|
|
28
|
+
saveButtonText: string;
|
|
29
|
+
};
|
|
30
|
+
type TBooleanModalStory = StoryObj<BooleanModalStoryProps>;
|
|
31
|
+
export declare const BooleanModalStory: TBooleanModalStory;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Modal/Modal.agent.scss";
|
|
3
|
+
import { BooleanModal } from "./BooleanModal";
|
|
4
|
+
import { Modal } from "./Modal";
|
|
5
|
+
import { Body } from "./components/Body";
|
|
6
|
+
import { Footer } from "./components/Footer";
|
|
7
|
+
import { Header } from "./components/Header";
|
|
8
|
+
import { HeaderBase } from "./components/HeaderBase";
|
|
9
|
+
const MODIFIERS = [
|
|
10
|
+
{ label: "Default", value: "" },
|
|
11
|
+
{ label: "Large (lg)", value: "lg" },
|
|
12
|
+
{ label: "Small (sm)", value: "sm" },
|
|
13
|
+
];
|
|
14
|
+
const meta = {
|
|
15
|
+
title: "Agent/Components/Modal",
|
|
16
|
+
component: Modal,
|
|
17
|
+
parameters: {
|
|
18
|
+
options: {},
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export default meta;
|
|
22
|
+
export const DefaultModalStory = {
|
|
23
|
+
name: "Default Modal",
|
|
24
|
+
render: ({ bodyContent, cancelButtonText, saveButtonText, ...args }) => {
|
|
25
|
+
const selectClassModifier = MODIFIERS.find((m) => m.label === args.classModifier) ?? MODIFIERS[0];
|
|
26
|
+
return (_jsxs(Modal, { ...args, classModifier: selectClassModifier.value, onOutsideTap: () => { }, children: [_jsx(Header, { title: args.title, onCancel: () => { } }), _jsx(Body, { children: _jsx("p", { children: bodyContent }) }), _jsxs(Footer, { children: [selectClassModifier.value !== "sm" && (_jsx("button", { className: "btn af-btn af-btn--reverse", type: "button", children: cancelButtonText })), _jsx("button", { className: "btn af-btn", type: "button", children: saveButtonText })] })] }));
|
|
27
|
+
},
|
|
28
|
+
args: {
|
|
29
|
+
open: true,
|
|
30
|
+
title: "Modal title",
|
|
31
|
+
bodyContent: 'Voici une version avec un header classique Modal.Header. Un classModifier "lg" a été mis pour montrer une version plus large d\'une modale. Il est existe également un modifier "sm", pour les modales plus petites. Mais il est possible d\'ajouter son propre modifier pour personnaliser selon ses besoins avec un peu de CSS.',
|
|
32
|
+
cancelButtonText: "Annuler",
|
|
33
|
+
saveButtonText: "Valider",
|
|
34
|
+
classModifier: MODIFIERS[0].label,
|
|
35
|
+
},
|
|
36
|
+
argTypes: {
|
|
37
|
+
classModifier: {
|
|
38
|
+
options: MODIFIERS.map((m) => m.label),
|
|
39
|
+
control: { type: "radio" },
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
export const CustomTitleModalStory = {
|
|
44
|
+
name: "Custom Title Modal",
|
|
45
|
+
render: ({ bodyContent, cancelButtonText, saveButtonText, ...args }) => {
|
|
46
|
+
const selectClassModifier = MODIFIERS.find((m) => m.label === args.classModifier) ?? MODIFIERS[0];
|
|
47
|
+
return (_jsx("div", { children: _jsxs(Modal, { ...args, title: undefined, classModifier: selectClassModifier.value, onOutsideTap: () => { }, children: [_jsx(HeaderBase, { id: "headerId", children: args.title }), _jsx(Body, { children: _jsx("p", { children: bodyContent }) }), _jsxs(Footer, { children: [selectClassModifier.value !== "sm" && (_jsx("button", { className: "btn af-btn af-btn--reverse", type: "button", children: cancelButtonText })), _jsx("button", { className: "btn af-btn", type: "button", children: saveButtonText })] })] }) }));
|
|
48
|
+
},
|
|
49
|
+
args: {
|
|
50
|
+
open: true,
|
|
51
|
+
title: (_jsxs("p", { children: ["Ici je contr\u00F4le compl\u00E8tement", _jsx("b", { children: " le contenu" })] })),
|
|
52
|
+
bodyContent: 'Voici une version avec un header customisé à l\'aide du composant Modal.HeaderBase. Un classModifier "lg" a été mis pour montrer une version plus large d\'une modale. Il est existe également un modifier "sm", pour les modales plus petites. Mais il est possible d\'ajouter son propre modifier pour personnaliser selon ses besoins avec un peu de CSS.',
|
|
53
|
+
cancelButtonText: "Annuler",
|
|
54
|
+
saveButtonText: "Valider",
|
|
55
|
+
classModifier: MODIFIERS[0].label,
|
|
56
|
+
},
|
|
57
|
+
argTypes: {
|
|
58
|
+
classModifier: {
|
|
59
|
+
options: MODIFIERS.map((m) => m.label),
|
|
60
|
+
control: { type: "radio" },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
export const BooleanModalStory = {
|
|
65
|
+
name: "Boolean Modal",
|
|
66
|
+
render: ({ classModifier, ...args }) => {
|
|
67
|
+
const selectClassModifier = MODIFIERS.find((m) => m.label === classModifier) ?? MODIFIERS[0];
|
|
68
|
+
return (_jsx(BooleanModal, { classModifier: selectClassModifier.value, ...args, onCancel: () => { }, children: args.bodyContent }));
|
|
69
|
+
},
|
|
70
|
+
args: {
|
|
71
|
+
open: true,
|
|
72
|
+
title: "Boolean Modal title",
|
|
73
|
+
bodyContent: (_jsx("p", { children: "Reprehenderit sit quis aute nisi consequat consequat mollit. Commodo in aliquip consectetur nulla sit anim. Pariatur minim commodo enim ea eu laborum culpa laboris. Labore labore irure ipsum consequat enim officia anim ipsum aliqua excepteur qui sint. Duis sint do culpa adipisicing dolor adipisicing ea dolore aute nisi quis ullamco aliquip occaecat. Aute ut mollit amet." })),
|
|
74
|
+
cancelTitle: "Annuler",
|
|
75
|
+
submitTitle: "Valider",
|
|
76
|
+
classModifier: MODIFIERS[0].label,
|
|
77
|
+
},
|
|
78
|
+
argTypes: {
|
|
79
|
+
classModifier: {
|
|
80
|
+
options: MODIFIERS.map((m) => m.label),
|
|
81
|
+
control: { type: "radio" },
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getComponentClassName } from "../../agent";
|
|
3
|
+
const Body = ({ children, className, classModifier, ...otherProps }) => {
|
|
4
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-modal__body");
|
|
5
|
+
return (_jsx("section", { className: componentClassName, ...otherProps, children: children }));
|
|
6
|
+
};
|
|
7
|
+
export { Body };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getComponentClassName } from "../../agent";
|
|
3
|
+
const Footer = ({ classModifier, className, ...rest }) => {
|
|
4
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-modal__footer");
|
|
5
|
+
return _jsx("footer", { ...rest, className: componentClassName });
|
|
6
|
+
};
|
|
7
|
+
export { Footer };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MouseEventHandler } from "react";
|
|
2
|
+
export type HeaderProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
className?: string;
|
|
4
|
+
onCancel: MouseEventHandler<HTMLButtonElement>;
|
|
5
|
+
title?: string;
|
|
6
|
+
classModifier?: string;
|
|
7
|
+
closeButtonAriaLabel?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const Header: ({ className, classModifier, title, closeButtonAriaLabel, onCancel, ...props }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Header };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getComponentClassName } from "../../agent";
|
|
3
|
+
const Header = ({ className, classModifier, title, closeButtonAriaLabel = "Fermer la boite de dialogue", onCancel, ...props }) => {
|
|
4
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-modal__header");
|
|
5
|
+
return (_jsxs("header", { className: componentClassName, ...props, children: [_jsx("h4", { className: "af-modal__header-title", children: title }), _jsx("button", { className: "af-modal__header-close-btn", type: "button", "aria-label": closeButtonAriaLabel, onClick: onCancel, children: _jsx("span", { className: "glyphicon glyphicon-close", "aria-hidden": "true" }) })] }));
|
|
6
|
+
};
|
|
7
|
+
export { Header };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getComponentClassName } from "../../agent";
|
|
3
|
+
const HeaderBase = ({ classModifier, className, ...rest }) => {
|
|
4
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-modal__header");
|
|
5
|
+
return _jsx("header", { ...rest, className: componentClassName });
|
|
6
|
+
};
|
|
7
|
+
export { HeaderBase };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Modal/Modal.agent.scss";
|
|
2
|
+
export { BooleanModal } from "./BooleanModal";
|
|
3
|
+
export { Modal } from "./Modal";
|
|
4
|
+
export { Body as ModalBody } from "./components/Body";
|
|
5
|
+
export { Footer as ModalFooter } from "./components/Footer";
|
|
6
|
+
export { Header as ModalHeader } from "./components/Header";
|
|
7
|
+
export { HeaderBase as ModalHeaderBase } from "./components/HeaderBase";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Modal/Modal.agent.scss";
|
|
2
|
+
export { BooleanModal } from "./BooleanModal";
|
|
3
|
+
export { Modal } from "./Modal";
|
|
4
|
+
export { Body as ModalBody } from "./components/Body";
|
|
5
|
+
export { Footer as ModalFooter } from "./components/Footer";
|
|
6
|
+
export { Header as ModalHeader } from "./components/Header";
|
|
7
|
+
export { HeaderBase as ModalHeaderBase } from "./components/HeaderBase";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactNode } from "react";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Modal/Modal.client.scss";
|
|
3
|
+
export type ButtonAction = {
|
|
4
|
+
text: string;
|
|
5
|
+
callback: () => void;
|
|
6
|
+
};
|
|
7
|
+
type ModalProps = {
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
hasCloseBtn?: boolean;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
title: string;
|
|
12
|
+
subtitle?: string;
|
|
13
|
+
iconTitle?: ReactNode;
|
|
14
|
+
fullWidthButtons?: boolean;
|
|
15
|
+
actions?: {
|
|
16
|
+
primary?: ButtonAction;
|
|
17
|
+
secondary?: ButtonAction;
|
|
18
|
+
tertiary?: ButtonAction;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const Modal: ({ isOpen, hasCloseBtn, onClose, children, title, subtitle, iconTitle, actions, fullWidthButtons, }: PropsWithChildren<ModalProps>) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useId, useRef, useState, } from "react";
|
|
3
|
+
import close from "@material-symbols/svg-400/outlined/close.svg";
|
|
4
|
+
import { ButtonClient as Button, Variants as ButtonVariants, } from "../Button/Button.client";
|
|
5
|
+
import "@axa-fr/design-system-slash-css/dist/Modal/Modal.client.scss";
|
|
6
|
+
import { Svg } from "../Svg";
|
|
7
|
+
export const Modal = ({ isOpen, hasCloseBtn = true, onClose, children, title, subtitle, iconTitle, actions, fullWidthButtons, }) => {
|
|
8
|
+
const [isModalOpen, setIsModalOpen] = useState(isOpen);
|
|
9
|
+
const modalRef = useRef(null);
|
|
10
|
+
const idTitle = useId();
|
|
11
|
+
const idContent = useId();
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setIsModalOpen(isOpen);
|
|
14
|
+
}, [isOpen]);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
const modalElement = modalRef.current;
|
|
17
|
+
if (!modalRef.current) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (isModalOpen) {
|
|
21
|
+
document.body.style.overflow = "hidden";
|
|
22
|
+
modalElement.showModal();
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
document.body.style.overflow = "inherit";
|
|
26
|
+
modalElement.close();
|
|
27
|
+
}
|
|
28
|
+
}, [isModalOpen]);
|
|
29
|
+
const handleCloseModal = () => {
|
|
30
|
+
onClose?.();
|
|
31
|
+
setIsModalOpen(false);
|
|
32
|
+
};
|
|
33
|
+
const handleKeyDown = (event) => {
|
|
34
|
+
if (event.key === "Escape") {
|
|
35
|
+
handleCloseModal();
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return (_jsxs("dialog", { ref: modalRef, onKeyDown: handleKeyDown, onClick: (e) => e.target === modalRef.current && handleCloseModal(), className: "af-modal", "aria-labelledby": idTitle, "aria-describedby": idContent, children: [_jsxs("div", { id: idTitle, className: "af-modal__top", children: [iconTitle, _jsxs("h2", { className: "af-modal__top-title", children: [_jsxs("div", { children: [_jsx("div", { className: "af-modal__top-title-text", children: title }), subtitle && (_jsx("span", { className: "af-modal__top-title-subtitle", children: subtitle }))] }), hasCloseBtn && (_jsx(Button, { className: "af-modal__top-title-close-btn", onClick: handleCloseModal, type: "button", "aria-label": "close", children: _jsx(Svg, { src: close, width: 32, height: 32 }) }))] })] }), _jsxs("div", { id: idContent, className: "af-modal__content", children: [children, actions && (_jsxs("div", { className: `af-modal__actions${fullWidthButtons ? " af-modal__actions--fullWidth" : ""} `, children: [actions?.primary && (_jsx(Button, { variant: ButtonVariants.primary, onClick: actions?.primary.callback, children: actions?.primary.text })), actions?.secondary && (_jsx(Button, { variant: ButtonVariants.secondary, onClick: actions?.secondary.callback, children: actions?.secondary.text })), actions?.tertiary && (_jsx(Button, { variant: ButtonVariants.tertiary, onClick: actions?.tertiary.callback, children: actions?.tertiary.text }))] }))] })] }));
|
|
39
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { ButtonAction, Modal } from "./Modal.client";
|
|
4
|
+
declare const meta: Meta<typeof Modal>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type StoryProps = Omit<React.ComponentProps<typeof Modal>, "isOpen" | "hasCloseBtn" | "onClose" | "title" | "iconTitle" | "fullWidthButtons" | "actions"> & {
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
hasCloseBtn?: boolean;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
title: string;
|
|
11
|
+
iconTitle?: ReactNode;
|
|
12
|
+
fullWidthButtons?: boolean;
|
|
13
|
+
actions?: {
|
|
14
|
+
primary?: ButtonAction;
|
|
15
|
+
secondary?: ButtonAction;
|
|
16
|
+
tertiary?: ButtonAction;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type Story = StoryObj<StoryProps>;
|
|
20
|
+
export declare const Playground: Story;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import bluetoothAudio from "@material-symbols/svg-400/outlined/bluetooth_searching.svg";
|
|
4
|
+
import { Modal } from "./Modal.client";
|
|
5
|
+
import { Svg } from "../Svg";
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "Client/Components/Modal",
|
|
8
|
+
component: Modal,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "centered",
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
const Container = (props) => {
|
|
15
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
16
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", onClick: () => setIsOpen(true), children: "open modal" }), _jsx(Modal, { ...props, isOpen: isOpen, onClose: () => setIsOpen(false), actions: {
|
|
17
|
+
primary: { text: "Save", callback: () => setIsOpen(false) },
|
|
18
|
+
secondary: { text: "Cancel", callback: () => setIsOpen(false) },
|
|
19
|
+
tertiary: { text: "Reset", callback: () => setIsOpen(false) },
|
|
20
|
+
} })] }));
|
|
21
|
+
};
|
|
22
|
+
export const Playground = {
|
|
23
|
+
name: "Modal",
|
|
24
|
+
render: (args) => _jsx(Container, { ...args }),
|
|
25
|
+
args: {
|
|
26
|
+
hasCloseBtn: true,
|
|
27
|
+
title: "Modal title",
|
|
28
|
+
children: "Vestibulum nunc neque, sodales non luctus in, dictum vitae nisl. Curabitur vitae massa non nisl lacinia tempus. Pellentesque id nulla tortor.",
|
|
29
|
+
iconTitle: _jsx(Svg, { src: bluetoothAudio }),
|
|
30
|
+
subtitle: "Info complémentaire",
|
|
31
|
+
fullWidthButtons: false,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Pagination/Pagination.client.scss";
|
|
2
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
type PaginationProps = {
|
|
4
|
+
numberPage: number;
|
|
5
|
+
onChangePage: (page: number) => void;
|
|
6
|
+
defaultPage?: number;
|
|
7
|
+
} & ComponentPropsWithoutRef<"div">;
|
|
8
|
+
export declare const Pagination: ({ numberPage, onChangePage, defaultPage, }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Pagination/Pagination.client.scss";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { PaginationMobile } from "./PaginationMobile.client";
|
|
5
|
+
import { PaginationDesktop } from "./PaginationDesktop.client";
|
|
6
|
+
import { useIsSmallScreen } from "../utilities/hooks/useIsSmallScreen";
|
|
7
|
+
const BREAKPOINT_SMALL = 1024;
|
|
8
|
+
export const Pagination = ({ numberPage, onChangePage, defaultPage, }) => {
|
|
9
|
+
const isMobile = useIsSmallScreen(BREAKPOINT_SMALL);
|
|
10
|
+
const [currentPage, setCurrentPage] = useState(defaultPage || 1);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
onChangePage(currentPage);
|
|
13
|
+
}, [currentPage, onChangePage]);
|
|
14
|
+
return (_jsx("div", { className: "af-container-pagination", children: isMobile ? (_jsx(PaginationMobile, { numberPage: numberPage, currentPage: currentPage, setCurrentPage: setCurrentPage })) : (_jsx(PaginationDesktop, { numberPage: numberPage, currentPage: currentPage, setCurrentPage: setCurrentPage })) }));
|
|
15
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Pagination } from "./Pagination.client";
|
|
3
|
+
declare const meta: Meta<typeof Pagination>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type StoryProps = Omit<React.ComponentProps<typeof Pagination>, "numberPage"> & {
|
|
6
|
+
numberPage: number;
|
|
7
|
+
onChangePage: (page: number) => void;
|
|
8
|
+
defaultPage?: number;
|
|
9
|
+
};
|
|
10
|
+
type Story = StoryObj<StoryProps>;
|
|
11
|
+
export declare const Playground: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Pagination } from "./Pagination.client";
|
|
3
|
+
const meta = {
|
|
4
|
+
component: Pagination,
|
|
5
|
+
title: "Client/Components/Pagination",
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered",
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
export const Playground = {
|
|
12
|
+
name: "Pagination",
|
|
13
|
+
render: ({ numberPage, onChangePage, defaultPage }) => (_jsx(Pagination, { numberPage: numberPage, defaultPage: defaultPage, onChangePage: onChangePage })),
|
|
14
|
+
args: {
|
|
15
|
+
numberPage: 20,
|
|
16
|
+
defaultPage: 2,
|
|
17
|
+
onChangePage: () => { },
|
|
18
|
+
},
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Pagination/PaginationDesktop.client.scss";
|
|
2
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
type PropsPaginationDesktop = {
|
|
4
|
+
numberPage: number;
|
|
5
|
+
currentPage: number;
|
|
6
|
+
setCurrentPage: React.Dispatch<React.SetStateAction<number>>;
|
|
7
|
+
} & ComponentPropsWithoutRef<"div">;
|
|
8
|
+
export declare const PaginationDesktop: ({ numberPage, currentPage, setCurrentPage, }: PropsPaginationDesktop) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Pagination/PaginationDesktop.client.scss";
|
|
3
|
+
const SEVEN_PAGE = 7;
|
|
4
|
+
const LAST_FOUR_PAGE = 4;
|
|
5
|
+
const FIVE_PAGE = 5;
|
|
6
|
+
export const PaginationDesktop = ({ numberPage, currentPage, setCurrentPage, }) => {
|
|
7
|
+
const pages = Array.from({ length: numberPage }, (_, index) => index + 1);
|
|
8
|
+
let filteredNumbers = [...pages];
|
|
9
|
+
let classNamePagination = "";
|
|
10
|
+
if (numberPage > SEVEN_PAGE) {
|
|
11
|
+
if (currentPage < FIVE_PAGE) {
|
|
12
|
+
classNamePagination = "first";
|
|
13
|
+
filteredNumbers = [...pages.slice(0, FIVE_PAGE), pages[pages.length - 1]];
|
|
14
|
+
}
|
|
15
|
+
else if (currentPage > numberPage - LAST_FOUR_PAGE) {
|
|
16
|
+
classNamePagination = "last";
|
|
17
|
+
filteredNumbers = [pages[0], ...pages.slice(-FIVE_PAGE)];
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
classNamePagination = "between";
|
|
21
|
+
filteredNumbers = [
|
|
22
|
+
pages[0],
|
|
23
|
+
currentPage - 1,
|
|
24
|
+
currentPage,
|
|
25
|
+
currentPage + 1,
|
|
26
|
+
pages[pages.length - 1],
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return (_jsx("div", { className: "af-pagination-desktop", children: _jsx("ul", { className: classNamePagination, children: filteredNumbers.map((page) => (_jsx("li", { "aria-label": `page-${page}`, "aria-current": currentPage === page ? "page" : undefined, children: _jsx("button", { type: "button", onClick: () => setCurrentPage(page), children: page }) }, `page-${page}`))) }) }));
|
|
31
|
+
};
|