1 | import * as React from 'react';
|
2 | import { SxProps } from '@mui/system';
|
3 | import { TypographyProps } from '../Typography';
|
4 | import { OverridableComponent, OverrideProps } from '../OverridableComponent';
|
5 | import { Theme } from '..';
|
6 | import { CardHeaderClasses } from './cardHeaderClasses';
|
7 |
|
8 | export interface CardHeaderOwnProps<
|
9 | TitleTypographyComponent extends React.ElementType = 'span',
|
10 | SubheaderTypographyComponent extends React.ElementType = 'span',
|
11 | > {
|
12 | |
13 |
|
14 |
|
15 | action?: React.ReactNode;
|
16 | |
17 |
|
18 |
|
19 | avatar?: React.ReactNode;
|
20 | |
21 |
|
22 |
|
23 | classes?: Partial<CardHeaderClasses>;
|
24 | |
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 | disableTypography?: boolean;
|
32 | |
33 |
|
34 |
|
35 | subheader?: React.ReactNode;
|
36 | |
37 |
|
38 |
|
39 |
|
40 | subheaderTypographyProps?: TypographyProps<
|
41 | SubheaderTypographyComponent,
|
42 | {
|
43 | component?: SubheaderTypographyComponent;
|
44 | }
|
45 | >;
|
46 | |
47 |
|
48 |
|
49 | sx?: SxProps<Theme>;
|
50 | |
51 |
|
52 |
|
53 | title?: React.ReactNode;
|
54 | |
55 |
|
56 |
|
57 |
|
58 | titleTypographyProps?: TypographyProps<
|
59 | TitleTypographyComponent,
|
60 | {
|
61 | component?: TitleTypographyComponent;
|
62 | }
|
63 | >;
|
64 | }
|
65 |
|
66 | export interface CardHeaderTypeMap<
|
67 | AdditionalProps = {},
|
68 | RootComponent extends React.ElementType = 'div',
|
69 | TitleTypographyComponent extends React.ElementType = 'span',
|
70 | SubheaderTypographyComponent extends React.ElementType = 'span',
|
71 | > {
|
72 | props: AdditionalProps &
|
73 | CardHeaderOwnProps<TitleTypographyComponent, SubheaderTypographyComponent>;
|
74 | defaultComponent: RootComponent;
|
75 | }
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 | declare const CardHeader: OverridableCardHeader;
|
87 |
|
88 | export interface OverridableCardHeader extends OverridableComponent<CardHeaderTypeMap> {
|
89 | <
|
90 | RootComponent extends React.ElementType = CardHeaderTypeMap['defaultComponent'],
|
91 | AdditionalProps = {},
|
92 | TitleTypographyComponent extends React.ElementType = 'span',
|
93 | SubheaderTypographyComponent extends React.ElementType = 'span',
|
94 | >(
|
95 | props: CardHeaderPropsWithComponent<
|
96 | RootComponent,
|
97 | AdditionalProps,
|
98 | TitleTypographyComponent,
|
99 | SubheaderTypographyComponent
|
100 | >,
|
101 | ): React.JSX.Element;
|
102 | }
|
103 |
|
104 | export type CardHeaderProps<
|
105 | RootComponent extends React.ElementType = CardHeaderTypeMap['defaultComponent'],
|
106 | AdditionalProps = {},
|
107 | TitleTypographyComponent extends React.ElementType = 'span',
|
108 | SubheaderTypographyComponent extends React.ElementType = 'span',
|
109 | > = OverrideProps<
|
110 | CardHeaderTypeMap<
|
111 | AdditionalProps,
|
112 | RootComponent,
|
113 | TitleTypographyComponent,
|
114 | SubheaderTypographyComponent
|
115 | >,
|
116 | RootComponent
|
117 | >;
|
118 |
|
119 | export type CardHeaderPropsWithComponent<
|
120 | RootComponent extends React.ElementType = CardHeaderTypeMap['defaultComponent'],
|
121 | AdditionalProps = {},
|
122 | TitleTypographyComponent extends React.ElementType = 'span',
|
123 | SubheaderTypographyComponent extends React.ElementType = 'span',
|
124 | > = {
|
125 | |
126 |
|
127 |
|
128 |
|
129 | component?: RootComponent;
|
130 | } & CardHeaderProps<
|
131 | RootComponent,
|
132 | AdditionalProps,
|
133 | TitleTypographyComponent,
|
134 | SubheaderTypographyComponent
|
135 | >;
|
136 |
|
137 | export default CardHeader;
|