Skip to content

Commit

Permalink
Merge branch 'master' into parial-anchor-origin
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeshanTamboli committed Oct 3, 2024
2 parents 92463be + 8f3e6e9 commit d4b7b5d
Show file tree
Hide file tree
Showing 104 changed files with 1,474 additions and 1,078 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 2.1
orbs:
aws-cli: circleci/aws-cli@4.2.3
aws-cli: circleci/aws-cli@5.1.0
aws-s3: circleci/aws-s3@4.0

parameters:
Expand Down
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
/packages/mui-icons-material/material-icons/
/packages/mui-icons-material/src/*.js
/packages/mui-icons-material/templateSvgIcon.js
/packages/mui-utils/macros/__fixtures__/
# Ignore fixtures
/packages-internal/scripts/typescript-to-proptypes/test/*/*
/test/bundling/fixtures/**/*.fixture.js
Expand Down
14 changes: 12 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// @ts-check

/**
* @typedef {import('eslint').Linter.Config} Config
*/

const path = require('path');

const OneLevelImportMessage = [
Expand Down Expand Up @@ -39,7 +45,7 @@ const NO_RESTRICTED_IMPORTS_PATTERNS_DEEPLY_NESTED = [
},
];

module.exports = {
module.exports = /** @type {Config} */ ({
root: true, // So parent files don't get applied
env: {
es6: true,
Expand Down Expand Up @@ -228,6 +234,10 @@ module.exports = {
"The 'use client' pragma can't be used with export * in the same module. This is not supported by Next.js.",
selector: 'ExpressionStatement[expression.value="use client"] ~ ExportAllDeclaration',
},
{
message: 'Do not call `Error(...)` without `new`. Use `new Error(...)` instead.',
selector: "CallExpression[callee.name='Error']",
},
],

// We re-export default in many places, remove when https://github.com/airbnb/javascript/issues/2500 gets resolved
Expand Down Expand Up @@ -526,4 +536,4 @@ module.exports = {
},
},
],
};
});
2 changes: 1 addition & 1 deletion .github/workflows/cherry-pick-next-to-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
if: ${{ contains(github.event.pull_request.labels.*.name, 'needs cherry-pick') && github.event.pull_request.merged == true }}
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0
- name: Cherry pick and create the new PR
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest]
steps:
- run: echo "${{ github.actor }}"
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
# fetch all tags which are required for `pnpm release:changelog`
fetch-depth: 0
- name: Set up pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Use Node.js 20.x
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 20
cache: 'pnpm' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7
uses: github/codeql-action/init@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
with:
languages: typescript
config-file: ./.github/codeql/codeql-config.yml
Expand All @@ -30,4 +30,4 @@ jobs:
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7
uses: github/codeql-action/analyze@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
4 changes: 2 additions & 2 deletions .github/workflows/publish-canaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
fetch-depth: 0
- name: Set up pnpm
uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0
- name: Use Node.js 20.x
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version: 20
cache: 'pnpm' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
persist-credentials: false

Expand All @@ -43,6 +43,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
uses: github/codeql-action/upload-sarif@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7
uses: github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
with:
sarif_file: results.sarif
3 changes: 1 addition & 2 deletions .github/workflows/support-stackoverflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
issue-comment: |
👋 Thanks for using this project!
We use GitHub issues exclusively as a bug and feature requests tracker, however,
this issue appears to be a support request.
We use GitHub issues exclusively as a bug and feature requests tracker, however, this issue appears to be a support request.
For support with Material UI please check out https://mui.com/material-ui/getting-started/support/. Thanks!
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vale-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- uses: errata-ai/vale-action@38bf078c328061f59879b347ca344a718a736018 # v2.1.0
continue-on-error: true # GitHub Action flag needed until https://github.com/errata-ai/vale-action/issues/89 is fixed
with:
Expand Down
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,64 @@
# [Versions](https://mui.com/versions/)

## v6.1.2

<!-- generated comparing v6.1.1..master -->

_Oct 2, 2024_

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

### `@mui/material@6.1.2`

- [Autocomplete] Fix listbox opens and closes on click when used with `limitTags` (#42494) @appleSimple
- [Button] Ignore `dark` and `contrastText` if not provided in the theme (#43861) @siriwatknp
- [Button] Fix regression for color `inherit` (#43862) @siriwatknp
- [LinearProgress] Fix background color (#43949) @sai6855
- Support CSS variables with shadow DOM (#43948) @siriwatknp
- [Rating] Use Rating `name` as prefix of input element ids (#43829) @yash49
- [Drawer] Fix issue with main window being used instead of iframe's window (#43818) @albarv340
- [ThemeProvider] Support setting default mode (#43951) @siriwatknp

### Docs

- Update theme toggle demo (#43956) @Janpot
- Add note about minimum required webpack version (#43864) @Janpot
- Format Pigment CSS docs (#43812) @oliviertassinari
- Fix visual bug on dashboard template (#43836) @oliviertassinari
- Fix pigment-css.md syntax error (#43837) @kdichev
- Fix Sign-in template form experience (#43838) @oliviertassinari
- Remove "To be continued" section from v0 –> v1 migration guide (#43832) @samuelsycamore
- Fix 301 to chromium (#43809) @oliviertassinari
- [joy-ui] Add missing ComponentLinkHeader components (#43865) @samuelsycamore
- [Modal] Remove unnecessary type assertion (#43825) @ZeeshanTamboli
- [Table] Stabilize random series in virtualized table demo (#43744) @Janpot
- [system] Add migration guide link to `@mui/styles` pages (#43833) @samuelsycamore

### Core

- [code-infra] Fix flaky dashboard screenshot - take 2 (#43937) @Janpot
- [code-infra] Replace all instances of `e` with `event` and add eslint rule (#43866) @samuelsycamore
- [code-infra] Fix and update bundling fixtures (#43709) @Janpot
- [code-infra] Update transitive dependencies with vulnerabilties (#43895) @Janpot
- [code-infra] Optimize regression tests (#43889) @Janpot
- [code-infra] Remove custom playwright installation steps (#43881) @Janpot
- [code-infra] Fix flaky dashboard screenshot (#43890) @Janpot
- [code-infra] Add new instanceof proptypes for toolpad (#43814) @Janpot
- Fix eslint-plugin-react-compiler issues in usePagination tests (#43946) @wilhelmlofsten
- Uniformity in version range @oliviertassinari
- Replace `toBeAriaHidden` matcher with `toBeInaccessible` in tests (#43870) @ZeeshanTamboli
- [docs-infra] Strengthen CSP (#43711) @oliviertassinari
- [docs-infra] Open Codesandbox demo with fontsize=12 (#43860) @siriwatknp
- [icons] Reduce Material Icon page size (#43911) @oliviertassinari
- [test] Point Istanbul to correct URL (#43935) @sai6855
- [test] Sync React.version parse logic with codebase (#43820) @oliviertassinari
- Improve getReactElementRef() utils (#43022) @sai6855
- [Drawer] Refactor getScrollbarSize usages (#43828) @BrianWoolfolk
- [Modal] Replace `show` parameter name with `hide` in modal manager (#43868) @ZeeshanTamboli
- [Modal] Remove unnecessary `manager` prop handling (#43867) @ZeeshanTamboli

All contributors of this release in alphabetical order: @albarv340, @appleSimple, @BrianWoolfolk, @DanailH, @Janpot, @kdichev, @oliviertassinari, @sai6855, @samuelsycamore, @siriwatknp, @wilhelmlofsten, @yash49, @ZeeshanTamboli

## v6.1.1

<!-- generated comparing v6.1.0..master -->
Expand Down
6 changes: 3 additions & 3 deletions apps/pigment-css-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"react-dom": "^18.3.1"
},
"devDependencies": {
"@pigment-css/nextjs-plugin": "0.0.23",
"@types/node": "^20.16.5",
"@types/react": "^18.3.4",
"@pigment-css/nextjs-plugin": "0.0.24",
"@types/node": "^20.16.10",
"@types/react": "^18.3.6",
"@types/react-dom": "^18.3.0",
"eslint": "^8.57.1",
"typescript": "^5.6.2"
Expand Down
4 changes: 2 additions & 2 deletions apps/pigment-css-vite-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"devDependencies": {
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@pigment-css/vite-plugin": "0.0.23",
"@types/react": "^18.3.4",
"@pigment-css/vite-plugin": "0.0.24",
"@types/react": "^18.3.6",
"@types/react-dom": "^18.3.0",
"@types/webfontloader": "^1.6.38",
"@vitejs/plugin-react": "^4.3.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import CircularUnderLoad from '../../../../../docs/data/material/components/prog
import CircularWithValueLabel from '../../../../../docs/data/material/components/progress/CircularWithValueLabel.tsx';
import CustomizedProgressBars from '../../../../../docs/data/material/components/progress/CustomizedProgressBars.tsx';
import DelayingAppearance from '../../../../../docs/data/material/components/progress/DelayingAppearance.tsx';
import LinearBuffer from '../../../../../docs/data/material/components/progress/LinearBuffer.tsx';
import LinearColor from '../../../../../docs/data/material/components/progress/LinearColor.tsx';
import LinearDeterminate from '../../../../../docs/data/material/components/progress/LinearDeterminate.tsx';
import LinearIndeterminate from '../../../../../docs/data/material/components/progress/LinearIndeterminate.tsx';
Expand Down Expand Up @@ -66,12 +65,6 @@ export default function Progress() {
<DelayingAppearance />
</div>
</section>
<section>
<h2> Linear Buffer</h2>
<div className="demo-container">
<LinearBuffer />
</div>
</section>
<section>
<h2> Linear Color</h2>
<div className="demo-container">
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/grid2/grid2.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The grid system is implemented with the `Grid` component:
- Item widths are set in percentages, so they're always fluid and sized relative to their parent element.
- There are five default grid breakpoints: xs, sm, md, lg, and xl. If you need custom breakpoints, check out [custom breakpoints grid](#custom-breakpoints).
- You can give integer values for each breakpoint, to indicate how many of the 12 available columns are occupied by the component when the viewport width satisfies the [breakpoint constraints](/material-ui/customization/breakpoints/#default-breakpoints).
- It uses negative margins and padding to create gaps between children, which behave similarly to [the `gap` CSS property](https://developer.mozilla.org/en-US/docs/Web/CSS/gap).
- It uses [the `gap` CSS property](https://developer.mozilla.org/en-US/docs/Web/CSS/gap) to add spacing between items.
- It does _not_ support row spanning. Children elements cannot span multiple rows. We recommend using [CSS Grid](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout) if you need this functionality.
- It does _not_ automatically place children. It will try to fit the children one by one, and if there is not enough space, the rest of the children will start on the next line, and so on. If you need auto-placement, we recommend using [CSS Grid](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_grid_layout/Auto-placement_in_grid_layout) instead.

Expand Down
26 changes: 19 additions & 7 deletions docs/data/material/customization/dark-mode/ToggleColorMode.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Select from '@mui/material/Select';
import MenuItem from '@mui/material/MenuItem';
import RadioGroup from '@mui/material/RadioGroup';
import Radio from '@mui/material/Radio';
import FormControl from '@mui/material/FormControl';
import FormControlLabel from '@mui/material/FormControlLabel';
import FormLabel from '@mui/material/FormLabel';
import { ThemeProvider, createTheme, useColorScheme } from '@mui/material/styles';

function MyApp() {
Expand All @@ -23,11 +26,20 @@ function MyApp() {
minHeight: '56px',
}}
>
<Select value={mode} onChange={(event) => setMode(event.target.value)}>
<MenuItem value="system">System</MenuItem>
<MenuItem value="light">Light</MenuItem>
<MenuItem value="dark">Dark</MenuItem>
</Select>
<FormControl>
<FormLabel id="demo-theme-toggle">Theme</FormLabel>
<RadioGroup
aria-labelledby="demo-theme-toggle"
name="theme-toggle"
row
value={mode}
onChange={(event) => setMode(event.target.value)}
>
<FormControlLabel value="system" control={<Radio />} label="System" />
<FormControlLabel value="light" control={<Radio />} label="Light" />
<FormControlLabel value="dark" control={<Radio />} label="Dark" />
</RadioGroup>
</FormControl>
</Box>
);
}
Expand Down
33 changes: 21 additions & 12 deletions docs/data/material/customization/dark-mode/ToggleColorMode.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import * as React from 'react';
import Box from '@mui/material/Box';
import Select from '@mui/material/Select';
import MenuItem from '@mui/material/MenuItem';
import RadioGroup from '@mui/material/RadioGroup';
import Radio from '@mui/material/Radio';
import FormControl from '@mui/material/FormControl';
import FormControlLabel from '@mui/material/FormControlLabel';
import FormLabel from '@mui/material/FormLabel';
import { ThemeProvider, createTheme, useColorScheme } from '@mui/material/styles';

function MyApp() {
Expand All @@ -23,16 +26,22 @@ function MyApp() {
minHeight: '56px',
}}
>
<Select
value={mode}
onChange={(event) =>
setMode(event.target.value as 'system' | 'light' | 'dark')
}
>
<MenuItem value="system">System</MenuItem>
<MenuItem value="light">Light</MenuItem>
<MenuItem value="dark">Dark</MenuItem>
</Select>
<FormControl>
<FormLabel id="demo-theme-toggle">Theme</FormLabel>
<RadioGroup
aria-labelledby="demo-theme-toggle"
name="theme-toggle"
row
value={mode}
onChange={(event) =>
setMode(event.target.value as 'system' | 'light' | 'dark')
}
>
<FormControlLabel value="system" control={<Radio />} label="System" />
<FormControlLabel value="light" control={<Radio />} label="Light" />
<FormControlLabel value="dark" control={<Radio />} label="Dark" />
</RadioGroup>
</FormControl>
</Box>
);
}
Expand Down
14 changes: 14 additions & 0 deletions docs/data/material/customization/dark-mode/dark-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,20 @@ To instantly switch between color schemes with no transition, apply the `disable
</ThemeProvider>
```

## Setting the default mode

When `colorSchemes` is provided, the default mode is `system`, which means the app uses the system preference when users first visit the site.

To set a different default mode, pass the `defaultMode` prop to the ThemeProvider component:

```js
<ThemeProvider theme={theme} defaultMode="dark">
```

:::info
The `defaultMode` value can be `'light'`, `'dark'`, or `'system'`.
:::

## Styling in dark mode

Use the `theme.applyStyles` utility to apply styles for a specific mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ Have a look at the older [versions](https://mui.com/versions/) for backward comp

Material UI requires a minimum version of TypeScript 4.7.
This aims to match the policy of [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped), with the support of the versions of TypeScript that are less than two years old.

## Webpack

The minimium required version of webpack to bundle applications that use Material UI is v5. Webpack <= v4 can't bundle Material UI untranspiled as it uses features such as the [null coalscing operator (`??`)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing) and [optional chaining (`?.`)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining).
3 changes: 2 additions & 1 deletion docs/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export default withDocsInfra({
// We only care about Node runtime at this point.
(options.nextRuntime === undefined || options.nextRuntime === 'nodejs')
) {
const [nextExternals, ...externals] = config.externals;
const externals = config.externals.slice(0, -1);
const nextExternals = config.externals.at(-1);

config.externals = [
// @ts-ignore
Expand Down
Loading

0 comments on commit d4b7b5d

Please sign in to comment.