@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 @@
|
|
|
1
|
+
export declare function treeshakeTest(): void;
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import defaultConfig from '@ainias42/config/eslint.config.js';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
...defaultConfig,
|
|
6
|
+
{
|
|
7
|
+
rules: {
|
|
8
|
+
'import/no-extraneous-dependencies': [
|
|
9
|
+
'error',
|
|
10
|
+
{
|
|
11
|
+
devDependencies: ['src/**/*.stories.ts', 'src/**/*.stories.tsx', '.storybook/**/*.ts'],
|
|
12
|
+
packageDir: ['./', path.join(process.cwd(), '../..')],
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|
package/package.json
CHANGED
|
@@ -1,107 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ainias42/react-bootstrap-mobile",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Mobile React Components
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "Mobile React Components",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"main": "dist/index.js",
|
|
6
10
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
"build": "
|
|
9
|
-
"
|
|
10
|
-
"update packages": "node bin/updateCopies.js",
|
|
11
|
-
"typecheck": "tsc --noEmit",
|
|
12
|
-
"lint:noCache": "eslint \"src/{**/*,*}.{js,jsx,tsx,ts}\" --max-warnings 0",
|
|
11
|
+
"build-postinstall": "npm run build",
|
|
12
|
+
"build": "ctix build && webpack --env production",
|
|
13
|
+
"lint:noCache": "eslint \"{src,.storybook}/{**/*,*}.{js,jsx,tsx,ts}\" --max-warnings 0",
|
|
13
14
|
"lint": "npm run lint:noCache -- --cache",
|
|
14
|
-
"lint:fix": "npm run lint -- --fix"
|
|
15
|
+
"lint:fix": "npm run lint -- --fix",
|
|
16
|
+
"typecheck": "tsc --noEmit",
|
|
17
|
+
"prettier": "npm run prettier:list -- --write",
|
|
18
|
+
"prettier:list": "prettier --list-different \"{src,.storybook}/**/*.{ts,tsx,js,jsx,json}\"",
|
|
19
|
+
"stylelint": "stylelint --allow-empty-input \"{src,.storybook}/**/*.{css,scss}\"",
|
|
20
|
+
"stylelint:fix": "npm run stylelint -- --fix",
|
|
21
|
+
"storybook": "storybook dev -p 6006",
|
|
22
|
+
"build-storybook": "storybook build"
|
|
15
23
|
},
|
|
24
|
+
"author": "",
|
|
16
25
|
"repository": {
|
|
17
26
|
"type": "git",
|
|
18
|
-
"url": "git
|
|
19
|
-
},
|
|
20
|
-
"keywords": [
|
|
21
|
-
"bootstrap",
|
|
22
|
-
"react",
|
|
23
|
-
"mobile"
|
|
24
|
-
],
|
|
25
|
-
"author": "Silas Günther",
|
|
26
|
-
"license": "MIT",
|
|
27
|
-
"bugs": {
|
|
28
|
-
"url": "https://github.com/Ainias/Bootstrap-React-Mobile/issues"
|
|
27
|
+
"url": "gitea@git.silas.link:Ainias/libraries.git"
|
|
29
28
|
},
|
|
30
|
-
"publishConfig": {
|
|
31
|
-
"access": "public"
|
|
32
|
-
},
|
|
33
|
-
"homepage": "https://github.com/Ainias/Bootstrap-React-Mobile#readme",
|
|
34
29
|
"peerDependencies": {
|
|
35
|
-
"@fortawesome/fontawesome-svg-core": "^6.
|
|
36
|
-
"@fortawesome/free-regular-svg-icons": "^6.
|
|
37
|
-
"@fortawesome/free-solid-svg-icons": "^6.
|
|
38
|
-
"@fortawesome/react-fontawesome": "^0.2
|
|
39
|
-
"
|
|
40
|
-
"react": "^19.1.
|
|
41
|
-
"react-beautiful-dnd": "^13.1.1",
|
|
30
|
+
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
31
|
+
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
32
|
+
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
33
|
+
"@fortawesome/react-fontawesome": "^3.0.2",
|
|
34
|
+
"react": "^19.1.0",
|
|
35
|
+
"react-dom": "^19.1.0",
|
|
42
36
|
"react-hook-form": "^7.62.0"
|
|
43
37
|
},
|
|
44
|
-
"devDependencies": {
|
|
45
|
-
"@babel/core": "^7.28.3",
|
|
46
|
-
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
47
|
-
"@babel/plugin-transform-typescript": "^7.28.0",
|
|
48
|
-
"@babel/preset-env": "^7.28.3",
|
|
49
|
-
"@babel/preset-react": "^7.27.1",
|
|
50
|
-
"@babel/preset-typescript": "^7.27.1",
|
|
51
|
-
"@fortawesome/fontawesome-svg-core": "^6.5.2",
|
|
52
|
-
"@fortawesome/free-regular-svg-icons": "^6.5.2",
|
|
53
|
-
"@fortawesome/free-solid-svg-icons": "^6.5.2",
|
|
54
|
-
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
55
|
-
"@types/react": "^19.1.11",
|
|
56
|
-
"@types/react-beautiful-dnd": "^13.1.8",
|
|
57
|
-
"@types/react-dom": "^19.1.7",
|
|
58
|
-
"@types/react-table": "^7.7.20",
|
|
59
|
-
"@types/react-window": "^1.8.8",
|
|
60
|
-
"@types/react-window-infinite-loader": "^1.0.9",
|
|
61
|
-
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
62
|
-
"@typescript-eslint/parser": "^7.18.0",
|
|
63
|
-
"ajv": "^8.17.1",
|
|
64
|
-
"babel-loader": "^10.0.0",
|
|
65
|
-
"bootstrap": "^5.3.3",
|
|
66
|
-
"css-layering-webpack-plugin": "^0.4.0",
|
|
67
|
-
"css-loader": "^7.1.2",
|
|
68
|
-
"eslint": "^8.57.0",
|
|
69
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
70
|
-
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
71
|
-
"eslint-config-prettier": "^10.1.8",
|
|
72
|
-
"eslint-import-resolver-typescript": "^4.4.4",
|
|
73
|
-
"eslint-plugin-import": "^2.32.0",
|
|
74
|
-
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
75
|
-
"eslint-plugin-react": "^7.37.5",
|
|
76
|
-
"eslint-plugin-react-hooks": "^4.6.2",
|
|
77
|
-
"html-webpack-plugin": "^5.6.4",
|
|
78
|
-
"loader-utils": "^3.3.1",
|
|
79
|
-
"mini-css-extract-plugin": "^2.9.4",
|
|
80
|
-
"prettier": "^3.6.2",
|
|
81
|
-
"react": "^19.1.1",
|
|
82
|
-
"react-beautiful-dnd": "^13.1.1",
|
|
83
|
-
"react-dom": "^19.1.1",
|
|
84
|
-
"react-hook-form": "^7.62.0",
|
|
85
|
-
"sass": "^1.90.0",
|
|
86
|
-
"sass-loader": "^16.0.5",
|
|
87
|
-
"terser-webpack-plugin": "^5.3.14",
|
|
88
|
-
"ts-loader": "^9.5.4",
|
|
89
|
-
"typescript": "^5.9.2",
|
|
90
|
-
"webpack": "^5.101.3",
|
|
91
|
-
"webpack-cli": "^6.0.1",
|
|
92
|
-
"webpack-dev-server": "^5.2.2"
|
|
93
|
-
},
|
|
94
38
|
"dependencies": {
|
|
95
|
-
"@ainias42/
|
|
96
|
-
"@
|
|
97
|
-
"@
|
|
39
|
+
"@ainias42/config": "*",
|
|
40
|
+
"@ainias42/js-helper": ">=0.8.16",
|
|
41
|
+
"@hello-pangea/dnd": "^18.0.1",
|
|
42
|
+
"@uiw/react-color": "^2.5.5",
|
|
98
43
|
"classnames": "^2.5.1",
|
|
99
|
-
"isomorphic-style-loader": "^5.4.0",
|
|
100
|
-
"react-color": "^2.19.3",
|
|
101
44
|
"react-table": "^7.8.0",
|
|
102
|
-
"react-virtualized-auto-sizer": "^1.0.26",
|
|
103
|
-
"react-window": "^1.8.11",
|
|
104
|
-
"react-window-infinite-loader": "^1.0.10",
|
|
105
45
|
"yup": "^1.7.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@ainias42/webpack-config": "*",
|
|
49
|
+
"@storybook/addon-docs": "^9.1.5",
|
|
50
|
+
"@storybook/addon-onboarding": "^9.1.5",
|
|
51
|
+
"@storybook/react-vite": "^9.1.5",
|
|
52
|
+
"@storybook/addon-themes": "^9.1.5",
|
|
53
|
+
"eslint-plugin-storybook": "^9.1.5",
|
|
54
|
+
"storybook": "^9.1.5",
|
|
55
|
+
"vite": "^7.1.4",
|
|
56
|
+
"vite-tsconfig-paths": "^5.1.4"
|
|
106
57
|
}
|
|
107
58
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@
|
|
4
|
-
@
|
|
5
|
-
@
|
|
6
|
-
@
|
|
1
|
+
@use "src/scss/variables" as *;
|
|
2
|
+
@use "src/scss/designMixin" as *;
|
|
3
|
+
@use "src/scss/flavorMixin" as *;
|
|
4
|
+
@use "src/scss/breakpoints" as *;
|
|
5
|
+
@use "src/scss/default" as *;
|
|
6
|
+
@use "src/scss/colors" as *;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { ActionSheet } from '@/Components/ActionSheet/ActionSheet';
|
|
4
|
+
import { faCog, faHouse, faTrash, faUser } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import { fn } from 'storybook/test';
|
|
6
|
+
import React, { useEffect, useRef } from 'react';
|
|
7
|
+
import type { ActionSheetHandle } from '@/Components/ActionSheet/ActionSheet';
|
|
8
|
+
|
|
9
|
+
const meta = {
|
|
10
|
+
component: ActionSheet,
|
|
11
|
+
render: (args) => {
|
|
12
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
13
|
+
const ref = useRef<ActionSheetHandle | null>(null);
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
ref.current?.show();
|
|
18
|
+
}, []);
|
|
19
|
+
|
|
20
|
+
return <ActionSheet {...args} ref={ref} />;
|
|
21
|
+
},
|
|
22
|
+
} satisfies Meta<typeof ActionSheet>;
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
|
|
26
|
+
type Story = StoryObj<typeof meta>;
|
|
27
|
+
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
args: {
|
|
30
|
+
title: 'Action Sheet Title',
|
|
31
|
+
actions: [
|
|
32
|
+
{
|
|
33
|
+
name: 'Action 1',
|
|
34
|
+
icon: faCog,
|
|
35
|
+
action: fn(),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'Action 2',
|
|
39
|
+
icon: faHouse,
|
|
40
|
+
action: fn(),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Action 3',
|
|
44
|
+
icon: faUser,
|
|
45
|
+
action: fn(),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Delete Action',
|
|
49
|
+
icon: faTrash,
|
|
50
|
+
action: fn(),
|
|
51
|
+
isDestructive: true,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -1,24 +1,27 @@
|
|
|
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 { Container } from '@/Components/Layout/Container';
|
|
5
|
+
import { Flex } from '@/Components/Layout/Flex';
|
|
6
|
+
import { Icon } from '@/Components/Icon/Icon';
|
|
7
|
+
import { InlineBlock } from '@/Components/Layout/InlineBlock';
|
|
8
|
+
import { Text } from '@/Components/Text/Text';
|
|
6
9
|
import { faTimes } from '@fortawesome/free-solid-svg-icons';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
10
|
+
import { useCallback, useImperativeHandle, useState } from 'react';
|
|
11
|
+
import { withMemo } from '@/helper/withMemo';
|
|
12
|
+
import baseStyles from '@/scss/baseClasses.module.scss';
|
|
9
13
|
import classNames from 'classnames';
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { withMemo } from "../../helper/withMemo";
|
|
14
|
+
import styles from '@/Components/ActionSheet/actionSheet.module.scss';
|
|
15
|
+
import type { ForwardedRef } from 'react';
|
|
16
|
+
import type { IconSource } from '@/Components/Icon/Icon';
|
|
17
|
+
import type { RbmComponentProps } from '@/Components/RbmComponentProps';
|
|
15
18
|
|
|
16
19
|
export type ActionSheetAction<ActionData> = {
|
|
17
20
|
name: string;
|
|
18
21
|
icon?: IconSource;
|
|
19
22
|
action: (data?: ActionData) => void;
|
|
20
23
|
actionData?: ActionData;
|
|
21
|
-
|
|
24
|
+
isDestructive?: boolean;
|
|
22
25
|
};
|
|
23
26
|
|
|
24
27
|
export type ActionSheetHandle = {
|
|
@@ -26,18 +29,23 @@ export type ActionSheetHandle = {
|
|
|
26
29
|
hide: () => void;
|
|
27
30
|
};
|
|
28
31
|
|
|
29
|
-
|
|
30
32
|
export type ActionSheetProps = RbmComponentProps<{
|
|
31
33
|
title?: string;
|
|
32
34
|
actions: ActionSheetAction<any>[];
|
|
33
35
|
cancelText?: string;
|
|
34
36
|
onClose?: () => void;
|
|
35
|
-
ref?: ForwardedRef<ActionSheetHandle
|
|
37
|
+
ref?: ForwardedRef<ActionSheetHandle>;
|
|
36
38
|
}>;
|
|
37
39
|
|
|
38
|
-
export const ActionSheet = withMemo(function ActionSheet(
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
export const ActionSheet = withMemo(function ActionSheet({
|
|
41
|
+
title,
|
|
42
|
+
actions,
|
|
43
|
+
cancelText = 'Cancel',
|
|
44
|
+
className,
|
|
45
|
+
onClose,
|
|
46
|
+
style,
|
|
47
|
+
ref,
|
|
48
|
+
}: ActionSheetProps) {
|
|
41
49
|
const [isOpen, setIsOpen] = useState(false);
|
|
42
50
|
|
|
43
51
|
// Variables
|
|
@@ -58,7 +66,7 @@ export const ActionSheet = withMemo(function ActionSheet(
|
|
|
58
66
|
close();
|
|
59
67
|
action?.action(action.actionData);
|
|
60
68
|
},
|
|
61
|
-
[close]
|
|
69
|
+
[close],
|
|
62
70
|
);
|
|
63
71
|
|
|
64
72
|
useImperativeHandle(
|
|
@@ -67,7 +75,7 @@ export const ActionSheet = withMemo(function ActionSheet(
|
|
|
67
75
|
show: () => setIsOpen(true),
|
|
68
76
|
hide: close,
|
|
69
77
|
}),
|
|
70
|
-
[setIsOpen, close]
|
|
78
|
+
[setIsOpen, close],
|
|
71
79
|
);
|
|
72
80
|
|
|
73
81
|
// Effects
|
|
@@ -75,9 +83,14 @@ export const ActionSheet = withMemo(function ActionSheet(
|
|
|
75
83
|
// Other
|
|
76
84
|
|
|
77
85
|
const renderAction = (action: ActionSheetAction<any>) => (
|
|
78
|
-
<Clickable
|
|
86
|
+
<Clickable
|
|
87
|
+
key={action.name}
|
|
88
|
+
className={classNames(styles.action, { [styles.destructive]: action.isDestructive })}
|
|
89
|
+
onClick={onActionClick}
|
|
90
|
+
onClickData={action}
|
|
91
|
+
>
|
|
79
92
|
<InlineBlock className={styles.actionIcon}>{action.icon ? <Icon icon={action.icon} /> : null}</InlineBlock>
|
|
80
|
-
<Text>{action.name}</Text>
|
|
93
|
+
<Text className={styles.actionName}>{action.name}</Text>
|
|
81
94
|
</Clickable>
|
|
82
95
|
);
|
|
83
96
|
|
|
@@ -87,10 +100,10 @@ export const ActionSheet = withMemo(function ActionSheet(
|
|
|
87
100
|
onClick={close}
|
|
88
101
|
style={style}
|
|
89
102
|
>
|
|
90
|
-
<Container fluid="xxl" className=
|
|
103
|
+
<Container fluid="xxl" className={baseStyles.fullHeight}>
|
|
91
104
|
<Flex className={styles.content}>
|
|
92
105
|
{title ? (
|
|
93
|
-
<Block>
|
|
106
|
+
<Block className={styles.title}>
|
|
94
107
|
<Text>{title}</Text>
|
|
95
108
|
</Block>
|
|
96
109
|
) : null}
|
|
@@ -109,4 +122,4 @@ export const ActionSheet = withMemo(function ActionSheet(
|
|
|
109
122
|
</Container>
|
|
110
123
|
</Clickable>
|
|
111
124
|
);
|
|
112
|
-
}
|
|
125
|
+
});
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
@use "../../scss/variables" as variables;
|
|
2
|
+
@use "../../scss/designMixin" as mixin;
|
|
3
|
+
@use "../../scss/vars" as *;
|
|
4
|
+
|
|
5
|
+
@include vars {
|
|
6
|
+
--action-sheet-background-color: var(--curtain-light);
|
|
7
|
+
--action-sheet-action-background-color: var(--foreground-primary);
|
|
8
|
+
--action-sheet-title-color: var(--text-secondary);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@include mixin.design(variables.$material) {
|
|
12
|
+
--action-sheet-action-text-color: var(--text-secondary);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@include mixin.design(variables.$flat) {
|
|
16
|
+
--action-sheet-action-text-color: var(--flavor-accent);
|
|
17
|
+
--action-sheet-action-background-image: linear-gradient(0deg, var(--curtain-light), var(--curtain-light) 100%);
|
|
18
|
+
--action-sheet-action-destructive-text-color: var(--flavor-destructive)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.actionSheet {
|
|
22
|
+
position: fixed;
|
|
23
|
+
inset: 100% 0 0;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
background-color: var(--action-sheet-background-color);
|
|
26
|
+
z-index: var(--action-sheet-z-index);
|
|
27
|
+
transition-duration: 0s;
|
|
28
|
+
transition-delay: 0.25s;
|
|
29
|
+
|
|
30
|
+
&.open {
|
|
31
|
+
transition-delay: 0s;
|
|
32
|
+
top: 0;
|
|
33
|
+
|
|
34
|
+
> :global(.full-height) {;
|
|
35
|
+
top: 0
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
> :global(.full-height) {
|
|
40
|
+
position: absolute;
|
|
41
|
+
inset: 100% 0 0;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.content {
|
|
45
|
+
bottom: 0;
|
|
46
|
+
height: 100%;
|
|
47
|
+
display: flex;
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
justify-content: end;
|
|
50
|
+
|
|
51
|
+
.title, .action {
|
|
52
|
+
width: 100%;
|
|
53
|
+
background-color: var(--action-sheet-action-background-color);
|
|
54
|
+
border-radius: 0;
|
|
55
|
+
display: block;
|
|
56
|
+
text-overflow: ellipsis;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
white-space: nowrap;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.title {
|
|
62
|
+
--text-primary-default-color: var(--action-sheet-title-color);
|
|
63
|
+
|
|
64
|
+
color: var(--action-sheet-title-color);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.action {
|
|
68
|
+
--text-primary-default-color: var(--action-sheet-action-text-color);
|
|
69
|
+
|
|
70
|
+
color: var(--action-sheet-action-text-color);
|
|
71
|
+
background-color: var(--action-sheet-action-background-color);
|
|
72
|
+
|
|
73
|
+
.actionName {
|
|
74
|
+
font-size: 20px;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.cancel {
|
|
79
|
+
--text-primary-default-color: var(--action-sheet-action-text-color);
|
|
80
|
+
|
|
81
|
+
color: var(--action-sheet-action-text-color);
|
|
82
|
+
width: 100%;
|
|
83
|
+
font-size: 20px;
|
|
84
|
+
background-color: var(--action-sheet-action-background-color);
|
|
85
|
+
display: block;
|
|
86
|
+
text-overflow: ellipsis;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
white-space: nowrap;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@include mixin.design(variables.$material) {
|
|
93
|
+
> .full-height {
|
|
94
|
+
padding: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.content {
|
|
98
|
+
text-align: left;
|
|
99
|
+
|
|
100
|
+
.action {
|
|
101
|
+
height: 30px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.title {
|
|
105
|
+
height: 40px;
|
|
106
|
+
line-height: 40px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.action, .title {
|
|
110
|
+
font-size: 1rem;
|
|
111
|
+
|
|
112
|
+
.actionName {
|
|
113
|
+
font-size: 1rem;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
padding: 0 0 0 16px;
|
|
117
|
+
|
|
118
|
+
.actionIcon {
|
|
119
|
+
display: inline-block;
|
|
120
|
+
float: left;
|
|
121
|
+
margin-right: 24px;
|
|
122
|
+
font-size: 16px;
|
|
123
|
+
text-align: center;
|
|
124
|
+
width: 0.8em;
|
|
125
|
+
height: 30px;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.cancel {
|
|
130
|
+
height: 35px;
|
|
131
|
+
line-height: 30px;
|
|
132
|
+
padding: 0 0 0 16px;
|
|
133
|
+
color: var(--action-sheet-action-text-color);
|
|
134
|
+
font-size: 1rem;
|
|
135
|
+
|
|
136
|
+
.actionIcon {
|
|
137
|
+
display: inline-block;
|
|
138
|
+
float: left;
|
|
139
|
+
margin-right: 24px;
|
|
140
|
+
font-size: 1rem;
|
|
141
|
+
text-align: center;
|
|
142
|
+
width: 0.8em;
|
|
143
|
+
height: 30px;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@include mixin.design(variables.$flat) {
|
|
150
|
+
.content {
|
|
151
|
+
text-align: center;
|
|
152
|
+
padding-right: 10px;
|
|
153
|
+
padding-left: 10px;
|
|
154
|
+
padding-bottom: 10px;
|
|
155
|
+
|
|
156
|
+
.action, .title {
|
|
157
|
+
height: 56px;
|
|
158
|
+
line-height: 56px;
|
|
159
|
+
background-size: 100% 1px;
|
|
160
|
+
background-repeat: no-repeat;
|
|
161
|
+
background-position: bottom;
|
|
162
|
+
background-image: var(--action-sheet-action-background-image);
|
|
163
|
+
|
|
164
|
+
&:first-child {
|
|
165
|
+
border-top-right-radius: 12px;
|
|
166
|
+
border-top-left-radius: 12px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&:nth-last-child(2) {
|
|
170
|
+
border-bottom-right-radius: 12px;
|
|
171
|
+
border-bottom-left-radius: 12px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.actionIcon {
|
|
175
|
+
display: none;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
&.destructive {
|
|
179
|
+
--text-primary-default-color: var(--action-sheet-action-destructive-text-color);
|
|
180
|
+
|
|
181
|
+
color: var(--action-sheet-action-destructive-text-color);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.cancel {
|
|
186
|
+
height: 56px;
|
|
187
|
+
line-height: 56px;
|
|
188
|
+
border-radius: 12px;
|
|
189
|
+
margin: 8px 0 0;
|
|
190
|
+
font-weight: 600;
|
|
191
|
+
|
|
192
|
+
.actionIcon {
|
|
193
|
+
display: none;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
|
|
3
|
+
import { Card } from '@/Components/Card/Card';
|
|
4
|
+
import { Text } from '@/Components/Text/Text';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
const meta = {
|
|
8
|
+
component: Card,
|
|
9
|
+
argTypes: {
|
|
10
|
+
children: {
|
|
11
|
+
control: false,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
children: (
|
|
16
|
+
<Text>
|
|
17
|
+
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
|
|
18
|
+
labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et
|
|
19
|
+
ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum
|
|
20
|
+
dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore
|
|
21
|
+
magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet
|
|
22
|
+
clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
|
23
|
+
</Text>
|
|
24
|
+
),
|
|
25
|
+
},
|
|
26
|
+
} satisfies Meta<typeof Card>;
|
|
27
|
+
|
|
28
|
+
export default meta;
|
|
29
|
+
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
export const Default: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
title: 'Title Card',
|
|
35
|
+
fullHeight: false,
|
|
36
|
+
noMargin: false,
|
|
37
|
+
noPadding: false,
|
|
38
|
+
noPaddingHeight: false,
|
|
39
|
+
noPaddingWidth: false,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import styles from './card.scss';
|
|
4
|
-
import { withMemo } from '../../helper/withMemo';
|
|
2
|
+
import { withMemo } from '@/helper/withMemo';
|
|
5
3
|
import classNames from 'classnames';
|
|
6
|
-
import
|
|
4
|
+
import styles from '@/Components/Card/card.module.scss';
|
|
5
|
+
import type { RbmComponentProps } from '@/Components/RbmComponentProps';
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
7
|
|
|
8
8
|
export type CardProps = RbmComponentProps<{
|
|
9
9
|
title?: string | ReactElement;
|
|
@@ -14,7 +14,7 @@ export type CardProps = RbmComponentProps<{
|
|
|
14
14
|
noMargin?: boolean;
|
|
15
15
|
}>;
|
|
16
16
|
|
|
17
|
-
function Card({
|
|
17
|
+
export const Card = withMemo(function Card({
|
|
18
18
|
title,
|
|
19
19
|
children,
|
|
20
20
|
fullHeight = false,
|
|
@@ -39,7 +39,4 @@ function Card({
|
|
|
39
39
|
<div className={styles.content}>{children}</div>
|
|
40
40
|
</div>
|
|
41
41
|
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const CardMemo = withMemo(Card, styles);
|
|
45
|
-
export { CardMemo as Card };
|
|
42
|
+
});
|