@fountain-ui/core 2.0.0-beta.9 → 2.0.0-beta.90
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/CHANGELOG.md +32 -0
- package/build/commonjs/Accordion/Accordion.js +110 -27
- package/build/commonjs/Accordion/Accordion.js.map +1 -1
- package/build/commonjs/Accordion/AccordionProps.js.map +1 -1
- package/build/commonjs/Badge/Badge.js +5 -14
- package/build/commonjs/Badge/Badge.js.map +1 -1
- package/build/commonjs/Badge/BadgeProps.js.map +1 -1
- package/build/commonjs/Button/Button.js +6 -3
- package/build/commonjs/Button/Button.js.map +1 -1
- package/build/commonjs/ButtonBase/ButtonBase.js +65 -51
- package/build/commonjs/ButtonBase/ButtonBase.js.map +1 -1
- package/build/commonjs/ButtonBase/ButtonBaseProps.js.map +1 -1
- package/build/commonjs/Checkbox/CheckboxProps.js.map +1 -1
- package/build/commonjs/Chip/Chip.js +11 -9
- package/build/commonjs/Chip/Chip.js.map +1 -1
- package/build/commonjs/Chip/ChipProps.js.map +1 -1
- package/build/commonjs/CircularProgress/CircularProgress.js +27 -28
- package/build/commonjs/CircularProgress/CircularProgress.js.map +1 -1
- package/build/commonjs/Dialog/Dialog.js +118 -10
- package/build/commonjs/Dialog/Dialog.js.map +1 -1
- package/build/commonjs/Dialog/DialogProps.js.map +1 -1
- package/build/commonjs/Divider/Divider.js +26 -18
- package/build/commonjs/Divider/Divider.js.map +1 -1
- package/build/commonjs/Divider/DividerProps.js.map +1 -1
- package/build/commonjs/Image/Image.js +58 -14
- package/build/commonjs/Image/Image.js.map +1 -1
- package/build/commonjs/Image/ImageProps.js.map +1 -1
- package/build/commonjs/Image/index.js.map +1 -1
- package/build/commonjs/ImageCore/ImageCoreNative.js +36 -26
- package/build/commonjs/ImageCore/ImageCoreNative.js.map +1 -1
- package/build/commonjs/ImageCore/ImageCoreProps.js.map +1 -1
- package/build/commonjs/ImageCore/ImageCoreWeb.js +19 -1
- package/build/commonjs/ImageCore/ImageCoreWeb.js.map +1 -1
- package/build/commonjs/ImageCore/ImageFileExtensionContext.js +14 -0
- package/build/commonjs/ImageCore/ImageFileExtensionContext.js.map +1 -0
- package/build/commonjs/ImageCore/ImageFileExtensionProvider.js +42 -0
- package/build/commonjs/ImageCore/ImageFileExtensionProvider.js.map +1 -0
- package/build/commonjs/ImageCore/index.js +17 -5
- package/build/commonjs/ImageCore/index.js.map +1 -1
- package/build/commonjs/ImageCore/index.native.js +27 -0
- package/build/commonjs/ImageCore/index.native.js.map +1 -1
- package/build/commonjs/Modal/AnimatedContainer/index.js +167 -0
- package/build/commonjs/Modal/AnimatedContainer/index.js.map +1 -0
- package/build/commonjs/Modal/Modal.js +43 -9
- package/build/commonjs/Modal/Modal.js.map +1 -1
- package/build/commonjs/Modal/ModalProps.js +12 -0
- package/build/commonjs/Modal/ModalProps.js.map +1 -1
- package/build/commonjs/Modal/index.js +8 -0
- package/build/commonjs/Modal/index.js.map +1 -1
- package/build/commonjs/Paper/Paper.js +1 -1
- package/build/commonjs/Paper/Paper.js.map +1 -1
- package/build/commonjs/Radio/Radio.js +11 -4
- package/build/commonjs/Radio/Radio.js.map +1 -1
- package/build/commonjs/Radio/RadioProps.js.map +1 -1
- package/build/commonjs/Slide/Slide.js +41 -27
- package/build/commonjs/Slide/Slide.js.map +1 -1
- package/build/commonjs/Slide/SlideProps.js.map +1 -1
- package/build/commonjs/Snackbar/Snackbar.js +34 -7
- package/build/commonjs/Snackbar/Snackbar.js.map +1 -1
- package/build/commonjs/Snackbar/SnackbarProps.js.map +1 -1
- package/build/commonjs/SnackbarContent/SnackbarContent.js +32 -14
- package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
- package/build/commonjs/SnackbarContent/SnackbarContentProps.js.map +1 -1
- package/build/commonjs/SvgIcon/SvgIcon.js +1 -1
- package/build/commonjs/SvgIcon/SvgIcon.js.map +1 -1
- package/build/commonjs/Tab/Tab.js +66 -20
- package/build/commonjs/Tab/Tab.js.map +1 -1
- package/build/commonjs/Tab/TabIndicator.js +11 -7
- package/build/commonjs/Tab/TabIndicator.js.map +1 -1
- package/build/commonjs/Tab/TabProps.js.map +1 -1
- package/build/commonjs/Tab/index.js.map +1 -1
- package/build/commonjs/Tabs/IndexAwareTab.js +35 -0
- package/build/commonjs/Tabs/IndexAwareTab.js.map +1 -0
- package/build/commonjs/Tabs/InternalContext.js +17 -0
- package/build/commonjs/Tabs/InternalContext.js.map +1 -0
- package/build/commonjs/Tabs/ScrollableTabsView.js +35 -0
- package/build/commonjs/Tabs/ScrollableTabsView.js.map +1 -0
- package/build/commonjs/Tabs/TabIndicator.js +73 -28
- package/build/commonjs/Tabs/TabIndicator.js.map +1 -1
- package/build/commonjs/Tabs/TabIndicatorProps.js.map +1 -1
- package/build/commonjs/Tabs/Tabs.js +119 -83
- package/build/commonjs/Tabs/Tabs.js.map +1 -1
- package/build/commonjs/Tabs/TabsProps.js.map +1 -1
- package/build/commonjs/Tabs/index.js.map +1 -1
- package/build/commonjs/Tabs/types.js +2 -0
- package/build/commonjs/Tabs/types.js.map +1 -0
- package/build/commonjs/Tabs/useIndexStore.js +35 -0
- package/build/commonjs/Tabs/useIndexStore.js.map +1 -0
- package/build/commonjs/Tabs/useScrollViewReaction.js +69 -0
- package/build/commonjs/Tabs/useScrollViewReaction.js.map +1 -0
- package/build/commonjs/Tabs/useTabCoordinates.js +30 -0
- package/build/commonjs/Tabs/useTabCoordinates.js.map +1 -0
- package/build/commonjs/Tabs/useTabInnerContentsWidth.js +30 -0
- package/build/commonjs/Tabs/useTabInnerContentsWidth.js.map +1 -0
- package/build/commonjs/Tabs/utils.js +19 -0
- package/build/commonjs/Tabs/utils.js.map +1 -0
- package/build/commonjs/TextField/InputLabel.js +6 -3
- package/build/commonjs/TextField/InputLabel.js.map +1 -1
- package/build/commonjs/TextField/OutlinedTextField.js +6 -2
- package/build/commonjs/TextField/OutlinedTextField.js.map +1 -1
- package/build/commonjs/TextField/TextField.js +15 -8
- package/build/commonjs/TextField/TextField.js.map +1 -1
- package/build/commonjs/TextField/TextFieldProps.js.map +1 -1
- package/build/commonjs/Tooltip/Tooltip.js +50 -31
- package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
- package/build/commonjs/Tooltip/TooltipProps.js.map +1 -1
- package/build/commonjs/Typography/Typography.js +14 -5
- package/build/commonjs/Typography/Typography.js.map +1 -1
- package/build/commonjs/Typography/TypographyProps.js.map +1 -1
- package/build/commonjs/animated/AnimatedPressable.js +2 -3
- package/build/commonjs/animated/AnimatedPressable.js.map +1 -1
- package/build/commonjs/hooks/index.js +32 -0
- package/build/commonjs/hooks/index.js.map +1 -1
- package/build/commonjs/hooks/useAnimatedValue.js +31 -0
- package/build/commonjs/hooks/useAnimatedValue.js.map +1 -0
- package/build/commonjs/hooks/useCollapsibleAppBar.js +41 -54
- package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/commonjs/hooks/useDebounce.js +33 -0
- package/build/commonjs/hooks/useDebounce.js.map +1 -0
- package/build/commonjs/hooks/useFadeInAppBar.js +21 -23
- package/build/commonjs/hooks/useFadeInAppBar.js.map +1 -1
- package/build/commonjs/hooks/useImperativeState.js +26 -0
- package/build/commonjs/hooks/useImperativeState.js.map +1 -0
- package/build/commonjs/hooks/useSyncAnimatedValue.js +40 -0
- package/build/commonjs/hooks/useSyncAnimatedValue.js.map +1 -0
- package/build/commonjs/hooks/useThrottle.js +3 -7
- package/build/commonjs/hooks/useThrottle.js.map +1 -1
- package/build/commonjs/hooks/useValidWindowDimensions/index.ios.js +14 -7
- package/build/commonjs/hooks/useValidWindowDimensions/index.ios.js.map +1 -1
- package/build/commonjs/index.js +28 -0
- package/build/commonjs/index.js.map +1 -1
- package/build/commonjs/internal/hooks/index.js +0 -8
- package/build/commonjs/internal/hooks/index.js.map +1 -1
- package/build/commonjs/internal/hooks/useHeight.js +3 -9
- package/build/commonjs/internal/hooks/useHeight.js.map +1 -1
- package/build/commonjs/internal/icons/Checkbox.js +1 -1
- package/build/commonjs/internal/icons/Checkbox.js.map +1 -1
- package/build/commonjs/internal/icons/CheckboxChecked.js +1 -1
- package/build/commonjs/internal/icons/CheckboxChecked.js.map +1 -1
- package/build/commonjs/internal/icons/ChevronDown.js +1 -1
- package/build/commonjs/internal/icons/ChevronDown.js.map +1 -1
- package/build/commonjs/internal/icons/ChevronLeft.js +1 -1
- package/build/commonjs/internal/icons/ChevronLeft.js.map +1 -1
- package/build/commonjs/internal/icons/ChevronRight.js +1 -1
- package/build/commonjs/internal/icons/ChevronRight.js.map +1 -1
- package/build/commonjs/internal/icons/Close.js +1 -1
- package/build/commonjs/internal/icons/Close.js.map +1 -1
- package/build/commonjs/internal/icons/Radio.js +1 -1
- package/build/commonjs/internal/icons/Radio.js.map +1 -1
- package/build/commonjs/internal/icons/RadioChecked.js +1 -1
- package/build/commonjs/internal/icons/RadioChecked.js.map +1 -1
- package/build/commonjs/store/MockStore.js +27 -0
- package/build/commonjs/store/MockStore.js.map +1 -0
- package/build/commonjs/store/SimpleStore.js +59 -0
- package/build/commonjs/store/SimpleStore.js.map +1 -0
- package/build/commonjs/store/index.js +24 -0
- package/build/commonjs/store/index.js.map +1 -0
- package/build/commonjs/store/types.js +2 -0
- package/build/commonjs/store/types.js.map +1 -0
- package/build/commonjs/types/index.js.map +1 -1
- package/build/commonjs/utils/index.js +8 -0
- package/build/commonjs/utils/index.js.map +1 -1
- package/build/commonjs/utils/isNotAndroid12.js +20 -0
- package/build/commonjs/utils/isNotAndroid12.js.map +1 -0
- package/build/module/Accordion/Accordion.js +111 -29
- package/build/module/Accordion/Accordion.js.map +1 -1
- package/build/module/Accordion/AccordionProps.js.map +1 -1
- package/build/module/Badge/Badge.js +5 -14
- package/build/module/Badge/Badge.js.map +1 -1
- package/build/module/Badge/BadgeProps.js.map +1 -1
- package/build/module/Button/Button.js +6 -3
- package/build/module/Button/Button.js.map +1 -1
- package/build/module/ButtonBase/ButtonBase.js +64 -49
- package/build/module/ButtonBase/ButtonBase.js.map +1 -1
- package/build/module/ButtonBase/ButtonBaseProps.js.map +1 -1
- package/build/module/Checkbox/CheckboxProps.js.map +1 -1
- package/build/module/Chip/Chip.js +11 -9
- package/build/module/Chip/Chip.js.map +1 -1
- package/build/module/Chip/ChipProps.js.map +1 -1
- package/build/module/CircularProgress/CircularProgress.js +25 -23
- package/build/module/CircularProgress/CircularProgress.js.map +1 -1
- package/build/module/Dialog/Dialog.js +109 -8
- package/build/module/Dialog/Dialog.js.map +1 -1
- package/build/module/Dialog/DialogProps.js.map +1 -1
- package/build/module/Divider/Divider.js +26 -18
- package/build/module/Divider/Divider.js.map +1 -1
- package/build/module/Divider/DividerProps.js.map +1 -1
- package/build/module/Image/Image.js +54 -12
- package/build/module/Image/Image.js.map +1 -1
- package/build/module/Image/ImageProps.js.map +1 -1
- package/build/module/Image/index.js.map +1 -1
- package/build/module/ImageCore/ImageCoreNative.js +31 -25
- package/build/module/ImageCore/ImageCoreNative.js.map +1 -1
- package/build/module/ImageCore/ImageCoreProps.js.map +1 -1
- package/build/module/ImageCore/ImageCoreWeb.js +19 -1
- package/build/module/ImageCore/ImageCoreWeb.js.map +1 -1
- package/build/module/ImageCore/ImageFileExtensionContext.js +5 -0
- package/build/module/ImageCore/ImageFileExtensionContext.js.map +1 -0
- package/build/module/ImageCore/ImageFileExtensionProvider.js +24 -0
- package/build/module/ImageCore/ImageFileExtensionProvider.js.map +1 -0
- package/build/module/ImageCore/index.js +2 -1
- package/build/module/ImageCore/index.js.map +1 -1
- package/build/module/ImageCore/index.native.js +2 -0
- package/build/module/ImageCore/index.native.js.map +1 -1
- package/build/module/Modal/AnimatedContainer/index.js +144 -0
- package/build/module/Modal/AnimatedContainer/index.js.map +1 -0
- package/build/module/Modal/Modal.js +43 -9
- package/build/module/Modal/Modal.js.map +1 -1
- package/build/module/Modal/ModalProps.js +5 -0
- package/build/module/Modal/ModalProps.js.map +1 -1
- package/build/module/Modal/index.js +1 -0
- package/build/module/Modal/index.js.map +1 -1
- package/build/module/Paper/Paper.js +1 -1
- package/build/module/Paper/Paper.js.map +1 -1
- package/build/module/Radio/Radio.js +9 -5
- package/build/module/Radio/Radio.js.map +1 -1
- package/build/module/Radio/RadioProps.js.map +1 -1
- package/build/module/Slide/Slide.js +39 -23
- package/build/module/Slide/Slide.js.map +1 -1
- package/build/module/Slide/SlideProps.js.map +1 -1
- package/build/module/Snackbar/Snackbar.js +25 -5
- package/build/module/Snackbar/Snackbar.js.map +1 -1
- package/build/module/Snackbar/SnackbarProps.js.map +1 -1
- package/build/module/SnackbarContent/SnackbarContent.js +21 -6
- package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
- package/build/module/SnackbarContent/SnackbarContentProps.js.map +1 -1
- package/build/module/SvgIcon/SvgIcon.js +1 -1
- package/build/module/SvgIcon/SvgIcon.js.map +1 -1
- package/build/module/Tab/Tab.js +63 -21
- package/build/module/Tab/Tab.js.map +1 -1
- package/build/module/Tab/TabIndicator.js +11 -7
- package/build/module/Tab/TabIndicator.js.map +1 -1
- package/build/module/Tab/TabProps.js.map +1 -1
- package/build/module/Tab/index.js.map +1 -1
- package/build/module/Tabs/IndexAwareTab.js +23 -0
- package/build/module/Tabs/IndexAwareTab.js.map +1 -0
- package/build/module/Tabs/InternalContext.js +7 -0
- package/build/module/Tabs/InternalContext.js.map +1 -0
- package/build/module/Tabs/ScrollableTabsView.js +22 -0
- package/build/module/Tabs/ScrollableTabsView.js.map +1 -0
- package/build/module/Tabs/TabIndicator.js +66 -25
- package/build/module/Tabs/TabIndicator.js.map +1 -1
- package/build/module/Tabs/TabIndicatorProps.js.map +1 -1
- package/build/module/Tabs/Tabs.js +109 -72
- package/build/module/Tabs/Tabs.js.map +1 -1
- package/build/module/Tabs/TabsProps.js.map +1 -1
- package/build/module/Tabs/index.js.map +1 -1
- package/build/module/Tabs/types.js +2 -0
- package/build/module/Tabs/types.js.map +1 -0
- package/build/module/Tabs/useIndexStore.js +25 -0
- package/build/module/Tabs/useIndexStore.js.map +1 -0
- package/build/module/Tabs/useScrollViewReaction.js +57 -0
- package/build/module/Tabs/useScrollViewReaction.js.map +1 -0
- package/build/module/Tabs/useTabCoordinates.js +21 -0
- package/build/module/Tabs/useTabCoordinates.js.map +1 -0
- package/build/module/Tabs/useTabInnerContentsWidth.js +21 -0
- package/build/module/Tabs/useTabInnerContentsWidth.js.map +1 -0
- package/build/module/Tabs/utils.js +9 -0
- package/build/module/Tabs/utils.js.map +1 -0
- package/build/module/TextField/InputLabel.js +7 -4
- package/build/module/TextField/InputLabel.js.map +1 -1
- package/build/module/TextField/OutlinedTextField.js +7 -3
- package/build/module/TextField/OutlinedTextField.js.map +1 -1
- package/build/module/TextField/TextField.js +13 -5
- package/build/module/TextField/TextField.js.map +1 -1
- package/build/module/TextField/TextFieldProps.js.map +1 -1
- package/build/module/Tooltip/Tooltip.js +48 -25
- package/build/module/Tooltip/Tooltip.js.map +1 -1
- package/build/module/Tooltip/TooltipProps.js.map +1 -1
- package/build/module/Typography/Typography.js +14 -5
- package/build/module/Typography/Typography.js.map +1 -1
- package/build/module/Typography/TypographyProps.js.map +1 -1
- package/build/module/animated/AnimatedPressable.js +2 -3
- package/build/module/animated/AnimatedPressable.js.map +1 -1
- package/build/module/hooks/index.js +4 -0
- package/build/module/hooks/index.js.map +1 -1
- package/build/module/hooks/useAnimatedValue.js +22 -0
- package/build/module/hooks/useAnimatedValue.js.map +1 -0
- package/build/module/hooks/useCollapsibleAppBar.js +42 -52
- package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/module/hooks/useDebounce.js +25 -0
- package/build/module/hooks/useDebounce.js.map +1 -0
- package/build/module/hooks/useFadeInAppBar.js +23 -20
- package/build/module/hooks/useFadeInAppBar.js.map +1 -1
- package/build/module/hooks/useImperativeState.js +17 -0
- package/build/module/hooks/useImperativeState.js.map +1 -0
- package/build/module/hooks/useSyncAnimatedValue.js +28 -0
- package/build/module/hooks/useSyncAnimatedValue.js.map +1 -0
- package/build/module/hooks/useThrottle.js +3 -3
- package/build/module/hooks/useThrottle.js.map +1 -1
- package/build/module/hooks/useValidWindowDimensions/index.ios.js +15 -9
- package/build/module/hooks/useValidWindowDimensions/index.ios.js.map +1 -1
- package/build/module/index.js +2 -0
- package/build/module/index.js.map +1 -1
- package/build/module/internal/hooks/index.js +0 -1
- package/build/module/internal/hooks/index.js.map +1 -1
- package/build/module/internal/hooks/useHeight.js +3 -4
- package/build/module/internal/hooks/useHeight.js.map +1 -1
- package/build/module/internal/icons/Checkbox.js +1 -1
- package/build/module/internal/icons/Checkbox.js.map +1 -1
- package/build/module/internal/icons/CheckboxChecked.js +1 -1
- package/build/module/internal/icons/CheckboxChecked.js.map +1 -1
- package/build/module/internal/icons/ChevronDown.js +1 -1
- package/build/module/internal/icons/ChevronDown.js.map +1 -1
- package/build/module/internal/icons/ChevronLeft.js +1 -1
- package/build/module/internal/icons/ChevronLeft.js.map +1 -1
- package/build/module/internal/icons/ChevronRight.js +1 -1
- package/build/module/internal/icons/ChevronRight.js.map +1 -1
- package/build/module/internal/icons/Close.js +1 -1
- package/build/module/internal/icons/Close.js.map +1 -1
- package/build/module/internal/icons/Radio.js +1 -1
- package/build/module/internal/icons/Radio.js.map +1 -1
- package/build/module/internal/icons/RadioChecked.js +1 -1
- package/build/module/internal/icons/RadioChecked.js.map +1 -1
- package/build/module/store/MockStore.js +18 -0
- package/build/module/store/MockStore.js.map +1 -0
- package/build/module/store/SimpleStore.js +50 -0
- package/build/module/store/SimpleStore.js.map +1 -0
- package/build/module/store/index.js +3 -0
- package/build/module/store/index.js.map +1 -0
- package/build/module/store/types.js +2 -0
- package/build/module/store/types.js.map +1 -0
- package/build/module/types/index.js.map +1 -1
- package/build/module/utils/index.js +1 -0
- package/build/module/utils/index.js.map +1 -1
- package/build/module/utils/isNotAndroid12.js +6 -0
- package/build/module/utils/isNotAndroid12.js.map +1 -0
- package/build/typescript/Accordion/Accordion.d.ts +1 -0
- package/build/typescript/Accordion/AccordionProps.d.ts +14 -11
- package/build/typescript/AspectRatio/AspectRatioNative.d.ts +1 -0
- package/build/typescript/AspectRatio/AspectRatioWeb.d.ts +1 -0
- package/build/typescript/Avatar/Avatar.d.ts +1 -0
- package/build/typescript/Badge/Badge.d.ts +1 -0
- package/build/typescript/Badge/BadgeProps.d.ts +5 -0
- package/build/typescript/Button/Button.d.ts +1 -0
- package/build/typescript/ButtonBase/ButtonBase.d.ts +1 -0
- package/build/typescript/ButtonBase/ButtonBaseProps.d.ts +8 -0
- package/build/typescript/Card/Card.d.ts +1 -0
- package/build/typescript/CardActions/CardActions.d.ts +1 -0
- package/build/typescript/CardContent/CardContent.d.ts +1 -0
- package/build/typescript/CardMedia/CardMedia.d.ts +1 -0
- package/build/typescript/Checkbox/Checkbox.d.ts +1 -0
- package/build/typescript/Checkbox/CheckboxProps.d.ts +1 -1
- package/build/typescript/Chip/Chip.d.ts +1 -0
- package/build/typescript/Chip/ChipProps.d.ts +4 -0
- package/build/typescript/CircularProgress/CircularProgress.d.ts +3 -2
- package/build/typescript/Column/Column.d.ts +1 -0
- package/build/typescript/Dialog/Dialog.d.ts +1 -0
- package/build/typescript/Dialog/DialogProps.d.ts +10 -0
- package/build/typescript/DialogActions/DialogActions.d.ts +1 -0
- package/build/typescript/DialogContent/DialogContent.d.ts +1 -0
- package/build/typescript/DialogMedia/DialogMedia.d.ts +1 -0
- package/build/typescript/DialogTitle/DialogTitle.d.ts +1 -0
- package/build/typescript/Divider/Divider.d.ts +1 -0
- package/build/typescript/Divider/DividerProps.d.ts +22 -1
- package/build/typescript/Fab/Fab.d.ts +1 -0
- package/build/typescript/Flexbox/Flexbox.d.ts +1 -0
- package/build/typescript/IconButton/IconButton.d.ts +1 -0
- package/build/typescript/Image/Image.d.ts +1 -0
- package/build/typescript/Image/ImageProps.d.ts +30 -2
- package/build/typescript/Image/index.d.ts +1 -1
- package/build/typescript/ImageCore/ImageCoreNative.d.ts +1 -0
- package/build/typescript/ImageCore/ImageCoreProps.d.ts +5 -1
- package/build/typescript/ImageCore/ImageCoreWeb.d.ts +1 -0
- package/build/typescript/ImageCore/ImageFileExtensionContext.d.ts +3 -0
- package/build/typescript/ImageCore/ImageFileExtensionProvider.d.ts +13 -0
- package/build/typescript/ImageCore/index.d.ts +3 -1
- package/build/typescript/ImageCore/index.native.d.ts +2 -0
- package/build/typescript/Link/Link.d.ts +1 -0
- package/build/typescript/List/List.d.ts +1 -0
- package/build/typescript/ListItem/ListItem.d.ts +1 -0
- package/build/typescript/ListItemIcon/ListItemIcon.d.ts +1 -0
- package/build/typescript/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +1 -0
- package/build/typescript/ListItemText/ListItemText.d.ts +1 -0
- package/build/typescript/ListSubheader/ListSubheader.d.ts +1 -0
- package/build/typescript/Menu/Menu.d.ts +1 -0
- package/build/typescript/MenuItem/MenuItem.d.ts +1 -0
- package/build/typescript/Modal/AnimatedContainer/index.d.ts +5 -0
- package/build/typescript/Modal/Modal.d.ts +1 -0
- package/build/typescript/Modal/ModalProps.d.ts +47 -0
- package/build/typescript/Modal/index.d.ts +2 -1
- package/build/typescript/Pagination/Pagination.d.ts +1 -0
- package/build/typescript/Portal/Portal.d.ts +1 -0
- package/build/typescript/Radio/Radio.d.ts +1 -0
- package/build/typescript/Radio/RadioProps.d.ts +13 -0
- package/build/typescript/RadioGroup/RadioGroup.d.ts +1 -0
- package/build/typescript/Row/Row.d.ts +1 -0
- package/build/typescript/Slide/Slide.d.ts +1 -0
- package/build/typescript/Slide/SlideProps.d.ts +2 -3
- package/build/typescript/Slider/Slider.d.ts +1 -1
- package/build/typescript/Snackbar/Snackbar.d.ts +1 -0
- package/build/typescript/Snackbar/SnackbarProps.d.ts +10 -3
- package/build/typescript/SnackbarContent/SnackbarContent.d.ts +1 -0
- package/build/typescript/SnackbarContent/SnackbarContentProps.d.ts +9 -0
- package/build/typescript/Spacer/Spacer.d.ts +1 -0
- package/build/typescript/SvgIcon/SvgIcon.d.ts +1 -0
- package/build/typescript/Switch/Switch.d.ts +1 -0
- package/build/typescript/Tab/Tab.d.ts +1 -0
- package/build/typescript/Tab/TabIndicator.d.ts +5 -1
- package/build/typescript/Tab/TabProps.d.ts +21 -2
- package/build/typescript/Tab/index.d.ts +1 -1
- package/build/typescript/TabBase/TabBase.d.ts +1 -0
- package/build/typescript/Tabs/IndexAwareTab.d.ts +8 -0
- package/build/typescript/Tabs/InternalContext.d.ts +7 -0
- package/build/typescript/Tabs/ScrollableTabsView.d.ts +8 -0
- package/build/typescript/Tabs/TabIndicator.d.ts +1 -0
- package/build/typescript/Tabs/TabIndicatorProps.d.ts +10 -5
- package/build/typescript/Tabs/Tabs.d.ts +4 -1
- package/build/typescript/Tabs/TabsProps.d.ts +37 -13
- package/build/typescript/Tabs/index.d.ts +1 -0
- package/build/typescript/Tabs/types.d.ts +9 -0
- package/build/typescript/Tabs/useIndexStore.d.ts +3 -0
- package/build/typescript/Tabs/useScrollViewReaction.d.ts +8 -0
- package/build/typescript/Tabs/useTabCoordinates.d.ts +6 -0
- package/build/typescript/Tabs/useTabInnerContentsWidth.d.ts +6 -0
- package/build/typescript/Tabs/utils.d.ts +3 -0
- package/build/typescript/TextField/InputLabel.d.ts +1 -0
- package/build/typescript/TextField/TextFieldProps.d.ts +3 -0
- package/build/typescript/Toolbar/Toolbar.d.ts +1 -0
- package/build/typescript/Tooltip/Tooltip.d.ts +1 -0
- package/build/typescript/Tooltip/TooltipProps.d.ts +26 -1
- package/build/typescript/Typography/TypographyProps.d.ts +22 -1
- package/build/typescript/animated/AnimatedPressable.d.ts +2 -2
- package/build/typescript/hooks/index.d.ts +5 -0
- package/build/typescript/hooks/useAnimatedValue.d.ts +2 -0
- package/build/typescript/hooks/useCollapsibleAppBar.d.ts +2 -0
- package/build/typescript/hooks/useDebounce.d.ts +1 -0
- package/build/typescript/hooks/useFadeInAppBar.d.ts +1 -0
- package/build/typescript/hooks/useImperativeState.d.ts +6 -0
- package/build/typescript/hooks/useSyncAnimatedValue.d.ts +6 -0
- package/build/typescript/hooks/useValidWindowDimensions/index.ios.d.ts +2 -1
- package/build/typescript/index.d.ts +2 -0
- package/build/typescript/internal/hooks/index.d.ts +0 -1
- package/build/typescript/internal/icons/Checkbox.d.ts +9 -7
- package/build/typescript/internal/icons/CheckboxChecked.d.ts +9 -7
- package/build/typescript/internal/icons/ChevronDown.d.ts +9 -7
- package/build/typescript/internal/icons/ChevronLeft.d.ts +9 -7
- package/build/typescript/internal/icons/ChevronRight.d.ts +9 -7
- package/build/typescript/internal/icons/CircularProgress.d.ts +1 -0
- package/build/typescript/internal/icons/Close.d.ts +9 -7
- package/build/typescript/internal/icons/Radio.d.ts +9 -7
- package/build/typescript/internal/icons/RadioChecked.d.ts +9 -7
- package/build/typescript/store/MockStore.d.ts +7 -0
- package/build/typescript/store/SimpleStore.d.ts +10 -0
- package/build/typescript/store/index.d.ts +3 -0
- package/build/typescript/store/types.d.ts +10 -0
- package/build/typescript/types/index.d.ts +6 -0
- package/build/typescript/utils/index.d.ts +1 -0
- package/build/typescript/utils/isNotAndroid12.d.ts +2 -0
- package/package.json +9 -9
- package/src/Accordion/Accordion.tsx +147 -51
- package/src/Accordion/AccordionProps.ts +15 -11
- package/src/Badge/Badge.tsx +6 -16
- package/src/Badge/BadgeProps.ts +6 -0
- package/src/Button/Button.tsx +8 -2
- package/src/ButtonBase/ButtonBase.tsx +79 -44
- package/src/ButtonBase/ButtonBaseProps.ts +10 -0
- package/src/Checkbox/CheckboxProps.ts +1 -1
- package/src/Chip/Chip.tsx +13 -9
- package/src/Chip/ChipProps.ts +5 -0
- package/src/CircularProgress/CircularProgress.tsx +41 -33
- package/src/Dialog/Dialog.tsx +136 -14
- package/src/Dialog/DialogProps.ts +12 -0
- package/src/Divider/Divider.tsx +23 -14
- package/src/Divider/DividerProps.ts +27 -1
- package/src/Image/Image.tsx +78 -16
- package/src/Image/ImageProps.ts +36 -2
- package/src/Image/index.ts +1 -1
- package/src/ImageCore/ImageCoreNative.tsx +29 -19
- package/src/ImageCore/ImageCoreProps.ts +6 -1
- package/src/ImageCore/ImageCoreWeb.tsx +22 -2
- package/src/ImageCore/ImageFileExtensionContext.ts +7 -0
- package/src/ImageCore/ImageFileExtensionProvider.tsx +33 -0
- package/src/ImageCore/index.native.ts +3 -1
- package/src/ImageCore/index.ts +4 -1
- package/src/Modal/AnimatedContainer/index.tsx +172 -0
- package/src/Modal/Modal.tsx +44 -12
- package/src/Modal/ModalProps.ts +59 -1
- package/src/Modal/index.ts +2 -1
- package/src/Paper/Paper.tsx +1 -1
- package/src/Radio/Radio.tsx +10 -7
- package/src/Radio/RadioProps.ts +16 -0
- package/src/Slide/Slide.tsx +33 -27
- package/src/Slide/SlideProps.ts +2 -3
- package/src/Snackbar/Snackbar.tsx +33 -7
- package/src/Snackbar/SnackbarProps.ts +19 -9
- package/src/SnackbarContent/SnackbarContent.tsx +42 -10
- package/src/SnackbarContent/SnackbarContentProps.ts +14 -3
- package/src/SvgIcon/SvgIcon.tsx +1 -1
- package/src/Tab/Tab.tsx +85 -28
- package/src/Tab/TabIndicator.tsx +17 -15
- package/src/Tab/TabProps.ts +24 -2
- package/src/Tab/index.ts +1 -1
- package/src/Tabs/IndexAwareTab.tsx +29 -0
- package/src/Tabs/InternalContext.ts +13 -0
- package/src/Tabs/ScrollableTabsView.tsx +28 -0
- package/src/Tabs/TabIndicator.tsx +74 -37
- package/src/Tabs/TabIndicatorProps.ts +12 -5
- package/src/Tabs/Tabs.tsx +139 -93
- package/src/Tabs/TabsProps.ts +43 -23
- package/src/Tabs/index.ts +2 -1
- package/src/Tabs/types.ts +18 -0
- package/src/Tabs/useIndexStore.ts +31 -0
- package/src/Tabs/useScrollViewReaction.ts +62 -0
- package/src/Tabs/useTabCoordinates.ts +25 -0
- package/src/Tabs/useTabInnerContentsWidth.ts +26 -0
- package/src/Tabs/utils.ts +14 -0
- package/src/TextField/InputLabel.tsx +6 -1
- package/src/TextField/OutlinedTextField.tsx +8 -2
- package/src/TextField/TextField.tsx +10 -4
- package/src/TextField/TextFieldProps.ts +4 -0
- package/src/Tooltip/Tooltip.tsx +57 -26
- package/src/Tooltip/TooltipProps.ts +26 -1
- package/src/Typography/Typography.tsx +12 -3
- package/src/Typography/TypographyProps.ts +30 -1
- package/src/animated/AnimatedPressable.tsx +1 -2
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useAnimatedValue.ts +21 -0
- package/src/hooks/useCollapsibleAppBar.ts +64 -47
- package/src/hooks/useDebounce.ts +23 -0
- package/src/hooks/useFadeInAppBar.ts +23 -17
- package/src/hooks/useImperativeState.ts +24 -0
- package/src/hooks/useSyncAnimatedValue.ts +38 -0
- package/src/hooks/useThrottle.ts +3 -3
- package/src/hooks/useValidWindowDimensions/index.ios.ts +16 -10
- package/src/index.ts +4 -0
- package/src/internal/hooks/index.ts +0 -1
- package/src/internal/hooks/useHeight.ts +4 -5
- package/src/internal/icons/Checkbox.tsx +1 -1
- package/src/internal/icons/CheckboxChecked.tsx +1 -1
- package/src/internal/icons/ChevronDown.tsx +1 -1
- package/src/internal/icons/ChevronLeft.tsx +1 -1
- package/src/internal/icons/ChevronRight.tsx +1 -1
- package/src/internal/icons/Close.tsx +1 -1
- package/src/internal/icons/Radio.tsx +1 -1
- package/src/internal/icons/RadioChecked.tsx +1 -1
- package/src/store/MockStore.ts +21 -0
- package/src/store/SimpleStore.ts +50 -0
- package/src/store/index.ts +3 -0
- package/src/store/types.ts +12 -0
- package/src/types/index.ts +7 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/isNotAndroid12.ts +7 -0
- package/build/commonjs/ButtonBase/ButtonBase.ios.js +0 -101
- package/build/commonjs/ButtonBase/ButtonBase.ios.js.map +0 -1
- package/build/commonjs/ButtonBase/useDisabledReaction/index.js +0 -21
- package/build/commonjs/ButtonBase/useDisabledReaction/index.js.map +0 -1
- package/build/commonjs/ButtonBase/useDisabledReaction/index.native.js +0 -9
- package/build/commonjs/ButtonBase/useDisabledReaction/index.native.js.map +0 -1
- package/build/commonjs/ImageCore/ImageCoreNative.ios.js +0 -60
- package/build/commonjs/ImageCore/ImageCoreNative.ios.js.map +0 -1
- package/build/commonjs/internal/hooks/useWidth.js +0 -29
- package/build/commonjs/internal/hooks/useWidth.js.map +0 -1
- package/build/module/ButtonBase/ButtonBase.ios.js +0 -82
- package/build/module/ButtonBase/ButtonBase.ios.js.map +0 -1
- package/build/module/ButtonBase/useDisabledReaction/index.js +0 -12
- package/build/module/ButtonBase/useDisabledReaction/index.js.map +0 -1
- package/build/module/ButtonBase/useDisabledReaction/index.native.js +0 -2
- package/build/module/ButtonBase/useDisabledReaction/index.native.js.map +0 -1
- package/build/module/ImageCore/ImageCoreNative.ios.js +0 -45
- package/build/module/ImageCore/ImageCoreNative.ios.js.map +0 -1
- package/build/module/internal/hooks/useWidth.js +0 -15
- package/build/module/internal/hooks/useWidth.js.map +0 -1
- package/build/typescript/ButtonBase/ButtonBase.ios.d.ts +0 -2
- package/build/typescript/ButtonBase/useDisabledReaction/index.d.ts +0 -2
- package/build/typescript/ButtonBase/useDisabledReaction/index.native.d.ts +0 -2
- package/build/typescript/ImageCore/ImageCoreNative.ios.d.ts +0 -2
- package/build/typescript/internal/hooks/useWidth.d.ts +0 -2
- package/src/ButtonBase/ButtonBase.ios.tsx +0 -95
- package/src/ButtonBase/useDisabledReaction/index.native.ts +0 -4
- package/src/ButtonBase/useDisabledReaction/index.ts +0 -16
- package/src/ImageCore/ImageCoreNative.ios.tsx +0 -46
- package/src/internal/hooks/useWidth.ts +0 -17
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { DragEventHandler, MouseEventHandler } from 'react';
|
|
2
2
|
import type ImageCoreProps from './ImageCoreProps';
|
|
3
3
|
|
|
4
|
+
const longClickDisabledStyle = {
|
|
5
|
+
'-webkit-user-select': 'none',
|
|
6
|
+
'-webkit-touch-callout': 'none',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const preventDragging: DragEventHandler<HTMLImageElement> = () => false;
|
|
10
|
+
|
|
11
|
+
const preventMouseDown: MouseEventHandler<HTMLImageElement> = (event) => {
|
|
12
|
+
if (event.preventDefault) {
|
|
13
|
+
event.preventDefault();
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
4
17
|
export default function ImageCore(props: ImageCoreProps) {
|
|
5
18
|
const {
|
|
6
19
|
alt,
|
|
20
|
+
disableDrag = false,
|
|
21
|
+
disableLongClick = false,
|
|
7
22
|
height,
|
|
8
23
|
loading,
|
|
9
24
|
onError,
|
|
@@ -13,13 +28,18 @@ export default function ImageCore(props: ImageCoreProps) {
|
|
|
13
28
|
width,
|
|
14
29
|
} = props;
|
|
15
30
|
|
|
16
|
-
const style = {
|
|
31
|
+
const style = {
|
|
32
|
+
objectFit: resizeMode,
|
|
33
|
+
...(disableLongClick ? longClickDisabledStyle : {}),
|
|
34
|
+
};
|
|
17
35
|
|
|
18
36
|
return (
|
|
19
37
|
<img
|
|
20
38
|
alt={alt}
|
|
21
39
|
height={height}
|
|
22
40
|
loading={loading}
|
|
41
|
+
onDragStart={disableDrag ? preventDragging : undefined}
|
|
42
|
+
onMouseDown={disableDrag ? preventMouseDown : undefined}
|
|
23
43
|
onError={onError}
|
|
24
44
|
onLoad={onLoad}
|
|
25
45
|
src={source.uri}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as R from 'ramda';
|
|
3
|
+
import ImageFileExtensionContext from './ImageFileExtensionContext';
|
|
4
|
+
|
|
5
|
+
export enum ImageFileExtension {
|
|
6
|
+
AVIF = 'avif',
|
|
7
|
+
WEBP = 'webp',
|
|
8
|
+
JPG = 'jpg',
|
|
9
|
+
PNG = 'png',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ImageFileExtensionProviderProps {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
extensions: ImageFileExtension[];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default function ImageFileExtensionProvider(props: ImageFileExtensionProviderProps) {
|
|
18
|
+
const { children, extensions } = props;
|
|
19
|
+
|
|
20
|
+
const supportedMediaTypes = [
|
|
21
|
+
...(R.map(extension => `image/${extension}`, extensions)),
|
|
22
|
+
'image/*',
|
|
23
|
+
'*/*',
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const acceptHeader = `${R.join(',', supportedMediaTypes)};`;
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<ImageFileExtensionContext.Provider value={acceptHeader}>
|
|
30
|
+
{children}
|
|
31
|
+
</ImageFileExtensionContext.Provider>
|
|
32
|
+
);
|
|
33
|
+
}
|
package/src/ImageCore/index.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export { default } from './ImageCoreWeb';
|
|
2
|
-
export
|
|
2
|
+
export type { default as ImageCoreProps, ImageSource, Loading, ResizeMode, CacheControl } from './ImageCoreProps';
|
|
3
|
+
|
|
4
|
+
export { default as ImageFileExtensionProvider } from './ImageFileExtensionProvider';
|
|
5
|
+
export * from './ImageFileExtensionProvider';
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import React, { useCallback, useEffect } from 'react';
|
|
2
|
+
import { Animated, Easing, Platform, useWindowDimensions } from 'react-native';
|
|
3
|
+
import * as R from 'ramda';
|
|
4
|
+
import { useAnimatedValue } from '../../hooks';
|
|
5
|
+
import { isNotAndroid12 } from '../../utils';
|
|
6
|
+
import type ModalProps from '../ModalProps';
|
|
7
|
+
import { ANIMATION_TYPE, AnimationUnit } from '../ModalProps';
|
|
8
|
+
|
|
9
|
+
type AnimatedContainerProps = Pick<ModalProps,
|
|
10
|
+
| 'children'
|
|
11
|
+
| 'closeAnimation'
|
|
12
|
+
| 'initialOpacity'
|
|
13
|
+
| 'initialTranslateY'
|
|
14
|
+
| 'onEnter'
|
|
15
|
+
| 'onEntered'
|
|
16
|
+
| 'onExit'
|
|
17
|
+
| 'onExited'
|
|
18
|
+
| 'openAnimation'
|
|
19
|
+
| 'offsetAnimation'
|
|
20
|
+
| 'style'
|
|
21
|
+
| 'visible'>
|
|
22
|
+
|
|
23
|
+
const DEFAULT_ANIMATION_CONFIG = {
|
|
24
|
+
duration: 300,
|
|
25
|
+
useNativeDriver: isNotAndroid12,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default function AnimatedContainer(props: AnimatedContainerProps) {
|
|
29
|
+
const {
|
|
30
|
+
children,
|
|
31
|
+
closeAnimation,
|
|
32
|
+
initialOpacity,
|
|
33
|
+
initialTranslateY,
|
|
34
|
+
onEnter,
|
|
35
|
+
onEntered,
|
|
36
|
+
onExit,
|
|
37
|
+
onExited,
|
|
38
|
+
openAnimation,
|
|
39
|
+
offsetAnimation,
|
|
40
|
+
style,
|
|
41
|
+
visible,
|
|
42
|
+
} = props;
|
|
43
|
+
|
|
44
|
+
const { height: screenHeight } = useWindowDimensions();
|
|
45
|
+
|
|
46
|
+
const opacity = useAnimatedValue(initialOpacity ?? 0);
|
|
47
|
+
|
|
48
|
+
const translateY = useAnimatedValue(initialTranslateY ?? screenHeight);
|
|
49
|
+
|
|
50
|
+
const convertToCompositeAnimation = useCallback((animationUnit: AnimationUnit) => {
|
|
51
|
+
const {
|
|
52
|
+
type,
|
|
53
|
+
...others
|
|
54
|
+
} = animationUnit;
|
|
55
|
+
|
|
56
|
+
switch (type) {
|
|
57
|
+
case ANIMATION_TYPE.FADE:
|
|
58
|
+
return Animated.timing(opacity, {
|
|
59
|
+
...others,
|
|
60
|
+
useNativeDriver: isNotAndroid12,
|
|
61
|
+
});
|
|
62
|
+
case ANIMATION_TYPE.SLIDE:
|
|
63
|
+
default:
|
|
64
|
+
const easing = others.toValue === screenHeight
|
|
65
|
+
? Easing.in(Easing.ease)
|
|
66
|
+
: Platform.OS === 'web'
|
|
67
|
+
? Easing.bezier(0.16, 1, 0.3, 1)
|
|
68
|
+
: Easing.out(Easing.exp);
|
|
69
|
+
|
|
70
|
+
return Animated.timing(translateY, {
|
|
71
|
+
...others,
|
|
72
|
+
easing,
|
|
73
|
+
useNativeDriver: isNotAndroid12,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}, [screenHeight]);
|
|
77
|
+
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
if (visible) {
|
|
80
|
+
onEnter?.();
|
|
81
|
+
|
|
82
|
+
if (R.isNil(openAnimation)) {
|
|
83
|
+
opacity.setValue(1);
|
|
84
|
+
|
|
85
|
+
Animated.timing(translateY, {
|
|
86
|
+
...DEFAULT_ANIMATION_CONFIG,
|
|
87
|
+
easing: Platform.OS === 'web'
|
|
88
|
+
? Easing.bezier(0.16, 1, 0.3, 1)
|
|
89
|
+
: Easing.out(Easing.exp),
|
|
90
|
+
toValue: 0,
|
|
91
|
+
}).start(({ finished }) => {
|
|
92
|
+
if (finished) {
|
|
93
|
+
onEntered?.();
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
} else {
|
|
97
|
+
const convertedAnimation = openAnimation.map((animationUnit) => {
|
|
98
|
+
return convertToCompositeAnimation({
|
|
99
|
+
...DEFAULT_ANIMATION_CONFIG,
|
|
100
|
+
...animationUnit,
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
Animated.parallel(convertedAnimation).start(({ finished }) => {
|
|
105
|
+
if (finished) {
|
|
106
|
+
onEntered?.();
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
onExit?.();
|
|
112
|
+
|
|
113
|
+
if (R.isNil(closeAnimation)) {
|
|
114
|
+
opacity.setValue(1);
|
|
115
|
+
|
|
116
|
+
Animated.timing(translateY, {
|
|
117
|
+
...DEFAULT_ANIMATION_CONFIG,
|
|
118
|
+
easing: Easing.in(Easing.ease),
|
|
119
|
+
toValue: screenHeight,
|
|
120
|
+
}).start(({ finished }) => {
|
|
121
|
+
if (finished) {
|
|
122
|
+
onExited?.();
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
} else {
|
|
126
|
+
const convertedAnimation = closeAnimation.map((animationUnit) => {
|
|
127
|
+
return convertToCompositeAnimation({
|
|
128
|
+
...DEFAULT_ANIMATION_CONFIG,
|
|
129
|
+
...animationUnit,
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
Animated.parallel(convertedAnimation).start(({ finished }) => {
|
|
134
|
+
if (finished) {
|
|
135
|
+
onExited?.();
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}, [convertToCompositeAnimation, visible]);
|
|
141
|
+
|
|
142
|
+
useEffect(() => {
|
|
143
|
+
if (visible && offsetAnimation && offsetAnimation.length > 0) {
|
|
144
|
+
opacity.setValue(1);
|
|
145
|
+
const convertedAnimation = offsetAnimation.map((animationUnit) => {
|
|
146
|
+
return convertToCompositeAnimation({
|
|
147
|
+
...DEFAULT_ANIMATION_CONFIG,
|
|
148
|
+
...animationUnit
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
Animated.parallel(convertedAnimation).start();
|
|
152
|
+
}
|
|
153
|
+
}, [visible, offsetAnimation, convertToCompositeAnimation]);
|
|
154
|
+
|
|
155
|
+
const animatedStyle = {
|
|
156
|
+
opacity,
|
|
157
|
+
transform: [{ translateY }],
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<Animated.View
|
|
162
|
+
needsOffscreenAlphaCompositing={true}
|
|
163
|
+
pointerEvents={'box-none'}
|
|
164
|
+
style={[
|
|
165
|
+
animatedStyle,
|
|
166
|
+
style,
|
|
167
|
+
]}
|
|
168
|
+
>
|
|
169
|
+
{children}
|
|
170
|
+
</Animated.View>
|
|
171
|
+
);
|
|
172
|
+
}
|
package/src/Modal/Modal.tsx
CHANGED
|
@@ -2,9 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { css, StyleSheet } from '../styles';
|
|
4
4
|
import { useElevationStyle } from '../hooks';
|
|
5
|
-
import Slide from '../Slide';
|
|
6
|
-
import SimpleBackdrop from './SimpleBackdrop';
|
|
7
5
|
import type ModalProps from './ModalProps';
|
|
6
|
+
import AnimatedContainer from './AnimatedContainer';
|
|
7
|
+
import SimpleBackdrop from './SimpleBackdrop';
|
|
8
8
|
|
|
9
9
|
export type ModalCloseReasonType = 'OUTSIDE_PRESS' | 'HARDWARE_BACK_PRESS' | 'CLOSE_BUTTON_PRESS' | 'UNKNOWN';
|
|
10
10
|
|
|
@@ -25,9 +25,18 @@ export default function Modal(props: ModalProps) {
|
|
|
25
25
|
animationStyle,
|
|
26
26
|
backdropOpacity = 0.5,
|
|
27
27
|
children,
|
|
28
|
+
closeAnimation,
|
|
28
29
|
disableAnimation = false,
|
|
29
30
|
hideBackdrop = false,
|
|
31
|
+
initialOpacity,
|
|
32
|
+
initialTranslateY,
|
|
30
33
|
onClose,
|
|
34
|
+
onEnter: onEnterProp,
|
|
35
|
+
onEntered: onEnteredProp,
|
|
36
|
+
onExit: onExitProp,
|
|
37
|
+
onExited: onExitedProp,
|
|
38
|
+
openAnimation,
|
|
39
|
+
offsetAnimation,
|
|
31
40
|
style,
|
|
32
41
|
visible,
|
|
33
42
|
...otherProps
|
|
@@ -43,6 +52,24 @@ export default function Modal(props: ModalProps) {
|
|
|
43
52
|
|
|
44
53
|
const elevationStyle = useElevationStyle(6);
|
|
45
54
|
|
|
55
|
+
const onEnter = () => {
|
|
56
|
+
setExited(false);
|
|
57
|
+
onEnterProp?.();
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const onEntered = () => {
|
|
61
|
+
onEnteredProp?.();
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const onExit = () => {
|
|
65
|
+
onExitProp?.();
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const onExited = () => {
|
|
69
|
+
setExited(true);
|
|
70
|
+
onExitedProp?.();
|
|
71
|
+
};
|
|
72
|
+
|
|
46
73
|
if (!visible) {
|
|
47
74
|
if (disableAnimation || exited) {
|
|
48
75
|
return null;
|
|
@@ -58,23 +85,28 @@ export default function Modal(props: ModalProps) {
|
|
|
58
85
|
])}
|
|
59
86
|
{...otherProps}
|
|
60
87
|
>
|
|
61
|
-
{(hideBackdrop
|
|
88
|
+
{(!hideBackdrop && visible) ? (
|
|
62
89
|
<SimpleBackdrop
|
|
63
90
|
onPress={handleBackdropPress}
|
|
64
91
|
opacity={backdropOpacity}
|
|
65
92
|
/>
|
|
66
|
-
)}
|
|
93
|
+
) : null}
|
|
67
94
|
|
|
68
95
|
{!disableAnimation ? (
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
96
|
+
<AnimatedContainer
|
|
97
|
+
children={children}
|
|
98
|
+
closeAnimation={closeAnimation}
|
|
99
|
+
initialOpacity={initialOpacity}
|
|
100
|
+
initialTranslateY={initialTranslateY}
|
|
101
|
+
onEnter={onEnter}
|
|
102
|
+
onEntered={onEntered}
|
|
103
|
+
onExit={onExit}
|
|
104
|
+
onExited={onExited}
|
|
105
|
+
openAnimation={openAnimation}
|
|
106
|
+
offsetAnimation={offsetAnimation}
|
|
74
107
|
style={animationStyle}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
</Slide>
|
|
108
|
+
visible={visible}
|
|
109
|
+
/>
|
|
78
110
|
) : children}
|
|
79
111
|
</View>
|
|
80
112
|
);
|
package/src/Modal/ModalProps.ts
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
|
+
import { Animated } from 'react-native';
|
|
3
4
|
import type { ComponentProps, OverridableComponentProps } from '../types';
|
|
4
5
|
import { ModalCloseEvent } from './Modal';
|
|
5
6
|
|
|
7
|
+
export const enum ANIMATION_TYPE {
|
|
8
|
+
SLIDE = 'slide',
|
|
9
|
+
FADE = 'fade',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type AnimationUnit = Omit<Animated.TimingAnimationConfig, 'useNativeDriver'> & {
|
|
13
|
+
/**
|
|
14
|
+
* Type of animation used when the dialog opens and closes.
|
|
15
|
+
*/
|
|
16
|
+
type: ANIMATION_TYPE;
|
|
17
|
+
}
|
|
18
|
+
|
|
6
19
|
export default interface ModalProps extends OverridableComponentProps<ViewProps, {
|
|
7
20
|
/**
|
|
8
21
|
* Style object provided to animation component.
|
|
@@ -26,16 +39,61 @@ export default interface ModalProps extends OverridableComponentProps<ViewProps,
|
|
|
26
39
|
*/
|
|
27
40
|
disableAnimation?: boolean;
|
|
28
41
|
|
|
42
|
+
/**
|
|
43
|
+
* Animation used when the modal closes.
|
|
44
|
+
*/
|
|
45
|
+
closeAnimation?: AnimationUnit[] | undefined;
|
|
46
|
+
|
|
29
47
|
/**
|
|
30
48
|
* If `true`, the backdrop is not rendered.
|
|
31
49
|
* @default false
|
|
32
50
|
*/
|
|
33
51
|
hideBackdrop?: boolean;
|
|
34
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Set the initial value of opacity for animating.
|
|
55
|
+
*/
|
|
56
|
+
initialOpacity?: number | undefined;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Set the initial value of transition y for animating.
|
|
60
|
+
*/
|
|
61
|
+
initialTranslateY?: number | undefined;
|
|
62
|
+
|
|
35
63
|
/**
|
|
36
64
|
* Callback fired when the component requests to be closed.
|
|
37
65
|
*/
|
|
38
|
-
onClose?: (event?: ModalCloseEvent) => void
|
|
66
|
+
onClose?: (event?: ModalCloseEvent) => void;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Callback fired when the enter animation will start.
|
|
70
|
+
*/
|
|
71
|
+
onEnter?: () => void | undefined;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Callback fired when the enter animation is completed.
|
|
75
|
+
*/
|
|
76
|
+
onEntered?: () => void | undefined;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Callback fired when the exit animation will start.
|
|
80
|
+
*/
|
|
81
|
+
onExit?: () => void | undefined;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Callback fired when the exit animation is completed.
|
|
85
|
+
*/
|
|
86
|
+
onExited?: () => void | undefined;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Animation used when the modal opens.
|
|
90
|
+
*/
|
|
91
|
+
openAnimation?: AnimationUnit[] | undefined;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Additional offset animation applied when the modal opens.
|
|
95
|
+
*/
|
|
96
|
+
offsetAnimation?: AnimationUnit[] | undefined;
|
|
39
97
|
|
|
40
98
|
/**
|
|
41
99
|
* If `true`, the modal is visible.
|
package/src/Modal/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { default, createModalCloseEvent } from './Modal';
|
|
2
2
|
export type { ModalCloseEvent } from './Modal';
|
|
3
|
-
export type { default as ModalProps } from './ModalProps';
|
|
3
|
+
export type { default as ModalProps, AnimationUnit } from './ModalProps';
|
|
4
|
+
export { ANIMATION_TYPE } from './ModalProps';
|
package/src/Paper/Paper.tsx
CHANGED
|
@@ -23,7 +23,7 @@ const Paper = React.forwardRef<View, PaperProps>(function Paper(props, ref) {
|
|
|
23
23
|
const rootStyle = { backgroundColor };
|
|
24
24
|
|
|
25
25
|
const roundedStyle = {
|
|
26
|
-
borderRadius: theme.shape.
|
|
26
|
+
borderRadius: theme.shape.roundnessLarge,
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
const elevationStyle = useElevationStyle(elevation);
|
package/src/Radio/Radio.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
3
3
|
import ButtonBase from '../ButtonBase';
|
|
4
4
|
import { Radio as RadioIcon, RadioChecked as RadioCheckedIcon } from '../internal';
|
|
5
|
-
import { css
|
|
5
|
+
import { css } from '../styles';
|
|
6
6
|
import { RadioContext } from '../RadioGroup/RadioContextProvider';
|
|
7
7
|
import type RadioProps from './RadioProps';
|
|
8
8
|
|
|
@@ -23,7 +23,10 @@ export default function Radio(props: RadioProps) {
|
|
|
23
23
|
const {
|
|
24
24
|
checked = false,
|
|
25
25
|
children,
|
|
26
|
+
checkedIcon: checkIconProp,
|
|
27
|
+
uncheckedIcon: uncheckedIconProp,
|
|
26
28
|
disabled = false,
|
|
29
|
+
iconPlacement = 'left',
|
|
27
30
|
onChange: onChangeProp,
|
|
28
31
|
style,
|
|
29
32
|
value,
|
|
@@ -32,8 +35,6 @@ export default function Radio(props: RadioProps) {
|
|
|
32
35
|
|
|
33
36
|
const styles = useStyles();
|
|
34
37
|
|
|
35
|
-
const theme = useTheme();
|
|
36
|
-
|
|
37
38
|
const context = React.useContext(RadioContext);
|
|
38
39
|
|
|
39
40
|
const handlePress = () => {
|
|
@@ -45,9 +46,9 @@ export default function Radio(props: RadioProps) {
|
|
|
45
46
|
|
|
46
47
|
const isChecked = context?.value === value ?? checked;
|
|
47
48
|
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
const checkedIcon = checkIconProp ?? <RadioCheckedIcon width={ICON_SIZE} height={ICON_SIZE} color={'primary'}/>;
|
|
50
|
+
const uncheckedIcon = uncheckedIconProp ?? <RadioIcon width={ICON_SIZE} height={ICON_SIZE} color={'tertiary'}/>;
|
|
51
|
+
const icon = isChecked ? checkedIcon : uncheckedIcon;
|
|
51
52
|
|
|
52
53
|
const rootStyle = css([
|
|
53
54
|
styles.root,
|
|
@@ -61,9 +62,11 @@ export default function Radio(props: RadioProps) {
|
|
|
61
62
|
style={rootStyle}
|
|
62
63
|
{...otherProps}
|
|
63
64
|
>
|
|
64
|
-
{icon}
|
|
65
|
+
{iconPlacement === 'left' ? icon : null}
|
|
65
66
|
|
|
66
67
|
{children ? children : null}
|
|
68
|
+
|
|
69
|
+
{iconPlacement === 'right' ? icon : null}
|
|
67
70
|
</ButtonBase>
|
|
68
71
|
);
|
|
69
72
|
};
|
package/src/Radio/RadioProps.ts
CHANGED
|
@@ -31,4 +31,20 @@ export default interface RadioProps extends OverridableComponentProps<BaseProps,
|
|
|
31
31
|
* Value of the component.
|
|
32
32
|
*/
|
|
33
33
|
value: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Determines the placement of the icon relative to the children.
|
|
37
|
+
* @default 'left'
|
|
38
|
+
*/
|
|
39
|
+
iconPlacement?: 'right' | 'left';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Custom icon element to display when the radio is unchecked.
|
|
43
|
+
*/
|
|
44
|
+
uncheckedIcon?: React.ReactNode;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Custom icon element to display when the radio is checked.
|
|
48
|
+
*/
|
|
49
|
+
checkedIcon?: React.ReactNode;
|
|
34
50
|
}> {}
|
package/src/Slide/Slide.tsx
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Animated, Dimensions, Easing, Platform } from 'react-native';
|
|
3
|
+
import { useAnimatedValue } from '../hooks';
|
|
4
|
+
import { isNotAndroid12 } from '../utils';
|
|
5
|
+
|
|
5
6
|
import type SlideProps from './SlideProps';
|
|
6
7
|
|
|
7
8
|
const defaultEnterDuration = 300;
|
|
8
9
|
const defaultExitDuration = 300;
|
|
9
10
|
|
|
11
|
+
const getDisappearingOffsetY = (): number => Dimensions.get('window').height;
|
|
12
|
+
|
|
10
13
|
export default function Slide(props: SlideProps) {
|
|
11
14
|
const {
|
|
12
15
|
animatedY: animatedYProp,
|
|
@@ -21,40 +24,42 @@ export default function Slide(props: SlideProps) {
|
|
|
21
24
|
...otherProps
|
|
22
25
|
} = props;
|
|
23
26
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const y = useSharedValue(window.height);
|
|
27
|
+
const y = useAnimatedValue(getDisappearingOffsetY());
|
|
27
28
|
const animatedY = animatedYProp || y;
|
|
28
29
|
|
|
29
|
-
const animatedStyle =
|
|
30
|
-
transform: [{ translateY: animatedY
|
|
31
|
-
}
|
|
30
|
+
const animatedStyle = {
|
|
31
|
+
transform: [{ translateY: animatedY }],
|
|
32
|
+
};
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
useEffect(() => {
|
|
34
35
|
if (appear) {
|
|
35
|
-
const enterConfig: WithTimingConfig = {
|
|
36
|
-
duration: enterDuration,
|
|
37
|
-
easing: Easing.out(Easing.exp),
|
|
38
|
-
};
|
|
39
|
-
|
|
40
36
|
onEnter?.();
|
|
41
37
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
const toValue = 0;
|
|
39
|
+
Animated.timing(animatedY, {
|
|
40
|
+
toValue,
|
|
41
|
+
duration: enterDuration,
|
|
42
|
+
easing: Platform.OS === 'web'
|
|
43
|
+
? Easing.bezier(0.16, 1, 0.3, 1)
|
|
44
|
+
: Easing.out(Easing.exp),
|
|
45
|
+
useNativeDriver: isNotAndroid12,
|
|
46
|
+
}).start(({ finished }) => {
|
|
47
|
+
if (finished && onEntered) {
|
|
48
|
+
onEntered();
|
|
45
49
|
}
|
|
46
50
|
});
|
|
47
51
|
} else {
|
|
48
|
-
const exitConfig: WithTimingConfig = {
|
|
49
|
-
duration: exitDuration,
|
|
50
|
-
easing: Easing.in(Easing.ease),
|
|
51
|
-
};
|
|
52
|
-
|
|
53
52
|
onExit?.();
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
const toValue = getDisappearingOffsetY();
|
|
55
|
+
Animated.timing(animatedY, {
|
|
56
|
+
toValue,
|
|
57
|
+
duration: exitDuration,
|
|
58
|
+
easing: Easing.in(Easing.ease),
|
|
59
|
+
useNativeDriver: isNotAndroid12,
|
|
60
|
+
}).start(({ finished }) => {
|
|
61
|
+
if (finished && onExited) {
|
|
62
|
+
onExited();
|
|
58
63
|
}
|
|
59
64
|
});
|
|
60
65
|
}
|
|
@@ -62,6 +67,7 @@ export default function Slide(props: SlideProps) {
|
|
|
62
67
|
|
|
63
68
|
return (
|
|
64
69
|
<Animated.View
|
|
70
|
+
pointerEvents={'box-none'}
|
|
65
71
|
style={[
|
|
66
72
|
animatedStyle,
|
|
67
73
|
style,
|
package/src/Slide/SlideProps.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ViewProps } from 'react-native';
|
|
3
|
-
import Animated from 'react-native-reanimated';
|
|
2
|
+
import type { Animated, ViewProps } from 'react-native';
|
|
4
3
|
import type { OverridableComponentProps } from '../types';
|
|
5
4
|
|
|
6
5
|
export default interface SlideProps extends OverridableComponentProps<ViewProps, {
|
|
7
6
|
/**
|
|
8
7
|
* y value for animating.
|
|
9
8
|
*/
|
|
10
|
-
animatedY?: Animated.
|
|
9
|
+
animatedY?: Animated.Value;
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* If `true`, the component will transition in.
|