Um modo de visualização em árvore apresentando uma lista hierárquica.
-
-As visualizações em árvore podem ser usadas para representar um navegação no sistema de arquivos para exibir pastas e arquivos, um item representando uma pasta pode ser expandido para revelar o conteúdo da pasta, que pode ser arquivos, pastas ou ambos.
-
-{{"component": "modules/components/ComponentLinkHeader.js"}}
-
-## Modo básico de visualização em árvore
-
-{{"demo": "FileSystemNavigator.js"}}
-
-## Seleção múltipla
-
-Visualizações de árvore também suportam seleção múltipla.
-
-{{"demo": "MultiSelectTreeView.js"}}
-
-## Visualização em árvore controlada
-
-A visualização em árvore também oferece uma API para controle.
-
-{{"demo": "ControlledTreeView.js"}}
-
-## Objeto complexo
-
-Enquanto o componente `TreeView`/`TreeItem` maximiza a flexibilidade, um passo extra é necessário para lidar com um objetos complexos.
-
-Vamos considerar uma variável de dados com a seguinte estrutura, a recursão pode ser usada para lidar com este cenário.
-
-```js
-const data = {
- id: 'root',
- name: 'Parent',
- children: [
- {
- id: '1',
- name: 'Child - 1',
- },
- // …
- ],
-};
-```
-
-{{"demo": "RichObjectTreeView.js", "defaultCodeOpen": false}}
-
-## Propriedade ContentComponent
-
-Você pode usar a propriedade `ContentComponent` e o hook `useTreeItem` para customizar ainda mais o comportamento do TreeItem.
-
-Como limitar a expansão para clicar no ícone:
-
-{{"demo": "IconExpansionTreeView.js", "defaultCodeOpen": false}}
-
-Ou aumentando a largura do indicador de estado:
-
-{{"demo": "BarTreeView.js", "defaultCodeOpen": false}}
-
-## Visualização em árvore customizada
-
-### Ícones customizados, borda e animação
-
-{{"demo": "CustomizedTreeView.js"}}
-
-### Clone do Gmail
-
-{{"demo": "GmailTreeView.js"}}
-
-## Itens desabilitados na árvore
-
-{{"demo": "DisabledTreeItems.js"}}
-
-O comportamento dos itens desabilitados da árvore depende da propriedade `disabledItemsFocusable`.
-
-Se é falsa:
-
-- As teclas de setas não focarão nos itens desabilitados e o próximo item não desabilitado será focado.
-- Digitar o primeiro caractere do rótulo de um item desabilitado não focará no item.
-- Interação do mouse ou teclado não irá expandir/recolher itens desabilitados.
-- Interação do mouse ou teclado não selecionará itens desabilitados.
-- Shift + teclas de setas irão pular itens desabilitados e o próximo item não desabilitado será selecionado.
-- Foco programático não focará itens desabilitados.
-
-Se é verdadeira:
-
-- As teclas de setas focarão em itens desabilitados.
-- Digitar o primeiro caractere do rótulo de um item desabilitado focará no item.
-- Interação do mouse ou teclado não irá expandir/recolher itens desabilitados.
-- Interação do mouse ou teclado não selecionará itens desabilitados.
-- Shift + teclas de setas não irão pular itens desabilitados, mas o item desabilitado não será selecionado.
-- Foco programático focará itens desabilitados.
-
-## Acessibilidade
-
-(WAI-ARIA: https://www.w3.org/WAI/ARIA/apg/patterns/treeview/)
-
-O componente segue as práticas de autoria da WAI-ARIA.
-
-Para ter uma exibição em árvore acessível, você deve usar `aria-labelledby` ou `aria-label` para fazer referência ou fornecer um rótulo na TreeView, caso contrário, os leitores de tela irão anunciá-lo como "tree", tornando difícil entender o contexto de um item específico da árvore.
diff --git a/docs/data/material/components/tree-view/tree-view-zh.md b/docs/data/material/components/tree-view/tree-view-zh.md
deleted file mode 100644
index b4476986a8958e..00000000000000
--- a/docs/data/material/components/tree-view/tree-view-zh.md
+++ /dev/null
@@ -1,108 +0,0 @@
----
-productId: material-ui
-title: Tree view React component
-components: TreeView, TreeItem
-githubLabel: 'component: tree view'
-waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/treeview/
-packageName: '@mui/lab'
----
-
-# Tree view
-
-
-
-Tree views can be used to represent a file system navigator displaying folders and files, an item representing a folder can be expanded to reveal the contents of the folder, which may be files, folders, or both.
-
-{{"component": "modules/components/ComponentLinkHeader.js"}}
-
-## Basic tree view
-
-{{"demo": "FileSystemNavigator.js"}}
-
-## Multi-selection
-
-Tree views also support multi-selection.
-
-{{"demo": "MultiSelectTreeView.js"}}
-
-## Controlled tree view
-
-The tree view also offers a controlled API.
-
-:::info
-
-- A component is **controlled** when it's managed by its parent using props.
-- A component is **uncontrolled** when it's managed by its own local state.
-
-Learn more about controlled and uncontrolled components in the [React documentation](https://react.dev/learn/sharing-state-between-components#controlled-and-uncontrolled-components).
-:::
-
-{{"demo": "ControlledTreeView.js"}}
-
-## Rich object
-
-While the `TreeView`/`TreeItem` component API maximizes flexibility, an extra step is needed to handle a rich object.
-
-Let's consider a data variable with the following shape, recursion can be used to handle it.
-
-```js
-const data = {
- id: 'root',
- name: 'Parent',
- children: [
- {
- id: '1',
- name: 'Child - 1',
- },
- // …
- ],
-};
-```
-
-{{"demo": "RichObjectTreeView.js", "defaultCodeOpen": false}}
-
-## ContentComponent prop
-
-You can use the `ContentComponent` prop and the `useTreeItem` hook to further customize the behavior of the TreeItem.
-
-Such as limiting expansion to clicking the icon:
-
-{{"demo": "IconExpansionTreeView.js", "defaultCodeOpen": false}}
-
-Or increasing the width of the state indicator:
-
-{{"demo": "BarTreeView.js", "defaultCodeOpen": false}}
-
-## Customization
-
-### Custom icons, border and animation
-
-{{"demo": "CustomizedTreeView.js"}}
-
-### Gmail clone
-
-{{"demo": "GmailTreeView.js"}}
-
-## Disabled tree items
-
-{{"demo": "DisabledTreeItems.js"}}
-
-The behavior of disabled tree items depends on the `disabledItemsFocusable` prop.
-
-If it is false:
-
-- Arrow keys will not focus disabled items and, the next non-disabled item will be focused.
-- Typing the first character of a disabled item's label will not focus the item.
-- Mouse or keyboard interaction will not expand/collapse disabled items.
-- Mouse or keyboard interaction will not select disabled items.
-- Shift + arrow keys will skip disabled items and, the next non-disabled item will be selected.
-- Programmatic focus will not focus disabled items.
-
-If it is true:
-
-- Arrow keys will focus disabled items.
-- Typing the first character of a disabled item's label will focus the item.
-- Mouse or keyboard interaction will not expand/collapse disabled items.
-- Mouse or keyboard interaction will not select disabled items.
-- Shift + arrow keys will not skip disabled items but, the disabled item will not be selected.
-- Programmatic focus will focus disabled items.
-
-## Accessibility
-
-(WAI-ARIA: https://www.w3.org/WAI/ARIA/apg/patterns/treeview/)
-
-The component follows the WAI-ARIA authoring practices.
-
-To have an accessible tree view you must use `aria-labelledby` or `aria-label` to reference or provide a label on the TreeView, otherwise screen readers will announce it as "tree", making it hard to understand the context of a specific tree item.
diff --git a/docs/data/material/discover-more/roadmap/roadmap.md b/docs/data/material/discover-more/roadmap/roadmap.md
index c76592406b4b3f..848a559fe16ff4 100644
--- a/docs/data/material/discover-more/roadmap/roadmap.md
+++ b/docs/data/material/discover-more/roadmap/roadmap.md
@@ -47,41 +47,41 @@ Here are the components we will work on being supported in the MUI ecosystem:
- 🛠 Work in progress, will be or already released as unstable
- ⏳ Planning to build
-| Name | Product | Status |
-| :----------------------------------------------------------------------- | :------- | :----- |
-| Advanced Layout | MUI X | ⏳ |
-| Carousel | MUI X | ⏳ |
-| [Charts](https://mui.com/x/react-charts/) | MUI X | 🧪 |
-| [Data Grid](/x/react-data-grid/) | MUI X | ✅ |
-| [Date Picker](/x/react-date-pickers/date-picker/) | MUI X | ✅ |
-| [Time Picker](/x/react-date-pickers/time-picker/) | MUI X | ✅ |
-| [Date Time Picker](/x/react-date-pickers/date-time-picker/) | MUI X | ✅ |
-| [Date Range Picker](/x/react-date-pickers/date-range-picker/) | MUI X | ✅ |
-| Time Range Picker | MUI X | ⏳ |
-| Date Time Range Picker | MUI X | ⏳ |
-| Dropdown | MUI Core | ⏳ |
-| Dropzone | MUI X | ⏳ |
-| File Upload | MUI X | ⏳ |
-| Gantt Chart | MUI X | ⏳ |
-| Gauge | MUI X | ⏳ |
-| Image | MUI Core | ⏳ |
-| [Masonry](/material-ui/react-masonry/) | MUI Core | 🧪 |
-| Navbar | MUI Core | ⏳ |
-| Nested Menu | MUI X | ⏳ |
-| NProgress | MUI Core | ⏳ |
-| Numeric Input | MUI Core | ⏳ |
-| Rich Text Editor | MUI X | ⏳ |
-| Scheduler | MUI X | ⏳ |
-| Scrollspy | MUI Core | ⏳ |
-| Sparkline | MUI X | ⏳ |
-| [Timeline](/material-ui/react-timeline/) | MUI Core | 🧪 |
-| Tree select | MUI X | ⏳ |
-| [Tree View](/material-ui/react-tree-view/) | MUI X | 🧪 |
-| Tree View - Checkbox | MUI X | ⏳ |
-| Tree View - Drag & Drop | MUI X | ⏳ |
-| [Tree View - Multiselect](/material-ui/react-tree-view/#multi-selection) | MUI X | 🧪 |
-| Tree View - Virtualization | MUI X | ⏳ |
-| Window Splitter | MUI X | ⏳ |
+| Name | Product | Status |
+| :------------------------------------------------------------- | :------- | :----- |
+| Advanced Layout | MUI X | ⏳ |
+| Carousel | MUI X | ⏳ |
+| [Charts](https://mui.com/x/react-charts/) | MUI X | 🧪 |
+| [Data Grid](/x/react-data-grid/) | MUI X | ✅ |
+| [Date Picker](/x/react-date-pickers/date-picker/) | MUI X | ✅ |
+| [Time Picker](/x/react-date-pickers/time-picker/) | MUI X | ✅ |
+| [Date Time Picker](/x/react-date-pickers/date-time-picker/) | MUI X | ✅ |
+| [Date Range Picker](/x/react-date-pickers/date-range-picker/) | MUI X | ✅ |
+| Time Range Picker | MUI X | ⏳ |
+| Date Time Range Picker | MUI X | ⏳ |
+| Dropdown | MUI Core | ⏳ |
+| Dropzone | MUI X | ⏳ |
+| File Upload | MUI X | ⏳ |
+| Gantt Chart | MUI X | ⏳ |
+| Gauge | MUI X | ⏳ |
+| Image | MUI Core | ⏳ |
+| [Masonry](/material-ui/react-masonry/) | MUI Core | 🧪 |
+| Navbar | MUI Core | ⏳ |
+| Nested Menu | MUI X | ⏳ |
+| NProgress | MUI Core | ⏳ |
+| Numeric Input | MUI Core | ⏳ |
+| Rich Text Editor | MUI X | ⏳ |
+| Scheduler | MUI X | ⏳ |
+| Scrollspy | MUI Core | ⏳ |
+| Sparkline | MUI X | ⏳ |
+| [Timeline](/material-ui/react-timeline/) | MUI Core | 🧪 |
+| Tree select | MUI X | ⏳ |
+| [Tree View](/x/react-tree-view/) | MUI X | 🧪 |
+| Tree View - Checkbox | MUI X | ⏳ |
+| Tree View - Drag & Drop | MUI X | ⏳ |
+| [Tree View - Multiselect](/x/react-tree-view/#multi-selection) | MUI X | 🧪 |
+| Tree View - Virtualization | MUI X | ⏳ |
+| Window Splitter | MUI X | ⏳ |
:::warning
**Disclaimer**: We operate in a dynamic environment, and things are subject to change. The information provided is intended to outline the general framework direction, for informational purposes only. We may decide to add or remove new items at any time, depending on our capability to deliver while meeting our quality standards. The development, releases, and timing of any features or functionality remains at the sole discretion of MUI. The roadmap does not represent a commitment, obligation, or promise to deliver at any time.
diff --git a/docs/data/material/getting-started/learn/learn.md b/docs/data/material/getting-started/learn/learn.md
index 1fc95b4d07a237..d262f3d9e6d8f4 100644
--- a/docs/data/material/getting-started/learn/learn.md
+++ b/docs/data/material/getting-started/learn/learn.md
@@ -4,20 +4,10 @@
## Your first component
-The following code snippet demonstrates a basic Material UI app that features a `` component:
+The following demo shows a basic Material UI app that features a `` component.
+Try changing the `variant` on the [Button](/material-ui/react-button/) to `outlined` to see how the style changes:
-```jsx
-import * as React from 'react';
-import Button from '@mui/material/Button';
-
-function App() {
- return Hello World;
-}
-```
-
-In the interactive demo below, try changing the code and see how it affects the output. (Hint: change `variant` to `"outlined"` and `color` to `"secondary"`. For more options, see the [`Button` component page](/material-ui/react-button/).)
-
-{{"demo": "../usage/Usage.js", "hideToolbar": true, "bg": true}}
+{{"demo": "../usage/ButtonUsage.js", "defaultCodeOpen": true}}
## Example projects
diff --git a/docs/data/material/getting-started/supported-components/MaterialUIComponents.js b/docs/data/material/getting-started/supported-components/MaterialUIComponents.js
index 43e3ab9c5a988a..3c9465a407ecea 100644
--- a/docs/data/material/getting-started/supported-components/MaterialUIComponents.js
+++ b/docs/data/material/getting-started/supported-components/MaterialUIComponents.js
@@ -194,7 +194,7 @@ const components = [
materialDesign: 'https://m2.material.io/components/tooltips',
},
{ name: 'Transfer List', materialUI: '/material-ui/react-transfer-list/' },
- { name: 'Tree View', materialUI: '/material-ui/react-tree-view/' },
+ { name: 'Tree View', materialUI: '/x/react-tree-view/' },
{
name: 'Typography',
materialUI: '/material-ui/react-typography/',
diff --git a/docs/data/material/getting-started/usage/Usage.js b/docs/data/material/getting-started/usage/Usage.js
deleted file mode 100644
index 8d0f199556feee..00000000000000
--- a/docs/data/material/getting-started/usage/Usage.js
+++ /dev/null
@@ -1,16 +0,0 @@
-import * as React from 'react';
-
-export default function Usage() {
- return (
-
- );
-}
diff --git a/docs/data/material/guides/interoperability/interoperability-pt.md b/docs/data/material/guides/interoperability/interoperability-pt.md
index b7049cf7b744a3..6c93cf1de96afa 100644
--- a/docs/data/material/guides/interoperability/interoperability-pt.md
+++ b/docs/data/material/guides/interoperability/interoperability-pt.md
@@ -861,6 +861,6 @@ There is [an ESLint plugin](https://docs.tss-react.dev/detecting-unused-classes)
:::
:::warning
-For [Storybook](https://storybook.js.org): At the time of this writing, Storybook still uses Emotion 10 by default.
+For [Storybook](https://storybook.js.org): At the time of this writing, Storybook still uses Emotion 10 by default.
Material UI and TSS use Emotion 11, so you must make [some changes](https://github.com/InseeFrLab/onyxia-ui/blob/324de62248074582b227e584c53fb2e123f5325f/.storybook/main.js#L31-L32) to `.storybook/main.js` in order to use Storybook with Material UI.
:::
diff --git a/docs/data/material/guides/interoperability/interoperability-zh.md b/docs/data/material/guides/interoperability/interoperability-zh.md
index 74d8dccb415c6d..2e4a50485eb227 100644
--- a/docs/data/material/guides/interoperability/interoperability-zh.md
+++ b/docs/data/material/guides/interoperability/interoperability-zh.md
@@ -855,6 +855,6 @@ There is [an ESLint plugin](https://docs.tss-react.dev/detecting-unused-classes)
:::
:::warning
-For [Storybook](https://storybook.js.org): At the time of this writing, Storybook still uses Emotion 10 by default.
+For [Storybook](https://storybook.js.org): At the time of this writing, Storybook still uses Emotion 10 by default.
Material UI and TSS use Emotion 11, so you must make [some changes](https://github.com/InseeFrLab/onyxia-ui/blob/324de62248074582b227e584c53fb2e123f5325f/.storybook/main.js#L31-L32) to `.storybook/main.js` in order to use Storybook with Material UI.
:::
diff --git a/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size-pt.md b/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size-pt.md
index 5e30e68f7368ff..306ecfd30497c1 100644
--- a/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size-pt.md
+++ b/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size-pt.md
@@ -206,7 +206,7 @@ Finalmente, você pode converter sua base de código existente com esse [codemod
The package published on npm is **transpiled**, with [Babel](https://github.com/babel/babel), to take into account the [supported platforms](/material-ui/getting-started/supported-platforms/).
-⚠️ Para minimizar a duplicação de código nos pacotes de usuários, autores de biblioteca são **fortemente desencorajados** a importar de qualquer um dos outros pacotes. Otherwise it's not guaranteed that dependencies used also use legacy or modern bundles. Instead, use these bundles at the bundler level with e.g [Webpack's `resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias):
+⚠️ Para minimizar a duplicação de código nos pacotes de usuários, autores de biblioteca são **fortemente desencorajados** a importar de qualquer um dos outros pacotes. Otherwise it's not guaranteed that dependencies used also use legacy or modern bundles. Instead, use these bundles at the bundler level with e.g. [Webpack's `resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias):
```js
{
diff --git a/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size-zh.md b/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size-zh.md
index 974981f086463b..5b90347af78206 100644
--- a/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size-zh.md
+++ b/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size-zh.md
@@ -206,7 +206,7 @@ module.exports = override(useBabelRc());
The package published on npm is **transpiled**, with [Babel](https://github.com/babel/babel), to take into account the [supported platforms](/material-ui/getting-started/supported-platforms/).
-⚠️ 为了尽量减少用户捆绑包中的重复代码,库作者 **非常不鼓励** 从任何其他捆绑包中导入。 Otherwise it's not guaranteed that dependencies used also use legacy or modern bundles. Otherwise it's not guaranteed that dependencies used also use legacy or modern bundles. Instead, use these bundles at the bundler level with e.g [Webpack's `resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias):
+⚠️ 为了尽量减少用户捆绑包中的重复代码,库作者 **非常不鼓励** 从任何其他捆绑包中导入。 Otherwise it's not guaranteed that dependencies used also use legacy or modern bundles. Otherwise it's not guaranteed that dependencies used also use legacy or modern bundles. Instead, use these bundles at the bundler level with e.g. [Webpack's `resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias):
```js
{
diff --git a/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size.md b/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size.md
index bdc3eda53d8b5e..6fc64b54b7549c 100644
--- a/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size.md
+++ b/docs/data/material/guides/minimizing-bundle-size/minimizing-bundle-size.md
@@ -213,7 +213,7 @@ The package published on npm is **transpiled**, with [Babel](https://github.com/
⚠️ Developers are **strongly discouraged** to import from any of the other bundles directly.
Otherwise it's not guaranteed that dependencies used also use legacy or modern bundles.
-Instead, use these bundles at the bundler level with e.g [Webpack's `resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias):
+Instead, use these bundles at the bundler level with e.g. [Webpack's `resolve.alias`](https://webpack.js.org/configuration/resolve/#resolvealias):
```js
{
diff --git a/docs/data/material/guides/next-js-app-router/next-js-app-router.md b/docs/data/material/guides/next-js-app-router/next-js-app-router.md
index c4771423e0d8d0..83c10c030dfd2e 100644
--- a/docs/data/material/guides/next-js-app-router/next-js-app-router.md
+++ b/docs/data/material/guides/next-js-app-router/next-js-app-router.md
@@ -178,7 +178,7 @@ Currently, `prepend` does not work reliably with the App Router, but you can wor
## Function props
-Props passed from Server Components—for example `page.js` or other routing files—must be [serializable](https://nextjs.org/docs/getting-started/react-essentials#passing-props-from-server-to-client-components-serialization).
+Props passed from Server Components—for example `page.js` or other routing files—must be [serializable](https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#passing-props-from-server-to-client-components-serialization).
This works without any additional directives:
@@ -227,5 +227,5 @@ export default function Page() {
}
```
-Instead, the Next.js team recommend moving components like these ["to the leaves"](https://nextjs.org/docs/getting-started/react-essentials#moving-client-components-to-the-leaves) to avoid this issue and improve overall performance.
+Instead, the Next.js team recommend moving components like these ["down the tree"](https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#moving-client-components-down-the-tree) to avoid this issue and improve overall performance.
:::
diff --git a/docs/data/material/guides/routing/routing.md b/docs/data/material/guides/routing/routing.md
index acf05f0c021e3a..4b3d4ed26859b7 100644
--- a/docs/data/material/guides/routing/routing.md
+++ b/docs/data/material/guides/routing/routing.md
@@ -101,7 +101,7 @@ const LinkBehavior = React.forwardRef((props, ref) => (
### Next.js Pages Router
-The [example folder](https://github.com/mui/material-ui/tree/HEAD/examples/material-ui-nextjs-ts) provides an adapter for the use of [Next.js's Link component](https://nextjs.org/docs/api-reference/next/link) with Material UI.
+The [example folder](https://github.com/mui/material-ui/tree/HEAD/examples/material-ui-nextjs-pages-router-ts) provides an adapter for the use of [Next.js's Link component](https://nextjs.org/docs/api-reference/next/link) with Material UI.
- The first version of the adapter is the [`NextLinkComposed`](https://github.com/mui/material-ui/blob/-/examples/material-ui-nextjs-pages-router-ts/src/Link.tsx) component.
This component is unstyled and only responsible for handling the navigation.
diff --git a/docs/data/material/pages.ts b/docs/data/material/pages.ts
index cf8f0003a89ccf..e046d612b8c7db 100644
--- a/docs/data/material/pages.ts
+++ b/docs/data/material/pages.ts
@@ -143,7 +143,6 @@ const pages: MuiPage[] = [
{ pathname: '/material-ui/about-the-lab', title: 'About the lab 🧪' },
{ pathname: '/material-ui/react-masonry' },
{ pathname: '/material-ui/react-timeline' },
- { pathname: '/material-ui/react-tree-view', title: 'Tree View' },
],
},
],
diff --git a/docs/data/material/pagesApi.js b/docs/data/material/pagesApi.js
index 4f1c9df177f38e..7bb6fe6df78aa8 100644
--- a/docs/data/material/pagesApi.js
+++ b/docs/data/material/pagesApi.js
@@ -133,8 +133,6 @@ module.exports = [
{ pathname: '/material-ui/api/toggle-button-group' },
{ pathname: '/material-ui/api/toolbar' },
{ pathname: '/material-ui/api/tooltip' },
- { pathname: '/material-ui/api/tree-item' },
- { pathname: '/material-ui/api/tree-view' },
{ pathname: '/material-ui/api/typography' },
{ pathname: '/material-ui/api/zoom' },
];
diff --git a/docs/next.config.js b/docs/next.config.js
index 985c81386d6019..69338cc64e730f 100644
--- a/docs/next.config.js
+++ b/docs/next.config.js
@@ -58,6 +58,7 @@ module.exports = withDocsInfra({
'@mui/x-date-pickers-pro',
'@mui/x-data-grid-generator',
'@mui/x-charts',
+ '@mui/x-tree-view',
'@mui/x-license-pro',
].some((dep) => request.startsWith(dep));
@@ -119,7 +120,7 @@ module.exports = withDocsInfra({
test: /\.(js|mjs|jsx)$/,
resourceQuery: { not: [/raw/] },
include:
- /node_modules(\/|\\)(notistack|@mui(\/|\\)x-data-grid|@mui(\/|\\)x-data-grid-pro|@mui(\/|\\)x-license-pro|@mui(\/|\\)x-data-grid-generator|@mui(\/|\\)x-date-pickers-pro|@mui(\/|\\)x-date-pickers|@mui(\/|\\)x-charts)/,
+ /node_modules(\/|\\)(notistack|@mui(\/|\\)x-data-grid|@mui(\/|\\)x-data-grid-pro|@mui(\/|\\)x-license-pro|@mui(\/|\\)x-data-grid-generator|@mui(\/|\\)x-date-pickers-pro|@mui(\/|\\)x-date-pickers|@mui(\/|\\)x-charts|@mui(\/|\\)x-tree-view)/,
use: {
loader: 'babel-loader',
options: {
diff --git a/docs/package.json b/docs/package.json
index 99cecd9321614b..767f02cb87d957 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -119,7 +119,8 @@
"stylis-plugin-rtl": "^2.1.1",
"stylis-plugin-rtl-sc": "npm:stylis-plugin-rtl@^1.1.0",
"webfontloader": "^1.6.28",
- "webpack-bundle-analyzer": "^4.9.0"
+ "webpack-bundle-analyzer": "^4.9.1",
+ "use-count-up": "^3.0.1"
},
"devDependencies": {
"@babel/plugin-transform-react-constant-elements": "^7.22.5",
diff --git a/docs/pages/_app.js b/docs/pages/_app.js
index 7b5e1dc3e84095..f1c3484eeb4eb8 100644
--- a/docs/pages/_app.js
+++ b/docs/pages/_app.js
@@ -359,13 +359,6 @@ export function reportWebVitals({ id, name, label, delta, value }) {
return;
}
- window.ga('send', 'event', {
- eventCategory: label === 'web-vital' ? 'Web Vitals' : 'Next.js custom metric',
- eventAction: name,
- eventValue: Math.round(name === 'CLS' ? value * 1000 : value), // values must be integers
- eventLabel: id, // id unique to current page load
- nonInteraction: true, // avoids affecting bounce rate.
- });
window.gtag('event', name, {
value: delta,
metric_label: label === 'web-vital' ? 'Web Vitals' : 'Next.js custom metric',
diff --git a/docs/pages/_document.js b/docs/pages/_document.js
index 953908455743e4..c64520eac1c394 100644
--- a/docs/pages/_document.js
+++ b/docs/pages/_document.js
@@ -34,9 +34,6 @@ if (process.env.NODE_ENV === 'production') {
const PRODUCTION_GA =
process.env.DEPLOY_ENV === 'production' || process.env.DEPLOY_ENV === 'staging';
-// TODO remove https://support.google.com/analytics/answer/11986666
-const GOOGLE_ANALYTICS_ID = PRODUCTION_GA ? 'UA-106598593-2' : 'UA-106598593-3';
-
const GOOGLE_ANALYTICS_ID_V4 = PRODUCTION_GA ? 'G-5NXDQLC2ZK' : 'G-XJ83JQEK7J';
export default class MyDocument extends Document {
@@ -176,11 +173,6 @@ export default class MyDocument extends Document {
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
__html: `
-window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
-window.ga('create','${GOOGLE_ANALYTICS_ID}',{
- sampleRate: ${PRODUCTION_GA ? 80 : 100},
-});
-
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
window.gtag = gtag;
diff --git a/docs/pages/blog/2019.md b/docs/pages/blog/2019.md
index e12b38477e5234..e1dbf8f38b5e72 100644
--- a/docs/pages/blog/2019.md
+++ b/docs/pages/blog/2019.md
@@ -59,7 +59,7 @@ Some of the key factors:
- [Skeleton](/material-ui/react-skeleton/)
- [Slider](/material-ui/react-slider/)
- [TextareaAutosize](/material-ui/react-textarea-autosize/)
- - [TreeView](/material-ui/react-tree-view/)
+ - [TreeView](/x/react-tree-view/)
- We have fixed a significant number of [accessibility issues](https://github.com/mui/material-ui/issues?q=is%3Aissue+label%3Aaccessibility+is%3Aclosed).
- We have introduced global class names.
- We have migrated the whole codebase to hooks.
diff --git a/docs/pages/blog/callback-support-in-style-overrides.md b/docs/pages/blog/callback-support-in-style-overrides.md
index b7e25bc17cd95d..72304620b71c41 100644
--- a/docs/pages/blog/callback-support-in-style-overrides.md
+++ b/docs/pages/blog/callback-support-in-style-overrides.md
@@ -68,7 +68,7 @@ import { ThemeProvider, createTheme } from '@mui/material/styles';
The callback is type-safe.
-- `ownerState`: `ComponentProps` interface, eg. `ButtonProps`, `ChipProps`, etc.
+- `ownerState`: `ComponentProps` interface, e.g. `ButtonProps`, `ChipProps`, etc.
- `theme`: `Theme` interface from `@mui/material/styles`.
```tsx
diff --git a/docs/pages/blog/july-2019-update.md b/docs/pages/blog/july-2019-update.md
index 270714c86838aa..cfea7d84fd0fe3 100644
--- a/docs/pages/blog/july-2019-update.md
+++ b/docs/pages/blog/july-2019-update.md
@@ -8,7 +8,7 @@ tags: ['Company']
Here are the most significant improvements in July:
-- 🌳 We have introduced a new [Tree View component](/material-ui/react-tree-view/) in the lab. Big thanks to Josh for it.
+- 🌳 We have introduced a new [Tree View component](/x/react-tree-view/) in the lab. Big thanks to Josh for it.
![Tree View](/static/blog/july-2019-update/tree-view.gif)
diff --git a/docs/pages/blog/lab-date-pickers-to-mui-x.md b/docs/pages/blog/lab-date-pickers-to-mui-x.md
index 8086f57588e4f4..fd437b0d4a6783 100644
--- a/docs/pages/blog/lab-date-pickers-to-mui-x.md
+++ b/docs/pages/blog/lab-date-pickers-to-mui-x.md
@@ -1,28 +1,28 @@
---
-title: Date and time pickers are moving to MUI X
-description: Migrate to the new package to start building with our powerful date and time pickers, now part of MUI X. Previously released MIT components will stay MIT.
+title: Date and Time Pickers are moving to MUI X
+description: Migrate to the new package to start building with our powerful Date and Time Pickers, now part of MUI X. Previously released MIT components will stay MIT.
date: 2022-04-03T00:00:00.000Z
authors: ['flaviendelangle']
tags: ['MUI X', 'News']
-card: true
+card: false
---
-After more than 18 months in the lab, the date and time picker components have found a new home as part of MUI X.
+After more than 18 months in the lab, the Date and Time Picker components have found a new home as part of MUI X.
This means we'll be dedicating even more time and effort to these complex components, to better meet the needs of both you and your users.
## TL;DR
-- The date pickers are one step closer to a stable release.
+- The Date and Time Pickers are one step closer to a stable release.
- **No surprise licenses changes**. We are staying true to [our promises](https://mui-org.notion.site/Stewardship-542a2226043d4f4a96dfb429d16cf5bd). What's MIT stays MIT, and we're going forward with our [plan announced over a year ago](https://v5-0-6.mui.com/components/date-range-picker/) to move the date range picker to the commercial license.
- Follow the [migration steps](/x/migration/migration-pickers-lab/)
-## What are date and time pickers?
+## What are Date and Time Pickers?
-Date and time pickers are interface controls that enable the user to select a date (or time) from a menu.
+Date and Time Pickers are interface controls that enable the user to select a date (or time) from a menu.
-
+
-
Date and time pickers using the default Material UI design
+
Date and Time Pickers using the default Material UI design
Common design patterns include text inputs, dropdown lists, calendars, timelines, and scrolling pickers on mobile devices.
@@ -39,17 +39,17 @@ MUI X components are available under two licenses:
- MUI X is MIT licensed, so free to use.
- MUI X Pro includes the most advanced features, and is commercially licensed.
-## Why have the date and time pickers been moved to MUI X?
+## Why have the Date and Time Pickers been moved to MUI X?
-Date and time picker UI elements appear simple enough on the surface, but they are surprisingly complicated to engineer.
+Date and Time Picker UI elements appear simple enough on the surface, but they are surprisingly complicated to engineer.
-When the picker components were ready to leave the lab, we had a choice to make: would they live in the MUI Core library, or should they become a part of MUI X?
+When the Date and Time Picker components were ready to leave the lab, we had a choice to make: would they live in the MUI Core library, or should they become a part of MUI X?
Given the complex nature of these components, we decided that they would benefit most from the dedicated attention that they would receive from the X team.
And by offering an even more advanced component package through our commercial license, we can continue to grow our team to better serve your needs.
-The date and time picker components are now available in two packages:
+The Date and Time Picker components are now available in two packages:
- `@mui/x-date-pickers` has a [MIT license](https://unpkg.com/browse/@mui/x-date-pickers/LICENSE), it contains all the open-source components
- `@mui/x-date-pickers-pro` has a [commercial license](https://unpkg.com/browse/@mui/x-date-pickers-pro/LICENSE), it contains all the MIT and commercially licensed components
@@ -58,7 +58,7 @@ The date and time picker components are now available in two packages:
The date range components can only be used with a commercial license.
-All other date and time picker components are available in `mui/x-date-pickers` and will remain MIT licensed and free forever.
+All other Date and Time Picker components are available in `mui/x-date-pickers` and will remain MIT licensed and free forever.
## How do I purchase a commercial license?
@@ -87,11 +87,11 @@ We have prepared a codemod to help you migrate your codebase from `@mui/lab` to
npx @mui/codemod v5.0.0/date-pickers-moved-to-x
```
-## Where is the date and time picker documentation?
+## Where is the Date and Time Picker documentation?
You can find the documentation for the picker components in the [MUI X docs](/x/react-date-pickers/getting-started/).
-## What's next for the date and time pickers?
+## What's next for the Date and Time Pickers?
For now, `@mui/x-date-pickers` and `@mui/x-date-pickers-pro` are in alpha.
Our next goal is to work on the stability and API consistency of these components to prepare a stable release.
diff --git a/docs/pages/blog/lab-tree-view-to-mui-x.js b/docs/pages/blog/lab-tree-view-to-mui-x.js
new file mode 100644
index 00000000000000..a2caf6fad2b240
--- /dev/null
+++ b/docs/pages/blog/lab-tree-view-to-mui-x.js
@@ -0,0 +1,7 @@
+import * as React from 'react';
+import TopLayoutBlog from 'docs/src/modules/components/TopLayoutBlog';
+import { docs } from './lab-tree-view-to-mui-x.md?@mui/markdown';
+
+export default function Page() {
+ return ;
+}
diff --git a/docs/pages/blog/lab-tree-view-to-mui-x.md b/docs/pages/blog/lab-tree-view-to-mui-x.md
new file mode 100644
index 00000000000000..102e33ec651261
--- /dev/null
+++ b/docs/pages/blog/lab-tree-view-to-mui-x.md
@@ -0,0 +1,84 @@
+---
+title: The Tree View is moving to MUI X
+description: Migrate to the new package to start building with our powerful Tree View, now part of MUI X. Previously released MIT components will stay MIT.
+date: 2023-08-21T00:00:00.000Z
+authors: ['flaviendelangle']
+tags: ['MUI X', 'News']
+card: true
+---
+
+After more than 4 years in the lab, the [Tree View](https://mui.com/x/react-tree-view/) components have found a new home as part of MUI X.
+This means we'll be dedicating even more time and effort to these complex components, to better meet the needs of both you and your users.
+
+## TL;DR
+
+- The Tree View is one step closer to a stable release.
+- **No surprise licenses changes**. We are staying true to [our promises](https://mui-org.notion.site/Stewardship-542a2226043d4f4a96dfb429d16cf5bd).
+ What's MIT stays MIT.
+ Therefore, all the existing features and future features of the Tree View will remain MIT and free to use.
+- Follow the [migration steps](/x/migration/migration-tree-view-lab/)
+
+## What is the Tree View?
+
+The Tree View is a component to represent hierarchical data presented as nodes in a tree-like format.
+
+The component allows to select one or multiple nodes.
+
+
+
+## What is MUI X?
+
+[MUI X](/x/) is a collection of advanced components built for complex use cases.
+
+As opposed to the MUI Core library, which leans on the open-source community for support, MUI X components require several full-time developers dedicated to engineering and ongoing maintenance.
+
+MUI X components are available under three licenses:
+
+- **MIT license**, which is free to use and includes all the current (and more to come) Treeview features.
+- **MUI X Pro**, a commercial license that offers features for handling large datasets and will include the most advanced features for Treeview, like virtualization.
+- **MUI X Premium**, which is also commercial and includes, in addition to the Pro features, tooling for data analysis.
+
+## Why did the Tree View move to MUI X?
+
+Once a component is ready to leave the lab, it can either go to MUI X or MUI Core libraries.
+
+Given the complex nature of the Treeview, it was a clear choice to group it with the other advanced components in MUI X.
+
+Moreover, new advanced features such as virtualization and drag and drop are already on the roadmap.
+
+The Tree View components are now available in the `@mui/x-tree-view` package which is [MIT licensed](https://unpkg.com/browse/@mui/x-tree-view/LICENSE) and includes all the current (free forever) features.
+
+## How do I migrate?
+
+Follow the [migration steps](/x/migration/migration-tree-view-lab/) by updating the package name and change from a default export to a named export:
+
+```diff
+-import TreeView from '@mui/lab/TreeView';
++import { TreeView } from '@mui/x-tree-view/TreeView';
+
+-import { TreeView, TreeItem } from '@mui/lab';
++import { TreeView, TreeItem } from '@mui/x-tree-view';
+```
+
+We have prepared a codemod to help you migrate your codebase from `@mui/lab` to `@mui/x-tree-view`:
+
+```bash
+npx @mui/codemod v5.0.0/tree-view-moved-to-x
+```
+
+## Where is the Tree View documentation?
+
+You can find the documentation for the Tree View component in the [MUI X docs](/x/react-tree-view/).
+
+## What's next for the Tree View?
+
+For now, `@mui/x-tree-view` is in alpha.
+Our next goal is to work on the stability and API consistency of its components to prepare a stable release in the next few months.
+
+Please feel free to try out the component and provide any feedback you may have.
+
+We also have a dedicated channel in our [Discord Server](https://mui.com/r/discord/) for you to provide any feedback or concerns you have with Tree View.
+
+Happy building!
diff --git a/docs/pages/blog/mui-core-v5.md b/docs/pages/blog/mui-core-v5.md
index 6636bee0dbe37c..7608354640fdba 100644
--- a/docs/pages/blog/mui-core-v5.md
+++ b/docs/pages/blog/mui-core-v5.md
@@ -1,5 +1,5 @@
---
-title: Introducing MUI Core v5.0
+title: Introducing MUI Core v5
description: After over 400 days of development and over 40 canary releases, we are excited to introduce MUI Core v5.0.0!
date: 2021-09-16T00:00:00.000Z
authors:
diff --git a/docs/pages/blog/mui-next-js-app-router.md b/docs/pages/blog/mui-next-js-app-router.md
index ffad12d2f67d45..6478e0ae4b8f52 100644
--- a/docs/pages/blog/mui-next-js-app-router.md
+++ b/docs/pages/blog/mui-next-js-app-router.md
@@ -26,8 +26,8 @@ See [this explanation of Client Components and SSR](https://github.com/reactwg/s
Additionally, we've created guides to walk you through setting up an app using the Next.js App Router with each of the Core libraries:
- [Material UI setup](https://mui.com/material-ui/guides/next-js-app-router/)
+- [Joy UI setup](https://mui.com/joy-ui/integrations/next-js-app-router/)
- [Base UI setup](https://mui.com/base-ui/guides/next-js-app-router/)
-- [Joy UI setup](https://mui.com/joy-ui/guides/next-js-app-router/)
diff --git a/docs/pages/blog/mui-x-v5.md b/docs/pages/blog/mui-x-v5.md
index ef3a455e5033e3..636ba21c026746 100644
--- a/docs/pages/blog/mui-x-v5.md
+++ b/docs/pages/blog/mui-x-v5.md
@@ -1,5 +1,5 @@
---
-title: Introducing MUI X v5.0
+title: Introducing MUI X v5
description: We are excited to introduce MUI X v5.0.0!
date: 2021-11-22T00:00:00.000Z
authors:
diff --git a/docs/pages/blog/mui-x-v6.md b/docs/pages/blog/mui-x-v6.md
index 6c154412bcd70d..9348275f3d9f74 100644
--- a/docs/pages/blog/mui-x-v6.md
+++ b/docs/pages/blog/mui-x-v6.md
@@ -1,5 +1,5 @@
---
-title: Introducing MUI X v6.0.0
+title: Introducing MUI X v6
description: Introducing the new major version of the advanced components.
date: 2023-03-06T00:00:00.000Z
authors: ['josefreitas']
diff --git a/docs/pages/experiments/base/listbox.tsx b/docs/pages/experiments/base/listbox.tsx
index acdb62766465c4..fbdfc67412e677 100644
--- a/docs/pages/experiments/base/listbox.tsx
+++ b/docs/pages/experiments/base/listbox.tsx
@@ -27,7 +27,7 @@ const styles = `
.list:focus-visible {
outline: none;
}
-
+
.item {
width: 50px;
height: 50px;
diff --git a/docs/pages/material-ui/api/swipeable-drawer.json b/docs/pages/material-ui/api/swipeable-drawer.json
index 90960f1b2a7c72..b1bea2958f2ef1 100644
--- a/docs/pages/material-ui/api/swipeable-drawer.json
+++ b/docs/pages/material-ui/api/swipeable-drawer.json
@@ -3,15 +3,21 @@
"onClose": {
"type": { "name": "func" },
"required": true,
- "signature": { "type": "function(event: object) => void", "describedArgs": ["event"] }
+ "signature": {
+ "type": "function(event: React.SyntheticEvent<{}>) => void",
+ "describedArgs": ["event"]
+ }
},
"onOpen": {
"type": { "name": "func" },
"required": true,
- "signature": { "type": "function(event: object) => void", "describedArgs": ["event"] }
+ "signature": {
+ "type": "function(event: React.SyntheticEvent<{}>) => void",
+ "describedArgs": ["event"]
+ }
},
"allowSwipeInChildren": {
- "type": { "name": "union", "description": "bool | func" },
+ "type": { "name": "union", "description": "func | bool" },
"default": "false"
},
"children": { "type": { "name": "node" } },
@@ -39,7 +45,24 @@
"import SwipeableDrawer from '@mui/material/SwipeableDrawer';",
"import { SwipeableDrawer } from '@mui/material';"
],
- "styles": { "classes": [], "globalClasses": {}, "name": null },
+ "styles": {
+ "classes": [
+ "root",
+ "docked",
+ "paper",
+ "paperAnchorLeft",
+ "paperAnchorRight",
+ "paperAnchorTop",
+ "paperAnchorBottom",
+ "paperAnchorDockedLeft",
+ "paperAnchorDockedTop",
+ "paperAnchorDockedRight",
+ "paperAnchorDockedBottom",
+ "modal"
+ ],
+ "globalClasses": {},
+ "name": "MuiSwipeableDrawer"
+ },
"spread": true,
"themeDefaultProps": false,
"muiName": "MuiSwipeableDrawer",
diff --git a/docs/pages/material-ui/api/tree-item.js b/docs/pages/material-ui/api/tree-item.js
deleted file mode 100644
index 938a0e13404ecc..00000000000000
--- a/docs/pages/material-ui/api/tree-item.js
+++ /dev/null
@@ -1,19 +0,0 @@
-import * as React from 'react';
-import ApiPage from 'docs/src/modules/components/ApiPage';
-import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations';
-import jsonPageContent from './tree-item.json';
-
-export default function Page(props) {
- const { descriptions, pageContent } = props;
- return ;
-}
-
-Page.getInitialProps = () => {
- const req = require.context('docs/translations/api-docs/tree-item', false, /tree-item.*.json$/);
- const descriptions = mapApiPageTranslations(req);
-
- return {
- descriptions,
- pageContent: jsonPageContent,
- };
-};
diff --git a/docs/pages/material-ui/api/tree-item.json b/docs/pages/material-ui/api/tree-item.json
deleted file mode 100644
index 0f2f44e92b7eac..00000000000000
--- a/docs/pages/material-ui/api/tree-item.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "props": {
- "nodeId": { "type": { "name": "string" }, "required": true },
- "children": { "type": { "name": "node" } },
- "classes": { "type": { "name": "object" }, "additionalInfo": { "cssApi": true } },
- "collapseIcon": { "type": { "name": "node" } },
- "ContentComponent": {
- "type": { "name": "custom", "description": "element type" },
- "default": "TreeItemContent"
- },
- "ContentProps": { "type": { "name": "object" } },
- "disabled": { "type": { "name": "bool" }, "default": "false" },
- "endIcon": { "type": { "name": "node" } },
- "expandIcon": { "type": { "name": "node" } },
- "icon": { "type": { "name": "node" } },
- "label": { "type": { "name": "node" } },
- "onFocus": { "type": { "name": "custom", "description": "unsupportedProp" } },
- "sx": {
- "type": {
- "name": "union",
- "description": "Array<func | object | bool> | func | object"
- },
- "additionalInfo": { "sx": true }
- },
- "TransitionComponent": { "type": { "name": "elementType" }, "default": "Collapse" },
- "TransitionProps": { "type": { "name": "object" } }
- },
- "name": "TreeItem",
- "imports": ["import TreeItem from '@mui/lab/TreeItem';", "import { TreeItem } from '@mui/lab';"],
- "styles": {
- "classes": [
- "root",
- "group",
- "content",
- "expanded",
- "selected",
- "focused",
- "disabled",
- "iconContainer",
- "label"
- ],
- "globalClasses": {
- "expanded": "Mui-expanded",
- "selected": "Mui-selected",
- "focused": "Mui-focused",
- "disabled": "Mui-disabled"
- },
- "name": "MuiTreeItem"
- },
- "spread": true,
- "themeDefaultProps": true,
- "muiName": "MuiTreeItem",
- "forwardsRefTo": "HTMLLIElement",
- "filename": "/packages/mui-lab/src/TreeItem/TreeItem.js",
- "inheritance": null,
- "demos": "
up to 60 days after the support has expired: 25% discount
+
up to 60 days after the support has expired: 35% discount
more than 60 days after the support has expired: 15% discount
diff --git a/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx b/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx
index dc6785b06694f5..1de1bb4a9a5099 100644
--- a/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx
+++ b/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx
@@ -505,7 +505,6 @@ const StyledSwitch = styled('span')(`
border-radius: max(2px, var(--border-radius));
background-color: #fff;
position: relative;
-
transition-property: left;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 120ms;
@@ -625,7 +624,7 @@ const StyledBadge = styled(Badge)(
list-style: none;
font-family: IBM Plex Sans, sans-serif;
position: relative;
- display: inline-block;
+ display: inline-block;
& .${badgeClasses.badge} {
--_scale: 1.5em;
diff --git a/docs/src/components/productMaterial/MaterialComponents.tsx b/docs/src/components/productMaterial/MaterialComponents.tsx
index e2d5a1afd97f2a..b651e77e429d3e 100644
--- a/docs/src/components/productMaterial/MaterialComponents.tsx
+++ b/docs/src/components/productMaterial/MaterialComponents.tsx
@@ -68,7 +68,7 @@ const CODES = {
Add item
}>
- Add item
+ Add item
`,
'Text field': `
diff --git a/docs/src/components/productX/XTreeViewDemo.tsx b/docs/src/components/productX/XTreeViewDemo.tsx
index 156c899b3e736a..df4eba0ada0505 100644
--- a/docs/src/components/productX/XTreeViewDemo.tsx
+++ b/docs/src/components/productX/XTreeViewDemo.tsx
@@ -4,8 +4,13 @@ import { styled, alpha } from '@mui/material/styles';
import Box from '@mui/material/Box';
import Paper from '@mui/material/Paper';
import Chip from '@mui/material/Chip';
-import TreeView from '@mui/lab/TreeView';
-import MuiTreeItem, { useTreeItem, TreeItemProps, TreeItemContentProps } from '@mui/lab/TreeItem';
+import { TreeView } from '@mui/x-tree-view/TreeView';
+import {
+ TreeItem as MuiTreeItem,
+ useTreeItem,
+ TreeItemProps,
+ TreeItemContentProps,
+} from '@mui/x-tree-view/TreeItem';
import Typography from '@mui/material/Typography';
import AddBoxOutlined from '@mui/icons-material/AddBoxOutlined';
import IndeterminateCheckBoxOutlined from '@mui/icons-material/IndeterminateCheckBoxOutlined';
@@ -45,16 +50,16 @@ const CustomContent = React.forwardRef(function CustomContent(
const icon = iconProp || expansionIcon || displayIcon;
- const handleMouseDown = (event: React.MouseEvent) => {
+ const handleMouseDown = (event: React.MouseEvent) => {
preventSelection(event);
};
- const handleExpansionClick = (event: React.MouseEvent) => {
+ const handleExpansionClick = (event: React.MouseEvent) => {
handleExpansion(event);
handleSelection(event);
};
- const handleSelectionClick = (event: React.MouseEvent) => {
+ const handleSelectionClick = (event: React.MouseEvent) => {
handleSelection(event);
};
@@ -204,13 +209,14 @@ const StyledTreeItem = styled(MuiTreeItem)(({ theme }) => [
}),
]);
-function TreeItem(
+const TreeItem = React.forwardRef(function TreeItem(
props: TreeItemProps & {
ContentProps?: { lastNestedChild?: boolean };
},
+ ref: React.Ref,
) {
- return ;
-}
+ return ;
+});
export default function XDateRangeDemo() {
return (
@@ -302,15 +308,15 @@ export default function XDateRangeDemo() {
({
pb: 0.2,
fontWeight: theme.typography.fontWeightSemiBold,
- color: (theme.vars || theme).palette.primary[300],
- borderColor: alpha(theme.palette.primary[300], 0.3),
- background: alpha(theme.palette.primary[800], 0.3),
+ color: (theme.vars || theme).palette.warning[300],
+ borderColor: alpha(theme.palette.warning[300], 0.3),
+ background: alpha(theme.palette.warning[800], 0.3),
})}
/>
@@ -319,7 +325,7 @@ export default function XDateRangeDemo() {
diff --git a/docs/src/components/showcase/FolderTreeView.tsx b/docs/src/components/showcase/FolderTreeView.tsx
index bff9c2e1e1dab2..b8ee4f67bc4bd1 100644
--- a/docs/src/components/showcase/FolderTreeView.tsx
+++ b/docs/src/components/showcase/FolderTreeView.tsx
@@ -4,8 +4,13 @@ import * as React from 'react';
import clsx from 'clsx';
import { styled } from '@mui/material/styles';
import Box from '@mui/material/Box';
-import TreeView from '@mui/lab/TreeView';
-import TreeItem, { useTreeItem, TreeItemProps, TreeItemContentProps } from '@mui/lab/TreeItem';
+import { TreeView } from '@mui/x-tree-view/TreeView';
+import {
+ TreeItem,
+ useTreeItem,
+ TreeItemProps,
+ TreeItemContentProps,
+} from '@mui/x-tree-view/TreeItem';
import Typography from '@mui/material/Typography';
import KeyboardArrowDownRounded from '@mui/icons-material/KeyboardArrowDownRounded';
import KeyboardArrowUpRounded from '@mui/icons-material/KeyboardArrowUpRounded';
@@ -38,11 +43,11 @@ const CustomContent = React.forwardRef(function CustomContent(
const icon = iconProp || expansionIcon || displayIcon;
- const handleMouseDown = (event: React.MouseEvent) => {
+ const handleMouseDown = (event: React.MouseEvent) => {
preventSelection(event);
};
- const handleExpansionClick = (event: React.MouseEvent) => {
+ const handleExpansionClick = (event: React.MouseEvent) => {
handleExpansion(event);
};
@@ -168,13 +173,14 @@ const StyledTreeItem = styled(TreeItem)(({ theme }) => [
}),
]);
-function CustomTreeItem(
+const CustomTreeItem = React.forwardRef(function CustomTreeItem(
props: TreeItemProps & {
ContentProps?: { lastNestedChild?: boolean };
},
+ ref: React.Ref,
) {
- return ;
-}
+ return ;
+});
export default function FolderTreeView() {
return (
diff --git a/docs/src/modules/components/Ad.js b/docs/src/modules/components/Ad.js
index c882646fe14955..301bebdb460be9 100644
--- a/docs/src/modules/components/Ad.js
+++ b/docs/src/modules/components/Ad.js
@@ -88,12 +88,7 @@ class AdErrorBoundary extends React.Component {
// send explicit `'null'`
const eventLabel = String(this.props.eventLabel);
// TODO: Use proper error monitoring service (e.g. Sentry) instead
- window.ga('send', {
- hitType: 'event',
- eventCategory: 'ad',
- eventAction: 'crash',
- eventLabel,
- });
+
window.gtag('event', 'ad', {
eventAction: 'crash',
eventLabel,
@@ -199,12 +194,6 @@ export default function Ad() {
}
const delay = setTimeout(() => {
- window.ga('send', {
- hitType: 'event',
- eventCategory: 'ad',
- eventAction: 'display',
- eventLabel,
- });
window.gtag('event', 'ad', {
eventAction: 'display',
eventLabel,
diff --git a/docs/src/modules/components/ApiPage.js b/docs/src/modules/components/ApiPage.js
index 867d707a1b474b..5ed107c795cfc2 100644
--- a/docs/src/modules/components/ApiPage.js
+++ b/docs/src/modules/components/ApiPage.js
@@ -127,7 +127,7 @@ export default function ApiPage(props) {
: '/material-ui/customization/theme-components/#theme-style-overrides';
let slotGuideLink = '';
if (isJoyComponent) {
- slotGuideLink = '/joy-ui/guides/overriding-component-structure/';
+ slotGuideLink = '/joy-ui/customization/overriding-component-structure/';
} else if (isBaseComponent) {
slotGuideLink = '/base-ui/guides/overriding-component-structure/';
}
diff --git a/docs/src/modules/components/ComponentsApiContent.js b/docs/src/modules/components/ComponentsApiContent.js
index 36de6d8d88a8c6..5b9afc2cbe6492 100644
--- a/docs/src/modules/components/ComponentsApiContent.js
+++ b/docs/src/modules/components/ComponentsApiContent.js
@@ -105,7 +105,7 @@ export default function ComponentsApiContent(props) {
: '/material-ui/customization/theme-components/#theme-style-overrides';
let slotGuideLink = '';
if (isJoyComponent) {
- slotGuideLink = '/joy-ui/guides/overriding-component-structure/';
+ slotGuideLink = '/joy-ui/customization/overriding-component-structure/';
} else if (isBaseComponent) {
slotGuideLink = '/base-ui/guides/overriding-component-structure/';
}
diff --git a/docs/src/modules/components/DemoEditor.tsx b/docs/src/modules/components/DemoEditor.tsx
index 766becb31bbcce..fb658c44ac5460 100644
--- a/docs/src/modules/components/DemoEditor.tsx
+++ b/docs/src/modules/components/DemoEditor.tsx
@@ -81,8 +81,8 @@ export default function DemoEditor(props: DemoEditorProps) {
const { language, value, onChange, copyButtonProps, children, id, ...other } = props;
const t = useTranslate();
const contextTheme = useTheme();
- const wrapperRef = React.useRef(null);
- const enterRef = React.useRef(null);
+ const wrapperRef = React.useRef(null);
+ const enterRef = React.useRef(null);
const handlers = useCodeCopy();
React.useEffect(() => {
diff --git a/docs/src/modules/components/GoogleAnalytics.js b/docs/src/modules/components/GoogleAnalytics.js
index 9eb34272d53062..fb4c511f87c2d6 100644
--- a/docs/src/modules/components/GoogleAnalytics.js
+++ b/docs/src/modules/components/GoogleAnalytics.js
@@ -2,7 +2,6 @@ import * as React from 'react';
import { useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
import { useRouter } from 'next/router';
-import loadScript from 'docs/src/modules/utils/loadScript';
import { useNoSsrCodeVariant } from 'docs/src/modules/utils/codeVariant';
import { useNoSsrCodeStyling } from 'docs/src/modules/utils/codeStylingSolution';
import { useUserLanguage } from 'docs/src/modules/utils/i18n';
@@ -30,12 +29,6 @@ function handleClick(event) {
return;
}
- window.ga('send', {
- hitType: 'event',
- eventCategory: category,
- eventAction: element.getAttribute('data-ga-event-action'),
- eventLabel: element.getAttribute('data-ga-event-label'),
- });
window.gtag('event', category, {
eventAction: element.getAttribute('data-ga-event-action'),
eventLabel: element.getAttribute('data-ga-event-label'),
@@ -56,14 +49,11 @@ let boundDataGaListener = false;
*/
function GoogleAnalytics() {
React.useEffect(() => {
- loadScript('https://www.google-analytics.com/analytics.js', document.querySelector('head'));
-
if (!boundDataGaListener) {
boundDataGaListener = true;
document.addEventListener('click', handleClick);
}
}, []);
-
const router = useRouter();
const timeout = React.useRef();
@@ -73,8 +63,6 @@ function GoogleAnalytics() {
clearTimeout(timeout.current);
timeout.current = setTimeout(() => {
const { canonicalAsServer } = pathnameToLanguage(window.location.pathname);
- window.ga('set', { page: canonicalAsServer });
- window.ga('send', { hitType: 'pageview' });
// https://developers.google.com/analytics/devguides/collection/ga4/views?client_type=gtag
window.gtag('event', 'page_view', {
@@ -88,7 +76,6 @@ function GoogleAnalytics() {
const codeVariant = useNoSsrCodeVariant();
React.useEffect(() => {
- window.ga('set', 'dimension1', codeVariant);
window.gtag('set', 'user_properties', {
codeVariant,
});
@@ -96,7 +83,6 @@ function GoogleAnalytics() {
const userLanguage = useUserLanguage();
React.useEffect(() => {
- window.ga('set', 'dimension2', userLanguage);
window.gtag('set', 'user_properties', {
userLanguage,
});
@@ -109,7 +95,6 @@ function GoogleAnalytics() {
*/
function trackDevicePixelRation() {
const devicePixelRatio = Math.round(window.devicePixelRatio * 10) / 10;
- window.ga('set', 'dimension3', devicePixelRatio);
window.gtag('set', 'user_properties', {
devicePixelRatio,
});
@@ -135,14 +120,12 @@ function GoogleAnalytics() {
const colorScheme = theme.palette.mode;
React.useEffect(() => {
- window.ga('set', 'dimension4', colorSchemeOS);
window.gtag('set', 'user_properties', {
colorSchemeOS,
});
}, [colorSchemeOS]);
React.useEffect(() => {
- window.ga('set', 'dimension5', colorScheme);
window.gtag('set', 'user_properties', {
colorScheme,
});
diff --git a/docs/src/modules/components/JoyThemeBuilder.tsx b/docs/src/modules/components/JoyThemeBuilder.tsx
index 2f99dac59d4f18..51da85ac1ac359 100644
--- a/docs/src/modules/components/JoyThemeBuilder.tsx
+++ b/docs/src/modules/components/JoyThemeBuilder.tsx
@@ -349,13 +349,14 @@ const theme = extendTheme(${JSON.stringify(
(k, v) => (v === undefined ? '__undefined' : v),
2,
).replace(/"__undefined"/g, 'undefined')})
-
+
export default theme;`;
function getPaletteFormProps(colorSchemes: any, colorMode: string, node: string) {
// @ts-ignore
const themeDefaultValue = defaultTheme.colorSchemes[colorMode].palette[node];
- const value = colorSchemes[colorMode][node];
+ const value = colorSchemes[colorMode][node] || {};
+
const mergedValue = { ...themeDefaultValue, ...value };
return {
themeDefaultValue,
@@ -719,6 +720,7 @@ function PaletteImport({
function ColorTokenCreator({ onChange }: { onChange: (name: string, value: string) => void }) {
const [open, setOpen] = React.useState(false);
const nameRef = React.useRef(null);
+ const colorRef = React.useRef(null);
const [name, setName] = React.useState('');
const [color, setColor] = React.useState('');
if (!open) {
@@ -739,6 +741,9 @@ function ColorTokenCreator({ onChange }: { onChange: (name: string, value: strin
);
}
+
+ const isValidToken = name.trim() && color.trim();
+
return (
setName(event.target.value)}
/>{' '}
:{' '}
- setColor(event.target.value)}
+ onEmptyColor={() => {
+ setColor('');
+ }}
onKeyDown={(event) => {
if (event.key === 'Enter' && name && color) {
onChange(name, color);
setOpen(false);
}
}}
+ onValidColor={(newColor) => {
+ setColor(newColor);
+ }}
+ slotProps={{
+ input: { ref: colorRef },
+ }}
sx={{ flexGrow: 1 }}
/>
{
- if (!name) {
+ const trimmedName = name.trim();
+ const trimmedColor = color.trim();
+
+ if (!trimmedName) {
nameRef.current?.focus();
+ } else if (!trimmedColor) {
+ colorRef.current?.focus();
} else {
- onChange(name, color);
+ onChange(trimmedName, trimmedColor);
setColor('');
setName('');
setOpen(false);
@@ -1582,7 +1600,7 @@ export default function JoyThemeBuilder() {
}}
onRemove={(token) => {
setter((prev) => {
- const newPalette = prev.background;
+ const newPalette = prev.background || {};
delete newPalette[token];
return { ...prev, background: newPalette };
});
@@ -1606,7 +1624,7 @@ export default function JoyThemeBuilder() {
}}
onRemove={(token) => {
setter((prev) => {
- const newPalette = prev.common;
+ const newPalette = prev.common || {};
delete newPalette[token];
return { ...prev, common: newPalette };
});
@@ -1630,7 +1648,7 @@ export default function JoyThemeBuilder() {
}}
onRemove={(token) => {
setter((prev) => {
- const newPalette = prev.text;
+ const newPalette = prev.text || {};
delete newPalette[token];
return { ...prev, text: newPalette };
});
@@ -1686,7 +1704,7 @@ export default function JoyThemeBuilder() {
}}
onRemove={(token) => {
setter((prev) => {
- const newPalette = prev[colorProp];
+ const newPalette = prev[colorProp] || {};
delete newPalette[token];
return { ...prev, [colorProp]: newPalette };
});
@@ -1707,7 +1725,7 @@ export default function JoyThemeBuilder() {
}}
onRemove={(token) => {
setter((prev) => {
- const newPalette = prev[colorProp];
+ const newPalette = prev[colorProp] || {};
delete newPalette[token];
return { ...prev, [colorProp]: newPalette };
});
diff --git a/docs/src/modules/components/MarkdownDocsV2.js b/docs/src/modules/components/MarkdownDocsV2.js
index 7a87ab3a632988..a6073d25d266bc 100644
--- a/docs/src/modules/components/MarkdownDocsV2.js
+++ b/docs/src/modules/components/MarkdownDocsV2.js
@@ -246,7 +246,6 @@ export default function MarkdownDocsV2(props) {
disableToc={disableToc}
location={localizedDoc.location}
title={localizedDoc.title}
- seoTitle={localizedDoc.seoTitle}
toc={activeToc}
disableLayout
hasTabs={hasTabs}
diff --git a/docs/src/modules/components/ThemeViewer.tsx b/docs/src/modules/components/ThemeViewer.tsx
index b59784e1e39db8..02fcc9884c994b 100644
--- a/docs/src/modules/components/ThemeViewer.tsx
+++ b/docs/src/modules/components/ThemeViewer.tsx
@@ -4,8 +4,8 @@ import { styled } from '@mui/system';
import Box from '@mui/material/Box';
import ExpandIcon from '@mui/icons-material/ExpandMore';
import CollapseIcon from '@mui/icons-material/ChevronRight';
-import TreeView from '@mui/lab/TreeView';
-import MuiTreeItem, { treeItemClasses } from '@mui/lab/TreeItem';
+import { TreeView } from '@mui/x-tree-view/TreeView';
+import { TreeItem as MuiTreeItem, treeItemClasses } from '@mui/x-tree-view/TreeItem';
import { lighten } from '@mui/material/styles';
function getType(value: any) {
diff --git a/docs/src/modules/sandbox/CodeSandbox.test.js b/docs/src/modules/sandbox/CodeSandbox.test.js
index d06d85dc0d4576..816b3f2a6cb0b8 100644
--- a/docs/src/modules/sandbox/CodeSandbox.test.js
+++ b/docs/src/modules/sandbox/CodeSandbox.test.js
@@ -48,6 +48,7 @@ describe('CodeSandbox', () => {
BasicButtons Material Demo
+
@@ -137,6 +138,7 @@ ReactDOM.createRoot(document.querySelector("#root")).render(
BasicButtons Material Demo
+
diff --git a/docs/src/modules/sandbox/CreateReactApp.ts b/docs/src/modules/sandbox/CreateReactApp.ts
index d24e266d68d720..345345f0caa01b 100644
--- a/docs/src/modules/sandbox/CreateReactApp.ts
+++ b/docs/src/modules/sandbox/CreateReactApp.ts
@@ -15,6 +15,7 @@ export const getHtml = ({
${title}
+
diff --git a/docs/src/modules/sandbox/Dependencies.ts b/docs/src/modules/sandbox/Dependencies.ts
index cfb952c223256f..c4c618a7f3f081 100644
--- a/docs/src/modules/sandbox/Dependencies.ts
+++ b/docs/src/modules/sandbox/Dependencies.ts
@@ -128,7 +128,7 @@ export default function SandboxDependencies(
deps[name] = versions[name] ? versions[name] : 'latest';
}
- // e.g date-fns
+ // e.g. date-fns
const dateAdapterMatch = fullName.match(
/^@mui\/(lab|x-date-pickers)\/(?Adapter.*)/,
) as RegExpMatchArrayWithGroups<{ adapterName: string }>;
diff --git a/docs/src/modules/sandbox/StackBlitz.test.js b/docs/src/modules/sandbox/StackBlitz.test.js
index ac332bc545091b..7fa696e080d879 100644
--- a/docs/src/modules/sandbox/StackBlitz.test.js
+++ b/docs/src/modules/sandbox/StackBlitz.test.js
@@ -35,6 +35,7 @@ describe('StackBlitz', () => {
BasicButtons Material Demo
+
@@ -110,6 +111,7 @@ ReactDOM.createRoot(document.querySelector("#root")).render(
BasicButtons Material Demo
+
diff --git a/docs/translations/api-docs/circular-progress/circular-progress-pt.json b/docs/translations/api-docs/circular-progress/circular-progress-pt.json
index 8fb837cdcd4302..d1071e225ef3b6 100644
--- a/docs/translations/api-docs/circular-progress/circular-progress-pt.json
+++ b/docs/translations/api-docs/circular-progress/circular-progress-pt.json
@@ -4,7 +4,7 @@
"classes": "Sobrescreve ou extende os estilos aplicados para o componente. Veja a API CSS abaixo para maiores detalhes.",
"color": "The color of the component. It supports both default and custom theme colors, which can be added as shown in the palette customization guide.",
"disableShrink": "If true, the shrink animation is disabled. This only works if variant is indeterminate.",
- "size": "The size of the circle. If using a number, the pixel unit is assumed. If using a string, you need to provide the CSS unit, e.g '3rem'.",
+ "size": "The size of the circle. If using a number, the pixel unit is assumed. If using a string, you need to provide the CSS unit, e.g. '3rem'.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details.",
"thickness": "The thickness of the circle.",
"value": "The value of the progress indicator for the determinate variant. Value between 0 and 100.",
diff --git a/docs/translations/api-docs/circular-progress/circular-progress-zh.json b/docs/translations/api-docs/circular-progress/circular-progress-zh.json
index aed68973841ecd..2b1f8128fdbfc5 100644
--- a/docs/translations/api-docs/circular-progress/circular-progress-zh.json
+++ b/docs/translations/api-docs/circular-progress/circular-progress-zh.json
@@ -4,7 +4,7 @@
"classes": "Override or extend the styles applied to the component. See CSS API below for more details.",
"color": "The color of the component. It supports both default and custom theme colors, which can be added as shown in the palette customization guide.",
"disableShrink": "If true, the shrink animation is disabled. This only works if variant is indeterminate.",
- "size": "The size of the circle. If using a number, the pixel unit is assumed. If using a string, you need to provide the CSS unit, e.g '3rem'.",
+ "size": "The size of the circle. If using a number, the pixel unit is assumed. If using a string, you need to provide the CSS unit, e.g. '3rem'.",
"sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details.",
"thickness": "The thickness of the circle.",
"value": "The value of the progress indicator for the determinate variant. Value between 0 and 100.",
diff --git a/docs/translations/api-docs/circular-progress/circular-progress.json b/docs/translations/api-docs/circular-progress/circular-progress.json
index 534bd39fa8a3ca..e587a33ff03b54 100644
--- a/docs/translations/api-docs/circular-progress/circular-progress.json
+++ b/docs/translations/api-docs/circular-progress/circular-progress.json
@@ -9,7 +9,7 @@
"description": "If true, the shrink animation is disabled. This only works if variant is indeterminate."
},
"size": {
- "description": "The size of the component. If using a number, the pixel unit is assumed. If using a string, you need to provide the CSS unit, e.g '3rem'."
+ "description": "The size of the component. If using a number, the pixel unit is assumed. If using a string, you need to provide the CSS unit, e.g. '3rem'."
},
"sx": {
"description": "The system prop that allows defining system overrides as well as additional CSS styles."
diff --git a/docs/translations/api-docs/swipeable-drawer/swipeable-drawer.json b/docs/translations/api-docs/swipeable-drawer/swipeable-drawer.json
index 4af424f071d346..843536573cf981 100644
--- a/docs/translations/api-docs/swipeable-drawer/swipeable-drawer.json
+++ b/docs/translations/api-docs/swipeable-drawer/swipeable-drawer.json
@@ -39,5 +39,57 @@
"description": "The duration for the transition, in milliseconds. You may specify a single timeout for all transitions, or individually with an object."
}
},
- "classDescriptions": {}
+ "classDescriptions": {
+ "root": { "description": "Styles applied to the root element." },
+ "docked": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the root element",
+ "conditions": "variant=\"permanent or persistent\""
+ },
+ "paper": {
+ "description": "Styles applied to {{nodeName}}.",
+ "nodeName": "the Paper component"
+ },
+ "paperAnchorLeft": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the Paper component",
+ "conditions": "anchor=\"left\""
+ },
+ "paperAnchorRight": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the Paper component",
+ "conditions": "anchor=\"right\""
+ },
+ "paperAnchorTop": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the Paper component",
+ "conditions": "anchor=\"top\""
+ },
+ "paperAnchorBottom": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the Paper component",
+ "conditions": "anchor=\"bottom\""
+ },
+ "paperAnchorDockedLeft": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the Paper component",
+ "conditions": "anchor=\"left\" and variant is not "temporary""
+ },
+ "paperAnchorDockedTop": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the Paper component",
+ "conditions": "anchor=\"top\" and variant is not "temporary""
+ },
+ "paperAnchorDockedRight": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the Paper component",
+ "conditions": "anchor=\"right\" and variant is not "temporary""
+ },
+ "paperAnchorDockedBottom": {
+ "description": "Styles applied to {{nodeName}} if {{conditions}}.",
+ "nodeName": "the Paper component",
+ "conditions": "anchor=\"bottom\" and variant is not "temporary""
+ },
+ "modal": { "description": "Styles applied to {{nodeName}}.", "nodeName": "the Modal component" }
+ }
}
diff --git a/docs/translations/api-docs/tree-item/tree-item-pt.json b/docs/translations/api-docs/tree-item/tree-item-pt.json
deleted file mode 100644
index 79723327db8dfb..00000000000000
--- a/docs/translations/api-docs/tree-item/tree-item-pt.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "componentDescription": "",
- "propDescriptions": {
- "children": "O conteúdo do componente.",
- "classes": "Sobrescreve ou extende os estilos aplicados para o componente. Veja a API CSS abaixo para maiores detalhes.",
- "collapseIcon": "The icon used to collapse the node.",
- "ContentComponent": "The component used for the content node.⚠️ Needs to be able to hold a ref.",
- "ContentProps": "Props applied to ContentComponent",
- "disabled": "If true, the node is disabled.",
- "endIcon": "The icon displayed next to a end node.",
- "expandIcon": "The icon used to expand the node.",
- "icon": "The icon to display next to the tree node's label.",
- "label": "The tree node label.",
- "nodeId": "The id of the node.",
- "onFocus": "This prop isn't supported. Use the onNodeFocus callback on the tree if you need to monitor a node's focus.",
- "sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details.",
- "TransitionComponent": "The component used for the transition. Follow this guide to learn more about the requirements for this component.",
- "TransitionProps": "Props applied to the transition element. By default, the element is based on this Transition component."
- },
- "classDescriptions": {
- "root": {
- "description": "Estilos aplicados ao elemento raiz."
- },
- "group": {
- "description": "Estilos aplicados a {{nodeName}}.",
- "nodeName": "the transition component"
- },
- "content": {
- "description": "Estilos aplicados a {{nodeName}}.",
- "nodeName": "the content element"
- },
- "expanded": {
- "description": "Pseudo-class applied to {{nodeName}} when {{conditions}}.",
- "nodeName": "the content element",
- "conditions": "expanded"
- },
- "selected": {
- "description": "Pseudo-class applied to {{nodeName}} when {{conditions}}.",
- "nodeName": "the content element",
- "conditions": "selected"
- },
- "focused": {
- "description": "Pseudo-class applied to {{nodeName}} when {{conditions}}.",
- "nodeName": "the content element",
- "conditions": "focused"
- },
- "disabled": {
- "description": "Pseudo-class applied to {{nodeName}} when {{conditions}}.",
- "nodeName": "the element",
- "conditions": "disabled"
- },
- "iconContainer": {
- "description": "Estilos aplicados a {{nodeName}}.",
- "nodeName": "the tree node icon"
- },
- "label": {
- "description": "Estilos aplicados a {{nodeName}}.",
- "nodeName": "the label element"
- }
- }
-}
diff --git a/docs/translations/api-docs/tree-item/tree-item-zh.json b/docs/translations/api-docs/tree-item/tree-item-zh.json
deleted file mode 100644
index 597760a3bfb742..00000000000000
--- a/docs/translations/api-docs/tree-item/tree-item-zh.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "componentDescription": "",
- "propDescriptions": {
- "children": "The content of the component.",
- "classes": "Override or extend the styles applied to the component. See CSS API below for more details.",
- "collapseIcon": "The icon used to collapse the node.",
- "ContentComponent": "The component used for the content node.⚠️ Needs to be able to hold a ref.",
- "ContentProps": "Props applied to ContentComponent",
- "disabled": "If true, the node is disabled.",
- "endIcon": "The icon displayed next to a end node.",
- "expandIcon": "The icon used to expand the node.",
- "icon": "The icon to display next to the tree node's label.",
- "label": "The tree node label.",
- "nodeId": "The id of the node.",
- "onFocus": "This prop isn't supported. Use the onNodeFocus callback on the tree if you need to monitor a node's focus.",
- "sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details.",
- "TransitionComponent": "The component used for the transition. Follow this guide to learn more about the requirements for this component.",
- "TransitionProps": "Props applied to the transition element. By default, the element is based on this Transition component."
- },
- "classDescriptions": {
- "root": {
- "description": "Styles applied to the root element."
- },
- "group": {
- "description": "Styles applied to {{nodeName}}.",
- "nodeName": "the transition component"
- },
- "content": {
- "description": "Styles applied to {{nodeName}}.",
- "nodeName": "the content element"
- },
- "expanded": {
- "description": "Pseudo-class applied to {{nodeName}} when {{conditions}}.",
- "nodeName": "the content element",
- "conditions": "expanded"
- },
- "selected": {
- "description": "Pseudo-class applied to {{nodeName}} when {{conditions}}.",
- "nodeName": "the content element",
- "conditions": "selected"
- },
- "focused": {
- "description": "Pseudo-class applied to {{nodeName}} when {{conditions}}.",
- "nodeName": "the content element",
- "conditions": "focused"
- },
- "disabled": {
- "description": "Pseudo-class applied to {{nodeName}} when {{conditions}}.",
- "nodeName": "the element",
- "conditions": "disabled"
- },
- "iconContainer": {
- "description": "Styles applied to {{nodeName}}.",
- "nodeName": "the tree node icon"
- },
- "label": {
- "description": "Styles applied to {{nodeName}}.",
- "nodeName": "the label element"
- }
- }
-}
diff --git a/docs/translations/api-docs/tree-item/tree-item.json b/docs/translations/api-docs/tree-item/tree-item.json
deleted file mode 100644
index 163aaa848f1dbe..00000000000000
--- a/docs/translations/api-docs/tree-item/tree-item.json
+++ /dev/null
@@ -1,67 +0,0 @@
-{
- "componentDescription": "",
- "propDescriptions": {
- "children": { "description": "The content of the component." },
- "classes": { "description": "Override or extend the styles applied to the component." },
- "collapseIcon": { "description": "The icon used to collapse the node." },
- "ContentComponent": {
- "description": "The component used for the content node.",
- "requiresRef": true
- },
- "ContentProps": { "description": "Props applied to ContentComponent" },
- "disabled": { "description": "If true, the node is disabled." },
- "endIcon": { "description": "The icon displayed next to a end node." },
- "expandIcon": { "description": "The icon used to expand the node." },
- "icon": { "description": "The icon to display next to the tree node's label." },
- "label": { "description": "The tree node label." },
- "nodeId": { "description": "The id of the node." },
- "onFocus": {
- "description": "This prop isn't supported. Use the onNodeFocus callback on the tree if you need to monitor a node's focus."
- },
- "sx": {
- "description": "The system prop that allows defining system overrides as well as additional CSS styles."
- },
- "TransitionComponent": {
- "description": "The component used for the transition. Follow this guide to learn more about the requirements for this component."
- },
- "TransitionProps": {
- "description": "Props applied to the transition element. By default, the element is based on this Transition component."
- }
- },
- "classDescriptions": {
- "root": { "description": "Styles applied to the root element." },
- "group": {
- "description": "Styles applied to {{nodeName}}.",
- "nodeName": "the transition component"
- },
- "content": {
- "description": "Styles applied to {{nodeName}}.",
- "nodeName": "the content element"
- },
- "expanded": {
- "description": "State class applied to {{nodeName}} when {{conditions}}.",
- "nodeName": "the content element",
- "conditions": "expanded"
- },
- "selected": {
- "description": "State class applied to {{nodeName}} when {{conditions}}.",
- "nodeName": "the content element",
- "conditions": "selected"
- },
- "focused": {
- "description": "State class applied to {{nodeName}} when {{conditions}}.",
- "nodeName": "the content element",
- "conditions": "focused"
- },
- "disabled": {
- "description": "State class applied to {{nodeName}} when {{conditions}}.",
- "nodeName": "the element",
- "conditions": "disabled"
- },
- "iconContainer": {
- "description": "Styles applied to {{nodeName}}.",
- "nodeName": "the tree node icon"
- },
- "label": { "description": "Styles applied to {{nodeName}}.", "nodeName": "the label element" }
- }
-}
diff --git a/docs/translations/api-docs/tree-view/tree-view-pt.json b/docs/translations/api-docs/tree-view/tree-view-pt.json
deleted file mode 100644
index 9b46510858d462..00000000000000
--- a/docs/translations/api-docs/tree-view/tree-view-pt.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "componentDescription": "",
- "propDescriptions": {
- "children": "O conteúdo do componente.",
- "classes": "Sobrescreve ou extende os estilos aplicados para o componente. Veja a API CSS abaixo para maiores detalhes.",
- "defaultCollapseIcon": "O ícone padrão usado para recolher o nó.",
- "defaultEndIcon": "O ícone padrão mostrado perto do fim do nó. Isso é aplicado para todas os nós de árvores e pode ser substituído pelo ThreeItem icon.",
- "defaultExpanded": "Expanded node ids. (Uncontrolled)",
- "defaultExpandIcon": "The default icon used to expand the node.",
- "defaultParentIcon": "The default icon displayed next to a parent node. This is applied to all parent nodes and can be overridden by the TreeItem icon prop.",
- "defaultSelected": "Selected node ids. (Uncontrolled) When multiSelect is true this takes an array of strings; when false (default) a string.",
- "disabledItemsFocusable": "If true, will allow focus on disabled items.",
- "disableSelection": "If true selection is disabled.",
- "expanded": "Expanded node ids. (Controlled)",
- "id": "This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id.",
- "multiSelect": "If true ctrl and shift will trigger multiselect.",
- "onNodeFocus": "Callback fired when tree items are focused.
Signature: function(event: object, value: string) => void event: The event source of the callback Warning: This is a generic event not a focus event. value: of the focused node.",
- "onNodeSelect": "Callback fired when tree items are selected/unselected.
Signature: function(event: object, value: array | string) => void event: The event source of the callback value: of the selected nodes. When multiSelect is true this is an array of strings; when false (default) a string.",
- "onNodeToggle": "Callback fired when tree items are expanded/collapsed.
Signature: function(event: object, nodeIds: array) => void event: The event source of the callback. nodeIds: The ids of the expanded nodes.",
- "selected": "Selected node ids. (Controlled) When multiSelect is true this takes an array of strings; when false (default) a string.",
- "sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details."
- },
- "classDescriptions": {
- "root": {
- "description": "Estilos aplicados ao elemento raiz."
- }
- }
-}
diff --git a/docs/translations/api-docs/tree-view/tree-view-zh.json b/docs/translations/api-docs/tree-view/tree-view-zh.json
deleted file mode 100644
index a155e338aa5557..00000000000000
--- a/docs/translations/api-docs/tree-view/tree-view-zh.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "componentDescription": "",
- "propDescriptions": {
- "children": "The content of the component.",
- "classes": "Override or extend the styles applied to the component. See CSS API below for more details.",
- "defaultCollapseIcon": "The default icon used to collapse the node.",
- "defaultEndIcon": "The default icon displayed next to a end node. This is applied to all tree nodes and can be overridden by the TreeItem icon prop.",
- "defaultExpanded": "Expanded node ids. (Uncontrolled)",
- "defaultExpandIcon": "The default icon used to expand the node.",
- "defaultParentIcon": "The default icon displayed next to a parent node. This is applied to all parent nodes and can be overridden by the TreeItem icon prop.",
- "defaultSelected": "Selected node ids. (Uncontrolled) When multiSelect is true this takes an array of strings; when false (default) a string.",
- "disabledItemsFocusable": "If true, will allow focus on disabled items.",
- "disableSelection": "If true selection is disabled.",
- "expanded": "Expanded node ids. (Controlled)",
- "id": "This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id.",
- "multiSelect": "If true ctrl and shift will trigger multiselect.",
- "onNodeFocus": "Callback fired when tree items are focused.
Signature: function(event: object, value: string) => void event: The event source of the callback Warning: This is a generic event not a focus event. value: of the focused node.",
- "onNodeSelect": "Callback fired when tree items are selected/unselected.
Signature: function(event: object, value: array | string) => void event: The event source of the callback value: of the selected nodes. When multiSelect is true this is an array of strings; when false (default) a string.",
- "onNodeToggle": "Callback fired when tree items are expanded/collapsed.
Signature: function(event: object, nodeIds: array) => void event: The event source of the callback. nodeIds: The ids of the expanded nodes.",
- "selected": "Selected node ids. (Controlled) When multiSelect is true this takes an array of strings; when false (default) a string.",
- "sx": "The system prop that allows defining system overrides as well as additional CSS styles. See the `sx` page for more details."
- },
- "classDescriptions": {
- "root": {
- "description": "Styles applied to the root element."
- }
- }
-}
diff --git a/docs/translations/api-docs/tree-view/tree-view.json b/docs/translations/api-docs/tree-view/tree-view.json
deleted file mode 100644
index 9c7372518f97aa..00000000000000
--- a/docs/translations/api-docs/tree-view/tree-view.json
+++ /dev/null
@@ -1,58 +0,0 @@
-{
- "componentDescription": "",
- "propDescriptions": {
- "children": { "description": "The content of the component." },
- "classes": { "description": "Override or extend the styles applied to the component." },
- "defaultCollapseIcon": { "description": "The default icon used to collapse the node." },
- "defaultEndIcon": {
- "description": "The default icon displayed next to a end node. This is applied to all tree nodes and can be overridden by the TreeItem icon prop."
- },
- "defaultExpanded": { "description": "Expanded node ids. (Uncontrolled)" },
- "defaultExpandIcon": { "description": "The default icon used to expand the node." },
- "defaultParentIcon": {
- "description": "The default icon displayed next to a parent node. This is applied to all parent nodes and can be overridden by the TreeItem icon prop."
- },
- "defaultSelected": {
- "description": "Selected node ids. (Uncontrolled) When multiSelect is true this takes an array of strings; when false (default) a string."
- },
- "disabledItemsFocusable": {
- "description": "If true, will allow focus on disabled items."
- },
- "disableSelection": { "description": "If true selection is disabled." },
- "expanded": { "description": "Expanded node ids. (Controlled)" },
- "id": {
- "description": "This prop is used to help implement the accessibility logic. If you don't provide this prop. It falls back to a randomly generated id."
- },
- "multiSelect": {
- "description": "If true ctrl and shift will trigger multiselect."
- },
- "onNodeFocus": {
- "description": "Callback fired when tree items are focused.",
- "typeDescriptions": {
- "event": "The event source of the callback Warning: This is a generic event not a focus event.",
- "value": "of the focused node."
- }
- },
- "onNodeSelect": {
- "description": "Callback fired when tree items are selected/unselected.",
- "typeDescriptions": {
- "event": "The event source of the callback",
- "nodeIds": "Ids of the selected nodes. When multiSelect is true this is an array of strings; when false (default) a string."
- }
- },
- "onNodeToggle": {
- "description": "Callback fired when tree items are expanded/collapsed.",
- "typeDescriptions": {
- "event": "The event source of the callback.",
- "nodeIds": "The ids of the expanded nodes."
- }
- },
- "selected": {
- "description": "Selected node ids. (Controlled) When multiSelect is true this takes an array of strings; when false (default) a string."
- },
- "sx": {
- "description": "The system prop that allows defining system overrides as well as additional CSS styles."
- }
- },
- "classDescriptions": { "root": { "description": "Styles applied to the root element." } }
-}
diff --git a/docs/translations/translations-pt.json b/docs/translations/translations-pt.json
index ae08b12f066018..7b866002dd9279 100644
--- a/docs/translations/translations-pt.json
+++ b/docs/translations/translations-pt.json
@@ -296,7 +296,6 @@
"/material-ui/about-the-lab": "About the lab 🧪",
"/material-ui/react-masonry": "Masonry",
"/material-ui/react-timeline": "Timeline",
- "/material-ui/react-tree-view": "Tree view",
"/material-ui/customization": "Customization",
"/material-ui/customization/theme": "Theme",
"/material-ui/customization/theming": "Theming",
diff --git a/docs/translations/translations-zh.json b/docs/translations/translations-zh.json
index c30b0201a8f6ca..cfb05484a2f749 100644
--- a/docs/translations/translations-zh.json
+++ b/docs/translations/translations-zh.json
@@ -296,7 +296,6 @@
"/material-ui/about-the-lab": "关于实验室 🧪",
"/material-ui/react-masonry": "Masonry",
"/material-ui/react-timeline": "Timeline",
- "/material-ui/react-tree-view": "Tree view",
"/material-ui/customization": "Customization",
"/material-ui/customization/theme": "Theme",
"/material-ui/customization/theming": "Theming",
diff --git a/docs/translations/translations.json b/docs/translations/translations.json
index 5421c5dec72f1f..6954460bf699c4 100644
--- a/docs/translations/translations.json
+++ b/docs/translations/translations.json
@@ -397,7 +397,6 @@
"/material-ui/about-the-lab": "About the lab 🧪",
"/material-ui/react-masonry": "Masonry",
"/material-ui/react-timeline": "Timeline",
- "/material-ui/react-tree-view": "Tree View",
"/material-ui/customization": "Customization",
"/material-ui/customization/theme": "Theme",
"/material-ui/customization/theming": "Theming",
diff --git a/examples/base-ui-nextjs-tailwind-ts/src/app/components.tsx b/examples/base-ui-nextjs-tailwind-ts/src/app/components.tsx
index a8751131922a31..86c63cae795749 100644
--- a/examples/base-ui-nextjs-tailwind-ts/src/app/components.tsx
+++ b/examples/base-ui-nextjs-tailwind-ts/src/app/components.tsx
@@ -34,7 +34,7 @@ const SelectButton = React.forwardRef(function SelectButton<
// the components exported from this file have function props which are non-serializable
// therefore they are additionally wrapped with 'use client' here
-// https://nextjs.org/docs/getting-started/react-essentials#passing-props-from-server-to-client-components-serialization
+// https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#passing-props-from-server-to-client-components-serialization
export function SelectOption(props: OptionProps) {
const {
diff --git a/package.json b/package.json
index 241bf020320f85..31a915df5af423 100644
--- a/package.json
+++ b/package.json
@@ -106,7 +106,7 @@
"@types/fs-extra": "^11.0.1",
"@types/lodash": "^4.14.197",
"@types/mocha": "^10.0.1",
- "@types/node": "^18.17.12",
+ "@types/node": "^18.17.14",
"@types/prettier": "^2.7.3",
"@types/react": "^18.2.21",
"@types/react-is": "^18.2.1",
@@ -204,7 +204,7 @@
"unist-util-visit": "^2.0.3",
"util": "^0.12.5",
"webpack": "^5.88.2",
- "webpack-bundle-analyzer": "^4.9.0",
+ "webpack-bundle-analyzer": "^4.9.1",
"webpack-cli": "^4.10.0",
"yargs": "^17.7.2",
"yarn-deduplicate": "^6.0.2"
@@ -226,7 +226,7 @@
"**/@definitelytyped/header-parser": "^0.0.169",
"**/@definitelytyped/typescript-versions": "^0.0.169",
"**/@definitelytyped/utils": "^0.0.169",
- "**/@types/node": "^18.17.12",
+ "**/@types/node": "^18.17.14",
"**/@types/react": "^18.2.21",
"**/cross-fetch": "^4.0.0"
},
diff --git a/packages/api-docs-builder/buildApi.ts b/packages/api-docs-builder/buildApi.ts
index 4b2bab7882ed38..cc02291d099a8e 100644
--- a/packages/api-docs-builder/buildApi.ts
+++ b/packages/api-docs-builder/buildApi.ts
@@ -19,7 +19,8 @@ import {
} from './buildApiUtils';
import generateComponentApi, { ReactApi } from './ApiBuilders/ComponentApiBuilder';
import generateHookApi from './ApiBuilders/HookApiBuilder';
-import { createTypeScriptProject, TypeScriptProject } from './utils/createTypeScriptProject';
+import { createTypeScriptProjectBuilder } from './utils/createTypeScriptProject';
+import { CORE_TYPESCRIPT_PROJECTS, CoreTypeScriptProjects } from './utils/coreTypeScriptProjects';
const apiDocsTranslationsDirectory = path.resolve('docs', 'translations', 'api-docs');
@@ -112,7 +113,7 @@ interface Settings {
/**
* Component directories to be used to generate API
*/
- getProjects: () => TypeScriptProject[];
+ typeScriptProjects: CoreTypeScriptProjects[];
getApiPages: () => Array<{ pathname: string }>;
getComponentInfo: (filename: string) => ComponentInfo;
getHookInfo?: (filename: string) => HookInfo;
@@ -123,18 +124,7 @@ const SETTINGS: Settings[] = [
output: {
apiManifestPath: path.join(process.cwd(), 'docs/data/material/pagesApi.js'),
},
- getProjects: () => [
- createTypeScriptProject({
- name: 'material',
- rootPath: path.join(process.cwd(), 'packages/mui-material'),
- entryPointPath: 'src/index.d.ts',
- }),
- createTypeScriptProject({
- name: 'lab',
- rootPath: path.join(process.cwd(), 'packages/mui-lab'),
- entryPointPath: 'src/index.d.ts',
- }),
- ],
+ typeScriptProjects: ['material', 'lab'],
getApiPages: () => findApiPages('docs/pages/material-ui/api'),
getComponentInfo: getMaterialComponentInfo,
},
@@ -142,13 +132,7 @@ const SETTINGS: Settings[] = [
output: {
apiManifestPath: path.join(process.cwd(), 'docs/data/base/pagesApi.js'),
},
- getProjects: () => [
- createTypeScriptProject({
- name: 'base',
- rootPath: path.join(process.cwd(), 'packages/mui-base'),
- entryPointPath: 'src/index.d.ts',
- }),
- ],
+ typeScriptProjects: ['base'],
getApiPages: () => findApiPages('docs/pages/base-ui/api'),
getComponentInfo: getBaseComponentInfo,
getHookInfo: getBaseHookInfo,
@@ -157,13 +141,7 @@ const SETTINGS: Settings[] = [
output: {
apiManifestPath: path.join(process.cwd(), 'docs/data/joy/pagesApi.js'),
},
- getProjects: () => [
- createTypeScriptProject({
- name: 'joy',
- rootPath: path.join(process.cwd(), 'packages/mui-joy'),
- entryPointPath: 'src/index.ts',
- }),
- ],
+ typeScriptProjects: ['joy'],
getApiPages: () => findApiPages('docs/pages/joy-ui/api'),
getComponentInfo: getJoyComponentInfo,
},
@@ -171,13 +149,7 @@ const SETTINGS: Settings[] = [
output: {
apiManifestPath: path.join(process.cwd(), 'docs/data/system/pagesApi.js'),
},
- getProjects: () => [
- createTypeScriptProject({
- name: 'system',
- rootPath: path.join(process.cwd(), 'packages/mui-system'),
- entryPointPath: 'src/index.d.ts',
- }),
- ],
+ typeScriptProjects: ['system'],
getApiPages: () => findApiPages('docs/pages/system/api'),
getComponentInfo: getSystemComponentInfo,
},
@@ -187,13 +159,12 @@ type CommandOptions = { grep?: string };
async function run(argv: yargs.ArgumentsCamelCase) {
const grep = argv.grep == null ? null : new RegExp(argv.grep);
+ const buildTypeScriptProject = createTypeScriptProjectBuilder(CORE_TYPESCRIPT_PROJECTS);
+
let allBuilds: Array> = [];
await SETTINGS.reduce(async (resolvedPromise, setting) => {
await resolvedPromise;
- /**
- * @type {string[]}
- */
- const projects = setting.getProjects();
+ const projects = setting.typeScriptProjects.map((project) => buildTypeScriptProject(project));
const apiPagesManifestPath = setting.output.apiManifestPath;
const manifestDir = apiPagesManifestPath.match(/(.*)\/[^/]+\./)?.[1];
diff --git a/packages/api-docs-builder/package.json b/packages/api-docs-builder/package.json
index 2f7e128933bc5a..e0fcaf8f1c9ca2 100644
--- a/packages/api-docs-builder/package.json
+++ b/packages/api-docs-builder/package.json
@@ -20,7 +20,7 @@
},
"devDependencies": {
"@types/mocha": "^10.0.1",
- "@types/node": "^18.17.12",
+ "@types/node": "^18.17.14",
"chai": "^4.3.8",
"sinon": "^15.2.0",
"typescript": "^5.1.6"
diff --git a/packages/api-docs-builder/utils/coreTypeScriptProjects.ts b/packages/api-docs-builder/utils/coreTypeScriptProjects.ts
new file mode 100644
index 00000000000000..575f3d9fa2665b
--- /dev/null
+++ b/packages/api-docs-builder/utils/coreTypeScriptProjects.ts
@@ -0,0 +1,45 @@
+import path from 'path';
+import { CreateTypeScriptProjectOptions } from './createTypeScriptProject';
+
+export type CoreTypeScriptProjects =
+ | 'material'
+ | 'lab'
+ | 'base'
+ | 'joy'
+ | 'system'
+ | 'material-next'
+ | 'docs';
+
+export const CORE_TYPESCRIPT_PROJECTS: Record<
+ CoreTypeScriptProjects,
+ Omit
+> = {
+ material: {
+ rootPath: path.join(process.cwd(), 'packages/mui-material'),
+ entryPointPath: 'src/index.d.ts',
+ },
+ lab: {
+ rootPath: path.join(process.cwd(), 'packages/mui-lab'),
+ entryPointPath: 'src/index.d.ts',
+ },
+ base: {
+ rootPath: path.join(process.cwd(), 'packages/mui-base'),
+ entryPointPath: 'src/index.d.ts',
+ },
+ joy: {
+ rootPath: path.join(process.cwd(), 'packages/mui-joy'),
+ entryPointPath: 'src/index.ts',
+ },
+ system: {
+ rootPath: path.join(process.cwd(), 'packages/mui-system'),
+ entryPointPath: 'src/index.d.ts',
+ },
+ 'material-next': {
+ rootPath: path.join(process.cwd(), 'packages/mui-material-next'),
+ entryPointPath: 'src/index.ts',
+ },
+ docs: {
+ rootPath: path.join(process.cwd(), 'docs'),
+ tsConfigPath: 'tsconfig.json',
+ },
+};
diff --git a/packages/api-docs-builder/utils/createTypeScriptProject.ts b/packages/api-docs-builder/utils/createTypeScriptProject.ts
index f6c19d309cdd54..6a0cc4b54ce209 100644
--- a/packages/api-docs-builder/utils/createTypeScriptProject.ts
+++ b/packages/api-docs-builder/utils/createTypeScriptProject.ts
@@ -10,7 +10,7 @@ export interface TypeScriptProject {
checker: ts.TypeChecker;
}
-interface CreateTypeScriptProjectOptions {
+export interface CreateTypeScriptProjectOptions {
name: string;
rootPath: string;
/**
@@ -21,9 +21,15 @@ interface CreateTypeScriptProjectOptions {
tsConfigPath?: string;
/**
* File used as root of the package.
+ * This property is used to gather the exports of the project.
* The path must be relative to the root path.
*/
- entryPointPath: string;
+ entryPointPath?: string;
+ /**
+ * Files to include in the project.
+ * By default, it will use the files defined in the tsconfig.
+ */
+ files?: string[];
}
export const createTypeScriptProject = (
@@ -33,11 +39,11 @@ export const createTypeScriptProject = (
name,
rootPath,
tsConfigPath: inputTsConfigPath = 'tsconfig.build.json',
- entryPointPath: inputEntryPointPath = 'src/index.ts',
+ entryPointPath: inputEntryPointPath,
+ files,
} = options;
const tsConfigPath = path.join(rootPath, inputTsConfigPath);
- const entryPointPath = path.join(rootPath, inputEntryPointPath);
const tsConfigFile = ts.readConfigFile(tsConfigPath, (filePath) =>
fs.readFileSync(filePath).toString(),
@@ -47,6 +53,13 @@ export const createTypeScriptProject = (
throw tsConfigFile.error;
}
+ // The build config does not parse the `.d.ts` files, but we sometimes need them to get the exports.
+ if (tsConfigFile.config.exclude) {
+ tsConfigFile.config.exclude = tsConfigFile.config.exclude.filter(
+ (pattern: string) => pattern !== 'src/**/*.d.ts',
+ );
+ }
+
const tsConfigFileContent = ts.parseJsonConfigFileContent(
tsConfigFile.config,
ts.sys,
@@ -58,18 +71,25 @@ export const createTypeScriptProject = (
}
const program = ts.createProgram({
- rootNames: [entryPointPath],
+ rootNames: files ?? tsConfigFileContent.fileNames,
options: tsConfigFileContent.options,
});
const checker = program.getTypeChecker();
- const sourceFile = program.getSourceFile(entryPointPath);
- const exports = Object.fromEntries(
- checker.getExportsOfModule(checker.getSymbolAtLocation(sourceFile!)!).map((symbol) => {
- return [symbol.name, symbol];
- }),
- );
+ let exports: TypeScriptProject['exports'];
+ if (inputEntryPointPath) {
+ const entryPointPath = path.join(rootPath, inputEntryPointPath);
+ const sourceFile = program.getSourceFile(entryPointPath);
+
+ exports = Object.fromEntries(
+ checker.getExportsOfModule(checker.getSymbolAtLocation(sourceFile!)!).map((symbol) => {
+ return [symbol.name, symbol];
+ }),
+ );
+ } else {
+ exports = {};
+ }
return {
name,
@@ -79,3 +99,28 @@ export const createTypeScriptProject = (
checker,
};
};
+
+export const createTypeScriptProjectBuilder =