From 7bc7de6cb4daa77508bc9904cccc3bbc2feb687d Mon Sep 17 00:00:00 2001
From: sai chand <60743144+sai6855@users.noreply.github.com>
Date: Thu, 2 May 2024 21:56:19 +0530
Subject: [PATCH] [material-ui][Chip] Add colorDefault class to chipClasses
(#42067)
---
docs/pages/material-ui/api/chip.json | 6 ++++++
docs/translations/api-docs/chip/chip.json | 5 +++++
packages/mui-material/src/Chip/Chip.test.js | 1 +
packages/mui-material/src/Chip/chipClasses.ts | 3 +++
4 files changed, 15 insertions(+)
diff --git a/docs/pages/material-ui/api/chip.json b/docs/pages/material-ui/api/chip.json
index 1d3b02d127913a..1854ff2494185f 100644
--- a/docs/pages/material-ui/api/chip.json
+++ b/docs/pages/material-ui/api/chip.json
@@ -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",
diff --git a/docs/translations/api-docs/chip/chip.json b/docs/translations/api-docs/chip/chip.json
index fddc50bdb23a05..719f2b5e502068 100644
--- a/docs/translations/api-docs/chip/chip.json
+++ b/docs/translations/api-docs/chip/chip.json
@@ -79,6 +79,11 @@
"conditions": "onClick
and color=\"secondary\"
is defined or clickable={true}
",
"deprecationInfo": "Combine the .MuiChip-clickable and .MuiChip-colorSecondary classes instead. How to migrate"
},
+ "colorDefault": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the root element",
+ "conditions": "color=\"default\"
"
+ },
"colorError": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the root element",
diff --git a/packages/mui-material/src/Chip/Chip.test.js b/packages/mui-material/src/Chip/Chip.test.js
index 9cf98ce15f5986..6af617103ddb7d 100644
--- a/packages/mui-material/src/Chip/Chip.test.js
+++ b/packages/mui-material/src/Chip/Chip.test.js
@@ -54,6 +54,7 @@ describe('', () => {
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);
diff --git a/packages/mui-material/src/Chip/chipClasses.ts b/packages/mui-material/src/Chip/chipClasses.ts
index 48efe3fbe3cea6..881ffd4ab22a61 100644
--- a/packages/mui-material/src/Chip/chipClasses.ts
+++ b/packages/mui-material/src/Chip/chipClasses.ts
@@ -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"`. */
@@ -156,6 +158,7 @@ const chipClasses: ChipClasses = generateUtilityClasses('MuiChip', [
'root',
'sizeSmall',
'sizeMedium',
+ 'colorDefault',
'colorError',
'colorInfo',
'colorPrimary',