diff --git a/.eslintignore b/.eslintignore index a693875c8a..339ce84214 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,3 +7,4 @@ dependent-usage-analyzer/ build-scss.js component-generator/ example/ +*.d.ts diff --git a/package-lock.json b/package-lock.json index 57ad6fe07c..089b8dc176 100644 --- a/package-lock.json +++ b/package-lock.json @@ -104,7 +104,7 @@ "peerDependencies": { "react": "^16.8.6 || ^17.0.0", "react-dom": "^16.8.6 || ^17.0.0", - "react-intl": "^5.25.1 || ^6.4" + "react-intl": "^5.25.1 || ^6.4.0" } }, "component-generator": { diff --git a/src/ActionRow/index.jsx b/src/ActionRow/index.tsx similarity index 77% rename from src/ActionRow/index.jsx rename to src/ActionRow/index.tsx index e4808ce4d3..dc76a47d98 100644 --- a/src/ActionRow/index.jsx +++ b/src/ActionRow/index.tsx @@ -2,17 +2,25 @@ import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; +export interface ActionRowProps { + as?: React.ElementType; + isStacked?: boolean; + children?: React.ReactNode; + className?: string; +} + function ActionRow({ - as, + as = 'div', isStacked, children, + className, ...props -}) { +}: ActionRowProps) { return React.createElement( as, { ...props, - className: classNames(props.className, { + className: classNames(className, { 'pgn__action-row': !isStacked, 'pgn__action-row-stacked': isStacked, }), @@ -39,7 +47,7 @@ ActionRow.defaultProps = { isStacked: false, }; -function ActionRowSpacer() { +function ActionRowSpacer(): React.ReactElement { return ; } diff --git a/src/Alert/index.d.ts b/src/Alert/index.d.ts new file mode 100644 index 0000000000..04ac93af98 --- /dev/null +++ b/src/Alert/index.d.ts @@ -0,0 +1,18 @@ +import React from 'react'; +import BaseAlert, { AlertProps } from 'react-bootstrap/Alert'; + +declare const ALERT_CLOSE_LABEL_TEXT: string; +export interface BaseAlertProps extends AlertProps { + icon?: React.ReactElement, + actions?: Array, + dismissible?: boolean, + onClose?: () => void, + closeLabel?: React.ReactElement, + stacked?: boolean, +} +declare const Alert: React.ForwardRefExoticComponent & { + Link: typeof BaseAlert.Link; + Heading: typeof BaseAlert.Heading; +}; +export { ALERT_CLOSE_LABEL_TEXT }; +export default Alert; diff --git a/src/Annotation/index.d.ts b/src/Annotation/index.d.ts new file mode 100644 index 0000000000..fd727aedd7 --- /dev/null +++ b/src/Annotation/index.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; + +export interface AnnotationProps { + className?: string, + variant?: 'error' | 'success' | 'warning' | 'light' | 'dark', + children?: React.ReactNode, + arrowPlacement?: 'top' | 'right' | 'bottom' | 'left', +} +declare const Annotation: React.ForwardRefExoticComponent; +export default Annotation; diff --git a/src/Avatar/index.d.ts b/src/Avatar/index.d.ts new file mode 100644 index 0000000000..876fcd5b91 --- /dev/null +++ b/src/Avatar/index.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface AvatarProps { + alt?: string, + size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'huge', + src?: string, +} +declare const Avatar: React.FC; +export default Avatar; diff --git a/src/AvatarButton/index.d.ts b/src/AvatarButton/index.d.ts new file mode 100644 index 0000000000..6f4fd4214c --- /dev/null +++ b/src/AvatarButton/index.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface AvatarButtonProps { + alt?: string, + size?: 'xs' | 'sm' | 'md', + src?: string, +} +declare const AvatarButton: React.FC; +export default AvatarButton; diff --git a/src/Badge/index.d.ts b/src/Badge/index.d.ts new file mode 100644 index 0000000000..76b6a26f42 --- /dev/null +++ b/src/Badge/index.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; +import { BadgeProps } from 'react-bootstrap/Badge'; + +interface IBadge extends BadgeProps { + children?: React.ReactNode, +} + +declare const Badge: React.ForwardRefExoticComponent; +export default Badge; diff --git a/src/Breadcrumb/index.d.ts b/src/Breadcrumb/index.d.ts new file mode 100644 index 0000000000..e167c42a72 --- /dev/null +++ b/src/Breadcrumb/index.d.ts @@ -0,0 +1,18 @@ +import React from 'react'; + +export interface BreadcrumbProps { + links: Array<{ + label: string, + href?: string, + className?: string, + }>, + activeLabel?: string, + spacer?: React.ReactElement, + clickHandler?: Function, + variant?: 'light' | 'dark', + isMobile?: boolean, + ariaLabel?: string, + linkAs?: React.ElementType, +} +declare const Breadcrumb: React.FC; +export default Breadcrumb; diff --git a/src/Breadcrumb/index.jsx b/src/Breadcrumb/index.jsx index 41cc7fd23d..3ecbb3d2bc 100644 --- a/src/Breadcrumb/index.jsx +++ b/src/Breadcrumb/index.jsx @@ -40,7 +40,9 @@ Breadcrumb.propTypes = { * prop as these objects will get passed down as props to the underlying component defined by `linkAs` prop. */ links: PropTypes.arrayOf(PropTypes.shape({ - label: PropTypes.string, + label: PropTypes.string.isRequired, + href: PropTypes.string, + className: PropTypes.string, })).isRequired, /** allows to add a label that is not a link to the end of the breadcrumb. */ activeLabel: PropTypes.string, diff --git a/src/Button/index.d.ts b/src/Button/index.d.ts new file mode 100644 index 0000000000..08246e8b28 --- /dev/null +++ b/src/Button/index.d.ts @@ -0,0 +1,19 @@ +import React from 'react'; +import { ButtonProps } from 'react-bootstrap/Button'; +import { ButtonGroupProps, ButtonToolbarProps } from "react-bootstrap"; +import { BsPrefixRefForwardingComponent } from "react-bootstrap/helpers"; + +export interface BaseButtonProps extends ButtonProps { + iconBefore?: React.ReactElement, + iconAfter?: React.ReactElement, +} + +declare type Button = BsPrefixRefForwardingComponent<'button', BaseButtonProps>; +declare type ButtonGroup = BsPrefixRefForwardingComponent<'div', ButtonGroupProps>; +declare type ButtonToolbar = BsPrefixRefForwardingComponent<'div', ButtonToolbarProps>; + +declare const Button: Button; +declare const ButtonGroup: ButtonGroup; +declare const ButtonToolbar: ButtonToolbar; +export { ButtonGroup, ButtonToolbar }; +export default Button; diff --git a/src/Card/CardBody.d.ts b/src/Card/CardBody.d.ts new file mode 100644 index 0000000000..edd5dca682 --- /dev/null +++ b/src/Card/CardBody.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; + +export interface CardBodyProps { + className?: string, + children?: React.ReactNode, +} +declare const CardBody: React.ForwardRefExoticComponent; +export default CardBody; diff --git a/src/Card/CardCarousel/CardCarousel.d.ts b/src/Card/CardCarousel/CardCarousel.d.ts new file mode 100644 index 0000000000..9f44a0d9bd --- /dev/null +++ b/src/Card/CardCarousel/CardCarousel.d.ts @@ -0,0 +1,23 @@ +import React from 'react'; + +export interface CardCarouselProps { + ariaLabel: string, + children: React.ReactNode, + title?: React.ReactNode, + subtitle?: React.ReactNode, + columnSizes?: { + xs?: number, + sm?: number, + md?: number, + lg?: number, + xl?: number, + }, + hasInteractiveChildren?: boolean, + canScrollHorizontal?: boolean, + disableOpacityMasks?: boolean, + onScrollPrevious?: Function, + onScrollNext?: Function, + CardCarouselControls?: React.ElementType, +} +declare const CardCarousel: React.ForwardRefExoticComponent; +export default CardCarousel; diff --git a/src/Card/CardCarousel/CardCarouselControls.d.ts b/src/Card/CardCarousel/CardCarouselControls.d.ts new file mode 100644 index 0000000000..f0d26924a5 --- /dev/null +++ b/src/Card/CardCarousel/CardCarouselControls.d.ts @@ -0,0 +1,4 @@ +import React from 'react'; + +declare const CardCarouselControls: React.FC; +export default CardCarouselControls; diff --git a/src/Card/CardCarousel/CardCarouselHeader.d.ts b/src/Card/CardCarousel/CardCarouselHeader.d.ts new file mode 100644 index 0000000000..a7ebcb0fe6 --- /dev/null +++ b/src/Card/CardCarousel/CardCarouselHeader.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; + +export interface CardCarouselHeaderProps { + title?: React.ReactNode, + subtitle?: React.ReactNode, +} +declare const CardCarouselHeader: React.FC; +export default CardCarouselHeader; diff --git a/src/Card/CardCarousel/CardCarouselItems.d.ts b/src/Card/CardCarousel/CardCarouselItems.d.ts new file mode 100644 index 0000000000..a7d5cd493f --- /dev/null +++ b/src/Card/CardCarousel/CardCarouselItems.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; + +export interface CardCarouselItemsProps { + children: React.ReactNode, +} +declare const CardCarouselItems: React.FC; +export default CardCarouselItems; diff --git a/src/Card/CardCarousel/CardCarouselProvider.d.ts b/src/Card/CardCarousel/CardCarouselProvider.d.ts new file mode 100644 index 0000000000..394d34cdcd --- /dev/null +++ b/src/Card/CardCarousel/CardCarouselProvider.d.ts @@ -0,0 +1,19 @@ +import React from 'react'; + +export interface CardCarouselProviderProps { + columnSizes?: { + xs?: number, + sm?: number, + md?: number, + lg?: number, + xl?: number, + }, + hasInteractiveChildren?: boolean, + canScrollHorizontal?: boolean, + CardCarouselControls?: React.ElementType, + children: React.ReactNode, +} +declare const CardCarouselProvider: React.FC; +declare const CardCarouselContext: React.Context<{}>; +export { CardCarouselContext }; +export default CardCarouselProvider; diff --git a/src/Card/CardCarousel/CardCarouselSubtitle.d.ts b/src/Card/CardCarousel/CardCarouselSubtitle.d.ts new file mode 100644 index 0000000000..314f7ecf98 --- /dev/null +++ b/src/Card/CardCarousel/CardCarouselSubtitle.d.ts @@ -0,0 +1,9 @@ +import React from "react"; + +export interface CardCarouselSubtitleProps { + as?: React.ElementType | string + className?: string, + children: React.ReactNode, +} +declare const CardCarouselSubtitle: React.FC; +export default CardCarouselSubtitle; diff --git a/src/Card/CardCarousel/CardCarouselTitle.d.ts b/src/Card/CardCarousel/CardCarouselTitle.d.ts new file mode 100644 index 0000000000..c262a91379 --- /dev/null +++ b/src/Card/CardCarousel/CardCarouselTitle.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface CardCarouselTitleProps { + as?: React.ElementType | string + className?: string, + children: React.ReactNode, +} +declare const CardCarouselTitle: React.FC; +export default CardCarouselTitle; diff --git a/src/Card/CardCarousel/index.d.ts b/src/Card/CardCarousel/index.d.ts new file mode 100644 index 0000000000..96bb4f7b1b --- /dev/null +++ b/src/Card/CardCarousel/index.d.ts @@ -0,0 +1,3 @@ +import CardCarousel from "./CardCarousel"; + +export default CardCarousel; diff --git a/src/Card/CardContext.d.ts b/src/Card/CardContext.d.ts new file mode 100644 index 0000000000..7c102fb37e --- /dev/null +++ b/src/Card/CardContext.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; + +export interface CardContextProviderProps { + orientation?: 'horizontal' | 'vertical', + isLoading?: boolean, + variant?: 'light' | 'dark' | 'muted', + children?: React.ReactNode, +} +declare const CardContextProvider: React.FC; +declare const CardContext: React.Context<{}>; +export { CardContextProvider }; +export default CardContext; diff --git a/src/Card/CardDeck.d.ts b/src/Card/CardDeck.d.ts new file mode 100644 index 0000000000..b0e2e3c817 --- /dev/null +++ b/src/Card/CardDeck.d.ts @@ -0,0 +1,19 @@ +import React from 'react'; + +export declare const CARD_DECK_ITEM_CLASS_NAME = 'pgn__card-deck-card-item'; +export interface CardDeckProps { + columnSizes?: { + xs?: number, + sm?: number, + md?: number, + lg?: number, + xl?: number, + }, + hasInteractiveChildren?: boolean, + canScrollHorizontal?: boolean, + hasOverflowScrollItems?: boolean, + className?: string, + children: React.ReactNode, +} +declare const CardDeck: React.ForwardRefExoticComponent; +export default CardDeck; diff --git a/src/Card/CardDivider.d.ts b/src/Card/CardDivider.d.ts new file mode 100644 index 0000000000..1c6e7485de --- /dev/null +++ b/src/Card/CardDivider.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; + +export interface CardDividerProps { + className?: string, +} +declare const CardDivider: React.ForwardRefExoticComponent; +export default CardDivider; diff --git a/src/Card/CardFooter.d.ts b/src/Card/CardFooter.d.ts new file mode 100644 index 0000000000..55afc36f51 --- /dev/null +++ b/src/Card/CardFooter.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; + +export interface CardFooterProps { + isStacked?: boolean, + textElement?: React.ReactNode, + skeletonHeight?: number, + skeletonWidth?: number, + orientation?: 'horizontal' | 'vertical', + className?: string, + children?: React.ReactNode, +} +declare const CardFooter: React.ForwardRefExoticComponent; +export default CardFooter; diff --git a/src/Card/CardGrid.d.ts b/src/Card/CardGrid.d.ts new file mode 100644 index 0000000000..76e06b518a --- /dev/null +++ b/src/Card/CardGrid.d.ts @@ -0,0 +1,15 @@ +import React from 'react'; + +export interface CardGridProps { + className?: string, + children?: React.ReactNode, + columnSizes?: { + xs?: number, + sm?: number, + md?: number, + lg?: number, + xl?: number, + }, +} +declare const CardGrid: React.FC; +export default CardGrid; diff --git a/src/Card/CardHeader.d.ts b/src/Card/CardHeader.d.ts new file mode 100644 index 0000000000..58ecd6e54f --- /dev/null +++ b/src/Card/CardHeader.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; + +export interface CardHeaderProps { + actions?: React.ReactNode, + size?: 'sm' | 'md', + subtitle?: React.ReactNode, + title?: React.ReactNode, + skeletonHeight?: number, + skeletonWidth?: number, + className?: string, +} +declare const CardHeader: React.ForwardRefExoticComponent; +export default CardHeader; diff --git a/src/Card/CardImageCap.d.ts b/src/Card/CardImageCap.d.ts new file mode 100644 index 0000000000..f14c1f2592 --- /dev/null +++ b/src/Card/CardImageCap.d.ts @@ -0,0 +1,19 @@ +import React from 'react'; + +export interface CardImageCapProps { + src?: string, + fallbackSrc?: string, + srcAlt?: string, + logoSrc?: string, + fallbackLogoSrc?: string, + logoAlt?: string, + skeletonHeight?: number, + skeletonWidth?: number, + logoSkeleton?: boolean, + logoSkeletonHeight?: number, + logoSkeletonWidth?: number, + className?: string, + children?: React.ReactNode, +} +declare const CardImageCap: React.ForwardRefExoticComponent; +export default CardImageCap; diff --git a/src/Card/CardSection.d.ts b/src/Card/CardSection.d.ts new file mode 100644 index 0000000000..37b9ed1851 --- /dev/null +++ b/src/Card/CardSection.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; + +export interface CardSectionProps { + title?: React.ReactNode, + actions?: React.ReactNode, + muted?: boolean, + skeletonHeight?: number, + skeletonWidth?: number, + className?: string, + children?: React.ReactNode, +} +declare const CardSection: React.ForwardRefExoticComponent; +export default CardSection; diff --git a/src/Card/CardStatus.d.ts b/src/Card/CardStatus.d.ts new file mode 100644 index 0000000000..739ba77f9f --- /dev/null +++ b/src/Card/CardStatus.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; + +export interface CardStatusProps { + variant?: 'success' | 'primary' | 'warning' | 'danger', + icon?: React.ReactElement, + title?: React.ReactNode, + className?: string, + children?: React.ReactNode, +} +declare const CardStatus: React.ForwardRefExoticComponent; +export default CardStatus; diff --git a/src/Card/CardStatus.jsx b/src/Card/CardStatus.jsx index be355ebf5a..2309e96fe6 100644 --- a/src/Card/CardStatus.jsx +++ b/src/Card/CardStatus.jsx @@ -61,7 +61,7 @@ CardStatus.propTypes = { /** The class to append to the base element. */ className: PropTypes.string, /** Icon that will be shown in the top-left corner. */ - icon: PropTypes.func, + icon: PropTypes.oneOfType([PropTypes.element, PropTypes.func]), /** Specifies variant to use. */ variant: PropTypes.oneOf([ 'primary', @@ -70,7 +70,7 @@ CardStatus.propTypes = { 'warning', ]), /** Specifies title for the `Card.Status`. */ - title: PropTypes.oneOfType([PropTypes.element, PropTypes.string]), + title: PropTypes.node, /** Specifies any optional actions, e.g. button(s). */ actions: PropTypes.node, }; diff --git a/src/Card/index.d.ts b/src/Card/index.d.ts new file mode 100644 index 0000000000..4a934c3331 --- /dev/null +++ b/src/Card/index.d.ts @@ -0,0 +1,46 @@ +import React from 'react'; +import Card, { CardProps } from "react-bootstrap/Card"; +import { BsPrefixRefForwardingComponent } from "react-bootstrap/helpers"; +import CardDivider from "./CardDivider"; +import CardContext from "./CardContext"; +import CardBody from "./CardBody"; +import CardHeader from "./CardHeader"; +import CardFooter from "./CardFooter"; +import CardSection from "./CardSection"; +import CardStatus from "./CardStatus"; +import CardImageCap from "./CardImageCap"; + +export interface BaseCardProps extends CardProps { + orientation?: 'horizontal' | 'vertical', + isLoading?: boolean, + isClickable?: boolean, + muted?: boolean, + variant?: 'light' | 'dark' | 'muted', + className?: string, + children?: React.ReactNode, +} +declare type Card = BsPrefixRefForwardingComponent<'div', BaseCardProps> & { + Img: typeof Card.Img; + Title: typeof Card.Title; + Subtitle: typeof Card.Subtitle; + Body: typeof CardBody; + Link: typeof Card.Link; + Text: typeof Card.Text; + Header: typeof CardHeader; + Footer: typeof CardFooter; + ImgOverlay: typeof Card.ImgOverlay; + Context: typeof CardContext; + Divider: typeof CardDivider; + Section: typeof CardSection; + Status: typeof CardStatus; + ImageCap: typeof CardImageCap; +}; + +declare const Card: Card; +export default Card; +export { default as CardColumns } from 'react-bootstrap/CardColumns'; +export { default as CardDeck } from './CardDeck'; +export { default as CardCarousel } from './CardCarousel/CardCarousel'; +export { default as CardImg } from 'react-bootstrap/CardImg'; +export { default as CardGroup } from 'react-bootstrap/CardGroup'; +export { default as CardGrid } from './CardGrid'; diff --git a/src/Carousel/index.d.ts b/src/Carousel/index.d.ts new file mode 100644 index 0000000000..22952d0f36 --- /dev/null +++ b/src/Carousel/index.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; +import { CarouselProps } from 'react-bootstrap/Carousel'; +import { CarouselItemProps } from 'react-bootstrap/CarouselItem'; +import { BsPrefixProps } from 'react-bootstrap/helpers'; + +declare const Carousel: React.ForwardRefExoticComponent & { + Item: React.ForwardRefExoticComponent; + Caption: React.FC; +}; + +export default Carousel; diff --git a/src/ChipCarousel/index.tsx b/src/ChipCarousel/index.tsx index 9b8d458ce5..14e898f266 100644 --- a/src/ChipCarousel/index.tsx +++ b/src/ChipCarousel/index.tsx @@ -2,11 +2,8 @@ import React, { ForwardedRef } from 'react'; import PropTypes from 'prop-types'; import { useIntl } from 'react-intl'; import classNames from 'classnames'; -// @ts-ignore import { OverflowScroll, OverflowScrollContext } from '../OverflowScroll'; -// @ts-ignore import IconButton from '../IconButton'; -// @ts-ignore import Icon from '../Icon'; // @ts-ignore import { ArrowForward, ArrowBack } from '../../icons'; diff --git a/src/Collapsible/CollapsibleAdvanced.d.ts b/src/Collapsible/CollapsibleAdvanced.d.ts new file mode 100644 index 0000000000..8177e0ce50 --- /dev/null +++ b/src/Collapsible/CollapsibleAdvanced.d.ts @@ -0,0 +1,16 @@ +import React from 'react'; + +export interface CollapsibleAdvancedProps { + children?: React.ReactNode; + className?: string; + defaultOpen?: boolean; + open?: boolean; + onToggle?: () => void; + onOpen?: () => void; + onClose?: () => void; + unmountOnExit?: boolean; +} + +declare class CollapsibleAdvanced extends React.Component {} + +export default CollapsibleAdvanced; diff --git a/src/Collapsible/CollapsibleBody.d.ts b/src/Collapsible/CollapsibleBody.d.ts new file mode 100644 index 0000000000..18803e359a --- /dev/null +++ b/src/Collapsible/CollapsibleBody.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; + +export interface CollapsibleBodyProps { + children?: React.ReactNode; + tag?: string, + transitionWrapper?: React.ReactElement, +} + +declare const CollapsibleBody: React.FC; + +export default CollapsibleBody; diff --git a/src/Collapsible/CollapsibleTrigger.d.ts b/src/Collapsible/CollapsibleTrigger.d.ts new file mode 100644 index 0000000000..65b4dad81b --- /dev/null +++ b/src/Collapsible/CollapsibleTrigger.d.ts @@ -0,0 +1,14 @@ +import React from 'react'; + +export interface CollapsibleTriggerProps { + children?: React.ReactNode; + tag?: keyof JSX.IntrinsicElements | string; + openOnly?: boolean; + closeOnly?: boolean; + onClick?: (e: React.MouseEvent) => void; + onKeyDown?: (e: React.KeyboardEvent) => void; +} + +declare const CollapsibleTrigger: React.FC; + +export default CollapsibleTrigger; diff --git a/src/Collapsible/CollapsibleVisible.d.ts b/src/Collapsible/CollapsibleVisible.d.ts new file mode 100644 index 0000000000..269ce636e6 --- /dev/null +++ b/src/Collapsible/CollapsibleVisible.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; + +export interface CollapsibleVisibleProps { + children?: React.ReactNode; + whenOpen?: boolean; + whenClosed?: boolean; +} + +declare const CollapsibleVisible: React.FC; + +export default CollapsibleVisible; diff --git a/src/Collapsible/index.d.ts b/src/Collapsible/index.d.ts new file mode 100644 index 0000000000..9d0aef8a13 --- /dev/null +++ b/src/Collapsible/index.d.ts @@ -0,0 +1,30 @@ +import React from 'react'; +import { CollapsibleAdvancedProps } from './CollapsibleAdvanced'; +import { CollapsibleBodyProps } from './CollapsibleBody'; +import { CollapsibleTriggerProps } from './CollapsibleTrigger'; +import { CollapsibleVisibleProps } from './CollapsibleVisible'; + +export interface CollapsibleProps { + children: React.ReactNode; + className?: string; + defaultOpen?: boolean; + iconWhenClosed?: React.ReactElement; + iconWhenOpen?: React.ReactElement; + onClose?: () => void; + onOpen?: () => void; + onToggle?: () => void; + open?: boolean; + styling?: 'basic' | 'card' | 'card-lg'; + title: React.ReactNode; + unmountOnExit?: boolean; +} + +declare const Collapsible: React.ForwardRefExoticComponent & { + Advanced: React.FC; + Body: React.FC; + Trigger: React.FC; + Visible: React.FC; + Context: React.FC; +}; + +export default Collapsible; diff --git a/src/Container/index.d.ts b/src/Container/index.d.ts new file mode 100644 index 0000000000..102aab2384 --- /dev/null +++ b/src/Container/index.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; +import { ContainerProps as BaseContainerProps } from 'react-bootstrap/Container'; +import { BsPrefixProps } from 'react-bootstrap/helpers'; + +export interface ContainerProps extends BsPrefixProps, BaseContainerProps { + children?: React.ReactNode; + size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'; +} + +declare const Container: React.FC; + +export default Container; diff --git a/src/DataTable/BulkActions.d.ts b/src/DataTable/BulkActions.d.ts new file mode 100644 index 0000000000..7ea3853903 --- /dev/null +++ b/src/DataTable/BulkActions.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface BulkActionsProps { + className?: string; +} + +declare const BulkActions: React.FC; + +export default BulkActions; diff --git a/src/DataTable/CardView.d.ts b/src/DataTable/CardView.d.ts new file mode 100644 index 0000000000..f3f7bb5424 --- /dev/null +++ b/src/DataTable/CardView.d.ts @@ -0,0 +1,21 @@ +import React from 'react'; + +export interface CardViewProps { + className?: string; + columnSizes?: { + xs?: number; + sm?: number; + md?: number; + lg?: number; + xl?: number; + }; + CardComponent: React.FC; + selectionPlacement?: 'left' | 'right'; + SkeletonCardComponent?: React.FC; + skeletonCardCount?: number; +} + +declare function CardView(props: CardViewProps): JSX.Element; + +export default CardView; + diff --git a/src/DataTable/CollapsibleButtonGroup.d.ts b/src/DataTable/CollapsibleButtonGroup.d.ts new file mode 100644 index 0000000000..c0bbdc5e41 --- /dev/null +++ b/src/DataTable/CollapsibleButtonGroup.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; + +export interface CollapsibleButtonGroupProps { + className?: string; + actions: { + component: React.ReactNode; + args?: Record; + }; +} + +declare const CollapsibleButtonGroup: React.FC; + +export default CollapsibleButtonGroup; diff --git a/src/DataTable/DataTableLayout.d.ts b/src/DataTable/DataTableLayout.d.ts new file mode 100644 index 0000000000..dbb4aa70f9 --- /dev/null +++ b/src/DataTable/DataTableLayout.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; + +export interface DataTableLayoutProps { + className?: string; + children: React.ReactNode; + filtersTitle?: string | React.ReactElement; +} + +declare const DataTableLayout: React.FC; + +export default DataTableLayout; diff --git a/src/DataTable/DropdownFilters.d.ts b/src/DataTable/DropdownFilters.d.ts new file mode 100644 index 0000000000..daf14cb43b --- /dev/null +++ b/src/DataTable/DropdownFilters.d.ts @@ -0,0 +1,3 @@ +declare function DropdownFilters(): JSX.Element; + +export default DropdownFilters; diff --git a/src/DataTable/EmptyTable.d.ts b/src/DataTable/EmptyTable.d.ts new file mode 100644 index 0000000000..1d33831120 --- /dev/null +++ b/src/DataTable/EmptyTable.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; + +export interface EmptyTableProps { + className?: string; + content: string; +} + +declare const EmptyTable: React.FC; + +export default EmptyTable; diff --git a/src/DataTable/ExplandAll.d.ts b/src/DataTable/ExplandAll.d.ts new file mode 100644 index 0000000000..39cdc9956f --- /dev/null +++ b/src/DataTable/ExplandAll.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; + +export interface ExpandAllProps { + getToggleAllRowsExpandedProps: () => { + onClick: React.MouseEventHandler; + }; + isAllRowsExpanded: boolean; +} + +declare const ExpandAll: React.FC; + +export default ExpandAll; diff --git a/src/DataTable/ExplandRow.d.ts b/src/DataTable/ExplandRow.d.ts new file mode 100644 index 0000000000..46c049a774 --- /dev/null +++ b/src/DataTable/ExplandRow.d.ts @@ -0,0 +1,10 @@ +export interface ExpandRowProps { + row: { + isExpanded: boolean; + getToggleRowExpandedProps: () => any; + }; +} + +declare function ExpandRow(props: ExpandRowProps): JSX.Element; + +export default ExpandRow; diff --git a/src/DataTable/FilterStatus.d.ts b/src/DataTable/FilterStatus.d.ts new file mode 100644 index 0000000000..46503e22fe --- /dev/null +++ b/src/DataTable/FilterStatus.d.ts @@ -0,0 +1,14 @@ +import React from 'react'; + +export interface FilterStatusProps { + className?: string; + buttonClassName?: string; + variant?: string; + size?: string; + clearFiltersText?: string | React.ReactElement; + showFilteredFields?: boolean; +} + +declare function FilterStatus(props: FilterStatusProps): JSX.Element; + +export default FilterStatus; diff --git a/src/DataTable/RowStatus.d.ts b/src/DataTable/RowStatus.d.ts new file mode 100644 index 0000000000..ee00aa4d67 --- /dev/null +++ b/src/DataTable/RowStatus.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; + +export interface RowStatusProps { + className?: string; + statusText: string | React.ReactElement; +} + +declare function RowStatus(props: RowStatusProps): JSX.Element; + +export default RowStatus; diff --git a/src/DataTable/SidebarFilter.d.ts b/src/DataTable/SidebarFilter.d.ts new file mode 100644 index 0000000000..c9f7288413 --- /dev/null +++ b/src/DataTable/SidebarFilter.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; + +export interface SidebarFiltersProps { + title?: string | React.ReactElement; +} + +declare function SidebarFilters(props: SidebarFiltersProps): JSX.Element; + +export default SidebarFilters; + diff --git a/src/DataTable/SmartStatus.d.ts b/src/DataTable/SmartStatus.d.ts new file mode 100644 index 0000000000..92117647f2 --- /dev/null +++ b/src/DataTable/SmartStatus.d.ts @@ -0,0 +1,3 @@ +declare function SmartStatus(): JSX.Element; + +export default SmartStatus; diff --git a/src/DataTable/Table.d.ts b/src/DataTable/Table.d.ts new file mode 100644 index 0000000000..ffc1c5fc1d --- /dev/null +++ b/src/DataTable/Table.d.ts @@ -0,0 +1,7 @@ +export interface TableProps { + isStriped?: boolean; +} + +declare function Table(props: TableProps): JSX.Element; + +export default Table; diff --git a/src/DataTable/TableActions.d.ts b/src/DataTable/TableActions.d.ts new file mode 100644 index 0000000000..79e81fd796 --- /dev/null +++ b/src/DataTable/TableActions.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface TableActionsProps { + className?: string +} + +declare const TableActions: React.FC; + +export default TableActions; diff --git a/src/DataTable/TableCell.d.ts b/src/DataTable/TableCell.d.ts new file mode 100644 index 0000000000..3e1dfc7e47 --- /dev/null +++ b/src/DataTable/TableCell.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; + +export interface TableCellProps { + getCellProps: () => any; + render: (type: string) => React.ReactNode; + column: { + cellClassName?: string; + }; +} + +declare function TableCell(props: TableCellProps): JSX.Element; + +export default TableCell; diff --git a/src/DataTable/TableControlBar.d.ts b/src/DataTable/TableControlBar.d.ts new file mode 100644 index 0000000000..be13a8252d --- /dev/null +++ b/src/DataTable/TableControlBar.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface TableControlBarProps { + className?: string; +} + +declare const TableControlBar: React.FC; + +export default TableControlBar; diff --git a/src/DataTable/TableFilters.d.ts b/src/DataTable/TableFilters.d.ts new file mode 100644 index 0000000000..4af7ee8181 --- /dev/null +++ b/src/DataTable/TableFilters.d.ts @@ -0,0 +1,15 @@ +import React from 'react'; + +interface TableColumn { + Header: string | React.ReactNode; + canFilter?: boolean; + render: (arg0: string) => React.ReactNode; +} + +export interface TableFiltersProps { + columns: Array; +} + +declare function TableFilters(props: TableFiltersProps): JSX.Element; + +export default TableFilters; diff --git a/src/DataTable/TableFooter.d.ts b/src/DataTable/TableFooter.d.ts new file mode 100644 index 0000000000..a2b475b25b --- /dev/null +++ b/src/DataTable/TableFooter.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; + +export interface TableFooterProps { + children?: React.ReactNode | React.ReactNodeArray; + className?: string; +} + +declare function TableFooter(props: TableFooterProps): JSX.Element; + +export default TableFooter; diff --git a/src/DataTable/TableHeaderCell.d.ts b/src/DataTable/TableHeaderCell.d.ts new file mode 100644 index 0000000000..319ff32ece --- /dev/null +++ b/src/DataTable/TableHeaderCell.d.ts @@ -0,0 +1,13 @@ +export interface TableHeaderCellProps { + getHeaderProps: () => void; + isSorted?: boolean; + render: (arg0: string) => void; + isSortedDesc?: boolean; + getSortByToggleProps?: () => void; + canSort?: boolean; + headerClassName: string; +} + +declare function TableHeaderCell(props: TableHeaderCellProps): JSX.Element; + +export default TableHeaderCell; diff --git a/src/DataTable/TableHeaderRow.d.ts b/src/DataTable/TableHeaderRow.d.ts new file mode 100644 index 0000000000..b356b3cf62 --- /dev/null +++ b/src/DataTable/TableHeaderRow.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import { TableHeaderCellProps } from './TableHeaderCell'; + +export interface TableHeaderRowProps { + headerGroups: { + headers: TableHeaderCellProps[]; + getHeaderGroupProps: () => React.HTMLAttributes; + } +} + +declare function TableHeaderRow(props: TableHeaderRowProps): JSX.Element; + +export default TableHeaderRow; diff --git a/src/DataTable/TablePagination.d.ts b/src/DataTable/TablePagination.d.ts new file mode 100644 index 0000000000..3ee1f9d438 --- /dev/null +++ b/src/DataTable/TablePagination.d.ts @@ -0,0 +1,3 @@ +declare function TablePagination(): JSX.Element; + +export default TablePagination; diff --git a/src/DataTable/TablePaginationMinimal.d.ts b/src/DataTable/TablePaginationMinimal.d.ts new file mode 100644 index 0000000000..dab8943796 --- /dev/null +++ b/src/DataTable/TablePaginationMinimal.d.ts @@ -0,0 +1,3 @@ +declare function TablePaginationMinimal(): JSX.Element; + +export default TablePaginationMinimal; diff --git a/src/DataTable/TableRow.d.ts b/src/DataTable/TableRow.d.ts new file mode 100644 index 0000000000..6c922c42c1 --- /dev/null +++ b/src/DataTable/TableRow.d.ts @@ -0,0 +1,13 @@ +export interface TableRowProps { + row: { + getRowProps: (props?: any) => any; + cells: object[]; + id: string; + isSelected?: boolean; + isExpanded?: boolean; + }; +} + +declare function TableRow(props: TableRowProps): JSX.Element; + +export default TableRow; diff --git a/src/DataTable/filters/CheckboxFilters.d.ts b/src/DataTable/filters/CheckboxFilters.d.ts new file mode 100644 index 0000000000..69ca03e234 --- /dev/null +++ b/src/DataTable/filters/CheckboxFilters.d.ts @@ -0,0 +1,15 @@ +import React from 'react'; + +export interface CheckboxFiltersProps { + column: { + setFilter: (value: string | undefined) => void; + Header: React.ReactNode; + filterChoices: { name: string; value?: string | number; number?: number }[]; + getHeaderProps: () => { key: string }; + filterValue?: string[]; + } +} + +declare const CheckboxFilter: React.FC; + +export default CheckboxFilter; diff --git a/src/DataTable/filters/DropdownFilter.d.ts b/src/DataTable/filters/DropdownFilter.d.ts new file mode 100644 index 0000000000..966eb5d819 --- /dev/null +++ b/src/DataTable/filters/DropdownFilter.d.ts @@ -0,0 +1,20 @@ +import React from 'react'; + +export type FilterChoice = { + name: string; + number?: number; + value: string | number; +}; + +export interface DropdownFilterProps { + column: { + setFilter: (value: string | undefined) => void; + Header: React.ReactNode; + filterChoices: FilterChoice[]; + getHeaderProps: () => { key: string }; + } +} + +declare const DropdownFilter: React.FC; + +export default DropdownFilter; diff --git a/src/DataTable/filters/LabelledCheckbox.d.ts b/src/DataTable/filters/LabelledCheckbox.d.ts new file mode 100644 index 0000000000..b7553a8952 --- /dev/null +++ b/src/DataTable/filters/LabelledCheckbox.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; + +export interface LabelledCheckboxProps { + checked: boolean; + onChange: React.ChangeEventHandler; + label: React.ReactNode | ((props: LabelledCheckboxProps) => React.ReactNode); + id: string; +} + +declare const LabelledCheckbox: React.FC; + +export default LabelledCheckbox; diff --git a/src/DataTable/filters/MultiSelectDropdownFilter.d.ts b/src/DataTable/filters/MultiSelectDropdownFilter.d.ts new file mode 100644 index 0000000000..79280971b8 --- /dev/null +++ b/src/DataTable/filters/MultiSelectDropdownFilter.d.ts @@ -0,0 +1,21 @@ +import React from 'react'; + +export interface Choice { + name: string; + number?: number; + value: string | number; +} + +export interface MultiSelectDropdownFilterProps { + column: { + setFilter: (value: string[]) => void; + Header: React.ReactNode | ((props: Record) => JSX.Element); + filterChoices: Choice[]; + getHeaderProps: () => { key: string }; + filterValue?: string[]; + } +} + +declare const MultiSelectDropdownFilter: React.FC; + +export default MultiSelectDropdownFilter; diff --git a/src/DataTable/filters/TextFilter.d.ts b/src/DataTable/filters/TextFilter.d.ts new file mode 100644 index 0000000000..d0f3369c9d --- /dev/null +++ b/src/DataTable/filters/TextFilter.d.ts @@ -0,0 +1,14 @@ +import React from 'react'; + +export interface TextFilterProps { + column: { + filterValue?: string; + setFilter: (value?: string) => void; + Header: React.ReactNode | ((props?: any) => React.ReactNode); + getHeaderProps: (props?: any) => { key: string }; + } +} + +declare const TextFilter: React.FC; + +export default TextFilter; diff --git a/src/DataTable/index.d.ts b/src/DataTable/index.d.ts new file mode 100644 index 0000000000..4d3b0e2200 --- /dev/null +++ b/src/DataTable/index.d.ts @@ -0,0 +1,137 @@ +import React from 'react'; +import { BulkActionsProps } from './BulkActions'; +import { EmptyTableProps } from './EmptyTable'; +import { FilterStatusProps } from './FilterStatus'; +import DropdownFilters from './DropdownFilters'; +import { RowStatusProps } from './RowStatus'; +import { ControlledSelectionStatusProps } from './selection/SelectionStatus'; +import SmartStatus from './SmartStatus'; +import { TableProps } from './Table'; +import { TableCellProps } from './TableCell'; +import { TableControlBarProps } from './TableControlBar'; +import { TableFiltersProps } from './TableFilters'; +import { TableFooterProps } from './TableFooter'; +import { TableHeaderCellProps } from './TableHeaderCell'; +import { TableHeaderRowProps } from './TableHeaderRow'; +import TablePagination from './TablePagination'; +import TablePaginationMinimal from './TablePaginationMinimal'; +import { TableActionsProps } from './TableActions'; +import { ControlledSelectProps } from './selection/ControlledSelect'; +import { ControlledSelectHeaderProps } from './selection/ControlledSelectHeader'; +import { ExpandAllProps } from './ExplandAll'; +import { ExpandRowProps } from './ExplandRow'; + +export interface BulkAction { + buttonText: string; + handleClick: () => void; + className?: string; + variant?: string; + disabled?: boolean; +} + +export type BulkActionProp = BulkAction | (() => BulkAction) | React.ReactElement; + +export interface TableAction { + buttonText: string; + handleClick: () => void; + className?: string; + variant?: string; + disabled?: boolean; +} + +export type TableActionType = TableAction | (() => TableAction) | React.ReactElement; + +export interface DataTableProps { + columns: { + Header: string; + accessor?: string; + Cell?: (cell: any) => React.ReactNode; + Filter?: Function; + filter?: string; + filterChoices?: { + name: string; + number: number; + value: string + }[]; + }[]; + data: object; + defaultColumnValues?: { + Filter: () => React.ReactNode; + }; + additionalColumns?: { + id: string; + Header?: string; + Cell?: (cell: any) => React.ReactNode; + }[]; + isSelectable?: boolean; + isPaginated?: boolean; + manualPagination?: boolean; + pageCount?: number; + itemCount?: number; + isFilterable?: boolean; + manualFilters?: boolean; + fetchData?: (data: object) => void; + initialState?: { + pageSize?: number; + pageIndex?: number; + filters?: { [key: string]: any }[]; + sortBy?: { [key: string]: any }[]; + selectedRowIds?: { [key: string]: any }; + }; + isSortable?: boolean; + manualSortBy?: boolean; + isExpandable?: boolean; + renderRowSubComponent?: (row: number, index: number) => React.ReactNode; + bulkActions?: BulkActionProp[]; + tableActions?: TableActionType[]; + numBreakoutFilters?: 1 | 2 | 3 | 4; + initialTableOptions?: object; + EmptyTableComponent?: Function; + RowStatusComponent?: Function; + SelectionStatusComponent?: Function; + FilterStatusComponent?: Function; + manualSelectColumn?: { + id: string; + Header: () => React.ReactNode; + Cell: (cell: any) => React.ReactNode, + disableSortBy: boolean; + }; + showFiltersInSidebar?: boolean; + dataViewToggleOptions?: { + isDataViewToggleEnabled?: boolean; + onDataViewToggle?: Function; + defaultActiveStateValue?: string; + togglePlacement?: string; + }; + disableElevation?: boolean; + isLoading?: boolean; + children?: React.ReactNode; + onSelectedRowsChanged?: (selectedRowIds: Record) => void; +} + +declare const DataTable: React.FC & { + BulkActions: React.FC; + EmptyTable: React.FC; + DropdownFilters: typeof DropdownFilters; + FilterStatus: React.FC; + RowStatus: React.FC; + SelectionStatus: React.FC; + SmartStatus: typeof SmartStatus; + Table: React.FC; + TableCell: React.FC; + TableControlBar: React.FC; + TableFilters: React.FC; + TableFooter: React.FC; + TableHeaderCell: React.FC; + TableHeaderRow: React.FC; + TablePagination: typeof TablePagination; + TablePaginationMinimal: typeof TablePaginationMinimal; + TableActions: React.FC; + ControlledSelectionStatus: React.FC; + ControlledSelect: React.FC; + ControlledSelectHeader: React.FC; + ExpandAll: React.FC; + ExpandRow: React.FC; +}; + +export default DataTable; diff --git a/src/DataTable/selection/BaseSelectionStatus.d.ts b/src/DataTable/selection/BaseSelectionStatus.d.ts new file mode 100644 index 0000000000..70bbeba854 --- /dev/null +++ b/src/DataTable/selection/BaseSelectionStatus.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; + +export interface SelectionStatusProps { + className?: string; + clearSelectionText: string | React.ReactElement; +} + +declare const SelectionStatus: React.FC; + +export default SelectionStatus; diff --git a/src/DataTable/selection/ControlledSelect.d.ts b/src/DataTable/selection/ControlledSelect.d.ts new file mode 100644 index 0000000000..2900504be0 --- /dev/null +++ b/src/DataTable/selection/ControlledSelect.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; + +export interface ControlledSelectProps { + row: { + id: string | number; + getToggleRowSelectedProps: () => any; + isSelected: boolean; + }; +} + +declare const ControlledSelect: React.FC; + +export default ControlledSelect; diff --git a/src/DataTable/selection/ControlledSelectHeader.d.ts b/src/DataTable/selection/ControlledSelectHeader.d.ts new file mode 100644 index 0000000000..6b4ef84cdb --- /dev/null +++ b/src/DataTable/selection/ControlledSelectHeader.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; + +export interface ControlledSelectHeaderProps { + rows: { + id: string | number; + }; +} + +declare const ControlledSelectHeader: React.FC; + +export default ControlledSelectHeader; diff --git a/src/DataTable/selection/ControlledSelectionStatus.d.ts b/src/DataTable/selection/ControlledSelectionStatus.d.ts new file mode 100644 index 0000000000..440dfec8a5 --- /dev/null +++ b/src/DataTable/selection/ControlledSelectionStatus.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; + +export interface ControlledSelectionStatusProps { + className?: string; + clearSelectionText?: string | JSX.Element; +} + +declare const ControlledSelectionStatus: React.FC; + +export default ControlledSelectionStatus; diff --git a/src/DataTable/selection/SelectionStatus.d.ts b/src/DataTable/selection/SelectionStatus.d.ts new file mode 100644 index 0000000000..c4e1f56667 --- /dev/null +++ b/src/DataTable/selection/SelectionStatus.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import { ControlledSelectionStatusProps } from './ControlledSelectionStatus'; + +export interface SelectionStatusProps extends ControlledSelectionStatusProps {} + +declare const SelectionStatus: React.FC; + +export default SelectionStatus; diff --git a/src/Dropdown/index.d.ts b/src/Dropdown/index.d.ts new file mode 100644 index 0000000000..aa1decb12d --- /dev/null +++ b/src/Dropdown/index.d.ts @@ -0,0 +1,35 @@ +import React from 'react'; +import { BsPrefixProps } from 'react-bootstrap/helpers'; +import BaseDropdown, { DropdownProps as BaseDropdownProps } from 'react-bootstrap/Dropdown'; +import { DropdownToggleProps as BaseDropdownToggleProps } from 'react-bootstrap/DropdownToggle'; +import { DropdownMenuProps } from 'react-bootstrap/DropdownMenu'; + +interface DropdownProps extends BaseDropdownProps { + autoClose?: boolean | 'inside' | 'outside'; + className?: string; + variant?: 'light' | 'dark'; +} + +interface DropdownToggleProps extends BsPrefixProps, BaseDropdownToggleProps { + id: string | number; +} + +interface DropdownItemProps extends React.HTMLAttributes, React.LinkHTMLAttributes{} + +declare const DropdownToggle: React.ForwardRefExoticComponent; + +declare const DropdownItem: React.ForwardRefExoticComponent; + +declare const Dropdown: React.ForwardRefExoticComponent & { + Toggle: React.FC; + Item: React.FC + Menu: React.FC; + Header: typeof BaseDropdown.Header; + Divider: typeof BaseDropdown.Divider; +}; + +export default Dropdown; +export { DropdownToggle, DropdownItem }; + +export { default as DropdownButton } from 'react-bootstrap/DropdownButton'; +export { default as SplitButton } from 'react-bootstrap/SplitButton'; diff --git a/src/Dropzone/DefaultContent.d.ts b/src/Dropzone/DefaultContent.d.ts new file mode 100644 index 0000000000..f1cf9f86d6 --- /dev/null +++ b/src/Dropzone/DefaultContent.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; + +export interface DefaultContentProps { + accept?: { [key: string]: string[] }; + maxSize?: number; + minSize?: number; +} + +declare const DefaultContent: React.FC; + +export default DefaultContent; diff --git a/src/Dropzone/DragError.d.ts b/src/Dropzone/DragError.d.ts new file mode 100644 index 0000000000..c79bc2d5ef --- /dev/null +++ b/src/Dropzone/DragError.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface DragErrorProps { + message: string | keyof JSX.IntrinsicElements; +} + +declare const DragError: React.FC; + +export default DragError; diff --git a/src/Dropzone/GenericError.d.ts b/src/Dropzone/GenericError.d.ts new file mode 100644 index 0000000000..7dd77a4c07 --- /dev/null +++ b/src/Dropzone/GenericError.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface GenericErrorProps { + errorMsgs: { [key: string]: string[] }; +} + +declare const GenericError: React.FC; + +export default GenericError; diff --git a/src/Dropzone/UploadProgress.d.ts b/src/Dropzone/UploadProgress.d.ts new file mode 100644 index 0000000000..890193bca1 --- /dev/null +++ b/src/Dropzone/UploadProgress.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; + +export interface UploadProgressProps { + variant: 'spinner' | 'bar'; + percent: number; + name: string; + onCancel: () => void; +} + +declare const UploadProgress: React.FC; + +export default UploadProgress; diff --git a/src/Dropzone/index.d.ts b/src/Dropzone/index.d.ts new file mode 100644 index 0000000000..8d13629b8c --- /dev/null +++ b/src/Dropzone/index.d.ts @@ -0,0 +1,29 @@ +import React from 'react'; + +export interface DropzoneProps { + className?: string; + accept?: { [key: string]: string[] }; + maxSize?: number; + minSize?: number; + onUploadProgress?: (percentageUploaded: number, progressEvent: AbortSignal) => void; + onUploadCancel?: () => void; + onProcessUpload: (params: { + fileData: object; + requestConfig: object; + handleError: (error: Error) => void; + }) => void; + errorMessages?: { + invalidType?: string | JSX.Element; + invalidSizeLess?: string | JSX.Element; + invalidSizeMore?: string | JSX.Element; + multipleDragged?: string | JSX.Element; + uploadError?: string | JSX.Element; + }; + progressVariant?: 'spinner' | 'bar'; + validator?: (file: File) => boolean; + inputComponent?: React.ReactNode | React.FunctionComponent; +} + +declare const Dropzone: React.FC; + +export default Dropzone; diff --git a/src/Form/FormAutosuggest.d.ts b/src/Form/FormAutosuggest.d.ts new file mode 100644 index 0000000000..8883880a1e --- /dev/null +++ b/src/Form/FormAutosuggest.d.ts @@ -0,0 +1,24 @@ +import React from 'react'; + +export interface FormAutosuggestProps { + arrowKeyNavigationSelector?: string; + ignoredArrowKeysNames?: string[]; + isLoading?: boolean; + role?: string; + className?: string; + floatingLabel?: string; + onChange?: (value: string) => void; + helpMessage?: string; + placeholder?: string; + value?: string; + errorMessageText?: string; + name?: string; + readOnly?: boolean; + children?: React.ReactNode; + screenReaderText?: string; + onSelected?: (selectedValue: string) => void; +} + +declare const FormAutosuggest: React.FC; + +export default FormAutosuggest; diff --git a/src/Form/FormAutosuggestOption.d.ts b/src/Form/FormAutosuggestOption.d.ts new file mode 100644 index 0000000000..021059787e --- /dev/null +++ b/src/Form/FormAutosuggestOption.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; + +export interface FormAutosuggestOptionProps { + className?: string; + children?: string; + onClick?: (event: React.MouseEvent) => void; +} + +declare const FormAutosuggestOption: React.FC; + +export default FormAutosuggestOption; diff --git a/src/Form/FormCheckbox.d.ts b/src/Form/FormCheckbox.d.ts new file mode 100644 index 0000000000..d2f2621baa --- /dev/null +++ b/src/Form/FormCheckbox.d.ts @@ -0,0 +1,26 @@ +import React from 'react'; + +export interface FormCheckboxProps extends React.InputHTMLAttributes { + children: React.ReactNode; + className?: string; + controlClassName?: string; + labelClassName?: string; + description?: React.ReactNode; + isInvalid?: boolean; + isValid?: boolean; + controlAs?: keyof JSX.IntrinsicElements; + floatLabelLeft?: boolean; +} + +export interface CheckboxControlProps { + isIndeterminate?: boolean; + className?: string; +} + +declare const FormCheckbox: React.FC; + +declare const CheckboxControl: React.FC; + +export { CheckboxControl }; + +export default FormCheckbox; diff --git a/src/Form/FormCheckboxSet.d.ts b/src/Form/FormCheckboxSet.d.ts new file mode 100644 index 0000000000..9d81bf057f --- /dev/null +++ b/src/Form/FormCheckboxSet.d.ts @@ -0,0 +1,17 @@ +import React from 'react'; + +export interface FormCheckboxSetProps { + children: React.ReactNode; + className?: string; + name: string; + value?: string[], + defaultValue?: string[]; + isInline?: boolean; + onChange?: React.ChangeEventHandler; + onFocus?: React.FocusEventHandler; + onBlur?: React.FocusEventHandler; +} + +declare const FormCheckboxSet: React.FC; + +export default FormCheckboxSet; diff --git a/src/Form/FormCheckboxSetContext.d.ts b/src/Form/FormCheckboxSetContext.d.ts new file mode 100644 index 0000000000..b5f6fc397d --- /dev/null +++ b/src/Form/FormCheckboxSetContext.d.ts @@ -0,0 +1,35 @@ +import React from 'react'; + +export type CheckboxProps = { + value: string; + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + onChange?: React.ChangeEventHandler; +}; + +export type FormCheckboxSetContextValue = { + name?: string; + value?: string[]; + defaultValue?: string[]; + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + onChange?: React.ChangeEventHandler; + getCheckboxControlProps: (checkboxProps: CheckboxProps) => CheckboxProps; + hasCheckboxSetProvider: boolean; +}; + +export declare const FormCheckboxSetContext: React.Context; + +export declare const useCheckboxSetContext: () => FormCheckboxSetContextValue; + +export type FormCheckboxSetContextProviderProps = { + children: React.ReactNode; + name?: string; + onBlur?: React.FocusEventHandler; + onFocus?: React.FocusEventHandler; + onChange?: React.ChangeEventHandler; + value?: string[]; + defaultValue?: string[]; +}; + +export declare const FormCheckboxSetContextProvider: React.FC; diff --git a/src/Form/FormControl.d.ts b/src/Form/FormControl.d.ts new file mode 100644 index 0000000000..6b40dcad05 --- /dev/null +++ b/src/Form/FormControl.d.ts @@ -0,0 +1,22 @@ +import React from 'react'; +import { FormControlProps as BaseFormControlProps } from 'react-bootstrap/FormControl'; +import { FormControlFeedbackProps } from './FormControlFeedback'; +import { BsPrefixProps } from 'react-bootstrap/helpers'; + +export interface FormControlProps extends BsPrefixProps, BaseFormControlProps { + className?: string; + defaultValue?: string | number, + controlClassName?: string; + leadingElement?: React.ReactNode; + trailingElement?: React.ReactNode; + floatingLabel?: React.ReactNode; + isInvalid?: boolean; + autoResize?: boolean; +} + +declare const FormControl: React.FC & { + Feedback: React.FC; + Description: React.FC; +}; + +export default FormControl; diff --git a/src/Form/FormControlDecorator.d.ts b/src/Form/FormControlDecorator.d.ts new file mode 100644 index 0000000000..99a85ed9a0 --- /dev/null +++ b/src/Form/FormControlDecorator.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; + +export interface FormControlDecoratorProps { + children: React.ReactNode; + location?: 'leading' | 'trailing'; +} + +declare const FormControlDecorator: React.FC; + +export default FormControlDecorator; diff --git a/src/Form/FormControlDecoratorGroup.d.ts b/src/Form/FormControlDecoratorGroup.d.ts new file mode 100644 index 0000000000..9f364a52c2 --- /dev/null +++ b/src/Form/FormControlDecoratorGroup.d.ts @@ -0,0 +1,15 @@ +import React from 'react'; +import { FORM_CONTROL_SIZES } from './constants'; + +export interface FormControlDecoratorGroupProps { + children: React.ReactNode; + leadingElement?: React.ReactNode; + trailingElement?: React.ReactNode; + floatingLabel?: React.ReactNode; + className?: string; + size?: FORM_CONTROL_SIZES.SMALL | FORM_CONTROL_SIZES.LARGE; +} + +declare const FormControlDecoratorGroup: React.FC; + +export default FormControlDecoratorGroup; diff --git a/src/Form/FormControlFeedback.d.ts b/src/Form/FormControlFeedback.d.ts new file mode 100644 index 0000000000..84a30e9ee2 --- /dev/null +++ b/src/Form/FormControlFeedback.d.ts @@ -0,0 +1,16 @@ +import React from 'react'; + +export type FeedbackVariants = 'default' | 'valid' | 'invalid' | 'warning' | 'criteria-empty' | 'criteria-valid' | 'criteria-invalid'; + +export interface FormControlFeedbackProps { + children: React.ReactNode; + className?: string; + hasIcon?: boolean; + type?: FeedbackVariants, + icon?: React.ReactNode; + muted?: boolean; +} + +declare const FormControlFeedback: React.FC; + +export default FormControlFeedback; diff --git a/src/Form/FormControlFloatingLabel.d.ts b/src/Form/FormControlFloatingLabel.d.ts new file mode 100644 index 0000000000..3f657ddd95 --- /dev/null +++ b/src/Form/FormControlFloatingLabel.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface FormControlFloatingLabelProps { + children: React.ReactNode; +} + +declare const FormControlFloatingLabel: React.FC; + +export default FormControlFloatingLabel; diff --git a/src/Form/FormControlSet.d.ts b/src/Form/FormControlSet.d.ts new file mode 100644 index 0000000000..b18f27e815 --- /dev/null +++ b/src/Form/FormControlSet.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; +import { BsPrefixProps } from 'react-bootstrap/helpers'; + +export interface FormControlSetProps extends BsPrefixProps{ + className?: string; + isInline?: boolean; + children?: React.ReactNode; +} + +declare const FormControlSet: React.FC; + +export default FormControlSet; diff --git a/src/Form/FormGroup.d.ts b/src/Form/FormGroup.d.ts new file mode 100644 index 0000000000..b04cea5ebf --- /dev/null +++ b/src/Form/FormGroup.d.ts @@ -0,0 +1,16 @@ +import React from 'react'; +import { BsPrefixProps } from 'react-bootstrap/helpers'; +import { FormControlSizes } from './FormGroupContext'; + +export interface FormGroupProps extends BsPrefixProps, React.HTMLAttributes { + children: React.ReactNode; + className?: string; + controlId?: string; + isInvalid?: boolean; + isValid?: boolean; + size?: FormControlSizes; +} + +declare const FormGroup: React.FC; + +export default FormGroup; diff --git a/src/Form/FormGroupContext.d.ts b/src/Form/FormGroupContext.d.ts new file mode 100644 index 0000000000..09a609c284 --- /dev/null +++ b/src/Form/FormGroupContext.d.ts @@ -0,0 +1,43 @@ +import React from 'react'; + +export type FormControlSizes = 'sm' | 'lg'; + +export interface FormGroupContextProviderProps { + children: React.ReactNode; + controlId?: string; + isInvalid?: boolean; + isValid?: boolean; + size?: FormControlSizes; +} + +export type DescriptorProps = { + id?: string; +}; + +export interface ControlProps extends DescriptorProps { + 'aria-describedby'?: string; + 'aria-labelledby'?: string; +} + +export interface LabelProps extends DescriptorProps { + htmlFor?: string; +} + +export interface FormGroupContextProps { + getControlProps: (props: ControlProps) => ControlProps; + getLabelProps: (props: LabelProps) => LabelProps; + getDescriptorProps: (props: DescriptorProps) => DescriptorProps; + useSetIsControlGroupEffect: (flag: boolean) => void; + isControlGroup: boolean; + controlId: string; + isInvalid?: boolean; + isValid?: boolean; + size?: FormControlSizes; + hasFormGroupProvider: boolean; +} + +declare const FormGroupContextProvider: React.FC; + +export declare const FormGroupContext: React.Context; + +export default FormGroupContextProvider; diff --git a/src/Form/FormLabel.d.ts b/src/Form/FormLabel.d.ts new file mode 100644 index 0000000000..068e08a3aa --- /dev/null +++ b/src/Form/FormLabel.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import { FormControlSizes } from './FormGroupContext'; + +export interface FormLabelProps { + className?: string; + children: React.ReactNode; + isInline?: boolean; + size?: FormControlSizes; +} + +declare const FormLabel: React.FC; + +export default FormLabel; diff --git a/src/Form/FormRadio.d.ts b/src/Form/FormRadio.d.ts new file mode 100644 index 0000000000..eb3b799253 --- /dev/null +++ b/src/Form/FormRadio.d.ts @@ -0,0 +1,15 @@ +import React from 'react'; + +export interface FormRadioProps extends React.InputHTMLAttributes { + children: React.ReactNode; + className?: string; + controlClassName?: string; + labelClassName?: string; + description?: React.ReactNode; + isInvalid?: boolean; + isValid?: boolean; +} + +declare const FormRadio: React.FC; + +export default FormRadio; diff --git a/src/Form/FormRadioSet.d.ts b/src/Form/FormRadioSet.d.ts new file mode 100644 index 0000000000..ecd7cadfd9 --- /dev/null +++ b/src/Form/FormRadioSet.d.ts @@ -0,0 +1,17 @@ +import React from 'react'; + +export interface FormRadioSetProps { + children: React.ReactNode; + className?: string; + name: string; + value?: string; + defaultValue?: string; + isInline?: boolean; + onChange?: React.ChangeEventHandler; + onFocus?: React.FocusEventHandler; + onBlur?: React.FocusEventHandler; +} + +declare const FormRadioSet: React.FC; + +export default FormRadioSet; diff --git a/src/Form/FormRadioSetContext.d.ts b/src/Form/FormRadioSetContext.d.ts new file mode 100644 index 0000000000..9ab26cdaa3 --- /dev/null +++ b/src/Form/FormRadioSetContext.d.ts @@ -0,0 +1,29 @@ +import React from 'react'; + +export type HandlersTypes = { + onBlur?: (event: React.FocusEvent) => void; + onFocus?: (event: React.FocusEvent) => void; + onChange?: (event: React.ChangeEvent) => void; +}; + +export interface RadioControlProps extends HandlersTypes { + value: string; +} + +export interface FormRadioSetContextValue extends RadioControlProps { + name: string; + defaultValue?: string; + getRadioControlProps: (props: RadioControlProps) => RadioControlProps; +} + +export interface FormRadioSetContextProviderProps extends FormRadioSetContextValue { + children: React.ReactNode; +} + +declare const FormRadioSetContext: React.Context; +declare function useRadioSetContext(): FormRadioSetContextValue; +declare function FormRadioSetContextProvider(props: FormRadioSetContextProviderProps): JSX.Element; + +export { useRadioSetContext, FormRadioSetContextProvider }; + +export default FormRadioSetContext; diff --git a/src/Form/FormSwitch.d.ts b/src/Form/FormSwitch.d.ts new file mode 100644 index 0000000000..10d89ce6eb --- /dev/null +++ b/src/Form/FormSwitch.d.ts @@ -0,0 +1,21 @@ +import React from 'react'; + +export interface FormSwitchProps extends React.ButtonHTMLAttributes { + children: React.ReactNode; + className?: string; + labelClassName?: string; + helperText?: React.ReactNode; + floatLabelLeft?: boolean; +} + +export interface FormSwitchControlProps { + isIndeterminate?: boolean; + className?: string; +} + +declare const FormSwitch: React.FC; +declare const SwitchControl: React.FC; + +export { SwitchControl }; + +export default FormSwitch; diff --git a/src/Form/FormSwitchSet.d.ts b/src/Form/FormSwitchSet.d.ts new file mode 100644 index 0000000000..5db6796765 --- /dev/null +++ b/src/Form/FormSwitchSet.d.ts @@ -0,0 +1,3 @@ +import { FormCheckboxSetProps } from './FormCheckboxSet'; + +export default function FormSwitchSet(props: FormCheckboxSetProps): JSX.Element diff --git a/src/Form/FormText.d.ts b/src/Form/FormText.d.ts new file mode 100644 index 0000000000..f8f01d86f3 --- /dev/null +++ b/src/Form/FormText.d.ts @@ -0,0 +1,24 @@ +import React from 'react'; +import { FeedbackVariants } from './FormControlFeedback'; + +export interface FormTextIconProps { + type?: FormTextTypes; + customIcon?: React.ReactNode; +} + +export interface FormTextProps { + children: React.ReactNode; + className?: string; + hasIcon?: boolean; + type?: FeedbackVariants, + icon?: React.ReactNode; + muted?: boolean; +} + +declare const FormText: React.FC; + +declare const FormTextIcon: React.FC; + +export { FormTextIcon }; + +export default FormText; diff --git a/src/Form/index.d.ts b/src/Form/index.d.ts new file mode 100644 index 0000000000..6d41ce91e5 --- /dev/null +++ b/src/Form/index.d.ts @@ -0,0 +1,62 @@ +import React from 'react'; +import { Form, FormProps } from 'react-bootstrap/Form'; + +import FormControl, { FormControlProps } from './FormControl'; +import FormRadio, { FormRadioProps } from './FormRadio'; +import FormRadioSet, { FormRadioSetProps } from './FormRadioSet'; +import FormControlFeedback, { FormControlFeedbackProps } from './FormControlFeedback'; +import FormRadioSetContext from './FormRadioSetContext'; +import FormAutosuggest, { FormAutosuggestProps } from './FormAutosuggest'; +import FormAutosuggestOption, { FormAutosuggestOptionProps } from './FormAutosuggestOption'; +import FormCheckbox, { FormCheckboxProps, CheckboxControl } from './FormCheckbox'; +import FormCheckboxSet, { FormCheckboxSetProps } from './FormCheckboxSet'; +import FormCheckboxSetContext from './FormCheckboxSetContext'; +import FormControlDecoratorGroup from './FormControlDecoratorGroup'; +import FormSwitch, { FormSwitchProps, SwitchControl } from './FormSwitch'; +import FormLabel, { FormLabelProps } from './FormLabel'; +import FormGroup, { FormGroupProps } from './FormGroup'; +import FormText, { FormTextProps } from './FormText'; +import FormSwitchSet from './FormSwitchSet'; +import { BsPrefixRefForwardingComponent } from "react-bootstrap/helpers"; + +declare const Form: React.FC & { + Control: React.FC & { + Feedback: React.FC; + Description: React.FC; + }; + Radio: React.FC; + RadioSet: React.FC; + Autosuggest: React.FC; + AutosuggestOption: React.FC; + Checkbox: React.FC; + CheckboxSet: React.FC; + Switch: React.FC; + SwitchSet: React.FC; + Label: React.FC; + Group: React.FC; + Text: React.FC; + Row: BsPrefixRefForwardingComponent<"div", unknown>; +}; + +export default Form; + +export { + FormControl, + FormLabel, + FormRadio, + FormRadioSet, + FormRadioSetContext, + FormCheckbox, + FormSwitch, + FormAutosuggest, + FormAutosuggestOption, + FormCheckboxSet, + FormCheckboxSetContext, + FormGroup, + FormControlDecoratorGroup, + FormControlFeedback, + FormText, + CheckboxControl, + SwitchControl, + FormSwitchSet, +} diff --git a/src/Hyperlink/index.d.ts b/src/Hyperlink/index.d.ts new file mode 100644 index 0000000000..e41e69957d --- /dev/null +++ b/src/Hyperlink/index.d.ts @@ -0,0 +1,18 @@ +import React from 'react'; + +export interface HyperlinkProps extends React.AnchorHTMLAttributes { + destination: string; + children: React.ReactNode; + className?: string; + target?: string; + onClick?: React.MouseEventHandler; + externalLinkAlternativeText?: string; + externalLinkTitle?: string; + variant?: 'default' | 'muted' | 'brand'; + isInline?: boolean; + showLaunchIcon?: boolean; +} + +declare const Hyperlink: React.ForwardRefExoticComponent>; + +export { Hyperlink }; diff --git a/src/IconButton/index.d.ts b/src/IconButton/index.d.ts new file mode 100644 index 0000000000..309ce257c7 --- /dev/null +++ b/src/IconButton/index.d.ts @@ -0,0 +1,38 @@ +import React from 'react'; + +export type IconButtonVariants = 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'light' | 'dark' | 'black' | 'brand'; + +export interface IconButtonProps extends React.ButtonHTMLAttributes { + className?: string; + iconAs?: React.ComponentType; + src?: React.ReactElement; + alt: string; + invertColors?: boolean; + icon?: { + prefix: string; + iconName: string; + icon: any[]; + }; + iconClassNames?: string; + onClick?: (event: React.MouseEvent) => void; + variant?: IconButtonVariants; + size?: 'sm' | 'md' | 'inline'; + isActive?: boolean; +} + +export interface IconButtonWithTooltipProps { + tooltipPlacement?: string; + tooltipContent: React.ReactNode; + invertColors?: boolean; + variant?: IconButtonVariants; +} + +declare const IconButtonWithTooltip: React.ForwardRefExoticComponent; + +declare const IconButton: React.ForwardRefExoticComponent & { + IconButtonWithTooltip: React.FC; +}; + +export { IconButtonWithTooltip }; + +export default IconButton; diff --git a/src/IconButtonToggle/index.d.ts b/src/IconButtonToggle/index.d.ts new file mode 100644 index 0000000000..d279ef6445 --- /dev/null +++ b/src/IconButtonToggle/index.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; +import { IconButtonProps } from '../IconButton'; + +export interface IconButtonToggleProps { + activeValue?: string; + onChange?: (value: string) => void; + children: React.ReactElement; +} + +declare const IconButtonToggle: React.FC; + +export default IconButtonToggle; diff --git a/src/Layout/index.d.ts b/src/Layout/index.d.ts new file mode 100644 index 0000000000..0e68bcc3c7 --- /dev/null +++ b/src/Layout/index.d.ts @@ -0,0 +1,27 @@ +import React from 'react'; + +export type ColSpanValues = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'auto'; + +export interface ColLayout { + span: ColSpanValues; + offset?: number; +} + +export interface LayoutProps { + children: React.ReactNode; + xs?: ColLayout[]; + sm?: ColLayout[]; + md?: ColLayout[]; + lg?: ColLayout[]; + xl?: ColLayout[]; +} + +export interface LayoutComponent extends React.ForwardRefExoticComponent { + Element: React.FC; +} + +export declare const LayoutElement: React.ForwardRefExoticComponent & React.RefAttributes>; + +declare const Layout: LayoutComponent; + +export default Layout; diff --git a/src/MailtoLink/index.d.ts b/src/MailtoLink/index.d.ts new file mode 100644 index 0000000000..ab27f0c7ee --- /dev/null +++ b/src/MailtoLink/index.d.ts @@ -0,0 +1,17 @@ +import React from 'react'; +import { Options } from 'mailto-link'; + +export interface MailtoLinkProps extends Options { + children: React.ReactNode; + className?: string; + target?: string; + onClick?: React.MouseEventHandler; + externalLink?: { + alternativeText: string; + title: string; + }; +} + +declare const MailtoLink: React.ForwardRefExoticComponent; + +export default MailtoLink; diff --git a/src/Menu/MenuItem.d.ts b/src/Menu/MenuItem.d.ts new file mode 100644 index 0000000000..55bcf54db1 --- /dev/null +++ b/src/Menu/MenuItem.d.ts @@ -0,0 +1,17 @@ +import React from 'react'; +import { BsPrefixProps } from 'react-bootstrap/helpers'; + +interface MenuItemProps extends BsPrefixProps, React.HTMLAttributes { + defaultSelected?: boolean; + children?: React.ReactNode; + iconBefore?: React.ReactNode; + iconAfter?: React.ReactNode; + disabled?: boolean; + href?: string; + variant?: string; + size?: string; +} + +declare const MenuItem: React.FC; + +export default MenuItem; diff --git a/src/Menu/SelectMenu.d.ts b/src/Menu/SelectMenu.d.ts new file mode 100644 index 0000000000..dadd8d007b --- /dev/null +++ b/src/Menu/SelectMenu.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; + +export interface SelectMenuProps { + defaultMessage?: string; + isLink?: boolean; + children: React.ReactNode; + className?: string; +} + +declare const SelectMenu: React.FC; + +export default SelectMenu; diff --git a/src/Menu/index.d.ts b/src/Menu/index.d.ts new file mode 100644 index 0000000000..7b1092ca6e --- /dev/null +++ b/src/Menu/index.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; + +export interface MenuProps { + className?: string; + arrowKeyNavigationSelector?: string; + as?: keyof JSX.IntrinsicElements; + children?: React.ReactNode; +} + +declare const Menu: React.FC; + +export default Menu; diff --git a/src/Modal/AlertModal.d.ts b/src/Modal/AlertModal.d.ts new file mode 100644 index 0000000000..d82c601028 --- /dev/null +++ b/src/Modal/AlertModal.d.ts @@ -0,0 +1,5 @@ +import { BaseModalProps } from './BaseModalProps'; + +declare function AlertModal(props: BaseModalProps): JSX.Element; + +export default AlertModal; diff --git a/src/Modal/BaseModalProps.d.ts b/src/Modal/BaseModalProps.d.ts new file mode 100644 index 0000000000..db1f8da350 --- /dev/null +++ b/src/Modal/BaseModalProps.d.ts @@ -0,0 +1,19 @@ +import React from 'react'; + +export type ModalSizes = 'sm' | 'md' | 'lg' | 'xl' | 'fullscreen'; +export type ModalVariants = 'default' | 'warning' | 'danger' | 'success' | 'dark'; + +export interface BaseModalProps { + children: React.ReactNode; + title: string; + isOpen?: boolean; + hasCloseButton?: boolean; + onClose?: () => void; + size?: ModalSizes; + variant?: ModalVariants; + closeLabel?: string; + className?: string; + isFullscreenScroll?: boolean; + footerNode?: React.ReactNode; + isBlocking?: boolean; +} diff --git a/src/Modal/FullscreenModal.d.ts b/src/Modal/FullscreenModal.d.ts new file mode 100644 index 0000000000..7b751fa3e5 --- /dev/null +++ b/src/Modal/FullscreenModal.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; +import { BaseModalProps } from './BaseModalProps'; + +export interface FullscreenModalProps extends BaseModalProps { + beforeBodyNode?: React.ReactNode; + afterBodyNode?: React.ReactNode; + modalBodyClassName?: string; +} + +declare const FullscreenModal: React.FC; + +export default FullscreenModal; diff --git a/src/Modal/MarketingModal.d.ts b/src/Modal/MarketingModal.d.ts new file mode 100644 index 0000000000..55bbb05eef --- /dev/null +++ b/src/Modal/MarketingModal.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import { BaseModalProps } from './BaseModalProps'; + +export interface MarketingModalProps extends BaseModalProps { + heroIsDark?: boolean; + heroNode?: React.ReactNode; + beforeBodyNode?: React.ReactNode; + afterBodyNode?: React.ReactNode; +} + +declare const MarketingModal: React.FC; + +export default MarketingModal; diff --git a/src/Modal/ModalCloseButton.d.ts b/src/Modal/ModalCloseButton.d.ts new file mode 100644 index 0000000000..7590b19df5 --- /dev/null +++ b/src/Modal/ModalCloseButton.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; +import { BsPrefixProps } from 'react-bootstrap/helpers'; + +export interface ModalCloseButtonProps extends BsPrefixProps, React.ButtonHTMLAttributes { + children?: React.ReactNode; + className?: string; + onClick?: () => void; +} + +declare const ModalCloseButton: React.ForwardRefExoticComponent>; + +export default ModalCloseButton; diff --git a/src/Modal/ModalContext.d.ts b/src/Modal/ModalContext.d.ts new file mode 100644 index 0000000000..32417b18a0 --- /dev/null +++ b/src/Modal/ModalContext.d.ts @@ -0,0 +1,22 @@ +import React from 'react'; + +export interface ModalContextValue { + onClose: () => void; + isOpen: boolean; + isBlocking: boolean; +} + +export interface ModalContextProviderProps { + children?: React.ReactNode; + onClose: () => void; + isBlocking?: boolean; + isOpen: boolean; +} + +declare const ModalContext: React.FC; + +declare function ModalContextProvider(props: ModalContextProviderProps): JSX.Element; + +export { ModalContextProvider }; + +export default ModalContext; diff --git a/src/Modal/ModalDialog.d.ts b/src/Modal/ModalDialog.d.ts new file mode 100644 index 0000000000..b52e793bdc --- /dev/null +++ b/src/Modal/ModalDialog.d.ts @@ -0,0 +1,29 @@ +import React from 'react'; +import { ModalDialogHeaderProps } from './ModalDialogHeader'; +import { ModalDialogFooterProps } from './ModalDialogFooter'; +import { ModalDialogTitleProps } from './ModalDialogTitle'; +import { ModalCloseButtonProps } from './ModalCloseButton'; +import { ModalDialogHeroProps } from './ModalDialogHero'; +import { ModalDialogBodyProps } from './ModalDialogBody'; +import { ModalDialogHeroContentProps } from './ModalDialogHeroContent'; +import { ModalDialogHeroBackgroundProps } from './ModalDialogHeroBackground'; +import { BaseModalProps } from './BaseModalProps'; + +export interface ModalDialogProps extends Omit { + isFullscreenOnMobile?: boolean; + zIndex?: number; +} + +declare const ModalDialog: React.FC & { + Header: React.FC; + Title: React.FC; + Footer: React.FC; + CloseButton: React.FC; + Body: React.FC; + Hero: React.FC & { + Content: React.FC; + Background: React.FC; + } +}; + +export default ModalDialog; diff --git a/src/Modal/ModalDialogBody.d.ts b/src/Modal/ModalDialogBody.d.ts new file mode 100644 index 0000000000..ceea8134bb --- /dev/null +++ b/src/Modal/ModalDialogBody.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; + +export interface ModalDialogBodyProps { + as?: keyof JSX.IntrinsicElements; + children: React.ReactNode; + className?: string; +} + +declare const ModalDialogBody: React.FC; + +export default ModalDialogBody; diff --git a/src/Modal/ModalDialogFooter.d.ts b/src/Modal/ModalDialogFooter.d.ts new file mode 100644 index 0000000000..1fe5048f32 --- /dev/null +++ b/src/Modal/ModalDialogFooter.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import { ModalDialogBodyProps } from './ModalDialogBody'; + +export interface ModalDialogFooterProps extends ModalDialogBodyProps {} + +export const ModalDialogFooter: React.FC; + +export default ModalDialogFooter; diff --git a/src/Modal/ModalDialogHeader.d.ts b/src/Modal/ModalDialogHeader.d.ts new file mode 100644 index 0000000000..cc718c397f --- /dev/null +++ b/src/Modal/ModalDialogHeader.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import { ModalDialogBodyProps } from './ModalDialogBody'; + +export interface ModalDialogHeaderProps extends ModalDialogBodyProps {} + +export const ModalDialogHeader: React.FC; + +export default ModalDialogHeader; diff --git a/src/Modal/ModalDialogHero.d.ts b/src/Modal/ModalDialogHero.d.ts new file mode 100644 index 0000000000..a30e72ddd3 --- /dev/null +++ b/src/Modal/ModalDialogHero.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import { ModalDialogBodyProps } from './ModalDialogBody'; + +export interface ModalDialogHeroProps extends ModalDialogBodyProps {} + +declare const ModalDialogHero: React.FC; + +export default ModalDialogHero; diff --git a/src/Modal/ModalDialogHeroBackground.d.ts b/src/Modal/ModalDialogHeroBackground.d.ts new file mode 100644 index 0000000000..2b592da427 --- /dev/null +++ b/src/Modal/ModalDialogHeroBackground.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import { ModalDialogBodyProps } from './ModalDialogBody'; + +export interface ModalDialogHeroBackgroundProps extends ModalDialogBodyProps {} + +declare const ModalDialogHeroBackground: React.FC; + +export default ModalDialogHeroBackground; diff --git a/src/Modal/ModalDialogHeroContent.d.ts b/src/Modal/ModalDialogHeroContent.d.ts new file mode 100644 index 0000000000..cc718c397f --- /dev/null +++ b/src/Modal/ModalDialogHeroContent.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import { ModalDialogBodyProps } from './ModalDialogBody'; + +export interface ModalDialogHeaderProps extends ModalDialogBodyProps {} + +export const ModalDialogHeader: React.FC; + +export default ModalDialogHeader; diff --git a/src/Modal/ModalDialogTitle.d.ts b/src/Modal/ModalDialogTitle.d.ts new file mode 100644 index 0000000000..19c94d690b --- /dev/null +++ b/src/Modal/ModalDialogTitle.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; +import { ModalDialogBodyProps } from './ModalDialogBody'; + +export interface ModalDialogTitleProps extends ModalDialogBodyProps {} + +export const ModalDialogTitle: React.FC; + +export default ModalDialogTitle; diff --git a/src/Modal/ModalLayer.d.ts b/src/Modal/ModalLayer.d.ts new file mode 100644 index 0000000000..dc8218cbc4 --- /dev/null +++ b/src/Modal/ModalLayer.d.ts @@ -0,0 +1,15 @@ +import React from 'react'; + +export interface ModalLayerProps { + children: React.ReactNode; + onClose: () => void; + isOpen: boolean; + isBlocking?: boolean; + zIndex?: number; +} + +export function ModalBackdrop(props: { onClick?: () => void }): JSX.Element; + +export function ModalContentContainer(props: { children?: React.ReactNode }): JSX.Element; + +export default function ModalLayer(props: ModalLayerProps): JSX.Element; diff --git a/src/Modal/ModalPopup.d.ts b/src/Modal/ModalPopup.d.ts new file mode 100644 index 0000000000..62b7933c66 --- /dev/null +++ b/src/Modal/ModalPopup.d.ts @@ -0,0 +1,17 @@ +import React from 'react'; +import { PopoverPlacements } from './PopperElement'; + +export interface ModalPopupProps { + children: React.ReactNode; + onClose: () => void; + isOpen: boolean; + isBlocking?: boolean; + withPortal?: boolean; + positionRef?: ((instance: HTMLElement | null) => void) | React.RefObject; + placement?: PopoverPlacements; + hasArrow?: boolean; +} + +declare const ModalPopup: React.FC; + +export default ModalPopup; diff --git a/src/Modal/PopperElement.d.ts b/src/Modal/PopperElement.d.ts new file mode 100644 index 0000000000..264718143c --- /dev/null +++ b/src/Modal/PopperElement.d.ts @@ -0,0 +1,18 @@ +import React from 'react'; + +export type PopperElementPlacements = 'auto' | 'auto-start' | 'auto-end' | 'top' | 'top-start' | 'top-end' | 'bottom' + | 'bottom-start' | 'bottom-end' | 'right' | 'right-start' | 'right-end' | 'left' | 'left-start' | 'left-end'; + +export interface PopperElementProps { + children?: React.ReactNode; + target: { + current: React.ReactNode; + }; + strategy?: 'absolute' | 'fixed'; + placement?: PopperElementPlacements; + modifiers?: {}; +} + +declare const PopperElement: React.FC; + +export default PopperElement; diff --git a/src/Modal/Portal.d.ts b/src/Modal/Portal.d.ts new file mode 100644 index 0000000000..1919a1716d --- /dev/null +++ b/src/Modal/Portal.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface PortalProps { + children: React.ReactNode; +} + +declare class Portal extends React.Component {} + +export default Portal; diff --git a/src/Modal/StandardModal.d.ts b/src/Modal/StandardModal.d.ts new file mode 100644 index 0000000000..892c55204a --- /dev/null +++ b/src/Modal/StandardModal.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; +import { BaseModalProps } from './BaseModalProps'; + +export interface StandardModalProps extends Omit { + title: string, + beforeBodyNode?: React.ReactNode; + afterBodyNode?: React.ReactNode; +} + +declare const StandardModal: React.FC; + +export default StandardModal; diff --git a/src/Modal/StandartModal.d.ts b/src/Modal/StandartModal.d.ts new file mode 100644 index 0000000000..ddae748165 --- /dev/null +++ b/src/Modal/StandartModal.d.ts @@ -0,0 +1,21 @@ +import React from 'react'; + +export interface StandardModalProps { + children: React.ReactNode; + title: string; + onClose: () => void; + isOpen?: boolean; + hasCloseButton?: boolean; + size?: 'sm' | 'md' | 'lg' | 'xl' | 'fullscreen'; + variant?: 'default' | 'warning' | 'danger' | 'success' | 'dark'; + closeLabel?: string; + className?: string; + isFullscreenScroll?: boolean; + footerNode?: React.ReactNode; + beforeBodyNode?: React.ReactNode; + afterBodyNode?: React.ReactNode; +} + +declare const StandardModal: React.FC; + +export default StandardModal; diff --git a/src/Modal/index.d.ts b/src/Modal/index.d.ts new file mode 100644 index 0000000000..951351b899 --- /dev/null +++ b/src/Modal/index.d.ts @@ -0,0 +1,28 @@ +import React from 'react'; + +export interface ButtonProps { + children?: React.ReactNode; + disabled?: boolean; + onClick?: () => void; + className?: string; + variant?: string; + type?: string; +} + +export interface ModalProps { + open?: boolean; + parentSelector?: string; + title: string | React.ReactNode; + body: string | React.ReactNode; + buttons?: (React.ReactNode | ButtonProps)[]; + closeText?: string | React.ReactNode; + onClose: () => void; + variant?: { + status?: string; + }; + renderDefaultCloseButton?: boolean; + renderHeaderCloseButton?: boolean; + dialogClassName?: string; +} + +export default class Modal extends React.Component {} diff --git a/src/Nav/index.d.ts b/src/Nav/index.d.ts new file mode 100644 index 0000000000..c561580e1a --- /dev/null +++ b/src/Nav/index.d.ts @@ -0,0 +1,48 @@ +import React from 'react'; +import { BsPrefixProps } from 'react-bootstrap/helpers'; +import { NavProps as BaseNavProps } from 'react-bootstrap/Nav'; +import { NavItemProps as BaseNavItemProps } from 'react-bootstrap/NavItem'; +import { NavLinkProps as BaseNavLinkProps } from 'react-bootstrap/NavLink'; +import { NavDropdownProps as BaseNavDropdownProps } from 'react-bootstrap/NavDropdown'; +import { DropdownItemProps as BaseDropdownItemProps } from 'react-bootstrap/esm/DropdownItem'; + +export interface NavProps extends BsPrefixProps, BaseNavProps {} + +export interface NavItemProps extends BsPrefixProps, BaseNavItemProps {} + +export interface NavLinkProps extends BsPrefixProps, Omit { + title?: string; +} + +export interface NavDropdownProps extends BsPrefixProps, BaseNavDropdownProps { + menuVariant?: 'dark'; + onClick?: (event: React.SyntheticEvent) => void; +} + +export interface NavDropdownItemProps extends BsPrefixProps, BaseDropdownItemProps {} + +export interface NavDropdownDividerProps extends BsPrefixProps {} + +declare const NavDropdownItem: React.ForwardRefExoticComponent; +declare const NavDropdownDivider: React.ForwardRefExoticComponent; +declare const NavItem: React.ForwardRefExoticComponent; +declare const NavLink: React.ForwardRefExoticComponent; +declare const NavDropdown: React.ForwardRefExoticComponent & { + Item: React.ForwardRefExoticComponent; + Divider: React.ForwardRefExoticComponent; +}; + +declare const Nav: React.ForwardRefExoticComponent & { + Item: React.ForwardRefExoticComponent; + Link: React.ForwardRefExoticComponent; + Dropdown: React.ForwardRefExoticComponent & { + Item: React.ForwardRefExoticComponent; + Divider: React.ForwardRefExoticComponent; + }; +}; + +export { + NavDropdownItem, NavDropdownDivider, NavItem, NavLink, NavDropdown, +}; + +export default Nav; diff --git a/src/Navbar/index.d.ts b/src/Navbar/index.d.ts new file mode 100644 index 0000000000..cc18920845 --- /dev/null +++ b/src/Navbar/index.d.ts @@ -0,0 +1,24 @@ +import React from 'react'; +import { BsPrefixProps } from 'react-bootstrap/helpers'; +import { NavbarProps as BaseNavbarProps } from 'react-bootstrap/Navbar'; +import { NavbarBrandProps as BaseNavbarBrandProps } from 'react-bootstrap/NavbarBrand'; +import { NavbarToggleProps as BaseNavbarToggleProps } from 'react-bootstrap/NavbarToggle'; +import { NavbarCollapseProps as BaseNavbarCollapseProps } from 'react-bootstrap/NavbarCollapse'; + +export interface NavbarProps extends BsPrefixProps, BaseNavbarProps {} + +export interface NavbarBrandProps extends BsPrefixProps, BaseNavbarBrandProps {} + +export interface NavbarToggleProps extends BsPrefixProps, BaseNavbarToggleProps { + children?: React.ReactNode; +} + +export interface NavbarCollapseProps extends BsPrefixProps, BaseNavbarCollapseProps, React.HTMLAttributes {} + +declare const Navbar: React.FC & { + Brand: React.FC; + Toggle: React.FC; + Collapse: React.FC; +}; + +export default Navbar; diff --git a/src/OverflowScroll/OverflowScroll.d.ts b/src/OverflowScroll/OverflowScroll.d.ts new file mode 100644 index 0000000000..3e5ce80fcd --- /dev/null +++ b/src/OverflowScroll/OverflowScroll.d.ts @@ -0,0 +1,21 @@ +import React from 'react'; +import { OverflowScrollItems } from './OverflowScrollItems'; + +export interface OverflowScrollProps { + ariaLabel: string; + children: React.ReactNode; + childQuerySelector?: string; + hasInteractiveChildren?: boolean; + disableScroll?: boolean; + disableOpacityMasks?: boolean; + onScrollPrevious?: () => void; + onScrollNext?: () => void; + offset?: number | string; + offsetType?: 'percentage' | 'fixed'; +} + +declare const OverflowScroll: React.FC & { + Items: React.FC; +}; + +export default OverflowScroll; diff --git a/src/OverflowScroll/OverflowScrollItems.d.ts b/src/OverflowScroll/OverflowScrollItems.d.ts new file mode 100644 index 0000000000..630902f6d4 --- /dev/null +++ b/src/OverflowScroll/OverflowScrollItems.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface OverflowScrollItemsProps { + children: React.ReactNode; +} + +declare function OverflowScrollItems(props: OverflowScrollItemsProps): JSX.Element; + +export default OverflowScrollItems; diff --git a/src/OverflowScroll/index.d.ts b/src/OverflowScroll/index.d.ts new file mode 100644 index 0000000000..4af067db08 --- /dev/null +++ b/src/OverflowScroll/index.d.ts @@ -0,0 +1,6 @@ +export { default as OverflowScroll } from './OverflowScroll'; +export { default as OverflowScrollContext } from './OverflowScrollContext'; +export { + useOverflowScroll, + useOverflowScrollItems, +} from './data'; diff --git a/src/Overlay/index.d.ts b/src/Overlay/index.d.ts new file mode 100644 index 0000000000..1f8c60d353 --- /dev/null +++ b/src/Overlay/index.d.ts @@ -0,0 +1,38 @@ +import React from 'react'; +import { Placement } from '@popperjs/core'; +import { TransitionProps } from 'react-transition-group/Transition'; +import { FadeProps } from 'react-bootstrap/Fade'; + +export interface OverlayProps extends React.HTMLAttributes { + show: boolean; + onHide: () => void; + placement?: Placement; + container?: React.ReactElement | (() => React.ReactElement | null) | null; + flip?: boolean; + popperConfig?: Object; + rootClose?: boolean; + rootCloseEvent?: 'click' | 'mousedown'; + transition?: FadeProps | TransitionProps; + onEnter?: () => void; + onEntered?: () => void; + onEntering?: () => void; + onExit?: () => void; + onExited?: () => void; + onExiting?: () => void; + target: Element | (() => Element | null) | null; +} + +export interface OverlayTriggerProps extends OverlayProps { + trigger: 'click' | 'hover' | 'focus'; + delay?: number | { show: number; hide: number }; + defaultShow?: boolean; + onToggle?: (show: boolean) => void; + overlay: React.ReactNode | ((props: any) => React.ReactNode); +} + +declare const Overlay: React.FC; +declare const OverlayTrigger: React.FC; + +export { OverlayTrigger }; + +export default Overlay; diff --git a/src/PageBanner/index.d.ts b/src/PageBanner/index.d.ts new file mode 100644 index 0000000000..2aa2dbc14a --- /dev/null +++ b/src/PageBanner/index.d.ts @@ -0,0 +1,14 @@ +import React from 'react'; + +export interface PageBannerTypes { + children?: React.ReactNode; + dismissible?: boolean; + dismissAltText?: React.ReactNode; + onDismiss?: () => void; + show?: boolean; + variant?: 'light' | 'dark' | 'warning' | 'accentA' | 'accentB'; +} + +declare const PageBanner: React.FC; + +export default PageBanner; diff --git a/src/Pagination/index.d.ts b/src/Pagination/index.d.ts new file mode 100644 index 0000000000..63eba20b20 --- /dev/null +++ b/src/Pagination/index.d.ts @@ -0,0 +1,28 @@ +import React from 'react'; + +export interface PaginationProps { + onPageSelect: (pageNumber: number) => void; + pageCount: number; + paginationLabel: string; + buttonLabels?: { + previous?: string; + next?: string; + page?: string; + currentPage?: string; + pageOfCount?: string; + }; + className?: string; + currentPage?: number; + maxPagesDisplayed?: number; + icons?: { + leftIcon?: React.ReactNode; + rightIcon?: React.ReactNode; + }; + variant?: 'default' | 'secondary' | 'reduced' | 'minimal'; + invertColors?: boolean; + size?: 'default' | 'small'; +} + +declare class Pagination extends React.Component {} + +export default Pagination; diff --git a/src/Popover/index.d.ts b/src/Popover/index.d.ts new file mode 100644 index 0000000000..fb084ae270 --- /dev/null +++ b/src/Popover/index.d.ts @@ -0,0 +1,21 @@ +import React from 'react'; +import { BsPrefixProps } from 'react-bootstrap/helpers'; +import { PopoverProps } from 'react-bootstrap/Popover'; + +export interface WrapperPopoverProps extends Omit { + placement?: 'auto' | 'top' | 'bottom' | 'left' | 'right'; + popper?: {}; + className?: string; + variant?: string; +} + +export interface PopoverTitleProps extends BsPrefixProps {} + +export interface PopoverContentProps extends BsPrefixProps {} + +declare const WrapperPopover: React.ForwardRefExoticComponent & { + Title: React.FC; + Content: React.FC; +}; + +export default WrapperPopover; diff --git a/src/ProductTour/Checkpoint.d.ts b/src/ProductTour/Checkpoint.d.ts new file mode 100644 index 0000000000..506519f506 --- /dev/null +++ b/src/ProductTour/Checkpoint.d.ts @@ -0,0 +1,24 @@ +import React from 'react'; + +export type CheckpointPlacements = 'top' | 'top-start' | 'top-end' | 'right-start' | 'right' | 'right-end' + | 'left-start' | 'left' | 'left-end' | 'bottom' | 'bottom-start' | 'bottom-end'; + +export interface CheckpointProps { + advanceButtonText?: React.ReactNode; + body?: React.ReactNode; + dismissButtonText?: React.ReactNode; + endButtonText?: React.ReactNode; + index: number; + onAdvance: () => void; + onDismiss: () => void; + onEnd: () => void; + placement?: CheckpointPlacements; + showDismissButton?: boolean; + target: string; + title?: React.ReactNode; + totalCheckpoints: number; +} + +declare const Checkpoint: React.ForwardRefExoticComponent; + +export default Checkpoint; diff --git a/src/ProductTour/CheckpointActionRow.d.ts b/src/ProductTour/CheckpointActionRow.d.ts new file mode 100644 index 0000000000..ae447349eb --- /dev/null +++ b/src/ProductTour/CheckpointActionRow.d.ts @@ -0,0 +1,17 @@ +import React from 'react'; + +export interface CheckpointActionRowProps { + advanceButtonText?: React.ReactNode; + dismissButtonText?: React.ReactNode; + endButtonText?: React.ReactNode; + isLastCheckpoint?: boolean; + onAdvance?: (index: number) => void; + onDismiss?: () => void; + onEnd?: (index: number) => void; + showDismissButton?: boolean; + index?: number; +} + +declare const CheckpointActionRow: React.ForwardRefExoticComponent; + +export default CheckpointActionRow; diff --git a/src/ProductTour/CheckpointBody.d.ts b/src/ProductTour/CheckpointBody.d.ts new file mode 100644 index 0000000000..669751370c --- /dev/null +++ b/src/ProductTour/CheckpointBody.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface CheckpointBodyProps { + children?: React.ReactNode; +} + +declare const CheckpointBody: React.ForwardRefExoticComponent; + +export default CheckpointBody; diff --git a/src/ProductTour/CheckpointBreadcrumbs.d.ts b/src/ProductTour/CheckpointBreadcrumbs.d.ts new file mode 100644 index 0000000000..490a57ef2f --- /dev/null +++ b/src/ProductTour/CheckpointBreadcrumbs.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; + +export type CheckpointBreadcrumbsProps = { + currentIndex?: number; + totalCheckpoints?: number; +}; + +declare const CheckpointBreadcrumbs: React.ForwardRefExoticComponent; + +export default CheckpointBreadcrumbs; diff --git a/src/ProductTour/CheckpointTitle.d.ts b/src/ProductTour/CheckpointTitle.d.ts new file mode 100644 index 0000000000..a4ff6a7127 --- /dev/null +++ b/src/ProductTour/CheckpointTitle.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface CheckpointTitleProps { + children?: React.ReactNode; +} + +declare const CheckpointTitle: React.ForwardRefExoticComponent; + +export default CheckpointTitle; diff --git a/src/ProductTour/index.d.ts b/src/ProductTour/index.d.ts new file mode 100644 index 0000000000..e238af245f --- /dev/null +++ b/src/ProductTour/index.d.ts @@ -0,0 +1,36 @@ +import React from 'react'; + +export interface CheckpointData { + advanceButtonText?: React.ReactNode; + body?: React.ReactNode; + dismissButtonText?: React.ReactNode; + endButtonText?: React.ReactNode; + onAdvance?: () => void; + onDismiss?: () => void; + onEnd?: () => void; + placement?: string; + target?: string; + title?: React.ReactNode; + showDismissButton?: boolean; +} + +export interface TourData { + advanceButtonText?: React.ReactNode; + checkpoints?: CheckpointData[]; + dismissButtonText?: React.ReactNode; + endButtonText?: React.ReactNode; + enabled?: boolean; + onDismiss?: () => void; + onEnd?: (lastCheckpoint: CheckpointData) => void; + onEscape?: () => void; + startingIndex?: number; + tourId: string; +} + +export interface ProductTourProps { + tours: TourData[]; +} + +declare const ProductTour: React.ForwardRefExoticComponent; + +export default ProductTour; diff --git a/src/ProgressBar/index.d.ts b/src/ProgressBar/index.d.ts new file mode 100644 index 0000000000..87ee83b00d --- /dev/null +++ b/src/ProgressBar/index.d.ts @@ -0,0 +1,18 @@ +import React from 'react'; +import { ProgressBarProps as BaseProgressBarProps } from 'react-bootstrap/ProgressBar'; + +export interface ProgressBarProps extends BaseProgressBarProps {} + +export interface ProgressBarAnnotatedProps extends ProgressBarProps { + threshold?: number; + thresholdLabel?: React.ReactNode; + thresholdVariant?: 'dark' | 'warning' | 'success' | 'error'; + progressHint?: React.ReactNode; + thresholdHint?: React.ReactNode; +} + +declare const ProgressBar: React.FC & { + Annotated: React.FC; +}; + +export default ProgressBar; diff --git a/src/Scrollable/index.d.ts b/src/Scrollable/index.d.ts new file mode 100644 index 0000000000..481895d8de --- /dev/null +++ b/src/Scrollable/index.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; + +export interface ScrollableProps extends React.HTMLAttributes { + children: React.ReactNode; + className?: string; +} + +declare function Scrollable(props: ScrollableProps): JSX.Element; + +export default Scrollable; diff --git a/src/SearchField/SearchFieldAdvanced.d.ts b/src/SearchField/SearchFieldAdvanced.d.ts new file mode 100644 index 0000000000..63a0f02c54 --- /dev/null +++ b/src/SearchField/SearchFieldAdvanced.d.ts @@ -0,0 +1,28 @@ +import React from 'react'; + +export interface SearchFieldAdvancedProps { + children: React.ReactNode; + onSubmit: (value: string) => void; + className?: string; + onBlur?: (event: React.FocusEvent) => void; + onChange?: (value: string) => void; + onClear?: () => void; + onFocus?: (event: React.FocusEvent) => void; + screenReaderText?: { + label: string | React.ReactElement; + submitButton: string | React.ReactElement; + clearButton?: string | React.ReactElement; + }; + value?: string; + icons?: { + submit: React.ReactElement; + clear?: React.ReactElement; + }; + formAriaLabel?: string; + disabled?: boolean; + submitButtonLocation?: 'internal' | 'external'; +} + +declare const SearchFieldAdvanced: React.FC; + +export default SearchFieldAdvanced; diff --git a/src/SearchField/SearchFieldInput.d.ts b/src/SearchField/SearchFieldInput.d.ts new file mode 100644 index 0000000000..b5047d4291 --- /dev/null +++ b/src/SearchField/SearchFieldInput.d.ts @@ -0,0 +1,10 @@ +import React from 'react'; + +export interface SearchFieldInputProps extends React.InputHTMLAttributes { + className?: string; + placeholder?: string; +} + +declare function SearchFieldInput(props: SearchFieldInputProps): JSX.Element; + +export default SearchFieldInput; diff --git a/src/SearchField/SearchFieldLabel.d.ts b/src/SearchField/SearchFieldLabel.d.ts new file mode 100644 index 0000000000..adc1e92cb3 --- /dev/null +++ b/src/SearchField/SearchFieldLabel.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface SearchFieldLabelProps { + children?: React.ReactNode; +} + +declare function SearchFieldLabel(props: SearchFieldLabelProps): JSX.Element; + +export default SearchFieldLabel; diff --git a/src/SearchField/SearchFieldSubmitButton.d.ts b/src/SearchField/SearchFieldSubmitButton.d.ts new file mode 100644 index 0000000000..9d215eb51a --- /dev/null +++ b/src/SearchField/SearchFieldSubmitButton.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; + +export interface SearchFieldSubmitButtonProps { + variant?: 'light' | 'dark'; + submitButtonLocation?: 'internal' | 'external'; + buttonText?: string; +} + +declare const SearchFieldSubmitButton: React.FC; + +export default SearchFieldSubmitButton; diff --git a/src/SearchField/SearchFileClearButton.d.ts b/src/SearchField/SearchFileClearButton.d.ts new file mode 100644 index 0000000000..d47e7f3936 --- /dev/null +++ b/src/SearchField/SearchFileClearButton.d.ts @@ -0,0 +1,7 @@ +import React from 'react'; + +export interface SearchFieldClearButtonProps extends React.ButtonHTMLAttributes {} + +declare const SearchFieldClearButton: React.FC; + +export default SearchFieldClearButton; diff --git a/src/SearchField/index.d.ts b/src/SearchField/index.d.ts new file mode 100644 index 0000000000..a870305979 --- /dev/null +++ b/src/SearchField/index.d.ts @@ -0,0 +1,43 @@ +import React from 'react'; +import { SearchFieldAdvancedProps } from './SearchFieldAdvanced'; +import { SearchFieldClearButtonProps } from './SearchFieldClearButton'; +import { SearchFieldInputProps } from './SearchFieldInput'; +import { SearchFieldLabelProps } from './SearchFieldLabel'; +import { SearchFieldSubmitButtonProps } from './SearchFieldSubmitButton'; + +export interface SearchFieldProps { + onSubmit: (value: string) => void; + label?: string | React.ReactNode; + className?: string; + onBlur?: (event: React.FocusEvent) => void; + onChange?: (value: string) => void; + onClear?: () => void; + onFocus?: (event: React.FocusEvent) => void; + placeholder?: string; + screenReaderText?: { + label: string | React.ReactNode; + submitButton: string | React.ReactNode; + clearButton?: string | React.ReactNode; + }; + value?: string; + icons?: { + submit: React.ReactNode; + clear?: React.ReactNode; + }; + formAriaLabel?: string; + inputProps?: Record; + variant?: 'light' | 'dark'; + disabled?: boolean; + submitButtonLocation?: 'internal' | 'external'; + buttonText?: string | React.ReactNode; +} + +declare const SearchField: React.FC & { + Advanced: React.FC; + Label: React.FC; + Input: React.FC; + ClearButton: React.FC; + SubmitButton: React.FC; +}; + +export default SearchField; diff --git a/src/SelectableBox/SelectableBoxSet.d.ts b/src/SelectableBox/SelectableBoxSet.d.ts new file mode 100644 index 0000000000..f88ce37f0f --- /dev/null +++ b/src/SelectableBox/SelectableBoxSet.d.ts @@ -0,0 +1,16 @@ +import React from 'react'; + +export interface SelectableBoxSetProps { + name: string; + children?: React.ReactNode; + onChange?: React.ChangeEventHandler; + value?: string | number | Array; + defaultValue?: string | number; + type?: 'radio' | 'checkbox'; + columns?: number; + className?: string; +} + +declare const SelectableBoxSet: React.ForwardRefExoticComponent; + +export default SelectableBoxSet; diff --git a/src/SelectableBox/index.d.ts b/src/SelectableBox/index.d.ts new file mode 100644 index 0000000000..2d9e665d76 --- /dev/null +++ b/src/SelectableBox/index.d.ts @@ -0,0 +1,24 @@ +import React from 'react'; +import { SelectableBoxSetProps } from './SelectableBoxSet'; + +export interface SelectableBoxProps extends React.HTMLAttributes { + value?: string | number; + checked?: boolean; + type?: 'radio' | 'checkbox'; + onClick?: (inputRef: React.HTMLInputElement) => void; + onFocus?: () => void; + inputHidden?: boolean; + isIndeterminate?: boolean; + isInvalid?: boolean; + className?: string; +} + +export type SelectableBoxRef = React.HTMLDivElement & { + inputRef?: React.HTMLInputElement; +}; + +declare const SelectableBox: React.ForwardRefExoticComponent> & { + Set: React.FC; +}; + +export default SelectableBox; diff --git a/src/Sheet/SheetContainer.d.ts b/src/Sheet/SheetContainer.d.ts new file mode 100644 index 0000000000..978992c9b3 --- /dev/null +++ b/src/Sheet/SheetContainer.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface SheetContainerProps { + children: React.ReactNode; +} + +declare class SheetContainer extends React.Component {} + +export default SheetContainer; diff --git a/src/Sheet/index.d.ts b/src/Sheet/index.d.ts new file mode 100644 index 0000000000..18a86a81a0 --- /dev/null +++ b/src/Sheet/index.d.ts @@ -0,0 +1,26 @@ +import React from 'react'; + +export declare const POSITIONS: { + left: string; + right: string; + top: string; + bottom: string; +}; + +export declare const VARIANTS: { + light: string; + dark: string; +}; + +export interface SheetProps { + blocking?: boolean; + children?: React.ReactNode; + position?: keyof typeof POSITIONS; + show?: boolean; + onClose?: () => void; + variant?: keyof typeof VARIANTS; +} + +declare class Sheet extends React.Component {} + +export default Sheet; diff --git a/src/Spinner/index.d.ts b/src/Spinner/index.d.ts new file mode 100644 index 0000000000..79ebad0f4c --- /dev/null +++ b/src/Spinner/index.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; +import { SpinnerProps as BaseSpinnerProps } from 'react-bootstrap/Spinner'; + +export interface SpinnerProps extends BaseSpinnerProps { + className?: string; + screenReaderText?: React.ReactNode; +} + +declare const Spinner: React.ForwardRefExoticComponent; + +export default Spinner; diff --git a/src/Stack/index.d.ts b/src/Stack/index.d.ts new file mode 100644 index 0000000000..ee0c6a0c6b --- /dev/null +++ b/src/Stack/index.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; + +export interface StackProps extends React.HTMLAttributes { + children: React.ReactNode; + direction?: 'horizontal' | 'vertical'; + gap?: number; + className?: string; +} + +declare const Stack: React.ForwardRefExoticComponent; + +export default Stack; diff --git a/src/StatefulButton/index.d.ts b/src/StatefulButton/index.d.ts new file mode 100644 index 0000000000..58b4d86676 --- /dev/null +++ b/src/StatefulButton/index.d.ts @@ -0,0 +1,21 @@ +import React from 'react'; + +export type StatefulButtonState = 'default' | 'pending' | 'complete' | 'error'; + +export type DefaultValuesForLabelsAndIcons = { + default: React.ReactNode; + [key: string]: React.ReactNode; +}; + +export interface StatefulButtonProps extends React.ButtonHTMLAttributes { + className?: string; + state?: StatefulButtonState; + labels: DefaultValuesForLabelsAndIcons; + icons?: DefaultValuesForLabelsAndIcons; + disabledStates?: StatefulButtonState[]; + onClick?: (e: React.MouseEvent) => void; +} + +declare const StatefulButton: React.FC; + +export default StatefulButton; diff --git a/src/Stepper/Stepper.Step.d.ts b/src/Stepper/Stepper.Step.d.ts new file mode 100644 index 0000000000..9f461953a5 --- /dev/null +++ b/src/Stepper/Stepper.Step.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; + +export interface StepperStepProps { + children: React.ReactNode; + className?: string; + eventKey: string; + title: string; + description?: string; + hasError?: boolean; + index?: number; +} + +export default function StepperStep(props: StepperStepProps): JSX.Element; diff --git a/src/Stepper/Stepper.d.ts b/src/Stepper/Stepper.d.ts new file mode 100644 index 0000000000..4a5653d204 --- /dev/null +++ b/src/Stepper/Stepper.d.ts @@ -0,0 +1,20 @@ +import React from 'react'; +import { StepperStepProps } from './Stepper.Step'; +import { StepperHeaderProps } from './StepperHeader'; +import { StepperActionRowProps } from './StepperActionRow'; +import ActionRow from '../ActionRow'; + +export interface StepperTypes { + children: React.ReactNode; + activeKey: string; +} + +declare const Stepper: React.FC & { + Step: React.FC; + Header: React.FC; + ActionRow: React.FC & { + Spacer: typeof ActionRow.Spacer; + }; +}; + +export default Stepper; diff --git a/src/Stepper/StepperActionRow.d.ts b/src/Stepper/StepperActionRow.d.ts new file mode 100644 index 0000000000..a5ffc3b71a --- /dev/null +++ b/src/Stepper/StepperActionRow.d.ts @@ -0,0 +1,11 @@ +import React from 'react'; +import { BsPrefixProps } from 'react-bootstrap/helpers'; + +export interface StepperActionRowProps extends BsPrefixProps { + children: React.ReactNode; + eventKey: string; +} + +declare const StepperActionRow: React.FC; + +export default StepperActionRow; diff --git a/src/Stepper/StepperContext.d.ts b/src/Stepper/StepperContext.d.ts new file mode 100644 index 0000000000..21f72f9a31 --- /dev/null +++ b/src/Stepper/StepperContext.d.ts @@ -0,0 +1,15 @@ +import React from 'react'; + +export interface StepperStepProps { + children: React.ReactNode; + eventKey: string; + index?: number; + onClick?: (eventKey: string) => void; + active?: boolean; + complete?: boolean; + disabled?: boolean; +} + +declare const StepperStep: React.FC; + +export default StepperStep; diff --git a/src/Stepper/StepperHeader.d.ts b/src/Stepper/StepperHeader.d.ts new file mode 100644 index 0000000000..4d02d10d8f --- /dev/null +++ b/src/Stepper/StepperHeader.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; +import { StepperHeaderStepProps } from './StepperHeaderStep'; + +export interface StepperHeaderProps { + className?: string; + PageCountComponent?: keyof JSX.IntrinsicElements; +} + +declare const StepperHeader: React.FC & { + Step: React.FC; +}; + +export default StepperHeader; diff --git a/src/Stepper/StepperHeaderStep.d.ts b/src/Stepper/StepperHeaderStep.d.ts new file mode 100644 index 0000000000..4a9d5bb845 --- /dev/null +++ b/src/Stepper/StepperHeaderStep.d.ts @@ -0,0 +1,13 @@ +import React from 'react'; + +export interface StepperHeaderStepProps { + eventKey: string; + title: string; + isActive?: boolean; + description?: string; + index?: number; +} + +declare const StepperHeaderStep: React.FC; + +export default StepperHeaderStep; diff --git a/src/Sticky/index.d.ts b/src/Sticky/index.d.ts new file mode 100644 index 0000000000..75ba7891cf --- /dev/null +++ b/src/Sticky/index.d.ts @@ -0,0 +1,12 @@ +import React from 'react'; + +export interface StickyProps { + children: React.ReactNode; + position?: 'top' | 'bottom'; + offset?: number | string; + className?: string; +} + +declare const Sticky: React.ForwardRefExoticComponent; + +export default Sticky; diff --git a/src/Tabs/index.d.ts b/src/Tabs/index.d.ts new file mode 100644 index 0000000000..01c0fa9417 --- /dev/null +++ b/src/Tabs/index.d.ts @@ -0,0 +1,21 @@ +import React from 'react'; + +export interface TabsProps extends React.ButtonHTMLAttributes { + children: React.ReactNode; + className?: string; + moreTabText?: string; + defaultActiveKey?: string; + activeKey?: string; +} + +export interface TabProps extends React.ButtonHTMLAttributes { + title: React.ReactNode; + notification?: React.ReactNode; + disabled?: boolean; + eventKey?: string | number; + tabClassName?: string; +} + +export default function Tabs(props: TabsProps): JSX.Element; + +export declare function Tab(props: TabProps): JSX.Element; diff --git a/src/Toast/ToastContainer.d.ts b/src/Toast/ToastContainer.d.ts new file mode 100644 index 0000000000..0ec335128c --- /dev/null +++ b/src/Toast/ToastContainer.d.ts @@ -0,0 +1,9 @@ +import React from 'react'; + +export interface ToastContainerProps { + children: React.ReactNode; +} + +declare class ToastContainer extends React.Component {} + +export default ToastContainer; diff --git a/src/Toast/index.d.ts b/src/Toast/index.d.ts new file mode 100644 index 0000000000..b9d97a293d --- /dev/null +++ b/src/Toast/index.d.ts @@ -0,0 +1,16 @@ +import { ToastProps as BaseToastProps } from 'react-bootstrap/Toast'; + +export interface ToastProps extends BaseToastProps { + children: string; + action?: { + label: string; + href?: string; + onClick?: () => void; + }; + closeLabel?: string; + className?: string; +} + +declare function Toast(props: ToastProps): JSX.Element; + +export default Toast; diff --git a/src/Tooltip/index.d.ts b/src/Tooltip/index.d.ts new file mode 100644 index 0000000000..fc99e59fec --- /dev/null +++ b/src/Tooltip/index.d.ts @@ -0,0 +1,14 @@ +import React from 'react'; +import { TooltipProps as BaseTooltipProps } from 'react-bootstrap/Tooltip'; + +export interface TooltipProps extends BaseTooltipProps { + popper?: object; + children?: React.ReactNode; + className?: string; + variant?: string; + bsPrefix?: string; +} + +declare const Tooltip: React.FC; + +export default Tooltip; diff --git a/src/TransitionReplace/index.d.ts b/src/TransitionReplace/index.d.ts new file mode 100644 index 0000000000..001bc4df06 --- /dev/null +++ b/src/TransitionReplace/index.d.ts @@ -0,0 +1,25 @@ +import React from 'react'; + +export interface TransitionReplaceProps { + children?: React.ReactElement; + enterDuration?: number; + exitDuration?: number; + className?: string; + onChildEnter?: (node: HTMLElement) => void; + onChildEntering?: (node: HTMLElement) => void; + onChildEntered?: (node: HTMLElement) => void; + onChildExit?: (node: HTMLElement) => void; + onChildExiting?: (node: HTMLElement) => void; + onChildExited?: (node: HTMLElement) => void; + transitionClassNames?: string; + transitionStyles?: { + entering?: React.CSSProperties; + entered?: React.CSSProperties; + exiting?: React.CSSProperties; + exited?: React.CSSProperties; + }; +} + +declare class TransitionReplace extends React.Component {} + +export default TransitionReplace; diff --git a/src/Truncate/index.d.ts b/src/Truncate/index.d.ts new file mode 100644 index 0000000000..add29cf162 --- /dev/null +++ b/src/Truncate/index.d.ts @@ -0,0 +1,15 @@ +import React from 'react'; + +export interface TruncateProps { + children: string; + lines?: string | number; + ellipsis?: string | number | React.ReactNode; + whiteSpace?: boolean; + elementType?: string; + className?: string; + onTruncate?: (truncated: HTMLElement[]) => void; +} + +declare const Truncate: React.FC; + +export default Truncate; diff --git a/src/hooks/useArrowKeyNavigation.d.ts b/src/hooks/useArrowKeyNavigation.d.ts new file mode 100644 index 0000000000..8b8083e65b --- /dev/null +++ b/src/hooks/useArrowKeyNavigation.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; + +export type UseArrowKeyNavigationProps = { + selectors?: string; + ignoredKeys?: string[]; +}; + +export default function useArrowKeyNavigation(props?: UseArrowKeyNavigationProps): React.RefObject; diff --git a/src/hooks/useIndexOfLastVisibleChild.d.ts b/src/hooks/useIndexOfLastVisibleChild.d.ts new file mode 100644 index 0000000000..0d2da8795c --- /dev/null +++ b/src/hooks/useIndexOfLastVisibleChild.d.ts @@ -0,0 +1,8 @@ +import React from 'react'; + +declare const useIndexOfLastVisibleChild: ( + containerElementRef: React.RefObject, + overflowElementRef?: React.RefObject +) => number; + +export default useIndexOfLastVisibleChild; diff --git a/src/hooks/useIsVisible.d.ts b/src/hooks/useIsVisible.d.ts new file mode 100644 index 0000000000..604f9e69da --- /dev/null +++ b/src/hooks/useIsVisible.d.ts @@ -0,0 +1,5 @@ +import React from 'react'; + +declare const useIsVisible: (defaultIsVisible?: boolean) => [boolean, React.RefObject]; + +export default useIsVisible; diff --git a/src/hooks/useToggle.d.ts b/src/hooks/useToggle.d.ts new file mode 100644 index 0000000000..71cf5ea91e --- /dev/null +++ b/src/hooks/useToggle.d.ts @@ -0,0 +1,17 @@ +export type HandlersTypes = { + handleToggleOn?: () => void; + handleToggleOff?: () => void; + handleToggle?: (isOn: boolean) => void; +}; + +export type UseToggleReturnTypes = [ + isOn: boolean, + setOn: () => void, + setOff: () => void, + toggle: () => void +]; + +export default function useToggle( + defaultIsOn?: boolean, + handlers?: HandlersTypes +): UseToggleReturnTypes; diff --git a/src/hooks/useWindowSize.d.ts b/src/hooks/useWindowSize.d.ts new file mode 100644 index 0000000000..21d926e8fa --- /dev/null +++ b/src/hooks/useWindowSize.d.ts @@ -0,0 +1,8 @@ +export interface WindowSizeTypes { + width?: number; + height?: number; +} + +declare function useWindowSize(): WindowSizeTypes; + +export default useWindowSize;