@mui/docs 9.0.0-alpha.3 → 9.0.0-beta.0
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/ApiPage/ApiWarningAlert.d.ts +10 -0
- package/ApiPage/ApiWarningAlert.js +22 -0
- package/ApiPage/definitions/classes.d.ts +18 -0
- package/ApiPage/definitions/classes.js +54 -0
- package/ApiPage/definitions/index.d.ts +4 -0
- package/ApiPage/definitions/index.js +4 -0
- package/ApiPage/definitions/properties.d.ts +58 -0
- package/ApiPage/definitions/properties.js +110 -0
- package/ApiPage/definitions/slots.d.ts +16 -0
- package/ApiPage/definitions/slots.js +39 -0
- package/ApiPage/definitions/types.d.ts +53 -0
- package/ApiPage/definitions/types.js +1 -0
- package/ApiPage/index.d.ts +2 -0
- package/ApiPage/index.js +2 -0
- package/ApiPage/list/ClassesList.d.ts +11 -0
- package/ApiPage/list/ClassesList.js +103 -0
- package/ApiPage/list/ExpandableApiItem.d.ts +18 -0
- package/ApiPage/list/ExpandableApiItem.js +241 -0
- package/ApiPage/list/PropertiesList.d.ts +7 -0
- package/ApiPage/list/PropertiesList.js +263 -0
- package/ApiPage/list/SlotsList.d.ts +7 -0
- package/ApiPage/list/SlotsList.js +93 -0
- package/ApiPage/list/index.d.ts +1 -0
- package/ApiPage/list/index.js +1 -0
- package/ApiPage/private.d.ts +3 -0
- package/ApiPage/private.js +3 -0
- package/ApiPage/sections/ClassesSection.d.ts +34 -0
- package/ApiPage/sections/ClassesSection.js +76 -0
- package/ApiPage/sections/PropertiesSection.d.ts +45 -0
- package/ApiPage/sections/PropertiesSection.js +59 -0
- package/ApiPage/sections/SlotsSection.d.ts +24 -0
- package/ApiPage/sections/SlotsSection.js +61 -0
- package/ApiPage/sections/ToggleDisplayOption.d.ts +17 -0
- package/ApiPage/sections/ToggleDisplayOption.js +158 -0
- package/ApiPage/sections/index.d.ts +4 -0
- package/ApiPage/sections/index.js +4 -0
- package/ApiPage/table/ClassesTable.d.ts +7 -0
- package/ApiPage/table/ClassesTable.js +116 -0
- package/ApiPage/table/PropertiesTable.d.ts +6 -0
- package/ApiPage/table/PropertiesTable.js +286 -0
- package/ApiPage/table/SlotsTable.d.ts +6 -0
- package/ApiPage/table/SlotsTable.js +126 -0
- package/ApiPage/table/StyledTableContainer.d.ts +1 -0
- package/ApiPage/table/StyledTableContainer.js +42 -0
- package/ApiPage/types.d.ts +11 -0
- package/ApiPage/types.js +1 -0
- package/CHANGELOG.md +224 -3
- package/DemoContext/DemoContext.d.ts +1 -1
- package/{AnalyticsProvider → DocsApp}/AnalyticsProvider.js +10 -6
- package/DocsApp/DocsApp.d.ts +79 -0
- package/DocsApp/DocsApp.js +105 -0
- package/{GoogleAnalytics → DocsApp}/GoogleAnalytics.js +4 -4
- package/DocsApp/StyledEngineProvider.d.ts +8 -0
- package/{StyledEngineProvider → DocsApp}/StyledEngineProvider.js +2 -8
- package/DocsApp/consoleBanner.d.ts +1 -0
- package/DocsApp/consoleBanner.js +18 -0
- package/DocsApp/createGetInitialProps.d.ts +30 -0
- package/DocsApp/createGetInitialProps.js +29 -0
- package/DocsApp/index.d.ts +5 -0
- package/DocsApp/index.js +4 -0
- package/DocsApp/loadDependencies.d.ts +1 -0
- package/DocsApp/loadDependencies.js +9 -0
- package/DocsApp/reportWebVitals.d.ts +13 -0
- package/DocsApp/reportWebVitals.js +22 -0
- package/DocsApp/serviceWorker.d.ts +1 -0
- package/DocsApp/serviceWorker.js +59 -0
- package/Document/Document.js +2 -2
- package/Document/getInitialProps.js +3 -5
- package/InfoCard/InfoCard.js +9 -5
- package/Link/SkipLink.js +1 -3
- package/NextNProgressBar/NextNProgressBar.js +0 -2
- package/PageContext/PageContext.d.ts +6 -5
- package/branding/BrandingCssVarsProvider.d.ts +9 -5
- package/branding/BrandingCssVarsProvider.js +1 -1
- package/branding/brandingTheme.js +82 -75
- package/codeStyling/codeStyling.d.ts +7 -10
- package/codeStyling/codeStyling.js +0 -4
- package/codeVariant/codeVariant.d.ts +7 -10
- package/codeVariant/codeVariant.js +0 -4
- package/constants/constants.d.ts +10 -10
- package/constants/index.d.ts +1 -1
- package/constants/index.js +1 -1
- package/package.json +35 -44
- package/utils/index.js +0 -1
- package/webpack/index.d.ts +17 -0
- package/webpack/index.js +1 -0
- package/AnalyticsProvider/index.d.ts +0 -1
- package/AnalyticsProvider/index.js +0 -1
- package/GoogleAnalytics/index.d.ts +0 -1
- package/GoogleAnalytics/index.js +0 -1
- package/StyledEngineProvider/StyledEngineProvider.d.ts +0 -9
- package/StyledEngineProvider/index.d.ts +0 -1
- package/StyledEngineProvider/index.js +0 -1
- package/createEmotionCache/index.d.ts +0 -1
- package/createEmotionCache/index.js +0 -1
- /package/{AnalyticsProvider → DocsApp}/AnalyticsProvider.d.ts +0 -0
- /package/{GoogleAnalytics → DocsApp}/GoogleAnalytics.d.ts +0 -0
- /package/{createEmotionCache → DocsApp}/createEmotionCache.d.ts +0 -0
- /package/{createEmotionCache → DocsApp}/createEmotionCache.js +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Track fraction of actual events to prevent exceeding event quota.
|
|
2
|
+
// Filter sessions instead of individual events so that we can track multiple metrics per device.
|
|
3
|
+
// See https://github.com/GoogleChromeLabs/web-vitals-report to use this data
|
|
4
|
+
const disableWebVitalsReporting = Math.random() > 0.0001;
|
|
5
|
+
export function reportWebVitals({
|
|
6
|
+
id,
|
|
7
|
+
name,
|
|
8
|
+
label,
|
|
9
|
+
delta,
|
|
10
|
+
value
|
|
11
|
+
}) {
|
|
12
|
+
if (disableWebVitalsReporting) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
window.gtag('event', name, {
|
|
16
|
+
value: delta,
|
|
17
|
+
metric_label: label === 'web-vital' ? 'Web Vitals' : 'Next.js custom metric',
|
|
18
|
+
metric_value: value,
|
|
19
|
+
metric_delta: delta,
|
|
20
|
+
metric_id: id // id unique to current page load
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerServiceWorker(swPath: string): Promise<void>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
let reloadInterval;
|
|
2
|
+
|
|
3
|
+
// Avoid infinite loop when "Update on reload" is set in the Chrome sw dev tools.
|
|
4
|
+
function lazyReload() {
|
|
5
|
+
clearInterval(reloadInterval);
|
|
6
|
+
reloadInterval = setInterval(() => {
|
|
7
|
+
if (document.hasFocus()) {
|
|
8
|
+
window.location.reload();
|
|
9
|
+
}
|
|
10
|
+
}, 100);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Inspired by
|
|
14
|
+
// https://developers.google.com/web/tools/workbox/guides/advanced-recipes#offer_a_page_reload_for_users
|
|
15
|
+
function forcePageReload(registration) {
|
|
16
|
+
// console.log('already controlled?', Boolean(navigator.serviceWorker.controller));
|
|
17
|
+
|
|
18
|
+
if (!navigator.serviceWorker.controller) {
|
|
19
|
+
// The window client isn't currently controlled so it's a new service
|
|
20
|
+
// worker that will activate immediately.
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// console.log('registration waiting?', Boolean(registration.waiting));
|
|
25
|
+
if (registration.waiting) {
|
|
26
|
+
// SW is waiting to activate. Can occur if multiple clients open and
|
|
27
|
+
// one of the clients is refreshed.
|
|
28
|
+
registration.waiting.postMessage('skipWaiting');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
function listenInstalledStateChange() {
|
|
32
|
+
registration.installing.addEventListener('statechange', event => {
|
|
33
|
+
// console.log('statechange', event.target.state);
|
|
34
|
+
if (event.target.state === 'installed' && registration.waiting) {
|
|
35
|
+
// A new service worker is available, inform the user
|
|
36
|
+
registration.waiting.postMessage('skipWaiting');
|
|
37
|
+
} else if (event.target.state === 'activated') {
|
|
38
|
+
// Force the control of the page by the activated service worker.
|
|
39
|
+
lazyReload();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (registration.installing) {
|
|
44
|
+
listenInstalledStateChange();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// We are currently controlled so a new SW may be found...
|
|
49
|
+
// Add a listener in case a new SW is found,
|
|
50
|
+
registration.addEventListener('updatefound', listenInstalledStateChange);
|
|
51
|
+
}
|
|
52
|
+
export async function registerServiceWorker(swPath) {
|
|
53
|
+
if ('serviceWorker' in navigator && process.env.NODE_ENV === 'production' && window.location.host.includes('mui.com')) {
|
|
54
|
+
// register() automatically attempts to refresh the sw.js.
|
|
55
|
+
const registration = await navigator.serviceWorker.register(swPath);
|
|
56
|
+
// Force the page reload for users.
|
|
57
|
+
forcePageReload(registration);
|
|
58
|
+
}
|
|
59
|
+
}
|
package/Document/Document.js
CHANGED
|
@@ -4,8 +4,8 @@ import Script from 'next/script';
|
|
|
4
4
|
import { Html, Head, Main, NextScript } from 'next/document';
|
|
5
5
|
import GlobalStyles from '@mui/material/GlobalStyles';
|
|
6
6
|
import MuiInitColorSchemeScript from '@mui/material/InitColorSchemeScript';
|
|
7
|
-
import { getMetaThemeColor } from
|
|
8
|
-
import { fontClasses } from
|
|
7
|
+
import { getMetaThemeColor } from "../branding/index.js";
|
|
8
|
+
import { fontClasses } from "../nextFonts/index.js";
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
10
|
export function Document({
|
|
11
11
|
canonicalAsServer,
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
var _style, _style2, _style3, _style4;
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { documentGetInitialProps } from '@mui/material-nextjs/v13-pagesRouter';
|
|
4
|
-
import createEmotionCache from "../createEmotionCache
|
|
4
|
+
import createEmotionCache from "../DocsApp/createEmotionCache.js";
|
|
5
5
|
import { pathnameToLanguage } from "../helpers/helpers.js";
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
8
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
7
|
export function createGetInitialProps({
|
|
10
8
|
setupStyledComponents = false
|
|
11
9
|
}) {
|
|
12
|
-
async function
|
|
10
|
+
async function getInitialPropsDocument(ctx) {
|
|
13
11
|
const styledComponentsSheet = setupStyledComponents ? new (await import('styled-components')).ServerStyleSheet() : null;
|
|
14
12
|
try {
|
|
15
13
|
const finalProps = await documentGetInitialProps(ctx, {
|
|
@@ -58,5 +56,5 @@ export function createGetInitialProps({
|
|
|
58
56
|
}
|
|
59
57
|
}
|
|
60
58
|
}
|
|
61
|
-
return
|
|
59
|
+
return getInitialPropsDocument;
|
|
62
60
|
}
|
package/InfoCard/InfoCard.js
CHANGED
|
@@ -68,18 +68,22 @@ export function InfoCard(props) {
|
|
|
68
68
|
children: [svg && svg, icon && /*#__PURE__*/_jsx(GlowingIconContainer, {
|
|
69
69
|
icon: icon
|
|
70
70
|
}), /*#__PURE__*/_jsx(Typography, {
|
|
71
|
-
fontWeight: "semiBold",
|
|
72
71
|
component: "h3",
|
|
73
|
-
color: "text.primary",
|
|
74
72
|
variant: "body2",
|
|
75
|
-
mt: icon ? 2 : 0,
|
|
76
|
-
mb: description ? 0.5 : 0,
|
|
77
73
|
className: classNameTitle,
|
|
78
74
|
...titleProps,
|
|
75
|
+
sx: [{
|
|
76
|
+
fontWeight: 'semiBold',
|
|
77
|
+
color: 'text.primary',
|
|
78
|
+
mt: icon ? 2 : 0,
|
|
79
|
+
mb: description ? 0.5 : 0
|
|
80
|
+
}, ...(Array.isArray(titleProps?.sx) ? titleProps.sx : [titleProps?.sx])],
|
|
79
81
|
children: title
|
|
80
82
|
}), /*#__PURE__*/_jsx(Typography, {
|
|
81
83
|
variant: "body2",
|
|
82
|
-
|
|
84
|
+
sx: {
|
|
85
|
+
color: 'text.secondary'
|
|
86
|
+
},
|
|
83
87
|
className: classNameDescription,
|
|
84
88
|
children: description
|
|
85
89
|
})]
|
package/Link/SkipLink.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import MuiLink from '@mui/material/Link';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
import { useTranslate } from
|
|
3
|
+
import { useTranslate } from "../i18n/index.js";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
const StyledLink = styled(MuiLink)(({
|
|
6
6
|
theme
|
|
@@ -55,8 +55,6 @@ const StyledLink = styled(MuiLink)(({
|
|
|
55
55
|
}
|
|
56
56
|
})
|
|
57
57
|
}));
|
|
58
|
-
|
|
59
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
60
58
|
export function SkipLink() {
|
|
61
59
|
const t = useTranslate();
|
|
62
60
|
return /*#__PURE__*/_jsx(StyledLink, {
|
|
@@ -9,21 +9,22 @@ export type RootSvgProps<P = unknown> = Omit<React.SVGProps<SVGSVGElement>, 'ref
|
|
|
9
9
|
} & P;
|
|
10
10
|
export interface ProductVersion {
|
|
11
11
|
text: string;
|
|
12
|
-
current
|
|
13
|
-
href?:
|
|
12
|
+
current?: boolean;
|
|
13
|
+
href?: string;
|
|
14
14
|
}
|
|
15
15
|
export interface ProductInfo {
|
|
16
16
|
metadata: string;
|
|
17
17
|
name: string;
|
|
18
|
-
logo
|
|
19
|
-
logoSvg
|
|
20
|
-
wordmarkSvg
|
|
18
|
+
logo?: (props: RootSvgProps) => React.JSX.Element;
|
|
19
|
+
logoSvg?: string;
|
|
20
|
+
wordmarkSvg?: string;
|
|
21
21
|
versions: ProductVersion[];
|
|
22
22
|
}
|
|
23
23
|
export interface MuiPageContext {
|
|
24
24
|
activePage: MuiPage | null;
|
|
25
25
|
pages: MuiPage[];
|
|
26
26
|
productId: MuiProductId;
|
|
27
|
+
productCategoryId: string;
|
|
27
28
|
productIdentifier: ProductInfo;
|
|
28
29
|
activePageParents: MuiPage[];
|
|
29
30
|
}
|
|
@@ -9,15 +9,19 @@ export declare function setDocsColors(primary: Record<string, string>, secondary
|
|
|
9
9
|
export declare function resetDocsColor(): void;
|
|
10
10
|
export declare function setDocsSpacing(value: number): void;
|
|
11
11
|
export declare function resetDocsSpacing(): void;
|
|
12
|
+
export declare function getTheme(direction: 'ltr' | 'rtl'): import("@mui/material/styles").Theme;
|
|
13
|
+
interface BrandingCssThemeProviderProps {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
direction?: 'ltr' | 'rtl';
|
|
16
|
+
forceThemeRerender?: boolean;
|
|
17
|
+
}
|
|
12
18
|
export declare function BrandingCssThemeProvider({
|
|
13
19
|
children,
|
|
14
20
|
direction,
|
|
15
21
|
forceThemeRerender
|
|
16
|
-
}:
|
|
17
|
-
direction?: 'ltr' | 'rtl';
|
|
18
|
-
forceThemeRerender?: boolean;
|
|
19
|
-
}>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
}: BrandingCssThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
20
23
|
export declare function BrandingCssVarsProvider(props: {
|
|
21
24
|
children: React.ReactNode;
|
|
22
25
|
direction?: 'ltr' | 'rtl';
|
|
23
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -104,7 +104,7 @@ export function resetDocsSpacing() {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
const themeCache = new Map();
|
|
107
|
-
function getTheme(direction) {
|
|
107
|
+
export function getTheme(direction) {
|
|
108
108
|
let cachedTheme = themeCache.get(direction);
|
|
109
109
|
if (!cachedTheme) {
|
|
110
110
|
cachedTheme = createTheme({
|
|
@@ -317,7 +317,9 @@ export function getThemedComponents() {
|
|
|
317
317
|
components: {
|
|
318
318
|
MuiAlert: {
|
|
319
319
|
styleOverrides: {
|
|
320
|
-
root: {
|
|
320
|
+
root: ({
|
|
321
|
+
theme
|
|
322
|
+
}) => ({
|
|
321
323
|
padding: '16px',
|
|
322
324
|
gap: '12px',
|
|
323
325
|
fontSize: '1rem',
|
|
@@ -333,80 +335,85 @@ export function getThemedComponents() {
|
|
|
333
335
|
},
|
|
334
336
|
'& .MuiAlert-message': {
|
|
335
337
|
padding: 0
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
+
},
|
|
339
|
+
variants: [{
|
|
340
|
+
// same styles from the MarkdownElement callout
|
|
341
|
+
props: {
|
|
342
|
+
variant: 'standard',
|
|
343
|
+
color: 'warning'
|
|
344
|
+
},
|
|
345
|
+
style: [{
|
|
346
|
+
backgroundColor: alpha(theme.palette.warning[50], 0.5),
|
|
347
|
+
color: (theme.vars || theme).palette.grey[900],
|
|
348
|
+
border: '1px solid',
|
|
349
|
+
borderColor: alpha(theme.palette.warning[700], 0.15),
|
|
350
|
+
'& .MuiAlert-icon': {
|
|
351
|
+
color: (theme.vars || theme).palette.warning[600]
|
|
352
|
+
},
|
|
353
|
+
'& * a': {
|
|
354
|
+
// !important is used here to override the anchor tag color coming from MarkdownElement
|
|
355
|
+
color: `${(theme.vars || theme).palette.warning[900]} !important`,
|
|
356
|
+
textDecorationColor: `${alpha(theme.palette.warning.main, 0.4)} !important`,
|
|
357
|
+
'&:hover': {
|
|
358
|
+
textDecorationColor: `${(theme.vars || theme).palette.warning[900]} !important`
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}, theme.applyDarkStyles({
|
|
362
|
+
backgroundColor: alpha(theme.palette.warning[700], 0.12),
|
|
363
|
+
color: (theme.vars || theme).palette.warning[50],
|
|
364
|
+
'& .MuiAlert-icon': {
|
|
365
|
+
color: (theme.vars || theme).palette.warning[400]
|
|
366
|
+
},
|
|
367
|
+
'& * a': {
|
|
368
|
+
color: `${(theme.vars || theme).palette.warning[100]} !important`,
|
|
369
|
+
textDecorationColor: `${alpha(theme.palette.warning[600], 0.4)} !important`,
|
|
370
|
+
'&:hover': {
|
|
371
|
+
textDecorationColor: `${(theme.vars || theme).palette.warning[600]} !important`
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
})]
|
|
375
|
+
}, {
|
|
376
|
+
// same styles from the MarkdownElement callout
|
|
377
|
+
props: {
|
|
378
|
+
variant: 'standard',
|
|
379
|
+
color: 'success'
|
|
380
|
+
},
|
|
381
|
+
style: [{
|
|
382
|
+
backgroundColor: alpha(theme.palette.success[50], 0.5),
|
|
383
|
+
color: (theme.vars || theme).palette.success[900],
|
|
384
|
+
border: `1px solid ${(theme.vars || theme).palette.success[100]}`,
|
|
385
|
+
'& .MuiAlert-icon': {
|
|
386
|
+
color: (theme.vars || theme).palette.success[600]
|
|
387
|
+
},
|
|
388
|
+
'& * a': {
|
|
389
|
+
// !important is used here to override the anchor tag color coming from MarkdownElement
|
|
390
|
+
color: `${(theme.vars || theme).palette.success[900]} !important`,
|
|
391
|
+
textDecorationColor: `${alpha(theme.palette.success.main, 0.4)} !important`,
|
|
392
|
+
'&:hover': {
|
|
393
|
+
textDecorationColor: `${(theme.vars || theme).palette.success[900]} !important`
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}, theme.applyDarkStyles({
|
|
397
|
+
backgroundColor: alpha(theme.palette.success[700], 0.12),
|
|
398
|
+
color: (theme.vars || theme).palette.success[50],
|
|
399
|
+
borderColor: alpha(theme.palette.success[400], 0.1),
|
|
400
|
+
'& .MuiAlert-icon': {
|
|
401
|
+
color: (theme.vars || theme).palette.success[500]
|
|
402
|
+
},
|
|
403
|
+
'& * a': {
|
|
404
|
+
color: `${(theme.vars || theme).palette.success[100]} !important`,
|
|
405
|
+
textDecorationColor: `${alpha(theme.palette.success[600], 0.4)} !important`,
|
|
406
|
+
'&:hover': {
|
|
407
|
+
textDecorationColor: `${(theme.vars || theme).palette.success[600]} !important`
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
})]
|
|
411
|
+
}]
|
|
412
|
+
}),
|
|
338
413
|
icon: {
|
|
339
414
|
paddingTop: 10,
|
|
340
415
|
paddingBottom: 0
|
|
341
|
-
}
|
|
342
|
-
standardWarning: ({
|
|
343
|
-
theme
|
|
344
|
-
}) => [
|
|
345
|
-
// same styles from the MarkdownElement callout
|
|
346
|
-
{
|
|
347
|
-
backgroundColor: alpha(theme.palette.warning[50], 0.5),
|
|
348
|
-
color: (theme.vars || theme).palette.grey[900],
|
|
349
|
-
border: '1px solid',
|
|
350
|
-
borderColor: alpha(theme.palette.warning[700], 0.15),
|
|
351
|
-
'& .MuiAlert-icon': {
|
|
352
|
-
color: (theme.vars || theme).palette.warning[600]
|
|
353
|
-
},
|
|
354
|
-
'& * a': {
|
|
355
|
-
// !important is used here to override the anchor tag color coming from MarkdownElement
|
|
356
|
-
color: `${(theme.vars || theme).palette.warning[900]} !important`,
|
|
357
|
-
textDecorationColor: `${alpha(theme.palette.warning.main, 0.4)} !important`,
|
|
358
|
-
'&:hover': {
|
|
359
|
-
textDecorationColor: `${(theme.vars || theme).palette.warning[900]} !important`
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}, theme.applyDarkStyles({
|
|
363
|
-
backgroundColor: alpha(theme.palette.warning[700], 0.12),
|
|
364
|
-
color: (theme.vars || theme).palette.warning[50],
|
|
365
|
-
'& .MuiAlert-icon': {
|
|
366
|
-
color: (theme.vars || theme).palette.warning[400]
|
|
367
|
-
},
|
|
368
|
-
'& * a': {
|
|
369
|
-
color: `${(theme.vars || theme).palette.warning[100]} !important`,
|
|
370
|
-
textDecorationColor: `${alpha(theme.palette.warning[600], 0.4)} !important`,
|
|
371
|
-
'&:hover': {
|
|
372
|
-
textDecorationColor: `${(theme.vars || theme).palette.warning[600]} !important`
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
})],
|
|
376
|
-
standardSuccess: ({
|
|
377
|
-
theme
|
|
378
|
-
}) => [
|
|
379
|
-
// same styles from the MarkdownElement callout
|
|
380
|
-
{
|
|
381
|
-
backgroundColor: alpha(theme.palette.success[50], 0.5),
|
|
382
|
-
color: (theme.vars || theme).palette.success[900],
|
|
383
|
-
border: `1px solid ${(theme.vars || theme).palette.success[100]}`,
|
|
384
|
-
'& .MuiAlert-icon': {
|
|
385
|
-
color: (theme.vars || theme).palette.success[600]
|
|
386
|
-
},
|
|
387
|
-
'& * a': {
|
|
388
|
-
// !important is used here to override the anchor tag color coming from MarkdownElement
|
|
389
|
-
color: `${(theme.vars || theme).palette.success[900]} !important`,
|
|
390
|
-
textDecorationColor: `${alpha(theme.palette.success.main, 0.4)} !important`,
|
|
391
|
-
'&:hover': {
|
|
392
|
-
textDecorationColor: `${(theme.vars || theme).palette.success[900]} !important`
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
}, theme.applyDarkStyles({
|
|
396
|
-
backgroundColor: alpha(theme.palette.success[700], 0.12),
|
|
397
|
-
color: (theme.vars || theme).palette.success[50],
|
|
398
|
-
borderColor: alpha(theme.palette.success[400], 0.1),
|
|
399
|
-
'& .MuiAlert-icon': {
|
|
400
|
-
color: (theme.vars || theme).palette.success[500]
|
|
401
|
-
},
|
|
402
|
-
'& * a': {
|
|
403
|
-
color: `${(theme.vars || theme).palette.success[100]} !important`,
|
|
404
|
-
textDecorationColor: `${alpha(theme.palette.success[600], 0.4)} !important`,
|
|
405
|
-
'&:hover': {
|
|
406
|
-
textDecorationColor: `${(theme.vars || theme).palette.success[600]} !important`
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
})]
|
|
416
|
+
}
|
|
410
417
|
}
|
|
411
418
|
},
|
|
412
419
|
MuiButtonBase: {
|
|
@@ -1185,12 +1192,12 @@ export function getThemedComponents() {
|
|
|
1185
1192
|
IconComponent: ArrowDropDownRounded
|
|
1186
1193
|
},
|
|
1187
1194
|
styleOverrides: {
|
|
1188
|
-
iconFilled: {
|
|
1189
|
-
top: 'calc(50% - .25em)'
|
|
1190
|
-
},
|
|
1191
1195
|
root: ({
|
|
1192
1196
|
theme
|
|
1193
1197
|
}) => ({
|
|
1198
|
+
'& .MuiSelect-filled ~ .MuiSelect-icon': {
|
|
1199
|
+
top: 'calc(50% - .25em)'
|
|
1200
|
+
},
|
|
1194
1201
|
variants: [{
|
|
1195
1202
|
props: {
|
|
1196
1203
|
variant: 'outlined'
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export function
|
|
8
|
-
export function useNoSsrCodeStyling(): any;
|
|
9
|
-
export function useSetCodeStyling(): () => void;
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function CodeStylingProvider(props: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function useCodeStyling(): string;
|
|
6
|
+
export declare function useNoSsrCodeStyling(): string | undefined;
|
|
7
|
+
export declare function useSetCodeStyling(): React.Dispatch<React.SetStateAction<string>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { CODE_STYLING } from "../constants/index.js";
|
|
4
3
|
import { getCookie } from "../helpers/index.js";
|
|
@@ -70,9 +69,6 @@ export function CodeStylingProvider(props) {
|
|
|
70
69
|
children: children
|
|
71
70
|
});
|
|
72
71
|
}
|
|
73
|
-
process.env.NODE_ENV !== "production" ? CodeStylingProvider.propTypes = {
|
|
74
|
-
children: PropTypes.node.isRequired
|
|
75
|
-
} : void 0;
|
|
76
72
|
export function useCodeStyling() {
|
|
77
73
|
return React.useContext(CodeStylingContext).codeStyling;
|
|
78
74
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export function
|
|
8
|
-
export function useNoSsrCodeVariant(): any;
|
|
9
|
-
export function useSetCodeVariant(): () => void;
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function CodeVariantProvider(props: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function useCodeVariant(): string;
|
|
6
|
+
export declare function useNoSsrCodeVariant(): string | undefined;
|
|
7
|
+
export declare function useSetCodeVariant(): React.Dispatch<React.SetStateAction<string>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { CODE_VARIANTS } from "../constants/index.js";
|
|
4
3
|
import { getCookie } from "../helpers/index.js";
|
|
@@ -59,9 +58,6 @@ export function CodeVariantProvider(props) {
|
|
|
59
58
|
children: children
|
|
60
59
|
});
|
|
61
60
|
}
|
|
62
|
-
process.env.NODE_ENV !== "production" ? CodeVariantProvider.propTypes = {
|
|
63
|
-
children: PropTypes.node.isRequired
|
|
64
|
-
} : void 0;
|
|
65
61
|
export function useCodeVariant() {
|
|
66
62
|
return React.useContext(CodeVariantContext).codeVariant;
|
|
67
63
|
}
|
package/constants/constants.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
export const LANGUAGES_LABEL: {
|
|
1
|
+
export declare const CODE_VARIANTS: {
|
|
2
|
+
JS: string;
|
|
3
|
+
TS: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const CODE_STYLING: {
|
|
6
|
+
SYSTEM: string;
|
|
7
|
+
TAILWIND: string;
|
|
8
|
+
CSS: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const LANGUAGES_LABEL: {
|
|
11
11
|
code: string;
|
|
12
12
|
text: string;
|
|
13
13
|
}[];
|
package/constants/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./constants.js";
|
package/constants/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./constants.js";
|