UNPKG

980 BTypeScriptView Raw
1import * as React from 'react';
2
3import SafeAnchor, { SafeAnchorProps } from './SafeAnchor';
4
5import { BsPrefixComponent, BsPrefixComponentClass } from './helpers';
6
7export class AlertLink<
8 // Need to use BsPrefixComponentClass to get proper type checking.
9 As extends React.ElementType = BsPrefixComponentClass<'a', SafeAnchorProps>
10> extends BsPrefixComponent<As> {}
11
12export class AlertHeading<
13 As extends React.ElementType = 'div'
14> extends BsPrefixComponent<As> {}
15
16export interface AlertProps extends React.HTMLProps<HTMLDivElement> {
17 bsPrefix?: string;
18 variant?:
19 | 'primary'
20 | 'secondary'
21 | 'success'
22 | 'danger'
23 | 'warning'
24 | 'info'
25 | 'dark'
26 | 'light';
27 dismissible?: boolean;
28 show?: boolean;
29 onClose?: () => void;
30 closeLabel?: string;
31 transition?: React.ElementType;
32}
33
34declare const Alert: React.ForwardRefExoticComponent<AlertProps> & {
35 Link: typeof AlertLink;
36 Heading: typeof AlertHeading;
37};
38
39export default Alert;