@ainias42/react-bootstrap-mobile 1.0.1 → 1.0.3
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/.ctirc +114 -0
- package/.prettierrc +1 -5
- package/.storybook/main.ts +31 -0
- package/.storybook/preview.ts +36 -0
- package/bin/release.sh +1 -37
- package/bin/updatePackages.sh +3 -0
- package/dist/{src/Components → Components}/ActionSheet/ActionSheet.d.ts +5 -5
- package/dist/Components/ActionSheet/ActionSheet.stories.d.ts +9 -0
- package/dist/Components/Card/Card.d.ts +12 -0
- package/dist/Components/Card/Card.stories.d.ts +16 -0
- package/dist/{src/Components → Components}/Clickable/Clickable.d.ts +3 -3
- package/dist/Components/Colors.stories.d.ts +5 -0
- package/dist/Components/Dialog/AlertDialog.d.ts +8 -0
- package/dist/Components/Dialog/AlertDialog.stories.d.ts +14 -0
- package/dist/{src/Components → Components}/Dialog/ButtonDialog.d.ts +3 -3
- package/dist/Components/Dialog/ConfirmDialog.d.ts +9 -0
- package/dist/Components/Dialog/ConfirmDialog.stories.d.ts +15 -0
- package/dist/{src/Components → Components}/Dialog/Dialog.d.ts +2 -2
- package/dist/{src/Components → Components}/Dialog/DialogBackground.d.ts +2 -2
- package/dist/{src/Components → Components}/Dialog/DialogContainer.d.ts +3 -3
- package/dist/{src/Components → Components}/Dialog/DialogContext.d.ts +3 -2
- package/dist/{src/Components → Components}/DragAndDrop/DragItem.d.ts +2 -2
- package/dist/{src/Components → Components}/DragAndDrop/DropArea.d.ts +2 -2
- package/dist/{src/Components → Components}/FormElements/Button/Button.d.ts +8 -8
- package/dist/Components/FormElements/Button/Button.stories.d.ts +43 -0
- package/dist/Components/FormElements/CheckBox/Checkbox.d.ts +12 -0
- package/dist/Components/FormElements/CheckBox/Checkbox.stories.d.ts +17 -0
- package/dist/{src/Components → Components}/FormElements/ColorInput/ColorInput.d.ts +3 -5
- package/dist/Components/FormElements/ColorInput/ColorInput.stories.d.ts +8 -0
- package/dist/{src/Components → Components}/FormElements/Controller/ColorInputController.d.ts +1 -1
- package/dist/{src/Components → Components}/FormElements/Controller/FileInputController.d.ts +4 -4
- package/dist/Components/FormElements/Controller/HookForm.d.ts +15 -0
- package/dist/{src/Components → Components}/FormElements/Controller/InputController.d.ts +1 -1
- package/dist/{src/Components → Components}/FormElements/Controller/MultipleFileInputController.d.ts +1 -1
- package/dist/{src/Components → Components}/FormElements/Controller/PasswordInputController.d.ts +1 -1
- package/dist/{src/Components → Components}/FormElements/Controller/SelectController.d.ts +1 -1
- package/dist/Components/FormElements/Controller/SliderController.d.ts +5 -0
- package/dist/{src/Components → Components}/FormElements/Controller/SwitchController.d.ts +1 -1
- package/dist/{src/Components → Components}/FormElements/Controller/TextareaController.d.ts +1 -1
- package/dist/{src/Components → Components}/FormElements/Controller/useYupResolver.d.ts +1 -1
- package/dist/{src/Components → Components}/FormElements/Controller/withHookController.d.ts +3 -2
- package/dist/Components/FormElements/Error/FormError.d.ts +6 -0
- package/dist/Components/FormElements/Error/FormError.stories.d.ts +7 -0
- package/dist/Components/FormElements/Form.stories.d.ts +7 -0
- package/dist/Components/FormElements/Input/FileInput/FileInput.d.ts +13 -0
- package/dist/{src/Components → Components}/FormElements/Input/FileInput/MultipleFileInput.d.ts +6 -6
- package/dist/Components/FormElements/Input/HiddenInput.d.ts +6 -0
- package/dist/Components/FormElements/Input/HiddenInput.stories.d.ts +9 -0
- package/dist/{src/Components → Components}/FormElements/Input/Input.d.ts +4 -4
- package/dist/Components/FormElements/Input/Input.stories.d.ts +18 -0
- package/dist/{src/Components → Components}/FormElements/Input/PasswordInput/PasswordInput.d.ts +5 -4
- package/dist/Components/FormElements/Input/PasswordInput/PasswordInput.stories.d.ts +8 -0
- package/dist/{src/Components → Components}/FormElements/SearchSelectInput/SearchSelectInput.d.ts +4 -4
- package/dist/Components/FormElements/SearchSelectInput/SearchSelectInput.stories.d.ts +9 -0
- package/dist/{src/Components → Components}/FormElements/Select/Select.d.ts +4 -4
- package/dist/Components/FormElements/Select/Select.stories.d.ts +8 -0
- package/dist/{src/Components → Components}/FormElements/Slider/Slider.d.ts +4 -4
- package/dist/Components/FormElements/Slider/Slider.stories.d.ts +7 -0
- package/dist/{src/Components → Components}/FormElements/Switch/Switch.d.ts +5 -5
- package/dist/Components/FormElements/Switch/Switch.stories.d.ts +11 -0
- package/dist/{src/Components → Components}/FormElements/Textarea/Textarea.d.ts +4 -4
- package/dist/Components/FormElements/Textarea/Textarea.stories.d.ts +9 -0
- package/dist/{src/Components → Components}/FormElements/hooks/useOnChangeDone.d.ts +1 -1
- package/dist/{src/Components → Components}/FullScreen/FullScreen.d.ts +4 -4
- package/dist/{src/Components → Components}/Hooks/useClientLayoutEffect.d.ts +1 -1
- package/dist/{src/Components → Components}/Hooks/useComposedRef.d.ts +1 -1
- package/dist/{src/Components → Components}/Hooks/useDelayedState.d.ts +1 -1
- package/dist/{src/Components → Components}/Hooks/useInViewport.d.ts +1 -1
- package/dist/{src/Components → Components}/Icon/DoubleIcon.d.ts +1 -1
- package/dist/Components/Icon/DoubleIcon.stories.d.ts +23 -0
- package/dist/{src/Components → Components}/Icon/Icon.d.ts +5 -5
- package/dist/Components/Icon/Icon.stories.d.ts +17 -0
- package/dist/Components/Image/Image.d.ts +10 -0
- package/dist/Components/Image/Image.stories.d.ts +7 -0
- package/dist/{src/Components → Components}/InViewport/InViewport.d.ts +1 -1
- package/dist/{src/Components → Components}/Layout/Block.d.ts +4 -4
- package/dist/{src/Components → Components}/Layout/Container.d.ts +1 -1
- package/dist/{src/Components → Components}/Layout/Flex.d.ts +3 -3
- package/dist/{src/Components → Components}/Layout/Grid/Grid.d.ts +3 -3
- package/dist/{src/Components → Components}/Layout/Grid/GridItem.d.ts +1 -1
- package/dist/Components/Layout/Grow.d.ts +10 -0
- package/dist/{src/Components → Components}/Layout/Inline.d.ts +3 -3
- package/dist/{src/Components → Components}/Layout/InlineBlock.d.ts +3 -3
- package/dist/{src/Components → Components}/Layout/View.d.ts +4 -4
- package/dist/{src/Components → Components}/Layout/ViewWithoutListeners.d.ts +3 -3
- package/dist/Components/LoadingArea/LoadingArea.d.ts +9 -0
- package/dist/Components/LoadingArea/LoadingArea.stories.d.ts +9 -0
- package/dist/Components/LoadingCircle/LoadingCircle.d.ts +7 -0
- package/dist/Components/LoadingCircle/LoadingCircle.stories.d.ts +26 -0
- package/dist/{src/Components → Components}/Menu/HoverMenu.d.ts +3 -3
- package/dist/Components/Menu/HoverMenu.stories.d.ts +16 -0
- package/dist/{src/Components → Components}/Menu/Menu.d.ts +2 -2
- package/dist/Components/Menu/Menu.stories.d.ts +14 -0
- package/dist/{src/Components → Components}/Menu/MenuCloseContext.d.ts +1 -1
- package/dist/{src/Components → Components}/Menu/MenuDivider.d.ts +1 -1
- package/dist/{src/Components → Components}/Menu/MenuItem.d.ts +4 -3
- package/dist/Components/Menu/MenuItem.stories.d.ts +21 -0
- package/dist/{src/Components → Components}/Menu/Submenu.d.ts +3 -3
- package/dist/Components/Menu/Submenu.stories.d.ts +10 -0
- package/dist/{src/Components → Components}/Menu/useMenu.d.ts +2 -2
- package/dist/{src/Components → Components}/RbmComponentProps.d.ts +4 -4
- package/dist/{src/Components → Components}/SizeCalculator/SizeCalculator.d.ts +1 -1
- package/dist/Components/SpoilerList/Spoiler/Spoiler.d.ts +16 -0
- package/dist/Components/SpoilerList/Spoiler/Spoiler.stories.d.ts +7 -0
- package/dist/{src/Components → Components}/SpoilerList/SpoilerList.d.ts +3 -5
- package/dist/{src/Components → Components}/TabBar/TabBar.d.ts +4 -6
- package/dist/Components/TabBar/TabBar.stories.d.ts +10 -0
- package/dist/Components/TabBar/TabBarButton.d.ts +7 -0
- package/dist/{src/Components → Components}/Table/Table.d.ts +3 -3
- package/dist/{src/Components → Components}/Text/Heading.d.ts +2 -2
- package/dist/{src/Components → Components}/Text/Text.d.ts +3 -3
- package/dist/Components/Text/Text.stories.d.ts +35 -0
- package/dist/Components/Toast/Toast.d.ts +12 -0
- package/dist/Components/Toast/Toast.stories.d.ts +8 -0
- package/dist/{src/Components → Components}/Toast/ToastContainer.d.ts +2 -2
- package/dist/Components/TopBar/MoreButton.d.ts +7 -0
- package/dist/{src/Components → Components}/TopBar/TopBar.d.ts +4 -6
- package/dist/Components/TopBar/TopBar.stories.d.ts +7 -0
- package/dist/Components/TopBar/TopBarButton.d.ts +7 -0
- package/dist/helper/useDeepShallow.d.ts +1 -0
- package/dist/helper/withMemo.d.ts +3 -0
- package/dist/{src/helper → helper}/withRenderBrowserOnly.d.ts +1 -1
- package/dist/helper/withRestrictedChildren.d.ts +7 -0
- package/dist/index.css +36 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +116 -0
- package/dist/index.js +5357 -0
- package/dist/index.js.map +1 -0
- package/dist/treeshakeTest.d.ts +1 -0
- package/eslint.config.js +17 -0
- package/package.json +41 -90
- package/react-bootstrap-mobile.scss +6 -6
- package/src/Components/ActionSheet/ActionSheet.stories.tsx +55 -0
- package/src/Components/ActionSheet/ActionSheet.tsx +37 -24
- package/src/Components/ActionSheet/actionSheet.module.scss +198 -0
- package/src/Components/Card/Card.stories.tsx +41 -0
- package/src/Components/Card/Card.tsx +6 -9
- package/src/Components/Card/card.module.scss +74 -0
- package/src/Components/Clickable/Clickable.tsx +73 -63
- package/src/Components/Clickable/clickable.module.scss +14 -0
- package/src/Components/Colors.stories.tsx +77 -0
- package/src/Components/Dialog/AlertDialog.stories.tsx +28 -0
- package/src/Components/Dialog/AlertDialog.tsx +10 -9
- package/src/Components/Dialog/ButtonDialog.tsx +15 -13
- package/src/Components/Dialog/ConfirmDialog.stories.tsx +29 -0
- package/src/Components/Dialog/ConfirmDialog.tsx +11 -9
- package/src/Components/Dialog/Dialog.tsx +10 -10
- package/src/Components/Dialog/DialogBackground.tsx +32 -21
- package/src/Components/Dialog/DialogContainer.tsx +23 -18
- package/src/Components/Dialog/DialogContext.ts +7 -6
- package/src/Components/Dialog/{buttonDialog.scss → buttonDialog.module.scss} +29 -21
- package/src/Components/Dialog/dialog.module.scss +30 -0
- package/src/Components/Dialog/dialogBackground.module.scss +17 -0
- package/src/Components/Dialog/useAlertDialog.ts +3 -3
- package/src/Components/Dialog/useConfirmDialog.ts +3 -3
- package/src/Components/DragAndDrop/DragItem.tsx +7 -6
- package/src/Components/DragAndDrop/DropArea.tsx +5 -4
- package/src/Components/Flavor.ts +4 -4
- package/src/Components/FormElements/Button/Button.stories.tsx +79 -0
- package/src/Components/FormElements/Button/Button.tsx +49 -36
- package/src/Components/FormElements/Button/ButtonType.ts +2 -2
- package/src/Components/FormElements/Button/button.module.scss +87 -0
- package/src/Components/FormElements/CheckBox/Checkbox.stories.tsx +50 -0
- package/src/Components/FormElements/CheckBox/Checkbox.tsx +13 -14
- package/src/Components/FormElements/CheckBox/{checkbox.scss → checkbox.module.scss} +30 -11
- package/src/Components/FormElements/ColorInput/ColorInput.stories.tsx +24 -0
- package/src/Components/FormElements/ColorInput/ColorInput.tsx +55 -59
- package/src/Components/FormElements/ColorInput/{colorInput.scss → colorInput.module.scss} +17 -19
- package/src/Components/FormElements/ColorInput/sharedSelectedColor.ts +19 -10
- package/src/Components/FormElements/Controller/ColorInputController.ts +3 -3
- package/src/Components/FormElements/Controller/FileInputController.tsx +29 -20
- package/src/Components/FormElements/Controller/HookForm.tsx +128 -24
- package/src/Components/FormElements/Controller/InputController.ts +3 -3
- package/src/Components/FormElements/Controller/MultipleFileInputController.ts +2 -3
- package/src/Components/FormElements/Controller/PasswordInputController.ts +3 -3
- package/src/Components/FormElements/Controller/SelectController.ts +3 -3
- package/src/Components/FormElements/Controller/SendFormContext.ts +3 -3
- package/src/Components/FormElements/Controller/SliderController.ts +4 -0
- package/src/Components/FormElements/Controller/SwitchController.ts +3 -3
- package/src/Components/FormElements/Controller/TextareaController.ts +2 -2
- package/src/Components/FormElements/Controller/useYupResolver.ts +10 -8
- package/src/Components/FormElements/Controller/withHookController.tsx +21 -18
- package/src/Components/FormElements/Error/FormError.stories.tsx +16 -0
- package/src/Components/FormElements/Error/FormError.tsx +42 -0
- package/src/Components/FormElements/Error/formError.module.scss +9 -0
- package/src/Components/FormElements/Form.stories.tsx +16 -0
- package/src/Components/FormElements/Input/FileInput/FileInput.tsx +52 -32
- package/src/Components/FormElements/Input/FileInput/MultipleFileInput.tsx +234 -231
- package/src/Components/FormElements/Input/FileInput/{fileInput.scss → fileInput.module.scss} +10 -12
- package/src/Components/FormElements/Input/HiddenInput.stories.tsx +44 -0
- package/src/Components/FormElements/Input/HiddenInput.tsx +6 -8
- package/src/Components/FormElements/Input/Input.stories.tsx +59 -0
- package/src/Components/FormElements/Input/Input.tsx +173 -172
- package/src/Components/FormElements/Input/PasswordInput/PasswordInput.stories.tsx +31 -0
- package/src/Components/FormElements/Input/PasswordInput/PasswordInput.tsx +20 -16
- package/src/Components/FormElements/Input/input.module.scss +95 -0
- package/src/Components/FormElements/SearchSelectInput/SearchSelectInput.stories.tsx +49 -0
- package/src/Components/FormElements/SearchSelectInput/SearchSelectInput.tsx +178 -166
- package/src/Components/FormElements/SearchSelectInput/seachSelectInput.module.scss +112 -0
- package/src/Components/FormElements/Select/Select.stories.tsx +49 -0
- package/src/Components/FormElements/Select/Select.tsx +34 -24
- package/src/Components/FormElements/Select/select.module.scss +63 -0
- package/src/Components/FormElements/Slider/Slider.stories.tsx +15 -0
- package/src/Components/FormElements/Slider/Slider.tsx +29 -20
- package/src/Components/FormElements/Slider/slider.module.scss +93 -0
- package/src/Components/FormElements/Switch/Switch.stories.tsx +65 -0
- package/src/Components/FormElements/Switch/Switch.tsx +72 -63
- package/src/Components/FormElements/Switch/switch.module.scss +157 -0
- package/src/Components/FormElements/Textarea/Textarea.stories.tsx +37 -0
- package/src/Components/FormElements/Textarea/Textarea.tsx +46 -45
- package/src/Components/FormElements/Textarea/textarea.module.scss +34 -0
- package/src/Components/FormElements/hooks/useOnChangeDone.ts +6 -2
- package/src/Components/FullScreen/FullScreen.tsx +16 -16
- package/src/Components/Hooks/useBreakpoint.ts +13 -7
- package/src/Components/Hooks/useClientLayoutEffect.ts +1 -1
- package/src/Components/Hooks/useComposedRef.ts +2 -1
- package/src/Components/Hooks/useDebounced.ts +2 -2
- package/src/Components/Hooks/useDelayed.ts +2 -3
- package/src/Components/Hooks/useDelayedEffect.ts +3 -3
- package/src/Components/Hooks/useDelayedState.ts +18 -10
- package/src/Components/Hooks/useInViewport.ts +3 -2
- package/src/Components/Hooks/useKeyListener.ts +9 -6
- package/src/Components/Hooks/useListener.ts +4 -4
- package/src/Components/Hooks/useMousePosition.ts +2 -2
- package/src/Components/Hooks/useRerender.ts +17 -14
- package/src/Components/Hooks/useWindowDimensions.ts +11 -12
- package/src/Components/Icon/DoubleIcon.stories.tsx +38 -0
- package/src/Components/Icon/DoubleIcon.tsx +22 -17
- package/src/Components/Icon/Icon.stories.tsx +37 -0
- package/src/Components/Icon/Icon.tsx +39 -17
- package/src/Components/Icon/{icon.scss → icon.module.scss} +2 -0
- package/src/Components/Image/Image.stories.tsx +17 -0
- package/src/Components/Image/Image.tsx +7 -12
- package/src/Components/InViewport/InViewport.tsx +5 -6
- package/src/Components/Layout/Block.tsx +18 -12
- package/src/Components/Layout/Container.tsx +5 -6
- package/src/Components/Layout/Flex.tsx +17 -9
- package/src/Components/Layout/Grid/Grid.tsx +20 -10
- package/src/Components/Layout/Grid/GridItem.tsx +5 -6
- package/src/Components/Layout/Grid/{grid.scss → grid.module.scss} +19 -26
- package/src/Components/Layout/Grow.tsx +18 -8
- package/src/Components/Layout/Inline.tsx +15 -12
- package/src/Components/Layout/InlineBlock.tsx +17 -12
- package/src/Components/Layout/View.tsx +20 -9
- package/src/Components/Layout/ViewWithoutListeners.tsx +24 -15
- package/src/Components/Layout/container.module.scss +54 -0
- package/src/Components/LoadingArea/LoadingArea.stories.tsx +35 -0
- package/src/Components/LoadingArea/LoadingArea.tsx +10 -15
- package/src/Components/LoadingArea/{loadingArea.scss → loadingArea.module.scss} +8 -5
- package/src/Components/LoadingCircle/LoadingCircle.stories.tsx +58 -0
- package/src/Components/LoadingCircle/LoadingCircle.tsx +26 -13
- package/src/Components/LoadingCircle/{loadingCircle.scss → loadingCircle.module.scss} +14 -5
- package/src/Components/Menu/HoverMenu.stories.tsx +32 -0
- package/src/Components/Menu/HoverMenu.tsx +61 -45
- package/src/Components/Menu/Menu.stories.tsx +69 -0
- package/src/Components/Menu/Menu.tsx +67 -58
- package/src/Components/Menu/MenuCloseContext.ts +1 -1
- package/src/Components/Menu/MenuDivider.tsx +6 -6
- package/src/Components/Menu/MenuItem.stories.tsx +35 -0
- package/src/Components/Menu/MenuItem.tsx +66 -55
- package/src/Components/Menu/Submenu.stories.tsx +37 -0
- package/src/Components/Menu/Submenu.tsx +72 -58
- package/src/Components/Menu/{menu.scss → menu.module.scss} +23 -11
- package/src/Components/Menu/useMenu.ts +4 -3
- package/src/Components/RbmComponentProps.ts +6 -7
- package/src/Components/SizeCalculator/SizeCalculator.tsx +3 -3
- package/src/Components/SpoilerList/Spoiler/Spoiler.stories.tsx +21 -0
- package/src/Components/SpoilerList/Spoiler/Spoiler.tsx +49 -48
- package/src/Components/SpoilerList/Spoiler/{spoiler.scss → spoiler.module.scss} +46 -30
- package/src/Components/SpoilerList/SpoilerList.tsx +8 -12
- package/src/Components/SpoilerList/useSpoilerGroup.ts +2 -2
- package/src/Components/TabBar/TabBar.stories.tsx +32 -0
- package/src/Components/TabBar/TabBar.tsx +16 -18
- package/src/Components/TabBar/TabBarButton.tsx +13 -10
- package/src/Components/TabBar/tabBar.module.scss +128 -0
- package/src/Components/Table/Table.tsx +16 -15
- package/src/Components/Text/Heading.tsx +6 -7
- package/src/Components/Text/Text.stories.tsx +121 -0
- package/src/Components/Text/Text.tsx +19 -10
- package/src/Components/Text/{text.scss → text.module.scss} +3 -8
- package/src/Components/Toast/Toast.stories.tsx +25 -0
- package/src/Components/Toast/Toast.tsx +15 -17
- package/src/Components/Toast/ToastContainer.tsx +72 -54
- package/src/Components/Toast/ToastContext.ts +9 -3
- package/src/Components/Toast/toast.module.scss +65 -0
- package/src/Components/TopBar/MoreButton.tsx +9 -11
- package/src/Components/TopBar/TopBar.stories.tsx +63 -0
- package/src/Components/TopBar/TopBar.tsx +49 -40
- package/src/Components/TopBar/TopBarButton.tsx +20 -10
- package/src/Components/TopBar/{topBar.scss → topBar.module.scss} +40 -23
- package/src/Size.ts +1 -2
- package/src/WrongChildError.ts +1 -1
- package/src/helper/EmptyProps.ts +1 -1
- package/src/helper/nonEmptyString.ts +1 -1
- package/src/helper/useDeepShallow.ts +10 -0
- package/src/helper/withMemo.ts +7 -8
- package/src/helper/withRenderBrowserOnly.tsx +2 -1
- package/src/helper/withRestrictedChildren.tsx +11 -14
- package/src/index.ts +116 -0
- package/src/scss/_colors.scss +32 -19
- package/src/scss/_default.scss +5 -5
- package/src/scss/_flavorMixin.scss +3 -0
- package/src/scss/_variables.scss +19 -19
- package/src/scss/_vars.scss +12 -0
- package/src/scss/baseClasses.module.scss +23 -0
- package/src/scss/breakpoints.scss +79 -0
- package/src/treeshakeTest.ts +3 -0
- package/src/types/{react-table-config.d.ts → reactTableConfig.d.ts} +2 -43
- package/stylelint.config.mjs +4 -0
- package/tsconfig.build.json +7 -0
- package/tsconfig.json +16 -48
- package/webpack.config.ts +6 -0
- package/.eslintrc.json +0 -191
- package/.npnignore +0 -5
- package/LICENSE +0 -21
- package/README.md +0 -1
- package/babel.config.js +0 -22
- package/bin/build.js +0 -60
- package/bin/updateCopies.js +0 -94
- package/bootstrapReactMobile.ts +0 -119
- package/dist/bootstrapReactMobile.d.ts +0 -119
- package/dist/bootstrapReactMobile.js +0 -14043
- package/dist/bootstrapReactMobile.js.map +0 -1
- package/dist/src/Components/Card/Card.d.ts +0 -14
- package/dist/src/Components/Dialog/AlertDialog.d.ts +0 -10
- package/dist/src/Components/Dialog/ConfirmDialog.d.ts +0 -11
- package/dist/src/Components/FormElements/CheckBox/Checkbox.d.ts +0 -14
- package/dist/src/Components/FormElements/Controller/HookForm.d.ts +0 -8
- package/dist/src/Components/FormElements/FormError.d.ts +0 -5
- package/dist/src/Components/FormElements/Input/FileInput/FileInput.d.ts +0 -13
- package/dist/src/Components/FormElements/Input/HiddenInput.d.ts +0 -8
- package/dist/src/Components/Image/Image.d.ts +0 -12
- package/dist/src/Components/Layout/Grow.d.ts +0 -9
- package/dist/src/Components/List/BulletList/BulletList.d.ts +0 -8
- package/dist/src/Components/List/BulletList/ListItem.d.ts +0 -7
- package/dist/src/Components/List/InfiniteList.d.ts +0 -7
- package/dist/src/Components/List/List.d.ts +0 -15
- package/dist/src/Components/LoadingArea/LoadingArea.d.ts +0 -12
- package/dist/src/Components/LoadingCircle/LoadingCircle.d.ts +0 -8
- package/dist/src/Components/SpoilerList/Spoiler/Spoiler.d.ts +0 -18
- package/dist/src/Components/TabBar/TabBarButton.d.ts +0 -9
- package/dist/src/Components/Toast/Toast.d.ts +0 -13
- package/dist/src/Components/TopBar/MoreButton.d.ts +0 -9
- package/dist/src/Components/TopBar/TopBarButton.d.ts +0 -9
- package/dist/src/ListRow/ListRow.d.ts +0 -1
- package/dist/src/StyleProvider.d.ts +0 -2
- package/dist/src/helper/withMemo.d.ts +0 -3
- package/dist/src/helper/withRestrictedChildren.d.ts +0 -6
- package/scripts/getPackageJson.js +0 -25
- package/src/Components/ActionSheet/actionSheet.scss +0 -153
- package/src/Components/Card/card.scss +0 -76
- package/src/Components/Clickable/clickable.scss +0 -8
- package/src/Components/Dialog/dialog.scss +0 -30
- package/src/Components/Dialog/dialogBackground.scss +0 -11
- package/src/Components/FormElements/Button/button.scss +0 -73
- package/src/Components/FormElements/FormError.tsx +0 -29
- package/src/Components/FormElements/Input/input.scss +0 -83
- package/src/Components/FormElements/SearchSelectInput/seachSelectInput.scss +0 -97
- package/src/Components/FormElements/Select/select.scss +0 -61
- package/src/Components/FormElements/Slider/slider.scss +0 -92
- package/src/Components/FormElements/Switch/switch.scss +0 -152
- package/src/Components/FormElements/Textarea/textarea.scss +0 -31
- package/src/Components/FormElements/formError.scss +0 -4
- package/src/Components/Layout/container.scss +0 -12
- package/src/Components/List/BulletList/BulletList.tsx +0 -33
- package/src/Components/List/BulletList/ListItem.tsx +0 -34
- package/src/Components/List/InfiniteList.tsx +0 -56
- package/src/Components/List/List.tsx +0 -95
- package/src/Components/List/list.scss +0 -30
- package/src/Components/TabBar/tabBar.scss +0 -108
- package/src/Components/Toast/toast.scss +0 -55
- package/src/ListRow/ListRow.tsx +0 -20
- package/src/StyleProvider.ts +0 -4
- package/src/scss/_baseClasses.scss +0 -23
- package/src/types/isomorphic-style-loader.d.ts +0 -3
- package/webpack.config.js +0 -95
- /package/dist/{src/Components → Components}/Dialog/useAlertDialog.d.ts +0 -0
- /package/dist/{src/Components → Components}/Dialog/useConfirmDialog.d.ts +0 -0
- /package/dist/{src/Components → Components}/DragAndDrop/useStrictEnabled.d.ts +0 -0
- /package/dist/{src/Components → Components}/Flavor.d.ts +0 -0
- /package/dist/{src/Components → Components}/FormElements/Button/ButtonType.d.ts +0 -0
- /package/dist/{src/Components → Components}/FormElements/ColorInput/sharedSelectedColor.d.ts +0 -0
- /package/dist/{src/Components → Components}/FormElements/Controller/SendFormContext.d.ts +0 -0
- /package/dist/{src/Components → Components}/FormElements/Input/FileInput/FileType.d.ts +0 -0
- /package/dist/{src/Components → Components}/Hooks/useBreakpoint.d.ts +0 -0
- /package/dist/{src/Components → Components}/Hooks/useDebounced.d.ts +0 -0
- /package/dist/{src/Components → Components}/Hooks/useDelayed.d.ts +0 -0
- /package/dist/{src/Components → Components}/Hooks/useDelayedEffect.d.ts +0 -0
- /package/dist/{src/Components → Components}/Hooks/useKeyListener.d.ts +0 -0
- /package/dist/{src/Components → Components}/Hooks/useListener.d.ts +0 -0
- /package/dist/{src/Components → Components}/Hooks/useMousePosition.d.ts +0 -0
- /package/dist/{src/Components → Components}/Hooks/useOnMount.d.ts +0 -0
- /package/dist/{src/Components → Components}/Hooks/useOnce.d.ts +0 -0
- /package/dist/{src/Components → Components}/Hooks/useRerender.d.ts +0 -0
- /package/dist/{src/Components → Components}/Hooks/useWindowDimensions.d.ts +0 -0
- /package/dist/{src/Components → Components}/SpoilerList/useSpoilerGroup.d.ts +0 -0
- /package/dist/{src/Components → Components}/Toast/ToastContext.d.ts +0 -0
- /package/dist/{src/Size.d.ts → Size.d.ts} +0 -0
- /package/dist/{src/TypeHelpers.d.ts → TypeHelpers.d.ts} +0 -0
- /package/dist/{src/WindowContext → WindowContext}/WindowContext.d.ts +0 -0
- /package/dist/{src/WrongChildError.d.ts → WrongChildError.d.ts} +0 -0
- /package/dist/{src/helper → helper}/Characters.d.ts +0 -0
- /package/dist/{src/helper → helper}/DistributiveOmit.d.ts +0 -0
- /package/dist/{src/helper → helper}/EmptyProps.d.ts +0 -0
- /package/dist/{src/helper → helper}/memoComparator.d.ts +0 -0
- /package/dist/{src/helper → helper}/nonEmptyString.d.ts +0 -0
- /package/src/Components/FormElements/Input/PasswordInput/{passwordInput.scss → passwordInput.module.scss} +0 -0
- /package/src/Components/Image/{image.scss → image.module.scss} +0 -0
- /package/src/Components/InViewport/{inViewport.scss → inViewport.module.scss} +0 -0
- /package/src/Components/Layout/{layout.scss → layout.module.scss} +0 -0
- /package/src/Components/Text/{heading.scss → heading.module.scss} +0 -0
- /package/src/types/{scss-module.d.ts → scss.d.ts} +0 -0
|
@@ -20,7 +20,7 @@ export function useSpoilerGroup(defaultKey?: number | string, options: Partial<S
|
|
|
20
20
|
return oldKey;
|
|
21
21
|
});
|
|
22
22
|
},
|
|
23
|
-
[options?.closeWithClick]
|
|
23
|
+
[options?.closeWithClick],
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
const createProps = useCallback(
|
|
@@ -32,7 +32,7 @@ export function useSpoilerGroup(defaultKey?: number | string, options: Partial<S
|
|
|
32
32
|
noClosingAnimation: options?.noClosingAnimation !== false,
|
|
33
33
|
closeIcon: null,
|
|
34
34
|
}),
|
|
35
|
-
[onClick, openKey, options?.noClosingAnimation]
|
|
35
|
+
[onClick, openKey, options?.noClosingAnimation],
|
|
36
36
|
);
|
|
37
37
|
|
|
38
38
|
return [createProps, openKey] as const;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { TabBar } from '@/Components/TabBar/TabBar';
|
|
4
|
+
import { faCog, faHome, faSearch, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import { fn } from 'storybook/test';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
component: TabBar,
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: 'padded',
|
|
11
|
+
},
|
|
12
|
+
} satisfies Meta<typeof TabBar>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
args: {
|
|
20
|
+
transparent: false,
|
|
21
|
+
underline: false,
|
|
22
|
+
drawBehind: false,
|
|
23
|
+
buttons: [
|
|
24
|
+
{ title: 'Home', icon: faHome },
|
|
25
|
+
{ title: 'Search', icon: faSearch },
|
|
26
|
+
{ title: 'Profile', icon: faUser },
|
|
27
|
+
{ title: 'Settings', icon: faCog },
|
|
28
|
+
],
|
|
29
|
+
startActiveTab: 0,
|
|
30
|
+
onTabChange: fn(),
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { Icon
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
import { withMemo } from '../../helper/withMemo';
|
|
2
|
+
import { Container } from '@/Components/Layout/Container';
|
|
3
|
+
import { Icon } from '@/Components/Icon/Icon';
|
|
4
|
+
import { Inline } from '@/Components/Layout/Inline';
|
|
5
|
+
import { TabBarButton } from '@/Components/TabBar/TabBarButton';
|
|
6
|
+
import { Text } from '@/Components/Text/Text';
|
|
7
|
+
import { useCallback, useState } from 'react';
|
|
8
|
+
import { withMemo } from '@/helper/withMemo';
|
|
10
9
|
import classNames from 'classnames';
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import styles from '@/Components/TabBar/tabBar.module.scss';
|
|
11
|
+
import type { ComponentType } from 'react';
|
|
12
|
+
import type { IconSource } from '@/Components/Icon/Icon';
|
|
13
|
+
import type { ListenerWithData } from '@/Components/Hooks/useListener';
|
|
14
|
+
import type { RbmComponentProps } from '@/Components/RbmComponentProps';
|
|
14
15
|
|
|
15
16
|
export type TabBarComponentButtonType = {
|
|
16
17
|
component: ComponentType<Record<string, any>>;
|
|
@@ -62,7 +63,7 @@ function getButtonComponents(buttons: TabBarButtonType[], activeTab: number, onS
|
|
|
62
63
|
});
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
function TabBar({
|
|
66
|
+
export const TabBar = withMemo(function TabBar({
|
|
66
67
|
buttons,
|
|
67
68
|
startActiveTab,
|
|
68
69
|
onTabChange,
|
|
@@ -84,7 +85,7 @@ function TabBar({
|
|
|
84
85
|
setInternalActiveTab(index);
|
|
85
86
|
onTabChange(index);
|
|
86
87
|
},
|
|
87
|
-
[onTabChange, setInternalActiveTab]
|
|
88
|
+
[onTabChange, setInternalActiveTab],
|
|
88
89
|
);
|
|
89
90
|
|
|
90
91
|
// Effects
|
|
@@ -103,7 +104,7 @@ function TabBar({
|
|
|
103
104
|
[styles.transparent]: transparent,
|
|
104
105
|
[styles.underlined]: underline,
|
|
105
106
|
},
|
|
106
|
-
className
|
|
107
|
+
className,
|
|
107
108
|
)}
|
|
108
109
|
>
|
|
109
110
|
<Container fluid="xxl" className={styles.buttonContainer}>
|
|
@@ -111,7 +112,4 @@ function TabBar({
|
|
|
111
112
|
</Container>
|
|
112
113
|
</div>
|
|
113
114
|
);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
const TabBarMemo = withMemo(TabBar, styles);
|
|
117
|
-
export { TabBarMemo as TabBar };
|
|
115
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import styles from './tabBar.scss';
|
|
5
|
-
import { withMemo } from '../../helper/withMemo';
|
|
2
|
+
import { useListenerWithExtractedProps } from '@/Components/Hooks/useListener';
|
|
3
|
+
import { withMemo } from '@/helper/withMemo';
|
|
6
4
|
import classNames from 'classnames';
|
|
7
|
-
import
|
|
5
|
+
import styles from '@/Components/TabBar/tabBar.module.scss';
|
|
6
|
+
import type { Listener } from '@/Components/Hooks/useListener';
|
|
7
|
+
import type { RbmComponentProps } from '@/Components/RbmComponentProps';
|
|
8
8
|
|
|
9
9
|
export type TabBarButtonProps = RbmComponentProps<
|
|
10
10
|
{
|
|
@@ -12,7 +12,12 @@ export type TabBarButtonProps = RbmComponentProps<
|
|
|
12
12
|
} & Listener<'onClick', number>
|
|
13
13
|
>;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
export const TabBarButton = withMemo(function TabBarButton({
|
|
16
|
+
active,
|
|
17
|
+
className,
|
|
18
|
+
children,
|
|
19
|
+
...rbmProps
|
|
20
|
+
}: TabBarButtonProps) {
|
|
16
21
|
// Variables
|
|
17
22
|
|
|
18
23
|
// States
|
|
@@ -32,13 +37,11 @@ function TabBarButton({ active, className, children, ...rbmProps }: TabBarButton
|
|
|
32
37
|
<a
|
|
33
38
|
{...otherProps}
|
|
34
39
|
role="button"
|
|
40
|
+
tabIndex={0}
|
|
35
41
|
onClick={onClick}
|
|
36
42
|
className={classNames(styles.button, { [styles.buttonActive]: active, className })}
|
|
37
43
|
>
|
|
38
44
|
{children}
|
|
39
45
|
</a>
|
|
40
46
|
);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const TabBarButtonMemo = withMemo(TabBarButton, styles);
|
|
44
|
-
export { TabBarButtonMemo as TabBarButton };
|
|
47
|
+
});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
@use "../../scss/variables" as variables;
|
|
2
|
+
@use "../../scss/designMixin" as mixin;
|
|
3
|
+
@use "../../scss/vars" as *;
|
|
4
|
+
|
|
5
|
+
@include vars {
|
|
6
|
+
--tab-bar-button-active-background-color: var(--tab-bar-background-color);
|
|
7
|
+
--tab-bar-button-active-underline-color: var(--tab-bar-button-active-text-color);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@include mixin.design(variables.$material) {
|
|
11
|
+
--tab-bar-background-color: var(--foreground-primary);
|
|
12
|
+
--tab-bar-box-shadow-color: var(--box-shadow-color);
|
|
13
|
+
--tab-bar-button-text-color: var(--text-primary);
|
|
14
|
+
--tab-bar-button-active-text-color: var(--tab-bar-button-text-color);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@include mixin.design(variables.$flat) {
|
|
18
|
+
--tab-bar-background-color: var(--foreground-primary);
|
|
19
|
+
--tab-bar-button-active-text-color: var(--flavor-accent);
|
|
20
|
+
--tab-bar-border-top-color: var(--border-light);
|
|
21
|
+
--tab-bar-button-text-color: var(--text-tertiary);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.tabBar {
|
|
25
|
+
height: 60px;
|
|
26
|
+
width: 100%;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-wrap: wrap;
|
|
29
|
+
padding-left: 0;
|
|
30
|
+
margin-bottom: 0;
|
|
31
|
+
list-style: none;
|
|
32
|
+
background-color: var(--tab-bar-background-color);
|
|
33
|
+
|
|
34
|
+
.buttonContainer {
|
|
35
|
+
padding: 0;
|
|
36
|
+
display: flex;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&.underlined {
|
|
40
|
+
.buttonActive {
|
|
41
|
+
@include mixin.design(variables.$flat) {
|
|
42
|
+
border-bottom: 4px solid var(--tab-bar-button-active-underline-color);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&.transparent {
|
|
48
|
+
opacity: 0.65;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@include mixin.design(variables.$material) {
|
|
52
|
+
box-shadow: 0 -2px 2px 0 var(--tab-bar-box-shadow-color), 0 -1px 5px 0 var(--tab-bar-box-shadow-color), 0 -1px 1px 0 var(--tab-bar-box-shadow-color);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@include mixin.design(variables.$flat) {
|
|
56
|
+
border-top: 1px solid var(--tab-bar-border-top-color);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.button {
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
padding: 0;
|
|
65
|
+
flex-basis: 0;
|
|
66
|
+
flex-grow: 1;
|
|
67
|
+
text-align: center;
|
|
68
|
+
text-decoration: none;
|
|
69
|
+
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
|
|
70
|
+
|
|
71
|
+
> span {
|
|
72
|
+
width: 100%;
|
|
73
|
+
display: inline-block;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.buttonIcon {
|
|
77
|
+
display: block;
|
|
78
|
+
font-size: 24px;
|
|
79
|
+
line-height: 26px;
|
|
80
|
+
height: 28px;
|
|
81
|
+
margin: auto;
|
|
82
|
+
|
|
83
|
+
+ .buttonTitle {
|
|
84
|
+
font-size: 10px;
|
|
85
|
+
line-height: 1;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.buttonTitle {
|
|
90
|
+
display: block;
|
|
91
|
+
margin: auto;
|
|
92
|
+
font-size: 16px;
|
|
93
|
+
line-height: 49px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
color: var(--tab-bar-button-text-color);
|
|
97
|
+
|
|
98
|
+
&.buttonActive {
|
|
99
|
+
color: var(--tab-bar-button-active-text-color);
|
|
100
|
+
|
|
101
|
+
--text-primary-default-color: var(--tab-bar-button-active-text-color);
|
|
102
|
+
|
|
103
|
+
background-color: var(--tab-bar-button-active-background-color);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@include mixin.design(variables.$material) {
|
|
107
|
+
position: relative;
|
|
108
|
+
text-transform: uppercase;
|
|
109
|
+
|
|
110
|
+
&::after {
|
|
111
|
+
content: ' ';
|
|
112
|
+
display: block;
|
|
113
|
+
width: 0;
|
|
114
|
+
height: 2px;
|
|
115
|
+
bottom: 0;
|
|
116
|
+
position: absolute;
|
|
117
|
+
margin-top: -2px;
|
|
118
|
+
background-color: var(--tab-bar-button-active-underline-color)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&.buttonActive {
|
|
122
|
+
&::after {
|
|
123
|
+
width: 100%;
|
|
124
|
+
transition: width 0.2s ease-in-out;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useSortBy, useTable } from 'react-table';
|
|
3
|
+
import { withMemo } from '@/helper/withMemo';
|
|
4
|
+
import type {
|
|
3
5
|
Cell,
|
|
4
|
-
Column as RTColumn,
|
|
5
6
|
HeaderGroup,
|
|
6
7
|
PluginHook,
|
|
8
|
+
Column as RTColumn,
|
|
7
9
|
Row,
|
|
8
10
|
TableOptions,
|
|
9
|
-
useSortBy,
|
|
10
11
|
UseSortByOptions,
|
|
11
|
-
useTable,
|
|
12
12
|
} from 'react-table';
|
|
13
|
-
import { RbmComponentProps } from '
|
|
14
|
-
import { ReactNode } from 'react';
|
|
15
|
-
import { withMemo } from '../../helper/withMemo';
|
|
13
|
+
import type { RbmComponentProps } from '@/Components/RbmComponentProps';
|
|
14
|
+
import type { ReactNode } from 'react';
|
|
16
15
|
|
|
17
16
|
export type ColumnCellData<DataType extends string | number | Record<string, unknown>> = {
|
|
18
17
|
value: DataType;
|
|
@@ -62,16 +61,16 @@ function Table<DataType extends string | number | Record<string, unknown>>({
|
|
|
62
61
|
// Variables
|
|
63
62
|
|
|
64
63
|
if (cellRenderer) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
for (const c of columns) {
|
|
65
|
+
c.Cell = c.Cell ?? cellRenderer;
|
|
66
|
+
}
|
|
68
67
|
}
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
for (const c of columns) {
|
|
71
70
|
if (!('width' in c)) {
|
|
72
71
|
c.width = 0;
|
|
73
72
|
}
|
|
74
|
-
}
|
|
73
|
+
}
|
|
75
74
|
|
|
76
75
|
let tableOptions: TableOptions<Record<string, DataType>> = {
|
|
77
76
|
columns,
|
|
@@ -91,7 +90,7 @@ function Table<DataType extends string | number | Record<string, unknown>>({
|
|
|
91
90
|
|
|
92
91
|
const { getTableProps, getTableBodyProps, headerGroups, rows, prepareRow } = useTable<Record<string, DataType>>(
|
|
93
92
|
tableOptions,
|
|
94
|
-
...plugins
|
|
93
|
+
...plugins,
|
|
95
94
|
);
|
|
96
95
|
|
|
97
96
|
// States
|
|
@@ -109,7 +108,9 @@ function Table<DataType extends string | number | Record<string, unknown>>({
|
|
|
109
108
|
if (sortOptions?.renderSortIndicator) {
|
|
110
109
|
return sortOptions.renderSortIndicator(column);
|
|
111
110
|
}
|
|
112
|
-
if (column.isSorted)
|
|
111
|
+
if (column.isSorted) {
|
|
112
|
+
return <span>{column.isSortedDesc ? ' ↓' : ' ↑'}</span>;
|
|
113
|
+
}
|
|
113
114
|
return null;
|
|
114
115
|
};
|
|
115
116
|
|
|
@@ -128,7 +129,7 @@ function Table<DataType extends string | number | Record<string, unknown>>({
|
|
|
128
129
|
// Apply the header cell props
|
|
129
130
|
<th
|
|
130
131
|
{...column.getHeaderProps(
|
|
131
|
-
sortOptions ? column.getSortByToggleProps() : undefined
|
|
132
|
+
sortOptions ? column.getSortByToggleProps() : undefined,
|
|
132
133
|
)}
|
|
133
134
|
>
|
|
134
135
|
{
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { RbmComponentProps, WithStringProps } from '../RbmComponentProps';
|
|
5
|
-
|
|
6
|
-
import styles from './heading.scss';
|
|
2
|
+
import { TEXT_PRIO, TEXT_SIZE, Text } from '@/Components/Text/Text';
|
|
3
|
+
import { withMemo } from '@/helper/withMemo';
|
|
7
4
|
import classNames from 'classnames';
|
|
8
|
-
import
|
|
5
|
+
import styles from '@/Components/Text/heading.module.scss';
|
|
6
|
+
import type { EmptyProps } from '@/helper/EmptyProps';
|
|
7
|
+
import type { RbmComponentProps, WithStringProps } from '@/Components/RbmComponentProps';
|
|
9
8
|
|
|
10
9
|
export type HeadingProps = RbmComponentProps<EmptyProps, WithStringProps>;
|
|
11
10
|
|
|
@@ -40,5 +39,5 @@ function Heading({ children, className, style }: HeadingProps) {
|
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
// Need HeadingMemo for autocompletion of phpstorm
|
|
43
|
-
const HeadingMemo = withMemo(Heading,
|
|
42
|
+
const HeadingMemo = withMemo(Heading, 'text');
|
|
44
43
|
export { HeadingMemo as Heading };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { TEXT_PRIO, TEXT_SIZE, Text } from '@/Components/Text/Text';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
component: Text,
|
|
8
|
+
argTypes: {
|
|
9
|
+
prio: {
|
|
10
|
+
control: { type: 'select' },
|
|
11
|
+
options: [undefined, ...Object.values(TEXT_PRIO)],
|
|
12
|
+
},
|
|
13
|
+
size: {
|
|
14
|
+
control: { type: 'select' },
|
|
15
|
+
options: [undefined, ...Object.values(TEXT_SIZE)],
|
|
16
|
+
},
|
|
17
|
+
children: {
|
|
18
|
+
control: 'text',
|
|
19
|
+
defaultValue: 'Sample Text',
|
|
20
|
+
},
|
|
21
|
+
as: {
|
|
22
|
+
control: { type: 'select' },
|
|
23
|
+
options: [undefined, 'span', 'div', 'p', 'label'],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
} satisfies Meta<typeof Text>;
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
export const Default: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
children: 'Test',
|
|
35
|
+
block: false,
|
|
36
|
+
emphasized: false,
|
|
37
|
+
className: '',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const DifferentSizes: Story = {
|
|
42
|
+
args: {
|
|
43
|
+
children: undefined,
|
|
44
|
+
block: true,
|
|
45
|
+
emphasized: false,
|
|
46
|
+
className: '',
|
|
47
|
+
},
|
|
48
|
+
render: ({ children, ...args }) => (
|
|
49
|
+
<>
|
|
50
|
+
<Text {...args} size={TEXT_SIZE.xSmall}>
|
|
51
|
+
{children || 'X-Small'}
|
|
52
|
+
</Text>
|
|
53
|
+
<Text {...args} size={TEXT_SIZE.small}>
|
|
54
|
+
{children || 'Small'}
|
|
55
|
+
</Text>
|
|
56
|
+
<Text {...args} size={TEXT_SIZE.medium}>
|
|
57
|
+
{children || 'Medium'}
|
|
58
|
+
</Text>
|
|
59
|
+
<Text {...args} size={TEXT_SIZE.large}>
|
|
60
|
+
{children ?? 'Large'}
|
|
61
|
+
</Text>
|
|
62
|
+
<Text {...args} size={TEXT_SIZE.xLarge}>
|
|
63
|
+
{children || 'X-Large'}
|
|
64
|
+
</Text>
|
|
65
|
+
<Text {...args} size={TEXT_SIZE.xxLarge}>
|
|
66
|
+
{children || 'XX-Large'}
|
|
67
|
+
</Text>
|
|
68
|
+
</>
|
|
69
|
+
),
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const DifferentPrios: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
children: 'Test',
|
|
75
|
+
block: true,
|
|
76
|
+
emphasized: false,
|
|
77
|
+
className: '',
|
|
78
|
+
},
|
|
79
|
+
render: ({ children, ...args }) => (
|
|
80
|
+
<>
|
|
81
|
+
<Text {...args} prio={TEXT_PRIO.primary}>
|
|
82
|
+
{children || 'Primary'}
|
|
83
|
+
</Text>
|
|
84
|
+
<Text {...args} prio={TEXT_PRIO.secondary}>
|
|
85
|
+
{children || 'Secondary'}
|
|
86
|
+
</Text>
|
|
87
|
+
<Text {...args} prio={TEXT_PRIO.tertiary}>
|
|
88
|
+
{children || 'Tertiary'}
|
|
89
|
+
</Text>
|
|
90
|
+
<Text {...args} prio={TEXT_PRIO.heading}>
|
|
91
|
+
{children || 'Heading'}
|
|
92
|
+
</Text>
|
|
93
|
+
</>
|
|
94
|
+
),
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const SizesPrioCombo: Story = {
|
|
98
|
+
args: {
|
|
99
|
+
children: undefined,
|
|
100
|
+
block: false,
|
|
101
|
+
emphasized: false,
|
|
102
|
+
className: '',
|
|
103
|
+
},
|
|
104
|
+
render: ({ children, ...args }) => {
|
|
105
|
+
return (
|
|
106
|
+
<table>
|
|
107
|
+
{Object.entries(TEXT_SIZE).map(([sizeName, sizeValue]) => (
|
|
108
|
+
<tr>
|
|
109
|
+
{Object.entries(TEXT_PRIO).map(([prioName, prioValue]) => (
|
|
110
|
+
<td>
|
|
111
|
+
<Text {...args} size={sizeValue} prio={prioValue}>
|
|
112
|
+
{children || `${prioName} ${sizeName}`}
|
|
113
|
+
</Text>
|
|
114
|
+
</td>
|
|
115
|
+
))}
|
|
116
|
+
</tr>
|
|
117
|
+
))}
|
|
118
|
+
</table>
|
|
119
|
+
);
|
|
120
|
+
},
|
|
121
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { Inline } from '@/Components/Layout/Inline';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import { WrongChildError } from '@/WrongChildError';
|
|
2
5
|
import classNames from 'classnames';
|
|
3
|
-
import styles from '
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import { Inline, InlineProps } from '../Layout/Inline';
|
|
8
|
-
import { ViewProps } from '../Layout/View';
|
|
9
|
-
import { JSX } from "react/jsx-runtime";
|
|
6
|
+
import styles from '@/Components/Text/text.module.scss';
|
|
7
|
+
import type { InlineProps } from '@/Components/Layout/Inline';
|
|
8
|
+
import type { Recursive, ValueOf } from '@/TypeHelpers';
|
|
9
|
+
import type { ViewProps } from '@/Components/Layout/View';
|
|
10
10
|
import IntrinsicElements = JSX.IntrinsicElements;
|
|
11
11
|
|
|
12
12
|
export const TEXT_PRIO = {
|
|
@@ -71,13 +71,22 @@ function Text<AsType extends keyof JSX.IntrinsicElements = 'span'>({
|
|
|
71
71
|
<Inline
|
|
72
72
|
__allowChildren="text"
|
|
73
73
|
as={as}
|
|
74
|
-
{...props as InlineProps<AsType>}
|
|
75
|
-
className={classNames(
|
|
74
|
+
{...(props as InlineProps<AsType>)}
|
|
75
|
+
className={classNames(
|
|
76
|
+
styles.text,
|
|
77
|
+
{
|
|
78
|
+
[styles.block]: block,
|
|
79
|
+
[styles.emphasized]: emphasized,
|
|
80
|
+
},
|
|
81
|
+
prio,
|
|
82
|
+
size,
|
|
83
|
+
className,
|
|
84
|
+
)}
|
|
76
85
|
>
|
|
77
86
|
{children}
|
|
78
87
|
</Inline>
|
|
79
88
|
);
|
|
80
89
|
}
|
|
81
90
|
|
|
82
|
-
const tmp = React.memo(
|
|
91
|
+
const tmp = React.memo(Text) as typeof Text;
|
|
83
92
|
export { tmp as Text };
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
$secondaryColor: #71717a; // Gray-500
|
|
3
|
-
$tertiaryColor: #A1A1AA; // Gray-400
|
|
1
|
+
@use "../../scss/vars" as *;
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
--text-primary-default-color:
|
|
7
|
-
--text-prmary: #{$primaryColor};
|
|
8
|
-
--text-secondary: #{$secondaryColor};
|
|
9
|
-
--text-tertiary: #{$tertiaryColor};
|
|
3
|
+
@include vars {
|
|
4
|
+
--text-primary-default-color: var(--text-prmary);
|
|
10
5
|
}
|
|
11
6
|
|
|
12
7
|
.text {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Toast } from '@/Components/Toast/Toast';
|
|
2
|
+
import { fn } from 'storybook/test';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
component: Toast,
|
|
7
|
+
} satisfies Meta<typeof Toast>;
|
|
8
|
+
|
|
9
|
+
export default meta;
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
|
|
13
|
+
export const Default: Story = {
|
|
14
|
+
args: {
|
|
15
|
+
children: 'Toast!',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const ToastWithAction: Story = {
|
|
20
|
+
args: {
|
|
21
|
+
children: 'Toast with action',
|
|
22
|
+
onClick: fn(),
|
|
23
|
+
actionName: 'Action',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import styles from './toast.scss';
|
|
8
|
-
import { withMemo } from '../../helper/withMemo';
|
|
2
|
+
import { Clickable } from '@/Components/Clickable/Clickable';
|
|
3
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
4
|
+
import { useListener } from '@/Components/Hooks/useListener';
|
|
5
|
+
import { withMemo } from '@/helper/withMemo';
|
|
9
6
|
import classNames from 'classnames';
|
|
7
|
+
import styles from '@/Components/Toast/toast.module.scss';
|
|
8
|
+
import type { Listener, OptionalListener } from '@/Components/Hooks/useListener';
|
|
9
|
+
import type { RbmComponentProps, WithStringProps } from '@/Components/RbmComponentProps';
|
|
10
|
+
import type { ReactNode } from 'react';
|
|
10
11
|
|
|
11
12
|
type WithoutActionProps<DismissedData> = {
|
|
12
13
|
timeToShow?: number;
|
|
@@ -17,10 +18,10 @@ type WithActionProps<ActionData, DismissedData> = WithoutActionProps<DismissedDa
|
|
|
17
18
|
|
|
18
19
|
export type ToastProps<ActionData, DismissedData> = RbmComponentProps<
|
|
19
20
|
WithActionProps<ActionData, DismissedData> | WithoutActionProps<DismissedData>,
|
|
20
|
-
|
|
21
|
+
WithStringProps
|
|
21
22
|
>;
|
|
22
23
|
|
|
23
|
-
function Toast<ActionData, DismissedData>({
|
|
24
|
+
export const Toast = withMemo(function Toast<ActionData, DismissedData>({
|
|
24
25
|
className,
|
|
25
26
|
timeToShow = 0,
|
|
26
27
|
children,
|
|
@@ -33,14 +34,14 @@ function Toast<ActionData, DismissedData>({
|
|
|
33
34
|
|
|
34
35
|
// States
|
|
35
36
|
const [hidingStart, setHidingStart] = useState<number>(0);
|
|
36
|
-
const [startShow] = useState(
|
|
37
|
+
const [startShow] = useState(Date.now());
|
|
37
38
|
const [isHidden, setIsHidden] = useState<boolean>(false);
|
|
38
39
|
|
|
39
40
|
// Refs
|
|
40
41
|
|
|
41
42
|
// Callbacks
|
|
42
43
|
const updateHidingStart = useCallback(() => {
|
|
43
|
-
setHidingStart((oldHidingStart) => (oldHidingStart > 0 ? oldHidingStart :
|
|
44
|
+
setHidingStart((oldHidingStart) => (oldHidingStart > 0 ? oldHidingStart : Date.now()));
|
|
44
45
|
setTimeout(() => setIsHidden(true), ANIMATION_DURATION);
|
|
45
46
|
}, [setHidingStart]);
|
|
46
47
|
|
|
@@ -49,7 +50,7 @@ function Toast<ActionData, DismissedData>({
|
|
|
49
50
|
// Effects
|
|
50
51
|
useEffect(() => {
|
|
51
52
|
if (timeToShow > 0) {
|
|
52
|
-
const diff = timeToShow + startShow -
|
|
53
|
+
const diff = timeToShow + startShow - Date.now();
|
|
53
54
|
const timeout = setTimeout(updateHidingStart, diff);
|
|
54
55
|
return () => {
|
|
55
56
|
if (timeout) {
|
|
@@ -62,7 +63,7 @@ function Toast<ActionData, DismissedData>({
|
|
|
62
63
|
|
|
63
64
|
useEffect(() => {
|
|
64
65
|
if (hidingStart > 0) {
|
|
65
|
-
const diff = hidingStart + ANIMATION_DURATION -
|
|
66
|
+
const diff = hidingStart + ANIMATION_DURATION - Date.now();
|
|
66
67
|
if (diff > 0) {
|
|
67
68
|
const timeout = setTimeout(() => onDismissed, diff);
|
|
68
69
|
return () => {
|
|
@@ -102,7 +103,4 @@ function Toast<ActionData, DismissedData>({
|
|
|
102
103
|
{actionElement}
|
|
103
104
|
</Clickable>
|
|
104
105
|
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const ToastMemo = withMemo(Toast, styles, 'text');
|
|
108
|
-
export { ToastMemo as Toast };
|
|
106
|
+
}, 'text');
|