@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,30 +1,34 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { TypographyProps } from '../Typography';
|
|
3
2
|
|
|
4
3
|
export default interface AccordionProps {
|
|
5
4
|
/**
|
|
6
|
-
* The
|
|
5
|
+
* The title of the component.
|
|
7
6
|
*/
|
|
8
|
-
|
|
7
|
+
title: string | React.ReactNode;
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
|
-
* The
|
|
10
|
+
* The subtitle of the component.
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
subTitle?: string | React.ReactNode;
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
|
-
* The
|
|
15
|
+
* The component to the left of the title.
|
|
16
|
+
*/
|
|
17
|
+
LeftComponent?: React.ReactNode;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The icon to the right of the title.
|
|
17
21
|
*/
|
|
18
22
|
RightIcon?: React.ReactElement;
|
|
19
23
|
|
|
20
24
|
/**
|
|
21
|
-
* The
|
|
25
|
+
* The content of the component.
|
|
22
26
|
*/
|
|
23
|
-
|
|
27
|
+
content: string | React.ReactNode;
|
|
24
28
|
|
|
25
29
|
/**
|
|
26
|
-
* The
|
|
27
|
-
* @default
|
|
30
|
+
* The initial state of expanding
|
|
31
|
+
* @default false
|
|
28
32
|
*/
|
|
29
|
-
|
|
33
|
+
isInitialExpanded?: boolean;
|
|
30
34
|
}
|
package/src/Badge/Badge.tsx
CHANGED
|
@@ -9,13 +9,12 @@ const defaultPosition: BadgePosition = {
|
|
|
9
9
|
horizontal: 'right',
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
type BadgeStyles = NamedStylesStringUnion<'root' | 'badge'
|
|
12
|
+
type BadgeStyles = NamedStylesStringUnion<'root' | 'badge'>;
|
|
13
13
|
|
|
14
14
|
const useStyles: UseStyles<BadgeStyles> = function (): BadgeStyles {
|
|
15
15
|
const theme = useTheme();
|
|
16
16
|
|
|
17
17
|
const dotSize = 4;
|
|
18
|
-
const offset = 0;
|
|
19
18
|
|
|
20
19
|
return {
|
|
21
20
|
root: {},
|
|
@@ -26,18 +25,6 @@ const useStyles: UseStyles<BadgeStyles> = function (): BadgeStyles {
|
|
|
26
25
|
position: 'absolute',
|
|
27
26
|
width: dotSize,
|
|
28
27
|
},
|
|
29
|
-
top: {
|
|
30
|
-
top: offset,
|
|
31
|
-
},
|
|
32
|
-
bottom: {
|
|
33
|
-
bottom: offset,
|
|
34
|
-
},
|
|
35
|
-
left: {
|
|
36
|
-
left: offset,
|
|
37
|
-
},
|
|
38
|
-
right: {
|
|
39
|
-
right: offset,
|
|
40
|
-
},
|
|
41
28
|
};
|
|
42
29
|
};
|
|
43
30
|
|
|
@@ -47,6 +34,7 @@ export default function Badge(props: BadgeProps) {
|
|
|
47
34
|
invisible = false,
|
|
48
35
|
position = defaultPosition,
|
|
49
36
|
style,
|
|
37
|
+
offset = 0,
|
|
50
38
|
...otherProps
|
|
51
39
|
} = props;
|
|
52
40
|
|
|
@@ -59,8 +47,10 @@ export default function Badge(props: BadgeProps) {
|
|
|
59
47
|
|
|
60
48
|
const badgeStyle = css([
|
|
61
49
|
styles.badge,
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
{
|
|
51
|
+
[position.vertical]: offset,
|
|
52
|
+
[position.horizontal]: offset,
|
|
53
|
+
},
|
|
64
54
|
]);
|
|
65
55
|
|
|
66
56
|
return (
|
package/src/Badge/BadgeProps.ts
CHANGED
package/src/Button/Button.tsx
CHANGED
|
@@ -42,6 +42,7 @@ export default function Button(props: ButtonProps) {
|
|
|
42
42
|
fullWidth = false,
|
|
43
43
|
href,
|
|
44
44
|
onPress,
|
|
45
|
+
pressEffect,
|
|
45
46
|
size = 'medium',
|
|
46
47
|
startIcon: startIconProp,
|
|
47
48
|
style: styleProp,
|
|
@@ -81,11 +82,11 @@ export default function Button(props: ButtonProps) {
|
|
|
81
82
|
const startIcon = cloneElementSafely(startIconProp, iconProps);
|
|
82
83
|
const endIcon = cloneElementSafely(endIconProp, iconProps);
|
|
83
84
|
|
|
84
|
-
const paddingSize = size === 'small' ? theme.spacing(
|
|
85
|
+
const paddingSize = size === 'small' ? theme.spacing(3) : theme.spacing(4);
|
|
85
86
|
const paddingLeft = startIcon ? paddingSize - theme.spacing(1) : paddingSize;
|
|
86
87
|
const paddingRight = endIcon ? paddingSize - theme.spacing(1) : paddingSize;
|
|
87
88
|
|
|
88
|
-
const borderRadius = theme.shape.
|
|
89
|
+
const borderRadius = theme.shape.roundnessLarge;
|
|
89
90
|
const buttonBaseStyle = css([
|
|
90
91
|
styles.root,
|
|
91
92
|
variantStyleMap[variant],
|
|
@@ -116,6 +117,10 @@ export default function Button(props: ButtonProps) {
|
|
|
116
117
|
{ textAlign: 'center' },
|
|
117
118
|
]);
|
|
118
119
|
|
|
120
|
+
const modifiedPressEffect = variant !== 'text' && !pressEffect
|
|
121
|
+
? 'scale'
|
|
122
|
+
: pressEffect;
|
|
123
|
+
|
|
119
124
|
const handlePress = async () => {
|
|
120
125
|
if (disabled) {
|
|
121
126
|
return;
|
|
@@ -136,6 +141,7 @@ export default function Button(props: ButtonProps) {
|
|
|
136
141
|
disabled={disabled}
|
|
137
142
|
onPress={handlePress}
|
|
138
143
|
style={buttonBaseStyle}
|
|
144
|
+
pressEffect={modifiedPressEffect}
|
|
139
145
|
{...otherProps}
|
|
140
146
|
>
|
|
141
147
|
{startIcon}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import React, { useCallback, useEffect } from 'react';
|
|
2
|
+
import { Animated } from 'react-native';
|
|
3
|
+
import { useAnimatedValue, useThrottle } from '../hooks';
|
|
4
|
+
import { isNotAndroid12 } from '../utils';
|
|
5
5
|
import { AnimatedPressable } from '../animated';
|
|
6
|
-
import { StyleSheet } from '../styles';
|
|
7
6
|
import type ButtonBaseProps from './ButtonBaseProps';
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
interface StartPressAnimation {
|
|
9
|
+
(pressIn: boolean, isHover: boolean): void;
|
|
10
|
+
}
|
|
9
11
|
|
|
10
12
|
export const ORIGINAL_OPACITY = 1;
|
|
11
13
|
export const DISABLED_OPACITY = .3;
|
|
@@ -14,14 +16,26 @@ const ACTIVE_OPACITY = .65;
|
|
|
14
16
|
const ORIGINAL_SCALE = 1;
|
|
15
17
|
const MINIFIED_SCALE = .96;
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
// at "node_modules/react-native/Libraries/Pressability.js"
|
|
20
|
+
// const DEFAULT_MIN_PRESS_DURATION = 130;
|
|
21
|
+
const SCALE_EFFECT_PRESS_IN_DELAY = 130;
|
|
22
|
+
const OPACITY_EFFECT_PRESS_IN_DELAY = 0;
|
|
23
|
+
|
|
24
|
+
type TimingAnimationValue = Animated.Value | Animated.ValueXY;
|
|
25
|
+
type TimingAnimationToValue = Animated.TimingAnimationConfig['toValue'];
|
|
18
26
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
const startTimingAnimationWithDefaults = (
|
|
28
|
+
value: TimingAnimationValue,
|
|
29
|
+
toValue: TimingAnimationToValue,
|
|
30
|
+
) => {
|
|
31
|
+
Animated.timing(value, {
|
|
32
|
+
toValue,
|
|
33
|
+
duration: 150,
|
|
34
|
+
useNativeDriver: isNotAndroid12,
|
|
35
|
+
}).start();
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const getOpacityByDisabled = (disabled: boolean) => disabled ? DISABLED_OPACITY : ORIGINAL_OPACITY;
|
|
25
39
|
|
|
26
40
|
export default function ButtonBase(props: ButtonBaseProps) {
|
|
27
41
|
const {
|
|
@@ -29,8 +43,10 @@ export default function ButtonBase(props: ButtonBaseProps) {
|
|
|
29
43
|
disabled = false,
|
|
30
44
|
disableThrottle = false,
|
|
31
45
|
onPress,
|
|
46
|
+
onPressOut,
|
|
32
47
|
pressEffect = 'opacity',
|
|
33
|
-
|
|
48
|
+
pressDelay: pressDelayOrNil,
|
|
49
|
+
style: styleProp,
|
|
34
50
|
throttleMillis = 650,
|
|
35
51
|
...otherProps
|
|
36
52
|
} = props;
|
|
@@ -40,56 +56,75 @@ export default function ButtonBase(props: ButtonBaseProps) {
|
|
|
40
56
|
callback: onPress,
|
|
41
57
|
});
|
|
42
58
|
|
|
43
|
-
const opacity =
|
|
44
|
-
const scale =
|
|
59
|
+
const opacity = useAnimatedValue(getOpacityByDisabled(disabled));
|
|
60
|
+
const scale = useAnimatedValue(ORIGINAL_SCALE);
|
|
45
61
|
|
|
46
|
-
|
|
47
|
-
opacity
|
|
48
|
-
|
|
49
|
-
}));
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
opacity.setValue(getOpacityByDisabled(disabled));
|
|
64
|
+
}, [disabled, pressEffect]);
|
|
50
65
|
|
|
51
|
-
|
|
66
|
+
const startScaleAnimation = useCallback<StartPressAnimation>((pressIn, isHover) => {
|
|
67
|
+
if (!isHover) {
|
|
68
|
+
startTimingAnimationWithDefaults(
|
|
69
|
+
scale,
|
|
70
|
+
pressIn ? MINIFIED_SCALE : ORIGINAL_SCALE,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}, []);
|
|
52
74
|
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
|
|
75
|
+
const startOpacityAnimation = useCallback<StartPressAnimation>((pressIn) => {
|
|
76
|
+
if (pressIn) {
|
|
77
|
+
opacity.setValue(ACTIVE_OPACITY);
|
|
78
|
+
} else {
|
|
79
|
+
startTimingAnimationWithDefaults(opacity, ORIGINAL_OPACITY);
|
|
56
80
|
}
|
|
81
|
+
}, []);
|
|
57
82
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
} else if (!isHovered) {
|
|
65
|
-
if (pressIn) {
|
|
66
|
-
scale.value = withDelay(
|
|
67
|
-
100,
|
|
68
|
-
withTiming(MINIFIED_SCALE, animationTimingConfig),
|
|
69
|
-
);
|
|
70
|
-
} else {
|
|
71
|
-
scale.value = withTiming(ORIGINAL_SCALE, animationTimingConfig);
|
|
72
|
-
}
|
|
83
|
+
const startPressAnimation = useCallback<StartPressAnimation>((pressIn, isHover = false) => {
|
|
84
|
+
if (pressEffect === 'scale') {
|
|
85
|
+
startScaleAnimation(pressIn, isHover);
|
|
86
|
+
} else if (pressEffect === 'opacity') {
|
|
87
|
+
startOpacityAnimation(pressIn, isHover);
|
|
73
88
|
}
|
|
89
|
+
}, [pressEffect]);
|
|
90
|
+
|
|
91
|
+
const handlePressIn = useCallback(() => {
|
|
92
|
+
startPressAnimation(true, false);
|
|
93
|
+
}, [startPressAnimation]);
|
|
94
|
+
|
|
95
|
+
const handlePressOut = useCallback(() => {
|
|
96
|
+
onPressOut && onPressOut();
|
|
97
|
+
|
|
98
|
+
startPressAnimation(false, false);
|
|
99
|
+
}, [startPressAnimation, onPressOut]);
|
|
100
|
+
|
|
101
|
+
const animatedStyle = {
|
|
102
|
+
opacity,
|
|
103
|
+
transform: [{ scale }],
|
|
74
104
|
};
|
|
75
105
|
|
|
106
|
+
const defaultPressDelay = pressEffect === 'scale'
|
|
107
|
+
? SCALE_EFFECT_PRESS_IN_DELAY
|
|
108
|
+
: OPACITY_EFFECT_PRESS_IN_DELAY;
|
|
109
|
+
const pressDelay = pressDelayOrNil ?? defaultPressDelay;
|
|
110
|
+
|
|
76
111
|
return (
|
|
77
112
|
<AnimatedPressable
|
|
78
113
|
disabled={disabled}
|
|
79
114
|
onPress={handlePress}
|
|
80
|
-
onPressIn={
|
|
81
|
-
onPressOut={
|
|
115
|
+
onPressIn={handlePressIn}
|
|
116
|
+
onPressOut={handlePressOut}
|
|
82
117
|
style={[
|
|
83
118
|
animatedStyle,
|
|
84
|
-
|
|
85
|
-
style,
|
|
119
|
+
styleProp,
|
|
86
120
|
]}
|
|
121
|
+
unstable_pressDelay={pressDelay}
|
|
87
122
|
{...otherProps}
|
|
88
123
|
>
|
|
89
124
|
{typeof children !== 'function' ? (
|
|
90
125
|
({ hovered }) => {
|
|
91
126
|
if (hovered !== undefined && !disabled) {
|
|
92
|
-
|
|
127
|
+
startPressAnimation(hovered, true);
|
|
93
128
|
}
|
|
94
129
|
|
|
95
130
|
return children;
|
|
@@ -26,12 +26,22 @@ export default interface ButtonBaseProps extends OverridableComponentProps<Press
|
|
|
26
26
|
*/
|
|
27
27
|
onPress?: () => void;
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Function to execute on press out.
|
|
31
|
+
*/
|
|
32
|
+
onPressOut?: () => void;
|
|
33
|
+
|
|
29
34
|
/**
|
|
30
35
|
* Applied press effect.
|
|
31
36
|
* @default 'opacity'
|
|
32
37
|
*/
|
|
33
38
|
pressEffect?: PressEffect;
|
|
34
39
|
|
|
40
|
+
/**
|
|
41
|
+
* The milliseconds to delay effect.
|
|
42
|
+
*/
|
|
43
|
+
pressDelay?: number;
|
|
44
|
+
|
|
35
45
|
/**
|
|
36
46
|
* The millisecond for debouncing.
|
|
37
47
|
* @default 650
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { CommonComponentColor, OverridableComponentProps } from '../types';
|
|
3
3
|
import type { ButtonBaseProps } from '../ButtonBase';
|
|
4
4
|
|
|
5
|
-
type BaseProps = Omit<ButtonBaseProps, 'onPress'>;
|
|
5
|
+
type BaseProps = Omit<ButtonBaseProps, 'onPress' | 'children'>;
|
|
6
6
|
|
|
7
7
|
export type CheckboxColor = CommonComponentColor;
|
|
8
8
|
|
package/src/Chip/Chip.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import type ChipProps from './ChipProps';
|
|
|
8
8
|
|
|
9
9
|
type ChipStyles = NamedStylesStringUnion<'root'>;
|
|
10
10
|
|
|
11
|
-
const ICON_SIZE =
|
|
11
|
+
const ICON_SIZE = 20;
|
|
12
12
|
|
|
13
13
|
const useStyles: UseStyles<ChipStyles> = function (): ChipStyles {
|
|
14
14
|
const theme = useTheme();
|
|
@@ -16,12 +16,12 @@ const useStyles: UseStyles<ChipStyles> = function (): ChipStyles {
|
|
|
16
16
|
return {
|
|
17
17
|
root: {
|
|
18
18
|
alignItems: 'center',
|
|
19
|
-
borderRadius:
|
|
19
|
+
borderRadius: theme.shape.roundnessExtra,
|
|
20
20
|
flexDirection: 'row',
|
|
21
21
|
height: 32,
|
|
22
22
|
justifyContent: 'center',
|
|
23
|
-
paddingLeft: theme.spacing(
|
|
24
|
-
paddingRight: theme.spacing(
|
|
23
|
+
paddingLeft: theme.spacing(3),
|
|
24
|
+
paddingRight: theme.spacing(3),
|
|
25
25
|
},
|
|
26
26
|
};
|
|
27
27
|
};
|
|
@@ -30,6 +30,7 @@ export default function Chip(props: ChipProps) {
|
|
|
30
30
|
const {
|
|
31
31
|
children,
|
|
32
32
|
endIcon: endIconProp,
|
|
33
|
+
numberOfLines,
|
|
33
34
|
onPress,
|
|
34
35
|
startIcon: startIconProp,
|
|
35
36
|
style: styleProp,
|
|
@@ -47,16 +48,16 @@ export default function Chip(props: ChipProps) {
|
|
|
47
48
|
const variantStyleMap = {
|
|
48
49
|
outlined: {
|
|
49
50
|
backgroundColor: theme.palette.paper.default,
|
|
50
|
-
borderColor: theme.palette.border,
|
|
51
|
-
borderWidth:
|
|
51
|
+
borderColor: theme.palette.border.default,
|
|
52
|
+
borderWidth: 1,
|
|
52
53
|
},
|
|
53
54
|
filled: {
|
|
54
55
|
backgroundColor: theme.palette.paper.grey,
|
|
55
56
|
},
|
|
56
57
|
bold: {
|
|
57
|
-
backgroundColor: theme.palette.paper.
|
|
58
|
+
backgroundColor: theme.palette.paper.default,
|
|
58
59
|
borderColor: theme.palette.primary.main,
|
|
59
|
-
borderWidth:
|
|
60
|
+
borderWidth: 1.5,
|
|
60
61
|
},
|
|
61
62
|
};
|
|
62
63
|
|
|
@@ -67,7 +68,9 @@ export default function Chip(props: ChipProps) {
|
|
|
67
68
|
]);
|
|
68
69
|
|
|
69
70
|
const fontStyle = createFontStyle(theme, {
|
|
70
|
-
selector: (typo) =>
|
|
71
|
+
selector: (typo) => variant === 'bold'
|
|
72
|
+
? typo.subtitle2
|
|
73
|
+
: typo.body2,
|
|
71
74
|
color: fontColor,
|
|
72
75
|
});
|
|
73
76
|
|
|
@@ -103,6 +106,7 @@ export default function Chip(props: ChipProps) {
|
|
|
103
106
|
|
|
104
107
|
<Text
|
|
105
108
|
children={children}
|
|
109
|
+
numberOfLines={numberOfLines}
|
|
106
110
|
style={textStyle}
|
|
107
111
|
/>
|
|
108
112
|
|
package/src/Chip/ChipProps.ts
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ViewProps } from 'react-native';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import { Animated, Easing } from 'react-native';
|
|
3
4
|
import { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
4
|
-
import Animated, { Easing, useAnimatedStyle, useSharedValue, withRepeat, withTiming } from 'react-native-reanimated';
|
|
5
5
|
import { CircularProgress as CircularProgressIcon } from '../internal/icons';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import type { OverridableComponentProps } from '../types';
|
|
7
|
+
import { useAnimatedValue } from '../hooks';
|
|
8
|
+
import { isNotAndroid12 } from '../utils';
|
|
8
9
|
|
|
9
10
|
type CircularProgressStyles = NamedStylesStringUnion<'root'>;
|
|
10
11
|
|
|
12
|
+
const MIN_ROTATE_DEGREE = 0;
|
|
13
|
+
const MAX_ROTATE_DEGREE = 360;
|
|
14
|
+
|
|
11
15
|
const useStyles: UseStyles<CircularProgressStyles> = function (): CircularProgressStyles {
|
|
12
16
|
return {
|
|
13
17
|
root: {
|
|
@@ -18,39 +22,43 @@ const useStyles: UseStyles<CircularProgressStyles> = function (): CircularProgre
|
|
|
18
22
|
};
|
|
19
23
|
|
|
20
24
|
export default function CircularProgress(props: OverridableComponentProps<ViewProps>) {
|
|
21
|
-
const { style } = props;
|
|
25
|
+
const { style: styleProp } = props;
|
|
22
26
|
|
|
23
27
|
const styles = useStyles();
|
|
24
28
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
);
|
|
29
|
+
const rotate = useAnimatedValue(MIN_ROTATE_DEGREE);
|
|
30
|
+
|
|
31
|
+
const animatedStyle = {
|
|
32
|
+
transform: [{
|
|
33
|
+
rotate: rotate.interpolate({
|
|
34
|
+
inputRange: [MIN_ROTATE_DEGREE, MAX_ROTATE_DEGREE],
|
|
35
|
+
outputRange: [`${MIN_ROTATE_DEGREE}deg`, `${MAX_ROTATE_DEGREE}deg`],
|
|
36
|
+
}),
|
|
37
|
+
}],
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
Animated.loop(
|
|
42
|
+
Animated.timing(
|
|
43
|
+
rotate,
|
|
44
|
+
{
|
|
45
|
+
toValue: MAX_ROTATE_DEGREE,
|
|
46
|
+
duration: 900,
|
|
47
|
+
easing: Easing.linear,
|
|
48
|
+
useNativeDriver: isNotAndroid12,
|
|
49
|
+
},
|
|
50
|
+
),
|
|
51
|
+
).start();
|
|
49
52
|
}, []);
|
|
50
53
|
|
|
51
54
|
return (
|
|
52
|
-
<Animated.View
|
|
53
|
-
<CircularProgressIcon/>
|
|
54
|
-
|
|
55
|
+
<Animated.View
|
|
56
|
+
children={<CircularProgressIcon/>}
|
|
57
|
+
style={[
|
|
58
|
+
animatedStyle,
|
|
59
|
+
styles.root,
|
|
60
|
+
styleProp,
|
|
61
|
+
]}
|
|
62
|
+
/>
|
|
55
63
|
);
|
|
56
64
|
};
|