@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
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
2
|
+
import { Block } from '@/Components/Layout/Block';
|
|
3
|
+
import { Clickable } from '@/Components/Clickable/Clickable';
|
|
4
|
+
import { Flex } from '@/Components/Layout/Flex';
|
|
5
|
+
import { Grow } from '@/Components/Layout/Grow';
|
|
6
|
+
import { Heading } from '@/Components/Text/Heading';
|
|
7
|
+
import { Icon } from '@/Components/Icon/Icon';
|
|
8
|
+
import { faCircleXmark } from '@fortawesome/free-solid-svg-icons';
|
|
9
|
+
import { withMemo } from '@/helper/withMemo';
|
|
6
10
|
import classNames from 'classnames';
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { Grow } from "../Layout/Grow";
|
|
10
|
-
import { Clickable } from "../Clickable/Clickable";
|
|
11
|
-
import { Icon } from "../Icon/Icon";
|
|
12
|
-
import { faCircleXmark } from "@fortawesome/free-solid-svg-icons";
|
|
11
|
+
import styles from '@/Components/Dialog/dialogBackground.module.scss';
|
|
12
|
+
import type { RbmComponentProps } from '@/Components/RbmComponentProps';
|
|
13
13
|
|
|
14
|
-
export type DialogBackgroundProps = RbmComponentProps<{ title?: string
|
|
14
|
+
export type DialogBackgroundProps = RbmComponentProps<{ title?: string; onClose?: () => void }>;
|
|
15
15
|
|
|
16
16
|
export const DialogBackground = withMemo(function DialogBackground({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
children,
|
|
18
|
+
className,
|
|
19
|
+
style,
|
|
20
|
+
title,
|
|
21
|
+
onClose,
|
|
22
|
+
}: DialogBackgroundProps) {
|
|
23
23
|
// Variables
|
|
24
24
|
|
|
25
25
|
// Refs
|
|
@@ -38,10 +38,21 @@ export const DialogBackground = withMemo(function DialogBackground({
|
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
40
|
<Block __allowChildren="all" className={classNames(styles.dialogBackground, className)} style={style}>
|
|
41
|
-
{(!!title || !!onClose) &&
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
{(!!title || !!onClose) && (
|
|
42
|
+
<Flex horizontal={true} className={styles.title}>
|
|
43
|
+
{!!title && (
|
|
44
|
+
<Grow>
|
|
45
|
+
<Heading>{title}</Heading>
|
|
46
|
+
</Grow>
|
|
47
|
+
)}
|
|
48
|
+
{!!onClose && (
|
|
49
|
+
<Clickable onClick={onClose}>
|
|
50
|
+
<Icon size="lg" icon={faCircleXmark} />
|
|
51
|
+
</Clickable>
|
|
52
|
+
)}
|
|
53
|
+
</Flex>
|
|
54
|
+
)}
|
|
44
55
|
{children}
|
|
45
56
|
</Block>
|
|
46
57
|
);
|
|
47
|
-
}
|
|
58
|
+
});
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Block } from '@/Components/Layout/Block';
|
|
3
|
+
import { Dialog } from '@/Components/Dialog/Dialog';
|
|
4
|
+
import { DialogProvider } from '@/Components/Dialog/DialogContext';
|
|
3
5
|
import { PromiseWithHandlers } from '@ainias42/js-helper';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { useCallback, useImperativeHandle, useState } from 'react';
|
|
7
|
+
import { withMemo } from '@/helper/withMemo';
|
|
8
|
+
import type { ComponentType, ForwardedRef, PropsWithChildren } from 'react';
|
|
9
|
+
import type { ShowDialog } from '@/Components/Dialog/DialogContext';
|
|
8
10
|
|
|
9
11
|
export type DialogContainerProps = PropsWithChildren<{
|
|
10
|
-
dialogClassName?: string
|
|
11
|
-
ref?: ForwardedRef<DialogContainerRef
|
|
12
|
+
dialogClassName?: string;
|
|
13
|
+
ref?: ForwardedRef<DialogContainerRef>;
|
|
12
14
|
}>;
|
|
13
15
|
|
|
14
16
|
type DialogData = {
|
|
@@ -20,13 +22,13 @@ type DialogData = {
|
|
|
20
22
|
|
|
21
23
|
export type DialogContainerRef = {
|
|
22
24
|
showDialog: ShowDialog;
|
|
23
|
-
}
|
|
25
|
+
};
|
|
24
26
|
|
|
25
27
|
export const DialogContainer = withMemo(function DialogContainer({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
children,
|
|
29
|
+
dialogClassName,
|
|
30
|
+
ref,
|
|
31
|
+
}: DialogContainerProps) {
|
|
30
32
|
// Variables
|
|
31
33
|
const [dialogs, setDialogs] = useState<DialogData[]>([]);
|
|
32
34
|
const [, setLastId] = useState(0);
|
|
@@ -43,7 +45,7 @@ export const DialogContainer = withMemo(function DialogContainer({
|
|
|
43
45
|
setLastId((oldId) => {
|
|
44
46
|
const id = oldId + 1;
|
|
45
47
|
setDialogs((oldDialogs) => {
|
|
46
|
-
return [...oldDialogs, {id, component, props, resultPromise: promise}] as DialogData[];
|
|
48
|
+
return [...oldDialogs, { id, component, props, resultPromise: promise }] as DialogData[];
|
|
47
49
|
});
|
|
48
50
|
return id;
|
|
49
51
|
});
|
|
@@ -58,15 +60,18 @@ export const DialogContainer = withMemo(function DialogContainer({
|
|
|
58
60
|
return false;
|
|
59
61
|
}
|
|
60
62
|
return true;
|
|
61
|
-
})
|
|
63
|
+
}),
|
|
62
64
|
);
|
|
63
65
|
}, []);
|
|
64
66
|
|
|
65
67
|
// Effects
|
|
66
|
-
useImperativeHandle(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
useImperativeHandle(
|
|
69
|
+
ref,
|
|
70
|
+
() => ({
|
|
71
|
+
showDialog,
|
|
72
|
+
}),
|
|
73
|
+
[showDialog],
|
|
74
|
+
);
|
|
70
75
|
|
|
71
76
|
// Other
|
|
72
77
|
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import {
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import type { ComponentType } from 'react';
|
|
3
|
+
import type { EmptyProps } from '@/helper/EmptyProps';
|
|
3
4
|
|
|
4
5
|
export type ShowDialog = <
|
|
5
6
|
P = EmptyProps,
|
|
6
7
|
R = any,
|
|
7
8
|
C extends ComponentType<(P & { close: (result?: R) => void }) | P> = ComponentType<
|
|
8
9
|
(P & { close: (result?: R) => void }) | P
|
|
9
|
-
|
|
10
|
+
>,
|
|
10
11
|
>(
|
|
11
12
|
dialog: C,
|
|
12
|
-
props?: Omit<P, 'close'
|
|
13
|
+
props?: Omit<P, 'close'>,
|
|
13
14
|
) => Promise<R | void>;
|
|
14
15
|
|
|
15
16
|
const DialogContext = React.createContext<ShowDialog>(() => {
|
|
16
|
-
console.error(
|
|
17
|
-
return Promise.reject(new Error(
|
|
17
|
+
console.error('DialogContext not initialized');
|
|
18
|
+
return Promise.reject(new Error('DialogContext not initialized'));
|
|
18
19
|
});
|
|
19
20
|
export const DialogProvider = DialogContext.Provider;
|
|
20
21
|
|
|
@@ -1,20 +1,33 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@
|
|
1
|
+
@use "../../scss/variables" as variables;
|
|
2
|
+
@use "../../scss/designMixin" as mixin;
|
|
3
|
+
@use "../../scss/flavorMixin" as *;
|
|
4
|
+
@use "../../scss/vars" as *;
|
|
5
|
+
|
|
6
|
+
@include vars {
|
|
7
|
+
--button-dialog-text-color: var(--text-primary);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@include mixin.design(variables.$material) {
|
|
11
|
+
--button-dialog-background-color: var(--foreground-primary);
|
|
12
|
+
--button-dialog-box-shadow-color: var(--box-shadow-color);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@include mixin.design(variables.$flat) {
|
|
16
|
+
--button-dialog-background-color: var(--foreground-secondary);
|
|
17
|
+
--button-dialog-button-border-color: var(--border-light);
|
|
18
|
+
}
|
|
4
19
|
|
|
5
20
|
.buttonDialog {
|
|
6
21
|
font-weight: 400;
|
|
7
22
|
max-width: 95%;
|
|
8
23
|
overflow: hidden;
|
|
9
24
|
min-width: 270px;
|
|
25
|
+
background-color: var(--button-dialog-background-color);
|
|
10
26
|
|
|
11
27
|
.title {
|
|
12
28
|
font-weight: 500;
|
|
13
29
|
}
|
|
14
30
|
|
|
15
|
-
.message {
|
|
16
|
-
}
|
|
17
|
-
|
|
18
31
|
.buttonContainer {
|
|
19
32
|
width: 100%;
|
|
20
33
|
|
|
@@ -23,18 +36,14 @@
|
|
|
23
36
|
|
|
24
37
|
.buttonText {
|
|
25
38
|
@include flavorSelection(--text-primary-default-color);
|
|
26
|
-
|
|
27
39
|
}
|
|
28
|
-
|
|
29
40
|
}
|
|
30
41
|
}
|
|
31
42
|
|
|
32
|
-
@include design(
|
|
43
|
+
@include mixin.design(variables.$flat) {
|
|
33
44
|
border-radius: 8px;
|
|
34
|
-
background-color: #f4f4f4;
|
|
35
45
|
padding-top: 16px;
|
|
36
|
-
|
|
37
|
-
font-family: -apple-system, 'Helvetica Neue', 'Helvetica', 'Arial', 'Lucida Grande', sans-serif;
|
|
46
|
+
font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
|
|
38
47
|
text-align: center;
|
|
39
48
|
|
|
40
49
|
.title {
|
|
@@ -46,6 +55,7 @@
|
|
|
46
55
|
font-size: 14px;
|
|
47
56
|
padding: 4px 12px 8px;
|
|
48
57
|
min-height: 36px;
|
|
58
|
+
color: var(--button-dialog-text-color)
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
.buttonContainer {
|
|
@@ -55,8 +65,8 @@
|
|
|
55
65
|
.button {
|
|
56
66
|
flex: 1;
|
|
57
67
|
display: block;
|
|
58
|
-
border-left: 1px solid var(--border-
|
|
59
|
-
border-top: 1px solid var(--border-
|
|
68
|
+
border-left: 1px solid var(--button-dialog-button-border-color);
|
|
69
|
+
border-top: 1px solid var(--button-dialog-button-border-color);
|
|
60
70
|
vertical-align: middle;
|
|
61
71
|
text-align: center;
|
|
62
72
|
height: 44px;
|
|
@@ -76,13 +86,11 @@
|
|
|
76
86
|
}
|
|
77
87
|
}
|
|
78
88
|
|
|
79
|
-
@include design(
|
|
89
|
+
@include mixin.design(variables.$material) {
|
|
80
90
|
border-radius: 2px;
|
|
81
|
-
background-color: #ffffff;
|
|
82
91
|
padding: 22px 0 0;
|
|
83
|
-
box-shadow: 0 16px 24px 2px
|
|
84
|
-
|
|
85
|
-
font-family: 'Roboto', 'Noto', sans-serif;
|
|
92
|
+
box-shadow: 0 16px 24px 2px var(--button-dialog-box-shadow-color), 0 6px 30px 5px var(--button-dialog-box-shadow-color), 0 8px 10px -5px var(--button-dialog-box-shadow-color);
|
|
93
|
+
font-family: Roboto, Noto, sans-serif;
|
|
86
94
|
text-align: left;
|
|
87
95
|
|
|
88
96
|
.title {
|
|
@@ -94,9 +102,9 @@
|
|
|
94
102
|
font-size: 16px;
|
|
95
103
|
line-height: 20px;
|
|
96
104
|
padding: 0 24px;
|
|
97
|
-
margin: 24px 0 10px
|
|
105
|
+
margin: 24px 0 10px;
|
|
98
106
|
min-height: 0;
|
|
99
|
-
color:
|
|
107
|
+
color: var(--button-dialog-text-color);
|
|
100
108
|
}
|
|
101
109
|
|
|
102
110
|
.buttonContainer {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@use "sass:map";
|
|
2
|
+
@use "../../scss/variables" as variables;
|
|
3
|
+
@use "../../scss/vars" as *;
|
|
4
|
+
|
|
5
|
+
@include vars {
|
|
6
|
+
--dialog-z-index: 1001;
|
|
7
|
+
--dialog-background-color: var(--curtain-light)
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.dialogContainer {
|
|
11
|
+
position: fixed;
|
|
12
|
+
inset: 0;
|
|
13
|
+
margin: auto;
|
|
14
|
+
z-index: var(--dialog-z-index);
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
background-color: var(--dialog-background-color);
|
|
20
|
+
|
|
21
|
+
.closeCurtain {
|
|
22
|
+
position: absolute;
|
|
23
|
+
inset: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.dialog {
|
|
27
|
+
max-width: map.get(variables.$grid-breakpoints, "xxl");
|
|
28
|
+
z-index: 1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@use "../../scss/vars" as *;
|
|
2
|
+
|
|
3
|
+
@include vars {
|
|
4
|
+
--dialog-background-background-color: var(--foreground-primary);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.dialogBackground {
|
|
8
|
+
background-color: var(--dialog-background-background-color);
|
|
9
|
+
padding: 0.5rem;
|
|
10
|
+
max-height: 80vh;
|
|
11
|
+
overflow: auto;
|
|
12
|
+
|
|
13
|
+
.title {
|
|
14
|
+
gap: 16px;
|
|
15
|
+
margin: 0 0 0.8rem;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { AlertDialog } from '@/Components/Dialog/AlertDialog';
|
|
1
2
|
import { useCallback } from 'react';
|
|
2
|
-
import { useDialog } from '
|
|
3
|
-
import { AlertDialog } from './AlertDialog';
|
|
3
|
+
import { useDialog } from '@/Components/Dialog/DialogContext';
|
|
4
4
|
|
|
5
5
|
export function useAlertDialog() {
|
|
6
6
|
const showDialog = useDialog();
|
|
@@ -8,6 +8,6 @@ export function useAlertDialog() {
|
|
|
8
8
|
(message: string, title?: string) => {
|
|
9
9
|
return showDialog(AlertDialog, { message, title });
|
|
10
10
|
},
|
|
11
|
-
[showDialog]
|
|
11
|
+
[showDialog],
|
|
12
12
|
);
|
|
13
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ConfirmDialog } from '@/Components/Dialog/ConfirmDialog';
|
|
1
2
|
import { useCallback } from 'react';
|
|
2
|
-
import { useDialog } from '
|
|
3
|
-
import { ConfirmDialog } from './ConfirmDialog';
|
|
3
|
+
import { useDialog } from '@/Components/Dialog/DialogContext';
|
|
4
4
|
|
|
5
5
|
export function useConfirmDialog() {
|
|
6
6
|
const showDialog = useDialog();
|
|
@@ -8,6 +8,6 @@ export function useConfirmDialog() {
|
|
|
8
8
|
(message: string, title?: string) => {
|
|
9
9
|
return showDialog(ConfirmDialog, { message, title });
|
|
10
10
|
},
|
|
11
|
-
[showDialog]
|
|
11
|
+
[showDialog],
|
|
12
12
|
);
|
|
13
13
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Draggable } from '@hello-pangea/dnd';
|
|
3
|
+
import { withMemo } from '@/helper/withMemo';
|
|
4
|
+
import type { DraggableProps } from '@hello-pangea/dnd';
|
|
5
|
+
import type { RbmComponentProps, WithNoStringAndChildrenProps } from '@/Components/RbmComponentProps';
|
|
5
6
|
|
|
6
7
|
export type DragItemProps = RbmComponentProps<Omit<DraggableProps, 'children'>, WithNoStringAndChildrenProps>;
|
|
7
8
|
|
|
8
|
-
function DragItem({children, className, ...dragProps}: DragItemProps) {
|
|
9
|
+
function DragItem({ children, className, ...dragProps }: DragItemProps) {
|
|
9
10
|
// Variables
|
|
10
11
|
|
|
11
12
|
// Refs
|
|
@@ -24,7 +25,7 @@ function DragItem({children, className, ...dragProps}: DragItemProps) {
|
|
|
24
25
|
|
|
25
26
|
return (
|
|
26
27
|
<Draggable {...dragProps}>
|
|
27
|
-
{({innerRef, dragHandleProps, draggableProps}) => (
|
|
28
|
+
{({ innerRef, dragHandleProps, draggableProps }) => (
|
|
28
29
|
<div className={className} {...draggableProps} {...dragHandleProps} ref={innerRef}>
|
|
29
30
|
{children}
|
|
30
31
|
</div>
|
|
@@ -35,4 +36,4 @@ function DragItem({children, className, ...dragProps}: DragItemProps) {
|
|
|
35
36
|
|
|
36
37
|
// Need DragItemMemo for autocompletion of phpstorm
|
|
37
38
|
const DragItemMemo = withMemo(DragItem);
|
|
38
|
-
export {DragItemMemo as DragItem};
|
|
39
|
+
export { DragItemMemo as DragItem };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { Droppable } from '@hello-pangea/dnd';
|
|
3
|
+
import { useStrictEnabled } from '@/Components/DragAndDrop/useStrictEnabled';
|
|
4
|
+
import { withMemo } from '@/helper/withMemo';
|
|
5
|
+
import type { DroppableProps } from '@hello-pangea/dnd';
|
|
6
|
+
import type { RbmComponentProps, WithNoStringAndChildrenProps } from '@/Components/RbmComponentProps';
|
|
6
7
|
|
|
7
8
|
export type DropAreaProps = RbmComponentProps<Omit<DroppableProps, 'children'>, WithNoStringAndChildrenProps>;
|
|
8
9
|
|
package/src/Components/Flavor.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export enum Flavor {
|
|
2
|
-
Accent =
|
|
3
|
-
Basic =
|
|
4
|
-
Destructive =
|
|
5
|
-
Constructive =
|
|
2
|
+
Accent = 'flavor-accent',
|
|
3
|
+
Basic = 'flavor-basic',
|
|
4
|
+
Destructive = 'flavor-destructive',
|
|
5
|
+
Constructive = 'flavor-constructive',
|
|
6
6
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Button } from '@/Components/FormElements/Button/Button';
|
|
2
|
+
import { ButtonType } from '@/Components/FormElements/Button/ButtonType';
|
|
3
|
+
import { Flavor } from '@/Components/Flavor';
|
|
4
|
+
import { Size } from '@/Size';
|
|
5
|
+
import { Text } from '@/Components/Text/Text';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { ButtonProps } from '@/Components/FormElements/Button/Button';
|
|
8
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
9
|
+
|
|
10
|
+
const meta = {
|
|
11
|
+
component: Button,
|
|
12
|
+
argTypes: {
|
|
13
|
+
flavor: {
|
|
14
|
+
control: { type: 'select' },
|
|
15
|
+
options: Object.values(Flavor),
|
|
16
|
+
},
|
|
17
|
+
type: {
|
|
18
|
+
control: { type: 'select' },
|
|
19
|
+
options: Object.values(ButtonType),
|
|
20
|
+
},
|
|
21
|
+
size: {
|
|
22
|
+
control: { type: 'select' },
|
|
23
|
+
options: [undefined, 'medium', 'small'],
|
|
24
|
+
mapping: {
|
|
25
|
+
medium: Size.medium,
|
|
26
|
+
small: Size.small,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
children: {
|
|
30
|
+
control: false,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
render: (args) => (
|
|
34
|
+
<Button {...args}>
|
|
35
|
+
<Text>Button</Text>
|
|
36
|
+
</Button>
|
|
37
|
+
),
|
|
38
|
+
} satisfies Meta<typeof Button>;
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
41
|
+
|
|
42
|
+
type Story = StoryObj<ButtonProps<any>>;
|
|
43
|
+
|
|
44
|
+
export const Default: Story = {
|
|
45
|
+
args: {
|
|
46
|
+
fullWidth: false,
|
|
47
|
+
flavor: Flavor.Basic,
|
|
48
|
+
type: ButtonType.Primary,
|
|
49
|
+
stopPropagation: false,
|
|
50
|
+
size: undefined,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const Accent: Story = {
|
|
55
|
+
args: {
|
|
56
|
+
fullWidth: false,
|
|
57
|
+
flavor: Flavor.Accent,
|
|
58
|
+
type: ButtonType.Primary,
|
|
59
|
+
stopPropagation: false,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const Destructive: Story = {
|
|
64
|
+
args: {
|
|
65
|
+
fullWidth: false,
|
|
66
|
+
flavor: Flavor.Destructive,
|
|
67
|
+
type: ButtonType.Primary,
|
|
68
|
+
stopPropagation: false,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const Constructive: Story = {
|
|
73
|
+
args: {
|
|
74
|
+
fullWidth: false,
|
|
75
|
+
flavor: Flavor.Constructive,
|
|
76
|
+
type: ButtonType.Primary,
|
|
77
|
+
stopPropagation: false,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
@@ -1,57 +1,70 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { ButtonType } from '@/Components/FormElements/Button/ButtonType';
|
|
3
|
+
import { Flavor } from '@/Components/Flavor';
|
|
4
|
+
import { Size } from '@/Size';
|
|
5
|
+
import { useCallback } from 'react';
|
|
6
|
+
import { useListenerWithExtractedProps } from '@/Components/Hooks/useListener';
|
|
7
|
+
import { withMemo } from '@/helper/withMemo';
|
|
5
8
|
import classNames from 'classnames';
|
|
6
|
-
import
|
|
7
|
-
import { HTMLAttributes, MouseEvent
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { Size } from "../../../Size";
|
|
9
|
+
import styles from '@/Components/FormElements/Button/button.module.scss';
|
|
10
|
+
import type { HTMLAttributes, MouseEvent } from 'react';
|
|
11
|
+
import type { OptionalListener } from '@/Components/Hooks/useListener';
|
|
12
|
+
import type { Override } from '@ainias42/js-helper';
|
|
13
|
+
import type { RbmComponentProps } from '@/Components/RbmComponentProps';
|
|
12
14
|
|
|
13
15
|
export type ButtonProps<ClickData> = RbmComponentProps<
|
|
14
|
-
Override<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
Override<
|
|
17
|
+
HTMLAttributes<HTMLButtonElement>,
|
|
18
|
+
{
|
|
19
|
+
type?: ButtonType;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
flavor?: Flavor;
|
|
22
|
+
fullWidth?: boolean;
|
|
23
|
+
stopPropagation?: boolean;
|
|
24
|
+
size?: Omit<Size, 'xxLarge' | 'xLarge' | 'large' | 'xSmall'>;
|
|
25
|
+
} & OptionalListener<'onClick', ClickData>
|
|
26
|
+
>
|
|
22
27
|
>;
|
|
23
28
|
|
|
24
29
|
export const Button = withMemo(function Button<ClickData>({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
children,
|
|
31
|
+
className,
|
|
32
|
+
disabled,
|
|
33
|
+
size,
|
|
34
|
+
fullWidth = false,
|
|
35
|
+
flavor = Flavor.Accent,
|
|
36
|
+
type = ButtonType.Primary,
|
|
32
37
|
stopPropagation = true,
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
...props
|
|
39
|
+
}: ButtonProps<ClickData>) {
|
|
35
40
|
const [onClick, otherProps] = useListenerWithExtractedProps<'onClick', ClickData>('onClick', props);
|
|
36
41
|
|
|
37
|
-
const realOnClick = useCallback(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
const realOnClick = useCallback(
|
|
43
|
+
(ev: MouseEvent) => {
|
|
44
|
+
if (stopPropagation) {
|
|
45
|
+
ev.stopPropagation();
|
|
46
|
+
}
|
|
47
|
+
onClick?.(ev);
|
|
48
|
+
},
|
|
49
|
+
[onClick, stopPropagation],
|
|
50
|
+
);
|
|
43
51
|
|
|
44
52
|
const classes = {
|
|
45
53
|
[styles.primary]: type === ButtonType.Primary,
|
|
46
54
|
[styles.secondary]: type === ButtonType.Secondary,
|
|
47
55
|
[styles.disabled]: disabled,
|
|
48
|
-
[styles.small]: size === Size.small
|
|
56
|
+
[styles.small]: size === Size.small,
|
|
49
57
|
};
|
|
50
58
|
|
|
51
59
|
return (
|
|
52
|
-
<button
|
|
53
|
-
|
|
60
|
+
<button
|
|
61
|
+
{...otherProps}
|
|
62
|
+
disabled={disabled}
|
|
63
|
+
type="button"
|
|
64
|
+
onClick={realOnClick}
|
|
65
|
+
className={classNames(styles.button, { [styles.fullWidth]: fullWidth }, classes, flavor, className)}
|
|
66
|
+
>
|
|
54
67
|
{children}
|
|
55
68
|
</button>
|
|
56
69
|
);
|
|
57
|
-
}
|
|
70
|
+
});
|