@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.
- package/CHANGELOG.md +462 -4
- package/CodeCopy/CodeCopy.d.ts +20 -0
- package/CodeCopy/CodeCopy.js +172 -0
- package/CodeCopy/CodeCopyButton.d.ts +5 -0
- package/CodeCopy/CodeCopyButton.js +41 -0
- package/CodeCopy/index.d.ts +3 -0
- package/CodeCopy/index.js +3 -0
- package/CodeCopy/package.json +6 -0
- package/CodeCopy/useClipboardCopy.d.ts +4 -0
- package/CodeCopy/useClipboardCopy.js +21 -0
- package/ComponentLinkHeader/ComponentLinkHeader.d.ts +9 -0
- package/ComponentLinkHeader/ComponentLinkHeader.js +179 -0
- package/ComponentLinkHeader/index.d.ts +2 -0
- package/ComponentLinkHeader/index.js +2 -0
- package/ComponentLinkHeader/package.json +6 -0
- package/HighlightedCode/HighlightedCode.d.ts +14 -0
- package/HighlightedCode/HighlightedCode.js +68 -0
- package/HighlightedCode/index.d.ts +1 -0
- package/HighlightedCode/index.js +1 -0
- package/HighlightedCode/package.json +6 -0
- package/InfoCard/InfoCard.d.ts +0 -1
- package/InfoCard/InfoCard.js +45 -44
- package/Link/Link.js +40 -38
- package/MarkdownElement/MarkdownElement.d.ts +6 -0
- package/MarkdownElement/MarkdownElement.js +825 -0
- package/MarkdownElement/index.d.ts +1 -0
- package/MarkdownElement/index.js +1 -0
- package/MarkdownElement/package.json +6 -0
- package/NProgressBar/NProgressBar.js +6 -7
- package/SectionTitle/SectionTitle.d.ts +7 -0
- package/SectionTitle/SectionTitle.js +30 -0
- package/SectionTitle/index.d.ts +1 -0
- package/SectionTitle/index.js +1 -0
- package/SectionTitle/package.json +6 -0
- package/branding/brandingTheme.js +569 -369
- package/node/CodeCopy/CodeCopy.js +188 -0
- package/node/CodeCopy/CodeCopyButton.js +50 -0
- package/node/CodeCopy/index.js +40 -0
- package/node/CodeCopy/useClipboardCopy.js +30 -0
- package/node/ComponentLinkHeader/ComponentLinkHeader.js +189 -0
- package/node/ComponentLinkHeader/index.js +24 -0
- package/node/HighlightedCode/HighlightedCode.js +77 -0
- package/node/HighlightedCode/index.js +16 -0
- package/node/InfoCard/InfoCard.js +45 -44
- package/node/Link/Link.js +43 -40
- package/node/MarkdownElement/MarkdownElement.js +837 -0
- package/node/MarkdownElement/index.js +16 -0
- package/node/NProgressBar/NProgressBar.js +6 -7
- package/node/SectionTitle/SectionTitle.js +38 -0
- package/node/SectionTitle/index.js +16 -0
- package/node/branding/brandingTheme.js +569 -369
- package/node/svgIcons/AdobeXDIcon.js +22 -0
- package/node/svgIcons/BundleSizeIcon.js +22 -0
- package/node/svgIcons/FigmaIcon.js +31 -0
- package/node/svgIcons/FileDownload.js +3 -3
- package/node/svgIcons/JavaScript.js +3 -3
- package/node/svgIcons/MaterialDesignIcon.js +27 -0
- package/node/svgIcons/SketchIcon.js +36 -0
- package/node/svgIcons/TypeScript.js +3 -3
- package/node/svgIcons/W3CIcon.js +24 -0
- package/node/translations/translations.json +4 -2
- package/package.json +6 -4
- package/svgIcons/AdobeXDIcon.d.ts +4 -0
- package/svgIcons/AdobeXDIcon.js +14 -0
- package/svgIcons/BundleSizeIcon.d.ts +4 -0
- package/svgIcons/BundleSizeIcon.js +14 -0
- package/svgIcons/FigmaIcon.d.ts +4 -0
- package/svgIcons/FigmaIcon.js +23 -0
- package/svgIcons/FileDownload.d.ts +7 -0
- package/svgIcons/FileDownload.js +3 -3
- package/svgIcons/JavaScript.d.ts +7 -0
- package/svgIcons/JavaScript.js +3 -3
- package/svgIcons/MaterialDesignIcon.d.ts +4 -0
- package/svgIcons/MaterialDesignIcon.js +19 -0
- package/svgIcons/SketchIcon.d.ts +4 -0
- package/svgIcons/SketchIcon.js +28 -0
- package/svgIcons/TypeScript.d.ts +7 -0
- package/svgIcons/TypeScript.js +3 -3
- package/svgIcons/W3CIcon.d.ts +4 -0
- package/svgIcons/W3CIcon.js +16 -0
- package/translations/translations.json +4 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/legacy/DocsProvider/DocsProvider.js +0 -25
- package/legacy/DocsProvider/index.js +0 -1
- package/legacy/InfoCard/InfoCard.js +0 -86
- package/legacy/InfoCard/index.js +0 -1
- package/legacy/Link/Link.js +0 -101
- package/legacy/Link/index.js +0 -1
- package/legacy/NProgressBar/NProgressBar.js +0 -80
- package/legacy/NProgressBar/index.js +0 -1
- package/legacy/branding/BrandingProvider.js +0 -17
- package/legacy/branding/brandingTheme.js +0 -1168
- package/legacy/branding/index.js +0 -2
- package/legacy/i18n/i18n.js +0 -105
- package/legacy/i18n/index.js +0 -1
- package/legacy/svgIcons/FileDownload.js +0 -14
- package/legacy/svgIcons/JavaScript.js +0 -14
- package/legacy/svgIcons/TypeScript.js +0 -14
- package/legacy/translations/index.js +0 -4
package/legacy/branding/index.js
DELETED
package/legacy/i18n/i18n.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { deepmerge } from '@mui/utils';
|
|
4
|
-
import defaultTranslations from '../translations';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
var TranslationsContext = /*#__PURE__*/React.createContext(defaultTranslations);
|
|
7
|
-
function TranslationsProvider(_ref) {
|
|
8
|
-
var _ref$translations = _ref.translations,
|
|
9
|
-
translations = _ref$translations === void 0 ? {} : _ref$translations,
|
|
10
|
-
children = _ref.children;
|
|
11
|
-
var currentTranslations = React.useContext(TranslationsContext);
|
|
12
|
-
var mergedTranslations = React.useMemo(function () {
|
|
13
|
-
return deepmerge(currentTranslations, translations);
|
|
14
|
-
}, [currentTranslations, translations]);
|
|
15
|
-
return /*#__PURE__*/_jsx(TranslationsContext.Provider, {
|
|
16
|
-
value: mergedTranslations,
|
|
17
|
-
children: children
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function getPath(obj, path) {
|
|
21
|
-
if (!path || typeof path !== 'string') {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
return path.split('.').reduce(function (acc, item) {
|
|
25
|
-
return acc && acc[item] ? acc[item] : null;
|
|
26
|
-
}, obj);
|
|
27
|
-
}
|
|
28
|
-
var UserLanguageContext = /*#__PURE__*/React.createContext({
|
|
29
|
-
userLanguage: '',
|
|
30
|
-
setUserLanguage: function setUserLanguage() {}
|
|
31
|
-
});
|
|
32
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
33
|
-
UserLanguageContext.displayName = 'UserLanguage';
|
|
34
|
-
}
|
|
35
|
-
export function UserLanguageProvider(props) {
|
|
36
|
-
var children = props.children,
|
|
37
|
-
translations = props.translations,
|
|
38
|
-
defaultUserLanguage = props.defaultUserLanguage;
|
|
39
|
-
var _React$useState = React.useState(defaultUserLanguage),
|
|
40
|
-
userLanguage = _React$useState[0],
|
|
41
|
-
setUserLanguage = _React$useState[1];
|
|
42
|
-
var contextValue = React.useMemo(function () {
|
|
43
|
-
return {
|
|
44
|
-
userLanguage: userLanguage,
|
|
45
|
-
setUserLanguage: setUserLanguage
|
|
46
|
-
};
|
|
47
|
-
}, [userLanguage]);
|
|
48
|
-
return /*#__PURE__*/_jsx(TranslationsProvider, {
|
|
49
|
-
translations: translations,
|
|
50
|
-
children: /*#__PURE__*/_jsx(UserLanguageContext.Provider, {
|
|
51
|
-
value: contextValue,
|
|
52
|
-
children: children
|
|
53
|
-
})
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
process.env.NODE_ENV !== "production" ? UserLanguageProvider.propTypes = {
|
|
57
|
-
children: PropTypes.node.isRequired,
|
|
58
|
-
defaultUserLanguage: PropTypes.string
|
|
59
|
-
} : void 0;
|
|
60
|
-
export function useUserLanguage() {
|
|
61
|
-
return React.useContext(UserLanguageContext).userLanguage;
|
|
62
|
-
}
|
|
63
|
-
export function useSetUserLanguage() {
|
|
64
|
-
return React.useContext(UserLanguageContext).setUserLanguage;
|
|
65
|
-
}
|
|
66
|
-
var warnedOnce = {};
|
|
67
|
-
export function useTranslate() {
|
|
68
|
-
var userLanguage = useUserLanguage();
|
|
69
|
-
var translations = React.useContext(TranslationsContext);
|
|
70
|
-
return React.useMemo(function () {
|
|
71
|
-
return function translate(key) {
|
|
72
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
73
|
-
var _options$ignoreWarnin = options.ignoreWarning,
|
|
74
|
-
ignoreWarning = _options$ignoreWarnin === void 0 ? false : _options$ignoreWarnin;
|
|
75
|
-
var wordings = translations[userLanguage];
|
|
76
|
-
if (!wordings) {
|
|
77
|
-
console.error("Missing language: ".concat(userLanguage, "."));
|
|
78
|
-
return '…';
|
|
79
|
-
}
|
|
80
|
-
var translation = getPath(wordings, key);
|
|
81
|
-
if (!translation) {
|
|
82
|
-
var fullKey = "".concat(userLanguage, ":").concat(key);
|
|
83
|
-
// No warnings in CI env
|
|
84
|
-
if (!ignoreWarning && !warnedOnce[fullKey] && typeof window !== 'undefined') {
|
|
85
|
-
console.error("Missing translation for ".concat(fullKey));
|
|
86
|
-
warnedOnce[fullKey] = true;
|
|
87
|
-
}
|
|
88
|
-
return getPath(translations.en, key);
|
|
89
|
-
}
|
|
90
|
-
return translation;
|
|
91
|
-
};
|
|
92
|
-
}, [userLanguage, translations]);
|
|
93
|
-
}
|
|
94
|
-
export function mapTranslations(req) {
|
|
95
|
-
var result = {};
|
|
96
|
-
req.keys().forEach(function (filename) {
|
|
97
|
-
var match = filename.match(/-([a-z]{2}).json$/);
|
|
98
|
-
if (match) {
|
|
99
|
-
result[match[1]] = req(filename);
|
|
100
|
-
} else {
|
|
101
|
-
result.en = req(filename);
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
return result;
|
|
105
|
-
}
|
package/legacy/i18n/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './i18n';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
var _path;
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import SvgIcon from '@mui/material/SvgIcon';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
function FileDownload(props) {
|
|
7
|
-
return /*#__PURE__*/_jsx(SvgIcon, _extends({}, props, {
|
|
8
|
-
children: _path || (_path = /*#__PURE__*/_jsx("path", {
|
|
9
|
-
d: "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"
|
|
10
|
-
}))
|
|
11
|
-
}));
|
|
12
|
-
}
|
|
13
|
-
FileDownload.muiName = 'SvgIcon';
|
|
14
|
-
export default FileDownload;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
var _path;
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import SvgIcon from '@mui/material/SvgIcon';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
function JavaScript(props) {
|
|
7
|
-
return /*#__PURE__*/_jsx(SvgIcon, _extends({}, props, {
|
|
8
|
-
children: _path || (_path = /*#__PURE__*/_jsx("path", {
|
|
9
|
-
d: "M3,3H21V21H3V3M7.73,18.04C8.13,18.89 8.92,19.59 10.27,19.59C11.77,19.59 12.8,18.79 12.8,17.04V11.26H11.1V17C11.1,17.86 10.75,18.08 10.2,18.08C9.62,18.08 9.38,17.68 9.11,17.21L7.73,18.04M13.71,17.86C14.21,18.84 15.22,19.59 16.8,19.59C18.4,19.59 19.6,18.76 19.6,17.23C19.6,15.82 18.79,15.19 17.35,14.57L16.93,14.39C16.2,14.08 15.89,13.87 15.89,13.37C15.89,12.96 16.2,12.64 16.7,12.64C17.18,12.64 17.5,12.85 17.79,13.37L19.1,12.5C18.55,11.54 17.77,11.17 16.7,11.17C15.19,11.17 14.22,12.13 14.22,13.4C14.22,14.78 15.03,15.43 16.25,15.95L16.67,16.13C17.45,16.47 17.91,16.68 17.91,17.26C17.91,17.74 17.46,18.09 16.76,18.09C15.93,18.09 15.45,17.66 15.09,17.06L13.71,17.86Z"
|
|
10
|
-
}))
|
|
11
|
-
}));
|
|
12
|
-
}
|
|
13
|
-
JavaScript.muiName = 'SvgIcon';
|
|
14
|
-
export default JavaScript;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
var _path;
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import SvgIcon from '@mui/material/SvgIcon';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
function TypeScript(props) {
|
|
7
|
-
return /*#__PURE__*/_jsx(SvgIcon, _extends({}, props, {
|
|
8
|
-
children: _path || (_path = /*#__PURE__*/_jsx("path", {
|
|
9
|
-
d: "M3,3H21V21H3V3M13.71,17.86C14.21,18.84 15.22,19.59 16.8,19.59C18.4,19.59 19.6,18.76 19.6,17.23C19.6,15.82 18.79,15.19 17.35,14.57L16.93,14.39C16.2,14.08 15.89,13.87 15.89,13.37C15.89,12.96 16.2,12.64 16.7,12.64C17.18,12.64 17.5,12.85 17.79,13.37L19.1,12.5C18.55,11.54 17.77,11.17 16.7,11.17C15.19,11.17 14.22,12.13 14.22,13.4C14.22,14.78 15.03,15.43 16.25,15.95L16.67,16.13C17.45,16.47 17.91,16.68 17.91,17.26C17.91,17.74 17.46,18.09 16.76,18.09C15.93,18.09 15.45,17.66 15.09,17.06L13.71,17.86M13,11.25H8V12.75H9.5V20H11.25V12.75H13V11.25Z"
|
|
10
|
-
}))
|
|
11
|
-
}));
|
|
12
|
-
}
|
|
13
|
-
TypeScript.muiName = 'SvgIcon';
|
|
14
|
-
export default TypeScript;
|