paradiego
This commit is contained in:
29
node_modules/@mui/material/modern/styles/ThemeProvider.js
generated
vendored
Normal file
29
node_modules/@mui/material/modern/styles/ThemeProvider.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import ThemeProviderNoVars from "./ThemeProviderNoVars.js";
|
||||
import { CssVarsProvider } from "./ThemeProviderWithVars.js";
|
||||
import THEME_ID from "./identifier.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
export default function ThemeProvider({
|
||||
theme,
|
||||
...props
|
||||
}) {
|
||||
if (typeof theme === 'function') {
|
||||
return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
|
||||
theme: theme,
|
||||
...props
|
||||
});
|
||||
}
|
||||
const muiTheme = THEME_ID in theme ? theme[THEME_ID] : theme;
|
||||
if (!('colorSchemes' in muiTheme)) {
|
||||
return /*#__PURE__*/_jsx(ThemeProviderNoVars, {
|
||||
theme: theme,
|
||||
...props
|
||||
});
|
||||
}
|
||||
return /*#__PURE__*/_jsx(CssVarsProvider, {
|
||||
theme: theme,
|
||||
...props
|
||||
});
|
||||
}
|
||||
17
node_modules/@mui/material/modern/styles/ThemeProviderNoVars.js
generated
vendored
Normal file
17
node_modules/@mui/material/modern/styles/ThemeProviderNoVars.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import { ThemeProvider as SystemThemeProvider } from '@mui/system';
|
||||
import THEME_ID from "./identifier.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
export default function ThemeProviderNoVars({
|
||||
theme: themeInput,
|
||||
...props
|
||||
}) {
|
||||
const scopedTheme = THEME_ID in themeInput ? themeInput[THEME_ID] : undefined;
|
||||
return /*#__PURE__*/_jsx(SystemThemeProvider, {
|
||||
...props,
|
||||
themeId: scopedTheme ? THEME_ID : undefined,
|
||||
theme: scopedTheme || themeInput
|
||||
});
|
||||
}
|
||||
91
node_modules/@mui/material/modern/styles/ThemeProviderWithVars.js
generated
vendored
Normal file
91
node_modules/@mui/material/modern/styles/ThemeProviderWithVars.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import styleFunctionSx from '@mui/system/styleFunctionSx';
|
||||
import { unstable_createCssVarsProvider as createCssVarsProvider } from '@mui/system';
|
||||
import createTheme from "./createTheme.js";
|
||||
import createTypography from "./createTypography.js";
|
||||
import THEME_ID from "./identifier.js";
|
||||
import { defaultConfig } from "../InitColorSchemeScript/InitColorSchemeScript.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const {
|
||||
CssVarsProvider: InternalCssVarsProvider,
|
||||
useColorScheme,
|
||||
getInitColorSchemeScript: deprecatedGetInitColorSchemeScript
|
||||
} = createCssVarsProvider({
|
||||
themeId: THEME_ID,
|
||||
// @ts-ignore ignore module augmentation tests
|
||||
theme: () => createTheme({
|
||||
cssVariables: true
|
||||
}),
|
||||
colorSchemeStorageKey: defaultConfig.colorSchemeStorageKey,
|
||||
modeStorageKey: defaultConfig.modeStorageKey,
|
||||
defaultColorScheme: {
|
||||
light: defaultConfig.defaultLightColorScheme,
|
||||
dark: defaultConfig.defaultDarkColorScheme
|
||||
},
|
||||
resolveTheme: theme => {
|
||||
const newTheme = {
|
||||
...theme,
|
||||
typography: createTypography(theme.palette, theme.typography)
|
||||
};
|
||||
newTheme.unstable_sx = function sx(props) {
|
||||
return styleFunctionSx({
|
||||
sx: props,
|
||||
theme: this
|
||||
});
|
||||
};
|
||||
return newTheme;
|
||||
}
|
||||
});
|
||||
let warnedOnce = false;
|
||||
|
||||
// TODO: remove in v7
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
function Experimental_CssVarsProvider(props) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (!warnedOnce) {
|
||||
console.warn(['MUI: The Experimental_CssVarsProvider component has been ported into ThemeProvider.', '', "You should use `import { ThemeProvider } from '@mui/material/styles'` instead.", 'For more details, check out https://mui.com/material-ui/customization/css-theme-variables/usage/'].join('\n'));
|
||||
warnedOnce = true;
|
||||
}
|
||||
}
|
||||
return /*#__PURE__*/_jsx(InternalCssVarsProvider, {
|
||||
...props
|
||||
});
|
||||
}
|
||||
let warnedInitScriptOnce = false;
|
||||
|
||||
// TODO: remove in v7
|
||||
const getInitColorSchemeScript = params => {
|
||||
if (!warnedInitScriptOnce) {
|
||||
console.warn(['MUI: The getInitColorSchemeScript function has been deprecated.', '', "You should use `import InitColorSchemeScript from '@mui/material/InitColorSchemeScript'`", 'and replace the function call with `<InitColorSchemeScript />` instead.'].join('\n'));
|
||||
warnedInitScriptOnce = true;
|
||||
}
|
||||
return deprecatedGetInitColorSchemeScript(params);
|
||||
};
|
||||
|
||||
/**
|
||||
* TODO: remove this export in v7
|
||||
* @deprecated
|
||||
* The `CssVarsProvider` component has been deprecated and ported into `ThemeProvider`.
|
||||
*
|
||||
* You should use `ThemeProvider` and `createTheme` instead:
|
||||
*
|
||||
* ```diff
|
||||
* - import { CssVarsProvider, extendTheme } from '@mui/material/styles';
|
||||
* + import { ThemeProvider, createTheme } from '@mui/material/styles';
|
||||
*
|
||||
* - const theme = extendTheme();
|
||||
* + const theme = createTheme({
|
||||
* + cssVariables: true,
|
||||
* + colorSchemes: { light: true, dark: true },
|
||||
* + });
|
||||
*
|
||||
* - <CssVarsProvider theme={theme}>
|
||||
* + <ThemeProvider theme={theme}>
|
||||
* ```
|
||||
*
|
||||
* To see the full documentation, check out https://mui.com/material-ui/customization/css-theme-variables/usage/.
|
||||
*/
|
||||
export const CssVarsProvider = InternalCssVarsProvider;
|
||||
export { useColorScheme, getInitColorSchemeScript, Experimental_CssVarsProvider };
|
||||
81
node_modules/@mui/material/modern/styles/adaptV4Theme.js
generated
vendored
Normal file
81
node_modules/@mui/material/modern/styles/adaptV4Theme.js
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
import { createBreakpoints, createSpacing } from '@mui/system';
|
||||
export default function adaptV4Theme(inputTheme) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.warn(['MUI: adaptV4Theme() is deprecated.', 'Follow the upgrade guide on https://mui.com/r/migration-v4#theme.'].join('\n'));
|
||||
}
|
||||
const {
|
||||
defaultProps = {},
|
||||
mixins = {},
|
||||
overrides = {},
|
||||
palette = {},
|
||||
props = {},
|
||||
styleOverrides = {},
|
||||
...other
|
||||
} = inputTheme;
|
||||
const theme = {
|
||||
...other,
|
||||
components: {}
|
||||
};
|
||||
|
||||
// default props
|
||||
Object.keys(defaultProps).forEach(component => {
|
||||
const componentValue = theme.components[component] || {};
|
||||
componentValue.defaultProps = defaultProps[component];
|
||||
theme.components[component] = componentValue;
|
||||
});
|
||||
Object.keys(props).forEach(component => {
|
||||
const componentValue = theme.components[component] || {};
|
||||
componentValue.defaultProps = props[component];
|
||||
theme.components[component] = componentValue;
|
||||
});
|
||||
|
||||
// CSS overrides
|
||||
Object.keys(styleOverrides).forEach(component => {
|
||||
const componentValue = theme.components[component] || {};
|
||||
componentValue.styleOverrides = styleOverrides[component];
|
||||
theme.components[component] = componentValue;
|
||||
});
|
||||
Object.keys(overrides).forEach(component => {
|
||||
const componentValue = theme.components[component] || {};
|
||||
componentValue.styleOverrides = overrides[component];
|
||||
theme.components[component] = componentValue;
|
||||
});
|
||||
|
||||
// theme.spacing
|
||||
theme.spacing = createSpacing(inputTheme.spacing);
|
||||
|
||||
// theme.mixins.gutters
|
||||
const breakpoints = createBreakpoints(inputTheme.breakpoints || {});
|
||||
const spacing = theme.spacing;
|
||||
theme.mixins = {
|
||||
gutters: (styles = {}) => {
|
||||
return {
|
||||
paddingLeft: spacing(2),
|
||||
paddingRight: spacing(2),
|
||||
...styles,
|
||||
[breakpoints.up('sm')]: {
|
||||
paddingLeft: spacing(3),
|
||||
paddingRight: spacing(3),
|
||||
...styles[breakpoints.up('sm')]
|
||||
}
|
||||
};
|
||||
},
|
||||
...mixins
|
||||
};
|
||||
const {
|
||||
type: typeInput,
|
||||
mode: modeInput,
|
||||
...paletteRest
|
||||
} = palette;
|
||||
const finalMode = modeInput || typeInput || 'light';
|
||||
theme.palette = {
|
||||
// theme.palette.text.hint
|
||||
text: {
|
||||
hint: finalMode === 'dark' ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.38)'
|
||||
},
|
||||
mode: finalMode,
|
||||
type: finalMode,
|
||||
...paletteRest
|
||||
};
|
||||
return theme;
|
||||
}
|
||||
41
node_modules/@mui/material/modern/styles/createColorScheme.js
generated
vendored
Normal file
41
node_modules/@mui/material/modern/styles/createColorScheme.js
generated
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
import createPalette from "./createPalette.js";
|
||||
import getOverlayAlpha from "./getOverlayAlpha.js";
|
||||
const defaultDarkOverlays = [...Array(25)].map((_, index) => {
|
||||
if (index === 0) {
|
||||
return undefined;
|
||||
}
|
||||
const overlay = getOverlayAlpha(index);
|
||||
return `linear-gradient(rgba(255 255 255 / ${overlay}), rgba(255 255 255 / ${overlay}))`;
|
||||
});
|
||||
export function getOpacity(mode) {
|
||||
return {
|
||||
inputPlaceholder: mode === 'dark' ? 0.5 : 0.42,
|
||||
inputUnderline: mode === 'dark' ? 0.7 : 0.42,
|
||||
switchTrackDisabled: mode === 'dark' ? 0.2 : 0.12,
|
||||
switchTrack: mode === 'dark' ? 0.3 : 0.38
|
||||
};
|
||||
}
|
||||
export function getOverlays(mode) {
|
||||
return mode === 'dark' ? defaultDarkOverlays : [];
|
||||
}
|
||||
export default function createColorScheme(options) {
|
||||
const {
|
||||
palette: paletteInput = {
|
||||
mode: 'light'
|
||||
},
|
||||
// need to cast to avoid module augmentation test
|
||||
opacity,
|
||||
overlays,
|
||||
...rest
|
||||
} = options;
|
||||
const palette = createPalette(paletteInput);
|
||||
return {
|
||||
palette,
|
||||
opacity: {
|
||||
...getOpacity(palette.mode),
|
||||
...opacity
|
||||
},
|
||||
overlays: overlays || getOverlays(palette.mode),
|
||||
...rest
|
||||
};
|
||||
}
|
||||
59
node_modules/@mui/material/modern/styles/createGetSelector.js
generated
vendored
Normal file
59
node_modules/@mui/material/modern/styles/createGetSelector.js
generated
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
import excludeVariablesFromRoot from "./excludeVariablesFromRoot.js";
|
||||
export default theme => (colorScheme, css) => {
|
||||
const selector = theme.colorSchemeSelector;
|
||||
let rule = selector;
|
||||
if (selector === 'class') {
|
||||
rule = '.%s';
|
||||
}
|
||||
if (selector === 'data') {
|
||||
rule = '[data-%s]';
|
||||
}
|
||||
if (selector?.startsWith('data-') && !selector.includes('%s')) {
|
||||
// 'data-mui-color-scheme' -> '[data-mui-color-scheme="%s"]'
|
||||
rule = `[${selector}="%s"]`;
|
||||
}
|
||||
if (theme.defaultColorScheme === colorScheme) {
|
||||
if (colorScheme === 'dark') {
|
||||
const excludedVariables = {};
|
||||
excludeVariablesFromRoot(theme.cssVarPrefix).forEach(cssVar => {
|
||||
excludedVariables[cssVar] = css[cssVar];
|
||||
delete css[cssVar];
|
||||
});
|
||||
if (rule === 'media') {
|
||||
return {
|
||||
':root': css,
|
||||
[`@media (prefers-color-scheme: dark)`]: {
|
||||
':root': excludedVariables
|
||||
}
|
||||
};
|
||||
}
|
||||
if (rule) {
|
||||
return {
|
||||
[rule.replace('%s', colorScheme)]: excludedVariables,
|
||||
[`:root, ${rule.replace('%s', colorScheme)}`]: css
|
||||
};
|
||||
}
|
||||
return {
|
||||
':root': {
|
||||
...css,
|
||||
...excludedVariables
|
||||
}
|
||||
};
|
||||
}
|
||||
if (rule && rule !== 'media') {
|
||||
return `:root, ${rule.replace('%s', String(colorScheme))}`;
|
||||
}
|
||||
} else if (colorScheme) {
|
||||
if (rule === 'media') {
|
||||
return {
|
||||
[`@media (prefers-color-scheme: ${String(colorScheme)})`]: {
|
||||
':root': css
|
||||
}
|
||||
};
|
||||
}
|
||||
if (rule) {
|
||||
return rule.replace('%s', String(colorScheme));
|
||||
}
|
||||
}
|
||||
return ':root';
|
||||
};
|
||||
16
node_modules/@mui/material/modern/styles/createMixins.js
generated
vendored
Normal file
16
node_modules/@mui/material/modern/styles/createMixins.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
export default function createMixins(breakpoints, mixins) {
|
||||
return {
|
||||
toolbar: {
|
||||
minHeight: 56,
|
||||
[breakpoints.up('xs')]: {
|
||||
'@media (orientation: landscape)': {
|
||||
minHeight: 48
|
||||
}
|
||||
},
|
||||
[breakpoints.up('sm')]: {
|
||||
minHeight: 64
|
||||
}
|
||||
},
|
||||
...mixins
|
||||
};
|
||||
}
|
||||
7
node_modules/@mui/material/modern/styles/createMuiStrictModeTheme.js
generated
vendored
Normal file
7
node_modules/@mui/material/modern/styles/createMuiStrictModeTheme.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import deepmerge from '@mui/utils/deepmerge';
|
||||
import createTheme from "./createTheme.js";
|
||||
export default function createMuiStrictModeTheme(options, ...args) {
|
||||
return createTheme(deepmerge({
|
||||
unstable_strictMode: true
|
||||
}, options), ...args);
|
||||
}
|
||||
308
node_modules/@mui/material/modern/styles/createPalette.js
generated
vendored
Normal file
308
node_modules/@mui/material/modern/styles/createPalette.js
generated
vendored
Normal file
@@ -0,0 +1,308 @@
|
||||
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
||||
import deepmerge from '@mui/utils/deepmerge';
|
||||
import { darken, getContrastRatio, lighten } from '@mui/system/colorManipulator';
|
||||
import common from "../colors/common.js";
|
||||
import grey from "../colors/grey.js";
|
||||
import purple from "../colors/purple.js";
|
||||
import red from "../colors/red.js";
|
||||
import orange from "../colors/orange.js";
|
||||
import blue from "../colors/blue.js";
|
||||
import lightBlue from "../colors/lightBlue.js";
|
||||
import green from "../colors/green.js";
|
||||
export const light = {
|
||||
// The colors used to style the text.
|
||||
text: {
|
||||
// The most important text.
|
||||
primary: 'rgba(0, 0, 0, 0.87)',
|
||||
// Secondary text.
|
||||
secondary: 'rgba(0, 0, 0, 0.6)',
|
||||
// Disabled text have even lower visual prominence.
|
||||
disabled: 'rgba(0, 0, 0, 0.38)'
|
||||
},
|
||||
// The color used to divide different elements.
|
||||
divider: 'rgba(0, 0, 0, 0.12)',
|
||||
// The background colors used to style the surfaces.
|
||||
// Consistency between these values is important.
|
||||
background: {
|
||||
paper: common.white,
|
||||
default: common.white
|
||||
},
|
||||
// The colors used to style the action elements.
|
||||
action: {
|
||||
// The color of an active action like an icon button.
|
||||
active: 'rgba(0, 0, 0, 0.54)',
|
||||
// The color of an hovered action.
|
||||
hover: 'rgba(0, 0, 0, 0.04)',
|
||||
hoverOpacity: 0.04,
|
||||
// The color of a selected action.
|
||||
selected: 'rgba(0, 0, 0, 0.08)',
|
||||
selectedOpacity: 0.08,
|
||||
// The color of a disabled action.
|
||||
disabled: 'rgba(0, 0, 0, 0.26)',
|
||||
// The background color of a disabled action.
|
||||
disabledBackground: 'rgba(0, 0, 0, 0.12)',
|
||||
disabledOpacity: 0.38,
|
||||
focus: 'rgba(0, 0, 0, 0.12)',
|
||||
focusOpacity: 0.12,
|
||||
activatedOpacity: 0.12
|
||||
}
|
||||
};
|
||||
export const dark = {
|
||||
text: {
|
||||
primary: common.white,
|
||||
secondary: 'rgba(255, 255, 255, 0.7)',
|
||||
disabled: 'rgba(255, 255, 255, 0.5)',
|
||||
icon: 'rgba(255, 255, 255, 0.5)'
|
||||
},
|
||||
divider: 'rgba(255, 255, 255, 0.12)',
|
||||
background: {
|
||||
paper: '#121212',
|
||||
default: '#121212'
|
||||
},
|
||||
action: {
|
||||
active: common.white,
|
||||
hover: 'rgba(255, 255, 255, 0.08)',
|
||||
hoverOpacity: 0.08,
|
||||
selected: 'rgba(255, 255, 255, 0.16)',
|
||||
selectedOpacity: 0.16,
|
||||
disabled: 'rgba(255, 255, 255, 0.3)',
|
||||
disabledBackground: 'rgba(255, 255, 255, 0.12)',
|
||||
disabledOpacity: 0.38,
|
||||
focus: 'rgba(255, 255, 255, 0.12)',
|
||||
focusOpacity: 0.12,
|
||||
activatedOpacity: 0.24
|
||||
}
|
||||
};
|
||||
function addLightOrDark(intent, direction, shade, tonalOffset) {
|
||||
const tonalOffsetLight = tonalOffset.light || tonalOffset;
|
||||
const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;
|
||||
if (!intent[direction]) {
|
||||
if (intent.hasOwnProperty(shade)) {
|
||||
intent[direction] = intent[shade];
|
||||
} else if (direction === 'light') {
|
||||
intent.light = lighten(intent.main, tonalOffsetLight);
|
||||
} else if (direction === 'dark') {
|
||||
intent.dark = darken(intent.main, tonalOffsetDark);
|
||||
}
|
||||
}
|
||||
}
|
||||
function getDefaultPrimary(mode = 'light') {
|
||||
if (mode === 'dark') {
|
||||
return {
|
||||
main: blue[200],
|
||||
light: blue[50],
|
||||
dark: blue[400]
|
||||
};
|
||||
}
|
||||
return {
|
||||
main: blue[700],
|
||||
light: blue[400],
|
||||
dark: blue[800]
|
||||
};
|
||||
}
|
||||
function getDefaultSecondary(mode = 'light') {
|
||||
if (mode === 'dark') {
|
||||
return {
|
||||
main: purple[200],
|
||||
light: purple[50],
|
||||
dark: purple[400]
|
||||
};
|
||||
}
|
||||
return {
|
||||
main: purple[500],
|
||||
light: purple[300],
|
||||
dark: purple[700]
|
||||
};
|
||||
}
|
||||
function getDefaultError(mode = 'light') {
|
||||
if (mode === 'dark') {
|
||||
return {
|
||||
main: red[500],
|
||||
light: red[300],
|
||||
dark: red[700]
|
||||
};
|
||||
}
|
||||
return {
|
||||
main: red[700],
|
||||
light: red[400],
|
||||
dark: red[800]
|
||||
};
|
||||
}
|
||||
function getDefaultInfo(mode = 'light') {
|
||||
if (mode === 'dark') {
|
||||
return {
|
||||
main: lightBlue[400],
|
||||
light: lightBlue[300],
|
||||
dark: lightBlue[700]
|
||||
};
|
||||
}
|
||||
return {
|
||||
main: lightBlue[700],
|
||||
light: lightBlue[500],
|
||||
dark: lightBlue[900]
|
||||
};
|
||||
}
|
||||
function getDefaultSuccess(mode = 'light') {
|
||||
if (mode === 'dark') {
|
||||
return {
|
||||
main: green[400],
|
||||
light: green[300],
|
||||
dark: green[700]
|
||||
};
|
||||
}
|
||||
return {
|
||||
main: green[800],
|
||||
light: green[500],
|
||||
dark: green[900]
|
||||
};
|
||||
}
|
||||
function getDefaultWarning(mode = 'light') {
|
||||
if (mode === 'dark') {
|
||||
return {
|
||||
main: orange[400],
|
||||
light: orange[300],
|
||||
dark: orange[700]
|
||||
};
|
||||
}
|
||||
return {
|
||||
main: '#ed6c02',
|
||||
// closest to orange[800] that pass 3:1.
|
||||
light: orange[500],
|
||||
dark: orange[900]
|
||||
};
|
||||
}
|
||||
export default function createPalette(palette) {
|
||||
const {
|
||||
mode = 'light',
|
||||
contrastThreshold = 3,
|
||||
tonalOffset = 0.2,
|
||||
...other
|
||||
} = palette;
|
||||
const primary = palette.primary || getDefaultPrimary(mode);
|
||||
const secondary = palette.secondary || getDefaultSecondary(mode);
|
||||
const error = palette.error || getDefaultError(mode);
|
||||
const info = palette.info || getDefaultInfo(mode);
|
||||
const success = palette.success || getDefaultSuccess(mode);
|
||||
const warning = palette.warning || getDefaultWarning(mode);
|
||||
|
||||
// Use the same logic as
|
||||
// Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59
|
||||
// and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54
|
||||
function getContrastText(background) {
|
||||
const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const contrast = getContrastRatio(background, contrastText);
|
||||
if (contrast < 3) {
|
||||
console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\n'));
|
||||
}
|
||||
}
|
||||
return contrastText;
|
||||
}
|
||||
const augmentColor = ({
|
||||
color,
|
||||
name,
|
||||
mainShade = 500,
|
||||
lightShade = 300,
|
||||
darkShade = 700
|
||||
}) => {
|
||||
color = {
|
||||
...color
|
||||
};
|
||||
if (!color.main && color[mainShade]) {
|
||||
color.main = color[mainShade];
|
||||
}
|
||||
if (!color.hasOwnProperty('main')) {
|
||||
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
|
||||
The color object needs to have a \`main\` property or a \`${mainShade}\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));
|
||||
}
|
||||
if (typeof color.main !== 'string') {
|
||||
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.
|
||||
\`color.main\` should be a string, but \`${JSON.stringify(color.main)}\` was provided instead.
|
||||
|
||||
Did you intend to use one of the following approaches?
|
||||
|
||||
import { green } from "@mui/material/colors";
|
||||
|
||||
const theme1 = createTheme({ palette: {
|
||||
primary: green,
|
||||
} });
|
||||
|
||||
const theme2 = createTheme({ palette: {
|
||||
primary: { main: green[500] },
|
||||
} });` : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));
|
||||
}
|
||||
addLightOrDark(color, 'light', lightShade, tonalOffset);
|
||||
addLightOrDark(color, 'dark', darkShade, tonalOffset);
|
||||
if (!color.contrastText) {
|
||||
color.contrastText = getContrastText(color.main);
|
||||
}
|
||||
return color;
|
||||
};
|
||||
const modes = {
|
||||
dark,
|
||||
light
|
||||
};
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (!modes[mode]) {
|
||||
console.error(`MUI: The palette mode \`${mode}\` is not supported.`);
|
||||
}
|
||||
}
|
||||
const paletteOutput = deepmerge({
|
||||
// A collection of common colors.
|
||||
common: {
|
||||
...common
|
||||
},
|
||||
// prevent mutable object.
|
||||
// The palette mode, can be light or dark.
|
||||
mode,
|
||||
// The colors used to represent primary interface elements for a user.
|
||||
primary: augmentColor({
|
||||
color: primary,
|
||||
name: 'primary'
|
||||
}),
|
||||
// The colors used to represent secondary interface elements for a user.
|
||||
secondary: augmentColor({
|
||||
color: secondary,
|
||||
name: 'secondary',
|
||||
mainShade: 'A400',
|
||||
lightShade: 'A200',
|
||||
darkShade: 'A700'
|
||||
}),
|
||||
// The colors used to represent interface elements that the user should be made aware of.
|
||||
error: augmentColor({
|
||||
color: error,
|
||||
name: 'error'
|
||||
}),
|
||||
// The colors used to represent potentially dangerous actions or important messages.
|
||||
warning: augmentColor({
|
||||
color: warning,
|
||||
name: 'warning'
|
||||
}),
|
||||
// The colors used to present information to the user that is neutral and not necessarily important.
|
||||
info: augmentColor({
|
||||
color: info,
|
||||
name: 'info'
|
||||
}),
|
||||
// The colors used to indicate the successful completion of an action that user triggered.
|
||||
success: augmentColor({
|
||||
color: success,
|
||||
name: 'success'
|
||||
}),
|
||||
// The grey colors.
|
||||
grey,
|
||||
// Used by `getContrastText()` to maximize the contrast between
|
||||
// the background and the text.
|
||||
contrastThreshold,
|
||||
// Takes a background color and returns the text color that maximizes the contrast.
|
||||
getContrastText,
|
||||
// Generate a rich color object.
|
||||
augmentColor,
|
||||
// Used by the functions below to shift a color's luminance by approximately
|
||||
// two indexes within its tonal palette.
|
||||
// E.g., shift from Red 500 to Red 300 or Red 700.
|
||||
tonalOffset,
|
||||
// The light and dark mode object.
|
||||
...modes[mode]
|
||||
}, other);
|
||||
return paletteOutput;
|
||||
}
|
||||
10
node_modules/@mui/material/modern/styles/createStyles.js
generated
vendored
Normal file
10
node_modules/@mui/material/modern/styles/createStyles.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
let warnedOnce = false;
|
||||
|
||||
// To remove in v6
|
||||
export default function createStyles(styles) {
|
||||
if (!warnedOnce) {
|
||||
console.warn(['MUI: createStyles from @mui/material/styles is deprecated.', 'Please use @mui/styles/createStyles'].join('\n'));
|
||||
warnedOnce = true;
|
||||
}
|
||||
return styles;
|
||||
}
|
||||
99
node_modules/@mui/material/modern/styles/createTheme.js
generated
vendored
Normal file
99
node_modules/@mui/material/modern/styles/createTheme.js
generated
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
import createPalette from "./createPalette.js";
|
||||
import createThemeWithVars from "./createThemeWithVars.js";
|
||||
import createThemeNoVars from "./createThemeNoVars.js";
|
||||
export { createMuiTheme } from "./createThemeNoVars.js";
|
||||
// eslint-disable-next-line consistent-return
|
||||
function attachColorScheme(theme, scheme, colorScheme) {
|
||||
if (!theme.colorSchemes) {
|
||||
return undefined;
|
||||
}
|
||||
if (colorScheme) {
|
||||
theme.colorSchemes[scheme] = {
|
||||
...(colorScheme !== true && colorScheme),
|
||||
palette: createPalette({
|
||||
...(colorScheme === true ? {} : colorScheme.palette),
|
||||
mode: scheme
|
||||
}) // cast type to skip module augmentation test
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a theme base on the options received.
|
||||
* @param options Takes an incomplete theme object and adds the missing parts.
|
||||
* @param args Deep merge the arguments with the about to be returned theme.
|
||||
* @returns A complete, ready-to-use theme object.
|
||||
*/
|
||||
export default function createTheme(options = {},
|
||||
// cast type to skip module augmentation test
|
||||
...args) {
|
||||
const {
|
||||
palette,
|
||||
cssVariables = false,
|
||||
colorSchemes: initialColorSchemes = !palette ? {
|
||||
light: true
|
||||
} : undefined,
|
||||
defaultColorScheme: initialDefaultColorScheme = palette?.mode,
|
||||
...rest
|
||||
} = options;
|
||||
const defaultColorSchemeInput = initialDefaultColorScheme || 'light';
|
||||
const defaultScheme = initialColorSchemes?.[defaultColorSchemeInput];
|
||||
const colorSchemesInput = {
|
||||
...initialColorSchemes,
|
||||
...(palette ? {
|
||||
[defaultColorSchemeInput]: {
|
||||
...(typeof defaultScheme !== 'boolean' && defaultScheme),
|
||||
palette
|
||||
}
|
||||
} : undefined)
|
||||
};
|
||||
if (cssVariables === false) {
|
||||
if (!('colorSchemes' in options)) {
|
||||
// Behaves exactly as v5
|
||||
return createThemeNoVars(options, ...args);
|
||||
}
|
||||
let paletteOptions = palette;
|
||||
if (!('palette' in options)) {
|
||||
if (colorSchemesInput[defaultColorSchemeInput]) {
|
||||
if (colorSchemesInput[defaultColorSchemeInput] !== true) {
|
||||
paletteOptions = colorSchemesInput[defaultColorSchemeInput].palette;
|
||||
} else if (defaultColorSchemeInput === 'dark') {
|
||||
// @ts-ignore to prevent the module augmentation test from failing
|
||||
paletteOptions = {
|
||||
mode: 'dark'
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
const theme = createThemeNoVars({
|
||||
...options,
|
||||
palette: paletteOptions
|
||||
}, ...args);
|
||||
theme.defaultColorScheme = defaultColorSchemeInput;
|
||||
theme.colorSchemes = colorSchemesInput;
|
||||
if (theme.palette.mode === 'light') {
|
||||
theme.colorSchemes.light = {
|
||||
...(colorSchemesInput.light !== true && colorSchemesInput.light),
|
||||
palette: theme.palette
|
||||
};
|
||||
attachColorScheme(theme, 'dark', colorSchemesInput.dark);
|
||||
}
|
||||
if (theme.palette.mode === 'dark') {
|
||||
theme.colorSchemes.dark = {
|
||||
...(colorSchemesInput.dark !== true && colorSchemesInput.dark),
|
||||
palette: theme.palette
|
||||
};
|
||||
attachColorScheme(theme, 'light', colorSchemesInput.light);
|
||||
}
|
||||
return theme;
|
||||
}
|
||||
if (!palette && !('light' in colorSchemesInput) && defaultColorSchemeInput === 'light') {
|
||||
colorSchemesInput.light = true;
|
||||
}
|
||||
return createThemeWithVars({
|
||||
...rest,
|
||||
colorSchemes: colorSchemesInput,
|
||||
defaultColorScheme: defaultColorSchemeInput,
|
||||
...(typeof cssVariables !== 'boolean' && cssVariables)
|
||||
}, ...args);
|
||||
}
|
||||
94
node_modules/@mui/material/modern/styles/createThemeNoVars.js
generated
vendored
Normal file
94
node_modules/@mui/material/modern/styles/createThemeNoVars.js
generated
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
||||
import deepmerge from '@mui/utils/deepmerge';
|
||||
import styleFunctionSx, { unstable_defaultSxConfig as defaultSxConfig } from '@mui/system/styleFunctionSx';
|
||||
import systemCreateTheme from '@mui/system/createTheme';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
import createMixins from "./createMixins.js";
|
||||
import createPalette from "./createPalette.js";
|
||||
import createTypography from "./createTypography.js";
|
||||
import shadows from "./shadows.js";
|
||||
import createTransitions from "./createTransitions.js";
|
||||
import zIndex from "./zIndex.js";
|
||||
function createThemeNoVars(options = {}, ...args) {
|
||||
const {
|
||||
breakpoints: breakpointsInput,
|
||||
mixins: mixinsInput = {},
|
||||
spacing: spacingInput,
|
||||
palette: paletteInput = {},
|
||||
transitions: transitionsInput = {},
|
||||
typography: typographyInput = {},
|
||||
shape: shapeInput,
|
||||
...other
|
||||
} = options;
|
||||
if (options.vars) {
|
||||
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`vars\` is a private field used for CSS variables support.
|
||||
Please use another name.` : _formatMuiErrorMessage(20));
|
||||
}
|
||||
const palette = createPalette(paletteInput);
|
||||
const systemTheme = systemCreateTheme(options);
|
||||
let muiTheme = deepmerge(systemTheme, {
|
||||
mixins: createMixins(systemTheme.breakpoints, mixinsInput),
|
||||
palette,
|
||||
// Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.
|
||||
shadows: shadows.slice(),
|
||||
typography: createTypography(palette, typographyInput),
|
||||
transitions: createTransitions(transitionsInput),
|
||||
zIndex: {
|
||||
...zIndex
|
||||
}
|
||||
});
|
||||
muiTheme = deepmerge(muiTheme, other);
|
||||
muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component.
|
||||
const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];
|
||||
const traverse = (node, component) => {
|
||||
let key;
|
||||
|
||||
// eslint-disable-next-line guard-for-in
|
||||
for (key in node) {
|
||||
const child = node[key];
|
||||
if (stateClasses.includes(key) && Object.keys(child).length > 0) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const stateClass = generateUtilityClass('', key);
|
||||
console.error([`MUI: The \`${component}\` component increases ` + `the CSS specificity of the \`${key}\` internal state.`, 'You can not override it like this: ', JSON.stringify(node, null, 2), '', `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({
|
||||
root: {
|
||||
[`&.${stateClass}`]: child
|
||||
}
|
||||
}, null, 2), '', 'https://mui.com/r/state-classes-guide'].join('\n'));
|
||||
}
|
||||
// Remove the style to prevent global conflicts.
|
||||
node[key] = {};
|
||||
}
|
||||
}
|
||||
};
|
||||
Object.keys(muiTheme.components).forEach(component => {
|
||||
const styleOverrides = muiTheme.components[component].styleOverrides;
|
||||
if (styleOverrides && component.startsWith('Mui')) {
|
||||
traverse(styleOverrides, component);
|
||||
}
|
||||
});
|
||||
}
|
||||
muiTheme.unstable_sxConfig = {
|
||||
...defaultSxConfig,
|
||||
...other?.unstable_sxConfig
|
||||
};
|
||||
muiTheme.unstable_sx = function sx(props) {
|
||||
return styleFunctionSx({
|
||||
sx: props,
|
||||
theme: this
|
||||
});
|
||||
};
|
||||
return muiTheme;
|
||||
}
|
||||
let warnedOnce = false;
|
||||
export function createMuiTheme(...args) {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (!warnedOnce) {
|
||||
warnedOnce = true;
|
||||
console.error(['MUI: the createMuiTheme function was renamed to createTheme.', '', "You should use `import { createTheme } from '@mui/material/styles'`"].join('\n'));
|
||||
}
|
||||
}
|
||||
return createThemeNoVars(...args);
|
||||
}
|
||||
export default createThemeNoVars;
|
||||
384
node_modules/@mui/material/modern/styles/createThemeWithVars.js
generated
vendored
Normal file
384
node_modules/@mui/material/modern/styles/createThemeWithVars.js
generated
vendored
Normal file
@@ -0,0 +1,384 @@
|
||||
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
||||
import deepmerge from '@mui/utils/deepmerge';
|
||||
import { unstable_createGetCssVar as systemCreateGetCssVar, createSpacing } from '@mui/system';
|
||||
import { createUnarySpacing } from '@mui/system/spacing';
|
||||
import { prepareCssVars, prepareTypographyVars, createGetColorSchemeSelector } from '@mui/system/cssVars';
|
||||
import styleFunctionSx, { unstable_defaultSxConfig as defaultSxConfig } from '@mui/system/styleFunctionSx';
|
||||
import { private_safeColorChannel as safeColorChannel, private_safeAlpha as safeAlpha, private_safeDarken as safeDarken, private_safeLighten as safeLighten, private_safeEmphasize as safeEmphasize, hslToRgb } from '@mui/system/colorManipulator';
|
||||
import createThemeNoVars from "./createThemeNoVars.js";
|
||||
import createColorScheme, { getOpacity, getOverlays } from "./createColorScheme.js";
|
||||
import defaultShouldSkipGeneratingVar from "./shouldSkipGeneratingVar.js";
|
||||
import defaultGetSelector from "./createGetSelector.js";
|
||||
import { stringifyTheme } from "./stringifyTheme.js";
|
||||
function assignNode(obj, keys) {
|
||||
keys.forEach(k => {
|
||||
if (!obj[k]) {
|
||||
obj[k] = {};
|
||||
}
|
||||
});
|
||||
}
|
||||
function setColor(obj, key, defaultValue) {
|
||||
if (!obj[key] && defaultValue) {
|
||||
obj[key] = defaultValue;
|
||||
}
|
||||
}
|
||||
function toRgb(color) {
|
||||
if (!color || !color.startsWith('hsl')) {
|
||||
return color;
|
||||
}
|
||||
return hslToRgb(color);
|
||||
}
|
||||
function setColorChannel(obj, key) {
|
||||
if (!(`${key}Channel` in obj)) {
|
||||
// custom channel token is not provided, generate one.
|
||||
// if channel token can't be generated, show a warning.
|
||||
obj[`${key}Channel`] = safeColorChannel(toRgb(obj[key]), `MUI: Can't create \`palette.${key}Channel\` because \`palette.${key}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` + '\n' + `To suppress this warning, you need to explicitly provide the \`palette.${key}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`);
|
||||
}
|
||||
}
|
||||
function getSpacingVal(spacingInput) {
|
||||
if (typeof spacingInput === 'number') {
|
||||
return `${spacingInput}px`;
|
||||
}
|
||||
if (typeof spacingInput === 'string' || typeof spacingInput === 'function' || Array.isArray(spacingInput)) {
|
||||
return spacingInput;
|
||||
}
|
||||
return '8px';
|
||||
}
|
||||
const silent = fn => {
|
||||
try {
|
||||
return fn();
|
||||
} catch (error) {
|
||||
// ignore error
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
export const createGetCssVar = (cssVarPrefix = 'mui') => systemCreateGetCssVar(cssVarPrefix);
|
||||
function attachColorScheme(colorSchemes, scheme, restTheme, colorScheme) {
|
||||
if (!scheme) {
|
||||
return undefined;
|
||||
}
|
||||
scheme = scheme === true ? {} : scheme;
|
||||
const mode = colorScheme === 'dark' ? 'dark' : 'light';
|
||||
if (!restTheme) {
|
||||
colorSchemes[colorScheme] = createColorScheme({
|
||||
...scheme,
|
||||
palette: {
|
||||
mode,
|
||||
...scheme?.palette
|
||||
}
|
||||
});
|
||||
return undefined;
|
||||
}
|
||||
const {
|
||||
palette,
|
||||
...muiTheme
|
||||
} = createThemeNoVars({
|
||||
...restTheme,
|
||||
palette: {
|
||||
mode,
|
||||
...scheme?.palette
|
||||
}
|
||||
});
|
||||
colorSchemes[colorScheme] = {
|
||||
...scheme,
|
||||
palette,
|
||||
opacity: {
|
||||
...getOpacity(mode),
|
||||
...scheme?.opacity
|
||||
},
|
||||
overlays: scheme?.overlays || getOverlays(mode)
|
||||
};
|
||||
return muiTheme;
|
||||
}
|
||||
|
||||
/**
|
||||
* A default `createThemeWithVars` comes with a single color scheme, either `light` or `dark` based on the `defaultColorScheme`.
|
||||
* This is better suited for apps that only need a single color scheme.
|
||||
*
|
||||
* To enable built-in `light` and `dark` color schemes, either:
|
||||
* 1. provide a `colorSchemeSelector` to define how the color schemes will change.
|
||||
* 2. provide `colorSchemes.dark` will set `colorSchemeSelector: 'media'` by default.
|
||||
*/
|
||||
export default function createThemeWithVars(options = {}, ...args) {
|
||||
const {
|
||||
colorSchemes: colorSchemesInput = {
|
||||
light: true
|
||||
},
|
||||
defaultColorScheme: defaultColorSchemeInput,
|
||||
disableCssColorScheme = false,
|
||||
cssVarPrefix = 'mui',
|
||||
shouldSkipGeneratingVar = defaultShouldSkipGeneratingVar,
|
||||
colorSchemeSelector: selector = colorSchemesInput.light && colorSchemesInput.dark ? 'media' : undefined,
|
||||
...input
|
||||
} = options;
|
||||
const firstColorScheme = Object.keys(colorSchemesInput)[0];
|
||||
const defaultColorScheme = defaultColorSchemeInput || (colorSchemesInput.light && firstColorScheme !== 'light' ? 'light' : firstColorScheme);
|
||||
const getCssVar = createGetCssVar(cssVarPrefix);
|
||||
const {
|
||||
[defaultColorScheme]: defaultSchemeInput,
|
||||
light: builtInLight,
|
||||
dark: builtInDark,
|
||||
...customColorSchemes
|
||||
} = colorSchemesInput;
|
||||
const colorSchemes = {
|
||||
...customColorSchemes
|
||||
};
|
||||
let defaultScheme = defaultSchemeInput;
|
||||
|
||||
// For built-in light and dark color schemes, ensure that the value is valid if they are the default color scheme.
|
||||
if (defaultColorScheme === 'dark' && !('dark' in colorSchemesInput) || defaultColorScheme === 'light' && !('light' in colorSchemesInput)) {
|
||||
defaultScheme = true;
|
||||
}
|
||||
if (!defaultScheme) {
|
||||
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The \`colorSchemes.${defaultColorScheme}\` option is either missing or invalid.` : _formatMuiErrorMessage(21, defaultColorScheme));
|
||||
}
|
||||
|
||||
// Create the palette for the default color scheme, either `light`, `dark`, or custom color scheme.
|
||||
const muiTheme = attachColorScheme(colorSchemes, defaultScheme, input, defaultColorScheme);
|
||||
if (builtInLight && !colorSchemes.light) {
|
||||
attachColorScheme(colorSchemes, builtInLight, undefined, 'light');
|
||||
}
|
||||
if (builtInDark && !colorSchemes.dark) {
|
||||
attachColorScheme(colorSchemes, builtInDark, undefined, 'dark');
|
||||
}
|
||||
let theme = {
|
||||
defaultColorScheme,
|
||||
...muiTheme,
|
||||
cssVarPrefix,
|
||||
colorSchemeSelector: selector,
|
||||
getCssVar,
|
||||
colorSchemes,
|
||||
font: {
|
||||
...prepareTypographyVars(muiTheme.typography),
|
||||
...muiTheme.font
|
||||
},
|
||||
spacing: getSpacingVal(input.spacing)
|
||||
};
|
||||
Object.keys(theme.colorSchemes).forEach(key => {
|
||||
const palette = theme.colorSchemes[key].palette;
|
||||
const setCssVarColor = cssVar => {
|
||||
const tokens = cssVar.split('-');
|
||||
const color = tokens[1];
|
||||
const colorToken = tokens[2];
|
||||
return getCssVar(cssVar, palette[color][colorToken]);
|
||||
};
|
||||
|
||||
// attach black & white channels to common node
|
||||
if (palette.mode === 'light') {
|
||||
setColor(palette.common, 'background', '#fff');
|
||||
setColor(palette.common, 'onBackground', '#000');
|
||||
}
|
||||
if (palette.mode === 'dark') {
|
||||
setColor(palette.common, 'background', '#000');
|
||||
setColor(palette.common, 'onBackground', '#fff');
|
||||
}
|
||||
|
||||
// assign component variables
|
||||
assignNode(palette, ['Alert', 'AppBar', 'Avatar', 'Button', 'Chip', 'FilledInput', 'LinearProgress', 'Skeleton', 'Slider', 'SnackbarContent', 'SpeedDialAction', 'StepConnector', 'StepContent', 'Switch', 'TableCell', 'Tooltip']);
|
||||
if (palette.mode === 'light') {
|
||||
setColor(palette.Alert, 'errorColor', safeDarken(palette.error.light, 0.6));
|
||||
setColor(palette.Alert, 'infoColor', safeDarken(palette.info.light, 0.6));
|
||||
setColor(palette.Alert, 'successColor', safeDarken(palette.success.light, 0.6));
|
||||
setColor(palette.Alert, 'warningColor', safeDarken(palette.warning.light, 0.6));
|
||||
setColor(palette.Alert, 'errorFilledBg', setCssVarColor('palette-error-main'));
|
||||
setColor(palette.Alert, 'infoFilledBg', setCssVarColor('palette-info-main'));
|
||||
setColor(palette.Alert, 'successFilledBg', setCssVarColor('palette-success-main'));
|
||||
setColor(palette.Alert, 'warningFilledBg', setCssVarColor('palette-warning-main'));
|
||||
setColor(palette.Alert, 'errorFilledColor', silent(() => palette.getContrastText(palette.error.main)));
|
||||
setColor(palette.Alert, 'infoFilledColor', silent(() => palette.getContrastText(palette.info.main)));
|
||||
setColor(palette.Alert, 'successFilledColor', silent(() => palette.getContrastText(palette.success.main)));
|
||||
setColor(palette.Alert, 'warningFilledColor', silent(() => palette.getContrastText(palette.warning.main)));
|
||||
setColor(palette.Alert, 'errorStandardBg', safeLighten(palette.error.light, 0.9));
|
||||
setColor(palette.Alert, 'infoStandardBg', safeLighten(palette.info.light, 0.9));
|
||||
setColor(palette.Alert, 'successStandardBg', safeLighten(palette.success.light, 0.9));
|
||||
setColor(palette.Alert, 'warningStandardBg', safeLighten(palette.warning.light, 0.9));
|
||||
setColor(palette.Alert, 'errorIconColor', setCssVarColor('palette-error-main'));
|
||||
setColor(palette.Alert, 'infoIconColor', setCssVarColor('palette-info-main'));
|
||||
setColor(palette.Alert, 'successIconColor', setCssVarColor('palette-success-main'));
|
||||
setColor(palette.Alert, 'warningIconColor', setCssVarColor('palette-warning-main'));
|
||||
setColor(palette.AppBar, 'defaultBg', setCssVarColor('palette-grey-100'));
|
||||
setColor(palette.Avatar, 'defaultBg', setCssVarColor('palette-grey-400'));
|
||||
setColor(palette.Button, 'inheritContainedBg', setCssVarColor('palette-grey-300'));
|
||||
setColor(palette.Button, 'inheritContainedHoverBg', setCssVarColor('palette-grey-A100'));
|
||||
setColor(palette.Chip, 'defaultBorder', setCssVarColor('palette-grey-400'));
|
||||
setColor(palette.Chip, 'defaultAvatarColor', setCssVarColor('palette-grey-700'));
|
||||
setColor(palette.Chip, 'defaultIconColor', setCssVarColor('palette-grey-700'));
|
||||
setColor(palette.FilledInput, 'bg', 'rgba(0, 0, 0, 0.06)');
|
||||
setColor(palette.FilledInput, 'hoverBg', 'rgba(0, 0, 0, 0.09)');
|
||||
setColor(palette.FilledInput, 'disabledBg', 'rgba(0, 0, 0, 0.12)');
|
||||
setColor(palette.LinearProgress, 'primaryBg', safeLighten(palette.primary.main, 0.62));
|
||||
setColor(palette.LinearProgress, 'secondaryBg', safeLighten(palette.secondary.main, 0.62));
|
||||
setColor(palette.LinearProgress, 'errorBg', safeLighten(palette.error.main, 0.62));
|
||||
setColor(palette.LinearProgress, 'infoBg', safeLighten(palette.info.main, 0.62));
|
||||
setColor(palette.LinearProgress, 'successBg', safeLighten(palette.success.main, 0.62));
|
||||
setColor(palette.LinearProgress, 'warningBg', safeLighten(palette.warning.main, 0.62));
|
||||
setColor(palette.Skeleton, 'bg', `rgba(${setCssVarColor('palette-text-primaryChannel')} / 0.11)`);
|
||||
setColor(palette.Slider, 'primaryTrack', safeLighten(palette.primary.main, 0.62));
|
||||
setColor(palette.Slider, 'secondaryTrack', safeLighten(palette.secondary.main, 0.62));
|
||||
setColor(palette.Slider, 'errorTrack', safeLighten(palette.error.main, 0.62));
|
||||
setColor(palette.Slider, 'infoTrack', safeLighten(palette.info.main, 0.62));
|
||||
setColor(palette.Slider, 'successTrack', safeLighten(palette.success.main, 0.62));
|
||||
setColor(palette.Slider, 'warningTrack', safeLighten(palette.warning.main, 0.62));
|
||||
const snackbarContentBackground = safeEmphasize(palette.background.default, 0.8);
|
||||
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
||||
setColor(palette.SnackbarContent, 'color', silent(() => palette.getContrastText(snackbarContentBackground)));
|
||||
setColor(palette.SpeedDialAction, 'fabHoverBg', safeEmphasize(palette.background.paper, 0.15));
|
||||
setColor(palette.StepConnector, 'border', setCssVarColor('palette-grey-400'));
|
||||
setColor(palette.StepContent, 'border', setCssVarColor('palette-grey-400'));
|
||||
setColor(palette.Switch, 'defaultColor', setCssVarColor('palette-common-white'));
|
||||
setColor(palette.Switch, 'defaultDisabledColor', setCssVarColor('palette-grey-100'));
|
||||
setColor(palette.Switch, 'primaryDisabledColor', safeLighten(palette.primary.main, 0.62));
|
||||
setColor(palette.Switch, 'secondaryDisabledColor', safeLighten(palette.secondary.main, 0.62));
|
||||
setColor(palette.Switch, 'errorDisabledColor', safeLighten(palette.error.main, 0.62));
|
||||
setColor(palette.Switch, 'infoDisabledColor', safeLighten(palette.info.main, 0.62));
|
||||
setColor(palette.Switch, 'successDisabledColor', safeLighten(palette.success.main, 0.62));
|
||||
setColor(palette.Switch, 'warningDisabledColor', safeLighten(palette.warning.main, 0.62));
|
||||
setColor(palette.TableCell, 'border', safeLighten(safeAlpha(palette.divider, 1), 0.88));
|
||||
setColor(palette.Tooltip, 'bg', safeAlpha(palette.grey[700], 0.92));
|
||||
}
|
||||
if (palette.mode === 'dark') {
|
||||
setColor(palette.Alert, 'errorColor', safeLighten(palette.error.light, 0.6));
|
||||
setColor(palette.Alert, 'infoColor', safeLighten(palette.info.light, 0.6));
|
||||
setColor(palette.Alert, 'successColor', safeLighten(palette.success.light, 0.6));
|
||||
setColor(palette.Alert, 'warningColor', safeLighten(palette.warning.light, 0.6));
|
||||
setColor(palette.Alert, 'errorFilledBg', setCssVarColor('palette-error-dark'));
|
||||
setColor(palette.Alert, 'infoFilledBg', setCssVarColor('palette-info-dark'));
|
||||
setColor(palette.Alert, 'successFilledBg', setCssVarColor('palette-success-dark'));
|
||||
setColor(palette.Alert, 'warningFilledBg', setCssVarColor('palette-warning-dark'));
|
||||
setColor(palette.Alert, 'errorFilledColor', silent(() => palette.getContrastText(palette.error.dark)));
|
||||
setColor(palette.Alert, 'infoFilledColor', silent(() => palette.getContrastText(palette.info.dark)));
|
||||
setColor(palette.Alert, 'successFilledColor', silent(() => palette.getContrastText(palette.success.dark)));
|
||||
setColor(palette.Alert, 'warningFilledColor', silent(() => palette.getContrastText(palette.warning.dark)));
|
||||
setColor(palette.Alert, 'errorStandardBg', safeDarken(palette.error.light, 0.9));
|
||||
setColor(palette.Alert, 'infoStandardBg', safeDarken(palette.info.light, 0.9));
|
||||
setColor(palette.Alert, 'successStandardBg', safeDarken(palette.success.light, 0.9));
|
||||
setColor(palette.Alert, 'warningStandardBg', safeDarken(palette.warning.light, 0.9));
|
||||
setColor(palette.Alert, 'errorIconColor', setCssVarColor('palette-error-main'));
|
||||
setColor(palette.Alert, 'infoIconColor', setCssVarColor('palette-info-main'));
|
||||
setColor(palette.Alert, 'successIconColor', setCssVarColor('palette-success-main'));
|
||||
setColor(palette.Alert, 'warningIconColor', setCssVarColor('palette-warning-main'));
|
||||
setColor(palette.AppBar, 'defaultBg', setCssVarColor('palette-grey-900'));
|
||||
setColor(palette.AppBar, 'darkBg', setCssVarColor('palette-background-paper')); // specific for dark mode
|
||||
setColor(palette.AppBar, 'darkColor', setCssVarColor('palette-text-primary')); // specific for dark mode
|
||||
setColor(palette.Avatar, 'defaultBg', setCssVarColor('palette-grey-600'));
|
||||
setColor(palette.Button, 'inheritContainedBg', setCssVarColor('palette-grey-800'));
|
||||
setColor(palette.Button, 'inheritContainedHoverBg', setCssVarColor('palette-grey-700'));
|
||||
setColor(palette.Chip, 'defaultBorder', setCssVarColor('palette-grey-700'));
|
||||
setColor(palette.Chip, 'defaultAvatarColor', setCssVarColor('palette-grey-300'));
|
||||
setColor(palette.Chip, 'defaultIconColor', setCssVarColor('palette-grey-300'));
|
||||
setColor(palette.FilledInput, 'bg', 'rgba(255, 255, 255, 0.09)');
|
||||
setColor(palette.FilledInput, 'hoverBg', 'rgba(255, 255, 255, 0.13)');
|
||||
setColor(palette.FilledInput, 'disabledBg', 'rgba(255, 255, 255, 0.12)');
|
||||
setColor(palette.LinearProgress, 'primaryBg', safeDarken(palette.primary.main, 0.5));
|
||||
setColor(palette.LinearProgress, 'secondaryBg', safeDarken(palette.secondary.main, 0.5));
|
||||
setColor(palette.LinearProgress, 'errorBg', safeDarken(palette.error.main, 0.5));
|
||||
setColor(palette.LinearProgress, 'infoBg', safeDarken(palette.info.main, 0.5));
|
||||
setColor(palette.LinearProgress, 'successBg', safeDarken(palette.success.main, 0.5));
|
||||
setColor(palette.LinearProgress, 'warningBg', safeDarken(palette.warning.main, 0.5));
|
||||
setColor(palette.Skeleton, 'bg', `rgba(${setCssVarColor('palette-text-primaryChannel')} / 0.13)`);
|
||||
setColor(palette.Slider, 'primaryTrack', safeDarken(palette.primary.main, 0.5));
|
||||
setColor(palette.Slider, 'secondaryTrack', safeDarken(palette.secondary.main, 0.5));
|
||||
setColor(palette.Slider, 'errorTrack', safeDarken(palette.error.main, 0.5));
|
||||
setColor(palette.Slider, 'infoTrack', safeDarken(palette.info.main, 0.5));
|
||||
setColor(palette.Slider, 'successTrack', safeDarken(palette.success.main, 0.5));
|
||||
setColor(palette.Slider, 'warningTrack', safeDarken(palette.warning.main, 0.5));
|
||||
const snackbarContentBackground = safeEmphasize(palette.background.default, 0.98);
|
||||
setColor(palette.SnackbarContent, 'bg', snackbarContentBackground);
|
||||
setColor(palette.SnackbarContent, 'color', silent(() => palette.getContrastText(snackbarContentBackground)));
|
||||
setColor(palette.SpeedDialAction, 'fabHoverBg', safeEmphasize(palette.background.paper, 0.15));
|
||||
setColor(palette.StepConnector, 'border', setCssVarColor('palette-grey-600'));
|
||||
setColor(palette.StepContent, 'border', setCssVarColor('palette-grey-600'));
|
||||
setColor(palette.Switch, 'defaultColor', setCssVarColor('palette-grey-300'));
|
||||
setColor(palette.Switch, 'defaultDisabledColor', setCssVarColor('palette-grey-600'));
|
||||
setColor(palette.Switch, 'primaryDisabledColor', safeDarken(palette.primary.main, 0.55));
|
||||
setColor(palette.Switch, 'secondaryDisabledColor', safeDarken(palette.secondary.main, 0.55));
|
||||
setColor(palette.Switch, 'errorDisabledColor', safeDarken(palette.error.main, 0.55));
|
||||
setColor(palette.Switch, 'infoDisabledColor', safeDarken(palette.info.main, 0.55));
|
||||
setColor(palette.Switch, 'successDisabledColor', safeDarken(palette.success.main, 0.55));
|
||||
setColor(palette.Switch, 'warningDisabledColor', safeDarken(palette.warning.main, 0.55));
|
||||
setColor(palette.TableCell, 'border', safeDarken(safeAlpha(palette.divider, 1), 0.68));
|
||||
setColor(palette.Tooltip, 'bg', safeAlpha(palette.grey[700], 0.92));
|
||||
}
|
||||
|
||||
// MUI X - DataGrid needs this token.
|
||||
setColorChannel(palette.background, 'default');
|
||||
|
||||
// added for consistency with the `background.default` token
|
||||
setColorChannel(palette.background, 'paper');
|
||||
setColorChannel(palette.common, 'background');
|
||||
setColorChannel(palette.common, 'onBackground');
|
||||
setColorChannel(palette, 'divider');
|
||||
Object.keys(palette).forEach(color => {
|
||||
const colors = palette[color];
|
||||
|
||||
// The default palettes (primary, secondary, error, info, success, and warning) errors are handled by the above `createTheme(...)`.
|
||||
|
||||
if (colors && typeof colors === 'object') {
|
||||
// Silent the error for custom palettes.
|
||||
if (colors.main) {
|
||||
setColor(palette[color], 'mainChannel', safeColorChannel(toRgb(colors.main)));
|
||||
}
|
||||
if (colors.light) {
|
||||
setColor(palette[color], 'lightChannel', safeColorChannel(toRgb(colors.light)));
|
||||
}
|
||||
if (colors.dark) {
|
||||
setColor(palette[color], 'darkChannel', safeColorChannel(toRgb(colors.dark)));
|
||||
}
|
||||
if (colors.contrastText) {
|
||||
setColor(palette[color], 'contrastTextChannel', safeColorChannel(toRgb(colors.contrastText)));
|
||||
}
|
||||
if (color === 'text') {
|
||||
// Text colors: text.primary, text.secondary
|
||||
setColorChannel(palette[color], 'primary');
|
||||
setColorChannel(palette[color], 'secondary');
|
||||
}
|
||||
if (color === 'action') {
|
||||
// Action colors: action.active, action.selected
|
||||
if (colors.active) {
|
||||
setColorChannel(palette[color], 'active');
|
||||
}
|
||||
if (colors.selected) {
|
||||
setColorChannel(palette[color], 'selected');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
theme = args.reduce((acc, argument) => deepmerge(acc, argument), theme);
|
||||
const parserConfig = {
|
||||
prefix: cssVarPrefix,
|
||||
disableCssColorScheme,
|
||||
shouldSkipGeneratingVar,
|
||||
getSelector: defaultGetSelector(theme)
|
||||
};
|
||||
const {
|
||||
vars,
|
||||
generateThemeVars,
|
||||
generateStyleSheets
|
||||
} = prepareCssVars(theme, parserConfig);
|
||||
theme.vars = vars;
|
||||
Object.entries(theme.colorSchemes[theme.defaultColorScheme]).forEach(([key, value]) => {
|
||||
theme[key] = value;
|
||||
});
|
||||
theme.generateThemeVars = generateThemeVars;
|
||||
theme.generateStyleSheets = generateStyleSheets;
|
||||
theme.generateSpacing = function generateSpacing() {
|
||||
return createSpacing(input.spacing, createUnarySpacing(this));
|
||||
};
|
||||
theme.getColorSchemeSelector = createGetColorSchemeSelector(selector);
|
||||
theme.spacing = theme.generateSpacing();
|
||||
theme.shouldSkipGeneratingVar = shouldSkipGeneratingVar;
|
||||
theme.unstable_sxConfig = {
|
||||
...defaultSxConfig,
|
||||
...input?.unstable_sxConfig
|
||||
};
|
||||
theme.unstable_sx = function sx(props) {
|
||||
return styleFunctionSx({
|
||||
sx: props,
|
||||
theme: this
|
||||
});
|
||||
};
|
||||
theme.toRuntimeSource = stringifyTheme; // for Pigment CSS integration
|
||||
|
||||
return theme;
|
||||
}
|
||||
89
node_modules/@mui/material/modern/styles/createTransitions.js
generated
vendored
Normal file
89
node_modules/@mui/material/modern/styles/createTransitions.js
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves
|
||||
// to learn the context in which each easing should be used.
|
||||
export const easing = {
|
||||
// This is the most common easing curve.
|
||||
easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
|
||||
// Objects enter the screen at full velocity from off-screen and
|
||||
// slowly decelerate to a resting point.
|
||||
easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
|
||||
// Objects leave the screen at full velocity. They do not decelerate when off-screen.
|
||||
easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
|
||||
// The sharp curve is used by objects that may return to the screen at any time.
|
||||
sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'
|
||||
};
|
||||
|
||||
// Follow https://m2.material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations
|
||||
// to learn when use what timing
|
||||
export const duration = {
|
||||
shortest: 150,
|
||||
shorter: 200,
|
||||
short: 250,
|
||||
// most basic recommended timing
|
||||
standard: 300,
|
||||
// this is to be used in complex animations
|
||||
complex: 375,
|
||||
// recommended when something is entering screen
|
||||
enteringScreen: 225,
|
||||
// recommended when something is leaving screen
|
||||
leavingScreen: 195
|
||||
};
|
||||
function formatMs(milliseconds) {
|
||||
return `${Math.round(milliseconds)}ms`;
|
||||
}
|
||||
function getAutoHeightDuration(height) {
|
||||
if (!height) {
|
||||
return 0;
|
||||
}
|
||||
const constant = height / 36;
|
||||
|
||||
// https://www.desmos.com/calculator/vbrp3ggqet
|
||||
return Math.min(Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10), 3000);
|
||||
}
|
||||
export default function createTransitions(inputTransitions) {
|
||||
const mergedEasing = {
|
||||
...easing,
|
||||
...inputTransitions.easing
|
||||
};
|
||||
const mergedDuration = {
|
||||
...duration,
|
||||
...inputTransitions.duration
|
||||
};
|
||||
const create = (props = ['all'], options = {}) => {
|
||||
const {
|
||||
duration: durationOption = mergedDuration.standard,
|
||||
easing: easingOption = mergedEasing.easeInOut,
|
||||
delay = 0,
|
||||
...other
|
||||
} = options;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const isString = value => typeof value === 'string';
|
||||
const isNumber = value => !Number.isNaN(parseFloat(value));
|
||||
if (!isString(props) && !Array.isArray(props)) {
|
||||
console.error('MUI: Argument "props" must be a string or Array.');
|
||||
}
|
||||
if (!isNumber(durationOption) && !isString(durationOption)) {
|
||||
console.error(`MUI: Argument "duration" must be a number or a string but found ${durationOption}.`);
|
||||
}
|
||||
if (!isString(easingOption)) {
|
||||
console.error('MUI: Argument "easing" must be a string.');
|
||||
}
|
||||
if (!isNumber(delay) && !isString(delay)) {
|
||||
console.error('MUI: Argument "delay" must be a number or a string.');
|
||||
}
|
||||
if (typeof options !== 'object') {
|
||||
console.error(['MUI: Secong argument of transition.create must be an object.', "Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join('\n'));
|
||||
}
|
||||
if (Object.keys(other).length !== 0) {
|
||||
console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(',')}].`);
|
||||
}
|
||||
}
|
||||
return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');
|
||||
};
|
||||
return {
|
||||
getAutoHeightDuration,
|
||||
create,
|
||||
...inputTransitions,
|
||||
easing: mergedEasing,
|
||||
duration: mergedDuration
|
||||
};
|
||||
}
|
||||
92
node_modules/@mui/material/modern/styles/createTypography.js
generated
vendored
Normal file
92
node_modules/@mui/material/modern/styles/createTypography.js
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
import deepmerge from '@mui/utils/deepmerge';
|
||||
function round(value) {
|
||||
return Math.round(value * 1e5) / 1e5;
|
||||
}
|
||||
const caseAllCaps = {
|
||||
textTransform: 'uppercase'
|
||||
};
|
||||
const defaultFontFamily = '"Roboto", "Helvetica", "Arial", sans-serif';
|
||||
|
||||
/**
|
||||
* @see @link{https://m2.material.io/design/typography/the-type-system.html}
|
||||
* @see @link{https://m2.material.io/design/typography/understanding-typography.html}
|
||||
*/
|
||||
export default function createTypography(palette, typography) {
|
||||
const {
|
||||
fontFamily = defaultFontFamily,
|
||||
// The default font size of the Material Specification.
|
||||
fontSize = 14,
|
||||
// px
|
||||
fontWeightLight = 300,
|
||||
fontWeightRegular = 400,
|
||||
fontWeightMedium = 500,
|
||||
fontWeightBold = 700,
|
||||
// Tell MUI what's the font-size on the html element.
|
||||
// 16px is the default font-size used by browsers.
|
||||
htmlFontSize = 16,
|
||||
// Apply the CSS properties to all the variants.
|
||||
allVariants,
|
||||
pxToRem: pxToRem2,
|
||||
...other
|
||||
} = typeof typography === 'function' ? typography(palette) : typography;
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (typeof fontSize !== 'number') {
|
||||
console.error('MUI: `fontSize` is required to be a number.');
|
||||
}
|
||||
if (typeof htmlFontSize !== 'number') {
|
||||
console.error('MUI: `htmlFontSize` is required to be a number.');
|
||||
}
|
||||
}
|
||||
const coef = fontSize / 14;
|
||||
const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);
|
||||
const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => ({
|
||||
fontFamily,
|
||||
fontWeight,
|
||||
fontSize: pxToRem(size),
|
||||
// Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/
|
||||
lineHeight,
|
||||
// The letter spacing was designed for the Roboto font-family. Using the same letter-spacing
|
||||
// across font-families can cause issues with the kerning.
|
||||
...(fontFamily === defaultFontFamily ? {
|
||||
letterSpacing: `${round(letterSpacing / size)}em`
|
||||
} : {}),
|
||||
...casing,
|
||||
...allVariants
|
||||
});
|
||||
const variants = {
|
||||
h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),
|
||||
h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),
|
||||
h3: buildVariant(fontWeightRegular, 48, 1.167, 0),
|
||||
h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),
|
||||
h5: buildVariant(fontWeightRegular, 24, 1.334, 0),
|
||||
h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),
|
||||
subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),
|
||||
subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),
|
||||
body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),
|
||||
body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),
|
||||
button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),
|
||||
caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),
|
||||
overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),
|
||||
// TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types.
|
||||
inherit: {
|
||||
fontFamily: 'inherit',
|
||||
fontWeight: 'inherit',
|
||||
fontSize: 'inherit',
|
||||
lineHeight: 'inherit',
|
||||
letterSpacing: 'inherit'
|
||||
}
|
||||
};
|
||||
return deepmerge({
|
||||
htmlFontSize,
|
||||
pxToRem,
|
||||
fontFamily,
|
||||
fontSize,
|
||||
fontWeightLight,
|
||||
fontWeightRegular,
|
||||
fontWeightMedium,
|
||||
fontWeightBold,
|
||||
...variants
|
||||
}, other, {
|
||||
clone: false // No need to clone deep
|
||||
});
|
||||
}
|
||||
125
node_modules/@mui/material/modern/styles/cssUtils.js
generated
vendored
Normal file
125
node_modules/@mui/material/modern/styles/cssUtils.js
generated
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
export function isUnitless(value) {
|
||||
return String(parseFloat(value)).length === String(value).length;
|
||||
}
|
||||
|
||||
// Ported from Compass
|
||||
// https://github.com/Compass/compass/blob/master/core/stylesheets/compass/typography/_units.scss
|
||||
// Emulate the sass function "unit"
|
||||
export function getUnit(input) {
|
||||
return String(input).match(/[\d.\-+]*\s*(.*)/)[1] || '';
|
||||
}
|
||||
|
||||
// Emulate the sass function "unitless"
|
||||
export function toUnitless(length) {
|
||||
return parseFloat(length);
|
||||
}
|
||||
|
||||
// Convert any CSS <length> or <percentage> value to any another.
|
||||
// From https://github.com/KyleAMathews/convert-css-length
|
||||
export function convertLength(baseFontSize) {
|
||||
return (length, toUnit) => {
|
||||
const fromUnit = getUnit(length);
|
||||
|
||||
// Optimize for cases where `from` and `to` units are accidentally the same.
|
||||
if (fromUnit === toUnit) {
|
||||
return length;
|
||||
}
|
||||
|
||||
// Convert input length to pixels.
|
||||
let pxLength = toUnitless(length);
|
||||
if (fromUnit !== 'px') {
|
||||
if (fromUnit === 'em') {
|
||||
pxLength = toUnitless(length) * toUnitless(baseFontSize);
|
||||
} else if (fromUnit === 'rem') {
|
||||
pxLength = toUnitless(length) * toUnitless(baseFontSize);
|
||||
}
|
||||
}
|
||||
|
||||
// Convert length in pixels to the output unit
|
||||
let outputLength = pxLength;
|
||||
if (toUnit !== 'px') {
|
||||
if (toUnit === 'em') {
|
||||
outputLength = pxLength / toUnitless(baseFontSize);
|
||||
} else if (toUnit === 'rem') {
|
||||
outputLength = pxLength / toUnitless(baseFontSize);
|
||||
} else {
|
||||
return length;
|
||||
}
|
||||
}
|
||||
return parseFloat(outputLength.toFixed(5)) + toUnit;
|
||||
};
|
||||
}
|
||||
export function alignProperty({
|
||||
size,
|
||||
grid
|
||||
}) {
|
||||
const sizeBelow = size - size % grid;
|
||||
const sizeAbove = sizeBelow + grid;
|
||||
return size - sizeBelow < sizeAbove - size ? sizeBelow : sizeAbove;
|
||||
}
|
||||
|
||||
// fontGrid finds a minimal grid (in rem) for the fontSize values so that the
|
||||
// lineHeight falls under a x pixels grid, 4px in the case of Material Design,
|
||||
// without changing the relative line height
|
||||
export function fontGrid({
|
||||
lineHeight,
|
||||
pixels,
|
||||
htmlFontSize
|
||||
}) {
|
||||
return pixels / (lineHeight * htmlFontSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* generate a responsive version of a given CSS property
|
||||
* @example
|
||||
* responsiveProperty({
|
||||
* cssProperty: 'fontSize',
|
||||
* min: 15,
|
||||
* max: 20,
|
||||
* unit: 'px',
|
||||
* breakpoints: [300, 600],
|
||||
* })
|
||||
*
|
||||
* // this returns
|
||||
*
|
||||
* {
|
||||
* fontSize: '15px',
|
||||
* '@media (min-width:300px)': {
|
||||
* fontSize: '17.5px',
|
||||
* },
|
||||
* '@media (min-width:600px)': {
|
||||
* fontSize: '20px',
|
||||
* },
|
||||
* }
|
||||
* @param {Object} params
|
||||
* @param {string} params.cssProperty - The CSS property to be made responsive
|
||||
* @param {number} params.min - The smallest value of the CSS property
|
||||
* @param {number} params.max - The largest value of the CSS property
|
||||
* @param {string} [params.unit] - The unit to be used for the CSS property
|
||||
* @param {Array.number} [params.breakpoints] - An array of breakpoints
|
||||
* @param {number} [params.alignStep] - Round scaled value to fall under this grid
|
||||
* @returns {Object} responsive styles for {params.cssProperty}
|
||||
*/
|
||||
export function responsiveProperty({
|
||||
cssProperty,
|
||||
min,
|
||||
max,
|
||||
unit = 'rem',
|
||||
breakpoints = [600, 900, 1200],
|
||||
transform = null
|
||||
}) {
|
||||
const output = {
|
||||
[cssProperty]: `${min}${unit}`
|
||||
};
|
||||
const factor = (max - min) / breakpoints[breakpoints.length - 1];
|
||||
breakpoints.forEach(breakpoint => {
|
||||
let value = min + factor * breakpoint;
|
||||
if (transform !== null) {
|
||||
value = transform(value);
|
||||
}
|
||||
output[`@media (min-width:${breakpoint}px)`] = {
|
||||
[cssProperty]: `${Math.round(value * 10000) / 10000}${unit}`
|
||||
};
|
||||
});
|
||||
return output;
|
||||
}
|
||||
5
node_modules/@mui/material/modern/styles/defaultTheme.js
generated
vendored
Normal file
5
node_modules/@mui/material/modern/styles/defaultTheme.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use client';
|
||||
|
||||
import createTheme from "./createTheme.js";
|
||||
const defaultTheme = createTheme();
|
||||
export default defaultTheme;
|
||||
5
node_modules/@mui/material/modern/styles/excludeVariablesFromRoot.js
generated
vendored
Normal file
5
node_modules/@mui/material/modern/styles/excludeVariablesFromRoot.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* @internal These variables should not appear in the :root stylesheet when the `defaultColorScheme="dark"`
|
||||
*/
|
||||
const excludeVariablesFromRoot = cssVarPrefix => [...[...Array(24)].map((_, index) => `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}overlays-${index + 1}`), `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkBg`, `--${cssVarPrefix ? `${cssVarPrefix}-` : ''}palette-AppBar-darkColor`];
|
||||
export default excludeVariablesFromRoot;
|
||||
9
node_modules/@mui/material/modern/styles/experimental_extendTheme.js
generated
vendored
Normal file
9
node_modules/@mui/material/modern/styles/experimental_extendTheme.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import extendTheme from "./createThemeWithVars.js";
|
||||
let warnedOnce = false;
|
||||
export default function deprecatedExtendTheme(...args) {
|
||||
if (!warnedOnce) {
|
||||
console.warn(['MUI: The `experimental_extendTheme` has been stabilized.', '', "You should use `import { extendTheme } from '@mui/material/styles'`"].join('\n'));
|
||||
warnedOnce = true;
|
||||
}
|
||||
return extendTheme(...args);
|
||||
}
|
||||
10
node_modules/@mui/material/modern/styles/getOverlayAlpha.js
generated
vendored
Normal file
10
node_modules/@mui/material/modern/styles/getOverlayAlpha.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
// Inspired by https://github.com/material-components/material-components-ios/blob/bca36107405594d5b7b16265a5b0ed698f85a5ee/components/Elevation/src/UIColor%2BMaterialElevation.m#L61
|
||||
export default function getOverlayAlpha(elevation) {
|
||||
let alphaValue;
|
||||
if (elevation < 1) {
|
||||
alphaValue = 5.11916 * elevation ** 2;
|
||||
} else {
|
||||
alphaValue = 4.5 * Math.log(elevation + 1) + 2;
|
||||
}
|
||||
return Math.round(alphaValue * 10) / 1000;
|
||||
}
|
||||
1
node_modules/@mui/material/modern/styles/identifier.js
generated
vendored
Normal file
1
node_modules/@mui/material/modern/styles/identifier.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default '$$material';
|
||||
38
node_modules/@mui/material/modern/styles/index.js
generated
vendored
Normal file
38
node_modules/@mui/material/modern/styles/index.js
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
||||
export { default as THEME_ID } from "./identifier.js";
|
||||
export { default as adaptV4Theme } from "./adaptV4Theme.js";
|
||||
export { hexToRgb, rgbToHex, hslToRgb, decomposeColor, recomposeColor, getContrastRatio, getLuminance, emphasize, alpha, darken, lighten, css, keyframes } from '@mui/system';
|
||||
export { unstable_createBreakpoints } from '@mui/system/createBreakpoints';
|
||||
// TODO: Remove this function in v6.
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export function experimental_sx() {
|
||||
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: The \`experimental_sx\` has been moved to \`theme.unstable_sx\`.For more details, see https://github.com/mui/material-ui/pull/35150.` : _formatMuiErrorMessage(19));
|
||||
}
|
||||
export { default as createTheme, createMuiTheme } from "./createTheme.js";
|
||||
export { default as unstable_createMuiStrictModeTheme } from "./createMuiStrictModeTheme.js";
|
||||
export { default as createStyles } from "./createStyles.js";
|
||||
export { getUnit as unstable_getUnit, toUnitless as unstable_toUnitless } from "./cssUtils.js";
|
||||
export { default as responsiveFontSizes } from "./responsiveFontSizes.js";
|
||||
export { default as createTransitions, duration, easing } from "./createTransitions.js";
|
||||
export { default as createColorScheme } from "./createColorScheme.js";
|
||||
export { default as useTheme } from "./useTheme.js";
|
||||
export { default as useThemeProps } from "./useThemeProps.js";
|
||||
export { default as styled } from "./styled.js";
|
||||
export { default as experimentalStyled } from "./styled.js";
|
||||
export { default as ThemeProvider } from "./ThemeProvider.js";
|
||||
export { StyledEngineProvider } from '@mui/system';
|
||||
// The legacy utilities from @mui/styles
|
||||
// These are just empty functions that throws when invoked
|
||||
export { default as makeStyles } from "./makeStyles.js";
|
||||
export { default as withStyles } from "./withStyles.js";
|
||||
export { default as withTheme } from "./withTheme.js";
|
||||
export * from "./ThemeProviderWithVars.js";
|
||||
export { default as extendTheme } from "./createThemeWithVars.js";
|
||||
export { default as experimental_extendTheme } from "./experimental_extendTheme.js"; // TODO: Remove in v7
|
||||
export { default as getOverlayAlpha } from "./getOverlayAlpha.js";
|
||||
export { default as shouldSkipGeneratingVar } from "./shouldSkipGeneratingVar.js";
|
||||
|
||||
// Private methods for creating parts of the theme
|
||||
export { default as private_createTypography } from "./createTypography.js";
|
||||
export { default as private_createMixins } from "./createMixins.js";
|
||||
export { default as private_excludeVariablesFromRoot } from "./excludeVariablesFromRoot.js";
|
||||
6
node_modules/@mui/material/modern/styles/makeStyles.js
generated
vendored
Normal file
6
node_modules/@mui/material/modern/styles/makeStyles.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
||||
export default function makeStyles() {
|
||||
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: makeStyles is no longer exported from @mui/material/styles.
|
||||
You have to import it from @mui/styles.
|
||||
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(14));
|
||||
}
|
||||
68
node_modules/@mui/material/modern/styles/responsiveFontSizes.js
generated
vendored
Normal file
68
node_modules/@mui/material/modern/styles/responsiveFontSizes.js
generated
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
||||
import { isUnitless, convertLength, responsiveProperty, alignProperty, fontGrid } from "./cssUtils.js";
|
||||
export default function responsiveFontSizes(themeInput, options = {}) {
|
||||
const {
|
||||
breakpoints = ['sm', 'md', 'lg'],
|
||||
disableAlign = false,
|
||||
factor = 2,
|
||||
variants = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'caption', 'button', 'overline']
|
||||
} = options;
|
||||
const theme = {
|
||||
...themeInput
|
||||
};
|
||||
theme.typography = {
|
||||
...theme.typography
|
||||
};
|
||||
const typography = theme.typography;
|
||||
|
||||
// Convert between CSS lengths e.g. em->px or px->rem
|
||||
// Set the baseFontSize for your project. Defaults to 16px (also the browser default).
|
||||
const convert = convertLength(typography.htmlFontSize);
|
||||
const breakpointValues = breakpoints.map(x => theme.breakpoints.values[x]);
|
||||
variants.forEach(variant => {
|
||||
const style = typography[variant];
|
||||
if (!style) {
|
||||
return;
|
||||
}
|
||||
const remFontSize = parseFloat(convert(style.fontSize, 'rem'));
|
||||
if (remFontSize <= 1) {
|
||||
return;
|
||||
}
|
||||
const maxFontSize = remFontSize;
|
||||
const minFontSize = 1 + (maxFontSize - 1) / factor;
|
||||
let {
|
||||
lineHeight
|
||||
} = style;
|
||||
if (!isUnitless(lineHeight) && !disableAlign) {
|
||||
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: Unsupported non-unitless line height with grid alignment.
|
||||
Use unitless line heights instead.` : _formatMuiErrorMessage(6));
|
||||
}
|
||||
if (!isUnitless(lineHeight)) {
|
||||
// make it unitless
|
||||
lineHeight = parseFloat(convert(lineHeight, 'rem')) / parseFloat(remFontSize);
|
||||
}
|
||||
let transform = null;
|
||||
if (!disableAlign) {
|
||||
transform = value => alignProperty({
|
||||
size: value,
|
||||
grid: fontGrid({
|
||||
pixels: 4,
|
||||
lineHeight,
|
||||
htmlFontSize: typography.htmlFontSize
|
||||
})
|
||||
});
|
||||
}
|
||||
typography[variant] = {
|
||||
...style,
|
||||
...responsiveProperty({
|
||||
cssProperty: 'fontSize',
|
||||
min: minFontSize,
|
||||
max: maxFontSize,
|
||||
unit: 'rem',
|
||||
breakpoints: breakpointValues,
|
||||
transform
|
||||
})
|
||||
};
|
||||
});
|
||||
return theme;
|
||||
}
|
||||
3
node_modules/@mui/material/modern/styles/rootShouldForwardProp.js
generated
vendored
Normal file
3
node_modules/@mui/material/modern/styles/rootShouldForwardProp.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import slotShouldForwardProp from "./slotShouldForwardProp.js";
|
||||
const rootShouldForwardProp = prop => slotShouldForwardProp(prop) && prop !== 'classes';
|
||||
export default rootShouldForwardProp;
|
||||
10
node_modules/@mui/material/modern/styles/shadows.js
generated
vendored
Normal file
10
node_modules/@mui/material/modern/styles/shadows.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
const shadowKeyUmbraOpacity = 0.2;
|
||||
const shadowKeyPenumbraOpacity = 0.14;
|
||||
const shadowAmbientShadowOpacity = 0.12;
|
||||
function createShadow(...px) {
|
||||
return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(',');
|
||||
}
|
||||
|
||||
// Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss
|
||||
const shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];
|
||||
export default shadows;
|
||||
5
node_modules/@mui/material/modern/styles/shouldSkipGeneratingVar.js
generated
vendored
Normal file
5
node_modules/@mui/material/modern/styles/shouldSkipGeneratingVar.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export default function shouldSkipGeneratingVar(keys) {
|
||||
return !!keys[0].match(/(cssVarPrefix|colorSchemeSelector|typography|mixins|breakpoints|direction|transitions)/) || !!keys[0].match(/sxConfig$/) ||
|
||||
// ends with sxConfig
|
||||
keys[0] === 'palette' && !!keys[1]?.match(/(mode|contrastThreshold|tonalOffset)/);
|
||||
}
|
||||
5
node_modules/@mui/material/modern/styles/slotShouldForwardProp.js
generated
vendored
Normal file
5
node_modules/@mui/material/modern/styles/slotShouldForwardProp.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
// copied from @mui/system/createStyled
|
||||
function slotShouldForwardProp(prop) {
|
||||
return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
|
||||
}
|
||||
export default slotShouldForwardProp;
|
||||
54
node_modules/@mui/material/modern/styles/stringifyTheme.js
generated
vendored
Normal file
54
node_modules/@mui/material/modern/styles/stringifyTheme.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
/* eslint-disable import/prefer-default-export */
|
||||
import { isPlainObject } from '@mui/utils/deepmerge';
|
||||
function isSerializable(val) {
|
||||
return isPlainObject(val) || typeof val === 'undefined' || typeof val === 'string' || typeof val === 'boolean' || typeof val === 'number' || Array.isArray(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* `baseTheme` usually comes from `createTheme` or `extendTheme`.
|
||||
*
|
||||
* This function is intended to be used with zero-runtime CSS-in-JS like Pigment CSS
|
||||
* For example, in a Next.js project:
|
||||
*
|
||||
* ```js
|
||||
* // next.config.js
|
||||
* const { extendTheme } = require('@mui/material/styles');
|
||||
*
|
||||
* const theme = extendTheme();
|
||||
* // `.toRuntimeSource` is Pigment CSS specific to create a theme that is available at runtime.
|
||||
* theme.toRuntimeSource = stringifyTheme;
|
||||
*
|
||||
* module.exports = withPigment({
|
||||
* theme,
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
export function stringifyTheme(baseTheme = {}) {
|
||||
const serializableTheme = {
|
||||
...baseTheme
|
||||
};
|
||||
function serializeTheme(object) {
|
||||
const array = Object.entries(object);
|
||||
// eslint-disable-next-line no-plusplus
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
const [key, value] = array[index];
|
||||
if (!isSerializable(value) || key.startsWith('unstable_')) {
|
||||
delete object[key];
|
||||
} else if (isPlainObject(value)) {
|
||||
object[key] = {
|
||||
...value
|
||||
};
|
||||
serializeTheme(object[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
serializeTheme(serializableTheme);
|
||||
return `import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
||||
|
||||
const theme = ${JSON.stringify(serializableTheme, null, 2)};
|
||||
|
||||
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
||||
theme.transitions = createTransitions(theme.transitions || {});
|
||||
|
||||
export default theme;`;
|
||||
}
|
||||
14
node_modules/@mui/material/modern/styles/styled.js
generated
vendored
Normal file
14
node_modules/@mui/material/modern/styles/styled.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use client';
|
||||
|
||||
import createStyled from '@mui/system/createStyled';
|
||||
import defaultTheme from "./defaultTheme.js";
|
||||
import THEME_ID from "./identifier.js";
|
||||
import rootShouldForwardProp from "./rootShouldForwardProp.js";
|
||||
export { default as slotShouldForwardProp } from "./slotShouldForwardProp.js";
|
||||
export { default as rootShouldForwardProp } from "./rootShouldForwardProp.js";
|
||||
const styled = createStyled({
|
||||
themeId: THEME_ID,
|
||||
defaultTheme,
|
||||
rootShouldForwardProp
|
||||
});
|
||||
export default styled;
|
||||
14
node_modules/@mui/material/modern/styles/useTheme.js
generated
vendored
Normal file
14
node_modules/@mui/material/modern/styles/useTheme.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import { useTheme as useThemeSystem } from '@mui/system';
|
||||
import defaultTheme from "./defaultTheme.js";
|
||||
import THEME_ID from "./identifier.js";
|
||||
export default function useTheme() {
|
||||
const theme = useThemeSystem(defaultTheme);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
React.useDebugValue(theme);
|
||||
}
|
||||
return theme[THEME_ID] || theme;
|
||||
}
|
||||
16
node_modules/@mui/material/modern/styles/useThemeProps.js
generated
vendored
Normal file
16
node_modules/@mui/material/modern/styles/useThemeProps.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
'use client';
|
||||
|
||||
import systemUseThemeProps from '@mui/system/useThemeProps';
|
||||
import defaultTheme from "./defaultTheme.js";
|
||||
import THEME_ID from "./identifier.js";
|
||||
export default function useThemeProps({
|
||||
props,
|
||||
name
|
||||
}) {
|
||||
return systemUseThemeProps({
|
||||
props,
|
||||
name,
|
||||
defaultTheme,
|
||||
themeId: THEME_ID
|
||||
});
|
||||
}
|
||||
6
node_modules/@mui/material/modern/styles/withStyles.js
generated
vendored
Normal file
6
node_modules/@mui/material/modern/styles/withStyles.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
||||
export default function withStyles() {
|
||||
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withStyles is no longer exported from @mui/material/styles.
|
||||
You have to import it from @mui/styles.
|
||||
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(15));
|
||||
}
|
||||
6
node_modules/@mui/material/modern/styles/withTheme.js
generated
vendored
Normal file
6
node_modules/@mui/material/modern/styles/withTheme.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
||||
export default function withTheme() {
|
||||
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: withTheme is no longer exported from @mui/material/styles.
|
||||
You have to import it from @mui/styles.
|
||||
See https://mui.com/r/migration-v4/#mui-material-styles for more details.` : _formatMuiErrorMessage(16));
|
||||
}
|
||||
13
node_modules/@mui/material/modern/styles/zIndex.js
generated
vendored
Normal file
13
node_modules/@mui/material/modern/styles/zIndex.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
// We need to centralize the zIndex definitions as they work
|
||||
// like global values in the browser.
|
||||
const zIndex = {
|
||||
mobileStepper: 1000,
|
||||
fab: 1050,
|
||||
speedDial: 1050,
|
||||
appBar: 1100,
|
||||
drawer: 1200,
|
||||
modal: 1300,
|
||||
snackbar: 1400,
|
||||
tooltip: 1500
|
||||
};
|
||||
export default zIndex;
|
||||
Reference in New Issue
Block a user