@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.
Files changed (436) hide show
  1. package/Box/Box.js +11 -17
  2. package/Box/boxClasses.js +3 -10
  3. package/Box/index.js +3 -35
  4. package/Box/package.json +2 -2
  5. package/CHANGELOG.md +169 -3
  6. package/Container/Container.d.ts +1 -1
  7. package/Container/Container.js +12 -17
  8. package/Container/ContainerProps.js +1 -5
  9. package/Container/containerClasses.js +6 -14
  10. package/Container/createContainer.js +34 -43
  11. package/Container/index.js +3 -35
  12. package/Container/package.json +2 -2
  13. package/GlobalStyles/GlobalStyles.js +11 -19
  14. package/GlobalStyles/index.js +2 -25
  15. package/GlobalStyles/package.json +2 -2
  16. package/README.md +2 -2
  17. package/RtlProvider/index.js +13 -23
  18. package/RtlProvider/package.json +2 -2
  19. package/Stack/Stack.d.ts +1 -1
  20. package/Stack/Stack.js +11 -17
  21. package/Stack/StackProps.js +1 -5
  22. package/Stack/createStack.d.ts +2 -2
  23. package/Stack/createStack.js +40 -51
  24. package/Stack/index.js +5 -55
  25. package/Stack/package.json +2 -2
  26. package/Stack/stackClasses.js +6 -14
  27. package/ThemeProvider/ThemeProvider.js +22 -30
  28. package/ThemeProvider/index.js +1 -12
  29. package/ThemeProvider/package.json +2 -2
  30. package/Unstable_Grid/Grid.d.ts +1 -1
  31. package/Unstable_Grid/Grid.js +25 -31
  32. package/Unstable_Grid/GridProps.js +1 -5
  33. package/Unstable_Grid/createGrid.d.ts +2 -2
  34. package/Unstable_Grid/createGrid.js +59 -70
  35. package/Unstable_Grid/gridClasses.js +6 -14
  36. package/Unstable_Grid/gridGenerator.js +24 -43
  37. package/Unstable_Grid/index.js +6 -63
  38. package/Unstable_Grid/package.json +2 -2
  39. package/Unstable_Grid/traverseBreakpoints.d.ts +1 -1
  40. package/Unstable_Grid/traverseBreakpoints.js +3 -11
  41. package/borders/borders.d.ts +14 -0
  42. package/{esm → borders}/borders.js +5 -5
  43. package/borders/index.d.ts +2 -0
  44. package/borders/index.js +4 -0
  45. package/borders/package.json +6 -0
  46. package/{breakpoints.d.ts → breakpoints/breakpoints.d.ts} +13 -3
  47. package/{modern → breakpoints}/breakpoints.js +1 -1
  48. package/breakpoints/index.d.ts +2 -0
  49. package/breakpoints/index.js +4 -0
  50. package/breakpoints/package.json +6 -0
  51. package/colorManipulator/index.d.ts +1 -0
  52. package/colorManipulator/index.js +3 -0
  53. package/colorManipulator/package.json +6 -0
  54. package/compose/compose.d.ts +5 -0
  55. package/{modern → compose}/compose.js +1 -1
  56. package/compose/index.d.ts +1 -0
  57. package/compose/index.js +3 -0
  58. package/compose/package.json +6 -0
  59. package/{createBox.d.ts → createBox/createBox.d.ts} +2 -2
  60. package/{modern → createBox}/createBox.js +2 -2
  61. package/createBox/index.d.ts +1 -0
  62. package/createBox/index.js +3 -0
  63. package/createBox/package.json +6 -0
  64. package/{createStyled.d.ts → createStyled/createStyled.d.ts} +2 -2
  65. package/{modern → createStyled}/createStyled.js +2 -2
  66. package/createStyled/index.d.ts +2 -0
  67. package/createStyled/index.js +4 -0
  68. package/createStyled/package.json +6 -0
  69. package/createTheme/applyStyles.js +1 -7
  70. package/createTheme/createBreakpoints.d.ts +4 -4
  71. package/createTheme/createBreakpoints.js +7 -15
  72. package/createTheme/createSpacing.d.ts +2 -2
  73. package/createTheme/createSpacing.js +8 -14
  74. package/createTheme/createTheme.js +20 -27
  75. package/createTheme/index.js +3 -27
  76. package/createTheme/package.json +2 -2
  77. package/createTheme/shape.js +1 -7
  78. package/cssGrid/cssGrid.d.ts +3 -0
  79. package/{esm → cssGrid}/cssGrid.js +5 -5
  80. package/cssGrid/index.d.ts +2 -0
  81. package/cssGrid/index.js +4 -0
  82. package/cssGrid/package.json +6 -0
  83. package/cssVars/createCssVarsProvider.d.ts +0 -8
  84. package/cssVars/createCssVarsProvider.js +70 -110
  85. package/cssVars/createCssVarsTheme.d.ts +2 -7
  86. package/cssVars/createCssVarsTheme.js +10 -20
  87. package/cssVars/createGetCssVar.js +1 -7
  88. package/cssVars/cssVarsParser.js +6 -15
  89. package/cssVars/getInitColorSchemeScript.js +7 -16
  90. package/cssVars/index.js +4 -33
  91. package/cssVars/package.json +2 -2
  92. package/cssVars/prepareCssVars.d.ts +5 -9
  93. package/cssVars/prepareCssVars.js +60 -41
  94. package/cssVars/useCurrentColorScheme.js +16 -26
  95. package/display/display.d.ts +3 -0
  96. package/{esm → display}/display.js +2 -2
  97. package/display/index.d.ts +2 -0
  98. package/display/index.js +4 -0
  99. package/display/package.json +6 -0
  100. package/flexbox/flexbox.d.ts +3 -0
  101. package/{modern → flexbox}/flexbox.js +2 -2
  102. package/flexbox/index.d.ts +2 -0
  103. package/flexbox/index.js +4 -0
  104. package/flexbox/package.json +6 -0
  105. package/getThemeValue/getThemeValue.d.ts +1 -0
  106. package/{esm → getThemeValue}/getThemeValue.js +10 -10
  107. package/getThemeValue/index.d.ts +2 -0
  108. package/getThemeValue/index.js +4 -0
  109. package/getThemeValue/package.json +6 -0
  110. package/index.d.ts +22 -83
  111. package/index.js +61 -579
  112. package/legacy/{borders.js → borders/borders.js} +5 -5
  113. package/legacy/borders/index.js +4 -0
  114. package/legacy/{breakpoints.js → breakpoints/breakpoints.js} +1 -1
  115. package/legacy/breakpoints/index.js +4 -0
  116. package/legacy/colorManipulator/index.js +3 -0
  117. package/legacy/{compose.js → compose/compose.js} +1 -1
  118. package/legacy/compose/index.js +3 -0
  119. package/legacy/{createBox.js → createBox/createBox.js} +2 -2
  120. package/legacy/createBox/index.js +3 -0
  121. package/legacy/{createStyled.js → createStyled/createStyled.js} +2 -2
  122. package/legacy/createStyled/index.js +4 -0
  123. package/legacy/createTheme/createSpacing.js +3 -7
  124. package/legacy/{cssGrid.js → cssGrid/cssGrid.js} +5 -5
  125. package/legacy/cssGrid/index.js +4 -0
  126. package/legacy/cssVars/createCssVarsProvider.js +36 -62
  127. package/legacy/cssVars/createCssVarsTheme.js +7 -7
  128. package/legacy/cssVars/cssVarsParser.js +3 -2
  129. package/legacy/cssVars/prepareCssVars.js +45 -25
  130. package/legacy/{display.js → display/display.js} +2 -2
  131. package/legacy/display/index.js +4 -0
  132. package/legacy/{flexbox.js → flexbox/flexbox.js} +2 -2
  133. package/legacy/flexbox/index.js +4 -0
  134. package/legacy/{getThemeValue.js → getThemeValue/getThemeValue.js} +10 -10
  135. package/legacy/getThemeValue/index.js +4 -0
  136. package/legacy/index.js +1 -1
  137. package/legacy/memoize/index.js +3 -0
  138. package/legacy/merge/index.js +3 -0
  139. package/legacy/palette/index.js +4 -0
  140. package/legacy/{palette.js → palette/palette.js} +2 -2
  141. package/legacy/positions/index.js +4 -0
  142. package/legacy/{positions.js → positions/positions.js} +2 -2
  143. package/legacy/propsToClassKey/index.js +3 -0
  144. package/legacy/responsivePropType/index.js +3 -0
  145. package/legacy/shadows/index.js +3 -0
  146. package/legacy/{shadows.js → shadows/shadows.js} +1 -1
  147. package/legacy/sizing/index.js +4 -0
  148. package/legacy/{sizing.js → sizing/sizing.js} +3 -3
  149. package/legacy/spacing/index.js +4 -0
  150. package/legacy/{spacing.js → spacing/spacing.js} +29 -26
  151. package/legacy/style/index.js +4 -0
  152. package/legacy/{style.js → style/style.js} +2 -2
  153. package/legacy/styled/index.js +3 -0
  154. package/legacy/styled/styled.js +3 -0
  155. package/legacy/typography/index.js +4 -0
  156. package/legacy/{typography.js → typography/typography.js} +2 -2
  157. package/legacy/useTheme/index.js +4 -0
  158. package/legacy/{useTheme.js → useTheme/useTheme.js} +2 -2
  159. package/legacy/useThemeWithoutDefault/index.js +3 -0
  160. package/memoize/index.d.ts +1 -0
  161. package/memoize/index.js +3 -0
  162. package/memoize/memoize.d.ts +3 -0
  163. package/memoize/package.json +6 -0
  164. package/merge/index.d.ts +1 -0
  165. package/merge/index.js +3 -0
  166. package/merge/package.json +6 -0
  167. package/modern/{borders.js → borders/borders.js} +5 -5
  168. package/modern/borders/index.js +4 -0
  169. package/{esm → modern/breakpoints}/breakpoints.js +2 -3
  170. package/modern/breakpoints/index.js +4 -0
  171. package/modern/colorManipulator/index.js +3 -0
  172. package/{esm → modern/compose}/compose.js +1 -1
  173. package/modern/compose/index.js +3 -0
  174. package/{esm → modern/createBox}/createBox.js +2 -2
  175. package/modern/createBox/index.js +3 -0
  176. package/{esm → modern/createStyled}/createStyled.js +5 -6
  177. package/modern/createStyled/index.js +4 -0
  178. package/modern/createTheme/createSpacing.js +7 -8
  179. package/modern/{cssGrid.js → cssGrid/cssGrid.js} +5 -5
  180. package/modern/cssGrid/index.js +4 -0
  181. package/modern/cssVars/createCssVarsProvider.js +29 -60
  182. package/modern/cssVars/createCssVarsTheme.js +7 -10
  183. package/modern/cssVars/cssVarsParser.js +3 -2
  184. package/modern/cssVars/prepareCssVars.js +49 -21
  185. package/modern/{display.js → display/display.js} +2 -2
  186. package/modern/display/index.js +4 -0
  187. package/{esm → modern/flexbox}/flexbox.js +2 -2
  188. package/modern/flexbox/index.js +4 -0
  189. package/modern/{getThemeValue.js → getThemeValue/getThemeValue.js} +10 -10
  190. package/modern/getThemeValue/index.js +4 -0
  191. package/modern/index.js +1 -1
  192. package/modern/memoize/index.js +3 -0
  193. package/modern/merge/index.js +3 -0
  194. package/modern/palette/index.js +4 -0
  195. package/{esm → modern/palette}/palette.js +2 -2
  196. package/modern/positions/index.js +4 -0
  197. package/modern/{positions.js → positions/positions.js} +2 -2
  198. package/modern/propsToClassKey/index.js +3 -0
  199. package/modern/responsivePropType/index.js +3 -0
  200. package/modern/shadows/index.js +3 -0
  201. package/{esm → modern/shadows}/shadows.js +1 -1
  202. package/modern/sizing/index.js +4 -0
  203. package/modern/{sizing.js → sizing/sizing.js} +3 -3
  204. package/modern/spacing/index.js +4 -0
  205. package/{esm → modern/spacing}/spacing.js +29 -27
  206. package/modern/style/index.js +4 -0
  207. package/modern/{style.js → style/style.js} +2 -2
  208. package/modern/styled/index.js +3 -0
  209. package/modern/styled/styled.js +3 -0
  210. package/modern/typography/index.js +4 -0
  211. package/modern/{typography.js → typography/typography.js} +2 -2
  212. package/modern/useTheme/index.js +4 -0
  213. package/{esm → modern/useTheme}/useTheme.js +2 -2
  214. package/modern/useThemeWithoutDefault/index.js +3 -0
  215. package/node/Box/Box.js +36 -0
  216. package/node/Box/boxClasses.js +10 -0
  217. package/node/Box/index.js +37 -0
  218. package/{esm → node}/Container/Container.js +17 -12
  219. package/node/Container/ContainerProps.js +5 -0
  220. package/node/Container/containerClasses.js +15 -0
  221. package/node/Container/createContainer.js +152 -0
  222. package/node/Container/index.js +37 -0
  223. package/node/GlobalStyles/GlobalStyles.js +45 -0
  224. package/node/GlobalStyles/index.js +27 -0
  225. package/node/RtlProvider/index.js +35 -0
  226. package/{esm → node}/Stack/Stack.js +17 -11
  227. package/node/Stack/StackProps.js +5 -0
  228. package/node/Stack/createStack.js +184 -0
  229. package/node/Stack/index.js +57 -0
  230. package/node/Stack/stackClasses.js +15 -0
  231. package/{esm → node}/ThemeProvider/ThemeProvider.js +30 -22
  232. package/node/ThemeProvider/index.js +14 -0
  233. package/{esm → node}/Unstable_Grid/Grid.js +31 -25
  234. package/node/Unstable_Grid/GridProps.js +5 -0
  235. package/node/Unstable_Grid/createGrid.js +180 -0
  236. package/{esm → node}/Unstable_Grid/gridClasses.js +14 -6
  237. package/{esm → node}/Unstable_Grid/gridGenerator.js +39 -22
  238. package/node/Unstable_Grid/index.js +65 -0
  239. package/{esm → node}/Unstable_Grid/traverseBreakpoints.js +11 -3
  240. package/{borders.js → node/borders/borders.js} +5 -5
  241. package/node/borders/index.js +27 -0
  242. package/{breakpoints.js → node/breakpoints/breakpoints.js} +1 -1
  243. package/node/breakpoints/index.js +27 -0
  244. package/node/colorManipulator/index.js +17 -0
  245. package/{compose.js → node/compose/compose.js} +1 -1
  246. package/node/compose/index.js +14 -0
  247. package/{createBox.js → node/createBox/createBox.js} +3 -3
  248. package/node/createBox/index.js +14 -0
  249. package/{createStyled.js → node/createStyled/createStyled.js} +3 -3
  250. package/node/createStyled/index.js +27 -0
  251. package/{esm → node}/createTheme/applyStyles.js +7 -1
  252. package/{esm → node}/createTheme/createBreakpoints.js +15 -7
  253. package/{esm → node}/createTheme/createSpacing.js +13 -9
  254. package/node/createTheme/createTheme.js +50 -0
  255. package/node/createTheme/index.js +27 -0
  256. package/node/createTheme/shape.js +10 -0
  257. package/{cssGrid.js → node/cssGrid/cssGrid.js} +5 -5
  258. package/node/cssGrid/index.js +27 -0
  259. package/{esm → node}/cssVars/createCssVarsProvider.js +79 -99
  260. package/node/cssVars/createCssVarsTheme.js +20 -0
  261. package/{esm → node}/cssVars/createGetCssVar.js +7 -1
  262. package/{esm → node}/cssVars/cssVarsParser.js +16 -5
  263. package/node/cssVars/getInitColorSchemeScript.js +53 -0
  264. package/node/cssVars/index.js +35 -0
  265. package/node/cssVars/prepareCssVars.js +106 -0
  266. package/{esm → node}/cssVars/useCurrentColorScheme.js +24 -14
  267. package/{display.js → node/display/display.js} +2 -2
  268. package/node/display/index.js +27 -0
  269. package/{flexbox.js → node/flexbox/flexbox.js} +2 -2
  270. package/node/flexbox/index.js +27 -0
  271. package/{getThemeValue.js → node/getThemeValue/getThemeValue.js} +10 -10
  272. package/node/getThemeValue/index.js +27 -0
  273. package/node/index.js +590 -0
  274. package/node/memoize/index.js +14 -0
  275. package/node/merge/index.js +14 -0
  276. package/node/palette/index.js +27 -0
  277. package/{palette.js → node/palette/palette.js} +2 -2
  278. package/node/positions/index.js +27 -0
  279. package/{positions.js → node/positions/positions.js} +2 -2
  280. package/node/propsToClassKey/index.js +14 -0
  281. package/node/responsivePropType/index.js +14 -0
  282. package/node/shadows/index.js +14 -0
  283. package/{shadows.js → node/shadows/shadows.js} +1 -1
  284. package/node/sizing/index.js +27 -0
  285. package/{sizing.js → node/sizing/sizing.js} +3 -3
  286. package/node/spacing/index.js +27 -0
  287. package/{spacing.js → node/spacing/spacing.js} +29 -26
  288. package/node/style/index.js +27 -0
  289. package/{style.js → node/style/style.js} +2 -2
  290. package/{esm → node}/styleFunctionSx/defaultSxConfig.js +71 -65
  291. package/node/styleFunctionSx/extendSxProp.js +55 -0
  292. package/node/styleFunctionSx/index.js +35 -0
  293. package/{esm → node}/styleFunctionSx/styleFunctionSx.js +26 -18
  294. package/node/styled/index.js +14 -0
  295. package/{styled.js → node/styled/styled.js} +1 -1
  296. package/node/typography/index.js +27 -0
  297. package/{typography.js → node/typography/typography.js} +2 -2
  298. package/node/useMediaQuery/index.js +26 -0
  299. package/{esm → node}/useMediaQuery/useMediaQuery.js +16 -9
  300. package/node/useTheme/index.js +27 -0
  301. package/{useTheme.js → node/useTheme/useTheme.js} +2 -2
  302. package/node/useThemeProps/getThemeProps.js +19 -0
  303. package/node/useThemeProps/index.js +21 -0
  304. package/node/useThemeProps/useThemeProps.js +27 -0
  305. package/node/useThemeWithoutDefault/index.js +14 -0
  306. package/{useThemeWithoutDefault.js → node/useThemeWithoutDefault/useThemeWithoutDefault.js} +1 -1
  307. package/package.json +8 -8
  308. package/palette/index.d.ts +2 -0
  309. package/palette/index.js +4 -0
  310. package/palette/package.json +6 -0
  311. package/palette/palette.d.ts +5 -0
  312. package/{modern → palette}/palette.js +2 -2
  313. package/positions/index.d.ts +2 -0
  314. package/positions/index.js +4 -0
  315. package/positions/package.json +6 -0
  316. package/positions/positions.d.ts +3 -0
  317. package/{esm → positions}/positions.js +2 -2
  318. package/propsToClassKey/index.d.ts +1 -0
  319. package/propsToClassKey/index.js +3 -0
  320. package/propsToClassKey/package.json +6 -0
  321. package/responsivePropType/index.d.ts +1 -0
  322. package/responsivePropType/index.js +3 -0
  323. package/responsivePropType/package.json +6 -0
  324. package/shadows/index.d.ts +1 -0
  325. package/shadows/index.js +3 -0
  326. package/shadows/package.json +6 -0
  327. package/shadows/shadows.d.ts +3 -0
  328. package/{modern → shadows}/shadows.js +1 -1
  329. package/sizing/index.d.ts +2 -0
  330. package/sizing/index.js +4 -0
  331. package/sizing/package.json +6 -0
  332. package/sizing/sizing.d.ts +12 -0
  333. package/{esm → sizing}/sizing.js +5 -6
  334. package/spacing/index.d.ts +2 -0
  335. package/spacing/index.js +4 -0
  336. package/spacing/package.json +6 -0
  337. package/{spacing.d.ts → spacing/spacing.d.ts} +1 -1
  338. package/{modern → spacing}/spacing.js +29 -26
  339. package/style/index.d.ts +2 -0
  340. package/style/index.js +4 -0
  341. package/style/package.json +6 -0
  342. package/{style.d.ts → style/style.d.ts} +1 -1
  343. package/{esm → style}/style.js +2 -2
  344. package/styleFunctionSx/defaultSxConfig.js +65 -71
  345. package/styleFunctionSx/extendSxProp.js +11 -19
  346. package/styleFunctionSx/index.js +4 -35
  347. package/styleFunctionSx/package.json +2 -2
  348. package/styleFunctionSx/styleFunctionSx.js +18 -27
  349. package/styled/index.d.ts +1 -0
  350. package/styled/index.js +3 -0
  351. package/styled/package.json +6 -0
  352. package/{styled.d.ts → styled/styled.d.ts} +1 -1
  353. package/styled/styled.js +3 -0
  354. package/typography/index.d.ts +2 -0
  355. package/typography/index.js +4 -0
  356. package/typography/package.json +6 -0
  357. package/typography/typography.d.ts +12 -0
  358. package/{esm → typography}/typography.js +2 -2
  359. package/useMediaQuery/index.js +2 -26
  360. package/useMediaQuery/package.json +2 -2
  361. package/useMediaQuery/useMediaQuery.js +9 -16
  362. package/useTheme/index.d.ts +2 -0
  363. package/useTheme/index.js +4 -0
  364. package/useTheme/package.json +6 -0
  365. package/{useTheme.d.ts → useTheme/useTheme.d.ts} +1 -1
  366. package/{modern → useTheme}/useTheme.js +2 -2
  367. package/useThemeProps/getThemeProps.js +3 -10
  368. package/useThemeProps/index.js +2 -19
  369. package/useThemeProps/package.json +2 -2
  370. package/useThemeProps/useThemeProps.js +5 -11
  371. package/useThemeWithoutDefault/index.d.ts +1 -0
  372. package/useThemeWithoutDefault/index.js +3 -0
  373. package/useThemeWithoutDefault/package.json +6 -0
  374. package/esm/Box/Box.js +0 -30
  375. package/esm/Box/boxClasses.js +0 -3
  376. package/esm/Box/index.js +0 -5
  377. package/esm/Container/ContainerProps.js +0 -1
  378. package/esm/Container/containerClasses.js +0 -7
  379. package/esm/Container/createContainer.js +0 -143
  380. package/esm/Container/index.js +0 -5
  381. package/esm/GlobalStyles/GlobalStyles.js +0 -37
  382. package/esm/GlobalStyles/index.js +0 -4
  383. package/esm/RtlProvider/index.js +0 -25
  384. package/esm/Stack/StackProps.js +0 -1
  385. package/esm/Stack/createStack.js +0 -173
  386. package/esm/Stack/index.js +0 -7
  387. package/esm/Stack/stackClasses.js +0 -7
  388. package/esm/ThemeProvider/index.js +0 -3
  389. package/esm/Unstable_Grid/GridProps.js +0 -1
  390. package/esm/Unstable_Grid/createGrid.js +0 -171
  391. package/esm/Unstable_Grid/index.js +0 -8
  392. package/esm/createTheme/createTheme.js +0 -43
  393. package/esm/createTheme/index.js +0 -3
  394. package/esm/createTheme/shape.js +0 -4
  395. package/esm/cssVars/createCssVarsTheme.js +0 -16
  396. package/esm/cssVars/getInitColorSchemeScript.js +0 -44
  397. package/esm/cssVars/index.js +0 -6
  398. package/esm/cssVars/prepareCssVars.js +0 -73
  399. package/esm/index.js +0 -65
  400. package/esm/styleFunctionSx/extendSxProp.js +0 -48
  401. package/esm/styleFunctionSx/index.js +0 -4
  402. package/esm/styled.js +0 -3
  403. package/esm/useMediaQuery/index.js +0 -2
  404. package/esm/useThemeProps/getThemeProps.js +0 -12
  405. package/esm/useThemeProps/index.js +0 -4
  406. package/esm/useThemeProps/useThemeProps.js +0 -21
  407. package/legacy/styled.js +0 -3
  408. package/modern/styled.js +0 -3
  409. /package/{colorManipulator.d.ts → colorManipulator/colorManipulator.d.ts} +0 -0
  410. /package/{esm → colorManipulator}/colorManipulator.js +0 -0
  411. /package/legacy/{colorManipulator.js → colorManipulator/colorManipulator.js} +0 -0
  412. /package/legacy/{memoize.js → memoize/memoize.js} +0 -0
  413. /package/{esm → legacy/merge}/merge.js +0 -0
  414. /package/legacy/{propsToClassKey.js → propsToClassKey/propsToClassKey.js} +0 -0
  415. /package/legacy/{responsivePropType.js → responsivePropType/responsivePropType.js} +0 -0
  416. /package/legacy/{useThemeWithoutDefault.js → useThemeWithoutDefault/useThemeWithoutDefault.js} +0 -0
  417. /package/{esm → memoize}/memoize.js +0 -0
  418. /package/{merge.d.ts → merge/merge.d.ts} +0 -0
  419. /package/{legacy → merge}/merge.js +0 -0
  420. /package/modern/{colorManipulator.js → colorManipulator/colorManipulator.js} +0 -0
  421. /package/modern/{memoize.js → memoize/memoize.js} +0 -0
  422. /package/modern/{merge.js → merge/merge.js} +0 -0
  423. /package/{esm → modern/propsToClassKey}/propsToClassKey.js +0 -0
  424. /package/{esm → modern/responsivePropType}/responsivePropType.js +0 -0
  425. /package/{esm → modern/useThemeWithoutDefault}/useThemeWithoutDefault.js +0 -0
  426. /package/{colorManipulator.js → node/colorManipulator/colorManipulator.js} +0 -0
  427. /package/{memoize.js → node/memoize/memoize.js} +0 -0
  428. /package/{merge.js → node/merge/merge.js} +0 -0
  429. /package/{propsToClassKey.js → node/propsToClassKey/propsToClassKey.js} +0 -0
  430. /package/{responsivePropType.js → node/responsivePropType/responsivePropType.js} +0 -0
  431. /package/{propsToClassKey.d.ts → propsToClassKey/propsToClassKey.d.ts} +0 -0
  432. /package/{modern → propsToClassKey}/propsToClassKey.js +0 -0
  433. /package/{responsivePropType.d.ts → responsivePropType/responsivePropType.d.ts} +0 -0
  434. /package/{modern → responsivePropType}/responsivePropType.js +0 -0
  435. /package/{useThemeWithoutDefault.d.ts → useThemeWithoutDefault/useThemeWithoutDefault.d.ts} +0 -0
  436. /package/{modern → useThemeWithoutDefault}/useThemeWithoutDefault.js +0 -0
@@ -1,9 +1,9 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
2
- import responsivePropType from './responsivePropType';
3
- import { handleBreakpoints } from './breakpoints';
4
- import { getPath } from './style';
5
- import merge from './merge';
6
- import memoize from './memoize';
2
+ import responsivePropType from '../responsivePropType';
3
+ import { handleBreakpoints } from '../breakpoints';
4
+ import { getPath } from '../style';
5
+ import merge from '../merge';
6
+ import memoize from '../memoize';
7
7
  var properties = {
8
8
  m: 'margin',
9
9
  p: 'padding'
@@ -50,25 +50,29 @@ export var paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'p
50
50
  var spacingKeys = [].concat(marginKeys, paddingKeys);
51
51
  export function createUnaryUnit(theme, themeKey, defaultValue, propName) {
52
52
  var _getPath;
53
- var themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue;
54
- if (typeof themeSpacing === 'number') {
55
- return function (abs) {
56
- if (typeof abs === 'string') {
57
- return abs;
53
+ var themeSpacing = (_getPath = getPath(theme, themeKey, true)) != null ? _getPath : defaultValue;
54
+ if (typeof themeSpacing === 'number' || typeof themeSpacing === 'string') {
55
+ return function (val) {
56
+ if (typeof val === 'string') {
57
+ return val;
58
58
  }
59
59
  if (process.env.NODE_ENV !== 'production') {
60
- if (typeof abs !== 'number') {
61
- console.error("MUI: Expected ".concat(propName, " argument to be a number or a string, got ").concat(abs, "."));
60
+ if (typeof val !== 'number') {
61
+ console.error("MUI: Expected ".concat(propName, " argument to be a number or a string, got ").concat(val, "."));
62
62
  }
63
63
  }
64
- return themeSpacing * abs;
64
+ if (typeof themeSpacing === 'string') {
65
+ return "calc(".concat(val, " * ").concat(themeSpacing, ")");
66
+ }
67
+ return themeSpacing * val;
65
68
  };
66
69
  }
67
70
  if (Array.isArray(themeSpacing)) {
68
- return function (abs) {
69
- if (typeof abs === 'string') {
70
- return abs;
71
+ return function (val) {
72
+ if (typeof val === 'string') {
73
+ return val;
71
74
  }
75
+ var abs = Math.abs(val);
72
76
  if (process.env.NODE_ENV !== 'production') {
73
77
  if (!Number.isInteger(abs)) {
74
78
  console.error(["MUI: The `theme.".concat(themeKey, "` array type cannot be combined with non integer values.") + "You should either use an integer value that can be used as index, or define the `theme.".concat(themeKey, "` as a number.")].join('\n'));
@@ -76,7 +80,14 @@ export function createUnaryUnit(theme, themeKey, defaultValue, propName) {
76
80
  console.error(["MUI: The value provided (".concat(abs, ") overflows."), "The supported values are: ".concat(JSON.stringify(themeSpacing), "."), "".concat(abs, " > ").concat(themeSpacing.length - 1, ", you need to add the missing values.")].join('\n'));
77
81
  }
78
82
  }
79
- return themeSpacing[abs];
83
+ var transformed = themeSpacing[abs];
84
+ if (val >= 0) {
85
+ return transformed;
86
+ }
87
+ if (typeof transformed === 'number') {
88
+ return -transformed;
89
+ }
90
+ return "-".concat(transformed);
80
91
  };
81
92
  }
82
93
  if (typeof themeSpacing === 'function') {
@@ -96,15 +107,7 @@ export function getValue(transformer, propValue) {
96
107
  if (typeof propValue === 'string' || propValue == null) {
97
108
  return propValue;
98
109
  }
99
- var abs = Math.abs(propValue);
100
- var transformed = transformer(abs);
101
- if (propValue >= 0) {
102
- return transformed;
103
- }
104
- if (typeof transformed === 'number') {
105
- return -transformed;
106
- }
107
- return "-".concat(transformed);
110
+ return transformer(propValue);
108
111
  }
109
112
  export function getStyleFromPropValue(cssProperties, transformer) {
110
113
  return function (propValue) {
@@ -0,0 +1,4 @@
1
+ 'use client';
2
+
3
+ export { default } from './style';
4
+ export * from './style';
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import capitalize from '@mui/utils/capitalize';
3
- import responsivePropType from './responsivePropType';
4
- import { handleBreakpoints } from './breakpoints';
3
+ import responsivePropType from '../responsivePropType';
4
+ import { handleBreakpoints } from '../breakpoints';
5
5
  export function getPath(obj, path) {
6
6
  var checkVars = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
7
7
  if (!path || typeof path !== 'string') {
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+
3
+ export { default } from './styled';
@@ -0,0 +1,3 @@
1
+ import createStyled from '../createStyled';
2
+ var styled = createStyled();
3
+ export default styled;
@@ -0,0 +1,4 @@
1
+ 'use client';
2
+
3
+ export { default } from './typography';
4
+ export * from './typography';
@@ -1,5 +1,5 @@
1
- import style from './style';
2
- import compose from './compose';
1
+ import style from '../style';
2
+ import compose from '../compose';
3
3
  export var fontFamily = style({
4
4
  prop: 'fontFamily',
5
5
  themeKey: 'typography'
@@ -0,0 +1,4 @@
1
+ 'use client';
2
+
3
+ export { default } from './useTheme';
4
+ export * from './useTheme';
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import createTheme from './createTheme';
4
- import useThemeWithoutDefault from './useThemeWithoutDefault';
3
+ import createTheme from '../createTheme';
4
+ import useThemeWithoutDefault from '../useThemeWithoutDefault';
5
5
  export var systemDefaultTheme = createTheme();
6
6
  function useTheme() {
7
7
  var defaultTheme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : systemDefaultTheme;
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+
3
+ export { default } from './useThemeWithoutDefault';
@@ -0,0 +1 @@
1
+ export { default } from './memoize';
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+
3
+ export { default } from './memoize';
@@ -0,0 +1,3 @@
1
+ export default function memoize<ArgType = any, ReturnType = any>(
2
+ fn: (arg: ArgType) => ReturnType,
3
+ ): (arg: ArgType) => ReturnType;
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/memoize/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1 @@
1
+ export { default } from './merge';
package/merge/index.js ADDED
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+
3
+ export { default } from './merge';
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "./index.js",
4
+ "main": "../node/merge/index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -1,8 +1,8 @@
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';
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;
@@ -0,0 +1,4 @@
1
+ 'use client';
2
+
3
+ export { default } from './borders';
4
+ export * from './borders';
@@ -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 './merge';
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[.
@@ -77,8 +77,7 @@ function breakpoints(styleFunction) {
77
77
  return newStyleFunction;
78
78
  }
79
79
  export function createEmptyBreakpointObject(breakpointsInput = {}) {
80
- var _breakpointsInput$key;
81
- const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {
80
+ const breakpointsInOrder = breakpointsInput.keys?.reduce((acc, key) => {
82
81
  const breakpointStyleKey = breakpointsInput.up(key);
83
82
  acc[breakpointStyleKey] = {};
84
83
  return acc;
@@ -0,0 +1,4 @@
1
+ 'use client';
2
+
3
+ export { default } from './breakpoints';
4
+ export * from './breakpoints';
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+
3
+ export * from './colorManipulator';
@@ -1,4 +1,4 @@
1
- import merge from './merge';
1
+ import merge from '../merge';
2
2
  function compose(...styles) {
3
3
  const handlers = styles.reduce((acc, style) => {
4
4
  style.filterProps.forEach(prop => {
@@ -0,0 +1,3 @@
1
+ 'use client';
2
+
3
+ export { default } from './compose';
@@ -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 './styleFunctionSx';
10
- import useTheme from './useTheme';
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,3 @@
1
+ 'use client';
2
+
3
+ export { default } from './createBox';
@@ -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 './createTheme';
12
- import styleFunctionSx from './styleFunctionSx';
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
  }
@@ -74,7 +74,7 @@ function processStyleArg(callableStyle, _ref) {
74
74
  }, props, ownerState));
75
75
  } else {
76
76
  Object.keys(variant.props).forEach(key => {
77
- if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) {
77
+ if (ownerState?.[key] !== variant.props[key] && props[key] !== variant.props[key]) {
78
78
  isMatch = false;
79
79
  }
80
80
  });
@@ -110,7 +110,7 @@ export default function createStyled(input = {}) {
110
110
  systemSx.__mui_systemSx = true;
111
111
  return (tag, inputOptions = {}) => {
112
112
  // Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.
113
- processStyles(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));
113
+ processStyles(tag, styles => styles.filter(style => !style?.__mui_systemSx));
114
114
  const {
115
115
  name: componentName,
116
116
  slot: componentSlot,
@@ -193,12 +193,11 @@ export default function createStyled(input = {}) {
193
193
  }
194
194
  if (componentName && !skipVariantsResolver) {
195
195
  expressionsWithDefaultTheme.push(props => {
196
- var _theme$components;
197
196
  const theme = resolveTheme(_extends({}, props, {
198
197
  defaultTheme,
199
198
  themeId
200
199
  }));
201
- const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants;
200
+ const themeVariants = theme?.components?.[componentName]?.variants;
202
201
  return processStyleArg({
203
202
  variants: themeVariants
204
203
  }, _extends({}, props, {
@@ -0,0 +1,4 @@
1
+ 'use client';
2
+
3
+ export { default } from './createStyled';
4
+ export * from './createStyled';
@@ -3,18 +3,17 @@ import { createUnarySpacing } from '../spacing';
3
3
  // The different signatures imply different meaning for their arguments that can't be expressed structurally.
4
4
  // We express the difference with variable names.
5
5
 
6
- export default function createSpacing(spacingInput = 8) {
6
+ export default function createSpacing(spacingInput = 8,
7
+ // Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.
8
+ // Smaller components, such as icons, can align to a 4dp grid.
9
+ // https://m2.material.io/design/layout/understanding-layout.html
10
+ transform = createUnarySpacing({
11
+ spacing: spacingInput
12
+ })) {
7
13
  // Already transformed.
8
14
  if (spacingInput.mui) {
9
15
  return spacingInput;
10
16
  }
11
-
12
- // Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.
13
- // Smaller components, such as icons, can align to a 4dp grid.
14
- // https://m2.material.io/design/layout/understanding-layout.html
15
- const transform = createUnarySpacing({
16
- spacing: spacingInput
17
- });
18
17
  const spacing = (...argsInput) => {
19
18
  if (process.env.NODE_ENV !== 'production') {
20
19
  if (!(argsInput.length <= 4)) {
@@ -1,8 +1,8 @@
1
- import style from './style';
2
- import compose from './compose';
3
- import { createUnaryUnit, getValue } from './spacing';
4
- import { handleBreakpoints } from './breakpoints';
5
- import responsivePropType from './responsivePropType';
1
+ import style from '../style';
2
+ import compose from '../compose';
3
+ import { createUnaryUnit, getValue } from '../spacing';
4
+ import { handleBreakpoints } from '../breakpoints';
5
+ import responsivePropType from '../responsivePropType';
6
6
 
7
7
  // false positive
8
8
  // eslint-disable-next-line react/function-component-definition
@@ -0,0 +1,4 @@
1
+ 'use client';
2
+
3
+ export { default } from './cssGrid';
4
+ export * from './cssGrid';
@@ -1,17 +1,15 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
3
  import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
4
- const _excluded = ["colorSchemes", "components", "generateCssVars", "cssVarPrefix"];
4
+ const _excluded = ["colorSchemes", "components", "cssVarPrefix"];
5
5
  import * as React from 'react';
6
6
  import PropTypes from 'prop-types';
7
- import deepmerge from '@mui/utils/deepmerge';
8
7
  import { GlobalStyles } from '@mui/styled-engine';
9
8
  import { useTheme as muiUseTheme } from '@mui/private-theming';
10
9
  import ThemeProvider from '../ThemeProvider';
11
10
  import systemGetInitColorSchemeScript, { DEFAULT_ATTRIBUTE, DEFAULT_COLOR_SCHEME_STORAGE_KEY, DEFAULT_MODE_STORAGE_KEY } from './getInitColorSchemeScript';
12
11
  import useCurrentColorScheme from './useCurrentColorScheme';
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
13
  export const DISABLE_CSS_TRANSITION = '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}';
16
14
  export default function createCssVarsProvider(options) {
17
15
  const {
@@ -29,8 +27,7 @@ export default function createCssVarsProvider(options) {
29
27
  defaultMode: designSystemMode = 'light',
30
28
  defaultColorScheme: designSystemColorScheme,
31
29
  disableTransitionOnChange: designSystemTransitionOnChange = false,
32
- resolveTheme,
33
- excludeVariablesFromRoot
30
+ resolveTheme
34
31
  } = options;
35
32
  if (!defaultTheme.colorSchemes || typeof designSystemColorScheme === 'string' && !defaultTheme.colorSchemes[designSystemColorScheme] || typeof designSystemColorScheme === 'object' && !defaultTheme.colorSchemes[designSystemColorScheme?.light] || typeof designSystemColorScheme === 'object' && !defaultTheme.colorSchemes[designSystemColorScheme?.dark]) {
36
33
  console.error(`MUI: \`${designSystemColorScheme}\` does not exist in \`theme.colorSchemes\`.`);
@@ -72,10 +69,6 @@ export default function createCssVarsProvider(options) {
72
69
  {
73
70
  colorSchemes = {},
74
71
  components = {},
75
- generateCssVars = () => ({
76
- vars: {},
77
- css: {}
78
- }),
79
72
  cssVarPrefix
80
73
  } = _ref,
81
74
  restThemeProp = _objectWithoutPropertiesLoose(_ref, _excluded);
@@ -129,32 +122,22 @@ export default function createCssVarsProvider(options) {
129
122
  return colorScheme;
130
123
  })();
131
124
 
132
- // 2. Create CSS variables and store them in objects (to be generated in stylesheets in the final step)
133
- const {
134
- css: rootCss,
135
- vars: rootVars
136
- } = generateCssVars();
125
+ // 2. get the `vars` object that refers to the CSS custom properties
126
+ const themeVars = restThemeProp.generateThemeVars?.() || restThemeProp.vars;
137
127
 
138
128
  // 3. Start composing the theme object
139
129
  const theme = _extends({}, restThemeProp, {
140
130
  components,
141
131
  colorSchemes,
142
132
  cssVarPrefix,
143
- vars: rootVars,
144
- getColorSchemeSelector: targetColorScheme => `[${attribute}="${targetColorScheme}"] &`
133
+ vars: themeVars
145
134
  });
135
+ if (typeof theme.generateSpacing === 'function') {
136
+ theme.spacing = theme.generateSpacing();
137
+ }
146
138
 
147
- // 4. Create color CSS variables and store them in objects (to be generated in stylesheets in the final step)
148
- // The default color scheme stylesheet is constructed to have the least CSS specificity.
149
- // The other color schemes uses selector, default as data attribute, to increase the CSS specificity so that they can override the default color scheme stylesheet.
150
- const defaultColorSchemeStyleSheet = {};
151
- const otherColorSchemesStyleSheet = {};
139
+ // 4. Resolve the color scheme and merge it to the theme
152
140
  Object.entries(colorSchemes).forEach(([key, scheme]) => {
153
- const {
154
- css,
155
- vars
156
- } = generateCssVars(key);
157
- theme.vars = deepmerge(theme.vars, vars);
158
141
  if (key === calculatedColorScheme) {
159
142
  // 4.1 Merge the selected color scheme to the theme
160
143
  Object.keys(scheme).forEach(schemeKey => {
@@ -169,30 +152,22 @@ export default function createCssVarsProvider(options) {
169
152
  theme.palette.colorScheme = key;
170
153
  }
171
154
  }
172
- const resolvedDefaultColorScheme = (() => {
173
- if (typeof defaultColorScheme === 'string') {
174
- return defaultColorScheme;
175
- }
176
- if (defaultMode === 'dark') {
177
- return defaultColorScheme.dark;
178
- }
179
- return defaultColorScheme.light;
180
- })();
181
- if (key === resolvedDefaultColorScheme) {
182
- if (excludeVariablesFromRoot) {
183
- const excludedVariables = {};
184
- excludeVariablesFromRoot(cssVarPrefix).forEach(cssVar => {
185
- excludedVariables[cssVar] = css[cssVar];
186
- delete css[cssVar];
187
- });
188
- defaultColorSchemeStyleSheet[`[${attribute}="${key}"]`] = excludedVariables;
189
- }
190
- defaultColorSchemeStyleSheet[`${colorSchemeSelector}, [${attribute}="${key}"]`] = css;
191
- } else {
192
- otherColorSchemesStyleSheet[`${colorSchemeSelector === ':root' ? '' : colorSchemeSelector}[${attribute}="${key}"]`] = css;
193
- }
194
155
  });
195
- theme.vars = deepmerge(theme.vars, rootVars);
156
+ const resolvedDefaultColorScheme = (() => {
157
+ if (typeof defaultColorScheme === 'string') {
158
+ return defaultColorScheme;
159
+ }
160
+ if (defaultMode === 'dark') {
161
+ return defaultColorScheme.dark;
162
+ }
163
+ return defaultColorScheme.light;
164
+ })();
165
+ themeProp.defaultColorScheme = resolvedDefaultColorScheme;
166
+ themeProp.colorSchemeSelector = colorSchemeSelector;
167
+ themeProp.attribute = attribute;
168
+ if (!theme.getColorSchemeSelector) {
169
+ theme.getColorSchemeSelector = targetColorScheme => `[${attribute}="${targetColorScheme}"] &`;
170
+ }
196
171
 
197
172
  // 5. Declaring effects
198
173
  // 5.1 Updates the selector value to use the current color scheme which tells CSS to use the proper stylesheet.
@@ -243,16 +218,10 @@ export default function createCssVarsProvider(options) {
243
218
  shouldGenerateStyleSheet = false;
244
219
  }
245
220
  const element = /*#__PURE__*/_jsxs(React.Fragment, {
246
- children: [shouldGenerateStyleSheet && /*#__PURE__*/_jsxs(React.Fragment, {
247
- children: [/*#__PURE__*/_jsx(GlobalStyles, {
248
- styles: {
249
- [colorSchemeSelector]: rootCss
250
- }
251
- }), /*#__PURE__*/_jsx(GlobalStyles, {
252
- styles: defaultColorSchemeStyleSheet
253
- }), /*#__PURE__*/_jsx(GlobalStyles, {
254
- styles: otherColorSchemesStyleSheet
255
- })]
221
+ children: [shouldGenerateStyleSheet && /*#__PURE__*/_jsx(React.Fragment, {
222
+ children: (theme.generateStyleSheets?.() || []).map((styles, index) => /*#__PURE__*/_jsx(GlobalStyles, {
223
+ styles: styles
224
+ }, index))
256
225
  }), /*#__PURE__*/_jsx(ThemeProvider, {
257
226
  themeId: scopedTheme ? themeId : undefined,
258
227
  theme: resolveTheme ? resolveTheme(theme) : theme,
@@ -1,16 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["cssVarPrefix", "shouldSkipGeneratingVar"];
4
2
  import prepareCssVars from './prepareCssVars';
5
3
  function createCssVarsTheme(theme) {
6
- const {
7
- cssVarPrefix,
8
- shouldSkipGeneratingVar
9
- } = theme,
10
- otherTheme = _objectWithoutPropertiesLoose(theme, _excluded);
11
- return _extends({}, theme, prepareCssVars(otherTheme, {
12
- prefix: cssVarPrefix,
13
- shouldSkipGeneratingVar
4
+ const output = theme;
5
+ const result = prepareCssVars(output, _extends({}, theme, {
6
+ prefix: theme.cssVarPrefix
14
7
  }));
8
+ output.vars = result.vars;
9
+ output.generateThemeVars = result.generateThemeVars;
10
+ output.generateStyleSheets = result.generateStyleSheets;
11
+ return output;
15
12
  }
16
13
  export default createCssVarsTheme;
@@ -111,11 +111,12 @@ export default function cssVarsParser(theme, options) {
111
111
  if (!shouldSkipGeneratingVar || !shouldSkipGeneratingVar(keys, value)) {
112
112
  // only create css & var if `shouldSkipGeneratingVar` return false
113
113
  const cssVar = `--${prefix ? `${prefix}-` : ''}${keys.join('-')}`;
114
+ const resolvedValue = getCssValue(keys, value);
114
115
  Object.assign(css, {
115
- [cssVar]: getCssValue(keys, value)
116
+ [cssVar]: resolvedValue
116
117
  });
117
118
  assignNestedKeys(vars, keys, `var(${cssVar})`, arrayKeys);
118
- assignNestedKeys(varsWithDefaults, keys, `var(${cssVar}, ${value})`, arrayKeys);
119
+ assignNestedKeys(varsWithDefaults, keys, `var(${cssVar}, ${resolvedValue})`, arrayKeys);
119
120
  }
120
121
  }
121
122
  }, keys => keys[0] === 'vars' // skip 'vars/*' paths