@mui/system 5.15.15 → 6.0.0-alpha.1
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.js +11 -17
- package/Box/boxClasses.js +3 -10
- package/Box/index.js +3 -35
- package/Box/package.json +2 -2
- package/CHANGELOG.md +169 -3
- package/Container/Container.d.ts +1 -1
- package/Container/Container.js +12 -17
- package/Container/ContainerProps.js +1 -5
- package/Container/containerClasses.js +6 -14
- package/Container/createContainer.js +34 -43
- package/Container/index.js +3 -35
- package/Container/package.json +2 -2
- package/GlobalStyles/GlobalStyles.js +11 -19
- package/GlobalStyles/index.js +2 -25
- package/GlobalStyles/package.json +2 -2
- package/README.md +2 -2
- package/RtlProvider/index.js +13 -23
- package/RtlProvider/package.json +2 -2
- package/Stack/Stack.d.ts +1 -1
- package/Stack/Stack.js +11 -17
- package/Stack/StackProps.js +1 -5
- package/Stack/createStack.d.ts +2 -2
- package/Stack/createStack.js +40 -51
- package/Stack/index.js +5 -55
- package/Stack/package.json +2 -2
- package/Stack/stackClasses.js +6 -14
- package/ThemeProvider/ThemeProvider.js +22 -30
- package/ThemeProvider/index.js +1 -12
- package/ThemeProvider/package.json +2 -2
- package/Unstable_Grid/Grid.d.ts +1 -1
- package/Unstable_Grid/Grid.js +25 -31
- package/Unstable_Grid/GridProps.js +1 -5
- package/Unstable_Grid/createGrid.d.ts +2 -2
- package/Unstable_Grid/createGrid.js +59 -70
- package/Unstable_Grid/gridClasses.js +6 -14
- package/Unstable_Grid/gridGenerator.js +24 -43
- package/Unstable_Grid/index.js +6 -63
- package/Unstable_Grid/package.json +2 -2
- package/Unstable_Grid/traverseBreakpoints.d.ts +1 -1
- package/Unstable_Grid/traverseBreakpoints.js +3 -11
- package/borders/borders.d.ts +14 -0
- package/{esm → borders}/borders.js +5 -5
- package/borders/index.d.ts +2 -0
- package/borders/index.js +4 -0
- package/borders/package.json +6 -0
- package/{breakpoints.d.ts → breakpoints/breakpoints.d.ts} +13 -3
- package/{modern → breakpoints}/breakpoints.js +1 -1
- package/breakpoints/index.d.ts +2 -0
- package/breakpoints/index.js +4 -0
- package/breakpoints/package.json +6 -0
- package/colorManipulator/index.d.ts +1 -0
- package/colorManipulator/index.js +3 -0
- package/colorManipulator/package.json +6 -0
- package/compose/compose.d.ts +5 -0
- package/{modern → compose}/compose.js +1 -1
- package/compose/index.d.ts +1 -0
- package/compose/index.js +3 -0
- package/compose/package.json +6 -0
- package/{createBox.d.ts → createBox/createBox.d.ts} +2 -2
- package/{modern → createBox}/createBox.js +2 -2
- package/createBox/index.d.ts +1 -0
- package/createBox/index.js +3 -0
- package/createBox/package.json +6 -0
- package/{createStyled.d.ts → createStyled/createStyled.d.ts} +2 -2
- package/{modern → createStyled}/createStyled.js +2 -2
- package/createStyled/index.d.ts +2 -0
- package/createStyled/index.js +4 -0
- package/createStyled/package.json +6 -0
- package/createTheme/applyStyles.js +1 -7
- package/createTheme/createBreakpoints.d.ts +4 -4
- package/createTheme/createBreakpoints.js +7 -15
- package/createTheme/createSpacing.d.ts +2 -2
- package/createTheme/createSpacing.js +8 -14
- package/createTheme/createTheme.js +20 -27
- package/createTheme/index.js +3 -27
- package/createTheme/package.json +2 -2
- package/createTheme/shape.js +1 -7
- package/cssGrid/cssGrid.d.ts +3 -0
- package/{esm → cssGrid}/cssGrid.js +5 -5
- package/cssGrid/index.d.ts +2 -0
- package/cssGrid/index.js +4 -0
- package/cssGrid/package.json +6 -0
- package/cssVars/createCssVarsProvider.d.ts +0 -8
- package/cssVars/createCssVarsProvider.js +70 -110
- package/cssVars/createCssVarsTheme.d.ts +2 -7
- package/cssVars/createCssVarsTheme.js +10 -20
- package/cssVars/createGetCssVar.js +1 -7
- package/cssVars/cssVarsParser.js +6 -15
- package/cssVars/getInitColorSchemeScript.js +7 -16
- package/cssVars/index.js +4 -33
- package/cssVars/package.json +2 -2
- package/cssVars/prepareCssVars.d.ts +5 -9
- package/cssVars/prepareCssVars.js +60 -41
- package/cssVars/useCurrentColorScheme.js +16 -26
- package/display/display.d.ts +3 -0
- package/{esm → display}/display.js +2 -2
- package/display/index.d.ts +2 -0
- package/display/index.js +4 -0
- package/display/package.json +6 -0
- package/flexbox/flexbox.d.ts +3 -0
- package/{modern → flexbox}/flexbox.js +2 -2
- package/flexbox/index.d.ts +2 -0
- package/flexbox/index.js +4 -0
- package/flexbox/package.json +6 -0
- package/getThemeValue/getThemeValue.d.ts +1 -0
- package/{esm → getThemeValue}/getThemeValue.js +10 -10
- package/getThemeValue/index.d.ts +2 -0
- package/getThemeValue/index.js +4 -0
- package/getThemeValue/package.json +6 -0
- package/index.d.ts +22 -83
- package/index.js +61 -579
- package/legacy/{borders.js → borders/borders.js} +5 -5
- package/legacy/borders/index.js +4 -0
- package/legacy/{breakpoints.js → breakpoints/breakpoints.js} +1 -1
- package/legacy/breakpoints/index.js +4 -0
- package/legacy/colorManipulator/index.js +3 -0
- package/legacy/{compose.js → compose/compose.js} +1 -1
- package/legacy/compose/index.js +3 -0
- package/legacy/{createBox.js → createBox/createBox.js} +2 -2
- package/legacy/createBox/index.js +3 -0
- package/legacy/{createStyled.js → createStyled/createStyled.js} +2 -2
- package/legacy/createStyled/index.js +4 -0
- package/legacy/createTheme/createSpacing.js +3 -7
- package/legacy/{cssGrid.js → cssGrid/cssGrid.js} +5 -5
- package/legacy/cssGrid/index.js +4 -0
- package/legacy/cssVars/createCssVarsProvider.js +36 -62
- package/legacy/cssVars/createCssVarsTheme.js +7 -7
- package/legacy/cssVars/cssVarsParser.js +3 -2
- package/legacy/cssVars/prepareCssVars.js +45 -25
- package/legacy/{display.js → display/display.js} +2 -2
- package/legacy/display/index.js +4 -0
- package/legacy/{flexbox.js → flexbox/flexbox.js} +2 -2
- package/legacy/flexbox/index.js +4 -0
- package/legacy/{getThemeValue.js → getThemeValue/getThemeValue.js} +10 -10
- package/legacy/getThemeValue/index.js +4 -0
- package/legacy/index.js +1 -1
- package/legacy/memoize/index.js +3 -0
- package/legacy/merge/index.js +3 -0
- package/legacy/palette/index.js +4 -0
- package/legacy/{palette.js → palette/palette.js} +2 -2
- package/legacy/positions/index.js +4 -0
- package/legacy/{positions.js → positions/positions.js} +2 -2
- package/legacy/propsToClassKey/index.js +3 -0
- package/legacy/responsivePropType/index.js +3 -0
- package/legacy/shadows/index.js +3 -0
- package/legacy/{shadows.js → shadows/shadows.js} +1 -1
- package/legacy/sizing/index.js +4 -0
- package/legacy/{sizing.js → sizing/sizing.js} +3 -3
- package/legacy/spacing/index.js +4 -0
- package/legacy/{spacing.js → spacing/spacing.js} +29 -26
- package/legacy/style/index.js +4 -0
- package/legacy/{style.js → style/style.js} +2 -2
- package/legacy/styled/index.js +3 -0
- package/legacy/styled/styled.js +3 -0
- package/legacy/typography/index.js +4 -0
- package/legacy/{typography.js → typography/typography.js} +2 -2
- package/legacy/useTheme/index.js +4 -0
- package/legacy/{useTheme.js → useTheme/useTheme.js} +2 -2
- package/legacy/useThemeWithoutDefault/index.js +3 -0
- package/memoize/index.d.ts +1 -0
- package/memoize/index.js +3 -0
- package/memoize/memoize.d.ts +3 -0
- package/memoize/package.json +6 -0
- package/merge/index.d.ts +1 -0
- package/merge/index.js +3 -0
- package/merge/package.json +6 -0
- package/modern/{borders.js → borders/borders.js} +5 -5
- package/modern/borders/index.js +4 -0
- package/{esm → modern/breakpoints}/breakpoints.js +2 -3
- package/modern/breakpoints/index.js +4 -0
- package/modern/colorManipulator/index.js +3 -0
- package/{esm → modern/compose}/compose.js +1 -1
- package/modern/compose/index.js +3 -0
- package/{esm → modern/createBox}/createBox.js +2 -2
- package/modern/createBox/index.js +3 -0
- package/{esm → modern/createStyled}/createStyled.js +5 -6
- package/modern/createStyled/index.js +4 -0
- package/modern/createTheme/createSpacing.js +7 -8
- package/modern/{cssGrid.js → cssGrid/cssGrid.js} +5 -5
- package/modern/cssGrid/index.js +4 -0
- package/modern/cssVars/createCssVarsProvider.js +29 -60
- package/modern/cssVars/createCssVarsTheme.js +7 -10
- package/modern/cssVars/cssVarsParser.js +3 -2
- package/modern/cssVars/prepareCssVars.js +49 -21
- package/modern/{display.js → display/display.js} +2 -2
- package/modern/display/index.js +4 -0
- package/{esm → modern/flexbox}/flexbox.js +2 -2
- package/modern/flexbox/index.js +4 -0
- package/modern/{getThemeValue.js → getThemeValue/getThemeValue.js} +10 -10
- package/modern/getThemeValue/index.js +4 -0
- package/modern/index.js +1 -1
- package/modern/memoize/index.js +3 -0
- package/modern/merge/index.js +3 -0
- package/modern/palette/index.js +4 -0
- package/{esm → modern/palette}/palette.js +2 -2
- package/modern/positions/index.js +4 -0
- package/modern/{positions.js → positions/positions.js} +2 -2
- package/modern/propsToClassKey/index.js +3 -0
- package/modern/responsivePropType/index.js +3 -0
- package/modern/shadows/index.js +3 -0
- package/{esm → modern/shadows}/shadows.js +1 -1
- package/modern/sizing/index.js +4 -0
- package/modern/{sizing.js → sizing/sizing.js} +3 -3
- package/modern/spacing/index.js +4 -0
- package/{esm → modern/spacing}/spacing.js +29 -27
- package/modern/style/index.js +4 -0
- package/modern/{style.js → style/style.js} +2 -2
- package/modern/styled/index.js +3 -0
- package/modern/styled/styled.js +3 -0
- package/modern/typography/index.js +4 -0
- package/modern/{typography.js → typography/typography.js} +2 -2
- package/modern/useTheme/index.js +4 -0
- package/{esm → modern/useTheme}/useTheme.js +2 -2
- package/modern/useThemeWithoutDefault/index.js +3 -0
- package/node/Box/Box.js +36 -0
- package/node/Box/boxClasses.js +10 -0
- package/node/Box/index.js +37 -0
- package/{esm → node}/Container/Container.js +17 -12
- package/node/Container/ContainerProps.js +5 -0
- package/node/Container/containerClasses.js +15 -0
- package/node/Container/createContainer.js +152 -0
- package/node/Container/index.js +37 -0
- package/node/GlobalStyles/GlobalStyles.js +45 -0
- package/node/GlobalStyles/index.js +27 -0
- package/node/RtlProvider/index.js +35 -0
- package/{esm → node}/Stack/Stack.js +17 -11
- package/node/Stack/StackProps.js +5 -0
- package/node/Stack/createStack.js +184 -0
- package/node/Stack/index.js +57 -0
- package/node/Stack/stackClasses.js +15 -0
- package/{esm → node}/ThemeProvider/ThemeProvider.js +30 -22
- package/node/ThemeProvider/index.js +14 -0
- package/{esm → node}/Unstable_Grid/Grid.js +31 -25
- package/node/Unstable_Grid/GridProps.js +5 -0
- package/node/Unstable_Grid/createGrid.js +180 -0
- package/{esm → node}/Unstable_Grid/gridClasses.js +14 -6
- package/{esm → node}/Unstable_Grid/gridGenerator.js +39 -22
- package/node/Unstable_Grid/index.js +65 -0
- package/{esm → node}/Unstable_Grid/traverseBreakpoints.js +11 -3
- package/{borders.js → node/borders/borders.js} +5 -5
- package/node/borders/index.js +27 -0
- package/{breakpoints.js → node/breakpoints/breakpoints.js} +1 -1
- package/node/breakpoints/index.js +27 -0
- package/node/colorManipulator/index.js +17 -0
- package/{compose.js → node/compose/compose.js} +1 -1
- package/node/compose/index.js +14 -0
- package/{createBox.js → node/createBox/createBox.js} +3 -3
- package/node/createBox/index.js +14 -0
- package/{createStyled.js → node/createStyled/createStyled.js} +3 -3
- package/node/createStyled/index.js +27 -0
- package/{esm → node}/createTheme/applyStyles.js +7 -1
- package/{esm → node}/createTheme/createBreakpoints.js +15 -7
- package/{esm → node}/createTheme/createSpacing.js +13 -9
- package/node/createTheme/createTheme.js +50 -0
- package/node/createTheme/index.js +27 -0
- package/node/createTheme/shape.js +10 -0
- package/{cssGrid.js → node/cssGrid/cssGrid.js} +5 -5
- package/node/cssGrid/index.js +27 -0
- package/{esm → node}/cssVars/createCssVarsProvider.js +79 -99
- package/node/cssVars/createCssVarsTheme.js +20 -0
- package/{esm → node}/cssVars/createGetCssVar.js +7 -1
- package/{esm → node}/cssVars/cssVarsParser.js +16 -5
- package/node/cssVars/getInitColorSchemeScript.js +53 -0
- package/node/cssVars/index.js +35 -0
- package/node/cssVars/prepareCssVars.js +106 -0
- package/{esm → node}/cssVars/useCurrentColorScheme.js +24 -14
- package/{display.js → node/display/display.js} +2 -2
- package/node/display/index.js +27 -0
- package/{flexbox.js → node/flexbox/flexbox.js} +2 -2
- package/node/flexbox/index.js +27 -0
- package/{getThemeValue.js → node/getThemeValue/getThemeValue.js} +10 -10
- package/node/getThemeValue/index.js +27 -0
- package/node/index.js +590 -0
- package/node/memoize/index.js +14 -0
- package/node/merge/index.js +14 -0
- package/node/palette/index.js +27 -0
- package/{palette.js → node/palette/palette.js} +2 -2
- package/node/positions/index.js +27 -0
- package/{positions.js → node/positions/positions.js} +2 -2
- package/node/propsToClassKey/index.js +14 -0
- package/node/responsivePropType/index.js +14 -0
- package/node/shadows/index.js +14 -0
- package/{shadows.js → node/shadows/shadows.js} +1 -1
- package/node/sizing/index.js +27 -0
- package/{sizing.js → node/sizing/sizing.js} +3 -3
- package/node/spacing/index.js +27 -0
- package/{spacing.js → node/spacing/spacing.js} +29 -26
- package/node/style/index.js +27 -0
- package/{style.js → node/style/style.js} +2 -2
- package/{esm → node}/styleFunctionSx/defaultSxConfig.js +71 -65
- package/node/styleFunctionSx/extendSxProp.js +55 -0
- package/node/styleFunctionSx/index.js +35 -0
- package/{esm → node}/styleFunctionSx/styleFunctionSx.js +26 -18
- package/node/styled/index.js +14 -0
- package/{styled.js → node/styled/styled.js} +1 -1
- package/node/typography/index.js +27 -0
- package/{typography.js → node/typography/typography.js} +2 -2
- package/node/useMediaQuery/index.js +26 -0
- package/{esm → node}/useMediaQuery/useMediaQuery.js +16 -9
- package/node/useTheme/index.js +27 -0
- package/{useTheme.js → node/useTheme/useTheme.js} +2 -2
- package/node/useThemeProps/getThemeProps.js +19 -0
- package/node/useThemeProps/index.js +21 -0
- package/node/useThemeProps/useThemeProps.js +27 -0
- package/node/useThemeWithoutDefault/index.js +14 -0
- package/{useThemeWithoutDefault.js → node/useThemeWithoutDefault/useThemeWithoutDefault.js} +1 -1
- package/package.json +8 -8
- package/palette/index.d.ts +2 -0
- package/palette/index.js +4 -0
- package/palette/package.json +6 -0
- package/palette/palette.d.ts +5 -0
- package/{modern → palette}/palette.js +2 -2
- package/positions/index.d.ts +2 -0
- package/positions/index.js +4 -0
- package/positions/package.json +6 -0
- package/positions/positions.d.ts +3 -0
- package/{esm → positions}/positions.js +2 -2
- package/propsToClassKey/index.d.ts +1 -0
- package/propsToClassKey/index.js +3 -0
- package/propsToClassKey/package.json +6 -0
- package/responsivePropType/index.d.ts +1 -0
- package/responsivePropType/index.js +3 -0
- package/responsivePropType/package.json +6 -0
- package/shadows/index.d.ts +1 -0
- package/shadows/index.js +3 -0
- package/shadows/package.json +6 -0
- package/shadows/shadows.d.ts +3 -0
- package/{modern → shadows}/shadows.js +1 -1
- package/sizing/index.d.ts +2 -0
- package/sizing/index.js +4 -0
- package/sizing/package.json +6 -0
- package/sizing/sizing.d.ts +12 -0
- package/{esm → sizing}/sizing.js +5 -6
- package/spacing/index.d.ts +2 -0
- package/spacing/index.js +4 -0
- package/spacing/package.json +6 -0
- package/{spacing.d.ts → spacing/spacing.d.ts} +1 -1
- package/{modern → spacing}/spacing.js +29 -26
- package/style/index.d.ts +2 -0
- package/style/index.js +4 -0
- package/style/package.json +6 -0
- package/{style.d.ts → style/style.d.ts} +1 -1
- package/{esm → style}/style.js +2 -2
- package/styleFunctionSx/defaultSxConfig.js +65 -71
- package/styleFunctionSx/extendSxProp.js +11 -19
- package/styleFunctionSx/index.js +4 -35
- package/styleFunctionSx/package.json +2 -2
- package/styleFunctionSx/styleFunctionSx.js +18 -27
- package/styled/index.d.ts +1 -0
- package/styled/index.js +3 -0
- package/styled/package.json +6 -0
- package/{styled.d.ts → styled/styled.d.ts} +1 -1
- package/styled/styled.js +3 -0
- package/typography/index.d.ts +2 -0
- package/typography/index.js +4 -0
- package/typography/package.json +6 -0
- package/typography/typography.d.ts +12 -0
- package/{esm → typography}/typography.js +2 -2
- package/useMediaQuery/index.js +2 -26
- package/useMediaQuery/package.json +2 -2
- package/useMediaQuery/useMediaQuery.js +9 -16
- package/useTheme/index.d.ts +2 -0
- package/useTheme/index.js +4 -0
- package/useTheme/package.json +6 -0
- package/{useTheme.d.ts → useTheme/useTheme.d.ts} +1 -1
- package/{modern → useTheme}/useTheme.js +2 -2
- package/useThemeProps/getThemeProps.js +3 -10
- package/useThemeProps/index.js +2 -19
- package/useThemeProps/package.json +2 -2
- package/useThemeProps/useThemeProps.js +5 -11
- package/useThemeWithoutDefault/index.d.ts +1 -0
- package/useThemeWithoutDefault/index.js +3 -0
- package/useThemeWithoutDefault/package.json +6 -0
- package/esm/Box/Box.js +0 -30
- package/esm/Box/boxClasses.js +0 -3
- package/esm/Box/index.js +0 -5
- package/esm/Container/ContainerProps.js +0 -1
- package/esm/Container/containerClasses.js +0 -7
- package/esm/Container/createContainer.js +0 -143
- package/esm/Container/index.js +0 -5
- package/esm/GlobalStyles/GlobalStyles.js +0 -37
- package/esm/GlobalStyles/index.js +0 -4
- package/esm/RtlProvider/index.js +0 -25
- package/esm/Stack/StackProps.js +0 -1
- package/esm/Stack/createStack.js +0 -173
- package/esm/Stack/index.js +0 -7
- package/esm/Stack/stackClasses.js +0 -7
- package/esm/ThemeProvider/index.js +0 -3
- package/esm/Unstable_Grid/GridProps.js +0 -1
- package/esm/Unstable_Grid/createGrid.js +0 -171
- package/esm/Unstable_Grid/index.js +0 -8
- package/esm/createTheme/createTheme.js +0 -43
- package/esm/createTheme/index.js +0 -3
- package/esm/createTheme/shape.js +0 -4
- package/esm/cssVars/createCssVarsTheme.js +0 -16
- package/esm/cssVars/getInitColorSchemeScript.js +0 -44
- package/esm/cssVars/index.js +0 -6
- package/esm/cssVars/prepareCssVars.js +0 -73
- package/esm/index.js +0 -65
- package/esm/styleFunctionSx/extendSxProp.js +0 -48
- package/esm/styleFunctionSx/index.js +0 -4
- package/esm/styled.js +0 -3
- package/esm/useMediaQuery/index.js +0 -2
- package/esm/useThemeProps/getThemeProps.js +0 -12
- package/esm/useThemeProps/index.js +0 -4
- package/esm/useThemeProps/useThemeProps.js +0 -21
- package/legacy/styled.js +0 -3
- package/modern/styled.js +0 -3
- /package/{colorManipulator.d.ts → colorManipulator/colorManipulator.d.ts} +0 -0
- /package/{esm → colorManipulator}/colorManipulator.js +0 -0
- /package/legacy/{colorManipulator.js → colorManipulator/colorManipulator.js} +0 -0
- /package/legacy/{memoize.js → memoize/memoize.js} +0 -0
- /package/{esm → legacy/merge}/merge.js +0 -0
- /package/legacy/{propsToClassKey.js → propsToClassKey/propsToClassKey.js} +0 -0
- /package/legacy/{responsivePropType.js → responsivePropType/responsivePropType.js} +0 -0
- /package/legacy/{useThemeWithoutDefault.js → useThemeWithoutDefault/useThemeWithoutDefault.js} +0 -0
- /package/{esm → memoize}/memoize.js +0 -0
- /package/{merge.d.ts → merge/merge.d.ts} +0 -0
- /package/{legacy → merge}/merge.js +0 -0
- /package/modern/{colorManipulator.js → colorManipulator/colorManipulator.js} +0 -0
- /package/modern/{memoize.js → memoize/memoize.js} +0 -0
- /package/modern/{merge.js → merge/merge.js} +0 -0
- /package/{esm → modern/propsToClassKey}/propsToClassKey.js +0 -0
- /package/{esm → modern/responsivePropType}/responsivePropType.js +0 -0
- /package/{esm → modern/useThemeWithoutDefault}/useThemeWithoutDefault.js +0 -0
- /package/{colorManipulator.js → node/colorManipulator/colorManipulator.js} +0 -0
- /package/{memoize.js → node/memoize/memoize.js} +0 -0
- /package/{merge.js → node/merge/merge.js} +0 -0
- /package/{propsToClassKey.js → node/propsToClassKey/propsToClassKey.js} +0 -0
- /package/{responsivePropType.js → node/responsivePropType/responsivePropType.js} +0 -0
- /package/{propsToClassKey.d.ts → propsToClassKey/propsToClassKey.d.ts} +0 -0
- /package/{modern → propsToClassKey}/propsToClassKey.js +0 -0
- /package/{responsivePropType.d.ts → responsivePropType/responsivePropType.d.ts} +0 -0
- /package/{modern → responsivePropType}/responsivePropType.js +0 -0
- /package/{useThemeWithoutDefault.d.ts → useThemeWithoutDefault/useThemeWithoutDefault.d.ts} +0 -0
- /package/{modern → useThemeWithoutDefault}/useThemeWithoutDefault.js +0 -0
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.generateSpacingClassNames = exports.generateSizeClassNames = exports.generateGridStyles = exports.generateGridSizeStyles = exports.generateGridRowSpacingStyles = exports.generateGridOffsetStyles = exports.generateGridDirectionStyles = exports.generateGridColumnsStyles = exports.generateGridColumnSpacingStyles = exports.generateDirectionClasses = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _traverseBreakpoints = require("./traverseBreakpoints");
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { traverseBreakpoints } from './traverseBreakpoints';
|
|
10
3
|
function appendLevel(level) {
|
|
11
4
|
if (!level) {
|
|
12
5
|
return '';
|
|
@@ -35,13 +28,13 @@ function getParentColumns(ownerState) {
|
|
|
35
28
|
}
|
|
36
29
|
return `var(--Grid-columns${appendLevel(ownerState.unstable_level - 1)})`;
|
|
37
30
|
}
|
|
38
|
-
const generateGridSizeStyles = ({
|
|
31
|
+
export const generateGridSizeStyles = ({
|
|
39
32
|
theme,
|
|
40
33
|
ownerState
|
|
41
34
|
}) => {
|
|
42
35
|
const getSelfSpacing = createGetSelfSpacing(ownerState);
|
|
43
36
|
const styles = {};
|
|
44
|
-
|
|
37
|
+
traverseBreakpoints(theme.breakpoints, ownerState.gridSize, (appendStyle, value) => {
|
|
45
38
|
let style = {};
|
|
46
39
|
if (value === true) {
|
|
47
40
|
style = {
|
|
@@ -70,13 +63,12 @@ const generateGridSizeStyles = ({
|
|
|
70
63
|
});
|
|
71
64
|
return styles;
|
|
72
65
|
};
|
|
73
|
-
|
|
74
|
-
const generateGridOffsetStyles = ({
|
|
66
|
+
export const generateGridOffsetStyles = ({
|
|
75
67
|
theme,
|
|
76
68
|
ownerState
|
|
77
69
|
}) => {
|
|
78
70
|
const styles = {};
|
|
79
|
-
|
|
71
|
+
traverseBreakpoints(theme.breakpoints, ownerState.gridOffset, (appendStyle, value) => {
|
|
80
72
|
let style = {};
|
|
81
73
|
if (value === 'auto') {
|
|
82
74
|
style = {
|
|
@@ -92,8 +84,7 @@ const generateGridOffsetStyles = ({
|
|
|
92
84
|
});
|
|
93
85
|
return styles;
|
|
94
86
|
};
|
|
95
|
-
|
|
96
|
-
const generateGridColumnsStyles = ({
|
|
87
|
+
export const generateGridColumnsStyles = ({
|
|
97
88
|
theme,
|
|
98
89
|
ownerState
|
|
99
90
|
}) => {
|
|
@@ -105,15 +96,14 @@ const generateGridColumnsStyles = ({
|
|
|
105
96
|
} : {
|
|
106
97
|
'--Grid-columns': 12
|
|
107
98
|
};
|
|
108
|
-
|
|
99
|
+
traverseBreakpoints(theme.breakpoints, ownerState.columns, (appendStyle, value) => {
|
|
109
100
|
appendStyle(styles, {
|
|
110
101
|
[`--Grid-columns${appendLevel(ownerState.unstable_level)}`]: value
|
|
111
102
|
});
|
|
112
103
|
});
|
|
113
104
|
return styles;
|
|
114
105
|
};
|
|
115
|
-
|
|
116
|
-
const generateGridRowSpacingStyles = ({
|
|
106
|
+
export const generateGridRowSpacingStyles = ({
|
|
117
107
|
theme,
|
|
118
108
|
ownerState
|
|
119
109
|
}) => {
|
|
@@ -126,16 +116,14 @@ const generateGridRowSpacingStyles = ({
|
|
|
126
116
|
// It will be overridden if spacing props are provided
|
|
127
117
|
[`--Grid-rowSpacing${appendLevel(ownerState.unstable_level)}`]: getParentSpacing('row')
|
|
128
118
|
} : {};
|
|
129
|
-
|
|
130
|
-
var _theme$spacing;
|
|
119
|
+
traverseBreakpoints(theme.breakpoints, ownerState.rowSpacing, (appendStyle, value) => {
|
|
131
120
|
appendStyle(styles, {
|
|
132
|
-
[`--Grid-rowSpacing${appendLevel(ownerState.unstable_level)}`]: typeof value === 'string' ? value :
|
|
121
|
+
[`--Grid-rowSpacing${appendLevel(ownerState.unstable_level)}`]: typeof value === 'string' ? value : theme.spacing?.(value)
|
|
133
122
|
});
|
|
134
123
|
});
|
|
135
124
|
return styles;
|
|
136
125
|
};
|
|
137
|
-
|
|
138
|
-
const generateGridColumnSpacingStyles = ({
|
|
126
|
+
export const generateGridColumnSpacingStyles = ({
|
|
139
127
|
theme,
|
|
140
128
|
ownerState
|
|
141
129
|
}) => {
|
|
@@ -148,16 +136,14 @@ const generateGridColumnSpacingStyles = ({
|
|
|
148
136
|
// It will be overridden if spacing props are provided
|
|
149
137
|
[`--Grid-columnSpacing${appendLevel(ownerState.unstable_level)}`]: getParentSpacing('column')
|
|
150
138
|
} : {};
|
|
151
|
-
|
|
152
|
-
var _theme$spacing2;
|
|
139
|
+
traverseBreakpoints(theme.breakpoints, ownerState.columnSpacing, (appendStyle, value) => {
|
|
153
140
|
appendStyle(styles, {
|
|
154
|
-
[`--Grid-columnSpacing${appendLevel(ownerState.unstable_level)}`]: typeof value === 'string' ? value :
|
|
141
|
+
[`--Grid-columnSpacing${appendLevel(ownerState.unstable_level)}`]: typeof value === 'string' ? value : theme.spacing?.(value)
|
|
155
142
|
});
|
|
156
143
|
});
|
|
157
144
|
return styles;
|
|
158
145
|
};
|
|
159
|
-
|
|
160
|
-
const generateGridDirectionStyles = ({
|
|
146
|
+
export const generateGridDirectionStyles = ({
|
|
161
147
|
theme,
|
|
162
148
|
ownerState
|
|
163
149
|
}) => {
|
|
@@ -165,23 +151,22 @@ const generateGridDirectionStyles = ({
|
|
|
165
151
|
return {};
|
|
166
152
|
}
|
|
167
153
|
const styles = {};
|
|
168
|
-
|
|
154
|
+
traverseBreakpoints(theme.breakpoints, ownerState.direction, (appendStyle, value) => {
|
|
169
155
|
appendStyle(styles, {
|
|
170
156
|
flexDirection: value
|
|
171
157
|
});
|
|
172
158
|
});
|
|
173
159
|
return styles;
|
|
174
160
|
};
|
|
175
|
-
|
|
176
|
-
const generateGridStyles = ({
|
|
161
|
+
export const generateGridStyles = ({
|
|
177
162
|
ownerState
|
|
178
163
|
}) => {
|
|
179
164
|
const getSelfSpacing = createGetSelfSpacing(ownerState);
|
|
180
165
|
const getParentSpacing = createGetParentSpacing(ownerState);
|
|
181
|
-
return (
|
|
166
|
+
return _extends({
|
|
182
167
|
minWidth: 0,
|
|
183
168
|
boxSizing: 'border-box'
|
|
184
|
-
}, ownerState.container && (
|
|
169
|
+
}, ownerState.container && _extends({
|
|
185
170
|
display: 'flex',
|
|
186
171
|
flexWrap: 'wrap'
|
|
187
172
|
}, ownerState.wrap && ownerState.wrap !== 'wrap' && {
|
|
@@ -190,14 +175,13 @@ const generateGridStyles = ({
|
|
|
190
175
|
margin: `calc(${getSelfSpacing('row')} / -2) calc(${getSelfSpacing('column')} / -2)`
|
|
191
176
|
}, ownerState.disableEqualOverflow && {
|
|
192
177
|
margin: `calc(${getSelfSpacing('row')} * -1) 0px 0px calc(${getSelfSpacing('column')} * -1)`
|
|
193
|
-
}), (!ownerState.container || isNestedContainer(ownerState)) && (
|
|
178
|
+
}), (!ownerState.container || isNestedContainer(ownerState)) && _extends({
|
|
194
179
|
padding: `calc(${getParentSpacing('row')} / 2) calc(${getParentSpacing('column')} / 2)`
|
|
195
180
|
}, (ownerState.disableEqualOverflow || ownerState.parentDisableEqualOverflow) && {
|
|
196
181
|
padding: `${getParentSpacing('row')} 0px 0px ${getParentSpacing('column')}`
|
|
197
182
|
}));
|
|
198
183
|
};
|
|
199
|
-
|
|
200
|
-
const generateSizeClassNames = gridSize => {
|
|
184
|
+
export const generateSizeClassNames = gridSize => {
|
|
201
185
|
const classNames = [];
|
|
202
186
|
Object.entries(gridSize).forEach(([key, value]) => {
|
|
203
187
|
if (value !== false && value !== undefined) {
|
|
@@ -206,8 +190,7 @@ const generateSizeClassNames = gridSize => {
|
|
|
206
190
|
});
|
|
207
191
|
return classNames;
|
|
208
192
|
};
|
|
209
|
-
|
|
210
|
-
const generateSpacingClassNames = (spacing, smallestBreakpoint = 'xs') => {
|
|
193
|
+
export const generateSpacingClassNames = (spacing, smallestBreakpoint = 'xs') => {
|
|
211
194
|
function isValidSpacing(val) {
|
|
212
195
|
if (val === undefined) {
|
|
213
196
|
return false;
|
|
@@ -228,8 +211,7 @@ const generateSpacingClassNames = (spacing, smallestBreakpoint = 'xs') => {
|
|
|
228
211
|
}
|
|
229
212
|
return [];
|
|
230
213
|
};
|
|
231
|
-
|
|
232
|
-
const generateDirectionClasses = direction => {
|
|
214
|
+
export const generateDirectionClasses = direction => {
|
|
233
215
|
if (direction === undefined) {
|
|
234
216
|
return [];
|
|
235
217
|
}
|
|
@@ -237,5 +219,4 @@ const generateDirectionClasses = direction => {
|
|
|
237
219
|
return Object.entries(direction).map(([key, value]) => `direction-${key}-${value}`);
|
|
238
220
|
}
|
|
239
221
|
return [`direction-xs-${String(direction)}`];
|
|
240
|
-
};
|
|
241
|
-
exports.generateDirectionClasses = generateDirectionClasses;
|
|
222
|
+
};
|
package/Unstable_Grid/index.js
CHANGED
|
@@ -1,65 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
'use client';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
gridClasses: true,
|
|
11
|
-
unstable_traverseBreakpoints: true
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "createGrid", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return _createGrid.default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(exports, "default", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _Grid.default;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "gridClasses", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _gridClasses.default;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
Object.defineProperty(exports, "unstable_traverseBreakpoints", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
get: function () {
|
|
34
|
-
return _traverseBreakpoints.traverseBreakpoints;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
var _Grid = _interopRequireDefault(require("./Grid"));
|
|
38
|
-
var _createGrid = _interopRequireDefault(require("./createGrid"));
|
|
39
|
-
var _GridProps = require("./GridProps");
|
|
40
|
-
Object.keys(_GridProps).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
43
|
-
if (key in exports && exports[key] === _GridProps[key]) return;
|
|
44
|
-
Object.defineProperty(exports, key, {
|
|
45
|
-
enumerable: true,
|
|
46
|
-
get: function () {
|
|
47
|
-
return _GridProps[key];
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
var _gridClasses = _interopRequireWildcard(require("./gridClasses"));
|
|
52
|
-
Object.keys(_gridClasses).forEach(function (key) {
|
|
53
|
-
if (key === "default" || key === "__esModule") return;
|
|
54
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
55
|
-
if (key in exports && exports[key] === _gridClasses[key]) return;
|
|
56
|
-
Object.defineProperty(exports, key, {
|
|
57
|
-
enumerable: true,
|
|
58
|
-
get: function () {
|
|
59
|
-
return _gridClasses[key];
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
var _traverseBreakpoints = require("./traverseBreakpoints");
|
|
64
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
65
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
3
|
+
export { default } from './Grid';
|
|
4
|
+
export { default as createGrid } from './createGrid';
|
|
5
|
+
export * from './GridProps';
|
|
6
|
+
export { default as gridClasses } from './gridClasses';
|
|
7
|
+
export * from './gridClasses';
|
|
8
|
+
export { traverseBreakpoints as unstable_traverseBreakpoints } from './traverseBreakpoints';
|
|
@@ -3,5 +3,5 @@ export declare const filterBreakpointKeys: (breakpointsKeys: Breakpoint[], respo
|
|
|
3
3
|
interface Iterator<T> {
|
|
4
4
|
(appendStyle: (responsiveStyles: Record<string, any>, style: object) => void, value: T): void;
|
|
5
5
|
}
|
|
6
|
-
export declare const traverseBreakpoints: <T = unknown>(breakpoints: Breakpoints, responsive: Record<string, any> |
|
|
6
|
+
export declare const traverseBreakpoints: <T = unknown>(breakpoints: Breakpoints, responsive: T | T[] | Record<string, any> | undefined, iterator: Iterator<T>) => void;
|
|
7
7
|
export {};
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.traverseBreakpoints = exports.filterBreakpointKeys = void 0;
|
|
7
|
-
const filterBreakpointKeys = (breakpointsKeys, responsiveKeys) => breakpointsKeys.filter(key => responsiveKeys.includes(key));
|
|
8
|
-
exports.filterBreakpointKeys = filterBreakpointKeys;
|
|
9
|
-
const traverseBreakpoints = (breakpoints, responsive, iterator) => {
|
|
1
|
+
export const filterBreakpointKeys = (breakpointsKeys, responsiveKeys) => breakpointsKeys.filter(key => responsiveKeys.includes(key));
|
|
2
|
+
export const traverseBreakpoints = (breakpoints, responsive, iterator) => {
|
|
10
3
|
const smallestBreakpoint = breakpoints.keys[0]; // the keys is sorted from smallest to largest by `createBreakpoints`.
|
|
11
4
|
|
|
12
5
|
if (Array.isArray(responsive)) {
|
|
@@ -46,5 +39,4 @@ const traverseBreakpoints = (breakpoints, responsive, iterator) => {
|
|
|
46
39
|
Object.assign(responsiveStyles, style);
|
|
47
40
|
}, responsive);
|
|
48
41
|
}
|
|
49
|
-
};
|
|
50
|
-
exports.traverseBreakpoints = traverseBreakpoints;
|
|
42
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PropsFor, SimpleStyleFunction, borders } from '../Box';
|
|
2
|
+
|
|
3
|
+
export const border: SimpleStyleFunction<'border'>;
|
|
4
|
+
export const borderTop: SimpleStyleFunction<'borderTop'>;
|
|
5
|
+
export const borderRight: SimpleStyleFunction<'borderRight'>;
|
|
6
|
+
export const borderBottom: SimpleStyleFunction<'borderBottom'>;
|
|
7
|
+
export const borderLeft: SimpleStyleFunction<'borderLeft'>;
|
|
8
|
+
export const borderColor: SimpleStyleFunction<'borderColor'>;
|
|
9
|
+
export const borderTopColor: SimpleStyleFunction<'borderTopColor'>;
|
|
10
|
+
export const borderRightColor: SimpleStyleFunction<'borderRightColor'>;
|
|
11
|
+
export const borderBottomColor: SimpleStyleFunction<'borderBottomColor'>;
|
|
12
|
+
export const borderLeftColor: SimpleStyleFunction<'borderLeftColor'>;
|
|
13
|
+
export const borderRadius: SimpleStyleFunction<'borderRadius'>;
|
|
14
|
+
export type BordersProps = PropsFor<typeof borders>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import responsivePropType from '
|
|
2
|
-
import style from '
|
|
3
|
-
import compose from '
|
|
4
|
-
import { createUnaryUnit, getValue } from '
|
|
5
|
-
import { handleBreakpoints } from '
|
|
1
|
+
import responsivePropType from '../responsivePropType';
|
|
2
|
+
import style from '../style';
|
|
3
|
+
import compose from '../compose';
|
|
4
|
+
import { createUnaryUnit, getValue } from '../spacing';
|
|
5
|
+
import { handleBreakpoints } from '../breakpoints';
|
|
6
6
|
export function borderTransform(value) {
|
|
7
7
|
if (typeof value !== 'number') {
|
|
8
8
|
return value;
|
package/borders/index.js
ADDED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CSSObject } from '@mui/styled-engine';
|
|
2
|
-
import { Breakpoints } from '
|
|
3
|
-
import type { Breakpoint } from '
|
|
4
|
-
import { ResponsiveStyleValue } from '
|
|
2
|
+
import { Breakpoints } from '../createTheme/createBreakpoints';
|
|
3
|
+
import type { Breakpoint } from '../createTheme';
|
|
4
|
+
import { ResponsiveStyleValue } from '../styleFunctionSx';
|
|
5
|
+
import { StyleFunction } from '../Box';
|
|
5
6
|
|
|
6
7
|
export interface ResolveBreakpointValuesOptions<T> {
|
|
7
8
|
values: ResponsiveStyleValue<T>;
|
|
@@ -19,3 +20,12 @@ export function handleBreakpoints<Props>(
|
|
|
19
20
|
propValue: any,
|
|
20
21
|
styleFromPropValue: (value: any, breakpoint?: Breakpoint) => any,
|
|
21
22
|
): any;
|
|
23
|
+
|
|
24
|
+
type DefaultBreakPoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @returns An enhanced stylefunction that considers breakpoints
|
|
28
|
+
*/
|
|
29
|
+
export default function breakpoints<Props, Breakpoints extends string = DefaultBreakPoints>(
|
|
30
|
+
styleFunction: StyleFunction<Props>,
|
|
31
|
+
): StyleFunction<Partial<Record<Breakpoints, Props>> & Props>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import deepmerge from '@mui/utils/deepmerge';
|
|
4
|
-
import merge from '
|
|
4
|
+
import merge from '../merge';
|
|
5
5
|
|
|
6
6
|
// The breakpoint **start** at this value.
|
|
7
7
|
// For instance with the first breakpoint xs: [xs, sm[.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './colorManipulator';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './compose';
|
package/compose/index.js
ADDED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OverridableComponent } from '@mui/types';
|
|
2
|
-
import { BoxTypeMap } from '
|
|
3
|
-
import { Theme as SystemTheme } from '
|
|
2
|
+
import { BoxTypeMap } from '../Box';
|
|
3
|
+
import { Theme as SystemTheme } from '../createTheme';
|
|
4
4
|
|
|
5
5
|
export default function createBox<
|
|
6
6
|
T extends object = SystemTheme,
|
|
@@ -6,8 +6,8 @@ const _excluded = ["className", "component"];
|
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
8
|
import styled from '@mui/styled-engine';
|
|
9
|
-
import styleFunctionSx, { extendSxProp } from '
|
|
10
|
-
import useTheme from '
|
|
9
|
+
import styleFunctionSx, { extendSxProp } from '../styleFunctionSx';
|
|
10
|
+
import useTheme from '../useTheme';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
export default function createBox(options = {}) {
|
|
13
13
|
const {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './createBox';
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
CreateMUIStyled as CreateMUIStyledStyledEngine,
|
|
4
4
|
CSSInterpolation,
|
|
5
5
|
} from '@mui/styled-engine';
|
|
6
|
-
import styleFunctionSx, { SxProps } from '
|
|
7
|
-
import { Theme as DefaultTheme } from '
|
|
6
|
+
import styleFunctionSx, { SxProps } from '../styleFunctionSx';
|
|
7
|
+
import { Theme as DefaultTheme } from '../createTheme';
|
|
8
8
|
|
|
9
9
|
export function shouldForwardProp(propName: PropertyKey): boolean;
|
|
10
10
|
|
|
@@ -8,8 +8,8 @@ import styledEngineStyled, { internal_processStyles as processStyles } from '@mu
|
|
|
8
8
|
import { isPlainObject } from '@mui/utils/deepmerge';
|
|
9
9
|
import capitalize from '@mui/utils/capitalize';
|
|
10
10
|
import getDisplayName from '@mui/utils/getDisplayName';
|
|
11
|
-
import createTheme from '
|
|
12
|
-
import styleFunctionSx from '
|
|
11
|
+
import createTheme from '../createTheme';
|
|
12
|
+
import styleFunctionSx from '../styleFunctionSx';
|
|
13
13
|
function isEmpty(obj) {
|
|
14
14
|
return Object.keys(obj).length === 0;
|
|
15
15
|
}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = applyStyles;
|
|
7
1
|
/**
|
|
8
2
|
* A universal utility to style components with multiple color modes. Always use it from the theme object.
|
|
9
3
|
* It works with:
|
|
@@ -62,7 +56,7 @@ exports.default = applyStyles;
|
|
|
62
56
|
* })
|
|
63
57
|
*```
|
|
64
58
|
*/
|
|
65
|
-
function applyStyles(key, styles) {
|
|
59
|
+
export default function applyStyles(key, styles) {
|
|
66
60
|
// @ts-expect-error this is 'any' type
|
|
67
61
|
const theme = this;
|
|
68
62
|
if (theme.vars && typeof theme.getColorSchemeSelector === 'function') {
|
|
@@ -31,13 +31,13 @@ export interface Breakpoints {
|
|
|
31
31
|
/**
|
|
32
32
|
* @param key - A breakpoint key (`xs`, `sm`, etc.) or a screen width number in px.
|
|
33
33
|
* @returns A media query string ready to be used with most styling solutions, which matches screen widths greater than the screen size given by the breakpoint key (inclusive).
|
|
34
|
-
* @see [API documentation](https://mui.com/material-ui/customization/breakpoints/#theme-breakpoints-up-key-media-query)
|
|
34
|
+
* @see [API documentation](https://next.mui.com/material-ui/customization/breakpoints/#theme-breakpoints-up-key-media-query)
|
|
35
35
|
*/
|
|
36
36
|
up: (key: Breakpoint | number) => string;
|
|
37
37
|
/**
|
|
38
38
|
* @param key - A breakpoint key (`xs`, `sm`, etc.) or a screen width number in px.
|
|
39
39
|
* @returns A media query string ready to be used with most styling solutions, which matches screen widths less than the screen size given by the breakpoint key (exclusive).
|
|
40
|
-
* @see [API documentation](https://mui.com/material-ui/customization/breakpoints/#theme-breakpoints-down-key-media-query)
|
|
40
|
+
* @see [API documentation](https://next.mui.com/material-ui/customization/breakpoints/#theme-breakpoints-down-key-media-query)
|
|
41
41
|
*/
|
|
42
42
|
down: (key: Breakpoint | number) => string;
|
|
43
43
|
/**
|
|
@@ -45,14 +45,14 @@ export interface Breakpoints {
|
|
|
45
45
|
* @param end - A breakpoint key (`xs`, `sm`, etc.) or a screen width number in px.
|
|
46
46
|
* @returns A media query string ready to be used with most styling solutions, which matches screen widths greater than
|
|
47
47
|
* the screen size given by the breakpoint key in the first argument (inclusive) and less than the screen size given by the breakpoint key in the second argument (exclusive).
|
|
48
|
-
* @see [API documentation](https://mui.com/material-ui/customization/breakpoints/#theme-breakpoints-between-start-end-media-query)
|
|
48
|
+
* @see [API documentation](https://next.mui.com/material-ui/customization/breakpoints/#theme-breakpoints-between-start-end-media-query)
|
|
49
49
|
*/
|
|
50
50
|
between: (start: Breakpoint | number, end: Breakpoint | number) => string;
|
|
51
51
|
/**
|
|
52
52
|
* @param key - A breakpoint key (`xs`, `sm`, etc.) or a screen width number in px.
|
|
53
53
|
* @returns A media query string ready to be used with most styling solutions, which matches screen widths starting from
|
|
54
54
|
* the screen size given by the breakpoint key (inclusive) and stopping at the screen size given by the next breakpoint key (exclusive).
|
|
55
|
-
* @see [API documentation](https://mui.com/material-ui/customization/breakpoints/#theme-breakpoints-only-key-media-query)
|
|
55
|
+
* @see [API documentation](https://next.mui.com/material-ui/customization/breakpoints/#theme-breakpoints-only-key-media-query)
|
|
56
56
|
*/
|
|
57
57
|
only: (key: Breakpoint) => string;
|
|
58
58
|
/**
|
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.breakpointKeys = void 0;
|
|
8
|
-
exports.default = createBreakpoints;
|
|
9
|
-
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
11
3
|
const _excluded = ["values", "unit", "step"];
|
|
12
4
|
// Sorted ASC by size. That's important.
|
|
13
5
|
// It can't be configured as it's used statically for propTypes.
|
|
14
|
-
const breakpointKeys =
|
|
6
|
+
export const breakpointKeys = ['xs', 'sm', 'md', 'lg', 'xl'];
|
|
15
7
|
const sortBreakpointsValues = values => {
|
|
16
8
|
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
17
9
|
key,
|
|
@@ -20,14 +12,14 @@ const sortBreakpointsValues = values => {
|
|
|
20
12
|
// Sort in ascending order
|
|
21
13
|
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
22
14
|
return breakpointsAsArray.reduce((acc, obj) => {
|
|
23
|
-
return (
|
|
15
|
+
return _extends({}, acc, {
|
|
24
16
|
[obj.key]: obj.val
|
|
25
17
|
});
|
|
26
18
|
}, {});
|
|
27
19
|
};
|
|
28
20
|
|
|
29
21
|
// Keep in mind that @media is inclusive by the CSS specification.
|
|
30
|
-
function createBreakpoints(breakpoints) {
|
|
22
|
+
export default function createBreakpoints(breakpoints) {
|
|
31
23
|
const {
|
|
32
24
|
// The breakpoint **start** at this value.
|
|
33
25
|
// For instance with the first breakpoint xs: [xs, sm).
|
|
@@ -45,7 +37,7 @@ function createBreakpoints(breakpoints) {
|
|
|
45
37
|
unit = 'px',
|
|
46
38
|
step = 5
|
|
47
39
|
} = breakpoints,
|
|
48
|
-
other = (
|
|
40
|
+
other = _objectWithoutPropertiesLoose(breakpoints, _excluded);
|
|
49
41
|
const sortedValues = sortBreakpointsValues(values);
|
|
50
42
|
const keys = Object.keys(sortedValues);
|
|
51
43
|
function up(key) {
|
|
@@ -77,7 +69,7 @@ function createBreakpoints(breakpoints) {
|
|
|
77
69
|
}
|
|
78
70
|
return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
|
|
79
71
|
}
|
|
80
|
-
return (
|
|
72
|
+
return _extends({
|
|
81
73
|
keys,
|
|
82
74
|
values: sortedValues,
|
|
83
75
|
up,
|