Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui][Alert] Convert to support zero runtime #41230

Merged
merged 27 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2f21ebc
add alert page
siriwatknp Feb 21, 2024
635482e
update next-app to use build files
siriwatknp Feb 21, 2024
1f8e0ea
migrate Alert
siriwatknp Feb 21, 2024
b6f3ed3
add the rest of demos
siriwatknp Feb 21, 2024
d17ab03
make the next-app works with workspace
siriwatknp Feb 22, 2024
aacd7b9
fix theme types
siriwatknp Feb 22, 2024
9b1de9e
Revert "fix theme types"
siriwatknp Feb 28, 2024
16655aa
Revert "make the next-app works with workspace"
siriwatknp Feb 28, 2024
4cc4324
Revert "add the rest of demos"
siriwatknp Feb 28, 2024
336cb50
Revert "update next-app to use build files"
siriwatknp Feb 28, 2024
514c651
Revert "add alert page"
siriwatknp Feb 28, 2024
b4782e9
Merge branch 'master' of https://github.com/mui/material-ui into mui-…
siriwatknp Feb 28, 2024
37842c1
add react-alert page to apps
siriwatknp Feb 28, 2024
1addb4f
add components index page
siriwatknp Feb 28, 2024
8975ea5
fix path
siriwatknp Feb 28, 2024
2397c77
add zero-runtime to the root so that apps can be built
siriwatknp Feb 28, 2024
1c615dd
Merge branch 'master' of https://github.com/mui/material-ui into mui-…
siriwatknp Feb 29, 2024
cd57f5a
convert AlertTitle
siriwatknp Feb 29, 2024
f6910df
use prettier module
siriwatknp Feb 29, 2024
eb39558
Merge branch 'master' of https://github.com/mui/material-ui into mui-…
siriwatknp Feb 29, 2024
0689c63
fix iterating palette and add tests
siriwatknp Mar 1, 2024
b4b8cb1
only test if ThemeProvider and createTheme are provided
siriwatknp Mar 1, 2024
9bf53e2
remove typo `only`
siriwatknp Mar 1, 2024
75c758b
Merge branch 'master' of https://github.com/mui/material-ui into mui-…
siriwatknp Mar 4, 2024
bcb07aa
run pnpm install at root
siriwatknp Mar 4, 2024
df1c916
run pnpm install apps
siriwatknp Mar 4, 2024
df00cea
remove material-nextjs from vite-app
siriwatknp Mar 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/local-ui-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"version": "0.0.1",
"private": true,
"dependencies": {
"@mui/zero-runtime": "file:../../packages/zero-runtime/build"
"@mui/zero-runtime": "file:../../packages/zero-runtime"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mistake from other PR.

}
}
9 changes: 2 additions & 7 deletions apps/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 21 additions & 17 deletions apps/zero-runtime-next-app/src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
@layer reset, mui;

html,
body {
max-width: 100vw;
overflow-x: hidden;
}
@layer reset {
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}

a {
color: inherit;
text-decoration: none;
}
html,
body {
max-width: 100vw;
overflow-x: hidden;
}

a {
color: inherit;
text-decoration: none;
}

@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
}
}
44 changes: 44 additions & 0 deletions apps/zero-runtime-next-app/src/app/material-ui/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an index page that links to each demo page.

import * as React from 'react';
import Link from 'next/link';
import fs from 'fs/promises';
import path from 'path';
import { css } from '@mui/zero-runtime';

export default async function MaterialUIPage() {
const rootPaths = await fs.readdir(path.join(process.cwd(), `src/app/material-ui`));
return (
<div>
<h1>Material UI Components</h1>
<nav>
<ul
className={css({
margin: 0,
marginBlock: '1rem',
padding: 0,
paddingLeft: '1.5rem',
display: 'flex',
flexDirection: 'column',
gap: '0.5rem',
})}
>
{rootPaths
.filter((item) => !item.match(/\.(js|tsx)$/))
.map((file) => (
<li key={file}>
<Link
href={`/material-ui/${file.replace(/\.[jt]sx?$/, '')}`}
className={css({
textDecoration: 'underline',
fontSize: '17px',
})}
>
{file}
</Link>
</li>
))}
</ul>
</nav>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
'use client';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generated from zero-render-mui-demos.mjs script.

import * as React from 'react';
import ActionAlerts from '../../../../../../docs/data/material/components/alert/ActionAlerts';
import BasicAlerts from '../../../../../../docs/data/material/components/alert/BasicAlerts';
import ColorAlerts from '../../../../../../docs/data/material/components/alert/ColorAlerts';
import DescriptionAlerts from '../../../../../../docs/data/material/components/alert/DescriptionAlerts';
import FilledAlerts from '../../../../../../docs/data/material/components/alert/FilledAlerts';
import IconAlerts from '../../../../../../docs/data/material/components/alert/IconAlerts';
import OutlinedAlerts from '../../../../../../docs/data/material/components/alert/OutlinedAlerts';
import SimpleAlert from '../../../../../../docs/data/material/components/alert/SimpleAlert';
import TransitionAlerts from '../../../../../../docs/data/material/components/alert/TransitionAlerts';

export default function Alert() {
return (
<React.Fragment>
<section>
<h2> Action Alerts</h2>
<div className="demo-container">
<ActionAlerts />
</div>
</section>
<section>
<h2> Basic Alerts</h2>
<div className="demo-container">
<BasicAlerts />
</div>
</section>
<section>
<h2> Color Alerts</h2>
<div className="demo-container">
<ColorAlerts />
</div>
</section>
<section>
<h2> Description Alerts</h2>
<div className="demo-container">
<DescriptionAlerts />
</div>
</section>
<section>
<h2> Filled Alerts</h2>
<div className="demo-container">
<FilledAlerts />
</div>
</section>
<section>
<h2> Icon Alerts</h2>
<div className="demo-container">
<IconAlerts />
</div>
</section>
<section>
<h2> Outlined Alerts</h2>
<div className="demo-container">
<OutlinedAlerts />
</div>
</section>
<section>
<h2> Simple Alert</h2>
<div className="demo-container">
<SimpleAlert />
</div>
</section>
<section>
<h2> Transition Alerts</h2>
<div className="demo-container">
<TransitionAlerts />
</div>
</section>
</React.Fragment>
);
}
73 changes: 73 additions & 0 deletions apps/zero-runtime-vite-app/src/pages/material-ui/react-alert.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import * as React from 'react';
import MaterialUILayout from '../../Layout';
import ActionAlerts from '../../../../../docs/data/material/components/alert/ActionAlerts.tsx';
import BasicAlerts from '../../../../../docs/data/material/components/alert/BasicAlerts.tsx';
import ColorAlerts from '../../../../../docs/data/material/components/alert/ColorAlerts.tsx';
import DescriptionAlerts from '../../../../../docs/data/material/components/alert/DescriptionAlerts.tsx';
import FilledAlerts from '../../../../../docs/data/material/components/alert/FilledAlerts.tsx';
import IconAlerts from '../../../../../docs/data/material/components/alert/IconAlerts.tsx';
import OutlinedAlerts from '../../../../../docs/data/material/components/alert/OutlinedAlerts.tsx';
import SimpleAlert from '../../../../../docs/data/material/components/alert/SimpleAlert.tsx';
import TransitionAlerts from '../../../../../docs/data/material/components/alert/TransitionAlerts.tsx';

export default function Alert() {
return (
<MaterialUILayout>
<h1>Alert</h1>
<section>
<h2> Action Alerts</h2>
<div className="demo-container">
<ActionAlerts />
</div>
</section>
<section>
<h2> Basic Alerts</h2>
<div className="demo-container">
<BasicAlerts />
</div>
</section>
<section>
<h2> Color Alerts</h2>
<div className="demo-container">
<ColorAlerts />
</div>
</section>
<section>
<h2> Description Alerts</h2>
<div className="demo-container">
<DescriptionAlerts />
</div>
</section>
<section>
<h2> Filled Alerts</h2>
<div className="demo-container">
<FilledAlerts />
</div>
</section>
<section>
<h2> Icon Alerts</h2>
<div className="demo-container">
<IconAlerts />
</div>
</section>
<section>
<h2> Outlined Alerts</h2>
<div className="demo-container">
<OutlinedAlerts />
</div>
</section>
<section>
<h2> Simple Alert</h2>
<div className="demo-container">
<SimpleAlert />
</div>
</section>
<section>
<h2> Transition Alerts</h2>
<div className="demo-container">
<TransitionAlerts />
</div>
</section>
</MaterialUILayout>
);
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
"@mui/joy": "workspace:*",
"@mui/material": "workspace:^",
"@mui/utils": "workspace:^",
"@mui/zero-runtime": "workspace:^",
"@next/eslint-plugin-next": "^14.1.0",
"@octokit/rest": "^20.0.2",
"@playwright/test": "1.41.2",
Expand Down
Loading
Loading