Skip to content

feat: v1 docs #378

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 72 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
4ab2422
First working version of pigment-css/react@v1
Dec 26, 2024
841238d
Implement styled runtime
Feb 3, 2025
8275455
Implement runtime and add tests
Feb 6, 2025
2dc2085
Propagate className from prop to the target component
Feb 7, 2025
074a182
Allow react components in tagged template
Feb 7, 2025
f30fca7
Handle pre-transformed tagged-template literal by swc
Feb 8, 2025
04d8b61
Make the package exports work with node10 resolution
Feb 27, 2025
8e9c8ec
Throw error instead of warning when transform fails
Feb 27, 2025
fdf6245
Consolidate exports to single ts file
Feb 27, 2025
4261fc9
Update nx build outputs
Mar 6, 2025
5e57953
Fix argument processing for constant string css
Mar 6, 2025
205f055
Add docs links
Mar 25, 2025
c658cee
v1/plugins
Jan 14, 2025
79b5186
Post transform callback for vite
Jan 21, 2025
974abcd
Fix typechecking config
Feb 3, 2025
9cc5c2f
feat: Add a way to filter files by names
Feb 4, 2025
842e908
Export bundle config type
Feb 4, 2025
65e7521
Add a way to have private values in the theme object
Feb 7, 2025
af96ab5
Add a separate option for runtimePackages
Feb 7, 2025
ba94393
Suppress warnings in webpack
Feb 8, 2025
a543939
Fix types
Feb 8, 2025
f5c0f38
Suppress related warnings in nextjs/webpack
Feb 8, 2025
7d6ff76
Rearrange exports
Feb 27, 2025
e732168
Fix path resolution for webpack
Mar 5, 2025
5c70710
Transform theme shorthands within the theme values to css variables
Mar 6, 2025
47a41f9
Generate the theme css value once
Mar 11, 2025
5a26488
Make plugin argument optional
Mar 11, 2025
70a3316
Restructure package output
Mar 12, 2025
0cdfd3f
Add plugin package to csb
Mar 12, 2025
bc857a7
Fix feature and wywFeature key swap
Mar 13, 2025
07704a3
Handle path on Windows
Mar 19, 2025
5e14f84
Bump next.js version
Mar 23, 2025
0d70056
feat: revamped docs site
Feb 8, 2025
74b0c66
Refactor theme and use lightning css
Feb 8, 2025
f0f25d3
CI fixes
Feb 8, 2025
a0ec478
Docs layout setup
Feb 27, 2025
ebc0dd5
Working mdx page. Syntax highlight is not working
Mar 5, 2025
7667f9b
Add basic doc to help with review
Mar 5, 2025
715ac1c
Allow shorthand css vars to be written in theme values as well
Mar 5, 2025
ffc334e
Reconfigure app to use mdx from within the app
Mar 5, 2025
16b1e38
Add reset styles
Mar 5, 2025
fc2aa8f
Add releases page
Mar 6, 2025
a0cf0e8
Add heading id and links
Mar 6, 2025
bca1590
Fix code copy
Mar 6, 2025
1f4f9df
Add in-page quick-nav
Mar 6, 2025
8903858
Fix lint
Mar 6, 2025
8fc577d
Remove redundatn class
Mar 6, 2025
c0b987b
Fix lint errors
Mar 6, 2025
e58458d
Add alert component. Also add pure css system theme
Mar 7, 2025
23f35d4
Final theme implementation
Mar 8, 2025
149e663
Fix ci
Mar 8, 2025
8b73c0b
Use .pigment.tsx as next.js route pages directly
Mar 10, 2025
2550902
Add in-built support for light,dark and system modes
Mar 11, 2025
c15f748
Use in-built theme support from Pigment
Mar 11, 2025
f9c3efd
Fix lint
Mar 11, 2025
b04db49
Fix lint
Mar 11, 2025
3140e16
Add redirect
Mar 11, 2025
46e7645
Add netlify cache plugin
Mar 11, 2025
31e8266
Empty about page
Mar 12, 2025
66ef9d0
Don't render draft items only in production deployment
Mar 12, 2025
ed396a7
Import static assets
Mar 12, 2025
04aeffc
Remove usage of @pigment-css/theme package in docs
Mar 13, 2025
5892b1c
Update icons in Alert component
Mar 14, 2025
73a8608
Add theme selector menu
Mar 14, 2025
2f3ad40
Remove unused css
Mar 14, 2025
889b8c4
Theme selector icons
Mar 17, 2025
f8c7d31
Update nav items
Mar 19, 2025
5f77184
Filter static params generation to be only for files that exist in the
Mar 20, 2025
878528e
Remove some of the nav items
Mar 20, 2025
4c10dbd
Bump next.js version and fix logo loading
Mar 20, 2025
846daf3
Add Edit on Github link and fix rtl
Mar 21, 2025
e29d178
Add id attribute to content
Mar 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .codesandbox/ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"packages": [
"packages/pigment-css-core",
"packages/pigment-css-nextjs-plugin",
"packages/pigment-css-plugin",
"packages/pigment-css-react",
"packages/pigment-css-react-new",
"packages/pigment-css-theme",
"packages/pigment-css-unplugin",
"packages/pigment-css-utils",
Expand Down
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
/packages/pigment-css-react/tests/**/fixtures
/packages/pigment-css-core/exports/
/packages/pigment-css-core/tests/**/fixtures
/packages/pigment-css-react-new/exports/
/packages/pigment-css-react-new/tests/**/fixtures
/packages/pigment-css-nextjs-plugin/loader.js
/packages/pigment-css-plugin/exports/
# Ignore fixtures
/packages-internal/scripts/typescript-to-proptypes/test/*/*
/test/bundling/fixtures/**/*.fixture.js
Expand All @@ -35,3 +38,4 @@ pnpm-lock.yaml
# If we want to format these files we'd need to do it in crowdin
docs/**/*-pt.md
docs/**/*-zh.md
/tmpapps
11 changes: 4 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ module.exports = {
// Airbnb use warn https://github.com/airbnb/javascript/blob/63098cbb6c05376dbefc9a91351f5727540c1ce1/packages/eslint-config-airbnb-base/rules/style.js#L97
// but eslint recommands error
'func-names': 'error',
'no-restricted-imports': [
'error',
{
patterns: ['@mui/*/*/*'],
},
],
'no-continue': 'off',
'no-constant-condition': 'error',
// Use the proptype inheritance chain
Expand All @@ -83,6 +77,8 @@ module.exports = {
],
'no-use-before-define': 'off',

'react/react-in-jsx-scope': 'off',

// disabled type-aware linting due to performance considerations
'@typescript-eslint/dot-notation': 'off',
'dot-notation': 'error',
Expand Down Expand Up @@ -201,6 +197,7 @@ module.exports = {

'react/jsx-no-useless-fragment': ['error', { allowExpressions: true }],
'lines-around-directive': 'off',
'react/prop-types': 'off',
},
overrides: [
{
Expand Down Expand Up @@ -281,7 +278,7 @@ module.exports = {
},
// Next.js entry points pages
{
files: ['docs/pages/**/*.js'],
files: ['docs/apps/**/*{.tsx,.ts,.js}'],
rules: {
'react/prop-types': 'off',
},
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"language": "markdown",
"scheme": "file"
}
]
],
"typescript.tsdk": "node_modules/typescript/lib"
}
8 changes: 4 additions & 4 deletions apps/pigment-css-next-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
"local-ui-lib": "workspace:^",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"next": "15.1.3"
"next": "15.1.6"
},
"devDependencies": {
"@pigment-css/nextjs-plugin": "workspace:^",
"@types/node": "^18.19.63",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
"@types/node": "^20",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"eslint": "^8.57.0",
"typescript": "^5.4.4"
},
Expand Down
7 changes: 4 additions & 3 deletions docs/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
REPO_ROOT=https://github.com/mui/pigment-css
DEFAULT_BRANCH=master

APP_NAME=Pigment CSS
GITHUB=https://github.com/mui/pigment-css
NPM=https://www.npmjs.com/package/@pigment-css/core
WEBSITE=https://pigment-css.com
18 changes: 0 additions & 18 deletions docs/.eslintrc.js

This file was deleted.

5 changes: 5 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
export
4 changes: 0 additions & 4 deletions docs/README.md

This file was deleted.

12 changes: 0 additions & 12 deletions docs/data/getting-started/overview/overview.mdx

This file was deleted.

36 changes: 0 additions & 36 deletions docs/data/pages.ts

This file was deleted.

14 changes: 14 additions & 0 deletions docs/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { dirname } from 'path';
import { fileURLToPath } from 'url';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

const eslintConfig = [...compat.extends('next/core-web-vitals', 'next/typescript')];

export default eslintConfig;
10 changes: 0 additions & 10 deletions docs/globals.d.ts

This file was deleted.

68 changes: 32 additions & 36 deletions docs/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,54 +1,50 @@
import * as url from 'url';
import * as path from 'path';
import * as path from 'node:path';
import type { NextConfig } from 'next';
// @ts-ignore
// eslint-disable-next-line no-restricted-imports
import withPigment, { type PigmentCSSConfig } from '@pigment-css/plugin/nextjs';
// @ts-expect-error This file doesn't have TS definitions.
import withDocsInfra from '@mui/monorepo/docs/nextConfigDocsInfra.js';
import { withPigment, extendTheme } from '@pigment-css/nextjs-plugin';

import { theme as baseTheme } from './src/theme';
import theme, { THEME_DARK } from './src/theme';

import rootPackage from '../package.json';

const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url));
const DATA_DIR = path.join(currentDirectory, 'data');
const isProd = process.env.NODE_ENV === 'production';
const CONTENT_DIR = path.join(__dirname, 'src', 'content');

const nextConfig: NextConfig = {
pageExtensions: ['tsx', 'pigment.tsx'],
trailingSlash: false,
env: {
DATA_DIR,
CURRENT_VERSION: rootPackage.version,
},
distDir: 'export',
output: process.env.NODE_ENV === 'production' ? 'export' : undefined,
eslint: {
ignoreDuringBuilds: true,
},
devIndicators: {
buildActivity: true,
buildActivityPosition: 'bottom-right',
appIsrStatus: false,
LIB_VERSION: rootPackage.version,
CONTENT_DIR,
CHANGELOG_FILE: path.join(__dirname, '../CHANGELOG.md'),
},
...(isProd && { distDir: 'export', output: 'export' }),
experimental: {
esmExternals: true,
workerThreads: false,
turbo: undefined,
useLightningcss: true,
},
};

const theme = extendTheme({
colorSchemes: {
light: baseTheme,
const pigmentConfig: PigmentCSSConfig = {
theme: {
colorSchemes: {
light: theme,
dark: THEME_DARK,
},
defaultScheme: 'light',
getSelector(mode) {
if (mode === 'light') {
return ':root, [data-theme="light"]';
}
return `[data-theme="${mode}"]`;
},
},
});
transformSx: false,
displayName: !isProd,
sourceMap: !isProd,
include: /\.pigment\.tsx?$/,
};

export default withPigment(withDocsInfra(nextConfig), {
theme,
displayName: true,
sourceMap: process.env.NODE_ENV !== 'production',
babelOptions: {
plugins: [
'@babel/plugin-proposal-explicit-resource-management',
'@babel/plugin-transform-unicode-property-regex',
],
},
});
export default withPigment(withDocsInfra(nextConfig), pigmentConfig);
60 changes: 33 additions & 27 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,49 @@
{
"name": "docs",
"version": "0.1.0",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"clean": "rm -rf .next export",
"dev": "next dev",
"build": "cross-env NODE_ENV=production next build",
"preview": "serve ./export",
"lint": "next lint",
"typescript": "tsc --noEmit -p ."
"build": "next build",
"start": "pnpm dlx serve export",
"lint": "next lint"
},
"dependencies": {
"@base_ui/react": "^1.0.0-alpha.3",
"@base-ui-components/react": "^1.0.0-alpha.6",
"@mdx-js/mdx": "^3.1.0",
"@pigment-css/react": "workspace:*",
"@stefanprobst/rehype-extract-toc": "^2.2.0",
"@pigment-css/react-new": "workspace:*",
"@stefanprobst/rehype-extract-toc": "^2.2.1",
"clipboard-copy": "4.0.1",
"clsx": "^2.1.1",
"next": "15.0.2",
"react": "18.3.1",
"react-dom": "18.3.1",
"rehype-pretty-code": "0.14.0",
"estree-util-value-to-estree": "^3.3.2",
"hast-util-to-string": "^3.0.1",
"lucide-react": "^0.479.0",
"next": "15.2.3",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"rehype-autolink-headings": "^7.1.0",
"rehype-highlight": "^7.0.2",
"rehype-pretty-code": "^0.14.0",
"rehype-slug": "^6.0.0",
"remark-frontmatter": "^5.0.0",
"remark-gfm": "^4.0.0",
"remark-mdx-frontmatter": "^5.0.0",
"shiki": "^1.22.2",
"to-vfile": "^8.0.0",
"vfile-matter": "^5.0.0"
"remark-gfm": "^4.0.1",
"remark-typography": "^0.6.21",
"scroll-into-view-if-needed": "^3.1.0",
"shiki": "^3.1.0",
"unist-util-visit-parents": "^6.0.1"
},
"devDependencies": {
"@babel/plugin-proposal-explicit-resource-management": "^7.25.9",
"@babel/plugin-transform-unicode-property-regex": "^7.25.9",
"@mui/monorepo": "github:mui/material-ui#ae455647016fe5dee968b017aa191e176bc113dd",
"@pigment-css/nextjs-plugin": "workspace:*",
"@eslint/eslintrc": "^3",
"@mui/monorepo": "github:mui/material-ui#v6.4.7",
"@pigment-css/plugin": "workspace:*",
"@types/mdx": "^2.0.13",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint-config-next": "15.0.2",
"serve": "14.2.4",
"tailwindcss": "^3.4.14"
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"eslint": "^9",
"eslint-config-next": "15.2.3",
"typescript": "^5"
},
"nx": {
"targets": {
Expand Down
Loading