mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-07 16:19:02 +02:00
c0c3bfe185
GitOrigin-RevId: 5dd6b490a6f597892b47a89aabce748cea3e3bc6
61 lines
1.0 KiB
TypeScript
61 lines
1.0 KiB
TypeScript
import { forwardRef, ReactNode } from 'react'
|
|
import { Button, ButtonProps } from 'react-bootstrap'
|
|
|
|
type DSButtonProps = Pick<
|
|
ButtonProps,
|
|
| 'children'
|
|
| 'disabled'
|
|
| 'href'
|
|
| 'id'
|
|
| 'target'
|
|
| 'rel'
|
|
| 'onClick'
|
|
| 'onMouseDown'
|
|
| 'onMouseOver'
|
|
| 'onMouseOut'
|
|
| 'onFocus'
|
|
| 'onBlur'
|
|
| 'size'
|
|
| 'active'
|
|
| 'type'
|
|
> & {
|
|
leadingIcon?: ReactNode
|
|
trailingIcon?: ReactNode
|
|
variant?: 'primary' | 'secondary' | 'tertiary' | 'danger'
|
|
}
|
|
|
|
const DSButton = forwardRef<HTMLButtonElement, DSButtonProps>(
|
|
(
|
|
{
|
|
children,
|
|
leadingIcon,
|
|
trailingIcon,
|
|
variant = 'primary',
|
|
size,
|
|
...props
|
|
},
|
|
ref
|
|
) => {
|
|
return (
|
|
<Button
|
|
className="d-inline-grid btn-ds"
|
|
variant={variant}
|
|
size={size}
|
|
{...props}
|
|
ref={ref}
|
|
role={undefined}
|
|
>
|
|
<span className="button-content">
|
|
{leadingIcon}
|
|
{children}
|
|
{trailingIcon}
|
|
</span>
|
|
</Button>
|
|
)
|
|
}
|
|
)
|
|
|
|
DSButton.displayName = 'DSButton'
|
|
|
|
export default DSButton
|