1 | import { globalStateClasses } from '@mui/utils/generateUtilityClass';
|
2 | const GLOBAL_CLASS_PREFIX = 'base';
|
3 | function buildStateClass(state) {
|
4 | return `${GLOBAL_CLASS_PREFIX}--${state}`;
|
5 | }
|
6 | function buildSlotClass(componentName, slot) {
|
7 | return `${GLOBAL_CLASS_PREFIX}-${componentName}-${slot}`;
|
8 | }
|
9 | export function generateUtilityClass(componentName, slot) {
|
10 | const globalStateClass = globalStateClasses[slot];
|
11 | return globalStateClass ? buildStateClass(globalStateClass) : buildSlotClass(componentName, slot);
|
12 | }
|
13 | export function isGlobalState(slot) {
|
14 | return globalStateClasses[slot] !== undefined;
|
15 | } |
\ | No newline at end of file |