From 6664c579c772703bb2cc11a97d9fe9bc69c2a404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=81=87=E8=A7=81=E5=90=8C=E5=AD=A6?= <1875694521@qq.com> Date: Sat, 8 Nov 2025 14:23:01 +0800 Subject: [PATCH] chore(demo): improve dark demo (#55647) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(demo): improve dark demo * Update components/transfer/demo/style-class.tsx Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: 遇见同学 <1875694521@qq.com> * Update components/transfer/demo/style-class.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: 遇见同学 <1875694521@qq.com> * chore: update snap --------- Signed-off-by: 遇见同学 <1875694521@qq.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../__snapshots__/demo-extend.test.ts.snap | 14 ++++++++++++-- components/auto-complete/demo/style-class.tsx | 6 ++++-- .../__snapshots__/demo-extend.test.ts.snap | 2 +- .../__snapshots__/demo.test.tsx.snap | 2 +- components/input-number/demo/style-class.tsx | 2 +- .../__snapshots__/demo-extend.test.ts.snap | 6 ++---- .../__tests__/__snapshots__/demo.test.ts.snap | 6 ++---- components/splitter/demo/style-class.tsx | 10 ++++++---- .../__snapshots__/demo-extend.test.ts.snap | 19 ++++++++----------- .../__tests__/__snapshots__/demo.test.ts.snap | 19 ++++++++----------- components/transfer/demo/style-class.tsx | 13 ++++++++----- 11 files changed, 53 insertions(+), 46 deletions(-) diff --git a/components/auto-complete/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/auto-complete/__tests__/__snapshots__/demo-extend.test.ts.snap index 48236a3d3e..0375753978 100644 --- a/components/auto-complete/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/auto-complete/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -2728,7 +2728,7 @@ exports[`renders components/auto-complete/demo/style-class.tsx extend context co
({ const stylesObject: AutoCompleteProps['styles'] = { popup: { root: { borderWidth: 1, borderColor: '#1890ff' }, - list: { backgroundColor: '#f9f9f9' }, + list: { backgroundColor: 'rgba(240,240,240, 0.85)' }, + listItem: { color: '#272727' }, }, }; @@ -21,7 +22,8 @@ const stylesFn: AutoCompleteProps['styles'] = ({ props }) => { return { popup: { root: { borderWidth: 1, borderColor: '#ccc' }, - list: { backgroundColor: '#f0f0f0' }, + list: { backgroundColor: 'rgba(240,240,240, 0.85)' }, + listItem: { color: '#272727' }, }, } satisfies AutoCompleteProps['styles']; } diff --git a/components/input-number/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/input-number/__tests__/__snapshots__/demo-extend.test.ts.snap index d585fc05ce..ff5daa977e 100644 --- a/components/input-number/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/input-number/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -4494,7 +4494,7 @@ exports[`renders components/input-number/demo/style-class.tsx extend context cor
{ if (props.size === 'large') { return { root: { - backgroundColor: '#fafafa', + backgroundColor: 'rgba(250,250,250, 0.5)', borderColor: '#722ed1', }, } satisfies InputNumberProps['styles']; diff --git a/components/splitter/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/splitter/__tests__/__snapshots__/demo-extend.test.ts.snap index 1258de0c68..5b284a2dbb 100644 --- a/components/splitter/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/splitter/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -1310,7 +1310,7 @@ exports[`renders components/splitter/demo/style-class.tsx extend context correct >
First
@@ -1338,7 +1338,7 @@ exports[`renders components/splitter/demo/style-class.tsx extend context correct >
Second
@@ -1359,7 +1359,6 @@ exports[`renders components/splitter/demo/style-class.tsx extend context correct >
First
@@ -1386,7 +1385,6 @@ exports[`renders components/splitter/demo/style-class.tsx extend context correct >
Second
diff --git a/components/splitter/__tests__/__snapshots__/demo.test.ts.snap b/components/splitter/__tests__/__snapshots__/demo.test.ts.snap index 63cd594659..e9033d0a9e 100644 --- a/components/splitter/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/splitter/__tests__/__snapshots__/demo.test.ts.snap @@ -1293,7 +1293,7 @@ exports[`renders components/splitter/demo/style-class.tsx correctly 1`] = ` >
First
@@ -1321,7 +1321,7 @@ exports[`renders components/splitter/demo/style-class.tsx correctly 1`] = ` >
Second
@@ -1342,7 +1342,6 @@ exports[`renders components/splitter/demo/style-class.tsx correctly 1`] = ` >
First
@@ -1369,7 +1368,6 @@ exports[`renders components/splitter/demo/style-class.tsx correctly 1`] = ` >
Second
diff --git a/components/splitter/demo/style-class.tsx b/components/splitter/demo/style-class.tsx index 064a1edc67..5b9ce5dae6 100644 --- a/components/splitter/demo/style-class.tsx +++ b/components/splitter/demo/style-class.tsx @@ -3,10 +3,12 @@ import { Flex, Splitter, Typography } from 'antd'; import type { SplitterProps } from 'antd'; import { createStyles } from 'antd-style'; -const Desc: React.FC> = (props) => { +const Desc: React.FC> = ( + props, +) => { return ( - + {props.text} @@ -49,10 +51,10 @@ const App: React.FC = () => { - + - + diff --git a/components/transfer/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/transfer/__tests__/__snapshots__/demo-extend.test.ts.snap index 577f69ebcd..c175b49919 100644 --- a/components/transfer/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/transfer/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -11446,8 +11446,7 @@ exports[`renders components/transfer/demo/style-class.tsx extend context correct class="ant-transfer ant-transfer-status-error css-var-test-id" >
({ - section: { backgroundColor: '#fafafa' }, +const useStyles = createStyles(({ token, css }) => ({ + section: { backgroundColor: 'rgba(250,250,250, 0.5)' }, header: { color: token.colorPrimary }, + actions: css` + & button { + background-color: rgba(255,242,232,0.6); + } + `, })); const mockData = Array.from({ length: 20 }).map((_, i) => ({ @@ -17,15 +22,13 @@ const mockData = Array.from({ length: 20 }).map((_, i) => ({ const initialTargetKeys = mockData.filter((item) => Number(item.key) > 10).map((item) => item.key); const stylesObject: TransferProps['styles'] = { - section: { backgroundColor: '#fafafa' }, header: { fontWeight: 'bold' }, - actions: { backgroundColor: '#fff2e8' }, }; const stylesFn: TransferProps['styles'] = (info) => { if (info.props.status === 'warning') { return { - section: { backgroundColor: '#f6ffed', borderColor: '#b7eb8f' }, + section: { backgroundColor: 'rgba(246,255,237, 0.6)', borderColor: '#b7eb8f' }, header: { color: '#8DBCC7', fontWeight: 'normal' }, } satisfies TransferProps['styles']; }