@mui/docs 6.0.0-alpha.4 → 6.0.0-alpha.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # [Versions](https://mui.com/versions/)
2
2
 
3
+ ## v6.0.0-alpha.5
4
+
5
+ <!-- generated comparing v6.0.0-alpha.4..next -->
6
+
7
+ _May 1, 2024_
8
+
9
+ A big thanks to the 9 contributors who made this release possible. Here are some highlights ✨:
10
+
11
+ ### `@mui/material@6.0.0-alpha.5`
12
+
13
+ - [FormControlLabel] Deprecate `componentsProps` (#41767) @sai6855
14
+ - [PaginationItem] Deprecate components prop (#41777) @sai6855
15
+ - [SvgIcon] Convert to support CSS extraction (#41779) @aarongarciah
16
+
17
+ ### `@mui/base@5.0.0-beta.43`
18
+
19
+ - [TextareaAutosize] Fix resizing instability (#41638) @ZeeshanTamboli
20
+
21
+ ### Docs
22
+
23
+ - Fix small SEO issues @oliviertassinari
24
+ - [material-ui] Fix minor spelling error in the "About the lab" page (#42073) @ryanhartwig
25
+ - [material-ui] Update Figma plugin name (#41967) @danilo-leal
26
+ - [material-ui][templates] Fix input props attributes in Landing Page template (#42013) @5-tom
27
+ - [system] Update typo on the sx prop page (#42035) @bricker
28
+
29
+ ### Core
30
+
31
+ - [docs-infra] Clean up branding theme file and improve font-face readibility (#42023) @danilo-leal
32
+ - [docs-infra] Simplify docs demo (#42016) @oliviertassinari
33
+ - [website] Add content about the Sync plugin in the Material UI page (#40515) @danilo-leal
34
+ - [website] Sync career roles (#42058) @oliviertassinari
35
+ - [website] Add Nadja on the about page (#42021) @mnajdova
36
+ - [website] Fix code block design by changing the `MarkdownElement` import (#42022) @danilo-leal
37
+ - [wesbite] Remove duplicate MarkdownElement component (#42028) @danilo-leal
38
+
39
+ All contributors of this release in alphabetical order: @5-tom, @aarongarciah, @bricker, @danilo-leal, @mnajdova, @oliviertassinari, @ryanhartwig, @sai6855, @ZeeshanTamboli
40
+
3
41
  ## v6.0.0-alpha.4
4
42
 
5
43
  <!-- generated comparing v6.0.0-alpha.3..next -->
@@ -3,10 +3,12 @@ import { ButtonProps } from '@mui/material/Button';
3
3
  import { SxProps } from '@mui/material/styles';
4
4
  export interface HighlightedCodeProps {
5
5
  code: string;
6
- component?: React.ElementType;
7
6
  copyButtonHidden?: boolean;
8
7
  copyButtonProps?: ButtonProps;
9
8
  language: string;
9
+ parentComponent?: React.ElementType;
10
+ preComponent?: React.ElementType;
11
+ plainStyle?: boolean;
10
12
  sx?: SxProps;
11
13
  }
12
14
  export declare const HighlightedCode: React.ForwardRefExoticComponent<HighlightedCodeProps & React.RefAttributes<HTMLDivElement>>;
@@ -1,19 +1,42 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["copyButtonHidden", "copyButtonProps", "code", "language", "component"];
2
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
+ const _excluded = ["copyButtonHidden", "copyButtonProps", "code", "language", "plainStyle", "parentComponent", "preComponent"];
4
4
  import * as React from 'react';
5
5
  import prism from '@mui/internal-markdown/prism';
6
6
  import { NoSsr } from '@mui/base/NoSsr';
7
+ import { styled } from '@mui/material/styles';
7
8
  import { useCodeCopy, CodeCopyButton } from '../CodeCopy';
8
9
  import { MarkdownElement } from '../MarkdownElement';
9
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const Pre = styled('pre')(({
12
+ theme
13
+ }) => ({
14
+ margin: 0,
15
+ color: 'hsl(60deg 30% 96.08%)',
16
+ // fallback color until Prism's theme is loaded
17
+ WebkitOverflowScrolling: 'touch',
18
+ // iOS momentum scrolling.
19
+ maxWidth: 'calc(100vw - 32px)',
20
+ [theme.breakpoints.up('md')]: {
21
+ maxWidth: 'calc(100vw - 32px - 16px)'
22
+ },
23
+ '& code': _extends({}, theme.typography.caption, {
24
+ fontFamily: theme.typography.fontFamilyCode,
25
+ fontWeight: 400,
26
+ WebkitFontSmoothing: 'subpixel-antialiased'
27
+ // Reset for Safari
28
+ // https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
29
+ })
30
+ }));
10
31
  export const HighlightedCode = /*#__PURE__*/React.forwardRef(function HighlightedCode(props, ref) {
11
32
  const {
12
33
  copyButtonHidden = false,
13
34
  copyButtonProps,
14
35
  code,
15
36
  language,
16
- component: Component = MarkdownElement
37
+ plainStyle,
38
+ parentComponent: Component = plainStyle ? 'div' : MarkdownElement,
39
+ preComponent: PreComponent = plainStyle ? Pre : 'pre'
17
40
  } = props,
18
41
  other = _objectWithoutPropertiesLoose(props, _excluded);
19
42
  const renderedCode = React.useMemo(() => {
@@ -30,7 +53,7 @@ export const HighlightedCode = /*#__PURE__*/React.forwardRef(function Highlighte
30
53
  children: /*#__PURE__*/_jsx(CodeCopyButton, _extends({
31
54
  code: code
32
55
  }, copyButtonProps))
33
- }), /*#__PURE__*/_jsx("pre", {
56
+ }), /*#__PURE__*/_jsx(PreComponent, {
34
57
  children: /*#__PURE__*/_jsx("code", {
35
58
  className: `language-${language}`
36
59
  // eslint-disable-next-line react/no-danger
@@ -218,20 +218,17 @@ export const getDesignTokens = mode => ({
218
218
  },
219
219
  body1: {
220
220
  fontSize: defaultTheme.typography.pxToRem(16),
221
- // 16px
222
221
  lineHeight: 24 / 16,
223
222
  letterSpacing: 0
224
223
  },
225
224
  body2: {
226
225
  fontSize: defaultTheme.typography.pxToRem(14),
227
- // 14px
228
226
  lineHeight: 21 / 14,
229
227
  letterSpacing: 0
230
228
  },
231
229
  caption: {
232
230
  display: 'inline-block',
233
231
  fontSize: defaultTheme.typography.pxToRem(12),
234
- // 12px
235
232
  lineHeight: 18 / 12,
236
233
  letterSpacing: 0,
237
234
  fontWeight: 700
@@ -380,7 +377,7 @@ export function getThemedComponents() {
380
377
  transform: 'translateX(2px)'
381
378
  }
382
379
  }, ownerState.size === 'small' && {
383
- padding: theme.spacing('6px', 1),
380
+ padding: theme.spacing('6px', 1.5),
384
381
  fontFamily: theme.typography.fontFamily,
385
382
  fontSize: defaultTheme.typography.pxToRem(13),
386
383
  fontWeight: theme.typography.fontWeightSemiBold,
@@ -5,24 +5,47 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.HighlightedCode = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
8
  var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var React = _interopRequireWildcard(require("react"));
11
11
  var _prism = _interopRequireDefault(require("@mui/internal-markdown/prism"));
12
12
  var _NoSsr = require("@mui/base/NoSsr");
13
+ var _styles = require("@mui/material/styles");
13
14
  var _CodeCopy = require("../CodeCopy");
14
15
  var _MarkdownElement = require("../MarkdownElement");
15
16
  var _jsxRuntime = require("react/jsx-runtime");
16
- const _excluded = ["copyButtonHidden", "copyButtonProps", "code", "language", "component"];
17
+ const _excluded = ["copyButtonHidden", "copyButtonProps", "code", "language", "plainStyle", "parentComponent", "preComponent"];
17
18
  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); }
18
19
  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 && {}.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; }
20
+ const Pre = (0, _styles.styled)('pre')(({
21
+ theme
22
+ }) => ({
23
+ margin: 0,
24
+ color: 'hsl(60deg 30% 96.08%)',
25
+ // fallback color until Prism's theme is loaded
26
+ WebkitOverflowScrolling: 'touch',
27
+ // iOS momentum scrolling.
28
+ maxWidth: 'calc(100vw - 32px)',
29
+ [theme.breakpoints.up('md')]: {
30
+ maxWidth: 'calc(100vw - 32px - 16px)'
31
+ },
32
+ '& code': (0, _extends2.default)({}, theme.typography.caption, {
33
+ fontFamily: theme.typography.fontFamilyCode,
34
+ fontWeight: 400,
35
+ WebkitFontSmoothing: 'subpixel-antialiased'
36
+ // Reset for Safari
37
+ // https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
38
+ })
39
+ }));
19
40
  const HighlightedCode = exports.HighlightedCode = /*#__PURE__*/React.forwardRef(function HighlightedCode(props, ref) {
20
41
  const {
21
42
  copyButtonHidden = false,
22
43
  copyButtonProps,
23
44
  code,
24
45
  language,
25
- component: Component = _MarkdownElement.MarkdownElement
46
+ plainStyle,
47
+ parentComponent: Component = plainStyle ? 'div' : _MarkdownElement.MarkdownElement,
48
+ preComponent: PreComponent = plainStyle ? Pre : 'pre'
26
49
  } = props,
27
50
  other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
28
51
  const renderedCode = React.useMemo(() => {
@@ -39,7 +62,7 @@ const HighlightedCode = exports.HighlightedCode = /*#__PURE__*/React.forwardRef(
39
62
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CodeCopy.CodeCopyButton, (0, _extends2.default)({
40
63
  code: code
41
64
  }, copyButtonProps))
42
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("pre", {
65
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(PreComponent, {
43
66
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("code", {
44
67
  className: `language-${language}`
45
68
  // eslint-disable-next-line react/no-danger
@@ -228,20 +228,17 @@ const getDesignTokens = mode => ({
228
228
  },
229
229
  body1: {
230
230
  fontSize: defaultTheme.typography.pxToRem(16),
231
- // 16px
232
231
  lineHeight: 24 / 16,
233
232
  letterSpacing: 0
234
233
  },
235
234
  body2: {
236
235
  fontSize: defaultTheme.typography.pxToRem(14),
237
- // 14px
238
236
  lineHeight: 21 / 14,
239
237
  letterSpacing: 0
240
238
  },
241
239
  caption: {
242
240
  display: 'inline-block',
243
241
  fontSize: defaultTheme.typography.pxToRem(12),
244
- // 12px
245
242
  lineHeight: 18 / 12,
246
243
  letterSpacing: 0,
247
244
  fontWeight: 700
@@ -391,7 +388,7 @@ function getThemedComponents() {
391
388
  transform: 'translateX(2px)'
392
389
  }
393
390
  }, ownerState.size === 'small' && {
394
- padding: theme.spacing('6px', 1),
391
+ padding: theme.spacing('6px', 1.5),
395
392
  fontFamily: theme.typography.fontFamily,
396
393
  fontSize: defaultTheme.typography.pxToRem(13),
397
394
  fontWeight: theme.typography.fontWeightSemiBold,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mui/docs",
3
- "version": "6.0.0-alpha.4",
3
+ "version": "6.0.0-alpha.5",
4
4
  "private": false,
5
5
  "author": "MUI Team",
6
6
  "description": "MUI Docs - Documentation building blocks.",
@@ -25,7 +25,7 @@
25
25
  "dependencies": {
26
26
  "@babel/runtime": "^7.24.4",
27
27
  "clipboard-copy": "^4.0.1",
28
- "clsx": "^2.1.0",
28
+ "clsx": "^2.1.1",
29
29
  "nprogress": "^0.2.0",
30
30
  "prop-types": "^15.8.1",
31
31
  "@mui/internal-markdown": "^1.0.3"