Files
madbase/control-plane-ui/node_modules/@mui/system/legacy/getThemeValue.js
Vlad Durnea cffdf8af86
Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped
wip:milestone 0 fixes
2026-03-15 12:35:42 +02:00

47 lines
1.5 KiB
JavaScript

import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import borders from './borders';
import display from './display';
import flexbox from './flexbox';
import grid from './cssGrid';
import positions from './positions';
import palette from './palette';
import shadows from './shadows';
import sizing from './sizing';
import spacing from './spacing';
import typography from './typography';
var 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 var styleFunctionMapping = {
borders: borders,
display: display,
flexbox: flexbox,
grid: grid,
positions: positions,
palette: palette,
shadows: shadows,
sizing: sizing,
spacing: spacing,
typography: typography
};
export var propToStyleFunction = Object.keys(filterPropsMapping).reduce(function (acc, styleFnName) {
filterPropsMapping[styleFnName].forEach(function (propName) {
acc[propName] = styleFunctionMapping[styleFnName];
});
return acc;
}, {});
function getThemeValue(prop, value, theme) {
var inputProps = _defineProperty(_defineProperty({}, prop, value), "theme", theme);
var styleFunction = propToStyleFunction[prop];
return styleFunction ? styleFunction(inputProps) : _defineProperty({}, prop, value);
}
export default getThemeValue;