Skip to content

Commit 32f5c5d

Browse files
author
Brijesh Bittu
committed
feat: revamped docs site
It is now in sync with the base-ui docs design.
1 parent 0cd6daa commit 32f5c5d

Some content is hidden

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

87 files changed

+3019
-3069
lines changed

.eslintrc.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ module.exports = {
5757
// Airbnb use warn https://github.com/airbnb/javascript/blob/63098cbb6c05376dbefc9a91351f5727540c1ce1/packages/eslint-config-airbnb-base/rules/style.js#L97
5858
// but eslint recommands error
5959
'func-names': 'error',
60-
'no-restricted-imports': [
61-
'error',
62-
{
63-
patterns: ['@mui/*/*/*'],
64-
},
65-
],
6660
'no-continue': 'off',
6761
'no-constant-condition': 'error',
6862
// Use the proptype inheritance chain

apps/pigment-css-next-app/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
"local-ui-lib": "workspace:^",
1616
"react": "^19.0.0",
1717
"react-dom": "^19.0.0",
18-
"next": "15.1.3"
18+
"next": "15.1.6"
1919
},
2020
"devDependencies": {
2121
"@pigment-css/nextjs-plugin": "workspace:^",
22-
"@types/node": "^18.19.63",
23-
"@types/react": "^19.0.2",
24-
"@types/react-dom": "^19.0.2",
22+
"@types/node": "^20",
23+
"@types/react": "^19.0.8",
24+
"@types/react-dom": "^19.0.3",
2525
"eslint": "^8.57.0",
2626
"typescript": "^5.4.4"
2727
},

docs/.env

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
REPO_ROOT=https://github.com/mui/pigment-css
2-
DEFAULT_BRANCH=master
3-
1+
SOURCE_CODE_REPO=https://github.com/mui/pigment-css
2+
SOURCE_GITHUB_BRANCH=master

docs/.eslintrc.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,15 @@
2828
npm-debug.log*
2929
yarn-debug.log*
3030
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
3135

3236
# vercel
3337
.vercel
3438

3539
# typescript
3640
*.tsbuildinfo
3741
next-env.d.ts
42+
export

docs/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/data/getting-started/overview/overview.mdx

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/data/pages.ts

Lines changed: 0 additions & 36 deletions
This file was deleted.

docs/eslint.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { dirname } from "path";
2+
import { fileURLToPath } from "url";
3+
import { FlatCompat } from "@eslint/eslintrc";
4+
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = dirname(__filename);
7+
8+
const compat = new FlatCompat({
9+
baseDirectory: __dirname,
10+
});
11+
12+
const eslintConfig = [
13+
...compat.extends("next/core-web-vitals", "next/typescript"),
14+
];
15+
16+
export default eslintConfig;

docs/globals.d.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/next.config.ts

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,46 @@
1-
import * as url from 'url';
2-
import * as path from 'path';
31
import type { NextConfig } from 'next';
4-
// @ts-ignore
5-
// eslint-disable-next-line no-restricted-imports
2+
import nextMdx from '@next/mdx';
3+
import withPigment, { type PigmentCSSConfig } from '@pigment-css/plugin/nextjs';
4+
import remarkGfm from 'remark-gfm';
5+
import remarkTypography from 'remark-typography';
6+
import rehypeExtractToc from '@stefanprobst/rehype-extract-toc';
7+
// @ts-expect-error This file doesn't have TS definitions.
68
import withDocsInfra from '@mui/monorepo/docs/nextConfigDocsInfra.js';
7-
import { withPigment, extendTheme } from '@pigment-css/nextjs-plugin';
89

9-
import { theme as baseTheme } from './src/theme';
10+
import theme from './src/theme';
1011
import rootPackage from '../package.json';
1112

12-
const currentDirectory = url.fileURLToPath(new URL('.', import.meta.url));
13-
const DATA_DIR = path.join(currentDirectory, 'data');
13+
const withMdx = nextMdx({
14+
options: {
15+
remarkPlugins: [remarkGfm, remarkTypography],
16+
rehypePlugins: [rehypeExtractToc],
17+
},
18+
});
19+
20+
const isProd = process.env.NODE_ENV === 'production';
1421

1522
const nextConfig: NextConfig = {
1623
trailingSlash: false,
24+
pageExtensions: ['mdx', 'tsx'],
1725
env: {
18-
DATA_DIR,
19-
CURRENT_VERSION: rootPackage.version,
20-
},
21-
distDir: 'export',
22-
output: process.env.NODE_ENV === 'production' ? 'export' : undefined,
23-
eslint: {
24-
ignoreDuringBuilds: true,
25-
},
26-
devIndicators: {
27-
buildActivity: true,
28-
buildActivityPosition: 'bottom-right',
29-
appIsrStatus: false,
26+
LIB_VERSION: rootPackage.version,
27+
APP_NAME: 'Pigment CSS',
28+
GITHUB: 'https://github.com/mui/pigment-css',
29+
NPM: 'https://www.npmjs.com/package/@pigment-css/core',
3030
},
31+
...(isProd && { distDir: 'export', output: 'export' }),
3132
experimental: {
3233
esmExternals: true,
3334
workerThreads: false,
34-
turbo: undefined,
3535
},
3636
};
3737

38-
const theme = extendTheme({
39-
colorSchemes: {
40-
light: baseTheme,
41-
},
42-
});
43-
44-
export default withPigment(withDocsInfra(nextConfig), {
38+
const pigmentConfig: PigmentCSSConfig = {
4539
theme,
46-
displayName: true,
47-
sourceMap: process.env.NODE_ENV !== 'production',
48-
babelOptions: {
49-
plugins: [
50-
'@babel/plugin-proposal-explicit-resource-management',
51-
'@babel/plugin-transform-unicode-property-regex',
52-
],
53-
},
54-
});
40+
transformSx: false,
41+
displayName: !isProd,
42+
sourceMap: !isProd,
43+
include: /\.pigment\.tsx?$/,
44+
};
45+
46+
export default withPigment(withMdx(withDocsInfra(nextConfig)), pigmentConfig);

docs/package.json

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,38 @@
11
{
22
"name": "docs",
3-
"version": "0.1.0",
3+
"version": "0.0.0",
44
"private": true,
55
"scripts": {
66
"dev": "next dev",
7-
"build": "cross-env NODE_ENV=production next build",
8-
"preview": "serve ./export",
9-
"lint": "next lint",
10-
"typescript": "tsc --noEmit -p ."
7+
"build": "next build",
8+
"start": "pnpm dlx serve export",
9+
"lint": "next lint"
1110
},
1211
"dependencies": {
13-
"@base_ui/react": "^1.0.0-alpha.3",
14-
"@mdx-js/mdx": "^3.1.0",
15-
"@pigment-css/react": "workspace:*",
16-
"@stefanprobst/rehype-extract-toc": "^2.2.0",
12+
"@base-ui-components/react": "^1.0.0-alpha.6",
13+
"@pigment-css/theme": "workspace:*",
14+
"@pigment-css/react-new": "workspace:*",
1715
"clsx": "^2.1.1",
18-
"next": "15.0.2",
19-
"react": "18.3.1",
20-
"react-dom": "18.3.1",
21-
"rehype-pretty-code": "0.14.0",
22-
"rehype-slug": "^6.0.0",
23-
"remark-frontmatter": "^5.0.0",
24-
"remark-gfm": "^4.0.0",
25-
"remark-mdx-frontmatter": "^5.0.0",
26-
"shiki": "^1.22.2",
27-
"to-vfile": "^8.0.0",
28-
"vfile-matter": "^5.0.0"
16+
"react": "^19.0.0",
17+
"react-dom": "^19.0.0",
18+
"next": "15.1.6",
19+
"scroll-into-view-if-needed": "^3.1.0"
2920
},
3021
"devDependencies": {
31-
"@babel/plugin-proposal-explicit-resource-management": "^7.25.9",
32-
"@babel/plugin-transform-unicode-property-regex": "^7.25.9",
33-
"@mui/monorepo": "github:mui/material-ui#ae455647016fe5dee968b017aa191e176bc113dd",
34-
"@pigment-css/nextjs-plugin": "workspace:*",
22+
"@mdx-js/loader": "^3.1.0",
23+
"@next/mdx": "^15.1.6",
24+
"@pigment-css/plugin": "workspace:*",
25+
"@stefanprobst/rehype-extract-toc": "^2.2.1",
26+
"@mui/monorepo": "github:mui/material-ui#v6.4.2",
27+
"remark-gfm": "^4.0.0",
28+
"remark-typography": "^0.6.21",
29+
"typescript": "^5",
3530
"@types/node": "^20",
36-
"@types/react": "^18",
37-
"@types/react-dom": "^18",
38-
"eslint-config-next": "15.0.2",
39-
"serve": "14.2.4",
40-
"tailwindcss": "^3.4.14"
31+
"@types/react": "^19.0.8",
32+
"@types/react-dom": "^19.0.3",
33+
"eslint": "^9",
34+
"eslint-config-next": "15.1.6",
35+
"@eslint/eslintrc": "^3"
4136
},
4237
"nx": {
4338
"targets": {

docs/public/_headers

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/_next/*.js
2+
Cache-Control: public, max-age=31536000, immutable
3+
4+
/static/*.ico
5+
Content-Type: image/x-icon
6+
7+
/performance/*
8+
X-Robots-Tag: noindex
9+
10+
/experiments/*
11+
X-Robots-Tag: noindex
12+
13+
/*
14+
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
15+
# Block usage in iframes.
16+
X-Frame-Options: SAMEORIGIN
17+
# Force the browser to trust the Content-Type header
18+
# https://stackoverflow.com/questions/18337630/what-is-x-content-type-options-nosniff
19+
X-Content-Type-Options: nosniff
20+
X-XSS-Protection: 1; mode=block
21+
Referrer-Policy: strict-origin-when-cross-origin
22+
# TODO: progressively reduce the CSP scopes
23+
# Start with a wildcard, using https://github.com/mui/toolpad/blob/f4c4eb046b352e4fc00729c3bed605e671b040c4/packages/toolpad-studio/src/server/index.ts#L241
24+
Content-Security-Policy: default-src * data: mediastream: blob: filesystem: about: ws: wss: 'unsafe-eval' 'wasm-unsafe-eval' 'unsafe-inline'; script-src * data: blob: 'unsafe-inline' 'unsafe-eval'; script-src-elem * data: blob: 'unsafe-inline'; connect-src * data: blob: 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; media-src * data: blob: 'unsafe-inline'; frame-src * data: blob: ; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline'; frame-ancestors *;

docs/public/robots.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Algolia-Crawler-Verif: 98C49CAFF7AEED76
2+
3+
User-agent: *
4+
Allow: /
2.76 KB
Loading

docs/public/static/favicon-dev.ico

2.56 KB
Binary file not shown.

docs/public/static/favicon-dev.svg

Lines changed: 4 additions & 0 deletions
Loading

docs/public/static/favicon.ico

2.56 KB
Binary file not shown.

docs/public/static/favicon.svg

Lines changed: 4 additions & 0 deletions
Loading

docs/public/static/logo-dev.svg

Lines changed: 6 additions & 0 deletions
Loading

docs/public/static/logo.png

1.14 KB
Loading

docs/public/static/logo.svg

Lines changed: 4 additions & 0 deletions
Loading

docs/src/app/(content)/getting-started/[slug]/not-found.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)