From 74c7d207c1cf6dc01d9b972bd315defe7868172f Mon Sep 17 00:00:00 2001 From: MadCcc <1075746765@qq.com> Date: Mon, 17 Jul 2023 10:13:22 +0800 Subject: [PATCH] refactor: menu component token (#43576) * docs: update examples link * refacor: menu component token * chore: update demo * chore: update test case * fix: token * chore: fix * Apply suggestions from code review Signed-off-by: MadCcc <1075746765@qq.com> * chore: fix lint * refactor: more token --------- Signed-off-by: MadCcc <1075746765@qq.com> --- .dumi/theme/slots/Sidebar/index.tsx | 4 +- components/layout/__tests__/token.test.tsx | 2 - .../__snapshots__/demo-extend.test.ts.snap | 1401 +++++++++++++---- .../__snapshots__/demo.test.tsx.snap | 492 ++++-- components/menu/demo/component-token.tsx | 97 +- components/menu/style/horizontal.tsx | 8 +- components/menu/style/index.tsx | 273 +++- components/menu/style/theme.tsx | 8 +- components/menu/style/vertical.tsx | 28 +- docs/blog/extract-ssr.en-US.md | 2 +- docs/blog/extract-ssr.zh-CN.md | 2 +- docs/react/migrate-less-variables.en-US.md | 42 +- docs/react/migrate-less-variables.zh-CN.md | 40 +- 13 files changed, 1922 insertions(+), 477 deletions(-) diff --git a/.dumi/theme/slots/Sidebar/index.tsx b/.dumi/theme/slots/Sidebar/index.tsx index 3a6fb7c367..22c5e78cb8 100644 --- a/.dumi/theme/slots/Sidebar/index.tsx +++ b/.dumi/theme/slots/Sidebar/index.tsx @@ -134,7 +134,9 @@ const Sidebar: React.FC = () => { } = useSiteToken(); const menuChild = ( - + { >
{ @@ -62,7 +61,6 @@ describe('Layout.Token', () => { >
{ diff --git a/components/menu/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/menu/__tests__/__snapshots__/demo-extend.test.ts.snap index ae3cec84dc..f8ad1bf508 100644 --- a/components/menu/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/menu/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -1,131 +1,34 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders components/menu/demo/component-token.tsx extend context correctly 1`] = ` -Array [ - +