diff --git a/.codesandbox/ci.json b/.codesandbox/ci.json index 247caf9a4..bb915d7fe 100644 --- a/.codesandbox/ci.json +++ b/.codesandbox/ci.json @@ -6,6 +6,6 @@ "publishDirectory": { "@base_ui/react": "packages/mui-base/build" }, - "sandboxes": ["/examples/base-ui-cra-ts"], + "sandboxes": ["/.codesandbox/template"], "silent": true } diff --git a/examples/base-ui-cra-ts/README.md b/.codesandbox/template/README.md similarity index 100% rename from examples/base-ui-cra-ts/README.md rename to .codesandbox/template/README.md diff --git a/examples/base-ui-cra-ts/package.json b/.codesandbox/template/package.json similarity index 100% rename from examples/base-ui-cra-ts/package.json rename to .codesandbox/template/package.json diff --git a/examples/base-ui-cra-ts/public/favicon.ico b/.codesandbox/template/public/favicon.ico similarity index 100% rename from examples/base-ui-cra-ts/public/favicon.ico rename to .codesandbox/template/public/favicon.ico diff --git a/examples/base-ui-cra-ts/public/index.html b/.codesandbox/template/public/index.html similarity index 100% rename from examples/base-ui-cra-ts/public/index.html rename to .codesandbox/template/public/index.html diff --git a/examples/base-ui-cra-ts/src/App.tsx b/.codesandbox/template/src/App.tsx similarity index 100% rename from examples/base-ui-cra-ts/src/App.tsx rename to .codesandbox/template/src/App.tsx diff --git a/examples/base-ui-cra-ts/src/index.css b/.codesandbox/template/src/index.css similarity index 100% rename from examples/base-ui-cra-ts/src/index.css rename to .codesandbox/template/src/index.css diff --git a/examples/base-ui-cra-ts/src/index.tsx b/.codesandbox/template/src/index.tsx similarity index 100% rename from examples/base-ui-cra-ts/src/index.tsx rename to .codesandbox/template/src/index.tsx diff --git a/examples/base-ui-cra-ts/src/react-app-env.d.ts b/.codesandbox/template/src/react-app-env.d.ts similarity index 100% rename from examples/base-ui-cra-ts/src/react-app-env.d.ts rename to .codesandbox/template/src/react-app-env.d.ts diff --git a/examples/base-ui-cra-ts/tsconfig.json b/.codesandbox/template/tsconfig.json similarity index 100% rename from examples/base-ui-cra-ts/tsconfig.json rename to .codesandbox/template/tsconfig.json diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2a367f864..f26f2a5df 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,4 @@ * @atomiks @michaldudak /docs/data/ @atomiks @colmtuite @michaldudak -/examples/ @atomiks @colmtuite @michaldudak /packages/mui-base/ @atomiks @colmtuite @michaldudak /scripts/ @michaldudak diff --git a/.gitignore b/.gitignore index af81c2c90..16e906ed3 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,6 @@ /docs/app/playground/* !/docs/app/playground/\[slug\] /docs/public/feed/ -/examples/**/.cache /test/bundling/fixtures/*/yarn.lock /test/bundling/fixtures/*/pnpm-lock.yaml # created by test/bundling/scripts/createFixture diff --git a/babel.config.js b/babel.config.js index 60e79815d..600a3b4d3 100644 --- a/babel.config.js +++ b/babel.config.js @@ -17,8 +17,7 @@ module.exports = function getBabelConfig(api) { const defaultAlias = { '@base_ui/react': resolveAliasPath('./packages/mui-base/src'), - docs: resolveAliasPath('./node_modules/@mui/monorepo/docs'), - 'docs-base': resolveAliasPath('./docs'), + docs: resolveAliasPath('./docs'), test: resolveAliasPath('./test'), '@mui-internal/api-docs-builder': resolveAliasPath( './node_modules/@mui/monorepo/packages/api-docs-builder', diff --git a/docs/data/getting-started/support/support.mdx b/docs/data/getting-started/support/support.mdx index ef5431aa0..8786f65f8 100644 --- a/docs/data/getting-started/support/support.mdx +++ b/docs/data/getting-started/support/support.mdx @@ -36,25 +36,6 @@ You have a few possible options to provide it: You can browse the documentation, find an example close to your use case, and then open it in a live editor: - - Forking an example - - - Forking an example - - #### Use starter templates You can use a starter React template to build a reproduction case with [JavaScript](https://stackblitz.com/github/stackblitz/starters/tree/main/react) or [TypeScript](https://stackblitz.com/github/stackblitz/starters/tree/main/react-ts). diff --git a/docs/data/guides/next-js-app-router/next-js-app-router.mdx b/docs/data/guides/next-js-app-router/next-js-app-router.mdx index 9ca2cf346..a588063b8 100644 --- a/docs/data/guides/next-js-app-router/next-js-app-router.mdx +++ b/docs/data/guides/next-js-app-router/next-js-app-router.mdx @@ -7,12 +7,6 @@ description: Learn how to use Base UI with the Next.js App Router. -## Example - -Starting fresh on a new App Router-based project? - -Jump right into the code with [this example: Base UI - Next.js App Router with Tailwind CSS in TypeScript](https://github.com/mui/base-ui/tree/master/examples/base-ui-nextjs-tailwind-ts). - ## Next.js and React Server Components The Next.js App Router implements React Server Components, [an upcoming feature for React](https://github.com/reactjs/rfcs/blob/main/text/0227-server-module-conventions.md). @@ -52,8 +46,6 @@ module.exports = { }; ``` -Refer to this [example repo](https://github.com/mui/base-ui/tree/master/examples/base-ui-nextjs-tailwind-ts) for a full working demo of a Next.js 13 app using Base UI and Tailwind CSS. - ### Emotion If you're using Emotion, or something Emotion-based like MUI System, create a custom `ThemeRegistry` component that combines the Emotion `CacheProvider`, the Material UI `ThemeProvider`, and the `useServerInsertedHTML` hook from `next/navigation` as follows: diff --git a/docs/next.config.mjs b/docs/next.config.mjs index 9a24d9252..27cfa7c07 100644 --- a/docs/next.config.mjs +++ b/docs/next.config.mjs @@ -38,8 +38,7 @@ const nextConfig = { ...config.resolve, alias: { ...config.resolve.alias, - 'docs-base': path.resolve(workspaceRoot, 'docs'), - docs: path.resolve(workspaceRoot, 'node_modules/@mui/monorepo/docs'), + docs: path.resolve(workspaceRoot, 'docs'), }, }, module: { diff --git a/docs/public/_headers b/docs/public/_headers index 1d23b0bc3..c5809468d 100644 --- a/docs/public/_headers +++ b/docs/public/_headers @@ -1,9 +1,6 @@ /_next/*.js Cache-Control: public, max-age=31536000, immutable -/static/images/* - Cache-Control: public, max-age=86400 - /static/favicon.ico Content-Type: image/x-icon diff --git a/docs/public/static/BIMI.svg b/docs/public/static/BIMI.svg deleted file mode 100644 index 90911c497..000000000 --- a/docs/public/static/BIMI.svg +++ /dev/null @@ -1 +0,0 @@ -MUI \ No newline at end of file diff --git a/docs/public/static/ads-in-house/figma.png b/docs/public/static/ads-in-house/figma.png deleted file mode 100644 index c9e425224..000000000 Binary files a/docs/public/static/ads-in-house/figma.png and /dev/null differ diff --git a/docs/public/static/ads-in-house/scaffoldhub.png b/docs/public/static/ads-in-house/scaffoldhub.png deleted file mode 100644 index 1f43f8e2a..000000000 Binary files a/docs/public/static/ads-in-house/scaffoldhub.png and /dev/null differ diff --git a/docs/public/static/ads-in-house/themes-2.jpg b/docs/public/static/ads-in-house/themes-2.jpg deleted file mode 100644 index e45aa75c1..000000000 Binary files a/docs/public/static/ads-in-house/themes-2.jpg and /dev/null differ diff --git a/docs/public/static/ads-in-house/themes.png b/docs/public/static/ads-in-house/themes.png deleted file mode 100644 index 6a0658647..000000000 Binary files a/docs/public/static/ads-in-house/themes.png and /dev/null differ diff --git a/docs/public/static/ads-in-house/tidelift.png b/docs/public/static/ads-in-house/tidelift.png deleted file mode 100644 index cb517a8e3..000000000 Binary files a/docs/public/static/ads-in-house/tidelift.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/autocomplete-dark.png b/docs/public/static/base-ui/react-components/autocomplete-dark.png deleted file mode 100644 index 825a7e638..000000000 Binary files a/docs/public/static/base-ui/react-components/autocomplete-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/autocomplete-light.png b/docs/public/static/base-ui/react-components/autocomplete-light.png deleted file mode 100644 index 127a860a9..000000000 Binary files a/docs/public/static/base-ui/react-components/autocomplete-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/badge-dark.png b/docs/public/static/base-ui/react-components/badge-dark.png deleted file mode 100644 index 4b37c2b8b..000000000 Binary files a/docs/public/static/base-ui/react-components/badge-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/badge-light.png b/docs/public/static/base-ui/react-components/badge-light.png deleted file mode 100644 index b091c9cba..000000000 Binary files a/docs/public/static/base-ui/react-components/badge-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/button-dark.png b/docs/public/static/base-ui/react-components/button-dark.png deleted file mode 100644 index f920d3c98..000000000 Binary files a/docs/public/static/base-ui/react-components/button-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/button-light.png b/docs/public/static/base-ui/react-components/button-light.png deleted file mode 100644 index f8084bfe3..000000000 Binary files a/docs/public/static/base-ui/react-components/button-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/checkbox-dark.png b/docs/public/static/base-ui/react-components/checkbox-dark.png deleted file mode 100644 index 31b0e7d36..000000000 Binary files a/docs/public/static/base-ui/react-components/checkbox-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/checkbox-light.png b/docs/public/static/base-ui/react-components/checkbox-light.png deleted file mode 100644 index 7d991416d..000000000 Binary files a/docs/public/static/base-ui/react-components/checkbox-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/click-away-dark.png b/docs/public/static/base-ui/react-components/click-away-dark.png deleted file mode 100644 index 55bce3997..000000000 Binary files a/docs/public/static/base-ui/react-components/click-away-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/click-away-light.png b/docs/public/static/base-ui/react-components/click-away-light.png deleted file mode 100644 index 166fb9423..000000000 Binary files a/docs/public/static/base-ui/react-components/click-away-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/focus-trap-dark.png b/docs/public/static/base-ui/react-components/focus-trap-dark.png deleted file mode 100644 index 85d6295a4..000000000 Binary files a/docs/public/static/base-ui/react-components/focus-trap-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/focus-trap-light.png b/docs/public/static/base-ui/react-components/focus-trap-light.png deleted file mode 100644 index 4c7ddfbdb..000000000 Binary files a/docs/public/static/base-ui/react-components/focus-trap-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/form-control-dark.png b/docs/public/static/base-ui/react-components/form-control-dark.png deleted file mode 100644 index d0474fcc7..000000000 Binary files a/docs/public/static/base-ui/react-components/form-control-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/form-control-light.png b/docs/public/static/base-ui/react-components/form-control-light.png deleted file mode 100644 index 45407e08a..000000000 Binary files a/docs/public/static/base-ui/react-components/form-control-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/input-dark.png b/docs/public/static/base-ui/react-components/input-dark.png deleted file mode 100644 index 04dda34ce..000000000 Binary files a/docs/public/static/base-ui/react-components/input-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/input-light.png b/docs/public/static/base-ui/react-components/input-light.png deleted file mode 100644 index b525fd6e8..000000000 Binary files a/docs/public/static/base-ui/react-components/input-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/menu-dark.png b/docs/public/static/base-ui/react-components/menu-dark.png deleted file mode 100644 index 9de920c6a..000000000 Binary files a/docs/public/static/base-ui/react-components/menu-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/menu-light.png b/docs/public/static/base-ui/react-components/menu-light.png deleted file mode 100644 index e8d2925a1..000000000 Binary files a/docs/public/static/base-ui/react-components/menu-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/modal-dark.png b/docs/public/static/base-ui/react-components/modal-dark.png deleted file mode 100644 index d2710c79d..000000000 Binary files a/docs/public/static/base-ui/react-components/modal-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/modal-light.png b/docs/public/static/base-ui/react-components/modal-light.png deleted file mode 100644 index 625f07b36..000000000 Binary files a/docs/public/static/base-ui/react-components/modal-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/no-ssr-dark.png b/docs/public/static/base-ui/react-components/no-ssr-dark.png deleted file mode 100644 index 92dcff575..000000000 Binary files a/docs/public/static/base-ui/react-components/no-ssr-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/no-ssr-light.png b/docs/public/static/base-ui/react-components/no-ssr-light.png deleted file mode 100644 index c4238a136..000000000 Binary files a/docs/public/static/base-ui/react-components/no-ssr-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/number-field-dark.png b/docs/public/static/base-ui/react-components/number-field-dark.png deleted file mode 100644 index eba3b691f..000000000 Binary files a/docs/public/static/base-ui/react-components/number-field-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/number-field-light.png b/docs/public/static/base-ui/react-components/number-field-light.png deleted file mode 100644 index 2592016d8..000000000 Binary files a/docs/public/static/base-ui/react-components/number-field-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/pagination-dark.png b/docs/public/static/base-ui/react-components/pagination-dark.png deleted file mode 100644 index d76ddaf20..000000000 Binary files a/docs/public/static/base-ui/react-components/pagination-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/pagination-light.png b/docs/public/static/base-ui/react-components/pagination-light.png deleted file mode 100644 index c3202bd85..000000000 Binary files a/docs/public/static/base-ui/react-components/pagination-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/popper-dark.png b/docs/public/static/base-ui/react-components/popper-dark.png deleted file mode 100644 index dd0c2e69b..000000000 Binary files a/docs/public/static/base-ui/react-components/popper-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/popper-light.png b/docs/public/static/base-ui/react-components/popper-light.png deleted file mode 100644 index 759846416..000000000 Binary files a/docs/public/static/base-ui/react-components/popper-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/portal-dark.png b/docs/public/static/base-ui/react-components/portal-dark.png deleted file mode 100644 index 0baf138fb..000000000 Binary files a/docs/public/static/base-ui/react-components/portal-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/portal-light.png b/docs/public/static/base-ui/react-components/portal-light.png deleted file mode 100644 index 9e2c7abca..000000000 Binary files a/docs/public/static/base-ui/react-components/portal-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/select-dark.png b/docs/public/static/base-ui/react-components/select-dark.png deleted file mode 100644 index ef6540d3c..000000000 Binary files a/docs/public/static/base-ui/react-components/select-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/select-light.png b/docs/public/static/base-ui/react-components/select-light.png deleted file mode 100644 index 40f9cbaa2..000000000 Binary files a/docs/public/static/base-ui/react-components/select-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/slider-dark.png b/docs/public/static/base-ui/react-components/slider-dark.png deleted file mode 100644 index 4f24d4a5c..000000000 Binary files a/docs/public/static/base-ui/react-components/slider-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/slider-light.png b/docs/public/static/base-ui/react-components/slider-light.png deleted file mode 100644 index 376c14f64..000000000 Binary files a/docs/public/static/base-ui/react-components/slider-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/snackbar-dark.png b/docs/public/static/base-ui/react-components/snackbar-dark.png deleted file mode 100644 index e046665f8..000000000 Binary files a/docs/public/static/base-ui/react-components/snackbar-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/snackbar-light.png b/docs/public/static/base-ui/react-components/snackbar-light.png deleted file mode 100644 index 88923fbe4..000000000 Binary files a/docs/public/static/base-ui/react-components/snackbar-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/switch-dark.png b/docs/public/static/base-ui/react-components/switch-dark.png deleted file mode 100644 index ff40ce5e5..000000000 Binary files a/docs/public/static/base-ui/react-components/switch-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/switch-light.png b/docs/public/static/base-ui/react-components/switch-light.png deleted file mode 100644 index 1c2d4e483..000000000 Binary files a/docs/public/static/base-ui/react-components/switch-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/tabs-dark.png b/docs/public/static/base-ui/react-components/tabs-dark.png deleted file mode 100644 index b93e78a8f..000000000 Binary files a/docs/public/static/base-ui/react-components/tabs-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/tabs-light.png b/docs/public/static/base-ui/react-components/tabs-light.png deleted file mode 100644 index fa788b53f..000000000 Binary files a/docs/public/static/base-ui/react-components/tabs-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/textarea-dark.png b/docs/public/static/base-ui/react-components/textarea-dark.png deleted file mode 100644 index b590dc277..000000000 Binary files a/docs/public/static/base-ui/react-components/textarea-dark.png and /dev/null differ diff --git a/docs/public/static/base-ui/react-components/textarea-light.png b/docs/public/static/base-ui/react-components/textarea-light.png deleted file mode 100644 index ee81c0ecf..000000000 Binary files a/docs/public/static/base-ui/react-components/textarea-light.png and /dev/null differ diff --git a/docs/public/static/base-ui/with-tailwind-css/full-stack-radio.png b/docs/public/static/base-ui/with-tailwind-css/full-stack-radio.png deleted file mode 100644 index 68901c77e..000000000 Binary files a/docs/public/static/base-ui/with-tailwind-css/full-stack-radio.png and /dev/null differ diff --git a/docs/public/static/base-ui/with-tailwind-css/player-buttons.png b/docs/public/static/base-ui/with-tailwind-css/player-buttons.png deleted file mode 100644 index ded63ea9b..000000000 Binary files a/docs/public/static/base-ui/with-tailwind-css/player-buttons.png and /dev/null differ diff --git a/docs/public/static/base-ui/with-tailwind-css/player-slider.png b/docs/public/static/base-ui/with-tailwind-css/player-slider.png deleted file mode 100644 index 357c75dc7..000000000 Binary files a/docs/public/static/base-ui/with-tailwind-css/player-slider.png and /dev/null differ diff --git a/docs/public/static/branding/base-ui/avatar.png b/docs/public/static/branding/base-ui/avatar.png deleted file mode 100644 index fcbe937a0..000000000 Binary files a/docs/public/static/branding/base-ui/avatar.png and /dev/null differ diff --git a/docs/public/static/branding/base-ui/headless-ui-dark.svg b/docs/public/static/branding/base-ui/headless-ui-dark.svg deleted file mode 100644 index 8a1805ef8..000000000 --- a/docs/public/static/branding/base-ui/headless-ui-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/public/static/branding/base-ui/headless-ui.svg b/docs/public/static/branding/base-ui/headless-ui.svg deleted file mode 100644 index d3d46d347..000000000 --- a/docs/public/static/branding/base-ui/headless-ui.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/public/static/branding/base-ui/nhost-dark.svg b/docs/public/static/branding/base-ui/nhost-dark.svg deleted file mode 100644 index b19eaa8a4..000000000 --- a/docs/public/static/branding/base-ui/nhost-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/public/static/branding/base-ui/nhost-light.svg b/docs/public/static/branding/base-ui/nhost-light.svg deleted file mode 100644 index 8840bda6a..000000000 --- a/docs/public/static/branding/base-ui/nhost-light.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/public/static/branding/base-ui/nhost-screenshot-2x.png b/docs/public/static/branding/base-ui/nhost-screenshot-2x.png deleted file mode 100644 index a3d296db6..000000000 Binary files a/docs/public/static/branding/base-ui/nhost-screenshot-2x.png and /dev/null differ diff --git a/docs/public/static/branding/base-ui/nhost-screenshot.png b/docs/public/static/branding/base-ui/nhost-screenshot.png deleted file mode 100644 index b8b296f1f..000000000 Binary files a/docs/public/static/branding/base-ui/nhost-screenshot.png and /dev/null differ diff --git a/docs/public/static/branding/base-ui/radix-dark.svg b/docs/public/static/branding/base-ui/radix-dark.svg deleted file mode 100644 index 65d9544bc..000000000 --- a/docs/public/static/branding/base-ui/radix-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/public/static/branding/base-ui/radix.svg b/docs/public/static/branding/base-ui/radix.svg deleted file mode 100644 index 78940fb00..000000000 --- a/docs/public/static/branding/base-ui/radix.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/public/static/branding/base-ui/react-aria-dark.svg b/docs/public/static/branding/base-ui/react-aria-dark.svg deleted file mode 100644 index 821788ee6..000000000 --- a/docs/public/static/branding/base-ui/react-aria-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/public/static/branding/base-ui/react-aria.svg b/docs/public/static/branding/base-ui/react-aria.svg deleted file mode 100644 index 92faea7de..000000000 --- a/docs/public/static/branding/base-ui/react-aria.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/docs/public/static/docs-infra/forking-an-example-dark.png b/docs/public/static/docs-infra/forking-an-example-dark.png deleted file mode 100644 index 43495985d..000000000 Binary files a/docs/public/static/docs-infra/forking-an-example-dark.png and /dev/null differ diff --git a/docs/public/static/docs-infra/forking-an-example.png b/docs/public/static/docs-infra/forking-an-example.png deleted file mode 100644 index b94e367bd..000000000 Binary files a/docs/public/static/docs-infra/forking-an-example.png and /dev/null differ diff --git a/docs/public/static/logo.png b/docs/public/static/logo.png deleted file mode 100644 index 56526f097..000000000 Binary files a/docs/public/static/logo.png and /dev/null differ diff --git a/docs/public/static/social-previews/baseui-preview.jpg b/docs/public/static/social-previews/baseui-preview.jpg deleted file mode 100644 index 90f9ee4e1..000000000 Binary files a/docs/public/static/social-previews/baseui-preview.jpg and /dev/null differ diff --git a/docs/public/static/styles/prism-okaidia.css b/docs/public/static/styles/prism-okaidia.css deleted file mode 100644 index f47491ed2..000000000 --- a/docs/public/static/styles/prism-okaidia.css +++ /dev/null @@ -1,158 +0,0 @@ -/** - * okaidia theme for JavaScript, CSS and HTML - * Loosely based on Monokai textmate theme by http://www.monokai.nl/ - * @author ocodia - */ - -code[class*='language-'], -pre[class*='language-'] { - /* color: #f8f8f2; */ - /* background: none; */ - /* text-shadow: 0 1px rgba(0, 0, 0, 0.3); */ - /* font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; */ - /* font-size: 1em; */ - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - /* line-height: 1.5; */ - - /* -moz-tab-size: 4; */ - /* -o-tab-size: 4; */ - /* tab-size: 4; */ - - -webkit-hyphens: none; - -moz-hyphens: none; - -ms-hyphens: none; - hyphens: none; -} - -/* Code blocks */ -/* -pre[class*='language-'] { - padding: 1em; - margin: 0.5em 0; - overflow: auto; - border-radius: 0.3em; -}$ -*/ - -/* -:not(pre) > code[class*='language-'], -pre[class*='language-'] { - background: #272822; -} -*/ - -/* Inline code */ -/* -:not(pre) > code[class*='language-'] { - padding: 0.1em; - border-radius: 0.3em; - white-space: normal; -} -*/ - -/* -.token.comment, -.token.prolog, -.token.doctype, -.token.cdata { - color: #8292a2; -} -*/ - -.token.punctuation { - color: #f8f8f2; -} - -.token.namespace { - opacity: 0.7; -} - -/* -.token.property, -.token.tag, -.token.constant, -.token.symbol, -.token.deleted { - color: #f92672; -} -*/ - -/* -.token.boolean, -.token.number { - color: #ae81ff; -} -*/ - -.token.selector, -.token.attr-name, -.token.string, -.token.char, -.token.builtin, -.token.inserted { - color: #a6e22e; -} - -.token.operator, -.token.entity, -.token.url, -.language-css .token.string, -.style .token.string, -.token.variable { - color: #f8f8f2; -} - -.token.atrule, -.token.attr-value, -.token.function, -.token.class-name { - color: #e6db74; -} - -.token.keyword { - color: #66d9ef; -} - -.token.regex, -.token.important { - color: #fd971f; -} - -.token.important, -.token.bold { - font-weight: bold; -} -.token.italic { - font-style: italic; -} - -.token.entity { - cursor: help; -} - -/** - * Overrides to reach AA, copied from https://reactjs.org, on top of the - * source from https://unpkg.com/prismjs/themes/prism-okaidia.css that are above. - */ -.token.comment, -.token.prolog, -.token.doctype, -.token.cdata { - color: #b2b2b2; -} - -.token.property, -.token.tag, -.token.symbol, -.token.deleted { - color: #fc929e; -} - -.token.boolean, -.token.number { - color: #b78eff; -} diff --git a/docs/scripts/formattedTSDemos.js b/docs/scripts/formattedTSDemos.js index b8c47f114..c7d503422 100644 --- a/docs/scripts/formattedTSDemos.js +++ b/docs/scripts/formattedTSDemos.js @@ -88,7 +88,7 @@ async function transpileFile(tsxPath, project) { if (enableJSXPreview) { transformOptions.plugins = transformOptions.plugins.concat([ [ - require.resolve('docs/src/modules/utils/babel-plugin-jsx-preview'), + require.resolve('@mui/monorepo/docs/src/modules/utils/babel-plugin-jsx-preview'), { maxLines: 16, outputFilename: `${tsxPath}.preview` }, ], ]); diff --git a/docs/app/(content)/components/[slug]/getApiReferenceData.ts b/docs/src/app/(content)/components/[slug]/getApiReferenceData.ts similarity index 93% rename from docs/app/(content)/components/[slug]/getApiReferenceData.ts rename to docs/src/app/(content)/components/[slug]/getApiReferenceData.ts index 77c500d4d..fe124e057 100644 --- a/docs/app/(content)/components/[slug]/getApiReferenceData.ts +++ b/docs/src/app/(content)/components/[slug]/getApiReferenceData.ts @@ -1,5 +1,5 @@ import { readFile } from 'node:fs/promises'; -import { ComponentAPIReference } from 'docs-base/types/ComponentAPIReference'; +import { ComponentAPIReference } from 'docs/types/ComponentAPIReference'; import kebabCase from 'lodash/kebabCase'; export function getApiReferenceData(componentNames: string[]): Promise { diff --git a/docs/app/(content)/components/[slug]/page.tsx b/docs/src/app/(content)/components/[slug]/page.tsx similarity index 69% rename from docs/app/(content)/components/[slug]/page.tsx rename to docs/src/app/(content)/components/[slug]/page.tsx index dd2cfc6b9..ee50eb064 100644 --- a/docs/app/(content)/components/[slug]/page.tsx +++ b/docs/src/app/(content)/components/[slug]/page.tsx @@ -1,18 +1,21 @@ import * as React from 'react'; import { Metadata } from 'next'; -import { components } from 'docs-base/src/components/content/MDXComponents'; -import { getMarkdownPage, getMarkdownPageMetadata } from 'docs-base/app/(content)/getMarkdownPage'; -import { ComponentLinkHeader } from 'docs-base/src/components/content/ComponentLinkHeader'; -import { Description } from 'docs-base/src/components/content/Description'; -import { TableOfContents } from 'docs-base/src/components/TableOfContents'; -import routes, { getSlugs } from 'docs-base/data/pages'; -import { SiblingPageLinks } from 'docs-base/src/components/SiblingPageLinks'; -import { EditPageGithubLink } from 'docs-base/src/components/EditPageGithubLink'; +import { components } from 'docs/src/components/content/MDXComponents'; +import { + getMarkdownPage, + getMarkdownPageMetadata, +} from 'docs/src/app/(content)/getMarkdownPage'; +import { ComponentLinkHeader } from 'docs/src/components/content/ComponentLinkHeader'; +import { Description } from 'docs/src/components/content/Description'; +import { TableOfContents } from 'docs/src/components/TableOfContents'; +import routes, { getSlugs } from 'docs/data/pages'; +import { SiblingPageLinks } from 'docs/src/components/SiblingPageLinks'; +import { EditPageGithubLink } from 'docs/src/components/EditPageGithubLink'; import { ApiReference, getApiReferenceTableOfContents, -} from 'docs-base/src/components/ApiReference'; -import { DemoLoader, DemoLoaderProps } from 'docs-base/src/components/demo/DemoLoader'; +} from 'docs/src/components/ApiReference'; +import { DemoLoader, DemoLoaderProps } from 'docs/src/components/demo/DemoLoader'; import { getApiReferenceData } from './getApiReferenceData'; import classes from '../../styles.module.css'; @@ -40,7 +43,8 @@ export default async function ComponentPage(props: Props) { componentName, ); - const documentedComponents = metadata.components?.split(',').map((c: string) => c.trim()) ?? []; + const documentedComponents = + metadata.components?.split(',').map((c: string) => c.trim()) ?? []; const componentsApi = await getApiReferenceData(documentedComponents); const apiReferenceToc = getApiReferenceTableOfContents(componentsApi); @@ -56,7 +60,10 @@ export default async function ComponentPage(props: Props) { Description: () => , // eslint-disable-next-line react/no-unstable-nested-components ComponentLinkHeader: () => ( - + ), }; @@ -70,7 +77,10 @@ export default async function ComponentPage(props: Props) {
- +
diff --git a/docs/app/(content)/getMarkdownPage.ts b/docs/src/app/(content)/getMarkdownPage.ts similarity index 98% rename from docs/app/(content)/getMarkdownPage.ts rename to docs/src/app/(content)/getMarkdownPage.ts index 8c3f4afca..77ade6d1a 100644 --- a/docs/app/(content)/getMarkdownPage.ts +++ b/docs/src/app/(content)/getMarkdownPage.ts @@ -12,7 +12,7 @@ import extractToc, { type Toc } from '@stefanprobst/rehype-extract-toc'; import exportToc from '@stefanprobst/rehype-extract-toc/mdx'; import { read as readVFile } from 'to-vfile'; import { matter } from 'vfile-matter'; -import { config } from 'docs-base/config'; +import { config } from 'docs/config'; export const DATA_PATH = path.join(process.cwd(), 'data'); diff --git a/docs/app/(content)/getting-started/[slug]/page.tsx b/docs/src/app/(content)/getting-started/[slug]/page.tsx similarity index 68% rename from docs/app/(content)/getting-started/[slug]/page.tsx rename to docs/src/app/(content)/getting-started/[slug]/page.tsx index 000ab6d80..496cbe0ed 100644 --- a/docs/app/(content)/getting-started/[slug]/page.tsx +++ b/docs/src/app/(content)/getting-started/[slug]/page.tsx @@ -1,12 +1,15 @@ import * as React from 'react'; import { Metadata } from 'next'; -import { components } from 'docs-base/src/components/content/MDXComponents'; -import { getMarkdownPage, getMarkdownPageMetadata } from 'docs-base/app/(content)/getMarkdownPage'; -import { TableOfContents } from 'docs-base/src/components/TableOfContents'; -import routes, { getSlugs } from 'docs-base/data/pages'; -import { Description } from 'docs-base/src/components/content/Description'; -import { SiblingPageLinks } from 'docs-base/src/components/SiblingPageLinks'; -import { EditPageGithubLink } from 'docs-base/src/components/EditPageGithubLink'; +import { components } from 'docs/src/components/content/MDXComponents'; +import { + getMarkdownPage, + getMarkdownPageMetadata, +} from 'docs/src/app/(content)/getMarkdownPage'; +import { TableOfContents } from 'docs/src/components/TableOfContents'; +import routes, { getSlugs } from 'docs/data/pages'; +import { Description } from 'docs/src/components/content/Description'; +import { SiblingPageLinks } from 'docs/src/components/SiblingPageLinks'; +import { EditPageGithubLink } from 'docs/src/components/EditPageGithubLink'; import classes from '../../styles.module.css'; const CATEGORY_SEGMENT = 'getting-started'; @@ -22,7 +25,10 @@ export default async function DocsPage(props: Props) { params: { slug }, } = props; - const { MDXContent, tableOfContents, metadata } = await getMarkdownPage(CATEGORY_SEGMENT, slug); + const { MDXContent, tableOfContents, metadata } = await getMarkdownPage( + CATEGORY_SEGMENT, + slug, + ); const allComponents = { ...components, @@ -40,7 +46,10 @@ export default async function DocsPage(props: Props) {
- +
diff --git a/docs/app/(content)/guides/[slug]/page.tsx b/docs/src/app/(content)/guides/[slug]/page.tsx similarity index 65% rename from docs/app/(content)/guides/[slug]/page.tsx rename to docs/src/app/(content)/guides/[slug]/page.tsx index bc0130000..9848b738e 100644 --- a/docs/app/(content)/guides/[slug]/page.tsx +++ b/docs/src/app/(content)/guides/[slug]/page.tsx @@ -1,12 +1,15 @@ import * as React from 'react'; import { Metadata } from 'next'; -import { components } from 'docs-base/src/components/content/MDXComponents'; -import { getMarkdownPage, getMarkdownPageMetadata } from 'docs-base/app/(content)/getMarkdownPage'; -import { TableOfContents } from 'docs-base/src/components/TableOfContents'; -import routes, { getSlugs } from 'docs-base/data/pages'; -import { Description } from 'docs-base/src/components/content/Description'; -import { SiblingPageLinks } from 'docs-base/src/components/SiblingPageLinks'; -import { EditPageGithubLink } from 'docs-base/src/components/EditPageGithubLink'; +import { components } from 'docs/src/components/content/MDXComponents'; +import { + getMarkdownPage, + getMarkdownPageMetadata, +} from 'docs/src/app/(content)/getMarkdownPage'; +import { TableOfContents } from 'docs/src/components/TableOfContents'; +import routes, { getSlugs } from 'docs/data/pages'; +import { Description } from 'docs/src/components/content/Description'; +import { SiblingPageLinks } from 'docs/src/components/SiblingPageLinks'; +import { EditPageGithubLink } from 'docs/src/components/EditPageGithubLink'; import classes from '../../styles.module.css'; const CATEGORY_SEGMENT = 'guides'; @@ -22,7 +25,10 @@ export default async function DocsPage(props: Props) { params: { slug }, } = props; - const { MDXContent, tableOfContents, metadata } = await getMarkdownPage(CATEGORY_SEGMENT, slug); + const { MDXContent, tableOfContents, metadata } = await getMarkdownPage( + CATEGORY_SEGMENT, + slug, + ); const allComponents = { ...components, @@ -40,7 +46,10 @@ export default async function DocsPage(props: Props) {
- +
@@ -56,7 +65,10 @@ export async function generateStaticParams() { export async function generateMetadata({ params }: Props): Promise { const { slug } = params; - const { title = 'Guides', description } = await getMarkdownPageMetadata(CATEGORY_SEGMENT, slug); + const { title = 'Guides', description } = await getMarkdownPageMetadata( + CATEGORY_SEGMENT, + slug, + ); return { title, diff --git a/docs/app/(content)/layout.tsx b/docs/src/app/(content)/layout.tsx similarity index 59% rename from docs/app/(content)/layout.tsx rename to docs/src/app/(content)/layout.tsx index 706a9d110..92a3130a7 100644 --- a/docs/app/(content)/layout.tsx +++ b/docs/src/app/(content)/layout.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; -import { AppBar } from 'docs-base/src/components/AppBar'; -import { Navigation } from 'docs-base/src/components/Navigation'; -import routes from 'docs-base/data/pages'; +import { AppBar } from 'docs/src/components/AppBar'; +import { Navigation } from 'docs/src/components/Navigation'; +import routes from 'docs/data/pages'; export default function Layout({ children }: React.PropsWithChildren<{}>) { return ( diff --git a/docs/app/(content)/styles.module.css b/docs/src/app/(content)/styles.module.css similarity index 100% rename from docs/app/(content)/styles.module.css rename to docs/src/app/(content)/styles.module.css diff --git a/docs/app/DocsProviders.tsx b/docs/src/app/DocsProviders.tsx similarity index 51% rename from docs/app/DocsProviders.tsx rename to docs/src/app/DocsProviders.tsx index 39b504c7c..c964bfa3e 100644 --- a/docs/app/DocsProviders.tsx +++ b/docs/src/app/DocsProviders.tsx @@ -1,13 +1,15 @@ import * as React from 'react'; import { Tooltip } from '@base_ui/react/Tooltip'; -import { DemoVariantSelectorProvider } from 'docs-base/src/components/demo/DemoVariantSelectorProvider'; -import { PackageManagerSnippetProvider } from 'docs-base/src/blocks/PackageManagerSnippet/PackageManagerSnippetProvider'; +import { DemoVariantSelectorProvider } from 'docs/src/components/demo/DemoVariantSelectorProvider'; +import { PackageManagerSnippetProvider } from 'docs/src/blocks/PackageManagerSnippet/PackageManagerSnippetProvider'; export function DocsProviders({ children }: { children: React.ReactNode }) { return ( - {children} + + {children} + ); diff --git a/docs/app/experiments/[slug]/page.tsx b/docs/src/app/experiments/[slug]/page.tsx similarity index 93% rename from docs/app/experiments/[slug]/page.tsx rename to docs/src/app/experiments/[slug]/page.tsx index ab2f3df3a..42d3a8bcd 100644 --- a/docs/app/experiments/[slug]/page.tsx +++ b/docs/src/app/experiments/[slug]/page.tsx @@ -25,7 +25,7 @@ export default async function Page(props: Props) { } export async function generateStaticParams() { - return (await readdir('app/experiments', { withFileTypes: true })) + return (await readdir('src/app/experiments', { withFileTypes: true })) .filter( (entry: Dirent) => entry.name.endsWith('.tsx') && diff --git a/docs/app/experiments/accordion-animations.tsx b/docs/src/app/experiments/accordion-animations.tsx similarity index 100% rename from docs/app/experiments/accordion-animations.tsx rename to docs/src/app/experiments/accordion-animations.tsx diff --git a/docs/app/experiments/accordion-horizontal.tsx b/docs/src/app/experiments/accordion-horizontal.tsx similarity index 100% rename from docs/app/experiments/accordion-horizontal.tsx rename to docs/src/app/experiments/accordion-horizontal.tsx diff --git a/docs/app/experiments/accordion.horizontal.module.css b/docs/src/app/experiments/accordion.horizontal.module.css similarity index 100% rename from docs/app/experiments/accordion.horizontal.module.css rename to docs/src/app/experiments/accordion.horizontal.module.css diff --git a/docs/app/experiments/accordion.module.css b/docs/src/app/experiments/accordion.module.css similarity index 100% rename from docs/app/experiments/accordion.module.css rename to docs/src/app/experiments/accordion.module.css diff --git a/docs/app/experiments/accordion.tsx b/docs/src/app/experiments/accordion.tsx similarity index 100% rename from docs/app/experiments/accordion.tsx rename to docs/src/app/experiments/accordion.tsx diff --git a/docs/app/experiments/anchor-positioning.tsx b/docs/src/app/experiments/anchor-positioning.tsx similarity index 86% rename from docs/app/experiments/anchor-positioning.tsx rename to docs/src/app/experiments/anchor-positioning.tsx index 0ca6ddac3..db7995cfc 100644 --- a/docs/app/experiments/anchor-positioning.tsx +++ b/docs/src/app/experiments/anchor-positioning.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import { useAnchorPositioning } from '../../../packages/mui-base/src/utils/useAnchorPositioning'; +import { useAnchorPositioning } from '../../../../packages/mui-base/src/utils/useAnchorPositioning'; const oppositeSideMap = { top: 'bottom', @@ -17,31 +17,40 @@ export default function AnchorPositioning() { const [popupSize, setPopupSize] = React.useState('xs'); const [anchorSize, setAnchorSize] = React.useState('m'); const [side, setSide] = React.useState<'top' | 'bottom' | 'left' | 'right'>('top'); - const [alignment, setAlignment] = React.useState<'start' | 'center' | 'end'>('center'); + const [alignment, setAlignment] = React.useState<'start' | 'center' | 'end'>( + 'center', + ); const [sideOffset, setSideOffset] = React.useState(0); const [alignmentOffset, setAlignmentOffset] = React.useState(0); const [collisionPadding, setCollisionPadding] = React.useState(5); const [arrowPadding, setArrowPadding] = React.useState(5); const [hideWhenDetached, setHideWhenDetached] = React.useState(false); const [arrow, setArrow] = React.useState(true); - const [hideArrowWhenUncentered, setHideArrowWhenUncentered] = React.useState(false); + const [hideArrowWhenUncentered, setHideArrowWhenUncentered] = + React.useState(false); const [sticky, setSticky] = React.useState(false); const [constrainSize, setConstrainSize] = React.useState(false); const [visible, setVisible] = React.useState(false); const [trackAnchor, setTrackAnchor] = React.useState(true); - const { refs, positionerStyles, arrowStyles, arrowRef, renderedSide, arrowUncentered } = - useAnchorPositioning({ - side, - alignment, - sideOffset, - alignmentOffset, - collisionPadding, - hideWhenDetached, - sticky, - arrowPadding, - trackAnchor, - }); + const { + refs, + positionerStyles, + arrowStyles, + arrowRef, + renderedSide, + arrowUncentered, + } = useAnchorPositioning({ + side, + alignment, + sideOffset, + alignmentOffset, + collisionPadding, + hideWhenDetached, + sticky, + arrowPadding, + trackAnchor, + }); const handleInitialScroll = React.useCallback((node: HTMLDivElement | null) => { if (node) { @@ -98,14 +107,17 @@ export default function AnchorPositioning() { width: 20, height: 20, [oppositeSideMap[renderedSide]]: -10, - ...(arrowUncentered && hideArrowWhenUncentered && { visibility: 'hidden' }), + ...(arrowUncentered && + hideArrowWhenUncentered && { visibility: 'hidden' }), }} /> )} ); - const popupNode = trackAnchor ? popup : ReactDOM.createPortal(popup, document.body); + const popupNode = trackAnchor + ? popup + : ReactDOM.createPortal(popup, document.body); return (
@@ -178,7 +190,12 @@ export default function AnchorPositioning() { Side {(['top', 'bottom', 'left', 'right'] as const).map((s) => ( ))} @@ -266,7 +283,11 @@ export default function AnchorPositioning() { @@ -280,7 +301,11 @@ export default function AnchorPositioning() { diff --git a/docs/src/app/experiments/collapsible-accordion.tsx b/docs/src/app/experiments/collapsible-accordion.tsx new file mode 100644 index 000000000..b9e048221 --- /dev/null +++ b/docs/src/app/experiments/collapsible-accordion.tsx @@ -0,0 +1,164 @@ +'use client'; +import * as React from 'react'; +import { Collapsible } from '@base_ui/react/Collapsible'; + +const TRANSITION_DURATION = '350ms'; + +function AccordionSection(props: { + index: number; + openIndex: number; + setOpen: (nextOpenIndex: number) => void; +}) { + const { index, openIndex, setOpen } = props; + const isOpen = index === openIndex; + return ( + setOpen(isOpen ? -1 : index)} + > + + + + + + + {isOpen ? 'Close' : 'Open'} Panel {index} + + +

This is the collapsed content of Panel {index}

+

This is the second paragraph

+

This is the third paragraph

+
+ +
+ ); +} + +export default function CollapsibleAccordion() { + const [openIndex, setOpen] = React.useState(-1); + return ( +
+
+        A crude accordion where only 1 of the 3 {``}s can be open at
+        any time
+        
+ Animated using CSS transitions +
+ {[0, 1, 2].map((index) => ( + + ))} +
+ ); +} + +const grey = { + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', +}; + +export function Styles() { + return ( + + ); +} diff --git a/docs/app/experiments/collapsible-cls.tsx b/docs/src/app/experiments/collapsible-cls.tsx similarity index 100% rename from docs/app/experiments/collapsible-cls.tsx rename to docs/src/app/experiments/collapsible-cls.tsx diff --git a/docs/app/experiments/collapsible-framer.tsx b/docs/src/app/experiments/collapsible-framer.tsx similarity index 96% rename from docs/app/experiments/collapsible-framer.tsx rename to docs/src/app/experiments/collapsible-framer.tsx index c3b68da96..dbfd17c56 100644 --- a/docs/app/experiments/collapsible-framer.tsx +++ b/docs/src/app/experiments/collapsible-framer.tsx @@ -45,8 +45,8 @@ export default function CollapsibleFramer() { >

This is the collapsed content

- Your Choice of Fried Chicken (Half), Chicken Sandwich, With Shredded cabbage & carrot - with mustard mayonnaise And Potato Wedges + Your Choice of Fried Chicken (Half), Chicken Sandwich, With Shredded + cabbage & carrot with mustard mayonnaise And Potato Wedges

demo: https://codepen.io/aardrian/pen/QWjBNQG

https://adrianroselli.com/2020/05/disclosure-widgets.html

diff --git a/docs/app/experiments/collapsible-hidden-until-found.tsx b/docs/src/app/experiments/collapsible-hidden-until-found.tsx similarity index 79% rename from docs/app/experiments/collapsible-hidden-until-found.tsx rename to docs/src/app/experiments/collapsible-hidden-until-found.tsx index 558277c63..d42c30c7e 100644 --- a/docs/app/experiments/collapsible-hidden-until-found.tsx +++ b/docs/src/app/experiments/collapsible-hidden-until-found.tsx @@ -11,22 +11,23 @@ export default function CollapsibleHiddenUntilFound() { return (
-        All 3 Collapsibles contain the text "May the force be with you" but only the
-        content in the 2nd and 3rd Collapsible will be revealed by the browser's in-page search
-        (e.g. Ctrl/Cmd-F) in{' '}
+        All 3 Collapsibles contain the text "May the force be with you" but
+        only the content in the 2nd and 3rd Collapsible will be revealed by the
+        browser's in-page search (e.g. Ctrl/Cmd-F) in{' '}
         
           supported browsers
         
         

- All Collapsibles here are animated, but if they are opened by find-in-page, the opening - animation will be disabled (one-off) and open instantly + All Collapsibles here are animated, but if they are opened by find-in-page, + the opening animation will be disabled (one-off) and open instantly

- Collapsible #2 is animated using CSS @keyframe animation, while #1 and #3 is animated with - CSS transitions. #3 demonstrates a possible browser bug where the matching text is not - properly highlighted by the browser the first time that instance is matched. It only occurs - with transitions, not @keyframe animations. + Collapsible #2 is animated using CSS @keyframe animation, while #1 and #3 is + animated with CSS transitions. #3 demonstrates a possible browser bug where + the matching text is not properly highlighted by the browser the first time + that instance is matched. It only occurs with transitions, not @keyframe + animations.
@@ -34,7 +35,9 @@ export default function CollapsibleHiddenUntilFound() { Trigger 1 - +

This is the collapsed content

May the force be with you

diff --git a/docs/app/experiments/collapsible.module.css b/docs/src/app/experiments/collapsible.module.css similarity index 100% rename from docs/app/experiments/collapsible.module.css rename to docs/src/app/experiments/collapsible.module.css diff --git a/docs/src/app/experiments/collapsible.tsx b/docs/src/app/experiments/collapsible.tsx new file mode 100644 index 000000000..13edd2666 --- /dev/null +++ b/docs/src/app/experiments/collapsible.tsx @@ -0,0 +1,205 @@ +'use client'; +import * as React from 'react'; +import { Collapsible } from '@base_ui/react/Collapsible'; + +const DURATION = '350ms'; + +export default function CollapsibleDemo() { + return ( +
+
+ + + + + + + + Trigger (CSS animation) + + +

This is the collapsed content

+

This component is animated with CSS @keyframe animations

+

demo: https://codepen.io/aardrian/pen/QWjBNQG

+

https://adrianroselli.com/2020/05/disclosure-widgets.html

+
+
+
+ +
+ + + + + + + + Trigger (CSS transition) + + +

This is the collapsed content

+

This component is animated with CSS transitions

+

demo: https://codepen.io/aardrian/pen/QWjBNQG

+

https://adrianroselli.com/2020/05/disclosure-widgets.html

+
+
+
+ + + + + + + + + Trigger (root renders a span + CSS transition) + + +

This is the collapsed content

+

This component is animated with CSS transitions

+

demo: https://codepen.io/aardrian/pen/QWjBNQG

+

https://adrianroselli.com/2020/05/disclosure-widgets.html

+
+
+ +
+ ); +} + +const grey = { + 50: '#F3F6F9', + 100: '#E5EAF2', + 200: '#DAE2ED', + 300: '#C7D0DD', + 400: '#B0B8C4', + 500: '#9DA8B7', + 600: '#6B7A90', + 700: '#434D5B', + 800: '#303740', + 900: '#1C2025', +}; + +export function Styles() { + return ( + + ); +} diff --git a/docs/app/experiments/dialog.module.css b/docs/src/app/experiments/dialog.module.css similarity index 100% rename from docs/app/experiments/dialog.module.css rename to docs/src/app/experiments/dialog.module.css diff --git a/docs/app/experiments/dialog.tsx b/docs/src/app/experiments/dialog.tsx similarity index 82% rename from docs/app/experiments/dialog.tsx rename to docs/src/app/experiments/dialog.tsx index 9d72f1bf8..5b79fd50d 100644 --- a/docs/app/experiments/dialog.tsx +++ b/docs/src/app/experiments/dialog.tsx @@ -4,7 +4,11 @@ import clsx from 'clsx'; import { Dialog } from '@base_ui/react/Dialog'; // eslint-disable-next-line no-restricted-imports import { useTransitionStatus } from '@base_ui/react/utils/useTransitionStatus'; -import { animated as springAnimated, useSpring, useSpringRef } from '@react-spring/web'; +import { + animated as springAnimated, + useSpring, + useSpringRef, +} from '@react-spring/web'; import classes from './dialog.module.css'; const NESTED_DIALOGS = 8; @@ -27,9 +31,9 @@ function renderContent( {title} This is a sample dialog.

- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eget sapien id dolor rutrum - porta. Sed enim nulla, placerat eu tincidunt non, ultrices in lectus. Curabitur pellentesque - diam nec ligula hendrerit dapibus. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eget sapien id + dolor rutrum porta. Sed enim nulla, placerat eu tincidunt non, ultrices in + lectus. Curabitur pellentesque diam nec ligula hendrerit dapibus.

@@ -65,7 +69,9 @@ function CssTransitionDialogDemo({ keepMounted, modal, dismissible }: DemoProps) return ( - Open with CSS transition + + Open with CSS transition + - Open with CSS animation + + Open with CSS animation + - + Open with React Spring transition - + }) { +function ReactSpringTransition(props: { + open: boolean; + children?: React.ReactElement; +}) { const { open, children } = props; const api = useSpringRef(); @@ -194,8 +218,16 @@ export default function DialogExperiment() { return (

Dialog

- - + +

Options