pre-installations and preparations
This commit is contained in:
1 parent
3e5a0329cb
commit
201d621ac3
6977 files changed
+742826
No files matched your search
+3
@@ -0,0 +1,3 @@
|
||||
import { GlobalStateSlot } from '@mui/utils/generateUtilityClass';
|
||||
export declare function generateUtilityClass(componentName: string, slot: string | GlobalStateSlot): string;
|
||||
export declare function isGlobalState(slot: string): boolean;
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import { globalStateClasses } from '@mui/utils/generateUtilityClass';
|
||||
const GLOBAL_CLASS_PREFIX = 'base';
|
||||
function buildStateClass(state) {
|
||||
return `${GLOBAL_CLASS_PREFIX}--${state}`;
|
||||
}
|
||||
function buildSlotClass(componentName, slot) {
|
||||
return `${GLOBAL_CLASS_PREFIX}-${componentName}-${slot}`;
|
||||
}
|
||||
export function generateUtilityClass(componentName, slot) {
|
||||
const globalStateClass = globalStateClasses[slot];
|
||||
return globalStateClass ? buildStateClass(globalStateClass) : buildSlotClass(componentName, slot);
|
||||
}
|
||||
export function isGlobalState(slot) {
|
||||
return globalStateClasses[slot] !== undefined;
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/generateUtilityClass/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
Reference in new issue
Block a user