From cb590e471cdd8f742b7f05d8e93527269aa93762 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 22:01:48 +0530 Subject: [PATCH] [material-ui][ToggleButtonGroup] Add missing `selected` class in ToggleButtonGroupClasses type (@tarunrajput) (#42250) Co-authored-by: Tarun Chauhan Co-authored-by: ZeeshanTamboli --- docs/pages/material-ui/api/toggle-button-group.json | 12 ++++++++++++ .../toggle-button-group/toggle-button-group.json | 10 ++++++++++ .../ToggleButtonGroup/toggleButtonGroupClasses.ts | 5 +++++ 3 files changed, 27 insertions(+) diff --git a/docs/pages/material-ui/api/toggle-button-group.json b/docs/pages/material-ui/api/toggle-button-group.json index e3d1c10eefb45c..add23c498c045e 100644 --- a/docs/pages/material-ui/api/toggle-button-group.json +++ b/docs/pages/material-ui/api/toggle-button-group.json @@ -81,6 +81,12 @@ "description": "Styles applied to the children if `orientation=\"vertical\"`.", "isGlobal": false }, + { + "key": "horizontal", + "className": "MuiToggleButtonGroup-horizontal", + "description": "Styles applied to the root element if `orientation=\"horizontal\"`.", + "isGlobal": false + }, { "key": "lastButton", "className": "MuiToggleButtonGroup-lastButton", @@ -99,6 +105,12 @@ "description": "Styles applied to the root element.", "isGlobal": false }, + { + "key": "selected", + "className": "Mui-selected", + "description": "State class applied to the root element if `selected={true}`.", + "isGlobal": true + }, { "key": "vertical", "className": "MuiToggleButtonGroup-vertical", diff --git a/docs/translations/api-docs/toggle-button-group/toggle-button-group.json b/docs/translations/api-docs/toggle-button-group/toggle-button-group.json index 21eccbcd92b660..3e9c41ea144f5f 100644 --- a/docs/translations/api-docs/toggle-button-group/toggle-button-group.json +++ b/docs/translations/api-docs/toggle-button-group/toggle-button-group.json @@ -57,6 +57,11 @@ "nodeName": "the children", "conditions": "orientation=\"vertical\"" }, + "horizontal": { + "description": "Styles applied to {{nodeName}} if {{conditions}}.", + "nodeName": "the root element", + "conditions": "orientation=\"horizontal\"" + }, "lastButton": { "description": "Styles applied to {{nodeName}}.", "nodeName": "the last button in the toggle button group" @@ -66,6 +71,11 @@ "nodeName": "buttons in the middle of the toggle button group" }, "root": { "description": "Styles applied to the root element." }, + "selected": { + "description": "State class applied to {{nodeName}} if {{conditions}}.", + "nodeName": "the root element", + "conditions": "selected={true}" + }, "vertical": { "description": "Styles applied to {{nodeName}} if {{conditions}}.", "nodeName": "the root element", diff --git a/packages/mui-material/src/ToggleButtonGroup/toggleButtonGroupClasses.ts b/packages/mui-material/src/ToggleButtonGroup/toggleButtonGroupClasses.ts index 75cf854a4d59fc..9cb2f1cc7958a5 100644 --- a/packages/mui-material/src/ToggleButtonGroup/toggleButtonGroupClasses.ts +++ b/packages/mui-material/src/ToggleButtonGroup/toggleButtonGroupClasses.ts @@ -4,6 +4,10 @@ import generateUtilityClass from '@mui/utils/generateUtilityClass'; export interface ToggleButtonGroupClasses { /** Styles applied to the root element. */ root: string; + /** State class applied to the root element if `selected={true}`. */ + selected: string; + /** Styles applied to the root element if `orientation="horizontal"`. */ + horizontal: string; /** Styles applied to the root element if `orientation="vertical"`. */ vertical: string; /** State class applied to the root element if `disabled={true}`. */ @@ -35,6 +39,7 @@ const toggleButtonGroupClasses: ToggleButtonGroupClasses = generateUtilityClasse [ 'root', 'selected', + 'horizontal', 'vertical', 'disabled', 'grouped',