@mui/system 5.15.14 → 6.0.0-alpha.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.js +11 -17
- package/Box/boxClasses.js +3 -10
- package/Box/index.js +3 -35
- package/Box/package.json +2 -2
- package/CHANGELOG.md +80 -1
- 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/{esm → colorManipulator}/colorManipulator.js +1 -1
- 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.js +3 -8
- 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 +67 -110
- package/cssVars/createCssVarsTheme.d.ts +2 -7
- package/cssVars/createCssVarsTheme.js +10 -20
- package/cssVars/createGetCssVar.js +1 -7
- package/cssVars/cssVarsParser.js +3 -13
- 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.js → colorManipulator/colorManipulator.js} +1 -1
- 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/{cssGrid.js → cssGrid/cssGrid.js} +5 -5
- package/legacy/cssGrid/index.js +4 -0
- package/legacy/cssVars/createCssVarsProvider.js +33 -62
- package/legacy/cssVars/createCssVarsTheme.js +7 -7
- 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} +5 -5
- 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.js → colorManipulator/colorManipulator.js} +1 -1
- 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/{cssGrid.js → cssGrid/cssGrid.js} +5 -5
- package/modern/cssGrid/index.js +4 -0
- package/modern/cssVars/createCssVarsProvider.js +26 -60
- package/modern/cssVars/createCssVarsTheme.js +7 -10
- 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/modern/{spacing.js → spacing/spacing.js} +5 -5
- 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/{colorManipulator.js → node/colorManipulator/colorManipulator.js} +1 -1
- 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 +8 -3
- 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 +76 -99
- package/node/cssVars/createCssVarsTheme.js +20 -0
- package/{esm → node}/cssVars/createGetCssVar.js +7 -1
- package/{esm → node}/cssVars/cssVarsParser.js +13 -3
- 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} +5 -5
- 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 +5 -5
- 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/{esm → spacing}/spacing.js +6 -7
- 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/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/{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/{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,80 +1,99 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const _excluded = ["colorSchemes", "components", "defaultColorScheme"];
|
|
14
|
-
function prepareCssVars(theme, parserConfig) {
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _toPropertyKey from "@babel/runtime/helpers/esm/toPropertyKey";
|
|
3
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
+
const _excluded = ["getSelector"],
|
|
5
|
+
_excluded2 = ["colorSchemes", "components", "defaultColorScheme"];
|
|
6
|
+
import deepmerge from '@mui/utils/deepmerge';
|
|
7
|
+
import cssVarsParser from './cssVarsParser';
|
|
8
|
+
function prepareCssVars(theme, _ref = {}) {
|
|
9
|
+
let {
|
|
10
|
+
getSelector
|
|
11
|
+
} = _ref,
|
|
12
|
+
parserConfig = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
15
13
|
// @ts-ignore - ignore components do not exist
|
|
16
14
|
const {
|
|
17
15
|
colorSchemes = {},
|
|
18
16
|
defaultColorScheme = 'light'
|
|
19
17
|
} = theme,
|
|
20
|
-
otherTheme = (
|
|
18
|
+
otherTheme = _objectWithoutPropertiesLoose(theme, _excluded2);
|
|
21
19
|
const {
|
|
22
20
|
vars: rootVars,
|
|
23
21
|
css: rootCss,
|
|
24
22
|
varsWithDefaults: rootVarsWithDefaults
|
|
25
|
-
} = (
|
|
23
|
+
} = cssVarsParser(otherTheme, parserConfig);
|
|
26
24
|
let themeVars = rootVarsWithDefaults;
|
|
27
25
|
const colorSchemesMap = {};
|
|
28
26
|
const {
|
|
29
|
-
[defaultColorScheme]:
|
|
27
|
+
[defaultColorScheme]: defaultScheme
|
|
30
28
|
} = colorSchemes,
|
|
31
|
-
otherColorSchemes = (
|
|
29
|
+
otherColorSchemes = _objectWithoutPropertiesLoose(colorSchemes, [defaultColorScheme].map(_toPropertyKey));
|
|
32
30
|
Object.entries(otherColorSchemes || {}).forEach(([key, scheme]) => {
|
|
33
31
|
const {
|
|
34
32
|
vars,
|
|
35
33
|
css,
|
|
36
34
|
varsWithDefaults
|
|
37
|
-
} = (
|
|
38
|
-
themeVars = (
|
|
35
|
+
} = cssVarsParser(scheme, parserConfig);
|
|
36
|
+
themeVars = deepmerge(themeVars, varsWithDefaults);
|
|
39
37
|
colorSchemesMap[key] = {
|
|
40
38
|
css,
|
|
41
39
|
vars
|
|
42
40
|
};
|
|
43
41
|
});
|
|
44
|
-
if (
|
|
42
|
+
if (defaultScheme) {
|
|
45
43
|
// default color scheme vars should be merged last to set as default
|
|
46
44
|
const {
|
|
47
45
|
css,
|
|
48
46
|
vars,
|
|
49
47
|
varsWithDefaults
|
|
50
|
-
} = (
|
|
51
|
-
themeVars = (
|
|
48
|
+
} = cssVarsParser(defaultScheme, parserConfig);
|
|
49
|
+
themeVars = deepmerge(themeVars, varsWithDefaults);
|
|
52
50
|
colorSchemesMap[defaultColorScheme] = {
|
|
53
51
|
css,
|
|
54
52
|
vars
|
|
55
53
|
};
|
|
56
54
|
}
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
55
|
+
const generateThemeVars = () => {
|
|
56
|
+
let vars = _extends({}, rootVars);
|
|
57
|
+
Object.entries(colorSchemesMap).forEach(([, {
|
|
58
|
+
vars: schemeVars
|
|
59
|
+
}]) => {
|
|
60
|
+
vars = deepmerge(vars, schemeVars);
|
|
61
|
+
});
|
|
62
|
+
return vars;
|
|
63
|
+
};
|
|
64
|
+
const generateStyleSheets = () => {
|
|
65
|
+
const stylesheets = [];
|
|
66
|
+
const colorScheme = theme.defaultColorScheme || 'light';
|
|
67
|
+
function insertStyleSheet(selector, css) {
|
|
68
|
+
if (Object.keys(css).length) {
|
|
69
|
+
stylesheets.push(typeof selector === 'string' ? {
|
|
70
|
+
[selector]: _extends({}, css)
|
|
71
|
+
} : selector);
|
|
72
|
+
}
|
|
67
73
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
insertStyleSheet(getSelector?.(undefined, _extends({}, rootCss)) || ':root', rootCss);
|
|
75
|
+
const {
|
|
76
|
+
[colorScheme]: defaultSchemeVal
|
|
77
|
+
} = colorSchemesMap,
|
|
78
|
+
rest = _objectWithoutPropertiesLoose(colorSchemesMap, [colorScheme].map(_toPropertyKey));
|
|
79
|
+
if (defaultSchemeVal) {
|
|
80
|
+
// default color scheme has to come before other color schemes
|
|
81
|
+
const {
|
|
82
|
+
css
|
|
83
|
+
} = defaultSchemeVal;
|
|
84
|
+
insertStyleSheet(getSelector?.(colorScheme, _extends({}, css)) || `[${theme.attribute || 'data-color-scheme'}="${colorScheme}"]`, css);
|
|
85
|
+
}
|
|
86
|
+
Object.entries(rest).forEach(([key, {
|
|
87
|
+
css
|
|
88
|
+
}]) => {
|
|
89
|
+
insertStyleSheet(getSelector?.(key, _extends({}, css)) || `[${theme.attribute || 'data-color-scheme'}="${key}"]`, css);
|
|
90
|
+
});
|
|
91
|
+
return stylesheets;
|
|
74
92
|
};
|
|
75
93
|
return {
|
|
76
94
|
vars: themeVars,
|
|
77
|
-
|
|
95
|
+
generateThemeVars,
|
|
96
|
+
generateStyleSheets
|
|
78
97
|
};
|
|
79
98
|
}
|
|
80
|
-
|
|
99
|
+
export default prepareCssVars;
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
'use client';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.default = useCurrentColorScheme;
|
|
9
|
-
exports.getColorScheme = getColorScheme;
|
|
10
|
-
exports.getSystemMode = getSystemMode;
|
|
11
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
-
var React = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _getInitColorSchemeScript = require("./getInitColorSchemeScript");
|
|
14
|
-
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); }
|
|
15
|
-
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; }
|
|
16
|
-
function getSystemMode(mode) {
|
|
3
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { DEFAULT_MODE_STORAGE_KEY, DEFAULT_COLOR_SCHEME_STORAGE_KEY } from './getInitColorSchemeScript';
|
|
6
|
+
export function getSystemMode(mode) {
|
|
17
7
|
if (typeof window !== 'undefined' && mode === 'system') {
|
|
18
8
|
const mql = window.matchMedia('(prefers-color-scheme: dark)');
|
|
19
9
|
if (mql.matches) {
|
|
@@ -32,7 +22,7 @@ function processState(state, callback) {
|
|
|
32
22
|
}
|
|
33
23
|
return undefined;
|
|
34
24
|
}
|
|
35
|
-
function getColorScheme(state) {
|
|
25
|
+
export function getColorScheme(state) {
|
|
36
26
|
return processState(state, mode => {
|
|
37
27
|
if (mode === 'light') {
|
|
38
28
|
return state.lightColorScheme;
|
|
@@ -59,14 +49,14 @@ function initializeValue(key, defaultValue) {
|
|
|
59
49
|
}
|
|
60
50
|
return value || defaultValue;
|
|
61
51
|
}
|
|
62
|
-
function useCurrentColorScheme(options) {
|
|
52
|
+
export default function useCurrentColorScheme(options) {
|
|
63
53
|
const {
|
|
64
54
|
defaultMode = 'light',
|
|
65
55
|
defaultLightColorScheme,
|
|
66
56
|
defaultDarkColorScheme,
|
|
67
57
|
supportedColorSchemes = [],
|
|
68
|
-
modeStorageKey =
|
|
69
|
-
colorSchemeStorageKey =
|
|
58
|
+
modeStorageKey = DEFAULT_MODE_STORAGE_KEY,
|
|
59
|
+
colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,
|
|
70
60
|
storageWindow = typeof window === 'undefined' ? undefined : window
|
|
71
61
|
} = options;
|
|
72
62
|
const joinedColorSchemes = supportedColorSchemes.join(',');
|
|
@@ -88,13 +78,13 @@ function useCurrentColorScheme(options) {
|
|
|
88
78
|
// do nothing if mode does not change
|
|
89
79
|
return currentState;
|
|
90
80
|
}
|
|
91
|
-
const newMode = mode
|
|
81
|
+
const newMode = mode ?? defaultMode;
|
|
92
82
|
try {
|
|
93
83
|
localStorage.setItem(modeStorageKey, newMode);
|
|
94
84
|
} catch (e) {
|
|
95
85
|
// Unsupported
|
|
96
86
|
}
|
|
97
|
-
return (
|
|
87
|
+
return _extends({}, currentState, {
|
|
98
88
|
mode: newMode,
|
|
99
89
|
systemMode: getSystemMode(newMode)
|
|
100
90
|
});
|
|
@@ -109,7 +99,7 @@ function useCurrentColorScheme(options) {
|
|
|
109
99
|
} catch (e) {
|
|
110
100
|
// Unsupported
|
|
111
101
|
}
|
|
112
|
-
return (
|
|
102
|
+
return _extends({}, currentState, {
|
|
113
103
|
lightColorScheme: defaultLightColorScheme,
|
|
114
104
|
darkColorScheme: defaultDarkColorScheme
|
|
115
105
|
});
|
|
@@ -119,7 +109,7 @@ function useCurrentColorScheme(options) {
|
|
|
119
109
|
console.error(`\`${value}\` does not exist in \`theme.colorSchemes\`.`);
|
|
120
110
|
} else {
|
|
121
111
|
setState(currentState => {
|
|
122
|
-
const newState = (
|
|
112
|
+
const newState = _extends({}, currentState);
|
|
123
113
|
processState(currentState, mode => {
|
|
124
114
|
try {
|
|
125
115
|
localStorage.setItem(`${colorSchemeStorageKey}-${mode}`, value);
|
|
@@ -138,7 +128,7 @@ function useCurrentColorScheme(options) {
|
|
|
138
128
|
}
|
|
139
129
|
} else {
|
|
140
130
|
setState(currentState => {
|
|
141
|
-
const newState = (
|
|
131
|
+
const newState = _extends({}, currentState);
|
|
142
132
|
const newLightColorScheme = value.light === null ? defaultLightColorScheme : value.light;
|
|
143
133
|
const newDarkColorScheme = value.dark === null ? defaultDarkColorScheme : value.dark;
|
|
144
134
|
if (newLightColorScheme) {
|
|
@@ -172,13 +162,13 @@ function useCurrentColorScheme(options) {
|
|
|
172
162
|
const handleMediaQuery = React.useCallback(event => {
|
|
173
163
|
if (state.mode === 'system') {
|
|
174
164
|
setState(currentState => {
|
|
175
|
-
const systemMode = event
|
|
165
|
+
const systemMode = event?.matches ? 'dark' : 'light';
|
|
176
166
|
|
|
177
167
|
// Early exit, nothing changed.
|
|
178
168
|
if (currentState.systemMode === systemMode) {
|
|
179
169
|
return currentState;
|
|
180
170
|
}
|
|
181
|
-
return (
|
|
171
|
+
return _extends({}, currentState, {
|
|
182
172
|
systemMode
|
|
183
173
|
});
|
|
184
174
|
});
|
|
@@ -232,7 +222,7 @@ function useCurrentColorScheme(options) {
|
|
|
232
222
|
}
|
|
233
223
|
return undefined;
|
|
234
224
|
}, [setColorScheme, setMode, modeStorageKey, colorSchemeStorageKey, joinedColorSchemes, defaultMode, storageWindow]);
|
|
235
|
-
return (
|
|
225
|
+
return _extends({}, state, {
|
|
236
226
|
colorScheme,
|
|
237
227
|
setMode,
|
|
238
228
|
setColorScheme
|
package/display/index.js
ADDED
package/flexbox/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getThemeValue(prop: string, value: any, theme: object): any;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import borders from '
|
|
2
|
-
import display from '
|
|
3
|
-
import flexbox from '
|
|
4
|
-
import grid from '
|
|
5
|
-
import positions from '
|
|
6
|
-
import palette from '
|
|
7
|
-
import shadows from '
|
|
8
|
-
import sizing from '
|
|
9
|
-
import spacing from '
|
|
10
|
-
import typography from '
|
|
1
|
+
import borders from '../borders';
|
|
2
|
+
import display from '../display';
|
|
3
|
+
import flexbox from '../flexbox';
|
|
4
|
+
import grid from '../cssGrid';
|
|
5
|
+
import positions from '../positions';
|
|
6
|
+
import palette from '../palette';
|
|
7
|
+
import shadows from '../shadows';
|
|
8
|
+
import sizing from '../sizing';
|
|
9
|
+
import spacing from '../spacing';
|
|
10
|
+
import typography from '../typography';
|
|
11
11
|
const filterPropsMapping = {
|
|
12
12
|
borders: borders.filterProps,
|
|
13
13
|
display: display.filterProps,
|
package/index.d.ts
CHANGED
|
@@ -1,91 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ComposedStyleFunction,
|
|
3
|
-
StyleFunction,
|
|
4
|
-
PropsFor,
|
|
5
|
-
SimpleStyleFunction,
|
|
6
|
-
borders,
|
|
7
|
-
display,
|
|
8
|
-
flexbox,
|
|
9
|
-
grid,
|
|
10
|
-
palette,
|
|
11
|
-
positions,
|
|
12
|
-
shadows,
|
|
13
|
-
sizing,
|
|
14
|
-
typography,
|
|
15
|
-
} from './Box';
|
|
16
1
|
// disable automatic export
|
|
17
2
|
export {};
|
|
18
3
|
|
|
19
|
-
|
|
20
|
-
export const border: SimpleStyleFunction<'border'>;
|
|
21
|
-
export const borderTop: SimpleStyleFunction<'borderTop'>;
|
|
22
|
-
export const borderRight: SimpleStyleFunction<'borderRight'>;
|
|
23
|
-
export const borderBottom: SimpleStyleFunction<'borderBottom'>;
|
|
24
|
-
export const borderLeft: SimpleStyleFunction<'borderLeft'>;
|
|
25
|
-
export const borderColor: SimpleStyleFunction<'borderColor'>;
|
|
26
|
-
export const borderTopColor: SimpleStyleFunction<'borderTopColor'>;
|
|
27
|
-
export const borderRightColor: SimpleStyleFunction<'borderRightColor'>;
|
|
28
|
-
export const borderBottomColor: SimpleStyleFunction<'borderBottomColor'>;
|
|
29
|
-
export const borderLeftColor: SimpleStyleFunction<'borderLeftColor'>;
|
|
30
|
-
export const borderRadius: SimpleStyleFunction<'borderRadius'>;
|
|
31
|
-
export type BordersProps = PropsFor<typeof borders>;
|
|
32
|
-
|
|
33
|
-
// breakpoints.js
|
|
34
|
-
type DefaultBreakPoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
35
|
-
export { handleBreakpoints, mergeBreakpointsInOrder } from './breakpoints';
|
|
4
|
+
export * from './borders';
|
|
36
5
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
export
|
|
58
|
-
|
|
59
|
-
export type PositionsProps = PropsFor<typeof positions>;
|
|
60
|
-
|
|
61
|
-
export type ShadowsProps = PropsFor<typeof shadows>;
|
|
62
|
-
|
|
63
|
-
// * sizing.js TODO
|
|
64
|
-
export const width: SimpleStyleFunction<'width'>;
|
|
65
|
-
export const maxWidth: SimpleStyleFunction<'maxWidth'>;
|
|
66
|
-
export const minWidth: SimpleStyleFunction<'minWidth'>;
|
|
67
|
-
export const height: SimpleStyleFunction<'height'>;
|
|
68
|
-
export const maxHeight: SimpleStyleFunction<'maxHeight'>;
|
|
69
|
-
export const minHeight: SimpleStyleFunction<'minHeight'>;
|
|
70
|
-
export const sizeWidth: SimpleStyleFunction<'sizeWidth'>;
|
|
71
|
-
export const sizeHeight: SimpleStyleFunction<'sizeHeight'>;
|
|
72
|
-
export const boxSizing: SimpleStyleFunction<'boxSizing'>;
|
|
73
|
-
export type SizingProps = PropsFor<typeof sizing>;
|
|
74
|
-
|
|
75
|
-
// typography.js
|
|
76
|
-
export const typographyVariant: SimpleStyleFunction<'typography'>;
|
|
77
|
-
export const fontFamily: SimpleStyleFunction<'fontFamily'>;
|
|
78
|
-
export const fontSize: SimpleStyleFunction<'fontSize'>;
|
|
79
|
-
export const fontStyle: SimpleStyleFunction<'fontStyle'>;
|
|
80
|
-
export const fontWeight: SimpleStyleFunction<'fontWeight'>;
|
|
81
|
-
export const letterSpacing: SimpleStyleFunction<'letterSpacing'>;
|
|
82
|
-
export const lineHeight: SimpleStyleFunction<'lineHeight'>;
|
|
83
|
-
export const textAlign: SimpleStyleFunction<'textAlign'>;
|
|
84
|
-
export const textTransform: SimpleStyleFunction<'textTransform'>;
|
|
85
|
-
export type TypographyProps = PropsFor<typeof typography>;
|
|
6
|
+
export { default as breakpoints, handleBreakpoints, mergeBreakpointsInOrder } from './breakpoints';
|
|
7
|
+
|
|
8
|
+
export { default as compose } from './compose';
|
|
9
|
+
|
|
10
|
+
export * from './display';
|
|
11
|
+
|
|
12
|
+
export * from './flexbox';
|
|
13
|
+
|
|
14
|
+
export * from './cssGrid';
|
|
15
|
+
|
|
16
|
+
export * from './palette';
|
|
17
|
+
|
|
18
|
+
export * from './positions';
|
|
19
|
+
|
|
20
|
+
export * from './shadows';
|
|
21
|
+
|
|
22
|
+
export * from './sizing';
|
|
23
|
+
|
|
24
|
+
export * from './typography';
|
|
25
|
+
|
|
26
|
+
export { default as unstable_getThemeValue } from './getThemeValue';
|
|
86
27
|
|
|
87
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
88
|
-
export function unstable_getThemeValue(prop: string, value: any, theme: object): any;
|
|
89
28
|
/**
|
|
90
29
|
* The `css` function accepts arrays as values for mobile-first responsive styles.
|
|
91
30
|
* Note that this extends to non-theme values also. For example `display=['none', 'block']`
|