pre-installations and preparations
This commit is contained in:
1 parent
3e5a0329cb
commit
201d621ac3
6977 files changed
+742826
No files matched your search
+17
@@ -0,0 +1,17 @@
|
||||
export type GlobalStateSlot = keyof typeof globalStateClasses;
|
||||
export declare const globalStateClasses: {
|
||||
active: string;
|
||||
checked: string;
|
||||
completed: string;
|
||||
disabled: string;
|
||||
error: string;
|
||||
expanded: string;
|
||||
focused: string;
|
||||
focusVisible: string;
|
||||
open: string;
|
||||
readOnly: string;
|
||||
required: string;
|
||||
selected: string;
|
||||
};
|
||||
export default function generateUtilityClass(componentName: string, slot: string, globalStatePrefix?: string): string;
|
||||
export declare function isGlobalState(slot: string): boolean;
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
import ClassNameGenerator from '../ClassNameGenerator';
|
||||
export const 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, globalStatePrefix = 'Mui') {
|
||||
const globalStateClass = globalStateClasses[slot];
|
||||
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;
|
||||
}
|
||||
export function isGlobalState(slot) {
|
||||
return globalStateClasses[slot] !== undefined;
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export { default } from './generateUtilityClass';
|
||||
export * from './generateUtilityClass';
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export { default } from './generateUtilityClass';
|
||||
export * from './generateUtilityClass';
|
||||
+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