1 | import * as React from 'react';
|
2 | import { StandardProps, PropTypes } from '..';
|
3 | import { OverrideProps, OverridableTypeMap, OverridableComponent } from '../OverridableComponent';
|
4 | import { Variant as ThemeVariant } from '../styles/createTypography';
|
5 |
|
6 | type Variant = ThemeVariant | 'srOnly';
|
7 |
|
8 | export interface TypographyTypeMap<P = {}, D extends React.ElementType = 'span'> {
|
9 | props: P & {
|
10 | align?: PropTypes.Alignment;
|
11 | |
12 |
|
13 |
|
14 | children?: React.ReactNode;
|
15 | color?:
|
16 | | 'initial'
|
17 | | 'inherit'
|
18 | | 'primary'
|
19 | | 'secondary'
|
20 | | 'textPrimary'
|
21 | | 'textSecondary'
|
22 | | 'error';
|
23 | display?: 'initial' | 'block' | 'inline';
|
24 | gutterBottom?: boolean;
|
25 | noWrap?: boolean;
|
26 | paragraph?: boolean;
|
27 | variant?: Variant | 'inherit';
|
28 | variantMapping?: Partial<Record<Variant, string>>;
|
29 | };
|
30 | defaultComponent: D;
|
31 | classKey: TypographyClassKey;
|
32 | }
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | declare const Typography: OverridableComponent<TypographyTypeMap>;
|
46 |
|
47 | export type TypographyProps<
|
48 | D extends React.ElementType = TypographyTypeMap['defaultComponent'],
|
49 | P = {}
|
50 | > = OverrideProps<TypographyTypeMap<P, D>, D>;
|
51 |
|
52 | export type TypographyClassKey =
|
53 | | 'root'
|
54 | | 'h1'
|
55 | | 'h2'
|
56 | | 'h3'
|
57 | | 'h4'
|
58 | | 'h5'
|
59 | | 'h6'
|
60 | | 'subtitle1'
|
61 | | 'subtitle2'
|
62 | | 'body1'
|
63 | | 'body2'
|
64 | | 'caption'
|
65 | | 'button'
|
66 | | 'overline'
|
67 | | 'srOnly'
|
68 | | 'alignLeft'
|
69 | | 'alignCenter'
|
70 | | 'alignRight'
|
71 | | 'alignJustify'
|
72 | | 'noWrap'
|
73 | | 'gutterBottom'
|
74 | | 'paragraph'
|
75 | | 'colorInherit'
|
76 | | 'colorPrimary'
|
77 | | 'colorSecondary'
|
78 | | 'colorTextPrimary'
|
79 | | 'colorTextSecondary'
|
80 | | 'colorError'
|
81 | | 'displayInline'
|
82 | | 'displayBlock';
|
83 |
|
84 | export default Typography;
|