@fountain-ui/core 3.0.0-alpha.1 → 3.0.0-alpha.11
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 +4 -1
- package/build/commonjs/Accordion/Accordion.js.map +1 -1
- package/build/commonjs/Accordion/index.js +8 -0
- package/build/commonjs/Accordion/index.js.map +1 -1
- package/build/commonjs/Accordion/useVariantStyleMap.js +11 -10
- package/build/commonjs/Accordion/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/AppBar/AppBar.js +6 -1
- package/build/commonjs/AppBar/AppBar.js.map +1 -1
- package/build/commonjs/AppBar/index.js +8 -0
- package/build/commonjs/AppBar/index.js.map +1 -1
- package/build/commonjs/Badge/index.js +26 -0
- package/build/commonjs/Badge/index.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 +1 -0
- package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
- package/build/commonjs/Button/Button.js +15 -3
- package/build/commonjs/Button/Button.js.map +1 -1
- package/build/commonjs/Button/ButtonProps.js +7 -7
- package/build/commonjs/Button/ButtonProps.js.map +1 -1
- package/build/commonjs/Button/index.js +20 -0
- package/build/commonjs/Button/index.js.map +1 -1
- package/build/commonjs/Button/useVariantStyleMap.js +5 -7
- package/build/commonjs/Button/useVariantStyleMap.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 +5 -2
- package/build/commonjs/Checkbox/Checkbox.js.map +1 -1
- package/build/commonjs/Checkbox/index.js +8 -0
- package/build/commonjs/Checkbox/index.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 +21 -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 +20 -0
- package/build/commonjs/Chip/index.js.map +1 -1
- package/build/commonjs/Chip/useChipStyle.js +31 -37
- package/build/commonjs/Chip/useChipStyle.js.map +1 -1
- package/build/commonjs/Dialog/Dialog.js +7 -8
- 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/index.js +8 -0
- package/build/commonjs/Dialog/index.js.map +1 -1
- package/build/commonjs/Dialog/useDialogSectionStyle.js +5 -5
- package/build/commonjs/Dialog/useDialogSectionStyle.js.map +1 -1
- package/build/commonjs/Dialog/useDialogStyle.js +9 -8
- package/build/commonjs/Dialog/useDialogStyle.js.map +1 -1
- package/build/commonjs/DialogContent/DialogContent.js +1 -2
- package/build/commonjs/DialogContent/DialogContent.js.map +1 -1
- package/build/commonjs/DialogTitle/BackButton.js +47 -0
- package/build/commonjs/DialogTitle/BackButton.js.map +1 -0
- package/build/commonjs/DialogTitle/CloseButton.js +45 -0
- package/build/commonjs/DialogTitle/CloseButton.js.map +1 -0
- package/build/commonjs/DialogTitle/DialogTitle.js +11 -4
- package/build/commonjs/DialogTitle/DialogTitle.js.map +1 -1
- package/build/commonjs/Divider/Divider.js +18 -10
- package/build/commonjs/Divider/Divider.js.map +1 -1
- package/build/commonjs/Divider/DividerProps.js +4 -4
- package/build/commonjs/Divider/DividerProps.js.map +1 -1
- package/build/commonjs/Divider/index.js +14 -0
- package/build/commonjs/Divider/index.js.map +1 -1
- package/build/commonjs/Empty/Empty.js +1 -2
- 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/index.js +8 -0
- package/build/commonjs/IconButton/index.js.map +1 -1
- package/build/commonjs/ListItem/ListItem.js +47 -25
- 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/Pagination/NumberPagination.js +1 -1
- 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 +14 -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 +6 -2
- package/build/commonjs/Radio/Radio.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/Snackbar/index.js +8 -0
- package/build/commonjs/Snackbar/index.js.map +1 -1
- package/build/commonjs/SnackbarContent/SnackbarContent.js +27 -12
- package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
- package/build/commonjs/SvgIcon/index.js +14 -0
- package/build/commonjs/SvgIcon/index.js.map +1 -1
- package/build/commonjs/Tab/useVariantStyleMap.js +3 -3
- package/build/commonjs/Tab/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/Tabs/Tabs.js +6 -1
- package/build/commonjs/Tabs/Tabs.js.map +1 -1
- package/build/commonjs/Tabs/index.js +14 -0
- package/build/commonjs/Tabs/index.js.map +1 -1
- package/build/commonjs/Tabs/useTabsStyle.js +42 -0
- package/build/commonjs/Tabs/useTabsStyle.js.map +1 -0
- package/build/commonjs/TextField/TextField.js +1 -1
- package/build/commonjs/TextField/TextField.js.map +1 -1
- package/build/commonjs/TextField/index.js +8 -0
- package/build/commonjs/TextField/index.js.map +1 -1
- package/build/commonjs/TextField/useVariantStyleMap.js +2 -2
- 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 +8 -4
- package/build/commonjs/Toolbar/Toolbar.js.map +1 -1
- package/build/commonjs/Toolbar/index.js +8 -0
- package/build/commonjs/Toolbar/index.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 +11 -24
- package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
- package/build/commonjs/Tooltip/index.js +39 -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/Typography/index.js +8 -0
- package/build/commonjs/Typography/index.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/useContentContainerStyle.js +21 -28
- package/build/commonjs/hooks/useContentContainerStyle.js.map +1 -1
- package/build/commonjs/index.js +21 -0
- package/build/commonjs/index.js.map +1 -1
- 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/Close.js +4 -2
- package/build/commonjs/internal/icons/Close.js.map +1 -1
- package/build/module/Accordion/Accordion.js +4 -1
- package/build/module/Accordion/Accordion.js.map +1 -1
- package/build/module/Accordion/index.js +1 -0
- package/build/module/Accordion/index.js.map +1 -1
- package/build/module/Accordion/useVariantStyleMap.js +11 -10
- package/build/module/Accordion/useVariantStyleMap.js.map +1 -1
- package/build/module/AppBar/AppBar.js +5 -1
- package/build/module/AppBar/AppBar.js.map +1 -1
- package/build/module/AppBar/index.js +1 -0
- package/build/module/AppBar/index.js.map +1 -1
- package/build/module/Badge/index.js +1 -0
- package/build/module/Badge/index.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 +1 -0
- package/build/module/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
- package/build/module/Button/Button.js +16 -4
- package/build/module/Button/Button.js.map +1 -1
- package/build/module/Button/ButtonProps.js +3 -3
- package/build/module/Button/ButtonProps.js.map +1 -1
- package/build/module/Button/index.js +1 -0
- package/build/module/Button/index.js.map +1 -1
- package/build/module/Button/useVariantStyleMap.js +5 -7
- package/build/module/Button/useVariantStyleMap.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 +5 -2
- package/build/module/Checkbox/Checkbox.js.map +1 -1
- package/build/module/Checkbox/index.js +1 -0
- package/build/module/Checkbox/index.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 +17 -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 -0
- package/build/module/Chip/index.js.map +1 -1
- package/build/module/Chip/useChipStyle.js +31 -36
- package/build/module/Chip/useChipStyle.js.map +1 -1
- package/build/module/Dialog/Dialog.js +7 -8
- 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/index.js +1 -0
- package/build/module/Dialog/index.js.map +1 -1
- package/build/module/Dialog/useDialogSectionStyle.js +5 -5
- package/build/module/Dialog/useDialogSectionStyle.js.map +1 -1
- package/build/module/Dialog/useDialogStyle.js +9 -8
- package/build/module/Dialog/useDialogStyle.js.map +1 -1
- package/build/module/DialogContent/DialogContent.js +1 -2
- package/build/module/DialogContent/DialogContent.js.map +1 -1
- package/build/module/DialogTitle/BackButton.js +32 -0
- package/build/module/DialogTitle/BackButton.js.map +1 -0
- package/build/module/DialogTitle/CloseButton.js +30 -0
- package/build/module/DialogTitle/CloseButton.js.map +1 -0
- package/build/module/DialogTitle/DialogTitle.js +8 -3
- package/build/module/DialogTitle/DialogTitle.js.map +1 -1
- package/build/module/Divider/Divider.js +8 -1
- package/build/module/Divider/Divider.js.map +1 -1
- package/build/module/Divider/DividerProps.js +2 -2
- package/build/module/Divider/DividerProps.js.map +1 -1
- package/build/module/Divider/index.js +1 -0
- package/build/module/Divider/index.js.map +1 -1
- package/build/module/Empty/Empty.js +1 -2
- 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/index.js +1 -0
- package/build/module/IconButton/index.js.map +1 -1
- package/build/module/ListItem/ListItem.js +45 -27
- 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/Pagination/NumberPagination.js +1 -1
- 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 -0
- 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 +5 -2
- package/build/module/Radio/Radio.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/Snackbar/index.js +1 -0
- package/build/module/Snackbar/index.js.map +1 -1
- package/build/module/SnackbarContent/SnackbarContent.js +27 -12
- package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
- package/build/module/SvgIcon/index.js +1 -0
- package/build/module/SvgIcon/index.js.map +1 -1
- package/build/module/Tab/useVariantStyleMap.js +3 -3
- package/build/module/Tab/useVariantStyleMap.js.map +1 -1
- package/build/module/Tabs/Tabs.js +5 -1
- package/build/module/Tabs/Tabs.js.map +1 -1
- package/build/module/Tabs/index.js +1 -0
- package/build/module/Tabs/index.js.map +1 -1
- package/build/module/Tabs/useTabsStyle.js +32 -0
- package/build/module/Tabs/useTabsStyle.js.map +1 -0
- package/build/module/TextField/TextField.js +1 -1
- package/build/module/TextField/TextField.js.map +1 -1
- package/build/module/TextField/index.js +1 -0
- package/build/module/TextField/index.js.map +1 -1
- package/build/module/TextField/useVariantStyleMap.js +2 -2
- 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 +7 -3
- package/build/module/Toolbar/Toolbar.js.map +1 -1
- package/build/module/Toolbar/index.js +1 -0
- package/build/module/Toolbar/index.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 +4 -16
- package/build/module/Tooltip/Tooltip.js.map +1 -1
- package/build/module/Tooltip/index.js +2 -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/Typography/index.js +1 -0
- package/build/module/Typography/index.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/useContentContainerStyle.js +23 -26
- package/build/module/hooks/useContentContainerStyle.js.map +1 -1
- package/build/module/index.js +2 -0
- package/build/module/index.js.map +1 -1
- 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/Close.js +4 -2
- package/build/module/internal/icons/Close.js.map +1 -1
- package/build/typescript/Accordion/index.d.ts +1 -0
- package/build/typescript/Accordion/useVariantStyleMap.d.ts +1 -0
- package/build/typescript/AppBar/index.d.ts +1 -0
- package/build/typescript/Badge/index.d.ts +2 -1
- package/build/typescript/Button/ButtonProps.d.ts +11 -6
- package/build/typescript/Button/index.d.ts +1 -0
- package/build/typescript/ButtonBase/index.d.ts +1 -1
- package/build/typescript/Checkbox/index.d.ts +1 -0
- 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 -0
- package/build/typescript/Chip/useChipStyle.d.ts +4 -3
- package/build/typescript/Dialog/DialogProps.d.ts +1 -6
- package/build/typescript/Dialog/index.d.ts +1 -0
- package/build/typescript/Dialog/useDialogStyle.d.ts +1 -1
- package/build/typescript/DialogTitle/BackButton.d.ts +6 -0
- package/build/typescript/DialogTitle/CloseButton.d.ts +6 -0
- package/build/typescript/DialogTitle/DialogTitle.d.ts +8 -1
- package/build/typescript/Divider/DividerProps.d.ts +4 -4
- package/build/typescript/Divider/index.d.ts +1 -0
- package/build/typescript/Flexbox/FlexboxProps.d.ts +4 -0
- package/build/typescript/IconButton/index.d.ts +1 -0
- 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 -1
- 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/Snackbar/index.d.ts +1 -0
- package/build/typescript/SvgIcon/index.d.ts +1 -0
- package/build/typescript/Tabs/index.d.ts +1 -0
- package/build/typescript/Tabs/useTabsStyle.d.ts +7 -0
- package/build/typescript/TextField/index.d.ts +1 -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/index.d.ts +1 -0
- package/build/typescript/Tooltip/Beaks/index.d.ts +4 -0
- package/build/typescript/Tooltip/index.d.ts +3 -1
- package/build/typescript/Typography/TypographyProps.d.ts +4 -0
- package/build/typescript/Typography/index.d.ts +1 -0
- package/build/typescript/hooks/useContentContainerStyle.d.ts +4 -8
- package/build/typescript/index.d.ts +2 -0
- package/package.json +3 -3
- package/src/Accordion/Accordion.tsx +4 -1
- package/src/Accordion/index.ts +1 -0
- package/src/Accordion/useVariantStyleMap.ts +12 -10
- package/src/AppBar/AppBar.tsx +4 -0
- package/src/AppBar/index.ts +1 -0
- package/src/Badge/index.ts +12 -1
- package/src/Badge/useVariantStyleMap.ts +2 -2
- package/src/BottomSheetTitle/BottomSheetTitle.tsx +1 -0
- package/src/Button/Button.tsx +19 -4
- package/src/Button/ButtonProps.ts +12 -6
- package/src/Button/index.ts +1 -0
- package/src/Button/useVariantStyleMap.ts +3 -7
- package/src/ButtonBase/index.ts +1 -1
- package/src/Checkbox/Checkbox.tsx +12 -9
- package/src/Checkbox/index.ts +1 -0
- package/src/Checkbox/useVariantStyleMap.ts +6 -1
- package/src/Chip/Chip.tsx +20 -13
- package/src/Chip/ChipProps.ts +13 -4
- package/src/Chip/index.ts +1 -0
- package/src/Chip/useChipStyle.ts +36 -34
- package/src/Dialog/Dialog.tsx +7 -8
- package/src/Dialog/DialogProps.ts +1 -7
- package/src/Dialog/index.ts +1 -0
- package/src/Dialog/useDialogSectionStyle.ts +4 -4
- package/src/Dialog/useDialogStyle.ts +9 -7
- package/src/DialogContent/DialogContent.tsx +1 -2
- package/src/DialogTitle/BackButton.tsx +44 -0
- package/src/DialogTitle/CloseButton.tsx +42 -0
- package/src/DialogTitle/DialogTitle.tsx +9 -1
- package/src/Divider/Divider.tsx +6 -1
- package/src/Divider/DividerProps.ts +4 -4
- package/src/Divider/index.ts +1 -0
- package/src/Empty/Empty.tsx +1 -2
- package/src/Flexbox/Flexbox.tsx +2 -0
- package/src/Flexbox/FlexboxProps.ts +5 -0
- package/src/IconButton/index.ts +1 -0
- package/src/ListItem/ListItem.tsx +69 -28
- 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/Pagination/NumberPagination.tsx +1 -1
- package/src/Pagination/Pagination.tsx +3 -2
- package/src/Pagination/PaginationProps.ts +15 -0
- package/src/Pagination/index.ts +2 -1
- package/src/PaginationItem/PaginationItem.tsx +31 -24
- package/src/PaginationItem/PaginationItemProps.ts +7 -0
- package/src/Radio/Radio.tsx +8 -2
- 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/Snackbar/index.ts +1 -0
- package/src/SnackbarContent/SnackbarContent.tsx +37 -18
- package/src/SvgIcon/index.ts +1 -0
- package/src/Tab/useVariantStyleMap.ts +3 -3
- package/src/Tabs/Tabs.tsx +4 -0
- package/src/Tabs/index.ts +1 -0
- package/src/Tabs/useTabsStyle.ts +38 -0
- package/src/TextField/TextField.tsx +1 -1
- package/src/TextField/index.tsx +1 -0
- package/src/TextField/useVariantStyleMap.ts +2 -2
- package/src/Toolbar/BackButton/BackButton.tsx +42 -0
- package/src/Toolbar/BackButton/BackButtonProps.ts +4 -0
- package/src/Toolbar/BackButton/index.ts +2 -0
- package/src/Toolbar/Toolbar.tsx +6 -1
- package/src/Toolbar/index.ts +1 -0
- package/src/Tooltip/Beaks/index.ts +4 -0
- package/src/Tooltip/Tooltip.tsx +5 -16
- package/src/Tooltip/index.ts +3 -1
- package/src/Typography/Typography.tsx +3 -1
- package/src/Typography/TypographyProps.ts +5 -0
- package/src/Typography/index.ts +1 -0
- package/src/hooks/useBreakpointUp.ts +3 -1
- package/src/hooks/useContentContainerStyle.ts +26 -34
- package/src/index.ts +3 -0
- package/src/internal/icons/ChevronLeft.tsx +4 -1
- package/src/internal/icons/ChevronRight.tsx +4 -1
- package/src/internal/icons/Close.tsx +4 -1
- package/build/commonjs/ButtonBase/LegacyButtonBase.js +0 -126
- package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +0 -1
- package/build/commonjs/TextField/InputLabel.js +0 -163
- package/build/commonjs/TextField/InputLabel.js.map +0 -1
- package/build/module/ButtonBase/LegacyButtonBase.js +0 -106
- package/build/module/ButtonBase/LegacyButtonBase.js.map +0 -1
- package/build/module/TextField/InputLabel.js +0 -149
- package/build/module/TextField/InputLabel.js.map +0 -1
- package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +0 -5
- package/build/typescript/TextField/InputLabel.d.ts +0 -33
- package/src/ButtonBase/LegacyButtonBase.tsx +0 -135
- package/src/TextField/InputLabel.tsx +0 -234
|
@@ -35,7 +35,6 @@ function Dialog(props) {
|
|
|
35
35
|
const {
|
|
36
36
|
animationType = _Modal.ANIMATION_TYPE.SLIDE,
|
|
37
37
|
children,
|
|
38
|
-
fullScreen = false,
|
|
39
38
|
hideBackdrop,
|
|
40
39
|
onClose,
|
|
41
40
|
style: styleProp,
|
|
@@ -44,7 +43,7 @@ function Dialog(props) {
|
|
|
44
43
|
topElement,
|
|
45
44
|
...otherProps
|
|
46
45
|
} = props;
|
|
47
|
-
const styles = (0, _useDialogStyle.default)(size
|
|
46
|
+
const styles = (0, _useDialogStyle.default)(size);
|
|
48
47
|
const {
|
|
49
48
|
height: screenHeight
|
|
50
49
|
} = (0, _reactNative.useWindowDimensions)();
|
|
@@ -73,7 +72,7 @@ function Dialog(props) {
|
|
|
73
72
|
toValue: 0,
|
|
74
73
|
type: _Modal.ANIMATION_TYPE.FADE
|
|
75
74
|
}];
|
|
76
|
-
} else if (animationType === _Modal.ANIMATION_TYPE.SLIDE
|
|
75
|
+
} else if (animationType === _Modal.ANIMATION_TYPE.SLIDE) {
|
|
77
76
|
return [{
|
|
78
77
|
toValue: screenHeight,
|
|
79
78
|
type: _Modal.ANIMATION_TYPE.SLIDE
|
|
@@ -89,14 +88,14 @@ function Dialog(props) {
|
|
|
89
88
|
toValue: screenHeight,
|
|
90
89
|
type: _Modal.ANIMATION_TYPE.SLIDE
|
|
91
90
|
}];
|
|
92
|
-
}, [animationType,
|
|
91
|
+
}, [animationType, screenHeight]);
|
|
93
92
|
const openAnimation = (0, _react.useMemo)(() => {
|
|
94
93
|
if (animationType === _Modal.ANIMATION_TYPE.FADE) {
|
|
95
94
|
return [{
|
|
96
95
|
toValue: 1,
|
|
97
96
|
type: _Modal.ANIMATION_TYPE.FADE
|
|
98
97
|
}];
|
|
99
|
-
} else if (animationType === _Modal.ANIMATION_TYPE.SLIDE
|
|
98
|
+
} else if (animationType === _Modal.ANIMATION_TYPE.SLIDE) {
|
|
100
99
|
return [{
|
|
101
100
|
toValue: 0,
|
|
102
101
|
type: _Modal.ANIMATION_TYPE.SLIDE
|
|
@@ -112,8 +111,8 @@ function Dialog(props) {
|
|
|
112
111
|
toValue: 0,
|
|
113
112
|
type: _Modal.ANIMATION_TYPE.SLIDE
|
|
114
113
|
}];
|
|
115
|
-
}, [animationType
|
|
116
|
-
const initialOpacity = animationType === _Modal.ANIMATION_TYPE.SLIDE
|
|
114
|
+
}, [animationType]);
|
|
115
|
+
const initialOpacity = animationType === _Modal.ANIMATION_TYPE.SLIDE ? 1 : undefined;
|
|
117
116
|
const initialTranslateY = animationType === _Modal.ANIMATION_TYPE.FADE ? 0 : undefined;
|
|
118
117
|
const paperStyle = (0, _styles.css)([styles.paper, styleProp]);
|
|
119
118
|
return /*#__PURE__*/_react.default.createElement(_Modal.default, _extends({
|
|
@@ -132,7 +131,7 @@ function Dialog(props) {
|
|
|
132
131
|
size
|
|
133
132
|
}
|
|
134
133
|
}, topElement ? /*#__PURE__*/_react.default.createElement(_Column.default, {
|
|
135
|
-
style:
|
|
134
|
+
style: styles.topElementContainer
|
|
136
135
|
}, /*#__PURE__*/_react.default.createElement(_Column.default, {
|
|
137
136
|
style: styles.topElementContent,
|
|
138
137
|
onLayout: handleTopElementLayout
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TOP_ELEMENT_OFFSET","Dialog","props","animationType","ANIMATION_TYPE","SLIDE","children","
|
|
1
|
+
{"version":3,"names":["TOP_ELEMENT_OFFSET","Dialog","props","animationType","ANIMATION_TYPE","SLIDE","children","hideBackdrop","onClose","style","styleProp","size","visible","topElement","otherProps","styles","useDialogStyle","height","screenHeight","useWindowDimensions","topElementHeight","setTopElementHeight","useState","handleTopElementLayout","event","nativeEvent","layout","offsetAnimation","useMemo","toValue","type","closeAnimation","FADE","duration","openAnimation","delay","initialOpacity","undefined","initialTranslateY","paperStyle","css","paper","container","root","topElementContainer","topElementContent"],"sources":["Dialog.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\nimport { LayoutChangeEvent, useWindowDimensions } from 'react-native';\nimport { css } from '@fountain-ui/styles';\nimport Column from '../Column';\nimport Modal, { ANIMATION_TYPE, AnimationUnit } from '../Modal';\nimport ShadowView from '../ShadowView';\nimport type DialogProps from './DialogProps';\nimport { DialogProvider } from './DialogContext';\nimport useDialogStyle from './useDialogStyle';\n\nconst TOP_ELEMENT_OFFSET = 20;\n\nexport default function Dialog(props: DialogProps) {\n const {\n animationType = ANIMATION_TYPE.SLIDE,\n children,\n hideBackdrop,\n onClose,\n style: styleProp,\n size = 'medium',\n visible,\n topElement,\n ...otherProps\n } = props;\n\n const styles = useDialogStyle(size);\n\n const { height: screenHeight } = useWindowDimensions();\n\n const [topElementHeight, setTopElementHeight] = useState(0);\n const handleTopElementLayout = (event: LayoutChangeEvent) => {\n const { height } = event.nativeEvent.layout;\n setTopElementHeight(height);\n };\n\n const offsetAnimation = useMemo<AnimationUnit[]>(() => {\n if (topElementHeight === 0) {\n return [];\n }\n\n return [{\n toValue: (topElementHeight - TOP_ELEMENT_OFFSET) / 2,\n type: ANIMATION_TYPE.SLIDE,\n }];\n }, [topElementHeight]);\n\n const closeAnimation = useMemo<AnimationUnit[]>(() => {\n if (animationType === ANIMATION_TYPE.FADE) {\n return [{\n toValue: 0,\n type: ANIMATION_TYPE.FADE,\n }];\n } else if (animationType === ANIMATION_TYPE.SLIDE) {\n return [\n {\n toValue: screenHeight,\n type: ANIMATION_TYPE.SLIDE,\n },\n {\n duration: 150,\n toValue: 0,\n type: ANIMATION_TYPE.FADE,\n },\n ];\n }\n\n return [{\n duration: 150,\n toValue: screenHeight,\n type: ANIMATION_TYPE.SLIDE,\n }];\n }, [animationType, screenHeight]);\n\n const openAnimation = useMemo<AnimationUnit[]>(() => {\n if (animationType === ANIMATION_TYPE.FADE) {\n return [{\n toValue: 1,\n type: ANIMATION_TYPE.FADE,\n }];\n } else if (animationType === ANIMATION_TYPE.SLIDE) {\n return [\n {\n toValue: 0,\n type: ANIMATION_TYPE.SLIDE,\n },\n {\n delay: 50,\n duration: 150,\n toValue: 1,\n type: ANIMATION_TYPE.FADE,\n },\n ];\n }\n\n return [{\n toValue: 0,\n type: ANIMATION_TYPE.SLIDE,\n }];\n }, [animationType]);\n\n const initialOpacity = animationType === ANIMATION_TYPE.SLIDE ? 1 : undefined;\n\n const initialTranslateY = animationType === ANIMATION_TYPE.FADE ? 0 : undefined;\n\n const paperStyle = css([\n styles.paper,\n styleProp,\n ]);\n\n return (\n <Modal\n animationStyle={styles.container}\n closeAnimation={closeAnimation}\n hideBackdrop={hideBackdrop || animationType === ANIMATION_TYPE.FADE}\n initialOpacity={initialOpacity}\n initialTranslateY={initialTranslateY}\n onClose={onClose}\n openAnimation={openAnimation}\n offsetAnimation={offsetAnimation}\n visible={visible}\n style={styles.root}\n {...otherProps}\n >\n <DialogProvider value={{ size }}>\n {topElement ? (\n <Column style={styles.topElementContainer}>\n <Column\n style={styles.topElementContent}\n onLayout={handleTopElementLayout}\n >\n {topElement}\n </Column>\n </Column>\n ) : null}\n\n <ShadowView\n variant={600}\n style={paperStyle}\n >\n {children}\n </ShadowView>\n </DialogProvider>\n </Modal>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;;;;;AAEA,MAAMA,kBAAkB,GAAG,EAA3B;;AAEe,SAASC,MAAT,CAAgBC,KAAhB,EAAoC;EAC/C,MAAM;IACFC,aAAa,GAAGC,qBAAA,CAAeC,KAD7B;IAEFC,QAFE;IAGFC,YAHE;IAIFC,OAJE;IAKFC,KAAK,EAAEC,SALL;IAMFC,IAAI,GAAG,QANL;IAOFC,OAPE;IAQFC,UARE;IASF,GAAGC;EATD,IAUFZ,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EAAEI,cAJpB;IAKI,iBAAiB,EAAEE,iBALvB;IAMI,OAAO,EAAE9B,OANb;IAOI,aAAa,EAAE0B,aAPnB;IAQI,eAAe,EAAEP,eARrB;IASI,OAAO,EAAEf,OATb;IAUI,KAAK,EAAEG,MAAM,CAAC4B;EAVlB,GAWQ7B,UAXR,gBAaI,6BAAC,6BAAD;IAAgB,KAAK,EAAE;MAAEH;IAAF;EAAvB,GACKE,UAAU,gBACP,6BAAC,eAAD;IAAQ,KAAK,EAAEE,MAAM,CAAC6B;EAAtB,gBACI,6BAAC,eAAD;IACI,KAAK,EAAE7B,MAAM,CAAC8B,iBADlB;IAEI,QAAQ,EAAEtB;EAFd,GAIKV,UAJL,CADJ,CADO,GASP,IAVR,eAYI,6BAAC,mBAAD;IACI,OAAO,EAAE,GADb;IAEI,KAAK,EAAE0B;EAFX,GAIKjC,QAJL,CAZJ,CAbJ,CADJ;AAmCH;;AAAA"}
|
|
@@ -4,6 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.dialogSizes = void 0;
|
|
7
|
-
const dialogSizes = ['small', 'medium', 'large'];
|
|
7
|
+
const dialogSizes = ['small', 'medium', 'large', 'full'];
|
|
8
8
|
exports.dialogSizes = dialogSizes;
|
|
9
9
|
//# sourceMappingURL=DialogProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dialogSizes"],"sources":["DialogProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ModalProps } from '../Modal';\nimport type { OverridableComponentProps } from '../types';\nimport { ANIMATION_TYPE } from '../Modal';\n\nexport const dialogSizes = ['small', 'medium', 'large'] as const;\nexport type DialogSize = typeof dialogSizes[number];\n\nexport default interface DialogProps extends OverridableComponentProps<ModalProps, {\n /**\n * Type of animation used when the dialog opens and closes.\n * @default 'slide'\n */\n animationType?: ANIMATION_TYPE;\n\n /**\n * Dialog children, usually the included sub-components.\n */\n children?: React.ReactNode;\n\n /**\n *
|
|
1
|
+
{"version":3,"names":["dialogSizes"],"sources":["DialogProps.ts"],"sourcesContent":["import React from 'react';\nimport type { ModalProps } from '../Modal';\nimport type { OverridableComponentProps } from '../types';\nimport { ANIMATION_TYPE } from '../Modal';\n\nexport const dialogSizes = ['small', 'medium', 'large', 'full'] as const;\nexport type DialogSize = typeof dialogSizes[number];\n\nexport default interface DialogProps extends OverridableComponentProps<ModalProps, {\n /**\n * Type of animation used when the dialog opens and closes.\n * @default 'slide'\n */\n animationType?: ANIMATION_TYPE;\n\n /**\n * Dialog children, usually the included sub-components.\n */\n children?: React.ReactNode;\n\n /**\n * Determines the minWidth of the Dialog.\n * @default 'medium'\n */\n size?: DialogSize;\n\n /**\n * Top element for displaying additional information on the dialog.\n */\n topElement?: React.ReactNode;\n}> {}\n"],"mappings":";;;;;;AAKO,MAAMA,WAAW,GAAG,CAAC,OAAD,EAAU,QAAV,EAAoB,OAApB,EAA6B,MAA7B,CAApB"}
|
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "default", {
|
|
|
15
15
|
return _Dialog.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "dialogSizes", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _DialogProps.dialogSizes;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
Object.defineProperty(exports, "useDialogContext", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function () {
|
|
@@ -30,6 +36,8 @@ Object.defineProperty(exports, "useDialogSectionStyle", {
|
|
|
30
36
|
|
|
31
37
|
var _Dialog = _interopRequireDefault(require("./Dialog"));
|
|
32
38
|
|
|
39
|
+
var _DialogProps = require("./DialogProps");
|
|
40
|
+
|
|
33
41
|
var _DialogContext = require("./DialogContext");
|
|
34
42
|
|
|
35
43
|
var _useDialogSectionStyle = _interopRequireDefault(require("./useDialogSectionStyle"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './Dialog';\nexport type { default as DialogProps } from './DialogProps';\nexport { DialogProvider, useDialogContext } from './DialogContext';\nexport { default as useDialogSectionStyle } from './useDialogSectionStyle';\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './Dialog';\nexport type { default as DialogProps } from './DialogProps';\nexport { dialogSizes } from './DialogProps';\nexport { DialogProvider, useDialogContext } from './DialogContext';\nexport { default as useDialogSectionStyle } from './useDialogSectionStyle';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AACA"}
|
|
@@ -24,15 +24,15 @@ function useDialogSectionStyle() {
|
|
|
24
24
|
return (0, _react.useMemo)(() => {
|
|
25
25
|
const sizePaddingHorizontalMap = {
|
|
26
26
|
small: {
|
|
27
|
-
paddingHorizontal:
|
|
27
|
+
paddingHorizontal: 24
|
|
28
28
|
},
|
|
29
29
|
medium: {
|
|
30
|
-
|
|
31
|
-
paddingHorizontal: theme.spacing(windowWidth >= 448 ? 8 : 6)
|
|
30
|
+
paddingHorizontal: windowWidth >= 448 ? 32 : 24
|
|
32
31
|
},
|
|
33
32
|
large: {
|
|
34
|
-
paddingHorizontal:
|
|
35
|
-
}
|
|
33
|
+
paddingHorizontal: 32
|
|
34
|
+
},
|
|
35
|
+
full: {}
|
|
36
36
|
};
|
|
37
37
|
return sizePaddingHorizontalMap[size];
|
|
38
38
|
}, [size, theme, windowWidth]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDialogSectionStyle","size","useDialogContext","width","windowWidth","useWindowDimensions","theme","useTheme","useMemo","sizePaddingHorizontalMap","small","paddingHorizontal","
|
|
1
|
+
{"version":3,"names":["useDialogSectionStyle","size","useDialogContext","width","windowWidth","useWindowDimensions","theme","useTheme","useMemo","sizePaddingHorizontalMap","small","paddingHorizontal","medium","large","full"],"sources":["useDialogSectionStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useWindowDimensions } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { useDialogContext } from './DialogContext';\nimport type { DialogSize } from './DialogProps';\n\nexport default function useDialogSectionStyle() {\n const { size } = useDialogContext();\n\n const { width: windowWidth } = useWindowDimensions();\n\n const theme = useTheme();\n\n return useMemo<FountainUiStyle>(() => {\n const sizePaddingHorizontalMap: Record<DialogSize, FountainUiStyle> = {\n small: {\n paddingHorizontal: 24,\n },\n medium: {\n paddingHorizontal: windowWidth >= 448 ? 32 : 24,\n },\n large: {\n paddingHorizontal: 32,\n },\n full: {},\n };\n\n return sizePaddingHorizontalMap[size];\n }, [size, theme, windowWidth]);\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAGe,SAASA,qBAAT,GAAiC;EAC5C,MAAM;IAAEC;EAAF,IAAW,IAAAC,+BAAA,GAAjB;EAEA,MAAM;IAAEC,KAAK,EAAEC;EAAT,IAAyB,IAAAC,gCAAA,GAA/B;EAEA,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAyB,MAAM;IAClC,MAAMC,wBAA6D,GAAG;MAClEC,KAAK,EAAE;QACHC,iBAAiB,EAAE;MADhB,CAD2D;MAIlEC,MAAM,EAAE;QACJD,iBAAiB,EAAEP,WAAW,IAAI,GAAf,GAAqB,EAArB,GAA0B;MADzC,CAJ0D;MAOlES,KAAK,EAAE;QACHF,iBAAiB,EAAE;MADhB,CAP2D;MAUlEG,IAAI,EAAE;IAV4D,CAAtE;IAaA,OAAOL,wBAAwB,CAACR,IAAD,CAA/B;EACH,CAfM,EAeJ,CAACA,IAAD,EAAOK,KAAP,EAAcF,WAAd,CAfI,CAAP;AAgBH"}
|
|
@@ -11,7 +11,7 @@ var _reactNative = require("react-native");
|
|
|
11
11
|
|
|
12
12
|
var _styles = require("../styles");
|
|
13
13
|
|
|
14
|
-
function useDialogStyle(size
|
|
14
|
+
function useDialogStyle(size) {
|
|
15
15
|
const theme = (0, _styles.useTheme)();
|
|
16
16
|
const {
|
|
17
17
|
height: windowHeight,
|
|
@@ -31,28 +31,29 @@ function useDialogStyle(size, fullScreen) {
|
|
|
31
31
|
maxWidth: 512,
|
|
32
32
|
minHeight: 360,
|
|
33
33
|
width: 512
|
|
34
|
-
}
|
|
34
|
+
},
|
|
35
|
+
full: {}
|
|
35
36
|
};
|
|
36
|
-
const containerPaddingVertical =
|
|
37
|
+
const containerPaddingVertical = 24;
|
|
37
38
|
const dialogMaxHeight = windowHeight - containerPaddingVertical * 2;
|
|
38
39
|
const dialogMaxWidth = (_sizeStyleMap$size = sizeStyleMap[size]) === null || _sizeStyleMap$size === void 0 ? void 0 : _sizeStyleMap$size.maxWidth;
|
|
40
|
+
const isFullScreen = size === 'full';
|
|
39
41
|
return {
|
|
40
42
|
root: {
|
|
41
43
|
alignItems: 'center',
|
|
42
44
|
justifyContent: 'center',
|
|
43
45
|
zIndex: theme.zIndex.dialog
|
|
44
46
|
},
|
|
45
|
-
container:
|
|
47
|
+
container: isFullScreen ? {
|
|
46
48
|
height: '100%',
|
|
47
49
|
width: '100%'
|
|
48
50
|
} : {
|
|
49
51
|
alignItems: 'center',
|
|
50
|
-
|
|
51
|
-
paddingHorizontal: theme.spacing(windowWidth > 320 ? 6 : 4),
|
|
52
|
+
paddingHorizontal: windowWidth > theme.breakpoints.values.xs ? 24 : 16,
|
|
52
53
|
paddingVertical: containerPaddingVertical,
|
|
53
54
|
width: '100%'
|
|
54
55
|
},
|
|
55
|
-
paper:
|
|
56
|
+
paper: isFullScreen ? {
|
|
56
57
|
backgroundColor: theme.palette.surface.base,
|
|
57
58
|
height: '100%',
|
|
58
59
|
width: '100%'
|
|
@@ -74,6 +75,6 @@ function useDialogStyle(size, fullScreen) {
|
|
|
74
75
|
width: '100%'
|
|
75
76
|
}
|
|
76
77
|
};
|
|
77
|
-
}, [theme, windowHeight, windowWidth, size
|
|
78
|
+
}, [theme, windowHeight, windowWidth, size]);
|
|
78
79
|
}
|
|
79
80
|
//# sourceMappingURL=useDialogStyle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDialogStyle","size","
|
|
1
|
+
{"version":3,"names":["useDialogStyle","size","theme","useTheme","height","windowHeight","width","windowWidth","useWindowDimensions","useMemo","sizeStyleMap","small","maxWidth","medium","large","minHeight","full","containerPaddingVertical","dialogMaxHeight","dialogMaxWidth","isFullScreen","root","alignItems","justifyContent","zIndex","dialog","container","paddingHorizontal","breakpoints","values","xs","paddingVertical","paper","backgroundColor","palette","surface","base","borderRadius","shape","radius","xl","maxHeight","overflow","topElementContainer","topElementContent","position","bottom"],"sources":["useDialogStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useWindowDimensions } from 'react-native';\nimport type { FountainUiStyle, NamedStylesStringUnion } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport type { DialogSize } from './DialogProps';\n\ntype DialogStyleKeys =\n | 'root'\n | 'container'\n | 'paper'\n | 'topElementContainer'\n | 'topElementContent';\n\ntype DialogStyles = NamedStylesStringUnion<DialogStyleKeys>;\n\nexport default function useDialogStyle(size: DialogSize): DialogStyles {\n const theme = useTheme();\n\n const {\n height: windowHeight,\n width: windowWidth,\n } = useWindowDimensions();\n\n return useMemo(() => {\n const sizeStyleMap: Record<DialogSize, FountainUiStyle> = {\n small: {\n maxWidth: 260,\n },\n medium: {\n maxWidth: 400,\n },\n large: {\n maxWidth: 512,\n minHeight: 360,\n width: 512,\n },\n full: {},\n };\n\n const containerPaddingVertical = 24;\n const dialogMaxHeight = windowHeight - containerPaddingVertical * 2;\n const dialogMaxWidth = sizeStyleMap[size]?.maxWidth;\n\n const isFullScreen = size === 'full';\n\n return {\n root: {\n alignItems: 'center',\n justifyContent: 'center',\n zIndex: theme.zIndex.dialog,\n },\n container: isFullScreen ? {\n height: '100%',\n width: '100%',\n } : {\n alignItems: 'center',\n paddingHorizontal: windowWidth > theme.breakpoints.values.xs ? 24 : 16,\n paddingVertical: containerPaddingVertical,\n width: '100%',\n },\n paper: isFullScreen ? {\n backgroundColor: theme.palette.surface.base,\n height: '100%',\n width: '100%',\n } : {\n backgroundColor: theme.palette.surface.base,\n borderRadius: theme.shape.radius.xl,\n maxHeight: dialogMaxHeight,\n overflow: 'hidden',\n width: '100%',\n ...sizeStyleMap[size],\n },\n topElementContainer: {\n maxWidth: dialogMaxWidth,\n width: '100%',\n },\n topElementContent: {\n position: 'absolute',\n bottom: 0,\n width: '100%',\n },\n };\n }, [theme, windowHeight, windowWidth, size]);\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAYe,SAASA,cAAT,CAAwBC,IAAxB,EAAwD;EACnE,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAM;IACFC,MAAM,EAAEC,YADN;IAEFC,KAAK,EAAEC;EAFL,IAGF,IAAAC,gCAAA,GAHJ;EAKA,OAAO,IAAAC,cAAA,EAAQ,MAAM;IAAA;;IACjB,MAAMC,YAAiD,GAAG;MACtDC,KAAK,EAAE;QACHC,QAAQ,EAAE;MADP,CAD+C;MAItDC,MAAM,EAAE;QACJD,QAAQ,EAAE;MADN,CAJ8C;MAOtDE,KAAK,EAAE;QACHF,QAAQ,EAAE,GADP;QAEHG,SAAS,EAAE,GAFR;QAGHT,KAAK,EAAE;MAHJ,CAP+C;MAYtDU,IAAI,EAAE;IAZgD,CAA1D;IAeA,MAAMC,wBAAwB,GAAG,EAAjC;IACA,MAAMC,eAAe,GAAGb,YAAY,GAAGY,wBAAwB,GAAG,CAAlE;IACA,MAAME,cAAc,yBAAGT,YAAY,CAACT,IAAD,CAAf,uDAAG,mBAAoBW,QAA3C;IAEA,MAAMQ,YAAY,GAAGnB,IAAI,KAAK,MAA9B;IAEA,OAAO;MACHoB,IAAI,EAAE;QACFC,UAAU,EAAE,QADV;QAEFC,cAAc,EAAE,QAFd;QAGFC,MAAM,EAAEtB,KAAK,CAACsB,MAAN,CAAaC;MAHnB,CADH;MAMHC,SAAS,EAAEN,YAAY,GAAG;QACtBhB,MAAM,EAAE,MADc;QAEtBE,KAAK,EAAE;MAFe,CAAH,GAGnB;QACAgB,UAAU,EAAE,QADZ;QAEAK,iBAAiB,EAAEpB,WAAW,GAAGL,KAAK,CAAC0B,WAAN,CAAkBC,MAAlB,CAAyBC,EAAvC,GAA4C,EAA5C,GAAiD,EAFpE;QAGAC,eAAe,EAAEd,wBAHjB;QAIAX,KAAK,EAAE;MAJP,CATD;MAeH0B,KAAK,EAAEZ,YAAY,GAAG;QAClBa,eAAe,EAAE/B,KAAK,CAACgC,OAAN,CAAcC,OAAd,CAAsBC,IADrB;QAElBhC,MAAM,EAAE,MAFU;QAGlBE,KAAK,EAAE;MAHW,CAAH,GAIf;QACA2B,eAAe,EAAE/B,KAAK,CAACgC,OAAN,CAAcC,OAAd,CAAsBC,IADvC;QAEAC,YAAY,EAAEnC,KAAK,CAACoC,KAAN,CAAYC,MAAZ,CAAmBC,EAFjC;QAGAC,SAAS,EAAEvB,eAHX;QAIAwB,QAAQ,EAAE,QAJV;QAKApC,KAAK,EAAE,MALP;QAMA,GAAGI,YAAY,CAACT,IAAD;MANf,CAnBD;MA2BH0C,mBAAmB,EAAE;QACjB/B,QAAQ,EAAEO,cADO;QAEjBb,KAAK,EAAE;MAFU,CA3BlB;MA+BHsC,iBAAiB,EAAE;QACfC,QAAQ,EAAE,UADK;QAEfC,MAAM,EAAE,CAFO;QAGfxC,KAAK,EAAE;MAHQ;IA/BhB,CAAP;EAqCH,CA3DM,EA2DJ,CAACJ,KAAD,EAAQG,YAAR,EAAsBE,WAAtB,EAAmCN,IAAnC,CA3DI,CAAP;AA4DH"}
|
|
@@ -40,8 +40,7 @@ function DialogContent(props) {
|
|
|
40
40
|
const sectionStyle = (0, _Dialog.useDialogSectionStyle)();
|
|
41
41
|
const rootStyle = (0, _styles.css)([styles.root, sectionStyle, styleProp]);
|
|
42
42
|
const contentFontStyle = (0, _styles.createFontStyle)(theme, {
|
|
43
|
-
|
|
44
|
-
// selector: (typography) => typography.body2.regular,
|
|
43
|
+
selector: typography => typography.body2.regular,
|
|
45
44
|
color: theme.palette.text.base
|
|
46
45
|
});
|
|
47
46
|
const contentStyle = (0, _styles.css)([contentFontStyle, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","theme","useTheme","root","flexGrow","flexShrink","marginVertical","spacing","DialogContent","props","children","style","styleProp","textAlign","otherProps","styles","sectionStyle","useDialogSectionStyle","rootStyle","css","contentFontStyle","createFontStyle","color","palette","text","base","contentStyle"],"sources":["DialogContent.tsx"],"sourcesContent":["import React from 'react';\nimport { ScrollView, Text, TextStyle } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useDialogSectionStyle } from '../Dialog';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type DialogContentProps from './DialogContentProps';\n\ntype DialogContentStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: UseStyles<DialogContentStyles> = function (): DialogContentStyles {\n const theme = useTheme();\n\n return {\n root: {\n flexGrow: 1,\n flexShrink: 1,\n marginVertical: theme.spacing(4),\n },\n };\n};\n\nexport default function DialogContent(props: DialogContentProps) {\n const {\n children,\n style: styleProp,\n textAlign = 'left' as TextStyle['textAlign'],\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const sectionStyle = useDialogSectionStyle();\n\n const rootStyle = css([\n styles.root,\n sectionStyle,\n styleProp,\n ]);\n\n const contentFontStyle = createFontStyle(theme, {\n
|
|
1
|
+
{"version":3,"names":["useStyles","theme","useTheme","root","flexGrow","flexShrink","marginVertical","spacing","DialogContent","props","children","style","styleProp","textAlign","otherProps","styles","sectionStyle","useDialogSectionStyle","rootStyle","css","contentFontStyle","createFontStyle","selector","typography","body2","regular","color","palette","text","base","contentStyle"],"sources":["DialogContent.tsx"],"sourcesContent":["import React from 'react';\nimport { ScrollView, Text, TextStyle } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useDialogSectionStyle } from '../Dialog';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type DialogContentProps from './DialogContentProps';\n\ntype DialogContentStyles = NamedStylesStringUnion<'root'>;\n\nconst useStyles: UseStyles<DialogContentStyles> = function (): DialogContentStyles {\n const theme = useTheme();\n\n return {\n root: {\n flexGrow: 1,\n flexShrink: 1,\n marginVertical: theme.spacing(4),\n },\n };\n};\n\nexport default function DialogContent(props: DialogContentProps) {\n const {\n children,\n style: styleProp,\n textAlign = 'left' as TextStyle['textAlign'],\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const sectionStyle = useDialogSectionStyle();\n\n const rootStyle = css([\n styles.root,\n sectionStyle,\n styleProp,\n ]);\n\n const contentFontStyle = createFontStyle(theme, {\n selector: (typography) => typography.body2.regular,\n color: theme.palette.text.base,\n });\n\n const contentStyle = css([\n contentFontStyle,\n { textAlign },\n ]);\n\n return (\n <ScrollView\n bounces={false}\n style={rootStyle}\n {...otherProps}\n >\n {typeof children === 'string' ? (\n <Text style={contentStyle}>\n {children}\n </Text>\n ) : (children)}\n </ScrollView>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAKA,MAAMA,SAAyC,GAAG,YAAiC;EAC/E,MAAMC,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,OAAO;IACHC,IAAI,EAAE;MACFC,QAAQ,EAAE,CADR;MAEFC,UAAU,EAAE,CAFV;MAGFC,cAAc,EAAEL,KAAK,CAACM,OAAN,CAAc,CAAd;IAHd;EADH,CAAP;AAOH,CAVD;;AAYe,SAASC,aAAT,CAAuBC,KAAvB,EAAkD;EAC7D,MAAM;IACFC,QADE;IAEFC,KAAK,EAAEC,SAFL;IAGFC,SAAS,GAAG,MAHV;IAIF,GAAGC;EAJD,IAKFL,KALJ;EAOA,MAAMR,KAAK,GAAG,IAAAC,gBAAA,GAAd;EAEA,MAAMa,MAAM,GAAGf,SAAS,EAAxB;EAEA,MAAMgB,YAAY,GAAG,IAAAC,6BAAA,GAArB;EAEA,MAAMC,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBJ,MAAM,CAACZ,IADW,EAElBa,YAFkB,EAGlBJ,SAHkB,CAAJ,CAAlB;EAMA,MAAMQ,gBAAgB,GAAG,IAAAC,uBAAA,EAAgBpB,KAAhB,EAAuB;IAC5CqB,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,KAAX,CAAiBC,OADC;IAE5CC,KAAK,EAAEzB,KAAK,CAAC0B,OAAN,CAAcC,IAAd,CAAmBC;EAFkB,CAAvB,CAAzB;EAKA,MAAMC,YAAY,GAAG,IAAAX,WAAA,EAAI,CACrBC,gBADqB,EAErB;IAAEP;EAAF,CAFqB,CAAJ,CAArB;EAKA,oBACI,6BAAC,uBAAD;IACI,OAAO,EAAE,KADb;IAEI,KAAK,EAAEK;EAFX,GAGQJ,UAHR,GAKK,OAAOJ,QAAP,KAAoB,QAApB,gBACG,6BAAC,iBAAD;IAAM,KAAK,EAAEoB;EAAb,GACKpB,QADL,CADH,GAIIA,QATT,CADJ;AAaH;;AAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = BackButton;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
13
|
+
|
|
14
|
+
var _internal = require("../internal");
|
|
15
|
+
|
|
16
|
+
var _styles = require("@fountain-ui/styles");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
const styles = _reactNative.StyleSheet.create({
|
|
23
|
+
root: {
|
|
24
|
+
height: 40,
|
|
25
|
+
left: 20,
|
|
26
|
+
paddingLeft: 5,
|
|
27
|
+
paddingRight: 11,
|
|
28
|
+
paddingVertical: 8,
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
width: 40
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
function BackButton(props) {
|
|
35
|
+
const {
|
|
36
|
+
style: styleProp,
|
|
37
|
+
...otherProps
|
|
38
|
+
} = props;
|
|
39
|
+
const rootStyle = (0, _styles.css)([styles.root, styleProp]);
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(_IconButton.default, _extends({
|
|
41
|
+
style: rootStyle
|
|
42
|
+
}, otherProps), /*#__PURE__*/_react.default.createElement(_internal.ChevronLeft, {
|
|
43
|
+
color: 'strong',
|
|
44
|
+
size: 'large'
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=BackButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["styles","StyleSheet","create","root","height","left","paddingLeft","paddingRight","paddingVertical","position","width","BackButton","props","style","styleProp","otherProps","rootStyle","css"],"sources":["BackButton.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet } from 'react-native';\nimport type { IconButtonProps } from '../IconButton';\nimport IconButton from '../IconButton';\nimport { ChevronLeft } from '../internal';\nimport { css } from '@fountain-ui/styles';\n\nconst styles = StyleSheet.create({\n root: {\n height: 40,\n left: 20,\n paddingLeft: 5,\n paddingRight: 11,\n paddingVertical: 8,\n position: 'absolute',\n width: 40,\n },\n});\n\ninterface BackButtonProps extends Omit<IconButtonProps, 'children'> {}\n\nexport default function BackButton(props: BackButtonProps) {\n const {\n style: styleProp,\n ...otherProps\n } = props;\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n return (\n <IconButton\n style={rootStyle}\n {...otherProps}\n >\n <ChevronLeft\n color={'strong'}\n size={'large'}\n />\n </IconButton>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAEA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,MAAM,EAAE,EADN;IAEFC,IAAI,EAAE,EAFJ;IAGFC,WAAW,EAAE,CAHX;IAIFC,YAAY,EAAE,EAJZ;IAKFC,eAAe,EAAE,CALf;IAMFC,QAAQ,EAAE,UANR;IAOFC,KAAK,EAAE;EAPL;AADuB,CAAlB,CAAf;;AAce,SAASC,UAAT,CAAoBC,KAApB,EAA4C;EACvD,MAAM;IACFC,KAAK,EAAEC,SADL;IAEF,GAAGC;EAFD,IAGFH,KAHJ;EAKA,MAAMI,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBjB,MAAM,CAACG,IADW,EAElBW,SAFkB,CAAJ,CAAlB;EAKA,oBACI,6BAAC,mBAAD;IACI,KAAK,EAAEE;EADX,GAEQD,UAFR,gBAII,6BAAC,qBAAD;IACI,KAAK,EAAE,QADX;IAEI,IAAI,EAAE;EAFV,EAJJ,CADJ;AAWH"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = CloseButton;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
|
13
|
+
|
|
14
|
+
var _internal = require("../internal");
|
|
15
|
+
|
|
16
|
+
var _styles = require("@fountain-ui/styles");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
const styles = _reactNative.StyleSheet.create({
|
|
23
|
+
root: {
|
|
24
|
+
height: 40,
|
|
25
|
+
left: 20,
|
|
26
|
+
padding: 8,
|
|
27
|
+
position: 'absolute',
|
|
28
|
+
width: 40
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
function CloseButton(props) {
|
|
33
|
+
const {
|
|
34
|
+
style: styleProp,
|
|
35
|
+
...otherProps
|
|
36
|
+
} = props;
|
|
37
|
+
const rootStyle = (0, _styles.css)([styles.root, styleProp]);
|
|
38
|
+
return /*#__PURE__*/_react.default.createElement(_IconButton.default, _extends({
|
|
39
|
+
style: rootStyle
|
|
40
|
+
}, otherProps), /*#__PURE__*/_react.default.createElement(_internal.Close, {
|
|
41
|
+
color: 'strong',
|
|
42
|
+
size: 'large'
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=CloseButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["styles","StyleSheet","create","root","height","left","padding","position","width","CloseButton","props","style","styleProp","otherProps","rootStyle","css"],"sources":["CloseButton.tsx"],"sourcesContent":["import React from 'react';\nimport { StyleSheet } from 'react-native';\nimport type { IconButtonProps } from '../IconButton';\nimport IconButton from '../IconButton';\nimport { Close } from '../internal';\nimport { css } from '@fountain-ui/styles';\n\nconst styles = StyleSheet.create({\n root: {\n height: 40,\n left: 20,\n padding: 8,\n position: 'absolute',\n width: 40,\n },\n});\n\ninterface CloseButtonProps extends Omit<IconButtonProps, 'children'> {}\n\nexport default function CloseButton(props: CloseButtonProps) {\n const {\n style: styleProp,\n ...otherProps\n } = props;\n\n const rootStyle = css([\n styles.root,\n styleProp,\n ]);\n\n return (\n <IconButton\n style={rootStyle}\n {...otherProps}\n >\n <Close\n color={'strong'}\n size={'large'}\n />\n </IconButton>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;AAEA,MAAMA,MAAM,GAAGC,uBAAA,CAAWC,MAAX,CAAkB;EAC7BC,IAAI,EAAE;IACFC,MAAM,EAAE,EADN;IAEFC,IAAI,EAAE,EAFJ;IAGFC,OAAO,EAAE,CAHP;IAIFC,QAAQ,EAAE,UAJR;IAKFC,KAAK,EAAE;EALL;AADuB,CAAlB,CAAf;;AAYe,SAASC,WAAT,CAAqBC,KAArB,EAA8C;EACzD,MAAM;IACFC,KAAK,EAAEC,SADL;IAEF,GAAGC;EAFD,IAGFH,KAHJ;EAKA,MAAMI,SAAS,GAAG,IAAAC,WAAA,EAAI,CAClBf,MAAM,CAACG,IADW,EAElBS,SAFkB,CAAJ,CAAlB;EAKA,oBACI,6BAAC,mBAAD;IACI,KAAK,EAAEE;EADX,GAEQD,UAFR,gBAII,6BAAC,eAAD;IACI,KAAK,EAAE,QADX;IAEI,IAAI,EAAE;EAFV,EAJJ,CADJ;AAWH"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default =
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -13,6 +13,10 @@ var _Dialog = require("../Dialog");
|
|
|
13
13
|
|
|
14
14
|
var _styles = require("../styles");
|
|
15
15
|
|
|
16
|
+
var _BackButton = _interopRequireDefault(require("./BackButton"));
|
|
17
|
+
|
|
18
|
+
var _CloseButton = _interopRequireDefault(require("./CloseButton"));
|
|
19
|
+
|
|
16
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
21
|
|
|
18
22
|
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); }
|
|
@@ -29,7 +33,7 @@ const useStyles = function () {
|
|
|
29
33
|
};
|
|
30
34
|
};
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
const DialogTitle = props => {
|
|
33
37
|
const {
|
|
34
38
|
children,
|
|
35
39
|
style: styleProp,
|
|
@@ -49,7 +53,10 @@ function DialogTitle(props) {
|
|
|
49
53
|
}), typeof children === 'string' ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
50
54
|
style: titleStyle
|
|
51
55
|
}, children) : children);
|
|
52
|
-
}
|
|
56
|
+
};
|
|
53
57
|
|
|
54
|
-
;
|
|
58
|
+
DialogTitle.BackButton = _BackButton.default;
|
|
59
|
+
DialogTitle.CloseButton = _CloseButton.default;
|
|
60
|
+
var _default = DialogTitle;
|
|
61
|
+
exports.default = _default;
|
|
55
62
|
//# sourceMappingURL=DialogTitle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useStyles","theme","useTheme","root","paddingTop","spacing","title","textAlign","DialogTitle","props","children","style","styleProp","otherProps","styles","sectionStyle","useDialogSectionStyle","rootStyle","css","titleFontStyle","createFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle"],"sources":["DialogTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useDialogSectionStyle } from '../Dialog';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type DialogTitleProps from './DialogTitleProps';\n\ntype DialogTitleStyles = NamedStylesStringUnion<'root' | 'title'>;\n\nconst useStyles: UseStyles<DialogTitleStyles> = function (): DialogTitleStyles {\n const theme = useTheme();\n\n return {\n root: {\n paddingTop: theme.spacing(6.5),\n },\n title: {\n textAlign: 'center',\n },\n };\n};\n\
|
|
1
|
+
{"version":3,"names":["useStyles","theme","useTheme","root","paddingTop","spacing","title","textAlign","DialogTitle","props","children","style","styleProp","otherProps","styles","sectionStyle","useDialogSectionStyle","rootStyle","css","titleFontStyle","createFontStyle","selector","typography","header3","semiBold","color","palette","text","strong","titleStyle","BackButton","CloseButton"],"sources":["DialogTitle.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport type { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { useDialogSectionStyle } from '../Dialog';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport BackButton from './BackButton';\nimport CloseButton from './CloseButton';\nimport type DialogTitleProps from './DialogTitleProps';\n\ntype DialogTitleStyles = NamedStylesStringUnion<'root' | 'title'>;\n\nconst useStyles: UseStyles<DialogTitleStyles> = function (): DialogTitleStyles {\n const theme = useTheme();\n\n return {\n root: {\n paddingTop: theme.spacing(6.5),\n },\n title: {\n textAlign: 'center',\n },\n };\n};\n\nconst DialogTitle = (props: DialogTitleProps) => {\n const {\n children,\n style: styleProp,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const sectionStyle = useDialogSectionStyle();\n\n const rootStyle = css([\n styles.root,\n sectionStyle,\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 <View\n {...otherProps}\n style={rootStyle}\n >\n {typeof children === 'string' ? (\n <Text style={titleStyle}>\n {children}\n </Text>\n ) : (children)}\n </View>\n );\n};\n\nDialogTitle.BackButton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A2CAF,WAAW,CAACsB,UAAZ,GAAyBA,mBAAzB;AAEAtB,WAAW,CAACuB,WAAZ,GAA0BA,oBAA1B;eAEevB,W"}
|
|
@@ -9,13 +9,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
-
var _styles = require("
|
|
12
|
+
var _styles = require("@fountain-ui/styles");
|
|
13
|
+
|
|
14
|
+
var _styles2 = require("../styles");
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
18
|
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); }
|
|
17
19
|
|
|
18
|
-
const styles =
|
|
20
|
+
const styles = _styles2.StyleSheet.create({
|
|
19
21
|
container: {
|
|
20
22
|
alignSelf: 'stretch',
|
|
21
23
|
alignItems: 'center'
|
|
@@ -39,6 +41,12 @@ function selectBorderColor(theme, variant, vertical) {
|
|
|
39
41
|
|
|
40
42
|
case 'strong':
|
|
41
43
|
return vertical ? theme.palette.border.weak : theme.palette.border.base;
|
|
44
|
+
|
|
45
|
+
case 'strongStatic':
|
|
46
|
+
return _styles.commonColors.opacity.white['13'];
|
|
47
|
+
|
|
48
|
+
case 'baseStatic':
|
|
49
|
+
return _styles.commonColors.opacity.white['10'];
|
|
42
50
|
}
|
|
43
51
|
}
|
|
44
52
|
|
|
@@ -54,7 +62,7 @@ function Divider(props) {
|
|
|
54
62
|
vertical = false,
|
|
55
63
|
...otherProps
|
|
56
64
|
} = props;
|
|
57
|
-
const theme = (0,
|
|
65
|
+
const theme = (0, _styles2.useTheme)();
|
|
58
66
|
const borderWidth = borderWidthProp ?? (vertical ? 1 : 0.5);
|
|
59
67
|
const fontColor = theme.palette.text.weak;
|
|
60
68
|
const borderColor = selectBorderColor(theme, variant, vertical);
|
|
@@ -86,8 +94,8 @@ function Divider(props) {
|
|
|
86
94
|
} : {
|
|
87
95
|
borderBottomWidth: borderWidth
|
|
88
96
|
};
|
|
89
|
-
const containerStyle = (0,
|
|
90
|
-
const dividerStyle = (0,
|
|
97
|
+
const containerStyle = (0, _styles2.css)([insetStyle, marginStyle, styles.container, vertical ? styles.column : styles.row, childrenProp ? undefined : borderColorStyle, childrenProp ? undefined : borderWidthStyle, style]);
|
|
98
|
+
const dividerStyle = (0, _styles2.css)([borderColorStyle, borderWidthStyle, styles.divider]);
|
|
91
99
|
const dividerMarginSize = theme.spacing(marginBetweenChildren);
|
|
92
100
|
const startDividerStyle = {
|
|
93
101
|
display: elementAlign !== 'start' ? 'flex' : 'none',
|
|
@@ -105,17 +113,17 @@ function Divider(props) {
|
|
|
105
113
|
marginLeft: dividerMarginSize
|
|
106
114
|
})
|
|
107
115
|
};
|
|
108
|
-
const fontStyle = (0,
|
|
109
|
-
selector: typo => typo.caption2,
|
|
116
|
+
const fontStyle = (0, _styles2.createFontStyle)(theme, {
|
|
117
|
+
selector: typo => typo.caption2.medium,
|
|
110
118
|
color: fontColor
|
|
111
119
|
});
|
|
112
120
|
const element = typeof childrenProp === 'string' ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
113
|
-
style: (0,
|
|
121
|
+
style: (0, _styles2.css)(fontStyle)
|
|
114
122
|
}, childrenProp) : childrenProp;
|
|
115
123
|
const children = childrenProp ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
116
|
-
style: (0,
|
|
124
|
+
style: (0, _styles2.css)([dividerStyle, startDividerStyle])
|
|
117
125
|
}), element, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
118
|
-
style: (0,
|
|
126
|
+
style: (0, _styles2.css)([dividerStyle, endDividerStyle])
|
|
119
127
|
})) : null;
|
|
120
128
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
121
129
|
style: containerStyle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["styles","StyleSheet","create","container","alignSelf","alignItems","row","flexDirection","column","divider","flexGrow","selectBorderColor","theme","variant","vertical","palette","border","weaker","weak","base","Divider","props","borderWidth","borderWidthProp","children","childrenProp","elementAlign","inset","marginBetweenChildren","style","otherProps","useTheme","fontColor","text","borderColor","marginSize","spacing","insetSize","marginLeft","marginRight","marginTop","marginBottom","marginStyle","insetStyle","borderColorStyle","borderWidthStyle","borderRightWidth","borderBottomWidth","containerStyle","css","undefined","dividerStyle","dividerMarginSize","startDividerStyle","display","endDividerStyle","fontStyle","createFontStyle","selector","typo","caption2","color","element"],"sources":["Divider.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport type { Theme } from '@fountain-ui/styles';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport { ExtendedStyle } from '../types';\nimport type DividerProps from './DividerProps';\nimport type { DividerVariant } from './DividerProps';\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: 'stretch',\n alignItems: 'center',\n },\n row: {\n flexDirection: 'row',\n },\n column: {\n flexDirection: 'column',\n },\n divider: {\n flexGrow: 1,\n },\n});\n\nfunction selectBorderColor(theme: Theme, variant: DividerVariant, vertical: boolean) {\n switch (variant) {\n default:\n case 'base':\n return vertical ? theme.palette.border.weaker : theme.palette.border.weak;\n case 'strong':\n return vertical ? theme.palette.border.weak : theme.palette.border.base;\n }\n}\n\nexport default function Divider(props: DividerProps) {\n const {\n borderWidth: borderWidthProp,\n children: childrenProp,\n elementAlign = 'center',\n inset = 0,\n marginBetweenChildren = 2,\n style,\n variant = 'base' as DividerVariant,\n vertical = false,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const borderWidth = borderWidthProp ?? (vertical ? 1 : 0.5);\n const fontColor = theme.palette.text.weak;\n const borderColor = selectBorderColor(theme, variant, vertical);\n const marginSize = theme.spacing(1);\n const insetSize = theme.spacing(inset);\n\n const marginLeft = marginSize;\n const marginRight = marginSize;\n const marginTop = marginSize;\n const marginBottom = marginSize;\n\n const marginStyle = vertical\n ? { marginLeft, marginRight }\n : { marginTop, marginBottom };\n\n const insetStyle = vertical\n ? { marginTop: insetSize, marginBottom: insetSize }\n : { marginLeft: insetSize, marginRight: insetSize };\n\n const borderColorStyle = { borderColor };\n const borderWidthStyle = (vertical ? { borderRightWidth: borderWidth } : { borderBottomWidth: borderWidth });\n\n const containerStyle = css([\n insetStyle,\n marginStyle,\n styles.container,\n vertical ? styles.column : styles.row,\n childrenProp ? undefined : borderColorStyle,\n childrenProp ? undefined : borderWidthStyle,\n style,\n ]);\n\n const dividerStyle = css([\n borderColorStyle,\n borderWidthStyle,\n styles.divider,\n ]);\n\n const dividerMarginSize = theme.spacing(marginBetweenChildren);\n const startDividerStyle: ExtendedStyle = {\n display: elementAlign !== 'start' ? 'flex' : 'none',\n ...(vertical ? { marginBottom: dividerMarginSize } : { marginRight: dividerMarginSize }),\n };\n const endDividerStyle: ExtendedStyle = {\n display: elementAlign !== 'end' ? 'flex' : 'none',\n ...(vertical ? { marginTop: dividerMarginSize } : { marginLeft: dividerMarginSize }),\n };\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => typo.caption2,\n color: fontColor,\n });\n\n const element = typeof childrenProp === 'string'\n ? <Text style={css(fontStyle)}>{childrenProp}</Text>\n : childrenProp;\n\n const children = childrenProp ? (\n <React.Fragment>\n <View style={css([dividerStyle, startDividerStyle])}/>\n {element}\n <View style={css([dividerStyle, endDividerStyle])}/>\n </React.Fragment>\n ) : null;\n\n return (\n <View\n style={containerStyle}\n {...otherProps}\n >\n {children}\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;;;AAKA,MAAMA,MAAM,GAAGC,
|
|
1
|
+
{"version":3,"names":["styles","StyleSheet","create","container","alignSelf","alignItems","row","flexDirection","column","divider","flexGrow","selectBorderColor","theme","variant","vertical","palette","border","weaker","weak","base","commonColors","opacity","white","Divider","props","borderWidth","borderWidthProp","children","childrenProp","elementAlign","inset","marginBetweenChildren","style","otherProps","useTheme","fontColor","text","borderColor","marginSize","spacing","insetSize","marginLeft","marginRight","marginTop","marginBottom","marginStyle","insetStyle","borderColorStyle","borderWidthStyle","borderRightWidth","borderBottomWidth","containerStyle","css","undefined","dividerStyle","dividerMarginSize","startDividerStyle","display","endDividerStyle","fontStyle","createFontStyle","selector","typo","caption2","medium","color","element"],"sources":["Divider.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport type { Theme } from '@fountain-ui/styles';\nimport { commonColors } from '@fountain-ui/styles';\nimport { createFontStyle, css, StyleSheet, useTheme } from '../styles';\nimport { ExtendedStyle } from '../types';\nimport type DividerProps from './DividerProps';\nimport type { DividerVariant } from './DividerProps';\n\nconst styles = StyleSheet.create({\n container: {\n alignSelf: 'stretch',\n alignItems: 'center',\n },\n row: {\n flexDirection: 'row',\n },\n column: {\n flexDirection: 'column',\n },\n divider: {\n flexGrow: 1,\n },\n});\n\nfunction selectBorderColor(theme: Theme, variant: DividerVariant, vertical: boolean) {\n switch (variant) {\n default:\n case 'base':\n return vertical ? theme.palette.border.weaker : theme.palette.border.weak;\n case 'strong':\n return vertical ? theme.palette.border.weak : theme.palette.border.base;\n case 'strongStatic':\n return commonColors.opacity.white['13'];\n case 'baseStatic':\n return commonColors.opacity.white['10'];\n }\n}\n\nexport default function Divider(props: DividerProps) {\n const {\n borderWidth: borderWidthProp,\n children: childrenProp,\n elementAlign = 'center',\n inset = 0,\n marginBetweenChildren = 2,\n style,\n variant = 'base' as DividerVariant,\n vertical = false,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const borderWidth = borderWidthProp ?? (vertical ? 1 : 0.5);\n const fontColor = theme.palette.text.weak;\n const borderColor = selectBorderColor(theme, variant, vertical);\n const marginSize = theme.spacing(1);\n const insetSize = theme.spacing(inset);\n\n const marginLeft = marginSize;\n const marginRight = marginSize;\n const marginTop = marginSize;\n const marginBottom = marginSize;\n\n const marginStyle = vertical\n ? { marginLeft, marginRight }\n : { marginTop, marginBottom };\n\n const insetStyle = vertical\n ? { marginTop: insetSize, marginBottom: insetSize }\n : { marginLeft: insetSize, marginRight: insetSize };\n\n const borderColorStyle = { borderColor };\n const borderWidthStyle = (vertical ? { borderRightWidth: borderWidth } : { borderBottomWidth: borderWidth });\n\n const containerStyle = css([\n insetStyle,\n marginStyle,\n styles.container,\n vertical ? styles.column : styles.row,\n childrenProp ? undefined : borderColorStyle,\n childrenProp ? undefined : borderWidthStyle,\n style,\n ]);\n\n const dividerStyle = css([\n borderColorStyle,\n borderWidthStyle,\n styles.divider,\n ]);\n\n const dividerMarginSize = theme.spacing(marginBetweenChildren);\n const startDividerStyle: ExtendedStyle = {\n display: elementAlign !== 'start' ? 'flex' : 'none',\n ...(vertical ? { marginBottom: dividerMarginSize } : { marginRight: dividerMarginSize }),\n };\n const endDividerStyle: ExtendedStyle = {\n display: elementAlign !== 'end' ? 'flex' : 'none',\n ...(vertical ? { marginTop: dividerMarginSize } : { marginLeft: dividerMarginSize }),\n };\n\n const fontStyle = createFontStyle(theme, {\n selector: (typo) => typo.caption2.medium,\n color: fontColor,\n });\n\n const element = typeof childrenProp === 'string'\n ? <Text style={css(fontStyle)}>{childrenProp}</Text>\n : childrenProp;\n\n const children = childrenProp ? (\n <React.Fragment>\n <View style={css([dividerStyle, startDividerStyle])}/>\n {element}\n <View style={css([dividerStyle, endDividerStyle])}/>\n </React.Fragment>\n ) : null;\n\n return (\n <View\n style={containerStyle}\n {...otherProps}\n >\n {children}\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;AAKA,MAAMA,MAAM,GAAGC,mBAAA,CAAWC,MAAX,CAAkB;EAC7BC,SAAS,EAAE;IACPC,SAAS,EAAE,SADJ;IAEPC,UAAU,EAAE;EAFL,CADkB;EAK7BC,GA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
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
const
|
|
8
|
-
exports.
|
|
9
|
-
const dividerVariants = ['base', 'strong'];
|
|
6
|
+
exports.dividerVariants = exports.dividerElementAligns = void 0;
|
|
7
|
+
const dividerElementAligns = ['start', 'center', 'end'];
|
|
8
|
+
exports.dividerElementAligns = dividerElementAligns;
|
|
9
|
+
const dividerVariants = ['base', 'strong', 'baseStatic', 'strongStatic'];
|
|
10
10
|
exports.dividerVariants = dividerVariants;
|
|
11
11
|
//# sourceMappingURL=DividerProps.js.map
|