mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 15:12:02 +00:00
web: remove duplicate as props in Wildcard (#30164)
This commit is contained in:
parent
78aa6b5765
commit
14ca0d7f7d
@ -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(
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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 }>
|
||||
}
|
||||
|
||||
@ -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}>
|
||||
|
||||
@ -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) => (
|
||||
|
||||
@ -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}>
|
||||
|
||||
@ -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) => (
|
||||
|
||||
@ -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}>
|
||||
|
||||
@ -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}>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user