From 21c806cd66d1b4609600e043c8300ed8e0458b52 Mon Sep 17 00:00:00 2001 From: Cole Bemis Date: Wed, 31 Mar 2021 16:18:06 -0700 Subject: [PATCH] Export prop types from index.ts --- src/Flash.tsx | 2 + src/Pagination/{index.tsx => index.ts} | 1 + src/SideNav.tsx | 2 +- src/index.ts | 84 +++++++++++++++++++++++++- 4 files changed, 87 insertions(+), 2 deletions(-) rename src/Pagination/{index.tsx => index.ts} (56%) diff --git a/src/Flash.tsx b/src/Flash.tsx index 4a98b3b9951..28151d93b66 100644 --- a/src/Flash.tsx +++ b/src/Flash.tsx @@ -2,6 +2,7 @@ import styled from 'styled-components' import {variant} from 'styled-system' import {COMMON, get, SystemCommonProps} from './constants' import sx, {SxProp} from './sx' +import {ComponentProps} from './utils/types' const variants = variant({ variants: { @@ -72,4 +73,5 @@ Flash.defaultProps = { variant: 'default' } +export type FlashProps = ComponentProps export default Flash diff --git a/src/Pagination/index.tsx b/src/Pagination/index.ts similarity index 56% rename from src/Pagination/index.tsx rename to src/Pagination/index.ts index 1466412190c..0966949cb78 100644 --- a/src/Pagination/index.tsx +++ b/src/Pagination/index.ts @@ -1,3 +1,4 @@ import Pagination from './Pagination' +export type {PaginationProps} from './Pagination' export default Pagination diff --git a/src/SideNav.tsx b/src/SideNav.tsx index 012cbdf39a6..2875163d9a8 100644 --- a/src/SideNav.tsx +++ b/src/SideNav.tsx @@ -160,6 +160,6 @@ SideNavLink.defaultProps = { SideNavLink.displayName = 'SideNav.Link' export type SideNavProps = ComponentProps -export type SideNavLinksProps = ComponentProps +export type SideNavLinkProps = ComponentProps export default Object.assign(SideNav, {Link: SideNavLink}) diff --git a/src/index.ts b/src/index.ts index 79f89a793ab..3628110319f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,14 +1,21 @@ export {default as theme} from './theme' export {get as themeGet} from './constants' export {default as BaseStyles} from './BaseStyles' +export type {BaseStylesProps} from './BaseStyles' export {default as ThemeProvider, useTheme, useColorSchemeVar} from './ThemeProvider' +export type {ThemeProviderProps} from './ThemeProvider' // Layout export {default as BorderBox} from './BorderBox' +export type {BorderBoxProps} from './BorderBox' export {default as Box} from './Box' +export type {BoxProps} from './Box' export {default as Flex} from './Flex' +export type {FlexProps} from './Flex' export {default as Grid} from './Grid' +export type {GridProps} from './Grid' export {default as Position, Absolute, Fixed, Relative, Sticky} from './Position' +export type {PositionProps, AbsoluteProps, FixedProps, RelativeProps, StickyProps} from './Position' // Hooks export {default as useDetails} from './hooks/useDetails' @@ -21,10 +28,15 @@ export {useOverlay} from './hooks/useOverlay' // Components export {default as Avatar} from './Avatar' +export type {AvatarProps} from './Avatar' export {default as AvatarPair} from './AvatarPair' +export type {AvatarPairProps} from './AvatarPair' export {default as AvatarStack} from './AvatarStack' +export type {AvatarStackProps} from './AvatarStack' export {default as BranchName} from './BranchName' +export type {BranchNameProps} from './BranchName' export {default as Breadcrumb} from './Breadcrumb' +export type {BreadcrumbProps, BreadcrumbItemProps} from './Breadcrumb' export { default as Button, ButtonDanger, @@ -35,38 +47,108 @@ export { ButtonClose, ButtonGroup } from './Button' +export type { + ButtonProps, + ButtonDangerProps, + ButtonOutlineProps, + ButtonPrimaryProps, + ButtonInvisibleProps, + ButtonTableListProps, + ButtonCloseProps, + ButtonGroupProps +} from './Button' export {default as Caret} from './Caret' +export type {CaretProps} from './Caret' export {default as CircleBadge} from './CircleBadge' +export type {CircleBadgeProps, CircleBadgeIconProps} from './CircleBadge' export {default as CircleOcticon} from './CircleOcticon' +export type {CircleOcticonProps} from './CircleOcticon' export {default as CounterLabel} from './CounterLabel' +export type {CounterLabelProps} from './CounterLabel' export {default as Details} from './Details' +export type {DetailsProps} from './Details' export {default as Dialog} from './Dialog' +export type {DialogProps, DialogHeaderProps} from './Dialog' export {default as Dropdown} from './Dropdown' +export type { + DropdownProps, + DropdownCaretProps, + DropdownButtonProps, + DropdownItemProps, + DropdownMenuProps +} from './Dropdown' export {default as FilteredSearch} from './FilteredSearch' +export type {FilteredSearchProps} from './FilteredSearch' export {default as FilterList} from './FilterList' +export type {FilterListProps, FilterListItemProps} from './FilterList' export {default as Flash} from './Flash' +export type {FlashProps} from './Flash' export {default as FormGroup} from './FormGroup' +export type {FormGroupProps, FormGroupLabelProps} from './FormGroup' export {default as Header} from './Header' +export type {HeaderProps, HeaderItemProps, HeaderLinkProps} from './Header' export {default as Heading} from './Heading' +export type {HeadingProps} from './Heading' export {default as LabelGroup} from './LabelGroup' +export type {LabelGroupProps} from './LabelGroup' export {default as Label} from './Label' +export type {LabelProps} from './Label' export {default as Link} from './Link' +export type {LinkProps} from './Link' export {default as Overlay} from './Overlay' +export type {OverlayProps} from './Overlay' export {default as Pagehead} from './Pagehead' +export type {PageheadProps} from './Pagehead' export {default as Pagination} from './Pagination' +export type {PaginationProps} from './Pagination' export {default as PointerBox} from './PointerBox' +export type {PointerBoxProps} from './PointerBox' export {default as Popover} from './Popover' -// export {default as Portal, PortalProps, registerPortalRoot} from './Portal' +export type {PopoverProps, PopoverContentProps} from './Popover' +// export {default as Portal, registerPortalRoot} from './Portal' +// export type {PortalProps} from './Portal' export {default as ProgressBar} from './ProgressBar' +export type {ProgressBarProps} from './ProgressBar' export {default as SelectMenu} from './SelectMenu' +export type { + SelectMenuProps, + SelectMenuDividerProps, + SelectMenuFilterProps, + SelectMenuFooterProps, + SelectMenuItemProps, + SelectMenuListProps, + SelectMenuModalProps, + SelectMenuTabsProps, + SelectMenuHeaderProps, + SelectMenuTabProps, + SelectMenuTabPanelProps, + SelectMenuLoadingAnimationProps +} from './SelectMenu' export {default as SideNav} from './SideNav' +export type {SideNavProps, SideNavLinkProps} from './SideNav' export {default as StateLabel} from './StateLabel' +export type {StateLabelProps} from './StateLabel' export {default as StyledOcticon} from './StyledOcticon' +export type {StyledOcticonProps} from './StyledOcticon' export {default as SubNav} from './SubNav' +export type {SubNavProps, SubNavLinkProps, SubNavLinksProps} from './SubNav' export {default as TabNav} from './TabNav' +export type {TabNavProps, TabNavLinkProps} from './TabNav' export {default as TextInput} from './TextInput' +export type {TextInputProps} from './TextInput' export {default as Text} from './Text' +export type {TextProps} from './Text' export {default as Timeline} from './Timeline' +export type { + TimelineProps, + TimelineBadgeProps, + TimelineBodyProps, + TimelineBreakProps, + TimelineItemsProps +} from './Timeline' export {default as Tooltip} from './Tooltip' +export type {TooltipProps} from './Tooltip' export {default as Truncate} from './Truncate' +export type {TruncateProps} from './Truncate' export {default as UnderlineNav} from './UnderlineNav' +export type {UnderlineNavProps, UnderlineNavLinkProps} from './UnderlineNav'