@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
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
@use "../../scss/variables" as variables;
|
|
2
|
+
@use "../../scss/designMixin" as mixin;
|
|
3
|
+
@use "../../scss/vars" as *;
|
|
4
|
+
|
|
5
|
+
@include vars {
|
|
6
|
+
--card-margin: 8px;
|
|
7
|
+
--card-padding: 16px;
|
|
8
|
+
--card-background-color: var(--foreground-primary);
|
|
9
|
+
--card-box-shadow-color: var(--box-shadow-color);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.card {
|
|
13
|
+
margin: var(--card-margin);
|
|
14
|
+
padding: var(--card-padding);
|
|
15
|
+
word-wrap: break-word;
|
|
16
|
+
background-color: var(--card-background-color);
|
|
17
|
+
|
|
18
|
+
&.fullHeight {
|
|
19
|
+
height: calc(100% - 2 * var(--card-margin))
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&.noPaddingHeight {
|
|
23
|
+
padding-top: 0;
|
|
24
|
+
padding-bottom: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&.noPaddingWidth {
|
|
28
|
+
padding-left: 0;
|
|
29
|
+
padding-right: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.noPadding {
|
|
33
|
+
padding: 0
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.noMargin {
|
|
37
|
+
margin: 0;
|
|
38
|
+
|
|
39
|
+
&.fullHeight {
|
|
40
|
+
height: 100%
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.content {
|
|
45
|
+
margin: 0;
|
|
46
|
+
line-height: 1.4;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.title {
|
|
50
|
+
padding: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@include mixin.design(variables.$material) {
|
|
54
|
+
border-radius: 2px;
|
|
55
|
+
box-shadow: 0 2px 2px 0 var(--card-box-shadow-color),
|
|
56
|
+
0 1px 5px 0 var(--card-box-shadow-color),
|
|
57
|
+
0 3px 1px -2px var(--card-box-shadow-color);
|
|
58
|
+
|
|
59
|
+
.title {
|
|
60
|
+
margin: 8px 0 12px;
|
|
61
|
+
font-size: 24px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@include mixin.design(variables.$flat) {
|
|
66
|
+
border-radius: 8px;
|
|
67
|
+
box-shadow: 0 1px 2px 0 var(--card-box-shadow-color);
|
|
68
|
+
|
|
69
|
+
.title {
|
|
70
|
+
margin: 4px 0 8px;
|
|
71
|
+
font-size: 20px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { useCallback, useEffect, useRef } from 'react';
|
|
3
|
+
import { useComposedRef } from '@/Components/Hooks/useComposedRef';
|
|
4
|
+
import { useListener } from '@/Components/Hooks/useListener';
|
|
5
|
+
import { withMemo } from '@/helper/withMemo';
|
|
5
6
|
import classNames from 'classnames';
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
useEffect,
|
|
11
|
-
MouseEvent,
|
|
12
|
-
PointerEvent,
|
|
13
|
-
useRef
|
|
14
|
-
} from 'react';
|
|
15
|
-
import {useComposedRef} from "../Hooks/useComposedRef";
|
|
16
|
-
import { withMemo } from "../../helper/withMemo";
|
|
7
|
+
import styles from '@/Components/Clickable/clickable.module.scss';
|
|
8
|
+
import type { ForwardedRef, MouseEvent, PointerEvent, MouseEvent as ReactMouseEvent } from 'react';
|
|
9
|
+
import type { OptionalListener } from '@/Components/Hooks/useListener';
|
|
10
|
+
import type { RbmComponentProps } from '@/Components/RbmComponentProps';
|
|
17
11
|
|
|
18
12
|
type OnClickListener<Data> = OptionalListener<'onClick', Data>;
|
|
19
13
|
type OnPointerDownListener<Data> = OptionalListener<'onPointerDown', Data, PointerEvent>;
|
|
@@ -35,31 +29,31 @@ export type ClickableProps<
|
|
|
35
29
|
OnMouseEnterData,
|
|
36
30
|
OnMouseLeaveData,
|
|
37
31
|
OnDoubleClickData,
|
|
38
|
-
HrefType extends string | undefined
|
|
32
|
+
HrefType extends string | undefined,
|
|
39
33
|
> = RbmComponentProps<
|
|
40
34
|
{
|
|
41
35
|
interactable?: boolean;
|
|
42
36
|
href?: HrefType;
|
|
43
|
-
target?: string
|
|
37
|
+
target?: string;
|
|
44
38
|
preventDefault?: boolean;
|
|
45
39
|
stopPropagation?: boolean;
|
|
46
40
|
useReactOnMouseLeave?: boolean;
|
|
47
41
|
id?: string;
|
|
48
42
|
tabIndex?: number;
|
|
49
|
-
draggable?: boolean
|
|
43
|
+
draggable?: boolean;
|
|
50
44
|
title?: string;
|
|
51
|
-
ref?: ForwardedRef<HrefType extends string ? HTMLAnchorElement : HTMLSpanElement
|
|
45
|
+
ref?: ForwardedRef<HrefType extends string ? HTMLAnchorElement : HTMLSpanElement>;
|
|
52
46
|
} & OnClickListener<OnClickData> &
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
47
|
+
OnPointerDownListener<OnMouseDownData> &
|
|
48
|
+
OnPointerMoveListener<OnMouseMoveData> &
|
|
49
|
+
OnPointerUpListener<OnMouseUpData> &
|
|
50
|
+
OnDropListener<OnDropData> &
|
|
51
|
+
OnDragStartListener<OnDragStartData> &
|
|
52
|
+
OnDragOverListener<OnDragOverData> &
|
|
53
|
+
OptionalListener<'onClickCapture', OnClickCaptureData> &
|
|
54
|
+
OptionalListener<'onMouseEnter', OnMouseEnterData> &
|
|
55
|
+
OptionalListener<'onMouseLeave', OnMouseLeaveData, MouseEvent | ReactMouseEvent> &
|
|
56
|
+
OptionalListener<'onDoubleClick', OnDoubleClickData>
|
|
63
57
|
>;
|
|
64
58
|
|
|
65
59
|
export const Clickable = withMemo(function Clickable<
|
|
@@ -74,26 +68,37 @@ export const Clickable = withMemo(function Clickable<
|
|
|
74
68
|
OnMouseEnterData,
|
|
75
69
|
OnMouseLeaveData,
|
|
76
70
|
OnDoubleClickData,
|
|
77
|
-
HrefType extends string | undefined
|
|
78
|
-
>(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
71
|
+
HrefType extends string | undefined,
|
|
72
|
+
>({
|
|
73
|
+
className,
|
|
74
|
+
children,
|
|
75
|
+
style,
|
|
76
|
+
href,
|
|
77
|
+
target,
|
|
78
|
+
id,
|
|
79
|
+
interactable = true,
|
|
80
|
+
preventDefault = false,
|
|
81
|
+
stopPropagation = true,
|
|
82
|
+
useReactOnMouseLeave = false,
|
|
83
|
+
tabIndex,
|
|
84
|
+
draggable,
|
|
85
|
+
title,
|
|
86
|
+
ref,
|
|
87
|
+
...clickData
|
|
88
|
+
}: ClickableProps<
|
|
89
|
+
OnClickData,
|
|
90
|
+
OnPointerDownData,
|
|
91
|
+
OnPointerMoveData,
|
|
92
|
+
OnPointerUpData,
|
|
93
|
+
OnClickCaptureData,
|
|
94
|
+
OnDropData,
|
|
95
|
+
OnDragStartData,
|
|
96
|
+
OnDragOverData,
|
|
97
|
+
OnMouseEnterData,
|
|
98
|
+
OnMouseLeaveData,
|
|
99
|
+
OnDoubleClickData,
|
|
100
|
+
HrefType
|
|
101
|
+
>) {
|
|
97
102
|
// Variables
|
|
98
103
|
|
|
99
104
|
// States
|
|
@@ -116,7 +121,7 @@ export const Clickable = withMemo(function Clickable<
|
|
|
116
121
|
onClickInner(e);
|
|
117
122
|
}
|
|
118
123
|
},
|
|
119
|
-
[clickData.onClick, onClickInner, preventDefault, stopPropagation]
|
|
124
|
+
[clickData.onClick, onClickInner, preventDefault, stopPropagation],
|
|
120
125
|
);
|
|
121
126
|
|
|
122
127
|
const onPointerDownInner = useListener<'onPointerDown', OnPointerDownData>('onPointerDown', clickData);
|
|
@@ -132,7 +137,7 @@ export const Clickable = withMemo(function Clickable<
|
|
|
132
137
|
onPointerDownInner(e);
|
|
133
138
|
}
|
|
134
139
|
},
|
|
135
|
-
[clickData.onPointerDown, onPointerDownInner, preventDefault, stopPropagation]
|
|
140
|
+
[clickData.onPointerDown, onPointerDownInner, preventDefault, stopPropagation],
|
|
136
141
|
);
|
|
137
142
|
|
|
138
143
|
const onPointerMoveInner = useListener<'onPointerMove', OnPointerMoveData>('onPointerMove', clickData);
|
|
@@ -148,7 +153,7 @@ export const Clickable = withMemo(function Clickable<
|
|
|
148
153
|
onPointerMoveInner(e);
|
|
149
154
|
}
|
|
150
155
|
},
|
|
151
|
-
[clickData.onPointerMove, onPointerMoveInner, preventDefault, stopPropagation]
|
|
156
|
+
[clickData.onPointerMove, onPointerMoveInner, preventDefault, stopPropagation],
|
|
152
157
|
);
|
|
153
158
|
|
|
154
159
|
const onPointerUpInner = useListener<'onPointerUp', OnPointerUpData>('onPointerUp', clickData);
|
|
@@ -164,7 +169,7 @@ export const Clickable = withMemo(function Clickable<
|
|
|
164
169
|
onPointerUpInner(e);
|
|
165
170
|
}
|
|
166
171
|
},
|
|
167
|
-
[clickData.onPointerUp, onPointerUpInner, preventDefault, stopPropagation]
|
|
172
|
+
[clickData.onPointerUp, onPointerUpInner, preventDefault, stopPropagation],
|
|
168
173
|
);
|
|
169
174
|
|
|
170
175
|
const onClickCaptureInner = useListener<'onClickCapture', OnClickCaptureData>('onClickCapture', clickData);
|
|
@@ -180,7 +185,7 @@ export const Clickable = withMemo(function Clickable<
|
|
|
180
185
|
onClickCaptureInner(e);
|
|
181
186
|
}
|
|
182
187
|
},
|
|
183
|
-
[clickData.onClickCapture, onClickCaptureInner, preventDefault, stopPropagation]
|
|
188
|
+
[clickData.onClickCapture, onClickCaptureInner, preventDefault, stopPropagation],
|
|
184
189
|
);
|
|
185
190
|
|
|
186
191
|
const onDropInner = useListener<'onDrop', OnDropData>('onDrop', clickData);
|
|
@@ -196,7 +201,7 @@ export const Clickable = withMemo(function Clickable<
|
|
|
196
201
|
onDropInner(e);
|
|
197
202
|
}
|
|
198
203
|
},
|
|
199
|
-
[clickData.onDrop, onDropInner, preventDefault, stopPropagation]
|
|
204
|
+
[clickData.onDrop, onDropInner, preventDefault, stopPropagation],
|
|
200
205
|
);
|
|
201
206
|
|
|
202
207
|
const onDragOver = useListener<'onDragOver', OnDragOverData>('onDragOver', clickData);
|
|
@@ -212,7 +217,7 @@ export const Clickable = withMemo(function Clickable<
|
|
|
212
217
|
onDragOver(e);
|
|
213
218
|
}
|
|
214
219
|
},
|
|
215
|
-
[clickData.onDragOver, onDragOver, preventDefault, stopPropagation]
|
|
220
|
+
[clickData.onDragOver, onDragOver, preventDefault, stopPropagation],
|
|
216
221
|
);
|
|
217
222
|
|
|
218
223
|
const onDragStartListener = useListener<'onDragStart', OnDragStartData>('onDragStart', clickData);
|
|
@@ -228,7 +233,7 @@ export const Clickable = withMemo(function Clickable<
|
|
|
228
233
|
onDragStartListener(e);
|
|
229
234
|
}
|
|
230
235
|
},
|
|
231
|
-
[clickData.onDragStart, onDragStartListener, preventDefault, stopPropagation]
|
|
236
|
+
[clickData.onDragStart, onDragStartListener, preventDefault, stopPropagation],
|
|
232
237
|
);
|
|
233
238
|
|
|
234
239
|
const onMouseEnter = useListener<'onMouseEnter', OnMouseEnterData>('onMouseEnter', clickData);
|
|
@@ -244,12 +249,12 @@ export const Clickable = withMemo(function Clickable<
|
|
|
244
249
|
onMouseEnter(e);
|
|
245
250
|
}
|
|
246
251
|
},
|
|
247
|
-
[clickData.onMouseEnter, onMouseEnter, preventDefault, stopPropagation]
|
|
252
|
+
[clickData.onMouseEnter, onMouseEnter, preventDefault, stopPropagation],
|
|
248
253
|
);
|
|
249
254
|
|
|
250
255
|
const onMouseLeave = useListener<'onMouseLeave', OnMouseLeaveData>('onMouseLeave', clickData);
|
|
251
256
|
const realOnMouseLeave = useCallback(
|
|
252
|
-
(e: Event|ReactMouseEvent) => {
|
|
257
|
+
(e: Event | ReactMouseEvent) => {
|
|
253
258
|
if (clickData.onMouseLeave) {
|
|
254
259
|
if (stopPropagation) {
|
|
255
260
|
e.stopPropagation();
|
|
@@ -260,12 +265,12 @@ export const Clickable = withMemo(function Clickable<
|
|
|
260
265
|
onMouseLeave(e);
|
|
261
266
|
}
|
|
262
267
|
},
|
|
263
|
-
[clickData.onMouseLeave, onMouseLeave, preventDefault, stopPropagation]
|
|
268
|
+
[clickData.onMouseLeave, onMouseLeave, preventDefault, stopPropagation],
|
|
264
269
|
);
|
|
265
270
|
|
|
266
271
|
const onDoubleClick = useListener<'onDoubleClick', OnDoubleClickData>('onDoubleClick', clickData);
|
|
267
272
|
const realOnDoubleClick = useCallback(
|
|
268
|
-
(e: Event|ReactMouseEvent) => {
|
|
273
|
+
(e: Event | ReactMouseEvent) => {
|
|
269
274
|
if (clickData.onDoubleClick) {
|
|
270
275
|
if (stopPropagation) {
|
|
271
276
|
e.stopPropagation();
|
|
@@ -276,7 +281,7 @@ export const Clickable = withMemo(function Clickable<
|
|
|
276
281
|
onDoubleClick(e);
|
|
277
282
|
}
|
|
278
283
|
},
|
|
279
|
-
[clickData.onDoubleClick, onDoubleClick, preventDefault, stopPropagation]
|
|
284
|
+
[clickData.onDoubleClick, onDoubleClick, preventDefault, stopPropagation],
|
|
280
285
|
);
|
|
281
286
|
|
|
282
287
|
// Effects
|
|
@@ -318,7 +323,12 @@ export const Clickable = withMemo(function Clickable<
|
|
|
318
323
|
};
|
|
319
324
|
if (typeof href === 'string') {
|
|
320
325
|
return (
|
|
321
|
-
<a
|
|
326
|
+
<a
|
|
327
|
+
{...props}
|
|
328
|
+
className={classNames(styles.link, props.className)}
|
|
329
|
+
href={href}
|
|
330
|
+
ref={refSetter as ForwardedRef<HTMLAnchorElement>}
|
|
331
|
+
>
|
|
322
332
|
{children}
|
|
323
333
|
</a>
|
|
324
334
|
);
|
|
@@ -328,4 +338,4 @@ export const Clickable = withMemo(function Clickable<
|
|
|
328
338
|
{children}
|
|
329
339
|
</span>
|
|
330
340
|
);
|
|
331
|
-
}
|
|
341
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { Block } from '@/Components/Layout/Block';
|
|
4
|
+
import { Grid } from '@/Components/Layout/Grid/Grid';
|
|
5
|
+
import { GridItem } from '@/Components/Layout/Grid/GridItem';
|
|
6
|
+
import { ObjectHelper } from '@ainias42/js-helper';
|
|
7
|
+
import { Text } from '@/Components/Text/Text';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
const meta = {} satisfies Meta<typeof Text>;
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj;
|
|
15
|
+
|
|
16
|
+
export const Default: Story = {
|
|
17
|
+
args: {},
|
|
18
|
+
render: () => {
|
|
19
|
+
const baseColors = {
|
|
20
|
+
Flavor: ['flavor-basic', 'flavor-accent', 'flavor-constructive', 'flavor-destructive'],
|
|
21
|
+
FlavorPale: [
|
|
22
|
+
'flavor-pale-basic',
|
|
23
|
+
'flavor-pale-accent',
|
|
24
|
+
'flavor-pale-constructive',
|
|
25
|
+
'flavor-pale-destructive',
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const textColors = {
|
|
30
|
+
Text: ['text-primary', 'text-secondary', 'text-tertiary', 'text-link', 'text-inverse'],
|
|
31
|
+
...baseColors,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const backgroundColors = {
|
|
35
|
+
Foregrouns: ['foreground-primary', 'foreground-secondary', 'foreground-tertiary'],
|
|
36
|
+
BackgroundBase: ['background-primary', 'background-secondary'],
|
|
37
|
+
...baseColors,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<div>
|
|
42
|
+
{ObjectHelper.entries(textColors).map(([category, colors]) => (
|
|
43
|
+
<Block>
|
|
44
|
+
<Text emphasized={true}>Text - {category}</Text>
|
|
45
|
+
<Grid>
|
|
46
|
+
{colors.map((color) => (
|
|
47
|
+
<GridItem size={2}>
|
|
48
|
+
<Text style={{ color: `var(--${color})` }}>{color}</Text>
|
|
49
|
+
</GridItem>
|
|
50
|
+
))}
|
|
51
|
+
</Grid>
|
|
52
|
+
</Block>
|
|
53
|
+
))}
|
|
54
|
+
{ObjectHelper.entries(backgroundColors).map(([category, colors]) => (
|
|
55
|
+
<Block>
|
|
56
|
+
<Text emphasized={true}>Background - {category}</Text>
|
|
57
|
+
<Grid>
|
|
58
|
+
{colors.map((color) => (
|
|
59
|
+
<GridItem size={2}>
|
|
60
|
+
<Block
|
|
61
|
+
style={{
|
|
62
|
+
backgroundColor: `var(--${color})`,
|
|
63
|
+
padding: '0.5rem',
|
|
64
|
+
borderRadius: '0.25rem',
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
<Text>{color}</Text>
|
|
68
|
+
</Block>
|
|
69
|
+
</GridItem>
|
|
70
|
+
))}
|
|
71
|
+
</Grid>
|
|
72
|
+
</Block>
|
|
73
|
+
))}
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AlertDialog } from '@/Components/Dialog/AlertDialog';
|
|
2
|
+
import { Dialog } from '@/Components/Dialog/Dialog';
|
|
3
|
+
import { fn } from 'storybook/test';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
component: AlertDialog,
|
|
9
|
+
decorators: (Story) => {
|
|
10
|
+
return (
|
|
11
|
+
<Dialog closable={false}>
|
|
12
|
+
<Story />
|
|
13
|
+
</Dialog>
|
|
14
|
+
);
|
|
15
|
+
},
|
|
16
|
+
} satisfies Meta<typeof AlertDialog>;
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
export const Default: Story = {
|
|
23
|
+
args: {
|
|
24
|
+
title: 'Title',
|
|
25
|
+
message: 'My Hint',
|
|
26
|
+
close: fn(),
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ButtonDialog } from '@/Components/Dialog/ButtonDialog';
|
|
2
3
|
import { useMemo } from 'react';
|
|
3
|
-
import { withMemo } from '
|
|
4
|
-
import { ButtonDialog } from './ButtonDialog';
|
|
4
|
+
import { withMemo } from '@/helper/withMemo';
|
|
5
5
|
|
|
6
6
|
export type AlertDialogProps = {
|
|
7
7
|
title?: string;
|
|
@@ -10,7 +10,12 @@ export type AlertDialogProps = {
|
|
|
10
10
|
confirmText?: string;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
export const AlertDialog = withMemo(function AlertDialog({
|
|
14
|
+
title,
|
|
15
|
+
message,
|
|
16
|
+
close,
|
|
17
|
+
confirmText = 'OK',
|
|
18
|
+
}: AlertDialogProps) {
|
|
14
19
|
// Variables
|
|
15
20
|
const buttons = useMemo(
|
|
16
21
|
() => [
|
|
@@ -19,7 +24,7 @@ function AlertDialog({ title, message, close, confirmText = 'OK' }: AlertDialogP
|
|
|
19
24
|
callback: () => close(),
|
|
20
25
|
},
|
|
21
26
|
],
|
|
22
|
-
[close, confirmText]
|
|
27
|
+
[close, confirmText],
|
|
23
28
|
);
|
|
24
29
|
|
|
25
30
|
// Refs
|
|
@@ -37,8 +42,4 @@ function AlertDialog({ title, message, close, confirmText = 'OK' }: AlertDialogP
|
|
|
37
42
|
// Render Functions
|
|
38
43
|
|
|
39
44
|
return <ButtonDialog message={message} buttons={buttons} title={title} />;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// Need AlertDialogMemo for autocompletion of phpstorm
|
|
43
|
-
const AlertDialogMemo = withMemo(AlertDialog);
|
|
44
|
-
export { AlertDialogMemo as AlertDialog };
|
|
45
|
+
});
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import styles from './buttonDialog.scss';
|
|
8
|
-
import { RbmComponentProps, WithNoChildren } from '../RbmComponentProps';
|
|
2
|
+
import { Block } from '@/Components/Layout/Block';
|
|
3
|
+
import { Clickable } from '@/Components/Clickable/Clickable';
|
|
4
|
+
import { Flavor } from '@/Components/Flavor';
|
|
5
|
+
import { TEXT_SIZE, Text } from '@/Components/Text/Text';
|
|
6
|
+
import { withMemo } from '@/helper/withMemo';
|
|
9
7
|
import classNames from 'classnames';
|
|
10
|
-
import
|
|
8
|
+
import styles from '@/Components/Dialog/buttonDialog.module.scss';
|
|
9
|
+
import type { RbmComponentProps, WithNoChildren } from '@/Components/RbmComponentProps';
|
|
10
|
+
import type { ReactElement } from 'react';
|
|
11
11
|
|
|
12
12
|
export type ButtonDialogProps = RbmComponentProps<
|
|
13
13
|
{
|
|
14
14
|
title?: string;
|
|
15
15
|
message: string;
|
|
16
|
-
buttons: { text: string; callback: () => void
|
|
17
|
-
extraContent?: ReactElement|null
|
|
16
|
+
buttons: { text: string; callback: () => void; flavor?: Flavor }[];
|
|
17
|
+
extraContent?: ReactElement | null;
|
|
18
18
|
},
|
|
19
19
|
WithNoChildren
|
|
20
20
|
>;
|
|
@@ -37,10 +37,12 @@ function ButtonDialog({ title, message, buttons, style, className, extraContent
|
|
|
37
37
|
// Render Functions
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
|
-
<Block className={classNames(styles.buttonDialog, className)} style={style}
|
|
40
|
+
<Block className={classNames(styles.buttonDialog, className)} style={style}>
|
|
41
41
|
{!!title && (
|
|
42
42
|
<Block>
|
|
43
|
-
<Text size={TEXT_SIZE.large} className={styles.title}>
|
|
43
|
+
<Text size={TEXT_SIZE.large} className={styles.title}>
|
|
44
|
+
{title}
|
|
45
|
+
</Text>
|
|
44
46
|
</Block>
|
|
45
47
|
)}
|
|
46
48
|
<Block>
|
|
@@ -60,5 +62,5 @@ function ButtonDialog({ title, message, buttons, style, className, extraContent
|
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
// Need ButtonDialogMemo for autocompletion of phpstorm
|
|
63
|
-
const ButtonDialogMemo = withMemo(ButtonDialog
|
|
65
|
+
const ButtonDialogMemo = withMemo(ButtonDialog);
|
|
64
66
|
export { ButtonDialogMemo as ButtonDialog };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { ConfirmDialog } from '@/Components/Dialog/ConfirmDialog';
|
|
4
|
+
import { Dialog } from '@/Components/Dialog/Dialog';
|
|
5
|
+
import { fn } from 'storybook/test';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
component: ConfirmDialog,
|
|
10
|
+
decorators: (Story) => {
|
|
11
|
+
return (
|
|
12
|
+
<Dialog closable={false}>
|
|
13
|
+
<Story />
|
|
14
|
+
</Dialog>
|
|
15
|
+
);
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof ConfirmDialog>;
|
|
18
|
+
|
|
19
|
+
export default meta;
|
|
20
|
+
|
|
21
|
+
type Story = StoryObj<typeof meta>;
|
|
22
|
+
|
|
23
|
+
export const Default: Story = {
|
|
24
|
+
args: {
|
|
25
|
+
title: 'Title',
|
|
26
|
+
message: 'My Question?',
|
|
27
|
+
close: fn(),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ButtonDialog } from '@/Components/Dialog/ButtonDialog';
|
|
2
3
|
import { useMemo } from 'react';
|
|
3
|
-
import { withMemo } from '
|
|
4
|
-
import { ButtonDialog } from './ButtonDialog';
|
|
4
|
+
import { withMemo } from '@/helper/withMemo';
|
|
5
5
|
|
|
6
6
|
export type ConfirmDialogProps = {
|
|
7
7
|
title?: string;
|
|
@@ -12,7 +12,13 @@ export type ConfirmDialogProps = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
// TODO Translation
|
|
15
|
-
|
|
15
|
+
export const ConfirmDialog = withMemo(function ConfirmDialog({
|
|
16
|
+
title,
|
|
17
|
+
message,
|
|
18
|
+
close,
|
|
19
|
+
cancelText = 'Cancel',
|
|
20
|
+
confirmText = 'OK',
|
|
21
|
+
}: ConfirmDialogProps) {
|
|
16
22
|
// Variables
|
|
17
23
|
const buttons = useMemo(
|
|
18
24
|
() => [
|
|
@@ -22,7 +28,7 @@ function ConfirmDialog({ title, message, close, cancelText = 'Cancel', confirmTe
|
|
|
22
28
|
},
|
|
23
29
|
{ text: cancelText, callback: () => close(false) },
|
|
24
30
|
],
|
|
25
|
-
[cancelText, close, confirmText]
|
|
31
|
+
[cancelText, close, confirmText],
|
|
26
32
|
);
|
|
27
33
|
|
|
28
34
|
// Refs
|
|
@@ -40,8 +46,4 @@ function ConfirmDialog({ title, message, close, cancelText = 'Cancel', confirmTe
|
|
|
40
46
|
// Render Functions
|
|
41
47
|
|
|
42
48
|
return <ButtonDialog message={message} buttons={buttons} title={title} />;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Need ConfirmDialogMemo for autocompletion of phpstorm
|
|
46
|
-
const ConfirmDialogMemo = withMemo(ConfirmDialog);
|
|
47
|
-
export { ConfirmDialogMemo as ConfirmDialog };
|
|
49
|
+
});
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { Block } from '@/Components/Layout/Block';
|
|
3
|
+
import { Clickable } from '@/Components/Clickable/Clickable';
|
|
4
|
+
import { InlineBlock } from '@/Components/Layout/InlineBlock';
|
|
5
|
+
import { useCallback, useState } from 'react';
|
|
6
|
+
import { withMemo } from '@/helper/withMemo';
|
|
2
7
|
import classNames from 'classnames';
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { withMemo } from '../../helper/withMemo';
|
|
7
|
-
import { InlineBlock } from '../Layout/InlineBlock';
|
|
8
|
-
import { Block } from '../Layout/Block';
|
|
9
|
-
import { ReactElement, useCallback, useState } from 'react';
|
|
10
|
-
import { Clickable } from '../Clickable/Clickable';
|
|
8
|
+
import styles from '@/Components/Dialog/dialog.module.scss';
|
|
9
|
+
import type { RbmComponentProps } from '@/Components/RbmComponentProps';
|
|
10
|
+
import type { ReactElement } from 'react';
|
|
11
11
|
|
|
12
12
|
export type DialogProps<ReturnData> = RbmComponentProps<
|
|
13
13
|
{
|
|
@@ -43,7 +43,7 @@ function Dialog<ReturnData>({
|
|
|
43
43
|
setIsClosed(true);
|
|
44
44
|
onClose?.(data, identifier);
|
|
45
45
|
},
|
|
46
|
-
[identifier, onClose]
|
|
46
|
+
[identifier, onClose],
|
|
47
47
|
);
|
|
48
48
|
|
|
49
49
|
const onCurtainClick = useCallback(() => {
|
|
@@ -78,5 +78,5 @@ function Dialog<ReturnData>({
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
// Need Dialog Memo for autocompletion of phpstorm
|
|
81
|
-
const DialogMemo = withMemo(Dialog
|
|
81
|
+
const DialogMemo = withMemo(Dialog);
|
|
82
82
|
export { DialogMemo as Dialog };
|