@mui/docs 6.0.0-alpha.6 → 6.0.0-alpha.8

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.
@@ -5,22 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.CodeCopyButton = CodeCopyButton;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
8
  var React = _interopRequireWildcard(require("react"));
11
- var _ContentCopyRounded = _interopRequireDefault(require("@mui/icons-material/ContentCopyRounded"));
12
- var _LibraryAddCheckRounded = _interopRequireDefault(require("@mui/icons-material/LibraryAddCheckRounded"));
13
9
  var _useClipboardCopy = _interopRequireDefault(require("./useClipboardCopy"));
14
10
  var _jsxRuntime = require("react/jsx-runtime");
15
11
  var _span, _span2;
16
- const _excluded = ["code"];
17
12
  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
13
  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; }
19
14
  function CodeCopyButton(props) {
20
15
  const {
21
- code
22
- } = props,
23
- other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
16
+ code,
17
+ ...other
18
+ } = props;
24
19
  const {
25
20
  copy,
26
21
  isCopied
@@ -30,7 +25,8 @@ function CodeCopyButton(props) {
30
25
  const key = macOS ? '⌘' : 'Ctrl + ';
31
26
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
32
27
  className: "MuiCode-copy-container",
33
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", (0, _extends2.default)({}, other, {
28
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
29
+ ...other,
34
30
  "aria-label": "Copy the code",
35
31
  type: "button",
36
32
  className: "MuiCode-copy",
@@ -38,22 +34,17 @@ function CodeCopyButton(props) {
38
34
  // event.stopPropagation();
39
35
  await copy(code);
40
36
  },
41
- children: [isCopied ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_LibraryAddCheckRounded.default, {
42
- sx: {
43
- fontSize: 18
44
- }
45
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ContentCopyRounded.default, {
46
- sx: {
47
- fontSize: 18
48
- }
49
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
37
+ children: [isCopied ? 'Copied' : 'Copy', /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
50
38
  className: "MuiCode-copyKeypress",
39
+ style: {
40
+ opacity: isCopied ? 0 : 1
41
+ },
51
42
  children: [_span || (_span = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
52
43
  children: "(or"
53
44
  })), " ", key, "C", _span2 || (_span2 = /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
54
45
  children: ")"
55
46
  }))]
56
47
  })]
57
- }))
48
+ })
58
49
  });
59
50
  }
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.HighlightedCode = void 0;
8
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
8
  var React = _interopRequireWildcard(require("react"));
11
9
  var _prism = _interopRequireDefault(require("@mui/internal-markdown/prism"));
12
10
  var _NoSsr = require("@mui/base/NoSsr");
@@ -14,7 +12,6 @@ var _styles = require("@mui/material/styles");
14
12
  var _CodeCopy = require("../CodeCopy");
15
13
  var _MarkdownElement = require("../MarkdownElement");
16
14
  var _jsxRuntime = require("react/jsx-runtime");
17
- const _excluded = ["copyButtonHidden", "copyButtonProps", "code", "language", "plainStyle", "parentComponent", "preComponent"];
18
15
  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); }
19
16
  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
17
  const Pre = (0, _styles.styled)('pre')(({
@@ -29,39 +26,42 @@ const Pre = (0, _styles.styled)('pre')(({
29
26
  [theme.breakpoints.up('md')]: {
30
27
  maxWidth: 'calc(100vw - 32px - 16px)'
31
28
  },
32
- '& code': (0, _extends2.default)({}, theme.typography.caption, {
29
+ '& code': {
30
+ // Avoid layout jump after hydration (style injected by Prism)
31
+ ...theme.typography.caption,
33
32
  fontFamily: theme.typography.fontFamilyCode,
34
33
  fontWeight: 400,
35
34
  WebkitFontSmoothing: 'subpixel-antialiased'
36
35
  // Reset for Safari
37
36
  // https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
38
- })
37
+ }
39
38
  }));
40
39
  const HighlightedCode = exports.HighlightedCode = /*#__PURE__*/React.forwardRef(function HighlightedCode(props, ref) {
41
40
  const {
42
- copyButtonHidden = false,
43
- copyButtonProps,
44
- code,
45
- language,
46
- plainStyle,
47
- parentComponent: Component = plainStyle ? 'div' : _MarkdownElement.MarkdownElement,
48
- preComponent: PreComponent = plainStyle ? Pre : 'pre'
49
- } = props,
50
- other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
41
+ copyButtonHidden = false,
42
+ copyButtonProps,
43
+ code,
44
+ language,
45
+ plainStyle,
46
+ parentComponent: Component = plainStyle ? 'div' : _MarkdownElement.MarkdownElement,
47
+ preComponent: PreComponent = plainStyle ? Pre : 'pre',
48
+ ...other
49
+ } = props;
51
50
  const renderedCode = React.useMemo(() => {
52
51
  return (0, _prism.default)(code.trim(), language);
53
52
  }, [code, language]);
54
53
  const handlers = (0, _CodeCopy.useCodeCopy)();
55
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, (0, _extends2.default)({
56
- ref: ref
57
- }, other, {
58
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", (0, _extends2.default)({
59
- className: "MuiCode-root"
60
- }, handlers, {
54
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
55
+ ref: ref,
56
+ ...other,
57
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
58
+ className: "MuiCode-root",
59
+ ...handlers,
61
60
  children: [copyButtonHidden ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_NoSsr.NoSsr, {
62
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CodeCopy.CodeCopyButton, (0, _extends2.default)({
63
- code: code
64
- }, copyButtonProps))
61
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CodeCopy.CodeCopyButton, {
62
+ code: code,
63
+ ...copyButtonProps
64
+ })
65
65
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(PreComponent, {
66
66
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("code", {
67
67
  className: `language-${language}`
@@ -72,6 +72,6 @@ const HighlightedCode = exports.HighlightedCode = /*#__PURE__*/React.forwardRef(
72
72
  }
73
73
  })
74
74
  })]
75
- }))
76
- }));
75
+ })
76
+ });
77
77
  });
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.GlowingIconContainer = GlowingIconContainer;
8
8
  exports.InfoCard = InfoCard;
9
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
9
  var React = _interopRequireWildcard(require("react"));
12
10
  var _styles = require("@mui/material/styles");
13
11
  var _Box = _interopRequireDefault(require("@mui/material/Box"));
@@ -15,14 +13,13 @@ var _Paper = _interopRequireDefault(require("@mui/material/Paper"));
15
13
  var _Typography = _interopRequireDefault(require("@mui/material/Typography"));
16
14
  var _Link = require("../Link");
17
15
  var _jsxRuntime = require("react/jsx-runtime");
18
- const _excluded = ["classNameDescription", "classNameTitle", "description", "icon", "link", "svg", "title", "titleProps"];
19
16
  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); }
20
17
  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; }
21
18
  function GlowingIconContainer({
22
19
  icon
23
20
  }) {
24
21
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
25
- sx: theme => (0, _extends2.default)({
22
+ sx: theme => ({
26
23
  width: 36,
27
24
  height: 36,
28
25
  display: 'flex',
@@ -36,63 +33,65 @@ function GlowingIconContainer({
36
33
  boxShadow: `0px 0 0 2px ${(0, _styles.alpha)(theme.palette.primary[500], 0.1)}, 0px 2px 12px 0px rgba(234, 237, 241, 0.3) inset`,
37
34
  '& .MuiSvgIcon-root': {
38
35
  fontSize: theme.typography.pxToRem(18)
39
- }
40
- }, theme.applyDarkStyles({
41
- borderColor: (0, _styles.alpha)(theme.palette.primary[400], 0.25),
42
- bgcolor: (0, _styles.alpha)(theme.palette.primary[900], 0.2),
43
- boxShadow: `0 0 0 2px ${(0, _styles.alpha)(theme.palette.primary[600], 0.1)}, 0px 2px 12px 0px rgba(0, 0, 0, 0.25) inset`
44
- })),
36
+ },
37
+ ...theme.applyDarkStyles({
38
+ borderColor: (0, _styles.alpha)(theme.palette.primary[400], 0.25),
39
+ bgcolor: (0, _styles.alpha)(theme.palette.primary[900], 0.2),
40
+ boxShadow: `0 0 0 2px ${(0, _styles.alpha)(theme.palette.primary[600], 0.1)}, 0px 2px 12px 0px rgba(0, 0, 0, 0.25) inset`
41
+ })
42
+ }),
45
43
  children: icon
46
44
  });
47
45
  }
48
46
  function InfoCard(props) {
49
47
  const {
50
- classNameDescription,
51
- classNameTitle,
52
- description,
53
- icon,
54
- link,
55
- svg,
56
- title,
57
- titleProps
58
- } = props,
59
- other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
60
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Paper.default, (0, _extends2.default)({
48
+ classNameDescription,
49
+ classNameTitle,
50
+ description,
51
+ icon,
52
+ link,
53
+ svg,
54
+ title,
55
+ titleProps,
56
+ ...other
57
+ } = props;
58
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Paper.default, {
61
59
  variant: "outlined",
62
60
  component: link ? _Link.Link : 'div',
63
- href: link
64
- }, link ? {
65
- noLinkStyle: true,
66
- // Fix overloading with prefetch={false}, only prefetch on hover.
67
- prefetch: false
68
- } : {}, {
69
- sx: theme => (0, _extends2.default)({
61
+ href: link,
62
+ ...(link ? {
63
+ noLinkStyle: true,
64
+ // Fix overloading with prefetch={false}, only prefetch on hover.
65
+ prefetch: false
66
+ } : {}),
67
+ sx: theme => ({
70
68
  p: 2.5,
71
69
  height: '100%',
72
- background: `${(theme.vars || theme).palette.gradients.linearSubtle}`
73
- }, theme.applyDarkStyles({
74
- bgcolor: (0, _styles.alpha)(theme.palette.primaryDark[800], 0.25),
75
70
  background: `${(theme.vars || theme).palette.gradients.linearSubtle}`,
76
- borderColor: 'primaryDark.700'
77
- }))
78
- }, other, {
71
+ ...theme.applyDarkStyles({
72
+ bgcolor: (0, _styles.alpha)(theme.palette.primaryDark[800], 0.25),
73
+ background: `${(theme.vars || theme).palette.gradients.linearSubtle}`,
74
+ borderColor: 'primaryDark.700'
75
+ })
76
+ }),
77
+ ...other,
79
78
  children: [svg && svg, icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(GlowingIconContainer, {
80
79
  icon: icon
81
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, (0, _extends2.default)({
80
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
82
81
  fontWeight: "semiBold",
83
82
  component: "h3",
84
83
  color: "text.primary",
85
84
  variant: "body2",
86
85
  mt: icon ? 2 : 0,
87
86
  mb: description ? 0.5 : 0,
88
- className: classNameTitle
89
- }, titleProps, {
87
+ className: classNameTitle,
88
+ ...titleProps,
90
89
  children: title
91
- })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
90
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
92
91
  variant: "body2",
93
92
  color: "text.secondary",
94
93
  className: classNameDescription,
95
94
  children: description
96
95
  })]
97
- }));
96
+ });
98
97
  }
package/node/Link/Link.js CHANGED
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.Link = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
10
8
  var React = _interopRequireWildcard(require("react"));
11
9
  var _clsx = _interopRequireDefault(require("clsx"));
12
10
  var _router = require("next/router");
@@ -16,8 +14,8 @@ var _styles = require("@mui/material/styles");
16
14
  var _i18n = require("../i18n");
17
15
  var _DocsProvider = require("../DocsProvider");
18
16
  var _jsxRuntime = require("react/jsx-runtime");
19
- const _excluded = ["to", "linkAs", "replace", "scroll", "shallow", "prefetch", "legacyBehavior", "locale"],
20
- _excluded2 = ["activeClassName", "as", "className", "href", "legacyBehavior", "linkAs", "locale", "noLinkStyle", "prefetch", "replace", "role", "scroll", "shallow"];
17
+ 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
+ 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; }
21
19
  /**
22
20
  * File to keep in sync with:
23
21
  *
@@ -25,22 +23,21 @@ const _excluded = ["to", "linkAs", "replace", "scroll", "shallow", "prefetch", "
25
23
  * - /examples/material-ui-nextjs-pages-router/src/Link.js
26
24
  * - /examples/material-ui-nextjs-pages-router-ts/src/Link.tsx
27
25
  */
26
+
28
27
  // Add support for the sx prop for consistency with the other branches.
29
- 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); }
30
- 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; }
31
28
  const Anchor = (0, _styles.styled)('a')({});
32
29
  const NextLinkComposed = /*#__PURE__*/React.forwardRef(function NextLinkComposed(props, ref) {
33
30
  const {
34
- to,
35
- linkAs,
36
- replace,
37
- scroll,
38
- shallow,
39
- prefetch,
40
- legacyBehavior = true,
41
- locale
42
- } = props,
43
- other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
31
+ to,
32
+ linkAs,
33
+ replace,
34
+ scroll,
35
+ shallow,
36
+ prefetch,
37
+ legacyBehavior = true,
38
+ locale,
39
+ ...other
40
+ } = props;
44
41
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_link.default, {
45
42
  href: to,
46
43
  prefetch: prefetch,
@@ -51,31 +48,33 @@ const NextLinkComposed = /*#__PURE__*/React.forwardRef(function NextLinkComposed
51
48
  passHref: true,
52
49
  locale: locale,
53
50
  legacyBehavior: legacyBehavior,
54
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Anchor, (0, _extends2.default)({
51
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Anchor, {
55
52
  "data-no-markdown-link": "true",
56
- ref: ref
57
- }, other))
53
+ ref: ref,
54
+ ...other
55
+ })
58
56
  });
59
57
  });
60
58
  // A styled version of the Next.js Pages Router Link component:
61
59
  // https://nextjs.org/docs/pages/api-reference/components/link
62
60
  const Link = exports.Link = /*#__PURE__*/React.forwardRef(function Link(props, ref) {
63
61
  const {
64
- activeClassName = 'active',
65
- as,
66
- className: classNameProps,
67
- href,
68
- legacyBehavior,
69
- linkAs: linkAsProp,
70
- locale,
71
- noLinkStyle,
72
- prefetch,
73
- replace,
74
- // Link don't have roles.
75
- scroll,
76
- shallow
77
- } = props,
78
- other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded2);
62
+ activeClassName = 'active',
63
+ as,
64
+ className: classNameProps,
65
+ href,
66
+ legacyBehavior,
67
+ linkAs: linkAsProp,
68
+ locale,
69
+ noLinkStyle,
70
+ prefetch,
71
+ replace,
72
+ role,
73
+ // Link don't have roles.
74
+ scroll,
75
+ shallow,
76
+ ...other
77
+ } = props;
79
78
  const router = (0, _router.useRouter)();
80
79
  const pathname = typeof href === 'string' ? href : href == null ? void 0 : href.pathname;
81
80
  const routerPathname = router.pathname.replace('/[docsTab]', '');
@@ -100,14 +99,18 @@ const Link = exports.Link = /*#__PURE__*/React.forwardRef(function Link(props, r
100
99
  locale
101
100
  };
102
101
  if (noLinkStyle) {
103
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(NextLinkComposed, (0, _extends2.default)({
102
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(NextLinkComposed, {
104
103
  className: className,
105
- ref: ref
106
- }, nextjsProps, other));
104
+ ref: ref,
105
+ ...nextjsProps,
106
+ ...other
107
+ });
107
108
  }
108
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Link.default, (0, _extends2.default)({
109
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Link.default, {
109
110
  component: NextLinkComposed,
110
111
  className: className,
111
- ref: ref
112
- }, nextjsProps, other));
112
+ ref: ref,
113
+ ...nextjsProps,
114
+ ...other
115
+ });
113
116
  });
@@ -5,21 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.MarkdownElement = void 0;
8
- var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
9
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
8
  var React = _interopRequireWildcard(require("react"));
11
9
  var _clsx = _interopRequireDefault(require("clsx"));
12
10
  var _styles = require("@mui/material/styles");
13
11
  var _branding = require("../branding");
14
12
  var _jsxRuntime = require("react/jsx-runtime");
15
- const _excluded = ["className", "renderedMarkdown"];
16
13
  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); }
17
14
  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; }
18
15
  const Root = (0, _styles.styled)('div')(({
19
16
  theme
20
17
  }) => {
21
18
  var _theme$shape$borderRa, _theme$shape, _theme$shape$borderRa2, _theme$shape2, _theme$shape$borderRa3, _theme$shape3;
22
- return (0, _extends2.default)({}, _branding.brandingLightTheme.typography.body1, {
19
+ return {
20
+ ..._branding.brandingLightTheme.typography.body1,
23
21
  lineHeight: 1.6,
24
22
  // Increased compared to the 1.5 default to make the docs easier to read.
25
23
  color: `var(--muidocs-palette-text-primary, ${_branding.brandingLightTheme.palette.text.primary})`,
@@ -52,11 +50,12 @@ const Root = (0, _styles.styled)('div')(({
52
50
  maxWidth: 'calc(100vw - 32px - 16px)'
53
51
  }
54
52
  },
55
- '& code': (0, _extends2.default)({}, _branding.brandingLightTheme.typography.body2, {
53
+ '& code': {
54
+ ..._branding.brandingLightTheme.typography.body2,
56
55
  fontFamily: _branding.brandingLightTheme.typography.fontFamilyCode,
57
56
  fontWeight: 400,
58
57
  WebkitFontSmoothing: 'subpixel-antialiased'
59
- }),
58
+ },
60
59
  '& pre > code': {
61
60
  // Reset for Safari
62
61
  // https://github.com/necolas/normalize.css/blob/master/normalize.css#L102
@@ -74,47 +73,53 @@ const Root = (0, _styles.styled)('div')(({
74
73
  direction: 'ltr /*! @noflip */',
75
74
  boxDecorationBreak: 'clone'
76
75
  },
77
- '& h1': (0, _extends2.default)({}, _branding.brandingLightTheme.typography.h3, {
76
+ '& h1': {
77
+ ..._branding.brandingLightTheme.typography.h3,
78
78
  fontSize: _branding.brandingLightTheme.typography.pxToRem(36),
79
79
  fontFamily: `"General Sans", ${_branding.brandingLightTheme.typography.fontFamilySystem}`,
80
80
  margin: '10px 0',
81
81
  color: `var(--muidocs-palette-primaryDark-900, ${_branding.brandingLightTheme.palette.primaryDark[900]})`,
82
82
  fontWeight: 600,
83
83
  letterSpacing: -0.2
84
- }),
85
- '& .description': (0, _extends2.default)({}, _branding.brandingLightTheme.typography.subtitle1, {
84
+ },
85
+ '& .description': {
86
+ ..._branding.brandingLightTheme.typography.subtitle1,
86
87
  fontWeight: 400,
87
88
  margin: '0 0 24px'
88
- }),
89
+ },
89
90
  '& .component-tabs': {
90
91
  margin: '0 0 40px'
91
92
  },
92
- '& h2': (0, _extends2.default)({}, _branding.brandingLightTheme.typography.h5, {
93
+ '& h2': {
94
+ ..._branding.brandingLightTheme.typography.h5,
93
95
  fontFamily: `"General Sans", ${_branding.brandingLightTheme.typography.fontFamilySystem}`,
94
96
  fontSize: theme.typography.pxToRem(26),
95
97
  fontWeight: _branding.brandingLightTheme.typography.fontWeightSemiBold,
96
98
  color: `var(--muidocs-palette-grey-900, ${_branding.brandingLightTheme.palette.grey[900]})`,
97
99
  margin: '40px 0 4px'
98
- }),
99
- '& h3': (0, _extends2.default)({}, _branding.brandingLightTheme.typography.h6, {
100
+ },
101
+ '& h3': {
102
+ ..._branding.brandingLightTheme.typography.h6,
100
103
  fontFamily: `"General Sans", ${_branding.brandingLightTheme.typography.fontFamilySystem}`,
101
104
  fontSize: theme.typography.pxToRem(20),
102
105
  fontWeight: _branding.brandingLightTheme.typography.fontWeightSemiBold,
103
106
  color: `var(--muidocs-palette-grey-900, ${_branding.brandingLightTheme.palette.grey[900]})`,
104
107
  margin: '24px 0 4px'
105
- }),
106
- '& h4': (0, _extends2.default)({}, _branding.brandingLightTheme.typography.subtitle1, {
108
+ },
109
+ '& h4': {
110
+ ..._branding.brandingLightTheme.typography.subtitle1,
107
111
  fontFamily: `"General Sans", ${_branding.brandingLightTheme.typography.fontFamilySystem}`,
108
112
  fontWeight: _branding.brandingLightTheme.typography.fontWeightSemiBold,
109
113
  color: `var(--muidocs-palette-grey-900, ${_branding.brandingLightTheme.palette.grey[900]})`,
110
114
  margin: '20px 0 6px'
111
- }),
112
- '& h5': (0, _extends2.default)({}, _branding.brandingLightTheme.typography.subtitle2, {
115
+ },
116
+ '& h5': {
117
+ ..._branding.brandingLightTheme.typography.subtitle2,
113
118
  fontFamily: `"General Sans", ${_branding.brandingLightTheme.typography.fontFamilySystem}`,
114
119
  fontWeight: _branding.brandingLightTheme.typography.fontWeightSemiBold,
115
120
  color: `var(--muidocs-palette-grey-900, ${_branding.brandingLightTheme.palette.grey[900]})`,
116
121
  margin: '20px 0 8px'
117
- }),
122
+ },
118
123
  '& p': {
119
124
  marginTop: 0,
120
125
  marginBottom: 16,
@@ -242,13 +247,14 @@ const Root = (0, _styles.styled)('div')(({
242
247
  borderBottom: `1px dotted var(--muidocs-palette-divider, ${_branding.brandingLightTheme.palette.divider})`
243
248
  }
244
249
  },
245
- '& td': (0, _extends2.default)({}, theme.typography.body2, {
250
+ '& td': {
251
+ ...theme.typography.body2,
246
252
  borderBottom: `1px solid var(--muidocs-palette-divider, ${_branding.brandingLightTheme.palette.divider})`,
247
253
  paddingRight: 20,
248
254
  paddingTop: 16,
249
255
  paddingBottom: 16,
250
256
  color: `var(--muidocs-palette-text-secondary, ${_branding.brandingLightTheme.palette.text.secondary})`
251
- }),
257
+ },
252
258
  '& td code': {
253
259
  lineHeight: 1.6
254
260
  },
@@ -537,45 +543,35 @@ const Root = (0, _styles.styled)('div')(({
537
543
  top: 0
538
544
  },
539
545
  '& .MuiCode-copy': {
540
- display: 'inline-flex',
541
- flexDirection: 'row-reverse',
542
- alignItems: 'center',
543
- width: 26,
544
- height: 26,
545
546
  cursor: 'pointer',
546
547
  position: 'absolute',
547
548
  top: 12,
548
549
  right: 12,
550
+ display: 'inline-flex',
551
+ flexDirection: 'row-reverse',
552
+ alignItems: 'center',
553
+ height: 24,
549
554
  padding: theme.spacing(0.5),
550
- fontFamily: 'inherit',
551
- fontWeight: 500,
555
+ paddingBottom: '5px',
556
+ // optical alignment
557
+ fontFamily: _branding.brandingLightTheme.typography.fontFamily,
558
+ fontWeight: _branding.brandingLightTheme.typography.fontWeightMedium,
559
+ fontSize: _branding.brandingLightTheme.typography.pxToRem(12),
552
560
  borderRadius: 6,
553
- border: 'none',
554
- backgroundColor: 'hsl(210, 35%, 9%)',
555
- // using the code block one-off background color (defined in line 23)
556
- color: '#FFF',
561
+ border: '1px solid',
562
+ borderColor: (0, _styles.alpha)(_branding.brandingLightTheme.palette.primaryDark[600], 0.5),
563
+ backgroundColor: (0, _styles.alpha)(_branding.brandingLightTheme.palette.primaryDark[800], 0.5),
564
+ color: `var(--muidocs-palette-grey-200, ${_branding.brandingLightTheme.palette.grey[200]})`,
557
565
  transition: theme.transitions.create(['background', 'borderColor', 'display'], {
558
566
  duration: theme.transitions.duration.shortest
559
567
  }),
560
- '& svg': {
561
- userSelect: 'none',
562
- width: theme.typography.pxToRem(16),
563
- height: theme.typography.pxToRem(16),
564
- display: 'inline-block',
565
- fill: 'currentcolor',
566
- flexShrink: 0,
567
- fontSize: '18px',
568
- margin: 'auto',
569
- opacity: 0.5
570
- },
571
- '& .MuiCode-copied-icon': {
568
+ '& .MuiCode-copied-label': {
572
569
  display: 'none'
573
570
  },
574
571
  '&:hover, &:focus': {
575
- backgroundColor: _branding.brandingLightTheme.palette.primaryDark[600],
576
- '& svg': {
577
- opacity: 1
578
- },
572
+ borderColor: `var(--muidocs-palette-primaryDark-400, ${_branding.brandingLightTheme.palette.primaryDark[400]})`,
573
+ backgroundColor: `var(--muidocs-palette-primaryDark-700, ${_branding.brandingLightTheme.palette.primaryDark[700]})`,
574
+ color: '#FFF',
579
575
  '& .MuiCode-copyKeypress': {
580
576
  display: 'block',
581
577
  // Approximate no hover capabilities with no keyboard
@@ -588,17 +584,19 @@ const Root = (0, _styles.styled)('div')(({
588
584
  '& .MuiCode-copyKeypress': {
589
585
  display: 'none',
590
586
  position: 'absolute',
591
- right: 26
587
+ right: 34
592
588
  },
593
589
  '&[data-copied]': {
594
- // style of the button when it is in copied state.
595
- borderColor: _branding.brandingLightTheme.palette.primary[700],
590
+ borderColor: `var(--muidocs-palette-primaryDark-400, ${_branding.brandingLightTheme.palette.primaryDark[400]})`,
591
+ backgroundColor: `var(--muidocs-palette-primaryDark-700, ${_branding.brandingLightTheme.palette.primaryDark[700]})`,
596
592
  color: '#fff',
597
- backgroundColor: _branding.brandingLightTheme.palette.primaryDark[600],
598
- '& .MuiCode-copy-icon': {
593
+ '& .MuiCode-copyKeypress': {
594
+ opacity: 0
595
+ },
596
+ '& .MuiCode-copy-label': {
599
597
  display: 'none'
600
598
  },
601
- '& .MuiCode-copied-icon': {
599
+ '& .MuiCode-copied-label': {
602
600
  display: 'block'
603
601
  }
604
602
  }
@@ -659,7 +657,7 @@ const Root = (0, _styles.styled)('div')(({
659
657
  borderRadius: 0
660
658
  }
661
659
  }
662
- });
660
+ };
663
661
  }, ({
664
662
  theme
665
663
  }) => ({
@@ -818,10 +816,10 @@ const Root = (0, _styles.styled)('div')(({
818
816
  }));
819
817
  const MarkdownElement = exports.MarkdownElement = /*#__PURE__*/React.forwardRef(function MarkdownElement(props, ref) {
820
818
  const {
821
- className,
822
- renderedMarkdown
823
- } = props,
824
- other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
819
+ className,
820
+ renderedMarkdown,
821
+ ...other
822
+ } = props;
825
823
  const more = {};
826
824
  if (typeof renderedMarkdown === 'string') {
827
825
  // workaround for https://github.com/facebook/react/issues/17170
@@ -830,9 +828,10 @@ const MarkdownElement = exports.MarkdownElement = /*#__PURE__*/React.forwardRef(
830
828
  __html: renderedMarkdown
831
829
  };
832
830
  }
833
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, (0, _extends2.default)({
834
- className: (0, _clsx.default)('markdown-body', className)
835
- }, more, other, {
831
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Root, {
832
+ className: (0, _clsx.default)('markdown-body', className),
833
+ ...more,
834
+ ...other,
836
835
  ref: ref
837
- }));
836
+ });
838
837
  });