From a3a1be9dd57202946d57b3971eb34f8875a707e2 Mon Sep 17 00:00:00 2001
From: Brijesh Bittu
Date: Fri, 1 Mar 2024 13:35:29 +0530
Subject: [PATCH] [pigmentcss] Rename zero-runtime to pigmentcss (#41317)
---
.codesandbox/ci.json | 16 +-
.eslintignore | 12 +-
CHANGELOG.md | 6 +-
apps/local-ui-lib/index.js | 2 +-
apps/local-ui-lib/package.json | 2 +-
apps/local-ui-lib/tsconfig.json | 2 +-
.../.eslintrc | 0
.../.gitignore | 0
.../README.md | 4 +-
.../next.config.js | 10 +-
.../package.json | 6 +-
.../public/next.svg | 0
.../public/vercel.svg | 0
.../src/app/box/page.tsx | 2 +-
.../src/app/favicon.ico | Bin
.../src/app/globals.css | 0
.../src/app/layout.tsx | 2 +-
.../src/app/material-ui/layout.tsx | 2 +-
.../src/app/material-ui/react-avatar/page.tsx | 0
.../src/app/page.module.css | 0
.../src/app/page.tsx | 2 +-
.../src/app/slider/page.tsx | 2 +-
.../src/app/theme.ts | 0
.../src/augment.d.ts | 4 +-
.../src/components}/Box.jsx | 2 +-
.../src/components/Slider/ZeroSlider.tsx | 2 +-
.../tsconfig.json | 2 +-
.../.eslintrc | 0
.../.gitignore | 0
.../README.md | 6 +-
.../index.html | 0
.../package.json | 4 +-
.../postcss.config.cjs | 0
.../src/App.tsx | 2 +-
.../src}/Box.jsx | 2 +-
.../src/Layout.tsx | 2 +-
.../src/Slider/ZeroSlider.test.jsx | 0
.../src/Slider/ZeroSlider.tsx | 2 +-
.../src/augment.ts | 4 +-
.../src/component.tsx | 2 +-
.../src/extend-zero.ts | 2 +-
.../src/main.tsx | 2 +-
.../src/pages/index.tsx | 0
.../src/pages/material-ui/react-avatar.tsx | 0
.../tsconfig.json | 2 +-
.../vite-env.d.ts | 0
.../vite.config.ts | 4 +-
apps/pnpm-lock.yaml | 359 +++++++++---------
apps/pnpm-workspace.yaml | 4 +-
babel.config.js | 2 +-
package.json | 12 +-
.../test/generated-types/tsconfig.json | 14 +-
.../.eslintrc | 0
.../.gitignore | 0
.../loader.js | 0
.../next-font.js | 0
.../next-image.js | 0
.../package.json | 12 +-
.../src/index.ts | 14 +-
.../src/virtual-css-loader.js | 0
.../tsconfig.build.json | 0
.../tsconfig.json | 0
.../tsup.config.ts | 0
.../zero-virtual.css | 0
.../.eslintignore | 0
.../{zero-runtime => pigment-react}/.eslintrc | 0
.../.gitignore | 0
.../{zero-runtime => pigment-react}/README.md | 52 +--
.../exports/createUseThemeProps.js | 0
.../exports/css.js | 0
.../exports/generateAtomics.js | 0
.../exports/keyframes.js | 0
.../exports/styled.js | 0
.../exports/sx-plugin.js | 0
.../exports/sx.js | 0
.../package.json | 12 +-
.../src/base.d.ts | 0
.../src/createUseThemeProps.d.ts | 0
.../src/createUseThemeProps.js | 0
.../src/css.d.ts | 0
packages/pigment-react/src/css.js | 5 +
.../src/generateAtomics.d.ts | 0
.../src/generateAtomics.js | 2 +-
.../src/index.ts | 0
.../src/keyframes.d.ts | 0
packages/pigment-react/src/keyframes.js | 5 +
.../src/processors/base-processor.ts | 0
.../src/processors/createUseThemeProps.ts | 0
.../src/processors/css.ts | 2 +-
.../src/processors/generateAtomics.ts | 0
.../src/processors/keyframes.ts | 0
.../src/processors/styled.ts | 0
.../src/processors/sx.ts | 0
.../src/styled.d.ts | 0
.../src/styled.jsx | 0
.../src/sx.d.ts | 0
.../{zero-runtime => pigment-react}/src/sx.js | 0
.../src/theme.ts | 0
.../src/utils/checkStaticObjectOrArray.ts | 0
.../src/utils/convertAtomicsToCss.ts | 0
.../src/utils/cssFnValueToVariable.ts | 0
.../src/utils/cssFunctionTransformerPlugin.ts | 2 +-
.../src/utils/emotion.ts | 0
.../src/utils/extendTheme.ts | 0
.../src/utils/generateCss.ts | 0
.../src/utils/index.ts | 0
.../src/utils/isUnitLess.ts | 0
.../src/utils/pre-linaria-plugin.ts | 2 +-
.../src/utils/preprocessor.ts | 0
.../src/utils/processCssObject.ts | 0
.../src/utils/sxObjectExtractor.ts | 0
.../src/utils/valueToLiteral.ts | 0
.../styles.css | 0
.../tests/README.md | 0
.../tests/fixtures/styled.input.js | 2 +-
.../tests/fixtures/styled.output.css | 6 +
.../tests/fixtures/styled.output.js | 17 +
.../tests/pigment.test.ts} | 2 +-
.../theme/index.d.ts | 0
.../theme/index.js | 0
.../theme/index.mjs | 0
.../tsconfig.build.json | 0
.../tsconfig.json | 0
.../tsup.config.ts | 0
.../.gitignore | 0
.../package.json | 15 +-
.../src/index.ts | 28 +-
.../tsconfig.build.json | 0
.../tsconfig.json | 4 +-
.../tsup.config.ts | 2 +-
.../.gitignore | 0
.../package.json | 12 +-
.../src/index.ts | 16 +-
.../src/vite-plugin.ts} | 6 +-
.../tsconfig.build.json | 0
.../tsconfig.json | 4 +-
.../tsup.config.ts | 4 +-
packages/zero-runtime/src/css.js | 5 -
packages/zero-runtime/src/keyframes.js | 5 -
.../tests/fixtures/styled.output.css | 6 -
.../tests/fixtures/styled.output.js | 17 -
pnpm-lock.yaml | 280 +++++++-------
...untime-license.mjs => pigment-license.mjs} | 0
tsconfig.json | 14 +-
webpackBaseConfig.js | 2 +-
145 files changed, 525 insertions(+), 535 deletions(-)
rename apps/{zero-runtime-next-app => pigment-next-app}/.eslintrc (100%)
rename apps/{zero-runtime-next-app => pigment-next-app}/.gitignore (100%)
rename apps/{zero-runtime-next-app => pigment-next-app}/README.md (78%)
rename apps/{zero-runtime-next-app => pigment-next-app}/next.config.js (92%)
rename apps/{zero-runtime-next-app => pigment-next-app}/package.json (81%)
rename apps/{zero-runtime-next-app => pigment-next-app}/public/next.svg (100%)
rename apps/{zero-runtime-next-app => pigment-next-app}/public/vercel.svg (100%)
rename apps/{zero-runtime-next-app => pigment-next-app}/src/app/box/page.tsx (97%)
rename apps/{zero-runtime-next-app => pigment-next-app}/src/app/favicon.ico (100%)
rename apps/{zero-runtime-next-app => pigment-next-app}/src/app/globals.css (100%)
rename apps/{zero-runtime-next-app => pigment-next-app}/src/app/layout.tsx (95%)
rename apps/{zero-runtime-next-app => pigment-next-app}/src/app/material-ui/layout.tsx (95%)
rename apps/{zero-runtime-next-app => pigment-next-app}/src/app/material-ui/react-avatar/page.tsx (100%)
rename apps/{zero-runtime-next-app => pigment-next-app}/src/app/page.module.css (100%)
rename apps/{zero-runtime-next-app => pigment-next-app}/src/app/page.tsx (98%)
rename apps/{zero-runtime-next-app => pigment-next-app}/src/app/slider/page.tsx (98%)
rename apps/{zero-runtime-next-app => pigment-next-app}/src/app/theme.ts (100%)
rename apps/{zero-runtime-next-app => pigment-next-app}/src/augment.d.ts (86%)
rename apps/{zero-runtime-vite-app/src => pigment-next-app/src/components}/Box.jsx (96%)
rename apps/{zero-runtime-next-app => pigment-next-app}/src/components/Slider/ZeroSlider.tsx (99%)
rename apps/{zero-runtime-next-app => pigment-next-app}/tsconfig.json (93%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/.eslintrc (100%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/.gitignore (100%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/README.md (89%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/index.html (100%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/package.json (89%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/postcss.config.cjs (100%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/src/App.tsx (98%)
rename apps/{zero-runtime-next-app/src/components => pigment-vite-app/src}/Box.jsx (96%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/src/Layout.tsx (95%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/src/Slider/ZeroSlider.test.jsx (100%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/src/Slider/ZeroSlider.tsx (99%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/src/augment.ts (83%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/src/component.tsx (71%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/src/extend-zero.ts (89%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/src/main.tsx (95%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/src/pages/index.tsx (100%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/src/pages/material-ui/react-avatar.tsx (100%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/tsconfig.json (86%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/vite-env.d.ts (100%)
rename apps/{zero-runtime-vite-app => pigment-vite-app}/vite.config.ts (94%)
rename packages/{zero-next-plugin => pigment-nextjs-plugin}/.eslintrc (100%)
rename packages/{zero-next-plugin => pigment-nextjs-plugin}/.gitignore (100%)
rename packages/{zero-next-plugin => pigment-nextjs-plugin}/loader.js (100%)
rename packages/{zero-next-plugin => pigment-nextjs-plugin}/next-font.js (100%)
rename packages/{zero-next-plugin => pigment-nextjs-plugin}/next-image.js (100%)
rename packages/{zero-next-plugin => pigment-nextjs-plugin}/package.json (78%)
rename packages/{zero-next-plugin => pigment-nextjs-plugin}/src/index.ts (86%)
rename packages/{zero-next-plugin => pigment-nextjs-plugin}/src/virtual-css-loader.js (100%)
rename packages/{zero-next-plugin => pigment-nextjs-plugin}/tsconfig.build.json (100%)
rename packages/{zero-next-plugin => pigment-nextjs-plugin}/tsconfig.json (100%)
rename packages/{zero-next-plugin => pigment-nextjs-plugin}/tsup.config.ts (100%)
rename packages/{zero-next-plugin => pigment-nextjs-plugin}/zero-virtual.css (100%)
rename packages/{zero-runtime => pigment-react}/.eslintignore (100%)
rename packages/{zero-runtime => pigment-react}/.eslintrc (100%)
rename packages/{zero-runtime => pigment-react}/.gitignore (100%)
rename packages/{zero-runtime => pigment-react}/README.md (86%)
rename packages/{zero-runtime => pigment-react}/exports/createUseThemeProps.js (100%)
rename packages/{zero-runtime => pigment-react}/exports/css.js (100%)
rename packages/{zero-runtime => pigment-react}/exports/generateAtomics.js (100%)
rename packages/{zero-runtime => pigment-react}/exports/keyframes.js (100%)
rename packages/{zero-runtime => pigment-react}/exports/styled.js (100%)
rename packages/{zero-runtime => pigment-react}/exports/sx-plugin.js (100%)
rename packages/{zero-runtime => pigment-react}/exports/sx.js (100%)
rename packages/{zero-runtime => pigment-react}/package.json (92%)
rename packages/{zero-runtime => pigment-react}/src/base.d.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/createUseThemeProps.d.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/createUseThemeProps.js (100%)
rename packages/{zero-runtime => pigment-react}/src/css.d.ts (100%)
create mode 100644 packages/pigment-react/src/css.js
rename packages/{zero-runtime => pigment-react}/src/generateAtomics.d.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/generateAtomics.js (85%)
rename packages/{zero-runtime => pigment-react}/src/index.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/keyframes.d.ts (100%)
create mode 100644 packages/pigment-react/src/keyframes.js
rename packages/{zero-runtime => pigment-react}/src/processors/base-processor.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/processors/createUseThemeProps.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/processors/css.ts (99%)
rename packages/{zero-runtime => pigment-react}/src/processors/generateAtomics.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/processors/keyframes.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/processors/styled.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/processors/sx.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/styled.d.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/styled.jsx (100%)
rename packages/{zero-runtime => pigment-react}/src/sx.d.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/sx.js (100%)
rename packages/{zero-runtime => pigment-react}/src/theme.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/utils/checkStaticObjectOrArray.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/utils/convertAtomicsToCss.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/utils/cssFnValueToVariable.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/utils/cssFunctionTransformerPlugin.ts (96%)
rename packages/{zero-runtime => pigment-react}/src/utils/emotion.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/utils/extendTheme.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/utils/generateCss.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/utils/index.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/utils/isUnitLess.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/utils/pre-linaria-plugin.ts (98%)
rename packages/{zero-runtime => pigment-react}/src/utils/preprocessor.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/utils/processCssObject.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/utils/sxObjectExtractor.ts (100%)
rename packages/{zero-runtime => pigment-react}/src/utils/valueToLiteral.ts (100%)
rename packages/{zero-runtime => pigment-react}/styles.css (100%)
rename packages/{zero-runtime => pigment-react}/tests/README.md (100%)
rename packages/{zero-runtime => pigment-react}/tests/fixtures/styled.input.js (92%)
create mode 100644 packages/pigment-react/tests/fixtures/styled.output.css
create mode 100644 packages/pigment-react/tests/fixtures/styled.output.js
rename packages/{zero-runtime/tests/zero-runtime.test.js => pigment-react/tests/pigment.test.ts} (97%)
rename packages/{zero-runtime => pigment-react}/theme/index.d.ts (100%)
rename packages/{zero-runtime => pigment-react}/theme/index.js (100%)
rename packages/{zero-runtime => pigment-react}/theme/index.mjs (100%)
rename packages/{zero-runtime => pigment-react}/tsconfig.build.json (100%)
rename packages/{zero-runtime => pigment-react}/tsconfig.json (100%)
rename packages/{zero-runtime => pigment-react}/tsup.config.ts (100%)
rename packages/{zero-unplugin => pigment-unplugin}/.gitignore (100%)
rename packages/{zero-unplugin => pigment-unplugin}/package.json (75%)
rename packages/{zero-unplugin => pigment-unplugin}/src/index.ts (92%)
rename packages/{zero-unplugin => pigment-unplugin}/tsconfig.build.json (100%)
rename packages/{zero-unplugin => pigment-unplugin}/tsconfig.json (79%)
rename packages/{zero-unplugin => pigment-unplugin}/tsup.config.ts (81%)
rename packages/{zero-vite-plugin => pigment-vite-plugin}/.gitignore (100%)
rename packages/{zero-vite-plugin => pigment-vite-plugin}/package.json (79%)
rename packages/{zero-vite-plugin => pigment-vite-plugin}/src/index.ts (85%)
rename packages/{zero-vite-plugin/src/zero-vite-plugin.ts => pigment-vite-plugin/src/vite-plugin.ts} (97%)
rename packages/{zero-vite-plugin => pigment-vite-plugin}/tsconfig.build.json (100%)
rename packages/{zero-vite-plugin => pigment-vite-plugin}/tsconfig.json (77%)
rename packages/{zero-vite-plugin => pigment-vite-plugin}/tsup.config.ts (76%)
delete mode 100644 packages/zero-runtime/src/css.js
delete mode 100644 packages/zero-runtime/src/keyframes.js
delete mode 100644 packages/zero-runtime/tests/fixtures/styled.output.css
delete mode 100644 packages/zero-runtime/tests/fixtures/styled.output.js
rename scripts/{zero-runtime-license.mjs => pigment-license.mjs} (100%)
diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json
index d19d051a72b16a..7d03e0dee7362d 100644
--- a/.codesandbox/ci.json
+++ b/.codesandbox/ci.json
@@ -23,10 +23,10 @@
"packages/mui-types",
"packages/mui-utils",
"packages-internal/scripts",
- "packages/zero-runtime",
- "packages/zero-unplugin",
- "packages/zero-vite-plugin",
- "packages/zero-next-plugin"
+ "packages/pigment-react",
+ "packages/pigment-unplugin",
+ "packages/pigment-vite-plugin",
+ "packages/pigment-nextjs-plugin"
],
"publishDirectory": {
"@mui/base": "packages/mui-base/build",
@@ -49,10 +49,10 @@
"@mui/types": "packages/mui-types/build",
"@mui/utils": "packages/mui-utils/build",
"@mui-internal/docs-utils": "packages/docs-utils",
- "@mui/zero-runtime": "packages/zero-runtime",
- "@mui/zero-unplugin": "packages/zero-unplugin",
- "@mui/zero-vite-plugin": "packages/zero-vite-plugin",
- "@mui/zero-next-plugin": "packages/zero-next-plugin"
+ "@pigmentcss/react": "packages/pigment-react",
+ "@pigmentcss/unplugin": "packages/pigment-unplugin",
+ "@pigmentcss/vite-plugin": "packages/pigment-vite-plugin",
+ "@pigmentcss/nextjs-plugin": "packages/pigment-nextjs-plugin"
},
"sandboxes": [
"/examples/material-ui-cra-ts",
diff --git a/.eslintignore b/.eslintignore
index d6b5b184b02ed5..40b0fcc4a9fce1 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -19,12 +19,12 @@
/packages/mui-icons-material/src/*.js
/packages/mui-icons-material/templateSvgIcon.js
/packages/mui-utils/macros/__fixtures__/
-/packages/zero-runtime/utils/
-/packages/zero-runtime/processors/
-/packages/zero-runtime/exports/
-/packages/zero-runtime/theme/
-/packages/zero-runtime/tests/fixtures/
-/packages/zero-next-plugin/loader.js
+/packages/pigment-react/utils/
+/packages/pigment-react/processors/
+/packages/pigment-react/exports/
+/packages/pigment-react/theme/
+/packages/pigment-react/tests/fixtures/
+/packages/pigment-nextjs-plugin/loader.js
# Ignore fixtures
/packages-internal/scripts/typescript-to-proptypes/test/*/*
/test/bundling/fixtures/**/*.fixture.js
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9b18285a756dd9..7ff80ee5d1fb27 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1193,7 +1193,7 @@ A big thanks to the 17 contributors who made this release possible.
- Update peer dep of @mui/material (#39398) @brijeshb42
-### `@mui/zero-runtime@0.0.1-alpha.0`
+### `@pigmentcss/react@0.0.1-alpha.0`
- Implement typings for public runtime API (#39215) @brijeshb42
@@ -1794,7 +1794,7 @@ A big thanks to the 11 contributors who made this release possible. This release
- [useButton][base-ui] Accept arbitrary props in getRootProps and forward them (#38475) @DiegoAndai
-### `@mui/zero-runtime@0.0.1-alpha.1`
+### `@pigmentcss/react@0.0.1-alpha.1`
- [system][zero][tag] Add support for sx prop (#38535) @brijeshb42
@@ -1857,7 +1857,7 @@ A big thanks to the 21 contributors who made this release possible. Here are som
- [ButtonBase] Add ButtonBase component (#38319) @DiegoAndai
- [Input] Add InputBase component (#38392) @mj12albert
-### `@mui/zero-runtime@0.0.1-alpha.0`
+### `@pigmentcss/react@0.0.1-alpha.0`
- Implementation of styled tag processor for linaria (#38378) @brijeshb42
diff --git a/apps/local-ui-lib/index.js b/apps/local-ui-lib/index.js
index b0e3fbde00685d..6422c23c197a3c 100644
--- a/apps/local-ui-lib/index.js
+++ b/apps/local-ui-lib/index.js
@@ -1,4 +1,4 @@
-import { keyframes, styled } from '@mui/zero-runtime';
+import { keyframes, styled } from '@pigmentcss/react';
export const bounceAnim = keyframes({
'from, 20%, 53%, 80%, to': {
diff --git a/apps/local-ui-lib/package.json b/apps/local-ui-lib/package.json
index 29c71057b00b2a..8f9dbab3e96078 100644
--- a/apps/local-ui-lib/package.json
+++ b/apps/local-ui-lib/package.json
@@ -3,6 +3,6 @@
"version": "0.0.1",
"private": true,
"dependencies": {
- "@mui/zero-runtime": "file:../../packages/zero-runtime/build"
+ "@pigmentcss/react": "file:../../packages/pigment-react"
}
}
diff --git a/apps/local-ui-lib/tsconfig.json b/apps/local-ui-lib/tsconfig.json
index 0373760617c181..c876374fe985c9 100644
--- a/apps/local-ui-lib/tsconfig.json
+++ b/apps/local-ui-lib/tsconfig.json
@@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"references": [
{
- "path": "../../packages/zero-runtime"
+ "path": "../../packages/pigment-react"
}
]
}
diff --git a/apps/zero-runtime-next-app/.eslintrc b/apps/pigment-next-app/.eslintrc
similarity index 100%
rename from apps/zero-runtime-next-app/.eslintrc
rename to apps/pigment-next-app/.eslintrc
diff --git a/apps/zero-runtime-next-app/.gitignore b/apps/pigment-next-app/.gitignore
similarity index 100%
rename from apps/zero-runtime-next-app/.gitignore
rename to apps/pigment-next-app/.gitignore
diff --git a/apps/zero-runtime-next-app/README.md b/apps/pigment-next-app/README.md
similarity index 78%
rename from apps/zero-runtime-next-app/README.md
rename to apps/pigment-next-app/README.md
index a09af14685fd0b..c880e18615edf9 100644
--- a/apps/zero-runtime-next-app/README.md
+++ b/apps/pigment-next-app/README.md
@@ -20,11 +20,11 @@ Open [http://localhost:3000](http://localhost:3000) with your browser to see the
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
-If you see and error like package `@mui/zero-runtime` not found, add it as a peer-dependency in `@mui/material`'s `package.json` file and run `pnpm build` and `pnpm install` again. Make sure to not push this change to git.
+If you see and error like package `@pigmentcss/react` not found, add it as a peer-dependency in `@mui/material`'s `package.json` file and run `pnpm build` and `pnpm install` again. Make sure to not push this change to git.
### Note
-If you are testing changes in zero-runtime packages itself while also running this demo app, start the watch command in a separate terminal to watch and build zero-runtime package files as they change -
+If you are testing changes in pigmentcss packages itself while also running this demo app, start the watch command in a separate terminal to watch and build pigmentcss package files as they change -
```bash
pnpm watch:zero
diff --git a/apps/zero-runtime-next-app/next.config.js b/apps/pigment-next-app/next.config.js
similarity index 92%
rename from apps/zero-runtime-next-app/next.config.js
rename to apps/pigment-next-app/next.config.js
index f35ccc89f5d350..32ef7ccb1bb26b 100644
--- a/apps/zero-runtime-next-app/next.config.js
+++ b/apps/pigment-next-app/next.config.js
@@ -1,10 +1,10 @@
/* eslint-env node */
// eslint-ignore-next-line import/no-unresolved
-const { withZeroPlugin } = require('@mui/zero-next-plugin');
+const { withPigment } = require('@pigmentcss/nextjs-plugin');
const { experimental_extendTheme: extendTheme } = require('@mui/material/styles');
/**
- * @typedef {import('@mui/zero-next-plugin').ZeroPluginConfig} ZeroPluginConfig
+ * @typedef {import('@pigmentcss/nextjs-plugin').PigmentOptions} PigmentOptions
*/
const theme = extendTheme({
@@ -109,9 +109,9 @@ theme.generateCssVars = (colorScheme) => {
};
/**
- * @type {ZeroPluginConfig}
+ * @type {PigmentOptions}
*/
-const zeroPluginOptions = {
+const pigmentOptions = {
theme,
transformLibraries: ['local-ui-lib'],
sourceMap: true,
@@ -129,4 +129,4 @@ const nextConfig = {
},
};
-module.exports = withZeroPlugin(nextConfig, zeroPluginOptions);
+module.exports = withPigment(nextConfig, pigmentOptions);
diff --git a/apps/zero-runtime-next-app/package.json b/apps/pigment-next-app/package.json
similarity index 81%
rename from apps/zero-runtime-next-app/package.json
rename to apps/pigment-next-app/package.json
index 373eb292173033..ceae7353a5daea 100644
--- a/apps/zero-runtime-next-app/package.json
+++ b/apps/pigment-next-app/package.json
@@ -9,7 +9,7 @@
"clean": "rimraf .next"
},
"dependencies": {
- "@mui/zero-runtime": "file:../../packages/zero-runtime",
+ "@pigmentcss/react": "file:../../packages/pigment-react",
"@mui/utils": "file:../../packages/mui-utils/build",
"@mui/base": "file:../../packages/mui-base/build",
"@mui/material": "file:../../packages/mui-material/build",
@@ -23,8 +23,8 @@
"next": "latest"
},
"devDependencies": {
- "@mui/zero-unplugin": "file:../../packages/zero-unplugin",
- "@mui/zero-next-plugin": "file:../../packages/zero-next-plugin",
+ "@pigmentcss/unplugin": "file:../../packages/pigment-unplugin",
+ "@pigmentcss/nextjs-plugin": "file:../../packages/pigment-nextjs-plugin",
"@types/node": "^20.5.7",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
diff --git a/apps/zero-runtime-next-app/public/next.svg b/apps/pigment-next-app/public/next.svg
similarity index 100%
rename from apps/zero-runtime-next-app/public/next.svg
rename to apps/pigment-next-app/public/next.svg
diff --git a/apps/zero-runtime-next-app/public/vercel.svg b/apps/pigment-next-app/public/vercel.svg
similarity index 100%
rename from apps/zero-runtime-next-app/public/vercel.svg
rename to apps/pigment-next-app/public/vercel.svg
diff --git a/apps/zero-runtime-next-app/src/app/box/page.tsx b/apps/pigment-next-app/src/app/box/page.tsx
similarity index 97%
rename from apps/zero-runtime-next-app/src/app/box/page.tsx
rename to apps/pigment-next-app/src/app/box/page.tsx
index 6bd98764a28fb0..fb56ce056198d5 100644
--- a/apps/zero-runtime-next-app/src/app/box/page.tsx
+++ b/apps/pigment-next-app/src/app/box/page.tsx
@@ -1,6 +1,6 @@
/* eslint-disable material-ui/no-empty-box */
-import { styled } from '@mui/zero-runtime';
+import { styled } from '@pigmentcss/react';
import * as React from 'react';
import { Box as MuiBox } from '../../components/Box';
diff --git a/apps/zero-runtime-next-app/src/app/favicon.ico b/apps/pigment-next-app/src/app/favicon.ico
similarity index 100%
rename from apps/zero-runtime-next-app/src/app/favicon.ico
rename to apps/pigment-next-app/src/app/favicon.ico
diff --git a/apps/zero-runtime-next-app/src/app/globals.css b/apps/pigment-next-app/src/app/globals.css
similarity index 100%
rename from apps/zero-runtime-next-app/src/app/globals.css
rename to apps/pigment-next-app/src/app/globals.css
diff --git a/apps/zero-runtime-next-app/src/app/layout.tsx b/apps/pigment-next-app/src/app/layout.tsx
similarity index 95%
rename from apps/zero-runtime-next-app/src/app/layout.tsx
rename to apps/pigment-next-app/src/app/layout.tsx
index c1b2026d353659..01f8c34afd4e9e 100644
--- a/apps/zero-runtime-next-app/src/app/layout.tsx
+++ b/apps/pigment-next-app/src/app/layout.tsx
@@ -3,7 +3,7 @@ import { Inter } from 'next/font/google';
import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter';
import { ThemeProvider } from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
-import '@mui/zero-runtime/styles.css';
+import '@pigmentcss/react/styles.css';
import theme from './theme';
import './globals.css';
diff --git a/apps/zero-runtime-next-app/src/app/material-ui/layout.tsx b/apps/pigment-next-app/src/app/material-ui/layout.tsx
similarity index 95%
rename from apps/zero-runtime-next-app/src/app/material-ui/layout.tsx
rename to apps/pigment-next-app/src/app/material-ui/layout.tsx
index da7a4c28b7beb9..92f476c84477c5 100644
--- a/apps/zero-runtime-next-app/src/app/material-ui/layout.tsx
+++ b/apps/pigment-next-app/src/app/material-ui/layout.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { styled } from '@mui/zero-runtime';
+import { styled } from '@pigmentcss/react';
const Main = styled('div')(({ theme }) => ({
display: 'flex',
diff --git a/apps/zero-runtime-next-app/src/app/material-ui/react-avatar/page.tsx b/apps/pigment-next-app/src/app/material-ui/react-avatar/page.tsx
similarity index 100%
rename from apps/zero-runtime-next-app/src/app/material-ui/react-avatar/page.tsx
rename to apps/pigment-next-app/src/app/material-ui/react-avatar/page.tsx
diff --git a/apps/zero-runtime-next-app/src/app/page.module.css b/apps/pigment-next-app/src/app/page.module.css
similarity index 100%
rename from apps/zero-runtime-next-app/src/app/page.module.css
rename to apps/pigment-next-app/src/app/page.module.css
diff --git a/apps/zero-runtime-next-app/src/app/page.tsx b/apps/pigment-next-app/src/app/page.tsx
similarity index 98%
rename from apps/zero-runtime-next-app/src/app/page.tsx
rename to apps/pigment-next-app/src/app/page.tsx
index e0fcee40f2b8d0..76668cda213da1 100644
--- a/apps/zero-runtime-next-app/src/app/page.tsx
+++ b/apps/pigment-next-app/src/app/page.tsx
@@ -1,5 +1,5 @@
import Image from 'next/image';
-import { styled, css } from '@mui/zero-runtime';
+import { styled, css } from '@pigmentcss/react';
import styles from './page.module.css';
const visuallyHidden = css({
diff --git a/apps/zero-runtime-next-app/src/app/slider/page.tsx b/apps/pigment-next-app/src/app/slider/page.tsx
similarity index 98%
rename from apps/zero-runtime-next-app/src/app/slider/page.tsx
rename to apps/pigment-next-app/src/app/slider/page.tsx
index 1c2a9b735bf559..c4db9973689ec8 100644
--- a/apps/zero-runtime-next-app/src/app/slider/page.tsx
+++ b/apps/pigment-next-app/src/app/slider/page.tsx
@@ -1,6 +1,6 @@
'use client';
import * as React from 'react';
-import { styled } from '@mui/zero-runtime';
+import { styled } from '@pigmentcss/react';
import { Button } from 'local-ui-lib';
import Slider from '@/components/Slider/ZeroSlider';
diff --git a/apps/zero-runtime-next-app/src/app/theme.ts b/apps/pigment-next-app/src/app/theme.ts
similarity index 100%
rename from apps/zero-runtime-next-app/src/app/theme.ts
rename to apps/pigment-next-app/src/app/theme.ts
diff --git a/apps/zero-runtime-next-app/src/augment.d.ts b/apps/pigment-next-app/src/augment.d.ts
similarity index 86%
rename from apps/zero-runtime-next-app/src/augment.d.ts
rename to apps/pigment-next-app/src/augment.d.ts
index 21e002967fcc36..2fbc8851cf8eba 100644
--- a/apps/zero-runtime-next-app/src/augment.d.ts
+++ b/apps/pigment-next-app/src/augment.d.ts
@@ -1,6 +1,6 @@
-import type { ExtendTheme } from '@mui/zero-runtime';
+import type { ExtendTheme } from '@pigmentcss/react';
-declare module '@mui/zero-runtime/theme' {
+declare module '@pigmentcss/react/theme' {
interface ThemeTokens {
'max-width': string;
'border-radius': string;
diff --git a/apps/zero-runtime-vite-app/src/Box.jsx b/apps/pigment-next-app/src/components/Box.jsx
similarity index 96%
rename from apps/zero-runtime-vite-app/src/Box.jsx
rename to apps/pigment-next-app/src/components/Box.jsx
index a6c66c96cf6bbb..938492ee6f5903 100644
--- a/apps/zero-runtime-vite-app/src/Box.jsx
+++ b/apps/pigment-next-app/src/components/Box.jsx
@@ -1,4 +1,4 @@
-import { generateAtomics } from '@mui/zero-runtime';
+import { generateAtomics } from '@pigmentcss/react';
const atomics = generateAtomics(({ theme }) => ({
conditions: Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {
diff --git a/apps/zero-runtime-next-app/src/components/Slider/ZeroSlider.tsx b/apps/pigment-next-app/src/components/Slider/ZeroSlider.tsx
similarity index 99%
rename from apps/zero-runtime-next-app/src/components/Slider/ZeroSlider.tsx
rename to apps/pigment-next-app/src/components/Slider/ZeroSlider.tsx
index 3f193c182caf6a..ac3757a241d1de 100644
--- a/apps/zero-runtime-next-app/src/components/Slider/ZeroSlider.tsx
+++ b/apps/pigment-next-app/src/components/Slider/ZeroSlider.tsx
@@ -8,7 +8,7 @@ import {
getSliderUtilityClass,
} from '@mui/material/Slider';
import { isHostComponent, useSlotProps } from '@mui/base/utils';
-import { styled } from '@mui/zero-runtime';
+import { styled } from '@pigmentcss/react';
import { capitalize } from '@mui/material/utils';
import SliderValueLabel from '@mui/material/Slider/SliderValueLabel';
import { useSlider, valueToPercent } from '@mui/base/useSlider';
diff --git a/apps/zero-runtime-next-app/tsconfig.json b/apps/pigment-next-app/tsconfig.json
similarity index 93%
rename from apps/zero-runtime-next-app/tsconfig.json
rename to apps/pigment-next-app/tsconfig.json
index d11ca0046190ee..7f52bcf9932c64 100644
--- a/apps/zero-runtime-next-app/tsconfig.json
+++ b/apps/pigment-next-app/tsconfig.json
@@ -35,7 +35,7 @@
"path": "../../packages/mui-material/tsconfig.build.json"
},
{
- "path": "../../packages/zero-runtime/tsconfig.json"
+ "path": "../../packages/pigment-react/tsconfig.json"
}
]
}
diff --git a/apps/zero-runtime-vite-app/.eslintrc b/apps/pigment-vite-app/.eslintrc
similarity index 100%
rename from apps/zero-runtime-vite-app/.eslintrc
rename to apps/pigment-vite-app/.eslintrc
diff --git a/apps/zero-runtime-vite-app/.gitignore b/apps/pigment-vite-app/.gitignore
similarity index 100%
rename from apps/zero-runtime-vite-app/.gitignore
rename to apps/pigment-vite-app/.gitignore
diff --git a/apps/zero-runtime-vite-app/README.md b/apps/pigment-vite-app/README.md
similarity index 89%
rename from apps/zero-runtime-vite-app/README.md
rename to apps/pigment-vite-app/README.md
index 706d0218f71537..891a06e2509823 100644
--- a/apps/zero-runtime-vite-app/README.md
+++ b/apps/pigment-vite-app/README.md
@@ -7,8 +7,8 @@ This project is not part of the workspace yet.
You can either run `pnpm build` command to build all the packages, or you need to build, the the minimum -
-1. `@mui/zero-runtime`
-2. `@mui/zero-vite-plugin`
+1. `@pigmentcss/react`
+2. `@pigmentcss/vite-plugin`
Make sure you have also run `pnpm release:build` at least once because we also use `@mui/material` and `@mui/system` packages. On subsequent runs, you can only build the above packages using -
@@ -24,4 +24,4 @@ After building, you can run the project by changing into the directory and then
Optionally, before running the dev server, you can run `pnpm vite optimize --force` if it logged some error during `pnpm vite`.
-If you see and error like package `@mui/zero-runtime` not found, add it as a peer-dependency in `@mui/material`'s `package.json` file and run `pnpm build` and `pnpm install` again. Make sure to not push this change to git.
+If you see and error like package `@pigmentcss/react` not found, add it as a peer-dependency in `@mui/material`'s `package.json` file and run `pnpm build` and `pnpm install` again. Make sure to not push this change to git.
diff --git a/apps/zero-runtime-vite-app/index.html b/apps/pigment-vite-app/index.html
similarity index 100%
rename from apps/zero-runtime-vite-app/index.html
rename to apps/pigment-vite-app/index.html
diff --git a/apps/zero-runtime-vite-app/package.json b/apps/pigment-vite-app/package.json
similarity index 89%
rename from apps/zero-runtime-vite-app/package.json
rename to apps/pigment-vite-app/package.json
index 9ebbe20d30f633..7499c0a565f8a0 100644
--- a/apps/zero-runtime-vite-app/package.json
+++ b/apps/pigment-vite-app/package.json
@@ -9,7 +9,7 @@
"build": "vite build"
},
"dependencies": {
- "@mui/zero-runtime": "file:../../packages/zero-runtime",
+ "@pigmentcss/react": "file:../../packages/pigment-react",
"@mui/utils": "file:../../packages/mui-utils/build",
"@mui/base": "file:../../packages/mui-base/build",
"@mui/material": "file:../../packages/mui-material/build",
@@ -27,7 +27,7 @@
"@babel/preset-env": "^7.23.9",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
- "@mui/zero-vite-plugin": "file:../../packages/zero-vite-plugin",
+ "@pigmentcss/vite-plugin": "file:../../packages/pigment-vite-plugin",
"@types/react": "^18.2.55",
"@types/react-dom": "^18.2.19",
"@vitejs/plugin-react": "^4.2.1",
diff --git a/apps/zero-runtime-vite-app/postcss.config.cjs b/apps/pigment-vite-app/postcss.config.cjs
similarity index 100%
rename from apps/zero-runtime-vite-app/postcss.config.cjs
rename to apps/pigment-vite-app/postcss.config.cjs
diff --git a/apps/zero-runtime-vite-app/src/App.tsx b/apps/pigment-vite-app/src/App.tsx
similarity index 98%
rename from apps/zero-runtime-vite-app/src/App.tsx
rename to apps/pigment-vite-app/src/App.tsx
index c930d8e796fbba..6bfbb8e4930c56 100644
--- a/apps/zero-runtime-vite-app/src/App.tsx
+++ b/apps/pigment-vite-app/src/App.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { styled, generateAtomics } from '@mui/zero-runtime';
+import { styled, generateAtomics } from '@pigmentcss/react';
import type { Breakpoint } from '@mui/system';
import { Button, bounceAnim } from 'local-ui-lib';
import Slider from './Slider/ZeroSlider';
diff --git a/apps/zero-runtime-next-app/src/components/Box.jsx b/apps/pigment-vite-app/src/Box.jsx
similarity index 96%
rename from apps/zero-runtime-next-app/src/components/Box.jsx
rename to apps/pigment-vite-app/src/Box.jsx
index a6c66c96cf6bbb..938492ee6f5903 100644
--- a/apps/zero-runtime-next-app/src/components/Box.jsx
+++ b/apps/pigment-vite-app/src/Box.jsx
@@ -1,4 +1,4 @@
-import { generateAtomics } from '@mui/zero-runtime';
+import { generateAtomics } from '@pigmentcss/react';
const atomics = generateAtomics(({ theme }) => ({
conditions: Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {
diff --git a/apps/zero-runtime-vite-app/src/Layout.tsx b/apps/pigment-vite-app/src/Layout.tsx
similarity index 95%
rename from apps/zero-runtime-vite-app/src/Layout.tsx
rename to apps/pigment-vite-app/src/Layout.tsx
index da7a4c28b7beb9..92f476c84477c5 100644
--- a/apps/zero-runtime-vite-app/src/Layout.tsx
+++ b/apps/pigment-vite-app/src/Layout.tsx
@@ -1,5 +1,5 @@
import * as React from 'react';
-import { styled } from '@mui/zero-runtime';
+import { styled } from '@pigmentcss/react';
const Main = styled('div')(({ theme }) => ({
display: 'flex',
diff --git a/apps/zero-runtime-vite-app/src/Slider/ZeroSlider.test.jsx b/apps/pigment-vite-app/src/Slider/ZeroSlider.test.jsx
similarity index 100%
rename from apps/zero-runtime-vite-app/src/Slider/ZeroSlider.test.jsx
rename to apps/pigment-vite-app/src/Slider/ZeroSlider.test.jsx
diff --git a/apps/zero-runtime-vite-app/src/Slider/ZeroSlider.tsx b/apps/pigment-vite-app/src/Slider/ZeroSlider.tsx
similarity index 99%
rename from apps/zero-runtime-vite-app/src/Slider/ZeroSlider.tsx
rename to apps/pigment-vite-app/src/Slider/ZeroSlider.tsx
index 124c21164655ab..312b53791a82bb 100644
--- a/apps/zero-runtime-vite-app/src/Slider/ZeroSlider.tsx
+++ b/apps/pigment-vite-app/src/Slider/ZeroSlider.tsx
@@ -8,7 +8,7 @@ import {
getSliderUtilityClass,
} from '@mui/material/Slider';
import { isHostComponent, useSlotProps } from '@mui/base/utils';
-import { styled } from '@mui/zero-runtime';
+import { styled } from '@pigmentcss/react';
import { capitalize } from '@mui/material/utils';
import SliderValueLabel from '@mui/material/Slider/SliderValueLabel';
import { useSlider, valueToPercent } from '@mui/base/useSlider';
diff --git a/apps/zero-runtime-vite-app/src/augment.ts b/apps/pigment-vite-app/src/augment.ts
similarity index 83%
rename from apps/zero-runtime-vite-app/src/augment.ts
rename to apps/pigment-vite-app/src/augment.ts
index 42f4ad0592d61a..cdad20e18f18f4 100644
--- a/apps/zero-runtime-vite-app/src/augment.ts
+++ b/apps/pigment-vite-app/src/augment.ts
@@ -1,7 +1,7 @@
import type { experimental_extendTheme } from '@mui/material/styles';
-import '@mui/zero-runtime/theme';
+import '@pigmentcss/react/theme';
-declare module '@mui/zero-runtime/theme' {
+declare module '@pigmentcss/react/theme' {
export interface ThemeArgs {
theme: ReturnType & {
applyDarkStyles(obj: T): Record;
diff --git a/apps/zero-runtime-vite-app/src/component.tsx b/apps/pigment-vite-app/src/component.tsx
similarity index 71%
rename from apps/zero-runtime-vite-app/src/component.tsx
rename to apps/pigment-vite-app/src/component.tsx
index 1da254676d8cf1..1574ffb134df88 100644
--- a/apps/zero-runtime-vite-app/src/component.tsx
+++ b/apps/pigment-vite-app/src/component.tsx
@@ -1,4 +1,4 @@
-import { styled } from '@mui/zero-runtime';
+import { styled } from '@pigmentcss/react';
export function Component() {
return null;
diff --git a/apps/zero-runtime-vite-app/src/extend-zero.ts b/apps/pigment-vite-app/src/extend-zero.ts
similarity index 89%
rename from apps/zero-runtime-vite-app/src/extend-zero.ts
rename to apps/pigment-vite-app/src/extend-zero.ts
index df034059d1de21..578bffe1d1dfe5 100644
--- a/apps/zero-runtime-vite-app/src/extend-zero.ts
+++ b/apps/pigment-vite-app/src/extend-zero.ts
@@ -1,6 +1,6 @@
import type { experimental_extendTheme } from '@mui/material/styles';
-declare module '@mui/zero-runtime/theme' {
+declare module '@pigmentcss/react/theme' {
interface ThemeArgs {
theme: ReturnType & {
applyDarkStyles(obj: T): Record;
diff --git a/apps/zero-runtime-vite-app/src/main.tsx b/apps/pigment-vite-app/src/main.tsx
similarity index 95%
rename from apps/zero-runtime-vite-app/src/main.tsx
rename to apps/pigment-vite-app/src/main.tsx
index 7a205582108963..96bdf75f62712a 100644
--- a/apps/zero-runtime-vite-app/src/main.tsx
+++ b/apps/pigment-vite-app/src/main.tsx
@@ -4,7 +4,7 @@ import { BrowserRouter as Router, useRoutes } from 'react-router-dom';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import routes from '~react-pages';
-import '@mui/zero-runtime/styles.css';
+import '@pigmentcss/react/styles.css';
function App() {
return Loading...
}>{useRoutes(routes)};
diff --git a/apps/zero-runtime-vite-app/src/pages/index.tsx b/apps/pigment-vite-app/src/pages/index.tsx
similarity index 100%
rename from apps/zero-runtime-vite-app/src/pages/index.tsx
rename to apps/pigment-vite-app/src/pages/index.tsx
diff --git a/apps/zero-runtime-vite-app/src/pages/material-ui/react-avatar.tsx b/apps/pigment-vite-app/src/pages/material-ui/react-avatar.tsx
similarity index 100%
rename from apps/zero-runtime-vite-app/src/pages/material-ui/react-avatar.tsx
rename to apps/pigment-vite-app/src/pages/material-ui/react-avatar.tsx
diff --git a/apps/zero-runtime-vite-app/tsconfig.json b/apps/pigment-vite-app/tsconfig.json
similarity index 86%
rename from apps/zero-runtime-vite-app/tsconfig.json
rename to apps/pigment-vite-app/tsconfig.json
index 0f7af61f85477d..3ac8cebf99a277 100644
--- a/apps/zero-runtime-vite-app/tsconfig.json
+++ b/apps/pigment-vite-app/tsconfig.json
@@ -15,7 +15,7 @@
"path": "../../packages/mui-material/tsconfig.build.json"
},
{
- "path": "../../packages/zero-runtime/tsconfig.json"
+ "path": "../../packages/pigment-react/tsconfig.json"
}
]
}
diff --git a/apps/zero-runtime-vite-app/vite-env.d.ts b/apps/pigment-vite-app/vite-env.d.ts
similarity index 100%
rename from apps/zero-runtime-vite-app/vite-env.d.ts
rename to apps/pigment-vite-app/vite-env.d.ts
diff --git a/apps/zero-runtime-vite-app/vite.config.ts b/apps/pigment-vite-app/vite.config.ts
similarity index 94%
rename from apps/zero-runtime-vite-app/vite.config.ts
rename to apps/pigment-vite-app/vite.config.ts
index c38390321d2262..b60ca64ba31f9b 100644
--- a/apps/zero-runtime-vite-app/vite.config.ts
+++ b/apps/pigment-vite-app/vite.config.ts
@@ -1,7 +1,7 @@
import { defineConfig, splitVendorChunkPlugin } from 'vite';
import reactPlugin from '@vitejs/plugin-react';
import Pages from 'vite-plugin-pages';
-import { zeroVitePlugin as zeroPlugin } from '@mui/zero-vite-plugin';
+import { pigment } from '@pigmentcss/vite-plugin';
import { experimental_extendTheme as extendTheme } from '@mui/material/styles';
const theme = extendTheme();
@@ -34,7 +34,7 @@ theme.generateCssVars = (colorScheme) => {
export default defineConfig({
plugins: [
reactPlugin({ include: /\.(mdx|js|jsx|ts|tsx)$/ }),
- zeroPlugin({
+ pigment({
theme,
transformLibraries: ['local-ui-lib', '@mui/material'],
sourceMap: true,
diff --git a/apps/pnpm-lock.yaml b/apps/pnpm-lock.yaml
index ca038f7aa8cd99..eda05ad8846c0f 100644
--- a/apps/pnpm-lock.yaml
+++ b/apps/pnpm-lock.yaml
@@ -55,8 +55,8 @@ importers:
specifier: ^4.14.202
version: 4.14.202
'@types/node':
- specifier: ^18.19.15
- version: 18.19.18
+ specifier: ^18.19.19
+ version: 18.19.20
'@types/prettier':
specifier: ^2.7.3
version: 2.7.3
@@ -116,8 +116,8 @@ importers:
specifier: ^10.0.6
version: 10.0.6
'@types/node':
- specifier: ^18.19.15
- version: 18.19.18
+ specifier: ^18.19.19
+ version: 18.19.20
babel-plugin-tester:
specifier: ^11.0.4
version: 11.0.4(@babel/core@7.23.9)
@@ -262,8 +262,8 @@ importers:
version: 15.8.1
devDependencies:
'@types/node':
- specifier: ^18.19.10
- version: 18.19.18
+ specifier: ^18.19.19
+ version: 18.19.20
'@types/prop-types':
specifier: ^15.7.11
version: 15.7.11
@@ -1059,8 +1059,8 @@ importers:
specifier: ^10.0.6
version: 10.0.6
'@types/node':
- specifier: ^18.19.15
- version: 18.19.18
+ specifier: ^18.19.19
+ version: 18.19.20
'@types/react':
specifier: ^18.2.55
version: 18.2.55
@@ -1087,125 +1087,17 @@ importers:
version: 15.2.0
publishDirectory: build
- ../packages/test-utils:
+ ../packages/pigment-nextjs-plugin:
dependencies:
- '@babel/plugin-transform-modules-commonjs':
- specifier: ^7.23.3
- version: 7.23.3(@babel/core@7.23.9)
- '@babel/preset-typescript':
- specifier: ^7.23.3
- version: 7.23.3(@babel/core@7.23.9)
- '@babel/register':
- specifier: ^7.23.7
- version: 7.23.7(@babel/core@7.23.9)
- '@babel/runtime':
- specifier: ^7.23.9
- version: 7.23.9
- '@emotion/cache':
- specifier: ^11.11.0
- version: 11.11.0
- '@emotion/react':
- specifier: ^11.11.3
- version: 11.11.3(@types/react@18.2.55)(react@18.2.0)
- '@mnajdova/enzyme-adapter-react-18':
- specifier: ^0.2.0
- version: 0.2.0(enzyme@3.11.0)(react-dom@18.2.0)(react@18.2.0)
- '@testing-library/dom':
- specifier: ^9.3.4
- version: 9.3.4
- '@testing-library/react':
- specifier: ^14.2.1
- version: 14.2.1(react-dom@18.2.0)(react@18.2.0)
- chai:
- specifier: ^4.4.1
- version: 4.4.1
- chai-dom:
- specifier: ^1.12.0
- version: 1.12.0(chai@4.4.1)
- dom-accessibility-api:
- specifier: ^0.6.3
- version: 0.6.3
- enzyme:
- specifier: ^3.11.0
- version: 3.11.0
- format-util:
- specifier: ^1.0.5
- version: 1.0.5
- fs-extra:
- specifier: ^11.2.0
- version: 11.2.0
- jsdom:
- specifier: ^24.0.0
- version: 24.0.0
- lodash:
- specifier: ^4.17.21
- version: 4.17.21
- mocha:
- specifier: ^10.2.0
- version: 10.3.0
- playwright:
- specifier: ^1.41.2
- version: 1.41.2
- prop-types:
- specifier: ^15.8.1
- version: 15.8.1
- react:
- specifier: ^18.2.0
- version: 18.2.0
- react-dom:
- specifier: ^18.2.0
- version: 18.2.0(react@18.2.0)
- react-test-renderer:
- specifier: ^18.2.0
- version: 18.2.0(react@18.2.0)
- sinon:
- specifier: ^15.2.0
- version: 15.2.0
- devDependencies:
- '@types/chai':
- specifier: ^4.3.11
- version: 4.3.12
- '@types/chai-dom':
- specifier: ^1.11.3
- version: 1.11.3
- '@types/enzyme':
- specifier: ^3.10.18
- version: 3.10.18
- '@types/format-util':
- specifier: ^1.0.4
- version: 1.0.4
- '@types/prop-types':
- specifier: ^15.7.11
- version: 15.7.11
- '@types/react':
- specifier: ^18.2.55
- version: 18.2.55
- '@types/react-dom':
- specifier: ^18.2.19
- version: 18.2.19
- '@types/react-test-renderer':
- specifier: ^18.0.7
- version: 18.0.7
- '@types/sinon':
- specifier: ^10.0.20
- version: 10.0.20
- typescript:
- specifier: ^5.3.3
- version: 5.3.3
-
- ../packages/waterfall: {}
-
- ../packages/zero-next-plugin:
- dependencies:
- '@mui/zero-unplugin':
+ '@pigmentcss/unplugin':
specifier: workspace:^
- version: link:../zero-unplugin
+ version: link:../pigment-unplugin
devDependencies:
next:
specifier: ^13.5.1
version: 13.5.1(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0)
- ../packages/zero-runtime:
+ ../packages/pigment-react:
dependencies:
'@babel/core':
specifier: ^7.23.9
@@ -1278,8 +1170,8 @@ importers:
specifier: ^4.14.202
version: 4.14.202
'@types/node':
- specifier: ^18.19.15
- version: 18.19.18
+ specifier: ^18.19.19
+ version: 18.19.20
'@types/react':
specifier: ^18.2.55
version: 18.2.55
@@ -1293,14 +1185,14 @@ importers:
specifier: ^18.2.0
version: 18.2.0
- ../packages/zero-unplugin:
+ ../packages/pigment-unplugin:
dependencies:
'@babel/core':
specifier: ^7.23.9
version: 7.23.9
- '@mui/zero-runtime':
+ '@pigmentcss/react':
specifier: workspace:^
- version: link:../zero-runtime
+ version: link:../pigment-react
'@wyw-in-js/shared':
specifier: ^0.4.1
version: 0.4.1
@@ -1318,7 +1210,7 @@ importers:
specifier: ^7.20.5
version: 7.20.5
- ../packages/zero-vite-plugin:
+ ../packages/pigment-vite-plugin:
dependencies:
'@babel/core':
specifier: ^7.23.9
@@ -1326,9 +1218,9 @@ importers:
'@babel/preset-typescript':
specifier: ^7.23.3
version: 7.23.3(@babel/core@7.23.9)
- '@mui/zero-runtime':
+ '@pigmentcss/react':
specifier: workspace:^
- version: link:../zero-runtime
+ version: link:../pigment-react
'@wyw-in-js/shared':
specifier: ^0.4.1
version: 0.4.1
@@ -1346,13 +1238,121 @@ importers:
specifier: ^5.0.12
version: 5.0.12
+ ../packages/test-utils:
+ dependencies:
+ '@babel/plugin-transform-modules-commonjs':
+ specifier: ^7.23.3
+ version: 7.23.3(@babel/core@7.23.9)
+ '@babel/preset-typescript':
+ specifier: ^7.23.3
+ version: 7.23.3(@babel/core@7.23.9)
+ '@babel/register':
+ specifier: ^7.23.7
+ version: 7.23.7(@babel/core@7.23.9)
+ '@babel/runtime':
+ specifier: ^7.23.9
+ version: 7.23.9
+ '@emotion/cache':
+ specifier: ^11.11.0
+ version: 11.11.0
+ '@emotion/react':
+ specifier: ^11.11.3
+ version: 11.11.3(@types/react@18.2.55)(react@18.2.0)
+ '@mnajdova/enzyme-adapter-react-18':
+ specifier: ^0.2.0
+ version: 0.2.0(enzyme@3.11.0)(react-dom@18.2.0)(react@18.2.0)
+ '@testing-library/dom':
+ specifier: ^9.3.4
+ version: 9.3.4
+ '@testing-library/react':
+ specifier: ^14.2.1
+ version: 14.2.1(react-dom@18.2.0)(react@18.2.0)
+ chai:
+ specifier: ^4.4.1
+ version: 4.4.1
+ chai-dom:
+ specifier: ^1.12.0
+ version: 1.12.0(chai@4.4.1)
+ dom-accessibility-api:
+ specifier: ^0.6.3
+ version: 0.6.3
+ enzyme:
+ specifier: ^3.11.0
+ version: 3.11.0
+ format-util:
+ specifier: ^1.0.5
+ version: 1.0.5
+ fs-extra:
+ specifier: ^11.2.0
+ version: 11.2.0
+ jsdom:
+ specifier: ^24.0.0
+ version: 24.0.0
+ lodash:
+ specifier: ^4.17.21
+ version: 4.17.21
+ mocha:
+ specifier: ^10.2.0
+ version: 10.3.0
+ playwright:
+ specifier: ^1.41.2
+ version: 1.41.2
+ prop-types:
+ specifier: ^15.8.1
+ version: 15.8.1
+ react:
+ specifier: ^18.2.0
+ version: 18.2.0
+ react-dom:
+ specifier: ^18.2.0
+ version: 18.2.0(react@18.2.0)
+ react-test-renderer:
+ specifier: ^18.2.0
+ version: 18.2.0(react@18.2.0)
+ sinon:
+ specifier: ^15.2.0
+ version: 15.2.0
+ devDependencies:
+ '@types/chai':
+ specifier: ^4.3.11
+ version: 4.3.12
+ '@types/chai-dom':
+ specifier: ^1.11.3
+ version: 1.11.3
+ '@types/enzyme':
+ specifier: ^3.10.18
+ version: 3.10.18
+ '@types/format-util':
+ specifier: ^1.0.4
+ version: 1.0.4
+ '@types/prop-types':
+ specifier: ^15.7.11
+ version: 15.7.11
+ '@types/react':
+ specifier: ^18.2.55
+ version: 18.2.55
+ '@types/react-dom':
+ specifier: ^18.2.19
+ version: 18.2.19
+ '@types/react-test-renderer':
+ specifier: ^18.0.7
+ version: 18.0.7
+ '@types/sinon':
+ specifier: ^10.0.20
+ version: 10.0.20
+ typescript:
+ specifier: ^5.3.3
+ version: 5.3.3
+
+ ../packages/waterfall: {}
+
local-ui-lib:
dependencies:
- '@mui/zero-runtime':
- specifier: file:../../packages/zero-runtime/build
- version: file:../packages/zero-runtime/build
+ '@pigmentcss/react':
+ specifier: file:../../packages/pigment-react
+ version: file:../packages/pigment-react(@types/react@18.2.55)(react@18.2.0)(typescript@5.3.3)
- zero-runtime-next-app:
+ pigment-next-app:
dependencies:
'@emotion/cache':
specifier: latest
@@ -1375,9 +1375,9 @@ importers:
'@mui/utils':
specifier: file:../../packages/mui-utils/build
version: file:../packages/mui-utils/build(@types/react@18.2.55)(react@18.2.0)
- '@mui/zero-runtime':
- specifier: file:../../packages/zero-runtime
- version: file:../packages/zero-runtime(@types/react@18.2.55)(react@18.2.0)(typescript@5.3.3)
+ '@pigmentcss/react':
+ specifier: file:../../packages/pigment-react
+ version: file:../packages/pigment-react(@types/react@18.2.55)(react@18.2.0)(typescript@5.3.3)
local-ui-lib:
specifier: workspace:^
version: link:../local-ui-lib
@@ -1391,15 +1391,15 @@ importers:
specifier: ^18.2.0
version: 18.2.0(react@18.2.0)
devDependencies:
- '@mui/zero-next-plugin':
- specifier: file:../../packages/zero-next-plugin
- version: file:../packages/zero-next-plugin(next@14.1.0)
- '@mui/zero-unplugin':
- specifier: file:../../packages/zero-unplugin
- version: file:../packages/zero-unplugin(@mui/zero-runtime@0.0.1)(typescript@5.3.3)
+ '@pigmentcss/nextjs-plugin':
+ specifier: file:../../packages/pigment-nextjs-plugin
+ version: file:../packages/pigment-nextjs-plugin(next@14.1.0)
+ '@pigmentcss/unplugin':
+ specifier: file:../../packages/pigment-unplugin
+ version: file:../packages/pigment-unplugin(typescript@5.3.3)
'@types/node':
specifier: ^20.5.7
- version: 20.11.20
+ version: 20.11.22
'@types/react':
specifier: ^18.2.55
version: 18.2.55
@@ -1413,7 +1413,7 @@ importers:
specifier: ^5.3.3
version: 5.3.3
- zero-runtime-vite-app:
+ pigment-vite-app:
dependencies:
'@mui/base':
specifier: file:../../packages/mui-base/build
@@ -1433,9 +1433,9 @@ importers:
'@mui/utils':
specifier: file:../../packages/mui-utils/build
version: file:../packages/mui-utils/build(@types/react@18.2.55)(react@18.2.0)
- '@mui/zero-runtime':
- specifier: file:../../packages/zero-runtime
- version: file:../packages/zero-runtime(@types/react@18.2.55)(react@18.2.0)(typescript@5.3.3)
+ '@pigmentcss/react':
+ specifier: file:../../packages/pigment-react
+ version: file:../packages/pigment-react(@types/react@18.2.55)(react@18.2.0)(typescript@5.3.3)
clsx:
specifier: ^2.1.0
version: 2.1.0
@@ -1464,9 +1464,9 @@ importers:
'@babel/preset-typescript':
specifier: ^7.23.3
version: 7.23.3(@babel/core@7.23.9)
- '@mui/zero-vite-plugin':
- specifier: file:../../packages/zero-vite-plugin
- version: file:../packages/zero-vite-plugin(vite@5.0.12)
+ '@pigmentcss/vite-plugin':
+ specifier: file:../../packages/pigment-vite-plugin
+ version: file:../packages/pigment-vite-plugin(vite@5.0.12)
'@types/react':
specifier: ^18.2.55
version: 18.2.55
@@ -2799,6 +2799,7 @@ packages:
'@emotion/serialize': 1.1.3
'@emotion/sheet': 1.2.2
'@emotion/utils': 1.2.1
+ dev: false
/@emotion/hash@0.9.1:
resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==}
@@ -3707,7 +3708,7 @@ packages:
/@types/cheerio@0.22.35:
resolution: {integrity: sha512-yD57BchKRvTV+JD53UZ6PD8KWY5g5rvvMLRnZR3EQBCZXiDT/HR+pKpMzFGlWNhFrXlo7VPZXtKvIEwZkAWOIA==}
dependencies:
- '@types/node': 18.19.18
+ '@types/node': 20.11.22
dev: true
/@types/cssesc@3.0.2:
@@ -3765,14 +3766,14 @@ packages:
resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==}
dev: true
- /@types/node@18.19.18:
- resolution: {integrity: sha512-80CP7B8y4PzZF0GWx15/gVWRrB5y/bIjNI84NK3cmQJu0WZwvmj2WMA5LcofQFVfLqqCSp545+U2LsrVzX36Zg==}
+ /@types/node@18.19.20:
+ resolution: {integrity: sha512-SKXZvI375jkpvAj8o+5U2518XQv76mAsixqfXiVyWyXZbVWQK25RurFovYpVIxVzul0rZoH58V/3SkEnm7s3qA==}
dependencies:
undici-types: 5.26.5
dev: true
- /@types/node@20.11.20:
- resolution: {integrity: sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg==}
+ /@types/node@20.11.22:
+ resolution: {integrity: sha512-/G+IxWxma6V3E+pqK1tSl2Fo1kl41pK1yeCyDsgkF9WlVAme4j5ISYM2zR11bgLFJGLN5sVK40T4RJNuiZbEjA==}
dependencies:
undici-types: 5.26.5
dev: true
@@ -3828,7 +3829,7 @@ packages:
/@types/resolve@0.0.8:
resolution: {integrity: sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==}
dependencies:
- '@types/node': 18.19.18
+ '@types/node': 20.11.22
dev: true
/@types/scheduler@0.16.8:
@@ -4520,6 +4521,7 @@ packages:
/clsx@2.1.0:
resolution: {integrity: sha512-m3iNNWpd9rl3jvvcBnu70ylMdrXt8Vlq4HYadnU5fwcOtvkSQWPmj7amUcDT2qYI7risszBjI5AUIUox9D16pg==}
engines: {node: '>=6'}
+ dev: false
/collection-visit@1.0.0:
resolution: {integrity: sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==}
@@ -4718,6 +4720,7 @@ packages:
resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==}
engines: {node: '>=4'}
hasBin: true
+ dev: false
/csso@5.0.5:
resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==}
@@ -6216,7 +6219,7 @@ packages:
resolution: {integrity: sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==}
engines: {node: '>= 10.13.0'}
dependencies:
- '@types/node': 18.19.18
+ '@types/node': 20.11.22
merge-stream: 2.0.0
supports-color: 7.2.0
dev: true
@@ -9084,21 +9087,21 @@ packages:
react-is: 18.2.0
dev: false
- file:../packages/zero-next-plugin(next@14.1.0):
- resolution: {directory: ../packages/zero-next-plugin, type: directory}
- id: file:../packages/zero-next-plugin
- name: '@mui/zero-next-plugin'
+ file:../packages/pigment-nextjs-plugin(next@14.1.0):
+ resolution: {directory: ../packages/pigment-nextjs-plugin, type: directory}
+ id: file:../packages/pigment-nextjs-plugin
+ name: '@pigmentcss/nextjs-plugin'
peerDependencies:
next: ^12.0.0 || ^13.0.0 || ^14.0.0
dependencies:
- '@mui/zero-unplugin': link:../packages/zero-unplugin
+ '@pigmentcss/unplugin': link:../packages/pigment-unplugin
next: 14.1.0(@babel/core@7.23.9)(react-dom@18.2.0)(react@18.2.0)
dev: true
- file:../packages/zero-runtime(@types/react@18.2.55)(react@18.2.0)(typescript@5.3.3):
- resolution: {directory: ../packages/zero-runtime, type: directory}
- id: file:../packages/zero-runtime
- name: '@mui/zero-runtime'
+ file:../packages/pigment-react(@types/react@18.2.55)(react@18.2.0)(typescript@5.3.3):
+ resolution: {directory: ../packages/pigment-react, type: directory}
+ id: file:../packages/pigment-react
+ name: '@pigmentcss/react'
peerDependencies:
react: ^17.0.0 || ^18.0.0
dependencies:
@@ -9125,21 +9128,15 @@ packages:
- '@types/react'
- supports-color
- typescript
-
- file:../packages/zero-runtime/build:
- resolution: {directory: ../packages/zero-runtime/build, type: directory}
- name: build
dev: false
- file:../packages/zero-unplugin(@mui/zero-runtime@0.0.1)(typescript@5.3.3):
- resolution: {directory: ../packages/zero-unplugin, type: directory}
- id: file:../packages/zero-unplugin
- name: '@mui/zero-unplugin'
- peerDependencies:
- '@mui/zero-runtime': workspace:^
+ file:../packages/pigment-unplugin(typescript@5.3.3):
+ resolution: {directory: ../packages/pigment-unplugin, type: directory}
+ id: file:../packages/pigment-unplugin
+ name: '@pigmentcss/unplugin'
dependencies:
'@babel/core': 7.23.9
- '@mui/zero-runtime': file:../packages/zero-runtime(@types/react@18.2.55)(react@18.2.0)(typescript@5.3.3)
+ '@pigmentcss/react': link:../packages/pigment-react
'@wyw-in-js/shared': 0.4.1
'@wyw-in-js/transform': 0.4.1(typescript@5.3.3)
babel-plugin-transform-react-remove-prop-types: 0.4.24
@@ -9149,16 +9146,16 @@ packages:
- typescript
dev: true
- file:../packages/zero-vite-plugin(vite@5.0.12):
- resolution: {directory: ../packages/zero-vite-plugin, type: directory}
- id: file:../packages/zero-vite-plugin
- name: '@mui/zero-vite-plugin'
+ file:../packages/pigment-vite-plugin(vite@5.0.12):
+ resolution: {directory: ../packages/pigment-vite-plugin, type: directory}
+ id: file:../packages/pigment-vite-plugin
+ name: '@pigmentcss/vite-plugin'
peerDependencies:
vite: ^4.0.0 || ^5.0.0
dependencies:
'@babel/core': 7.23.9
'@babel/preset-typescript': 7.23.3(@babel/core@7.23.9)
- '@mui/zero-runtime': link:../packages/zero-runtime
+ '@pigmentcss/react': link:../packages/pigment-react
'@wyw-in-js/shared': 0.4.1
'@wyw-in-js/transform': 0.4.1(typescript@5.3.3)
babel-plugin-transform-react-remove-prop-types: 0.4.24
diff --git a/apps/pnpm-workspace.yaml b/apps/pnpm-workspace.yaml
index bff4bedfe17d36..d770d322ad42ee 100644
--- a/apps/pnpm-workspace.yaml
+++ b/apps/pnpm-workspace.yaml
@@ -1,9 +1,9 @@
packages:
- 'local-ui-lib'
- - 'zero-runtime-*'
+ - 'pigment-*'
- '../packages/waterfall'
- '../packages/docs-utils'
- '../packages/test-utils'
- '../packages-internal/*'
- '../packages/mui-*'
- - '../packages/zero-*'
+ - '../packages/pigment-*'
diff --git a/babel.config.js b/babel.config.js
index 41c75df442e2f2..e62c73ff88c671 100644
--- a/babel.config.js
+++ b/babel.config.js
@@ -32,7 +32,7 @@ module.exports = function getBabelConfig(api) {
'@mui/utils': resolveAliasPath('./packages/mui-utils/src'),
'@mui/material-next': resolveAliasPath('./packages/mui-material-next/src'),
'@mui/joy': resolveAliasPath('./packages/mui-joy/src'),
- '@mui/zero-runtime': resolveAliasPath('./packages/zero-runtime/src'),
+ '@pigmentcss/react': resolveAliasPath('./packages/pigment-react/src'),
'@mui-internal/docs-utils': resolveAliasPath('./packages/docs-utils/src'),
docs: resolveAliasPath('./docs'),
test: resolveAliasPath('./test'),
diff --git a/package.json b/package.json
index 386a1007500eed..5bf7ea00537ae6 100644
--- a/package.json
+++ b/package.json
@@ -10,8 +10,8 @@
"build": "lerna run build --ignore docs",
"build:public": "lerna run --no-private build",
"build:ci": "lerna run build --ignore docs --concurrency 8 --skip-nx-cache",
- "build:zero": "lerna run --scope \"@mui/zero-*\" build",
- "clean:zero": "pnpm --filter \"@mui/zero-*\" clean",
+ "build:zero": "lerna run --scope \"@pigmentcss/*\" build",
+ "clean:zero": "pnpm --filter \"@pigmentcss/*\" clean",
"build:codesandbox": "NODE_OPTIONS=\"--max_old_space_size=4096\" lerna run --concurrency 8 --scope \"@mui/*\" --scope \"@mui-internal/*\" --no-private build",
"release:version": "lerna version --no-changelog --no-push --no-git-tag-version --no-private --force-publish=@mui/core-downloads-tracker",
"release:build": "lerna run --concurrency 8 --no-private build --skip-nx-cache",
@@ -54,9 +54,9 @@
"test": "node scripts/test.mjs",
"tc": "node test/cli.js",
"test:extended": "pnpm eslint && pnpm typescript && pnpm test:coverage",
- "test:zero-runtime:ci": "pnpm nx run @mui/zero-runtime:test:ci",
- "test:coverage": "cross-env NODE_ENV=test BABEL_ENV=coverage nyc --reporter=text mocha 'packages/**/*.test.{js,ts,tsx}' 'docs/**/*.test.{js,ts,tsx}' --exclude 'packages/zero-runtime/**/*.test.{js,ts,tsx}' && pnpm test:zero-runtime",
- "test:coverage:ci": "cross-env NODE_ENV=test BABEL_ENV=coverage nyc --reporter=lcov mocha 'packages/**/*.test.{js,ts,tsx}' 'docs/**/*.test.{js,ts,tsx}' --exclude 'packages/zero-runtime/**/*.test.{js,ts,tsx}' && pnpm test:zero-runtime:ci",
+ "test:pigment-react:ci": "pnpm nx run @pigmentcss/react:test:ci",
+ "test:coverage": "cross-env NODE_ENV=test BABEL_ENV=coverage nyc --reporter=text mocha 'packages/**/*.test.{js,ts,tsx}' 'docs/**/*.test.{js,ts,tsx}' --exclude 'packages/pigment-react/**/*.test.{js,ts,tsx}' && pnpm test:pigment-react",
+ "test:coverage:ci": "cross-env NODE_ENV=test BABEL_ENV=coverage nyc --reporter=lcov mocha 'packages/**/*.test.{js,ts,tsx}' 'docs/**/*.test.{js,ts,tsx}' --exclude 'packages/pigment-react/**/*.test.{js,ts,tsx}' && pnpm test:pigment-react:ci",
"test:coverage:html": "cross-env NODE_ENV=test BABEL_ENV=coverage nyc --reporter=html mocha 'packages/**/*.test.{js,ts,tsx}' 'docs/**/*.test.{js,ts,tsx}'",
"test:e2e": "cross-env NODE_ENV=production pnpm test:e2e:build && concurrently --success first --kill-others \"pnpm test:e2e:run\" \"pnpm test:e2e:server\"",
"test:e2e:build": "webpack --config test/e2e/webpack.config.js",
@@ -79,7 +79,7 @@
"typescript:ci": "lerna run --concurrency 5 --no-bail --no-sort typescript",
"validate-declarations": "tsx scripts/validateTypescriptDeclarations.mts",
"generate-codeowners": "node scripts/generateCodeowners.mjs",
- "watch:zero": "nx run-many -t watch --projects=\"@mui/zero-*\" --parallel"
+ "watch:zero": "nx run-many -t watch --projects=\"@pigmentcss/*\" --parallel"
},
"dependencies": {
"@googleapis/sheets": "^5.0.5",
diff --git a/packages/mui-icons-material/test/generated-types/tsconfig.json b/packages/mui-icons-material/test/generated-types/tsconfig.json
index 9b00faf9c2d744..112f552f4dfee6 100644
--- a/packages/mui-icons-material/test/generated-types/tsconfig.json
+++ b/packages/mui-icons-material/test/generated-types/tsconfig.json
@@ -42,14 +42,12 @@
"@mui/types": ["./mui-types"],
"@mui/utils": ["./mui-utils/src"],
"@mui/utils/*": ["./mui-utils/src/*"],
- "@mui/zero-next-plugin": ["./zero-next-plugin/src"],
- "@mui/zero-next-plugin/*": ["./zero-next-plugin/src/*"],
- "@mui/zero-runtime": ["./zero-runtime/src"],
- "@mui/zero-runtime/*": ["./zero-runtime/src/*"],
- "@mui/zero-tag-processor": ["./zero-tag-processor/src"],
- "@mui/zero-tag-processor/*": ["./zero-tag-processor/src/*"],
- "@mui/zero-vite-plugin": ["./zero-vite-plugin/src"],
- "@mui/zero-vite-plugin/*": ["./zero-vite-plugin/src/*"],
+ "@pigmentcss/nextjs-plugin": ["./pigment-nextjs-plugin/src"],
+ "@pigmentcss/nextjs-plugin/*": ["./pigment-nextjs-plugin/src/*"],
+ "@pigmentcss/react": ["./pigment-react/src"],
+ "@pigmentcss/react/*": ["./pigment-react/src/*"],
+ "@pigmentcss/vite-plugin": ["./pigment-vite-plugin/src"],
+ "@pigmentcss/vite-plugin/*": ["./pigment-vite-plugin/src/*"],
"@mui/internal-scripts/typescript-to-proptypes": [
"../packages-internal/scripts/typescript-to-proptypes/src"
]
diff --git a/packages/zero-next-plugin/.eslintrc b/packages/pigment-nextjs-plugin/.eslintrc
similarity index 100%
rename from packages/zero-next-plugin/.eslintrc
rename to packages/pigment-nextjs-plugin/.eslintrc
diff --git a/packages/zero-next-plugin/.gitignore b/packages/pigment-nextjs-plugin/.gitignore
similarity index 100%
rename from packages/zero-next-plugin/.gitignore
rename to packages/pigment-nextjs-plugin/.gitignore
diff --git a/packages/zero-next-plugin/loader.js b/packages/pigment-nextjs-plugin/loader.js
similarity index 100%
rename from packages/zero-next-plugin/loader.js
rename to packages/pigment-nextjs-plugin/loader.js
diff --git a/packages/zero-next-plugin/next-font.js b/packages/pigment-nextjs-plugin/next-font.js
similarity index 100%
rename from packages/zero-next-plugin/next-font.js
rename to packages/pigment-nextjs-plugin/next-font.js
diff --git a/packages/zero-next-plugin/next-image.js b/packages/pigment-nextjs-plugin/next-image.js
similarity index 100%
rename from packages/zero-next-plugin/next-image.js
rename to packages/pigment-nextjs-plugin/next-image.js
diff --git a/packages/zero-next-plugin/package.json b/packages/pigment-nextjs-plugin/package.json
similarity index 78%
rename from packages/zero-next-plugin/package.json
rename to packages/pigment-nextjs-plugin/package.json
index e1fd2188767bd7..42003929b0c53a 100644
--- a/packages/zero-next-plugin/package.json
+++ b/packages/pigment-nextjs-plugin/package.json
@@ -1,21 +1,21 @@
{
- "name": "@mui/zero-next-plugin",
+ "name": "@pigmentcss/nextjs-plugin",
"version": "0.0.1",
"main": "build/index.js",
"module": "build/index.mjs",
"types": "build/index.d.ts",
"author": "MUI Team",
- "description": "Next.js integration for @mui/zero-runtime CSS-in-JS library.",
+ "description": "Next.js integration for Pigment CSS.",
"repository": {
"type": "git",
"url": "https://github.com/mui/material-ui.git",
- "directory": "packages/zero-next-plugin"
+ "directory": "packages/pigment-nextjs-plugin"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/mui/material-ui/issues"
},
- "homepage": "https://github.com/mui/material-ui/tree/master/packages/zero-runtime",
+ "homepage": "https://github.com/mui/material-ui/tree/master/packages/pigment-react",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/mui-org"
@@ -23,12 +23,12 @@
"scripts": {
"clean": "rimraf build types",
"watch": "tsup --watch --tsconfig tsconfig.build.json",
- "copy-license": "node ../../scripts/zero-runtime-license.mjs",
+ "copy-license": "node ../../scripts/pigment-license.mjs",
"build": "tsup --tsconfig tsconfig.build.json",
"typecheck": "tsc --noEmit -p ."
},
"dependencies": {
- "@mui/zero-unplugin": "workspace:^"
+ "@pigmentcss/unplugin": "workspace:^"
},
"devDependencies": {
"next": "^13.5.1"
diff --git a/packages/zero-next-plugin/src/index.ts b/packages/pigment-nextjs-plugin/src/index.ts
similarity index 86%
rename from packages/zero-next-plugin/src/index.ts
rename to packages/pigment-nextjs-plugin/src/index.ts
index 661e0d0b2fe045..24b4115232769d 100644
--- a/packages/zero-next-plugin/src/index.ts
+++ b/packages/pigment-nextjs-plugin/src/index.ts
@@ -2,12 +2,12 @@ import * as path from 'node:path';
import type { NextConfig } from 'next';
import { findPagesDir } from 'next/dist/lib/find-pages-dir';
import {
- webpack as zeroWebpackPlugin,
+ webpack as webpackPlugin,
extendTheme,
- type PluginOptions as BaseZeroPluginConfig,
-} from '@mui/zero-unplugin';
+ type PigmentOptions as BasePigmentOptions,
+} from '@pigmentcss/unplugin';
-export type ZeroPluginConfig = BaseZeroPluginConfig & {
+export type PigmentOptions = BasePigmentOptions & {
asyncResolve?: (what: string) => string | null;
};
@@ -16,8 +16,8 @@ const extractionFile = path.join(
'zero-virtual.css',
);
-export function withZeroPlugin(nextConfig: NextConfig, zeroConfig: ZeroPluginConfig) {
- const { babelOptions, asyncResolve, ...rest } = zeroConfig;
+export function withPigment(nextConfig: NextConfig, pigmentConfig: PigmentOptions) {
+ const { babelOptions, asyncResolve, ...rest } = pigmentConfig;
const webpack: Exclude = (config, context) => {
const { dir, dev, isServer, config: resolvedNextConfig } = context;
@@ -43,7 +43,7 @@ export function withZeroPlugin(nextConfig: NextConfig, zeroConfig: ZeroPluginCon
use: require.resolve('../loader'),
});
config.plugins.push(
- zeroWebpackPlugin({
+ webpackPlugin({
...rest,
meta: {
type: 'next',
diff --git a/packages/zero-next-plugin/src/virtual-css-loader.js b/packages/pigment-nextjs-plugin/src/virtual-css-loader.js
similarity index 100%
rename from packages/zero-next-plugin/src/virtual-css-loader.js
rename to packages/pigment-nextjs-plugin/src/virtual-css-loader.js
diff --git a/packages/zero-next-plugin/tsconfig.build.json b/packages/pigment-nextjs-plugin/tsconfig.build.json
similarity index 100%
rename from packages/zero-next-plugin/tsconfig.build.json
rename to packages/pigment-nextjs-plugin/tsconfig.build.json
diff --git a/packages/zero-next-plugin/tsconfig.json b/packages/pigment-nextjs-plugin/tsconfig.json
similarity index 100%
rename from packages/zero-next-plugin/tsconfig.json
rename to packages/pigment-nextjs-plugin/tsconfig.json
diff --git a/packages/zero-next-plugin/tsup.config.ts b/packages/pigment-nextjs-plugin/tsup.config.ts
similarity index 100%
rename from packages/zero-next-plugin/tsup.config.ts
rename to packages/pigment-nextjs-plugin/tsup.config.ts
diff --git a/packages/zero-next-plugin/zero-virtual.css b/packages/pigment-nextjs-plugin/zero-virtual.css
similarity index 100%
rename from packages/zero-next-plugin/zero-virtual.css
rename to packages/pigment-nextjs-plugin/zero-virtual.css
diff --git a/packages/zero-runtime/.eslintignore b/packages/pigment-react/.eslintignore
similarity index 100%
rename from packages/zero-runtime/.eslintignore
rename to packages/pigment-react/.eslintignore
diff --git a/packages/zero-runtime/.eslintrc b/packages/pigment-react/.eslintrc
similarity index 100%
rename from packages/zero-runtime/.eslintrc
rename to packages/pigment-react/.eslintrc
diff --git a/packages/zero-runtime/.gitignore b/packages/pigment-react/.gitignore
similarity index 100%
rename from packages/zero-runtime/.gitignore
rename to packages/pigment-react/.gitignore
diff --git a/packages/zero-runtime/README.md b/packages/pigment-react/README.md
similarity index 86%
rename from packages/zero-runtime/README.md
rename to packages/pigment-react/README.md
index 1024a9d8078e94..90c2873d8b2078 100644
--- a/packages/zero-runtime/README.md
+++ b/packages/pigment-react/README.md
@@ -1,4 +1,4 @@
-# zero-runtime
+# Pigment CSS
A zero-runtime CSS-in-JS library that extracts the colocated styles to their own CSS files at build-time.
@@ -21,21 +21,21 @@ A zero-runtime CSS-in-JS library that extracts the colocated styles to their own
## Getting started
-Zero-runtime supports Next.js and Vite with future support for more bundlers. You must install the corresponding plugin, as shown below.
+Pigment CSS supports Next.js and Vite with support for more bundlers in future. You must install the corresponding plugin, as shown below.
### Next.js
```bash
-npm install @mui/zero-runtime
-npm install --save-dev @mui/zero-next-plugin
+npm install @pigmentcss/react
+npm install --save-dev @pigmentcss/nextjs-plugin
```
Then, in your `next.config.js` file, import the plugin and wrap the exported config object:
```js
-const { withZeroPlugin } = require('@mui/zero-next-plugin');
+const { withPigment } = require('@pigmentcss/nextjs-plugin');
-module.exports = withZeroPlugin({
+module.exports = withPigment({
// ... Your nextjs config.
});
```
@@ -43,18 +43,18 @@ module.exports = withZeroPlugin({
### Vite
```bash
-npm install @mui/zero-runtime
-npm install --save-dev @mui/zero-vite-plugin
+npm install @pigmentcss/react
+npm install --save-dev @pigmentcss/vite-plugin
```
Then, in your Vite config file, import the plugin and pass it to the `plugins` array as shown:
```js
-import { zeroVitePlugin } from '@mui/zero-vite-plugin';
+import { pigment } from '@pigmentcss/vite-plugin';
export default defineConfig({
plugins: [
- zeroVitePlugin(),
+ pigment(),
// ... Your other plugins.
],
});
@@ -62,14 +62,14 @@ export default defineConfig({
## Basic usage
-> You must configure zero-runtime with [Next.js](#nextjs) or [Vite](#vite) first.
+> You must configure Pigment CSS with [Next.js](#nextjs) or [Vite](#vite) first.
### Creating styles
Use the `css` API to create reusable styles:
```js
-import { css } from '@mui/zero-runtime';
+import { css } from '@pigmentcss/react';
const visuallyHidden = css({
border: 0,
@@ -105,7 +105,7 @@ const title = css(({ theme }) => ({
Use the `styled` API to create a component by passing styles at the end. The usage should be familiar if you've worked with Emotion or styled-components:
```js
-import { styled } from '@mui/zero-runtime';
+import { styled } from '@pigmentcss/react';
const Heading = styled('div')({
fontSize: '4rem',
@@ -118,7 +118,7 @@ function App() {
}
```
-The zero-runtime package differs from "standard" runtime CSS-in-JS libraries in a few ways:
+The Pigment CSS library differs from "standard" runtime CSS-in-JS libraries in a few ways:
1. You never get direct access to props in your styled declarations. This is because prop values are only available at runtime, but the CSS is extracted at build time. See [Styling based on runtime values](#styling-based-on-runtime-values) for a workaround.
2. Your styles must be declarative, and must account for all combinations of props that you want to style.
@@ -269,14 +269,14 @@ Theming is an **optional** feature that lets you reuse the same values, such as
> **💡 Good to know**:
>
-> The **theme** object is used at build time and does not exist in the final JS bundle. This means that components created using zero-runtime's `styled` can be used with React Server Components by default while still getting the benefits of theming.
+> The **theme** object is used at build time and does not exist in the final JS bundle. This means that components created using Pigment's `styled` can be used with React Server Components by default while still getting the benefits of theming.
For example, in Next.js, you can define a theme in the `next.config.js` file like this:
```js
-const { withZeroPlugin } = require('@mui/zero-next-plugin');
+const { withPigment } = require('@pigmentcss/nextjs-plugin');
-module.exports = withZeroPlugin(
+module.exports = withPigment(
{
// ...other nextConfig
},
@@ -315,9 +315,9 @@ const Heading = styled('h1')(({ theme }) => ({
Zero-runtime can generate CSS variables from the theme values when you wrap your theme with `extendTheme` utility. For example, in a `next.config.js` file:
```js
-const { withZeroPlugin, extendTheme } = require('@mui/zero-next-plugin');
+const { withPigment, extendTheme } = require('@pigmentcss/nextjs-plugin');
-module.exports = withZeroPlugin(
+module.exports = withPigment(
{
// ...nextConfig
},
@@ -381,7 +381,7 @@ In the above example, `light` (default) and `dark` color schemes are defined. Th
#### Switching color schemes
-By default, when `colorSchemes` is defined, zero-runtime uses the [`prefers-color-scheme`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media query to switch between color schemes based on user's system settings.
+By default, when `colorSchemes` is defined, Pigment uses the [`prefers-color-scheme`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme) media query to switch between color schemes based on user's system settings.
However, if you want to control the color scheme based on application logic, for example, using a button to switch between light and dark mode, you can customize the behavior by providing a `getSelector` function:
@@ -417,16 +417,16 @@ You can add a prefix to the generated CSS variables by providing a `cssVarPrefix
```jsx
extendTheme({
- cssVarPrefix: 'zero',
+ cssVarPrefix: 'pigment',
});
```
-The generated CSS variables will have the `zero` prefix:
+The generated CSS variables will have the `pigment` prefix:
```css
:root {
- --zero-colors-background: #f9f9f9;
- --zero-colors-foreground: #121212;
+ --pigment-colors-background: #f9f9f9;
+ --pigment-colors-foreground: #121212;
}
```
@@ -436,9 +436,9 @@ To get the type checking for the theme, you need to augment the theme type:
```ts
// any file that is included in your tsconfig.json
-import type { ExtendTheme } from '@mui/zero-runtime';
+import type { ExtendTheme } from '@pigmentcss/react';
-declare module '@mui/zero-runtime/theme' {
+declare module '@pigmentcss/react/theme' {
interface ThemeTokens {
// the structure of your theme
}
diff --git a/packages/zero-runtime/exports/createUseThemeProps.js b/packages/pigment-react/exports/createUseThemeProps.js
similarity index 100%
rename from packages/zero-runtime/exports/createUseThemeProps.js
rename to packages/pigment-react/exports/createUseThemeProps.js
diff --git a/packages/zero-runtime/exports/css.js b/packages/pigment-react/exports/css.js
similarity index 100%
rename from packages/zero-runtime/exports/css.js
rename to packages/pigment-react/exports/css.js
diff --git a/packages/zero-runtime/exports/generateAtomics.js b/packages/pigment-react/exports/generateAtomics.js
similarity index 100%
rename from packages/zero-runtime/exports/generateAtomics.js
rename to packages/pigment-react/exports/generateAtomics.js
diff --git a/packages/zero-runtime/exports/keyframes.js b/packages/pigment-react/exports/keyframes.js
similarity index 100%
rename from packages/zero-runtime/exports/keyframes.js
rename to packages/pigment-react/exports/keyframes.js
diff --git a/packages/zero-runtime/exports/styled.js b/packages/pigment-react/exports/styled.js
similarity index 100%
rename from packages/zero-runtime/exports/styled.js
rename to packages/pigment-react/exports/styled.js
diff --git a/packages/zero-runtime/exports/sx-plugin.js b/packages/pigment-react/exports/sx-plugin.js
similarity index 100%
rename from packages/zero-runtime/exports/sx-plugin.js
rename to packages/pigment-react/exports/sx-plugin.js
diff --git a/packages/zero-runtime/exports/sx.js b/packages/pigment-react/exports/sx.js
similarity index 100%
rename from packages/zero-runtime/exports/sx.js
rename to packages/pigment-react/exports/sx.js
diff --git a/packages/zero-runtime/package.json b/packages/pigment-react/package.json
similarity index 92%
rename from packages/zero-runtime/package.json
rename to packages/pigment-react/package.json
index be26354dd02107..bc0b91109d9458 100644
--- a/packages/zero-runtime/package.json
+++ b/packages/pigment-react/package.json
@@ -1,5 +1,5 @@
{
- "name": "@mui/zero-runtime",
+ "name": "@pigmentcss/react",
"version": "0.0.1",
"main": "build/index.js",
"module": "build/index.mjs",
@@ -9,13 +9,13 @@
"repository": {
"type": "git",
"url": "https://github.com/mui/material-ui.git",
- "directory": "packages/zero-runtime"
+ "directory": "packages/pigment-react"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/mui/material-ui/issues"
},
- "homepage": "https://github.com/mui/material-ui/tree/master/packages/zero-runtime",
+ "homepage": "https://github.com/mui/material-ui/tree/master/packages/pigment-react",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/mui-org"
@@ -23,10 +23,10 @@
"scripts": {
"clean": "rimraf build types processors utils",
"watch": "tsup --watch --clean false",
- "copy-license": "node ../../scripts/zero-runtime-license.mjs",
+ "copy-license": "node ../../scripts/pigment-license.mjs",
"build": "tsup",
- "test": "cd ../../ && cross-env NODE_ENV=test mocha 'packages/zero-runtime/**/*.test.{js,ts,tsx}'",
- "test:ci": "cd ../../ && cross-env NODE_ENV=test BABEL_ENV=coverage nyc --reporter=lcov --report-dir=./coverage/zero mocha 'packages/zero-runtime/**/*.test.{js,ts,tsx}'",
+ "test": "cd ../../ && cross-env NODE_ENV=test mocha 'packages/pigment-react/**/*.test.{js,ts,tsx}'",
+ "test:ci": "cd ../../ && cross-env NODE_ENV=test BABEL_ENV=coverage nyc --reporter=lcov --report-dir=./coverage/pigment-react mocha 'packages/pigment-react/**/*.test.{js,ts,tsx}'",
"typecheck": "tsc --noEmit -p ."
},
"dependencies": {
diff --git a/packages/zero-runtime/src/base.d.ts b/packages/pigment-react/src/base.d.ts
similarity index 100%
rename from packages/zero-runtime/src/base.d.ts
rename to packages/pigment-react/src/base.d.ts
diff --git a/packages/zero-runtime/src/createUseThemeProps.d.ts b/packages/pigment-react/src/createUseThemeProps.d.ts
similarity index 100%
rename from packages/zero-runtime/src/createUseThemeProps.d.ts
rename to packages/pigment-react/src/createUseThemeProps.d.ts
diff --git a/packages/zero-runtime/src/createUseThemeProps.js b/packages/pigment-react/src/createUseThemeProps.js
similarity index 100%
rename from packages/zero-runtime/src/createUseThemeProps.js
rename to packages/pigment-react/src/createUseThemeProps.js
diff --git a/packages/zero-runtime/src/css.d.ts b/packages/pigment-react/src/css.d.ts
similarity index 100%
rename from packages/zero-runtime/src/css.d.ts
rename to packages/pigment-react/src/css.d.ts
diff --git a/packages/pigment-react/src/css.js b/packages/pigment-react/src/css.js
new file mode 100644
index 00000000000000..f00304d44f681a
--- /dev/null
+++ b/packages/pigment-react/src/css.js
@@ -0,0 +1,5 @@
+export default function css() {
+ throw new Error(
+ `${process.env.PACKAGE_NAME}: You were trying to call "css" function without configuring your bundler. Make sure to install the bundler specific plugin and use it. @pigmentcss/vite-plugin for Vite integration or @pigmentcss/nextjs-plugin for Next.js integration.`,
+ );
+}
diff --git a/packages/zero-runtime/src/generateAtomics.d.ts b/packages/pigment-react/src/generateAtomics.d.ts
similarity index 100%
rename from packages/zero-runtime/src/generateAtomics.d.ts
rename to packages/pigment-react/src/generateAtomics.d.ts
diff --git a/packages/zero-runtime/src/generateAtomics.js b/packages/pigment-react/src/generateAtomics.js
similarity index 85%
rename from packages/zero-runtime/src/generateAtomics.js
rename to packages/pigment-react/src/generateAtomics.js
index f9b1820217270e..6c7f1868752f8c 100644
--- a/packages/zero-runtime/src/generateAtomics.js
+++ b/packages/pigment-react/src/generateAtomics.js
@@ -2,7 +2,7 @@ import cx from 'clsx';
export function generateAtomics() {
throw new Error(
- 'MUI: You were trying to call "generateAtomics" function directly without configuring your bundler. Make sure to install the bundler specific plugin and use it.',
+ `${process.env.PACKAGE_NAME}: You were trying to call "generateAtomics" function without configuring your bundler. Make sure to install the bundler specific plugin and use it. @pigmentcss/vite-plugin for Vite integration or @pigmentcss/nextjs-plugin for Next.js integration.`,
);
}
diff --git a/packages/zero-runtime/src/index.ts b/packages/pigment-react/src/index.ts
similarity index 100%
rename from packages/zero-runtime/src/index.ts
rename to packages/pigment-react/src/index.ts
diff --git a/packages/zero-runtime/src/keyframes.d.ts b/packages/pigment-react/src/keyframes.d.ts
similarity index 100%
rename from packages/zero-runtime/src/keyframes.d.ts
rename to packages/pigment-react/src/keyframes.d.ts
diff --git a/packages/pigment-react/src/keyframes.js b/packages/pigment-react/src/keyframes.js
new file mode 100644
index 00000000000000..480db9b274ee78
--- /dev/null
+++ b/packages/pigment-react/src/keyframes.js
@@ -0,0 +1,5 @@
+export default function keyframes() {
+ throw new Error(
+ `${process.env.PACKAGE_NAME}: You were trying to call "keyframes" function without configuring your bundler. Make sure to install the bundler specific plugin and use it. @pigmentcss/vite-plugin for Vite integration or @pigmentcss/nextjs-plugin for Next.js integration.`,
+ );
+}
diff --git a/packages/zero-runtime/src/processors/base-processor.ts b/packages/pigment-react/src/processors/base-processor.ts
similarity index 100%
rename from packages/zero-runtime/src/processors/base-processor.ts
rename to packages/pigment-react/src/processors/base-processor.ts
diff --git a/packages/zero-runtime/src/processors/createUseThemeProps.ts b/packages/pigment-react/src/processors/createUseThemeProps.ts
similarity index 100%
rename from packages/zero-runtime/src/processors/createUseThemeProps.ts
rename to packages/pigment-react/src/processors/createUseThemeProps.ts
diff --git a/packages/zero-runtime/src/processors/css.ts b/packages/pigment-react/src/processors/css.ts
similarity index 99%
rename from packages/zero-runtime/src/processors/css.ts
rename to packages/pigment-react/src/processors/css.ts
index 7cc910f56f82ca..461a05315b9fcc 100644
--- a/packages/zero-runtime/src/processors/css.ts
+++ b/packages/pigment-react/src/processors/css.ts
@@ -21,7 +21,7 @@ import type { Primitive, TemplateCallback } from './keyframes';
*
* @example
* ```ts
- * import { css } from '@mui/zero-runtime';
+ * import { css } from '@pigmentcss/react';
*
* const class1 = css(({theme}) => ({
* color: (theme.vars || theme).palette.primary.main,
diff --git a/packages/zero-runtime/src/processors/generateAtomics.ts b/packages/pigment-react/src/processors/generateAtomics.ts
similarity index 100%
rename from packages/zero-runtime/src/processors/generateAtomics.ts
rename to packages/pigment-react/src/processors/generateAtomics.ts
diff --git a/packages/zero-runtime/src/processors/keyframes.ts b/packages/pigment-react/src/processors/keyframes.ts
similarity index 100%
rename from packages/zero-runtime/src/processors/keyframes.ts
rename to packages/pigment-react/src/processors/keyframes.ts
diff --git a/packages/zero-runtime/src/processors/styled.ts b/packages/pigment-react/src/processors/styled.ts
similarity index 100%
rename from packages/zero-runtime/src/processors/styled.ts
rename to packages/pigment-react/src/processors/styled.ts
diff --git a/packages/zero-runtime/src/processors/sx.ts b/packages/pigment-react/src/processors/sx.ts
similarity index 100%
rename from packages/zero-runtime/src/processors/sx.ts
rename to packages/pigment-react/src/processors/sx.ts
diff --git a/packages/zero-runtime/src/styled.d.ts b/packages/pigment-react/src/styled.d.ts
similarity index 100%
rename from packages/zero-runtime/src/styled.d.ts
rename to packages/pigment-react/src/styled.d.ts
diff --git a/packages/zero-runtime/src/styled.jsx b/packages/pigment-react/src/styled.jsx
similarity index 100%
rename from packages/zero-runtime/src/styled.jsx
rename to packages/pigment-react/src/styled.jsx
diff --git a/packages/zero-runtime/src/sx.d.ts b/packages/pigment-react/src/sx.d.ts
similarity index 100%
rename from packages/zero-runtime/src/sx.d.ts
rename to packages/pigment-react/src/sx.d.ts
diff --git a/packages/zero-runtime/src/sx.js b/packages/pigment-react/src/sx.js
similarity index 100%
rename from packages/zero-runtime/src/sx.js
rename to packages/pigment-react/src/sx.js
diff --git a/packages/zero-runtime/src/theme.ts b/packages/pigment-react/src/theme.ts
similarity index 100%
rename from packages/zero-runtime/src/theme.ts
rename to packages/pigment-react/src/theme.ts
diff --git a/packages/zero-runtime/src/utils/checkStaticObjectOrArray.ts b/packages/pigment-react/src/utils/checkStaticObjectOrArray.ts
similarity index 100%
rename from packages/zero-runtime/src/utils/checkStaticObjectOrArray.ts
rename to packages/pigment-react/src/utils/checkStaticObjectOrArray.ts
diff --git a/packages/zero-runtime/src/utils/convertAtomicsToCss.ts b/packages/pigment-react/src/utils/convertAtomicsToCss.ts
similarity index 100%
rename from packages/zero-runtime/src/utils/convertAtomicsToCss.ts
rename to packages/pigment-react/src/utils/convertAtomicsToCss.ts
diff --git a/packages/zero-runtime/src/utils/cssFnValueToVariable.ts b/packages/pigment-react/src/utils/cssFnValueToVariable.ts
similarity index 100%
rename from packages/zero-runtime/src/utils/cssFnValueToVariable.ts
rename to packages/pigment-react/src/utils/cssFnValueToVariable.ts
diff --git a/packages/zero-runtime/src/utils/cssFunctionTransformerPlugin.ts b/packages/pigment-react/src/utils/cssFunctionTransformerPlugin.ts
similarity index 96%
rename from packages/zero-runtime/src/utils/cssFunctionTransformerPlugin.ts
rename to packages/pigment-react/src/utils/cssFunctionTransformerPlugin.ts
index b5d5d4b8db2d2a..1a4985c50f0625 100644
--- a/packages/zero-runtime/src/utils/cssFunctionTransformerPlugin.ts
+++ b/packages/pigment-react/src/utils/cssFunctionTransformerPlugin.ts
@@ -31,7 +31,7 @@ const cssFunctionTransformerPlugin = declare((api, pluginOpt
const finalPrefix = theme?.cssVarPrefix || '';
return {
- name: '@mui/zero-internal/cssFunctionTransformerPlugin',
+ name: '@pigmentcss/zero-internal/cssFunctionTransformerPlugin',
visitor: {
// @TODO - Maybe add support for plain strings in template
// literals as well.
diff --git a/packages/zero-runtime/src/utils/emotion.ts b/packages/pigment-react/src/utils/emotion.ts
similarity index 100%
rename from packages/zero-runtime/src/utils/emotion.ts
rename to packages/pigment-react/src/utils/emotion.ts
diff --git a/packages/zero-runtime/src/utils/extendTheme.ts b/packages/pigment-react/src/utils/extendTheme.ts
similarity index 100%
rename from packages/zero-runtime/src/utils/extendTheme.ts
rename to packages/pigment-react/src/utils/extendTheme.ts
diff --git a/packages/zero-runtime/src/utils/generateCss.ts b/packages/pigment-react/src/utils/generateCss.ts
similarity index 100%
rename from packages/zero-runtime/src/utils/generateCss.ts
rename to packages/pigment-react/src/utils/generateCss.ts
diff --git a/packages/zero-runtime/src/utils/index.ts b/packages/pigment-react/src/utils/index.ts
similarity index 100%
rename from packages/zero-runtime/src/utils/index.ts
rename to packages/pigment-react/src/utils/index.ts
diff --git a/packages/zero-runtime/src/utils/isUnitLess.ts b/packages/pigment-react/src/utils/isUnitLess.ts
similarity index 100%
rename from packages/zero-runtime/src/utils/isUnitLess.ts
rename to packages/pigment-react/src/utils/isUnitLess.ts
diff --git a/packages/zero-runtime/src/utils/pre-linaria-plugin.ts b/packages/pigment-react/src/utils/pre-linaria-plugin.ts
similarity index 98%
rename from packages/zero-runtime/src/utils/pre-linaria-plugin.ts
rename to packages/pigment-react/src/utils/pre-linaria-plugin.ts
index d107175ef37f2f..17a41372362750 100644
--- a/packages/zero-runtime/src/utils/pre-linaria-plugin.ts
+++ b/packages/pigment-react/src/utils/pre-linaria-plugin.ts
@@ -6,7 +6,7 @@ export const babelPlugin = declare((api) => {
api.assertVersion(7);
const { types: t } = api;
return {
- name: '@mui/zero-babel-plugin',
+ name: '@pigmentcss/zero-babel-plugin',
visitor: {
JSXAttribute(path) {
const namePath = path.get('name');
diff --git a/packages/zero-runtime/src/utils/preprocessor.ts b/packages/pigment-react/src/utils/preprocessor.ts
similarity index 100%
rename from packages/zero-runtime/src/utils/preprocessor.ts
rename to packages/pigment-react/src/utils/preprocessor.ts
diff --git a/packages/zero-runtime/src/utils/processCssObject.ts b/packages/pigment-react/src/utils/processCssObject.ts
similarity index 100%
rename from packages/zero-runtime/src/utils/processCssObject.ts
rename to packages/pigment-react/src/utils/processCssObject.ts
diff --git a/packages/zero-runtime/src/utils/sxObjectExtractor.ts b/packages/pigment-react/src/utils/sxObjectExtractor.ts
similarity index 100%
rename from packages/zero-runtime/src/utils/sxObjectExtractor.ts
rename to packages/pigment-react/src/utils/sxObjectExtractor.ts
diff --git a/packages/zero-runtime/src/utils/valueToLiteral.ts b/packages/pigment-react/src/utils/valueToLiteral.ts
similarity index 100%
rename from packages/zero-runtime/src/utils/valueToLiteral.ts
rename to packages/pigment-react/src/utils/valueToLiteral.ts
diff --git a/packages/zero-runtime/styles.css b/packages/pigment-react/styles.css
similarity index 100%
rename from packages/zero-runtime/styles.css
rename to packages/pigment-react/styles.css
diff --git a/packages/zero-runtime/tests/README.md b/packages/pigment-react/tests/README.md
similarity index 100%
rename from packages/zero-runtime/tests/README.md
rename to packages/pigment-react/tests/README.md
diff --git a/packages/zero-runtime/tests/fixtures/styled.input.js b/packages/pigment-react/tests/fixtures/styled.input.js
similarity index 92%
rename from packages/zero-runtime/tests/fixtures/styled.input.js
rename to packages/pigment-react/tests/fixtures/styled.input.js
index f31bc5267948f6..20e0f7f425cf95 100644
--- a/packages/zero-runtime/tests/fixtures/styled.input.js
+++ b/packages/pigment-react/tests/fixtures/styled.input.js
@@ -1,4 +1,4 @@
-import { styled, keyframes, css } from '@mui/zero-runtime';
+import { styled, keyframes, css } from '@pigmentcss/react';
const rotateKeyframe = keyframes({
from: {
diff --git a/packages/pigment-react/tests/fixtures/styled.output.css b/packages/pigment-react/tests/fixtures/styled.output.css
new file mode 100644
index 00000000000000..64f8bb93f42fc4
--- /dev/null
+++ b/packages/pigment-react/tests/fixtures/styled.output.css
@@ -0,0 +1,6 @@
+@keyframes r1ub6j9g{from{transform:rotate(360deg);}to{transform:rotate(0deg);}}
+.c1y26wbb{color:red;animation:r1ub6j9g 2s ease-out 0s infinite;}
+.ct00dwm{color:red;font-size:3rem;}
+.soujkwr{display:block;position:absolute;border-radius:inherit;background-color:currentColor;opacity:0.38;font-size:3rem;}
+.soujkwr-1{font-size:3rem;}
+.s14dtw5g{display:block;opacity:0.38;font-size:3rem;}
diff --git a/packages/pigment-react/tests/fixtures/styled.output.js b/packages/pigment-react/tests/fixtures/styled.output.js
new file mode 100644
index 00000000000000..e7d263b7520ef9
--- /dev/null
+++ b/packages/pigment-react/tests/fixtures/styled.output.js
@@ -0,0 +1,17 @@
+import { styled as _styled3 } from "@pigmentcss/react";
+import { styled as _styled2 } from "@pigmentcss/react";
+import { styled as _styled } from "@pigmentcss/react";
+import _theme from "@pigmentcss/react/theme";
+const Component = /*#__PURE__*/_styled("div")({
+ classes: ["c1y26wbb"]
+});
+const cls1 = "ct00dwm";
+const SliderRail = /*#__PURE__*/_styled2("span", {
+ name: 'MuiSlider',
+ slot: 'Rail'
+})({
+ classes: ["soujkwr", "soujkwr-1"]
+});
+const SliderRail2 = /*#__PURE__*/_styled3("span")({
+ classes: ["s14dtw5g"]
+});
diff --git a/packages/zero-runtime/tests/zero-runtime.test.js b/packages/pigment-react/tests/pigment.test.ts
similarity index 97%
rename from packages/zero-runtime/tests/zero-runtime.test.js
rename to packages/pigment-react/tests/pigment.test.ts
index cb5be8f401351f..c2a1ffddaae511 100644
--- a/packages/zero-runtime/tests/zero-runtime.test.js
+++ b/packages/pigment-react/tests/pigment.test.ts
@@ -3,7 +3,7 @@ import * as path from 'node:path';
import { expect } from 'chai';
import { asyncResolveFallback } from '@wyw-in-js/shared';
import { TransformCacheCollection, transform, createFileReporter } from '@wyw-in-js/transform';
-import { preprocessor } from '@mui/zero-runtime/utils';
+import { preprocessor } from '@pigmentcss/react/utils';
const files = fs.readdirSync(path.join(__dirname, 'fixtures'));
diff --git a/packages/zero-runtime/theme/index.d.ts b/packages/pigment-react/theme/index.d.ts
similarity index 100%
rename from packages/zero-runtime/theme/index.d.ts
rename to packages/pigment-react/theme/index.d.ts
diff --git a/packages/zero-runtime/theme/index.js b/packages/pigment-react/theme/index.js
similarity index 100%
rename from packages/zero-runtime/theme/index.js
rename to packages/pigment-react/theme/index.js
diff --git a/packages/zero-runtime/theme/index.mjs b/packages/pigment-react/theme/index.mjs
similarity index 100%
rename from packages/zero-runtime/theme/index.mjs
rename to packages/pigment-react/theme/index.mjs
diff --git a/packages/zero-runtime/tsconfig.build.json b/packages/pigment-react/tsconfig.build.json
similarity index 100%
rename from packages/zero-runtime/tsconfig.build.json
rename to packages/pigment-react/tsconfig.build.json
diff --git a/packages/zero-runtime/tsconfig.json b/packages/pigment-react/tsconfig.json
similarity index 100%
rename from packages/zero-runtime/tsconfig.json
rename to packages/pigment-react/tsconfig.json
diff --git a/packages/zero-runtime/tsup.config.ts b/packages/pigment-react/tsup.config.ts
similarity index 100%
rename from packages/zero-runtime/tsup.config.ts
rename to packages/pigment-react/tsup.config.ts
diff --git a/packages/zero-unplugin/.gitignore b/packages/pigment-unplugin/.gitignore
similarity index 100%
rename from packages/zero-unplugin/.gitignore
rename to packages/pigment-unplugin/.gitignore
diff --git a/packages/zero-unplugin/package.json b/packages/pigment-unplugin/package.json
similarity index 75%
rename from packages/zero-unplugin/package.json
rename to packages/pigment-unplugin/package.json
index 852dd3eff11908..75e61617251841 100644
--- a/packages/zero-unplugin/package.json
+++ b/packages/pigment-unplugin/package.json
@@ -1,21 +1,21 @@
{
- "name": "@mui/zero-unplugin",
+ "name": "@pigmentcss/unplugin",
"version": "0.0.1",
"main": "build/index.js",
"module": "build/index.mjs",
"types": "build/index.d.ts",
"author": "MUI Team",
- "description": "Webpack integration for @mui/zero-runtime CSS-in-JS library.",
+ "description": "Webpack integration for Pigment CSS.",
"repository": {
"type": "git",
"url": "https://github.com/mui/material-ui.git",
- "directory": "packages/zero-unplugin"
+ "directory": "packages/pigment-unplugin"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/mui/material-ui/issues"
},
- "homepage": "https://github.com/mui/material-ui/tree/master/packages/zero-runtime",
+ "homepage": "https://github.com/mui/material-ui/tree/master/packages/pigment-react",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/mui-org"
@@ -23,13 +23,13 @@
"scripts": {
"clean": "rimraf build types",
"watch": "tsup --watch --tsconfig tsconfig.build.json",
- "copy-license": "node ../../scripts/zero-runtime-license.mjs",
+ "copy-license": "node ../../scripts/pigment-license.mjs",
"build": "tsup --tsconfig tsconfig.build.json",
"typecheck": "tsc --noEmit -p ."
},
"dependencies": {
"@babel/core": "^7.23.9",
- "@mui/zero-runtime": "workspace:^",
+ "@pigmentcss/react": "workspace:^",
"@wyw-in-js/shared": "^0.4.1",
"@wyw-in-js/transform": "^0.4.1",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
@@ -38,9 +38,6 @@
"devDependencies": {
"@types/babel__core": "^7.20.5"
},
- "peerDependencies": {
- "@mui/zero-runtime": "workspace:^"
- },
"sideEffects": false,
"publishConfig": {
"access": "public"
diff --git a/packages/zero-unplugin/src/index.ts b/packages/pigment-unplugin/src/index.ts
similarity index 92%
rename from packages/zero-unplugin/src/index.ts
rename to packages/pigment-unplugin/src/index.ts
index 4bcabc01f3cd75..c35cd38dc4f6cb 100644
--- a/packages/zero-unplugin/src/index.ts
+++ b/packages/pigment-unplugin/src/index.ts
@@ -1,7 +1,7 @@
import { transformAsync } from '@babel/core';
import {
type Preprocessor,
- type PluginOptions as LinariaPluginOptions,
+ type PluginOptions as WywInJsPluginOptions,
type IFileReporterOptions,
TransformCacheCollection,
transform,
@@ -20,7 +20,7 @@ import {
generateThemeTokens,
extendTheme,
type Theme as BaseTheme,
-} from '@mui/zero-runtime/utils';
+} from '@pigmentcss/react/utils';
type NextMeta = {
type: 'next';
@@ -40,7 +40,7 @@ type WebpackMeta = {
type Meta = NextMeta | ViteMeta | WebpackMeta;
-export type PluginOptions = {
+export type PigmentOptions = {
theme?: Theme;
transformLibraries?: string[];
preprocessor?: Preprocessor;
@@ -49,7 +49,7 @@ export type PluginOptions = {
meta?: Meta;
asyncResolve?: (what: string) => string | null;
transformSx?: boolean;
-} & Partial;
+} & Partial;
const extensions = ['.js', '.jsx', '.mjs', '.cjs', '.ts', '.tsx', '.mts', '.cts'];
@@ -82,7 +82,7 @@ function isZeroRuntimeProcessableFile(fileName: string, transformLibraries: stri
const globalCssFileLookup = new Map();
const globalCssLookup = new Map();
-const pluginName = 'ZeroWebpackPlugin';
+const pluginName = 'PigmentCSSWebpackPlugin';
function innerNoop() {
return null;
@@ -92,7 +92,7 @@ function outerNoop() {
return innerNoop;
}
-export const plugin = createUnplugin((options) => {
+export const plugin = createUnplugin((options) => {
const {
theme,
meta,
@@ -268,17 +268,17 @@ export const plugin = createUnplugin((options) => {
transformInclude(id) {
return (
// this file should exist in the package
- id.endsWith('@mui/zero-runtime/styles.css') ||
- id.endsWith('/zero-runtime/styles.css') ||
- id.includes('@mui/zero-runtime/theme') ||
- id.includes('/zero-runtime/theme')
+ id.endsWith(`${process.env.RUNTIME_PACKAGE_NAME}/styles.css`) ||
+ id.endsWith('/pigment-react/styles.css') ||
+ id.includes(`${process.env.RUNTIME_PACKAGE_NAME}/theme`) ||
+ id.includes('/pigment-react/theme')
);
},
transform(_code, id) {
if (id.endsWith('styles.css')) {
return theme ? generateTokenCss(theme) : _code;
}
- if (id.includes('zero-runtime/theme')) {
+ if (id.includes('pigment-react/theme')) {
return `export default ${
theme ? JSON.stringify(generateThemeTokens(theme)) : '{}'
};`;
@@ -288,10 +288,10 @@ export const plugin = createUnplugin((options) => {
}
: {
resolveId(source: string) {
- if (source === '@mui/zero-runtime/styles.css') {
+ if (source === `${process.env.RUNTIME_PACKAGE_NAME}/styles.css`) {
return VIRTUAL_CSS_FILE;
}
- if (source === '@mui/zero-runtime/theme') {
+ if (source === `${process.env.RUNTIME_PACKAGE_NAME}/theme`) {
return VIRTUAL_THEME_FILE;
}
return null;
@@ -339,7 +339,7 @@ export const plugin = createUnplugin((options) => {
});
export const webpack = plugin.webpack as unknown as UnpluginFactoryOutput<
- PluginOptions,
+ PigmentOptions,
WebpackPluginInstance
>;
diff --git a/packages/zero-unplugin/tsconfig.build.json b/packages/pigment-unplugin/tsconfig.build.json
similarity index 100%
rename from packages/zero-unplugin/tsconfig.build.json
rename to packages/pigment-unplugin/tsconfig.build.json
diff --git a/packages/zero-unplugin/tsconfig.json b/packages/pigment-unplugin/tsconfig.json
similarity index 79%
rename from packages/zero-unplugin/tsconfig.json
rename to packages/pigment-unplugin/tsconfig.json
index b0083e731e2538..48af5a675fbc3f 100644
--- a/packages/zero-unplugin/tsconfig.json
+++ b/packages/pigment-unplugin/tsconfig.json
@@ -9,8 +9,8 @@
"@mui/system/*": ["./packages/mui-system/src/*"],
"@mui/utils": ["./packages/mui-utils/src"],
"@mui/utils/*": ["./packages/mui-utils/src/*"],
- "@mui/zero-runtime": ["./packages/zero-runtime/src"],
- "@mui/zero-runtime/*": ["./packages/zero-runtime/src/*"]
+ "@pigmentcss/react": ["./packages/pigment-react/src"],
+ "@pigmentcss/react/*": ["./packages/pigment-react/src/*"]
}
},
"include": ["src/**/*.ts"],
diff --git a/packages/zero-unplugin/tsup.config.ts b/packages/pigment-unplugin/tsup.config.ts
similarity index 81%
rename from packages/zero-unplugin/tsup.config.ts
rename to packages/pigment-unplugin/tsup.config.ts
index 44c71e50b1ec5b..ee75314ee863c4 100644
--- a/packages/zero-unplugin/tsup.config.ts
+++ b/packages/pigment-unplugin/tsup.config.ts
@@ -1,6 +1,6 @@
import { Options, defineConfig } from 'tsup';
import config from '../../tsup.config';
-import runtimePackageJson from '../zero-runtime/package.json';
+import runtimePackageJson from '../pigment-react/package.json';
const baseConfig: Options = {
...(config as Options),
diff --git a/packages/zero-vite-plugin/.gitignore b/packages/pigment-vite-plugin/.gitignore
similarity index 100%
rename from packages/zero-vite-plugin/.gitignore
rename to packages/pigment-vite-plugin/.gitignore
diff --git a/packages/zero-vite-plugin/package.json b/packages/pigment-vite-plugin/package.json
similarity index 79%
rename from packages/zero-vite-plugin/package.json
rename to packages/pigment-vite-plugin/package.json
index 15e561fcca0f1b..d499026aed289c 100644
--- a/packages/zero-vite-plugin/package.json
+++ b/packages/pigment-vite-plugin/package.json
@@ -1,21 +1,21 @@
{
- "name": "@mui/zero-vite-plugin",
+ "name": "@pigmentcss/vite-plugin",
"version": "0.0.1",
"main": "build/index.js",
"module": "build/index.mjs",
"types": "build/index.d.ts",
"author": "MUI Team",
- "description": "Vite integration for @mui/zero-runtime CSS-in-JS library.",
+ "description": "Vite integration for Pigment CSS.",
"repository": {
"type": "git",
"url": "https://github.com/mui/material-ui.git",
- "directory": "packages/zero-vite-plugin"
+ "directory": "packages/pigment-vite-plugin"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/mui/material-ui/issues"
},
- "homepage": "https://github.com/mui/material-ui/tree/master/packages/zero-runtime",
+ "homepage": "https://github.com/mui/material-ui/tree/master/packages/pigment-react",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/mui-org"
@@ -23,14 +23,14 @@
"scripts": {
"clean": "rimraf build",
"watch": "tsup --watch",
- "copy-license": "node ../../scripts/zero-runtime-license.mjs",
+ "copy-license": "node ../../scripts/pigment-license.mjs",
"build": "tsup",
"typecheck": "tsc --noEmit -p ."
},
"dependencies": {
"@babel/core": "^7.23.9",
"@babel/preset-typescript": "^7.23.3",
- "@mui/zero-runtime": "workspace:^",
+ "@pigmentcss/react": "workspace:^",
"@wyw-in-js/shared": "^0.4.1",
"@wyw-in-js/transform": "^0.4.1",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24"
diff --git a/packages/zero-vite-plugin/src/index.ts b/packages/pigment-vite-plugin/src/index.ts
similarity index 85%
rename from packages/zero-vite-plugin/src/index.ts
rename to packages/pigment-vite-plugin/src/index.ts
index 98296aba22a0d0..e3c57ab4a9f753 100644
--- a/packages/zero-vite-plugin/src/index.ts
+++ b/packages/pigment-vite-plugin/src/index.ts
@@ -5,11 +5,11 @@ import {
generateThemeTokens,
type Theme,
extendTheme,
-} from '@mui/zero-runtime/utils';
+} from '@pigmentcss/react/utils';
import { transformAsync } from '@babel/core';
-import baseZeroVitePlugin, { type VitePluginOptions } from './zero-vite-plugin';
+import baseWywPluginPlugin, { type VitePluginOptions } from './vite-plugin';
-export interface ZeroVitePluginOptions extends VitePluginOptions {
+export interface PigmentOptions extends VitePluginOptions {
/**
* The theme object that you want to be passed to the `styled` function
*/
@@ -41,7 +41,7 @@ function isZeroRuntimeProcessableFile(fileName: string, transformLibraries: stri
);
}
-export function zeroVitePlugin(options: ZeroVitePluginOptions) {
+export function pigment(options: PigmentOptions) {
const {
theme,
babelOptions = {},
@@ -56,10 +56,10 @@ export function zeroVitePlugin(options: ZeroVitePluginOptions) {
name: 'vite-mui-theme-injection-plugin',
enforce: 'pre',
resolveId(source) {
- if (source === '@mui/zero-runtime/styles.css') {
+ if (source === `${process.env.RUNTIME_PACKAGE_NAME}/styles.css`) {
return VIRTUAL_CSS_FILE;
}
- if (source === '@mui/zero-runtime/theme') {
+ if (source === `${process.env.RUNTIME_PACKAGE_NAME}/theme`) {
return VIRTUAL_THEME_FILE;
}
return null;
@@ -90,7 +90,7 @@ export function zeroVitePlugin(options: ZeroVitePluginOptions) {
filename,
babelrc: false,
configFile: false,
- plugins: [['@mui/zero-runtime/exports/sx-plugin']],
+ plugins: [[`${process.env.RUNTIME_PACKAGE_NAME}/exports/sx-plugin`]],
});
return {
code: result?.code ?? code,
@@ -104,7 +104,7 @@ export function zeroVitePlugin(options: ZeroVitePluginOptions) {
};
}
- const zeroPlugin = baseZeroVitePlugin({
+ const zeroPlugin = baseWywPluginPlugin({
themeArgs: {
theme,
},
diff --git a/packages/zero-vite-plugin/src/zero-vite-plugin.ts b/packages/pigment-vite-plugin/src/vite-plugin.ts
similarity index 97%
rename from packages/zero-vite-plugin/src/zero-vite-plugin.ts
rename to packages/pigment-vite-plugin/src/vite-plugin.ts
index 7f38bbd4630f1a..3fe9588297a016 100644
--- a/packages/zero-vite-plugin/src/zero-vite-plugin.ts
+++ b/packages/pigment-vite-plugin/src/vite-plugin.ts
@@ -20,7 +20,7 @@ import {
type PluginOptions,
type IFileReporterOptions,
} from '@wyw-in-js/transform';
-import { type PluginCustomOptions } from '@mui/zero-runtime/utils';
+import { type PluginCustomOptions } from '@pigmentcss/react/utils';
export type VitePluginOptions = {
debug?: IFileReporterOptions | false | null | undefined;
@@ -41,7 +41,7 @@ function outerNoop() {
return innerNoop;
}
-export default function zeroVitePlugin({
+export default function wywVitePlugin({
debug,
include,
exclude,
@@ -211,7 +211,7 @@ export default function zeroVitePlugin({
if (tagResult) {
return tagResult;
}
- if (source.endsWith('/zero-styled') || source.endsWith('/zero-useThemeProps')) {
+ if (source.endsWith('/zero-styled')) {
return `${process.env.RUNTIME_PACKAGE_NAME}/exports/${tag}`;
}
return null;
diff --git a/packages/zero-vite-plugin/tsconfig.build.json b/packages/pigment-vite-plugin/tsconfig.build.json
similarity index 100%
rename from packages/zero-vite-plugin/tsconfig.build.json
rename to packages/pigment-vite-plugin/tsconfig.build.json
diff --git a/packages/zero-vite-plugin/tsconfig.json b/packages/pigment-vite-plugin/tsconfig.json
similarity index 77%
rename from packages/zero-vite-plugin/tsconfig.json
rename to packages/pigment-vite-plugin/tsconfig.json
index 72c0ce02c10646..d4ee3196900b58 100644
--- a/packages/zero-vite-plugin/tsconfig.json
+++ b/packages/pigment-vite-plugin/tsconfig.json
@@ -8,8 +8,8 @@
"@mui/system/*": ["./packages/mui-system/src/*"],
"@mui/utils": ["./packages/mui-utils/src"],
"@mui/utils/*": ["./packages/mui-utils/src/*"],
- "@mui/zero-runtime": ["./packages/zero-runtime/src"],
- "@mui/zero-runtime/*": ["./packages/zero-runtime/src/*"]
+ "@pigmentcss/react": ["./packages/pigment-react/src"],
+ "@pigmentcss/react/*": ["./packages/pigment-react/src/*"]
}
},
"include": ["src/**/*"],
diff --git a/packages/zero-vite-plugin/tsup.config.ts b/packages/pigment-vite-plugin/tsup.config.ts
similarity index 76%
rename from packages/zero-vite-plugin/tsup.config.ts
rename to packages/pigment-vite-plugin/tsup.config.ts
index 16d0001d076fe1..df6f5ec24d6e7f 100644
--- a/packages/zero-vite-plugin/tsup.config.ts
+++ b/packages/pigment-vite-plugin/tsup.config.ts
@@ -1,8 +1,8 @@
import { Options, defineConfig } from 'tsup';
import config from '../../tsup.config';
-import zeroPkgJson from '../zero-runtime/package.json';
+import zeroPkgJson from '../pigment-react/package.json';
-const external = ['@mui/zero-runtime/utils'];
+const external = [`${zeroPkgJson.name}/utils`];
const baseConfig: Options = {
...(config as Options),
diff --git a/packages/zero-runtime/src/css.js b/packages/zero-runtime/src/css.js
deleted file mode 100644
index ac7121318de31a..00000000000000
--- a/packages/zero-runtime/src/css.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default function css() {
- throw new Error(
- 'MUI: You were trying to call "css" function without configuring your bundler. Make sure to install the bundler specific plugin and use it. @mui/zero-vite-plugin for Vite integration or @mui/zero-next-plugin for Next.js integration.',
- );
-}
diff --git a/packages/zero-runtime/src/keyframes.js b/packages/zero-runtime/src/keyframes.js
deleted file mode 100644
index 46b3d31275da1f..00000000000000
--- a/packages/zero-runtime/src/keyframes.js
+++ /dev/null
@@ -1,5 +0,0 @@
-export default function keyframes() {
- throw new Error(
- 'MUI: You were trying to call "keyframes" function without configuring your bundler. Make sure to install the bundler specific plugin and use it. @mui/zero-vite-plugin for Vite integration or @mui/zero-next-plugin for Next.js integration.',
- );
-}
diff --git a/packages/zero-runtime/tests/fixtures/styled.output.css b/packages/zero-runtime/tests/fixtures/styled.output.css
deleted file mode 100644
index 97adc65f851038..00000000000000
--- a/packages/zero-runtime/tests/fixtures/styled.output.css
+++ /dev/null
@@ -1,6 +0,0 @@
-@keyframes r1yjyf7p{from{transform:rotate(360deg);}to{transform:rotate(0deg);}}
-.cir471u{color:red;animation:r1yjyf7p 2s ease-out 0s infinite;}
-.c1xj10ek{color:red;font-size:3rem;}
-.sefdpty{display:block;position:absolute;border-radius:inherit;background-color:currentColor;opacity:0.38;font-size:3rem;}
-.sefdpty-1{font-size:3rem;}
-.s13fhnbp{display:block;opacity:0.38;font-size:3rem;}
diff --git a/packages/zero-runtime/tests/fixtures/styled.output.js b/packages/zero-runtime/tests/fixtures/styled.output.js
deleted file mode 100644
index 8d8430f119ebdf..00000000000000
--- a/packages/zero-runtime/tests/fixtures/styled.output.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import { styled as _styled3 } from "@mui/zero-runtime";
-import { styled as _styled2 } from "@mui/zero-runtime";
-import { styled as _styled } from "@mui/zero-runtime";
-import _theme from "@mui/zero-runtime/theme";
-const Component = /*#__PURE__*/_styled("div")({
- classes: ["cir471u"]
-});
-const cls1 = "c1xj10ek";
-const SliderRail = /*#__PURE__*/_styled2("span", {
- name: 'MuiSlider',
- slot: 'Rail'
-})({
- classes: ["sefdpty", "sefdpty-1"]
-});
-const SliderRail2 = /*#__PURE__*/_styled3("span")({
- classes: ["s13fhnbp"]
-});
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index b4341cb485fe56..08cd9756db259b 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -2082,147 +2082,17 @@ importers:
specifier: ^11.2.0
version: 11.2.0
- packages/react-docgen-types:
- devDependencies:
- ast-types:
- specifier: 0.14.2
- version: 0.14.2
-
- packages/rsc-builder:
- dependencies:
- fs-extra:
- specifier: ^11.2.0
- version: 11.2.0
- yargs:
- specifier: ^17.7.2
- version: 17.7.2
- devDependencies:
- '@types/mocha':
- specifier: ^10.0.6
- version: 10.0.6
- '@types/node':
- specifier: ^18.19.19
- version: 18.19.19
-
- packages/test-utils:
- dependencies:
- '@babel/plugin-transform-modules-commonjs':
- specifier: ^7.23.3
- version: 7.23.3(@babel/core@7.23.9)
- '@babel/preset-typescript':
- specifier: ^7.23.3
- version: 7.23.3(@babel/core@7.23.9)
- '@babel/register':
- specifier: ^7.23.7
- version: 7.23.7(@babel/core@7.23.9)
- '@babel/runtime':
- specifier: ^7.23.9
- version: 7.23.9
- '@emotion/cache':
- specifier: ^11.11.0
- version: 11.11.0
- '@emotion/react':
- specifier: ^11.11.3
- version: 11.11.3(@types/react@18.2.55)(react@18.2.0)
- '@mnajdova/enzyme-adapter-react-18':
- specifier: ^0.2.0
- version: 0.2.0(enzyme@3.11.0)(react-dom@18.2.0)(react@18.2.0)
- '@testing-library/dom':
- specifier: ^9.3.4
- version: 9.3.4
- '@testing-library/react':
- specifier: ^14.2.1
- version: 14.2.1(react-dom@18.2.0)(react@18.2.0)
- chai:
- specifier: ^4.4.1
- version: 4.4.1
- chai-dom:
- specifier: ^1.12.0
- version: 1.12.0(chai@4.4.1)
- dom-accessibility-api:
- specifier: ^0.6.3
- version: 0.6.3
- enzyme:
- specifier: ^3.11.0
- version: 3.11.0
- format-util:
- specifier: ^1.0.5
- version: 1.0.5
- fs-extra:
- specifier: ^11.2.0
- version: 11.2.0
- jsdom:
- specifier: ^24.0.0
- version: 24.0.0
- lodash:
- specifier: ^4.17.21
- version: 4.17.21
- mocha:
- specifier: ^10.3.0
- version: 10.3.0
- playwright:
- specifier: ^1.41.2
- version: 1.41.2
- prop-types:
- specifier: ^15.8.1
- version: 15.8.1
- react:
- specifier: ^18.2.0
- version: 18.2.0
- react-dom:
- specifier: ^18.2.0
- version: 18.2.0(react@18.2.0)
- react-test-renderer:
- specifier: ^18.2.0
- version: 18.2.0(react@18.2.0)
- sinon:
- specifier: ^15.2.0
- version: 15.2.0
- devDependencies:
- '@types/chai':
- specifier: ^4.3.11
- version: 4.3.11
- '@types/chai-dom':
- specifier: ^1.11.3
- version: 1.11.3
- '@types/enzyme':
- specifier: ^3.10.18
- version: 3.10.18
- '@types/format-util':
- specifier: ^1.0.4
- version: 1.0.4
- '@types/prop-types':
- specifier: ^15.7.11
- version: 15.7.11
- '@types/react':
- specifier: ^18.2.55
- version: 18.2.55
- '@types/react-dom':
- specifier: 18.2.19
- version: 18.2.19
- '@types/react-test-renderer':
- specifier: ^18.0.7
- version: 18.0.7
- '@types/sinon':
- specifier: ^10.0.20
- version: 10.0.20
- typescript:
- specifier: ^5.3.3
- version: 5.3.3
-
- packages/waterfall: {}
-
- packages/zero-next-plugin:
+ packages/pigment-nextjs-plugin:
dependencies:
- '@mui/zero-unplugin':
+ '@pigmentcss/unplugin':
specifier: workspace:^
- version: link:../zero-unplugin
+ version: link:../pigment-unplugin
devDependencies:
next:
specifier: ^13.5.1
version: 13.5.1(@babel/core@7.23.9)(babel-plugin-macros@3.1.0)(react-dom@18.2.0)(react@18.2.0)
- packages/zero-runtime:
+ packages/pigment-react:
dependencies:
'@babel/core':
specifier: ^7.23.9
@@ -2310,14 +2180,14 @@ importers:
specifier: ^18.2.0
version: 18.2.0
- packages/zero-unplugin:
+ packages/pigment-unplugin:
dependencies:
'@babel/core':
specifier: ^7.23.9
version: 7.23.9
- '@mui/zero-runtime':
+ '@pigmentcss/react':
specifier: workspace:^
- version: link:../zero-runtime
+ version: link:../pigment-react
'@wyw-in-js/shared':
specifier: ^0.4.1
version: 0.4.1
@@ -2335,7 +2205,7 @@ importers:
specifier: ^7.20.5
version: 7.20.5
- packages/zero-vite-plugin:
+ packages/pigment-vite-plugin:
dependencies:
'@babel/core':
specifier: ^7.23.9
@@ -2343,9 +2213,9 @@ importers:
'@babel/preset-typescript':
specifier: ^7.23.3
version: 7.23.3(@babel/core@7.23.9)
- '@mui/zero-runtime':
+ '@pigmentcss/react':
specifier: workspace:^
- version: link:../zero-runtime
+ version: link:../pigment-react
'@wyw-in-js/shared':
specifier: ^0.4.1
version: 0.4.1
@@ -2363,6 +2233,136 @@ importers:
specifier: ^5.0.12
version: 5.0.12(@types/node@18.19.19)
+ packages/react-docgen-types:
+ devDependencies:
+ ast-types:
+ specifier: 0.14.2
+ version: 0.14.2
+
+ packages/rsc-builder:
+ dependencies:
+ fs-extra:
+ specifier: ^11.2.0
+ version: 11.2.0
+ yargs:
+ specifier: ^17.7.2
+ version: 17.7.2
+ devDependencies:
+ '@types/mocha':
+ specifier: ^10.0.6
+ version: 10.0.6
+ '@types/node':
+ specifier: ^18.19.19
+ version: 18.19.19
+
+ packages/test-utils:
+ dependencies:
+ '@babel/plugin-transform-modules-commonjs':
+ specifier: ^7.23.3
+ version: 7.23.3(@babel/core@7.23.9)
+ '@babel/preset-typescript':
+ specifier: ^7.23.3
+ version: 7.23.3(@babel/core@7.23.9)
+ '@babel/register':
+ specifier: ^7.23.7
+ version: 7.23.7(@babel/core@7.23.9)
+ '@babel/runtime':
+ specifier: ^7.23.9
+ version: 7.23.9
+ '@emotion/cache':
+ specifier: ^11.11.0
+ version: 11.11.0
+ '@emotion/react':
+ specifier: ^11.11.3
+ version: 11.11.3(@types/react@18.2.55)(react@18.2.0)
+ '@mnajdova/enzyme-adapter-react-18':
+ specifier: ^0.2.0
+ version: 0.2.0(enzyme@3.11.0)(react-dom@18.2.0)(react@18.2.0)
+ '@testing-library/dom':
+ specifier: ^9.3.4
+ version: 9.3.4
+ '@testing-library/react':
+ specifier: ^14.2.1
+ version: 14.2.1(react-dom@18.2.0)(react@18.2.0)
+ chai:
+ specifier: ^4.4.1
+ version: 4.4.1
+ chai-dom:
+ specifier: ^1.12.0
+ version: 1.12.0(chai@4.4.1)
+ dom-accessibility-api:
+ specifier: ^0.6.3
+ version: 0.6.3
+ enzyme:
+ specifier: ^3.11.0
+ version: 3.11.0
+ format-util:
+ specifier: ^1.0.5
+ version: 1.0.5
+ fs-extra:
+ specifier: ^11.2.0
+ version: 11.2.0
+ jsdom:
+ specifier: ^24.0.0
+ version: 24.0.0
+ lodash:
+ specifier: ^4.17.21
+ version: 4.17.21
+ mocha:
+ specifier: ^10.3.0
+ version: 10.3.0
+ playwright:
+ specifier: ^1.41.2
+ version: 1.41.2
+ prop-types:
+ specifier: ^15.8.1
+ version: 15.8.1
+ react:
+ specifier: ^18.2.0
+ version: 18.2.0
+ react-dom:
+ specifier: ^18.2.0
+ version: 18.2.0(react@18.2.0)
+ react-test-renderer:
+ specifier: ^18.2.0
+ version: 18.2.0(react@18.2.0)
+ sinon:
+ specifier: ^15.2.0
+ version: 15.2.0
+ devDependencies:
+ '@types/chai':
+ specifier: ^4.3.11
+ version: 4.3.11
+ '@types/chai-dom':
+ specifier: ^1.11.3
+ version: 1.11.3
+ '@types/enzyme':
+ specifier: ^3.10.18
+ version: 3.10.18
+ '@types/format-util':
+ specifier: ^1.0.4
+ version: 1.0.4
+ '@types/prop-types':
+ specifier: ^15.7.11
+ version: 15.7.11
+ '@types/react':
+ specifier: ^18.2.55
+ version: 18.2.55
+ '@types/react-dom':
+ specifier: 18.2.19
+ version: 18.2.19
+ '@types/react-test-renderer':
+ specifier: ^18.0.7
+ version: 18.0.7
+ '@types/sinon':
+ specifier: ^10.0.20
+ version: 10.0.20
+ typescript:
+ specifier: ^5.3.3
+ version: 5.3.3
+
+ packages/waterfall: {}
+
test:
devDependencies:
'@babel/runtime':
diff --git a/scripts/zero-runtime-license.mjs b/scripts/pigment-license.mjs
similarity index 100%
rename from scripts/zero-runtime-license.mjs
rename to scripts/pigment-license.mjs
diff --git a/tsconfig.json b/tsconfig.json
index 1dcf1925a54a49..8a68aeef36143e 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -45,14 +45,12 @@
"@mui/joy/*": ["./packages/mui-joy/src/*"],
"@mui/icons-material": ["./packages/mui-icons-material/lib"],
"@mui/icons-material/*": ["./packages/mui-icons-material/lib/*"],
- "@mui/zero-next-plugin": ["./packages/zero-next-plugin/src"],
- "@mui/zero-next-plugin/*": ["./packages/zero-next-plugin/src/*"],
- "@mui/zero-runtime": ["./packages/zero-runtime/src"],
- "@mui/zero-runtime/*": ["./packages/zero-runtime/src/*"],
- "@mui/zero-tag-processor": ["./packages/zero-tag-processor/src"],
- "@mui/zero-tag-processor/*": ["./packages/zero-tag-processor/src/*"],
- "@mui/zero-vite-plugin": ["./packages/zero-vite-plugin/src"],
- "@mui/zero-vite-plugin/*": ["./packages/zero-vite-plugin/src/*"],
+ "@pigmentcss/nextjs-plugin": ["./packages/pigment-nextjs-plugin/src"],
+ "@pigmentcss/nextjs-plugin/*": ["./packages/pigment-nextjs-plugin/src/*"],
+ "@pigmentcss/react": ["./packages/pigment-react/src"],
+ "@pigmentcss/react/*": ["./packages/pigment-react/src/*"],
+ "@pigmentcss/vite-plugin": ["./packages/pigment-vite-plugin/src"],
+ "@pigmentcss/vite-plugin/*": ["./packages/pigment-vite-plugin/src/*"],
"@mui-internal/docs-utils": ["./packages/docs-utils/src"],
"@mui/internal-scripts/typescript-to-proptypes": [
"./packages-internal/scripts/typescript-to-proptypes/src"
diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js
index c9530cd25ee3bf..9e9aa260ce0e38 100644
--- a/webpackBaseConfig.js
+++ b/webpackBaseConfig.js
@@ -24,7 +24,7 @@ module.exports = {
'@mui/material-next': path.resolve(__dirname, './packages/mui-material-next/src'),
'@mui/material-nextjs': path.resolve(__dirname, './packages/mui-material-nextjs/src'),
'@mui/joy': path.resolve(__dirname, './packages/mui-joy/src'),
- '@mui/zero-runtime': path.resolve(__dirname, './packages/zero-runtime/src'),
+ '@pigmentcss/react': path.resolve(__dirname, './packages/pigment-react/src'),
'@mui-internal/docs-utils': path.resolve(__dirname, './packages/docs-utils/src'),
'@mui/internal-scripts/typescript-to-proptypes': path.resolve(
__dirname,