@mui/system 5.10.17 → 5.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Box/Box.spec.d.ts +1 -1
- package/CHANGELOG.md +74 -0
- package/Container/Container.d.ts +13 -13
- package/Container/ContainerProps.d.ts +40 -40
- package/Container/containerClasses.d.ts +22 -22
- package/Container/createContainer.d.ts +18 -18
- package/Stack/Stack.d.ts +13 -13
- package/Stack/StackProps.d.ts +42 -42
- package/Stack/createStack.d.ts +21 -21
- package/Stack/index.d.ts +5 -5
- package/Stack/stackClasses.d.ts +8 -8
- package/Unstable_Grid/Grid.d.ts +12 -12
- package/Unstable_Grid/GridProps.d.ts +162 -162
- package/Unstable_Grid/createGrid.d.ts +11 -11
- package/Unstable_Grid/gridClasses.d.ts +20 -20
- package/Unstable_Grid/gridGenerator.d.ts +29 -29
- package/Unstable_Grid/index.d.ts +5 -5
- package/borders.js +12 -7
- package/breakpoints.js +2 -0
- package/compose.js +3 -0
- package/createBox.d.ts +0 -2
- package/createBox.js +2 -3
- package/createBox.spec.d.ts +1 -1
- package/createStyled.js +2 -3
- package/createTheme/createSpacing.d.ts +10 -10
- package/createTheme/createTheme.d.ts +5 -0
- package/createTheme/createTheme.js +9 -0
- package/cssGrid.js +8 -0
- package/cssVars/createCssVarsProvider.spec.d.ts +1 -1
- package/cssVars/createGetCssVar.d.ts +5 -5
- package/cssVars/cssVarsParser.d.ts +63 -63
- package/cssVars/getInitColorSchemeScript.d.ts +42 -42
- package/cssVars/index.d.ts +3 -3
- package/cssVars/useCurrentColorScheme.d.ts +53 -53
- package/esm/borders.js +9 -6
- package/esm/breakpoints.js +2 -0
- package/esm/compose.js +3 -0
- package/esm/createBox.js +2 -3
- package/esm/createStyled.js +2 -3
- package/esm/createTheme/createTheme.js +9 -0
- package/esm/cssGrid.js +9 -0
- package/esm/index.js +1 -2
- package/esm/palette.js +4 -4
- package/esm/sizing.js +9 -9
- package/esm/spacing.js +2 -2
- package/esm/style.js +4 -1
- package/esm/styleFunctionSx/defaultSxConfig.js +284 -0
- package/esm/styleFunctionSx/extendSxProp.js +4 -2
- package/esm/styleFunctionSx/index.js +2 -1
- package/esm/styleFunctionSx/styleFunctionSx.js +45 -17
- package/index.d.ts +1 -2
- package/index.js +8 -9
- package/index.spec.d.ts +1 -1
- package/legacy/borders.js +9 -6
- package/legacy/breakpoints.js +2 -0
- package/legacy/compose.js +3 -0
- package/legacy/createBox.js +2 -4
- package/legacy/createStyled.js +2 -4
- package/legacy/createTheme/createTheme.js +9 -0
- package/legacy/cssGrid.js +9 -0
- package/legacy/index.js +2 -3
- package/legacy/palette.js +4 -4
- package/legacy/sizing.js +9 -9
- package/legacy/spacing.js +2 -2
- package/legacy/style.js +3 -2
- package/legacy/styleFunctionSx/defaultSxConfig.js +286 -0
- package/legacy/styleFunctionSx/extendSxProp.js +4 -2
- package/legacy/styleFunctionSx/index.js +2 -1
- package/legacy/styleFunctionSx/styleFunctionSx.js +44 -20
- package/modern/borders.js +9 -6
- package/modern/breakpoints.js +2 -0
- package/modern/compose.js +3 -0
- package/modern/createBox.js +2 -3
- package/modern/createStyled.js +2 -3
- package/modern/createTheme/createTheme.js +9 -0
- package/modern/cssGrid.js +9 -0
- package/modern/index.js +2 -3
- package/modern/palette.js +4 -4
- package/modern/sizing.js +9 -9
- package/modern/spacing.js +2 -2
- package/modern/style.js +4 -1
- package/modern/styleFunctionSx/defaultSxConfig.js +284 -0
- package/modern/styleFunctionSx/extendSxProp.js +3 -2
- package/modern/styleFunctionSx/index.js +2 -1
- package/modern/styleFunctionSx/styleFunctionSx.js +44 -17
- package/package.json +6 -6
- package/palette.js +5 -4
- package/sizing.js +12 -10
- package/spacing.js +4 -0
- package/style.d.ts +10 -8
- package/style.js +4 -1
- package/styleFunctionSx/defaultSxConfig.d.ts +20 -0
- package/styleFunctionSx/defaultSxConfig.js +291 -0
- package/styleFunctionSx/extendSxProp.js +4 -2
- package/styleFunctionSx/index.d.ts +4 -0
- package/styleFunctionSx/index.js +7 -0
- package/styleFunctionSx/styleFunctionSx.d.ts +2 -1
- package/styleFunctionSx/styleFunctionSx.js +45 -17
- package/styleFunctionSx/styleFunctionSx.spec.d.ts +1 -1
- package/esm/sx/index.js +0 -1
- package/esm/sx/sx.js +0 -10
- package/legacy/sx/index.js +0 -1
- package/legacy/sx/sx.js +0 -11
- package/modern/sx/index.js +0 -1
- package/modern/sx/sx.js +0 -10
- package/sx/index.d.ts +0 -1
- package/sx/index.js +0 -13
- package/sx/package.json +0 -6
- package/sx/sx.d.ts +0 -4
- package/sx/sx.js +0 -18
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { OverrideProps, IfEquals } from '@mui/types';
|
|
3
|
-
import { SxProps } from '../styleFunctionSx';
|
|
4
|
-
import { Theme, Breakpoint, BreakpointOverrides } from '../createTheme';
|
|
5
|
-
import { SystemProps } from '../Box';
|
|
6
|
-
type ResponsiveStyleValue<T> = T | Array<T | null> | {
|
|
7
|
-
[key in Breakpoint]?: T | null;
|
|
8
|
-
};
|
|
9
|
-
export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
10
|
-
export type GridSpacing = number | string;
|
|
11
|
-
export type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
12
|
-
export type GridSize = 'auto' | number;
|
|
13
|
-
export interface GridDefaultBreakpoints {
|
|
14
|
-
/**
|
|
15
|
-
* If a number, it sets the number of columns the grid item uses.
|
|
16
|
-
* It can't be greater than the total number of columns of the container (12 by default).
|
|
17
|
-
* If 'auto', the grid item's width matches its content.
|
|
18
|
-
* If false, the prop is ignored.
|
|
19
|
-
* If true, the grid item's width grows to use the space available in the grid container.
|
|
20
|
-
* The value is applied for the `lg` breakpoint and wider screens if not overridden.
|
|
21
|
-
* @default false
|
|
22
|
-
*/
|
|
23
|
-
lg?: boolean | GridSize;
|
|
24
|
-
/**
|
|
25
|
-
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
26
|
-
* If 'auto', the grid item push itself to the right-end of the container.
|
|
27
|
-
* The value is applied for the `lg` breakpoint and wider screens if not overridden.
|
|
28
|
-
*/
|
|
29
|
-
lgOffset?: GridSize;
|
|
30
|
-
/**
|
|
31
|
-
* If a number, it sets the number of columns the grid item uses.
|
|
32
|
-
* It can't be greater than the total number of columns of the container (12 by default).
|
|
33
|
-
* If 'auto', the grid item's width matches its content.
|
|
34
|
-
* If false, the prop is ignored.
|
|
35
|
-
* If true, the grid item's width grows to use the space available in the grid container.
|
|
36
|
-
* The value is applied for the `md` breakpoint and wider screens if not overridden.
|
|
37
|
-
* @default false
|
|
38
|
-
*/
|
|
39
|
-
md?: boolean | GridSize;
|
|
40
|
-
/**
|
|
41
|
-
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
42
|
-
* If 'auto', the grid item push itself to the right-end of the container.
|
|
43
|
-
* The value is applied for the `md` breakpoint and wider screens if not overridden.
|
|
44
|
-
*/
|
|
45
|
-
mdOffset?: GridSize;
|
|
46
|
-
/**
|
|
47
|
-
* If a number, it sets the number of columns the grid item uses.
|
|
48
|
-
* It can't be greater than the total number of columns of the container (12 by default).
|
|
49
|
-
* If 'auto', the grid item's width matches its content.
|
|
50
|
-
* If false, the prop is ignored.
|
|
51
|
-
* If true, the grid item's width grows to use the space available in the grid container.
|
|
52
|
-
* The value is applied for the `sm` breakpoint and wider screens if not overridden.
|
|
53
|
-
* @default false
|
|
54
|
-
*/
|
|
55
|
-
sm?: boolean | GridSize;
|
|
56
|
-
/**
|
|
57
|
-
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
58
|
-
* If 'auto', the grid item push itself to the right-end of the container.
|
|
59
|
-
* The value is applied for the `sm` breakpoint and wider screens if not overridden.
|
|
60
|
-
*/
|
|
61
|
-
smOffset?: GridSize;
|
|
62
|
-
/**
|
|
63
|
-
* If a number, it sets the number of columns the grid item uses.
|
|
64
|
-
* It can't be greater than the total number of columns of the container (12 by default).
|
|
65
|
-
* If 'auto', the grid item's width matches its content.
|
|
66
|
-
* If false, the prop is ignored.
|
|
67
|
-
* If true, the grid item's width grows to use the space available in the grid container.
|
|
68
|
-
* The value is applied for the `xl` breakpoint and wider screens if not overridden.
|
|
69
|
-
* @default false
|
|
70
|
-
*/
|
|
71
|
-
xl?: boolean | GridSize;
|
|
72
|
-
/**
|
|
73
|
-
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
74
|
-
* If 'auto', the grid item push itself to the right-end of the container.
|
|
75
|
-
* The value is applied for the `xl` breakpoint and wider screens if not overridden.
|
|
76
|
-
*/
|
|
77
|
-
xlOffset?: GridSize;
|
|
78
|
-
/**
|
|
79
|
-
* If a number, it sets the number of columns the grid item uses.
|
|
80
|
-
* It can't be greater than the total number of columns of the container (12 by default).
|
|
81
|
-
* If 'auto', the grid item's width matches its content.
|
|
82
|
-
* If false, the prop is ignored.
|
|
83
|
-
* If true, the grid item's width grows to use the space available in the grid container.
|
|
84
|
-
* The value is applied for all the screen sizes with the lowest priority.
|
|
85
|
-
* @default false
|
|
86
|
-
*/
|
|
87
|
-
xs?: boolean | GridSize;
|
|
88
|
-
/**
|
|
89
|
-
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
90
|
-
* If 'auto', the grid item push itself to the right-end of the container.
|
|
91
|
-
* The value is applied for the `xs` breakpoint and wider screens if not overridden.
|
|
92
|
-
*/
|
|
93
|
-
xsOffset?: GridSize;
|
|
94
|
-
}
|
|
95
|
-
type CustomBreakpoints = Partial<Record<Breakpoint, boolean | GridSize> & Record<`${Breakpoint}Offset`, GridSize>>;
|
|
96
|
-
interface BreakpointOverridesEmpty {
|
|
97
|
-
}
|
|
98
|
-
type Breakpoints = IfEquals<BreakpointOverrides, BreakpointOverridesEmpty, GridDefaultBreakpoints, CustomBreakpoints>;
|
|
99
|
-
export interface GridBaseProps extends Breakpoints {
|
|
100
|
-
/**
|
|
101
|
-
* The content of the component.
|
|
102
|
-
*/
|
|
103
|
-
children?: React.ReactNode;
|
|
104
|
-
/**
|
|
105
|
-
* The number of columns.
|
|
106
|
-
* @default 12
|
|
107
|
-
*/
|
|
108
|
-
columns?: ResponsiveStyleValue<number>;
|
|
109
|
-
/**
|
|
110
|
-
* Defines the horizontal space between the type `item` components.
|
|
111
|
-
* It overrides the value of the `spacing` prop.
|
|
112
|
-
*/
|
|
113
|
-
columnSpacing?: ResponsiveStyleValue<GridSpacing>;
|
|
114
|
-
/**
|
|
115
|
-
* If `true`, the component will have the flex *container* behavior.
|
|
116
|
-
* You should be wrapping *items* with a *container*.
|
|
117
|
-
* @default false
|
|
118
|
-
*/
|
|
119
|
-
container?: boolean;
|
|
120
|
-
/**
|
|
121
|
-
* Defines the `flex-direction` style property.
|
|
122
|
-
* It is applied for all screen sizes.
|
|
123
|
-
* @default 'row'
|
|
124
|
-
*/
|
|
125
|
-
direction?: ResponsiveStyleValue<GridDirection>;
|
|
126
|
-
/**
|
|
127
|
-
* If `true`, the negative margin and padding are apply only to the top and left sides of the grid.
|
|
128
|
-
*/
|
|
129
|
-
disableEqualOverflow?: boolean;
|
|
130
|
-
/**
|
|
131
|
-
* Defines the vertical space between the type `item` components.
|
|
132
|
-
* It overrides the value of the `spacing` prop.
|
|
133
|
-
*/
|
|
134
|
-
rowSpacing?: ResponsiveStyleValue<GridSpacing>;
|
|
135
|
-
/**
|
|
136
|
-
* Defines the space between the type `item` components.
|
|
137
|
-
* It can only be used on a type `container` component.
|
|
138
|
-
* @default 0
|
|
139
|
-
*/
|
|
140
|
-
spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
|
|
141
|
-
/**
|
|
142
|
-
* Defines the `flex-wrap` style property.
|
|
143
|
-
* It's applied for all screen sizes.
|
|
144
|
-
* @default 'wrap'
|
|
145
|
-
*/
|
|
146
|
-
wrap?: GridWrap;
|
|
147
|
-
}
|
|
148
|
-
export interface GridOwnerState extends GridBaseProps {
|
|
149
|
-
nested: boolean;
|
|
150
|
-
gridSize: Partial<Record<Breakpoint, GridSize | boolean>>;
|
|
151
|
-
gridOffset: Partial<Record<Breakpoint, GridSize>>;
|
|
152
|
-
}
|
|
153
|
-
export interface GridTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
154
|
-
props: P & GridBaseProps & {
|
|
155
|
-
sx?: SxProps<Theme>;
|
|
156
|
-
} & SystemProps<Theme>;
|
|
157
|
-
defaultComponent: D;
|
|
158
|
-
}
|
|
159
|
-
export type GridProps<D extends React.ElementType = GridTypeMap['defaultComponent'], P = {
|
|
160
|
-
component?: React.ElementType;
|
|
161
|
-
}> = OverrideProps<GridTypeMap<P, D>, D>;
|
|
162
|
-
export {};
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { OverrideProps, IfEquals } from '@mui/types';
|
|
3
|
+
import { SxProps } from '../styleFunctionSx';
|
|
4
|
+
import { Theme, Breakpoint, BreakpointOverrides } from '../createTheme';
|
|
5
|
+
import { SystemProps } from '../Box';
|
|
6
|
+
type ResponsiveStyleValue<T> = T | Array<T | null> | {
|
|
7
|
+
[key in Breakpoint]?: T | null;
|
|
8
|
+
};
|
|
9
|
+
export type GridDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
10
|
+
export type GridSpacing = number | string;
|
|
11
|
+
export type GridWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
|
|
12
|
+
export type GridSize = 'auto' | number;
|
|
13
|
+
export interface GridDefaultBreakpoints {
|
|
14
|
+
/**
|
|
15
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
16
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
17
|
+
* If 'auto', the grid item's width matches its content.
|
|
18
|
+
* If false, the prop is ignored.
|
|
19
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
20
|
+
* The value is applied for the `lg` breakpoint and wider screens if not overridden.
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
lg?: boolean | GridSize;
|
|
24
|
+
/**
|
|
25
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
26
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
27
|
+
* The value is applied for the `lg` breakpoint and wider screens if not overridden.
|
|
28
|
+
*/
|
|
29
|
+
lgOffset?: GridSize;
|
|
30
|
+
/**
|
|
31
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
32
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
33
|
+
* If 'auto', the grid item's width matches its content.
|
|
34
|
+
* If false, the prop is ignored.
|
|
35
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
36
|
+
* The value is applied for the `md` breakpoint and wider screens if not overridden.
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
md?: boolean | GridSize;
|
|
40
|
+
/**
|
|
41
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
42
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
43
|
+
* The value is applied for the `md` breakpoint and wider screens if not overridden.
|
|
44
|
+
*/
|
|
45
|
+
mdOffset?: GridSize;
|
|
46
|
+
/**
|
|
47
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
48
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
49
|
+
* If 'auto', the grid item's width matches its content.
|
|
50
|
+
* If false, the prop is ignored.
|
|
51
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
52
|
+
* The value is applied for the `sm` breakpoint and wider screens if not overridden.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
sm?: boolean | GridSize;
|
|
56
|
+
/**
|
|
57
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
58
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
59
|
+
* The value is applied for the `sm` breakpoint and wider screens if not overridden.
|
|
60
|
+
*/
|
|
61
|
+
smOffset?: GridSize;
|
|
62
|
+
/**
|
|
63
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
64
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
65
|
+
* If 'auto', the grid item's width matches its content.
|
|
66
|
+
* If false, the prop is ignored.
|
|
67
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
68
|
+
* The value is applied for the `xl` breakpoint and wider screens if not overridden.
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
xl?: boolean | GridSize;
|
|
72
|
+
/**
|
|
73
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
74
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
75
|
+
* The value is applied for the `xl` breakpoint and wider screens if not overridden.
|
|
76
|
+
*/
|
|
77
|
+
xlOffset?: GridSize;
|
|
78
|
+
/**
|
|
79
|
+
* If a number, it sets the number of columns the grid item uses.
|
|
80
|
+
* It can't be greater than the total number of columns of the container (12 by default).
|
|
81
|
+
* If 'auto', the grid item's width matches its content.
|
|
82
|
+
* If false, the prop is ignored.
|
|
83
|
+
* If true, the grid item's width grows to use the space available in the grid container.
|
|
84
|
+
* The value is applied for all the screen sizes with the lowest priority.
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
xs?: boolean | GridSize;
|
|
88
|
+
/**
|
|
89
|
+
* If a number, it sets the margin-left equals to the number of columns the grid item uses.
|
|
90
|
+
* If 'auto', the grid item push itself to the right-end of the container.
|
|
91
|
+
* The value is applied for the `xs` breakpoint and wider screens if not overridden.
|
|
92
|
+
*/
|
|
93
|
+
xsOffset?: GridSize;
|
|
94
|
+
}
|
|
95
|
+
type CustomBreakpoints = Partial<Record<Breakpoint, boolean | GridSize> & Record<`${Breakpoint}Offset`, GridSize>>;
|
|
96
|
+
interface BreakpointOverridesEmpty {
|
|
97
|
+
}
|
|
98
|
+
type Breakpoints = IfEquals<BreakpointOverrides, BreakpointOverridesEmpty, GridDefaultBreakpoints, CustomBreakpoints>;
|
|
99
|
+
export interface GridBaseProps extends Breakpoints {
|
|
100
|
+
/**
|
|
101
|
+
* The content of the component.
|
|
102
|
+
*/
|
|
103
|
+
children?: React.ReactNode;
|
|
104
|
+
/**
|
|
105
|
+
* The number of columns.
|
|
106
|
+
* @default 12
|
|
107
|
+
*/
|
|
108
|
+
columns?: ResponsiveStyleValue<number>;
|
|
109
|
+
/**
|
|
110
|
+
* Defines the horizontal space between the type `item` components.
|
|
111
|
+
* It overrides the value of the `spacing` prop.
|
|
112
|
+
*/
|
|
113
|
+
columnSpacing?: ResponsiveStyleValue<GridSpacing>;
|
|
114
|
+
/**
|
|
115
|
+
* If `true`, the component will have the flex *container* behavior.
|
|
116
|
+
* You should be wrapping *items* with a *container*.
|
|
117
|
+
* @default false
|
|
118
|
+
*/
|
|
119
|
+
container?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Defines the `flex-direction` style property.
|
|
122
|
+
* It is applied for all screen sizes.
|
|
123
|
+
* @default 'row'
|
|
124
|
+
*/
|
|
125
|
+
direction?: ResponsiveStyleValue<GridDirection>;
|
|
126
|
+
/**
|
|
127
|
+
* If `true`, the negative margin and padding are apply only to the top and left sides of the grid.
|
|
128
|
+
*/
|
|
129
|
+
disableEqualOverflow?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Defines the vertical space between the type `item` components.
|
|
132
|
+
* It overrides the value of the `spacing` prop.
|
|
133
|
+
*/
|
|
134
|
+
rowSpacing?: ResponsiveStyleValue<GridSpacing>;
|
|
135
|
+
/**
|
|
136
|
+
* Defines the space between the type `item` components.
|
|
137
|
+
* It can only be used on a type `container` component.
|
|
138
|
+
* @default 0
|
|
139
|
+
*/
|
|
140
|
+
spacing?: ResponsiveStyleValue<GridSpacing> | undefined;
|
|
141
|
+
/**
|
|
142
|
+
* Defines the `flex-wrap` style property.
|
|
143
|
+
* It's applied for all screen sizes.
|
|
144
|
+
* @default 'wrap'
|
|
145
|
+
*/
|
|
146
|
+
wrap?: GridWrap;
|
|
147
|
+
}
|
|
148
|
+
export interface GridOwnerState extends GridBaseProps {
|
|
149
|
+
nested: boolean;
|
|
150
|
+
gridSize: Partial<Record<Breakpoint, GridSize | boolean>>;
|
|
151
|
+
gridOffset: Partial<Record<Breakpoint, GridSize>>;
|
|
152
|
+
}
|
|
153
|
+
export interface GridTypeMap<P = {}, D extends React.ElementType = 'div'> {
|
|
154
|
+
props: P & GridBaseProps & {
|
|
155
|
+
sx?: SxProps<Theme>;
|
|
156
|
+
} & SystemProps<Theme>;
|
|
157
|
+
defaultComponent: D;
|
|
158
|
+
}
|
|
159
|
+
export type GridProps<D extends React.ElementType = GridTypeMap['defaultComponent'], P = {
|
|
160
|
+
component?: React.ElementType;
|
|
161
|
+
}> = OverrideProps<GridTypeMap<P, D>, D>;
|
|
162
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { OverridableComponent } from '@mui/types';
|
|
3
|
-
import { GridTypeMap } from './GridProps';
|
|
4
|
-
declare const defaultCreateStyledComponent: import("@mui/styled-engine").CreateStyledComponent<import("../createStyled").MUIStyledCommonProps<any>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}, any>;
|
|
5
|
-
declare function useThemePropsDefault<T extends {}>(props: T): T & {};
|
|
6
|
-
export default function createGrid(options?: {
|
|
7
|
-
createStyledComponent?: typeof defaultCreateStyledComponent;
|
|
8
|
-
useThemeProps?: typeof useThemePropsDefault;
|
|
9
|
-
componentName?: string;
|
|
10
|
-
}): OverridableComponent<GridTypeMap<{}, "div">>;
|
|
11
|
-
export {};
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { OverridableComponent } from '@mui/types';
|
|
3
|
+
import { GridTypeMap } from './GridProps';
|
|
4
|
+
declare const defaultCreateStyledComponent: import("@mui/styled-engine").CreateStyledComponent<import("../createStyled").MUIStyledCommonProps<any>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}, any>;
|
|
5
|
+
declare function useThemePropsDefault<T extends {}>(props: T): T & {};
|
|
6
|
+
export default function createGrid(options?: {
|
|
7
|
+
createStyledComponent?: typeof defaultCreateStyledComponent;
|
|
8
|
+
useThemeProps?: typeof useThemePropsDefault;
|
|
9
|
+
componentName?: string;
|
|
10
|
+
}): OverridableComponent<GridTypeMap<{}, "div">>;
|
|
11
|
+
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export interface GridClasses {
|
|
2
|
-
/** Styles applied to the root element. */
|
|
3
|
-
root: string;
|
|
4
|
-
/** Styles applied to the root element if `container={true}`. */
|
|
5
|
-
container: string;
|
|
6
|
-
/** Styles applied to the root element if `direction="column"`. */
|
|
7
|
-
'direction-xs-column': string;
|
|
8
|
-
/** Styles applied to the root element if `direction="column-reverse"`. */
|
|
9
|
-
'direction-xs-column-reverse': string;
|
|
10
|
-
/** Styles applied to the root element if `direction="row-reverse"`. */
|
|
11
|
-
'direction-xs-row-reverse': string;
|
|
12
|
-
/** Styles applied to the root element if `wrap="nowrap"`. */
|
|
13
|
-
'wrap-xs-nowrap': string;
|
|
14
|
-
/** Styles applied to the root element if `wrap="reverse"`. */
|
|
15
|
-
'wrap-xs-wrap-reverse': string;
|
|
16
|
-
}
|
|
17
|
-
export type GridClassKey = keyof GridClasses;
|
|
18
|
-
export declare function getGridUtilityClass(slot: string): string;
|
|
19
|
-
declare const gridClasses: GridClasses;
|
|
20
|
-
export default gridClasses;
|
|
1
|
+
export interface GridClasses {
|
|
2
|
+
/** Styles applied to the root element. */
|
|
3
|
+
root: string;
|
|
4
|
+
/** Styles applied to the root element if `container={true}`. */
|
|
5
|
+
container: string;
|
|
6
|
+
/** Styles applied to the root element if `direction="column"`. */
|
|
7
|
+
'direction-xs-column': string;
|
|
8
|
+
/** Styles applied to the root element if `direction="column-reverse"`. */
|
|
9
|
+
'direction-xs-column-reverse': string;
|
|
10
|
+
/** Styles applied to the root element if `direction="row-reverse"`. */
|
|
11
|
+
'direction-xs-row-reverse': string;
|
|
12
|
+
/** Styles applied to the root element if `wrap="nowrap"`. */
|
|
13
|
+
'wrap-xs-nowrap': string;
|
|
14
|
+
/** Styles applied to the root element if `wrap="reverse"`. */
|
|
15
|
+
'wrap-xs-wrap-reverse': string;
|
|
16
|
+
}
|
|
17
|
+
export type GridClassKey = keyof GridClasses;
|
|
18
|
+
export declare function getGridUtilityClass(slot: string): string;
|
|
19
|
+
declare const gridClasses: GridClasses;
|
|
20
|
+
export default gridClasses;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { Breakpoints, Breakpoint } from '../createTheme/createBreakpoints';
|
|
2
|
-
import { Spacing } from '../createTheme/createSpacing';
|
|
3
|
-
import { ResponsiveStyleValue } from '../styleFunctionSx';
|
|
4
|
-
import { GridDirection, GridOwnerState } from './GridProps';
|
|
5
|
-
interface Props {
|
|
6
|
-
theme: {
|
|
7
|
-
breakpoints: Breakpoints;
|
|
8
|
-
spacing?: Spacing;
|
|
9
|
-
};
|
|
10
|
-
ownerState: GridOwnerState & {
|
|
11
|
-
parentDisableEqualOverflow?: boolean;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
interface Iterator<T> {
|
|
15
|
-
(appendStyle: (responsiveStyles: Record<string, any>, style: object) => void, value: T): void;
|
|
16
|
-
}
|
|
17
|
-
export declare const filterBreakpointKeys: (breakpointsKeys: Breakpoint[], responsiveKeys: string[]) => Breakpoint[];
|
|
18
|
-
export declare const traverseBreakpoints: <T = unknown>(breakpoints: Breakpoints, responsive: Record<string, any> | T | T[] | undefined, iterator: Iterator<T>) => void;
|
|
19
|
-
export declare const generateGridSizeStyles: ({ theme, ownerState }: Props) => {};
|
|
20
|
-
export declare const generateGridOffsetStyles: ({ theme, ownerState }: Props) => {};
|
|
21
|
-
export declare const generateGridColumnsStyles: ({ theme, ownerState }: Props) => {};
|
|
22
|
-
export declare const generateGridRowSpacingStyles: ({ theme, ownerState }: Props) => {};
|
|
23
|
-
export declare const generateGridColumnSpacingStyles: ({ theme, ownerState }: Props) => {};
|
|
24
|
-
export declare const generateGridDirectionStyles: ({ theme, ownerState }: Props) => {};
|
|
25
|
-
export declare const generateGridStyles: ({ ownerState }: Props) => {};
|
|
26
|
-
export declare const generateSizeClassNames: (gridSize: GridOwnerState['gridSize']) => string[];
|
|
27
|
-
export declare const generateSpacingClassNames: (spacing: GridOwnerState['spacing'], smallestBreakpoint?: string) => string[];
|
|
28
|
-
export declare const generateDirectionClasses: (direction: ResponsiveStyleValue<GridDirection> | undefined) => string[];
|
|
29
|
-
export {};
|
|
1
|
+
import { Breakpoints, Breakpoint } from '../createTheme/createBreakpoints';
|
|
2
|
+
import { Spacing } from '../createTheme/createSpacing';
|
|
3
|
+
import { ResponsiveStyleValue } from '../styleFunctionSx';
|
|
4
|
+
import { GridDirection, GridOwnerState } from './GridProps';
|
|
5
|
+
interface Props {
|
|
6
|
+
theme: {
|
|
7
|
+
breakpoints: Breakpoints;
|
|
8
|
+
spacing?: Spacing;
|
|
9
|
+
};
|
|
10
|
+
ownerState: GridOwnerState & {
|
|
11
|
+
parentDisableEqualOverflow?: boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
interface Iterator<T> {
|
|
15
|
+
(appendStyle: (responsiveStyles: Record<string, any>, style: object) => void, value: T): void;
|
|
16
|
+
}
|
|
17
|
+
export declare const filterBreakpointKeys: (breakpointsKeys: Breakpoint[], responsiveKeys: string[]) => Breakpoint[];
|
|
18
|
+
export declare const traverseBreakpoints: <T = unknown>(breakpoints: Breakpoints, responsive: Record<string, any> | T | T[] | undefined, iterator: Iterator<T>) => void;
|
|
19
|
+
export declare const generateGridSizeStyles: ({ theme, ownerState }: Props) => {};
|
|
20
|
+
export declare const generateGridOffsetStyles: ({ theme, ownerState }: Props) => {};
|
|
21
|
+
export declare const generateGridColumnsStyles: ({ theme, ownerState }: Props) => {};
|
|
22
|
+
export declare const generateGridRowSpacingStyles: ({ theme, ownerState }: Props) => {};
|
|
23
|
+
export declare const generateGridColumnSpacingStyles: ({ theme, ownerState }: Props) => {};
|
|
24
|
+
export declare const generateGridDirectionStyles: ({ theme, ownerState }: Props) => {};
|
|
25
|
+
export declare const generateGridStyles: ({ ownerState }: Props) => {};
|
|
26
|
+
export declare const generateSizeClassNames: (gridSize: GridOwnerState['gridSize']) => string[];
|
|
27
|
+
export declare const generateSpacingClassNames: (spacing: GridOwnerState['spacing'], smallestBreakpoint?: string) => string[];
|
|
28
|
+
export declare const generateDirectionClasses: (direction: ResponsiveStyleValue<GridDirection> | undefined) => string[];
|
|
29
|
+
export {};
|
package/Unstable_Grid/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { default } from './Grid';
|
|
2
|
-
export { default as createGrid } from './createGrid';
|
|
3
|
-
export * from './GridProps';
|
|
4
|
-
export { default as gridClasses } from './gridClasses';
|
|
5
|
-
export * from './gridClasses';
|
|
1
|
+
export { default } from './Grid';
|
|
2
|
+
export { default as createGrid } from './createGrid';
|
|
3
|
+
export * from './GridProps';
|
|
4
|
+
export { default as gridClasses } from './gridClasses';
|
|
5
|
+
export * from './gridClasses';
|
package/borders.js
CHANGED
|
@@ -4,13 +4,15 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
7
|
+
exports.borderTopColor = exports.borderTop = exports.borderRightColor = exports.borderRight = exports.borderRadius = exports.borderLeftColor = exports.borderLeft = exports.borderColor = exports.borderBottomColor = exports.borderBottom = exports.border = void 0;
|
|
8
|
+
exports.borderTransform = borderTransform;
|
|
9
|
+
exports.default = void 0;
|
|
8
10
|
var _responsivePropType = _interopRequireDefault(require("./responsivePropType"));
|
|
9
11
|
var _style = _interopRequireDefault(require("./style"));
|
|
10
12
|
var _compose = _interopRequireDefault(require("./compose"));
|
|
11
13
|
var _spacing = require("./spacing");
|
|
12
14
|
var _breakpoints = require("./breakpoints");
|
|
13
|
-
function
|
|
15
|
+
function borderTransform(value) {
|
|
14
16
|
if (typeof value !== 'number') {
|
|
15
17
|
return value;
|
|
16
18
|
}
|
|
@@ -19,31 +21,31 @@ function getBorder(value) {
|
|
|
19
21
|
const border = (0, _style.default)({
|
|
20
22
|
prop: 'border',
|
|
21
23
|
themeKey: 'borders',
|
|
22
|
-
transform:
|
|
24
|
+
transform: borderTransform
|
|
23
25
|
});
|
|
24
26
|
exports.border = border;
|
|
25
27
|
const borderTop = (0, _style.default)({
|
|
26
28
|
prop: 'borderTop',
|
|
27
29
|
themeKey: 'borders',
|
|
28
|
-
transform:
|
|
30
|
+
transform: borderTransform
|
|
29
31
|
});
|
|
30
32
|
exports.borderTop = borderTop;
|
|
31
33
|
const borderRight = (0, _style.default)({
|
|
32
34
|
prop: 'borderRight',
|
|
33
35
|
themeKey: 'borders',
|
|
34
|
-
transform:
|
|
36
|
+
transform: borderTransform
|
|
35
37
|
});
|
|
36
38
|
exports.borderRight = borderRight;
|
|
37
39
|
const borderBottom = (0, _style.default)({
|
|
38
40
|
prop: 'borderBottom',
|
|
39
41
|
themeKey: 'borders',
|
|
40
|
-
transform:
|
|
42
|
+
transform: borderTransform
|
|
41
43
|
});
|
|
42
44
|
exports.borderBottom = borderBottom;
|
|
43
45
|
const borderLeft = (0, _style.default)({
|
|
44
46
|
prop: 'borderLeft',
|
|
45
47
|
themeKey: 'borders',
|
|
46
|
-
transform:
|
|
48
|
+
transform: borderTransform
|
|
47
49
|
});
|
|
48
50
|
exports.borderLeft = borderLeft;
|
|
49
51
|
const borderColor = (0, _style.default)({
|
|
@@ -70,6 +72,9 @@ const borderLeftColor = (0, _style.default)({
|
|
|
70
72
|
prop: 'borderLeftColor',
|
|
71
73
|
themeKey: 'palette'
|
|
72
74
|
});
|
|
75
|
+
|
|
76
|
+
// false positive
|
|
77
|
+
// eslint-disable-next-line react/function-component-definition
|
|
73
78
|
exports.borderLeftColor = borderLeftColor;
|
|
74
79
|
const borderRadius = props => {
|
|
75
80
|
if (props.borderRadius !== undefined && props.borderRadius !== null) {
|
package/breakpoints.js
CHANGED
|
@@ -63,6 +63,8 @@ function handleBreakpoints(props, propValue, styleFromPropValue) {
|
|
|
63
63
|
return output;
|
|
64
64
|
}
|
|
65
65
|
function breakpoints(styleFunction) {
|
|
66
|
+
// false positive
|
|
67
|
+
// eslint-disable-next-line react/function-component-definition
|
|
66
68
|
const newStyleFunction = props => {
|
|
67
69
|
const theme = props.theme || {};
|
|
68
70
|
const base = styleFunction(props);
|
package/compose.js
CHANGED
package/createBox.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import Box from './Box';
|
|
2
|
-
import styleFunctionSx from './styleFunctionSx';
|
|
3
2
|
|
|
4
3
|
export default function createBox(options?: {
|
|
5
4
|
defaultTheme: object;
|
|
6
5
|
defaultClassName?: string;
|
|
7
6
|
generateClassName?: (componentName: string) => string;
|
|
8
|
-
styleFunctionSx?: typeof styleFunctionSx;
|
|
9
7
|
}): typeof Box;
|
package/createBox.js
CHANGED
|
@@ -20,12 +20,11 @@ function createBox(options = {}) {
|
|
|
20
20
|
const {
|
|
21
21
|
defaultTheme,
|
|
22
22
|
defaultClassName = 'MuiBox-root',
|
|
23
|
-
generateClassName
|
|
24
|
-
styleFunctionSx = _styleFunctionSx.default
|
|
23
|
+
generateClassName
|
|
25
24
|
} = options;
|
|
26
25
|
const BoxRoot = (0, _styledEngine.default)('div', {
|
|
27
26
|
shouldForwardProp: prop => prop !== 'theme' && prop !== 'sx' && prop !== 'as'
|
|
28
|
-
})(
|
|
27
|
+
})(_styleFunctionSx.default);
|
|
29
28
|
const Box = /*#__PURE__*/React.forwardRef(function Box(inProps, ref) {
|
|
30
29
|
const theme = (0, _useTheme.default)(defaultTheme);
|
|
31
30
|
const _extendSxProp = (0, _styleFunctionSx.extendSxProp)(inProps),
|
package/createBox.spec.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/createStyled.js
CHANGED
|
@@ -85,12 +85,11 @@ function createStyled(input = {}) {
|
|
|
85
85
|
const {
|
|
86
86
|
defaultTheme = systemDefaultTheme,
|
|
87
87
|
rootShouldForwardProp = shouldForwardProp,
|
|
88
|
-
slotShouldForwardProp = shouldForwardProp
|
|
89
|
-
styleFunctionSx = _styleFunctionSx.default
|
|
88
|
+
slotShouldForwardProp = shouldForwardProp
|
|
90
89
|
} = input;
|
|
91
90
|
const systemSx = props => {
|
|
92
91
|
const theme = isEmpty(props.theme) ? defaultTheme : props.theme;
|
|
93
|
-
return
|
|
92
|
+
return (0, _styleFunctionSx.default)((0, _extends2.default)({}, props, {
|
|
94
93
|
theme
|
|
95
94
|
}));
|
|
96
95
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export type SpacingOptions = number | Spacing | ((abs: number) => number | string) | ((abs: number | string) => number | string) | ReadonlyArray<string | number>;
|
|
2
|
-
export type SpacingArgument = number | string;
|
|
3
|
-
export interface Spacing {
|
|
4
|
-
(): string;
|
|
5
|
-
(value: number): string;
|
|
6
|
-
(topBottom: SpacingArgument, rightLeft: SpacingArgument): string;
|
|
7
|
-
(top: SpacingArgument, rightLeft: SpacingArgument, bottom: SpacingArgument): string;
|
|
8
|
-
(top: SpacingArgument, right: SpacingArgument, bottom: SpacingArgument, left: SpacingArgument): string;
|
|
9
|
-
}
|
|
10
|
-
export default function createSpacing(spacingInput?: SpacingOptions): Spacing;
|
|
1
|
+
export type SpacingOptions = number | Spacing | ((abs: number) => number | string) | ((abs: number | string) => number | string) | ReadonlyArray<string | number>;
|
|
2
|
+
export type SpacingArgument = number | string;
|
|
3
|
+
export interface Spacing {
|
|
4
|
+
(): string;
|
|
5
|
+
(value: number): string;
|
|
6
|
+
(topBottom: SpacingArgument, rightLeft: SpacingArgument): string;
|
|
7
|
+
(top: SpacingArgument, rightLeft: SpacingArgument, bottom: SpacingArgument): string;
|
|
8
|
+
(top: SpacingArgument, right: SpacingArgument, bottom: SpacingArgument, left: SpacingArgument): string;
|
|
9
|
+
}
|
|
10
|
+
export default function createSpacing(spacingInput?: SpacingOptions): Spacing;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { CSSObject } from '@mui/styled-engine';
|
|
1
2
|
import { Breakpoints, BreakpointsOptions } from './createBreakpoints';
|
|
2
3
|
import { Shape, ShapeOptions } from './shape';
|
|
3
4
|
import { Spacing, SpacingOptions } from './createSpacing';
|
|
5
|
+
import { SxConfig, SxProps } from '../styleFunctionSx';
|
|
4
6
|
|
|
5
7
|
export { Breakpoint, BreakpointOverrides } from './createBreakpoints';
|
|
6
8
|
|
|
@@ -18,6 +20,7 @@ export interface ThemeOptions {
|
|
|
18
20
|
components?: Record<string, any>;
|
|
19
21
|
typography?: unknown;
|
|
20
22
|
zIndex?: Record<string, number>;
|
|
23
|
+
unstable_sxConfig?: SxConfig;
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
export interface Theme {
|
|
@@ -32,6 +35,8 @@ export interface Theme {
|
|
|
32
35
|
mixins?: unknown;
|
|
33
36
|
typography?: unknown;
|
|
34
37
|
zIndex?: unknown;
|
|
38
|
+
unstable_sxConfig: SxConfig;
|
|
39
|
+
unstable_sx: (props: SxProps<Theme>) => CSSObject;
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
/**
|