@fountain-ui/core 3.0.0-alpha.4 → 3.0.0-alpha.41
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/build/commonjs/Accordion/Accordion.js +20 -13
- package/build/commonjs/Accordion/Accordion.js.map +1 -1
- package/build/commonjs/Accordion/AccordionProps.js.map +1 -1
- package/build/commonjs/Accordion/useVariantStyleMap.js +15 -8
- package/build/commonjs/Accordion/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/AppBar/AppBar.js +1 -1
- package/build/commonjs/AppBar/AppBar.js.map +1 -1
- package/build/commonjs/Badge/Badge.js +4 -3
- package/build/commonjs/Badge/Badge.js.map +1 -1
- package/build/commonjs/Badge/BadgeProps.js.map +1 -1
- package/build/commonjs/Badge/useVariantStyleMap.js +2 -2
- package/build/commonjs/Badge/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js +6 -2
- package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
- package/build/commonjs/BottomSheetTitle/BottomSheetTitleProps.js.map +1 -1
- package/build/commonjs/Button/Button.js +26 -12
- package/build/commonjs/Button/Button.js.map +1 -1
- package/build/commonjs/Button/ButtonProps.js.map +1 -1
- package/build/commonjs/Button/useVariantStyleMap.js +9 -0
- package/build/commonjs/Button/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/ButtonBase/ButtonBase.js +1 -1
- package/build/commonjs/ButtonBase/ButtonBase.js.map +1 -1
- package/build/commonjs/ButtonBase/index.js +2 -2
- package/build/commonjs/ButtonBase/index.js.map +1 -1
- package/build/commonjs/Checkbox/Checkbox.js +4 -1
- package/build/commonjs/Checkbox/Checkbox.js.map +1 -1
- package/build/commonjs/Checkbox/useVariantStyleMap.js +6 -2
- package/build/commonjs/Checkbox/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/Chip/Chip.js +25 -14
- package/build/commonjs/Chip/Chip.js.map +1 -1
- package/build/commonjs/Chip/ChipProps.js +3 -1
- package/build/commonjs/Chip/ChipProps.js.map +1 -1
- package/build/commonjs/Chip/index.js +6 -0
- package/build/commonjs/Chip/index.js.map +1 -1
- package/build/commonjs/Chip/useChipStyle.js +51 -31
- package/build/commonjs/Chip/useChipStyle.js.map +1 -1
- package/build/commonjs/Dialog/Dialog.js +10 -12
- package/build/commonjs/Dialog/Dialog.js.map +1 -1
- package/build/commonjs/Dialog/DialogProps.js +1 -1
- package/build/commonjs/Dialog/DialogProps.js.map +1 -1
- package/build/commonjs/Dialog/useDialogSectionStyle.js +6 -4
- package/build/commonjs/Dialog/useDialogSectionStyle.js.map +1 -1
- package/build/commonjs/Dialog/useDialogStyle.js +19 -8
- package/build/commonjs/Dialog/useDialogStyle.js.map +1 -1
- package/build/commonjs/DialogActions/DialogActions.js +0 -1
- package/build/commonjs/DialogActions/DialogActions.js.map +1 -1
- package/build/commonjs/DialogTitle/DialogLargeTitle.js +80 -0
- package/build/commonjs/DialogTitle/DialogLargeTitle.js.map +1 -0
- package/build/commonjs/DialogTitle/DialogTitle.js +8 -4
- package/build/commonjs/DialogTitle/DialogTitle.js.map +1 -1
- package/build/commonjs/Divider/Divider.js +17 -9
- package/build/commonjs/Divider/Divider.js.map +1 -1
- package/build/commonjs/Divider/DividerProps.js +1 -1
- package/build/commonjs/Divider/DividerProps.js.map +1 -1
- package/build/commonjs/Empty/Empty.js +1 -1
- package/build/commonjs/Empty/Empty.js.map +1 -1
- package/build/commonjs/Flexbox/Flexbox.js +2 -0
- package/build/commonjs/Flexbox/Flexbox.js.map +1 -1
- package/build/commonjs/Flexbox/FlexboxProps.js.map +1 -1
- package/build/commonjs/IconButton/IconButton.js +3 -0
- package/build/commonjs/IconButton/IconButton.js.map +1 -1
- package/build/commonjs/IconButton/IconButtonProps.js +1 -1
- package/build/commonjs/IconButton/IconButtonProps.js.map +1 -1
- package/build/commonjs/Image/Image.js +2 -2
- package/build/commonjs/Image/Image.js.map +1 -1
- package/build/commonjs/ImageCore/ImageCoreNative.js +1 -1
- package/build/commonjs/ImageCore/ImageCoreNative.js.map +1 -1
- package/build/commonjs/ListItem/ListItem.js +38 -26
- package/build/commonjs/ListItem/ListItem.js.map +1 -1
- package/build/commonjs/ListItem/ListItemProps.js.map +1 -1
- package/build/commonjs/ListItemIcon/ListItemIcon.js +1 -2
- package/build/commonjs/ListItemIcon/ListItemIcon.js.map +1 -1
- package/build/commonjs/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
- package/build/commonjs/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
- package/build/commonjs/ListItemText/ListItemText.js +20 -21
- package/build/commonjs/ListItemText/ListItemText.js.map +1 -1
- package/build/commonjs/ListItemText/ListItemTextProps.js.map +1 -1
- package/build/commonjs/ListSubheader/ListSubheader.js +1 -1
- package/build/commonjs/ListSubheader/ListSubheader.js.map +1 -1
- package/build/commonjs/Modal/Modal.js +1 -1
- package/build/commonjs/Modal/Modal.js.map +1 -1
- package/build/commonjs/Pagination/NumberPagination.js +4 -2
- package/build/commonjs/Pagination/NumberPagination.js.map +1 -1
- package/build/commonjs/Pagination/Pagination.js +2 -0
- package/build/commonjs/Pagination/Pagination.js.map +1 -1
- package/build/commonjs/Pagination/PaginationProps.js +3 -1
- package/build/commonjs/Pagination/PaginationProps.js.map +1 -1
- package/build/commonjs/Pagination/index.js +6 -0
- package/build/commonjs/Pagination/index.js.map +1 -1
- package/build/commonjs/PaginationItem/PaginationItem.js +32 -22
- package/build/commonjs/PaginationItem/PaginationItem.js.map +1 -1
- package/build/commonjs/PaginationItem/PaginationItemProps.js.map +1 -1
- package/build/commonjs/Radio/Radio.js +11 -4
- package/build/commonjs/Radio/Radio.js.map +1 -1
- package/build/commonjs/RadioGroup/RadioGroup.js +2 -27
- package/build/commonjs/RadioGroup/RadioGroup.js.map +1 -1
- package/build/commonjs/Section/Section.js +32 -0
- package/build/commonjs/Section/Section.js.map +1 -0
- package/build/commonjs/Section/SectionProps.js +2 -0
- package/build/commonjs/Section/SectionProps.js.map +1 -0
- package/build/commonjs/Section/index.js +16 -0
- package/build/commonjs/Section/index.js.map +1 -0
- package/build/commonjs/ShadowView/ShadowView.native.js +4 -0
- package/build/commonjs/ShadowView/ShadowView.native.js.map +1 -1
- package/build/commonjs/SnackbarContent/SnackbarContent.js +26 -9
- package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
- package/build/commonjs/Tab/Tab.js +21 -19
- package/build/commonjs/Tab/Tab.js.map +1 -1
- package/build/commonjs/Tab/TabProps.js +4 -2
- package/build/commonjs/Tab/TabProps.js.map +1 -1
- package/build/commonjs/Tab/index.js +14 -0
- package/build/commonjs/Tab/index.js.map +1 -1
- package/build/commonjs/Tab/useVariantStyleMap.js +59 -18
- package/build/commonjs/Tab/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/TabBase/TabBase.js +1 -8
- package/build/commonjs/TabBase/TabBase.js.map +1 -1
- package/build/commonjs/TabBase/TabBaseProps.js.map +1 -1
- package/build/commonjs/Tabs/Tabs.js +23 -7
- 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/useTabsStyle.js +81 -0
- package/build/commonjs/Tabs/useTabsStyle.js.map +1 -0
- package/build/commonjs/TextField/TextField.js +60 -15
- package/build/commonjs/TextField/TextField.js.map +1 -1
- package/build/commonjs/TextField/useVariantStyleMap.js +29 -29
- package/build/commonjs/TextField/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/Toolbar/BackButton/BackButton.js +47 -0
- package/build/commonjs/Toolbar/BackButton/BackButton.js.map +1 -0
- package/build/commonjs/Toolbar/BackButton/BackButtonProps.js +2 -0
- package/build/commonjs/Toolbar/BackButton/BackButtonProps.js.map +1 -0
- package/build/commonjs/Toolbar/BackButton/index.js +16 -0
- package/build/commonjs/Toolbar/BackButton/index.js.map +1 -0
- package/build/commonjs/Toolbar/Toolbar.js +22 -12
- package/build/commonjs/Toolbar/Toolbar.js.map +1 -1
- package/build/commonjs/Toolbar/ToolbarProps.js.map +1 -1
- package/build/commonjs/Tooltip/Beaks/index.js +32 -0
- package/build/commonjs/Tooltip/Beaks/index.js.map +1 -1
- package/build/commonjs/Tooltip/Tooltip.js +18 -22
- package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
- package/build/commonjs/Tooltip/TooltipProps.js.map +1 -1
- package/build/commonjs/Tooltip/index.js +19 -0
- package/build/commonjs/Tooltip/index.js.map +1 -1
- package/build/commonjs/Typography/Typography.js +9 -2
- package/build/commonjs/Typography/Typography.js.map +1 -1
- package/build/commonjs/Typography/TypographyProps.js.map +1 -1
- package/build/commonjs/hooks/useBreakpointUp.js +4 -1
- package/build/commonjs/hooks/useBreakpointUp.js.map +1 -1
- package/build/commonjs/hooks/useCollapsibleAppBar.js +21 -13
- package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/commonjs/hooks/useContentContainerStyle.js +39 -25
- package/build/commonjs/hooks/useContentContainerStyle.js.map +1 -1
- package/build/commonjs/hooks/useFadeInAppBar.js +4 -4
- package/build/commonjs/hooks/useFadeInAppBar.js.map +1 -1
- package/build/commonjs/index.js +21 -0
- package/build/commonjs/index.js.map +1 -1
- package/build/commonjs/internal/icons/AppBarChevronLeft.js +23 -0
- package/build/commonjs/internal/icons/AppBarChevronLeft.js.map +1 -0
- package/build/commonjs/internal/icons/ChevronLeft.js +4 -2
- package/build/commonjs/internal/icons/ChevronLeft.js.map +1 -1
- package/build/commonjs/internal/icons/ChevronRight.js +4 -2
- package/build/commonjs/internal/icons/ChevronRight.js.map +1 -1
- package/build/commonjs/internal/icons/ChipClose.js +23 -0
- package/build/commonjs/internal/icons/ChipClose.js.map +1 -0
- package/build/commonjs/internal/icons/Clear.js +3 -3
- package/build/commonjs/internal/icons/Clear.js.map +1 -1
- package/build/commonjs/internal/icons/Close.js +4 -2
- package/build/commonjs/internal/icons/Close.js.map +1 -1
- package/build/commonjs/internal/icons/Search.js +2 -2
- package/build/commonjs/internal/icons/Search.js.map +1 -1
- package/build/commonjs/internal/icons/index.js +16 -0
- package/build/commonjs/internal/icons/index.js.map +1 -1
- package/build/module/Accordion/Accordion.js +20 -13
- package/build/module/Accordion/Accordion.js.map +1 -1
- package/build/module/Accordion/AccordionProps.js.map +1 -1
- package/build/module/Accordion/useVariantStyleMap.js +15 -8
- package/build/module/Accordion/useVariantStyleMap.js.map +1 -1
- package/build/module/AppBar/AppBar.js +1 -1
- package/build/module/AppBar/AppBar.js.map +1 -1
- package/build/module/Badge/Badge.js +4 -3
- package/build/module/Badge/Badge.js.map +1 -1
- package/build/module/Badge/BadgeProps.js.map +1 -1
- package/build/module/Badge/useVariantStyleMap.js +2 -2
- package/build/module/Badge/useVariantStyleMap.js.map +1 -1
- package/build/module/BottomSheetTitle/BottomSheetTitle.js +6 -2
- package/build/module/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
- package/build/module/BottomSheetTitle/BottomSheetTitleProps.js.map +1 -1
- package/build/module/Button/Button.js +27 -13
- package/build/module/Button/Button.js.map +1 -1
- package/build/module/Button/ButtonProps.js.map +1 -1
- package/build/module/Button/useVariantStyleMap.js +9 -0
- package/build/module/Button/useVariantStyleMap.js.map +1 -1
- package/build/module/ButtonBase/ButtonBase.js +1 -1
- package/build/module/ButtonBase/ButtonBase.js.map +1 -1
- package/build/module/ButtonBase/index.js +1 -1
- package/build/module/ButtonBase/index.js.map +1 -1
- package/build/module/Checkbox/Checkbox.js +4 -1
- package/build/module/Checkbox/Checkbox.js.map +1 -1
- package/build/module/Checkbox/useVariantStyleMap.js +6 -2
- package/build/module/Checkbox/useVariantStyleMap.js.map +1 -1
- package/build/module/Chip/Chip.js +21 -13
- package/build/module/Chip/Chip.js.map +1 -1
- package/build/module/Chip/ChipProps.js +1 -0
- package/build/module/Chip/ChipProps.js.map +1 -1
- package/build/module/Chip/index.js +1 -1
- package/build/module/Chip/index.js.map +1 -1
- package/build/module/Chip/useChipStyle.js +51 -31
- package/build/module/Chip/useChipStyle.js.map +1 -1
- package/build/module/Dialog/Dialog.js +10 -11
- package/build/module/Dialog/Dialog.js.map +1 -1
- package/build/module/Dialog/DialogProps.js +1 -1
- package/build/module/Dialog/DialogProps.js.map +1 -1
- package/build/module/Dialog/useDialogSectionStyle.js +6 -4
- package/build/module/Dialog/useDialogSectionStyle.js.map +1 -1
- package/build/module/Dialog/useDialogStyle.js +18 -8
- package/build/module/Dialog/useDialogStyle.js.map +1 -1
- package/build/module/DialogActions/DialogActions.js +0 -1
- package/build/module/DialogActions/DialogActions.js.map +1 -1
- package/build/module/DialogTitle/DialogLargeTitle.js +65 -0
- package/build/module/DialogTitle/DialogLargeTitle.js.map +1 -0
- package/build/module/DialogTitle/DialogTitle.js +6 -3
- package/build/module/DialogTitle/DialogTitle.js.map +1 -1
- package/build/module/Divider/Divider.js +7 -0
- package/build/module/Divider/Divider.js.map +1 -1
- package/build/module/Divider/DividerProps.js +1 -1
- package/build/module/Divider/DividerProps.js.map +1 -1
- package/build/module/Empty/Empty.js +1 -1
- package/build/module/Empty/Empty.js.map +1 -1
- package/build/module/Flexbox/Flexbox.js +2 -0
- package/build/module/Flexbox/Flexbox.js.map +1 -1
- package/build/module/Flexbox/FlexboxProps.js.map +1 -1
- package/build/module/IconButton/IconButton.js +3 -0
- package/build/module/IconButton/IconButton.js.map +1 -1
- package/build/module/IconButton/IconButtonProps.js +1 -1
- package/build/module/IconButton/IconButtonProps.js.map +1 -1
- package/build/module/Image/Image.js +2 -2
- package/build/module/Image/Image.js.map +1 -1
- package/build/module/ImageCore/ImageCoreNative.js +1 -1
- package/build/module/ImageCore/ImageCoreNative.js.map +1 -1
- package/build/module/ListItem/ListItem.js +36 -28
- package/build/module/ListItem/ListItem.js.map +1 -1
- package/build/module/ListItem/ListItemProps.js.map +1 -1
- package/build/module/ListItemIcon/ListItemIcon.js +1 -2
- package/build/module/ListItemIcon/ListItemIcon.js.map +1 -1
- package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
- package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
- package/build/module/ListItemText/ListItemText.js +17 -19
- package/build/module/ListItemText/ListItemText.js.map +1 -1
- package/build/module/ListItemText/ListItemTextProps.js.map +1 -1
- package/build/module/ListSubheader/ListSubheader.js +1 -1
- package/build/module/ListSubheader/ListSubheader.js.map +1 -1
- package/build/module/Modal/Modal.js +1 -1
- package/build/module/Modal/Modal.js.map +1 -1
- package/build/module/Pagination/NumberPagination.js +4 -2
- package/build/module/Pagination/NumberPagination.js.map +1 -1
- package/build/module/Pagination/Pagination.js +2 -0
- package/build/module/Pagination/Pagination.js.map +1 -1
- package/build/module/Pagination/PaginationProps.js +1 -0
- package/build/module/Pagination/PaginationProps.js.map +1 -1
- package/build/module/Pagination/index.js +1 -1
- package/build/module/Pagination/index.js.map +1 -1
- package/build/module/PaginationItem/PaginationItem.js +28 -21
- package/build/module/PaginationItem/PaginationItem.js.map +1 -1
- package/build/module/PaginationItem/PaginationItemProps.js.map +1 -1
- package/build/module/Radio/Radio.js +10 -4
- package/build/module/Radio/Radio.js.map +1 -1
- package/build/module/RadioGroup/RadioGroup.js +2 -20
- package/build/module/RadioGroup/RadioGroup.js.map +1 -1
- package/build/module/Section/Section.js +19 -0
- package/build/module/Section/Section.js.map +1 -0
- package/build/module/Section/SectionProps.js +2 -0
- package/build/module/Section/SectionProps.js.map +1 -0
- package/build/module/Section/index.js +2 -0
- package/build/module/Section/index.js.map +1 -0
- package/build/module/ShadowView/ShadowView.native.js +4 -0
- package/build/module/ShadowView/ShadowView.native.js.map +1 -1
- package/build/module/SnackbarContent/SnackbarContent.js +26 -9
- package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
- package/build/module/Tab/Tab.js +22 -19
- package/build/module/Tab/Tab.js.map +1 -1
- package/build/module/Tab/TabProps.js +2 -1
- package/build/module/Tab/TabProps.js.map +1 -1
- package/build/module/Tab/index.js +1 -0
- package/build/module/Tab/index.js.map +1 -1
- package/build/module/Tab/useVariantStyleMap.js +59 -18
- package/build/module/Tab/useVariantStyleMap.js.map +1 -1
- package/build/module/TabBase/TabBase.js +1 -8
- package/build/module/TabBase/TabBase.js.map +1 -1
- package/build/module/TabBase/TabBaseProps.js.map +1 -1
- package/build/module/Tabs/Tabs.js +21 -7
- 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/useTabsStyle.js +71 -0
- package/build/module/Tabs/useTabsStyle.js.map +1 -0
- package/build/module/TextField/TextField.js +60 -15
- package/build/module/TextField/TextField.js.map +1 -1
- package/build/module/TextField/useVariantStyleMap.js +29 -29
- package/build/module/TextField/useVariantStyleMap.js.map +1 -1
- package/build/module/Toolbar/BackButton/BackButton.js +32 -0
- package/build/module/Toolbar/BackButton/BackButton.js.map +1 -0
- package/build/module/Toolbar/BackButton/BackButtonProps.js +2 -0
- package/build/module/Toolbar/BackButton/BackButtonProps.js.map +1 -0
- package/build/module/Toolbar/BackButton/index.js +2 -0
- package/build/module/Toolbar/BackButton/index.js.map +1 -0
- package/build/module/Toolbar/Toolbar.js +20 -12
- package/build/module/Toolbar/Toolbar.js.map +1 -1
- package/build/module/Toolbar/ToolbarProps.js.map +1 -1
- package/build/module/Tooltip/Beaks/index.js +4 -0
- package/build/module/Tooltip/Beaks/index.js.map +1 -1
- package/build/module/Tooltip/Tooltip.js +11 -14
- package/build/module/Tooltip/Tooltip.js.map +1 -1
- package/build/module/Tooltip/TooltipProps.js.map +1 -1
- package/build/module/Tooltip/index.js +1 -0
- package/build/module/Tooltip/index.js.map +1 -1
- package/build/module/Typography/Typography.js +9 -2
- package/build/module/Typography/Typography.js.map +1 -1
- package/build/module/Typography/TypographyProps.js.map +1 -1
- package/build/module/hooks/useBreakpointUp.js +4 -1
- package/build/module/hooks/useBreakpointUp.js.map +1 -1
- package/build/module/hooks/useCollapsibleAppBar.js +22 -13
- package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/module/hooks/useContentContainerStyle.js +43 -25
- package/build/module/hooks/useContentContainerStyle.js.map +1 -1
- package/build/module/hooks/useFadeInAppBar.js +4 -4
- package/build/module/hooks/useFadeInAppBar.js.map +1 -1
- package/build/module/index.js +2 -0
- package/build/module/index.js.map +1 -1
- package/build/module/internal/icons/AppBarChevronLeft.js +9 -0
- package/build/module/internal/icons/AppBarChevronLeft.js.map +1 -0
- package/build/module/internal/icons/ChevronLeft.js +4 -2
- package/build/module/internal/icons/ChevronLeft.js.map +1 -1
- package/build/module/internal/icons/ChevronRight.js +4 -2
- package/build/module/internal/icons/ChevronRight.js.map +1 -1
- package/build/module/internal/icons/ChipClose.js +9 -0
- package/build/module/internal/icons/ChipClose.js.map +1 -0
- package/build/module/internal/icons/Clear.js +3 -3
- package/build/module/internal/icons/Clear.js.map +1 -1
- package/build/module/internal/icons/Close.js +4 -2
- package/build/module/internal/icons/Close.js.map +1 -1
- package/build/module/internal/icons/Search.js +2 -2
- package/build/module/internal/icons/Search.js.map +1 -1
- package/build/module/internal/icons/index.js +2 -0
- package/build/module/internal/icons/index.js.map +1 -1
- package/build/typescript/Accordion/AccordionProps.d.ts +4 -1
- package/build/typescript/Accordion/useVariantStyleMap.d.ts +1 -0
- package/build/typescript/Badge/BadgeProps.d.ts +10 -5
- package/build/typescript/BottomSheetTitle/BottomSheetTitleProps.d.ts +1 -0
- package/build/typescript/Button/ButtonProps.d.ts +5 -0
- package/build/typescript/ButtonBase/index.d.ts +1 -1
- package/build/typescript/Checkbox/useVariantStyleMap.d.ts +1 -0
- package/build/typescript/Chip/ChipProps.d.ts +11 -4
- package/build/typescript/Chip/index.d.ts +1 -1
- package/build/typescript/Chip/useChipStyle.d.ts +6 -3
- package/build/typescript/Dialog/DialogProps.d.ts +1 -6
- package/build/typescript/Dialog/useDialogStyle.d.ts +1 -1
- package/build/typescript/DialogTitle/DialogLargeTitle.d.ts +9 -0
- package/build/typescript/DialogTitle/DialogTitle.d.ts +6 -1
- package/build/typescript/Divider/DividerProps.d.ts +1 -1
- package/build/typescript/Flexbox/FlexboxProps.d.ts +4 -0
- package/build/typescript/IconButton/IconButtonProps.d.ts +1 -1
- package/build/typescript/ListItem/ListItem.d.ts +1 -1
- package/build/typescript/ListItem/ListItemProps.d.ts +4 -0
- package/build/typescript/ListItemText/ListItemTextProps.d.ts +2 -9
- package/build/typescript/Pagination/PaginationProps.d.ts +12 -0
- package/build/typescript/Pagination/index.d.ts +2 -2
- package/build/typescript/PaginationItem/PaginationItemProps.d.ts +6 -0
- package/build/typescript/Section/Section.d.ts +3 -0
- package/build/typescript/Section/SectionProps.d.ts +6 -0
- package/build/typescript/Section/index.d.ts +2 -0
- package/build/typescript/Tab/TabProps.d.ts +21 -2
- package/build/typescript/Tab/index.d.ts +2 -1
- package/build/typescript/Tab/useVariantStyleMap.d.ts +4 -2
- package/build/typescript/TabBase/TabBaseProps.d.ts +0 -5
- package/build/typescript/Tabs/Tabs.d.ts +1 -1
- package/build/typescript/Tabs/TabsProps.d.ts +6 -1
- package/build/typescript/Tabs/index.d.ts +1 -1
- package/build/typescript/Tabs/useTabsStyle.d.ts +8 -0
- package/build/typescript/TextField/useVariantStyleMap.d.ts +2 -0
- package/build/typescript/Toolbar/BackButton/BackButton.d.ts +3 -0
- package/build/typescript/Toolbar/BackButton/BackButtonProps.d.ts +4 -0
- package/build/typescript/Toolbar/BackButton/index.d.ts +2 -0
- package/build/typescript/Toolbar/Toolbar.d.ts +6 -1
- package/build/typescript/Toolbar/ToolbarProps.d.ts +0 -5
- package/build/typescript/Tooltip/Beaks/index.d.ts +4 -0
- package/build/typescript/Tooltip/TooltipProps.d.ts +2 -2
- package/build/typescript/Tooltip/index.d.ts +1 -0
- package/build/typescript/Typography/TypographyProps.d.ts +4 -0
- package/build/typescript/hooks/useCollapsibleAppBar.d.ts +2 -1
- package/build/typescript/hooks/useContentContainerStyle.d.ts +5 -8
- package/build/typescript/index.d.ts +2 -0
- package/build/typescript/internal/icons/AppBarChevronLeft.d.ts +131 -0
- package/build/typescript/internal/icons/ChipClose.d.ts +131 -0
- package/build/typescript/internal/icons/index.d.ts +2 -0
- package/package.json +5 -5
- package/src/Accordion/Accordion.tsx +23 -14
- package/src/Accordion/AccordionProps.ts +4 -2
- package/src/Accordion/useVariantStyleMap.ts +14 -6
- package/src/AppBar/AppBar.tsx +2 -2
- package/src/Badge/Badge.tsx +4 -3
- package/src/Badge/BadgeProps.ts +12 -6
- package/src/Badge/useVariantStyleMap.ts +2 -2
- package/src/BottomSheetTitle/BottomSheetTitle.tsx +5 -1
- package/src/BottomSheetTitle/BottomSheetTitleProps.ts +1 -0
- package/src/Button/Button.tsx +28 -12
- package/src/Button/ButtonProps.ts +6 -0
- package/src/Button/useVariantStyleMap.ts +9 -0
- package/src/ButtonBase/ButtonBase.tsx +1 -1
- package/src/ButtonBase/index.ts +1 -1
- package/src/Checkbox/Checkbox.tsx +11 -8
- package/src/Checkbox/useVariantStyleMap.ts +6 -1
- package/src/Chip/Chip.tsx +24 -13
- package/src/Chip/ChipProps.ts +13 -4
- package/src/Chip/index.ts +1 -1
- package/src/Chip/useChipStyle.ts +59 -29
- package/src/Dialog/Dialog.tsx +12 -11
- package/src/Dialog/DialogProps.ts +1 -7
- package/src/Dialog/useDialogSectionStyle.ts +6 -4
- package/src/Dialog/useDialogStyle.ts +19 -7
- package/src/DialogActions/DialogActions.tsx +0 -1
- package/src/DialogTitle/DialogLargeTitle.tsx +95 -0
- package/src/DialogTitle/DialogTitle.tsx +6 -1
- package/src/Divider/Divider.tsx +5 -0
- package/src/Divider/DividerProps.ts +1 -1
- package/src/Empty/Empty.tsx +1 -1
- package/src/Flexbox/Flexbox.tsx +2 -0
- package/src/Flexbox/FlexboxProps.ts +5 -0
- package/src/IconButton/IconButton.tsx +2 -0
- package/src/IconButton/IconButtonProps.ts +1 -0
- package/src/Image/Image.tsx +3 -3
- package/src/ImageCore/ImageCoreNative.tsx +1 -1
- package/src/ListItem/ListItem.tsx +61 -30
- package/src/ListItem/ListItemProps.ts +5 -0
- package/src/ListItemIcon/ListItemIcon.tsx +1 -2
- package/src/ListItemSecondaryAction/ListItemSecondaryAction.tsx +2 -0
- package/src/ListItemText/ListItemText.tsx +20 -28
- package/src/ListItemText/ListItemTextProps.ts +2 -10
- package/src/ListSubheader/ListSubheader.tsx +1 -1
- package/src/Modal/Modal.tsx +1 -1
- package/src/Pagination/NumberPagination.tsx +7 -2
- package/src/Pagination/Pagination.tsx +3 -2
- package/src/Pagination/PaginationProps.ts +15 -0
- package/src/Pagination/index.ts +2 -2
- package/src/PaginationItem/PaginationItem.tsx +31 -24
- package/src/PaginationItem/PaginationItemProps.ts +7 -0
- package/src/Radio/Radio.tsx +12 -3
- package/src/RadioGroup/RadioGroup.tsx +2 -28
- package/src/Section/Section.tsx +26 -0
- package/src/Section/SectionProps.ts +6 -0
- package/src/Section/index.ts +2 -0
- package/src/ShadowView/ShadowView.native.tsx +4 -0
- package/src/SnackbarContent/SnackbarContent.tsx +36 -15
- package/src/Tab/Tab.tsx +32 -22
- package/src/Tab/TabProps.ts +25 -2
- package/src/Tab/index.ts +2 -1
- package/src/Tab/useVariantStyleMap.ts +72 -19
- package/src/TabBase/TabBase.tsx +1 -9
- package/src/TabBase/TabBaseProps.ts +0 -6
- package/src/Tabs/Tabs.tsx +26 -8
- package/src/Tabs/TabsProps.ts +7 -1
- package/src/Tabs/index.ts +1 -1
- package/src/Tabs/useTabsStyle.ts +79 -0
- package/src/TextField/TextField.tsx +99 -45
- package/src/TextField/useVariantStyleMap.ts +29 -27
- package/src/Toolbar/BackButton/BackButton.tsx +44 -0
- package/src/Toolbar/BackButton/BackButtonProps.ts +4 -0
- package/src/Toolbar/BackButton/index.ts +2 -0
- package/src/Toolbar/Toolbar.tsx +26 -17
- package/src/Toolbar/ToolbarProps.ts +0 -6
- package/src/Tooltip/Beaks/index.ts +4 -0
- package/src/Tooltip/Tooltip.tsx +10 -12
- package/src/Tooltip/TooltipProps.ts +2 -2
- package/src/Tooltip/index.ts +1 -0
- package/src/Typography/Typography.tsx +3 -1
- package/src/Typography/TypographyProps.ts +5 -0
- package/src/hooks/useBreakpointUp.ts +3 -1
- package/src/hooks/useCollapsibleAppBar.ts +27 -24
- package/src/hooks/useContentContainerStyle.ts +43 -31
- package/src/hooks/useFadeInAppBar.ts +4 -4
- package/src/index.ts +3 -0
- package/src/internal/icons/AppBarChevronLeft.tsx +15 -0
- package/src/internal/icons/ChevronLeft.tsx +4 -1
- package/src/internal/icons/ChevronRight.tsx +4 -1
- package/src/internal/icons/ChipClose.tsx +13 -0
- package/src/internal/icons/Clear.tsx +3 -3
- package/src/internal/icons/Close.tsx +4 -1
- package/src/internal/icons/Search.tsx +2 -2
- package/src/internal/icons/index.ts +2 -0
- package/build/commonjs/ButtonBase/LegacyButtonBase.js +0 -126
- package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +0 -1
- package/build/module/ButtonBase/LegacyButtonBase.js +0 -106
- package/build/module/ButtonBase/LegacyButtonBase.js.map +0 -1
- package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +0 -5
- package/src/ButtonBase/LegacyButtonBase.tsx +0 -135
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "AppBarChevronLeft", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _AppBarChevronLeft.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "Check", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function () {
|
|
@@ -51,6 +57,12 @@ Object.defineProperty(exports, "ChevronRight", {
|
|
|
51
57
|
return _ChevronRight.default;
|
|
52
58
|
}
|
|
53
59
|
});
|
|
60
|
+
Object.defineProperty(exports, "ChipClose", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function () {
|
|
63
|
+
return _ChipClose.default;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
54
66
|
Object.defineProperty(exports, "CircularProgress", {
|
|
55
67
|
enumerable: true,
|
|
56
68
|
get: function () {
|
|
@@ -112,6 +124,8 @@ Object.defineProperty(exports, "Search", {
|
|
|
112
124
|
}
|
|
113
125
|
});
|
|
114
126
|
|
|
127
|
+
var _AppBarChevronLeft = _interopRequireDefault(require("./AppBarChevronLeft"));
|
|
128
|
+
|
|
115
129
|
var _Check = _interopRequireDefault(require("./Check"));
|
|
116
130
|
|
|
117
131
|
var _Checkbox = _interopRequireDefault(require("./Checkbox"));
|
|
@@ -128,6 +142,8 @@ var _ChevronLeft = _interopRequireDefault(require("./ChevronLeft"));
|
|
|
128
142
|
|
|
129
143
|
var _ChevronRight = _interopRequireDefault(require("./ChevronRight"));
|
|
130
144
|
|
|
145
|
+
var _ChipClose = _interopRequireDefault(require("./ChipClose"));
|
|
146
|
+
|
|
131
147
|
var _CircularProgress = _interopRequireDefault(require("./CircularProgress"));
|
|
132
148
|
|
|
133
149
|
var _Clear = _interopRequireDefault(require("./Clear"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default as Check } from './Check';\nexport { default as Checkbox } from './Checkbox';\nexport { default as CheckboxChecked } from './CheckboxChecked';\nexport { default as CheckboxOn } from './CheckboxOn';\nexport { default as CheckCircle } from './CheckCircle';\nexport { default as ChevronDown } from './ChevronDown';\nexport { default as ChevronLeft } from './ChevronLeft';\nexport { default as ChevronRight } from './ChevronRight';\nexport { default as CircularProgress } from './CircularProgress';\nexport { default as Clear } from './Clear';\nexport { default as Close } from './Close';\nexport { default as EyeOff } from './EyeOff';\nexport { default as EyeOn } from './EyeOn';\nexport { default as InfoCircle } from './InfoCircle';\nexport { default as LoadingSpinner } from './LoadingSpinner';\nexport { default as Radio } from './Radio';\nexport { default as RadioChecked } from './RadioChecked';\nexport { default as Search } from './Search';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default as AppBarChevronLeft } from './AppBarChevronLeft';\nexport { default as Check } from './Check';\nexport { default as Checkbox } from './Checkbox';\nexport { default as CheckboxChecked } from './CheckboxChecked';\nexport { default as CheckboxOn } from './CheckboxOn';\nexport { default as CheckCircle } from './CheckCircle';\nexport { default as ChevronDown } from './ChevronDown';\nexport { default as ChevronLeft } from './ChevronLeft';\nexport { default as ChevronRight } from './ChevronRight';\nexport { default as ChipClose } from './ChipClose';\nexport { default as CircularProgress } from './CircularProgress';\nexport { default as Clear } from './Clear';\nexport { default as Close } from './Close';\nexport { default as EyeOff } from './EyeOff';\nexport { default as EyeOn } from './EyeOn';\nexport { default as InfoCircle } from './InfoCircle';\nexport { default as LoadingSpinner } from './LoadingSpinner';\nexport { default as Radio } from './Radio';\nexport { default as RadioChecked } from './RadioChecked';\nexport { default as Search } from './Search';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
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
|
+
|
|
1
3
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
4
|
import { Text, View } from 'react-native';
|
|
3
5
|
import Animated, { useAnimatedStyle, useSharedValue, withDelay, withTiming } from 'react-native-reanimated';
|
|
@@ -40,7 +42,9 @@ export default function Accordion(props) {
|
|
|
40
42
|
RightIcon,
|
|
41
43
|
LeftComponent,
|
|
42
44
|
isInitialExpanded = false,
|
|
43
|
-
|
|
45
|
+
style: styleProp,
|
|
46
|
+
variant = 'solid',
|
|
47
|
+
...otherProps
|
|
44
48
|
} = props;
|
|
45
49
|
const styles = useStyles();
|
|
46
50
|
const theme = useTheme();
|
|
@@ -51,6 +55,7 @@ export default function Accordion(props) {
|
|
|
51
55
|
container: containerStyle,
|
|
52
56
|
content: contentStyle,
|
|
53
57
|
contentFont: contentFontStyle,
|
|
58
|
+
iconContainer: iconContainerStyle,
|
|
54
59
|
subTitleFont: subTitleFontStyle,
|
|
55
60
|
title: titleStyle,
|
|
56
61
|
titleFont: titleFontStyle
|
|
@@ -63,14 +68,14 @@ export default function Accordion(props) {
|
|
|
63
68
|
transform: [{
|
|
64
69
|
rotate: `${rotate.value}deg`
|
|
65
70
|
}]
|
|
66
|
-
}), []);
|
|
71
|
+
}), [rotate]);
|
|
67
72
|
const animatedContentBackgroundStyles = useAnimatedStyle(() => ({
|
|
68
73
|
height: animatedHeight.value,
|
|
69
74
|
overflow: 'hidden'
|
|
70
|
-
}), []);
|
|
75
|
+
}), [animatedHeight]);
|
|
71
76
|
const animatedContentStyle = useAnimatedStyle(() => ({
|
|
72
77
|
opacity: animatedOpacity.value
|
|
73
|
-
}), []);
|
|
78
|
+
}), [animatedOpacity]);
|
|
74
79
|
|
|
75
80
|
const onPress = () => {
|
|
76
81
|
setIsExpanded(prev => !prev);
|
|
@@ -91,10 +96,10 @@ export default function Accordion(props) {
|
|
|
91
96
|
animatedHeight.value = withTiming(isExpanded ? contentHeight : 0, ANIMATION_CONFIG);
|
|
92
97
|
animatedOpacity.value = isExpanded ? withDelay(CONTENT_OPACITY_DELAY_MILLIS, withTiming(1, ANIMATION_CONFIG)) : withTiming(0, ANIMATION_CONFIG);
|
|
93
98
|
}, [isExpanded, contentHeight]);
|
|
94
|
-
const rootStyle = css([styles.root, containerStyle]);
|
|
95
|
-
return /*#__PURE__*/React.createElement(Column, {
|
|
99
|
+
const rootStyle = css([styles.root, containerStyle, styleProp]);
|
|
100
|
+
return /*#__PURE__*/React.createElement(Column, _extends({
|
|
96
101
|
style: rootStyle
|
|
97
|
-
}, /*#__PURE__*/React.createElement(ButtonBase, {
|
|
102
|
+
}, otherProps), /*#__PURE__*/React.createElement(ButtonBase, {
|
|
98
103
|
onPress: onPress
|
|
99
104
|
}, /*#__PURE__*/React.createElement(Row, {
|
|
100
105
|
style: titleStyle
|
|
@@ -102,24 +107,26 @@ export default function Accordion(props) {
|
|
|
102
107
|
flexShrink: 1
|
|
103
108
|
}, /*#__PURE__*/React.createElement(Row, {
|
|
104
109
|
alignItems: 'center'
|
|
105
|
-
}, LeftComponent ? /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
110
|
+
}, LeftComponent ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
111
|
+
style: iconContainerStyle
|
|
112
|
+
}, LeftComponent), /*#__PURE__*/React.createElement(Spacer, {
|
|
106
113
|
size: 1.5
|
|
107
114
|
})) : null, /*#__PURE__*/React.createElement(Text, {
|
|
108
115
|
allowFontScaling: false,
|
|
109
116
|
children: title,
|
|
110
|
-
numberOfLines:
|
|
117
|
+
numberOfLines: 3,
|
|
111
118
|
style: titleFontStyle
|
|
112
|
-
})), subTitle && variant === 'solid' ?
|
|
119
|
+
})), subTitle && variant === 'solid' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Spacer, {
|
|
113
120
|
size: 1.5
|
|
114
|
-
}), /*#__PURE__*/React.createElement(Text, {
|
|
121
|
+
}), typeof subTitle === 'string' ? /*#__PURE__*/React.createElement(Text, {
|
|
115
122
|
allowFontScaling: false,
|
|
116
123
|
children: subTitle,
|
|
117
124
|
numberOfLines: 1,
|
|
118
125
|
style: subTitleFontStyle
|
|
119
|
-
})
|
|
126
|
+
}) : subTitle) : null), /*#__PURE__*/React.createElement(Spacer, {
|
|
120
127
|
flex: 1
|
|
121
128
|
}), /*#__PURE__*/React.createElement(Spacer, {
|
|
122
|
-
size:
|
|
129
|
+
size: 4
|
|
123
130
|
}), /*#__PURE__*/React.createElement(Animated.View, {
|
|
124
131
|
style: animatedChevronDownStyles
|
|
125
132
|
}, /*#__PURE__*/React.createElement(View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRef","useState","Text","View","Animated","useAnimatedStyle","useSharedValue","withDelay","withTiming","css","useTheme","ChevronDown","ButtonBase","Column","Row","Spacer","useVariantStyleMap","ROTATE_HIDE_DEGREE","ROTATE_SHOW_DEGREE","ANIMATION_CONFIG","duration","INITIAL_EXPANDED_DELAY_MILLIS","CONTENT_OPACITY_DELAY_MILLIS","useStyles","theme","root","marginBottom","spacing","rightIcon","alignItems","height","justifyContent","width","Accordion","props","title","subTitle","content","RightIcon","LeftComponent","isInitialExpanded","variant","styles","CONTENT_MARGIN_HEIGHT","isExpanded","setIsExpanded","shouldInitialExpandedRef","container","containerStyle","contentStyle","contentFont","contentFontStyle","subTitleFont","subTitleFontStyle","titleStyle","titleFont","titleFontStyle","rotate","animatedOpacity","animatedHeight","contentHeight","setContentHeight","animatedChevronDownStyles","transform","value","animatedContentBackgroundStyles","overflow","animatedContentStyle","opacity","onPress","prev","onLayout","event","nativeEvent","layout","current","setTimeout","rootStyle"],"sources":["Accordion.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { LayoutChangeEvent, Text, View, ViewStyle } from 'react-native';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withTiming,\n WithTimingConfig,\n} from 'react-native-reanimated';\nimport { css, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { ChevronDown } from '../internal/icons';\nimport ButtonBase from '../ButtonBase';\nimport Column from '../Column';\nimport Row from '../Row';\nimport Spacer from '../Spacer';\nimport type AccordionProps from './AccordionProps';\nimport type { AccordionVariant } from './AccordionProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\ntype AccordionStyles = NamedStylesStringUnion<'root' | 'rightIcon'>;\n\nconst ROTATE_HIDE_DEGREE = 0;\nconst ROTATE_SHOW_DEGREE = 180;\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = { duration: 200 };\nconst INITIAL_EXPANDED_DELAY_MILLIS = 100;\nconst CONTENT_OPACITY_DELAY_MILLIS = 200;\n\nconst useStyles: UseStyles<AccordionStyles> = function (): AccordionStyles {\n const theme = useTheme();\n\n return {\n root: { marginBottom: theme.spacing(3) },\n rightIcon: {\n alignItems: 'center',\n height: 32,\n justifyContent: 'center',\n width: 32,\n },\n };\n};\n\nexport default function Accordion(props: AccordionProps) {\n const {\n title,\n subTitle,\n content,\n RightIcon,\n LeftComponent,\n isInitialExpanded = false,\n variant = 'solid' as AccordionVariant,\n } = props;\n\n const styles = useStyles();\n const theme = useTheme();\n const CONTENT_MARGIN_HEIGHT = theme.spacing(2);\n\n const [isExpanded, setIsExpanded] = useState<boolean>(false);\n const shouldInitialExpandedRef = useRef<boolean>(isInitialExpanded);\n\n const {\n container: containerStyle,\n content: contentStyle,\n contentFont: contentFontStyle,\n subTitleFont: subTitleFontStyle,\n title: titleStyle,\n titleFont: titleFontStyle,\n } = useVariantStyleMap(variant);\n\n const rotate = useSharedValue(ROTATE_HIDE_DEGREE);\n const animatedOpacity = useSharedValue(0);\n\n const animatedHeight = useSharedValue(0);\n const [contentHeight, setContentHeight] = useState(0);\n\n const animatedChevronDownStyles = useAnimatedStyle(() => ({\n transform: [{ rotate: `${rotate.value}deg` }],\n }), []);\n\n const animatedContentBackgroundStyles = useAnimatedStyle(() => ({\n height: animatedHeight.value,\n overflow: 'hidden',\n } as ViewStyle), []);\n\n const animatedContentStyle = useAnimatedStyle(() => ({\n opacity: animatedOpacity.value,\n }), []);\n\n const onPress = () => {\n setIsExpanded(prev => !prev);\n };\n\n const onLayout = (event: LayoutChangeEvent) => {\n const height = event.nativeEvent.layout.height + CONTENT_MARGIN_HEIGHT;\n setContentHeight(height);\n\n if (shouldInitialExpandedRef.current) {\n shouldInitialExpandedRef.current = false;\n setTimeout(() => setIsExpanded(true), INITIAL_EXPANDED_DELAY_MILLIS);\n }\n };\n\n useEffect(() => {\n rotate.value = withTiming(isExpanded ? ROTATE_SHOW_DEGREE : ROTATE_HIDE_DEGREE, ANIMATION_CONFIG);\n\n animatedHeight.value = withTiming(isExpanded ? contentHeight : 0, ANIMATION_CONFIG);\n\n animatedOpacity.value = isExpanded\n ? withDelay(CONTENT_OPACITY_DELAY_MILLIS, withTiming(1, ANIMATION_CONFIG))\n : withTiming(0, ANIMATION_CONFIG);\n }, [isExpanded, contentHeight]);\n\n const rootStyle = css([\n styles.root,\n containerStyle,\n ]);\n\n return (\n <Column style={rootStyle}>\n <ButtonBase onPress={onPress}>\n <Row style={titleStyle}>\n <Column flexShrink={1}>\n <Row alignItems={'center'}>\n {LeftComponent ? (\n <React.Fragment>\n {LeftComponent}\n\n <Spacer size={1.5}/>\n </React.Fragment>\n ) : null}\n\n <Text\n allowFontScaling={false}\n children={title}\n numberOfLines={1}\n style={titleFontStyle}\n />\n </Row>\n\n {subTitle && variant === 'solid' ?\n typeof subTitle === 'string' ? (\n <React.Fragment>\n <Spacer size={1.5}/>\n\n <Text\n allowFontScaling={false}\n children={subTitle}\n numberOfLines={1}\n style={subTitleFontStyle}\n />\n </React.Fragment>\n ) : (subTitle)\n : null}\n </Column>\n\n <Spacer flex={1}/>\n\n <Spacer size={3}/>\n\n <Animated.View style={animatedChevronDownStyles}>\n <View style={styles.rightIcon}>\n {RightIcon ? RightIcon : (\n <ChevronDown\n width={16}\n height={16}\n color={'base'}\n />\n )}\n </View>\n </Animated.View>\n </Row>\n </ButtonBase>\n\n <Animated.View style={animatedContentBackgroundStyles}>\n <View\n onLayout={onLayout}\n style={contentStyle}\n >\n <Animated.View style={animatedContentStyle}>\n {typeof content === 'string' ? (\n <Text\n allowFontScaling={false}\n children={content}\n style={contentFontStyle}\n />\n ) : (content)}\n </Animated.View>\n </View>\n </Animated.View>\n </Column>\n );\n}\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,MAA3B,EAAmCC,QAAnC,QAAmD,OAAnD;AACA,SAA4BC,IAA5B,EAAkCC,IAAlC,QAAyD,cAAzD;AACA,OAAOC,QAAP,IACIC,gBADJ,EAEIC,cAFJ,EAGIC,SAHJ,EAIIC,UAJJ,QAMO,yBANP;AAOA,SAASC,GAAT,QAAuD,qBAAvD;AACA,SAASC,QAAT,QAAyB,WAAzB;AACA,SAASC,WAAT,QAA4B,mBAA5B;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,GAAP,MAAgB,QAAhB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AAGA,OAAOC,kBAAP,MAA+B,sBAA/B;AAIA,MAAMC,kBAAkB,GAAG,CAA3B;AACA,MAAMC,kBAAkB,GAAG,GAA3B;AACA,MAAMC,gBAA4C,GAAG;EAAEC,QAAQ,EAAE;AAAZ,CAArD;AACA,MAAMC,6BAA6B,GAAG,GAAtC;AACA,MAAMC,4BAA4B,GAAG,GAArC;;AAEA,MAAMC,SAAqC,GAAG,YAA6B;EACvE,MAAMC,KAAK,GAAGd,QAAQ,EAAtB;EAEA,OAAO;IACHe,IAAI,EAAE;MAAEC,YAAY,EAAEF,KAAK,CAACG,OAAN,CAAc,CAAd;IAAhB,CADH;IAEHC,SAAS,EAAE;MACPC,UAAU,EAAE,QADL;MAEPC,MAAM,EAAE,EAFD;MAGPC,cAAc,EAAE,QAHT;MAIPC,KAAK,EAAE;IAJA;EAFR,CAAP;AASH,CAZD;;AAcA,eAAe,SAASC,SAAT,CAAmBC,KAAnB,EAA0C;EACrD,MAAM;IACFC,KADE;IAEFC,QAFE;IAGFC,OAHE;IAIFC,SAJE;IAKFC,aALE;IAMFC,iBAAiB,GAAG,KANlB;IAO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,KADtB;IAEI,QAAQ,EAAEA,OAFd;IAGI,KAAK,EAAEc;EAHX,EADH,GAMId,OAPT,CAJJ,CADJ,CAvDJ,CADJ;AA0EH"}
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useState","Text","View","Animated","useAnimatedStyle","useSharedValue","withDelay","withTiming","css","useTheme","ChevronDown","ButtonBase","Column","Row","Spacer","useVariantStyleMap","ROTATE_HIDE_DEGREE","ROTATE_SHOW_DEGREE","ANIMATION_CONFIG","duration","INITIAL_EXPANDED_DELAY_MILLIS","CONTENT_OPACITY_DELAY_MILLIS","useStyles","theme","root","marginBottom","spacing","rightIcon","alignItems","height","justifyContent","width","Accordion","props","title","subTitle","content","RightIcon","LeftComponent","isInitialExpanded","style","styleProp","variant","otherProps","styles","CONTENT_MARGIN_HEIGHT","isExpanded","setIsExpanded","shouldInitialExpandedRef","container","containerStyle","contentStyle","contentFont","contentFontStyle","iconContainer","iconContainerStyle","subTitleFont","subTitleFontStyle","titleStyle","titleFont","titleFontStyle","rotate","animatedOpacity","animatedHeight","contentHeight","setContentHeight","animatedChevronDownStyles","transform","value","animatedContentBackgroundStyles","overflow","animatedContentStyle","opacity","onPress","prev","onLayout","event","nativeEvent","layout","current","setTimeout","rootStyle"],"sources":["Accordion.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { LayoutChangeEvent, Text, View, ViewStyle } from 'react-native';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withDelay,\n withTiming,\n WithTimingConfig,\n} from 'react-native-reanimated';\nimport { css, NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { ChevronDown } from '../internal/icons';\nimport ButtonBase from '../ButtonBase';\nimport Column from '../Column';\nimport Row from '../Row';\nimport Spacer from '../Spacer';\nimport type AccordionProps from './AccordionProps';\nimport type { AccordionVariant } from './AccordionProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\ntype AccordionStyles = NamedStylesStringUnion<'root' | 'rightIcon'>;\n\nconst ROTATE_HIDE_DEGREE = 0;\nconst ROTATE_SHOW_DEGREE = 180;\nconst ANIMATION_CONFIG: Readonly<WithTimingConfig> = { duration: 200 };\nconst INITIAL_EXPANDED_DELAY_MILLIS = 100;\nconst CONTENT_OPACITY_DELAY_MILLIS = 200;\n\nconst useStyles: UseStyles<AccordionStyles> = function (): AccordionStyles {\n const theme = useTheme();\n\n return {\n root: { marginBottom: theme.spacing(3) },\n rightIcon: {\n alignItems: 'center',\n height: 32,\n justifyContent: 'center',\n width: 32,\n },\n };\n};\n\nexport default function Accordion(props: AccordionProps) {\n const {\n title,\n subTitle,\n content,\n RightIcon,\n LeftComponent,\n isInitialExpanded = false,\n style: styleProp,\n variant = 'solid' as AccordionVariant,\n ...otherProps\n } = props;\n\n const styles = useStyles();\n const theme = useTheme();\n const CONTENT_MARGIN_HEIGHT = theme.spacing(2);\n\n const [isExpanded, setIsExpanded] = useState<boolean>(false);\n const shouldInitialExpandedRef = useRef<boolean>(isInitialExpanded);\n\n const {\n container: containerStyle,\n content: contentStyle,\n contentFont: contentFontStyle,\n iconContainer: iconContainerStyle,\n subTitleFont: subTitleFontStyle,\n title: titleStyle,\n titleFont: titleFontStyle,\n } = useVariantStyleMap(variant);\n\n const rotate = useSharedValue(ROTATE_HIDE_DEGREE);\n const animatedOpacity = useSharedValue(0);\n\n const animatedHeight = useSharedValue(0);\n const [contentHeight, setContentHeight] = useState(0);\n\n const animatedChevronDownStyles = useAnimatedStyle(() => ({\n transform: [{ rotate: `${rotate.value}deg` }],\n }), [rotate]);\n\n const animatedContentBackgroundStyles = useAnimatedStyle(() => ({\n height: animatedHeight.value,\n overflow: 'hidden',\n } as ViewStyle), [animatedHeight]);\n\n const animatedContentStyle = useAnimatedStyle(() => ({\n opacity: animatedOpacity.value,\n }), [animatedOpacity]);\n\n const onPress = () => {\n setIsExpanded(prev => !prev);\n };\n\n const onLayout = (event: LayoutChangeEvent) => {\n const height = event.nativeEvent.layout.height + CONTENT_MARGIN_HEIGHT;\n setContentHeight(height);\n\n if (shouldInitialExpandedRef.current) {\n shouldInitialExpandedRef.current = false;\n setTimeout(() => setIsExpanded(true), INITIAL_EXPANDED_DELAY_MILLIS);\n }\n };\n\n useEffect(() => {\n rotate.value = withTiming(isExpanded ? ROTATE_SHOW_DEGREE : ROTATE_HIDE_DEGREE, ANIMATION_CONFIG);\n\n animatedHeight.value = withTiming(isExpanded ? contentHeight : 0, ANIMATION_CONFIG);\n\n animatedOpacity.value = isExpanded\n ? withDelay(CONTENT_OPACITY_DELAY_MILLIS, withTiming(1, ANIMATION_CONFIG))\n : withTiming(0, ANIMATION_CONFIG);\n }, [isExpanded, contentHeight]);\n\n const rootStyle = css([\n styles.root,\n containerStyle,\n styleProp,\n ]);\n\n return (\n <Column\n style={rootStyle}\n {...otherProps}\n >\n <ButtonBase onPress={onPress}>\n <Row style={titleStyle}>\n <Column flexShrink={1}>\n <Row alignItems={'center'}>\n {LeftComponent ? (\n <React.Fragment>\n <View style={iconContainerStyle}>\n {LeftComponent}\n </View>\n\n <Spacer size={1.5}/>\n </React.Fragment>\n ) : null}\n\n <Text\n allowFontScaling={false}\n children={title}\n numberOfLines={3}\n style={titleFontStyle}\n />\n </Row>\n\n {subTitle && variant === 'solid' ? (\n <React.Fragment>\n <Spacer size={1.5}/>\n\n {typeof subTitle === 'string' ? (\n <Text\n allowFontScaling={false}\n children={subTitle}\n numberOfLines={1}\n style={subTitleFontStyle}\n />\n ) : (subTitle)}\n </React.Fragment>\n ) : null}\n </Column>\n\n <Spacer flex={1}/>\n\n <Spacer size={4}/>\n\n <Animated.View style={animatedChevronDownStyles}>\n <View style={styles.rightIcon}>\n {RightIcon ? RightIcon : (\n <ChevronDown\n width={16}\n height={16}\n color={'base'}\n />\n )}\n </View>\n </Animated.View>\n </Row>\n </ButtonBase>\n\n <Animated.View style={animatedContentBackgroundStyles}>\n <View\n onLayout={onLayout}\n style={contentStyle}\n >\n <Animated.View style={animatedContentStyle}>\n {typeof content === 'string' ? (\n <Text\n allowFontScaling={false}\n children={content}\n style={contentFontStyle}\n />\n ) : (content)}\n </Animated.View>\n </View>\n </Animated.View>\n </Column>\n );\n}\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,MAA3B,EAAmCC,QAAnC,QAAmD,OAAnD;AACA,SAA4BC,IAA5B,EAAkCC,IAAlC,QAAyD,cAAzD;AACA,OAAOC,QAAP,IACIC,gBADJ,EAEIC,cAFJ,EAGIC,SAHJ,EAIIC,UAJJ,QAMO,yBANP;AAOA,SAASC,GAAT,QAAuD,qBAAvD;AACA,SAASC,QAAT,QAAyB,WAAzB;AACA,SAASC,WAAT,QAA4B,mBAA5B;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,GAAP,MAAgB,QAAhB;AACA,OAAOC,MAAP,MAAmB,WAAnB;AAGA,OAAOC,kBAAP,MAA+B,sBAA/B;AAIA,MAAMC,kBAAkB,GAAG,CAA3B;AACA,MAAMC,kBAAkB,GAAG,GAA3B;AACA,MAAMC,gBAA4C,GAAG;EAAEC,QAAQ,EAAE;AAAZ,CAArD;AACA,MAAMC,6BAA6B,GAAG,GAAtC;AACA,MAAMC,4BAA4B,GAAG,GAArC;;AAEA,MAAMC,SAAqC,GAAG,YAA6B;EACvE,MAAMC,KAAK,GAAGd,QAAQ,EAAtB;EAEA,OAAO;IACHe,IAAI,EAAE;MAAEC,YAAY,EAAEF,KAAK,CAACG,OAAN,CAAc,CAAd;IAAhB,CADH;IAEHC,SAAS,EAAE;MACPC,UAAU,EAAE,QADL;MAEPC,MAAM,EAAE,EAFD;MAGPC,cAAc,EAAE,QAHT;MAIPC,KAAK,EAAE;IAJA;EAFR,CAAP;AASH,CAZD;;AAcA,eAAe,SAASC,SAAT,CAAmBC,KAAnB,EAA0C;EACrD,MAAM;IACFC,KADE;IAEFC,QAFE;IAGFC,OAHE;IAIFC,SAJE;IAKFC,aAL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;IAAe,KAAK,EAAEgC;EAAtB,gBACI,oBAAC,IAAD;IACI,QAAQ,EAAEM,QADd;IAEI,KAAK,EAAExB;EAFX,gBAII,oBAAC,QAAD,CAAU,IAAV;IAAe,KAAK,EAAEoB;EAAtB,GACK,OAAOnC,OAAP,KAAmB,QAAnB,gBACG,oBAAC,IAAD;IACI,gBAAgB,EAAE,KADtB;IAEI,QAAQ,EAAEA,OAFd;IAGI,KAAK,EAAEiB;EAHX,EADH,GAMIjB,OAPT,CAJJ,CADJ,CA5DJ,CADJ;AA+EH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["accordionVariants"],"sources":["AccordionProps.ts"],"sourcesContent":["import React from 'react';\n\nexport const accordionVariants = ['solid', 'line', 'underline'] as const;\nexport type AccordionVariant = typeof accordionVariants[number];\n\nexport default interface AccordionProps {\n /**\n * The title of the component.\n */\n title: string | React.ReactNode;\n\n /**\n * The subtitle of the component. (Only for solid variant)\n */\n subTitle?: string | React.ReactNode;\n\n /**\n * The component to the left of the title.\n */\n LeftComponent?: React.ReactNode;\n\n /**\n * The icon to the right of the title.\n */\n RightIcon?: React.ReactElement;\n\n /**\n * The content of the component.\n */\n content: string | React.ReactNode;\n\n /**\n * The initial state of expanding\n * @default false\n */\n isInitialExpanded?: boolean;\n\n /**\n * Determines design variations of the component.\n * @default 'solid'\n */\n variant: AccordionVariant;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["accordionVariants"],"sources":["AccordionProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ColumnProps } from '../Column';\nimport type { OverridableComponentProps } from '../types';\n\nexport const accordionVariants = ['solid', 'line', 'underline'] as const;\nexport type AccordionVariant = typeof accordionVariants[number];\n\nexport default interface AccordionProps extends OverridableComponentProps<Omit<ColumnProps, 'children'>, {\n /**\n * The title of the component.\n */\n title: string | React.ReactNode;\n\n /**\n * The subtitle of the component. (Only for solid variant)\n */\n subTitle?: string | React.ReactNode;\n\n /**\n * The component to the left of the title.\n */\n LeftComponent?: React.ReactNode;\n\n /**\n * The icon to the right of the title.\n */\n RightIcon?: React.ReactElement;\n\n /**\n * The content of the component.\n */\n content: string | React.ReactNode;\n\n /**\n * The initial state of expanding\n * @default false\n */\n isInitialExpanded?: boolean;\n\n /**\n * Determines design variations of the component.\n * @default 'solid'\n */\n variant: AccordionVariant;\n}> {}\n"],"mappings":"AAIA,OAAO,MAAMA,iBAAiB,GAAG,CAAC,OAAD,EAAU,MAAV,EAAkB,WAAlB,CAA1B"}
|
|
@@ -15,10 +15,12 @@ export default function useVariantStyleMap(variant) {
|
|
|
15
15
|
content: {
|
|
16
16
|
borderTopColor: theme.palette.border.weak,
|
|
17
17
|
borderTopWidth: 0.5,
|
|
18
|
+
left: 0,
|
|
18
19
|
marginHorizontal: theme.spacing(4),
|
|
19
20
|
paddingBottom: theme.spacing(5),
|
|
20
21
|
paddingTop: theme.spacing(4),
|
|
21
|
-
position: 'absolute'
|
|
22
|
+
position: 'absolute',
|
|
23
|
+
right: 0
|
|
22
24
|
},
|
|
23
25
|
contentFont: createFontStyle(theme, {
|
|
24
26
|
selector: typography => typography.body3.regular,
|
|
@@ -36,9 +38,9 @@ export default function useVariantStyleMap(variant) {
|
|
|
36
38
|
},
|
|
37
39
|
titleFont: createFontStyle(theme, {
|
|
38
40
|
selector: _ => typographyOf({
|
|
39
|
-
fontSize:
|
|
40
|
-
lineHeight:
|
|
41
|
-
fontFamily: '
|
|
41
|
+
fontSize: 16,
|
|
42
|
+
lineHeight: 20.8,
|
|
43
|
+
fontFamily: 'PretendardStd-SemiBold',
|
|
42
44
|
letterSpacing: 0
|
|
43
45
|
}),
|
|
44
46
|
color: theme.palette.text.strong
|
|
@@ -55,15 +57,20 @@ export default function useVariantStyleMap(variant) {
|
|
|
55
57
|
content: {
|
|
56
58
|
borderTopColor: theme.palette.border.weak,
|
|
57
59
|
borderTopWidth: 0.5,
|
|
60
|
+
left: 0,
|
|
58
61
|
marginHorizontal: theme.spacing(4),
|
|
59
62
|
paddingBottom: theme.spacing(4),
|
|
60
63
|
paddingTop: theme.spacing(3),
|
|
61
|
-
position: 'absolute'
|
|
64
|
+
position: 'absolute',
|
|
65
|
+
right: 0
|
|
62
66
|
},
|
|
63
67
|
contentFont: createFontStyle(theme, {
|
|
64
68
|
selector: typography => typography.caption2.regular,
|
|
65
69
|
color: theme.palette.text.base
|
|
66
70
|
}),
|
|
71
|
+
iconContainer: {
|
|
72
|
+
paddingTop: 1
|
|
73
|
+
},
|
|
67
74
|
title: {
|
|
68
75
|
alignItems: 'center',
|
|
69
76
|
paddingBottom: theme.spacing(1),
|
|
@@ -102,9 +109,9 @@ export default function useVariantStyleMap(variant) {
|
|
|
102
109
|
},
|
|
103
110
|
titleFont: createFontStyle(theme, {
|
|
104
111
|
selector: _ => typographyOf({
|
|
105
|
-
fontSize:
|
|
106
|
-
lineHeight:
|
|
107
|
-
fontFamily: '
|
|
112
|
+
fontSize: 16,
|
|
113
|
+
lineHeight: 20.8,
|
|
114
|
+
fontFamily: 'PretendardStd-SemiBold',
|
|
108
115
|
letterSpacing: 0
|
|
109
116
|
}),
|
|
110
117
|
color: theme.palette.text.strong
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","typographyOf","createFontStyle","useTheme","useVariantStyleMap","variant","theme","container","backgroundColor","palette","surface","supportive","borderRadius","shape","radius","md","content","borderTopColor","border","weak","borderTopWidth","marginHorizontal","spacing","paddingBottom","paddingTop","position","contentFont","selector","typography","body3","regular","color","text","base","subTitleFont","caption1","title","alignItems","paddingLeft","paddingRight","paddingVertical","titleFont","_","fontSize","lineHeight","fontFamily","letterSpacing","strong","borderColor","borderWidth","caption2","caption1short","semiBold","borderBottomColor","borderBottomWidth"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { AccordionVariant } from './AccordionProps';\n\ninterface VariantStyle {\n container: FountainUiStyle;\n content: FountainUiStyle;\n contentFont: TextStyle;\n subTitleFont?: TextStyle;\n title: FountainUiStyle;\n titleFont: TextStyle;\n}\n\nexport default function useVariantStyleMap(variant: AccordionVariant): VariantStyle {\n const theme = useTheme();\n\n return useMemo(() => {\n switch (variant) {\n default:\n case 'solid':\n return {\n container: {\n backgroundColor: theme.palette.surface.supportive,\n borderRadius: theme.shape.radius.md,\n },\n content: {\n borderTopColor: theme.palette.border.weak,\n borderTopWidth: 0.5,\n marginHorizontal: theme.spacing(4),\n paddingBottom: theme.spacing(5),\n paddingTop: theme.spacing(4),\n position: 'absolute',\n },\n contentFont: createFontStyle(theme, {\n selector: (typography) => typography.body3.regular,\n color: theme.palette.text.base,\n }),\n subTitleFont: createFontStyle(theme, {\n selector: (typography) => typography.caption1.regular,\n color: theme.palette.text.base,\n }),\n title: {\n alignItems: 'center',\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(2),\n paddingVertical: theme.spacing(4),\n },\n titleFont: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 15,\n lineHeight: 19.5,\n fontFamily: 'Pretendard-SemiBold',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strong,\n }),\n };\n case 'line':\n return {\n container: {\n borderColor: theme.palette.border.weak,\n borderRadius: theme.shape.radius.md,\n borderWidth: 1,\n },\n content: {\n borderTopColor: theme.palette.border.weak,\n borderTopWidth: 0.5,\n marginHorizontal: theme.spacing(4),\n paddingBottom: theme.spacing(4),\n paddingTop: theme.spacing(3),\n position: 'absolute',\n },\n contentFont: createFontStyle(theme, {\n selector: (typography) => typography.caption2.regular,\n color: theme.palette.text.base,\n }),\n title: {\n alignItems: 'center',\n paddingBottom: theme.spacing(1),\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(2),\n paddingTop: theme.spacing(0.75),\n },\n titleFont: createFontStyle(theme, {\n selector: (typography) => typography.caption1short.semiBold,\n color: theme.palette.text.base,\n }),\n };\n case 'underline':\n return {\n container: {\n borderBottomColor: theme.palette.border.weak,\n borderBottomWidth: 1,\n },\n content: {\n borderTopColor: theme.palette.border.weak,\n borderTopWidth: 0.5,\n paddingBottom: theme.spacing(5),\n paddingLeft: theme.spacing(0.5),\n paddingRight: theme.spacing(2),\n paddingTop: theme.spacing(4),\n },\n contentFont: createFontStyle(theme, {\n selector: (typography) => typography.body3.regular,\n color: theme.palette.text.base,\n }),\n title: {\n alignItems: 'center',\n paddingLeft: theme.spacing(0.5),\n paddingVertical: theme.spacing(2),\n },\n titleFont: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 15,\n lineHeight: 19.5,\n fontFamily: 'Pretendard-SemiBold',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strong,\n }),\n };\n }\n }, [theme, variant]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAGA,SAASC,YAAT,QAA6B,qBAA7B;AACA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AAYA,eAAe,SAASC,kBAAT,CAA4BC,OAA5B,EAAqE;EAChF,MAAMC,KAAK,GAAGH,QAAQ,EAAtB;EAEA,OAAOH,OAAO,CAAC,MAAM;IACjB,QAAQK,OAAR;MACI;MACA,KAAK,OAAL;QACI,OAAO;UACHE,SAAS,EAAE;YACPC,eAAe,EAAEF,KAAK,CAACG,OAAN,CAAcC,OAAd,CAAsBC,UADhC;YAEPC,YAAY,EAAEN,KAAK,CAACO,KAAN,CAAYC,MAAZ,CAAmBC;UAF1B,CADR;UAKHC,OAAO,EAAE;YACLC,cAAc,EAAEX,KAAK,CAACG,OAAN,CAAcS,MAAd,CAAqBC,IADhC;YAELC,cAAc,EAAE,GAFX;YAGLC,gBAAgB,EAAEf,KAAK,CAACgB,OAAN,CAAc,CAAd,CAHb;YAILC,aAAa,EAAEjB,KAAK,CAACgB,OAAN,CAAc,CAAd,CAJV;YAKLE,UAAU,EAAElB,KAAK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AAqBC,IADhC;YAELC,cAAc,EAAE,GAFX;YAGLG,aAAa,EAAEjB,KAAK,CAACgB,OAAN,CAAc,CAAd,CAHV;YAILgB,WAAW,EAAEhC,KAAK,CAACgB,OAAN,CAAc,GAAd,CAJR;YAKLiB,YAAY,EAAEjC,KAAK,CAACgB,OAAN,CAAc,CAAd,CALT;YAMLE,UAAU,EAAElB,KAAK,CAACgB,OAAN,CAAc,CAAd;UANP,CALN;UAaHI,WAAW,EAAExB,eAAe,CAACI,KAAD,EAAQ;YAChCqB,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,KAAX,CAAiBC,OADX;YAEhCC,KAAK,EAAEzB,KAAK,CAACG,OAAN,CAAcuB,IAAd,CAAmBC;UAFM,CAAR,CAbzB;UAiBHG,KAAK,EAAE;YACHC,UAAU,EAAE,QADT;YAEHC,WAAW,EAAEhC,KAAK,CAACgB,OAAN,CAAc,GAAd,CAFV;YAGHkB,eAAe,EAAElC,KAAK,CAACgB,OAAN,CAAc,CAAd;UAHd,CAjBJ;UAsBHmB,SAAS,EAAEvC,eAAe,CAACI,KAAD,EAAQ;YAC9BqB,QAAQ,EAAGe,CAAD,IAAOzC,YAAY,CAAC;cAC1B0C,QAAQ,EAAE,EADgB;cAE1BC,UAAU,EAAE,IAFc;cAG1BC,UAAU,EAAE,qBAHc;cAI1BC,aAAa,EAAE;YAJW,CAAD,CADC;YAO9Bf,KAAK,EAAEzB,KAAK,CAACG,OAAN,CAAcuB,IAAd,CAAmBe;UAPI,CAAR;QAtBvB,CAAP;IAxER;EAyGH,CA1Ga,EA0GX,CAACzC,KAAD,EAAQD,OAAR,CA1GW,CAAd;AA2GH"}
|
|
1
|
+
{"version":3,"names":["useMemo","typographyOf","createFontStyle","useTheme","useVariantStyleMap","variant","theme","container","backgroundColor","palette","surface","supportive","borderRadius","shape","radius","md","content","borderTopColor","border","weak","borderTopWidth","left","marginHorizontal","spacing","paddingBottom","paddingTop","position","right","contentFont","selector","typography","body3","regular","color","text","base","subTitleFont","caption1","title","alignItems","paddingLeft","paddingRight","paddingVertical","titleFont","_","fontSize","lineHeight","fontFamily","letterSpacing","strong","borderColor","borderWidth","caption2","iconContainer","caption1short","semiBold","borderBottomColor","borderBottomWidth"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { typographyOf } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { AccordionVariant } from './AccordionProps';\n\ninterface VariantStyle {\n container: FountainUiStyle;\n content: FountainUiStyle;\n contentFont: TextStyle;\n iconContainer?: FountainUiStyle;\n subTitleFont?: TextStyle;\n title: FountainUiStyle;\n titleFont: TextStyle;\n}\n\nexport default function useVariantStyleMap(variant: AccordionVariant): VariantStyle {\n const theme = useTheme();\n\n return useMemo(() => {\n switch (variant) {\n default:\n case 'solid':\n return {\n container: {\n backgroundColor: theme.palette.surface.supportive,\n borderRadius: theme.shape.radius.md,\n },\n content: {\n borderTopColor: theme.palette.border.weak,\n borderTopWidth: 0.5,\n left: 0,\n marginHorizontal: theme.spacing(4),\n paddingBottom: theme.spacing(5),\n paddingTop: theme.spacing(4),\n position: 'absolute',\n right: 0,\n },\n contentFont: createFontStyle(theme, {\n selector: (typography) => typography.body3.regular,\n color: theme.palette.text.base,\n }),\n subTitleFont: createFontStyle(theme, {\n selector: (typography) => typography.caption1.regular,\n color: theme.palette.text.base,\n }),\n title: {\n alignItems: 'center',\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(2),\n paddingVertical: theme.spacing(4),\n },\n titleFont: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 16,\n lineHeight: 20.8,\n fontFamily: 'PretendardStd-SemiBold',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strong,\n }),\n };\n case 'line':\n return {\n container: {\n borderColor: theme.palette.border.weak,\n borderRadius: theme.shape.radius.md,\n borderWidth: 1,\n },\n content: {\n borderTopColor: theme.palette.border.weak,\n borderTopWidth: 0.5,\n left: 0,\n marginHorizontal: theme.spacing(4),\n paddingBottom: theme.spacing(4),\n paddingTop: theme.spacing(3),\n position: 'absolute',\n right: 0,\n },\n contentFont: createFontStyle(theme, {\n selector: (typography) => typography.caption2.regular,\n color: theme.palette.text.base,\n }),\n iconContainer: {\n paddingTop: 1,\n },\n title: {\n alignItems: 'center',\n paddingBottom: theme.spacing(1),\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(2),\n paddingTop: theme.spacing(0.75),\n },\n titleFont: createFontStyle(theme, {\n selector: (typography) => typography.caption1short.semiBold,\n color: theme.palette.text.base,\n }),\n };\n case 'underline':\n return {\n container: {\n borderBottomColor: theme.palette.border.weak,\n borderBottomWidth: 1,\n },\n content: {\n borderTopColor: theme.palette.border.weak,\n borderTopWidth: 0.5,\n paddingBottom: theme.spacing(5),\n paddingLeft: theme.spacing(0.5),\n paddingRight: theme.spacing(2),\n paddingTop: theme.spacing(4),\n },\n contentFont: createFontStyle(theme, {\n selector: (typography) => typography.body3.regular,\n color: theme.palette.text.base,\n }),\n title: {\n alignItems: 'center',\n paddingLeft: theme.spacing(0.5),\n paddingVertical: theme.spacing(2),\n },\n titleFont: createFontStyle(theme, {\n selector: (_) => typographyOf({\n fontSize: 16,\n lineHeight: 20.8,\n fontFamily: 'PretendardStd-SemiBold',\n letterSpacing: 0,\n }),\n color: theme.palette.text.strong,\n }),\n };\n }\n }, [theme, variant]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAGA,SAASC,YAAT,QAA6B,qBAA7B;AACA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AAaA,eAAe,SAASC,kBAAT,CAA4BC,OAA5B,EAAqE;EAChF,MAAMC,KAAK,GAAGH,QAAQ,EAAtB;EAEA,OAAOH,OAAO,CAAC,MAAM;IACjB,QAAQK,OAAR;MACI;MACA,KAAK,OAAL;QACI,OAAO;UACHE,SAAS,E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AD,EAAQ;YAC9BuB,QAAQ,EAAGe,CAAD,IAAO3C,YAAY,CAAC;cAC1B4C,QAAQ,EAAE,EADgB;cAE1BC,UAAU,EAAE,IAFc;cAG1BC,UAAU,EAAE,wBAHc;cAI1BC,aAAa,EAAE;YAJW,CAAD,CADC;YAO9Bf,KAAK,EAAE3B,KAAK,CAACG,OAAN,CAAcyB,IAAd,CAAmBe;UAPI,CAAR;QAtBvB,CAAP;IA/ER;EAgHH,CAjHa,EAiHX,CAAC3C,KAAD,EAAQD,OAAR,CAjHW,CAAd;AAkHH"}
|
|
@@ -25,7 +25,7 @@ const AppBar = /*#__PURE__*/React.forwardRef(function AppBar(props, ref) {
|
|
|
25
25
|
const theme = useTheme();
|
|
26
26
|
const styles = useStyles();
|
|
27
27
|
const backgroundColorMap = {
|
|
28
|
-
default: theme.palette.background.
|
|
28
|
+
default: theme.palette.background.base,
|
|
29
29
|
alt: theme.palette.background.alt
|
|
30
30
|
};
|
|
31
31
|
const paperStyle = css([styles.root, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","css","useTheme","useStyles","theme","root","flexDirection","flexShrink","width","zIndex","appBar","AppBar","forwardRef","props","ref","color","style","otherProps","styles","backgroundColorMap","default","palette","background","alt","paperStyle","backgroundColor"],"sources":["AppBar.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { css, useTheme } from '../styles';\nimport type AppBarProps from './AppBarProps';\nimport type { AppBarColor } from './AppBarProps';\n\ntype AppBarStyleKeys = 'root';\n\ntype AppBarStyles = NamedStylesStringUnion<AppBarStyleKeys>;\n\nconst useStyles: UseStyles<AppBarStyles> = function (): AppBarStyles {\n const theme = useTheme();\n\n return {\n root: {\n flexDirection: 'column',\n flexShrink: 0,\n width: '100%',\n zIndex: theme.zIndex.appBar,\n },\n };\n};\n\nconst AppBar = React.forwardRef<View, AppBarProps>(function AppBar(props, ref) {\n const {\n color = 'default',\n style,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const backgroundColorMap: Record<AppBarColor, string> = {\n default: theme.palette.background.
|
|
1
|
+
{"version":3,"names":["React","View","css","useTheme","useStyles","theme","root","flexDirection","flexShrink","width","zIndex","appBar","AppBar","forwardRef","props","ref","color","style","otherProps","styles","backgroundColorMap","default","palette","background","base","alt","paperStyle","backgroundColor"],"sources":["AppBar.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { css, useTheme } from '../styles';\nimport type AppBarProps from './AppBarProps';\nimport type { AppBarColor } from './AppBarProps';\n\ntype AppBarStyleKeys = 'root';\n\ntype AppBarStyles = NamedStylesStringUnion<AppBarStyleKeys>;\n\nconst useStyles: UseStyles<AppBarStyles> = function (): AppBarStyles {\n const theme = useTheme();\n\n return {\n root: {\n flexDirection: 'column',\n flexShrink: 0,\n width: '100%',\n zIndex: theme.zIndex.appBar,\n },\n };\n};\n\nconst AppBar = React.forwardRef<View, AppBarProps>(function AppBar(props, ref) {\n const {\n color = 'default',\n style,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const backgroundColorMap: Record<AppBarColor, string> = {\n default: theme.palette.background.base,\n alt: theme.palette.background.alt,\n };\n\n const paperStyle = css([\n styles.root,\n { backgroundColor: backgroundColorMap[color] },\n style,\n ]);\n\n return (\n <View\n ref={ref}\n style={paperStyle}\n {...otherProps}\n />\n );\n});\n\nexport default AppBar;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,GAAT,EAAcC,QAAd,QAA8B,WAA9B;;AAQA,MAAMC,SAAkC,GAAG,YAA0B;EACjE,MAAMC,KAAK,GAAGF,QAAQ,EAAtB;EAEA,OAAO;IACHG,IAAI,EAAE;MACFC,aAAa,EAAE,QADb;MAEFC,UAAU,EAAE,CAFV;MAGFC,KAAK,EAAE,MAHL;MAIFC,MAAM,EAAEL,KAAK,CAACK,MAAN,CAAaC;IAJnB;EADH,CAAP;AAQH,CAXD;;AAaA,MAAMC,MAAM,gBAAGZ,KAAK,CAACa,UAAN,CAAoC,SAASD,MAAT,CAAgBE,KAAhB,EAAuBC,GAAvB,EAA4B;EAC3E,MAAM;IACFC,KAAK,GAAG,SADN;IAEFC,KAFE;IAGF,GAAGC;EAHD,IAIFJ,KAJJ;EAMA,MAAMT,KAAK,GAAGF,QAAQ,EAAtB;EAEA,MAAMgB,MAAM,GAAGf,SAAS,EAAxB;EAEA,MAAMgB,kBAA+C,GAAG;IACpDC,OAAO,EAAEhB,KAAK,CAACiB,OAAN,CAAcC,UAAd,CAAyBC,IADkB;IAEpDC,GAAG,EAAEpB,KAAK,CAACiB,OAAN,CAAcC,UAAd,CAAyBE;EAFsB,CAAxD;EAKA,MAAMC,UAAU,GAAGxB,GAAG,CAAC,CACnBiB,MAAM,CAACb,IADY,EAEnB;IAAEqB,eAAe,EAAEP,kBAAkB,CAACJ,KAAD;EAArC,CAFmB,EAGnBC,KAHmB,CAAD,CAAtB;EAMA,oBACI,oBAAC,IAAD;IACI,GAAG,EAAEF,GADT;IAEI,KAAK,EAAEW;EAFX,GAGQR,UAHR,EADJ;AAOH,CA7Bc,CAAf;AA+BA,eAAeN,MAAf"}
|
|
@@ -13,12 +13,13 @@ export default function Badge(props) {
|
|
|
13
13
|
children,
|
|
14
14
|
color = 'accent',
|
|
15
15
|
content,
|
|
16
|
+
horizontalOffset = 0,
|
|
16
17
|
invisible = false,
|
|
17
18
|
position = defaultPosition,
|
|
18
19
|
size = 'medium',
|
|
19
20
|
style: styleProp,
|
|
20
|
-
offset = 0,
|
|
21
21
|
variant = 'dot',
|
|
22
|
+
verticalOffset = 0,
|
|
22
23
|
...otherProps
|
|
23
24
|
} = props;
|
|
24
25
|
const {
|
|
@@ -27,8 +28,8 @@ export default function Badge(props) {
|
|
|
27
28
|
} = useVariantStyleMap(variant, size, color);
|
|
28
29
|
const rootStyle = css([styleProp]);
|
|
29
30
|
const badgeStyle = css([baseBadgeStyle, {
|
|
30
|
-
[position.vertical]:
|
|
31
|
-
[position.horizontal]:
|
|
31
|
+
[position.vertical]: verticalOffset,
|
|
32
|
+
[position.horizontal]: horizontalOffset
|
|
32
33
|
}]);
|
|
33
34
|
return /*#__PURE__*/React.createElement(View, _extends({
|
|
34
35
|
style: rootStyle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","css","useVariantStyleMap","defaultPosition","vertical","horizontal","Badge","props","children","color","content","invisible","position","size","style","styleProp","
|
|
1
|
+
{"version":3,"names":["React","Text","View","css","useVariantStyleMap","defaultPosition","vertical","horizontal","Badge","props","children","color","content","horizontalOffset","invisible","position","size","style","styleProp","variant","verticalOffset","otherProps","badge","baseBadgeStyle","contentFont","contentFontStyle","rootStyle","badgeStyle","undefined"],"sources":["Badge.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { css } from '../styles';\nimport type BadgeProps from './BadgeProps';\nimport type { BadgeColor, BadgePosition, BadgeSize, BadgeVariant } from './BadgeProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\nconst defaultPosition: BadgePosition = {\n vertical: 'top',\n horizontal: 'right',\n};\n\nexport default function Badge(props: BadgeProps) {\n const {\n children,\n color = 'accent' as BadgeColor,\n content,\n horizontalOffset = 0,\n invisible = false,\n position = defaultPosition,\n size = 'medium' as BadgeSize,\n style: styleProp,\n variant = 'dot' as BadgeVariant,\n verticalOffset = 0,\n ...otherProps\n } = props;\n\n const {\n badge: baseBadgeStyle,\n contentFont: contentFontStyle,\n } = useVariantStyleMap(variant, size, color);\n\n const rootStyle = css([\n styleProp,\n ]);\n\n const badgeStyle = css([\n baseBadgeStyle,\n {\n [position.vertical]: verticalOffset,\n [position.horizontal]: horizontalOffset,\n },\n ]);\n\n return (\n <View\n style={rootStyle}\n {...otherProps}\n >\n {children}\n\n {!invisible ? (\n <View style={badgeStyle}>\n {content !== undefined && content !== null ? (\n <Text style={contentFontStyle}>{content}</Text>\n ) : null}\n </View>\n ) : null}\n </View>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AACA,SAASC,GAAT,QAAoB,WAApB;AAGA,OAAOC,kBAAP,MAA+B,sBAA/B;AAEA,MAAMC,eAA8B,GAAG;EACnCC,QAAQ,EAAE,KADyB;EAEnCC,UAAU,EAAE;AAFuB,CAAvC;AAKA,eAAe,SAASC,KAAT,CAAeC,KAAf,EAAkC;EAC7C,MAAM;IACFC,QADE;IAEFC,KAAK,GAAG,QAFN;IAGFC,OAHE;IAIFC,gBAAgB,GAAG,CAJjB;IAKFC,SAAS,GAAG,KALV;IAMFC,QAAQ,GAAGV,eANT;IAOFW,IAAI,GAAG,QAPL;IAQFC,KAAK,EAAEC,SARL;IASFC,OAAO,GAAG,KATR;IAUFC,cAAc,GAAG,CAVf;IAWF,GAAGC;EAXD,IAYFZ,KAZJ;EAcA,MAAM;IACFa,KAAK,EAAEC,cADL;IAEFC,WAAW,EAAEC;EAFX,IAGFrB,kBAAkB,CAACe,OAAD,EAAUH,IAAV,EAAgBL,KAAhB,CAHtB;EAKA,MAAMe,SAAS,GAAGvB,GAAG,CAAC,CAClBe,SADkB,CAAD,CAArB;EAIA,MAAMS,UAAU,GAAGxB,GAAG,CAAC,CACnBoB,cADmB,EAEnB;IACI,CAACR,QAAQ,CAACT,QAAV,GAAqBc,cADzB;IAEI,CAACL,QAAQ,CAACR,UAAV,GAAuBM;EAF3B,CAFmB,CAAD,CAAtB;EAQA,oBACI,oBAAC,IAAD;IACI,KAAK,EAAEa;EADX,GAEQL,UAFR,GAIKX,QAJL,EAMK,CAACI,SAAD,gBACG,oBAAC,IAAD;IAAM,KAAK,EAAEa;EAAb,GACKf,OAAO,KAAKgB,SAAZ,IAAyBhB,OAAO,KAAK,IAArC,gBACG,oBAAC,IAAD;IAAM,KAAK,EAAEa;EAAb,GAAgCb,OAAhC,CADH,GAEG,IAHR,CADH,GAMG,IAZR,CADJ;AAgBH;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["badgeHorizontalPositions","badgeVerticalPositions","badgeColors","badgeSizes","badgeVariants"],"sources":["BadgeProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\n\nexport const badgeHorizontalPositions = ['right', 'left'] as const;\nexport type BadgeHorizontalPosition = typeof badgeHorizontalPositions[number];\n\nexport const badgeVerticalPositions = ['top', 'bottom'] as const;\nexport type BadgeVerticalPosition = typeof badgeVerticalPositions[number];\n\nexport interface BadgePosition {\n vertical: BadgeVerticalPosition;\n horizontal: BadgeHorizontalPosition;\n}\n\nexport const badgeColors = ['accent', 'danger'] as const;\nexport type BadgeColor = typeof badgeColors[number];\n\nexport const badgeSizes = ['large', 'medium'] as const;\nexport type BadgeSize = typeof badgeSizes[number];\n\nexport const badgeVariants = ['dot', 'number'] as const;\nexport type BadgeVariant = typeof badgeVariants[number];\n\nexport default interface BadgeProps extends OverridableComponentProps<ViewProps, {\n /**\n * The badge will be added relative to this node.\n */\n children?: React.ReactNode;\n\n /**\n *\n * @default 'accent'\n */\n color?: BadgeColor;\n\n /**\n * (only number variant)\n */\n content?: number;\n\n /**\n * If `true`, the badge is invisible.\n * @default false\n */\n invisible?: boolean;\n\n /**\n * The position of the badge.\n * @default {\n * vertical: 'top',\n * horizontal: 'right',\n * }\n */\n position?: BadgePosition;\n\n /**\n
|
|
1
|
+
{"version":3,"names":["badgeHorizontalPositions","badgeVerticalPositions","badgeColors","badgeSizes","badgeVariants"],"sources":["BadgeProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ViewProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\n\nexport const badgeHorizontalPositions = ['right', 'left'] as const;\nexport type BadgeHorizontalPosition = typeof badgeHorizontalPositions[number];\n\nexport const badgeVerticalPositions = ['top', 'bottom'] as const;\nexport type BadgeVerticalPosition = typeof badgeVerticalPositions[number];\n\nexport interface BadgePosition {\n vertical: BadgeVerticalPosition;\n horizontal: BadgeHorizontalPosition;\n}\n\nexport const badgeColors = ['accent', 'danger'] as const;\nexport type BadgeColor = typeof badgeColors[number];\n\nexport const badgeSizes = ['large', 'medium'] as const;\nexport type BadgeSize = typeof badgeSizes[number];\n\nexport const badgeVariants = ['dot', 'number'] as const;\nexport type BadgeVariant = typeof badgeVariants[number];\n\nexport default interface BadgeProps extends OverridableComponentProps<ViewProps, {\n /**\n * The badge will be added relative to this node.\n */\n children?: React.ReactNode;\n\n /**\n *\n * @default 'accent'\n */\n color?: BadgeColor;\n\n /**\n * (only number variant)\n */\n content?: number;\n\n /**\n * The horizontal offset of the badge.\n * @default 0\n */\n horizontalOffset?: number;\n\n /**\n * If `true`, the badge is invisible.\n * @default false\n */\n invisible?: boolean;\n\n /**\n * The position of the badge.\n * @default {\n * vertical: 'top',\n * horizontal: 'right',\n * }\n */\n position?: BadgePosition;\n\n /**\n *\n */\n size?: BadgeSize;\n\n /**\n *\n * @default 'dot'\n */\n variant?: BadgeVariant;\n\n /**\n * The vertical offset of the badge.\n * @default 0\n */\n verticalOffset?: number;\n}> {}\n"],"mappings":"AAIA,OAAO,MAAMA,wBAAwB,GAAG,CAAC,OAAD,EAAU,MAAV,CAAjC;AAGP,OAAO,MAAMC,sBAAsB,GAAG,CAAC,KAAD,EAAQ,QAAR,CAA/B;AAQP,OAAO,MAAMC,WAAW,GAAG,CAAC,QAAD,EAAW,QAAX,CAApB;AAGP,OAAO,MAAMC,UAAU,GAAG,CAAC,OAAD,EAAU,QAAV,CAAnB;AAGP,OAAO,MAAMC,aAAa,GAAG,CAAC,KAAD,EAAQ,QAAR,CAAtB"}
|
|
@@ -37,13 +37,13 @@ export default function useVariantStyleMap(variant, size, color) {
|
|
|
37
37
|
large: typographyOf({
|
|
38
38
|
fontSize: 14,
|
|
39
39
|
lineHeight: 14,
|
|
40
|
-
fontFamily: '
|
|
40
|
+
fontFamily: 'PretendardStd-Bold',
|
|
41
41
|
letterSpacing: -0.7
|
|
42
42
|
}),
|
|
43
43
|
medium: typographyOf({
|
|
44
44
|
fontSize: 12,
|
|
45
45
|
lineHeight: 12,
|
|
46
|
-
fontFamily: '
|
|
46
|
+
fontFamily: 'PretendardStd-Bold',
|
|
47
47
|
letterSpacing: -0.6
|
|
48
48
|
})
|
|
49
49
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","commonColors","typographyOf","createFontStyle","useTheme","sizeMap","dot","medium","number","large","getColorMap","theme","accent","palette","fill","danger","status","useVariantStyleMap","variant","size","color","badgeSize","process","env","NODE_ENV","undefined","console","warn","colorMap","commonBadgeStyle","backgroundColor","borderRadius","shape","radius","full","height","position","width","fontStyleMap","fontSize","lineHeight","fontFamily","letterSpacing","badge","alignItems","justifyContent","contentFont","selector","_","opacity","white"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FontStyle, FountainUiStyle, Theme } from '@fountain-ui/styles';\nimport { commonColors, typographyOf } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { BadgeColor, BadgeSize, BadgeVariant } from './BadgeProps';\n\nconst sizeMap: Record<BadgeVariant, Partial<Record<BadgeSize, number>>> = {\n dot: {\n medium: 4,\n },\n number: {\n large: 26,\n medium: 22,\n },\n};\n\nconst getColorMap = (theme: Theme): Record<BadgeColor, string> => ({\n accent: theme.palette.fill.accent,\n danger: theme.palette.status.danger,\n});\n\ninterface VariantStyle {\n badge: FountainUiStyle;\n contentFont?: TextStyle;\n}\n\nexport default function useVariantStyleMap(variant: BadgeVariant, size: BadgeSize, color: BadgeColor): VariantStyle {\n const theme = useTheme();\n\n return useMemo<VariantStyle>(() => {\n const badgeSize = sizeMap[variant][size] ?? sizeMap[variant].medium;\n\n if (process.env.NODE_ENV !== 'production' && sizeMap[variant][size] === undefined) {\n console.warn('The selected size is not supported for the chosen variant.');\n }\n\n const colorMap = getColorMap(theme);\n\n const commonBadgeStyle: FountainUiStyle = {\n backgroundColor: colorMap[color],\n borderRadius: theme.shape.radius.full,\n height: badgeSize,\n position: 'absolute',\n width: badgeSize,\n };\n\n const fontStyleMap: Record<BadgeSize, FontStyle> = {\n large: typographyOf({\n fontSize: 14,\n lineHeight: 14,\n fontFamily: '
|
|
1
|
+
{"version":3,"names":["useMemo","commonColors","typographyOf","createFontStyle","useTheme","sizeMap","dot","medium","number","large","getColorMap","theme","accent","palette","fill","danger","status","useVariantStyleMap","variant","size","color","badgeSize","process","env","NODE_ENV","undefined","console","warn","colorMap","commonBadgeStyle","backgroundColor","borderRadius","shape","radius","full","height","position","width","fontStyleMap","fontSize","lineHeight","fontFamily","letterSpacing","badge","alignItems","justifyContent","contentFont","selector","_","opacity","white"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FontStyle, FountainUiStyle, Theme } from '@fountain-ui/styles';\nimport { commonColors, typographyOf } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { BadgeColor, BadgeSize, BadgeVariant } from './BadgeProps';\n\nconst sizeMap: Record<BadgeVariant, Partial<Record<BadgeSize, number>>> = {\n dot: {\n medium: 4,\n },\n number: {\n large: 26,\n medium: 22,\n },\n};\n\nconst getColorMap = (theme: Theme): Record<BadgeColor, string> => ({\n accent: theme.palette.fill.accent,\n danger: theme.palette.status.danger,\n});\n\ninterface VariantStyle {\n badge: FountainUiStyle;\n contentFont?: TextStyle;\n}\n\nexport default function useVariantStyleMap(variant: BadgeVariant, size: BadgeSize, color: BadgeColor): VariantStyle {\n const theme = useTheme();\n\n return useMemo<VariantStyle>(() => {\n const badgeSize = sizeMap[variant][size] ?? sizeMap[variant].medium;\n\n if (process.env.NODE_ENV !== 'production' && sizeMap[variant][size] === undefined) {\n console.warn('The selected size is not supported for the chosen variant.');\n }\n\n const colorMap = getColorMap(theme);\n\n const commonBadgeStyle: FountainUiStyle = {\n backgroundColor: colorMap[color],\n borderRadius: theme.shape.radius.full,\n height: badgeSize,\n position: 'absolute',\n width: badgeSize,\n };\n\n const fontStyleMap: Record<BadgeSize, FontStyle> = {\n large: typographyOf({\n fontSize: 14,\n lineHeight: 14,\n fontFamily: 'PretendardStd-Bold',\n letterSpacing: -0.7,\n }),\n medium: typographyOf({\n fontSize: 12,\n lineHeight: 12,\n fontFamily: 'PretendardStd-Bold',\n letterSpacing: -0.6,\n }),\n };\n\n switch (variant) {\n default:\n case 'dot':\n return {\n badge: { ...commonBadgeStyle },\n };\n case 'number':\n return {\n badge: {\n ...commonBadgeStyle,\n alignItems: 'center',\n justifyContent: 'center',\n },\n contentFont: createFontStyle(theme, {\n selector: (_) => fontStyleMap[size],\n color: commonColors.opacity.white['100'],\n }),\n };\n }\n }, [theme, variant, size, color]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAGA,SAASC,YAAT,EAAuBC,YAAvB,QAA2C,qBAA3C;AACA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AAGA,MAAMC,OAAiE,GAAG;EACtEC,GAAG,EAAE;IACDC,MAAM,EAAE;EADP,CADiE;EAItEC,MAAM,EAAE;IACJC,KAAK,EAAE,EADH;IAEJF,MAAM,EAAE;EAFJ;AAJ8D,CAA1E;;AAUA,MAAMG,WAAW,GAAIC,KAAD,KAA+C;EAC/DC,MAAM,EAAED,KAAK,CAACE,OAAN,CAAcC,IAAd,CAAmBF,MADoC;EAE/DG,MAAM,EAAEJ,KAAK,CAACE,OAAN,CAAcG,MAAd,CAAqBD;AAFkC,CAA/C,CAApB;;AAUA,eAAe,SAASE,kBAAT,CAA4BC,OAA5B,EAAmDC,IAAnD,EAAoEC,KAApE,EAAqG;EAChH,MAAMT,KAAK,GAA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C,WAAW,EAAE3C,eAAe,CAACQ,KAAD,EAAQ;YAChCoC,QAAQ,EAAGC,CAAD,IAAOV,YAAY,CAACnB,IAAD,CADG;YAEhCC,KAAK,EAAEnB,YAAY,CAACgD,OAAb,CAAqBC,KAArB,CAA2B,KAA3B;UAFyB,CAAR;QANzB,CAAP;IAPR;EAmBH,CAnDa,EAmDX,CAACvC,KAAD,EAAQO,OAAR,EAAiBC,IAAjB,EAAuBC,KAAvB,CAnDW,CAAd;AAoDH"}
|
|
@@ -10,15 +10,17 @@ const useStyles = function () {
|
|
|
10
10
|
const theme = useTheme();
|
|
11
11
|
return {
|
|
12
12
|
root: {
|
|
13
|
-
alignItems: '
|
|
13
|
+
alignItems: 'flex-start',
|
|
14
14
|
gap: theme.spacing(8),
|
|
15
15
|
justifyContent: 'space-between',
|
|
16
16
|
marginBottom: theme.spacing(4),
|
|
17
17
|
paddingHorizontal: theme.spacing(6)
|
|
18
18
|
},
|
|
19
19
|
title: {
|
|
20
|
+
flexShrink: 1,
|
|
20
21
|
paddingBottom: theme.spacing(1.25),
|
|
21
|
-
paddingTop: theme.spacing(1)
|
|
22
|
+
paddingTop: theme.spacing(1),
|
|
23
|
+
minWidth: 0
|
|
22
24
|
},
|
|
23
25
|
actionButton: {
|
|
24
26
|
paddingBottom: theme.spacing(1.75),
|
|
@@ -51,8 +53,10 @@ export default function BottomSheetTitle(props) {
|
|
|
51
53
|
}), actionButtonProps ? /*#__PURE__*/React.createElement(Button, {
|
|
52
54
|
children: actionButtonProps.title,
|
|
53
55
|
color: 'accent',
|
|
56
|
+
disabled: actionButtonProps.disabled ?? false,
|
|
54
57
|
disableMinWidth: true,
|
|
55
58
|
onPress: actionButtonProps.onPress,
|
|
59
|
+
size: 'large',
|
|
56
60
|
style: styles.actionButton,
|
|
57
61
|
variant: 'text'
|
|
58
62
|
}) : null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","Button","Row","createFontStyle","css","useTheme","useStyles","theme","root","alignItems","gap","spacing","justifyContent","marginBottom","paddingHorizontal","title","paddingBottom","paddingTop","actionButton","BottomSheetTitle","props","actionButtonProps","children","style","styleProp","otherProps","styles","rootStyle","titleFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle","onPress"],"sources":["BottomSheetTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport Button from '../Button/Button';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type BottomSheetTitleProps from './BottomSheetTitleProps';\n\ntype BottomSheetTitleStyles = NamedStylesStringUnion<'root' | 'title' | 'actionButton'>;\n\nconst useStyles: UseStyles<BottomSheetTitleStyles> = function (): BottomSheetTitleStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: '
|
|
1
|
+
{"version":3,"names":["React","Text","Button","Row","createFontStyle","css","useTheme","useStyles","theme","root","alignItems","gap","spacing","justifyContent","marginBottom","paddingHorizontal","title","flexShrink","paddingBottom","paddingTop","minWidth","actionButton","BottomSheetTitle","props","actionButtonProps","children","style","styleProp","otherProps","styles","rootStyle","titleFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle","disabled","onPress"],"sources":["BottomSheetTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport Button from '../Button/Button';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type BottomSheetTitleProps from './BottomSheetTitleProps';\n\ntype BottomSheetTitleStyles = NamedStylesStringUnion<'root' | 'title' | 'actionButton'>;\n\nconst useStyles: UseStyles<BottomSheetTitleStyles> = function (): BottomSheetTitleStyles {\n const theme = useTheme();\n\n return {\n root: {\n alignItems: 'flex-start',\n gap: theme.spacing(8),\n justifyContent: 'space-between',\n marginBottom: theme.spacing(4),\n paddingHorizontal: theme.spacing(6),\n },\n title: {\n flexShrink: 1,\n paddingBottom: theme.spacing(1.25),\n paddingTop: theme.spacing(1),\n minWidth: 0,\n },\n actionButton: {\n paddingBottom: theme.spacing(1.75),\n paddingHorizontal: 0,\n paddingTop: theme.spacing(1.25),\n },\n };\n};\n\nexport default function BottomSheetTitle(props: BottomSheetTitleProps) {\n const {\n actionButtonProps,\n children,\n style: styleProp,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n const titleFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.header3.semiBold,\n color: theme.palette.text.strong,\n });\n\n const titleStyle = css([\n styles.title,\n titleFontStyle,\n ]);\n\n return (\n <Row\n style={rootStyle}\n {...otherProps}\n >\n <Text\n children={children}\n style={titleStyle}\n />\n\n {actionButtonProps ? (\n <Button\n children={actionButtonProps.title}\n color={'accent'}\n disabled={actionButtonProps.disabled ?? false}\n disableMinWidth={true}\n onPress={actionButtonProps.onPress}\n size={'large'}\n style={styles.actionButton}\n variant={'text'}\n />\n ) : null}\n </Row>\n );\n}\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,OAAOC,MAAP,MAAmB,kBAAnB;AACA,OAAOC,GAAP,MAAgB,QAAhB;AACA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,QAA/B,QAA+C,WAA/C;;AAKA,MAAMC,SAA4C,GAAG,YAAoC;EACrF,MAAMC,KAAK,GAAGF,QAAQ,EAAtB;EAEA,OAAO;IACHG,IAAI,EAAE;MACFC,UAAU,EAAE,YADV;MAEFC,GAAG,EAAEH,KAAK,CAACI,OAAN,CAAc,CAAd,CAFH;MAGFC,cAAc,EAAE,eAHd;MAIFC,YAAY,EAAEN,KAAK,CAACI,OAAN,CAAc,CAAd,CAJZ;MAKFG,iBAAiB,EAAEP,KAAK,CAACI,OAAN,CAAc,CAAd;IALjB,CADH;IAQHI,KAAK,EAAE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AAEQ,iBAAiB,CAACiB,QAAlB,IAA8B,KAH5C;IAII,eAAe,EAAE,IAJrB;IAKI,OAAO,EAAEjB,iBAAiB,CAACkB,OAL/B;IAMI,IAAI,EAAE,OANV;IAOI,KAAK,EAAEb,MAAM,CAACR,YAPlB;IAQI,OAAO,EAAE;EARb,EADc,GAWd,IApBR,CADJ;AAwBH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["BottomSheetTitleProps.ts"],"sourcesContent":["import type { OverridableComponentProps } from '../types';\nimport type { RowProps } from '../Row';\n\ntype ActionButtonProps = {\n title: string;\n onPress: () => void;\n};\n\nexport default interface BottomSheetTitleProps extends OverridableComponentProps<RowProps, {\n children: string;\n actionButtonProps?: ActionButtonProps;\n}> {}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["BottomSheetTitleProps.ts"],"sourcesContent":["import type { OverridableComponentProps } from '../types';\nimport type { RowProps } from '../Row';\n\ntype ActionButtonProps = {\n disabled?: boolean | undefined;\n title: string;\n onPress: () => void;\n};\n\nexport default interface BottomSheetTitleProps extends OverridableComponentProps<RowProps, {\n children: string;\n actionButtonProps?: ActionButtonProps;\n}> {}\n"],"mappings":""}
|
|
@@ -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
3
|
import React from 'react';
|
|
4
|
-
import { Linking, Text } from 'react-native';
|
|
4
|
+
import { Linking, Text, View } from 'react-native';
|
|
5
5
|
import { typographyOf } from '@fountain-ui/styles';
|
|
6
6
|
import ButtonBase from '../ButtonBase/ButtonBase';
|
|
7
7
|
import { LoadingSpinner } from '../internal/icons';
|
|
@@ -16,30 +16,34 @@ const useStyles = function () {
|
|
|
16
16
|
alignItems: 'center',
|
|
17
17
|
borderRadius: theme.shape.radius.sm,
|
|
18
18
|
flexDirection: 'row',
|
|
19
|
-
justifyContent: 'center'
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
minHeight: 32
|
|
20
21
|
},
|
|
21
22
|
fullWidth: {
|
|
22
23
|
width: '100%'
|
|
23
24
|
},
|
|
24
25
|
large: {
|
|
25
|
-
gap:
|
|
26
|
+
gap: 8,
|
|
26
27
|
minWidth: 104,
|
|
27
|
-
paddingHorizontal:
|
|
28
|
-
paddingVertical:
|
|
28
|
+
paddingHorizontal: 24,
|
|
29
|
+
paddingVertical: 14
|
|
29
30
|
},
|
|
30
31
|
medium: {
|
|
31
|
-
gap:
|
|
32
|
+
gap: 6,
|
|
32
33
|
minWidth: 88,
|
|
33
|
-
paddingHorizontal:
|
|
34
|
-
paddingVertical:
|
|
34
|
+
paddingHorizontal: 16,
|
|
35
|
+
paddingVertical: 11
|
|
35
36
|
},
|
|
36
37
|
small: {
|
|
37
38
|
minWidth: 64,
|
|
38
|
-
paddingHorizontal:
|
|
39
|
-
paddingVertical:
|
|
39
|
+
paddingHorizontal: 10,
|
|
40
|
+
paddingVertical: 8
|
|
40
41
|
},
|
|
41
42
|
loadingSpinner: {
|
|
42
43
|
position: 'absolute'
|
|
44
|
+
},
|
|
45
|
+
iconContainer: {
|
|
46
|
+
paddingTop: 1
|
|
43
47
|
}
|
|
44
48
|
};
|
|
45
49
|
};
|
|
@@ -79,6 +83,7 @@ export default function Button(props) {
|
|
|
79
83
|
color: colorProp = 'primary',
|
|
80
84
|
disabled: disabledProp = false,
|
|
81
85
|
disableMinWidth = false,
|
|
86
|
+
disablePadding = false,
|
|
82
87
|
endIcon: endIconProp,
|
|
83
88
|
fullWidth = false,
|
|
84
89
|
href,
|
|
@@ -104,10 +109,19 @@ export default function Button(props) {
|
|
|
104
109
|
fill: iconColor,
|
|
105
110
|
opacity: isLoading ? 0 : 1
|
|
106
111
|
};
|
|
107
|
-
const startIcon =
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
const startIcon = startIconProp ? /*#__PURE__*/React.createElement(View, {
|
|
113
|
+
style: styles.iconContainer
|
|
114
|
+
}, cloneElementSafely(startIconProp, iconProps)) : null;
|
|
115
|
+
const endIcon = endIconProp ? /*#__PURE__*/React.createElement(View, {
|
|
116
|
+
style: styles.iconContainer
|
|
117
|
+
}, cloneElementSafely(endIconProp, iconProps)) : null;
|
|
118
|
+
const buttonBaseStyle = css([styles.root, containerStyle, styles[size], (variant === 'capsuleSolid' || variant === 'capsuleOutlined') && size === 'small' ? {
|
|
119
|
+
paddingHorizontal: 12
|
|
120
|
+
} : undefined, fullWidth ? styles.fullWidth : undefined, disableMinWidth ? {
|
|
110
121
|
minWidth: 0
|
|
122
|
+
} : undefined, disablePadding ? {
|
|
123
|
+
paddingHorizontal: 0,
|
|
124
|
+
paddingVertical: 0
|
|
111
125
|
} : undefined, styleProp]);
|
|
112
126
|
const fontStyle = createFontStyle(theme, {
|
|
113
127
|
selector: _ => fontStyleMap[size],
|