UNPKG

1.01 kBTypeScriptView Raw
1import * as React from 'react';
2import {
3 borders,
4 ComposedStyleFunction,
5 display,
6 flexbox,
7 grid,
8 palette,
9 positions,
10 shadows,
11 sizing,
12 spacing,
13 typography,
14 PropsFor,
15} from '@material-ui/system';
16import { Omit } from '..';
17
18type BoxStyleFunction = ComposedStyleFunction<
19 [
20 typeof borders,
21 typeof display,
22 typeof flexbox,
23 typeof grid,
24 typeof palette,
25 typeof positions,
26 typeof shadows,
27 typeof sizing,
28 typeof spacing,
29 typeof typography
30 ]
31>;
32
33type SystemProps = PropsFor<BoxStyleFunction>;
34type ElementProps = Omit<React.HTMLAttributes<HTMLElement>, keyof SystemProps>;
35
36export interface BoxProps extends ElementProps, SystemProps {
37 // styled API
38 component?: React.ElementType;
39 clone?: boolean;
40 /**
41 * @deprecated
42 * Use the `sx` prop instead
43 */
44 css?: SystemProps;
45 // workaround for https://github.com/mui-org/material-ui/pull/15611
46 sx?: SystemProps;
47}
48
49declare const Box: React.ComponentType<BoxProps>;
50
51export default Box;