UNPKG

2.04 kBTypeScriptView Raw
1import * as React from 'react';
2import { SxProps } from '@mui/system';
3import { OverridableStringUnion } from '@mui/types';
4import { Theme } from '../styles';
5import { OverrideProps, OverridableComponent, OverridableTypeMap } from '../OverridableComponent';
6import { PaperClasses } from './paperClasses';
7
8export interface PaperPropsVariantOverrides {}
9
10export interface PaperOwnProps {
11 /**
12 * The content of the component.
13 */
14 children?: React.ReactNode;
15 /**
16 * Override or extend the styles applied to the component.
17 */
18 classes?: Partial<PaperClasses>;
19 /**
20 * Shadow depth, corresponds to `dp` in the spec.
21 * It accepts values between 0 and 24 inclusive.
22 * @default 1
23 */
24 elevation?: number;
25 /**
26 * If `true`, rounded corners are disabled.
27 * @default false
28 */
29 square?: boolean;
30 /**
31 * The system prop that allows defining system overrides as well as additional CSS styles.
32 */
33 sx?: SxProps<Theme>;
34 /**
35 * The variant to use.
36 * @default 'elevation'
37 */
38 variant?: OverridableStringUnion<'elevation' | 'outlined', PaperPropsVariantOverrides>;
39}
40
41export interface PaperTypeMap<
42 AdditionalProps = {},
43 RootComponent extends React.ElementType = 'div',
44> {
45 props: AdditionalProps & PaperOwnProps;
46 defaultComponent: RootComponent;
47}
48
49/**
50 *
51 * Demos:
52 *
53 * - [Card](https://mui.com/material-ui/react-card/)
54 * - [Paper](https://mui.com/material-ui/react-paper/)
55 *
56 * API:
57 *
58 * - [Paper API](https://mui.com/material-ui/api/paper/)
59 */
60declare const Paper: OverridableComponent<PaperTypeMap>;
61
62export interface ExtendPaperTypeMap<TypeMap extends OverridableTypeMap, Keys extends string = ''> {
63 props: TypeMap['props'] & Omit<PaperTypeMap['props'], Keys>;
64 defaultComponent: TypeMap['defaultComponent'];
65}
66
67export type PaperProps<
68 RootComponent extends React.ElementType = PaperTypeMap['defaultComponent'],
69 AdditionalProps = {},
70> = OverrideProps<PaperTypeMap<AdditionalProps, RootComponent>, RootComponent> & {
71 component?: React.ElementType;
72};
73
74export default Paper;