@fountain-ui/core 2.0.0-beta.9 → 2.0.0-beta.91
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 +18 -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 +35 -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 +2 -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 +3 -1
- 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 +4 -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 +4 -2
- 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 +4 -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 +6 -2
- 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
package/src/Dialog/Dialog.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { useWindowDimensions } from 'react-native';
|
|
3
|
-
import { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
4
|
-
import
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import { LayoutChangeEvent, useWindowDimensions } from 'react-native';
|
|
3
|
+
import { css, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
4
|
+
import Column from '../Column';
|
|
5
|
+
import Modal, { ANIMATION_TYPE, AnimationUnit } from '../Modal';
|
|
5
6
|
import Paper from '../Paper';
|
|
6
7
|
import { useTheme } from '../styles';
|
|
7
8
|
import type DialogProps from './DialogProps';
|
|
@@ -11,16 +12,23 @@ type DialogStyleKeys =
|
|
|
11
12
|
| 'paper'
|
|
12
13
|
| 'paperFullScreen'
|
|
13
14
|
| 'animation'
|
|
14
|
-
| 'animationFullScreen'
|
|
15
|
+
| 'animationFullScreen'
|
|
16
|
+
| 'topElementSize'
|
|
17
|
+
| 'topElementPosition';
|
|
15
18
|
|
|
16
19
|
type DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;
|
|
17
20
|
|
|
21
|
+
const DIALOG_MAX_WIDTH = 328;
|
|
22
|
+
|
|
23
|
+
const TOP_ELEMENT_OFFSET = 20;
|
|
24
|
+
|
|
18
25
|
const useStyles: UseStyles<DialogStyles> = function (): DialogStyles {
|
|
19
26
|
const theme = useTheme();
|
|
20
27
|
|
|
21
28
|
const { width } = useWindowDimensions();
|
|
22
29
|
|
|
23
30
|
const margin = theme.spacing(4);
|
|
31
|
+
const dialogWidth = width - margin * 2;
|
|
24
32
|
|
|
25
33
|
return {
|
|
26
34
|
root: {
|
|
@@ -29,10 +37,11 @@ const useStyles: UseStyles<DialogStyles> = function (): DialogStyles {
|
|
|
29
37
|
zIndex: theme.zIndex.dialog,
|
|
30
38
|
},
|
|
31
39
|
paper: {
|
|
40
|
+
borderRadius: theme.shape.roundnessExtra,
|
|
32
41
|
margin,
|
|
33
|
-
maxWidth:
|
|
42
|
+
maxWidth: DIALOG_MAX_WIDTH,
|
|
34
43
|
overflow: 'hidden',
|
|
35
|
-
width:
|
|
44
|
+
width: dialogWidth,
|
|
36
45
|
},
|
|
37
46
|
paperFullScreen: {
|
|
38
47
|
flexGrow: 1,
|
|
@@ -42,35 +51,148 @@ const useStyles: UseStyles<DialogStyles> = function (): DialogStyles {
|
|
|
42
51
|
width: '100%',
|
|
43
52
|
height: '100%',
|
|
44
53
|
},
|
|
54
|
+
topElementSize: {
|
|
55
|
+
marginHorizontal: margin,
|
|
56
|
+
maxWidth: DIALOG_MAX_WIDTH,
|
|
57
|
+
width: dialogWidth,
|
|
58
|
+
},
|
|
59
|
+
topElementPosition: {
|
|
60
|
+
position: 'absolute',
|
|
61
|
+
bottom: -1 * theme.spacing(4),
|
|
62
|
+
width: '100%',
|
|
63
|
+
},
|
|
45
64
|
};
|
|
46
65
|
};
|
|
47
66
|
|
|
48
67
|
export default function Dialog(props: DialogProps) {
|
|
49
68
|
const {
|
|
69
|
+
animationType = ANIMATION_TYPE.SLIDE,
|
|
50
70
|
children,
|
|
51
71
|
fullScreen = false,
|
|
72
|
+
hideBackdrop,
|
|
52
73
|
onClose,
|
|
74
|
+
style = {},
|
|
53
75
|
visible,
|
|
76
|
+
topElement,
|
|
54
77
|
...otherProps
|
|
55
78
|
} = props;
|
|
56
79
|
|
|
57
80
|
const styles = useStyles();
|
|
58
81
|
|
|
82
|
+
const { height: screenHeight } = useWindowDimensions();
|
|
83
|
+
|
|
84
|
+
const [topElementHeight, setTopElementHeight] = useState(0);
|
|
85
|
+
const handleTopElementLayout = (event: LayoutChangeEvent) => {
|
|
86
|
+
const { height } = event.nativeEvent.layout;
|
|
87
|
+
setTopElementHeight(height);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const offsetAnimation = useMemo<AnimationUnit[]>(() => {
|
|
91
|
+
if (topElementHeight === 0) {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return [{
|
|
96
|
+
toValue: (topElementHeight - TOP_ELEMENT_OFFSET) / 2,
|
|
97
|
+
type: ANIMATION_TYPE.SLIDE,
|
|
98
|
+
}]
|
|
99
|
+
}, [topElementHeight]);
|
|
100
|
+
|
|
101
|
+
const closeAnimation = useMemo<AnimationUnit[]>(() => {
|
|
102
|
+
if (animationType === ANIMATION_TYPE.FADE) {
|
|
103
|
+
return [{
|
|
104
|
+
toValue: 0,
|
|
105
|
+
type: ANIMATION_TYPE.FADE,
|
|
106
|
+
}];
|
|
107
|
+
} else if (animationType === ANIMATION_TYPE.SLIDE && !fullScreen) {
|
|
108
|
+
return [
|
|
109
|
+
{
|
|
110
|
+
toValue: screenHeight,
|
|
111
|
+
type: ANIMATION_TYPE.SLIDE,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
duration: 150,
|
|
115
|
+
toValue: 0,
|
|
116
|
+
type: ANIMATION_TYPE.FADE,
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return [{
|
|
122
|
+
duration: 150,
|
|
123
|
+
toValue: screenHeight,
|
|
124
|
+
type: ANIMATION_TYPE.SLIDE,
|
|
125
|
+
}];
|
|
126
|
+
}, [animationType, fullScreen, screenHeight]);
|
|
127
|
+
|
|
128
|
+
const openAnimation = useMemo<AnimationUnit[]>(() => {
|
|
129
|
+
if (animationType === ANIMATION_TYPE.FADE) {
|
|
130
|
+
return [{
|
|
131
|
+
toValue: 1,
|
|
132
|
+
type: ANIMATION_TYPE.FADE,
|
|
133
|
+
}];
|
|
134
|
+
} else if (animationType === ANIMATION_TYPE.SLIDE && !fullScreen) {
|
|
135
|
+
return [
|
|
136
|
+
{
|
|
137
|
+
toValue: 0,
|
|
138
|
+
type: ANIMATION_TYPE.SLIDE,
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
delay: 50,
|
|
142
|
+
duration: 150,
|
|
143
|
+
toValue: 1,
|
|
144
|
+
type: ANIMATION_TYPE.FADE,
|
|
145
|
+
},
|
|
146
|
+
];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return [{
|
|
150
|
+
toValue: 0,
|
|
151
|
+
type: ANIMATION_TYPE.SLIDE,
|
|
152
|
+
}];
|
|
153
|
+
}, [animationType, fullScreen]);
|
|
154
|
+
|
|
155
|
+
const initialOpacity = animationType === ANIMATION_TYPE.SLIDE && fullScreen ? 1 : undefined;
|
|
156
|
+
|
|
157
|
+
const initialTranslateY = animationType === ANIMATION_TYPE.FADE ? 0 : undefined;
|
|
158
|
+
|
|
59
159
|
return (
|
|
60
160
|
<Modal
|
|
61
161
|
animationStyle={fullScreen ? styles.animationFullScreen : styles.animation}
|
|
162
|
+
closeAnimation={closeAnimation}
|
|
163
|
+
hideBackdrop={hideBackdrop || animationType === ANIMATION_TYPE.FADE}
|
|
164
|
+
initialOpacity={initialOpacity}
|
|
165
|
+
initialTranslateY={initialTranslateY}
|
|
62
166
|
onClose={onClose}
|
|
167
|
+
openAnimation={openAnimation}
|
|
168
|
+
offsetAnimation={offsetAnimation}
|
|
63
169
|
visible={visible}
|
|
64
170
|
style={styles.root}
|
|
65
171
|
{...otherProps}
|
|
66
172
|
>
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
173
|
+
<React.Fragment>
|
|
174
|
+
{topElement ? (
|
|
175
|
+
<Column style={fullScreen ? undefined : styles.topElementSize}>
|
|
176
|
+
<Column
|
|
177
|
+
style={styles.topElementPosition}
|
|
178
|
+
onLayout={handleTopElementLayout}
|
|
179
|
+
>
|
|
180
|
+
{topElement}
|
|
181
|
+
</Column>
|
|
182
|
+
</Column>
|
|
183
|
+
) : null}
|
|
184
|
+
|
|
185
|
+
<Paper
|
|
186
|
+
elevation={6}
|
|
187
|
+
square={fullScreen}
|
|
188
|
+
style={css([
|
|
189
|
+
fullScreen ? styles.paperFullScreen : styles.paper,
|
|
190
|
+
style,
|
|
191
|
+
])}
|
|
192
|
+
>
|
|
193
|
+
{children}
|
|
194
|
+
</Paper>
|
|
195
|
+
</React.Fragment>
|
|
74
196
|
</Modal>
|
|
75
197
|
);
|
|
76
198
|
};
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ModalProps } from '../Modal';
|
|
3
3
|
import type { OverridableComponentProps } from '../types';
|
|
4
|
+
import { ANIMATION_TYPE } from '../Modal';
|
|
4
5
|
|
|
5
6
|
export default interface DialogProps extends OverridableComponentProps<ModalProps, {
|
|
7
|
+
/**
|
|
8
|
+
* Type of animation used when the dialog opens and closes.
|
|
9
|
+
* @default 'slide'
|
|
10
|
+
*/
|
|
11
|
+
animationType?: ANIMATION_TYPE;
|
|
12
|
+
|
|
6
13
|
/**
|
|
7
14
|
* Dialog children, usually the included sub-components.
|
|
8
15
|
*/
|
|
@@ -13,4 +20,9 @@ export default interface DialogProps extends OverridableComponentProps<ModalProp
|
|
|
13
20
|
* @default false
|
|
14
21
|
*/
|
|
15
22
|
fullScreen?: boolean;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Top element for displaying additional information on the dialog.
|
|
26
|
+
*/
|
|
27
|
+
topElement?: React.ReactNode;
|
|
16
28
|
}> {}
|
package/src/Divider/Divider.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
3
|
import { createFontStyle, css, StyleSheet, useTheme } from '../styles';
|
|
4
|
+
import { ExtendedStyle } from '../types';
|
|
4
5
|
import type DividerProps from './DividerProps';
|
|
5
6
|
|
|
6
7
|
const styles = StyleSheet.create({
|
|
@@ -17,27 +18,29 @@ const styles = StyleSheet.create({
|
|
|
17
18
|
divider: {
|
|
18
19
|
flexGrow: 1,
|
|
19
20
|
},
|
|
20
|
-
borderBottom: {
|
|
21
|
-
borderBottomWidth: 1,
|
|
22
|
-
},
|
|
23
|
-
borderRight: {
|
|
24
|
-
borderRightWidth: 1,
|
|
25
|
-
},
|
|
26
21
|
});
|
|
27
22
|
|
|
28
23
|
export default function Divider(props: DividerProps) {
|
|
29
24
|
const {
|
|
25
|
+
borderWidth = 1,
|
|
30
26
|
children: childrenProp,
|
|
27
|
+
color = 'divider',
|
|
28
|
+
elementAlign = 'center',
|
|
31
29
|
inset = 0,
|
|
32
|
-
|
|
30
|
+
marginBetweenChildren = 2,
|
|
33
31
|
style,
|
|
32
|
+
vertical = false,
|
|
34
33
|
...otherProps
|
|
35
34
|
} = props;
|
|
36
35
|
|
|
37
36
|
const theme = useTheme();
|
|
38
37
|
|
|
39
38
|
const fontColor = theme.palette.text.secondary;
|
|
40
|
-
const borderColor =
|
|
39
|
+
const borderColor = color === 'divider'
|
|
40
|
+
? theme.palette.divider
|
|
41
|
+
: color === 'border'
|
|
42
|
+
? theme.palette.border.default
|
|
43
|
+
: theme.palette[color].main;
|
|
41
44
|
const marginSize = theme.spacing(1);
|
|
42
45
|
const insetSize = theme.spacing(inset);
|
|
43
46
|
|
|
@@ -55,7 +58,7 @@ export default function Divider(props: DividerProps) {
|
|
|
55
58
|
: { marginLeft: insetSize, marginRight: insetSize };
|
|
56
59
|
|
|
57
60
|
const borderColorStyle = { borderColor };
|
|
58
|
-
const borderWidthStyle = (vertical ?
|
|
61
|
+
const borderWidthStyle = (vertical ? { borderRightWidth: borderWidth } : { borderBottomWidth: borderWidth });
|
|
59
62
|
|
|
60
63
|
const containerStyle = css([
|
|
61
64
|
insetStyle,
|
|
@@ -73,9 +76,15 @@ export default function Divider(props: DividerProps) {
|
|
|
73
76
|
styles.divider,
|
|
74
77
|
]);
|
|
75
78
|
|
|
76
|
-
const dividerMarginSize = theme.spacing(
|
|
77
|
-
const startDividerStyle
|
|
78
|
-
|
|
79
|
+
const dividerMarginSize = theme.spacing(marginBetweenChildren);
|
|
80
|
+
const startDividerStyle: ExtendedStyle = {
|
|
81
|
+
display: elementAlign !== 'start' ? 'flex' : 'none',
|
|
82
|
+
...(vertical ? { marginBottom: dividerMarginSize } : { marginRight: dividerMarginSize }),
|
|
83
|
+
};
|
|
84
|
+
const endDividerStyle: ExtendedStyle = {
|
|
85
|
+
display: elementAlign !== 'end' ? 'flex' : 'none',
|
|
86
|
+
...(vertical ? { marginTop: dividerMarginSize } : { marginLeft: dividerMarginSize }),
|
|
87
|
+
};
|
|
79
88
|
|
|
80
89
|
const fontStyle = createFontStyle(theme, {
|
|
81
90
|
selector: (typo) => typo.caption2,
|
|
@@ -87,11 +96,11 @@ export default function Divider(props: DividerProps) {
|
|
|
87
96
|
: childrenProp;
|
|
88
97
|
|
|
89
98
|
const children = childrenProp ? (
|
|
90
|
-
|
|
99
|
+
<React.Fragment>
|
|
91
100
|
<View style={css([dividerStyle, startDividerStyle])}/>
|
|
92
101
|
{element}
|
|
93
102
|
<View style={css([dividerStyle, endDividerStyle])}/>
|
|
94
|
-
|
|
103
|
+
</React.Fragment>
|
|
95
104
|
) : null;
|
|
96
105
|
|
|
97
106
|
return (
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
|
-
import type { OverridableComponentProps } from '../types';
|
|
3
|
+
import type { CommonComponentColor, OverridableComponentProps } from '../types';
|
|
4
|
+
|
|
5
|
+
export type DividerColor = 'divider' | 'border' | CommonComponentColor;
|
|
4
6
|
|
|
5
7
|
export default interface DividerProps extends OverridableComponentProps<ViewProps, {
|
|
6
8
|
/**
|
|
@@ -19,4 +21,28 @@ export default interface DividerProps extends OverridableComponentProps<ViewProp
|
|
|
19
21
|
* @default false
|
|
20
22
|
*/
|
|
21
23
|
vertical?: boolean;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The color of divider. It supports default divider color and those theme colors that make sense for this component.
|
|
27
|
+
* @default 'divider'
|
|
28
|
+
*/
|
|
29
|
+
color?: DividerColor;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The size of margin between child element and the divider. It works as a multiplier factor based on spacing system.
|
|
33
|
+
* @default 2
|
|
34
|
+
*/
|
|
35
|
+
marginBetweenChildren?: number;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The size of border width. It works as an actual pixel-based border width value of a divider.
|
|
39
|
+
* @default 1
|
|
40
|
+
*/
|
|
41
|
+
borderWidth?: number;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Set position of children.
|
|
45
|
+
* @default center
|
|
46
|
+
*/
|
|
47
|
+
elementAlign?: 'start' | 'center' | 'end';
|
|
22
48
|
}> {}
|
package/src/Image/Image.tsx
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import { Text, View } from 'react-native';
|
|
3
3
|
import type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
4
|
+
import type { ImageCoreProps } from '../ImageCore';
|
|
4
5
|
import ImageCore from '../ImageCore';
|
|
5
6
|
import { css, StyleSheet, useTheme } from '../styles';
|
|
6
7
|
import type ImageProps from './ImageProps';
|
|
7
8
|
|
|
9
|
+
type PlaceholderMode =
|
|
10
|
+
| 'default'
|
|
11
|
+
| 'custom'
|
|
12
|
+
| 'none';
|
|
13
|
+
|
|
8
14
|
type ImageStyleKeys =
|
|
9
15
|
| 'root'
|
|
10
16
|
| 'rounded'
|
|
11
17
|
| 'placeholder'
|
|
12
|
-
| 'outlined'
|
|
18
|
+
| 'outlined'
|
|
19
|
+
| 'error'
|
|
20
|
+
| 'errorText';
|
|
13
21
|
|
|
14
22
|
type ImageStyles = NamedStylesStringUnion<ImageStyleKeys>;
|
|
15
23
|
|
|
@@ -30,62 +38,116 @@ const useStyles: UseStyles<ImageStyles> = function (): ImageStyles {
|
|
|
30
38
|
borderStyle: 'solid',
|
|
31
39
|
borderColor: theme.palette.paper.grey,
|
|
32
40
|
},
|
|
41
|
+
error: {
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
height: '100%',
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
width: '100%',
|
|
46
|
+
},
|
|
47
|
+
errorText: {
|
|
48
|
+
color: theme.palette.text.primary,
|
|
49
|
+
fontFamily: 'Inter-Medium',
|
|
50
|
+
fontSize: 12,
|
|
51
|
+
letterSpacing: 0,
|
|
52
|
+
lineHeight: 18,
|
|
53
|
+
textAlign: 'center',
|
|
54
|
+
},
|
|
33
55
|
};
|
|
34
56
|
};
|
|
35
57
|
|
|
58
|
+
function determinePlaceholderMode(props: ImageProps): PlaceholderMode {
|
|
59
|
+
if (props.disablePlaceholder) {
|
|
60
|
+
return 'none';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return props.placeholder ? 'custom' : 'default';
|
|
64
|
+
}
|
|
65
|
+
|
|
36
66
|
export default function Image(props: ImageProps) {
|
|
37
67
|
const {
|
|
38
68
|
alt,
|
|
69
|
+
cache = 'immutable',
|
|
70
|
+
disableDrag,
|
|
71
|
+
disableLongClick,
|
|
39
72
|
disableOutline,
|
|
40
73
|
disablePlaceholder,
|
|
74
|
+
error,
|
|
41
75
|
loading = 'lazy',
|
|
76
|
+
onError: onErrorProp,
|
|
77
|
+
onLoad: onLoadProp,
|
|
42
78
|
overlaidChildren,
|
|
79
|
+
placeholder,
|
|
43
80
|
resizeMode = 'cover',
|
|
44
81
|
source,
|
|
45
82
|
style,
|
|
46
83
|
square = false,
|
|
47
|
-
onLoad,
|
|
48
|
-
onError,
|
|
49
84
|
...otherProps
|
|
50
85
|
} = props;
|
|
51
86
|
|
|
52
|
-
const [failed, setFailed] =
|
|
87
|
+
const [failed, setFailed] = useState(false);
|
|
53
88
|
|
|
54
89
|
const styles = useStyles();
|
|
55
90
|
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
91
|
+
const onLoad: ImageCoreProps['onLoad'] = () => {
|
|
92
|
+
setFailed(false);
|
|
93
|
+
|
|
94
|
+
onLoadProp?.();
|
|
95
|
+
};
|
|
60
96
|
|
|
97
|
+
const onError: ImageCoreProps['onError'] = () => {
|
|
61
98
|
setFailed(true);
|
|
62
|
-
|
|
99
|
+
|
|
100
|
+
onErrorProp?.();
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const placeholderMode = determinePlaceholderMode(props);
|
|
63
104
|
|
|
64
105
|
return (
|
|
65
106
|
<View
|
|
66
107
|
style={css([
|
|
67
108
|
styles.root,
|
|
68
109
|
!disableOutline ? styles.outlined : undefined,
|
|
69
|
-
!disablePlaceholder ? styles.placeholder : undefined,
|
|
70
110
|
!square ? styles.rounded : undefined,
|
|
111
|
+
placeholderMode === 'default' ? styles.placeholder : undefined,
|
|
71
112
|
style,
|
|
72
113
|
])}
|
|
73
114
|
{...otherProps}
|
|
74
115
|
>
|
|
116
|
+
{placeholderMode === 'custom' ? (
|
|
117
|
+
<View
|
|
118
|
+
style={css([
|
|
119
|
+
StyleSheet.absoluteFill,
|
|
120
|
+
{ zIndex: -1 },
|
|
121
|
+
])}
|
|
122
|
+
>
|
|
123
|
+
{placeholder}
|
|
124
|
+
</View>
|
|
125
|
+
) : null}
|
|
126
|
+
|
|
75
127
|
{failed ? (
|
|
76
|
-
<
|
|
77
|
-
|
|
128
|
+
<View style={styles.error}>
|
|
129
|
+
{error ?? (
|
|
130
|
+
<Text
|
|
131
|
+
children={alt}
|
|
132
|
+
style={styles.errorText}
|
|
133
|
+
/>
|
|
134
|
+
)}
|
|
135
|
+
</View>
|
|
136
|
+
) : source.uri ? (
|
|
78
137
|
<ImageCore
|
|
79
138
|
alt={alt}
|
|
139
|
+
cache={cache}
|
|
140
|
+
disableDrag={disableDrag}
|
|
141
|
+
disableLongClick={disableLongClick}
|
|
80
142
|
height={'100%'}
|
|
81
143
|
loading={loading}
|
|
82
|
-
onError={
|
|
144
|
+
onError={onError}
|
|
83
145
|
onLoad={onLoad}
|
|
84
146
|
resizeMode={resizeMode}
|
|
85
147
|
source={source}
|
|
86
148
|
width={'100%'}
|
|
87
149
|
/>
|
|
88
|
-
)}
|
|
150
|
+
) : null}
|
|
89
151
|
|
|
90
152
|
{overlaidChildren ? (
|
|
91
153
|
<View style={StyleSheet.absoluteFill}>
|
|
@@ -94,4 +156,4 @@ export default function Image(props: ImageProps) {
|
|
|
94
156
|
) : null}
|
|
95
157
|
</View>
|
|
96
158
|
);
|
|
97
|
-
};
|
|
159
|
+
};
|
package/src/Image/ImageProps.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ViewProps } from 'react-native';
|
|
3
3
|
import type { OverridableComponentProps } from '../types';
|
|
4
|
-
import type { ImageSource, Loading, ResizeMode } from '../ImageCore';
|
|
4
|
+
import type { ImageSource, Loading, ResizeMode, CacheControl } from '../ImageCore';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Image file quality.
|
|
8
|
+
* Request image by query string.
|
|
9
|
+
*/
|
|
10
|
+
export type ImageQuality = 'small' | 'medium' | 'large';
|
|
5
11
|
|
|
6
12
|
export default interface ImageProps extends OverridableComponentProps<ViewProps, {
|
|
7
13
|
/**
|
|
@@ -10,6 +16,18 @@ export default interface ImageProps extends OverridableComponentProps<ViewProps,
|
|
|
10
16
|
*/
|
|
11
17
|
alt?: string;
|
|
12
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Disable drag event for web.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
disableDrag?: boolean,
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Disable Long click event for web.
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
disableLongClick?: boolean,
|
|
30
|
+
|
|
13
31
|
/**
|
|
14
32
|
* If `true`, the image outline is not rendered.
|
|
15
33
|
* @default false
|
|
@@ -22,6 +40,11 @@ export default interface ImageProps extends OverridableComponentProps<ViewProps,
|
|
|
22
40
|
*/
|
|
23
41
|
disablePlaceholder?: boolean;
|
|
24
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Custom error element. Default is simple alt text.
|
|
45
|
+
*/
|
|
46
|
+
error?: React.ReactElement | null;
|
|
47
|
+
|
|
25
48
|
/**
|
|
26
49
|
* Web only. Loading the document by determining whether to load
|
|
27
50
|
* the image immediately (`eager`) or on an as-needed basis (`lazy`).
|
|
@@ -43,7 +66,12 @@ export default interface ImageProps extends OverridableComponentProps<ViewProps,
|
|
|
43
66
|
/**
|
|
44
67
|
* The children on top this image.
|
|
45
68
|
*/
|
|
46
|
-
overlaidChildren?: React.
|
|
69
|
+
overlaidChildren?: React.ReactElement;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Custom placeholder element.
|
|
73
|
+
*/
|
|
74
|
+
placeholder?: React.ReactElement;
|
|
47
75
|
|
|
48
76
|
/**
|
|
49
77
|
* Determines how to resize the image when the frame doesn't match the raw image dimensions.
|
|
@@ -61,4 +89,10 @@ export default interface ImageProps extends OverridableComponentProps<ViewProps,
|
|
|
61
89
|
* @default false
|
|
62
90
|
*/
|
|
63
91
|
square?: boolean;
|
|
92
|
+
|
|
93
|
+
/***
|
|
94
|
+
* FastImage cache control value.
|
|
95
|
+
* @default 'immutable'
|
|
96
|
+
*/
|
|
97
|
+
cache?: CacheControl;
|
|
64
98
|
}> {}
|
package/src/Image/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './Image';
|
|
2
|
-
export type { default as ImageProps } from './ImageProps';
|
|
2
|
+
export type { default as ImageProps, ImageQuality } from './ImageProps';
|
|
@@ -1,16 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
1
|
+
import React, { useCallback, useContext } from 'react';
|
|
2
|
+
import { Animated } from 'react-native';
|
|
4
3
|
import FastImage from 'react-native-fast-image';
|
|
4
|
+
import { useAnimatedValue } from '../hooks';
|
|
5
|
+
import { isNotAndroid12 } from '../utils';
|
|
5
6
|
import type ImageCoreProps from './ImageCoreProps';
|
|
7
|
+
import ImageFileExtensionContext from './ImageFileExtensionContext';
|
|
6
8
|
|
|
7
9
|
// @ts-ignore
|
|
8
10
|
const AnimatedFastImage = Animated.createAnimatedComponent(FastImage);
|
|
9
11
|
|
|
10
|
-
const
|
|
12
|
+
const INITIAL_OPACITY = 0;
|
|
13
|
+
const LOADED_OPACITY = 1;
|
|
14
|
+
|
|
15
|
+
const ANIMATION_DURATION = 200;
|
|
11
16
|
|
|
12
17
|
export default function ImageCore(props: ImageCoreProps) {
|
|
13
18
|
const {
|
|
19
|
+
cache,
|
|
14
20
|
height,
|
|
15
21
|
onError,
|
|
16
22
|
onLoad,
|
|
@@ -19,31 +25,35 @@ export default function ImageCore(props: ImageCoreProps) {
|
|
|
19
25
|
width,
|
|
20
26
|
} = props;
|
|
21
27
|
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const opacity = useSharedValue(0);
|
|
28
|
+
const opacity = useAnimatedValue(INITIAL_OPACITY);
|
|
25
29
|
|
|
26
|
-
const
|
|
27
|
-
opacity: opacity.value,
|
|
28
|
-
}));
|
|
30
|
+
const acceptHeader = useContext(ImageFileExtensionContext);
|
|
29
31
|
|
|
30
|
-
const handleLoad = () => {
|
|
31
|
-
|
|
32
|
+
const handleLoad = useCallback(() => {
|
|
33
|
+
Animated.timing(opacity, {
|
|
34
|
+
toValue: LOADED_OPACITY,
|
|
35
|
+
duration: ANIMATION_DURATION,
|
|
36
|
+
useNativeDriver: isNotAndroid12,
|
|
37
|
+
}).start();
|
|
32
38
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
};
|
|
39
|
+
onLoad?.();
|
|
40
|
+
}, [onLoad]);
|
|
37
41
|
|
|
38
42
|
return (
|
|
39
43
|
<AnimatedFastImage
|
|
40
44
|
onError={onError}
|
|
41
45
|
onLoad={handleLoad}
|
|
42
46
|
resizeMode={resizeMode}
|
|
43
|
-
source={{
|
|
47
|
+
source={{
|
|
48
|
+
cache,
|
|
49
|
+
uri: source.uri,
|
|
50
|
+
headers: {
|
|
51
|
+
'Accept': acceptHeader,
|
|
52
|
+
},
|
|
53
|
+
}}
|
|
44
54
|
style={[
|
|
45
|
-
|
|
46
|
-
|
|
55
|
+
{ opacity },
|
|
56
|
+
{ width, height },
|
|
47
57
|
]}
|
|
48
58
|
/>
|
|
49
59
|
);
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
export interface ImageSource {
|
|
2
|
-
uri
|
|
2
|
+
uri?: string;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
export type ResizeMode = 'cover' | 'contain';
|
|
6
6
|
|
|
7
7
|
export type Loading = 'lazy' | 'eager';
|
|
8
8
|
|
|
9
|
+
export type CacheControl = 'immutable' | 'web' | 'cacheOnly';
|
|
10
|
+
|
|
9
11
|
export default interface ImageCoreProps extends Readonly<{
|
|
10
12
|
alt?: string;
|
|
13
|
+
cache?: CacheControl;
|
|
14
|
+
disableDrag?: boolean,
|
|
15
|
+
disableLongClick?: boolean,
|
|
11
16
|
height?: number | string;
|
|
12
17
|
loading: Loading;
|
|
13
18
|
onError?: () => void;
|