FrontPastel/node_modules/@mui/utils/legacy/generateUtilityClass/generateUtilityClass.js

23 lines
840 B
JavaScript
Raw Normal View History

2024-04-17 13:55:11 +00:00
import ClassNameGenerator from '../ClassNameGenerator';
export var globalStateClasses = {
active: 'active',
checked: 'checked',
completed: 'completed',
disabled: 'disabled',
error: 'error',
expanded: 'expanded',
focused: 'focused',
focusVisible: 'focusVisible',
open: 'open',
readOnly: 'readOnly',
required: 'required',
selected: 'selected'
};
export default function generateUtilityClass(componentName, slot) {
var globalStatePrefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Mui';
var globalStateClass = globalStateClasses[slot];
return globalStateClass ? "".concat(globalStatePrefix, "-").concat(globalStateClass) : "".concat(ClassNameGenerator.generate(componentName), "-").concat(slot);
}
export function isGlobalState(slot) {
return globalStateClasses[slot] !== undefined;
}