Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into remove-input-classes
Browse files Browse the repository at this point in the history
  • Loading branch information
sai6855 committed Jan 10, 2025
2 parents cf3d292 + 11b3889 commit 54ab983
Show file tree
Hide file tree
Showing 60 changed files with 1,480 additions and 439 deletions.
2 changes: 1 addition & 1 deletion apps/pigment-css-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"devDependencies": {
"@pigment-css/nextjs-plugin": "0.0.29",
"@types/node": "^20.17.10",
"@types/node": "^20.17.12",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"eslint": "^8.57.1",
Expand Down
37 changes: 33 additions & 4 deletions apps/pigment-css-vite-app/src/pages/material-ui/react-progress.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import * as React from 'react';
import LinearProgress, { LinearProgressProps } from '@mui/material/LinearProgress';
import Typography from '@mui/material/Typography';
import Box from '@mui/material/Box';
import MaterialUILayout from '../../Layout';
import CircularColor from '../../../../../docs/data/material/components/progress/CircularColor.tsx';
import CircularDeterminate from '../../../../../docs/data/material/components/progress/CircularDeterminate.tsx';
Expand All @@ -9,9 +12,23 @@ import CircularWithValueLabel from '../../../../../docs/data/material/components
import CustomizedProgressBars from '../../../../../docs/data/material/components/progress/CustomizedProgressBars.tsx';
import DelayingAppearance from '../../../../../docs/data/material/components/progress/DelayingAppearance.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';
import LinearWithValueLabel from '../../../../../docs/data/material/components/progress/LinearWithValueLabel.tsx';

function LinearProgressWithLabel(props: LinearProgressProps & { value: number }) {
return (
<Box sx={{ display: 'flex', alignItems: 'center' }}>
<Box sx={{ width: '100%', mr: 1 }}>
<LinearProgress variant="determinate" {...props} />
</Box>
<Box sx={{ minWidth: 35 }}>
<Typography
variant="body2"
sx={{ color: 'text.secondary' }}
>{`${Math.round(props.value)}%`}</Typography>
</Box>
</Box>
);
}

export default function Progress() {
return (
Expand Down Expand Up @@ -65,6 +82,14 @@ export default function Progress() {
<DelayingAppearance />
</div>
</section>
<section>
<h2> Linear Buffer</h2>
<div className="demo-container">
<Box sx={{ width: '100%' }}>
<LinearProgress variant="buffer" value={10} valueBuffer={30} />
</Box>
</div>
</section>
<section>
<h2> Linear Color</h2>
<div className="demo-container">
Expand All @@ -74,7 +99,9 @@ export default function Progress() {
<section>
<h2> Linear Determinate</h2>
<div className="demo-container">
<LinearDeterminate />
<Box sx={{ width: '100%' }}>
<LinearProgress variant="determinate" value={10} />
</Box>
</div>
</section>
<section>
Expand All @@ -86,7 +113,9 @@ export default function Progress() {
<section>
<h2> Linear With Value Label</h2>
<div className="demo-container">
<LinearWithValueLabel />
<Box sx={{ width: '100%' }}>
<LinearProgressWithLabel value={10} />
</Box>
</div>
</section>
</MaterialUILayout>
Expand Down
22 changes: 14 additions & 8 deletions docs/data/material/components/menus/menus.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ A menu displays a list of choices on a temporary surface. It appears when the us

{{"component": "@mui/docs/ComponentLinkHeader"}}

## Introduction

Menus are implemented using a collection of related components:

- Menu: The container/surface of the menu.
- Menu Item: An option for users to select from the menu.
- Menu List (optional): Alternative composable container for Menu Items—see [Composition with Menu List](#composition-with-menu-list) for details.

## Basic menu

A basic menu opens over the anchor element by default (this option can be [changed](#menu-positioning) via props). When close to a screen edge, a basic menu vertically realigns to make sure that all menu items are completely visible.

Choosing an option should immediately ideally commit the option and close the menu.

**Disambiguation**: In contrast to simple menus, simple dialogs can present additional detail related to the options available for a list item or provide navigational or orthogonal actions related to the primary task. Although they can display the same content, simple menus are preferred over simple dialogs because simple menus are less disruptive to the user's current context.
You should configure the component so that selecting an option immediately confirms it and closes the menu, as shown in the demo below.

{{"demo": "BasicMenu.js"}}

Expand Down Expand Up @@ -54,13 +60,13 @@ For instance, you can display the menu on top of the anchor:

{{"demo": "PositionedMenu.js"}}

## MenuList composition
## Composition with Menu List

The `Menu` component uses the `Popover` component internally.
However, you might want to use a different positioning strategy, or not blocking the scroll.
For answering those needs, we expose a `MenuList` component that you can compose, with `Popper` in this example.
The Menu component uses the Popover component internally.
But you might want to use a different positioning strategy, or prefer not to block scrolling, for example.

The primary responsibility of the `MenuList` component is to handle the focus.
The Menu List component lets you compose your own menu for these kinds of use cases—its primary purpose is to handle focus.
See the demo below for an example of composition that uses Menu List and replaces the Menu's default Popover with a Popper component instead:

{{"demo": "MenuListComposition.js", "bg": true}}

Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/components/popper/popper.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Some important features of the Popper component:
- 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/#menulist-composition).
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).
- The `anchorEl` is passed as the reference object to create a new `Popper.js` instance.

{{"component": "@mui/docs/ComponentLinkHeader", "design": false}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Material UI Sync plugin
# Material UI Sync plugin 🧪

<p class="description">Sync is a Figma plugin that generates Material UI themes directly from design to code.</p>

:::warning
This plugin is experimental.
:::

## Introduction

[Material UI Sync](https://www.figma.com/community/plugin/1336346114713490235/material-ui-sync) is a Figma plugin that lets you generate a theme from the [Material UI for Figma Design Kit](https://www.figma.com/community/file/912837788133317724/material-ui-for-figma-and-mui-x).

:::warning
Sync works in combination with the [Material UI for Figma Design Kit v5.16.0](https://github.com/mui/mui-design-kits/releases) and later.
Other kits, such as the Joy UI Design Kit, are not supported yet.
:::

<img src="/static/material-ui/design-resources/sync.png" style="width: 814px;" alt="Customizing the Material UI Switch component in Figma with the Sync plugin running." width="1628" height="400" />

Sync works in combination with the [Material UI for Figma Design Kit v5.16.0](https://github.com/mui/mui-design-kits/releases) and later.

## Running the plugin

If you don't have the [complete and latest version](/store/items/figma-react/) of the Material UI for Figma Design Kit installed, you can test the plugin by using the [Community version](https://www.figma.com/community/file/912837788133317724/material-ui-for-figma-and-mui-x) instead.
Expand Down
3 changes: 1 addition & 2 deletions docs/data/material/getting-started/overview/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ It includes a comprehensive collection of prebuilt components that are ready for

:::info
Material UI v6 supports Material Design 2.
Adoption of Material Design 3 is tentatively planned for a future Material UI version.
You can follow [this GitHub issue](https://github.com/mui/material-ui/issues/29345) for future updates.
You can follow [this GitHub issue](https://github.com/mui/material-ui/issues/29345) for future design-related updates.
:::

## Advantages of Material UI
Expand Down
4 changes: 4 additions & 0 deletions docs/data/material/guides/composition/composition.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ If you added another `className` via the `slotProps` prop on the Custom Tooltip
The popper slot in the original example would now have both classes applied to it, in addition to any others that may be present: `"[…] custom-tooltip-popper foo"`.
:::
:::info
`style` object are shallow merged rather than replacing one another. The style keys from the first argument have higher priority.
:::
## Component prop
Material UI allows you to change the root element that will be rendered via a prop called `component`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,36 @@ Here's how to migrate:
},
```

## CardHeader

Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#card-header-props) below to migrate the code as described in the following sections:

```bash
npx @mui/codemod@latest deprecations/card-header-props <path>
```

### titleTypographyProps

The CardHeader's `titleTypographyProps` props were deprecated in favor of `slotProps.title`:

```diff
<CardHeader
- titleTypographyProps={titleTypographyProps}
+ slotProps={{ title: titleTypographyProps }}
/>
```

### subheaderTypographyProps

The CardHeader's `subheaderTypographyProps` props were deprecated in favor of `slotProps.subheader`:

```diff
<CardHeader
- subheaderTypographyProps={subheaderTypographyProps}
+ slotProps={{ subheader: subheaderTypographyProps }}
/>
```

## Chip

Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#chip-classes) below to migrate the code as described in the following sections:
Expand Down Expand Up @@ -1375,6 +1405,70 @@ Here's how to migrate:
},
```

## LinearProgress

Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#linear-progress-classes) below to migrate the code as described in the following sections:

```bash
npx @mui/codemod@latest deprecations/linear-progress-classes <path>
```

### Composed CSS classes

The CSS classes that composed the `variant` and `color` prop values were deprecated.

Here's how to migrate:

```diff
-.MuiLinearProgress-bar1Buffer
+.MuiLinearProgress-buffer > .MuiLinearProgress-bar1
-.MuiLinearProgress-bar1Determinate
+.MuiLinearProgress-determinate > .MuiLinearProgress-bar1
-.MuiLinearProgress-bar1Indeterminate
+.MuiLinearProgress-indeterminate > .MuiLinearProgress-bar1
-.MuiLinearProgress-bar2Buffer
+.MuiLinearProgress-buffer > .MuiLinearProgress-bar2
-.MuiLinearProgress-bar2Indeterminate
+.MuiLinearProgress-indeterminate > .MuiLinearProgress-bar2
-.MuiLinearProgress-barColorPrimary
+.MuiLinearProgress-colorPrimary > .MuiLinearProgress-bar
-.MuiLinearProgress-barColorSecondary
+.MuiLinearProgress-colorSecondary > .MuiLinearProgress-bar
-.MuiLinearProgress-dashedColorPrimary
+.MuiLinearProgress-colorPrimary > .MuiLinearProgress-dashed
-.MuiLinearProgress-dashedColorSecondary
+.MuiLinearProgress-colorSecondary > .MuiLinearProgress-dashed
```

```diff
import { linearProgressClasses } from '@mui/material/LinearProgress';

MuiLinearProgress: {
styleOverrides: {
root: {
- [`&.${linearProgressClasses.bar1Buffer}`]: {},
+ [`&.${linearProgressClasses.buffer} > .${linearProgressClasses.bar1}`]: {},
- [`&.${linearProgressClasses.bar1Determinate}`]: {},
+ [`&.${linearProgressClasses.determinate} > .${linearProgressClasses.bar1}`]: {},
- [`&.${linearProgressClasses.bar1Indeterminate}`]: {},
+ [`&.${linearProgressClasses.indeterminate} > .${linearProgressClasses.bar1}`]: {},
- [`&.${linearProgressClasses.bar2Buffer}`]: {},
+ [`&.${linearProgressClasses.buffer} > .${linearProgressClasses.bar2}`]: {},
- [`&.${linearProgressClasses.bar2Indeterminate}`]: {},
+ [`&.${linearProgressClasses.indeterminate} > .${linearProgressClasses.bar2}`]: {},
- [`&.${linearProgressClasses.barColorPrimary}`]: {},
+ [`&.${linearProgressClasses.colorPrimary} > .${linearProgressClasses.bar}`]: {},
- [`&.${linearProgressClasses.barColorSecondary}`]: {},
+ [`&.${linearProgressClasses.colorSecondary} > .${linearProgressClasses.bar}`]: {},
- [`&.${linearProgressClasses.dashedColorPrimary}`]: {},
+ [`&.${linearProgressClasses.colorPrimary} > .${linearProgressClasses.dashed}`]: {},
- [`&.${linearProgressClasses.dashedColorSecondary}`]: {},
+ [`&.${linearProgressClasses.colorSecondary} > .${linearProgressClasses.dashed}`]: {},
},
},
}
```

## Modal

Use the [codemod](https://github.com/mui/material-ui/tree/HEAD/packages/mui-codemod#modal-props) below to migrate the code as described in the following sections:
Expand Down
2 changes: 1 addition & 1 deletion docs/data/material/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ const pages: MuiPage[] = [
{
pathname: '/material-ui/design-resources/material-ui-sync',
title: 'Figma Sync plugin',
beta: true,
unstable: true,
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
"@types/css-mediaquery": "^0.1.4",
"@types/gtag.js": "^0.0.20",
"@types/json2mq": "^0.2.2",
"@types/node": "^20.17.10",
"@types/node": "^20.17.12",
"@types/prop-types": "^15.7.14",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
Expand Down
Loading

0 comments on commit 54ab983

Please sign in to comment.