Skip to content

Commit

Permalink
Merge branch 'master' into issue-42379-AppBar-color-inherit-inconsistent
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeshanTamboli committed Jul 11, 2024
2 parents 6e338fa + 3a920ad commit f995599
Show file tree
Hide file tree
Showing 325 changed files with 15,475 additions and 12,379 deletions.
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ commands:
node scripts/useReactVersion.mjs
# log a patch for maintainers who want to check out this change
git --no-pager diff HEAD
- when:
condition: << parameters.browsers >>
steps:
Expand All @@ -93,6 +94,13 @@ commands:
name: Restore playwright cache
keys:
- v6-playwright-{{ arch }}-{{ checksum "/tmp/playwright_info.json" }}
- when:
condition:
not: << parameters.browsers >>
steps:
# See https://stackoverflow.com/a/73411601
- run: corepack enable --install-directory ~/bin

- run:
name: View install environment
command: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# fetch all tags which are required for `pnpm release:changelog`
fetch-depth: 0
- name: Set up pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
uses: pnpm/action-setup@v4
- name: Use Node.js 18.x
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
Expand Down
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,63 @@
# [Versions](https://mui.com/versions/)

## v5.16.0

<!-- generated comparing v5.15.21..master -->

_Jul 5, 2024_

A big thanks to the 5 contributors who made this release possible. Here are some highlights ✨:

- 🚀 Added `InitColorSchemeScript` for Next.js App Router (#42829) @siriwatknp

### `@mui/[email protected]`

- [Alert] Add ability to override slot props (@alexey-kozlenkov) (#42808) @alexey-kozlenkov
- Add `InitColorSchemeScript` for Next.js App Router (#42829) @siriwatknp
- Add `DefaultPropsProvider` (#42820) @siriwatknp
- Support `CssVarsTheme` in `responsiveFontSizes` return type (@jxdp) (#42806) @jxdp
- Remove warning from `getInitColorSchemeScript` (#42838) @siriwatknp

### Docs

- [docs] Fix 301 MDN redirections @oliviertassinari

### Core

- [mui-utils][test] Remove usages of deprecated react-dom APIs (@aarongarciah) (#42813) @aarongarciah

All contributors of this release in alphabetical order: @aarongarciah, @alexey-kozlenkov, @jxdp, @oliviertassinari, @siriwatknp

## v5.15.21

<!-- generated comparing v5.15.20..master -->

_Jun 28, 2024_

A big thanks to the 7 contributors who made this release possible.

### `@mui/[email protected]`

- [Autocomplete] Fix renderOption props type (@DiegoAndai) (#42709) @DiegoAndai
- [Stepper] Generate class for `nonLinear` prop (@alexismo) (#42677) @alexismo

### Docs

- Use new email for sponsoring @oliviertassinari
- Fix 301 links (@alexfauquette) (#42700) @alexfauquette
- [material-ui][Select] Fix the `SelectAutoWidth` demo menu item value (@Danielkhakbaz) (#42696) @Danielkhakbaz
- [material-ui][Autocomplete] Fix more React 18.3 key spread warnings in demos (#42766) @wbt
- [material-ui] Fix sign in side image (#42708) @zanivan
- [website] Add Ale to team (#42769) @alelthomas

### Core

- [core] Cherry pick pnpm updates (#42763) @DiegoAndai
- [website] Add Armin to the team members (@arminmeh) (#42681) @arminmeh
- [website] Open Staff Engineer role for Pigment CSS (@mnajdova) (#42669) @mnajdova

All contributors of this release in alphabetical order: @alexfauquette, @alexismo, @arminmeh, @Danielkhakbaz, @DiegoAndai, @mnajdova, @oliviertassinari

## v5.15.20

<!-- generated comparing v5.15.19..master -->
Expand Down
10 changes: 5 additions & 5 deletions apps/pigment-css-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
"@mui/icons-material": "file:../../packages/mui-icons-material/build",
"@emotion/cache": "latest",
"local-ui-lib": "workspace:^",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"next": "latest"
"next": "latest",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@pigment-css/unplugin": "file:../../packages/pigment-css-unplugin",
"@pigment-css/nextjs-plugin": "file:../../packages/pigment-css-nextjs-plugin",
"@types/node": "^20.5.7",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"eslint": "^8.56.0",
"typescript": "^5.3.3"
}
Expand Down
8 changes: 4 additions & 4 deletions apps/pigment-css-vite-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"@mui/icons-material": "file:../../packages/mui-icons-material/build",
"clsx": "^2.1.0",
"local-ui-lib": "workspace:^",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router": "^6.22.1",
"react-router-dom": "^6.22.1"
},
Expand All @@ -27,8 +27,8 @@
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@pigment-css/vite-plugin": "file:../../packages/pigment-css-vite-plugin",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.2.1",
"postcss": "^8.4.35",
"postcss-combine-media-query": "^1.0.1",
Expand Down
6 changes: 3 additions & 3 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"jss": "^10.10.0",
"playwright": "^1.42.1",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-is": "^18.3.1",
"react-jss": "^10.10.0",
"react-redux": "^8.1.3",
"redux": "^4.2.1",
Expand Down
8 changes: 8 additions & 0 deletions docs/data/about/teamMembers.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,5 +331,13 @@
"locationCountry": "nl",
"about": "♟️ Chess, 🛠️ Small DIY projects and learning about space 🌌",
"github": "arminmeh"
},
{
"name": "Alejandra Thomas",
"title": "Content Engineer",
"location": "New York, US",
"locationCountry": "us",
"about": "Books 📚, long coffee walks ☕️, and my cat 🐈‍⬛",
"github": "alelthomas"
}
]
2 changes: 1 addition & 1 deletion docs/data/joy/components/autocomplete/autocomplete.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ In the event you want the avoid autofill, you can try the following:
/>
```

Read [the guide on MDN](https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion) for more details.
Read [the guide on MDN](https://developer.mozilla.org/en-US/docs/Web/Security/Practical_implementation_guides/Turning_off_form_autocompletion) for more details.

### iOS VoiceOver

Expand Down
38 changes: 31 additions & 7 deletions docs/data/joy/customization/dark-mode/dark-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ When you change the `defaultMode` to another value, you must clear the local sto

{{"demo": "DarkModeByDefault.js"}}

For server-side applications, check out the framework setup in [the section below](#server-side-rendering) and provide the same value to the `getInitColorSchemeScript` function:
For server-side applications, check out the framework setup in [the section below](#server-side-rendering) and provide the same value to the `InitColorSchemeScript` component:

```js
getInitColorSchemeScript({ defaultMode: 'dark' });
<InitColorSchemeScript defaultMode="dark" />
```

## Matching device's preference
Expand All @@ -28,10 +28,10 @@ import { CssVarsProvider } from '@mui/joy/styles';
<CssVarsProvider defaultMode="system">...</CssVarsProvider>;
```

For server-side applications, check out the framework setup in [the section below](#server-side-rendering) and provide the same value to the `getInitColorSchemeScript` function:
For server-side applications, check out the framework setup in [the section below](#server-side-rendering) and provide the same value to the `InitColorSchemeScript` component:

```js
getInitColorSchemeScript({ defaultMode: 'system' });
<InitColorSchemeScript defaultMode="system" />
```

### Identify the system mode
Expand Down Expand Up @@ -121,23 +121,47 @@ If you try to render your UI based on the server, before mounting on the client,

### Avoiding screen flickering

To [prevent the UI from flickering](/joy-ui/main-features/dark-mode-optimization/#the-problem-flickering-on-first-load), apply `getInitColorSchemeScript()` before the main application script-it varies across frameworks:
To [prevent the UI from flickering](/joy-ui/main-features/dark-mode-optimization/#the-problem-flickering-on-first-load), add the `<InitColorSchemeScript />` component before the `<CssVarsProvider />` component:

### Next.js App Router

To use the Joy UI API with a Next.js project with the App Router, add the following code to the [`app/layout.js`](https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts#layouts) file in order to prevent flickering:

```jsx title="layout.js"
import InitColorSchemeScript from '@mui/joy/InitColorSchemeScript';
import { CssVarsProvider } from '@mui/joy/styles';
import CssBaseline from '@mui/joy/CssBaseline';

export default function RootLayout({ children }) {
return (
<html lang="en" suppressHydrationWarning={true}>
<body>
<InitColorSchemeScript />
<CssVarsProvider>
<CssBaseline />
{children}
</CssVarsProvider>
</body>
</html>
);
}
```

### Next.js Pages Router

To use the Joy UI API with a Next.js project, add the following code to the custom [`pages/_document.js`](https://nextjs.org/docs/pages/building-your-application/routing/custom-document) file:

```jsx
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { getInitColorSchemeScript } from '@mui/joy/styles';
import InitColorSchemeScript from '@mui/joy/InitColorSchemeScript';

export default class MyDocument extends Document {
render() {
return (
<Html data-color-scheme="light">
<Head>...</Head>
<body>
{getInitColorSchemeScript()}
<InitColorSchemeScript />
<Main />
<NextScript />
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ Solving this problem required us to take a novel approach to styling and theming

Thanks to Joy UI's built-in support for CSS variables, your app can render all of its color schemes at build time, so that the user's preference can be injected _before_ the DOM is rendered in the browser.

Joy UI provides the `getInitColorSchemeScript()` function to make this flash-free dark mode possible with React frameworks like Next.js or Remix.
Joy UI provides the `InitColorSchemeScript` component to make this flash-free dark mode possible with React frameworks like Next.js or Remix.
This function must be placed before the main script so it can apply the correct stylesheet before your components are rendered.

The code snippet below shows how this works with the Next.js Pages Router:

```jsx
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { getInitColorSchemeScript } from '@mui/joy/styles';
import InitColorSchemeScript from '@mui/joy/InitColorSchemeScript';

export default class MyDocument extends Document {
render() {
return (
<Html data-color-scheme="light">
<Head>...</Head>
<body>
{getInitColorSchemeScript()}
<InitColorSchemeScript />
<Main />
<NextScript />
</body>
Expand Down
25 changes: 14 additions & 11 deletions docs/data/material/components/autocomplete/CheckboxesTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ export default function CheckboxesTags() {
options={top100Films}
disableCloseOnSelect
getOptionLabel={(option) => option.title}
renderOption={(props, option, { selected }) => (
<li {...props}>
<Checkbox
icon={icon}
checkedIcon={checkedIcon}
style={{ marginRight: 8 }}
checked={selected}
/>
{option.title}
</li>
)}
renderOption={(props, option, { selected }) => {
const { key, ...optionProps } = props;
return (
<li key={key} {...optionProps}>
<Checkbox
icon={icon}
checkedIcon={checkedIcon}
style={{ marginRight: 8 }}
checked={selected}
/>
{option.title}
</li>
);
}}
style={{ width: 500 }}
renderInput={(params) => (
<TextField {...params} label="Checkboxes" placeholder="Favorites" />
Expand Down
25 changes: 14 additions & 11 deletions docs/data/material/components/autocomplete/CheckboxesTags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,20 @@ export default function CheckboxesTags() {
options={top100Films}
disableCloseOnSelect
getOptionLabel={(option) => option.title}
renderOption={(props, option, { selected }) => (
<li {...props}>
<Checkbox
icon={icon}
checkedIcon={checkedIcon}
style={{ marginRight: 8 }}
checked={selected}
/>
{option.title}
</li>
)}
renderOption={(props, option, { selected }) => {
const { key, ...optionProps } = props;
return (
<li key={key} {...optionProps}>
<Checkbox
icon={icon}
checkedIcon={checkedIcon}
style={{ marginRight: 8 }}
checked={selected}
/>
{option.title}
</li>
);
}}
style={{ width: 500 }}
renderInput={(params) => (
<TextField {...params} label="Checkboxes" placeholder="Favorites" />
Expand Down
32 changes: 20 additions & 12 deletions docs/data/material/components/autocomplete/CountrySelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,26 @@ export default function CountrySelect() {
options={countries}
autoHighlight
getOptionLabel={(option) => option.label}
renderOption={(props, option) => (
<Box component="li" sx={{ '& > img': { mr: 2, flexShrink: 0 } }} {...props}>
<img
loading="lazy"
width="20"
srcSet={`https://flagcdn.com/w40/${option.code.toLowerCase()}.png 2x`}
src={`https://flagcdn.com/w20/${option.code.toLowerCase()}.png`}
alt=""
/>
{option.label} ({option.code}) +{option.phone}
</Box>
)}
renderOption={(props, option) => {
const { key, ...optionProps } = props;
return (
<Box
key={key}
component="li"
sx={{ '& > img': { mr: 2, flexShrink: 0 } }}
{...optionProps}
>
<img
loading="lazy"
width="20"
srcSet={`https://flagcdn.com/w40/${option.code.toLowerCase()}.png 2x`}
src={`https://flagcdn.com/w20/${option.code.toLowerCase()}.png`}
alt=""
/>
{option.label} ({option.code}) +{option.phone}
</Box>
);
}}
renderInput={(params) => (
<TextField
{...params}
Expand Down
Loading

0 comments on commit f995599

Please sign in to comment.