From 882cec62d64a7348332a3813dbcb241ff378da7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=81=8F=E5=8F=B3?= Date: Sun, 31 May 2020 11:48:34 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=F0=9F=8C=88=20Add=20Components=20overv?= =?UTF-8?q?iew=20page=20(#24491)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: Add components overview page * fix detail * remove ContributorsList form overview page * fix components url * improve code style * remove extra file * fix detail * fix lint * fix lint * docs: Finish components overview page * fix lint * docs: Update cover * fix lint * update cover * update menu * improve overview page * refactor code * fix order * update title * add components count * fix overview page ssr bug * move less file * update title margin Co-authored-by: arvinxx --- README-pt_BR.md | 2 +- README-zh_CN.md | 2 +- README.md | 2 +- components/affix/index.en-US.md | 1 + components/affix/index.zh-CN.md | 1 + components/alert/index.en-US.md | 1 + components/alert/index.zh-CN.md | 1 + components/anchor/index.en-US.md | 1 + components/anchor/index.zh-CN.md | 1 + components/auto-complete/index.en-US.md | 1 + components/auto-complete/index.zh-CN.md | 1 + components/avatar/index.en-US.md | 1 + components/avatar/index.zh-CN.md | 1 + components/back-top/index.en-US.md | 1 + components/back-top/index.zh-CN.md | 1 + components/badge/index.en-US.md | 1 + components/badge/index.zh-CN.md | 1 + components/breadcrumb/index.en-US.md | 1 + components/breadcrumb/index.zh-CN.md | 1 + components/button/index.en-US.md | 1 + components/button/index.zh-CN.md | 1 + components/calendar/index.en-US.md | 1 + components/calendar/index.zh-CN.md | 1 + components/card/index.en-US.md | 1 + components/card/index.zh-CN.md | 1 + components/carousel/index.en-US.md | 1 + components/carousel/index.zh-CN.md | 1 + components/cascader/index.en-US.md | 1 + components/cascader/index.zh-CN.md | 1 + components/checkbox/index.en-US.md | 1 + components/checkbox/index.zh-CN.md | 1 + components/collapse/index.en-US.md | 1 + components/collapse/index.zh-CN.md | 1 + components/comment/index.en-US.md | 1 + components/comment/index.zh-CN.md | 1 + components/config-provider/index.en-US.md | 1 + components/config-provider/index.zh-CN.md | 1 + components/date-picker/index.en-US.md | 1 + components/date-picker/index.zh-CN.md | 1 + components/descriptions/index.en-US.md | 1 + components/descriptions/index.zh-CN.md | 1 + components/divider/index.en-US.md | 1 + components/divider/index.zh-CN.md | 1 + components/drawer/index.en-US.md | 1 + components/drawer/index.zh-CN.md | 1 + components/dropdown/index.en-US.md | 1 + components/dropdown/index.zh-CN.md | 1 + components/empty/index.en-US.md | 1 + components/empty/index.zh-CN.md | 1 + components/form/index.en-US.md | 1 + components/form/index.zh-CN.md | 1 + components/grid/index.en-US.md | 1 + components/grid/index.zh-CN.md | 1 + components/icon/index.en-US.md | 1 + components/icon/index.zh-CN.md | 1 + components/input-number/index.en-US.md | 1 + components/input-number/index.zh-CN.md | 1 + components/input/index.en-US.md | 1 + components/input/index.zh-CN.md | 1 + components/layout/index.en-US.md | 1 + components/layout/index.zh-CN.md | 1 + components/list/index.en-US.md | 1 + components/list/index.zh-CN.md | 1 + components/mentions/index.en-US.md | 1 + components/mentions/index.zh-CN.md | 1 + components/menu/index.en-US.md | 1 + components/menu/index.zh-CN.md | 1 + components/message/index.en-US.md | 1 + components/message/index.zh-CN.md | 1 + components/modal/index.en-US.md | 1 + components/modal/index.zh-CN.md | 1 + components/notification/index.en-US.md | 1 + components/notification/index.zh-CN.md | 1 + components/overview/index.en-US.md | 7 + components/overview/index.zh-CN.md | 7 + components/page-header/index.en-US.md | 1 + components/page-header/index.zh-CN.md | 1 + components/pagination/index.en-US.md | 1 + components/pagination/index.zh-CN.md | 1 + components/popconfirm/index.en-US.md | 1 + components/popconfirm/index.zh-CN.md | 1 + components/popover/index.en-US.md | 1 + components/popover/index.zh-CN.md | 1 + components/progress/index.en-US.md | 1 + components/progress/index.zh-CN.md | 1 + components/radio/index.en-US.md | 1 + components/radio/index.zh-CN.md | 1 + components/rate/index.en-US.md | 1 + components/rate/index.zh-CN.md | 1 + components/result/index.en-US.md | 2 +- components/result/index.zh-CN.md | 1 + components/select/index.en-US.md | 1 + components/select/index.zh-CN.md | 1 + components/skeleton/index.en-US.md | 1 + components/skeleton/index.zh-CN.md | 1 + components/slider/index.en-US.md | 1 + components/slider/index.zh-CN.md | 1 + components/space/index.en-US.md | 1 + components/space/index.zh-CN.md | 1 + components/spin/index.en-US.md | 1 + components/spin/index.zh-CN.md | 1 + components/statistic/index.en-US.md | 1 + components/statistic/index.zh-CN.md | 1 + components/steps/index.en-US.md | 1 + components/steps/index.zh-CN.md | 1 + components/switch/index.en-US.md | 1 + components/switch/index.zh-CN.md | 1 + components/table/index.en-US.md | 1 + components/table/index.zh-CN.md | 1 + components/tabs/index.en-US.md | 1 + components/tabs/index.zh-CN.md | 1 + components/tag/index.en-US.md | 1 + components/tag/index.zh-CN.md | 1 + components/time-picker/index.en-US.md | 1 + components/time-picker/index.zh-CN.md | 1 + components/timeline/index.en-US.md | 1 + components/timeline/index.zh-CN.md | 1 + components/tooltip/index.en-US.md | 1 + components/tooltip/index.zh-CN.md | 1 + components/transfer/index.en-US.md | 1 + components/transfer/index.zh-CN.md | 1 + components/tree-select/index.en-US.md | 1 + components/tree-select/index.zh-CN.md | 2 + components/tree/index.en-US.md | 1 + components/tree/index.zh-CN.md | 1 + components/typography/index.en-US.md | 1 + components/typography/index.zh-CN.md | 1 + components/upload/index.en-US.md | 1 + components/upload/index.zh-CN.md | 1 + docs/react/introduce.en-US.md | 2 +- docs/react/introduce.zh-CN.md | 2 +- site/bisheng.config.js | 51 +--- .../template/Content/ComponentOverview.jsx | 84 +++++++ .../template/Content/ComponentOverview.less | 28 +++ site/theme/template/Content/MainContent.jsx | 228 ++++++++++-------- .../template/Layout/Header/Navigation.tsx | 2 +- site/theme/template/Layout/index.jsx | 6 +- site/theme/template/utils.tsx | 5 + site/themeConfig.d.ts | 11 + site/themeConfig.js | 52 ++++ 140 files changed, 456 insertions(+), 161 deletions(-) create mode 100644 components/overview/index.en-US.md create mode 100644 components/overview/index.zh-CN.md create mode 100644 site/theme/template/Content/ComponentOverview.jsx create mode 100644 site/theme/template/Content/ComponentOverview.less create mode 100644 site/themeConfig.d.ts create mode 100644 site/themeConfig.js diff --git a/README-pt_BR.md b/README-pt_BR.md index 591d00c3df..ec246a624b 100644 --- a/README-pt_BR.md +++ b/README-pt_BR.md @@ -110,7 +110,7 @@ Veja [i18n](https://ant.design/docs/react/i18n). ## 🔗 Links - [Página inicial](https://ant.design/) -- [Componentes](https://ant.design/components/button) +- [Componentes](https://ant.design/components/overview) - [Ant Design Pro](http://pro.ant.design/) - [Ant Design Charts](https://charts.ant.design) - [Change Log](CHANGELOG.en-US.md) diff --git a/README-zh_CN.md b/README-zh_CN.md index 0e360f5418..233ac6b972 100644 --- a/README-zh_CN.md +++ b/README-zh_CN.md @@ -114,7 +114,7 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' ## 🔗 链接 - [首页](https://ant.design/) -- [组件库](https://ant.design/docs/react/introduce) +- [组件库](https://ant.design/components/overview-cn) - [Ant Design Pro](http://pro.ant.design/) - [Ant Design Charts](https://charts.ant.design) - [更新日志](CHANGELOG.en-US.md) diff --git a/README.md b/README.md index cc6c8bc8af..b44063dcac 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ Dozens of languages supported in `antd`, see [i18n](https://ant.design/docs/reac ## 🔗 Links - [Home page](https://ant.design/) -- [Components](https://ant.design/components/button/) +- [Components](https://ant.design/components/overview) - [Ant Design Pro](http://pro.ant.design/) - [Ant Design Charts](https://charts.ant.design) - [Change Log](CHANGELOG.en-US.md) diff --git a/components/affix/index.en-US.md b/components/affix/index.en-US.md index 27302acf70..9d0fd783a3 100644 --- a/components/affix/index.en-US.md +++ b/components/affix/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Navigation title: Affix +cover: https://gw.alipayobjects.com/zos/alicdn/SQGCQ7gOO/Affix.svg --- Wrap Affix around another component to make it stick the viewport. diff --git a/components/affix/index.zh-CN.md b/components/affix/index.zh-CN.md index d6d1b97837..4ff1a39973 100644 --- a/components/affix/index.zh-CN.md +++ b/components/affix/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 固钉 type: 导航 title: Affix +cover: https://gw.alipayobjects.com/zos/alicdn/SQGCQ7gOO/Affix.svg --- 将页面元素钉在可视范围。 diff --git a/components/alert/index.en-US.md b/components/alert/index.en-US.md index 57db85eba4..5d749b3dd2 100644 --- a/components/alert/index.en-US.md +++ b/components/alert/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Feedback title: Alert +cover: https://gw.alipayobjects.com/zos/antfincdn/nuhf3vdRno/Alert.svg --- Alert component for feedback. diff --git a/components/alert/index.zh-CN.md b/components/alert/index.zh-CN.md index fc3e0acf06..f8fe52599f 100644 --- a/components/alert/index.zh-CN.md +++ b/components/alert/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 警告提示 type: 反馈 title: Alert +cover: https://gw.alipayobjects.com/zos/antfincdn/nuhf3vdRno/Alert.svg --- 警告提示,展现需要关注的信息。 diff --git a/components/anchor/index.en-US.md b/components/anchor/index.en-US.md index 63c9e81e9b..3f7aae334a 100644 --- a/components/anchor/index.en-US.md +++ b/components/anchor/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Other cols: 2 title: Anchor +cover: https://gw.alipayobjects.com/zos/alicdn/ep_L42LFy/Anchor.svg --- Hyperlinks to scroll on one page. diff --git a/components/anchor/index.zh-CN.md b/components/anchor/index.zh-CN.md index 607eb64afa..7df48293a3 100644 --- a/components/anchor/index.zh-CN.md +++ b/components/anchor/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 锚点 cols: 2 type: 其他 title: Anchor +cover: https://gw.alipayobjects.com/zos/alicdn/ep_L42LFy/Anchor.svg --- 用于跳转到页面指定位置。 diff --git a/components/auto-complete/index.en-US.md b/components/auto-complete/index.en-US.md index 36648c65e5..134444af10 100644 --- a/components/auto-complete/index.en-US.md +++ b/components/auto-complete/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Data Entry cols: 2 title: AutoComplete +cover: https://gw.alipayobjects.com/zos/alicdn/gtGCgVDKv/AutoComplete.svg --- Autocomplete function of input field. diff --git a/components/auto-complete/index.zh-CN.md b/components/auto-complete/index.zh-CN.md index b63a3c7fab..6243ed7bd6 100644 --- a/components/auto-complete/index.zh-CN.md +++ b/components/auto-complete/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 自动完成 type: 数据录入 cols: 2 title: AutoComplete +cover: https://gw.alipayobjects.com/zos/alicdn/gtGCgVDKv/AutoComplete.svg --- 输入框自动完成功能。 diff --git a/components/avatar/index.en-US.md b/components/avatar/index.en-US.md index 2156dabc56..27542a0d05 100644 --- a/components/avatar/index.en-US.md +++ b/components/avatar/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Display title: Avatar +cover: https://gw.alipayobjects.com/zos/antfincdn/aBcnbw68hP/Avatar.svg --- Avatars can be used to represent people or objects. It supports images, `Icon`s, or letters. diff --git a/components/avatar/index.zh-CN.md b/components/avatar/index.zh-CN.md index 696fd36c22..ca3bb31287 100644 --- a/components/avatar/index.zh-CN.md +++ b/components/avatar/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 头像 type: 数据展示 title: Avatar +cover: https://gw.alipayobjects.com/zos/antfincdn/aBcnbw68hP/Avatar.svg --- 用来代表用户或事物,支持图片、图标或字符展示。 diff --git a/components/back-top/index.en-US.md b/components/back-top/index.en-US.md index a5d7da816f..63808af0cd 100644 --- a/components/back-top/index.en-US.md +++ b/components/back-top/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Other title: BackTop +cover: https://gw.alipayobjects.com/zos/alicdn/Ji3PnAAMT/BackTop.svg --- `BackTop` makes it easy to go back to the top of the page. diff --git a/components/back-top/index.zh-CN.md b/components/back-top/index.zh-CN.md index c95bb50495..09f9a77ad3 100644 --- a/components/back-top/index.zh-CN.md +++ b/components/back-top/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components type: 其他 subtitle: 回到顶部 title: BackTop +cover: https://gw.alipayobjects.com/zos/alicdn/Ji3PnAAMT/BackTop.svg --- 返回页面顶部的操作按钮。 diff --git a/components/badge/index.en-US.md b/components/badge/index.en-US.md index d854f2b72e..b66d46b89b 100644 --- a/components/badge/index.en-US.md +++ b/components/badge/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Display title: Badge +cover: https://gw.alipayobjects.com/zos/antfincdn/6%26GF9WHwvY/Badge.svg --- Small numerical value or status descriptor for UI elements. diff --git a/components/badge/index.zh-CN.md b/components/badge/index.zh-CN.md index c4d2a22368..f272aba08e 100644 --- a/components/badge/index.zh-CN.md +++ b/components/badge/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 徽标数 type: 数据展示 title: Badge +cover: https://gw.alipayobjects.com/zos/antfincdn/6%26GF9WHwvY/Badge.svg --- 图标右上角的圆形徽标数字。 diff --git a/components/breadcrumb/index.en-US.md b/components/breadcrumb/index.en-US.md index a90f300f51..333108386f 100644 --- a/components/breadcrumb/index.en-US.md +++ b/components/breadcrumb/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Navigation title: Breadcrumb +cover: https://gw.alipayobjects.com/zos/alicdn/9Ltop8JwH/Breadcrumb.svg --- A breadcrumb displays the current location within a hierarchy. It allows going back to states higher up in the hierarchy. diff --git a/components/breadcrumb/index.zh-CN.md b/components/breadcrumb/index.zh-CN.md index 563cee4472..2ede5522a7 100644 --- a/components/breadcrumb/index.zh-CN.md +++ b/components/breadcrumb/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 面包屑 type: 导航 title: Breadcrumb +cover: https://gw.alipayobjects.com/zos/alicdn/9Ltop8JwH/Breadcrumb.svg --- 显示当前页面在系统层级结构中的位置,并能向上返回。 diff --git a/components/button/index.en-US.md b/components/button/index.en-US.md index afedcefaf6..f3da06cc03 100644 --- a/components/button/index.en-US.md +++ b/components/button/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: General title: Button +cover: https://gw.alipayobjects.com/zos/antfincdn/qZWIjVIkQ7/Button.svg --- To trigger an operation. diff --git a/components/button/index.zh-CN.md b/components/button/index.zh-CN.md index 59fb5a64a2..ec8ab43696 100644 --- a/components/button/index.zh-CN.md +++ b/components/button/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components type: 通用 title: Button subtitle: 按钮 +cover: https://gw.alipayobjects.com/zos/antfincdn/qZWIjVIkQ7/Button.svg --- 按钮用于开始一个即时操作。 diff --git a/components/calendar/index.en-US.md b/components/calendar/index.en-US.md index 98d82ae8ce..ed89084a34 100644 --- a/components/calendar/index.en-US.md +++ b/components/calendar/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Data Display cols: 1 title: Calendar +cover: https://gw.alipayobjects.com/zos/antfincdn/dPQmLq08DI/Calendar.svg --- Container for displaying data in calendar form. diff --git a/components/calendar/index.zh-CN.md b/components/calendar/index.zh-CN.md index baaef3ce7f..abefd37966 100644 --- a/components/calendar/index.zh-CN.md +++ b/components/calendar/index.zh-CN.md @@ -4,6 +4,7 @@ type: 数据展示 subtitle: 日历 cols: 1 title: Calendar +cover: https://gw.alipayobjects.com/zos/antfincdn/dPQmLq08DI/Calendar.svg --- 按照日历形式展示数据的容器。 diff --git a/components/card/index.en-US.md b/components/card/index.en-US.md index cf8bde791a..79c0ef3028 100644 --- a/components/card/index.en-US.md +++ b/components/card/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Data Display title: Card cols: 1 +cover: https://gw.alipayobjects.com/zos/antfincdn/NqXt8DJhky/Card.svg --- Simple rectangular container. diff --git a/components/card/index.zh-CN.md b/components/card/index.zh-CN.md index 1e8e563a14..269eb650fb 100644 --- a/components/card/index.zh-CN.md +++ b/components/card/index.zh-CN.md @@ -4,6 +4,7 @@ type: 数据展示 title: Card subtitle: 卡片 cols: 1 +cover: https://gw.alipayobjects.com/zos/antfincdn/NqXt8DJhky/Card.svg --- 通用卡片容器。 diff --git a/components/carousel/index.en-US.md b/components/carousel/index.en-US.md index b6b56cf1ab..656edb2bf5 100644 --- a/components/carousel/index.en-US.md +++ b/components/carousel/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Display title: Carousel +cover: https://gw.alipayobjects.com/zos/antfincdn/%24C9tmj978R/Carousel.svg --- A carousel component. Scales with its container. diff --git a/components/carousel/index.zh-CN.md b/components/carousel/index.zh-CN.md index b5c93c60b9..2f916e9990 100644 --- a/components/carousel/index.zh-CN.md +++ b/components/carousel/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components type: 数据展示 title: Carousel subtitle: 走马灯 +cover: https://gw.alipayobjects.com/zos/antfincdn/%24C9tmj978R/Carousel.svg --- 旋转木马,一组轮播的区域。 diff --git a/components/cascader/index.en-US.md b/components/cascader/index.en-US.md index 00b749df73..773850c661 100644 --- a/components/cascader/index.en-US.md +++ b/components/cascader/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: Cascader +cover: https://gw.alipayobjects.com/zos/antfincdn/cOHaAyTQ3u/Cascader.svg --- Cascade selection box. diff --git a/components/cascader/index.zh-CN.md b/components/cascader/index.zh-CN.md index 53ce83920f..196e329305 100644 --- a/components/cascader/index.zh-CN.md +++ b/components/cascader/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components type: 数据录入 title: Cascader subtitle: 级联选择 +cover: https://gw.alipayobjects.com/zos/antfincdn/cOHaAyTQ3u/Cascader.svg --- 级联选择框。 diff --git a/components/checkbox/index.en-US.md b/components/checkbox/index.en-US.md index 8b40e2553a..5f4feb6b0d 100644 --- a/components/checkbox/index.en-US.md +++ b/components/checkbox/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: Checkbox +cover: https://gw.alipayobjects.com/zos/alicdn/p7QZthygf/Checkbox.svg --- Checkbox component. diff --git a/components/checkbox/index.zh-CN.md b/components/checkbox/index.zh-CN.md index 09ca987432..f3f0e1b4bd 100644 --- a/components/checkbox/index.zh-CN.md +++ b/components/checkbox/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 多选框 type: 数据录入 title: Checkbox +cover: https://gw.alipayobjects.com/zos/alicdn/p7QZthygf/Checkbox.svg --- 多选框。 diff --git a/components/collapse/index.en-US.md b/components/collapse/index.en-US.md index 599b04f527..1574a6767d 100644 --- a/components/collapse/index.en-US.md +++ b/components/collapse/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Data Display title: Collapse cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/IxH16B9RD/Collapse.svg --- A content area which can be collapsed and expanded. diff --git a/components/collapse/index.zh-CN.md b/components/collapse/index.zh-CN.md index 7f3a5a8cb8..92f2babea5 100644 --- a/components/collapse/index.zh-CN.md +++ b/components/collapse/index.zh-CN.md @@ -4,6 +4,7 @@ type: 数据展示 title: Collapse subtitle: 折叠面板 cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/IxH16B9RD/Collapse.svg --- 可以折叠/展开的内容区域。 diff --git a/components/comment/index.en-US.md b/components/comment/index.en-US.md index 255510f3e8..e5db993252 100644 --- a/components/comment/index.en-US.md +++ b/components/comment/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Data Display title: Comment cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/uNYjrKkPv/Comment.svg --- A comment displays user feedback and discussion to website content. diff --git a/components/comment/index.zh-CN.md b/components/comment/index.zh-CN.md index d28d35a414..b78976f6be 100644 --- a/components/comment/index.zh-CN.md +++ b/components/comment/index.zh-CN.md @@ -4,6 +4,7 @@ type: 数据展示 title: Comment subtitle: 评论 cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/uNYjrKkPv/Comment.svg --- 对网站内容的反馈、评价和讨论。 diff --git a/components/config-provider/index.en-US.md b/components/config-provider/index.en-US.md index efd5594e3c..5018e607d4 100644 --- a/components/config-provider/index.en-US.md +++ b/components/config-provider/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Other cols: 1 title: ConfigProvider +cover: https://gw.alipayobjects.com/zos/alicdn/kegYxl1wj/ConfigProvider.svg --- `ConfigProvider` provides a uniform configuration support for components. diff --git a/components/config-provider/index.zh-CN.md b/components/config-provider/index.zh-CN.md index 416649527f..7f7a38df6e 100644 --- a/components/config-provider/index.zh-CN.md +++ b/components/config-provider/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 全局化配置 cols: 1 type: 其他 title: ConfigProvider +cover: https://gw.alipayobjects.com/zos/alicdn/kegYxl1wj/ConfigProvider.svg --- 为组件提供统一的全局化配置。 diff --git a/components/date-picker/index.en-US.md b/components/date-picker/index.en-US.md index 6be9088103..c8a2fd4e60 100644 --- a/components/date-picker/index.en-US.md +++ b/components/date-picker/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: DatePicker +cover: https://gw.alipayobjects.com/zos/alicdn/Xr6CsbN_a/DatePicker.svg --- To select or input a date. diff --git a/components/date-picker/index.zh-CN.md b/components/date-picker/index.zh-CN.md index 6f0a4ae4c5..45b6f7067b 100644 --- a/components/date-picker/index.zh-CN.md +++ b/components/date-picker/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components type: 数据录入 title: DatePicker subtitle: 日期选择框 +cover: https://gw.alipayobjects.com/zos/alicdn/Xr6CsbN_a/DatePicker.svg --- 输入或选择日期的控件。 diff --git a/components/descriptions/index.en-US.md b/components/descriptions/index.en-US.md index a15753ac02..f4b331a9f9 100644 --- a/components/descriptions/index.en-US.md +++ b/components/descriptions/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Data Display title: Descriptions cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/MjtG9_FOI/Descriptions.svg --- Display multiple read-only fields in groups. diff --git a/components/descriptions/index.zh-CN.md b/components/descriptions/index.zh-CN.md index a7c4608ef1..03d31b0e64 100644 --- a/components/descriptions/index.zh-CN.md +++ b/components/descriptions/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 描述列表 type: 数据展示 title: Descriptions cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/MjtG9_FOI/Descriptions.svg --- 成组展示多个只读字段。 diff --git a/components/divider/index.en-US.md b/components/divider/index.en-US.md index bb414a5424..83ec022380 100644 --- a/components/divider/index.en-US.md +++ b/components/divider/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Layout title: Divider +cover: https://gw.alipayobjects.com/zos/alicdn/5swjECahe/Divider.svg --- A divider line separates different content. diff --git a/components/divider/index.zh-CN.md b/components/divider/index.zh-CN.md index e8ce1e3516..899ee74288 100644 --- a/components/divider/index.zh-CN.md +++ b/components/divider/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components type: 布局 title: Divider subtitle: 分割线 +cover: https://gw.alipayobjects.com/zos/alicdn/5swjECahe/Divider.svg --- 区隔内容的分割线。 diff --git a/components/drawer/index.en-US.md b/components/drawer/index.en-US.md index 8f7d69d951..93c343b0bf 100644 --- a/components/drawer/index.en-US.md +++ b/components/drawer/index.en-US.md @@ -3,6 +3,7 @@ type: Feedback category: Components subtitle: title: Drawer +cover: https://gw.alipayobjects.com/zos/alicdn/7z8NJQhFb/Drawer.svg --- A panel which slides in from the edge of the screen. diff --git a/components/drawer/index.zh-CN.md b/components/drawer/index.zh-CN.md index eaba56621e..1add0131db 100644 --- a/components/drawer/index.zh-CN.md +++ b/components/drawer/index.zh-CN.md @@ -3,6 +3,7 @@ type: 反馈 category: Components subtitle: 抽屉 title: Drawer +cover: https://gw.alipayobjects.com/zos/alicdn/7z8NJQhFb/Drawer.svg --- 屏幕边缘滑出的浮层面板。 diff --git a/components/dropdown/index.en-US.md b/components/dropdown/index.en-US.md index 9a2ff3480a..2fa6a6021a 100644 --- a/components/dropdown/index.en-US.md +++ b/components/dropdown/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Navigation title: Dropdown +cover: https://gw.alipayobjects.com/zos/alicdn/TIIiKrsQT/Dropdown.svg --- A dropdown list. diff --git a/components/dropdown/index.zh-CN.md b/components/dropdown/index.zh-CN.md index c669c08a4f..4977d363f0 100644 --- a/components/dropdown/index.zh-CN.md +++ b/components/dropdown/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 下拉菜单 type: 导航 title: Dropdown +cover: https://gw.alipayobjects.com/zos/alicdn/TIIiKrsQT/Dropdown.svg --- 向下弹出的列表。 diff --git a/components/empty/index.en-US.md b/components/empty/index.en-US.md index 649880ac7a..aeb9e4d528 100644 --- a/components/empty/index.en-US.md +++ b/components/empty/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Data Display title: Empty cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/HzvSywumz/Empty.svg --- Empty state placeholder. diff --git a/components/empty/index.zh-CN.md b/components/empty/index.zh-CN.md index aaeab3f0e9..63531cccb2 100644 --- a/components/empty/index.zh-CN.md +++ b/components/empty/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 空状态 type: 数据展示 title: Empty cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/HzvSywumz/Empty.svg --- 空状态时的展示占位图。 diff --git a/components/form/index.en-US.md b/components/form/index.en-US.md index c22c3b9c90..085c41a053 100644 --- a/components/form/index.en-US.md +++ b/components/form/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Data Entry cols: 1 title: Form +cover: https://gw.alipayobjects.com/zos/antfincdn/YeW5m96xHG/Form.svg --- High performance Form component with data scope management. Including data collection, verification, and styles. diff --git a/components/form/index.zh-CN.md b/components/form/index.zh-CN.md index 87d7873610..439ed01cd5 100644 --- a/components/form/index.zh-CN.md +++ b/components/form/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 表单 type: 数据录入 cols: 1 title: Form +cover: https://gw.alipayobjects.com/zos/antfincdn/YeW5m96xHG/Form.svg --- 高性能表单控件,自带数据域管理。包含数据录入、校验以及对应样式。 diff --git a/components/grid/index.en-US.md b/components/grid/index.en-US.md index 117fe088c6..f4d1a65f4e 100644 --- a/components/grid/index.en-US.md +++ b/components/grid/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Layout cols: 1 title: Grid +cover: https://gw.alipayobjects.com/zos/alicdn/5rWLU27so/Grid.svg --- 24 Grids System。 diff --git a/components/grid/index.zh-CN.md b/components/grid/index.zh-CN.md index dc995003b3..8d7cf97600 100644 --- a/components/grid/index.zh-CN.md +++ b/components/grid/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 栅格 type: 布局 cols: 1 title: Grid +cover: https://gw.alipayobjects.com/zos/alicdn/5rWLU27so/Grid.svg --- 24 栅格系统。 diff --git a/components/icon/index.en-US.md b/components/icon/index.en-US.md index 734af8e442..bca584e65e 100644 --- a/components/icon/index.en-US.md +++ b/components/icon/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: General title: Icon toc: false +cover: https://gw.alipayobjects.com/zos/alicdn/rrwbSt3FQ/Icon.svg --- Semantic vector graphics. Before use icons, you need to install `@ant-design/icons` package: diff --git a/components/icon/index.zh-CN.md b/components/icon/index.zh-CN.md index cfa20a312b..91aefedffe 100644 --- a/components/icon/index.zh-CN.md +++ b/components/icon/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 图标 type: 通用 title: Icon toc: false +cover: https://gw.alipayobjects.com/zos/alicdn/rrwbSt3FQ/Icon.svg --- 语义化的矢量图形。使用图标组件,你需要安装 `@ant-design/icons` 图标组件包: diff --git a/components/input-number/index.en-US.md b/components/input-number/index.en-US.md index db5ced62ce..8c9af2fb4c 100644 --- a/components/input-number/index.en-US.md +++ b/components/input-number/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: InputNumber +cover: https://gw.alipayobjects.com/zos/alicdn/SPEln9WgK/InputNumber.svg --- Enter a number within certain range with the mouse or keyboard. diff --git a/components/input-number/index.zh-CN.md b/components/input-number/index.zh-CN.md index cf0a84c062..24878245ef 100644 --- a/components/input-number/index.zh-CN.md +++ b/components/input-number/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 数字输入框 type: 数据录入 title: InputNumber +cover: https://gw.alipayobjects.com/zos/alicdn/SPEln9WgK/InputNumber.svg --- 通过鼠标或键盘,输入范围内的数值。 diff --git a/components/input/index.en-US.md b/components/input/index.en-US.md index ed49e3be5f..7e8efae762 100644 --- a/components/input/index.en-US.md +++ b/components/input/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: Input +cover: https://gw.alipayobjects.com/zos/alicdn/By8Gcczjz/Input.svg --- A basic widget for getting the user input is a text field. Keyboard and mouse can be used for providing or changing data. diff --git a/components/input/index.zh-CN.md b/components/input/index.zh-CN.md index ca99da6830..7a87d2716f 100644 --- a/components/input/index.zh-CN.md +++ b/components/input/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 输入框 type: 数据录入 title: Input +cover: https://gw.alipayobjects.com/zos/alicdn/By8Gcczjz/Input.svg --- 通过鼠标或键盘输入内容,是最基础的表单域的包装。 diff --git a/components/layout/index.en-US.md b/components/layout/index.en-US.md index 4e385815ca..66bc3e86b9 100644 --- a/components/layout/index.en-US.md +++ b/components/layout/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Layout cols: 1 title: Layout +cover: https://gw.alipayobjects.com/zos/alicdn/hzEndUVEx/Layout.svg --- Handling the overall layout of a page. diff --git a/components/layout/index.zh-CN.md b/components/layout/index.zh-CN.md index 37a703de7c..97e67db917 100644 --- a/components/layout/index.zh-CN.md +++ b/components/layout/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 布局 type: 布局 cols: 1 title: Layout +cover: https://gw.alipayobjects.com/zos/alicdn/hzEndUVEx/Layout.svg --- 协助进行页面级整体布局。 diff --git a/components/list/index.en-US.md b/components/list/index.en-US.md index 02482d6442..c7db327210 100644 --- a/components/list/index.en-US.md +++ b/components/list/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Data Display title: List cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/5FrZKStG_/List.svg --- Simple List. diff --git a/components/list/index.zh-CN.md b/components/list/index.zh-CN.md index d29e7cabdd..22386ddbd5 100644 --- a/components/list/index.zh-CN.md +++ b/components/list/index.zh-CN.md @@ -4,6 +4,7 @@ type: 数据展示 title: List subtitle: 列表 cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/5FrZKStG_/List.svg --- 通用列表。 diff --git a/components/mentions/index.en-US.md b/components/mentions/index.en-US.md index 559c3582e7..6600b4bdef 100644 --- a/components/mentions/index.en-US.md +++ b/components/mentions/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: Mentions +cover: https://gw.alipayobjects.com/zos/alicdn/0pF5j477V/Mentions.svg --- Mention component. diff --git a/components/mentions/index.zh-CN.md b/components/mentions/index.zh-CN.md index cc477d3504..2347c6f421 100644 --- a/components/mentions/index.zh-CN.md +++ b/components/mentions/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 提及 type: 数据录入 title: Mentions +cover: https://gw.alipayobjects.com/zos/alicdn/0pF5j477V/Mentions.svg --- 提及组件。 diff --git a/components/menu/index.en-US.md b/components/menu/index.en-US.md index 11273ba771..e7e09a3c27 100644 --- a/components/menu/index.en-US.md +++ b/components/menu/index.en-US.md @@ -3,6 +3,7 @@ category: Components cols: 1 type: Navigation title: Menu +cover: https://gw.alipayobjects.com/zos/alicdn/3XZcjGpvK/Menu.svg --- A versatile menu for navigation. diff --git a/components/menu/index.zh-CN.md b/components/menu/index.zh-CN.md index 61a138b3bc..a5c031949a 100644 --- a/components/menu/index.zh-CN.md +++ b/components/menu/index.zh-CN.md @@ -4,6 +4,7 @@ cols: 1 type: 导航 title: Menu subtitle: 导航菜单 +cover: https://gw.alipayobjects.com/zos/alicdn/3XZcjGpvK/Menu.svg --- 为页面和功能提供导航的菜单列表。 diff --git a/components/message/index.en-US.md b/components/message/index.en-US.md index 3a683decc1..30d40ab292 100644 --- a/components/message/index.en-US.md +++ b/components/message/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Feedback noinstant: true title: Message +cover: https://gw.alipayobjects.com/zos/alicdn/DDde1IT6g/Message.svg --- Display global messages as feedback in response to user operations. diff --git a/components/message/index.zh-CN.md b/components/message/index.zh-CN.md index 1b357f9ebb..5b86bf5619 100644 --- a/components/message/index.zh-CN.md +++ b/components/message/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 全局提示 type: 反馈 noinstant: true title: Message +cover: https://gw.alipayobjects.com/zos/alicdn/DDde1IT6g/Message.svg --- 全局展示操作反馈信息。 diff --git a/components/modal/index.en-US.md b/components/modal/index.en-US.md index caf6db5d49..a2415b20ba 100644 --- a/components/modal/index.en-US.md +++ b/components/modal/index.en-US.md @@ -2,6 +2,7 @@ type: Feedback category: Components title: Modal +cover: https://gw.alipayobjects.com/zos/alicdn/3StSdUlSH/Modal.svg --- Modal dialogs. diff --git a/components/modal/index.zh-CN.md b/components/modal/index.zh-CN.md index b4e6cd5836..d9be673f91 100644 --- a/components/modal/index.zh-CN.md +++ b/components/modal/index.zh-CN.md @@ -3,6 +3,7 @@ type: 反馈 category: Components subtitle: 对话框 title: Modal +cover: https://gw.alipayobjects.com/zos/alicdn/3StSdUlSH/Modal.svg --- 模态对话框。 diff --git a/components/notification/index.en-US.md b/components/notification/index.en-US.md index 27518e5c3f..7f9716e99a 100644 --- a/components/notification/index.en-US.md +++ b/components/notification/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Feedback noinstant: true title: Notification +cover: https://gw.alipayobjects.com/zos/alicdn/KiuspIW60/Notification.svg --- Display a notification message globally. diff --git a/components/notification/index.zh-CN.md b/components/notification/index.zh-CN.md index 637441d039..ec4ae82798 100644 --- a/components/notification/index.zh-CN.md +++ b/components/notification/index.zh-CN.md @@ -4,6 +4,7 @@ type: 反馈 noinstant: true title: Notification subtitle: 通知提醒框 +cover: https://gw.alipayobjects.com/zos/alicdn/KiuspIW60/Notification.svg --- 全局展示通知提醒信息。 diff --git a/components/overview/index.en-US.md b/components/overview/index.en-US.md new file mode 100644 index 0000000000..70ee6ea39e --- /dev/null +++ b/components/overview/index.en-US.md @@ -0,0 +1,7 @@ +--- +category: Components +title: Components Overview +type: Overview +--- + +`antd` provides plenty of UI components to enrich your web applications, and we will improve components expirerence consistently. diff --git a/components/overview/index.zh-CN.md b/components/overview/index.zh-CN.md new file mode 100644 index 0000000000..a469e249e1 --- /dev/null +++ b/components/overview/index.zh-CN.md @@ -0,0 +1,7 @@ +--- +category: Components +title: 组件总览 +type: 组件总览 +--- + +`antd` 为 Web 应用提供了丰富的基础 UI 组件,我们还将持续探索企业级应用的最佳 UI 实践。 diff --git a/components/page-header/index.en-US.md b/components/page-header/index.en-US.md index 64dfcb506f..debd26b997 100644 --- a/components/page-header/index.en-US.md +++ b/components/page-header/index.en-US.md @@ -4,6 +4,7 @@ type: Navigation title: PageHeader cols: 1 subtitle: +cover: https://gw.alipayobjects.com/zos/alicdn/Uh-BJWMqm/PageHeader.svg --- A header with common actions and design elements built in. diff --git a/components/page-header/index.zh-CN.md b/components/page-header/index.zh-CN.md index d9f5eda710..3f922d3892 100644 --- a/components/page-header/index.zh-CN.md +++ b/components/page-header/index.zh-CN.md @@ -4,6 +4,7 @@ type: 导航 title: PageHeader cols: 1 subtitle: 页头 +cover: https://gw.alipayobjects.com/zos/alicdn/Uh-BJWMqm/PageHeader.svg --- 页头位于页容器中,页容器顶部,起到了内容概览和引导页级操作的作用。包括由面包屑、标题、页面内容简介、页面级操作等、页面级导航组成。 diff --git a/components/pagination/index.en-US.md b/components/pagination/index.en-US.md index d5f1842d9b..92b196cf97 100644 --- a/components/pagination/index.en-US.md +++ b/components/pagination/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Navigation title: Pagination cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/hRRde7p5u/Pagination.svg --- A long list can be divided into several pages using `Pagination`, and only one page will be loaded at a time. diff --git a/components/pagination/index.zh-CN.md b/components/pagination/index.zh-CN.md index fab23bf722..8a1b694f9e 100644 --- a/components/pagination/index.zh-CN.md +++ b/components/pagination/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 分页 type: 导航 title: Pagination cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/hRRde7p5u/Pagination.svg --- 采用分页的形式分隔长列表,每次只加载一个页面。 diff --git a/components/popconfirm/index.en-US.md b/components/popconfirm/index.en-US.md index 3e3c8477a4..8a3bea1790 100644 --- a/components/popconfirm/index.en-US.md +++ b/components/popconfirm/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Feedback title: Popconfirm +cover: https://gw.alipayobjects.com/zos/alicdn/8ln6VUFkX/Popconfirm.svg --- A simple and compact confirmation dialog of an action. diff --git a/components/popconfirm/index.zh-CN.md b/components/popconfirm/index.zh-CN.md index 1a1100dc4b..dd69144a31 100644 --- a/components/popconfirm/index.zh-CN.md +++ b/components/popconfirm/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 气泡确认框 type: 反馈 title: Popconfirm +cover: https://gw.alipayobjects.com/zos/alicdn/8ln6VUFkX/Popconfirm.svg --- 点击元素,弹出气泡式的确认框。 diff --git a/components/popover/index.en-US.md b/components/popover/index.en-US.md index fd0567d27e..85fe3bcf65 100644 --- a/components/popover/index.en-US.md +++ b/components/popover/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Display title: Popover +cover: https://gw.alipayobjects.com/zos/antfincdn/GkviFueLQwx/Popover.svg --- The floating card popped by clicking or hovering. diff --git a/components/popover/index.zh-CN.md b/components/popover/index.zh-CN.md index 83034091e7..8969207f58 100644 --- a/components/popover/index.zh-CN.md +++ b/components/popover/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 气泡卡片 type: 数据展示 title: Popover +cover: https://gw.alipayobjects.com/zos/antfincdn/GkviFueLQwx/Popover.svg --- 点击/鼠标移入元素,弹出气泡式的卡片浮层。 diff --git a/components/progress/index.en-US.md b/components/progress/index.en-US.md index 7405674ce9..0d909e2da2 100644 --- a/components/progress/index.en-US.md +++ b/components/progress/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Feedback title: Progress +cover: https://gw.alipayobjects.com/zos/antfincdn/%24X8q%26OILIY/Progress.svg --- Display the current progress of an operation flow. diff --git a/components/progress/index.zh-CN.md b/components/progress/index.zh-CN.md index 219ce14620..c76438d5ab 100644 --- a/components/progress/index.zh-CN.md +++ b/components/progress/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 进度条 type: 反馈 title: Progress +cover: https://gw.alipayobjects.com/zos/antfincdn/%24X8q%26OILIY/Progress.svg --- 展示操作的当前进度。 diff --git a/components/radio/index.en-US.md b/components/radio/index.en-US.md index 27e3a0510b..b0e32692d6 100644 --- a/components/radio/index.en-US.md +++ b/components/radio/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: Radio +cover: https://gw.alipayobjects.com/zos/alicdn/jhSTlg4WQ/Radio.svg --- Radio. diff --git a/components/radio/index.zh-CN.md b/components/radio/index.zh-CN.md index cd3d6131ac..17663e90df 100644 --- a/components/radio/index.zh-CN.md +++ b/components/radio/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 单选框 type: 数据录入 title: Radio +cover: https://gw.alipayobjects.com/zos/alicdn/jhSTlg4WQ/Radio.svg --- 单选框。 diff --git a/components/rate/index.en-US.md b/components/rate/index.en-US.md index 767e4c95d2..16884be858 100644 --- a/components/rate/index.en-US.md +++ b/components/rate/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: Rate +cover: https://gw.alipayobjects.com/zos/alicdn/V-ycROUpN/Rate.svg --- Rate component. diff --git a/components/rate/index.zh-CN.md b/components/rate/index.zh-CN.md index 91b095bd81..9930a3d5a4 100644 --- a/components/rate/index.zh-CN.md +++ b/components/rate/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 评分 type: 数据录入 title: Rate +cover: https://gw.alipayobjects.com/zos/alicdn/V-ycROUpN/Rate.svg --- 评分组件。 diff --git a/components/result/index.en-US.md b/components/result/index.en-US.md index c5f2a6f46b..3896289885 100644 --- a/components/result/index.en-US.md +++ b/components/result/index.en-US.md @@ -3,7 +3,7 @@ type: Feedback category: Components title: Result cols: 1 -subtitle: +cover: https://gw.alipayobjects.com/zos/alicdn/EuEXmy7nO/Result.svg --- Used to feed back the results of a series of operational tasks. diff --git a/components/result/index.zh-CN.md b/components/result/index.zh-CN.md index 430256908c..8f651961c2 100644 --- a/components/result/index.zh-CN.md +++ b/components/result/index.zh-CN.md @@ -4,6 +4,7 @@ category: Components title: Result cols: 1 subtitle: 结果 +cover: https://gw.alipayobjects.com/zos/alicdn/EuEXmy7nO/Result.svg --- 用于反馈一系列操作任务的处理结果。 diff --git a/components/select/index.en-US.md b/components/select/index.en-US.md index 543e74aa0d..4dc91460af 100644 --- a/components/select/index.en-US.md +++ b/components/select/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: Select +cover: https://gw.alipayobjects.com/zos/alicdn/oCqbyNvbA/Select.svg --- Select component to select value from options. diff --git a/components/select/index.zh-CN.md b/components/select/index.zh-CN.md index 5ba931e994..8a7015f3bb 100644 --- a/components/select/index.zh-CN.md +++ b/components/select/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 选择器 type: 数据录入 title: Select +cover: https://gw.alipayobjects.com/zos/alicdn/oCqbyNvbA/Select.svg --- 下拉选择器。 diff --git a/components/skeleton/index.en-US.md b/components/skeleton/index.en-US.md index 99089f101d..315f6ea695 100644 --- a/components/skeleton/index.en-US.md +++ b/components/skeleton/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Feedback title: Skeleton cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/KpcciCJgv/Skeleton.svg --- Provide a placeholder while you wait for content to load, or to visualise content that doesn't exist yet. diff --git a/components/skeleton/index.zh-CN.md b/components/skeleton/index.zh-CN.md index 24dab7cd54..6c0d1d79d2 100644 --- a/components/skeleton/index.zh-CN.md +++ b/components/skeleton/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 骨架屏 type: 反馈 title: Skeleton cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/KpcciCJgv/Skeleton.svg --- 在需要等待加载内容的位置提供一个占位图形组合。 diff --git a/components/slider/index.en-US.md b/components/slider/index.en-US.md index e1531c4353..87c1a6b4de 100644 --- a/components/slider/index.en-US.md +++ b/components/slider/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: Slider +cover: https://gw.alipayobjects.com/zos/alicdn/HZ3meFc6W/Silder.svg --- A Slider component for displaying current value and intervals in range. diff --git a/components/slider/index.zh-CN.md b/components/slider/index.zh-CN.md index e737f020e8..90783a7e5a 100644 --- a/components/slider/index.zh-CN.md +++ b/components/slider/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 滑动输入条 type: 数据录入 title: Slider +cover: https://gw.alipayobjects.com/zos/alicdn/HZ3meFc6W/Silder.svg --- 滑动型输入器,展示当前值和可选范围。 diff --git a/components/space/index.en-US.md b/components/space/index.en-US.md index 5a37bedffd..b47e72bcf8 100644 --- a/components/space/index.en-US.md +++ b/components/space/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Layout title: Space cols: 1 +cover: https://gw.alipayobjects.com/zos/antfincdn/wc6%263gJ0Y8/Space.svg --- Set components spacing. diff --git a/components/space/index.zh-CN.md b/components/space/index.zh-CN.md index b7b74a4681..adb6f66582 100644 --- a/components/space/index.zh-CN.md +++ b/components/space/index.zh-CN.md @@ -4,6 +4,7 @@ type: 布局 subtitle: 间距 title: Space cols: 1 +cover: https://gw.alipayobjects.com/zos/antfincdn/wc6%263gJ0Y8/Space.svg --- 设置组件之间的间距。 diff --git a/components/spin/index.en-US.md b/components/spin/index.en-US.md index 0fc83d632b..e5336f371a 100644 --- a/components/spin/index.en-US.md +++ b/components/spin/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Feedback title: Spin +cover: https://gw.alipayobjects.com/zos/alicdn/LBcJqCPRv/Spin.svg --- A spinner for displaying loading state of a page or a section. diff --git a/components/spin/index.zh-CN.md b/components/spin/index.zh-CN.md index dafd993f61..99b46c8536 100644 --- a/components/spin/index.zh-CN.md +++ b/components/spin/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components type: 反馈 title: Spin subtitle: 加载中 +cover: https://gw.alipayobjects.com/zos/alicdn/LBcJqCPRv/Spin.svg --- 用于页面和区块的加载中状态。 diff --git a/components/statistic/index.en-US.md b/components/statistic/index.en-US.md index f6e15de10c..ad9d38d1c2 100644 --- a/components/statistic/index.en-US.md +++ b/components/statistic/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Display title: Statistic +cover: https://gw.alipayobjects.com/zos/antfincdn/rcBNhLBrKbE/Statistic.svg --- Display statistic number. diff --git a/components/statistic/index.zh-CN.md b/components/statistic/index.zh-CN.md index 4b7acda744..e9c4a7d023 100644 --- a/components/statistic/index.zh-CN.md +++ b/components/statistic/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 统计数值 type: 数据展示 title: Statistic +cover: https://gw.alipayobjects.com/zos/antfincdn/rcBNhLBrKbE/Statistic.svg --- 展示统计数值。 diff --git a/components/steps/index.en-US.md b/components/steps/index.en-US.md index 47626297f6..ea26a1d543 100644 --- a/components/steps/index.en-US.md +++ b/components/steps/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Navigation cols: 1 title: Steps +cover: https://gw.alipayobjects.com/zos/antfincdn/UZYqMizXHaj/Steps.svg --- `Steps` is a navigation bar that guides users through the steps of a task. diff --git a/components/steps/index.zh-CN.md b/components/steps/index.zh-CN.md index f53b1ce714..daab5442b8 100644 --- a/components/steps/index.zh-CN.md +++ b/components/steps/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 步骤条 type: 导航 cols: 1 title: Steps +cover: https://gw.alipayobjects.com/zos/antfincdn/UZYqMizXHaj/Steps.svg --- 引导用户按照流程完成任务的导航条。 diff --git a/components/switch/index.en-US.md b/components/switch/index.en-US.md index 5e6012b8ea..5f9caf9e49 100644 --- a/components/switch/index.en-US.md +++ b/components/switch/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: Switch +cover: https://gw.alipayobjects.com/zos/alicdn/zNdJQMhfm/Switch.svg --- Switching Selector. diff --git a/components/switch/index.zh-CN.md b/components/switch/index.zh-CN.md index d5902b3bf1..4f8423111d 100644 --- a/components/switch/index.zh-CN.md +++ b/components/switch/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 开关 type: 数据录入 title: Switch +cover: https://gw.alipayobjects.com/zos/alicdn/zNdJQMhfm/Switch.svg --- 开关选择器。 diff --git a/components/table/index.en-US.md b/components/table/index.en-US.md index ed484a619a..bcf12f4a4c 100644 --- a/components/table/index.en-US.md +++ b/components/table/index.en-US.md @@ -3,6 +3,7 @@ category: Components cols: 1 type: Data Display title: Table +cover: https://gw.alipayobjects.com/zos/alicdn/f-SbcX2Lx/Table.svg --- A table displays rows of data. diff --git a/components/table/index.zh-CN.md b/components/table/index.zh-CN.md index 56da9a064a..79b51ff97b 100644 --- a/components/table/index.zh-CN.md +++ b/components/table/index.zh-CN.md @@ -4,6 +4,7 @@ cols: 1 type: 数据展示 title: Table subtitle: 表格 +cover: https://gw.alipayobjects.com/zos/alicdn/f-SbcX2Lx/Table.svg --- 展示行列数据。 diff --git a/components/tabs/index.en-US.md b/components/tabs/index.en-US.md index c89d323ef7..132a43e798 100644 --- a/components/tabs/index.en-US.md +++ b/components/tabs/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Data Display title: Tabs cols: 1 +cover: https://gw.alipayobjects.com/zos/antfincdn/lkI2hNEDr2V/Tabs.svg --- Tabs make it easy to switch between different views. diff --git a/components/tabs/index.zh-CN.md b/components/tabs/index.zh-CN.md index 6d30026c46..045a2aa74c 100644 --- a/components/tabs/index.zh-CN.md +++ b/components/tabs/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 标签页 type: 数据展示 title: Tabs cols: 1 +cover: https://gw.alipayobjects.com/zos/antfincdn/lkI2hNEDr2V/Tabs.svg --- 选项卡切换组件。 diff --git a/components/tag/index.en-US.md b/components/tag/index.en-US.md index d3d2475f47..9c75da19fc 100644 --- a/components/tag/index.en-US.md +++ b/components/tag/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Display title: Tag +cover: https://gw.alipayobjects.com/zos/antfincdn/RkyisJo2r%267/Tag.svg --- Tag for categorizing or markup. diff --git a/components/tag/index.zh-CN.md b/components/tag/index.zh-CN.md index d3f27bfa11..42d29510dd 100644 --- a/components/tag/index.zh-CN.md +++ b/components/tag/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 标签 type: 数据展示 title: Tag +cover: https://gw.alipayobjects.com/zos/antfincdn/RkyisJo2r%267/Tag.svg --- 进行标记和分类的小标签。 diff --git a/components/time-picker/index.en-US.md b/components/time-picker/index.en-US.md index fe38cc5995..2bcca99ded 100644 --- a/components/time-picker/index.en-US.md +++ b/components/time-picker/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: TimePicker +cover: https://gw.alipayobjects.com/zos/alicdn/5YIZctT1O/TimePicker.svg --- To select/input a time. diff --git a/components/time-picker/index.zh-CN.md b/components/time-picker/index.zh-CN.md index dffe7d67b6..be63f4f508 100644 --- a/components/time-picker/index.zh-CN.md +++ b/components/time-picker/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 时间选择框 type: 数据录入 title: TimePicker +cover: https://gw.alipayobjects.com/zos/alicdn/5YIZctT1O/TimePicker.svg --- 输入或选择时间的控件。 diff --git a/components/timeline/index.en-US.md b/components/timeline/index.en-US.md index d5d83e7b36..44d2f36faf 100644 --- a/components/timeline/index.en-US.md +++ b/components/timeline/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Display title: Timeline +cover: https://gw.alipayobjects.com/zos/antfincdn/vJmo00mmgR/Timeline.svg --- Vertical display timeline. diff --git a/components/timeline/index.zh-CN.md b/components/timeline/index.zh-CN.md index ffa44576e3..33ceb8c957 100644 --- a/components/timeline/index.zh-CN.md +++ b/components/timeline/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 时间轴 type: 数据展示 title: Timeline +cover: https://gw.alipayobjects.com/zos/antfincdn/vJmo00mmgR/Timeline.svg --- 垂直展示的时间流信息。 diff --git a/components/tooltip/index.en-US.md b/components/tooltip/index.en-US.md index be778664e3..2d3b9c7ed9 100644 --- a/components/tooltip/index.en-US.md +++ b/components/tooltip/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Display title: Tooltip +cover: https://gw.alipayobjects.com/zos/antfincdn/UYRSM99JXl/Tooltip.svg --- A simple text popup tip. diff --git a/components/tooltip/index.zh-CN.md b/components/tooltip/index.zh-CN.md index f4bcd94381..e87f4b8c8d 100644 --- a/components/tooltip/index.zh-CN.md +++ b/components/tooltip/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 文字提示 type: 数据展示 title: Tooltip +cover: https://gw.alipayobjects.com/zos/antfincdn/UYRSM99JXl/Tooltip.svg --- 简单的文字提示气泡框。 diff --git a/components/transfer/index.en-US.md b/components/transfer/index.en-US.md index fea739a6fa..1133f5e1d3 100644 --- a/components/transfer/index.en-US.md +++ b/components/transfer/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: Data Entry cols: 1 title: Transfer +cover: https://gw.alipayobjects.com/zos/antfincdn/7w84d56hrUo/Transfer.svg --- Double column transfer choice box. diff --git a/components/transfer/index.zh-CN.md b/components/transfer/index.zh-CN.md index f0fd78b349..0127d4617f 100644 --- a/components/transfer/index.zh-CN.md +++ b/components/transfer/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 穿梭框 type: 数据录入 cols: 1 title: Transfer +cover: https://gw.alipayobjects.com/zos/antfincdn/7w84d56hrUo/Transfer.svg --- 双栏穿梭选择框。 diff --git a/components/tree-select/index.en-US.md b/components/tree-select/index.en-US.md index a636869fc2..ee5f3628a3 100644 --- a/components/tree-select/index.en-US.md +++ b/components/tree-select/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: TreeSelect +cover: https://gw.alipayobjects.com/zos/antfincdn/ENgTVNIP1Hu/TreeSelect.svg --- Tree selection control. diff --git a/components/tree-select/index.zh-CN.md b/components/tree-select/index.zh-CN.md index 7093b8d72e..799e86ea7c 100644 --- a/components/tree-select/index.zh-CN.md +++ b/components/tree-select/index.zh-CN.md @@ -3,6 +3,8 @@ category: Components subtitle: 树选择 type: 数据录入 title: TreeSelect +cover: https://gw.alipayobjects.com/zos/antfincdn/ENgTVNIP1Hu/TreeSelect.svg + --- 树型选择控件。 diff --git a/components/tree/index.en-US.md b/components/tree/index.en-US.md index 4d829d492b..796a442c08 100644 --- a/components/tree/index.en-US.md +++ b/components/tree/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Display title: Tree +cover: https://gw.alipayobjects.com/zos/antfincdn/xCsdUJjs3GO/Tree.svg --- A hierarchical list structure component. diff --git a/components/tree/index.zh-CN.md b/components/tree/index.zh-CN.md index 064e61288d..db0244abd1 100644 --- a/components/tree/index.zh-CN.md +++ b/components/tree/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components type: 数据展示 title: Tree subtitle: 树形控件 +cover: https://gw.alipayobjects.com/zos/antfincdn/xCsdUJjs3GO/Tree.svg --- 多层次的结构列表。 diff --git a/components/typography/index.en-US.md b/components/typography/index.en-US.md index 9420b32a99..44a0b4832b 100644 --- a/components/typography/index.en-US.md +++ b/components/typography/index.en-US.md @@ -3,6 +3,7 @@ category: Components type: General title: Typography cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/GOM1KQ24O/Typography.svg --- Basic text writing, including headings, body text, lists, and more. diff --git a/components/typography/index.zh-CN.md b/components/typography/index.zh-CN.md index 1678581f06..f08192dc63 100644 --- a/components/typography/index.zh-CN.md +++ b/components/typography/index.zh-CN.md @@ -4,6 +4,7 @@ subtitle: 排版 type: 通用 title: Typography cols: 1 +cover: https://gw.alipayobjects.com/zos/alicdn/GOM1KQ24O/Typography.svg --- 文本的基本格式。 diff --git a/components/upload/index.en-US.md b/components/upload/index.en-US.md index 474540c2a0..8dafe18e2c 100644 --- a/components/upload/index.en-US.md +++ b/components/upload/index.en-US.md @@ -2,6 +2,7 @@ category: Components type: Data Entry title: Upload +cover: https://gw.alipayobjects.com/zos/alicdn/KIp6oKUun/Upload.svg --- Upload file by selecting or dragging. diff --git a/components/upload/index.zh-CN.md b/components/upload/index.zh-CN.md index ca606270e3..c4ba2c3bcb 100644 --- a/components/upload/index.zh-CN.md +++ b/components/upload/index.zh-CN.md @@ -3,6 +3,7 @@ category: Components subtitle: 上传 type: 数据录入 title: Upload +cover: https://gw.alipayobjects.com/zos/alicdn/KIp6oKUun/Upload.svg --- 文件选择上传和拖拽上传控件。 diff --git a/docs/react/introduce.en-US.md b/docs/react/introduce.en-US.md index 1f2b2f48bd..d2f8c09f73 100644 --- a/docs/react/introduce.en-US.md +++ b/docs/react/introduce.en-US.md @@ -107,7 +107,7 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' ## Links - [Home page](/) -- [Components](/components/button/) +- [Components](/components/overview) - [Ant Design Pro](https://pro.ant.design/) - [Ant Design Charts](https://charts.ant.design) - [Change Log](/changelog) diff --git a/docs/react/introduce.zh-CN.md b/docs/react/introduce.zh-CN.md index 7e145197c3..1d64ced7d2 100644 --- a/docs/react/introduce.zh-CN.md +++ b/docs/react/introduce.zh-CN.md @@ -107,7 +107,7 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' ## 链接 - [首页](/) -- [组件库](/components/button) +- [组件库](/components/overview-cn) - [Ant Design Pro](https://pro.ant.design/) - [Ant Design Charts](https://charts.ant.design) - [更新日志](/changelog) diff --git a/site/bisheng.config.js b/site/bisheng.config.js index d19fd8a7ab..2d473b2d76 100644 --- a/site/bisheng.config.js +++ b/site/bisheng.config.js @@ -3,6 +3,7 @@ const replaceLib = require('@ant-design/tools/lib/replaceLib'); const getWebpackConfig = require('@ant-design/tools/lib/getWebpackConfig'); const EsbuildPlugin = require('esbuild-webpack-plugin').default; const { version } = require('../package.json'); +const themeConfig = require('./themeConfig'); const { webpack } = getWebpackConfig; @@ -38,55 +39,7 @@ module.exports = { }, theme: './site/theme', htmlTemplate: './site/theme/static/template.html', - themeConfig: { - categoryOrder: { - 'Ant Design': 0, - 全局样式: 1, - 'Global Styles': 1, - 设计模式: 2, - 'Design Patterns': 2, - '设计模式 - 探索': 3, - 'Design Patterns (Research)': 3, - Components: 100, - 组件: 100, - }, - typeOrder: { - // Component - General: 0, - Layout: 1, - Navigation: 2, - 'Data Entry': 3, - 'Data Display': 4, - Feedback: 5, - Other: 6, - Deprecated: 7, - 通用: 0, - 布局: 1, - 导航: 2, - 数据录入: 3, - 数据展示: 4, - 反馈: 5, - 其他: 6, - 废弃: 7, - - // Design - 原则: 1, - Principles: 1, - 全局规则: 2, - 'Global Rules': 2, - 模板文档: 3, - 'Template Document': 3, - }, - docVersions: { - '3.x': 'http://3x.ant.design', - '2.x': 'http://2x.ant.design', - '1.x': 'http://1x.ant.design', - '0.12.x': 'http://012x.ant.design', - '0.11.x': 'http://011x.ant.design', - '0.10.x': 'http://010x.ant.design', - '0.9.x': 'http://09x.ant.design', - }, - }, + themeConfig, filePathMapper(filePath) { if (filePath === '/index.html') { return ['/index.html', '/index-cn.html']; diff --git a/site/theme/template/Content/ComponentOverview.jsx b/site/theme/template/Content/ComponentOverview.jsx new file mode 100644 index 0000000000..6ed7c12508 --- /dev/null +++ b/site/theme/template/Content/ComponentOverview.jsx @@ -0,0 +1,84 @@ +import React from 'react'; +import { Helmet } from 'react-helmet-async'; +import { Link } from 'bisheng/router'; +import { useIntl } from 'react-intl'; +import { Divider, Row, Col, Card, Typography, Tag, Space } from 'antd'; +import { getChildren } from 'jsonml.js/lib/utils'; +import { getMetaDescription, getLocalizedPathname, getThemeConfig, getMenuItems } from '../utils'; +import './ComponentOverview.less'; + +const { Title } = Typography; +const ComponentOverview = ({ + componentsData = [], + doc: { + meta: { title }, + content, + }, + utils: { toReactComponent }, +}) => { + const { locale } = useIntl(); + const documentTitle = `${title} - Ant Design`; + const contentChild = getMetaDescription(getChildren(content)); + const themeConfig = getThemeConfig(); + const menuItems = getMenuItems( + componentsData, + locale, + themeConfig.categoryOrder, + themeConfig.typeOrder, + ); + + return ( +
+ + {documentTitle} + + {contentChild && } + +

{title}

+ {toReactComponent(['section', { className: 'markdown' }].concat(getChildren(content)))} + + {menuItems + .filter(i => i.order > -1) + .map(group => ( +
+ + <Space align="center"> + {group.title} + <Tag style={{ display: 'block' }}>{group.children.length}</Tag> + </Space> + + + {group.children + .sort((a, b) => a.title.charCodeAt(0) - b.title.charCodeAt(0)) + .map(component => { + const url = `${component.filename + .replace(/(\/index)?((\.zh-cn)|(\.en-us))?\.md$/i, '') + .toLowerCase()}/`; + return ( + + + + {component.title} {component.subtitle} +
+ } + > +
+ {component.title} +
+ + + + ); + })} + + + ))} +
+ ); +}; + +export default ComponentOverview; diff --git a/site/theme/template/Content/ComponentOverview.less b/site/theme/template/Content/ComponentOverview.less new file mode 100644 index 0000000000..6171182cd6 --- /dev/null +++ b/site/theme/template/Content/ComponentOverview.less @@ -0,0 +1,28 @@ +@import '../../../../components/style/themes/default.less'; + +.components-overview { + padding: 0; + + &-group-title { + margin-bottom: 24px !important; + } + + &-title { + overflow: hidden; + color: @text-color; + text-overflow: ellipsis; + } + &-img { + display: flex; + align-items: center; + justify-content: center; + height: 152px; + } + &-card { + cursor: pointer; + transition: all @animation-duration-base @ease-in-out; + &:hover { + box-shadow: @shadow-1-down; + } + } +} diff --git a/site/theme/template/Content/MainContent.jsx b/site/theme/template/Content/MainContent.jsx index 023ac4f69b..dd38131d71 100644 --- a/site/theme/template/Content/MainContent.jsx +++ b/site/theme/template/Content/MainContent.jsx @@ -14,6 +14,7 @@ import PrevAndNext from './PrevAndNext'; import Footer from '../Layout/Footer'; import SiteContext from '../Layout/SiteContext'; import ComponentDoc from './ComponentDoc'; +import ComponentOverview from './ComponentOverview'; import * as utils from '../utils'; const { SubMenu } = Menu; @@ -126,6 +127,9 @@ class MainContent extends Component { themeConfig.typeOrder, ); return menuItems.map(menuItem => { + if (menuItem.title === 'Overview' || menuItem.title === '组件总览') { + return menuItem.children.map(leaf => this.generateMenuItem(false, leaf, footerNavIcons)); + } if (menuItem.type === 'type') { return ( @@ -314,109 +318,131 @@ class MainContent extends Component { } }; - render() { + renderContributors() { + const { + localizedPageData: { meta }, + intl: { formatMessage }, + } = this.props; return ( - - {({ isMobile, theme, setIframeTheme }) => { - const { openKeys } = this.state; - const { - localizedPageData, - demos, - intl: { formatMessage }, - } = this.props; - const { meta } = localizedPageData; - const activeMenuItem = this.getActiveMenuItem(); - const menuItems = this.getMenuItems(); - const menuItemsForFooterNav = this.getMenuItems({ - before: , - after: , - }); - const { prev, next } = this.getFooterNav(menuItemsForFooterNav, activeMenuItem); - const mainContainerClass = classNames('main-container', { - 'main-container-component': !!demos, - }); - const menuChild = ( - + loading ? ( + + ) : ( + - {menuItems} - - ); - const componentPage = /^\/?components/.test(this.props.location.pathname); - return ( -
- - {isMobile ? ( - - {menuChild} - - ) : ( - - -
{menuChild}
-
- - )} - -
- {demos ? ( - - ) : ( -
- )} - - loading ? ( - - ) : ( - - - {item.username} - - - ) - } - repo="ant-design" - owner="ant-design" - /> -
- {componentPage && ( -
- - } /> - -
- )} - -
- - -
- ); - }} -
+ + {item.username} + + + ) + } + repo="ant-design" + owner="ant-design" + /> + ); + } + + renderMainContent({ theme, setIframeTheme }) { + const { localizedPageData, demos, location } = this.props; + if (location.pathname.includes('components/overview')) { + return ( + meta.category === 'Components', + )} + /> + ); + } + if (demos) { + return ( + <> + + {this.renderContributors()} + + ); + } + return ( + <> +
+ {this.renderContributors()} + + ); + } + + render() { + const { demos, location } = this.props; + const { openKeys } = this.state; + const { isMobile, theme, setIframeTheme } = this.context; + const activeMenuItem = this.getActiveMenuItem(); + const menuItems = this.getMenuItems(); + const menuItemsForFooterNav = this.getMenuItems({ + before: , + after: , + }); + const { prev, next } = this.getFooterNav(menuItemsForFooterNav, activeMenuItem); + const mainContainerClass = classNames('main-container', { + 'main-container-component': !!demos, + }); + const menuChild = ( + + {menuItems} + + ); + const componentPage = /^\/?components/.test(location.pathname); + return ( +
+ + {isMobile ? ( + + {menuChild} + + ) : ( + + +
{menuChild}
+
+ + )} + +
+ {this.renderMainContent({ theme, setIframeTheme })} +
+ {componentPage && ( +
+ + } /> + +
+ )} + +
+ + +
); } } diff --git a/site/theme/template/Layout/Header/Navigation.tsx b/site/theme/template/Layout/Header/Navigation.tsx index c79bbe40ce..7cc3c0d163 100644 --- a/site/theme/template/Layout/Header/Navigation.tsx +++ b/site/theme/template/Layout/Header/Navigation.tsx @@ -91,7 +91,7 @@ export default ({ - + diff --git a/site/theme/template/Layout/index.jsx b/site/theme/template/Layout/index.jsx index 9f04d3c687..7e32e5dd0f 100644 --- a/site/theme/template/Layout/index.jsx +++ b/site/theme/template/Layout/index.jsx @@ -88,8 +88,6 @@ export default class Layout extends React.Component { direction: 'ltr', setIframeTheme: this.setIframeTheme, }; - - this.changeDirection = this.changeDirection.bind(this); } componentDidMount() { @@ -178,11 +176,11 @@ export default class Layout extends React.Component { setTwoToneColor(iconTwoToneThemeMap[theme] || iconTwoToneThemeMap.default); }; - changeDirection(direction) { + changeDirection = direction => { this.setState({ direction, }); - } + }; render() { const { children, helmetContext = {}, ...restProps } = this.props; diff --git a/site/theme/template/utils.tsx b/site/theme/template/utils.tsx index 8bcdee1cf8..9ff0aeccdc 100644 --- a/site/theme/template/utils.tsx +++ b/site/theme/template/utils.tsx @@ -1,5 +1,6 @@ import flattenDeep from 'lodash/flattenDeep'; import flatten from 'lodash/flatten'; +import themeConfig from '../../themeConfig'; interface Meta { skip?: boolean; @@ -213,3 +214,7 @@ export function getMetaDescription(jml?: any[] | null) { ).find(p => p && typeof p === 'string' && !COMMON_TAGS.includes(p)); return paragraph; } + +export const getThemeConfig = () => { + return themeConfig; +}; diff --git a/site/themeConfig.d.ts b/site/themeConfig.d.ts new file mode 100644 index 0000000000..e505702e96 --- /dev/null +++ b/site/themeConfig.d.ts @@ -0,0 +1,11 @@ +interface ThemeConfig { + categoryOrder: { + [key: string]: number; + }; + typeOrder: { + [key: string]: number; + }; +} + +const themeConfig: ThemeConfig; +export default themeConfig; diff --git a/site/themeConfig.js b/site/themeConfig.js new file mode 100644 index 0000000000..0d97298879 --- /dev/null +++ b/site/themeConfig.js @@ -0,0 +1,52 @@ +module.exports = { + categoryOrder: { + 'Ant Design': 0, + 全局样式: 1, + 'Global Styles': 1, + 设计模式: 2, + 'Design Patterns': 2, + '设计模式 - 探索': 3, + 'Design Patterns (Research)': 3, + Components: 100, + 组件: 100, + }, + typeOrder: { + // Component + Overview: -1, + General: 0, + Layout: 1, + Navigation: 2, + 'Data Entry': 3, + 'Data Display': 4, + Feedback: 5, + Other: 6, + Deprecated: 7, + + 组件总览: -1, + 通用: 0, + 布局: 1, + 导航: 2, + 数据录入: 3, + 数据展示: 4, + 反馈: 5, + 其他: 6, + 废弃: 7, + + // Design + 原则: 1, + Principles: 1, + 全局规则: 2, + 'Global Rules': 2, + 模板文档: 3, + 'Template Document': 3, + }, + docVersions: { + '3.x': 'http://3x.ant.design', + '2.x': 'http://2x.ant.design', + '1.x': 'http://1x.ant.design', + '0.12.x': 'http://012x.ant.design', + '0.11.x': 'http://011x.ant.design', + '0.10.x': 'http://010x.ant.design', + '0.9.x': 'http://09x.ant.design', + }, +};