diff --git a/e2e/fixtures/custom-plugin/package.json b/e2e/fixtures/custom-plugin/package.json index 1661f495e..68c0f5e5d 100644 --- a/e2e/fixtures/custom-plugin/package.json +++ b/e2e/fixtures/custom-plugin/package.json @@ -13,7 +13,6 @@ "@rspress/shared": "workspace:*", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-transition-group": "4.4.5", "rspress": "workspace:*", "solid-js": "^1.9.3" }, diff --git a/e2e/fixtures/plugin-preview/package.json b/e2e/fixtures/plugin-preview/package.json index 7c5d244b9..c3d455081 100644 --- a/e2e/fixtures/plugin-preview/package.json +++ b/e2e/fixtures/plugin-preview/package.json @@ -13,7 +13,6 @@ "@rspress/shared": "workspace:*", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-transition-group": "4.4.5", "rspress": "workspace:*", "solid-js": "^1.9.3" }, diff --git a/packages/theme-default/package.json b/packages/theme-default/package.json index 3b5a8071a..b8ae29935 100644 --- a/packages/theme-default/package.json +++ b/packages/theme-default/package.json @@ -48,8 +48,7 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "react-helmet-async": "^1.3.0", - "react-syntax-highlighter": "^15.6.1", - "react-transition-group": "4.4.5" + "react-syntax-highlighter": "^15.6.1" }, "devDependencies": { "@modern-js/plugin-tailwindcss": "2.62.0", diff --git a/packages/theme-default/src/components/LocalSideBar/index.scss b/packages/theme-default/src/components/LocalSideBar/index.scss index fdd0aea99..02827c269 100644 --- a/packages/theme-default/src/components/LocalSideBar/index.scss +++ b/packages/theme-default/src/components/LocalSideBar/index.scss @@ -54,6 +54,16 @@ overflow: scroll; box-shadow: var(--rp-shadow-1); border: 1px solid var(--rp-c-divider-light); + opacity: 0; + transform: translateY(-20px); + visibility: hidden; + transition: all 0.3s ease-out; + + &-show { + opacity: 1; + transform: translateY(0); + visibility: visible; + } } .fly-in-enter { diff --git a/packages/theme-default/src/components/LocalSideBar/index.tsx b/packages/theme-default/src/components/LocalSideBar/index.tsx index 1cb1c999a..f5388b14a 100644 --- a/packages/theme-default/src/components/LocalSideBar/index.tsx +++ b/packages/theme-default/src/components/LocalSideBar/index.tsx @@ -6,7 +6,6 @@ import { Sidebar, Toc } from '@theme'; import './index.scss'; import type { UISwitchResult } from '../../logic/useUISwitch'; import { SvgWrapper } from '../SvgWrapper'; -import { CSSTransition } from 'react-transition-group'; export function SideMenu({ outlineTitle, @@ -93,24 +92,15 @@ export function SideMenu({ - - - { - setIsTocOpen(false); - }} - /> - - + { + setIsTocOpen(false); + }} + /> + ) : null} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8b876459a..041f12a40 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -210,9 +210,6 @@ importers: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) - react-transition-group: - specifier: 4.4.5 - version: 4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rspress: specifier: workspace:* version: link:../../../packages/cli @@ -406,9 +403,6 @@ importers: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) - react-transition-group: - specifier: 4.4.5 - version: 4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rspress: specifier: workspace:* version: link:../../../packages/cli @@ -1448,9 +1442,6 @@ importers: react-syntax-highlighter: specifier: ^15.6.1 version: 15.6.1(react@18.3.1) - react-transition-group: - specifier: 4.4.5 - version: 4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) devDependencies: '@modern-js/plugin-tailwindcss': specifier: 2.62.0