paradiego
This commit is contained in:
1
node_modules/@mui/system/getThemeValue/getThemeValue.d.ts
generated
vendored
Normal file
1
node_modules/@mui/system/getThemeValue/getThemeValue.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function getThemeValue(prop: string, value: any, theme: object): any;
|
||||
51
node_modules/@mui/system/getThemeValue/getThemeValue.js
generated
vendored
Normal file
51
node_modules/@mui/system/getThemeValue/getThemeValue.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
import borders from "../borders/index.js";
|
||||
import display from "../display/index.js";
|
||||
import flexbox from "../flexbox/index.js";
|
||||
import grid from "../cssGrid/index.js";
|
||||
import positions from "../positions/index.js";
|
||||
import palette from "../palette/index.js";
|
||||
import shadows from "../shadows/index.js";
|
||||
import sizing from "../sizing/index.js";
|
||||
import spacing from "../spacing/index.js";
|
||||
import typography from "../typography/index.js";
|
||||
const filterPropsMapping = {
|
||||
borders: borders.filterProps,
|
||||
display: display.filterProps,
|
||||
flexbox: flexbox.filterProps,
|
||||
grid: grid.filterProps,
|
||||
positions: positions.filterProps,
|
||||
palette: palette.filterProps,
|
||||
shadows: shadows.filterProps,
|
||||
sizing: sizing.filterProps,
|
||||
spacing: spacing.filterProps,
|
||||
typography: typography.filterProps
|
||||
};
|
||||
export const styleFunctionMapping = {
|
||||
borders,
|
||||
display,
|
||||
flexbox,
|
||||
grid,
|
||||
positions,
|
||||
palette,
|
||||
shadows,
|
||||
sizing,
|
||||
spacing,
|
||||
typography
|
||||
};
|
||||
export const propToStyleFunction = Object.keys(filterPropsMapping).reduce((acc, styleFnName) => {
|
||||
filterPropsMapping[styleFnName].forEach(propName => {
|
||||
acc[propName] = styleFunctionMapping[styleFnName];
|
||||
});
|
||||
return acc;
|
||||
}, {});
|
||||
function getThemeValue(prop, value, theme) {
|
||||
const inputProps = {
|
||||
[prop]: value,
|
||||
theme
|
||||
};
|
||||
const styleFunction = propToStyleFunction[prop];
|
||||
return styleFunction ? styleFunction(inputProps) : {
|
||||
[prop]: value
|
||||
};
|
||||
}
|
||||
export default getThemeValue;
|
||||
2
node_modules/@mui/system/getThemeValue/index.d.ts
generated
vendored
Normal file
2
node_modules/@mui/system/getThemeValue/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { default } from './getThemeValue';
|
||||
export * from './getThemeValue';
|
||||
2
node_modules/@mui/system/getThemeValue/index.js
generated
vendored
Normal file
2
node_modules/@mui/system/getThemeValue/index.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { default } from "./getThemeValue.js";
|
||||
export * from "./getThemeValue.js";
|
||||
6
node_modules/@mui/system/getThemeValue/package.json
generated
vendored
Normal file
6
node_modules/@mui/system/getThemeValue/package.json
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/getThemeValue/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
Reference in New Issue
Block a user