Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: v1 docs #378

Open
wants to merge 68 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
12546ec
First working version of pigment-css/react@v1
Dec 26, 2024
ef73cae
Implement styled runtime
Feb 3, 2025
528c5d6
Implement runtime and add tests
Feb 6, 2025
72fe151
Propagate className from prop to the target component
Feb 7, 2025
ff4a402
Allow react components in tagged template
Feb 7, 2025
aea3fcb
Handle pre-transformed tagged-template literal by swc
Feb 8, 2025
ba4460d
Make the package exports work with node10 resolution
Feb 27, 2025
d6fa163
Throw error instead of warning when transform fails
Feb 27, 2025
628d3d8
Consolidate exports to single ts file
Feb 27, 2025
05037bf
Update nx build outputs
Mar 6, 2025
5a8e8c8
Fix argument processing for constant string css
Mar 6, 2025
a524110
v1/plugins
Jan 14, 2025
c673238
Post transform callback for vite
Jan 21, 2025
1a02bc9
Fix typechecking config
Feb 3, 2025
21bf2a7
feat: Add a way to filter files by names
Feb 4, 2025
4f421a4
Export bundle config type
Feb 4, 2025
bfc311e
Add a way to have private values in the theme object
Feb 7, 2025
539d23b
Add a separate option for runtimePackages
Feb 7, 2025
2f994e1
Suppress warnings in webpack
Feb 8, 2025
aabb6fe
Fix types
Feb 8, 2025
3bbf9a5
Suppress related warnings in nextjs/webpack
Feb 8, 2025
bcc6d08
Rearrange exports
Feb 27, 2025
4e23d37
Fix path resolution for webpack
Mar 5, 2025
9033d4b
Transform theme shorthands within the theme values to css variables
Mar 6, 2025
297da55
Generate the theme css value once
Mar 11, 2025
08677dd
Make plugin argument optional
Mar 11, 2025
6efb8c6
Restructure package output
Mar 12, 2025
87db35e
Add plugin package to csb
Mar 12, 2025
4d4e819
Fix feature and wywFeature key swap
Mar 13, 2025
3f9cb57
Handle path on Windows
Mar 19, 2025
133cb07
feat: revamped docs site
Feb 8, 2025
f35562c
Refactor theme and use lightning css
Feb 8, 2025
45f4526
CI fixes
Feb 8, 2025
f0b92d9
Docs layout setup
Feb 27, 2025
57ecb45
Working mdx page. Syntax highlight is not working
Mar 5, 2025
a37847c
Add basic doc to help with review
Mar 5, 2025
724590f
Allow shorthand css vars to be written in theme values as well
Mar 5, 2025
d293382
Reconfigure app to use mdx from within the app
Mar 5, 2025
edf21e2
Add reset styles
Mar 5, 2025
efc5f98
Add releases page
Mar 6, 2025
97c8391
Add heading id and links
Mar 6, 2025
3320878
Fix code copy
Mar 6, 2025
494e4e7
Add in-page quick-nav
Mar 6, 2025
ce9159f
Fix lint
Mar 6, 2025
38c39e6
Remove redundatn class
Mar 6, 2025
aaa09cf
Fix lint errors
Mar 6, 2025
614950c
Add alert component. Also add pure css system theme
Mar 7, 2025
e0e5fbe
Final theme implementation
Mar 8, 2025
4a30a00
Fix ci
Mar 8, 2025
d73533e
Use .pigment.tsx as next.js route pages directly
Mar 10, 2025
116e4d2
Add in-built support for light,dark and system modes
Mar 11, 2025
57d930e
Use in-built theme support from Pigment
Mar 11, 2025
68cbce0
Fix lint
Mar 11, 2025
074f4f5
Fix lint
Mar 11, 2025
177b57b
Add redirect
Mar 11, 2025
0111853
Add netlify cache plugin
Mar 11, 2025
7abde8f
Empty about page
Mar 12, 2025
2812bbd
Don't render draft items only in production deployment
Mar 12, 2025
17c3ded
Import static assets
Mar 12, 2025
672a0ca
Remove usage of @pigment-css/theme package in docs
Mar 13, 2025
898ad40
Update icons in Alert component
Mar 14, 2025
2d367a7
Add theme selector menu
Mar 14, 2025
156a38c
Remove unused css
Mar 14, 2025
398a640
Theme selector icons
Mar 17, 2025
6c7dc89
Update nav items
Mar 19, 2025
9e95d5a
Filter static params generation to be only for files that exist in the
Mar 20, 2025
3d4f722
Remove some of the nav items
Mar 20, 2025
bc2e865
Bump next.js version and fix logo loading
Mar 20, 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