[docs-infra] Move ads to the `@mui/docs` package
Followup of #42842
commits
- Move files to the package
- Use context for configuration of ads
- re-export the Ad component to avoid breaking toolpad docs
https://github.com/mui/mui-toolpad/blob/4298328c314621b0533974590284eb70f3dfffd9/docs/src/modules/components/SchemaReference.tsx#L4
Netlify deploy preview
https://deploy-preview-42944--material-ui.netlify.app/
Bundle size report
No bundle size changes (Toolpad) No bundle size changes
Generated by :no_entry_sign: dangerJS against 72c600fd59ff0303271b2a5966fd129d31a62047
I don't know why moving those files to the package results in the following error
src/Ad/ad.styles.ts(95,14): error TS2742: The inferred type of 'adStylesObject' cannot be named without a reference to 'packages/mui-styled-engine/node_modules/csstype'. This is likely not portable. A type annotation is necessary. buildTypes.mjs
Not proud of my fix: https://github.com/mui/material-ui/pull/42944/commits/0aa6cf43ded245b306772e16a6f4c440cb401fcc I probably missed something
Have you tried adding a reference to @mui/styled-engine here?
It did not worked (or I don't know how to do it correctly)
After some code commenting, it appears that the issue does not come from the styled(...)(problematicFunction) which infers the typing of the problematicFunction.
It's just the theme.typographe.body1 and other typography that requires the font typing which are in csstypes So I just added the library to the tsconfig