From b1467d6ec8c29f13ae894918ace83222b13d7783 Mon Sep 17 00:00:00 2001 From: EmilyyyLiu <100924403+EmilyyyLiu@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:09:56 +0800 Subject: [PATCH] feat(Divider): unify orientation attribute usage (#53645) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat[Divider]: Unified use of orientation attribute * feat: Restore the size type missed in the merge * feat: Delete unnecessary demo adjustments * docs: change text * feat: deprecated warning * Update components/divider/index.zh-CN.md Signed-off-by: thinkasany <480968828@qq.com> * Update components/divider/index.en-US.md Signed-off-by: thinkasany <480968828@qq.com> * feat: use useOrientation and change test,doc * feat: change demos orientation attribut * docs: change token and demo (orientationMargin->titlePlacementMargin) * feat: change demos titlePlacement="left/right" -> "start/end" * docs: titlePlacement align * feat: Resolve merge conflicts * fix: lint error * fix: demo lint error * feat: use mergedStyles.content * test: update snapshot * rerun ci * test: update snapshot * fix: delete titlePlacementMargin and udpate snapshots * feat: change demos orientationMargin-> styles.content.margin * Update components/divider/demo/vertical.md Co-authored-by: thinkasany <480968828@qq.com> Signed-off-by: EmilyyyLiu <100924403+EmilyyyLiu@users.noreply.github.com> * feat: Call warning using list * docs: `vertical` to make the divider vertical. * docs: Modify punctuation usage * docs: Add deprecated description * docs: Clarify the possible values for titlePlacement in the example * feat: replase { margin: '0' } ->{ margin: 0 } --------- Signed-off-by: thinkasany <480968828@qq.com> Signed-off-by: EmilyyyLiu <100924403+EmilyyyLiu@users.noreply.github.com> Co-authored-by: 刘欢 Co-authored-by: thinkasany <480968828@qq.com> --- .../theme/builtins/ResourceArticles/index.tsx | 2 +- components/badge/demo/colorful.tsx | 4 +- components/button/demo/debug-icon.tsx | 2 +- components/button/demo/icon-position.tsx | 2 +- components/button/demo/size.tsx | 2 +- components/collapse/demo/size.tsx | 6 +- components/color-picker/demo/panel-render.tsx | 2 +- components/config-provider/demo/direction.tsx | 28 +++---- components/config-provider/demo/locale.tsx | 2 +- .../__snapshots__/demo-extend.test.ts.snap | 24 +++--- .../__tests__/__snapshots__/demo.test.ts.snap | 24 +++--- components/divider/__tests__/index.test.tsx | 49 +++++++++++- components/divider/demo/_semantic.tsx | 10 +-- components/divider/demo/component-token.tsx | 12 +-- components/divider/demo/customize-style.tsx | 6 +- components/divider/demo/plain.tsx | 4 +- components/divider/demo/vertical.md | 4 +- components/divider/demo/vertical.tsx | 4 +- components/divider/demo/with-text.md | 4 +- components/divider/demo/with-text.tsx | 12 +-- components/divider/index.en-US.md | 10 ++- components/divider/index.tsx | 78 ++++++++++++------- components/divider/index.zh-CN.md | 10 ++- components/divider/style/index.ts | 2 +- components/grid/demo/flex-align.tsx | 6 +- components/grid/demo/flex-order.tsx | 4 +- components/grid/demo/flex-stretch.tsx | 6 +- components/grid/demo/flex.tsx | 12 +-- components/grid/demo/gutter.tsx | 6 +- components/list/demo/component-token.tsx | 12 +-- components/list/demo/simple.tsx | 6 +- components/menu/demo/switch-mode.tsx | 2 +- .../skeleton/demo/_semantic_element.tsx | 2 +- components/space/demo/split.tsx | 2 +- components/tag/demo/colorful.tsx | 4 +- components/tag/demo/status.tsx | 2 +- components/tooltip/demo/colorful.tsx | 4 +- 37 files changed, 220 insertions(+), 151 deletions(-) diff --git a/.dumi/theme/builtins/ResourceArticles/index.tsx b/.dumi/theme/builtins/ResourceArticles/index.tsx index 22d25b169b..137dc5e5f8 100644 --- a/.dumi/theme/builtins/ResourceArticles/index.tsx +++ b/.dumi/theme/builtins/ResourceArticles/index.tsx @@ -79,7 +79,7 @@ const ArticleList: React.FC = ({ name, data = [], authors = [] - + {article?.title} diff --git a/components/badge/demo/colorful.tsx b/components/badge/demo/colorful.tsx index 3dc569105c..9ef1d4b396 100644 --- a/components/badge/demo/colorful.tsx +++ b/components/badge/demo/colorful.tsx @@ -19,13 +19,13 @@ const colors = [ const App: React.FC = () => ( <> - Presets + Presets {colors.map((color) => ( ))} - Custom + Custom diff --git a/components/button/demo/debug-icon.tsx b/components/button/demo/debug-icon.tsx index f9b312cd9e..77d37f3de9 100644 --- a/components/button/demo/debug-icon.tsx +++ b/components/button/demo/debug-icon.tsx @@ -22,7 +22,7 @@ const App: React.FC = () => { Default Small - + Preview diff --git a/components/button/demo/icon-position.tsx b/components/button/demo/icon-position.tsx index 48707d02bf..166e1daf0d 100644 --- a/components/button/demo/icon-position.tsx +++ b/components/button/demo/icon-position.tsx @@ -13,7 +13,7 @@ const App: React.FC = () => { end - + Preview diff --git a/components/button/demo/size.tsx b/components/button/demo/size.tsx index 7a874bfd66..3131627cc3 100644 --- a/components/button/demo/size.tsx +++ b/components/button/demo/size.tsx @@ -14,7 +14,7 @@ const App: React.FC = () => { Default Small - + Preview diff --git a/components/collapse/demo/size.tsx b/components/collapse/demo/size.tsx index 49803c7ce7..5641d543ed 100644 --- a/components/collapse/demo/size.tsx +++ b/components/collapse/demo/size.tsx @@ -9,16 +9,16 @@ const text = ` const App: React.FC = () => ( <> - Default Size + Default Size {text}

}]} /> - Small Size + Small Size {text}

}]} /> - Large Size + Large Size {text}

}]} diff --git a/components/color-picker/demo/panel-render.tsx b/components/color-picker/demo/panel-render.tsx index 94288aa2a2..e4f0bb81bb 100644 --- a/components/color-picker/demo/panel-render.tsx +++ b/components/color-picker/demo/panel-render.tsx @@ -27,7 +27,7 @@ const HorizontalLayoutDemo = () => { - + diff --git a/components/config-provider/demo/direction.tsx b/components/config-provider/demo/direction.tsx index 740d006b2e..f3c273d1a1 100644 --- a/components/config-provider/demo/direction.tsx +++ b/components/config-provider/demo/direction.tsx @@ -163,7 +163,7 @@ const Page: React.FC<{ placement: Placement }> = ({ placement }) => {
- Cascader example + Cascader example } options={cascaderOptions} @@ -185,7 +185,7 @@ const Page: React.FC<{ placement: Placement }> = ({ placement }) => {
- Switch example + Switch example       @@ -194,7 +194,7 @@ const Page: React.FC<{ placement: Placement }> = ({ placement }) => { - Radio Group example + Radio Group example تهران @@ -208,7 +208,7 @@ const Page: React.FC<{ placement: Placement }> = ({ placement }) => {
- Button example + Button example
- Tree example + Tree example = ({ placement }) => {
- Input (Input Group) example + Input (Input Group) example @@ -297,7 +297,7 @@ const Page: React.FC<{ placement: Placement }> = ({ placement }) => {
- Select example + Select example