Skip to content

Commit

Permalink
[material-ui][Chip] Add colorDefault class to chipClasses (mui#42067)
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 authored May 2, 2024
1 parent b78eaf0 commit 7bc7de6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/pages/material-ui/api/chip.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@
"isGlobal": false,
"isDeprecated": true
},
{
"key": "colorDefault",
"className": "MuiChip-colorDefault",
"description": "Styles applied to the root element if `color=\"default\"`.",
"isGlobal": false
},
{
"key": "colorError",
"className": "MuiChip-colorError",
Expand Down
5 changes: 5 additions & 0 deletions docs/translations/api-docs/chip/chip.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@
"conditions": "<code>onClick</code> and <code>color=\"secondary\"</code> is defined or <code>clickable={true}</code>",
"deprecationInfo": "Combine the <a href=\"/material-ui/api/chip/#chip-classes-clickable\">.MuiChip-clickable</a> and <a href=\"/material-ui/api/chip/#chip-classes-colorSecondary\">.MuiChip-colorSecondary</a> classes instead. <a href=\"/material-ui/migration/migrating-from-deprecated-apis/\">How to migrate</a>"
},
"colorDefault": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the root element",
"conditions": "<code>color=\"default\"</code>"
},
"colorError": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the root element",
Expand Down
1 change: 1 addition & 0 deletions packages/mui-material/src/Chip/Chip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ describe('<Chip />', () => {
expect(label).to.have.text('My text Chip');

expect(chip).to.have.class(classes.root);
expect(chip).to.have.class(classes.colorDefault);
expect(chip).not.to.have.class(classes.colorPrimary);
expect(chip).not.to.have.class(classes.colorSecondary);
expect(chip).not.to.have.class(classes.clickable);
Expand Down
3 changes: 3 additions & 0 deletions packages/mui-material/src/Chip/chipClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export interface ChipClasses {
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"`. */
Expand Down Expand Up @@ -156,6 +158,7 @@ const chipClasses: ChipClasses = generateUtilityClasses('MuiChip', [
'root',
'sizeSmall',
'sizeMedium',
'colorDefault',
'colorError',
'colorInfo',
'colorPrimary',
Expand Down

0 comments on commit 7bc7de6

Please sign in to comment.