@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","rgb","createFontStyle","css","useTheme","ButtonBase","Paper","Spacer","useStyles","theme","backgroundColor","palette","primary","main","r","g","b","useMemo","root","borderRadius","shape","roundness","paddingHorizontal","spacing","paddingVertical","action","
|
|
1
|
+
{"version":3,"names":["React","Text","lightTheme","darkTheme","rgb","createFontStyle","css","useTheme","ButtonBase","Column","Paper","Spacer","Typography","useStyles","theme","backgroundColor","palette","primary","main","r","g","b","useMemo","root","flexDirection","alignItems","borderRadius","shape","roundness","paddingHorizontal","spacing","paddingVertical","action","SnackbarContent","props","actionLabel","message","title","onActionPress","style","startIcon","otherProps","styles","titleFontStyle","selector","typo","subtitle2","color","mode","contrastTextColor","messageFontStyle","body2","text","secondary","labelFontStyle","button2","labelStyle","padding","undefined"],"sources":["SnackbarContent.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport { lightTheme, darkTheme } from '@fountain-ui/styles';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { rgb } from '@fountain-ui/utils';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport ButtonBase from '../ButtonBase';\nimport Column from '../Column';\nimport Paper from '../Paper';\nimport Spacer from '../Spacer';\nimport Typography from '../Typography';\nimport type SnackbarContentProps from './SnackbarContentProps';\n\ntype SnackBarContentStyles = NamedStylesStringUnion<'root' | 'action'>;\n\nconst useStyles: UseStyles<SnackBarContentStyles> = function (): SnackBarContentStyles {\n const theme = useTheme();\n\n const backgroundColor = theme.palette.primary.main;\n const [r, g, b] = React.useMemo(() => rgb(backgroundColor), [backgroundColor]);\n\n return {\n root: {\n flexDirection: 'row',\n alignItems: 'center',\n backgroundColor: `rgba(${r}, ${g}, ${b}, .9)`,\n borderRadius: theme.shape.roundness,\n paddingHorizontal: theme.spacing(4),\n paddingVertical: theme.spacing(3),\n },\n action: {\n paddingVertical: theme.spacing(2),\n },\n };\n};\n\nexport default function SnackbarContent(props: SnackbarContentProps) {\n const {\n actionLabel,\n message,\n title,\n onActionPress,\n style,\n startIcon,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n\n const theme = useTheme();\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typo) => typo.subtitle2,\n color: theme.mode === 'light'\n ? lightTheme.palette.primary.contrastTextColor\n : lightTheme.palette.primary.main,\n });\n\n const messageFontStyle = createFontStyle(theme, {\n selector: (typo) => typo.body2,\n color: title\n ? theme.mode === 'light'\n ? darkTheme.palette.text.secondary\n : lightTheme.palette.text.secondary\n : theme.palette.primary.contrastTextColor,\n });\n\n const labelFontStyle = createFontStyle(theme, {\n selector: (typo) => typo.button2,\n color: theme.palette.primary.contrastTextColor,\n });\n\n const labelStyle = css([\n labelFontStyle,\n { padding: theme.spacing(2) },\n ]);\n\n return (\n <Paper\n elevation={0}\n style={css([\n styles.root,\n actionLabel ? styles.action : undefined,\n style,\n ])}\n {...otherProps}\n >\n {startIcon ? (\n <React.Fragment>\n {startIcon}\n\n <Spacer size={3}/>\n </React.Fragment>\n ) : null}\n\n <Column>\n {title ? (\n <Typography\n children={title}\n style={css([titleFontStyle])}\n />\n ) : null}\n\n <Text\n children={message}\n style={css([messageFontStyle])}\n />\n </Column>\n\n {actionLabel ? (\n <React.Fragment>\n <Spacer flex={1}/>\n\n <Spacer size={1}/>\n\n <ButtonBase\n onPress={onActionPress}\n pressEffect={'none'}\n >\n <Text\n children={actionLabel}\n style={labelStyle}\n />\n </ButtonBase>\n </React.Fragment>\n ) : null}\n </Paper>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AACA,SAASC,UAAT,EAAqBC,SAArB,QAAsC,qBAAtC;AAEA,SAASC,GAAT,QAAoB,oBAApB;AACA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,QAA/B,QAA+C,WAA/C;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,KAAP,MAAkB,UAAlB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,UAAP,MAAuB,eAAvB;;AAKA,MAAMC,SAA2C,GAAG,YAAmC;EACnF,MAAMC,KAAK,GAAGP,QAAQ,EAAtB;EAEA,MAAMQ,eAAe,GAAGD,KAAK,CAACE,OAAN,CAAcC,OAAd,CAAsBC,IAA9C;EACA,MAAM,CAACC,CAAD,EAAIC,CAAJ,EAAOC,CAAP,IAAYrB,KAAK,CAACsB,OAAN,CAAc,MAAM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AAC,UAAD;IACI,OAAO,EAAEG,aADb;IAEI,WAAW,EAAE;EAFjB,gBAII,oBAAC,IAAD;IACI,QAAQ,EAAEH,WADd;IAEI,KAAK,EAAEqB;EAFX,EAJJ,CALJ,CADQ,GAgBR,IA/CR,CADJ;AAmDH;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["SnackbarContentProps.ts"],"sourcesContent":["import type { OverridableComponentProps } from '../types';\nimport type { PaperProps } from '../Paper';\n\nexport default interface SnackbarContentProps extends OverridableComponentProps<PaperProps, {\n /**\n * The text to use for the action component.\n */\n actionLabel?: string
|
|
1
|
+
{"version":3,"names":[],"sources":["SnackbarContentProps.ts"],"sourcesContent":["import React from 'react';\nimport type { OverridableComponentProps } from '../types';\nimport type { PaperProps } from '../Paper';\n\nexport default interface SnackbarContentProps extends OverridableComponentProps<PaperProps, {\n /**\n * The text to use for the action component.\n */\n actionLabel?: string;\n\n /**\n * The message to display.\n */\n message?: string;\n\n /**\n * Callback fired when the action component pressed.\n */\n onActionPress?: () => void;\n\n /**\n * Element placed before the title and message.\n */\n startIcon?: React.ReactElement;\n\n /**\n * The title to display.\n */\n title?: string;\n}> {}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Svg","css","useTheme","SvgIcon","props","color","colorProp","height","style","styleProp","viewBox","width","otherProps","theme","palette","main","flexShrink"],"sources":["SvgIcon.tsx"],"sourcesContent":["import React from 'react';\nimport Svg from 'react-native-svg';\nimport { css, useTheme } from '../styles';\nimport type SvgIconProps from './SvgIconProps';\n\nexport default function SvgIcon(props: SvgIconProps) {\n const {\n color: colorProp = 'primary',\n height = 24,\n style: styleProp,\n viewBox = '0 0
|
|
1
|
+
{"version":3,"names":["React","Svg","css","useTheme","SvgIcon","props","color","colorProp","height","style","styleProp","viewBox","width","otherProps","theme","palette","main","flexShrink"],"sources":["SvgIcon.tsx"],"sourcesContent":["import React from 'react';\nimport Svg from 'react-native-svg';\nimport { css, useTheme } from '../styles';\nimport type SvgIconProps from './SvgIconProps';\n\nexport default function SvgIcon(props: SvgIconProps) {\n const {\n color: colorProp = 'primary',\n height = 24,\n style: styleProp,\n viewBox = '0 0 24 24',\n width = 24,\n ...otherProps\n }: SvgIconProps = props;\n\n const theme = useTheme();\n\n const color = theme.palette[colorProp].main;\n\n const style = css([\n { flexShrink: 0 },\n styleProp,\n ]);\n\n return (\n <Svg\n color={color}\n fill={'currentColor'}\n height={height}\n style={style}\n viewBox={viewBox}\n width={width}\n {...otherProps}\n />\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAOC,GAAP,MAAgB,kBAAhB;AACA,SAASC,GAAT,EAAcC,QAAd,QAA8B,WAA9B;AAGA,eAAe,SAASC,OAAT,CAAiBC,KAAjB,EAAsC;EACjD,MAAM;IACFC,KAAK,EAAEC,SAAS,GAAG,SADjB;IAEFC,MAAM,GAAG,EAFP;IAGFC,KAAK,EAAEC,SAHL;IAIFC,OAAO,GAAG,WAJR;IAKFC,KAAK,GAAG,EALN;IAMF,GAAGC;EAND,IAOYR,KAPlB;EASA,MAAMS,KAAK,GAAGX,QAAQ,EAAtB;EAEA,MAAMG,KAAK,GAAGQ,KAAK,CAACC,OAAN,CAAcR,SAAd,EAAyBS,IAAvC;EAEA,MAAMP,KAAK,GAAGP,GAAG,CAAC,CACd;IAAEe,UAAU,EAAE;EAAd,CADc,EAEdP,SAFc,CAAD,CAAjB;EAKA,oBACI,oBAAC,GAAD;IACI,KAAK,EAAEJ,KADX;IAEI,IAAI,EAAE,cAFV;IAGI,MAAM,EAAEE,MAHZ;IAII,KAAK,EAAEC,KAJX;IAKI,OAAO,EAAEE,OALb;IAMI,KAAK,EAAEC;EANX,GAOQC,UAPR,EADJ;AAWH;AAAA"}
|
package/build/module/Tab/Tab.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { Platform, Text } from 'react-native';
|
|
3
|
+
import React, { cloneElement } from 'react';
|
|
4
|
+
import { Platform, Text, View } from 'react-native';
|
|
5
5
|
import Badge from '../Badge';
|
|
6
6
|
import TabBase from '../TabBase';
|
|
7
7
|
import { createFontStyle, css, StyleSheet, useTheme } from '../styles';
|
|
@@ -10,54 +10,96 @@ const styles = StyleSheet.create({
|
|
|
10
10
|
root: { // TODO: Remove redundant platform checking
|
|
11
11
|
...(Platform.OS === 'web' ? {
|
|
12
12
|
minWidth: 'auto'
|
|
13
|
-
} : {})
|
|
14
|
-
|
|
15
|
-
primary: {
|
|
16
|
-
minHeight: 48
|
|
17
|
-
},
|
|
18
|
-
secondary: {
|
|
19
|
-
minHeight: 48
|
|
13
|
+
} : {}),
|
|
14
|
+
minHeight: 40
|
|
20
15
|
},
|
|
21
16
|
bottomNavigation: {
|
|
22
17
|
minHeight: 56
|
|
18
|
+
},
|
|
19
|
+
filledInner: {
|
|
20
|
+
justifyContent: 'center'
|
|
21
|
+
},
|
|
22
|
+
tertiary: {
|
|
23
|
+
minHeight: 44
|
|
23
24
|
}
|
|
24
25
|
});
|
|
25
26
|
export default function Tab(props) {
|
|
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
|
const theme = useTheme();
|
|
38
42
|
const vertical = variant === 'bottom-navigation';
|
|
39
|
-
const color = selected ? theme.palette.text.primary : theme.palette.text.hint;
|
|
40
|
-
const
|
|
43
|
+
const color = selected ? theme.palette.text.primary : variant === 'contained' ? theme.palette.text.secondary : theme.palette.text.hint;
|
|
44
|
+
const containedStyle = {
|
|
45
|
+
borderColor: selected ? theme.palette.primary.main : theme.palette.border.default,
|
|
46
|
+
borderRadius: theme.shape.roundnessExtra,
|
|
47
|
+
borderWidth: selected ? 1.5 : 1,
|
|
48
|
+
minHeight: 'auto',
|
|
49
|
+
paddingHorizontal: theme.spacing(3),
|
|
50
|
+
paddingVertical: theme.spacing(1.5)
|
|
51
|
+
};
|
|
52
|
+
const tabBaseStyle = css([styles.root, variant === 'bottom-navigation' && styles.bottomNavigation, variant === 'contained' && containedStyle, variant === 'tertiary' && styles.tertiary, style]);
|
|
53
|
+
const tabInnerStyle = css([styles.root, styles.filledInner]);
|
|
41
54
|
const fontStyle = createFontStyle(theme, {
|
|
42
|
-
selector: typo =>
|
|
55
|
+
selector: typo => {
|
|
56
|
+
switch (variant) {
|
|
57
|
+
case 'primary':
|
|
58
|
+
return typo.h2;
|
|
59
|
+
|
|
60
|
+
case 'secondary':
|
|
61
|
+
return typo.button2;
|
|
62
|
+
|
|
63
|
+
case 'tertiary':
|
|
64
|
+
return typo.h3;
|
|
65
|
+
|
|
66
|
+
case 'contained':
|
|
67
|
+
return selected ? { ...typo.subtitle2,
|
|
68
|
+
fontWeight: typo.fontWeight.medium
|
|
69
|
+
} : typo.body2;
|
|
70
|
+
|
|
71
|
+
default:
|
|
72
|
+
return typo.flag;
|
|
73
|
+
}
|
|
74
|
+
},
|
|
43
75
|
color
|
|
44
76
|
});
|
|
45
77
|
const pressEffect = selected ? 'none' : 'opacity';
|
|
46
78
|
const icon = selected ? selectedIcon || defaultIcon : defaultIcon;
|
|
47
|
-
const iconElement = icon ? /*#__PURE__*/
|
|
79
|
+
const iconElement = icon ? /*#__PURE__*/cloneElement(icon, {
|
|
48
80
|
fill: color
|
|
49
81
|
}) : null;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
vertical: vertical
|
|
54
|
-
}, otherProps), /*#__PURE__*/React.createElement(Badge, {
|
|
82
|
+
const tabElement = typeof children !== 'string' ? /*#__PURE__*/React.cloneElement(children, {
|
|
83
|
+
selected
|
|
84
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Badge, {
|
|
55
85
|
children: iconElement,
|
|
56
86
|
invisible: !badgeVisible
|
|
57
87
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
58
88
|
children: children,
|
|
59
89
|
style: css(fontStyle)
|
|
60
|
-
})
|
|
90
|
+
}));
|
|
91
|
+
const tabIndicator = enableIndicator && selected ? /*#__PURE__*/React.createElement(TabIndicator, {
|
|
92
|
+
indicatorSize: indicatorSize,
|
|
93
|
+
color: indicatorColor
|
|
94
|
+
}) : null;
|
|
95
|
+
return /*#__PURE__*/React.createElement(TabBase, _extends({
|
|
96
|
+
pressEffect: pressEffect,
|
|
97
|
+
style: tabBaseStyle,
|
|
98
|
+
vertical: vertical
|
|
99
|
+
}, otherProps), indicatorSize === 'fit-content' ? /*#__PURE__*/React.createElement(View, {
|
|
100
|
+
onLayout: onTabInnerLayout,
|
|
101
|
+
style: tabInnerStyle
|
|
102
|
+
}, tabElement, tabIndicator) : /*#__PURE__*/React.createElement(React.Fragment, null, tabElement, tabIndicator));
|
|
61
103
|
}
|
|
62
104
|
;
|
|
63
105
|
//# sourceMappingURL=Tab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","Text","Badge","TabBase","createFontStyle","css","StyleSheet","useTheme","TabIndicator","styles","create","root","OS","minWidth","
|
|
1
|
+
{"version":3,"names":["React","cloneElement","Platform","Text","View","Badge","TabBase","createFontStyle","css","StyleSheet","useTheme","TabIndicator","styles","create","root","OS","minWidth","minHeight","bottomNavigation","filledInner","justifyContent","tertiary","Tab","props","badgeVisible","children","enableIndicator","icon","defaultIcon","indicatorColor","indicatorSize","selected","selectedIcon","variant","style","onTabInnerLayout","otherProps","theme","vertical","color","palette","text","primary","secondary","hint","containedStyle","borderColor","main","border","default","borderRadius","shape","roundnessExtra","borderWidth","paddingHorizontal","spacing","paddingVertical","tabBaseStyle","tabInnerStyle","fontStyle","selector","typo","h2","button2","h3","subtitle2","fontWeight","medium","body2","flag","pressEffect","iconElement","fill","tabElement","tabIndicator"],"sources":["Tab.tsx"],"sourcesContent":["import React, { cloneElement } from 'react';\nimport { Platform, Text, View } from 'react-native';\nimport Badge from '../Badge';\nimport TabBase from '../TabBase';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport type TabProps from './TabProps';\nimport TabIndicator from './TabIndicator';\n\nconst styles = StyleSheet.create({\n root: {\n // TODO: Remove redundant platform checking\n ...(Platform.OS === 'web' ? { minWidth: 'auto' } : {}),\n minHeight: 40,\n },\n bottomNavigation: {\n minHeight: 56,\n },\n filledInner: {\n justifyContent: 'center',\n },\n tertiary: {\n minHeight: 44,\n },\n});\n\nexport default function Tab(props: TabProps) {\n const {\n badgeVisible = false,\n children,\n enableIndicator = false,\n icon: defaultIcon,\n indicatorColor = 'primary',\n indicatorSize = 'full',\n selected = false,\n selectedIcon,\n variant = 'primary',\n style,\n onTabInnerLayout,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const vertical = variant === 'bottom-navigation';\n\n const color = selected\n ? theme.palette.text.primary\n : variant === 'contained'\n ? theme.palette.text.secondary\n : theme.palette.text.hint;\n\n const containedStyle = {\n borderColor: selected ? theme.palette.primary.main : theme.palette.border.default,\n borderRadius: theme.shape.roundnessExtra,\n borderWidth: selected ? 1.5 : 1,\n minHeight: 'auto',\n paddingHorizontal: theme.spacing(3),\n paddingVertical: theme.spacing(1.5),\n };\n\n const tabBaseStyle = css([\n styles.root,\n variant === 'bottom-navigation' && styles.bottomNavigation,\n variant === 'contained' && containedStyle,\n variant === 'tertiary' && styles.tertiary,\n style,\n ]);\n\n const tabInnerStyle = css([\n styles.root,\n styles.filledInner,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => {\n switch (variant) {\n case 'primary':\n return typo.h2;\n case 'secondary':\n return typo.button2;\n case 'tertiary':\n return typo.h3;\n case 'contained':\n return selected\n ? { ...typo.subtitle2, fontWeight: typo.fontWeight.medium }\n : typo.body2;\n default:\n return typo.flag;\n }\n },\n color,\n });\n const pressEffect = selected ? 'none' : 'opacity';\n\n const icon = selected ? (selectedIcon || defaultIcon) : defaultIcon;\n const iconElement = icon ? cloneElement(icon, { fill: color }) : null;\n\n const tabElement = typeof children !== 'string' ? (\n React.cloneElement(children, {\n selected,\n })\n ) : (\n <React.Fragment>\n <Badge\n children={iconElement}\n invisible={!badgeVisible}\n />\n\n <Text\n children={children}\n style={css(fontStyle)}\n />\n </React.Fragment>\n );\n const tabIndicator = (enableIndicator && selected)\n ? <TabIndicator indicatorSize={indicatorSize} color={indicatorColor}/>\n : null;\n\n return (\n <TabBase\n pressEffect={pressEffect}\n style={tabBaseStyle}\n vertical={vertical}\n {...otherProps}\n >\n {indicatorSize === 'fit-content' ? (\n <View onLayout={onTabInnerLayout} style={tabInnerStyle}>\n {tabElement}\n\n {tabIndicator}\n </View>\n ) : (\n <React.Fragment>\n {tabElement}\n\n {tabIndicator}\n </React.Fragment>\n )}\n </TabBase>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,YAAhB,QAAoC,OAApC;AACA,SAASC,QAAT,EAAmBC,IAAnB,EAAyBC,IAAzB,QAAqC,cAArC;AACA,OAAOC,KAAP,MAAkB,UAAlB;AACA,OAAOC,OAAP,MAAoB,YAApB;AACA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,UAA/B,EAA2CC,QAA3C,QAA2D,WAA3D;AAEA,OAAOC,YAAP,MAAyB,gBAAzB;AAEA,MAAMC,MAAM,GAAGH,UAAU,CAACI,MAAX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IAAD,EAAO;IAAE6C,IAAI,EAAEjC;EAAR,CAAP,CAAf,GAAyC,IAAjE;EAEA,MAAMkC,UAAU,GAAG,OAAOhD,QAAP,KAAoB,QAApB,gBACfzB,KAAK,CAACC,YAAN,CAAmBwB,QAAnB,EAA6B;IACzBM;EADyB,CAA7B,CADe,gBAKf,oBAAC,KAAD,CAAO,QAAP,qBACI,oBAAC,KAAD;IACI,QAAQ,EAAEwC,WADd;IAEI,SAAS,EAAE,CAAC/C;EAFhB,EADJ,eAMI,oBAAC,IAAD;IACI,QAAQ,EAAEC,QADd;IAEI,KAAK,EAAEjB,GAAG,CAACmD,SAAD;EAFd,EANJ,CALJ;EAiBA,MAAMe,YAAY,GAAIhD,eAAe,IAAIK,QAApB,gBACf,oBAAC,YAAD;IAAc,aAAa,EAAED,aAA7B;IAA4C,KAAK,EAAED;EAAnD,EADe,GAEf,IAFN;EAIA,oBACI,oBAAC,OAAD;IACI,WAAW,EAAEyC,WADjB;IAEI,KAAK,EAAEb,YAFX;IAGI,QAAQ,EAAEnB;EAHd,GAIQF,UAJR,GAMKN,aAAa,KAAK,aAAlB,gBACG,oBAAC,IAAD;IAAM,QAAQ,EAAEK,gBAAhB;IAAkC,KAAK,EAAEuB;EAAzC,GACKe,UADL,EAGKC,YAHL,CADH,gBAOG,oBAAC,KAAD,CAAO,QAAP,QACKD,UADL,EAGKC,YAHL,CAbR,CADJ;AAsBH;AAAA"}
|
|
@@ -2,22 +2,26 @@ import React from 'react';
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { useTheme } from '../styles';
|
|
4
4
|
|
|
5
|
-
const useStyles = function () {
|
|
5
|
+
const useStyles = function (color, indicatorSize) {
|
|
6
6
|
const theme = useTheme();
|
|
7
7
|
return {
|
|
8
8
|
root: {
|
|
9
|
-
backgroundColor: theme.palette.
|
|
9
|
+
backgroundColor: theme.palette[color].main,
|
|
10
10
|
bottom: 0,
|
|
11
|
-
height:
|
|
12
|
-
left: 12,
|
|
13
|
-
right: 12,
|
|
11
|
+
height: 2,
|
|
12
|
+
left: indicatorSize === 'fit-content' ? 0 : 12,
|
|
13
|
+
right: indicatorSize === 'fit-content' ? 0 : 12,
|
|
14
14
|
position: 'absolute'
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
const TabIndicator = function TabIndicator() {
|
|
20
|
-
|
|
19
|
+
const TabIndicator = function TabIndicator(_ref) {
|
|
20
|
+
let {
|
|
21
|
+
indicatorSize,
|
|
22
|
+
color
|
|
23
|
+
} = _ref;
|
|
24
|
+
const styles = useStyles(color, indicatorSize);
|
|
21
25
|
return /*#__PURE__*/React.createElement(View, {
|
|
22
26
|
style: styles.root
|
|
23
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","useTheme","useStyles","theme","root","backgroundColor","palette","
|
|
1
|
+
{"version":3,"names":["React","View","useTheme","useStyles","color","indicatorSize","theme","root","backgroundColor","palette","main","bottom","height","left","right","position","TabIndicator","styles","memo"],"sources":["TabIndicator.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport type { TabIndicatorColor, TabIndicatorSize } from './TabProps';\n\ntype TabIndicatorStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: (color: TabIndicatorColor, indicatorSize: TabIndicatorSize) => TabIndicatorStyles =\n function (color: TabIndicatorColor, indicatorSize): TabIndicatorStyles {\n const theme = useTheme();\n\n return {\n root: {\n backgroundColor: theme.palette[color].main,\n bottom: 0,\n height: 2,\n left: indicatorSize === 'fit-content' ? 0 : 12,\n right: indicatorSize === 'fit-content' ? 0 : 12,\n position: 'absolute',\n },\n };\n };\n\nconst TabIndicator = function TabIndicator({ indicatorSize, color }: { indicatorSize: TabIndicatorSize; color: TabIndicatorColor }) {\n const styles = useStyles(color, indicatorSize);\n\n return (\n <View\n style={styles.root}\n />\n );\n};\n\nexport default React.memo(TabIndicator);\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,QAAT,QAAyB,WAAzB;;AAKA,MAAMC,SAA4F,GAC9F,UAAUC,KAAV,EAAoCC,aAApC,EAAuE;EACnE,MAAMC,KAAK,GAAGJ,QAAQ,EAAtB;EAEA,OAAO;IACHK,IAAI,EAAE;MACFC,eAAe,EAAEF,KAAK,CAACG,OAAN,CAAcL,KAAd,EAAqBM,IADpC;MAEFC,MAAM,EAAE,CAFN;MAGFC,MAAM,EAAE,CAHN;MAIFC,IAAI,EAAER,aAAa,KAAK,aAAlB,GAAkC,CAAlC,GAAsC,EAJ1C;MAKFS,KAAK,EAAET,aAAa,KAAK,aAAlB,GAAkC,CAAlC,GAAsC,EAL3C;MAMFU,QAAQ,EAAE;IANR;EADH,CAAP;AAUH,CAdL;;AAgBA,MAAMC,YAAY,GAAG,SAASA,YAAT,OAA+G;EAAA,IAAzF;IAAEX,aAAF;IAAiBD;EAAjB,CAAyF;EAChI,MAAMa,MAAM,GAAGd,SAAS,CAACC,KAAD,EAAQC,aAAR,CAAxB;EAEA,oBACI,oBAAC,IAAD;IACI,KAAK,EAAEY,MAAM,CAACV;EADlB,EADJ;AAKH,CARD;;AAUA,4BAAeP,KAAK,CAACkB,IAAN,CAAWF,YAAX,CAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["TabProps.ts"],"sourcesContent":["import React from 'react';\nimport type { TabBaseProps } from '../TabBase';\nimport type { OverridableComponentProps } from '../types';\n\nexport type TabVariant = 'primary' | 'secondary' | 'bottom-navigation';\n\nexport default interface TabProps extends OverridableComponentProps<TabBaseProps, {\n /**\n * If `true`, the badge is visible.\n * @default false\n */\n badgeVisible?: boolean;\n\n /**\n * The label of the Tab.\n */\n children: string;\n\n /**\n * If `true`, the indicator is enabled.\n * @default false\n */\n enableIndicator?: boolean;\n\n /**\n * If `true`, the component is selected.\n * @default false\n */\n selected?: boolean;\n\n /**\n * Element placed before the children.\n */\n icon?: React.ReactElement;\n\n /**\n * If supplied, use this icon on selected state.\n */\n selectedIcon?: React.ReactElement;\n\n /**\n * The variant to use.\n * @default 'primary'\n */\n variant?: TabVariant;\n}> {}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["TabProps.ts"],"sourcesContent":["import React from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport type { TabBaseProps } from '../TabBase';\nimport type { OverridableComponentProps } from '../types';\n\nexport type TabVariant = 'primary' | 'secondary' | 'tertiary' | 'bottom-navigation' | 'contained';\nexport type TabIndicatorColor = 'primary' | 'secondary';\nexport type TabIndicatorSize = 'full' | 'fit-content';\n\nexport default interface TabProps extends OverridableComponentProps<TabBaseProps, {\n /**\n * If `true`, the badge is visible.\n * @default false\n */\n badgeVisible?: boolean;\n\n /**\n * The label of the Tab.\n */\n children: string | React.ReactElement;\n\n /**\n * If `true`, the indicator is enabled.\n * @default false\n */\n enableIndicator?: boolean;\n\n /**\n * If `true`, the component is selected.\n * @default false\n */\n selected?: boolean;\n\n /**\n * Element placed before the children.\n */\n icon?: React.ReactElement;\n\n /**\n * Tab indicator color\n * @default 'primary'\n */\n indicatorColor?: TabIndicatorColor;\n\n /**\n * The size of tab indicator.\n * 'full' adjusts the indicator to the size of the Tab,\n * while 'fit-content' adjusts the indicator to the size of the content inside the Tab.\n * @default 'full'\n */\n indicatorSize?: TabIndicatorSize;\n\n /**\n * If supplied, use this icon on selected state.\n */\n selectedIcon?: React.ReactElement;\n\n /**\n * The variant to use.\n * @default 'primary'\n */\n variant?: TabVariant;\n\n /**\n * Function to be passed to the child component's onLayout prop.\n */\n onTabInnerLayout?: (event: LayoutChangeEvent) => void;\n}> {}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './Tab';\nexport type { default as TabProps, TabVariant } from './TabProps'
|
|
1
|
+
{"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './Tab';\nexport type { default as TabProps, TabVariant, TabIndicatorSize } from './TabProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cloneElement, useContext, useEffect, useState } from 'react';
|
|
2
|
+
import InternalContext from './InternalContext';
|
|
3
|
+
export default function IndexAwareTab(props) {
|
|
4
|
+
const {
|
|
5
|
+
children,
|
|
6
|
+
index,
|
|
7
|
+
initialIndex
|
|
8
|
+
} = props;
|
|
9
|
+
const [selected, setSelected] = useState(initialIndex === index);
|
|
10
|
+
const {
|
|
11
|
+
indexStore
|
|
12
|
+
} = useContext(InternalContext);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
return indexStore.subscribe(currentIndex => {
|
|
15
|
+
setSelected(currentIndex === index);
|
|
16
|
+
});
|
|
17
|
+
}, [indexStore, index]);
|
|
18
|
+
return /*#__PURE__*/cloneElement(children, {
|
|
19
|
+
selected
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
;
|
|
23
|
+
//# sourceMappingURL=IndexAwareTab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["cloneElement","useContext","useEffect","useState","InternalContext","IndexAwareTab","props","children","index","initialIndex","selected","setSelected","indexStore","subscribe","currentIndex"],"sources":["IndexAwareTab.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport React, { cloneElement, useContext, useEffect, useState } from 'react';\nimport InternalContext from './InternalContext';\n\nexport interface IndexAwareTabProps {\n children: ReactElement;\n index: number;\n initialIndex: number;\n}\n\nexport default function IndexAwareTab(props: IndexAwareTabProps) {\n const {\n children,\n index,\n initialIndex,\n } = props;\n\n const [selected, setSelected] = useState(initialIndex === index);\n\n const { indexStore } = useContext(InternalContext);\n\n useEffect(() => {\n return indexStore.subscribe((currentIndex) => {\n setSelected(currentIndex === index);\n });\n }, [indexStore, index]);\n\n return cloneElement(children, { selected });\n};\n"],"mappings":"AACA,SAAgBA,YAAhB,EAA8BC,UAA9B,EAA0CC,SAA1C,EAAqDC,QAArD,QAAqE,OAArE;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AAQA,eAAe,SAASC,aAAT,CAAuBC,KAAvB,EAAkD;EAC7D,MAAM;IACFC,QADE;IAEFC,KAFE;IAGFC;EAHE,IAIFH,KAJJ;EAMA,MAAM,CAACI,QAAD,EAAWC,WAAX,IAA0BR,QAAQ,CAACM,YAAY,KAAKD,KAAlB,CAAxC;EAEA,MAAM;IAAEI;EAAF,IAAiBX,UAAU,CAACG,eAAD,CAAjC;EAEAF,SAAS,CAAC,MAAM;IACZ,OAAOU,UAAU,CAACC,SAAX,CAAsBC,YAAD,IAAkB;MAC1CH,WAAW,CAACG,YAAY,KAAKN,KAAlB,CAAX;IACH,CAFM,CAAP;EAGH,CAJQ,EAIN,CAACI,UAAD,EAAaJ,KAAb,CAJM,CAAT;EAMA,oBAAOR,YAAY,CAACO,QAAD,EAAW;IAAEG;EAAF,CAAX,CAAnB;AACH;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createContext","MockStore","InternalContext","indexStore"],"sources":["InternalContext.ts"],"sourcesContent":["import { createContext } from 'react';\nimport type { MonoStore } from '../store';\nimport { MockStore } from '../store';\n\nexport interface InternalContextValue {\n indexStore: MonoStore<number>;\n}\n\nconst InternalContext = createContext<InternalContextValue>({\n indexStore: new MockStore(),\n});\n\nexport default InternalContext;\n"],"mappings":"AAAA,SAASA,aAAT,QAA8B,OAA9B;AAEA,SAASC,SAAT,QAA0B,UAA1B;AAMA,MAAMC,eAAe,gBAAGF,aAAa,CAAuB;EACxDG,UAAU,EAAE,IAAIF,SAAJ;AAD4C,CAAvB,CAArC;AAIA,eAAeC,eAAf"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ScrollView } from 'react-native';
|
|
5
|
+
import useScrollViewReaction from './useScrollViewReaction';
|
|
6
|
+
export default function ScrollableTabsView(props) {
|
|
7
|
+
const {
|
|
8
|
+
coordinates,
|
|
9
|
+
initialIndex,
|
|
10
|
+
...scrollViewProps
|
|
11
|
+
} = props;
|
|
12
|
+
const {
|
|
13
|
+
scrollViewRef,
|
|
14
|
+
onLayout
|
|
15
|
+
} = useScrollViewReaction(initialIndex, coordinates);
|
|
16
|
+
return /*#__PURE__*/React.createElement(ScrollView, _extends({
|
|
17
|
+
ref: scrollViewRef,
|
|
18
|
+
onLayout: onLayout
|
|
19
|
+
}, scrollViewProps));
|
|
20
|
+
}
|
|
21
|
+
;
|
|
22
|
+
//# sourceMappingURL=ScrollableTabsView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","ScrollView","useScrollViewReaction","ScrollableTabsView","props","coordinates","initialIndex","scrollViewProps","scrollViewRef","onLayout"],"sources":["ScrollableTabsView.tsx"],"sourcesContent":["import React from 'react';\nimport type { ScrollViewProps } from 'react-native';\nimport { ScrollView } from 'react-native';\nimport TabCoordinate from './TabCoordinate';\nimport useScrollViewReaction from './useScrollViewReaction';\n\nexport interface ScrollableTabsViewProps extends ScrollViewProps {\n initialIndex: number;\n coordinates: TabCoordinate[];\n}\n\nexport default function ScrollableTabsView(props: ScrollableTabsViewProps) {\n const {\n coordinates,\n initialIndex,\n ...scrollViewProps\n } = props;\n\n const { scrollViewRef, onLayout } = useScrollViewReaction(initialIndex, coordinates);\n\n return (\n <ScrollView\n ref={scrollViewRef}\n onLayout={onLayout}\n {...scrollViewProps}\n />\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,SAASC,UAAT,QAA2B,cAA3B;AAEA,OAAOC,qBAAP,MAAkC,yBAAlC;AAOA,eAAe,SAASC,kBAAT,CAA4BC,KAA5B,EAA4D;EACvE,MAAM;IACFC,WADE;IAEFC,YAFE;IAGF,GAAGC;EAHD,IAIFH,KAJJ;EAMA,MAAM;IAAEI,aAAF;IAAiBC;EAAjB,IAA8BP,qBAAqB,CAACI,YAAD,EAAeD,WAAf,CAAzD;EAEA,oBACI,oBAAC,UAAD;IACI,GAAG,EAAEG,aADT;IAEI,QAAQ,EAAEC;EAFd,GAGQF,eAHR,EADJ;AAOH;AAAA"}
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import
|
|
3
|
+
import React, { useCallback, useContext, useEffect } from 'react';
|
|
4
|
+
import { Animated, Easing } from 'react-native';
|
|
5
5
|
import { useTheme } from '../styles';
|
|
6
|
+
import { useAnimatedValue } from '../hooks';
|
|
7
|
+
import { isNotAndroid12 } from '../utils';
|
|
6
8
|
import { defaultCoordinate } from './TabCoordinate';
|
|
9
|
+
import InternalContext from './InternalContext';
|
|
10
|
+
const INDICATOR_WIDTH = 10;
|
|
11
|
+
const INDICATOR_HEIGHT = 2;
|
|
12
|
+
const SCROLLABLE_TABS_INSET = 12 * 2;
|
|
7
13
|
|
|
8
|
-
const useStyles = function () {
|
|
14
|
+
const useStyles = function (color) {
|
|
9
15
|
const theme = useTheme();
|
|
10
16
|
return {
|
|
11
17
|
root: {
|
|
12
|
-
backgroundColor: theme.palette.
|
|
18
|
+
backgroundColor: theme.palette[color].main,
|
|
19
|
+
left: 0,
|
|
13
20
|
bottom: 0,
|
|
14
|
-
|
|
21
|
+
width: INDICATOR_WIDTH,
|
|
22
|
+
height: INDICATOR_HEIGHT,
|
|
15
23
|
position: 'absolute'
|
|
16
24
|
},
|
|
17
25
|
disabled: {
|
|
@@ -20,37 +28,70 @@ const useStyles = function () {
|
|
|
20
28
|
};
|
|
21
29
|
};
|
|
22
30
|
|
|
31
|
+
const startAnimation = (value, toValue) => {
|
|
32
|
+
Animated.timing(value, {
|
|
33
|
+
toValue: toValue,
|
|
34
|
+
duration: 300,
|
|
35
|
+
easing: Easing.bezier(0.25, 1, 0.5, 1),
|
|
36
|
+
useNativeDriver: isNotAndroid12
|
|
37
|
+
}).start();
|
|
38
|
+
};
|
|
39
|
+
|
|
23
40
|
export default function TabIndicator(props) {
|
|
24
41
|
const {
|
|
42
|
+
color = 'primary',
|
|
25
43
|
coordinates,
|
|
26
44
|
disabled,
|
|
45
|
+
initialIndex,
|
|
27
46
|
scrollable,
|
|
28
|
-
scrollValue,
|
|
29
47
|
style,
|
|
30
48
|
...otherProps
|
|
31
49
|
} = props;
|
|
32
|
-
const styles = useStyles();
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const rightInset = scrollable ? 24 : 0;
|
|
50
|
+
const styles = useStyles(color);
|
|
51
|
+
const computeAnimationValues = useCallback(currentIndex => {
|
|
52
|
+
const {
|
|
53
|
+
x1,
|
|
54
|
+
x2
|
|
55
|
+
} = coordinates[currentIndex] ?? defaultCoordinate;
|
|
56
|
+
const tabWidth = x2 - x1;
|
|
57
|
+
const nextTranslateX = x1 + (tabWidth - INDICATOR_WIDTH) / 2;
|
|
58
|
+
const inset = scrollable ? SCROLLABLE_TABS_INSET : 0;
|
|
59
|
+
const nextScaleX = (tabWidth - inset) / INDICATOR_WIDTH;
|
|
43
60
|
return {
|
|
44
|
-
|
|
45
|
-
|
|
61
|
+
tx: nextTranslateX,
|
|
62
|
+
sx: nextScaleX
|
|
63
|
+
};
|
|
64
|
+
}, [coordinates, scrollable]);
|
|
65
|
+
const {
|
|
66
|
+
tx: initialTx,
|
|
67
|
+
sx: initialSx
|
|
68
|
+
} = computeAnimationValues(initialIndex);
|
|
69
|
+
const translateX = useAnimatedValue(initialTx);
|
|
70
|
+
const scaleX = useAnimatedValue(initialSx);
|
|
71
|
+
const {
|
|
72
|
+
indexStore
|
|
73
|
+
} = useContext(InternalContext);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const scrollToIndex = index => {
|
|
76
|
+
const {
|
|
77
|
+
tx,
|
|
78
|
+
sx
|
|
79
|
+
} = computeAnimationValues(index);
|
|
80
|
+
startAnimation(translateX, tx);
|
|
81
|
+
startAnimation(scaleX, sx);
|
|
46
82
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}));
|
|
83
|
+
|
|
84
|
+
scrollToIndex(indexStore.getState());
|
|
85
|
+
return indexStore.subscribe(scrollToIndex);
|
|
86
|
+
}, [computeAnimationValues, coordinates, indexStore]);
|
|
52
87
|
return /*#__PURE__*/React.createElement(Animated.View, _extends({
|
|
53
|
-
style: [styles.root, disabled ? styles.disabled : undefined,
|
|
88
|
+
style: [styles.root, disabled ? styles.disabled : undefined, {
|
|
89
|
+
transform: [{
|
|
90
|
+
translateX
|
|
91
|
+
}, {
|
|
92
|
+
scaleX
|
|
93
|
+
}]
|
|
94
|
+
}, style]
|
|
54
95
|
}, otherProps));
|
|
55
96
|
}
|
|
56
97
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useContext","useEffect","Animated","Easing","useTheme","useAnimatedValue","isNotAndroid12","defaultCoordinate","InternalContext","INDICATOR_WIDTH","INDICATOR_HEIGHT","SCROLLABLE_TABS_INSET","useStyles","color","theme","root","backgroundColor","palette","main","left","bottom","width","height","position","disabled","startAnimation","value","toValue","timing","duration","easing","bezier","useNativeDriver","start","TabIndicator","props","coordinates","initialIndex","scrollable","style","otherProps","styles","computeAnimationValues","currentIndex","x1","x2","tabWidth","nextTranslateX","inset","nextScaleX","tx","sx","initialTx","initialSx","translateX","scaleX","indexStore","scrollToIndex","index","getState","subscribe","undefined","transform"],"sources":["TabIndicator.tsx"],"sourcesContent":["import React, { useCallback, useContext, useEffect } from 'react';\nimport { Animated, Easing } from 'react-native';\nimport { NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { useAnimatedValue } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\nimport type TabIndicatorProps from './TabIndicatorProps';\nimport type { TabIndicatorColor } from './TabIndicatorProps';\nimport { defaultCoordinate } from './TabCoordinate';\nimport InternalContext from './InternalContext';\n\ntype TabIndicatorStyles = NamedStylesStringUnion<'root' | 'disabled'>;\n\nconst INDICATOR_WIDTH = 10;\nconst INDICATOR_HEIGHT = 2;\n\nconst SCROLLABLE_TABS_INSET = 12 * 2;\n\nconst useStyles: (color: TabIndicatorColor) => TabIndicatorStyles =\n function (color: TabIndicatorColor): TabIndicatorStyles {\n const theme = useTheme();\n\n return {\n root: {\n backgroundColor: theme.palette[color].main,\n left: 0,\n bottom: 0,\n width: INDICATOR_WIDTH,\n height: INDICATOR_HEIGHT,\n position: 'absolute',\n },\n disabled: {\n height: 0,\n },\n };\n };\n\nconst startAnimation = (value: Animated.Value, toValue: number) => {\n Animated.timing(value, {\n toValue: toValue,\n duration: 300,\n easing: Easing.bezier(0.25, 1, 0.5, 1),\n useNativeDriver: isNotAndroid12,\n }).start();\n};\n\nexport default function TabIndicator(props: TabIndicatorProps) {\n const {\n color = 'primary',\n coordinates,\n disabled,\n initialIndex,\n scrollable,\n style,\n ...otherProps\n } = props;\n\n const styles = useStyles(color);\n\n const computeAnimationValues = useCallback((currentIndex: number) => {\n const { x1, x2 } = coordinates[currentIndex] ?? defaultCoordinate;\n\n const tabWidth = x2 - x1;\n\n const nextTranslateX = x1 + (tabWidth - INDICATOR_WIDTH) / 2;\n\n const inset = scrollable ? SCROLLABLE_TABS_INSET : 0;\n const nextScaleX = (tabWidth - inset) / INDICATOR_WIDTH;\n\n return { tx: nextTranslateX, sx: nextScaleX };\n }, [coordinates, scrollable]);\n\n const {\n tx: initialTx,\n sx: initialSx,\n } = computeAnimationValues(initialIndex);\n\n const translateX = useAnimatedValue(initialTx);\n const scaleX = useAnimatedValue(initialSx);\n\n const { indexStore } = useContext(InternalContext);\n\n useEffect(() => {\n const scrollToIndex = (index: number) => {\n const { tx, sx } = computeAnimationValues(index);\n\n startAnimation(translateX, tx);\n startAnimation(scaleX, sx);\n };\n\n scrollToIndex(indexStore.getState());\n\n return indexStore.subscribe(scrollToIndex);\n }, [\n computeAnimationValues,\n coordinates,\n indexStore,\n ]);\n\n return (\n <Animated.View\n style={[\n styles.root,\n disabled ? styles.disabled : undefined,\n { transform: [{ translateX }, { scaleX }] },\n style,\n ]}\n {...otherProps}\n />\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,EAA6BC,UAA7B,EAAyCC,SAAzC,QAA0D,OAA1D;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,cAAjC;AAEA,SAASC,QAAT,QAAyB,WAAzB;AACA,SAASC,gBAAT,QAAiC,UAAjC;AACA,SAASC,cAAT,QAA+B,UAA/B;AAGA,SAASC,iBAAT,QAAkC,iBAAlC;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AAIA,MAAMC,eAAe,GAAG,EAAxB;AACA,MAAMC,gBAAgB,GAAG,CAAzB;AAEA,MAAMC,qBAAqB,GAAG,KAAK,CAAnC;;AAEA,MAAMC,SAA2D,GAC7D,UAAUC,KAAV,EAAwD;EACpD,MAAMC,KAAK,GAAGV,QAAQ,EAAtB;EAEA,OAAO;IACHW,IAAI,EAAE;MACFC,eAAe,EAAEF,KAAK,CAACG,OAAN,CAAcJ,KAAd,EAAqBK,IADpC;MAEFC,IAAI,EAAE,CAFJ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;EACH,CAXyC,EAWvC,CAACb,WAAD,EAAcE,UAAd,CAXuC,CAA1C;EAaA,MAAM;IACFY,EAAE,EAAEE,SADF;IAEFD,EAAE,EAAEE;EAFF,IAGFX,sBAAsB,CAACL,YAAD,CAH1B;EAKA,MAAMiB,UAAU,GAAGjD,gBAAgB,CAAC+C,SAAD,CAAnC;EACA,MAAMG,MAAM,GAAGlD,gBAAgB,CAACgD,SAAD,CAA/B;EAEA,MAAM;IAAEG;EAAF,IAAiBxD,UAAU,CAACQ,eAAD,CAAjC;EAEAP,SAAS,CAAC,MAAM;IACZ,MAAMwD,aAAa,GAAIC,KAAD,IAAmB;MACrC,MAAM;QAAER,EAAF;QAAMC;MAAN,IAAaT,sBAAsB,CAACgB,KAAD,CAAzC;MAEAjC,cAAc,CAAC6B,UAAD,EAAaJ,EAAb,CAAd;MACAzB,cAAc,CAAC8B,MAAD,EAASJ,EAAT,CAAd;IACH,CALD;;IAOAM,aAAa,CAACD,UAAU,CAACG,QAAX,EAAD,CAAb;IAEA,OAAOH,UAAU,CAACI,SAAX,CAAqBH,aAArB,CAAP;EACH,CAXQ,EAWN,CACCf,sBADD,EAECN,WAFD,EAGCoB,UAHD,CAXM,CAAT;EAiBA,oBACI,oBAAC,QAAD,CAAU,IAAV;IACI,KAAK,EAAE,CACHf,MAAM,CAAC1B,IADJ,EAEHS,QAAQ,GAAGiB,MAAM,CAACjB,QAAV,GAAqBqC,SAF1B,EAGH;MAAEC,SAAS,EAAE,CAAC;QAAER;MAAF,CAAD,EAAiB;QAAEC;MAAF,CAAjB;IAAb,CAHG,EAIHhB,KAJG;EADX,GAOQC,UAPR,EADJ;AAWH;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["TabIndicatorProps.ts"],"sourcesContent":["import type { ViewProps } from 'react-native';\nimport type {
|
|
1
|
+
{"version":3,"names":[],"sources":["TabIndicatorProps.ts"],"sourcesContent":["import type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\nimport type TabCoordinate from './TabCoordinate';\n\nexport type TabIndicatorColor = 'primary' | 'secondary';\n\nexport default interface TabIndicatorProps extends OverridableComponentProps<ViewProps, {\n /**\n * Tab item coordinates.\n */\n coordinates: TabCoordinate[];\n\n /**\n * Indicator color.\n * @default: 'primary'\n */\n color?: TabIndicatorColor;\n\n /**\n * If `true`, the indicator is disabled.\n */\n disabled: boolean;\n\n /**\n * Initial index.\n */\n initialIndex: number;\n\n /**\n * If `true`, the tab will be able to scroll.\n */\n scrollable: boolean;\n}> {}\n"],"mappings":""}
|