web: remove duplicate as props in Wildcard (#30164)

This commit is contained in:
Tom Ross 2022-01-25 11:03:10 +00:00 committed by GitHub
parent 78aa6b5765
commit 14ca0d7f7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 7 additions and 45 deletions

View File

@ -9,7 +9,6 @@ import { getAlertStyle } from './utils'
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
variant?: typeof ALERT_VARIANTS[number]
as?: React.ElementType
}
export const Alert = React.forwardRef(

View File

@ -21,13 +21,6 @@ export interface ButtonProps
* Modifies the button style to have a transparent/light background and a more pronounced outline.
*/
outline?: boolean
/**
* Used to change the element that is rendered.
* Useful if needing to style a link as a button, or in certain cases where a different element is required.
* Always be mindful of potentially accessibiliy pitfalls when using this!
* Note: This component assumes `HTMLButtonElement` types, providing a different component here will change the potential types that can be passed to this component.
*/
as?: React.ElementType
}
/**

View File

@ -7,7 +7,7 @@ import { BUTTON_VARIANTS } from '../constants'
import styles from './ButtonVariants.module.scss'
interface ButtonVariantsProps extends Pick<ButtonProps, 'size' | 'outline' | 'as'> {
interface ButtonVariantsProps extends Pick<ButtonProps, 'size' | 'outline'> {
variants: readonly typeof BUTTON_VARIANTS[number][]
icon?: React.ComponentType<{ className?: string }>
}

View File

@ -5,12 +5,7 @@ import { ForwardReferenceComponent } from '../../..'
import styles from './CardBody.module.scss'
interface CardBodyProps {
/**
* Used to change the element that is rendered.
*/
as?: React.ElementType
}
interface CardBodyProps {}
export const CardBody = React.forwardRef(({ as: Component = 'div', children, className, ...attributes }, reference) => (
<Component ref={reference} className={classNames(styles.cardBody, className)} {...attributes}>

View File

@ -5,12 +5,7 @@ import { ForwardReferenceComponent } from '../../..'
import styles from './CardHeader.module.scss'
interface CardHeaderProps {
/**
* Used to change the element that is rendered.
*/
as?: React.ElementType
}
interface CardHeaderProps {}
export const CardHeader = React.forwardRef(
({ as: Component = 'div', children, className, ...attributes }, reference) => (

View File

@ -5,12 +5,7 @@ import { ForwardReferenceComponent } from '../../..'
import styles from './CardList.module.scss'
interface CardListProps {
/**
* Used to change the element that is rendered.
*/
as?: React.ElementType
}
interface CardListProps {}
export const CardList = React.forwardRef(({ as: Component = 'div', children, className, ...attributes }, reference) => (
<Component ref={reference} className={classNames(styles.listGroup, className)} {...attributes}>

View File

@ -5,12 +5,7 @@ import { ForwardReferenceComponent } from '../../..'
import styles from './CardSubtitle.module.scss'
interface CardSubtitleProps {
/**
* Used to change the element that is rendered.
*/
as?: React.ElementType
}
interface CardSubtitleProps {}
export const CardSubtitle = React.forwardRef(
({ as: Component = 'div', children, className, ...attributes }, reference) => (

View File

@ -5,12 +5,7 @@ import { ForwardReferenceComponent } from '../../..'
import styles from './CardText.module.scss'
interface CardTextProps {
/**
* Used to change the element that is rendered.
*/
as?: React.ElementType
}
interface CardTextProps {}
export const CardText = React.forwardRef(({ as: Component = 'p', children, className, ...attributes }, reference) => (
<Component ref={reference} className={classNames(styles.cardText, className)} {...attributes}>

View File

@ -5,12 +5,7 @@ import { ForwardReferenceComponent } from '../../..'
import styles from './CardTitle.module.scss'
interface CardTitleProps {
/**
* Used to change the element that is rendered.
*/
as?: React.ElementType
}
interface CardTitleProps {}
export const CardTitle = React.forwardRef(({ as: Component = 'h3', children, className, ...attributes }, reference) => (
<Component ref={reference} className={classNames(styles.cardTitle, className)} {...attributes}>