UNPKG

1.88 kBTypeScriptView Raw
1import * as React from 'react';
2import { StandardProps, PropTypes } from '..';
3import { OverrideProps, OverridableTypeMap, OverridableComponent } from '../OverridableComponent';
4import { Variant as ThemeVariant } from '../styles/createTypography';
5
6type Variant = ThemeVariant | 'srOnly';
7
8export interface TypographyTypeMap<P = {}, D extends React.ElementType = 'span'> {
9 props: P & {
10 align?: PropTypes.Alignment;
11 /**
12 * The content of the component.
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 * Demos:
37 *
38 * - [Breadcrumbs](https://mui.com/components/breadcrumbs/)
39 * - [Typography](https://mui.com/components/typography/)
40 *
41 * API:
42 *
43 * - [Typography API](https://mui.com/api/typography/)
44 */
45declare const Typography: OverridableComponent<TypographyTypeMap>;
46
47export type TypographyProps<
48 D extends React.ElementType = TypographyTypeMap['defaultComponent'],
49 P = {}
50> = OverrideProps<TypographyTypeMap<P, D>, D>;
51
52export 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
84export default Typography;