Skip to content

Commit cac3452

Browse files
committed
Merge branch 'next' into base-ui/perseive-history
2 parents 81c4ded + 28a8d15 commit cac3452

File tree

11 files changed

+152
-36
lines changed

11 files changed

+152
-36
lines changed

.circleci/config.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,48 +888,106 @@ workflows:
888888
jobs:
889889
- test_profile:
890890
<<: *default-context
891+
892+
# This workflow can be triggered manually on the PR
891893
react-17:
894+
when:
895+
equal: [react-17, << pipeline.parameters.workflow >>]
896+
jobs:
897+
- test_unit:
898+
<<: *default-context
899+
react-version: ^17.0.0
900+
name: test_unit-react@17
901+
- test_browser:
902+
<<: *default-context
903+
react-version: ^17.0.0
904+
name: test_browser-react@17
905+
- test_regressions:
906+
<<: *default-context
907+
react-version: ^17.0.0
908+
name: test_regressions-react@17
909+
- test_e2e:
910+
<<: *default-context
911+
react-version: ^17.0.0
912+
name: test_e2e-react@17
913+
914+
# This workflow is identical to react-17, but scheduled
915+
react-17-cron:
892916
triggers:
893917
- schedule:
894918
cron: '0 0 * * *'
895919
filters:
896920
branches:
897921
only:
898922
- master
923+
- next
899924
jobs:
900925
- test_unit:
901926
<<: *default-context
902927
react-version: ^17.0.0
928+
name: test_unit-react@17
903929
- test_browser:
904930
<<: *default-context
905931
react-version: ^17.0.0
932+
name: test_browser-react@17
906933
- test_regressions:
907934
<<: *default-context
908935
react-version: ^17.0.0
936+
name: test_regressions-react@17
909937
- test_e2e:
910938
<<: *default-context
911939
react-version: ^17.0.0
940+
name: test_e2e-react@17
941+
942+
# This workflow can be triggered manually on the PR
912943
react-next:
944+
when:
945+
equal: [react-next, << pipeline.parameters.workflow >>]
946+
jobs:
947+
- test_unit:
948+
<<: *default-context
949+
react-version: next
950+
name: test_unit-react@next
951+
- test_browser:
952+
<<: *default-context
953+
react-version: next
954+
name: test_browser-react@next
955+
- test_regressions:
956+
<<: *default-context
957+
react-version: next
958+
name: test_regressions-react@next
959+
- test_e2e:
960+
<<: *default-context
961+
react-version: next
962+
name: test_e2e-react@next
963+
# This workflow is identical to react-next, but scheduled
964+
react-next-cron:
913965
triggers:
914966
- schedule:
915967
cron: '0 0 * * *'
916968
filters:
917969
branches:
918970
only:
919971
- master
972+
- next
920973
jobs:
921974
- test_unit:
922975
<<: *default-context
923976
react-version: next
977+
name: test_unit-react@next
924978
- test_browser:
925979
<<: *default-context
926980
react-version: next
981+
name: test_browser-react@next
927982
- test_regressions:
928983
<<: *default-context
929984
react-version: next
985+
name: test_regressions-react@next
930986
- test_e2e:
931987
<<: *default-context
932988
react-version: next
989+
name: test_e2e-react@next
990+
933991
typescript-next:
934992
triggers:
935993
- schedule:
@@ -938,6 +996,7 @@ workflows:
938996
branches:
939997
only:
940998
- master
999+
- next
9411000
jobs:
9421001
- test_types_next:
9431002
<<: *default-context

docs/data/material/migration/migrating-to-v6/migrating-to-pigment-css.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Integrating Pigment CSS with Material UI requires you to configure the theme t
171171
Add the following code to your [Next.js](#nextjs) or [Vite](#vite) config file:
172172

173173
```diff
174-
+ import { extendTheme, stringifyTheme } from '@mui/material';
174+
+ import { extendTheme } from '@mui/material';
175175

176176
+ const pigmentConfig = {
177177
+ theme: extendTheme(),

docs/data/material/migration/migrating-to-v6/migrating-to-v6.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@ Note that the items' position doesn't change.
255255
We recommend adopting this new behavior and **not trying to replicate the old one**, as this is a more predictable and modern approach.
256256
:::
257257

258+
### Rating
259+
260+
Previously, due to a bug, the `aria-label` attribute was "null Stars" when no value was set in the Rating component.
261+
This is fixed in v6, with the `aria-label` attribute being "0 Stars" when no value is set.
262+
258263
### useMediaQuery
259264

260265
The following deprecated types were removed:

docs/pages/material-ui/api/rating.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"emptyLabelText": { "type": { "name": "node" }, "default": "'Empty'" },
88
"getLabelText": {
99
"type": { "name": "func" },
10-
"default": "function defaultLabelText(value) {\n return `${value} Star${value !== 1 ? 's' : ''}`;\n}",
10+
"default": "function defaultLabelText(value) {\n return `${value || '0'} Star${value !== 1 ? 's' : ''}`;\n}",
1111
"signature": { "type": "function(value: number) => string", "describedArgs": ["value"] }
1212
},
1313
"highlightSelectedOnly": { "type": { "name": "bool" }, "default": "false" },

packages/mui-material-nextjs/src/v13-appRouter/appRouterV13.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default function AppRouterCacheProvider(props: AppRouterCacheProviderProp
7474
inserted.forEach(({ name, isGlobal }) => {
7575
const style = registry.cache.inserted[name];
7676

77-
if (typeof style !== 'boolean') {
77+
if (typeof style === 'string') {
7878
if (isGlobal) {
7979
globals.push({ name, style });
8080
} else {

packages/mui-material/src/Rating/Rating.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export interface RatingProps
4444
* @param {number} value The rating label's value to format.
4545
* @returns {string}
4646
* @default function defaultLabelText(value) {
47-
* return `${value} Star${value !== 1 ? 's' : ''}`;
47+
* return `${value || '0'} Star${value !== 1 ? 's' : ''}`;
4848
* }
4949
*/
5050
getLabelText?: (value: number) => string;

packages/mui-material/src/Rating/Rating.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ const defaultIcon = <Star fontSize="inherit" />;
321321
const defaultEmptyIcon = <StarBorder fontSize="inherit" />;
322322

323323
function defaultLabelText(value) {
324-
return `${value} Star${value !== 1 ? 's' : ''}`;
324+
return `${value || '0'} Star${value !== 1 ? 's' : ''}`;
325325
}
326326

327327
const Rating = React.forwardRef(function Rating(inProps, ref) {
@@ -670,7 +670,7 @@ Rating.propTypes /* remove-proptypes */ = {
670670
* @param {number} value The rating label's value to format.
671671
* @returns {string}
672672
* @default function defaultLabelText(value) {
673-
* return `${value} Star${value !== 1 ? 's' : ''}`;
673+
* return `${value || '0'} Star${value !== 1 ? 's' : ''}`;
674674
* }
675675
*/
676676
getLabelText: PropTypes.func,

packages/mui-material/src/Rating/Rating.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ describe('<Rating />', () => {
225225
expect(screen.getByRole('img')).toHaveAccessibleName('Stars: 2');
226226
});
227227

228+
it('should have a correct label when no value is set', () => {
229+
render(<Rating readOnly />);
230+
231+
expect(screen.getByRole('img')).toHaveAccessibleName('0 Stars');
232+
});
233+
228234
it('should have readOnly class applied', () => {
229235
render(<Rating readOnly value={2} />);
230236

0 commit comments

Comments
 (0)