diff --git a/docs/reference/generated/collapsible-trigger.json b/docs/reference/generated/collapsible-trigger.json index 656831b1a2..e106198972 100644 --- a/docs/reference/generated/collapsible-trigger.json +++ b/docs/reference/generated/collapsible-trigger.json @@ -10,5 +10,10 @@ "type": "React.ReactElement | (props, state) => React.ReactElement", "description": "A function to customize rendering of the component." } + }, + "dataAttributes": { + "data-panel-open": { + "description": "Present when the collapsible panel is open." + } } } diff --git a/docs/reference/generated/dialog-backdrop.json b/docs/reference/generated/dialog-backdrop.json index cdc89ae2ed..89e4bb0225 100644 --- a/docs/reference/generated/dialog-backdrop.json +++ b/docs/reference/generated/dialog-backdrop.json @@ -16,17 +16,17 @@ "description": "A function to customize rendering of the component." } }, - "attributes": { - "[data-open]": { + "dataAttributes": { + "data-open": { "description": "Present when the dialog is open." }, - "[data-closed]": { + "data-closed": { "description": "Present when the dialog is closed." }, - "[data-starting-style]": { + "data-starting-style": { "description": "Present when the dialog is animating in." }, - "[data-ending-style]": { + "data-ending-style": { "description": "Present when the dialog is animating out." } } diff --git a/docs/reference/generated/dialog-popup.json b/docs/reference/generated/dialog-popup.json index 0a8c107fc3..a95ab9f2d8 100644 --- a/docs/reference/generated/dialog-popup.json +++ b/docs/reference/generated/dialog-popup.json @@ -24,23 +24,23 @@ "description": "A function to customize rendering of the component." } }, - "attributes": { - "[data-open]": { + "dataAttributes": { + "data-open": { "description": "Present when the dialog is open." }, - "[data-closed]": { + "data-closed": { "description": "Present when the dialog is closed." }, - "[data-starting-style]": { + "data-starting-style": { "description": "Present when the dialog is animating in." }, - "[data-ending-style]": { + "data-ending-style": { "description": "Present when the dialog is animating out." }, - "[data-modal]": { + "data-modal": { "description": "Present when the dialog is modal." }, - "[data-nested-dialogs]": { + "data-nested-dialogs": { "type": "number", "description": "Indicates how many dialogs are nested within." } diff --git a/docs/reference/generated/dialog-trigger.json b/docs/reference/generated/dialog-trigger.json index c6c0cbdcd4..c1a51ac555 100644 --- a/docs/reference/generated/dialog-trigger.json +++ b/docs/reference/generated/dialog-trigger.json @@ -11,11 +11,11 @@ "description": "A function to customize rendering of the component." } }, - "attributes": { - "[data-modal]": { + "dataAttributes": { + "data-modal": { "description": "Present when the corresponding dialog is modal." }, - "[data-popup-open]": { + "data-popup-open": { "description": "Present when the corresponding dialog is open." } } diff --git a/docs/reference/overrides/dialog-backdrop.json b/docs/reference/overrides/dialog-backdrop.json index adc608486c..02ba5fd7f9 100644 --- a/docs/reference/overrides/dialog-backdrop.json +++ b/docs/reference/overrides/dialog-backdrop.json @@ -1,16 +1,16 @@ { "name": "DialogBackdrop", - "attributes": { - "[data-open]": { + "dataAttributes": { + "data-open": { "description": "Present when the dialog is open." }, - "[data-closed]": { + "data-closed": { "description": "Present when the dialog is closed." }, - "[data-starting-style]": { + "data-starting-style": { "description": "Present when the dialog is animating in." }, - "[data-ending-style]": { + "data-ending-style": { "description": "Present when the dialog is animating out." } } diff --git a/docs/reference/overrides/dialog-popup.json b/docs/reference/overrides/dialog-popup.json index 07bc9b8ee3..554bfac9c2 100644 --- a/docs/reference/overrides/dialog-popup.json +++ b/docs/reference/overrides/dialog-popup.json @@ -1,22 +1,22 @@ { "name": "DialogPopup", - "attributes": { - "[data-open]": { + "dataAttributes": { + "data-open": { "description": "Present when the dialog is open." }, - "[data-closed]": { + "data-closed": { "description": "Present when the dialog is closed." }, - "[data-starting-style]": { + "data-starting-style": { "description": "Present when the dialog is animating in." }, - "[data-ending-style]": { + "data-ending-style": { "description": "Present when the dialog is animating out." }, - "[data-modal]": { + "data-modal": { "description": "Present when the dialog is modal." }, - "[data-nested-dialogs]": { + "data-nested-dialogs": { "type": "number", "description": "Indicates how many dialogs are nested within." } diff --git a/docs/reference/overrides/dialog-trigger.json b/docs/reference/overrides/dialog-trigger.json index abb5b363f8..d2b03c1ddc 100644 --- a/docs/reference/overrides/dialog-trigger.json +++ b/docs/reference/overrides/dialog-trigger.json @@ -1,10 +1,10 @@ { "name": "DialogTrigger", - "attributes": { - "[data-modal]": { + "dataAttributes": { + "data-modal": { "description": "Present when the corresponding dialog is modal." }, - "[data-popup-open]": { + "data-popup-open": { "description": "Present when the corresponding dialog is open." } } diff --git a/docs/src/components/reference/rehypeReference.mjs b/docs/src/components/reference/rehypeReference.mjs index 904e7df3c4..a799eef7de 100644 --- a/docs/src/components/reference/rehypeReference.mjs +++ b/docs/src/components/reference/rehypeReference.mjs @@ -104,11 +104,11 @@ export function rehypeReference() { }), ); - if (def.attributes) { + if (def.dataAttributes) { subtree.push( createMdxElement({ name: ATTRIBUTES_TABLE, - props: { data: def.attributes }, + props: { data: def.dataAttributes }, }), ); } diff --git a/docs/src/components/reference/types.ts b/docs/src/components/reference/types.ts index d3937f208e..4510f4629a 100644 --- a/docs/src/components/reference/types.ts +++ b/docs/src/components/reference/types.ts @@ -2,7 +2,7 @@ export interface ComponentDef { name: string; description?: string; props: Record; - attributes?: Record; + dataAttributes?: Record; cssVariables?: Record; } diff --git a/package.json b/package.json index 6245d8539f..212495e911 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "@mui/internal-markdown": "^1.0.22", "@mui/internal-scripts": "^1.0.29", "@mui/internal-test-utils": "https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils", - "@mui/monorepo": "github:mui/material-ui#817470c5a7c2ae721401e308b961005730cdf2ab", + "@mui/monorepo": "github:mui/material-ui#v6.2.0", "@next/eslint-plugin-next": "^14.2.18", "@octokit/rest": "^20.1.1", "@playwright/test": "1.49.0", diff --git a/packages/react/src/collapsible/trigger/CollapsibleTriggerDataAttributes.ts b/packages/react/src/collapsible/trigger/CollapsibleTriggerDataAttributes.ts new file mode 100644 index 0000000000..d29498678e --- /dev/null +++ b/packages/react/src/collapsible/trigger/CollapsibleTriggerDataAttributes.ts @@ -0,0 +1,6 @@ +export enum CollapsibleTriggerDataAttributes { + /** + * Present when the collapsible panel is open. + */ + panelOpen = 'data-panel-open', +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2c88955f39..0657e0d237 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,8 +63,8 @@ importers: specifier: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils version: https://pkg.csb.dev/mui/material-ui/commit/92c23999/@mui/internal-test-utils(@babel/core@7.26.0)(react-dom@19.0.0-rc-fb9a90fa48-20240614(react@19.0.0-rc-fb9a90fa48-20240614))(react@19.0.0-rc-fb9a90fa48-20240614)(types-react-dom@19.0.0-rc.1)(types-react@19.0.0-rc.1) '@mui/monorepo': - specifier: github:mui/material-ui#817470c5a7c2ae721401e308b961005730cdf2ab - version: https://codeload.github.com/mui/material-ui/tar.gz/817470c5a7c2ae721401e308b961005730cdf2ab(encoding@0.1.13) + specifier: github:mui/material-ui#v6.2.0 + version: https://codeload.github.com/mui/material-ui/tar.gz/564be143f8ecf0afa12d2ca8c4873d5296b4f5c1(encoding@0.1.13) '@next/eslint-plugin-next': specifier: ^14.2.18 version: 14.2.18 @@ -2150,9 +2150,9 @@ packages: react: ^18.2.0 react-dom: ^18.2.0 - '@mui/monorepo@https://codeload.github.com/mui/material-ui/tar.gz/817470c5a7c2ae721401e308b961005730cdf2ab': - resolution: {tarball: https://codeload.github.com/mui/material-ui/tar.gz/817470c5a7c2ae721401e308b961005730cdf2ab} - version: 6.1.10 + '@mui/monorepo@https://codeload.github.com/mui/material-ui/tar.gz/564be143f8ecf0afa12d2ca8c4873d5296b4f5c1': + resolution: {tarball: https://codeload.github.com/mui/material-ui/tar.gz/564be143f8ecf0afa12d2ca8c4873d5296b4f5c1} + version: 6.2.0 engines: {pnpm: 9.14.4} '@mui/private-theming@6.1.10': @@ -11293,7 +11293,7 @@ snapshots: - supports-color - utf-8-validate - '@mui/monorepo@https://codeload.github.com/mui/material-ui/tar.gz/817470c5a7c2ae721401e308b961005730cdf2ab(encoding@0.1.13)': + '@mui/monorepo@https://codeload.github.com/mui/material-ui/tar.gz/564be143f8ecf0afa12d2ca8c4873d5296b4f5c1(encoding@0.1.13)': dependencies: '@googleapis/sheets': 9.3.1(encoding@0.1.13) '@netlify/functions': 2.8.2 diff --git a/scripts/buildApiDocs/buildReference.ts b/scripts/buildApiDocs/buildReference.ts index 757ad4e702..ae5e215cad 100644 --- a/scripts/buildApiDocs/buildReference.ts +++ b/scripts/buildApiDocs/buildReference.ts @@ -81,9 +81,12 @@ export async function buildReference() { console.warn(`Missing component description: ${componentData.name}`); } - const attributes = componentOverrides?.attributes; + const dataAttributes = + !!componentData?.dataAttributes || !!componentOverrides?.dataAttributes + ? { ...componentData?.dataAttributes, ...componentOverrides?.dataAttributes } + : undefined; const cssVariables = - !!componentData?.cssVariables || componentOverrides?.cssVariables + !!componentData?.cssVariables || !!componentOverrides?.cssVariables ? { ...componentData?.cssVariables, ...componentOverrides?.cssVariables } : undefined; @@ -91,7 +94,7 @@ export async function buildReference() { name: componentData.name, description: descriptionData.componentDescription, props, - attributes, + dataAttributes, cssVariables, };