/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
packages/mui-material/src/Chip/chipClasses.ts
76 строк
2 KB
Silviu Alexandru Avram
[chip] Remove deprecated classes (#48046)
23 мар 2026, 06:21
Не верифицирован
23 мар 2026, 06:21
a805647
Код
Авторство
О чём код?
import generateUtilityClasses from '@mui/utils/generateUtilityClasses'; import generateUtilityClass from '@mui/utils/generateUtilityClass'; export interface ChipClasses { /** Styles applied to the root element. */ root: string; /** Styles applied to the root element if `size="small"`. */ sizeSmall: string; /** Styles applied to the root element if `size="medium"`. */ sizeMedium: string; /** Styles applied to the root element if `color="default"`. */ colorDefault: string; /** Styles applied to the root element if `color="error"`. */ colorError: string; /** Styles applied to the root element if `color="info"`. */ colorInfo: string; /** Styles applied to the root element if `color="primary"`. */ colorPrimary: string; /** Styles applied to the root element if `color="secondary"`. */ colorSecondary: string; /** Styles applied to the root element if `color="success"`. */ colorSuccess: string; /** Styles applied to the root element if `color="warning"`. */ colorWarning: string; /** State class applied to the root element if `disabled={true}`. */ disabled: string; /** Styles applied to the root element if `onClick` is defined or `clickable={true}`. */ clickable: string; /** Styles applied to the root element if `onDelete` is defined. */ deletable: string; /** Styles applied to the root element if `variant="outlined"`. */ outlined: string; /** Styles applied to the root element if `variant="filled"`. */ filled: string; /** Styles applied to the avatar element. */ avatar: string; /** Styles applied to the icon element. */ icon: string; /** Styles applied to the label `span` element. */ label: string; /** Styles applied to the deleteIcon element. */ deleteIcon: string; /** State class applied to the root element if keyboard focused. */ focusVisible: string; } export type ChipClassKey = keyof ChipClasses; export function getChipUtilityClass(slot: string): string { return generateUtilityClass('MuiChip', slot); } const chipClasses: ChipClasses = generateUtilityClasses('MuiChip', [ 'root', 'sizeSmall', 'sizeMedium', 'colorDefault', 'colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'disabled', 'clickable', 'deletable', 'outlined', 'filled', 'avatar', 'icon', 'label', 'deleteIcon', 'focusVisible', ]); export default chipClasses;