@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,15 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Table/Pager.agent.scss";
|
|
2
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
import { PaginationButton } from "./PaginationButton";
|
|
4
|
+
export type PagerComponentProps = Pick<ComponentPropsWithoutRef<typeof PaginationButton>, "onChange"> & {
|
|
5
|
+
className?: string;
|
|
6
|
+
classModifier?: string;
|
|
7
|
+
numberPages?: number;
|
|
8
|
+
currentPage?: number;
|
|
9
|
+
mode?: "default" | "light";
|
|
10
|
+
previousLabel?: string;
|
|
11
|
+
nextLabel?: string;
|
|
12
|
+
ofLabel?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const Pager: ({ className, classModifier, numberPages, currentPage, onChange, mode, previousLabel, nextLabel, ofLabel, }: PagerComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Pager };
|
|
@@ -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/Table/Pager.agent.scss";
|
|
3
|
+
import { getComponentClassName } from "../../agent";
|
|
4
|
+
import { Li } from "./Li";
|
|
5
|
+
import { LiPoint } from "./LiPoint";
|
|
6
|
+
import { PaginationButton } from "./PaginationButton";
|
|
7
|
+
const Pager = ({ className, classModifier, numberPages = 1, currentPage = 1, onChange, mode = "default", previousLabel = "« Précédent", nextLabel = "Suivant »", ofLabel = "sur", }) => {
|
|
8
|
+
const hasNext = currentPage < numberPages;
|
|
9
|
+
const hasPrevious = currentPage > 1;
|
|
10
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-pager");
|
|
11
|
+
if (mode === "light") {
|
|
12
|
+
return (_jsx("nav", { className: componentClassName, children: _jsxs("ul", { className: "af-pager__pagination", children: [_jsx(PaginationButton, { onChange: onChange, value: currentPage - 1, active: hasPrevious, isVisible: true, children: _jsx("i", { className: "glyphicon glyphicon-chevron-left", "aria-hidden": "true" }) }), _jsxs(LiPoint, { isVisible: true, children: [currentPage, " ", ofLabel, " ", numberPages] }), _jsx(PaginationButton, { onChange: onChange, value: currentPage + 1, active: hasNext, isVisible: true, children: _jsx("i", { className: "glyphicon glyphicon-chevron-right", "aria-hidden": "true" }) })] }) }));
|
|
13
|
+
}
|
|
14
|
+
return (_jsx("nav", { className: componentClassName, children: _jsxs("ul", { className: "af-pager__pagination", children: [_jsx(PaginationButton, { onChange: onChange, value: currentPage - 1, active: hasPrevious, isVisible: true, children: previousLabel }), _jsx(Li, { onChange: onChange, value: 1, isVisible: numberPages > 1 && currentPage > 1 }), _jsx(LiPoint, { isVisible: currentPage > 3, children: "..." }), _jsx(Li, { onChange: onChange, value: currentPage - 1, isVisible: numberPages > 2 && currentPage > 2 }), _jsx(Li, { onChange: onChange, value: currentPage, active: true, isVisible: numberPages > 0 }), _jsx(Li, { onChange: onChange, value: currentPage + 1, isVisible: currentPage < numberPages - 1 }), _jsx(LiPoint, { isVisible: currentPage < numberPages - 2, children: "..." }), _jsx(Li, { onChange: onChange, value: numberPages, isVisible: currentPage < numberPages }), _jsx(PaginationButton, { onChange: onChange, value: currentPage + 1, active: hasNext, isVisible: true, children: nextLabel })] }) }));
|
|
15
|
+
};
|
|
16
|
+
export { Pager };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type PaginationButtonProps = {
|
|
3
|
+
isVisible?: boolean;
|
|
4
|
+
active?: boolean;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
value: number;
|
|
7
|
+
onChange: (e: {
|
|
8
|
+
value: number;
|
|
9
|
+
}) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const PaginationButton: ({ isVisible, active, children, value, onChange, }: PaginationButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export { PaginationButton };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const PaginationButton = ({ isVisible, active, children, value, onChange, }) => {
|
|
3
|
+
if (!isVisible) {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
6
|
+
if (active) {
|
|
7
|
+
return (_jsx("li", { className: "af-pager__item", children: _jsx("a", { className: "af-pager__item-link", href: "/#", role: "button", onClick: (e) => {
|
|
8
|
+
e.preventDefault();
|
|
9
|
+
onChange({ value });
|
|
10
|
+
}, children: children }) }));
|
|
11
|
+
}
|
|
12
|
+
return (_jsx("li", { className: "af-pager__item af-pager__item--disabled", children: _jsx("span", { className: "af-pager__item-nolink", children: children }) }));
|
|
13
|
+
};
|
|
14
|
+
export { PaginationButton };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Table/Paging.agent.scss";
|
|
2
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
3
|
+
import { Items } from "./Items";
|
|
4
|
+
import { Pager } from "./Pager";
|
|
5
|
+
type PagingComponentProps = ComponentPropsWithoutRef<typeof Pager> & ComponentPropsWithoutRef<typeof Items>;
|
|
6
|
+
type OnChangePager = (e: {
|
|
7
|
+
numberItems: number;
|
|
8
|
+
page: number;
|
|
9
|
+
}) => void;
|
|
10
|
+
export type Props = Omit<PagingComponentProps, "onChange"> & {
|
|
11
|
+
onChange?: OnChangePager;
|
|
12
|
+
};
|
|
13
|
+
declare const Paging: ({ className, classModifier, currentPage, displayLabel, elementsLabel, id, mode, nextLabel, numberItems, numberPages, ofLabel, previousLabel, items, onChange, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export { Paging };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Table/Paging.agent.scss";
|
|
3
|
+
import { useCallback } from "react";
|
|
4
|
+
import { getComponentClassName } from "../../agent";
|
|
5
|
+
import { Items } from "./Items";
|
|
6
|
+
import { Pager } from "./Pager";
|
|
7
|
+
const Paging = ({ className, classModifier, currentPage = 1, displayLabel, elementsLabel, id, mode, nextLabel, numberItems = 10, numberPages, ofLabel, previousLabel, items, onChange, }) => {
|
|
8
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-paging");
|
|
9
|
+
const handleChangeItems = useCallback((e) => onChange &&
|
|
10
|
+
onChange({
|
|
11
|
+
numberItems: e.value,
|
|
12
|
+
page: currentPage,
|
|
13
|
+
}), [currentPage, onChange]);
|
|
14
|
+
const handleChangePager = useCallback((e) => onChange &&
|
|
15
|
+
onChange({
|
|
16
|
+
numberItems,
|
|
17
|
+
page: e.value,
|
|
18
|
+
}), [numberItems, onChange]);
|
|
19
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsx("div", { className: "af-paging__limit", children: _jsx(Items, { onChange: handleChangeItems, numberItems: numberItems, id: id, displayLabel: displayLabel, elementsLabel: elementsLabel, items: items }) }), _jsx("div", { className: "af-paging__pager", children: _jsx(Pager, { onChange: handleChangePager, currentPage: currentPage, numberPages: numberPages, previousLabel: previousLabel, nextLabel: nextLabel, ofLabel: ofLabel, mode: mode }) })] }));
|
|
20
|
+
};
|
|
21
|
+
export { Paging };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
type Props = ComponentPropsWithoutRef<"tbody"> & {
|
|
3
|
+
classModifier?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const TBody: ({ children, className, classModifier, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { TBody };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getComponentClassName } from "../agent";
|
|
3
|
+
const TBody = ({ children, className, classModifier, ...otherProps }) => {
|
|
4
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-table__body");
|
|
5
|
+
return (_jsx("tbody", { className: componentClassName, ...otherProps, children: children }));
|
|
6
|
+
};
|
|
7
|
+
export { TBody };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
type Props = ComponentPropsWithoutRef<"thead"> & {
|
|
3
|
+
classModifier?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const THead: ({ children, className, classModifier, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { THead };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getComponentClassName } from "../Form/core";
|
|
3
|
+
const THead = ({ children, className, classModifier, ...otherProps }) => {
|
|
4
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-table__thead");
|
|
5
|
+
return (_jsx("thead", { className: componentClassName, ...otherProps, children: children }));
|
|
6
|
+
};
|
|
7
|
+
export { THead };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Table/Table.agent.scss";
|
|
3
|
+
type TableProps = ComponentPropsWithoutRef<"table"> & {
|
|
4
|
+
classModifier?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const Table: {
|
|
7
|
+
({ className, classModifier, children, ...othersProps }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
Header: ({ children, className, classModifier, ...otherProps }: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & {
|
|
9
|
+
classModifier?: string;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
Body: ({ children, className, classModifier, ...otherProps }: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & {
|
|
12
|
+
classModifier?: string;
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
THead: ({ children, className, classModifier, ...otherProps }: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & {
|
|
15
|
+
classModifier?: string;
|
|
16
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
TBody: ({ children, className, classModifier, ...otherProps }: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & {
|
|
18
|
+
classModifier?: string;
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
Th: ({ children, id, className, classModifier, ...otherProps }: Omit<import("react").DetailedHTMLProps<import("react").ThHTMLAttributes<HTMLTableHeaderCellElement>, HTMLTableHeaderCellElement>, "ref"> & {
|
|
21
|
+
classModifier?: string;
|
|
22
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
Tr: ({ children, id, className, classModifier, ...otherProps }: Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "ref"> & {
|
|
24
|
+
classModifier?: string;
|
|
25
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
Td: ({ children, id, className, classModifier, ...otherProps }: Omit<import("react").DetailedHTMLProps<import("react").TdHTMLAttributes<HTMLTableDataCellElement>, HTMLTableDataCellElement>, "ref"> & {
|
|
27
|
+
classModifier?: string;
|
|
28
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
};
|
|
30
|
+
export { Table };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getComponentClassName } from "../Form/core";
|
|
3
|
+
import { TBody } from "./TBody";
|
|
4
|
+
import { THead } from "./THead";
|
|
5
|
+
import { Td } from "./Td";
|
|
6
|
+
import { Th } from "./Th";
|
|
7
|
+
import { Tr } from "./Tr";
|
|
8
|
+
import "@axa-fr/design-system-slash-css/dist/Table/Table.agent.scss";
|
|
9
|
+
const Table = ({ className, classModifier, children, ...othersProps }) => {
|
|
10
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-table");
|
|
11
|
+
return (_jsx("table", { className: componentClassName, ...othersProps, children: children }));
|
|
12
|
+
};
|
|
13
|
+
Table.Header = THead;
|
|
14
|
+
Table.Body = TBody;
|
|
15
|
+
Table.THead = THead;
|
|
16
|
+
Table.TBody = TBody;
|
|
17
|
+
Table.Th = Th;
|
|
18
|
+
Table.Tr = Tr;
|
|
19
|
+
Table.Td = Td;
|
|
20
|
+
export { Table };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Paging } from "./Pagination/Paging";
|
|
3
|
+
import { Table } from "./Table";
|
|
4
|
+
declare const meta: Meta<typeof Paging>;
|
|
5
|
+
export default meta;
|
|
6
|
+
export declare const Simple: StoryObj<typeof Table>;
|
|
7
|
+
export declare const WithPagination: StoryObj<typeof Paging>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Paging } from "./Pagination/Paging";
|
|
3
|
+
import { Table } from "./Table";
|
|
4
|
+
const meta = {
|
|
5
|
+
component: Paging,
|
|
6
|
+
title: "Agent/Components/Table",
|
|
7
|
+
argTypes: { onChange: { action: "onChange" } },
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Simple = {
|
|
11
|
+
name: "Simple table",
|
|
12
|
+
render: () => (_jsx(Table, { children: _jsxs(Table.THead, { children: [_jsx(Table.Tr, { children: _jsx(Table.Th, { colSpan: 3, children: "Some text" }) }), _jsxs(Table.Tr, { children: [_jsx(Table.Th, { rowSpan: 2, children: "Some text" }), _jsx(Table.Td, { children: _jsx("strong", { children: "Some bold text" }) }), _jsx(Table.Td, { children: "Some text" })] }), _jsxs(Table.Tr, { children: [_jsx(Table.Td, { children: "Some text" }), _jsx(Table.Td, { children: "Some text" })] }), _jsxs(Table.Tr, { children: [_jsx(Table.Td, { children: "Some text" }), _jsx(Table.Td, { children: "Some text" }), _jsx(Table.Td, { children: "Some text" })] })] }) })),
|
|
13
|
+
args: {},
|
|
14
|
+
argTypes: {},
|
|
15
|
+
};
|
|
16
|
+
export const WithPagination = {
|
|
17
|
+
name: "Table with pagination",
|
|
18
|
+
render: ({ currentPage, numberItems, numberPages, mode, ...args }) => (_jsxs(_Fragment, { children: [_jsx(Table, { children: _jsxs(Table.THead, { children: [_jsx(Table.Tr, { children: _jsx(Table.Th, { colSpan: 3, children: "Some text" }) }), _jsxs(Table.Tr, { children: [_jsx(Table.Th, { rowSpan: 2, children: "Some text" }), _jsx(Table.Td, { children: _jsx("strong", { children: "Some bold text" }) }), _jsx(Table.Td, { children: "Some text" })] }), _jsxs(Table.Tr, { children: [_jsx(Table.Td, { children: "Some text" }), _jsx(Table.Td, { children: "Some text" })] }), _jsxs(Table.Tr, { children: [_jsx(Table.Td, { children: "Some text" }), _jsx(Table.Td, { children: "Some text" }), _jsx(Table.Td, { children: "Some text" })] })] }) }), _jsx(Paging, { currentPage: currentPage, numberItems: numberItems, numberPages: numberPages, mode: mode, ...args })] })),
|
|
19
|
+
args: {
|
|
20
|
+
currentPage: 3,
|
|
21
|
+
numberItems: 10,
|
|
22
|
+
numberPages: 10,
|
|
23
|
+
mode: "default",
|
|
24
|
+
items: [5, 10, 50, 100],
|
|
25
|
+
},
|
|
26
|
+
argTypes: {
|
|
27
|
+
currentPage: { control: { type: "number" } },
|
|
28
|
+
numberItems: { control: { type: "number" } },
|
|
29
|
+
numberPages: { control: { type: "number" } },
|
|
30
|
+
mode: { options: ["default", "light"], control: { type: "radio" } },
|
|
31
|
+
onChange: { table: { disable: true } },
|
|
32
|
+
},
|
|
33
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
type Props = ComponentPropsWithoutRef<"td"> & {
|
|
3
|
+
classModifier?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const Td: ({ children, id, className, classModifier, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { Td };
|
package/dist/Table/Td.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getComponentClassName } from "../Form/core";
|
|
3
|
+
const Td = ({ children, id, className, classModifier, ...otherProps }) => {
|
|
4
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-table__cell");
|
|
5
|
+
return (_jsx("td", { className: componentClassName, id: id, ...otherProps, children: children }, id));
|
|
6
|
+
};
|
|
7
|
+
export { Td };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
type Props = ComponentPropsWithoutRef<"th"> & {
|
|
3
|
+
classModifier?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const Th: ({ children, id, className, classModifier, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { Th };
|
package/dist/Table/Th.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getComponentClassName } from "../Form/core";
|
|
3
|
+
const Th = ({ children, id, className, classModifier, ...otherProps }) => {
|
|
4
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-table__th");
|
|
5
|
+
return (_jsx("th", { className: componentClassName, id: id, ...otherProps, children: children }, id));
|
|
6
|
+
};
|
|
7
|
+
export { Th };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
type Props = ComponentPropsWithoutRef<"tr"> & {
|
|
3
|
+
classModifier?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const Tr: ({ children, id, className, classModifier, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { Tr };
|
package/dist/Table/Tr.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getComponentClassName } from "../Form/core";
|
|
3
|
+
const Tr = ({ children, id, className, classModifier, ...otherProps }) => {
|
|
4
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-table__tr");
|
|
5
|
+
return (_jsx("tr", { className: componentClassName, ...otherProps, children: children }, id));
|
|
6
|
+
};
|
|
7
|
+
export { Tr };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TabProps } from "./components/Tab";
|
|
3
|
+
import { TabsCoreProps } from "./components/TabsCore";
|
|
4
|
+
type TTabs = React.ComponentType<TabsCoreProps> & {
|
|
5
|
+
Tab: React.ComponentType<TabProps>;
|
|
6
|
+
};
|
|
7
|
+
declare const Tabs: TTabs;
|
|
8
|
+
export { Tabs };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta, type StoryObj } from "@storybook/react";
|
|
2
|
+
import type { TabsCoreProps } from "./components/TabsCore";
|
|
3
|
+
declare const _default: Meta;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const SingleTab: StoryObj<TabsCoreProps>;
|
|
6
|
+
export declare const ComplexTabs: StoryObj<TabsCoreProps>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Badge } from "../../Badge/Badge";
|
|
3
|
+
import { Tabs } from "./Tabs.agent";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Agent/Components/Tabs",
|
|
6
|
+
component: Tabs,
|
|
7
|
+
parameters: {
|
|
8
|
+
options: {},
|
|
9
|
+
},
|
|
10
|
+
argTypes: {
|
|
11
|
+
onChange: { action: "tab changed" },
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
const TabTitleIconLeft = (_jsxs("span", { children: [_jsx("i", { className: "glyphicon glyphicon-ok" }), " Title with left icon"] }));
|
|
15
|
+
const TabTitleIconRight = (_jsxs("span", { children: ["Title with right icon ", _jsx("i", { className: "glyphicon glyphicon-facetime-video" })] }));
|
|
16
|
+
const TabTitleBadge = (_jsxs("span", { children: ["Title with badge ", _jsx(Badge, { classModifier: "danger", children: " 42 " })] }));
|
|
17
|
+
const TabTitleIconBadge = (_jsxs("span", { children: ["Title with badge and left icon", _jsx(Badge, { classModifier: "error", children: " Lorem ipsum " }), _jsx("i", { className: "glyphicon glyphicon-facetime-video" })] }));
|
|
18
|
+
export const SingleTab = {
|
|
19
|
+
name: "Single Tab",
|
|
20
|
+
render: (args) => (_jsx(Tabs, { ...args, children: _jsx(Tabs.Tab, { title: "My Title", children: "Content of my single tab" }) })),
|
|
21
|
+
args: { activeIndex: "0" },
|
|
22
|
+
argTypes: { onChange: { action: "onChange" } },
|
|
23
|
+
};
|
|
24
|
+
export const ComplexTabs = {
|
|
25
|
+
name: "Complex Tabs",
|
|
26
|
+
render: (args) => (_jsxs(Tabs, { ...args, children: [_jsx(Tabs.Tab, { title: TabTitleIconLeft, classModifier: "has-icon-left", children: "Content of my first tab" }), _jsx(Tabs.Tab, { title: TabTitleIconRight, classModifier: "has-icon-right", children: "Content of my second tab" }), _jsx(Tabs.Tab, { title: TabTitleBadge, children: "Content of my third tab " }), _jsx(Tabs.Tab, { title: TabTitleIconBadge, classModifier: "has-icon-left", children: "Content of my fifth tab" })] })),
|
|
27
|
+
args: { activeIndex: "1" },
|
|
28
|
+
argTypes: { onChange: { action: "onChange" } },
|
|
29
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type PaneComponentProps = {
|
|
3
|
+
active: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
declare const Pane: ({ children, className, active, }: PaneComponentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export { Pane };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Tabs/Tabs.agent.scss";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export type TabProps = {
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
classModifier?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const Tab: () => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Tab };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TabsStatelessProps } from "./TabsStateless";
|
|
3
|
+
type Tabs = {
|
|
4
|
+
onChange?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
5
|
+
activeIndex?: string;
|
|
6
|
+
};
|
|
7
|
+
export type TabsCoreProps = Tabs & Omit<TabsStatelessProps, "activeIndex">;
|
|
8
|
+
export declare const onChangeEvent: (onChange?: (event: React.MouseEvent<HTMLButtonElement>) => void) => (setState: (newValue: string) => void) => (event: React.MouseEvent<HTMLButtonElement>, index: string) => void;
|
|
9
|
+
declare const TabsCore: React.FunctionComponent<TabsCoreProps>;
|
|
10
|
+
export { TabsCore };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { TabsStateless } from "./TabsStateless";
|
|
4
|
+
const DEFAULT_ACTIVE_INDEX = "0";
|
|
5
|
+
export const onChangeEvent = (onChange) => (setState) => (event, index) => {
|
|
6
|
+
if (onChange) {
|
|
7
|
+
onChange(event);
|
|
8
|
+
}
|
|
9
|
+
if (index) {
|
|
10
|
+
setState(index);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const TabsCore = ({ activeIndex = DEFAULT_ACTIVE_INDEX, onChange, ...otherProps }) => {
|
|
14
|
+
const [stateActiveIndex, setActiveIndex] = useState(activeIndex);
|
|
15
|
+
return (_jsx(TabsStateless, { activeIndex: stateActiveIndex, ...otherProps, onChange: onChangeEvent(onChange)(setActiveIndex) }));
|
|
16
|
+
};
|
|
17
|
+
export { TabsCore };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export interface TabsStatelessProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
activeIndex: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
classModifier?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TabsStatelessHandlers {
|
|
9
|
+
onChange: (event: React.MouseEvent<HTMLButtonElement>, index: string) => void;
|
|
10
|
+
}
|
|
11
|
+
type Props = TabsStatelessProps & TabsStatelessHandlers;
|
|
12
|
+
declare const TabsStateless: ({ activeIndex, className, classModifier, children, onChange, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { TabsStateless };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Children, isValidElement } from "react";
|
|
3
|
+
import { getComponentClassName } from "../../../agent";
|
|
4
|
+
import { Pane } from "./Pane";
|
|
5
|
+
import { Title } from "./Title";
|
|
6
|
+
const TabsStateless = ({ activeIndex, className = "af-tabs", classModifier, children, onChange, }) => {
|
|
7
|
+
const componentClassName = getComponentClassName(className, classModifier);
|
|
8
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsx("ul", { className: "af-tabs__control", children: Children.map(children, (child, index) => isValidElement(child) && (_jsx(Title, { active: activeIndex === index.toString(), onChange: onChange, id: `${index}`, classModifier: child.props.classModifier, children: child.props.title }, `title-${index}`))) }), _jsx("div", { className: "af-tabs__content", children: Children.map(children, (child, index) => isValidElement(child) && (_jsx(Pane, { active: activeIndex === index.toString(), children: child.props.children }, `pane-${index}`))) })] }));
|
|
9
|
+
};
|
|
10
|
+
export { TabsStateless };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type TitleComponentProps = {
|
|
3
|
+
enable?: boolean | null;
|
|
4
|
+
active: boolean;
|
|
5
|
+
className?: string;
|
|
6
|
+
classModifier?: string;
|
|
7
|
+
id: string;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
onChange: (event: React.MouseEvent<HTMLButtonElement>, index: string) => void;
|
|
10
|
+
};
|
|
11
|
+
declare const Title: {
|
|
12
|
+
({ active, onChange, children, classModifier, className, enable, id, }: TitleComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export { Title };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { getComponentClassName } from "../../../agent";
|
|
4
|
+
const Title = ({ active, onChange, children, classModifier, className, enable, id, }) => {
|
|
5
|
+
const newClassModifier = classNames(classModifier, {
|
|
6
|
+
disabled: enable === false,
|
|
7
|
+
active,
|
|
8
|
+
});
|
|
9
|
+
const componentClassName = getComponentClassName(className, newClassModifier, "af-tabs__item");
|
|
10
|
+
return (_jsx("li", { className: componentClassName, children: _jsx("button", { type: "button", id: id, className: "af-tabs__link", onClick: (event) => onChange(event, id), children: children }) }));
|
|
11
|
+
};
|
|
12
|
+
Title.displayName = "Title";
|
|
13
|
+
export { Title };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Tabs/Tabs.client.scss";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
export declare enum Direction {
|
|
4
|
+
center = "center"
|
|
5
|
+
}
|
|
6
|
+
type TabsProps = {
|
|
7
|
+
items: {
|
|
8
|
+
title: string;
|
|
9
|
+
content: string | ReactNode;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
}[];
|
|
12
|
+
preSelectedTabIndex?: number;
|
|
13
|
+
direction?: Direction;
|
|
14
|
+
};
|
|
15
|
+
export declare const TabsClient: ({ items, preSelectedTabIndex, direction, }: TabsProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Tabs/Tabs.client.scss";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { useCallback, useRef, useState } from "react";
|
|
5
|
+
export var Direction;
|
|
6
|
+
(function (Direction) {
|
|
7
|
+
Direction["center"] = "center";
|
|
8
|
+
})(Direction || (Direction = {}));
|
|
9
|
+
export const TabsClient = ({ items, preSelectedTabIndex, direction, }) => {
|
|
10
|
+
const [selectedTabIndex, setSelectedTabIndex] = useState(preSelectedTabIndex || 0);
|
|
11
|
+
const buttonRefs = useRef([]);
|
|
12
|
+
const tablistRef = useRef(null);
|
|
13
|
+
const totalTabs = items.length;
|
|
14
|
+
const isActive = (index) => index === selectedTabIndex;
|
|
15
|
+
const onChangeTab = useCallback((e) => {
|
|
16
|
+
const firstTabIndex = 0;
|
|
17
|
+
const lastTabIndex = totalTabs - 1;
|
|
18
|
+
const goToNextTab = (nextTabIndex) => {
|
|
19
|
+
setSelectedTabIndex(nextTabIndex);
|
|
20
|
+
buttonRefs.current[nextTabIndex].focus();
|
|
21
|
+
e.stopPropagation();
|
|
22
|
+
e.preventDefault();
|
|
23
|
+
};
|
|
24
|
+
switch (e.key) {
|
|
25
|
+
case "ArrowRight":
|
|
26
|
+
goToNextTab(selectedTabIndex < lastTabIndex
|
|
27
|
+
? selectedTabIndex + 1
|
|
28
|
+
: firstTabIndex);
|
|
29
|
+
break;
|
|
30
|
+
case "ArrowLeft":
|
|
31
|
+
goToNextTab(selectedTabIndex > firstTabIndex
|
|
32
|
+
? selectedTabIndex - 1
|
|
33
|
+
: lastTabIndex);
|
|
34
|
+
break;
|
|
35
|
+
case "Home":
|
|
36
|
+
goToNextTab(firstTabIndex);
|
|
37
|
+
break;
|
|
38
|
+
case "End":
|
|
39
|
+
goToNextTab(lastTabIndex);
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}, [selectedTabIndex, totalTabs]);
|
|
45
|
+
return (_jsxs("div", { className: classNames("af-tabs-client", direction === Direction.center ? `af-tabs-client--center` : ""), children: [_jsx("div", { role: "tablist", ref: tablistRef, children: items.map((item, index) => (_jsxs("button", { role: "tab", id: `tab-${index}`, "aria-selected": isActive(index), "aria-controls": `tabpanel-${index}`, onKeyDown: onChangeTab, onClick: () => setSelectedTabIndex(index), ref: (element) => {
|
|
46
|
+
buttonRefs.current[index] = element;
|
|
47
|
+
}, type: "button", tabIndex: isActive(index) ? 0 : -1, children: [item.icon, _jsx("span", { children: item.title })] }, `tab-${item.title}`))) }), items.map((item, index) => (_jsx("div", { role: "tabpanel", "aria-hidden": !isActive(index), id: `tabpanel-${index}`, "aria-labelledby": `tab-${index}`, children: item.content }, `tabpanel-${item.title}`)))] }));
|
|
48
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { Direction, TabsClient } from "./Tabs.client";
|
|
4
|
+
declare const meta: Meta<typeof TabsClient>;
|
|
5
|
+
export default meta;
|
|
6
|
+
type StoryProps = Omit<React.ComponentProps<typeof TabsClient>, "items" | "direction" | "preSelectedTabIndex"> & {
|
|
7
|
+
items: {
|
|
8
|
+
title: string;
|
|
9
|
+
content: string | ReactNode;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
}[];
|
|
12
|
+
preSelectedTabIndex?: number;
|
|
13
|
+
direction?: Direction;
|
|
14
|
+
};
|
|
15
|
+
export declare const TabsStory: StoryObj<StoryProps>;
|
|
16
|
+
export declare const TabsCenterDirectionStory: StoryObj<StoryProps>;
|
|
17
|
+
export declare const TabsWithReactNodeStory: StoryObj<typeof TabsClient>;
|