Skip to content

Commit

Permalink
Merge branch 'master' into loading-button
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeshanTamboli committed Oct 30, 2024
2 parents ae5befd + 57bcc7c commit 15c0396
Show file tree
Hide file tree
Showing 37 changed files with 427 additions and 139 deletions.
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
# [Versions](https://mui.com/versions/)

## 6.1.6

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

_Oct 30, 2024_

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

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

- [Autocomplete] Add missing `onMouseDown` type to AutocompleteRenderInputParams (#44183) @sai6855
- [Avatar] Fix AvatarGroup spacing (#44208) @aarongarciah
- [AvatarGroup] Fix spacing CSS variable (#44202) @navedqb
- [Divider] Fix CSS specificity order (#44204) @o-alexandrov
- [Slider] Fix value prop type warning (#44131) @joshkel
- Replace `useThemeProps` with `useDefaultProps` (#44193) @siriwatknp

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

- Support Next 15.0.0 (#42428) @nphmuller

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

- [Tabs] Fix type of TabPanel component (#44207) @blackcow1987

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

- Fix system props default import specifier (#44170) @siriwatknp

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

- Bring back useIsFocusVisible (#44256) @aarongarciah
- Bring back getReactNodeRef (#44248) @aarongarciah

### Docs

- [material-ui][Avatar] Add AvatarGroup spacing demo (#44209) @aarongarciah
- Fix a typo in CONTRIBUTING.md (#44200) @prakhargupta1
- Mark the Hidden component as deprecated in the sidenav (#44068) @jimmycallin
- Use () when referencing functions (#44184) @oliviertassinari
- Follow types description convention (#44187) @oliviertassinari

### Core

- Lock file maintenance (#43947)
- Run @mui/icon-material src:icons (#44097) @oliviertassinari
- [test][material-ui] Add tests for Pigment Grid and Stack (#44132) @DiegoAndai
- [test] Distinguish private with public tests API (#44188) @oliviertassinari
- [docs-infra] Add recursively the relative modules in the demos (#44150) @mnajdova

All contributors of this release in alphabetical order: @aarongarciah, @blackcow1987, @DiegoAndai, @jimmycallin, @joshkel, @mnajdova, @navedqb, @nphmuller, @o-alexandrov, @oliviertassinari, @prakhargupta1, @sai6855, @siriwatknp

## 6.1.5

<!-- generated comparing v6.1.4..master -->
Expand Down
129 changes: 129 additions & 0 deletions docs/data/material/components/autocomplete/top100Films.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
// Top 100 films as rated by IMDb users. http://www.imdb.com/chart/top
const top100Films = [
{ label: 'The Shawshank Redemption', year: 1994 },
{ label: 'The Godfather', year: 1972 },
{ label: 'The Godfather: Part II', year: 1974 },
{ label: 'The Dark Knight', year: 2008 },
{ label: '12 Angry Men', year: 1957 },
{ label: "Schindler's List", year: 1993 },
{ label: 'Pulp Fiction', year: 1994 },
{
label: 'The Lord of the Rings: The Return of the King',
year: 2003,
},
{ label: 'The Good, the Bad and the Ugly', year: 1966 },
{ label: 'Fight Club', year: 1999 },
{
label: 'The Lord of the Rings: The Fellowship of the Ring',
year: 2001,
},
{
label: 'Star Wars: Episode V - The Empire Strikes Back',
year: 1980,
},
{ label: 'Forrest Gump', year: 1994 },
{ label: 'Inception', year: 2010 },
{
label: 'The Lord of the Rings: The Two Towers',
year: 2002,
},
{ label: "One Flew Over the Cuckoo's Nest", year: 1975 },
{ label: 'Goodfellas', year: 1990 },
{ label: 'The Matrix', year: 1999 },
{ label: 'Seven Samurai', year: 1954 },
{
label: 'Star Wars: Episode IV - A New Hope',
year: 1977,
},
{ label: 'City of God', year: 2002 },
{ label: 'Se7en', year: 1995 },
{ label: 'The Silence of the Lambs', year: 1991 },
{ label: "It's a Wonderful Life", year: 1946 },
{ label: 'Life Is Beautiful', year: 1997 },
{ label: 'The Usual Suspects', year: 1995 },
{ label: 'Léon: The Professional', year: 1994 },
{ label: 'Spirited Away', year: 2001 },
{ label: 'Saving Private Ryan', year: 1998 },
{ label: 'Once Upon a Time in the West', year: 1968 },
{ label: 'American History X', year: 1998 },
{ label: 'Interstellar', year: 2014 },
{ label: 'Casablanca', year: 1942 },
{ label: 'City Lights', year: 1931 },
{ label: 'Psycho', year: 1960 },
{ label: 'The Green Mile', year: 1999 },
{ label: 'The Intouchables', year: 2011 },
{ label: 'Modern Times', year: 1936 },
{ label: 'Raiders of the Lost Ark', year: 1981 },
{ label: 'Rear Window', year: 1954 },
{ label: 'The Pianist', year: 2002 },
{ label: 'The Departed', year: 2006 },
{ label: 'Terminator 2: Judgment Day', year: 1991 },
{ label: 'Back to the Future', year: 1985 },
{ label: 'Whiplash', year: 2014 },
{ label: 'Gladiator', year: 2000 },
{ label: 'Memento', year: 2000 },
{ label: 'The Prestige', year: 2006 },
{ label: 'The Lion King', year: 1994 },
{ label: 'Apocalypse Now', year: 1979 },
{ label: 'Alien', year: 1979 },
{ label: 'Sunset Boulevard', year: 1950 },
{
label: 'Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb',
year: 1964,
},
{ label: 'The Great Dictator', year: 1940 },
{ label: 'Cinema Paradiso', year: 1988 },
{ label: 'The Lives of Others', year: 2006 },
{ label: 'Grave of the Fireflies', year: 1988 },
{ label: 'Paths of Glory', year: 1957 },
{ label: 'Django Unchained', year: 2012 },
{ label: 'The Shining', year: 1980 },
{ label: 'WALL·E', year: 2008 },
{ label: 'American Beauty', year: 1999 },
{ label: 'The Dark Knight Rises', year: 2012 },
{ label: 'Princess Mononoke', year: 1997 },
{ label: 'Aliens', year: 1986 },
{ label: 'Oldboy', year: 2003 },
{ label: 'Once Upon a Time in America', year: 1984 },
{ label: 'Witness for the Prosecution', year: 1957 },
{ label: 'Das Boot', year: 1981 },
{ label: 'Citizen Kane', year: 1941 },
{ label: 'North by Northwest', year: 1959 },
{ label: 'Vertigo', year: 1958 },
{
label: 'Star Wars: Episode VI - Return of the Jedi',
year: 1983,
},
{ label: 'Reservoir Dogs', year: 1992 },
{ label: 'Braveheart', year: 1995 },
{ label: 'M', year: 1931 },
{ label: 'Requiem for a Dream', year: 2000 },
{ label: 'Amélie', year: 2001 },
{ label: 'A Clockwork Orange', year: 1971 },
{ label: 'Like Stars on Earth', year: 2007 },
{ label: 'Taxi Driver', year: 1976 },
{ label: 'Lawrence of Arabia', year: 1962 },
{ label: 'Double Indemnity', year: 1944 },
{
label: 'Eternal Sunshine of the Spotless Mind',
year: 2004,
},
{ label: 'Amadeus', year: 1984 },
{ label: 'To Kill a Mockingbird', year: 1962 },
{ label: 'Toy Story 3', year: 2010 },
{ label: 'Logan', year: 2017 },
{ label: 'Full Metal Jacket', year: 1987 },
{ label: 'Dangal', year: 2016 },
{ label: 'The Sting', year: 1973 },
{ label: '2001: A Space Odyssey', year: 1968 },
{ label: "Singin' in the Rain", year: 1952 },
{ label: 'Toy Story', year: 1995 },
{ label: 'Bicycle Thieves', year: 1948 },
{ label: 'The Kid', year: 1921 },
{ label: 'Inglourious Basterds', year: 2009 },
{ label: 'Snatch', year: 2000 },
{ label: '3 Idiots', year: 2009 },
{ label: 'Monty Python and the Holy Grail', year: 1975 },
];

export default top100Films;
1 change: 1 addition & 0 deletions docs/scripts/formattedTSDemos.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ async function getFiles(root) {
} else if (
stat.isFile() &&
/\.tsx?$/.test(filePath) &&
!filePath.endsWith('types.ts') &&
!filePath.endsWith('.d.ts') &&
!ignoreList.some((ignorePath) => filePath.endsWith(path.normalize(ignorePath)))
) {
Expand Down
7 changes: 2 additions & 5 deletions docs/src/modules/sandbox/CodeSandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ function createReactApp(demoData: DemoData) {
content: CRA.getRootIndex(demoData),
},
[`src/Demo.${ext}`]: {
content: flattenRelativeImports(
demoData.raw,
demoData.relativeModules?.map((file) => file.module),
),
content: flattenRelativeImports(demoData.raw),
},
// Spread the relative modules
...(demoData.relativeModules &&
Expand All @@ -60,7 +57,7 @@ function createReactApp(demoData: DemoData) {
...acc,
// Remove the path and keep the filename
[`src/${curr.module.replace(/^.*[\\/]/g, '')}`]: {
content: curr.raw,
content: flattenRelativeImports(curr.raw),
},
}),
{},
Expand Down
11 changes: 2 additions & 9 deletions docs/src/modules/sandbox/FlattenRelativeImports.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
export default function flattenRelativeImports(rawCode: string, modulePaths: string[] = []) {
let newCode = rawCode;
modulePaths.forEach((path: string) => {
const pathWithoutExtension = path.replace(/\.[a-z]*$/g, '');
// Move the relative import to the current directory
const newPath = `./${pathWithoutExtension.replace(/^.*[\\/]/g, '')}`;
newCode = newCode.replace(pathWithoutExtension, newPath);
});
return newCode;
export default function flattenRelativeImports(rawCode: string) {
return rawCode.replace(/from (['"])\..*\//g, `from $1./`);
}
7 changes: 2 additions & 5 deletions docs/src/modules/sandbox/StackBlitz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,15 @@ function createReactApp(demoData: DemoData) {
const files: Record<string, string> = {
'index.html': CRA.getHtml(demoData),
[`index.${ext}`]: CRA.getRootIndex(demoData),
[`Demo.${ext}`]: flattenRelativeImports(
demoData.raw,
demoData.relativeModules?.map((file) => file.module),
),
[`Demo.${ext}`]: flattenRelativeImports(demoData.raw),
// Spread the relative modules
...(demoData.relativeModules &&
// Transform the relative modules array into an object
demoData.relativeModules.reduce(
(acc, curr) => ({
...acc,
// Remove the path and keep the filename
[`${curr.module.replace(/^.*[\\/]/g, '')}`]: curr.raw,
[`${curr.module.replace(/^.*[\\/]/g, '')}`]: flattenRelativeImports(curr.raw),
}),
{},
)),
Expand Down
2 changes: 1 addition & 1 deletion packages-internal/babel-plugin-minify-errors/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/internal-babel-plugin-minify-errors",
"version": "1.0.12",
"version": "1.0.13",
"author": "MUI Team",
"description": "This is an internal package not meant for general use.",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages-internal/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/internal-scripts",
"version": "1.0.25",
"version": "1.0.26",
"author": "MUI Team",
"description": "Utilities supporting MUI libraries build and docs generation. This is an internal package not meant for general use.",
"main": "build/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages-internal/test-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mui/internal-test-utils",
"version": "1.0.18",
"version": "1.0.19",
"author": "MUI Team",
"description": "Utilities for MUI tests. This is an internal package not meant for general use.",
"main": "./build/index.js",
Expand Down
39 changes: 39 additions & 0 deletions packages-internal/test-utils/src/describeConformance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ export interface ConformanceOptions {
testLegacyComponentsProp?: boolean;
slots?: Record<string, SlotTestingOptions>;
ThemeProvider?: React.ElementType;
/**
* If provided, the component will be tested by the `DefaultPropsProvider` (in addition to the ThemeProvider).
*/
DefaultPropsProvider?: React.ElementType;
createTheme?: (arg: any) => any;
}

Expand Down Expand Up @@ -611,6 +615,41 @@ function testThemeDefaultProps(
expect(container.firstChild).to.have.attribute(testProp, 'testProp');
});
});

describe('default props provider:', () => {
it('respect custom default props', async function test() {
const testProp = 'data-id';
const { muiName, render, DefaultPropsProvider } = getOptions();

if (!DefaultPropsProvider) {
this.skip();
}

if (!muiName) {
throwMissingPropError('muiName');
}

if (!render) {
throwMissingPropError('render');
}

const { container } = await render(
<DefaultPropsProvider
value={{
[muiName]: {
defaultProps: {
[testProp]: 'testProp',
},
},
}}
>
{element}
</DefaultPropsProvider>,
);

expect(container.firstChild).to.have.attribute(testProp, 'testProp');
});
});
}

/**
Expand Down
Loading

0 comments on commit 15c0396

Please sign in to comment.