diff --git a/.circleci/config.yml b/.circleci/config.yml index e2d955df8d7671..64827aa7989ec8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -258,12 +258,6 @@ jobs: - run: name: '`pnpm proptypes` changes committed?' command: git add -A && git diff --exit-code --staged - - run: - name: 'Write "use client" directive' - command: pnpm rsc:build - - run: - name: '`pnpm rsc:build` changes committed?' - command: git add -A && git diff --exit-code --staged - run: name: Generate the documentation command: pnpm docs:api diff --git a/.eslintrc.js b/.eslintrc.js index b713ca81aa0d62..24f8b126a74ca9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -343,6 +343,7 @@ module.exports = /** @type {Config} */ ({ patterns: NO_RESTRICTED_IMPORTS_PATTERNS_DEEPLY_NESTED, }, ], + 'no-irregular-whitespace': ['error', { skipJSXText: true, skipStrings: true }], }, }, { @@ -407,6 +408,21 @@ module.exports = /** @type {Config} */ ({ 'react/prop-types': 'off', }, }, + { + files: ['packages/*/src/*/*.?(c|m)[jt]s?(x)'], + excludedFiles: [ + '*.spec.*', + '*.test.*', + // deprecated library + '**/mui-base/**/*', + '**/mui-joy/**/*', + // used internally, not used on app router yet + '**/mui-docs/**/*', + ], + rules: { + 'material-ui/disallow-react-api-in-server-components': 'error', + }, + }, { files: ['packages/*/src/**/*.?(c|m)[jt]s?(x)'], excludedFiles: '*.spec.*', @@ -519,6 +535,7 @@ module.exports = /** @type {Config} */ ({ 'import/no-default-export': 'error', 'import/prefer-default-export': 'off', 'react-compiler/react-compiler': 'off', + 'no-irregular-whitespace': ['error', { skipComments: true }], }, }, { @@ -544,6 +561,7 @@ module.exports = /** @type {Config} */ ({ // Reset the default until https://github.com/jsx-eslint/eslint-plugin-react/issues/3672 is fixed. 'react/jsx-no-target-blank': ['error', { allowReferrer: false }], 'react/prop-types': 'off', + 'no-irregular-whitespace': ['error', { skipJSXText: true, skipStrings: true }], }, }, { diff --git a/CHANGELOG.md b/CHANGELOG.md index 44e6ec48f8ee05..89a32d54584f00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,47 @@ # [Versions](https://mui.com/versions/) +## 6.4.1 + + + +_Jan 21, 2025_ + +A big thanks to the 9 contributors who made this release possible. + +### `@mui/material@6.4.1` + +- [ButtonBase] Export types used in ButtonBase props (#43530) @Janpot +- [Dialog] Add slots and slotProps (#44792) @sai6855 +- [Drawer] Deprecate composed classes (#44870) @yash49 +- [IconButton] Set default loading to `null` (#45057) @siriwatknp +- [ListItem] Add codemod for deprecated props (#45022) @sai6855 +- [Modal] Add migration guide and codemod for deprecated props (#45021) @sai6855 +- [TextField] Fix filled state to be synced with autofill (#44135) @DiegoAndai + +### `@mui/system@6.4.1` + +- Fix dark mode flicker using `useEnhancedEffect` (#44812) @siriwatknp + +### `@mui/utils@6.4.1` + +- Do not deep merge React component (#45058) @siriwatknp + +### Docs + +- Fix typo (#45070) @Fullchee +- Improve Toolpad templates section (#44914) @bharatkashyap +- Fix expand / collapse icons orientation (#44989) @zanivan +- Rename "Base UI" to "MUI Base" in all text (#45060) @mj12albert +- Add @mui/base deprecation callout (#45030) @mj12albert +- Update @mui/base deprecation message (#45064) @mj12albert + +### Core + +- [code-infra] Add "use client" directive to files with React APIs (#45036) @Janpot +- [docs] 301 redirect `/base-ui` to `base-ui.com` (#45061) @mj12albert + +All contributors of this release in alphabetical order: @bharatkashyap, @DiegoAndai, @Fullchee, @Janpot, @mj12albert, @sai6855, @siriwatknp, @yash49, @zanivan + ## 6.4.0 diff --git a/CHANGELOG.old.md b/CHANGELOG.old.md index e6c33fcc2fe53c..a8ad16b0f31721 100644 --- a/CHANGELOG.old.md +++ b/CHANGELOG.old.md @@ -3151,7 +3151,7 @@ A big thanks to the 12 contributors who made this release possible. Here are som - [docs][base] Remove usage of `component` prop in docs (#37462) @sai6855 - [docs] Fix docs redirections @oliviertassinari - [docs] Fix Fluent -> Fluent UI @oliviertassinari -- [docs] Fix MUI Base -> Base UI @oliviertassinari +- [docs] Fix MUI Base -> Base UI @oliviertassinari - [docs] Add base-vite-tailwind example repo (#36994) @mj12albert - [docs] Fix search bar layout shift (#37460) @oliviertassinari - [docs] Tweak Material UI's "Showcase" page design (#37259) @danilo-leal @@ -3366,7 +3366,7 @@ A big thanks to the 18 contributors who made this release possible. Here are som ### Core -- [blog] Fix images using "MUI Base" instead of "Base UI" (#37044) @danilo-leal +- [blog] Fix images using "MUI Base" instead of "Base UI" (#37044) @danilo-leal - [core] Add VS Code extensions recommendations (#37166) @michaldudak - [test] `e2e-website` related minor fixes (#37204) @ZeeshanTamboli @@ -3671,7 +3671,7 @@ A big thanks to the 9 contributors who made this release possible. Here are some ### Core - [core] Increase margin to scroll @oliviertassinari -- [core] Replace MUI Base with Base UI (#36716) @mnajdova +- [core] Replace MUI Base with Base UI (#36716) @mnajdova All contributors of this release in alphabetical order: @alirezahekmati, @danilo-leal, @hbjORbj, @Lioness100, @mnajdova, @oliviertassinari, @sai6855, @siriwatknp, @ZeeshanTamboli @@ -3711,7 +3711,7 @@ A big thanks to the 17 contributors who made this release possible. Here are som - [docs][base] Move styles to the bottom of demos code for `Menu` (#36582) @gitstart - [docs][base] Move styles code to bottom in the `Button` demos (#36590) @sai6855 - [docs][base] Show components & hooks API on the components page (#35938) @mnajdova -- [docs] Describe slotProps in MUI Base customization doc (#36206) @michaldudak +- [docs] Describe slotProps in MUI Base customization doc (#36206) @michaldudak - [docs] Fix double API page redirection (#36743) @oliviertassinari - [docs] Remove hash property and leverage pathname (#36764) @siriwatknp - [docs] Introduce markdown permalink to source (#36729) @oliviertassinari diff --git a/apps/pigment-css-vite-app/package.json b/apps/pigment-css-vite-app/package.json index 0d7c16771bb328..4236fbac0a30e2 100644 --- a/apps/pigment-css-vite-app/package.json +++ b/apps/pigment-css-vite-app/package.json @@ -34,7 +34,7 @@ "@vitejs/plugin-react": "^4.3.4", "postcss": "^8.4.49", "postcss-combine-media-query": "^1.0.1", - "vite": "5.4.11", + "vite": "5.4.12", "vite-plugin-node-polyfills": "0.22.0", "vite-plugin-pages": "^0.32.4" }, diff --git a/babel.config.js b/babel.config.js index 0b0e796d325601..8470913d067886 100644 --- a/babel.config.js +++ b/babel.config.js @@ -149,7 +149,7 @@ module.exports = function getBabelConfig(api) { ignore: [/@babel[\\|/]runtime/], // Fix a Windows issue. overrides: [ { - exclude: /\.test\.(js|ts|tsx)$/, + exclude: /\.test\.(m?js|ts|tsx)$/, plugins: ['@babel/plugin-transform-react-constant-elements'], }, { diff --git a/docs/README.md b/docs/README.md index 309763c7392c32..e564a475ff68fe 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ # Docs -This is the website of the company (MUI), the documentation of Material UI, Base UI, MUI System, and Joy UI. +This is the website of the company (MUI), the documentation of Material UI, MUI Base, MUI System, and Joy UI. To start the docs site in development mode, from the project root, run: diff --git a/docs/config.d.ts b/docs/config.d.ts deleted file mode 100644 index 605606f1179e10..00000000000000 --- a/docs/config.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export const LANGUAGES: string[]; - -export const LANGUAGES_SSR: string[]; - -export const LANGUAGES_IN_PROGRESS: string[]; - -export const LANGUAGES_IGNORE_PAGES: (pathname: string) => boolean; diff --git a/docs/config.js b/docs/config.ts similarity index 59% rename from docs/config.js rename to docs/config.ts index 3dfdb2d1a01e72..d950bbe163cb78 100644 --- a/docs/config.js +++ b/docs/config.ts @@ -1,13 +1,13 @@ // Valid languages to server-side render in production -const LANGUAGES = ['en']; +export const LANGUAGES = ['en']; // Server side rendered languages -const LANGUAGES_SSR = ['en']; +export const LANGUAGES_SSR = ['en']; // Work in progress -const LANGUAGES_IN_PROGRESS = LANGUAGES.slice(); +export const LANGUAGES_IN_PROGRESS = LANGUAGES.slice(); -const LANGUAGES_IGNORE_PAGES = (pathname) => { +export const LANGUAGES_IGNORE_PAGES = (pathname: string) => { // We don't have the bandwidth like Qt to translate our blog posts // https://www.qt.io/zh-cn/blog if (pathname === '/blog' || pathname.startsWith('/blog/')) { @@ -20,10 +20,3 @@ const LANGUAGES_IGNORE_PAGES = (pathname) => { return false; }; - -module.exports = { - LANGUAGES, - LANGUAGES_IN_PROGRESS, - LANGUAGES_SSR, - LANGUAGES_IGNORE_PAGES, -}; diff --git a/docs/data/base/all-components/all-components.md b/docs/data/base/all-components/all-components.md index 99c56c2df357e6..9337626c4209f1 100644 --- a/docs/data/base/all-components/all-components.md +++ b/docs/data/base/all-components/all-components.md @@ -1,5 +1,5 @@ -# Base UI components +# MUI Base components -

Every Base UI component available so far, sorted alphabetically.

+

Every MUI Base component available so far, sorted alphabetically.

{{"component": "modules/components/BaseUIComponents.js"}} diff --git a/docs/data/base/components/accordion/accordion.md b/docs/data/base/components/accordion/accordion.md index a8b814bb190c27..c86be4ca32ea62 100644 --- a/docs/data/base/components/accordion/accordion.md +++ b/docs/data/base/components/accordion/accordion.md @@ -3,12 +3,10 @@ productId: base-ui title: React Accordion component githubLabel: 'component: accordion' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/accordion/ +newUrl: https://base-ui.com/react/components/accordion +newName: Accordion --- -# Accordion 🚧 +# Accordion

Accordions let users show and hide sections of related content on a page.

- -:::warning -The Base UI Accordion component isn't available yet, but you can upvote [this GitHub issue](https://github.com/mui/base-ui/issues/25) to see it arrive sooner. -::: diff --git a/docs/data/base/components/autocomplete/autocomplete.md b/docs/data/base/components/autocomplete/autocomplete.md index 27a444d18a48aa..bd078c74054ae2 100644 --- a/docs/data/base/components/autocomplete/autocomplete.md +++ b/docs/data/base/components/autocomplete/autocomplete.md @@ -18,7 +18,7 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/ An autocomplete component is an enhanced text input that shows a list of suggested options as users type and lets them select an option from the list. -Base UI provides the `useAutocomplete` hook for building a custom Autocomplete. +MUI Base provides the `useAutocomplete` hook for building a custom Autocomplete. It implements the WAI-ARIA Combobox pattern and is typically used to assist users in completing form inputs or search queries faster. {{"demo": "AutocompleteIntroduction", "defaultCodeOpen": false, "bg": "gradient"}} @@ -102,9 +102,9 @@ Learn more about controlled and uncontrolled components in the [React documentat React Portals can be used to render the listbox outside of the DOM hierarchy, making it easier to allow it to "float" above adjacent elements. -Base UI provides a [Popper](/base-ui/react-popper/) component built around React's `createPortal()` for exactly this purpose, and additionally helps you manage keyboard focus as it moves in and out of the portal. +MUI Base provides a [Popper](/base-ui/react-popper/) component built around React's `createPortal()` for exactly this purpose, and additionally helps you manage keyboard focus as it moves in and out of the portal. -To render the listbox in Base UI's Popper, the `ref`s must be merged as follows: +To render the listbox in MUI Base's Popper, the `ref`s must be merged as follows: ```jsx import { useAutocomplete } from '@mui/base/useAutocomplete'; diff --git a/docs/data/base/components/button/button.md b/docs/data/base/components/button/button.md index 13b27adfd84093..966c86d2d8fd32 100644 --- a/docs/data/base/components/button/button.md +++ b/docs/data/base/components/button/button.md @@ -127,7 +127,7 @@ You can even use SVGs, as shown in the demo below: ### Using with links -The following demo illustrates how to use the Button as a link, whether using the Base UI Button itself for the `href`, or with the [Next.js Link component](https://nextjs.org/docs/pages/api-reference/components/link): +The following demo illustrates how to use the Button as a link, whether using the MUI Base Button itself for the `href`, or with the [Next.js Link component](https://nextjs.org/docs/pages/api-reference/components/link): {{"demo": "UnstyledLinkButton.js", "defaultCodeOpen": true}} @@ -142,7 +142,7 @@ Instead, `aria-disabled` is used, which makes the Button focusable. This should be used whenever the disabled Button needs to be read by screen readers. -Base UI uses this prop internally in [menu items](/base-ui/react-menu/), making it possible to use the keyboard to navigate to disabled items (in compliance with [ARIA guidelines](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols)). +MUI Base uses this prop internally in [menu items](/base-ui/react-menu/), making it possible to use the keyboard to navigate to disabled items (in compliance with [ARIA guidelines](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols)). The following demo shows how the `focusableWhenDisabled` prop works—use the Tab key to navigate within this document to see that only the second Button accepts the focus: diff --git a/docs/data/base/components/checkbox/checkbox.md b/docs/data/base/components/checkbox/checkbox.md index 56ce9d252acf15..badac67d5c9356 100644 --- a/docs/data/base/components/checkbox/checkbox.md +++ b/docs/data/base/components/checkbox/checkbox.md @@ -3,12 +3,10 @@ productId: base-ui title: React Checkbox component githubLabel: 'component: checkbox' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/ +newUrl: https://base-ui.com/react/components/checkbox +newName: Checkbox --- -# Checkbox 🚧 +# Checkbox

Checkboxes give users binary choices when presented with multiple options in a series.

- -:::warning -The Base UI Checkbox component isn't available yet, but you can upvote [this GitHub issue](https://github.com/mui/base-ui/issues/24) to see it arrive sooner. -::: diff --git a/docs/data/base/components/drawer/drawer.md b/docs/data/base/components/drawer/drawer.md index 92f3253ea7d435..9add0473f583fa 100644 --- a/docs/data/base/components/drawer/drawer.md +++ b/docs/data/base/components/drawer/drawer.md @@ -4,10 +4,10 @@ title: React Drawer component githubLabel: 'component: drawer' --- -# Drawer 🚧 +# Drawer

Navigation drawers (also known as sidebars) provide ergonomic access to different destinations without taking the user out of context.

-:::warning -The Base UI Drawer component isn't available yet, but you can upvote [this GitHub issue](https://github.com/mui/base-ui/issues/38) to see it arrive sooner. +:::error +@mui/base has been deprecated and replaced by MUI Base. Please follow [this GitHub issue](https://github.com/mui/base-ui/issues/38) to track the development of the Drawer component. ::: diff --git a/docs/data/base/components/form-control/form-control.md b/docs/data/base/components/form-control/form-control.md index 0179ebdb4e1d54..a9d4d5625cda26 100644 --- a/docs/data/base/components/form-control/form-control.md +++ b/docs/data/base/components/form-control/form-control.md @@ -4,6 +4,8 @@ title: React Form Control component and hook components: FormControl hooks: useFormControlContext githubLabel: 'component: FormControl' +newUrl: https://base-ui.com/react/components/field +newName: Field --- # Form Control diff --git a/docs/data/base/components/input/input.md b/docs/data/base/components/input/input.md index c5889e5340f340..751259acbf8c40 100644 --- a/docs/data/base/components/input/input.md +++ b/docs/data/base/components/input/input.md @@ -4,6 +4,8 @@ title: React Input component and hook components: Input hooks: useInput githubLabel: 'component: input' +newUrl: https://base-ui.com/react/components/input +newName: Input --- # Input diff --git a/docs/data/base/components/menu/menu.md b/docs/data/base/components/menu/menu.md index fe7892d6fc09a3..bc4c8af92c4285 100644 --- a/docs/data/base/components/menu/menu.md +++ b/docs/data/base/components/menu/menu.md @@ -5,6 +5,8 @@ components: Menu, MenuItem, MenuButton, Dropdown hooks: useMenu, useMenuItem, useMenuButton, useDropdown, useMenuItemContextStabilizer githubLabel: 'component: menu' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/ +newUrl: https://base-ui.com/react/components/menu +newName: Menu --- # Menu @@ -17,7 +19,7 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/ ## Introduction -The Base UI Dropdown Menu is implemented using a collection of related components: +The MUI Base Dropdown Menu is implemented using a collection of related components: - Dropdown - The outermost container that houses all Menu components. - Menu Button - The button that toggles the visibility of the Menu. diff --git a/docs/data/base/components/modal/modal.md b/docs/data/base/components/modal/modal.md index d902ca920e1129..6cf67aed698078 100644 --- a/docs/data/base/components/modal/modal.md +++ b/docs/data/base/components/modal/modal.md @@ -5,6 +5,8 @@ components: Modal hooks: useModal githubLabel: 'component: modal' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/ +newUrl: https://base-ui.com/react/components/dialog +newName: Dialog --- # Modal diff --git a/docs/data/base/components/number-input/number-input.md b/docs/data/base/components/number-input/number-input.md index a69f324e3e4db4..275d38cb1dc612 100644 --- a/docs/data/base/components/number-input/number-input.md +++ b/docs/data/base/components/number-input/number-input.md @@ -4,6 +4,8 @@ title: React Number Input component and hook components: NumberInput hooks: useNumberInput githubLabel: 'component: number input' +newUrl: https://base-ui.com/react/components/number-field +newName: Number Field --- # Number Input @@ -17,7 +19,7 @@ githubLabel: 'component: number input' ## Introduction A number input is a UI element that accepts numeric values from the user. -Base UI's Number Input component is a customizable replacement for the native HTML `` that solves common usability issues of its native counterpart, such as: +MUI Base's Number Input component is a customizable replacement for the native HTML `` that solves common usability issues of its native counterpart, such as: - Inconsistencies across browsers in the appearance and behavior of the stepper buttons - Allowing certain non-numeric characters ('e', '+', '-', '.') and silently discarding others @@ -41,7 +43,7 @@ The following demo shows how to create a Number Input component, apply some styl ### Anatomy -The Base UI Number Input component consists of four slots: +The MUI Base Number Input component consists of four slots: - `root`: an outer `
` containing the other interior slots - `input`: an `` element @@ -137,7 +139,7 @@ If you only define one or the other, the opposite end of the range will be open- ``` -The demo below shows a Number Input with a an accepted range of 1 to 99: +The demo below shows a Number Input with an accepted range of 1 to 99: {{"demo": "QuantityInput.js", "defaultCodeOpen": false}} diff --git a/docs/data/base/components/pagination/pagination.md b/docs/data/base/components/pagination/pagination.md index 92283c4d830678..425a6a7e550039 100644 --- a/docs/data/base/components/pagination/pagination.md +++ b/docs/data/base/components/pagination/pagination.md @@ -8,6 +8,6 @@ githubLabel: 'component: Pagination'

The Pagination component lets the user select a specific page from a range of pages.

-:::warning -The Base UI Pagination component isn't available yet, but you can upvote [this GitHub issue](https://github.com/mui/base-ui/issues/29) to see it arrive sooner. +:::error +@mui/base has been deprecated and replaced by MUI Base. Please follow [this GitHub issue](https://github.com/mui/base-ui/issues/29) to track the development of the Pagination component. ::: diff --git a/docs/data/base/components/popper/popper.md b/docs/data/base/components/popper/popper.md index 082f0cb07edaeb..ffc71167003de2 100644 --- a/docs/data/base/components/popper/popper.md +++ b/docs/data/base/components/popper/popper.md @@ -4,6 +4,8 @@ title: React Popper component components: Popper githubLabel: 'component: Popper' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/ +newUrl: https://base-ui.com/react/components/popover +newName: Popover --- # Popper @@ -23,7 +25,7 @@ It relies on the third-party library ([Popper.js v2](https://popper.js.org/docs/ The Popper.js library is no longer maintained. It has been replaced by a new library: [Floating UI](https://floating-ui.com/). -Base UI offers the [Popup](/base-ui/react-popup/) component based on this new library. +MUI Base offers the [Popup](/base-ui/react-popup/) component based on this new library. It has features and an API similar to the Popper component, but is still in development and its API may change. Once the [Popup](/base-ui/react-popup/) is stable, we will deprecate and, later, remove our Popper component. diff --git a/docs/data/base/components/popup/popup.md b/docs/data/base/components/popup/popup.md index b48c0344a1afb5..f2011dad29eb4b 100644 --- a/docs/data/base/components/popup/popup.md +++ b/docs/data/base/components/popup/popup.md @@ -4,6 +4,8 @@ title: React Popup component components: Popup githubLabel: 'component: popup' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/ +newUrl: https://base-ui.com/react/components/popover +newName: Popover --- # Popup @@ -22,7 +24,7 @@ It relies on the third-party [Floating UI](https://floating-ui.com/) library for {{"demo": "UnstyledPopupIntroduction", "defaultCodeOpen": false, "bg": "gradient"}} :::info -The Popup component, once stable, is intended to replace the [Popper](/base-ui/react-popper/) component, which will be phased out in a future release of Base UI. +The Popup component, once stable, is intended to replace the [Popper](/base-ui/react-popper/) component, which will be phased out in a future release of MUI Base. ::: ## Component @@ -61,7 +63,7 @@ Try changing this value to `top` in the interactive demo below to see how it wor ### Transitions You can animate the opening and closing of the Popup using CSS transitions, CSS animations, or third-party animation libraries. -It supports the API described on the [Base UI Transitions](/base-ui/react-transitions/) page. +It supports the API described on the [MUI Base Transitions](/base-ui/react-transitions/) page. ### Disable portal diff --git a/docs/data/base/components/radio-group/radio-group.md b/docs/data/base/components/radio-group/radio-group.md index 0deac10f94b3bf..6b7c9b6100cf57 100644 --- a/docs/data/base/components/radio-group/radio-group.md +++ b/docs/data/base/components/radio-group/radio-group.md @@ -3,12 +3,10 @@ productId: base-ui title: React Radio Group component githubLabel: 'component: radio' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/radio/ +newUrl: https://base-ui.com/react/components/radio +newName: Radio --- -# Radio Group 🚧 +# Radio Group

Radio buttons enable the user to select one option from a set.

- -:::warning -The Base UI Radio Group component isn't available yet, but you can upvote [this GitHub issue](https://github.com/mui/base-ui/issues/26) to see it arrive sooner. -::: diff --git a/docs/data/base/components/rating/rating.md b/docs/data/base/components/rating/rating.md index 08132d5682ff06..16b3aee9845836 100644 --- a/docs/data/base/components/rating/rating.md +++ b/docs/data/base/components/rating/rating.md @@ -5,10 +5,10 @@ githubLabel: 'component: rating' waiAria: https://www.w3.org/WAI/tutorials/forms/custom-controls/#a-star-rating --- -# Rating 🚧 +# Rating

Rating components provide users with a simple action to give feedback as well as assess the opinions of others.

-:::warning -The Base UI Rating component isn't available yet, but you can upvote [this GitHub issue](https://github.com/mui/base-ui/issues/30) to see it arrive sooner. +:::error +@mui/base has been deprecated and replaced by MUI Base. Please follow [this GitHub issue](https://github.com/mui/base-ui/issues/30) to track the development of the Rating component. ::: diff --git a/docs/data/base/components/select/select.md b/docs/data/base/components/select/select.md index c7202804dbca7e..f81cda39b7fdd2 100644 --- a/docs/data/base/components/select/select.md +++ b/docs/data/base/components/select/select.md @@ -5,6 +5,8 @@ components: Select, Option, OptionGroup hooks: useSelect, useOption, useOptionContextStabilizer githubLabel: 'component: select' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/ +newUrl: https://base-ui.com/react/components/select +newName: Select --- # Select @@ -19,7 +21,7 @@ waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-sel A select is a UI element that gives users a list of options to choose from. -Base UI's Select component replaces the native HTML `` tag. It also includes the Option component for creating the options in the list, and Option Group for grouping those options. {{"demo": "UnstyledSelectIntroduction", "defaultCodeOpen": false, "bg": "gradient"}} @@ -93,9 +95,9 @@ The uncontrolled component accepts the `defaultValue` that can be used to set th To deselect all values, pass `null` to the respective prop. :::warning -This pattern is where Base UI's Select differs from the equivalent [Material UI component](/material-ui/react-select/). +This pattern is where MUI Base's Select differs from the equivalent [Material UI component](/material-ui/react-select/). The Material UI Select takes an empty string to deselect all values. -In Base UI, you must use `null` to achieve this. +In MUI Base, you must use `null` to achieve this. ::: ### Object values diff --git a/docs/data/base/components/slider/slider.md b/docs/data/base/components/slider/slider.md index 5f7ac3b64af6aa..6d42bb8dec8e2c 100644 --- a/docs/data/base/components/slider/slider.md +++ b/docs/data/base/components/slider/slider.md @@ -5,6 +5,8 @@ components: Slider hooks: useSlider githubLabel: 'component: slider' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/slider-multithumb/ +newUrl: https://base-ui.com/react/components/slider +newName: Slider --- # Slider diff --git a/docs/data/base/components/switch/switch.md b/docs/data/base/components/switch/switch.md index d93177616509a9..3d719a13f00267 100644 --- a/docs/data/base/components/switch/switch.md +++ b/docs/data/base/components/switch/switch.md @@ -5,6 +5,8 @@ components: Switch hooks: useSwitch githubLabel: 'component: switch' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/switch/ +newUrl: https://base-ui.com/react/components/switch +newName: Switch --- # Switch diff --git a/docs/data/base/components/tabs/tabs.md b/docs/data/base/components/tabs/tabs.md index bb5bf1c80abf74..b27caf5ef9b36f 100644 --- a/docs/data/base/components/tabs/tabs.md +++ b/docs/data/base/components/tabs/tabs.md @@ -5,6 +5,8 @@ components: Tabs, Tab, TabPanel, TabsList hooks: useTab, useTabPanel, useTabs, useTabsList githubLabel: 'component: tabs' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/tabs/ +newUrl: https://base-ui.com/react/components/tabs +newName: Tabs --- # Tabs diff --git a/docs/data/base/components/toggle-button-group/toggle-button-group.md b/docs/data/base/components/toggle-button-group/toggle-button-group.md index 4fa0dada8546c8..b72b7760f9bf7f 100644 --- a/docs/data/base/components/toggle-button-group/toggle-button-group.md +++ b/docs/data/base/components/toggle-button-group/toggle-button-group.md @@ -2,12 +2,10 @@ productId: base-ui title: React Toggle Button Group component githubLabel: 'component: toggle button' +newUrl: https://base-ui.com/react/components/toggle-group +newName: Toggle Group --- -# Toggle Button Group 🚧 +# Toggle Button Group

Toggle Button Groups house sets of buttons with mutually exclusive actions.

- -:::warning -The Base UI Toggle Button Group component isn't available yet, but you can upvote [this GitHub issue](https://github.com/mui/base-ui/issues/31) to see it arrive sooner. -::: diff --git a/docs/data/base/components/tooltip/tooltip.md b/docs/data/base/components/tooltip/tooltip.md index 02ea58050debca..9815db3e031ae4 100644 --- a/docs/data/base/components/tooltip/tooltip.md +++ b/docs/data/base/components/tooltip/tooltip.md @@ -3,12 +3,10 @@ productId: base-ui title: React Tooltip component githubLabel: 'component: tooltip' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/ +newUrl: https://base-ui.com/react/components/tooltip +newName: Tooltip --- -# Tooltip 🚧 +# Tooltip

Tooltips display informative text when users hover over, focus on, or tap an element.

- -:::warning -The Base UI Tooltip component isn't available yet, but you can upvote [this GitHub issue](https://github.com/mui/base-ui/issues/32) to see it arrive sooner. -::: diff --git a/docs/data/base/components/transitions/transitions.md b/docs/data/base/components/transitions/transitions.md index f2a55ded2b83ec..f19ad074df70fc 100644 --- a/docs/data/base/components/transitions/transitions.md +++ b/docs/data/base/components/transitions/transitions.md @@ -13,7 +13,7 @@ hooks: useTransitionTrigger, useTransitionStateManager ## Introduction -Base UI offers higher-level components and low-level hooks that can be used to add animations to components as they enter and exit the screen. +MUI Base offers higher-level components and low-level hooks that can be used to add animations to components as they enter and exit the screen. :::info The [Popup](/base-ui/react-popup/) is currently the only component that supports this API; [Select](/base-ui/react-select/) and [Menu](/base-ui/react-menu/) support will be added next. @@ -21,7 +21,7 @@ The [Popup](/base-ui/react-popup/) is currently the only component that supports ## Components -Base UI offers two components to cover the majority of use cases using [CSS transitions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_transitions/Using_CSS_transitions) and [animations](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animations/Using_CSS_animations). +MUI Base offers two components to cover the majority of use cases using [CSS transitions](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_transitions/Using_CSS_transitions) and [animations](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animations/Using_CSS_animations). ### CSS Transition @@ -74,6 +74,6 @@ You can use any of the [transitions from Material UI](/material-ui/transitions/ ### React Spring -React Spring, another popular animation library, also can be used with the Base UI transitions API. +React Spring, another popular animation library, also can be used with the MUI Base transitions API. {{"demo": "ReactSpring.js"}} diff --git a/docs/data/base/getting-started/accessibility/accessibility.md b/docs/data/base/getting-started/accessibility/accessibility.md index 077b4ec3e35aea..87f0ce460fa659 100644 --- a/docs/data/base/getting-started/accessibility/accessibility.md +++ b/docs/data/base/getting-started/accessibility/accessibility.md @@ -1,14 +1,14 @@ # Accessibility -

Learn how to make the most of Base UI's accessibility features and guidelines.

+

Learn how to make the most of MUI Base's accessibility features and guidelines.

-Accessibility is our top priority for Base UI components. +Accessibility is our top priority for MUI Base components. However, the library cannot make your application fully accessible on its own. This page highlights the most common actions that you as a developer must take to ensure that your app is accessible to users who require assistive technologies. ## Keyboard navigation -Base UI components follow the [WAI-ARIA 1.2 standard](https://www.w3.org/TR/wai-aria-1.2/), so they are accessible with a keyboard out of the box. +MUI Base components follow the [WAI-ARIA 1.2 standard](https://www.w3.org/TR/wai-aria-1.2/), so they are accessible with a keyboard out of the box. This is important for users who have trouble using a pointing device, but also comes in handy for users who find navigating with a keyboard faster, and who expect web components to behave the same way as native operating system controls. Specifically, interactive components can be focused using the Tab key. @@ -19,7 +19,7 @@ The Select and Menu also let users navigate to options that begin with a provide ## Focus ring -While Base UI components handle keyboard navigation, it's the developer's responsibility to indicate when a component is focused and can receive keyboard input. +While MUI Base components handle keyboard navigation, it's the developer's responsibility to indicate when a component is focused and can receive keyboard input. This is usually done by styling the [`:focus`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus) or [`:focus-visible`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible) pseudoclasses. Read the [WCAG guidelines on focus appearance](https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance) to learn more about requirements for focus indicators. @@ -27,7 +27,7 @@ Read the [WCAG guidelines on focus appearance](https://www.w3.org/WAI/WCAG22/Und ## Color contrast -Since Base UI components are unstyled, it's up to you to implement the appropriate amount of color contrast between text and background. +Since MUI Base components are unstyled, it's up to you to implement the appropriate amount of color contrast between text and background. You can use [C. Liam Brown's Color Contrast Tool](https://cliambrown.com/contrast/) to measure contrast between colors in your design and ensure that they meet the minimum requirements (note that this tool uses the [APCA algorithm](https://ruitina.com/apca-accessible-colour-contrast/), which is slated to become the new standard in WCAG 3). diff --git a/docs/data/base/getting-started/customization/customization.md b/docs/data/base/getting-started/customization/customization.md index 59fc91b4c797ec..471fd6d2c480f8 100644 --- a/docs/data/base/getting-started/customization/customization.md +++ b/docs/data/base/getting-started/customization/customization.md @@ -1,8 +1,8 @@ -# Customizing Base UI components +# Customizing MUI Base components -

There are several ways to customize Base UI components, from applying custom CSS rules to building fully custom components using hooks.

+

There are several ways to customize MUI Base components, from applying custom CSS rules to building fully custom components using hooks.

-With Base UI, you have the freedom to decide how much you want to customize a component's structure and style. +With MUI Base, you have the freedom to decide how much you want to customize a component's structure and style. ## Styling the components @@ -10,12 +10,12 @@ This section reviews several methods of customization that are available: applyi ### Which option to choose? -The multitude of options can be overwhelming, especially if you're new to Base UI. +The multitude of options can be overwhelming, especially if you're new to MUI Base. How to decide which one to use, then? The first decision to make is whether to use unstyled components or hooks. Hooks are better suited for making component libraries that can be further customized. -For example, our own Joy UI is implemented using hooks from Base UI. +For example, our own Joy UI is implemented using hooks from MUI Base. Hooks also serve as the basis for several Material UI components, and future versions of the library will use them even more extensively. If you don't need to make your component library customizable (for instance, by exposing `slotProps`), then the unstyled components may be a better option thanks to their simplicity. @@ -83,7 +83,7 @@ export default function Switch(props) { } ``` -See our [Working with Tailwind CSS guide](/base-ui/guides/working-with-tailwind-css/) for more information about integrating Base UI and Tailwind CSS. +See our [Working with Tailwind CSS guide](/base-ui/guides/working-with-tailwind-css/) for more information about integrating MUI Base and Tailwind CSS. #### Styled components diff --git a/docs/data/base/getting-started/overview/overview.md b/docs/data/base/getting-started/overview/overview.md index 4770357341cc6e..41a383a1619052 100644 --- a/docs/data/base/getting-started/overview/overview.md +++ b/docs/data/base/getting-started/overview/overview.md @@ -2,38 +2,38 @@ title: Overview --- -# Base UI - Overview +# MUI Base - Overview -

Base UI is a library of headless ("unstyled") React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

+

MUI Base is a library of headless ("unstyled") React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

## Introduction -Base UI is a library of unstyled React UI components and hooks. +MUI Base is a library of unstyled React UI components and hooks. These components were extracted from [Material UI](/material-ui/), and are now available as a standalone package. They feature the same robust engineering but without implementing Material Design. -Base UI includes prebuilt components with production-ready functionality, along with low-level hooks for transferring that functionality to other components. +MUI Base includes prebuilt components with production-ready functionality, along with low-level hooks for transferring that functionality to other components. -With Base UI, you can rapidly build on top of our foundational components using any styling solution you choose—no need to override any default style engine or theme. +With MUI Base, you can rapidly build on top of our foundational components using any styling solution you choose—no need to override any default style engine or theme. :::warning -Base UI's API is currently being revised; there will be no new features or components added to the current implementation. -Learn more about plans for Base UI in [this blog post](/blog/base-ui-2024-plans/). +MUI Base's API is currently being revised; there will be no new features or components added to the current implementation. +Learn more about plans for MUI Base in [this blog post](/blog/base-ui-2024-plans/). ::: -## Advantages of Base UI +## Advantages of MUI Base -- **Ship faster:** Base UI gives you the foundational building blocks you need to assemble a sleek and sophisticated user interface in a fraction of the time that it would take to do it all from scratch. -- **You own the CSS:** unlike Material UI, which uses Emotion as a default style engine, Base UI has no built-in styling solution. +- **Ship faster:** MUI Base gives you the foundational building blocks you need to assemble a sleek and sophisticated user interface in a fraction of the time that it would take to do it all from scratch. +- **You own the CSS:** unlike Material UI, which uses Emotion as a default style engine, MUI Base has no built-in styling solution. This means you have complete control over your app's CSS. -- **Accessibility:** Base UI components are built with accessibility in mind. +- **Accessibility:** MUI Base components are built with accessibility in mind. We do our best to make all components screen reader-friendly, and offer suggestions for optimizing accessibility throughout our documentation. -## Base UI vs. Material UI +## MUI Base vs. Material UI -Base UI features many of the same components as [Material UI](/material-ui/getting-started/), but without the Material Design implementation. +MUI Base features many of the same components as [Material UI](/material-ui/getting-started/), but without the Material Design implementation. -Base UI is not packaged with any default theme or built-in style engine. +MUI Base is not packaged with any default theme or built-in style engine. This makes it a great choice if you need complete control over how your app's CSS is implemented. -You could think of Base UI as the "skeletal" or "headless" version of Material UI—in fact, future versions of Material UI will gradually adopt these components and hooks for their foundational structure. +You could think of MUI Base as the "skeletal" or "headless" version of Material UI—in fact, future versions of Material UI will gradually adopt these components and hooks for their foundational structure. diff --git a/docs/data/base/getting-started/quickstart/quickstart.md b/docs/data/base/getting-started/quickstart/quickstart.md index 41e248e7ad0754..c5dfcb209a1359 100644 --- a/docs/data/base/getting-started/quickstart/quickstart.md +++ b/docs/data/base/getting-started/quickstart/quickstart.md @@ -1,6 +1,6 @@ # Quickstart -

Get started with Base UI, a library of headless ("unstyled") React UI components and low-level hooks.

+

Get started with MUI Base, a library of headless ("unstyled") React UI components and low-level hooks.

:::info If you're using Next.js 13.4 or later, check out the [Next.js App Router guide](/base-ui/guides/next-js-app-router/). @@ -8,7 +8,7 @@ If you're using Next.js 13.4 or later, check out the [Next.js App Router guide]( ## Installation -`@mui/base` is completely standalone – run one of the following commands to add Base UI to your React project: +`@mui/base` is completely standalone – run one of the following commands to add MUI Base to your React project: @@ -30,7 +30,7 @@ yarn add @mui/base -Please note that [react](https://www.npmjs.com/package/react) and [react-dom](https://www.npmjs.com/package/react-dom) are peer dependencies, meaning you should ensure they are installed before installing Base UI. +Please note that [react](https://www.npmjs.com/package/react) and [react-dom](https://www.npmjs.com/package/react-dom) are peer dependencies, meaning you should ensure they are installed before installing MUI Base. ```json "peerDependencies": { @@ -41,13 +41,13 @@ Please note that [react](https://www.npmjs.com/package/react) and [react-dom](ht ## Implementing a Button -This is a quick tutorial that goes through the basics of using and styling Base UI components by replicating a button from GitHub's UI, using their [Primer design system](https://primer.style/components/button/) as a reference. +This is a quick tutorial that goes through the basics of using and styling MUI Base components by replicating a button from GitHub's UI, using their [Primer design system](https://primer.style/components/button/) as a reference. {{"demo": "Tutorial.js", "defaultCodeOpen": false, "hideToolbar": true}} ### Components and hooks -Base UI provides a ` ``` -Base UI components like the Button come with a classes object (for example `buttonClasses`) that provides class hooks for styling a particular state. +MUI Base components like the Button come with a classes object (for example `buttonClasses`) that provides class hooks for styling a particular state. ```css /* To style the disabled state: */ @@ -116,7 +116,7 @@ Base UI components like the Button come with a classes object (for example `but } ``` -The demo below shows how to create the Primer button using plain CSS with Base UI's Button component and `useButton` hook: +The demo below shows how to create the Primer button using plain CSS with MUI Base's Button component and `useButton` hook: {{"demo": "BaseButtonPlainCss.js", "defaultCodeOpen": false}} @@ -169,7 +169,7 @@ export default function App() { ``` -Most of the demos in the Base UI docs are styled with MUI System in this way. +Most of the demos in the MUI Base docs are styled with MUI System in this way. You can inspect the `theme` object used on this site in your browser console, or explore the default structure in the Material UI [Default theme](/material-ui/customization/default-theme/) documentation. The demos below show how to create the Primer button using MUI System: diff --git a/docs/data/base/getting-started/roadmap/roadmap.md b/docs/data/base/getting-started/roadmap/roadmap.md index 0b138cb782ef44..6e6dc5e7eee033 100644 --- a/docs/data/base/getting-started/roadmap/roadmap.md +++ b/docs/data/base/getting-started/roadmap/roadmap.md @@ -1,22 +1,22 @@ # Roadmap -

Keep up with ongoing projects and help shape the future of Base UI.

+

Keep up with ongoing projects and help shape the future of MUI Base.

## How we prioritize -Base UI is a community-driven project, meaning we usually pick the issues and suggestions that resonate the most with the community. +MUI Base is a community-driven project, meaning we usually pick the issues and suggestions that resonate the most with the community. Therefore, make sure to leave an upvote 👍 on [the GitHub issues](https://github.com/mui/base-ui/issues) you are most interested in. -Additionally, we conduct annual [developer surveys](/blog/?tags=Developer+survey/) which also serve as key inputs for Base UI's roadmap. +Additionally, we conduct annual [developer surveys](/blog/?tags=Developer+survey/) which also serve as key inputs for MUI Base's roadmap. Your participation is invaluable—keep an eye on MUI's social media to catch the next survey and help shape the future of the library! ## Keeping track of the roadmap ### GitHub project -The Base UI GitHub project is where you can see the ongoing priorities for the library. +The MUI Base GitHub project is where you can see the ongoing priorities for the library. We typically add umbrella issues to the project board after discussing them internally. -**[Visit the Base UI project board 👉](https://github.com/orgs/mui/projects/1/views/13)** +**[Visit the MUI Base project board 👉](https://github.com/orgs/mui/projects/1/views/13)** -A screenshot of the public Base UI GitHub project. +A screenshot of the public MUI Base GitHub project. diff --git a/docs/data/base/getting-started/support/support.md b/docs/data/base/getting-started/support/support.md index 670459dde18eca..7565e1fcce7228 100644 --- a/docs/data/base/getting-started/support/support.md +++ b/docs/data/base/getting-started/support/support.md @@ -1,6 +1,6 @@ # Support -

Learn how to get support for Base UI components, including feature requests, bug fixes, and technical support from the team.

+

Learn how to get support for MUI Base components, including feature requests, bug fixes, and technical support from the team.

## GitHub @@ -10,7 +10,7 @@ If you think you've found a bug, or you have a new feature idea: 1. Please start by [making sure it hasn't already been reported or fixed](https://github.com/mui/base-ui/issues?q=is%3Aopen+is%3Aclosed). You can search through existing issues and pull requests to see if someone has reported one similar to yours. -2. Then, if no duplicates exist, [open an issue](https://github.com/mui/base-ui/issues/new/choose) in the Base UI repository. +2. Then, if no duplicates exist, [open an issue](https://github.com/mui/base-ui/issues/new/choose) in the MUI Base repository. ### New issue guidelines @@ -46,7 +46,7 @@ You can use a starter React template to build a reproduction case with [JavaScri ## Stack Overflow -We use Stack Overflow for how-to questions. Answers are crowdsourced from expert developers in the Base UI community as well as Base UI maintainers. +We use Stack Overflow for how-to questions. Answers are crowdsourced from expert developers in the MUI Base community as well as MUI Base maintainers. You can search through existing questions and answers to see if someone has asked a similar question using the [base-ui tags](https://stackoverflow.com/questions/tagged/base-ui): @@ -54,7 +54,7 @@ If you can't find your answer, [ask a new question](https://stackoverflow.com/qu ## Technical support -We do _not_ offer paid support for Core libraries like Base UI. +We do _not_ offer paid support for Core libraries like MUI Base. But you might want to read the [technical support offered](https://mui.com/x/introduction/support/#technical-support) on MUI X components. @@ -67,23 +67,23 @@ This includes issues introduced by external sources, like browser upgrades or ch ### Supported versions -- Base UI v5: ⚠️ Beta version. -- Base UI v4 🅧 Never existed. -- Base UI v3 🅧 Never existed. -- Base UI v2: 🅧 Never existed. -- Base UI v1: 🅧 Never existed. -- Base UI v0.x: 🅧 Never existed. +- MUI Base v5: ⚠️ Beta version. +- MUI Base v4 🅧 Never existed. +- MUI Base v3 🅧 Never existed. +- MUI Base v2: 🅧 Never existed. +- MUI Base v1: 🅧 Never existed. +- MUI Base v0.x: 🅧 Never existed. ## Community ### Social media -The Base UI community is active on both [X/Twitter](https://x.com/MUI_hq) and [LinkedIn](https://www.linkedin.com/company/mui/). +The MUI Base community is active on both [X/Twitter](https://x.com/MUI_hq) and [LinkedIn](https://www.linkedin.com/company/mui/). These are great platforms to share what you're working on and connect with other developers. ### Discord -We have a [Discord Server](https://mui.com/r/discord/) to bring the Base UI community together. +We have a [Discord Server](https://mui.com/r/discord/) to bring the MUI Base community together. Our tools are used by thousands of developers and teams all around the world, many of whom actively engage with the community. You can join Discord to engage in lively discussions, share your projects, and interact with developers just like you from all around the world. We'd love for you to join us! @@ -94,9 +94,9 @@ How-to questions are not accepted on Discord, they should be asked on [Stack Ov ## Custom work -If your team gets stuck and needs help getting unblocked, Base UI's engineers may be available on a contract basis. +If your team gets stuck and needs help getting unblocked, MUI Base's engineers may be available on a contract basis. -Keep in mind that the work must be directly related to Base UI's products—we don't accept general web development or React work. +Keep in mind that the work must be directly related to MUI Base's products—we don't accept general web development or React work. Our contracting price starts at $200/hour or $1,500/day. diff --git a/docs/data/base/getting-started/usage/usage.md b/docs/data/base/getting-started/usage/usage.md index 65a0a34a494dd6..8e98e6ee912a0b 100644 --- a/docs/data/base/getting-started/usage/usage.md +++ b/docs/data/base/getting-started/usage/usage.md @@ -1,10 +1,10 @@ # Usage -

Learn the basics of working with Base UI components.

+

Learn the basics of working with MUI Base components.

## Responsive meta tag -Base UI is a _mobile-first_ component library—we write code for mobile devices first, and then scale up the components as necessary using CSS media queries. +MUI Base is a _mobile-first_ component library—we write code for mobile devices first, and then scale up the components as necessary using CSS media queries. To ensure proper rendering and touch zooming for all devices, add the responsive viewport meta tag to your `` element: @@ -24,7 +24,7 @@ The `slots` prop is an object that lets you override any interior subcomponents :::info Each component contains a root slot, and other appropriate slots based on the nature of the component. -For example, the Base UI Badge contains two slots: +For example, the MUI Base Badge contains two slots: - `root`: the container element that wraps the children. - `badge`: the badge element itself. @@ -33,7 +33,7 @@ For example, the Base UI Badge contains two slots: You can use the `slots` prop to override default slots with either custom components or HTML elements. -For example, the Base UI Badge component renders a `` by default. +For example, the MUI Base Badge component renders a `` by default. The code snippet below shows how to override this by assigning a `
` to the root slot: ```jsx @@ -45,7 +45,7 @@ The code snippet below shows how to override this by assigning a `
` to the The `slotProps` prop is an object that contains the props for all slots within a component. You can use it to define additional custom props for a component's interior elements. -For example, the code snippet below shows how to add a custom CSS class to the badge slot of the Base UI Badge component: +For example, the code snippet below shows how to add a custom CSS class to the badge slot of the MUI Base Badge component: ```jsx @@ -78,13 +78,13 @@ If you did the same with `slots.root`, you would need to place this attribute on ## Components vs. hooks -Base UI includes two kinds of building blocks: **components** and **hooks**. +MUI Base includes two kinds of building blocks: **components** and **hooks**. :::info Hooks encapsulate _logic_; components provide _structure_. ::: -Many Base UI components are implemented with the help of [React hooks](https://react.dev/reference/react/hooks). +Many MUI Base components are implemented with the help of [React hooks](https://react.dev/reference/react/hooks). You can use components or hooks—or a combination of both—when building custom components. In general, we recommend that you begin building with the component, and if you find that you are too limited by the customization options available, then consider refactoring your component to use the corresponding hook instead. diff --git a/docs/data/base/guides/next-js-app-router/next-js-app-router.md b/docs/data/base/guides/next-js-app-router/next-js-app-router.md index 11db3639e39933..6df1db77b739dc 100644 --- a/docs/data/base/guides/next-js-app-router/next-js-app-router.md +++ b/docs/data/base/guides/next-js-app-router/next-js-app-router.md @@ -1,18 +1,18 @@ # Next.js App Router -

Learn how to use Base UI with the Next.js App Router.

+

Learn how to use MUI Base with the Next.js App Router.

## Example Starting fresh on a new App Router-based project? -Jump right into the code with [this example: Base UI - Next.js App Router with Tailwind CSS in TypeScript](https://github.com/mui/material-ui/tree/master/examples/base-ui-nextjs-tailwind-ts). +Jump right into the code with [this example: MUI Base - Next.js App Router with Tailwind CSS in TypeScript](https://github.com/mui/material-ui/tree/master/examples/base-ui-nextjs-tailwind-ts). ## Next.js and React Server Components The Next.js App Router implements React Server Components, [an upcoming feature for React](https://github.com/reactjs/rfcs/blob/main/text/0227-server-module-conventions.md). -To support the App Router, the components and hooks from Base UI that need access to browser APIs are exported with the `"use client"` directive. +To support the App Router, the components and hooks from MUI Base that need access to browser APIs are exported with the `"use client"` directive. :::warning React Server Components should not be conflated with the concept of server-side rendering (SSR). @@ -21,9 +21,9 @@ So-called Client Components are still server-rendered to HTML. For more details, see [this explanation](https://github.com/reactwg/server-components/discussions/4) of Client Components and SSR from the React Working Group. ::: -## Setting up Base UI with the App Router +## Setting up MUI Base with the App Router -Base UI gives you the freedom to choose your own styling solution, so setting up a Next.js App Router project largely depends on what you choose. +MUI Base gives you the freedom to choose your own styling solution, so setting up a Next.js App Router project largely depends on what you choose. This guide covers Tailwind CSS, Emotion, and other CSS-in-JS solutions like styled-components. ### Tailwind CSS @@ -46,7 +46,7 @@ module.exports = { }; ``` -Refer to this [example repo](https://github.com/mui/material-ui/tree/master/examples/base-ui-nextjs-tailwind-ts) for a full working demo of a Next.js 13 app using Base UI and Tailwind CSS. +Refer to this [example repo](https://github.com/mui/material-ui/tree/master/examples/base-ui-nextjs-tailwind-ts) for a full working demo of a Next.js 13 app using MUI Base and Tailwind CSS. ### Emotion @@ -153,13 +153,13 @@ Currently, `prepend` does not work reliably with the App Router, but you can wor ### Other CSS-in-JS libraries -To use Next.js with Base UI and styled-components or other CSS-in-JS solutions, follow the [Next.js doc on CSS-in-JS](https://nextjs.org/docs/app/building-your-application/styling/css-in-js). +To use Next.js with MUI Base and styled-components or other CSS-in-JS solutions, follow the [Next.js doc on CSS-in-JS](https://nextjs.org/docs/app/building-your-application/styling/css-in-js). ## Customization ### Using callbacks for slot props -A common customization method in Base UI is to pass a callback to slots in `slotProps` in order to apply dynamic props. For example, you might want to change the background color by applying a different class when a Button is disabled: +A common customization method in MUI Base is to pass a callback to slots in `slotProps` in order to apply dynamic props. For example, you might want to change the background color by applying a different class when a Button is disabled: ```tsx // page.tsx diff --git a/docs/data/base/guides/overriding-component-structure/overriding-component-structure.md b/docs/data/base/guides/overriding-component-structure/overriding-component-structure.md index 19918913131b44..979cccb0be9341 100644 --- a/docs/data/base/guides/overriding-component-structure/overriding-component-structure.md +++ b/docs/data/base/guides/overriding-component-structure/overriding-component-structure.md @@ -1,8 +1,8 @@ # Overriding component structure -

Learn how to override the default DOM structure of Base UI components.

+

Learn how to override the default DOM structure of MUI Base components.

-Base UI components are designed to suit the widest possible range of use cases, but you may occasionally need to change how a component's structure is rendered in the DOM. +MUI Base components are designed to suit the widest possible range of use cases, but you may occasionally need to change how a component's structure is rendered in the DOM. To understand how to do this, it helps to have an accurate mental model of the components. @@ -13,7 +13,7 @@ Slots are most commonly filled by HTML tags, but may also be filled by React com All components contain a root slot that defines their primary node in the DOM tree; more complex components also contain additional interior slots named after the elements they represent. -All _non-utility_ Base UI components accept [the `slots` prop](#the-slots-prop) for overriding their rendered HTML structure. +All _non-utility_ MUI Base components accept [the `slots` prop](#the-slots-prop) for overriding their rendered HTML structure. Additionally, you can pass custom props to [interior slots](#interior-slots) using `slotProps`. diff --git a/docs/data/base/guides/working-with-tailwind-css/working-with-tailwind-css.md b/docs/data/base/guides/working-with-tailwind-css/working-with-tailwind-css.md index 92cf9f71fa4ad9..75353e35b15e2c 100644 --- a/docs/data/base/guides/working-with-tailwind-css/working-with-tailwind-css.md +++ b/docs/data/base/guides/working-with-tailwind-css/working-with-tailwind-css.md @@ -1,10 +1,10 @@ # Working with Tailwind CSS -

Learn how to style Base UI components with Tailwind CSS.

+

Learn how to style MUI Base components with Tailwind CSS.

## Getting started -The goal of this guide is to teach you how to style Base UI components using Tailwind CSS while building an interactive and accessible app. +The goal of this guide is to teach you how to style MUI Base components using Tailwind CSS while building an interactive and accessible app. ### Prerequisites @@ -243,7 +243,7 @@ You should now see the player rendered on the page, but the component is not yet ### Create the Slider component -Let's start by giving life to the slider with the Slider component from Base UI. +Let's start by giving life to the slider with the Slider component from MUI Base. First, create a new file called `Slider.tsx`. Copy and paste the code below into the file: @@ -376,7 +376,7 @@ Since we want to have an additional dot inside the thumb, we need to add new ele Note that after the thumb, we are still rendering the `children` passed via props. This is important because the `children` in this case contain a hidden `` element which makes the thumb accessible. -This is just one example, but this pattern of building custom components for each slot is possible with all Base UI components. +This is just one example, but this pattern of building custom components for each slot is possible with all MUI Base components. :::warning When building custom components for the slots, always propagate the props sent from the owner component on the root element. @@ -389,7 +389,7 @@ This is useful if you want to style the component based on some internal state. ## Adding a custom focus selector to the buttons To finish this guide off, let's see how you can add custom styles based on a component's internal state. -We'll create a custom Button component that uses the `focusVisible` state from the Base UI Button to apply a cyan ring around it. +We'll create a custom Button component that uses the `focusVisible` state from the MUI Base Button to apply a cyan ring around it. This is what it'll look like: @@ -513,9 +513,9 @@ Some classes were slightly changed on some buttons so we have a consistent focus These are the things we covered in this guide: -✅ How to use Tailwind CSS utility classes to style Base UI components, using the `slotProps` prop for targeting specific slots within the component.\ +✅ How to use Tailwind CSS utility classes to style MUI Base components, using the `slotProps` prop for targeting specific slots within the component.\ ✅ How to create custom components for specific slots in more complex customization scenarios. We used the `component` prop to pass them into the parent component.\ ✅ How to apply conditional styling based on the owner component's state using a callback as value for the `slotProps` prop. -Get all the code used in this guide in the [Base UI with Tailwind CSS](https://codesandbox.io/p/sandbox/working-with-tailwind-css-dhmf8w) example project. +Get all the code used in this guide in the [MUI Base with Tailwind CSS](https://codesandbox.io/p/sandbox/working-with-tailwind-css-dhmf8w) example project. diff --git a/docs/data/base/pages.ts b/docs/data/base/pages.ts index 7b024e970b9268..d76d2c7807cbb8 100644 --- a/docs/data/base/pages.ts +++ b/docs/data/base/pages.ts @@ -26,18 +26,17 @@ const pages: readonly MuiPage[] = [ children: [ { pathname: '/base-ui/react-autocomplete', title: 'Autocomplete' }, { pathname: '/base-ui/react-button', title: 'Button' }, - { pathname: '/base-ui/react-checkbox', title: 'Checkbox', planned: true }, + { pathname: '/base-ui/react-checkbox', title: 'Checkbox' }, { pathname: '/base-ui/react-input', title: 'Input' }, - { pathname: '/base-ui/react-number-input', title: 'Number Input', unstable: true }, - { pathname: '/base-ui/react-radio-group', title: 'Radio Group', planned: true }, - { pathname: '/base-ui/react-rating', title: 'Rating', planned: true }, + { pathname: '/base-ui/react-number-input', title: 'Number Input' }, + { pathname: '/base-ui/react-radio-group', title: 'Radio Group' }, + { pathname: '/base-ui/react-rating', title: 'Rating' }, { pathname: '/base-ui/react-select', title: 'Select' }, { pathname: '/base-ui/react-slider', title: 'Slider' }, { pathname: '/base-ui/react-switch', title: 'Switch' }, { pathname: '/base-ui/react-toggle-button-group', title: 'Toggle Button Group', - planned: true, }, ], }, @@ -46,7 +45,7 @@ const pages: readonly MuiPage[] = [ subheader: 'data-display', children: [ { pathname: '/base-ui/react-badge', title: 'Badge' }, - { pathname: '/base-ui/react-tooltip', title: 'Tooltip', planned: true }, + { pathname: '/base-ui/react-tooltip', title: 'Tooltip' }, ], }, { @@ -66,7 +65,6 @@ const pages: readonly MuiPage[] = [ { pathname: '/base-ui/react-accordion', title: 'Accordion', - planned: true, }, ], }, @@ -74,9 +72,9 @@ const pages: readonly MuiPage[] = [ pathname: '/base-ui/components/navigation', subheader: 'navigation', children: [ - { pathname: '/base-ui/react-drawer', title: 'Drawer', planned: true }, + { pathname: '/base-ui/react-drawer', title: 'Drawer' }, { pathname: '/base-ui/react-menu', title: 'Menu' }, - { pathname: '/base-ui/react-pagination', title: 'Pagination', planned: true }, + { pathname: '/base-ui/react-pagination', title: 'Pagination' }, { pathname: '/base-ui/react-table-pagination', title: 'Table Pagination' }, { pathname: '/base-ui/react-tabs', title: 'Tabs' }, ], @@ -91,7 +89,7 @@ const pages: readonly MuiPage[] = [ { pathname: '/base-ui/react-modal', title: 'Modal' }, { pathname: '/base-ui/react-no-ssr', title: 'No-SSR' }, { pathname: '/base-ui/react-popper', title: 'Popper' }, - { pathname: '/base-ui/react-popup', title: 'Popup', unstable: true }, + { pathname: '/base-ui/react-popup', title: 'Popup' }, { pathname: '/base-ui/react-portal', title: 'Portal' }, { pathname: '/base-ui/react-textarea-autosize', title: 'Textarea Autosize' }, { pathname: '/base-ui/react-transitions', title: 'Transitions' }, diff --git a/docs/data/joy/components/accordion/accordion.md b/docs/data/joy/components/accordion/accordion.md index 001b36fdab64d0..c1277c312680af 100644 --- a/docs/data/joy/components/accordion/accordion.md +++ b/docs/data/joy/components/accordion/accordion.md @@ -4,6 +4,7 @@ title: React Accordion component components: Accordion, AccordionDetails, AccordionGroup, AccordionSummary githubLabel: 'component: accordion' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/accordion/ +unstyled: https://base-ui.com/react/components/accordion --- # Accordion diff --git a/docs/data/joy/components/autocomplete/autocomplete.md b/docs/data/joy/components/autocomplete/autocomplete.md index ebf5bf7344fba8..85adcf917c5c2d 100644 --- a/docs/data/joy/components/autocomplete/autocomplete.md +++ b/docs/data/joy/components/autocomplete/autocomplete.md @@ -287,7 +287,7 @@ The following demo relies on [autosuggest-highlight](https://github.com/moroshko ### GitHub's picker -To reproduce GitHub's label picker, the `Autocomplete` is rendered inside a Base UI [`Popper`](/base-ui/react-popper/). To remove the popup behavior from the autocomplete, replace the listbox slot with the `AutocompleteListbox` component. +To reproduce GitHub's label picker, the `Autocomplete` is rendered inside a MUI Base [`Popper`](/base-ui/react-popper/). To remove the popup behavior from the autocomplete, replace the listbox slot with the `AutocompleteListbox` component. {{"demo": "GitHubLabel.js"}} diff --git a/docs/data/joy/components/badge/badge.md b/docs/data/joy/components/badge/badge.md index e5ba349dfeaf25..25c2487f64fada 100644 --- a/docs/data/joy/components/badge/badge.md +++ b/docs/data/joy/components/badge/badge.md @@ -3,7 +3,6 @@ productId: joy-ui title: React Badge component components: Badge githubLabel: 'component: badge' -unstyled: /base-ui/react-badge/ --- # Badge diff --git a/docs/data/joy/components/button/button.md b/docs/data/joy/components/button/button.md index b6bed946b9590a..e74eb854d02080 100644 --- a/docs/data/joy/components/button/button.md +++ b/docs/data/joy/components/button/button.md @@ -4,7 +4,6 @@ title: React Button component components: Button, IconButton githubLabel: 'component: button' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/button/ -unstyled: /base-ui/react-button/ --- # Button diff --git a/docs/data/joy/components/checkbox/checkbox.md b/docs/data/joy/components/checkbox/checkbox.md index 4583812b0d8664..1f0d1698b776ec 100644 --- a/docs/data/joy/components/checkbox/checkbox.md +++ b/docs/data/joy/components/checkbox/checkbox.md @@ -4,6 +4,7 @@ title: React Checkbox component components: Checkbox githubLabel: 'component: checkbox' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/ +unstyled: https://base-ui.com/react/components/checkbox --- # Checkbox diff --git a/docs/data/joy/components/divider/divider.md b/docs/data/joy/components/divider/divider.md index 60917da7cbab5f..2f56d0d77e0fd6 100644 --- a/docs/data/joy/components/divider/divider.md +++ b/docs/data/joy/components/divider/divider.md @@ -3,6 +3,7 @@ productId: joy-ui title: React Divider component components: Divider githubLabel: 'component: divider' +unstyled: https://base-ui.com/react/components/separator --- # Divider diff --git a/docs/data/joy/components/input/input.md b/docs/data/joy/components/input/input.md index 27575fa6d3bca4..433c0a9f69fe4b 100644 --- a/docs/data/joy/components/input/input.md +++ b/docs/data/joy/components/input/input.md @@ -2,7 +2,7 @@ productId: joy-ui title: React Input component components: FormControl, FormHelperText, FormLabel, Input -unstyled: /base-ui/react-input/ +unstyled: https://base-ui.com/react/components/input --- # Input diff --git a/docs/data/joy/components/menu/menu.md b/docs/data/joy/components/menu/menu.md index 26af6084268566..b76b35c12afe90 100644 --- a/docs/data/joy/components/menu/menu.md +++ b/docs/data/joy/components/menu/menu.md @@ -4,7 +4,7 @@ title: React Menu component components: Menu, MenuItem, MenuList, MenuButton githubLabel: 'component: menu' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/ -unstyled: /base-ui/react-menu/ +unstyled: https://base-ui.com/react/components/menu --- # Menu @@ -91,7 +91,7 @@ Use `slotProps` to pass props to the IconButton component. ### Positioned menu -The `Menu` is based on the Base UI `Popper` component, which exposes a few [placement props](/base-ui/react-popper/#placement). +The `Menu` is based on the MUI Base `Popper` component, which exposes a few [placement props](/base-ui/react-popper/#placement). For example, this is how you'd go for displaying the menu on the bottom-end of the anchor button. {{"demo": "PositionedMenu.js"}} diff --git a/docs/data/joy/components/modal/modal.md b/docs/data/joy/components/modal/modal.md index ff5045d23f6792..5a085d57e4634c 100644 --- a/docs/data/joy/components/modal/modal.md +++ b/docs/data/joy/components/modal/modal.md @@ -4,6 +4,7 @@ title: React Modal component components: Modal, ModalClose, ModalDialog, ModalOverflow, DialogTitle, DialogContent, DialogActions githubLabel: 'component: modal' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/ +unstyled: https://base-ui.com/react/components/dialog --- # Modal @@ -226,7 +227,7 @@ Use `sx` prop with `theme.breakpoints.only('xs')` to customize the styles of the ### Focus trap -Base UI `Modal` moves the focus back to the body of the component if the focus tries to escape it. +MUI Base `Modal` moves the focus back to the body of the component if the focus tries to escape it. This is done for accessibility purposes, but it can potentially create issues for your users. diff --git a/docs/data/joy/components/radio-button/radio-button.md b/docs/data/joy/components/radio-button/radio-button.md index b0726b188a1706..215d0559056684 100644 --- a/docs/data/joy/components/radio-button/radio-button.md +++ b/docs/data/joy/components/radio-button/radio-button.md @@ -4,6 +4,7 @@ title: React Radio Button component components: Radio, RadioGroup githubLabel: 'component: radio' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/radio/ +unstyled: https://base-ui.com/react/components/radio --- # Radio diff --git a/docs/data/joy/components/select/select.md b/docs/data/joy/components/select/select.md index ecfd4ace80361b..4b984c5e0168dd 100644 --- a/docs/data/joy/components/select/select.md +++ b/docs/data/joy/components/select/select.md @@ -4,7 +4,7 @@ title: React Select component components: Select, Option githubLabel: 'component: select' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/ -unstyled: /base-ui/react-select/ +unstyled: https://base-ui.com/react/components/select --- # Select diff --git a/docs/data/joy/components/slider/slider.md b/docs/data/joy/components/slider/slider.md index 795077148638bb..5b99afbc3de236 100644 --- a/docs/data/joy/components/slider/slider.md +++ b/docs/data/joy/components/slider/slider.md @@ -3,7 +3,7 @@ productId: joy-ui title: React Slider component components: Slider githubLabel: 'component: slider' -unstyled: /base-ui/react-slider/ +unstyled: https://base-ui.com/react/components/slider --- # Slider diff --git a/docs/data/joy/components/switch/switch.md b/docs/data/joy/components/switch/switch.md index be49a207cf053f..d2f3c3bf711e08 100644 --- a/docs/data/joy/components/switch/switch.md +++ b/docs/data/joy/components/switch/switch.md @@ -3,7 +3,7 @@ productId: joy-ui title: React Switch component components: Switch githubLabel: 'component: switch' -unstyled: /base-ui/react-switch/ +unstyled: https://base-ui.com/react/components/switch --- # Switch diff --git a/docs/data/joy/components/tabs/tabs.md b/docs/data/joy/components/tabs/tabs.md index a0370ad6719bde..932f7665681b40 100644 --- a/docs/data/joy/components/tabs/tabs.md +++ b/docs/data/joy/components/tabs/tabs.md @@ -4,7 +4,7 @@ title: React Tabs component components: Tab, TabList, TabPanel, Tabs githubLabel: 'component: tabs' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/tabs/ -unstyled: /base-ui/react-tabs/ +unstyled: https://base-ui.com/react/components/menu --- # Tabs diff --git a/docs/data/joy/components/text-field/text-field.md b/docs/data/joy/components/text-field/text-field.md index d2adcae1ab4a5f..6ea1ebedce4ddd 100644 --- a/docs/data/joy/components/text-field/text-field.md +++ b/docs/data/joy/components/text-field/text-field.md @@ -2,6 +2,7 @@ productId: joy-ui title: React Text Field component githubLabel: 'component: text field' +unstyled: https://base-ui.com/react/components/field --- # Text Field diff --git a/docs/data/joy/components/textarea/textarea.md b/docs/data/joy/components/textarea/textarea.md index 40513178fa5524..3302bdfac3d7cb 100644 --- a/docs/data/joy/components/textarea/textarea.md +++ b/docs/data/joy/components/textarea/textarea.md @@ -3,7 +3,6 @@ productId: joy-ui title: React Textarea component components: Textarea githubLabel: 'component: TextareaAutosize' -unstyled: /base-ui/react-textarea-autosize/ --- # Textarea @@ -14,7 +13,7 @@ unstyled: /base-ui/react-textarea-autosize/ ## Introduction -Joy UI's textarea component is built on top of the Base UI [`TextareaAutoSize`](/base-ui/react-textarea-autosize/) component. +Joy UI's textarea component is built on top of the MUI Base [`TextareaAutoSize`](/base-ui/react-textarea-autosize/) component. {{"demo": "TextareaUsage.js", "hideToolbar": true, "bg": "gradient"}} diff --git a/docs/data/joy/components/toggle-button-group/toggle-button-group.md b/docs/data/joy/components/toggle-button-group/toggle-button-group.md index b4d7a2322796f5..94ae80b5402e58 100644 --- a/docs/data/joy/components/toggle-button-group/toggle-button-group.md +++ b/docs/data/joy/components/toggle-button-group/toggle-button-group.md @@ -3,6 +3,7 @@ productId: joy-ui title: React Toggle Button Group component githubLabel: 'component: toggle button' components: ToggleButtonGroup, Button, IconButton +unstyled: https://base-ui.com/react/components/toggle-group --- # Toggle Button Group diff --git a/docs/data/joy/components/tooltip/tooltip.md b/docs/data/joy/components/tooltip/tooltip.md index 958b6ce3ab25e4..c00e1d433d30b2 100644 --- a/docs/data/joy/components/tooltip/tooltip.md +++ b/docs/data/joy/components/tooltip/tooltip.md @@ -4,6 +4,7 @@ title: React Tooltip component components: Tooltip githubLabel: 'component: tooltip' waiAria: https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/ +unstyled: https://base-ui.com/react/components/tooltip --- # Tooltip diff --git a/docs/data/joy/getting-started/overview/overview.md b/docs/data/joy/getting-started/overview/overview.md index a1a7cb56a2402a..d8dd66a87eda6d 100644 --- a/docs/data/joy/getting-started/overview/overview.md +++ b/docs/data/joy/getting-started/overview/overview.md @@ -55,7 +55,7 @@ For example, observe how each element of the [Input](/joy-ui/react-input/) compo ### Accessibility -Joy UI components are built on top of [Base UI's unstyled components and low-level hooks](/base-ui/getting-started/), giving you many accessibility features out of the box. +Joy UI components are built on top of [MUI Base's unstyled components and low-level hooks](/base-ui/getting-started/), giving you many accessibility features out of the box. We strive to make all components accessible to end users who require assistive technology, and offer suggestions for optimizing accessibility throughout our documentation. Joy UI's Form Control component automatically generates a unique ID that links the Input that it wraps with the Form Label and Form Helper Text components, ensuring that your app complies with this guideline: diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionFooter.js b/docs/data/joy/main-features/color-inversion/ColorInversionFooter.js index ed4f0dd5147010..0aea88918d72e4 100644 --- a/docs/data/joy/main-features/color-inversion/ColorInversionFooter.js +++ b/docs/data/joy/main-features/color-inversion/ColorInversionFooter.js @@ -128,7 +128,7 @@ export default function ColorInversionFooter() { Joy UI - Base UI + MUI Base Material UI diff --git a/docs/data/joy/main-features/color-inversion/ColorInversionFooter.tsx b/docs/data/joy/main-features/color-inversion/ColorInversionFooter.tsx index adb2bb70afa7e2..ce972aa2b3bbef 100644 --- a/docs/data/joy/main-features/color-inversion/ColorInversionFooter.tsx +++ b/docs/data/joy/main-features/color-inversion/ColorInversionFooter.tsx @@ -133,7 +133,7 @@ export default function ColorInversionFooter() { Joy UI - Base UI + MUI Base Material UI diff --git a/docs/data/material/components/click-away-listener/click-away-listener.md b/docs/data/material/components/click-away-listener/click-away-listener.md index 7618b34439ab53..eeeb0a89e33131 100644 --- a/docs/data/material/components/click-away-listener/click-away-listener.md +++ b/docs/data/material/components/click-away-listener/click-away-listener.md @@ -12,8 +12,8 @@ githubLabel: 'component: ClickAwayListener' ## This document has moved :::warning -Please refer to the [Click-Away Listener](/base-ui/react-click-away-listener/) component page in the Base UI docs for demos and details on usage. +Please refer to the [Click-Away Listener](/base-ui/react-click-away-listener/) component page in the MUI Base docs for demos and details on usage. -Click-Away Listener is a part of the standalone [Base UI](/base-ui/) component library. -It is currently re-exported from `@mui/material` for your convenience, but it will be removed from this package in a future major version after Base UI gets a stable release. +Click-Away Listener is a part of the standalone MUI Base component library. +It is currently re-exported from `@mui/material` for your convenience, but it will be removed from this package in a future major version after MUI Base gets a stable release. ::: diff --git a/docs/data/material/components/no-ssr/no-ssr.md b/docs/data/material/components/no-ssr/no-ssr.md index dec36823a9d88f..ac2611539ebcd3 100644 --- a/docs/data/material/components/no-ssr/no-ssr.md +++ b/docs/data/material/components/no-ssr/no-ssr.md @@ -11,8 +11,8 @@ components: NoSsr ## This document has moved :::warning -Please refer to the [No-SSR](/base-ui/react-no-ssr/) component page in the Base UI docs for demos and details on usage. +Please refer to the [No-SSR](/base-ui/react-no-ssr/) component page in the MUI Base docs for demos and details on usage. -No-SSR is a part of the standalone [Base UI](/base-ui/) component library. -It is currently re-exported from `@mui/material` for your convenience, but it will be removed from this package in a future major version after Base UI gets a stable release. +No-SSR is a part of the standalone MUI Base component library. +It is currently re-exported from `@mui/material` for your convenience, but it will be removed from this package in a future major version after MUI Base gets a stable release. ::: diff --git a/docs/data/material/components/popper/popper.md b/docs/data/material/components/popper/popper.md index 1730cd0fd38c6e..85833d7e6da69c 100644 --- a/docs/data/material/components/popper/popper.md +++ b/docs/data/material/components/popper/popper.md @@ -15,12 +15,12 @@ Some important features of the Popper component: - 🕷 Popper relies on the 3rd party library ([Popper.js](https://popper.js.org/)) for perfect positioning. - 💄 It's an alternative API to react-popper. It aims for simplicity. -- Its child element is a [Base UI Portal](/base-ui/react-portal/) on the body of the document to avoid rendering problems. +- Its child element is a [MUI Base Portal](/base-ui/react-portal/) on the body of the document to avoid rendering problems. You can disable this behavior with `disablePortal`. - The scroll isn't blocked like with the [Popover](/material-ui/react-popover/) component. The placement of the popper updates with the available area in the viewport. - Clicking away does not hide the Popper component. - If you need this behavior, you can use the [Base UI Click-Away Listener](/base-ui/react-click-away-listener/) - see the example in the [menu documentation section](/material-ui/react-menu/#composition-with-menu-list). + If you need this behavior, you can use the [MUI Base Click-Away Listener](/base-ui/react-click-away-listener/) - see the example in the [menu documentation section](/material-ui/react-menu/#composition-with-menu-list). - The `anchorEl` is passed as the reference object to create a new `Popper.js` instance. {{"component": "@mui/docs/ComponentLinkHeader", "design": false}} diff --git a/docs/data/material/components/portal/portal.md b/docs/data/material/components/portal/portal.md index 2f66f2159fd063..d8e92c4db26418 100644 --- a/docs/data/material/components/portal/portal.md +++ b/docs/data/material/components/portal/portal.md @@ -12,8 +12,8 @@ githubLabel: 'component: Portal' ## This document has moved :::warning -Please refer to the [Portal](/base-ui/react-portal/) component page in the Base UI docs for demos and details on usage. +Please refer to the [Portal](/base-ui/react-portal/) component page in the MUI Base docs for demos and details on usage. -Portal is a part of the standalone [Base UI](/base-ui/) component library. -It is currently re-exported from `@mui/material` for your convenience, but it will be removed from this package in a future major version after Base UI gets a stable release. +Portal is a part of the standalone MUI Base component library. +It is currently re-exported from `@mui/material` for your convenience, but it will be removed from this package in a future major version after MUI Base gets a stable release. ::: diff --git a/docs/data/material/components/text-fields/text-fields.md b/docs/data/material/components/text-fields/text-fields.md index 74205facd6ae01..b3bf54fff4fd5a 100644 --- a/docs/data/material/components/text-fields/text-fields.md +++ b/docs/data/material/components/text-fields/text-fields.md @@ -44,7 +44,7 @@ The `helperText` prop can then be used to provide feedback to the user about the ## Multiline -The `multiline` prop transforms the Text Field into a [Base UI Textarea Autosize](/base-ui/react-textarea-autosize/) element. +The `multiline` prop transforms the Text Field into a [MUI Base Textarea Autosize](/base-ui/react-textarea-autosize/) element. Unless the `rows` prop is set, the height of the text field dynamically matches its content. You can use the `minRows` and `maxRows` props to bound it. @@ -275,7 +275,7 @@ We do not recommend using `type="number"` with a Text Field due to potential usa ::: -If you need a text field with number validation, you can use Base UI's [Number Input](/base-ui/react-number-input/) instead. +If you need a text field with number validation, you can use MUI Base's [Number Input](/base-ui/react-number-input/) instead. You can follow [this GitHub issue](https://github.com/mui/material-ui/issues/19154) to track the progress of introducing the Number Input component to Material UI. diff --git a/docs/data/material/components/textarea-autosize/textarea-autosize.md b/docs/data/material/components/textarea-autosize/textarea-autosize.md index d4b51a9a2da082..be947db10d8717 100644 --- a/docs/data/material/components/textarea-autosize/textarea-autosize.md +++ b/docs/data/material/components/textarea-autosize/textarea-autosize.md @@ -12,8 +12,8 @@ githubLabel: 'component: TextareaAutosize' ## This document has moved :::warning -Please refer to the [Textarea Autosize](/base-ui/react-textarea-autosize/) component page in the Base UI docs for demos and details on usage. +Please refer to the [Textarea Autosize](/base-ui/react-textarea-autosize/) component page in the MUI Base docs for demos and details on usage. -Textarea Autosize is a part of the standalone [Base UI](/base-ui/) component library. -It is currently re-exported from `@mui/material` for your convenience, but it will be removed from this package in a future major version after Base UI gets a stable release. +Textarea Autosize is a part of the standalone MUI Base component library. +It is currently re-exported from `@mui/material` for your convenience, but it will be removed from this package in a future major version after MUI Base gets a stable release. ::: diff --git a/docs/data/material/customization/shadow-dom/shadow-dom.md b/docs/data/material/customization/shadow-dom/shadow-dom.md index fc19540b8b0f9b..fbb4061c327bf3 100644 --- a/docs/data/material/customization/shadow-dom/shadow-dom.md +++ b/docs/data/material/customization/shadow-dom/shadow-dom.md @@ -32,7 +32,7 @@ ReactDOM.createRoot(shadowRootElement).render( ### 2. Theme -Material UI components like Menu, Dialog, Popover, and others use the [Base UI Portal](/base-ui/react-portal/) component to render a new "subtree" in a container outside of current DOM hierarchy. +Material UI components like Menu, Dialog, Popover, and others use the [MUI Base Portal](/base-ui/react-portal/) component to render a new "subtree" in a container outside of current DOM hierarchy. By default, this container is `document.body`. But since the styles are applied only inside of the Shadow DOM, we need to render portals inside the Shadow DOM container as well: diff --git a/docs/data/material/discover-more/backers/backers.md b/docs/data/material/discover-more/backers/backers.md index b5176081f84c33..8a03acd40b583a 100644 --- a/docs/data/material/discover-more/backers/backers.md +++ b/docs/data/material/discover-more/backers/backers.md @@ -2,7 +2,7 @@

Support the development of the open-source projects of the MUI organization through crowdfunding.

-Material UI, Base UI, MUI System, and Joy UI are crowd-funded open-source projects, licensed under the permissive MIT license. +Material UI, MUI Base, MUI System, and Joy UI are crowd-funded open-source projects, licensed under the permissive MIT license. Sponsorship increases the rate of bug fixes, documentation improvements, and feature development. ## Diamond sponsors @@ -74,7 +74,7 @@ via [Open Collective](https://opencollective.com/mui-org) ### Why is Material UI a "crowd-funded open-source project"? -Material UI (as well as Base UI, MUI System, and Joy UI) is open-source to give users great freedom in how they use the software and to enable the community to have influence over how the project progresses to make it appropriate for a wide range of use cases. +Material UI (as well as MUI Base, MUI System, and Joy UI) is open-source to give users great freedom in how they use the software and to enable the community to have influence over how the project progresses to make it appropriate for a wide range of use cases. To ensure that these open-source libraries can stand the test of time for our users, they need to be well-directed and financially sustainable. The absolute best way to support the MUI organization to work on its libraries' ongoing development efforts is to become a sponsor. diff --git a/docs/data/material/getting-started/overview/overview.md b/docs/data/material/getting-started/overview/overview.md index 4dc5721b2d857d..f6d1a386e51db3 100644 --- a/docs/data/material/getting-started/overview/overview.md +++ b/docs/data/material/getting-started/overview/overview.md @@ -30,13 +30,13 @@ You can follow [this GitHub issue](https://github.com/mui/material-ui/issues/293 It's almost as old as React itself—its history stretches back to 2014—and we're in this for the long haul. You can count on the community's support for years to come (for example [Stack Overflow](https://trends.stackoverflow.co/?tags=material-ui)). -### Material UI vs. Base UI +### Material UI vs. MUI Base -Material UI and [Base UI](/base-ui/) feature many of the same UI components, but Base UI comes without any default styles or styling solutions. +Material UI and MUI Base feature many of the same UI components, but MUI Base comes without any default styles or styling solutions. Material UI is _comprehensive_ in that it comes packaged with default styles, and is optimized to work with [Emotion](https://emotion.sh/docs/introduction) (or [styled-components](https://styled-components.com/)). -Base UI, by contrast, could be considered the "skeletal" or "headless" counterpart to Material UI—in fact, future versions of Material UI will use Base UI components and hooks for its foundational structure. +MUI Base, by contrast, could be considered the "skeletal" or "headless" counterpart to Material UI—in fact, future versions of Material UI will use MUI Base components and hooks for its foundational structure. ## Start now diff --git a/docs/data/material/integrations/interoperability/interoperability.md b/docs/data/material/integrations/interoperability/interoperability.md index 56c22bfc22d13c..1e3bf6016e98dd 100644 --- a/docs/data/material/integrations/interoperability/interoperability.md +++ b/docs/data/material/integrations/interoperability/interoperability.md @@ -376,7 +376,7 @@ const CustomizedSlider = styled(Slider)( ### Portals -The [Base UI Portal](/base-ui/react-portal/) component provides a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component. +The [MUI Base Portal](/base-ui/react-portal/) component provides a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component. Because of the way styled-components scopes its CSS, you may run into issues where styling is not applied. For example, if you attempt to style the `tooltip` generated by the [Tooltip](/material-ui/react-tooltip/) component, diff --git a/docs/data/system/getting-started/overview/overview.md b/docs/data/system/getting-started/overview/overview.md index 63060be32272eb..4c56a1414e73ce 100644 --- a/docs/data/system/getting-started/overview/overview.md +++ b/docs/data/system/getting-started/overview/overview.md @@ -10,7 +10,7 @@ title: Overview MUI System is a set of CSS utilities to help you build custom designs more efficiently. It's used internally by libraries like [Material UI](/material-ui/), [Joy UI](/joy-ui/getting-started/). -It can also be used to style [Base UI](/base-ui/) components. +It can also be used to style MUI Base components. MUI System gives you a set of flexible, generic wrapper components like [`Box`](/system/react-box/) and [`Container`](/system/react-container/) that can be quickly customized using the `sx` prop. This prop lets you define styles directly within the components themselves, rather than creating bulky and redundant `const` definitions with styled-components. @@ -24,9 +24,9 @@ Learn more on [the `sx` prop page](/system/getting-started/the-sx-prop/). - **Avoid context-switching:** with styled-components, you frequently have to jump between the usage and the definition to find what you need. With MUI System, it's all in one place. - **Forget unnecessary custom names:** if you've ever struggled to come up with a good name for a styled-component, then you'll appreciate skipping that step entirely when using MUI System. -## MUI System vs. Base UI +## MUI System vs. MUI Base -[Base UI](/base-ui/) is a library of "unstyled" React components, while MUI System is a set of utilities for quickly applying styles to those components (as well as our other component libraries like Material UI and Joy UI). +MUI Base is a library of "unstyled" React components, while MUI System is a set of utilities for quickly applying styles to those components (as well as our other component libraries like Material UI and Joy UI). -Base UI is a standalone component library, whereas MUI System is _supplemental_ in that it's designed to be paired with Base UI or any third-party components. +MUI Base is a standalone component library, whereas MUI System is _supplemental_ in that it's designed to be paired with MUI Base or any third-party components. See the [Custom components page](/system/getting-started/custom-components/) for details on how to use MUI System. diff --git a/docs/mui-vale/styles/MUI/MuiBrandName.yml b/docs/mui-vale/styles/MUI/MuiBrandName.yml index c12fb2f40d9a8d..7b980872b24450 100644 --- a/docs/mui-vale/styles/MUI/MuiBrandName.yml +++ b/docs/mui-vale/styles/MUI/MuiBrandName.yml @@ -12,6 +12,7 @@ swap: Material UI: Material UI MUI X: MUI X Base UI: Base UI + MUI Base: MUI Base MUI System: MUI System MUI Store: MUI Store MUI Core: MUI Core diff --git a/docs/next.config.mjs b/docs/next.config.ts similarity index 95% rename from docs/next.config.mjs rename to docs/next.config.ts index aaf5919d1c1f26..df35d969bb97ea 100644 --- a/docs/next.config.mjs +++ b/docs/next.config.ts @@ -5,18 +5,14 @@ import * as fs from 'fs'; // @ts-ignore import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; import { createRequire } from 'module'; -import { findPages } from './src/modules/utils/find.mjs'; +import { NextConfig } from 'next'; +import { findPages } from './src/modules/utils/find'; +import { LANGUAGES, LANGUAGES_SSR, LANGUAGES_IGNORE_PAGES, LANGUAGES_IN_PROGRESS } from './config'; const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url)); const require = createRequire(import.meta.url); -const withDocsInfra = require('./nextConfigDocsInfra.js'); -const { - LANGUAGES, - LANGUAGES_SSR, - LANGUAGES_IGNORE_PAGES, - LANGUAGES_IN_PROGRESS, -} = require('./config.js'); +const withDocsInfra = require('./nextConfigDocsInfra'); const workspaceRoot = path.join(currentDirectory, '../'); @@ -30,7 +26,7 @@ const pkgContent = fs.readFileSync(path.resolve(workspaceRoot, 'package.json'), const pkg = JSON.parse(pkgContent); export default withDocsInfra({ - webpack: (config, options) => { + webpack: (config: NextConfig, options): NextConfig => { const plugins = config.plugins.slice(); if (process.env.DOCS_STATS_ENABLED) { @@ -260,6 +256,15 @@ export default withDocsInfra({ return map; }, + redirects: async () => { + return [ + { + source: '/base-ui/', + destination: 'https://base-ui.com', + permanent: true, + }, + ]; + }, // Used to signal we run pnpm build ...(process.env.NODE_ENV === 'production' ? { @@ -276,4 +281,4 @@ export default withDocsInfra({ ]; }, }), -}); +} satisfies NextConfig); diff --git a/docs/package.json b/docs/package.json index fcabb6a62ffe6a..91d02cfc8552dc 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,7 +16,7 @@ "typescript": "tsc -p tsconfig.json && tsc -p scripts/tsconfig.json", "typescript:transpile": "echo 'Use `pnpm docs:typescript:formatted'` instead && exit 1", "typescript:transpile:dev": "echo 'Use `pnpm docs:typescript'` instead && exit 1", - "link-check": "node ./scripts/reportBrokenLinks.js" + "link-check": "tsx ./scripts/reportBrokenLinks.js" }, "dependencies": { "@babel/core": "^7.26.0", diff --git a/docs/pages/_app.js b/docs/pages/_app.js index 1b3a4e4e061636..f22f3cdbc9fcde 100644 --- a/docs/pages/_app.js +++ b/docs/pages/_app.js @@ -39,7 +39,7 @@ import SvgBaseUiLogo, { } from 'docs/src/icons/SvgBaseUiLogo'; import './global.css'; import '../public/static/components-gallery/base-theme.css'; -import config from '../config'; +import * as config from '../config'; // Remove the license warning from demonstration purposes LicenseInfo.setLicenseKey(process.env.NEXT_PUBLIC_MUI_LICENSE); @@ -226,7 +226,7 @@ function AppWrapper(props) { if (productId === 'base-ui') { return { metadata: '', - name: 'Base UI', + name: 'MUI Base', logo: SvgBaseUiLogo, logoSvg: baseSvgLogoString, wordmarkSvg: baseSvgWordmarkString, diff --git a/docs/pages/base-ui.tsx b/docs/pages/base-ui.tsx deleted file mode 100644 index 91f8644f6512c9..00000000000000 --- a/docs/pages/base-ui.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import * as React from 'react'; -import Divider from '@mui/material/Divider'; -import Head from 'docs/src/modules/components/Head'; -import BrandingCssVarsProvider from 'docs/src/BrandingCssVarsProvider'; -import AppHeader from 'docs/src/layouts/AppHeader'; -import AppFooter from 'docs/src/layouts/AppFooter'; -import AppHeaderBanner from 'docs/src/components/banner/AppHeaderBanner'; -import BaseUIHero from 'docs/src/components/productBaseUI/BaseUIHero'; -import BaseUISummary from 'docs/src/components/productBaseUI/BaseUISummary'; -import BaseUIComponents from 'docs/src/components/productBaseUI/BaseUIComponents'; -import BaseUICustomization from 'docs/src/components/productBaseUI/BaseUICustomization'; -import BaseUIEnd from 'docs/src/components/productBaseUI/BaseUIEnd'; -import BaseUITestimonial from 'docs/src/components/productBaseUI/BaseUITestimonial'; - -export default function BaseUI() { - return ( - - - {/* eslint-disable-next-line @next/next/no-page-custom-font */} - - - - -
- - - - - - - - - - - -
- -
- ); -} diff --git a/docs/pages/material-ui/api/icon-button.json b/docs/pages/material-ui/api/icon-button.json index 09cb6b9e7dc49e..cfb79b5bfe0f07 100644 --- a/docs/pages/material-ui/api/icon-button.json +++ b/docs/pages/material-ui/api/icon-button.json @@ -19,7 +19,7 @@ }, "default": "false" }, - "loading": { "type": { "name": "bool" }, "default": "false" }, + "loading": { "type": { "name": "bool" }, "default": "null" }, "loadingIndicator": { "type": { "name": "node" }, "default": "" @@ -117,6 +117,12 @@ "description": "Styles applied to the loadingIndicator element.", "isGlobal": false }, + { + "key": "loadingWrapper", + "className": "MuiIconButton-loadingWrapper", + "description": "Styles applied to the loadingWrapper element.", + "isGlobal": false + }, { "key": "root", "className": "MuiIconButton-root", diff --git a/docs/public/_redirects b/docs/public/_redirects index d0192f8d819a74..98b9636d692980 100644 --- a/docs/public/_redirects +++ b/docs/public/_redirects @@ -509,6 +509,7 @@ https://v4.material-ui.com/* https://v4.mui.com/:splat 301! /material-ui/experimental-api/css-theme-variables/overview/ /material-ui/customization/css-theme-variables/overview/ 301 /material-ui/experimental-api/css-theme-variables/usage/ /material-ui/customization/css-theme-variables/usage/ 301 /material-ui/experimental-api/css-theme-variables/customization/ /material-ui/customization/css-theme-variables/configuration/ 301 +/base-ui/ https://base-ui.com/ 301 # Proxies diff --git a/docs/scripts/reportBrokenLinks.js b/docs/scripts/reportBrokenLinks.js index 039d0db99c7ef0..564e8ae06ac21c 100644 --- a/docs/scripts/reportBrokenLinks.js +++ b/docs/scripts/reportBrokenLinks.js @@ -1,182 +1,14 @@ /* eslint-disable no-console */ -const path = require('path'); -const fse = require('fs-extra'); -const { createRender } = require('@mui/internal-markdown'); -const { marked } = require('marked'); -const { LANGUAGES_IGNORE_PAGES } = require('../config'); - -// Use renderer to extract all links into a markdown document -function getPageLinks(markdown) { - const hrefs = []; - - const renderer = new marked.Renderer(); - renderer.link = ({ href }) => { - if (href.startsWith('/')) { - hrefs.push(href); - } - }; - marked(markdown, { renderer }); - return hrefs; -} - -// List all .js files in a folder -function getJsFilesInFolder(folderPath) { - const files = fse.readdirSync(folderPath, { withFileTypes: true }); - return files.reduce((acc, file) => { - if (file.isDirectory()) { - const filesInFolder = getJsFilesInFolder(path.join(folderPath, file.name)); - return [...acc, ...filesInFolder]; - } - if (file.name.endsWith('.js') || file.name.endsWith('.tsx')) { - return [...acc, path.join(folderPath, file.name).replace(/\\/g, '/')]; - } - return acc; - }, []); -} - -// Returns url assuming it's "./docs/pages/x/..." becomes "mui.com/x/..." -const jsFilePathToUrl = (jsFilePath) => { - const folder = path.dirname(jsFilePath); - const file = path.basename(jsFilePath); - - const root = folder.slice(jsFilePath.indexOf('/pages') + '/pages'.length); - const suffix = path.extname(file); - let page = `/${file.slice(0, file.length - suffix.length)}/`; - - if (page === '/index/') { - page = '/'; - } - - return `${root}${page}`; -}; - -function cleanLink(link) { - const startQueryIndex = link.indexOf('?'); - const endQueryIndex = link.indexOf('#', startQueryIndex); - - if (startQueryIndex === -1) { - return link; - } - if (endQueryIndex === -1) { - return link.slice(0, startQueryIndex); - } - return `${link.slice(0, startQueryIndex)}${link.slice(endQueryIndex)}`; -} - -function getLinksAndAnchors(fileName) { - const headingHashes = {}; - const render = createRender({ - headingHashes, - options: { - ignoreLanguagePages: LANGUAGES_IGNORE_PAGES, - env: { - SOURCE_CODE_REPO: '', - }, - }, - }); - - const data = fse.readFileSync(fileName, { encoding: 'utf8' }); - render(data); - - const links = getPageLinks(data).map(cleanLink); - - return { - hashes: Object.keys(headingHashes), - links, - }; -} - -const markdownImportRegExp = /'(.*)\?(muiMarkdown|@mui\/markdown)'/g; - -const getMdFilesImported = (jsPageFile) => { - // For each JS file extract the markdown rendered if it exists - const fileContent = fse.readFileSync(jsPageFile, 'utf8'); - /** - * Content files can be represented by either: - * - 'docsx/data/advanced-components/overview.md?muiMarkdown'; (for mui-x) - * - 'docs/data/advanced-components/overview.md?muiMarkdown'; - * - './index.md?muiMarkdown'; - */ - const importPaths = fileContent.match(markdownImportRegExp); - - if (importPaths === null) { - return []; - } - return importPaths.map((importPath) => { - let cleanImportPath = importPath.replace(markdownImportRegExp, '$1'); - if (cleanImportPath.startsWith('.')) { - cleanImportPath = path.join(path.dirname(jsPageFile), cleanImportPath); - } else { - /** - * convert /Users/oliviertassinari/base-ui/docs/pages/base-ui/react-switch/index.js - * and docs-base/data/base/components/switch/switch.md - * into /Users/oliviertassinari/base-ui/docs/data/base/components/switch/switch.md - */ - const cleanImportPathArray = cleanImportPath.split('/'); - // Assume that the first folder is /docs or an alias that starts with /docs - cleanImportPathArray.shift(); - - // Truncate jsPageFile at /docs/ and append cleanImportPath - cleanImportPath = path.join( - jsPageFile.slice(0, jsPageFile.indexOf('/docs/')), - 'docs', - cleanImportPathArray.join('/'), - ); - } - - return cleanImportPath; - }); -}; - -const parseDocFolder = (folderPath, availableLinks = {}, usedLinks = {}) => { - const jsPageFiles = getJsFilesInFolder(folderPath); - - const mdFiles = jsPageFiles.flatMap((jsPageFile) => { - const pageUrl = jsFilePathToUrl(jsPageFile); - const importedMds = getMdFilesImported(jsPageFile); - - return importedMds.map((fileName) => ({ fileName, url: pageUrl })); - }); - - // Mark all the existing page as available - jsPageFiles.forEach((jsFilePath) => { - const url = jsFilePathToUrl(jsFilePath); - availableLinks[url] = true; - }); - - // For each markdown file, extract links - mdFiles.forEach(({ fileName, url }) => { - const { hashes, links } = getLinksAndAnchors(fileName); - - links.forEach((link) => { - if (usedLinks[link] === undefined) { - usedLinks[link] = [fileName]; - } else { - usedLinks[link].push(fileName); - } - }); - - hashes.forEach((hash) => { - availableLinks[`${url}#${hash}`] = true; - }); - }); -}; - -const getAnchor = (link) => { - const splittedPath = link.split('/'); - const potentialAnchor = splittedPath[splittedPath.length - 1]; - return potentialAnchor.includes('#') ? potentialAnchor : ''; -}; - -// Export useful method for doing similar checks in other repositories -module.exports = { parseDocFolder, getAnchor }; +import path from 'path'; +import fse from 'fs-extra'; +import { parseDocFolder, getAnchor } from './reportBrokenLinksLib'; /** * The remaining pat to the code is specific to this repository */ const UNSUPPORTED_PATHS = ['/api/', '/careers/', '/store/', '/x/']; -const docsSpaceRoot = path.join(__dirname, '../'); +const docsSpaceRoot = path.join(path.dirname(new URL(import.meta.url).pathname), '../'); const buffer = []; function write(text) { @@ -193,43 +25,41 @@ function getPageUrlFromLink(link) { return rep; } -if (require.main === module) { - // {[url with hash]: true} - const availableLinks = {}; - - // {[url with hash]: list of files using this link} - const usedLinks = {}; - - parseDocFolder(path.join(docsSpaceRoot, './pages/'), availableLinks, usedLinks); - - write('Broken links found by `pnpm docs:link-check` that exist:\n'); - Object.keys(usedLinks) - .filter((link) => link.startsWith('/')) - .filter((link) => !availableLinks[link]) - // these url segments are specific to Base UI and added by scripts (can not be found in markdown) - .filter((link) => - ['components-api', 'hooks-api', '#unstyled'].every((str) => !link.includes(str)), - ) - .filter((link) => UNSUPPORTED_PATHS.every((unsupportedPath) => !link.includes(unsupportedPath))) - .sort() - .forEach((linkKey) => { - // - // - // - write(`- https://mui.com${linkKey}`); - console.log(`https://mui.com${linkKey}`); - - console.log(`used in`); - usedLinks[linkKey].forEach((f) => console.log(`- ${path.relative(docsSpaceRoot, f)}`)); - console.log('available anchors on the same page:'); - console.log( - Object.keys(availableLinks) - .filter((link) => getPageUrlFromLink(link) === getPageUrlFromLink(linkKey)) - .sort() - .map(getAnchor) - .join('\n'), - ); - console.log('\n\n'); - }); - save(buffer); -} +// {[url with hash]: true} +const availableLinks = {}; + +// {[url with hash]: list of files using this link} +const usedLinks = {}; + +parseDocFolder(path.join(docsSpaceRoot, './pages/'), availableLinks, usedLinks); + +write('Broken links found by `pnpm docs:link-check` that exist:\n'); +Object.keys(usedLinks) + .filter((link) => link.startsWith('/')) + .filter((link) => !availableLinks[link]) + // these url segments are specific to Base UI and added by scripts (can not be found in markdown) + .filter((link) => + ['components-api', 'hooks-api', '#unstyled'].every((str) => !link.includes(str)), + ) + .filter((link) => UNSUPPORTED_PATHS.every((unsupportedPath) => !link.includes(unsupportedPath))) + .sort() + .forEach((linkKey) => { + // + // + // + write(`- https://mui.com${linkKey}`); + console.log(`https://mui.com${linkKey}`); + + console.log(`used in`); + usedLinks[linkKey].forEach((f) => console.log(`- ${path.relative(docsSpaceRoot, f)}`)); + console.log('available anchors on the same page:'); + console.log( + Object.keys(availableLinks) + .filter((link) => getPageUrlFromLink(link) === getPageUrlFromLink(linkKey)) + .sort() + .map(getAnchor) + .join('\n'), + ); + console.log('\n\n'); + }); +save(buffer); diff --git a/docs/scripts/reportBrokenLinksLib.js b/docs/scripts/reportBrokenLinksLib.js new file mode 100644 index 00000000000000..b316ce2073fdf3 --- /dev/null +++ b/docs/scripts/reportBrokenLinksLib.js @@ -0,0 +1,171 @@ +import path from 'path'; +import fse from 'fs-extra'; +import { createRender } from '@mui/internal-markdown'; +import { marked } from 'marked'; +import { LANGUAGES_IGNORE_PAGES } from '../config'; + +// Use renderer to extract all links into a markdown document +function getPageLinks(markdown) { + const hrefs = []; + + const renderer = new marked.Renderer(); + renderer.link = ({ href }) => { + if (href.startsWith('/')) { + hrefs.push(href); + } + }; + marked(markdown, { renderer }); + return hrefs; +} + +// List all .js files in a folder +function getJsFilesInFolder(folderPath) { + const files = fse.readdirSync(folderPath, { withFileTypes: true }); + return files.reduce((acc, file) => { + if (file.isDirectory()) { + const filesInFolder = getJsFilesInFolder(path.join(folderPath, file.name)); + return [...acc, ...filesInFolder]; + } + if (file.name.endsWith('.js') || file.name.endsWith('.tsx')) { + return [...acc, path.join(folderPath, file.name).replace(/\\/g, '/')]; + } + return acc; + }, []); +} + +// Returns url assuming it's "./docs/pages/x/..." becomes "mui.com/x/..." +const jsFilePathToUrl = (jsFilePath) => { + const folder = path.dirname(jsFilePath); + const file = path.basename(jsFilePath); + + const root = folder.slice(jsFilePath.indexOf('/pages') + '/pages'.length); + const suffix = path.extname(file); + let page = `/${file.slice(0, file.length - suffix.length)}/`; + + if (page === '/index/') { + page = '/'; + } + + return `${root}${page}`; +}; + +function cleanLink(link) { + const startQueryIndex = link.indexOf('?'); + const endQueryIndex = link.indexOf('#', startQueryIndex); + + if (startQueryIndex === -1) { + return link; + } + if (endQueryIndex === -1) { + return link.slice(0, startQueryIndex); + } + return `${link.slice(0, startQueryIndex)}${link.slice(endQueryIndex)}`; +} + +function getLinksAndAnchors(fileName) { + const headingHashes = {}; + const render = createRender({ + headingHashes, + options: { + ignoreLanguagePages: LANGUAGES_IGNORE_PAGES, + env: { + SOURCE_CODE_REPO: '', + }, + }, + }); + + const data = fse.readFileSync(fileName, { encoding: 'utf8' }); + render(data); + + const links = getPageLinks(data).map(cleanLink); + + return { + hashes: Object.keys(headingHashes), + links, + }; +} + +const markdownImportRegExp = /'(.*)\?(muiMarkdown|@mui\/markdown)'/g; + +const getMdFilesImported = (jsPageFile) => { + // For each JS file extract the markdown rendered if it exists + const fileContent = fse.readFileSync(jsPageFile, 'utf8'); + /** + * Content files can be represented by either: + * - 'docsx/data/advanced-components/overview.md?muiMarkdown'; (for mui-x) + * - 'docs/data/advanced-components/overview.md?muiMarkdown'; + * - './index.md?muiMarkdown'; + */ + const importPaths = fileContent.match(markdownImportRegExp); + + if (importPaths === null) { + return []; + } + return importPaths.map((importPath) => { + let cleanImportPath = importPath.replace(markdownImportRegExp, '$1'); + if (cleanImportPath.startsWith('.')) { + cleanImportPath = path.join(path.dirname(jsPageFile), cleanImportPath); + } else { + /** + * convert /Users/oliviertassinari/base-ui/docs/pages/base-ui/react-switch/index.js + * and docs-base/data/base/components/switch/switch.md + * into /Users/oliviertassinari/base-ui/docs/data/base/components/switch/switch.md + */ + const cleanImportPathArray = cleanImportPath.split('/'); + // Assume that the first folder is /docs or an alias that starts with /docs + cleanImportPathArray.shift(); + + // Truncate jsPageFile at /docs/ and append cleanImportPath + cleanImportPath = path.join( + jsPageFile.slice(0, jsPageFile.indexOf('/docs/')), + 'docs', + cleanImportPathArray.join('/'), + ); + } + + return cleanImportPath; + }); +}; + +const parseDocFolder = (folderPath, availableLinks = {}, usedLinks = {}) => { + const jsPageFiles = getJsFilesInFolder(folderPath); + + const mdFiles = jsPageFiles.flatMap((jsPageFile) => { + const pageUrl = jsFilePathToUrl(jsPageFile); + const importedMds = getMdFilesImported(jsPageFile); + + return importedMds.map((fileName) => ({ fileName, url: pageUrl })); + }); + + // Mark all the existing page as available + jsPageFiles.forEach((jsFilePath) => { + const url = jsFilePathToUrl(jsFilePath); + availableLinks[url] = true; + }); + + // For each markdown file, extract links + mdFiles.forEach(({ fileName, url }) => { + const { hashes, links } = getLinksAndAnchors(fileName); + + links.forEach((link) => { + if (usedLinks[link] === undefined) { + usedLinks[link] = [fileName]; + } else { + usedLinks[link].push(fileName); + } + }); + + hashes.forEach((hash) => { + availableLinks[`${url}#${hash}`] = true; + }); + }); +}; + +const getAnchor = (link) => { + const splittedPath = link.split('/'); + const potentialAnchor = splittedPath[splittedPath.length - 1]; + return potentialAnchor.includes('#') ? potentialAnchor : ''; +}; + +// Export useful method for doing similar checks in other repositories +export { parseDocFolder, getAnchor }; diff --git a/docs/src/components/header/HeaderNavDropdown.tsx b/docs/src/components/header/HeaderNavDropdown.tsx index 713edd4644e911..1c0f299b07a592 100644 --- a/docs/src/components/header/HeaderNavDropdown.tsx +++ b/docs/src/components/header/HeaderNavDropdown.tsx @@ -95,7 +95,7 @@ const DOCS = [ href: ROUTES.joyDocs, }, { - name: 'Base UI', + name: 'MUI Base', description: 'Unstyled React components and low-level hooks.', href: ROUTES.baseDocs, }, diff --git a/docs/src/components/pricing/PricingTable.tsx b/docs/src/components/pricing/PricingTable.tsx index c7789a0572181c..2f0eb0334a24dc 100644 --- a/docs/src/components/pricing/PricingTable.tsx +++ b/docs/src/components/pricing/PricingTable.tsx @@ -429,9 +429,9 @@ function RowHead({ const rowHeaders: Record = { // Core - 'Base UI': ( + 'MUI Base': ( ), @@ -737,7 +737,7 @@ const toBeDefined = ( const communityData: Record = { // Core open-source libraries - 'Base UI': yes, + 'MUI Base': yes, 'MUI System': yes, 'Material UI': yes, 'Joy UI': yes, @@ -840,7 +840,7 @@ const communityData: Record = { const proData: Record = { // Core - 'Base UI': yes, + 'MUI Base': yes, 'MUI System': yes, 'Material UI': yes, 'Joy UI': yes, @@ -944,7 +944,7 @@ const proData: Record = { const premiumData: Record = { // Core - 'Base UI': yes, + 'MUI Base': yes, 'MUI System': yes, 'Material UI': yes, 'Joy UI': yes, @@ -1369,7 +1369,7 @@ export default function PricingTable({ {divider} {renderRow('Joy UI')} {divider} - {renderRow('Base UI')} + {renderRow('MUI Base')} {divider} {renderRow('MUI System')} }> diff --git a/docs/src/components/productBaseUI/BaseUIComponents.tsx b/docs/src/components/productBaseUI/BaseUIComponents.tsx index f0ecbab9d3000b..ee720b2bbe7c1a 100644 --- a/docs/src/components/productBaseUI/BaseUIComponents.tsx +++ b/docs/src/components/productBaseUI/BaseUIComponents.tsx @@ -81,7 +81,7 @@ export default function BaseUIComponents() {
CSS adventure } - description="Base UI's skeletal components give you a sturdy foundation to apply custom styles with ease. With no defaults to override, you're free to start from scratch using vanilla CSS, Tailwind CSS, MUI System, or any other framework you prefer." + description="MUI Base's skeletal components give you a sturdy foundation to apply custom styles with ease. With no defaults to override, you're free to start from scratch using vanilla CSS, Tailwind CSS, MUI System, or any other framework you prefer." /> {DEMOS.map((name) => ( diff --git a/docs/src/components/productBaseUI/BaseUICustomization.tsx b/docs/src/components/productBaseUI/BaseUICustomization.tsx index b1263233e99c6f..0a5bbcc037a2eb 100644 --- a/docs/src/components/productBaseUI/BaseUICustomization.tsx +++ b/docs/src/components/productBaseUI/BaseUICustomization.tsx @@ -244,14 +244,14 @@ export default function BaseUICustomization() {
with a lightweight API } - description="With Base UI, you have the freedom to decide how much you want to customize a component's structure and style." + description="With MUI Base, you have the freedom to decide how much you want to customize a component's structure and style." /> setIndex(0)}> } title="Applying custom CSS rules" - description="Your CSS, your rules. With Base UI there are no styles to override, so you can start with a clean slate." + description="Your CSS, your rules. With MUI Base there are no styles to override, so you can start with a clean slate." /> setIndex(1)}> @@ -265,7 +265,7 @@ export default function BaseUICustomization() { } title="Creating custom components using hooks" - description="Base UI includes low-level hooks for adding functionality to your own fully custom-built components." + description="MUI Base includes low-level hooks for adding functionality to your own fully custom-built components." /> diff --git a/docs/src/components/productBaseUI/BaseUIEnd.tsx b/docs/src/components/productBaseUI/BaseUIEnd.tsx index cf9ea8da96761d..60206f1cc03785 100644 --- a/docs/src/components/productBaseUI/BaseUIEnd.tsx +++ b/docs/src/components/productBaseUI/BaseUIEnd.tsx @@ -37,14 +37,14 @@ export default function BaseUIEnd() { } description={ - Base UI wouldn't be possible without our global community of contributors. Join - us today to get help when you need it, and lend a hand when you can. + MUI Base wouldn't be possible without our global community of contributors. + Join us today to get help when you need it, and lend a hand when you can. } /> @@ -55,10 +55,10 @@ export default function BaseUIEnd() { } />
- Base UI vs. Material UI + MUI Base vs. Material UI - Base UI features many of the same components as Material UI, but without the + MUI Base features many of the same components as Material UI, but without the Material Design implementation.
@@ -70,7 +70,7 @@ export default function BaseUIEnd() { Does it come with styles? - Base UI is not packaged with any default theme or built-in style engine. + MUI Base is not packaged with any default theme or built-in style engine. This makes it a great choice if you need complete control over how your app's CSS is implemented. diff --git a/docs/src/components/productBaseUI/BaseUIHero.tsx b/docs/src/components/productBaseUI/BaseUIHero.tsx index a90fe44968141a..1d876f56c148dc 100644 --- a/docs/src/components/productBaseUI/BaseUIHero.tsx +++ b/docs/src/components/productBaseUI/BaseUIHero.tsx @@ -62,7 +62,7 @@ export default function BaseUIHero() { / - Base UI + MUI Base @@ -80,13 +80,13 @@ export default function BaseUIHero() { total flexibility - Base UI gives you a set of foundational "headless" components that you can + MUI Base gives you a set of foundational "headless" components that you can build with using any styling solution you choose—no need to override any default style engine or theme. diff --git a/docs/src/components/productBaseUI/BaseUISummary.tsx b/docs/src/components/productBaseUI/BaseUISummary.tsx index a42d450154ceb1..00c945e07903fc 100644 --- a/docs/src/components/productBaseUI/BaseUISummary.tsx +++ b/docs/src/components/productBaseUI/BaseUISummary.tsx @@ -21,14 +21,14 @@ const content = [ icon: , title: 'Low-level hooks', description: - "When it's time to go fully custom, Base UI has you covered with low-level hooks for fine-grained flexibility in component design.", + "When it's time to go fully custom, MUI Base has you covered with low-level hooks for fine-grained flexibility in component design.", link: '/base-ui/getting-started/usage/#components-vs-hooks', }, { icon: , title: 'Accessibility', description: - 'We take accessibility seriously. The Base UI docs are loaded with guidelines and best practices.', + 'We take accessibility seriously. The MUI Base docs are loaded with guidelines and best practices.', link: '/base-ui/getting-started/accessibility/', }, ]; @@ -38,14 +38,14 @@ export default function BaseUISummary() {
Essential building blocks
for sleek and accessible UIs } - description="Base UI abstracts away the more frustrating aspects of UI development—like accessibility, cross-browser compatibility, and event handling—so you can skip ahead to design implementation." + description="MUI Base abstracts away the more frustrating aspects of UI development—like accessibility, cross-browser compatibility, and event handling—so you can skip ahead to design implementation." /> diff --git a/docs/src/components/productBaseUI/BaseUITestimonial.tsx b/docs/src/components/productBaseUI/BaseUITestimonial.tsx index c7c19b95ef433a..96a49163b6d500 100644 --- a/docs/src/components/productBaseUI/BaseUITestimonial.tsx +++ b/docs/src/components/productBaseUI/BaseUITestimonial.tsx @@ -44,13 +44,13 @@ export default function BaseUITestimonial() { component="img" src="/static/branding/base-ui/nhost-screenshot.png" srcSet="/static/branding/base-ui/nhost-screenshot-2x.png 2x" - alt="Screenshot displaying part of the Nhost dashboard that used Base UI to be built." + alt="Screenshot displaying part of the Nhost dashboard that used MUI Base to be built." loading="lazy" sx={{ backgroundColor: '#fff', width: 510, height: 210 }} /> - Nhost's new dashboard, powered by Base UI    + Nhost's new dashboard, powered by MUI Base    “After considering various options, we decided to migrate our custom components to - Material UI, and that's when we discovered Base UI. As a set of headless + Material UI, and that's when we discovered MUI Base. As a set of headless components, it offered exactly what we needed to implement our design system while maintaining full customizability. The focus on accessibility was also a big plus, as it ensured that our dashboard was usable by everyone. Low-level component hooks were just diff --git a/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx b/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx index 5d970f332f47c1..ca1288536f6419 100644 --- a/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx +++ b/docs/src/components/productBaseUI/BaseUIThemesDemo.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import clsx from 'clsx'; -// Base UI imports +// @mui/base imports import { Badge, badgeClasses } from '@mui/base/Badge'; import { Input, InputProps } from '@mui/base/Input'; import { Dropdown } from '@mui/base/Dropdown'; @@ -819,7 +819,7 @@ export default function BaseUIThemesDemo() { - Oh, hey, this is a Base UI modal. + Oh, hey, this is a MUI Base modal. - Base UI modals manages modal stacking when more than one is needed, creates a + MUI Base modals manages modal stacking when more than one is needed, creates a backdrop to disable interaction with the rest of the app, and a lot more. Close @@ -1022,7 +1022,7 @@ export default function BaseUIThemesDemo() {
-
This is a Base UI snackbar.
+
This is a MUI Base snackbar.
Free to design as you want it.
diff --git a/docs/src/components/productBaseUI/MuiBaseDeprecation.tsx b/docs/src/components/productBaseUI/MuiBaseDeprecation.tsx new file mode 100644 index 00000000000000..d7356a453d41f2 --- /dev/null +++ b/docs/src/components/productBaseUI/MuiBaseDeprecation.tsx @@ -0,0 +1,50 @@ +import * as React from 'react'; +import Box from '@mui/material/Box'; +import { MarkdownElement } from '@mui/docs/MarkdownElement'; + +export default function MuiBaseDeprecation(props: { + newComponentName?: string; + newComponentUrl?: string; +}) { + if (props.newComponentUrl && props.newComponentName) { + return ( + + + + + @mui/base has been deprecated and has been replaced by Base UI. We strongly recommend + using the Base UI {props.newComponentName} component{' '} + instead. + + + + ); + } + return ( + + + + + @mui/base has been deprecated and has been replaced by{' '} + Base UI. We strongly recommend using the new package + instead. + + + + ); +} + +function Icon() { + return ( + + + + ); +} diff --git a/docs/src/components/productCore/CoreProducts.tsx b/docs/src/components/productCore/CoreProducts.tsx index a0297d91a066da..6f1adb0f36e10f 100644 --- a/docs/src/components/productCore/CoreProducts.tsx +++ b/docs/src/components/productCore/CoreProducts.tsx @@ -4,7 +4,6 @@ import Section from 'docs/src/layouts/Section'; import { InfoCard } from '@mui/docs/InfoCard'; import { Theme } from '@mui/material/styles'; import SvgMuiLogomark from 'docs/src/icons/SvgMuiLogomark'; -import SvgBaseUiLogo from 'docs/src/icons/SvgBaseUiLogo'; import StyleRoundedIcon from '@mui/icons-material/StyleRounded'; import WebRoundedIcon from '@mui/icons-material/WebRounded'; @@ -35,13 +34,6 @@ const content = [ "An open-source React component library that implements MUI's own in-house design principles.", link: '/joy-ui/getting-started/', }, - { - icon: , - title: 'Base UI', - description: - "A library of unstyled React components and low-level hooks. With Base UI, you gain complete control over your app's CSS and accessibility features.", - link: '/base-ui/', - }, { icon: , title: 'MUI System', @@ -56,7 +48,7 @@ export default function CoreProducts() {
{content.map(({ icon, title, description, link }) => ( - + } />
- Material UI vs. Base UI + Material UI vs. MUI Base - Material UI implements Google's Material Design whereas Base UI features + Material UI implements Google's Material Design whereas MUI Base features many of the same components, but without the Material Design implementation.
diff --git a/docs/src/components/showcase/NotificationCard.tsx b/docs/src/components/showcase/NotificationCard.tsx index 8088639cedbbe4..b352d8c22f8244 100644 --- a/docs/src/components/showcase/NotificationCard.tsx +++ b/docs/src/components/showcase/NotificationCard.tsx @@ -65,7 +65,7 @@ export default function NotificationCard() { Incredible discoveries - It's about Material UI & Base UI... + It's about Material UI & MUI Base...
- + diff --git a/docs/src/components/showcase/ThemeTimeline.tsx b/docs/src/components/showcase/ThemeTimeline.tsx index e63871db097423..e8e0496182cdcd 100644 --- a/docs/src/components/showcase/ThemeTimeline.tsx +++ b/docs/src/components/showcase/ThemeTimeline.tsx @@ -111,7 +111,7 @@ export default function BasicTimeline() { - Base UI + MUI Base diff --git a/docs/src/components/showcase/ThemeToggleButton.tsx b/docs/src/components/showcase/ThemeToggleButton.tsx index 2359550e6148ac..44f30813601eac 100644 --- a/docs/src/components/showcase/ThemeToggleButton.tsx +++ b/docs/src/components/showcase/ThemeToggleButton.tsx @@ -42,7 +42,7 @@ export default function ThemeToggleButton() { > Joy UI Material UI - Base UI + MUI Base ); diff --git a/docs/src/layouts/AppFooter.tsx b/docs/src/layouts/AppFooter.tsx index bffdb8ca5bc467..42b1228f8b0da6 100644 --- a/docs/src/layouts/AppFooter.tsx +++ b/docs/src/layouts/AppFooter.tsx @@ -77,7 +77,7 @@ export default function AppFooter(props: AppFooterProps) { Material UI - Base UI + MUI Base MUI X diff --git a/docs/src/modules/components/AppSearch.js b/docs/src/modules/components/AppSearch.js index 201a926960567f..17012117f65196 100644 --- a/docs/src/modules/components/AppSearch.js +++ b/docs/src/modules/components/AppSearch.js @@ -134,7 +134,7 @@ function NewStartScreen() { }, { category: { - name: 'Base UI', + name: 'MUI Base', }, items: [ { @@ -270,7 +270,7 @@ function NewStartScreen() { const productNameProductId = { 'material-ui': 'Material UI', 'joy-ui': 'Joy UI', - 'base-ui': 'Base UI', + 'base-ui': 'MUI Base', x: 'MUI X', system: 'MUI System', toolpad: 'Toolpad', diff --git a/docs/src/modules/components/Demo.js b/docs/src/modules/components/Demo.js index 53e688b3a9f7af..b5b11f93a46c1c 100644 --- a/docs/src/modules/components/Demo.js +++ b/docs/src/modules/components/Demo.js @@ -68,7 +68,7 @@ function useDemoData(codeVariant, demo, githubLocation, codeStyling) { name = 'Joy UI'; } else if (canonicalAs.startsWith('/base-ui/')) { productId = 'base-ui'; - name = 'Base UI'; + name = 'MUI Base'; } else if (canonicalAs.startsWith('/x/')) { name = 'MUI X'; } diff --git a/docs/src/modules/components/MarkdownDocs.js b/docs/src/modules/components/MarkdownDocs.js index 921451a9a7af93..a8638b7ed62fa5 100644 --- a/docs/src/modules/components/MarkdownDocs.js +++ b/docs/src/modules/components/MarkdownDocs.js @@ -10,6 +10,7 @@ import { pathnameToLanguage } from 'docs/src/modules/utils/helpers'; import AppLayoutDocs from 'docs/src/modules/components/AppLayoutDocs'; import { useUserLanguage } from '@mui/docs/i18n'; import { BrandingProvider } from '@mui/docs/branding'; +import MuiBaseDeprecation from 'docs/src/components/productBaseUI/MuiBaseDeprecation'; function JoyModeObserver({ mode }) { const { setMode } = useColorScheme(); @@ -44,6 +45,8 @@ export default function MarkdownDocs(props) { const userLanguage = useUserLanguage(); const localizedDoc = docs[userLanguage] || docs.en; + const isBase = canonicalAs.startsWith('/base-ui/'); + const isJoy = canonicalAs.startsWith('/joy-ui/') && !disableCssVarsProvider; const CssVarsProvider = isJoy ? JoyCssVarsProvider : React.Fragment; const Wrapper = isJoy ? BrandingProvider : React.Fragment; @@ -73,6 +76,12 @@ export default function MarkdownDocs(props) { )} {isJoy && } + {isBase && ( + + )} {localizedDoc.rendered.map((renderedMarkdownOrDemo, index) => ( {isJoy && } + {isBase && ( + + )} {commonElements} {activeTab === '' && localizedDoc.rendered diff --git a/docs/src/modules/components/MuiProductSelector.tsx b/docs/src/modules/components/MuiProductSelector.tsx index af9370110bd50d..9874a60f3351ce 100644 --- a/docs/src/modules/components/MuiProductSelector.tsx +++ b/docs/src/modules/components/MuiProductSelector.tsx @@ -141,7 +141,7 @@ const coreProducts = [ }, { id: 'base-ui', - name: 'Base UI', + name: 'MUI Base', description: 'Unstyled components and hooks.', icon: , href: ROUTES.baseDocs, diff --git a/docs/src/modules/utils/find.mjs b/docs/src/modules/utils/find.ts similarity index 82% rename from docs/src/modules/utils/find.mjs rename to docs/src/modules/utils/find.ts index a5221c421cd2a7..2443570ffec0ad 100644 --- a/docs/src/modules/utils/find.mjs +++ b/docs/src/modules/utils/find.ts @@ -7,27 +7,26 @@ const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url)); const pageRegex = /(\.js|\.tsx)$/; const blackList = ['/.eslintrc', '/_document', '/_app']; -/** - * @typedef {object} NextJSPage - * @property {string} pathname - * @property {NextJSPage[]} [children] - */ +interface NextJSPage { + pathname: string; + children?: NextJSPage[]; +} + +interface FindPagesOptions { + front?: boolean; +} /** * Returns the Next.js pages available in a nested format. * The output is in the next.js format. * Each pathname is a route you can navigate to. - * @param {{ front: true }} [options] - * @param {string} [directory] - * @param {NextJSPage[]} pages - * @returns {NextJSPage[]} */ // eslint-disable-next-line import/prefer-default-export export function findPages( - options = {}, - directory = path.resolve(currentDirectory, '../../../pages'), - pages = [], -) { + options: FindPagesOptions = {}, + directory: string = path.resolve(currentDirectory, '../../../pages'), + pages: NextJSPage[] = [], +): NextJSPage[] { fs.readdirSync(directory).forEach((item) => { const itemPath = path.resolve(directory, item); const pathname = itemPath @@ -47,7 +46,7 @@ export function findPages( } if (fs.statSync(itemPath).isDirectory()) { - const children = []; + const children: NextJSPage[] = []; pages.push({ pathname, children, diff --git a/docs/src/modules/utils/getProductInfoFromUrl.test.js b/docs/src/modules/utils/getProductInfoFromUrl.test.js index 90b14261522b73..ba296fcc1d26f3 100644 --- a/docs/src/modules/utils/getProductInfoFromUrl.test.js +++ b/docs/src/modules/utils/getProductInfoFromUrl.test.js @@ -22,7 +22,7 @@ describe('getProductInfoFromUrl', () => { }); }); - it('should handle Base UI', () => { + it('should handle MUI Base', () => { expect(getProductInfoFromUrl('/base-ui/react-button/')).to.deep.equal({ productCategoryId: 'core', productId: 'base-ui', diff --git a/docs/translations/api-docs-base/css-transition/css-transition.json b/docs/translations/api-docs-base/css-transition/css-transition.json index 0071d2e1cd76ff..b092cf058fa1c2 100644 --- a/docs/translations/api-docs-base/css-transition/css-transition.json +++ b/docs/translations/api-docs-base/css-transition/css-transition.json @@ -1,5 +1,5 @@ { - "componentDescription": "A utility component that hooks up to the Base UI transitions API and\napplies a CSS transition to its children when necessary.", + "componentDescription": "A utility component that hooks up to the MUI Base transitions API and\napplies a CSS transition to its children when necessary.", "propDescriptions": { "enterClassName": { "description": "The name of the CSS class applied to the component when the transition is requested to enter." diff --git a/docs/translations/api-docs/icon-button/icon-button.json b/docs/translations/api-docs/icon-button/icon-button.json index a54834e31d136a..14e949b9b70d95 100644 --- a/docs/translations/api-docs/icon-button/icon-button.json +++ b/docs/translations/api-docs/icon-button/icon-button.json @@ -17,7 +17,7 @@ "description": "If given, uses a negative margin to counteract the padding on one side (this is often helpful for aligning the left or right side of the icon with content above or below, without ruining the border size and shape)." }, "loading": { - "description": "If true, the loading indicator is visible and the button is disabled." + "description": "If true, the loading indicator is visible and the button is disabled. If true \\| false, the loading wrapper is always rendered before the children to prevent Google Translation Crash." }, "loadingIndicator": { "description": "Element placed before the children if the button is in loading state. The node should contain an element with role="progressbar" with an accessible name. By default, it renders a CircularProgress that is labeled by the button itself." @@ -89,6 +89,10 @@ "description": "Styles applied to {{nodeName}}.", "nodeName": "the loadingIndicator element" }, + "loadingWrapper": { + "description": "Styles applied to {{nodeName}}.", + "nodeName": "the loadingWrapper element" + }, "root": { "description": "Styles applied to the root element." }, "sizeLarge": { "description": "Styles applied to {{nodeName}} if {{conditions}}.", diff --git a/docs/tsconfig.json b/docs/tsconfig.json index f72d9e329a56d7..0c74a89e15ddf7 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -3,6 +3,7 @@ "compilerOptions": { "allowJs": true, "isolatedModules": true, + "moduleResolution": "bundler", /* files are emitted by babel */ "noEmit": true, "noUnusedLocals": true, @@ -11,13 +12,6 @@ "esModuleInterop": true, "incremental": true }, - "include": [ - "next-env.d.ts", - "next.config.mjs", - "types", - "src", - "pages", - "data" - ], + "include": ["next-env.d.ts", "next.config.ts", "types", "src", "pages", "data"], "exclude": ["docs/.next", "docs/export", "node_modules"] } diff --git a/examples/base-ui-cra-ts/public/index.html b/examples/base-ui-cra-ts/public/index.html index cbd4989b1443c4..d0ce61c747019b 100644 --- a/examples/base-ui-cra-ts/public/index.html +++ b/examples/base-ui-cra-ts/public/index.html @@ -4,7 +4,7 @@ - CRA + Base UI + TS + CRA + MUI Base + TS diff --git a/examples/base-ui-cra/public/index.html b/examples/base-ui-cra/public/index.html index 71fe1731a68db2..9a5e8c93bdae53 100644 --- a/examples/base-ui-cra/public/index.html +++ b/examples/base-ui-cra/public/index.html @@ -5,7 +5,7 @@ - CRA + Base UI + CRA + MUI Base diff --git a/examples/base-ui-vite-tailwind-ts/src/App.tsx b/examples/base-ui-vite-tailwind-ts/src/App.tsx index a2085ff2abeb48..812bba2fdfb8eb 100644 --- a/examples/base-ui-vite-tailwind-ts/src/App.tsx +++ b/examples/base-ui-vite-tailwind-ts/src/App.tsx @@ -4,12 +4,12 @@ export default function App() { return (

- Base UI + Vite.js + Tailwind CSS in TypeScript + MUI Base + Vite.js + Tailwind CSS in TypeScript