@mui/docs 6.0.0-alpha.1 → 6.0.0-alpha.10

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 (99) hide show
  1. package/CHANGELOG.md +462 -4
  2. package/CodeCopy/CodeCopy.d.ts +20 -0
  3. package/CodeCopy/CodeCopy.js +172 -0
  4. package/CodeCopy/CodeCopyButton.d.ts +5 -0
  5. package/CodeCopy/CodeCopyButton.js +41 -0
  6. package/CodeCopy/index.d.ts +3 -0
  7. package/CodeCopy/index.js +3 -0
  8. package/CodeCopy/package.json +6 -0
  9. package/CodeCopy/useClipboardCopy.d.ts +4 -0
  10. package/CodeCopy/useClipboardCopy.js +21 -0
  11. package/ComponentLinkHeader/ComponentLinkHeader.d.ts +9 -0
  12. package/ComponentLinkHeader/ComponentLinkHeader.js +179 -0
  13. package/ComponentLinkHeader/index.d.ts +2 -0
  14. package/ComponentLinkHeader/index.js +2 -0
  15. package/ComponentLinkHeader/package.json +6 -0
  16. package/HighlightedCode/HighlightedCode.d.ts +14 -0
  17. package/HighlightedCode/HighlightedCode.js +68 -0
  18. package/HighlightedCode/index.d.ts +1 -0
  19. package/HighlightedCode/index.js +1 -0
  20. package/HighlightedCode/package.json +6 -0
  21. package/InfoCard/InfoCard.d.ts +0 -1
  22. package/InfoCard/InfoCard.js +45 -44
  23. package/Link/Link.js +40 -38
  24. package/MarkdownElement/MarkdownElement.d.ts +6 -0
  25. package/MarkdownElement/MarkdownElement.js +825 -0
  26. package/MarkdownElement/index.d.ts +1 -0
  27. package/MarkdownElement/index.js +1 -0
  28. package/MarkdownElement/package.json +6 -0
  29. package/NProgressBar/NProgressBar.js +6 -7
  30. package/SectionTitle/SectionTitle.d.ts +7 -0
  31. package/SectionTitle/SectionTitle.js +30 -0
  32. package/SectionTitle/index.d.ts +1 -0
  33. package/SectionTitle/index.js +1 -0
  34. package/SectionTitle/package.json +6 -0
  35. package/branding/brandingTheme.js +569 -369
  36. package/node/CodeCopy/CodeCopy.js +188 -0
  37. package/node/CodeCopy/CodeCopyButton.js +50 -0
  38. package/node/CodeCopy/index.js +40 -0
  39. package/node/CodeCopy/useClipboardCopy.js +30 -0
  40. package/node/ComponentLinkHeader/ComponentLinkHeader.js +189 -0
  41. package/node/ComponentLinkHeader/index.js +24 -0
  42. package/node/HighlightedCode/HighlightedCode.js +77 -0
  43. package/node/HighlightedCode/index.js +16 -0
  44. package/node/InfoCard/InfoCard.js +45 -44
  45. package/node/Link/Link.js +43 -40
  46. package/node/MarkdownElement/MarkdownElement.js +837 -0
  47. package/node/MarkdownElement/index.js +16 -0
  48. package/node/NProgressBar/NProgressBar.js +6 -7
  49. package/node/SectionTitle/SectionTitle.js +38 -0
  50. package/node/SectionTitle/index.js +16 -0
  51. package/node/branding/brandingTheme.js +569 -369
  52. package/node/svgIcons/AdobeXDIcon.js +22 -0
  53. package/node/svgIcons/BundleSizeIcon.js +22 -0
  54. package/node/svgIcons/FigmaIcon.js +31 -0
  55. package/node/svgIcons/FileDownload.js +3 -3
  56. package/node/svgIcons/JavaScript.js +3 -3
  57. package/node/svgIcons/MaterialDesignIcon.js +27 -0
  58. package/node/svgIcons/SketchIcon.js +36 -0
  59. package/node/svgIcons/TypeScript.js +3 -3
  60. package/node/svgIcons/W3CIcon.js +24 -0
  61. package/node/translations/translations.json +4 -2
  62. package/package.json +6 -4
  63. package/svgIcons/AdobeXDIcon.d.ts +4 -0
  64. package/svgIcons/AdobeXDIcon.js +14 -0
  65. package/svgIcons/BundleSizeIcon.d.ts +4 -0
  66. package/svgIcons/BundleSizeIcon.js +14 -0
  67. package/svgIcons/FigmaIcon.d.ts +4 -0
  68. package/svgIcons/FigmaIcon.js +23 -0
  69. package/svgIcons/FileDownload.d.ts +7 -0
  70. package/svgIcons/FileDownload.js +3 -3
  71. package/svgIcons/JavaScript.d.ts +7 -0
  72. package/svgIcons/JavaScript.js +3 -3
  73. package/svgIcons/MaterialDesignIcon.d.ts +4 -0
  74. package/svgIcons/MaterialDesignIcon.js +19 -0
  75. package/svgIcons/SketchIcon.d.ts +4 -0
  76. package/svgIcons/SketchIcon.js +28 -0
  77. package/svgIcons/TypeScript.d.ts +7 -0
  78. package/svgIcons/TypeScript.js +3 -3
  79. package/svgIcons/W3CIcon.d.ts +4 -0
  80. package/svgIcons/W3CIcon.js +16 -0
  81. package/translations/translations.json +4 -2
  82. package/tsconfig.build.tsbuildinfo +1 -1
  83. package/legacy/DocsProvider/DocsProvider.js +0 -25
  84. package/legacy/DocsProvider/index.js +0 -1
  85. package/legacy/InfoCard/InfoCard.js +0 -86
  86. package/legacy/InfoCard/index.js +0 -1
  87. package/legacy/Link/Link.js +0 -101
  88. package/legacy/Link/index.js +0 -1
  89. package/legacy/NProgressBar/NProgressBar.js +0 -80
  90. package/legacy/NProgressBar/index.js +0 -1
  91. package/legacy/branding/BrandingProvider.js +0 -17
  92. package/legacy/branding/brandingTheme.js +0 -1168
  93. package/legacy/branding/index.js +0 -2
  94. package/legacy/i18n/i18n.js +0 -105
  95. package/legacy/i18n/index.js +0 -1
  96. package/legacy/svgIcons/FileDownload.js +0 -14
  97. package/legacy/svgIcons/JavaScript.js +0 -14
  98. package/legacy/svgIcons/TypeScript.js +0 -14
  99. package/legacy/translations/index.js +0 -4
@@ -1,25 +0,0 @@
1
- import * as React from 'react';
2
- import { UserLanguageProvider } from '../i18n';
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
- var DocsConfigContext = /*#__PURE__*/React.createContext(null);
5
- export function DocsProvider(_ref) {
6
- var config = _ref.config,
7
- defaultUserLanguage = _ref.defaultUserLanguage,
8
- translations = _ref.translations,
9
- children = _ref.children;
10
- return /*#__PURE__*/_jsx(DocsConfigContext.Provider, {
11
- value: config,
12
- children: /*#__PURE__*/_jsx(UserLanguageProvider, {
13
- defaultUserLanguage: defaultUserLanguage,
14
- translations: translations,
15
- children: children
16
- })
17
- });
18
- }
19
- export function useDocsConfig() {
20
- var config = React.useContext(DocsConfigContext);
21
- if (!config) {
22
- throw new Error('Could not find docs config context value; please ensure the component is wrapped in a <DocsProvider>');
23
- }
24
- return config;
25
- }
@@ -1 +0,0 @@
1
- export * from './DocsProvider';
@@ -1,86 +0,0 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
- import _extends from "@babel/runtime/helpers/esm/extends";
3
- import * as React from 'react';
4
- import { alpha } from '@mui/material/styles';
5
- import Box from '@mui/material/Box';
6
- import Paper from '@mui/material/Paper';
7
- import Typography from '@mui/material/Typography';
8
- import { Link } from '../Link';
9
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
- export function GlowingIconContainer(_ref) {
11
- var icon = _ref.icon;
12
- return /*#__PURE__*/_jsx(Box, {
13
- sx: function sx(theme) {
14
- return _extends({
15
- width: 40,
16
- height: 40,
17
- display: 'flex',
18
- justifyContent: 'center',
19
- alignItems: 'center',
20
- flexShrink: 0,
21
- borderRadius: 1,
22
- border: '1px solid',
23
- borderColor: 'primary.200',
24
- bgcolor: 'primary.50',
25
- boxShadow: "0px 1px 6px 0px ".concat(alpha(theme.palette.primary[500], 0.2), ", 0px 2px 12px 0px rgba(234, 237, 241, 0.3) inset")
26
- }, theme.applyDarkStyles({
27
- borderColor: alpha(theme.palette.primary[400], 0.25),
28
- bgcolor: alpha(theme.palette.primary[900], 0.25),
29
- boxShadow: "0 2px 6px 0 ".concat(alpha(theme.palette.primary[600], 0.3), ", 0px 2px 12px 0px rgba(0, 0, 0, 0.25) inset")
30
- }));
31
- },
32
- children: icon
33
- });
34
- }
35
- export function InfoCard(props) {
36
- var classNameDescription = props.classNameDescription,
37
- classNameTitle = props.classNameTitle,
38
- dense = props.dense,
39
- description = props.description,
40
- icon = props.icon,
41
- link = props.link,
42
- svg = props.svg,
43
- title = props.title,
44
- titleProps = props.titleProps,
45
- other = _objectWithoutProperties(props, ["classNameDescription", "classNameTitle", "dense", "description", "icon", "link", "svg", "title", "titleProps"]);
46
- return /*#__PURE__*/_jsxs(Paper, _extends({
47
- variant: "outlined",
48
- component: link ? Link : 'div',
49
- href: link
50
- }, link ? {
51
- noLinkStyle: true,
52
- // Fix overloading with prefetch={false}, only prefetch on hover.
53
- prefetch: false
54
- } : {}, {
55
- sx: function sx(theme) {
56
- return _extends({
57
- p: dense ? 2.5 : 3.5,
58
- height: '100%',
59
- background: "".concat((theme.vars || theme).palette.gradients.linearSubtle)
60
- }, theme.applyDarkStyles({
61
- bgcolor: alpha(theme.palette.primaryDark[800], 0.25),
62
- background: "".concat((theme.vars || theme).palette.gradients.linearSubtle),
63
- borderColor: 'primaryDark.700'
64
- }));
65
- }
66
- }, other, {
67
- children: [svg && svg, icon && /*#__PURE__*/_jsx(GlowingIconContainer, {
68
- icon: icon
69
- }), /*#__PURE__*/_jsx(Typography, _extends({
70
- fontWeight: "bold",
71
- component: "h3",
72
- color: "text.primary",
73
- variant: "body2",
74
- mt: icon ? 2 : 0,
75
- mb: description ? 0.5 : 0,
76
- className: classNameTitle
77
- }, titleProps, {
78
- children: title
79
- })), /*#__PURE__*/_jsx(Typography, {
80
- variant: "body2",
81
- color: "text.secondary",
82
- className: classNameDescription,
83
- children: description
84
- })]
85
- }));
86
- }
@@ -1 +0,0 @@
1
- export * from './InfoCard';
@@ -1,101 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- import * as React from 'react';
4
- import clsx from 'clsx';
5
- import { useRouter } from 'next/router';
6
- import NextLink from 'next/link';
7
- import MuiLink from '@mui/material/Link';
8
- import { styled } from '@mui/material/styles';
9
- import { useUserLanguage } from '../i18n';
10
- import { useDocsConfig } from '../DocsProvider';
11
-
12
- /**
13
- * File to keep in sync with:
14
- *
15
- * - /docs/src/modules/components/Link.tsx
16
- * - /examples/material-ui-nextjs-pages-router/src/Link.js
17
- * - /examples/material-ui-nextjs-pages-router-ts/src/Link.tsx
18
- */
19
-
20
- // Add support for the sx prop for consistency with the other branches.
21
- import { jsx as _jsx } from "react/jsx-runtime";
22
- var Anchor = styled('a')({});
23
- var NextLinkComposed = /*#__PURE__*/React.forwardRef(function NextLinkComposed(props, ref) {
24
- var to = props.to,
25
- linkAs = props.linkAs,
26
- replace = props.replace,
27
- scroll = props.scroll,
28
- shallow = props.shallow,
29
- prefetch = props.prefetch,
30
- _props$legacyBehavior = props.legacyBehavior,
31
- legacyBehavior = _props$legacyBehavior === void 0 ? true : _props$legacyBehavior,
32
- locale = props.locale,
33
- other = _objectWithoutProperties(props, ["to", "linkAs", "replace", "scroll", "shallow", "prefetch", "legacyBehavior", "locale"]);
34
- return /*#__PURE__*/_jsx(NextLink, {
35
- href: to,
36
- prefetch: prefetch,
37
- as: linkAs,
38
- replace: replace,
39
- scroll: scroll,
40
- shallow: shallow,
41
- passHref: true,
42
- locale: locale,
43
- legacyBehavior: legacyBehavior,
44
- children: /*#__PURE__*/_jsx(Anchor, _extends({
45
- "data-no-markdown-link": "true",
46
- ref: ref
47
- }, other))
48
- });
49
- });
50
- // A styled version of the Next.js Pages Router Link component:
51
- // https://nextjs.org/docs/pages/api-reference/components/link
52
- export var Link = /*#__PURE__*/React.forwardRef(function Link(props, ref) {
53
- var _props$activeClassNam = props.activeClassName,
54
- activeClassName = _props$activeClassNam === void 0 ? 'active' : _props$activeClassNam,
55
- as = props.as,
56
- classNameProps = props.className,
57
- href = props.href,
58
- legacyBehavior = props.legacyBehavior,
59
- linkAsProp = props.linkAs,
60
- locale = props.locale,
61
- noLinkStyle = props.noLinkStyle,
62
- prefetch = props.prefetch,
63
- replace = props.replace,
64
- role = props.role,
65
- scroll = props.scroll,
66
- shallow = props.shallow,
67
- other = _objectWithoutProperties(props, ["activeClassName", "as", "className", "href", "legacyBehavior", "linkAs", "locale", "noLinkStyle", "prefetch", "replace", "role", "scroll", "shallow"]);
68
- var router = useRouter();
69
- var pathname = typeof href === 'string' ? href : href == null ? void 0 : href.pathname;
70
- var routerPathname = router.pathname.replace('/[docsTab]', '');
71
- var shouldBeActive = routerPathname === pathname;
72
- var className = clsx(classNameProps, shouldBeActive && activeClassName);
73
- var userLanguage = useUserLanguage();
74
- var _useDocsConfig = useDocsConfig(),
75
- LANGUAGES_IGNORE_PAGES = _useDocsConfig.LANGUAGES_IGNORE_PAGES;
76
- var linkAs = linkAsProp || as || href;
77
- if (userLanguage !== 'en' && pathname && pathname.indexOf('/') === 0 && !LANGUAGES_IGNORE_PAGES(pathname) && !pathname.startsWith("/".concat(userLanguage, "/"))) {
78
- linkAs = "/".concat(userLanguage).concat(linkAs);
79
- }
80
- var nextjsProps = {
81
- to: href,
82
- linkAs: linkAs,
83
- replace: replace,
84
- scroll: scroll,
85
- shallow: shallow,
86
- legacyBehavior: legacyBehavior,
87
- prefetch: prefetch,
88
- locale: locale
89
- };
90
- if (noLinkStyle) {
91
- return /*#__PURE__*/_jsx(NextLinkComposed, _extends({
92
- className: className,
93
- ref: ref
94
- }, nextjsProps, other));
95
- }
96
- return /*#__PURE__*/_jsx(MuiLink, _extends({
97
- component: NextLinkComposed,
98
- className: className,
99
- ref: ref
100
- }, nextjsProps, other));
101
- });
@@ -1 +0,0 @@
1
- export * from './Link';
@@ -1,80 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
3
- var _templateObject;
4
- import * as React from 'react';
5
- import PropTypes from 'prop-types';
6
- import NProgress from 'nprogress';
7
- import { NoSsr } from '@mui/base/NoSsr';
8
- import { exactProp } from '@mui/utils';
9
- import GlobalStyles from '@mui/material/GlobalStyles';
10
- import { keyframes } from '@mui/material/styles';
11
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
- NProgress.configure({
13
- barSelector: '.nprogress-bar',
14
- template: "\n <div class=\"nprogress-bar\">\n <div></div>\n <div></div>\n </div>\n "
15
- });
16
- var muiNProgressPulse = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 30% {\n opacity: 0.6;\n }\n\n 60% {\n opacity: 0;\n }\n\n to {\n opacity: 0.6;\n }\n"])));
17
-
18
- /**
19
- * Elegant and ready-to-use wrapper on top of https://github.com/rstacruz/nprogress/.
20
- * The implementation is highly inspired by the YouTube one.
21
- */
22
- function NProgressBar(props) {
23
- return /*#__PURE__*/_jsxs(NoSsr, {
24
- children: [props.children, /*#__PURE__*/_jsx(GlobalStyles, {
25
- styles: function styles(theme) {
26
- return {
27
- '#nprogress': _extends({
28
- direction: 'ltr',
29
- pointerEvents: 'none',
30
- position: 'fixed',
31
- top: 0,
32
- left: 0,
33
- right: 0,
34
- height: 2,
35
- zIndex: (theme.vars || theme).zIndex.tooltip,
36
- backgroundColor: (theme.vars || theme).palette.primary[200]
37
- }, theme.applyDarkStyles({
38
- backgroundColor: (theme.vars || theme).palette.primary[700]
39
- }), {
40
- '& .nprogress-bar': {
41
- position: 'fixed',
42
- backgroundColor: (theme.vars || theme).palette.primary.main,
43
- top: 0,
44
- left: 0,
45
- right: 0,
46
- height: 2
47
- },
48
- '& .nprogress-bar > div': {
49
- position: 'absolute',
50
- top: 0,
51
- height: 2,
52
- boxShadow: "".concat((theme.vars || theme).palette.primary.main, " 1px 0 6px 1px"),
53
- borderRadius: '100%',
54
- animation: "".concat(muiNProgressPulse, " 2s ease-out 0s infinite")
55
- },
56
- '& .nprogress-bar > div:first-of-type': {
57
- opacity: 0.6,
58
- width: 20,
59
- right: 0,
60
- clip: 'rect(-6px,22px,14px,10px)'
61
- },
62
- '& .nprogress-bar > div:last-of-type': {
63
- opacity: 0.6,
64
- width: 180,
65
- right: -80,
66
- clip: 'rect(-6px,90px,14px,-6px)'
67
- }
68
- })
69
- };
70
- }
71
- })]
72
- });
73
- }
74
- process.env.NODE_ENV !== "production" ? NProgressBar.propTypes = {
75
- children: PropTypes.node
76
- } : void 0;
77
- if (process.env.NODE_ENV !== 'production') {
78
- process.env.NODE_ENV !== "production" ? NProgressBar.propTypes = exactProp(NProgressBar.propTypes) : void 0;
79
- }
80
- export default NProgressBar;
@@ -1 +0,0 @@
1
- export { default } from './NProgressBar';
@@ -1,17 +0,0 @@
1
- import * as React from 'react';
2
- import { ThemeProvider, useTheme } from '@mui/material/styles';
3
- import { brandingDarkTheme, brandingLightTheme } from './brandingTheme';
4
- import { jsx as _jsx } from "react/jsx-runtime";
5
- export function BrandingProvider(props) {
6
- var children = props.children,
7
- modeProp = props.mode;
8
- var upperTheme = useTheme();
9
- var mode = modeProp || upperTheme.palette.mode;
10
- var theme = mode === 'dark' ? brandingDarkTheme : brandingLightTheme;
11
- return /*#__PURE__*/_jsx(ThemeProvider, {
12
- theme: modeProp ? function () {
13
- return theme;
14
- } : theme,
15
- children: children
16
- });
17
- }