Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/mui/material-ui into upda…
Browse files Browse the repository at this point in the history
…te-contributing-file
  • Loading branch information
danilo-leal committed Apr 12, 2022
2 parents a25ae3a + 47460ce commit 528643a
Show file tree
Hide file tree
Showing 1,437 changed files with 9,502 additions and 18,033 deletions.
109 changes: 77 additions & 32 deletions CHANGELOG.md

Large diffs are not rendered by default.

126 changes: 63 additions & 63 deletions CHANGELOG.old.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Please read [the full text](/CODE_OF_CONDUCT.md) so that you can understand what

## A large spectrum of contributions

There are [many ways](https://mui.com/getting-started/faq/#mui-is-awesome-how-can-i-support-the-project) to contribute to MUI, code contribution is one aspect of it. For instance, documentation improvements are as important as code changes.
There are [many ways](https://mui.com/material-ui/getting-started/faq/#mui-is-awesome-how-can-i-support-the-project) to contribute to MUI, code contribution is one aspect of it. For instance, documentation improvements are as important as code changes.

## Your first Pull Request

Expand Down Expand Up @@ -293,7 +293,7 @@ these changes across the localized versions.

## Roadmap

To get a sense of where MUI is heading, or for ideas on where you could contribute, take a look at the [roadmap](https://mui.com/discover-more/roadmap/).
To get a sense of where MUI is heading, or for ideas on where you could contribute, take a look at the [roadmap](https://mui.com/material-ui/discover-more/roadmap/).

## License

Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ yarn add @mui/material @emotion/react @emotion/styled
<details>
<summary>Older versions</summary>

- **[v4.x](https://v4.mui.com/)** ([Migration from v4 to v5](https://mui.com/guides/migration-v4/))
- **[v3.x](https://v3.mui.com/)** ([Migration from v3 to v4](https://mui.com/guides/migration-v3/))
- **[v0.x](https://v0.mui.com/)** ([Migration to v1](https://mui.com/guides/migration-v0x/))
- **[v4.x](https://v4.mui.com/)** ([Migration from v4 to v5](https://mui.com/material-ui/guides/migration-v4/))
- **[v3.x](https://v3.mui.com/)** ([Migration from v3 to v4](https://mui.com/material-ui/guides/migration-v3/))
- **[v0.x](https://v0.mui.com/)** ([Migration to v1](https://mui.com/material-ui/guides/migration-v0x/))

</details>

Expand All @@ -69,7 +69,6 @@ via [OpenCollective](https://opencollective.com/mui) or via [Patreon](https://ww
<a href="https://bit.dev/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank" style="margin-rig ht: 16px;"><img height="96" width="96" src="https://github.com/teambit.png?size=192" alt="bit.dev" title="The fastest way to share code" loading="lazy" /></a>
<a href="https://www.text-em-all.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img src="https://images.opencollective.com/callemall/09710fe/logo/192.png" alt="text-em-all.com" title="Mass Text Messaging & Automated Calling" height="96" width="96" loading="lazy"></a>
<a href="https://www.laststance.io/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/laststance/daffd6c/avatar/192.png" alt="laststance.io" title="Indipendent organization for OSS activity based on Tokyo" loading="lazy" /></a>
<a href="https://www.movavi.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/movavi-software/a1d0167/logo/192.png" alt="movavi.com" title="Screen recorder for Mac" loading="lazy" /></a>
<a href="https://online-aussie-casino.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/aussiecasinohex/923df37/logo/192.png" alt="online-aussie-casino.com" title="Aussie Gambling Guide" loading="lazy" /></a>
<a href="https://sumatosoft.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://images.opencollective.com/sumatosoft_company/0b78570/avatar/192.png" alt="sumatosoft.com" title="We help companies to digitalize their businesses" loading="lazy" /></a>
<a href="https://megafamous.com/?utm_source=MUI&utm_medium=referral&utm_content=readme" rel="noopener sponsored" target="_blank"><img height="96" width="96" src="https://p18.zdusercontent.com/attachment/9422375/Rullx0rw9lUGKuyKOy4VQ9Zxq?size=192" alt="megafamous.com" title="The best place to buy Instagram followers & likes." loading="lazy" /></a>
Expand All @@ -79,7 +78,7 @@ Gold Sponsors are those who have pledged \$500/month or more to MUI.

### There is more

See the full list of [our backers](https://mui.com/discover-more/backers/).
See the full list of [our backers](https://mui.com/material-ui/discover-more/backers/).

## Usage

Expand Down Expand Up @@ -114,7 +113,7 @@ There is a StackOverflow tag called "material-ui" that you can use to tag your q
## Examples

Are you looking for an example project to get started?
[We host some](https://mui.com/getting-started/example-projects/).
[We host some](https://mui.com/material-ui/getting-started/example-projects/).

## Documentation

Expand All @@ -129,15 +128,15 @@ You can find complete templates & themes in the [MUI Store](https://mui.com/stor
Read the [contributing guide](/CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to MUI.

Notice that contributions go far beyond pull requests and commits.
Although we love giving you the opportunity to put your stamp on MUI, we also are thrilled to receive a variety of [other contributions](https://mui.com/getting-started/faq/#mui-is-awesome-how-can-i-support-the-project).
Although we love giving you the opportunity to put your stamp on MUI, we also are thrilled to receive a variety of [other contributions](https://mui.com/material-ui/getting-started/faq/#mui-is-awesome-how-can-i-support-the-project).

## Changelog

If you have recently updated, please read the [changelog](https://github.com/mui/material-ui/releases) for details of what has changed.

## Roadmap

The future plans and high priority features and enhancements can be found in the [roadmap](https://mui.com/discover-more/roadmap/) file.
The future plans and high priority features and enhancements can be found in the [roadmap](https://mui.com/material-ui/discover-more/roadmap/) file.

## License

Expand Down
12 changes: 6 additions & 6 deletions benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"server:system": "cd ../ && cross-env NODE_ENV=production BABEL_ENV=benchmark babel-node benchmark/server/scenarios/system.js --inspect=0.0.0.0:9229 --extensions \".tsx,.ts,.js\""
},
"dependencies": {
"@chakra-ui/system": "^1.12.0",
"@emotion/react": "^11.8.2",
"@chakra-ui/system": "^1.12.1",
"@emotion/react": "^11.9.0",
"@emotion/styled": "^11.8.1",
"@mdx-js/react": "^2.1.1",
"@mui/material": "^5.6.0",
"@mui/styles": "^5.6.0",
"@mui/system": "^5.6.0",
"@mui/material": "^5.6.1",
"@mui/styles": "^5.6.1",
"@mui/system": "^5.6.1",
"@styled-system/css": "^5.1.5",
"benchmark": "^2.1.4",
"playwright": "^1.17.1",
Expand All @@ -30,7 +30,7 @@
"serve-handler": "^6.1.3",
"styled-components": "^5.3.5",
"theme-ui": "^0.14.2",
"webpack": "^5.71.0",
"webpack": "^5.72.0",
"webpack-cli": "^4.9.2"
}
}
45 changes: 45 additions & 0 deletions docs/data/base/components/badge/badge-pt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
product: base
title: Unstyled React badge
components: BadgeUnstyled
githubLabel: 'component: badge'
packageName: '@mui/base'
---

# Unstyled badge

<p class="description">Badge generates a small badge to the top-right of its child(ren).</p>

```js
import BadgeUnstyled from '@mui/base/BadgeUnstyled';
```

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## Basic usage

{{"demo": "UnstyledBadge.js", "defaultCodeOpen": false}}

## Badge visibility

The visibility of badges can be controlled using the `invisible` prop. If a badge is invisible, it has the `MuiBadge-invisible` class. It is up to the developer to provide styles that actually hide the badge.

{{"demo": "BadgeVisibility.js"}}

The badge hides automatically when `badgeContent` is zero. You can override this with the `showZero` prop.

{{"demo": "ShowZeroBadge.js"}}

## Maximum value

You can use the `max` prop to cap the value of the badge content. It is set to 99 by default.

Note that `badgeContent` should be a number (or convertible to a number) for this to work.

{{"demo": "BadgeMax.js"}}

## Accessibility

You can't rely on the content of the badge to be announced correctly. You should provide a full description, for instance, with `aria-label`:

{{"demo": "AccessibleBadges.js", "defaultCodeOpen": false}}
45 changes: 45 additions & 0 deletions docs/data/base/components/badge/badge-zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
product: base
title: 无样式的 React 徽章
components: BadgeUnstyled
githubLabel: 'component: badge'
packageName: '@mui/base'
---

# 无样式的徽章

<p class="description">徽章组件会在其子项(们)的右上角生成一个小徽章。</p>

```js
import BadgeUnstyled from '@mui/base/BadgeUnstyled';
```

{{"component": "modules/components/ComponentLinkHeader.js", "design": false}}

## 基本用法

{{"demo": "UnstyledBadge.js", "defaultCodeOpen": false}}

## 徽章的可见性

徽章组件的隐显可以通过 `invisible` 属性来设置。 如果徽章不可见,那么它会被应用 `MuiBadge-invisible` 类。 It is up to the developer to provide styles that actually hide the badge.

{{"demo": "BadgeVisibility.js"}}

The badge hides automatically when `badgeContent` is zero. You can override this with the `showZero` prop.

{{"demo": "ShowZeroBadge.js"}}

## 最大值

您可以使用 `max` 属性来限制徽章内容的最大值。 默认被设置为 99。

请注意, `badgeContent` 应该是一个数字(或是一个可被转换为数字的值)才能工作。

{{"demo": "BadgeMax.js"}}

## 无障碍设计

如果徽章的内容无法被正确的读取。 那您应该提供一个完整的描述,例如, 使用 `aria-label`

{{"demo": "AccessibleBadges.js", "defaultCodeOpen": false}}
29 changes: 16 additions & 13 deletions docs/data/base/components/badge/badge.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
product: base
title: Unstyled React badge
title: Unstyled React Badge component
components: BadgeUnstyled
githubLabel: 'component: badge'
packageName: '@mui/base'
---

# Unstyled badge

<p class="description">Badge generates a small badge to the top-right of its child(ren).</p>
<p class="description">The `BadgeUnstyled` component generates a small label that is attached to its children elements.</p>

```js
import BadgeUnstyled from '@mui/base/BadgeUnstyled';
Expand All @@ -22,28 +22,31 @@ import BadgeUnstyled from '@mui/base/BadgeUnstyled';

## Badge visibility

The visibility of badges can be controlled using the `invisible` prop.
If a badge is invisible, it has the `MuiBadge-invisible` class.
It is up to the developer to provide styles that actually hide the badge.
You can control the visibility of a `BadgeUnstyled` by using the `invisible` prop.
Setting a badge to `invisible` does not actually hide it—instead, this prop adds the `MuiBadge-invisible` class to the badge, which you can target with styles to hide however you prefer:

{{"demo": "BadgeVisibility.js"}}

The badge hides automatically when `badgeContent` is zero. You can override this with the `showZero` prop.
## Numerical badges

{{"demo": "ShowZeroBadge.js"}}
The following props are useful when `badgeContent` is a number.

### The showZero prop

## Maximum value
By default, badges automatically hide when `badgeContent={0}`. You can override this behavior with the `showZero` prop:

{{"demo": "ShowZeroBadge.js"}}

You can use the `max` prop to cap the value of the badge content.
It is set to 99 by default.
### The max prop

Note that `badgeContent` should be a number (or convertible to a number) for this to work.
You can use the `max` prop to set a maximum value for `badgeContent`.
The default is 99.

{{"demo": "BadgeMax.js"}}

## Accessibility

You can't rely on the content of the badge to be announced correctly.
You should provide a full description, for instance, with `aria-label`:
Screen readers may not provide users with enough information about a badge's contents.
To make your `BadgeUnstyled` accessible, you must provide a full description with `aria-label`:

{{"demo": "AccessibleBadges.js", "defaultCodeOpen": false}}
52 changes: 52 additions & 0 deletions docs/data/base/components/button/UnstyledButtonsDisabledFocus.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import * as React from 'react';
import Stack from '@mui/material/Stack';
import ButtonUnstyled, { buttonUnstyledClasses } from '@mui/base/ButtonUnstyled';
import { styled } from '@mui/system';

const blue = {
500: '#007FFF',
600: '#0072E5',
700: '#0059B2',
};

const CustomButton = styled(ButtonUnstyled)`
font-family: IBM Plex Sans, sans-serif;
font-weight: bold;
font-size: 0.875rem;
background-color: ${blue[500]};
padding: 12px 24px;
border-radius: 8px;
color: white;
transition: all 150ms ease;
cursor: pointer;
border: none;
&:hover {
background-color: ${blue[600]};
}
&.${buttonUnstyledClasses.active} {
background-color: ${blue[700]};
}
&.${buttonUnstyledClasses.focusVisible} {
box-shadow: 0 4px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
outline: none;
}
&.${buttonUnstyledClasses.disabled} {
opacity: 0.5;
cursor: not-allowed;
}
`;

export default function UnstyledButtonsDisabledFocus() {
return (
<Stack spacing={2} direction="row">
<CustomButton disabled>focusableWhenDisabled = false</CustomButton>
<CustomButton disabled focusableWhenDisabled>
focusableWhenDisabled = true
</CustomButton>
</Stack>
);
}
52 changes: 52 additions & 0 deletions docs/data/base/components/button/UnstyledButtonsDisabledFocus.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import * as React from 'react';
import Stack from '@mui/material/Stack';
import ButtonUnstyled, { buttonUnstyledClasses } from '@mui/base/ButtonUnstyled';
import { styled } from '@mui/system';

const blue = {
500: '#007FFF',
600: '#0072E5',
700: '#0059B2',
};

const CustomButton = styled(ButtonUnstyled)`
font-family: IBM Plex Sans, sans-serif;
font-weight: bold;
font-size: 0.875rem;
background-color: ${blue[500]};
padding: 12px 24px;
border-radius: 8px;
color: white;
transition: all 150ms ease;
cursor: pointer;
border: none;
&:hover {
background-color: ${blue[600]};
}
&.${buttonUnstyledClasses.active} {
background-color: ${blue[700]};
}
&.${buttonUnstyledClasses.focusVisible} {
box-shadow: 0 4px 20px 0 rgba(61, 71, 82, 0.1), 0 0 0 5px rgba(0, 127, 255, 0.5);
outline: none;
}
&.${buttonUnstyledClasses.disabled} {
opacity: 0.5;
cursor: not-allowed;
}
`;

export default function UnstyledButtonsDisabledFocus() {
return (
<Stack spacing={2} direction="row">
<CustomButton disabled>focusableWhenDisabled = false</CustomButton>
<CustomButton disabled focusableWhenDisabled>
focusableWhenDisabled = true
</CustomButton>
</Stack>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<CustomButton disabled>focusableWhenDisabled = false</CustomButton>
<CustomButton disabled focusableWhenDisabled>
focusableWhenDisabled = true
</CustomButton>

0 comments on commit 528643a

Please sign in to comment.