From 63d9f73ab288d64363b1ea17e602a2c3175d0c9a Mon Sep 17 00:00:00 2001 From: Ryan Lee Date: Tue, 12 Jul 2022 10:22:01 +0100 Subject: [PATCH] Ensure Consistent API for custom varients --- src/CardImg.tsx | 2 +- src/Carousel.tsx | 2 +- src/CloseButton.tsx | 2 +- src/ListGroup.tsx | 2 +- src/Nav.tsx | 2 +- src/Navbar.tsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CardImg.tsx b/src/CardImg.tsx index 5836ef52cf..1f55cf6329 100644 --- a/src/CardImg.tsx +++ b/src/CardImg.tsx @@ -8,7 +8,7 @@ import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers'; export interface CardImgProps extends BsPrefixProps, React.ImgHTMLAttributes { - variant?: 'top' | 'bottom'; + variant?: 'top' | 'bottom' | string; } const propTypes = { diff --git a/src/Carousel.tsx b/src/Carousel.tsx index feda64dcc4..5b396841e6 100644 --- a/src/Carousel.tsx +++ b/src/Carousel.tsx @@ -25,7 +25,7 @@ import triggerBrowserReflow from './triggerBrowserReflow'; import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers'; import TransitionWrapper from './TransitionWrapper'; -export type CarouselVariant = 'dark'; +export type CarouselVariant = 'dark' | string; export interface CarouselRef { element?: HTMLElement; diff --git a/src/CloseButton.tsx b/src/CloseButton.tsx index b50433f1a7..c71ba98df9 100644 --- a/src/CloseButton.tsx +++ b/src/CloseButton.tsx @@ -2,7 +2,7 @@ import PropTypes from 'prop-types'; import * as React from 'react'; import classNames from 'classnames'; -export type CloseButtonVariant = 'white'; +export type CloseButtonVariant = 'white' | string; export interface CloseButtonProps extends React.ButtonHTMLAttributes { diff --git a/src/ListGroup.tsx b/src/ListGroup.tsx index dacfbd8cee..0722b354d8 100644 --- a/src/ListGroup.tsx +++ b/src/ListGroup.tsx @@ -10,7 +10,7 @@ import ListGroupItem from './ListGroupItem'; import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers'; export interface ListGroupProps extends BsPrefixProps, BaseNavProps { - variant?: 'flush'; + variant?: 'flush' | string; horizontal?: boolean | string | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'; defaultActiveKey?: EventKey; numbered?: boolean; diff --git a/src/Nav.tsx b/src/Nav.tsx index 2a2caeb963..9a6f0ea249 100644 --- a/src/Nav.tsx +++ b/src/Nav.tsx @@ -17,7 +17,7 @@ import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers'; export interface NavProps extends BsPrefixProps, BaseNavProps { navbarBsPrefix?: string; cardHeaderBsPrefix?: string; - variant?: 'tabs' | 'pills'; + variant?: 'tabs' | 'pills' | string; defaultActiveKey?: EventKey; fill?: boolean; justify?: boolean; diff --git a/src/Navbar.tsx b/src/Navbar.tsx index aa48544691..8e4ea5bd7d 100644 --- a/src/Navbar.tsx +++ b/src/Navbar.tsx @@ -22,7 +22,7 @@ const NavbarText = createWithBsPrefix('navbar-text', { export interface NavbarProps extends BsPrefixProps, Omit, 'onSelect'> { - variant?: 'light' | 'dark'; + variant?: 'light' | 'dark' | string; expand?: boolean | string | 'sm' | 'md' | 'lg' | 'xl' | 'xxl'; bg?: string; fixed?: 'top' | 'bottom';