Skip to content

Commit 257acbb

Browse files
committed
Merge remote-tracking branch 'upstream/master' into template-polishing-checkout
2 parents d5c6f9e + b1a0896 commit 257acbb

File tree

99 files changed

+1734
-248
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1734
-248
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ jobs:
385385
name: Test umd release
386386
command: pnpm test:umd
387387
test_e2e_website:
388+
# NOTE: This workflow runs after successful docs deploy. See /test/e2e-website/README.md#ci
388389
<<: *defaults
389390
docker:
390391
- image: mcr.microsoft.com/playwright:v1.42.1-focal

.codesandbox/ci.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"packages/mui-base",
1010
"packages/mui-codemod",
1111
"packages/mui-core-downloads-tracker",
12+
"packages/mui-docs",
1213
"packages/mui-icons-material",
1314
"packages/mui-joy",
1415
"packages/mui-lab",
@@ -28,6 +29,7 @@
2829
"@mui/base": "packages/mui-base/build",
2930
"@mui/codemod": "packages/mui-codemod/build",
3031
"@mui/core-downloads-tracker": "packages/mui-core-downloads-tracker/build",
32+
"@mui/docs": "packages/mui-docs/build",
3133
"@mui/icons-material": "packages/mui-icons-material/build",
3234
"@mui/internal-babel-macros": "packages/mui-babel-macros",
3335
"@mui/internal-markdown": "packages/markdown",

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/packages/pigment-react/processors/
2424
/packages/pigment-react/exports/
2525
/packages/pigment-react/theme/
26-
/packages/pigment-react/tests/fixtures/
26+
/packages/pigment-react/tests/**/fixtures
2727
/packages/pigment-nextjs-plugin/loader.js
2828
# Ignore fixtures
2929
/packages-internal/scripts/typescript-to-proptypes/test/*/*

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ _Mar 5, 2024_
99
A big thanks to the 21 contributors who made this release possible.
1010
This release was mostly about 🐛 bug fixes and 📚 documentation improvements.
1111

12+
### `@pigment-css/[email protected]`, `@pigment-css/[email protected]`, `@pigment-css/[email protected]`, & `@pigment-css/[email protected]`
13+
14+
- This is the first public release of our new zero-runtime CSS-in-JS library, Pigment CSS.
15+
1216
1317

1418
- &#8203;<!-- 52 -->Support props callback type in theme variants (#40946) @ZeeshanTamboli

docs/data/base/components/snackbar/TransitionComponentSnackbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default function TransitionComponentSnackbar() {
1010
const [exited, setExited] = React.useState(true);
1111
const nodeRef = React.useRef(null);
1212

13-
const handleClose = (_: any, reason: SnackbarCloseReason) => {
13+
const handleClose = (_: any, reason?: SnackbarCloseReason) => {
1414
if (reason === 'clickaway') {
1515
return;
1616
}

docs/data/base/components/snackbar/UnstyledSnackbarIntroduction/css/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function UnstyledSnackbarIntroduction() {
1111
const [exited, setExited] = React.useState(true);
1212
const nodeRef = React.useRef(null);
1313

14-
const handleClose = (_: any, reason: SnackbarCloseReason) => {
14+
const handleClose = (_: any, reason?: SnackbarCloseReason) => {
1515
if (reason === 'clickaway') {
1616
return;
1717
}

docs/data/base/components/snackbar/UnstyledSnackbarIntroduction/system/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function UnstyledSnackbarIntroduction() {
1111
const [exited, setExited] = React.useState(true);
1212
const nodeRef = React.useRef(null);
1313

14-
const handleClose = (_: any, reason: SnackbarCloseReason) => {
14+
const handleClose = (_: any, reason?: SnackbarCloseReason) => {
1515
if (reason === 'clickaway') {
1616
return;
1717
}

docs/data/base/components/snackbar/UnstyledSnackbarIntroduction/tailwind/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function UnstyledSnackbarIntroduction() {
1818
const [exited, setExited] = React.useState(true);
1919
const nodeRef = React.useRef(null);
2020

21-
const handleClose = (_: any, reason: SnackbarCloseReason) => {
21+
const handleClose = (_: any, reason?: SnackbarCloseReason) => {
2222
if (reason === 'clickaway') {
2323
return;
2424
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
import * as React from 'react';
2-
import { useTheme } from '@mui/joy/styles';
32
import Stack from '@mui/joy/Stack';
43
import Person from '@mui/icons-material/Person';
54

65
export default function IconFontSizes() {
7-
const theme = useTheme();
86
return (
97
<Stack
108
spacing={2}
119
direction="row"
1210
sx={{ gridColumn: '1 / -1', alignItems: 'center', justifyContent: 'center' }}
1311
>
14-
{Object.keys(theme.fontSize).map((size) => (
15-
<Person key={size} fontSize={size} />
16-
))}
12+
<Person fontSize="xs" />
13+
<Person fontSize="sm" />
14+
<Person fontSize="md" />
15+
<Person fontSize="lg" />
16+
<Person fontSize="xl" />
17+
<Person fontSize="xl2" />
18+
<Person fontSize="xl3" />
19+
<Person fontSize="xl4" />
1720
</Stack>
1821
);
1922
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
import * as React from 'react';
2-
import { useTheme } from '@mui/joy/styles';
32
import Stack from '@mui/joy/Stack';
43
import Person from '@mui/icons-material/Person';
54

65
export default function IconFontSizes() {
7-
const theme = useTheme();
86
return (
97
<Stack
108
spacing={2}
119
direction="row"
1210
sx={{ gridColumn: '1 / -1', alignItems: 'center', justifyContent: 'center' }}
1311
>
14-
{Object.keys(theme.fontSize).map((size) => (
15-
<Person key={size} fontSize={size} />
16-
))}
12+
<Person fontSize="xs" />
13+
<Person fontSize="sm" />
14+
<Person fontSize="md" />
15+
<Person fontSize="lg" />
16+
<Person fontSize="xl" />
17+
<Person fontSize="xl2" />
18+
<Person fontSize="xl3" />
19+
<Person fontSize="xl4" />
1720
</Stack>
1821
);
1922
}
Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1-
{Object.keys(theme.fontSize).map((size) => (
2-
<Person key={size} fontSize={size} />
3-
))}
1+
<Person fontSize="xs" />
2+
<Person fontSize="sm" />
3+
<Person fontSize="md" />
4+
<Person fontSize="lg" />
5+
<Person fontSize="xl" />
6+
<Person fontSize="xl2" />
7+
<Person fontSize="xl3" />
8+
<Person fontSize="xl4" />

docs/data/joy/main-features/color-inversion/color-inversion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The color inversion feature is only available for `soft` and `solid` variants be
3535
- It works for both light and dark mode.
3636
- It can be disabled at any time without impacting the structure of the components.
3737
- It is an opt-in feature. If you don't use it, the extra CSS variables won't be included in the production style sheet.
38-
- Some children can be excluded from the color inversion, see ["skip color inversion on a child"](#skip-color-inversion-on-a-child) section.
38+
- Some children can be excluded from the color inversion, see ["skip color inversion on a child"](#skip-inversion-on-a-child) section.
3939

4040
### Trade-offs
4141

docs/pages/experiments/base/components-gallery.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export default function ComponentsGallery() {
143143
const [exited, setExited] = React.useState(true);
144144
const nodeRef = React.useRef(null);
145145

146-
const handleClose = (_: any, reason: SnackbarCloseReason) => {
146+
const handleClose = (_: any, reason?: SnackbarCloseReason) => {
147147
if (reason === 'clickaway') {
148148
return;
149149
}
@@ -208,7 +208,7 @@ export default function ComponentsGallery() {
208208
setCopySnackbarOpen(true);
209209
}
210210

211-
const handleCopyClose = (_: any, reason: SnackbarCloseReason) => {
211+
const handleCopyClose = (_: any, reason?: SnackbarCloseReason) => {
212212
if (reason === 'clickaway') {
213213
return;
214214
}

docs/src/components/productBaseUI/BaseUIThemesDemo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ export default function BaseUIThemesDemo() {
785785
// Snackbar
786786
const [openSnackbar, setOpenSnackbar] = React.useState(false);
787787

788-
const handleCloseSnackbar = (_: any, reason: SnackbarCloseReason) => {
788+
const handleCloseSnackbar = (_: any, reason?: SnackbarCloseReason) => {
789789
if (reason === 'clickaway') {
790790
return;
791791
}

docs/src/components/showcase/TaskCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default function TaskCard() {
3333
</Typography>
3434
</Box>
3535
<Box sx={{ my: 'auto' }}>
36-
<CodeRounded color="white" />
36+
<CodeRounded />
3737
<Typography fontSize={18} component="div" fontWeight="semiBold" sx={{ lineHeight: 1.4 }}>
3838
Customize every button and chip instance primary color
3939
</Typography>

docs/src/modules/brandingTheme.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,22 @@ declare module '@mui/material/Chip' {
6565
}
6666
}
6767

68+
declare module '@mui/material/SvgIcon' {
69+
interface SvgIconPropsColorOverrides {
70+
danger: true;
71+
}
72+
interface SvgIconPropsSizeOverrides {
73+
xs: true;
74+
sm: true;
75+
md: true;
76+
lg: true;
77+
xl: true;
78+
xl2: true;
79+
xl3: true;
80+
xl4: true;
81+
}
82+
}
83+
6884
// TODO: enable this once types conflict is fixed
6985
// declare module '@mui/material/Button' {
7086
// interface ButtonPropsVariantOverrides {

docs/src/modules/components/ApiPage/table/ClassesTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ export default function ClassesTable(props: ClassesTableProps) {
8181

8282
return (
8383
<tr key={className} id={getHash({ componentName, className: key })}>
84-
<td>
84+
<td className="algolia-lvl3">
8585
<span className="class-name">.{className}</span>
8686
</td>
8787
{displayClassKeys && (
8888
<td>{!isGlobal && <span className="class-key">{key}</span>}</td>
8989
)}
90-
<td>
90+
<td className="algolia-content">
9191
<span
9292
dangerouslySetInnerHTML={{
9393
__html: description || '',

docs/src/modules/components/ApiPage/table/PropertiesTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export default function PropertiesTable(props: PropertiesTableProps) {
166166
key={propName}
167167
id={getHash({ componentName, propName, hooksParameters, hooksReturnValue })}
168168
>
169-
<td className="MuiApi-table-item-title">
169+
<td className="MuiApi-table-item-title algolia-lvl3">
170170
{propName}
171171
{isRequired ? '*' : ''}
172172
{isOptional ? '?' : ''}
@@ -200,7 +200,7 @@ export default function PropertiesTable(props: PropertiesTableProps) {
200200
)}
201201
</td>
202202
)}
203-
<td className="MuiPropTable-description-column">
203+
<td className="MuiPropTable-description-column algolia-content">
204204
{description && <PropDescription description={description} />}
205205
{seeMoreDescription && (
206206
<p
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
# next-env.d.ts
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Pigment CSS - Next.js App Router with TypeScript example project
2+
3+
This is a [Next.js](https://nextjs.org/) project bootstrapped using [`create-next-app`](https://github.com/vercel/next.js/tree/HEAD/packages/create-next-app), with TypeScript and Pigment CSS, a zero-runtime CSS-in-JS library, installed.
4+
5+
## How to use
6+
7+
Download the example [or clone the repo](https://github.com/mui/material-ui):
8+
9+
<!-- #default-branch-switch -->
10+
11+
```bash
12+
curl https://codeload.github.com/mui/material-ui/tar.gz/master | tar -xz --strip=2 material-ui-master/examples/pigment-css-nextjs-ts
13+
cd pigment-css-nextjs-ts
14+
```
15+
16+
Install it and run:
17+
18+
```bash
19+
npm install
20+
npm run dev
21+
```
22+
23+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
24+
25+
or:
26+
27+
<!-- #default-branch-switch -->
28+
29+
[![Edit on StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/mui/material-ui/tree/master/examples/pigment-css-nextjs-ts)
30+
31+
[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/github/mui/material-ui/tree/master/examples/pigment-css-nextjs-ts)
32+
33+
## Learn more
34+
35+
To learn more about this example:
36+
37+
- [Pigment CSS documentation](https://github.com/mui/material-ui/blob/master/packages/pigment-react/README.md) - learn more about Pigment CSS features and APIs.
38+
- [Next.js documentation](https://nextjs.org/docs) - learn about Next.js features and APIs.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const { withPigment, extendTheme } = require('@pigment-css/nextjs-plugin');
2+
3+
// To learn more about theming, visit https://github.com/mui/material-ui/blob/master/packages/zero-runtime/README.md#theming
4+
const theme = extendTheme({
5+
colorSchemes: {
6+
light: {
7+
palette: {
8+
background: '0 0% 100%',
9+
foreground: '240 10% 3.9%',
10+
primary: '240 5.9% 10%',
11+
border: '240 5.9% 90%',
12+
},
13+
},
14+
dark: {
15+
palette: {
16+
background: '240 10% 3.9%',
17+
foreground: '0 0% 80%',
18+
primary: '0 0% 98%',
19+
border: '240 3.7% 15.9%',
20+
},
21+
},
22+
},
23+
});
24+
25+
/** @type {import('next').NextConfig} */
26+
const nextConfig = {};
27+
28+
module.exports = withPigment(nextConfig, { theme });
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "pigment-css-nextjs-ts",
3+
"version": "5.0.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint",
10+
"post-update": "echo \"codesandbox preview only, need an update\" && pnpm update --latest"
11+
},
12+
"dependencies": {
13+
"@pigment-css/react": "latest",
14+
"react": "latest",
15+
"react-dom": "latest",
16+
"next": "latest"
17+
},
18+
"devDependencies": {
19+
"@pigment-css/nextjs-plugin": "latest",
20+
"@types/node": "latest",
21+
"@types/react": "latest",
22+
"@types/react-dom": "latest",
23+
"eslint": "latest",
24+
"eslint-config-next": "latest",
25+
"typescript": "latest"
26+
}
27+
}

examples/pigment-css-nextjs-ts/public/.gitkeep

Whitespace-only changes.
619 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)