@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,14 +1,19 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Animated, Easing } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
-
import {
|
|
4
|
+
import { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
5
5
|
import Slide from '../Slide';
|
|
6
6
|
import SnackbarContent from '../SnackbarContent';
|
|
7
|
+
import { useAnimatedValue } from '../hooks';
|
|
7
8
|
import { useTheme } from '../styles';
|
|
9
|
+
import { isNotAndroid12 } from '../utils';
|
|
8
10
|
import type SnackbarProps from './SnackbarProps';
|
|
9
11
|
|
|
10
12
|
type SnackBarStyles = NamedStylesStringUnion<'root'>;
|
|
11
13
|
|
|
14
|
+
const fadeDuration = 300;
|
|
15
|
+
const fadeAnimationDelay = 100;
|
|
16
|
+
|
|
12
17
|
const useStyles: UseStyles<SnackBarStyles> = function (): SnackBarStyles {
|
|
13
18
|
const theme = useTheme();
|
|
14
19
|
const insets = useSafeAreaInsets();
|
|
@@ -35,6 +40,8 @@ export default function Snackbar(props: SnackbarProps) {
|
|
|
35
40
|
autoHideDuration = null,
|
|
36
41
|
children,
|
|
37
42
|
message,
|
|
43
|
+
title,
|
|
44
|
+
startIcon,
|
|
38
45
|
onActionPress,
|
|
39
46
|
onClose,
|
|
40
47
|
style,
|
|
@@ -73,16 +80,33 @@ export default function Snackbar(props: SnackbarProps) {
|
|
|
73
80
|
|
|
74
81
|
const [exited, setExited] = React.useState(true);
|
|
75
82
|
|
|
83
|
+
const animatedOpacity = useAnimatedValue(0);
|
|
84
|
+
|
|
85
|
+
const animatedStyle = {
|
|
86
|
+
opacity: animatedOpacity,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
Animated.timing(animatedOpacity, {
|
|
91
|
+
toValue: visible ? 1 : 0,
|
|
92
|
+
duration: fadeDuration,
|
|
93
|
+
delay: visible ? fadeAnimationDelay : 0,
|
|
94
|
+
easing: Easing.out(Easing.exp),
|
|
95
|
+
useNativeDriver: isNotAndroid12,
|
|
96
|
+
}).start();
|
|
97
|
+
}, [visible]);
|
|
98
|
+
|
|
76
99
|
if (!visible && exited) {
|
|
77
100
|
return null;
|
|
78
101
|
}
|
|
79
102
|
|
|
80
103
|
return (
|
|
81
|
-
<View
|
|
82
|
-
style={
|
|
104
|
+
<Animated.View
|
|
105
|
+
style={[
|
|
106
|
+
animatedStyle,
|
|
83
107
|
styles.root,
|
|
84
108
|
style,
|
|
85
|
-
]
|
|
109
|
+
]}
|
|
86
110
|
{...otherProps}
|
|
87
111
|
>
|
|
88
112
|
<Slide
|
|
@@ -93,12 +117,14 @@ export default function Snackbar(props: SnackbarProps) {
|
|
|
93
117
|
>
|
|
94
118
|
{children ? children : (
|
|
95
119
|
<SnackbarContent
|
|
120
|
+
title={title}
|
|
121
|
+
startIcon={startIcon}
|
|
96
122
|
actionLabel={actionLabel}
|
|
97
123
|
message={message}
|
|
98
124
|
onActionPress={onActionPress}
|
|
99
125
|
/>
|
|
100
126
|
)}
|
|
101
127
|
</Slide>
|
|
102
|
-
</View>
|
|
128
|
+
</Animated.View>
|
|
103
129
|
);
|
|
104
130
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import Animated from 'react-native
|
|
2
|
+
|
|
3
|
+
import type { Animated, ViewProps } from 'react-native';
|
|
4
4
|
import type { OverridableComponentProps } from '../types';
|
|
5
5
|
|
|
6
6
|
export default interface SnackbarProps extends OverridableComponentProps<ViewProps, {
|
|
7
7
|
/**
|
|
8
8
|
* The text to use for the action component.
|
|
9
9
|
*/
|
|
10
|
-
actionLabel?: string
|
|
10
|
+
actionLabel?: string;
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* y value for animating.
|
|
14
14
|
*/
|
|
15
|
-
animatedY?: Animated.
|
|
15
|
+
animatedY?: Animated.Value;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* The number of milliseconds to wait before automatically calling the
|
|
@@ -21,7 +21,7 @@ export default interface SnackbarProps extends OverridableComponentProps<ViewPro
|
|
|
21
21
|
* the `null` value.
|
|
22
22
|
* @default null
|
|
23
23
|
*/
|
|
24
|
-
autoHideDuration?: number | null
|
|
24
|
+
autoHideDuration?: number | null;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Replace the `SnackbarContent` component.
|
|
@@ -31,21 +31,31 @@ export default interface SnackbarProps extends OverridableComponentProps<ViewPro
|
|
|
31
31
|
/**
|
|
32
32
|
* The message to display.
|
|
33
33
|
*/
|
|
34
|
-
message?: string
|
|
34
|
+
message?: string;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Callback fired when the action component pressed.
|
|
38
38
|
*/
|
|
39
|
-
onActionPress?: () => void
|
|
39
|
+
onActionPress?: () => void;
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Callback fired when the component requests to be closed.
|
|
43
43
|
*/
|
|
44
|
-
onClose?: () => void
|
|
44
|
+
onClose?: () => void;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Element placed before the title and message.
|
|
48
|
+
*/
|
|
49
|
+
startIcon?: React.ReactElement;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The title to display.
|
|
53
|
+
*/
|
|
54
|
+
title?: string;
|
|
45
55
|
|
|
46
56
|
/**
|
|
47
57
|
* If `true`, `Snackbar` is shown.
|
|
48
58
|
* @default false
|
|
49
59
|
*/
|
|
50
|
-
visible?: boolean
|
|
60
|
+
visible?: boolean;
|
|
51
61
|
}> {}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text } from 'react-native';
|
|
3
|
+
import { lightTheme, darkTheme } from '@fountain-ui/styles';
|
|
3
4
|
import type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
4
5
|
import { rgb } from '@fountain-ui/utils';
|
|
5
6
|
import { createFontStyle, css, useTheme } from '../styles';
|
|
6
7
|
import ButtonBase from '../ButtonBase';
|
|
8
|
+
import Column from '../Column';
|
|
7
9
|
import Paper from '../Paper';
|
|
8
10
|
import Spacer from '../Spacer';
|
|
11
|
+
import Typography from '../Typography';
|
|
9
12
|
import type SnackbarContentProps from './SnackbarContentProps';
|
|
10
13
|
|
|
11
14
|
type SnackBarContentStyles = NamedStylesStringUnion<'root' | 'action'>;
|
|
@@ -18,15 +21,14 @@ const useStyles: UseStyles<SnackBarContentStyles> = function (): SnackBarContent
|
|
|
18
21
|
|
|
19
22
|
return {
|
|
20
23
|
root: {
|
|
24
|
+
flexDirection: 'row',
|
|
25
|
+
alignItems: 'center',
|
|
21
26
|
backgroundColor: `rgba(${r}, ${g}, ${b}, .9)`,
|
|
22
27
|
borderRadius: theme.shape.roundness,
|
|
23
28
|
paddingHorizontal: theme.spacing(4),
|
|
24
29
|
paddingVertical: theme.spacing(3),
|
|
25
30
|
},
|
|
26
31
|
action: {
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
flexDirection: 'row',
|
|
29
|
-
justifyContent: 'space-between',
|
|
30
32
|
paddingVertical: theme.spacing(2),
|
|
31
33
|
},
|
|
32
34
|
};
|
|
@@ -36,8 +38,10 @@ export default function SnackbarContent(props: SnackbarContentProps) {
|
|
|
36
38
|
const {
|
|
37
39
|
actionLabel,
|
|
38
40
|
message,
|
|
41
|
+
title,
|
|
39
42
|
onActionPress,
|
|
40
43
|
style,
|
|
44
|
+
startIcon,
|
|
41
45
|
...otherProps
|
|
42
46
|
} = props;
|
|
43
47
|
|
|
@@ -45,9 +49,20 @@ export default function SnackbarContent(props: SnackbarContentProps) {
|
|
|
45
49
|
|
|
46
50
|
const theme = useTheme();
|
|
47
51
|
|
|
52
|
+
const titleFontStyle = createFontStyle(theme, {
|
|
53
|
+
selector: (typo) => typo.subtitle2,
|
|
54
|
+
color: theme.mode === 'light'
|
|
55
|
+
? lightTheme.palette.primary.contrastTextColor
|
|
56
|
+
: lightTheme.palette.primary.main,
|
|
57
|
+
});
|
|
58
|
+
|
|
48
59
|
const messageFontStyle = createFontStyle(theme, {
|
|
49
60
|
selector: (typo) => typo.body2,
|
|
50
|
-
color:
|
|
61
|
+
color: title
|
|
62
|
+
? theme.mode === 'light'
|
|
63
|
+
? darkTheme.palette.text.secondary
|
|
64
|
+
: lightTheme.palette.text.secondary
|
|
65
|
+
: theme.palette.primary.contrastTextColor,
|
|
51
66
|
});
|
|
52
67
|
|
|
53
68
|
const labelFontStyle = createFontStyle(theme, {
|
|
@@ -70,15 +85,32 @@ export default function SnackbarContent(props: SnackbarContentProps) {
|
|
|
70
85
|
])}
|
|
71
86
|
{...otherProps}
|
|
72
87
|
>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
88
|
+
{startIcon ? (
|
|
89
|
+
<React.Fragment>
|
|
90
|
+
{startIcon}
|
|
91
|
+
|
|
92
|
+
<Spacer size={3}/>
|
|
93
|
+
</React.Fragment>
|
|
94
|
+
) : null}
|
|
95
|
+
|
|
96
|
+
<Column>
|
|
97
|
+
{title ? (
|
|
98
|
+
<Typography
|
|
99
|
+
children={title}
|
|
100
|
+
style={css([titleFontStyle])}
|
|
101
|
+
/>
|
|
102
|
+
) : null}
|
|
103
|
+
|
|
104
|
+
<Text
|
|
105
|
+
children={message}
|
|
106
|
+
style={css([messageFontStyle])}
|
|
107
|
+
/>
|
|
108
|
+
</Column>
|
|
79
109
|
|
|
80
110
|
{actionLabel ? (
|
|
81
111
|
<React.Fragment>
|
|
112
|
+
<Spacer flex={1}/>
|
|
113
|
+
|
|
82
114
|
<Spacer size={1}/>
|
|
83
115
|
|
|
84
116
|
<ButtonBase
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { OverridableComponentProps } from '../types';
|
|
2
3
|
import type { PaperProps } from '../Paper';
|
|
3
4
|
|
|
@@ -5,15 +6,25 @@ export default interface SnackbarContentProps extends OverridableComponentProps<
|
|
|
5
6
|
/**
|
|
6
7
|
* The text to use for the action component.
|
|
7
8
|
*/
|
|
8
|
-
actionLabel?: string
|
|
9
|
+
actionLabel?: string;
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* The message to display.
|
|
12
13
|
*/
|
|
13
|
-
message?: string
|
|
14
|
+
message?: string;
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* Callback fired when the action component pressed.
|
|
17
18
|
*/
|
|
18
|
-
onActionPress?: () => void
|
|
19
|
+
onActionPress?: () => void;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Element placed before the title and message.
|
|
23
|
+
*/
|
|
24
|
+
startIcon?: React.ReactElement;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The title to display.
|
|
28
|
+
*/
|
|
29
|
+
title?: string;
|
|
19
30
|
}> {}
|
package/src/SvgIcon/SvgIcon.tsx
CHANGED
package/src/Tab/Tab.tsx
CHANGED
|
@@ -1,37 +1,41 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Platform, Text } from 'react-native';
|
|
1
|
+
import React, { cloneElement } from 'react';
|
|
2
|
+
import { Platform, Text, View } from 'react-native';
|
|
3
3
|
import Badge from '../Badge';
|
|
4
4
|
import TabBase from '../TabBase';
|
|
5
|
-
import type TabProps from './TabProps';
|
|
6
5
|
import { createFontStyle, css, StyleSheet, useTheme } from '../styles';
|
|
6
|
+
import type TabProps from './TabProps';
|
|
7
7
|
import TabIndicator from './TabIndicator';
|
|
8
8
|
|
|
9
9
|
const styles = StyleSheet.create({
|
|
10
10
|
root: {
|
|
11
11
|
// TODO: Remove redundant platform checking
|
|
12
12
|
...(Platform.OS === 'web' ? { minWidth: 'auto' } : {}),
|
|
13
|
-
|
|
14
|
-
primary: {
|
|
15
|
-
minHeight: 48,
|
|
16
|
-
},
|
|
17
|
-
secondary: {
|
|
18
|
-
minHeight: 48,
|
|
13
|
+
minHeight: 40,
|
|
19
14
|
},
|
|
20
15
|
bottomNavigation: {
|
|
21
16
|
minHeight: 56,
|
|
22
17
|
},
|
|
18
|
+
filledInner: {
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
},
|
|
21
|
+
tertiary: {
|
|
22
|
+
minHeight: 44,
|
|
23
|
+
},
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
export default function Tab(props: TabProps) {
|
|
26
27
|
const {
|
|
27
28
|
badgeVisible = false,
|
|
28
29
|
children,
|
|
29
|
-
enableIndicator,
|
|
30
|
+
enableIndicator = false,
|
|
30
31
|
icon: defaultIcon,
|
|
31
|
-
|
|
32
|
+
indicatorColor = 'primary',
|
|
33
|
+
indicatorSize = 'full',
|
|
34
|
+
selected = false,
|
|
32
35
|
selectedIcon,
|
|
33
36
|
variant = 'primary',
|
|
34
37
|
style,
|
|
38
|
+
onTabInnerLayout,
|
|
35
39
|
...otherProps
|
|
36
40
|
} = props;
|
|
37
41
|
|
|
@@ -39,35 +43,64 @@ export default function Tab(props: TabProps) {
|
|
|
39
43
|
|
|
40
44
|
const vertical = variant === 'bottom-navigation';
|
|
41
45
|
|
|
42
|
-
const color = selected
|
|
46
|
+
const color = selected
|
|
47
|
+
? theme.palette.text.primary
|
|
48
|
+
: variant === 'contained'
|
|
49
|
+
? theme.palette.text.secondary
|
|
50
|
+
: theme.palette.text.hint;
|
|
51
|
+
|
|
52
|
+
const containedStyle = {
|
|
53
|
+
borderColor: selected ? theme.palette.primary.main : theme.palette.border.default,
|
|
54
|
+
borderRadius: theme.shape.roundnessExtra,
|
|
55
|
+
borderWidth: selected ? 1.5 : 1,
|
|
56
|
+
minHeight: 'auto',
|
|
57
|
+
paddingHorizontal: theme.spacing(3),
|
|
58
|
+
paddingVertical: theme.spacing(1.5),
|
|
59
|
+
};
|
|
43
60
|
|
|
44
61
|
const tabBaseStyle = css([
|
|
45
62
|
styles.root,
|
|
46
|
-
variant === '
|
|
47
|
-
|
|
48
|
-
|
|
63
|
+
variant === 'bottom-navigation' && styles.bottomNavigation,
|
|
64
|
+
variant === 'contained' && containedStyle,
|
|
65
|
+
variant === 'tertiary' && styles.tertiary,
|
|
49
66
|
style,
|
|
50
67
|
]);
|
|
51
68
|
|
|
69
|
+
const tabInnerStyle = css([
|
|
70
|
+
styles.root,
|
|
71
|
+
styles.filledInner,
|
|
72
|
+
]);
|
|
73
|
+
|
|
52
74
|
const fontStyle = createFontStyle(theme, {
|
|
53
|
-
selector: (typo) =>
|
|
54
|
-
|
|
55
|
-
|
|
75
|
+
selector: (typo) => {
|
|
76
|
+
switch (variant) {
|
|
77
|
+
case 'primary':
|
|
78
|
+
return typo.h2;
|
|
79
|
+
case 'secondary':
|
|
80
|
+
return typo.button2;
|
|
81
|
+
case 'tertiary':
|
|
82
|
+
return typo.h3;
|
|
83
|
+
case 'contained':
|
|
84
|
+
return selected
|
|
85
|
+
? { ...typo.subtitle2, fontWeight: typo.fontWeight.medium }
|
|
86
|
+
: typo.body2;
|
|
87
|
+
default:
|
|
88
|
+
return typo.flag;
|
|
89
|
+
}
|
|
90
|
+
},
|
|
56
91
|
color,
|
|
57
92
|
});
|
|
58
|
-
|
|
59
93
|
const pressEffect = selected ? 'none' : 'opacity';
|
|
60
94
|
|
|
61
95
|
const icon = selected ? (selectedIcon || defaultIcon) : defaultIcon;
|
|
62
|
-
const iconElement = icon ?
|
|
96
|
+
const iconElement = icon ? cloneElement(icon, { fill: color }) : null;
|
|
63
97
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
>
|
|
98
|
+
const tabElement = typeof children !== 'string' ? (
|
|
99
|
+
React.cloneElement(children, {
|
|
100
|
+
selected,
|
|
101
|
+
})
|
|
102
|
+
) : (
|
|
103
|
+
<React.Fragment>
|
|
71
104
|
<Badge
|
|
72
105
|
children={iconElement}
|
|
73
106
|
invisible={!badgeVisible}
|
|
@@ -77,8 +110,32 @@ export default function Tab(props: TabProps) {
|
|
|
77
110
|
children={children}
|
|
78
111
|
style={css(fontStyle)}
|
|
79
112
|
/>
|
|
113
|
+
</React.Fragment>
|
|
114
|
+
);
|
|
115
|
+
const tabIndicator = (enableIndicator && selected)
|
|
116
|
+
? <TabIndicator indicatorSize={indicatorSize} color={indicatorColor}/>
|
|
117
|
+
: null;
|
|
118
|
+
|
|
119
|
+
return (
|
|
120
|
+
<TabBase
|
|
121
|
+
pressEffect={pressEffect}
|
|
122
|
+
style={tabBaseStyle}
|
|
123
|
+
vertical={vertical}
|
|
124
|
+
{...otherProps}
|
|
125
|
+
>
|
|
126
|
+
{indicatorSize === 'fit-content' ? (
|
|
127
|
+
<View onLayout={onTabInnerLayout} style={tabInnerStyle}>
|
|
128
|
+
{tabElement}
|
|
129
|
+
|
|
130
|
+
{tabIndicator}
|
|
131
|
+
</View>
|
|
132
|
+
) : (
|
|
133
|
+
<React.Fragment>
|
|
134
|
+
{tabElement}
|
|
80
135
|
|
|
81
|
-
|
|
136
|
+
{tabIndicator}
|
|
137
|
+
</React.Fragment>
|
|
138
|
+
)}
|
|
82
139
|
</TabBase>
|
|
83
140
|
);
|
|
84
141
|
};
|
package/src/Tab/TabIndicator.tsx
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
import { NamedStylesStringUnion
|
|
3
|
+
import { NamedStylesStringUnion } from '@fountain-ui/styles';
|
|
4
4
|
import { useTheme } from '../styles';
|
|
5
|
+
import type { TabIndicatorColor, TabIndicatorSize } from './TabProps';
|
|
5
6
|
|
|
6
7
|
type TabIndicatorStyles = NamedStylesStringUnion<'root'>;
|
|
7
8
|
|
|
8
|
-
const useStyles:
|
|
9
|
-
|
|
9
|
+
const useStyles: (color: TabIndicatorColor, indicatorSize: TabIndicatorSize) => TabIndicatorStyles =
|
|
10
|
+
function (color: TabIndicatorColor, indicatorSize): TabIndicatorStyles {
|
|
11
|
+
const theme = useTheme();
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
return {
|
|
14
|
+
root: {
|
|
15
|
+
backgroundColor: theme.palette[color].main,
|
|
16
|
+
bottom: 0,
|
|
17
|
+
height: 2,
|
|
18
|
+
left: indicatorSize === 'fit-content' ? 0 : 12,
|
|
19
|
+
right: indicatorSize === 'fit-content' ? 0 : 12,
|
|
20
|
+
position: 'absolute',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
20
23
|
};
|
|
21
|
-
};
|
|
22
24
|
|
|
23
|
-
const TabIndicator = function TabIndicator() {
|
|
24
|
-
const styles = useStyles();
|
|
25
|
+
const TabIndicator = function TabIndicator({ indicatorSize, color }: { indicatorSize: TabIndicatorSize; color: TabIndicatorColor }) {
|
|
26
|
+
const styles = useStyles(color, indicatorSize);
|
|
25
27
|
|
|
26
28
|
return (
|
|
27
29
|
<View
|
package/src/Tab/TabProps.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { LayoutChangeEvent } from 'react-native';
|
|
2
3
|
import type { TabBaseProps } from '../TabBase';
|
|
3
4
|
import type { OverridableComponentProps } from '../types';
|
|
4
5
|
|
|
5
|
-
export type TabVariant = 'primary' | 'secondary' | 'bottom-navigation';
|
|
6
|
+
export type TabVariant = 'primary' | 'secondary' | 'tertiary' | 'bottom-navigation' | 'contained';
|
|
7
|
+
export type TabIndicatorColor = 'primary' | 'secondary';
|
|
8
|
+
export type TabIndicatorSize = 'full' | 'fit-content';
|
|
6
9
|
|
|
7
10
|
export default interface TabProps extends OverridableComponentProps<TabBaseProps, {
|
|
8
11
|
/**
|
|
@@ -14,7 +17,7 @@ export default interface TabProps extends OverridableComponentProps<TabBaseProps
|
|
|
14
17
|
/**
|
|
15
18
|
* The label of the Tab.
|
|
16
19
|
*/
|
|
17
|
-
children: string;
|
|
20
|
+
children: string | React.ReactElement;
|
|
18
21
|
|
|
19
22
|
/**
|
|
20
23
|
* If `true`, the indicator is enabled.
|
|
@@ -33,6 +36,20 @@ export default interface TabProps extends OverridableComponentProps<TabBaseProps
|
|
|
33
36
|
*/
|
|
34
37
|
icon?: React.ReactElement;
|
|
35
38
|
|
|
39
|
+
/**
|
|
40
|
+
* Tab indicator color
|
|
41
|
+
* @default 'primary'
|
|
42
|
+
*/
|
|
43
|
+
indicatorColor?: TabIndicatorColor;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The size of tab indicator.
|
|
47
|
+
* 'full' adjusts the indicator to the size of the Tab,
|
|
48
|
+
* while 'fit-content' adjusts the indicator to the size of the content inside the Tab.
|
|
49
|
+
* @default 'full'
|
|
50
|
+
*/
|
|
51
|
+
indicatorSize?: TabIndicatorSize;
|
|
52
|
+
|
|
36
53
|
/**
|
|
37
54
|
* If supplied, use this icon on selected state.
|
|
38
55
|
*/
|
|
@@ -43,4 +60,9 @@ export default interface TabProps extends OverridableComponentProps<TabBaseProps
|
|
|
43
60
|
* @default 'primary'
|
|
44
61
|
*/
|
|
45
62
|
variant?: TabVariant;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Function to be passed to the child component's onLayout prop.
|
|
66
|
+
*/
|
|
67
|
+
onTabInnerLayout?: (event: LayoutChangeEvent) => void;
|
|
46
68
|
}> {}
|
package/src/Tab/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default } from './Tab';
|
|
2
|
-
export type { default as TabProps, TabVariant } from './TabProps';
|
|
2
|
+
export type { default as TabProps, TabVariant, TabIndicatorSize } from './TabProps';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import React, { cloneElement, useContext, useEffect, useState } from 'react';
|
|
3
|
+
import InternalContext from './InternalContext';
|
|
4
|
+
|
|
5
|
+
export interface IndexAwareTabProps {
|
|
6
|
+
children: ReactElement;
|
|
7
|
+
index: number;
|
|
8
|
+
initialIndex: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default function IndexAwareTab(props: IndexAwareTabProps) {
|
|
12
|
+
const {
|
|
13
|
+
children,
|
|
14
|
+
index,
|
|
15
|
+
initialIndex,
|
|
16
|
+
} = props;
|
|
17
|
+
|
|
18
|
+
const [selected, setSelected] = useState(initialIndex === index);
|
|
19
|
+
|
|
20
|
+
const { indexStore } = useContext(InternalContext);
|
|
21
|
+
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
return indexStore.subscribe((currentIndex) => {
|
|
24
|
+
setSelected(currentIndex === index);
|
|
25
|
+
});
|
|
26
|
+
}, [indexStore, index]);
|
|
27
|
+
|
|
28
|
+
return cloneElement(children, { selected });
|
|
29
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
import type { MonoStore } from '../store';
|
|
3
|
+
import { MockStore } from '../store';
|
|
4
|
+
|
|
5
|
+
export interface InternalContextValue {
|
|
6
|
+
indexStore: MonoStore<number>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const InternalContext = createContext<InternalContextValue>({
|
|
10
|
+
indexStore: new MockStore(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default InternalContext;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ScrollViewProps } from 'react-native';
|
|
3
|
+
import { ScrollView } from 'react-native';
|
|
4
|
+
import TabCoordinate from './TabCoordinate';
|
|
5
|
+
import useScrollViewReaction from './useScrollViewReaction';
|
|
6
|
+
|
|
7
|
+
export interface ScrollableTabsViewProps extends ScrollViewProps {
|
|
8
|
+
initialIndex: number;
|
|
9
|
+
coordinates: TabCoordinate[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function ScrollableTabsView(props: ScrollableTabsViewProps) {
|
|
13
|
+
const {
|
|
14
|
+
coordinates,
|
|
15
|
+
initialIndex,
|
|
16
|
+
...scrollViewProps
|
|
17
|
+
} = props;
|
|
18
|
+
|
|
19
|
+
const { scrollViewRef, onLayout } = useScrollViewReaction(initialIndex, coordinates);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<ScrollView
|
|
23
|
+
ref={scrollViewRef}
|
|
24
|
+
onLayout={onLayout}
|
|
25
|
+
{...scrollViewProps}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
};
|