1 | import * as React from 'react';
|
2 | import { OverridableComponent, OverrideProps } from '@mui/types';
|
3 | import { SxProps } from '@mui/system';
|
4 | import { Breakpoint, Theme } from '../styles';
|
5 | type ResponsiveStyleValue<T> = T | Array<T | null> | {
|
6 | [key in Breakpoint]?: T | null;
|
7 | };
|
8 | export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
9 | export type GridSpacing = number | string;
|
10 | export type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
11 | export type GridSize = 'auto' | 'grow' | number;
|
12 | export interface GridBaseProps {
|
13 | |
14 |
|
15 |
|
16 | children?: React.ReactNode;
|
17 | |
18 |
|
19 |
|
20 |
|
21 | columns?: ResponsiveStyleValue<number>;
|
22 | |
23 |
|
24 |
|
25 |
|
26 | columnSpacing?: ResponsiveStyleValue<GridSpacing>;
|
27 | |
28 |
|
29 |
|
30 |
|
31 |
|
32 | container?: boolean;
|
33 | |
34 |
|
35 |
|
36 |
|
37 |
|
38 | direction?: ResponsiveStyleValue<GridDirection>;
|
39 | |
40 |
|
41 |
|
42 | offset?: ResponsiveStyleValue<number> | undefined;
|
43 | |
44 |
|
45 |
|
46 |
|
47 | rowSpacing?: ResponsiveStyleValue<GridSpacing>;
|
48 | |
49 |
|
50 |
|
51 |
|
52 |
|
53 | spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
|
54 | |
55 |
|
56 |
|
57 | size?: ResponsiveStyleValue<GridSize> | undefined;
|
58 | |
59 |
|
60 |
|
61 |
|
62 |
|
63 | wrap?: GridWrap;
|
64 | }
|
65 | export interface GridTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
|
66 | props: AdditionalProps & GridBaseProps & {
|
67 | sx?: SxProps<Theme>;
|
68 | };
|
69 | defaultComponent: DefaultComponent;
|
70 | }
|
71 | export type GridProps<RootComponent extends React.ElementType = GridTypeMap['defaultComponent'], AdditionalProps = {
|
72 | component?: React.ElementType;
|
73 | }> = OverrideProps<GridTypeMap<AdditionalProps, RootComponent>, RootComponent>;
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | declare const PigmentGrid: OverridableComponent<GridTypeMap>;
|
85 | export default PigmentGrid;
|