From cbcfd38ca78ec54b15033ee878749324106aaacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Wed, 9 Nov 2022 12:28:04 +0800 Subject: [PATCH] docs: v5 site upgrade (#38328) * build: try to use dumi as doc tool * docs: migrate demo structure to dumi way * refactor: use type export & import * docs: migrate demo previewer to dumi * docs: create empty layout & components * docs: apply custom rehype plugin * docs: create empty extra pages * docs: Add Banner component * chore: move theme tsconfig.json * docs: home page init * docs: migrate header (#37896) * docs: header * docs: update * docs: home init * clean up * test: fix site lint * chore: tsc ignore demo * chore: dumi demo migrate script * chore: cards * docs: home layout * docs: Update locale logic * docs: fix getLink logic * chore: fix ci (#37899) * chore: fix ci * ci: remove check-ts-demo * ci: preview build * test: ignore demo.tsx * chore: update script * test: update snapshot * test: update node and image test * chore: add .surgeignore * docs: layout providers (#37908) * docs: add components sidebar (#37923) * docs: sidebar * docs: update docs title * docs: update design doc * chore: code clean * docs: handle changelog page * docs: add title * docs: add subtitle * docs: active header nav * chore: code clean * docs: overview * chore: code clean * docs: update intl (#37918) * docs: update intl * chore: code clean * docs: update favicons * chore: update testPathIgnorePatterns * chore: code clean * chore: code clean * chore: copy 404.html (#37996) * docs: Home page theme picker * chore: Update migrate script * docs: home page update * docs: theme editor style * docs: theme lang * chore: update migrate.js * docs: fix demo (#38094) * chore: update migrate.js * docs: update md * docs: update demo * test: fix snapshot * chore: move debug to code attr in migrate script * chore: update md Co-authored-by: PeachScript * feat: overview page * feat: Migrate `404` page (#38118) * feat: migrate IconSearch component (#37916) * feat: copy IconDisplay from site to .dumi * feat: change docs of icon * feat: tweak * feat: use useIntl instead of injectIntl * feat: fix ts type error * feat: use intl.formatMessage to render text * docs: Adjust home btn sizw * docs: Update doc * feat: v5 site overview page (#38131) * feat: site * fix: fix * feat: v5 site overview page * fix: fix path * fix: fix * fix: fix * docs: fix margin logic * feat: v5 site change-log page (#38137) * feat: v5 site change-log page (#38162) * docs: site redirect to home pag * docs: theme picker * docs: use react-intl from dumi (#38183) * docs: Theme Picker * docs: update dumi config * docs: home back fix * docs: picker colorful * docs: locale of it * docs: update components desc * docs: site of links * docs: update components list * docs: update desc * feat: Migrate `DemoWrapper` component (#38166) * feat: Migrate `DemoWrapper` component * feat: remove invalid comments and add comment for `key` prop * docs: FloatButton pure panel * chore: update demo * chore: update dumi config * Revert "chore: update demo" This reverts commit 028265d3ba5987df5f13c3e9d42cf76cb1812b2e. * chore: test logic adjust to support cnpm modules * chore: add locale alias * docs: /index to / * docs: add locale redirect head script * chore: adjust compact * docs: fix missing token * feat: compact switch * chore: code clean * docs: update home * docs: fix radius token * docs: hash of it * chore: adjust home page * docs: Add background map * docs: site theme bac logic * docs: avatar * docs: update logo color * docs: home banner * docs: adjust tour size * docs: purepanl update * docs: transfooter * docs: update banner gif * docs: content (#38361) * docs: title & EditButton * docs: content * chore: fix toc * docs: resource page * docs: transform resource data from hast * docs: filename & Resource Card * chore: enable prerender * chore: remove less * docs: toc style * chore: fix lint * docs: fix Layout page * docs: fix CP page * chore: update demos * docs: workaround for export dynamic html * chore: enable demo eslint * docs: table style * fix: header shadow * chore: update snapshot * fix: toc style * docs: add title * docs: Adjust site * feat: helmet * docs: site css * fix: description * feat: toc debug * docs: update config-provider * feat: use colorPanel * fix: colorPanel value * feat: anchor ink ball style * feat: apply theme editor * fix: code block style * chore: update demo * chore: fix lint * chore: code clean * chore: update snapshot * feat: ts2js * chore: description * docs: site ready for ssr includes: - move client render logic to useEffect in site theme - extract antd cssinjs to a single css file like bisheng - workaround to support react@18 pipeableStream for emotion * chore: bump testing lib * docs: font size of title * chore: remove react-sortable-hoc * chore: update snapshot * chore: update script Co-authored-by: PeachScript Co-authored-by: MadCcc <1075746765@qq.com> Co-authored-by: zqran Co-authored-by: TrickyPi <530257315@qq.com> Co-authored-by: lijianan <574980606@qq.com> --- .dumi/hooks/useLocale.tsx | 15 + .dumi/hooks/useLocation.ts | 47 + .dumi/hooks/useMenu.tsx | 138 ++ .dumi/hooks/useSiteToken.ts | 35 + .../NotFound.tsx => .dumi/pages/404/index.tsx | 30 +- .dumi/pages/index-cn/index.tsx | 1 + .dumi/pages/index/components/Banner.tsx | 135 ++ .../index/components/BannerRecommends.tsx | 73 + .../pages/index/components/ComponentsList.tsx | 225 +++ .../index/components/DesignFramework.tsx | 162 ++ .dumi/pages/index/components/Group.tsx | 108 + .../pages/index/components/RecommendsOld.tsx | 104 + .../components/Theme/BackgroundImage.tsx | 54 + .../index/components/Theme/ColorPicker.tsx | 127 ++ .../index/components/Theme/RadiusPicker.tsx | 31 + .../index/components/Theme/ThemePicker.tsx | 96 + .../pages/index/components/Theme/colorUtil.ts | 78 + .dumi/pages/index/components/Theme/index.tsx | 521 +++++ .../pages/index/components}/util.tsx | 0 .dumi/pages/index/index.tsx | 94 + .dumi/pages/theme-editor-cn/index.tsx | 1 + .dumi/pages/theme-editor/index.tsx | 36 + .dumi/rehypeAntd.ts | 60 + .dumi/theme/antd.js | 4 + .dumi/theme/builtins/APITable/index.tsx | 8 + .../ComponentOverview/ProComponentsList.ts | 54 + .../builtins/ComponentOverview/index.tsx | 196 ++ .dumi/theme/builtins/DemoWrapper/index.tsx | 67 + .../theme/builtins/IconSearch}/Category.tsx | 10 +- .../builtins/IconSearch}/CopyableIcon.tsx | 0 .../builtins/IconSearch}/IconPicSearcher.tsx | 38 +- .../theme/builtins/IconSearch}/fields.ts | 2 - .../theme/builtins/IconSearch}/index.tsx | 35 +- .../theme/builtins/IconSearch}/themeIcons.tsx | 21 +- .../builtins/Previewer/fromDumiProps.tsx | 101 + .../theme/builtins/Previewer}/index.jsx | 22 +- .../builtins/ResourceArticles}/index.tsx | 116 +- .dumi/theme/builtins/ResourceCards/index.tsx | 118 ++ .dumi/theme/common/BrowserFrame.jsx | 5 + .../theme/common}/CodePenIcon.jsx | 0 .../theme/common}/CodePreview.jsx | 0 .../theme/common}/CodeSandboxIcon.jsx | 0 .dumi/theme/common/CommonHelmet.tsx | 23 + .dumi/theme/common/EditButton.tsx | 56 + .dumi/theme/common/GlobalStyles.tsx | 1795 +++++++++++++++++ .../theme/common}/Helmet.tsx | 0 .dumi/theme/common/PrevAndNext.tsx | 142 ++ .../theme/common}/RiddleIcon.jsx | 0 .dumi/theme/layouts/DocLayout/index.tsx | 151 ++ .dumi/theme/layouts/GlobalLayout.tsx | 63 + .../layouts/ResourceLayout}/AffixTabs.tsx | 65 +- .dumi/theme/layouts/ResourceLayout/index.tsx | 139 ++ .dumi/theme/layouts/SidebarLayout/index.tsx | 16 + .dumi/theme/locales/en-US.json | 138 ++ .dumi/theme/locales/zh-CN.json | 137 ++ .dumi/theme/plugin.ts | 116 ++ .dumi/theme/slots/Content/index.tsx | 218 ++ .dumi/theme/slots/DemoContext.tsx | 14 + .../theme/slots/Footer/index.tsx | 130 +- .dumi/theme/slots/Header/Github.tsx | 77 + .dumi/theme/slots/Header/Logo.tsx | 74 + .../theme/slots}/Header/More.tsx | 37 +- .../theme/slots}/Header/Navigation.tsx | 107 +- .../theme/slots}/Header/SearchBar.tsx | 163 +- .../theme/slots}/Header/algolia-config.ts | 0 .dumi/theme/slots/Header/index.tsx | 387 ++++ .../theme/slots}/Header/interface.tsx | 1 + .dumi/theme/slots/Sidebar/index.tsx | 157 ++ .../theme/slots}/SiteContext.tsx | 3 - .dumi/theme/slots/ThemeContext.tsx | 11 + {site => .dumi}/theme/static/style.js | 2 +- .../theme/themeConfig.ts | 3 +- .../theme/template => .dumi/theme}/utils.tsx | 10 +- .dumi/tsconfig.json | 15 + .dumirc.ts | 98 + .eslintignore | 16 +- .eslintrc.js | 12 + .github/workflows/test.yml | 22 - .gitignore | 3 + .jest.js | 25 +- .prettierignore | 4 +- .prettierrc | 6 + .surgeignore | 1 + components/__tests__/node.test.tsx | 2 +- .../__snapshots__/demo-extend.test.ts.snap | 8 +- .../__tests__/__snapshots__/demo.test.ts.snap | 8 +- components/affix/demo/basic.md | 35 - components/affix/demo/basic.tsx | 25 + components/affix/demo/debug.md | 33 - components/affix/demo/debug.tsx | 22 + components/affix/demo/on-change.md | 20 - components/affix/demo/on-change.tsx | 10 + components/affix/demo/target.md | 28 - components/affix/demo/target.tsx | 18 + components/affix/index.en-US.md | 13 +- components/affix/index.zh-CN.md | 13 +- .../__snapshots__/demo-extend.test.ts.snap | 75 +- .../__tests__/__snapshots__/demo.test.ts.snap | 75 +- .../alert/__tests__/demo-extend.test.ts | 2 +- components/alert/__tests__/demo.test.ts | 2 +- components/alert/demo/action.md | 69 - components/alert/demo/action.tsx | 59 + components/alert/demo/banner.md | 31 - components/alert/demo/banner.tsx | 20 + components/alert/demo/basic.md | 16 - components/alert/demo/basic.tsx | 6 + components/alert/demo/closable.md | 36 - components/alert/demo/closable.tsx | 26 + components/alert/demo/close-text.md | 16 - components/alert/demo/close-text.tsx | 6 + components/alert/demo/custom-icon.md | 56 - components/alert/demo/custom-icon.tsx | 45 + components/alert/demo/description.md | 39 - components/alert/demo/description.tsx | 29 + components/alert/demo/error-boundary.md | 37 - components/alert/demo/error-boundary.tsx | 27 + components/alert/demo/icon.md | 48 - components/alert/demo/icon.tsx | 38 + components/alert/demo/loop-banner.md | 26 - components/alert/demo/loop-banner.tsx | 16 + components/alert/demo/smooth-closed.md | 31 - components/alert/demo/smooth-closed.tsx | 21 + components/alert/demo/style.md | 23 - components/alert/demo/style.tsx | 13 + components/alert/index.en-US.md | 49 +- components/alert/index.zh-CN.md | 57 +- .../__snapshots__/demo-extend.test.ts.snap | 12 +- .../__tests__/__snapshots__/demo.test.ts.snap | 12 +- components/anchor/demo/basic.md | 27 - components/anchor/demo/basic.tsx | 17 + components/anchor/demo/customizeHighlight.md | 29 - components/anchor/demo/customizeHighlight.tsx | 19 + components/anchor/demo/onChange.md | 31 - components/anchor/demo/onChange.tsx | 21 + components/anchor/demo/onClick.md | 38 - components/anchor/demo/onClick.tsx | 28 + components/anchor/demo/static.md | 27 - components/anchor/demo/static.tsx | 17 + components/anchor/demo/targetOffset.md | 35 - components/anchor/demo/targetOffset.tsx | 25 + components/anchor/index.en-US.md | 38 +- components/anchor/index.tsx | 4 +- components/anchor/index.zh-CN.md | 37 +- components/anchor/style/index.tsx | 14 +- .../__snapshots__/demo-extend.test.ts.snap | 18 +- .../__tests__/__snapshots__/demo.test.ts.snap | 18 +- components/auto-complete/demo/basic.md | 60 - components/auto-complete/demo/basic.tsx | 50 + .../auto-complete/demo/certain-category.md | 72 - .../auto-complete/demo/certain-category.tsx | 62 + components/auto-complete/demo/custom.md | 50 - components/auto-complete/demo/custom.tsx | 40 + components/auto-complete/demo/form-debug.md | 76 +- components/auto-complete/demo/form-debug.tsx | 65 + .../auto-complete/demo/non-case-sensitive.md | 31 - .../auto-complete/demo/non-case-sensitive.tsx | 21 + components/auto-complete/demo/options.md | 40 - components/auto-complete/demo/options.tsx | 30 + components/auto-complete/demo/render-panel.md | 38 - .../auto-complete/demo/render-panel.tsx | 27 + components/auto-complete/demo/status.md | 36 - components/auto-complete/demo/status.tsx | 25 + .../auto-complete/demo/uncertain-category.md | 72 - .../auto-complete/demo/uncertain-category.tsx | 62 + components/auto-complete/index.en-US.md | 16 +- components/auto-complete/index.zh-CN.md | 16 +- .../__snapshots__/demo-extend.test.ts.snap | 16 +- .../__tests__/__snapshots__/demo.test.ts.snap | 16 +- components/avatar/demo/badge.md | 30 - components/avatar/demo/badge.tsx | 20 + components/avatar/demo/basic.md | 32 - components/avatar/demo/basic.tsx | 22 + components/avatar/demo/dynamic.md | 53 - components/avatar/demo/dynamic.tsx | 43 + components/avatar/demo/fallback.md | 26 - components/avatar/demo/fallback.tsx | 15 + components/avatar/demo/group.md | 64 - components/avatar/demo/group.tsx | 54 + components/avatar/demo/responsive.md | 22 - components/avatar/demo/responsive.tsx | 12 + components/avatar/demo/toggle-debug.md | 70 - components/avatar/demo/toggle-debug.tsx | 59 + components/avatar/demo/type.md | 27 - components/avatar/demo/type.tsx | 17 + components/avatar/index.en-US.md | 17 +- components/avatar/index.tsx | 4 +- components/avatar/index.zh-CN.md | 17 +- .../__snapshots__/demo-extend.test.ts.snap | 4 +- .../__tests__/__snapshots__/demo.test.ts.snap | 4 +- components/back-top/demo/basic.md | 23 - components/back-top/demo/basic.tsx | 13 + components/back-top/demo/custom.md | 41 - components/back-top/demo/custom.tsx | 30 + components/back-top/index.en-US.md | 21 +- components/back-top/index.zh-CN.md | 21 +- .../__snapshots__/demo-extend.test.ts.snap | 30 +- .../__tests__/__snapshots__/demo.test.ts.snap | 30 +- components/badge/demo/basic.md | 29 - components/badge/demo/basic.tsx | 19 + components/badge/demo/change.md | 67 - components/badge/demo/change.tsx | 57 + .../badge/demo/colorful-with-count-debug.md | 54 - .../badge/demo/colorful-with-count-debug.tsx | 43 + components/badge/demo/colorful.md | 48 - components/badge/demo/colorful.tsx | 38 + components/badge/demo/dot.md | 26 - components/badge/demo/dot.tsx | 16 + components/badge/demo/link.md | 22 - components/badge/demo/link.tsx | 12 + components/badge/demo/mix.md | 44 - components/badge/demo/mix.tsx | 33 + components/badge/demo/no-wrapper.md | 32 - components/badge/demo/no-wrapper.tsx | 22 + components/badge/demo/offset.md | 20 - components/badge/demo/offset.tsx | 10 + components/badge/demo/overflow.md | 31 - components/badge/demo/overflow.tsx | 21 + components/badge/demo/ribbbon.md | 59 - components/badge/demo/ribbbon.tsx | 49 + components/badge/demo/ribbon-debug.md | 35 - components/badge/demo/ribbon-debug.tsx | 24 + components/badge/demo/size.md | 25 - components/badge/demo/size.tsx | 15 + components/badge/demo/status.md | 34 - components/badge/demo/status.tsx | 24 + components/badge/demo/title.md | 26 - components/badge/demo/title.tsx | 15 + components/badge/index.en-US.md | 22 +- components/badge/index.tsx | 2 +- components/badge/index.zh-CN.md | 22 +- .../__snapshots__/demo-extend.test.ts.snap | 10 +- .../__tests__/__snapshots__/demo.test.ts.snap | 10 +- .../breadcrumb/__tests__/demo-extend.test.ts | 2 +- components/breadcrumb/__tests__/demo.test.ts | 2 +- components/breadcrumb/__tests__/image.test.ts | 2 +- components/breadcrumb/demo/basic.md | 27 - components/breadcrumb/demo/basic.tsx | 17 + components/breadcrumb/demo/overlay.md | 54 - components/breadcrumb/demo/overlay.tsx | 44 + components/breadcrumb/demo/react-router.md | 77 - components/breadcrumb/demo/react-router.tsx | 65 + .../breadcrumb/demo/separator-component.md | 26 - .../breadcrumb/demo/separator-component.tsx | 16 + components/breadcrumb/demo/separator.md | 23 - components/breadcrumb/demo/separator.tsx | 13 + components/breadcrumb/demo/withIcon.md | 28 - components/breadcrumb/demo/withIcon.tsx | 18 + components/breadcrumb/index.en-US.md | 39 +- components/breadcrumb/index.tsx | 4 +- components/breadcrumb/index.zh-CN.md | 25 +- .../__snapshots__/demo-extend.test.ts.snap | 22 +- .../__tests__/__snapshots__/demo.test.ts.snap | 22 +- components/button/__tests__/image.test.ts | 2 +- components/button/demo/basic.md | 25 - components/button/demo/basic.tsx | 15 + components/button/demo/block.md | 29 - components/button/demo/block.tsx | 19 + .../button/demo/chinese-chars-loading.md | 39 - .../button/demo/chinese-chars-loading.tsx | 28 + components/button/demo/danger.md | 32 - components/button/demo/danger.tsx | 22 + components/button/demo/disabled.md | 66 - components/button/demo/disabled.tsx | 56 + components/button/demo/ghost.md | 29 - components/button/demo/ghost.tsx | 19 + components/button/demo/icon.md | 76 - components/button/demo/icon.tsx | 66 + components/button/demo/legacy-group.md | 42 - components/button/demo/legacy-group.tsx | 31 + components/button/demo/loading.md | 69 - components/button/demo/loading.tsx | 59 + components/button/demo/multiple.md | 42 - components/button/demo/multiple.tsx | 32 + components/button/demo/size.md | 53 - components/button/demo/size.tsx | 43 + components/button/index.en-US.md | 20 +- components/button/index.tsx | 6 +- components/button/index.zh-CN.md | 20 +- .../__snapshots__/demo-extend.test.ts.snap | 10 +- .../__tests__/__snapshots__/demo.test.ts.snap | 10 +- components/calendar/demo/basic.md | 24 - components/calendar/demo/basic.tsx | 14 + components/calendar/demo/card.md | 28 - components/calendar/demo/card.tsx | 18 + components/calendar/demo/customize-header.md | 112 - components/calendar/demo/customize-header.tsx | 102 + components/calendar/demo/notice-calendar.md | 80 - components/calendar/demo/notice-calendar.tsx | 70 + components/calendar/demo/select.md | 37 - components/calendar/demo/select.tsx | 27 + components/calendar/index.en-US.md | 13 +- components/calendar/index.tsx | 4 +- components/calendar/index.zh-CN.md | 13 +- .../__snapshots__/demo-extend.test.ts.snap | 20 +- .../__tests__/__snapshots__/demo.test.ts.snap | 20 +- components/card/demo/basic.md | 29 - components/card/demo/basic.tsx | 19 + components/card/demo/border-less.md | 24 - components/card/demo/border-less.tsx | 14 + components/card/demo/flexible-content.md | 26 - components/card/demo/flexible-content.tsx | 16 + components/card/demo/grid-card.md | 33 - components/card/demo/grid-card.tsx | 23 + components/card/demo/in-column.md | 36 - components/card/demo/in-column.tsx | 26 + components/card/demo/inner.md | 30 - components/card/demo/inner.tsx | 20 + components/card/demo/loading.md | 56 - components/card/demo/loading.tsx | 46 + components/card/demo/meta.md | 40 - components/card/demo/meta.tsx | 30 + components/card/demo/simple.md | 22 - components/card/demo/simple.tsx | 12 + components/card/demo/tabs.md | 93 - components/card/demo/tabs.tsx | 83 + components/card/index.en-US.md | 18 +- components/card/index.tsx | 6 +- components/card/index.zh-CN.md | 18 +- .../__snapshots__/demo-extend.test.ts.snap | 8 +- .../__tests__/__snapshots__/demo.test.ts.snap | 8 +- components/carousel/demo/autoplay.md | 39 - components/carousel/demo/autoplay.tsx | 29 + components/carousel/demo/basic.md | 46 - components/carousel/demo/basic.tsx | 36 + components/carousel/demo/fade.md | 39 - components/carousel/demo/fade.tsx | 29 + components/carousel/demo/position.md | 57 - components/carousel/demo/position.tsx | 47 + components/carousel/index.en-US.md | 11 +- components/carousel/index.zh-CN.md | 11 +- .../__snapshots__/demo-extend.test.ts.snap | 36 +- .../__tests__/__snapshots__/demo.test.ts.snap | 36 +- components/cascader/demo/basic.md | 63 - components/cascader/demo/basic.tsx | 53 + components/cascader/demo/change-on-select.md | 61 - components/cascader/demo/change-on-select.tsx | 51 + components/cascader/demo/custom-dropdown.md | 67 - components/cascader/demo/custom-dropdown.tsx | 57 + components/cascader/demo/custom-render.md | 90 - components/cascader/demo/custom-render.tsx | 80 + components/cascader/demo/custom-trigger.md | 61 - components/cascader/demo/custom-trigger.tsx | 51 + components/cascader/demo/default-value.md | 63 - components/cascader/demo/default-value.tsx | 53 + components/cascader/demo/disabled-option.md | 63 - components/cascader/demo/disabled-option.tsx | 53 + components/cascader/demo/fields-name.md | 68 - components/cascader/demo/fields-name.tsx | 58 + components/cascader/demo/hover.md | 71 - components/cascader/demo/hover.tsx | 61 + components/cascader/demo/lazy.md | 66 - components/cascader/demo/lazy.tsx | 56 + components/cascader/demo/multiple.md | 69 - components/cascader/demo/multiple.tsx | 58 + components/cascader/demo/placement.md | 80 - components/cascader/demo/placement.tsx | 70 + components/cascader/demo/render-panel.md | 60 - components/cascader/demo/render-panel.tsx | 49 + components/cascader/demo/search.md | 81 - components/cascader/demo/search.tsx | 71 + .../cascader/demo/showCheckedStrategy.md | 88 - .../cascader/demo/showCheckedStrategy.tsx | 78 + components/cascader/demo/size.md | 73 - components/cascader/demo/size.tsx | 63 + components/cascader/demo/status.md | 22 - components/cascader/demo/status.tsx | 11 + components/cascader/demo/suffix.md | 86 - components/cascader/demo/suffix.tsx | 75 + components/cascader/index.en-US.md | 25 +- components/cascader/index.zh-CN.md | 25 +- .../__snapshots__/demo-extend.test.ts.snap | 14 +- .../__tests__/__snapshots__/demo.test.ts.snap | 14 +- components/checkbox/demo/basic.md | 21 - components/checkbox/demo/basic.tsx | 11 + components/checkbox/demo/check-all.md | 49 - components/checkbox/demo/check-all.tsx | 39 + components/checkbox/demo/controller.md | 53 - components/checkbox/demo/controller.tsx | 43 + components/checkbox/demo/debug-line.md | 60 - components/checkbox/demo/debug-line.tsx | 49 + components/checkbox/demo/disabled.md | 22 - components/checkbox/demo/disabled.tsx | 12 + components/checkbox/demo/group.md | 48 - components/checkbox/demo/group.tsx | 38 + components/checkbox/demo/layout.md | 41 - components/checkbox/demo/layout.tsx | 31 + components/checkbox/index.en-US.md | 14 +- components/checkbox/index.tsx | 4 +- components/checkbox/index.zh-CN.md | 14 +- components/col/index.tsx | 4 +- .../__snapshots__/demo-extend.test.ts.snap | 18 +- .../__tests__/__snapshots__/demo.test.ts.snap | 18 +- components/collapse/demo/accordion.md | 36 - components/collapse/demo/accordion.tsx | 26 + components/collapse/demo/basic.md | 42 - components/collapse/demo/basic.tsx | 32 + components/collapse/demo/borderless.md | 37 - components/collapse/demo/borderless.tsx | 27 + components/collapse/demo/collapsible.md | 42 - components/collapse/demo/collapsible.tsx | 32 + components/collapse/demo/custom.md | 42 - components/collapse/demo/custom.tsx | 32 + components/collapse/demo/extra.md | 73 - components/collapse/demo/extra.tsx | 63 + components/collapse/demo/ghost.md | 36 - components/collapse/demo/ghost.tsx | 26 + components/collapse/demo/mix.md | 46 - components/collapse/demo/mix.tsx | 36 + components/collapse/demo/noarrow.md | 39 - components/collapse/demo/noarrow.tsx | 29 + components/collapse/index.en-US.md | 17 +- components/collapse/index.tsx | 4 +- components/collapse/index.zh-CN.md | 17 +- .../config-provider/__tests__/image.test.ts | 2 +- components/config-provider/demo/direction.md | 554 ----- components/config-provider/demo/direction.tsx | 544 +++++ components/config-provider/demo/locale.md | 154 -- components/config-provider/demo/locale.tsx | 144 ++ components/config-provider/demo/prefixCls.md | 38 - components/config-provider/demo/prefixCls.tsx | 27 + components/config-provider/demo/size.md | 111 - components/config-provider/demo/size.tsx | 101 + components/config-provider/demo/theme.md | 662 ------ components/config-provider/demo/theme.tsx | 651 ++++++ components/config-provider/index.en-US.md | 51 +- components/config-provider/index.tsx | 10 +- components/config-provider/index.zh-CN.md | 49 +- .../__snapshots__/demo-extend.test.ts.snap | 38 +- .../__tests__/__snapshots__/demo.test.ts.snap | 38 +- .../date-picker/__tests__/demo-extend.test.ts | 2 +- components/date-picker/__tests__/demo.test.ts | 2 +- components/date-picker/demo/basic.md | 29 - components/date-picker/demo/basic.tsx | 19 + components/date-picker/demo/bordered.md | 29 - components/date-picker/demo/bordered.tsx | 19 + components/date-picker/demo/date-render.md | 49 - components/date-picker/demo/date-render.tsx | 39 + components/date-picker/demo/disabled-date.md | 78 - components/date-picker/demo/disabled-date.tsx | 68 + components/date-picker/demo/disabled.md | 37 - components/date-picker/demo/disabled.tsx | 27 + components/date-picker/demo/extra-footer.md | 26 - components/date-picker/demo/extra-footer.tsx | 16 + components/date-picker/demo/format.md | 49 - components/date-picker/demo/format.tsx | 39 + components/date-picker/demo/mode.md | 76 - components/date-picker/demo/mode.tsx | 65 + components/date-picker/demo/placement.md | 42 - components/date-picker/demo/placement.tsx | 32 + .../date-picker/demo/presetted-ranges.md | 64 - .../date-picker/demo/presetted-ranges.tsx | 54 + components/date-picker/demo/range-picker.md | 27 - components/date-picker/demo/range-picker.tsx | 17 + components/date-picker/demo/render-panel.md | 19 - components/date-picker/demo/render-panel.tsx | 8 + .../date-picker/demo/select-in-range.md | 51 - .../date-picker/demo/select-in-range.tsx | 41 + components/date-picker/demo/size.md | 40 - components/date-picker/demo/size.tsx | 30 + components/date-picker/demo/start-end.md | 70 - components/date-picker/demo/start-end.tsx | 59 + components/date-picker/demo/status.md | 24 - components/date-picker/demo/status.tsx | 13 + components/date-picker/demo/suffix.md | 43 - components/date-picker/demo/suffix.tsx | 32 + components/date-picker/demo/switchable.md | 49 - components/date-picker/demo/switchable.tsx | 39 + components/date-picker/demo/time.md | 41 - components/date-picker/demo/time.tsx | 31 + components/date-picker/index.en-US.md | 218 +- components/date-picker/index.zh-CN.md | 218 +- .../__snapshots__/demo-extend.test.ts.snap | 16 +- .../__tests__/__snapshots__/demo.test.ts.snap | 16 +- components/descriptions/demo/basic.md | 26 - components/descriptions/demo/basic.tsx | 16 + components/descriptions/demo/border.md | 45 - components/descriptions/demo/border.tsx | 35 + components/descriptions/demo/responsive.md | 44 - components/descriptions/demo/responsive.tsx | 34 + components/descriptions/demo/size.md | 72 - components/descriptions/demo/size.tsx | 62 + components/descriptions/demo/style.md | 67 - components/descriptions/demo/style.tsx | 56 + components/descriptions/demo/text.md | 85 - components/descriptions/demo/text.tsx | 74 + .../descriptions/demo/vertical-border.md | 45 - .../descriptions/demo/vertical-border.tsx | 35 + components/descriptions/demo/vertical.md | 26 - components/descriptions/demo/vertical.tsx | 16 + components/descriptions/index.en-US.md | 16 +- components/descriptions/index.zh-CN.md | 16 +- .../__snapshots__/demo-extend.test.ts.snap | 10 +- .../__tests__/__snapshots__/demo.test.ts.snap | 10 +- components/divider/demo/customize-style.md | 27 - components/divider/demo/customize-style.tsx | 16 + components/divider/demo/horizontal.md | 33 - components/divider/demo/horizontal.tsx | 23 + components/divider/demo/plain.md | 42 - components/divider/demo/plain.tsx | 32 + components/divider/demo/vertical.md | 24 - components/divider/demo/vertical.tsx | 14 + components/divider/demo/with-text.md | 52 - components/divider/demo/with-text.tsx | 42 + components/divider/index.en-US.md | 14 +- components/divider/index.zh-CN.md | 14 +- .../__snapshots__/demo-extend.test.tsx.snap | 24 +- .../__tests__/__snapshots__/demo.test.ts.snap | 24 +- components/drawer/demo/basic-right.md | 39 - components/drawer/demo/basic-right.tsx | 29 + components/drawer/demo/config-provider.md | 49 - components/drawer/demo/config-provider.tsx | 38 + components/drawer/demo/extra.md | 68 - components/drawer/demo/extra.tsx | 58 + components/drawer/demo/form-in-drawer.md | 148 -- components/drawer/demo/form-in-drawer.tsx | 138 ++ components/drawer/demo/multi-level-drawer.md | 57 - components/drawer/demo/multi-level-drawer.tsx | 47 + components/drawer/demo/no-mask.md | 53 - components/drawer/demo/no-mask.tsx | 42 + components/drawer/demo/placement.md | 60 - components/drawer/demo/placement.tsx | 50 + components/drawer/demo/render-in-current.md | 47 - components/drawer/demo/render-in-current.tsx | 37 + components/drawer/demo/render-panel.md | 24 - components/drawer/demo/render-panel.tsx | 13 + components/drawer/demo/scroll-debug.md | 68 - components/drawer/demo/scroll-debug.tsx | 57 + components/drawer/demo/size.md | 66 - components/drawer/demo/size.tsx | 56 + components/drawer/demo/user-profile.md | 160 -- components/drawer/demo/user-profile.tsx | 150 ++ components/drawer/index.en-US.md | 19 +- components/drawer/index.zh-CN.md | 19 +- .../__snapshots__/demo-extend.test.ts.snap | 34 +- .../__tests__/__snapshots__/demo.test.ts.snap | 34 +- components/dropdown/__tests__/image.test.ts | 2 +- components/dropdown/demo/arrow-center.md | 66 - components/dropdown/demo/arrow-center.tsx | 56 + components/dropdown/demo/arrow.md | 66 - components/dropdown/demo/arrow.tsx | 56 + components/dropdown/demo/basic.md | 62 - components/dropdown/demo/basic.tsx | 52 + components/dropdown/demo/context-menu.md | 45 - components/dropdown/demo/context-menu.tsx | 35 + components/dropdown/demo/custom-dropdown.md | 67 - components/dropdown/demo/custom-dropdown.tsx | 57 + components/dropdown/demo/deprecated.md | 66 - components/dropdown/demo/deprecated.tsx | 55 + components/dropdown/demo/dropdown-button.md | 85 - components/dropdown/demo/dropdown-button.tsx | 75 + components/dropdown/demo/event.md | 46 - components/dropdown/demo/event.tsx | 36 + components/dropdown/demo/item.md | 54 - components/dropdown/demo/item.tsx | 44 + components/dropdown/demo/loading.md | 70 - components/dropdown/demo/loading.tsx | 60 + components/dropdown/demo/menu-full.md | 79 - components/dropdown/demo/menu-full.tsx | 68 + components/dropdown/demo/overlay-open.md | 63 - components/dropdown/demo/overlay-open.tsx | 53 + components/dropdown/demo/placement.md | 69 - components/dropdown/demo/placement.tsx | 59 + components/dropdown/demo/render-panel.md | 59 - components/dropdown/demo/render-panel.tsx | 48 + components/dropdown/demo/selectable.md | 48 - components/dropdown/demo/selectable.tsx | 38 + components/dropdown/demo/sub-menu.md | 74 - components/dropdown/demo/sub-menu.tsx | 64 + components/dropdown/demo/trigger.md | 45 - components/dropdown/demo/trigger.tsx | 35 + components/dropdown/index.en-US.md | 72 +- components/dropdown/index.zh-CN.md | 72 +- .../__snapshots__/demo-extend.test.ts.snap | 10 +- .../__tests__/__snapshots__/demo.test.ts.snap | 10 +- components/empty/demo/basic.md | 15 - components/empty/demo/basic.tsx | 6 + components/empty/demo/config-provider.md | 89 - components/empty/demo/config-provider.tsx | 79 + components/empty/demo/customize.md | 30 - components/empty/demo/customize.tsx | 20 + components/empty/demo/description.md | 15 - components/empty/demo/description.tsx | 6 + components/empty/demo/simple.md | 15 - components/empty/demo/simple.tsx | 6 + components/empty/index.en-US.md | 13 +- components/empty/index.zh-CN.md | 13 +- .../__snapshots__/demo-extend.test.ts.snap | 117 +- .../__tests__/__snapshots__/demo.test.ts.snap | 77 +- components/float-button/demo/back-top.md | 28 - components/float-button/demo/back-top.tsx | 17 + components/float-button/demo/basic.md | 17 - components/float-button/demo/basic.tsx | 6 + components/float-button/demo/description.md | 34 - components/float-button/demo/description.tsx | 23 + components/float-button/demo/group-menu.md | 23 - components/float-button/demo/group-menu.tsx | 12 + components/float-button/demo/group.md | 32 - components/float-button/demo/group.tsx | 21 + components/float-button/demo/render-panel.md | 60 - components/float-button/demo/render-panel.tsx | 49 + components/float-button/demo/shape.md | 33 - components/float-button/demo/shape.tsx | 22 + components/float-button/demo/tooltip.md | 21 - components/float-button/demo/tooltip.tsx | 6 + components/float-button/demo/type.md | 23 - components/float-button/demo/type.tsx | 12 + components/float-button/index.en-US.md | 60 +- components/float-button/index.zh-CN.md | 36 +- components/form/Form.tsx | 4 +- .../__snapshots__/demo-extend.test.ts.snap | 64 +- .../__tests__/__snapshots__/demo.test.ts.snap | 64 +- components/form/__tests__/demo-extend.test.ts | 2 +- components/form/__tests__/demo.test.ts | 2 +- components/form/__tests__/image.test.ts | 2 +- components/form/demo/advanced-search.md | 100 - components/form/demo/advanced-search.tsx | 90 + components/form/demo/basic.md | 62 - components/form/demo/basic.tsx | 52 + components/form/demo/col-24-debug.md | 123 -- components/form/demo/col-24-debug.tsx | 112 + components/form/demo/complex-form-control.md | 83 - components/form/demo/complex-form-control.tsx | 73 + components/form/demo/control-hooks.md | 98 - components/form/demo/control-hooks.tsx | 90 + components/form/demo/control-ref.md | 105 - components/form/demo/control-ref.tsx | 97 + .../form/demo/customized-form-controls.md | 110 - .../form/demo/customized-form-controls.tsx | 100 + components/form/demo/dep-debug.md | 44 - components/form/demo/dep-debug.tsx | 33 + components/form/demo/disabled-input-debug.md | 56 - components/form/demo/disabled-input-debug.tsx | 45 + components/form/demo/disabled.md | 121 -- components/form/demo/disabled.tsx | 110 + components/form/demo/dynamic-form-item.md | 115 -- components/form/demo/dynamic-form-item.tsx | 105 + .../form/demo/dynamic-form-items-complex.md | 103 - .../form/demo/dynamic-form-items-complex.tsx | 93 + .../form/demo/dynamic-form-items-no-style.md | 60 - .../form/demo/dynamic-form-items-no-style.tsx | 49 + components/form/demo/dynamic-form-items.md | 61 - components/form/demo/dynamic-form-items.tsx | 51 + components/form/demo/dynamic-rule.md | 87 - components/form/demo/dynamic-rule.tsx | 77 + components/form/demo/form-context.md | 142 -- components/form/demo/form-context.tsx | 132 ++ components/form/demo/form-in-modal.md | 107 - components/form/demo/form-in-modal.tsx | 97 + components/form/demo/global-state.md | 62 - components/form/demo/global-state.tsx | 52 + components/form/demo/inline-login.md | 64 - components/form/demo/inline-login.tsx | 54 + components/form/demo/label-debug.md | 41 - components/form/demo/label-debug.tsx | 30 + components/form/demo/layout-can-wrap.md | 40 - components/form/demo/layout-can-wrap.tsx | 29 + components/form/demo/layout.md | 67 - components/form/demo/layout.tsx | 57 + components/form/demo/nest-messages.md | 63 - components/form/demo/nest-messages.tsx | 53 + components/form/demo/normal-login.md | 63 - components/form/demo/normal-login.tsx | 53 + components/form/demo/ref-item.md | 55 - components/form/demo/ref-item.tsx | 44 + components/form/demo/register.md | 297 --- components/form/demo/register.tsx | 287 +++ components/form/demo/required-mark.md | 56 - components/form/demo/required-mark.tsx | 46 + components/form/demo/size.md | 97 - components/form/demo/size.tsx | 87 + components/form/demo/time-related-controls.md | 87 - .../form/demo/time-related-controls.tsx | 77 + components/form/demo/useWatch.md | 37 - components/form/demo/useWatch.tsx | 26 + components/form/demo/validate-other.md | 206 -- components/form/demo/validate-other.tsx | 196 ++ components/form/demo/validate-static.md | 159 -- components/form/demo/validate-static.tsx | 149 ++ components/form/demo/warning-only.md | 61 - components/form/demo/warning-only.tsx | 50 + components/form/demo/without-form-create.md | 72 - components/form/demo/without-form-create.tsx | 62 + components/form/index.en-US.md | 42 +- components/form/index.tsx | 16 +- components/form/index.zh-CN.md | 238 ++- .../__snapshots__/demo-extend.test.ts.snap | 24 +- .../__tests__/__snapshots__/demo.test.ts.snap | 24 +- components/grid/demo/basic.md | 37 - components/grid/demo/basic.tsx | 27 + components/grid/demo/flex-align.md | 70 - components/grid/demo/flex-align.tsx | 60 + components/grid/demo/flex-order.md | 49 - components/grid/demo/flex-order.tsx | 39 + components/grid/demo/flex-stretch.md | 41 - components/grid/demo/flex-stretch.tsx | 31 + components/grid/demo/flex.md | 66 - components/grid/demo/flex.tsx | 56 + components/grid/demo/gutter.md | 78 - components/grid/demo/gutter.tsx | 68 + components/grid/demo/offset.md | 38 - components/grid/demo/offset.tsx | 28 + components/grid/demo/playground.md | 95 - components/grid/demo/playground.tsx | 85 + components/grid/demo/responsive-more.md | 28 - components/grid/demo/responsive-more.tsx | 18 + components/grid/demo/responsive.md | 28 - components/grid/demo/responsive.tsx | 18 + components/grid/demo/sort.md | 25 - components/grid/demo/sort.tsx | 15 + components/grid/demo/useBreakpoint.md | 31 - components/grid/demo/useBreakpoint.tsx | 23 + components/grid/index.en-US.md | 60 +- components/grid/index.tsx | 4 +- components/grid/index.zh-CN.md | 60 +- .../__snapshots__/demo-extend.test.ts.snap | 10 +- .../__tests__/__snapshots__/demo.test.ts.snap | 10 +- components/icon/__tests__/image.test.ts | 2 +- components/icon/demo/basic.md | 32 - components/icon/demo/basic.tsx | 22 + components/icon/demo/custom.md | 76 - components/icon/demo/custom.tsx | 66 + components/icon/demo/iconfont.md | 27 - components/icon/demo/iconfont.tsx | 17 + components/icon/demo/scriptUrl.md | 31 - components/icon/demo/scriptUrl.tsx | 21 + components/icon/demo/two-tone.md | 23 - components/icon/demo/two-tone.tsx | 13 + components/icon/index.en-US.md | 17 +- components/icon/index.zh-CN.md | 17 +- .../__snapshots__/demo-extend.test.ts.snap | 18 +- .../__tests__/__snapshots__/demo.test.ts.snap | 18 +- components/image/demo/basic.md | 21 - components/image/demo/basic.tsx | 11 + components/image/demo/controlled-preview.md | 51 - components/image/demo/controlled-preview.tsx | 41 + components/image/demo/fallback.md | 23 - components/image/demo/fallback.tsx | 13 + components/image/demo/placeholder.md | 42 - components/image/demo/placeholder.tsx | 32 + .../image/demo/preview-group-top-progress.md | 30 - .../image/demo/preview-group-top-progress.tsx | 20 + .../image/demo/preview-group-visible.md | 36 - .../image/demo/preview-group-visible.tsx | 26 + components/image/demo/preview-group.md | 24 - components/image/demo/preview-group.tsx | 14 + components/image/demo/preview-mask.md | 32 - components/image/demo/preview-mask.tsx | 21 + components/image/demo/previewSrc.md | 24 - components/image/demo/previewSrc.tsx | 14 + components/image/index.en-US.md | 14 +- components/image/index.tsx | 2 +- components/image/index.zh-CN.md | 14 +- .../__snapshots__/demo-extend.test.ts.snap | 28 +- .../__tests__/__snapshots__/demo.test.ts.snap | 28 +- components/input-number/demo/addon.md | 44 - components/input-number/demo/addon.tsx | 34 + components/input-number/demo/basic.md | 20 - components/input-number/demo/basic.tsx | 10 + components/input-number/demo/borderless.md | 16 - components/input-number/demo/borderless.tsx | 6 + components/input-number/demo/controls.md | 20 - components/input-number/demo/controls.tsx | 9 + components/input-number/demo/debug-token.md | 40 +- components/input-number/demo/debug-token.tsx | 30 + components/input-number/demo/digit.md | 30 - components/input-number/demo/digit.tsx | 20 + components/input-number/demo/disabled.md | 33 - components/input-number/demo/disabled.tsx | 23 + components/input-number/demo/formatter.md | 37 - components/input-number/demo/formatter.tsx | 27 + components/input-number/demo/keyboard.md | 32 - components/input-number/demo/keyboard.tsx | 22 + components/input-number/demo/out-of-range.md | 32 - components/input-number/demo/out-of-range.tsx | 22 + components/input-number/demo/prefix.md | 27 - components/input-number/demo/prefix.tsx | 17 + components/input-number/demo/render-panel.md | 22 - components/input-number/demo/render-panel.tsx | 11 + components/input-number/demo/size.md | 26 - components/input-number/demo/size.tsx | 16 + components/input-number/demo/status.md | 25 - components/input-number/demo/status.tsx | 14 + components/input-number/index.en-US.md | 21 +- components/input-number/index.zh-CN.md | 21 +- .../__snapshots__/demo-extend.test.ts.snap | 42 +- .../__tests__/__snapshots__/demo.test.ts.snap | 42 +- components/input/__tests__/image.test.ts | 2 +- components/input/demo/addon.md | 45 - components/input/demo/addon.tsx | 35 + components/input/demo/align.md | 108 +- components/input/demo/align.tsx | 97 + components/input/demo/allowClear.md | 29 - components/input/demo/allowClear.tsx | 19 + components/input/demo/autosize-textarea.md | 38 - components/input/demo/autosize-textarea.tsx | 28 + components/input/demo/basic.md | 16 - components/input/demo/basic.tsx | 6 + components/input/demo/borderless-debug.md | 30 - components/input/demo/borderless-debug.tsx | 19 + components/input/demo/borderless.md | 16 - components/input/demo/borderless.tsx | 6 + components/input/demo/debug-addon.md | 35 - components/input/demo/debug-addon.tsx | 24 + components/input/demo/focus.md | 80 - components/input/demo/focus.tsx | 70 + components/input/demo/group.md | 188 -- components/input/demo/group.tsx | 178 ++ components/input/demo/password-input.md | 38 - components/input/demo/password-input.tsx | 28 + components/input/demo/presuffix.md | 35 - components/input/demo/presuffix.tsx | 25 + components/input/demo/search-input-loading.md | 28 - .../input/demo/search-input-loading.tsx | 18 + components/input/demo/search-input.md | 57 - components/input/demo/search-input.tsx | 47 + components/input/demo/show-count.md | 29 - components/input/demo/show-count.tsx | 19 + components/input/demo/size.md | 27 - components/input/demo/size.tsx | 17 + components/input/demo/status.md | 25 - components/input/demo/status.tsx | 14 + components/input/demo/textarea-resize.md | 34 - components/input/demo/textarea-resize.tsx | 23 + components/input/demo/textarea-show-count.md | 39 - components/input/demo/textarea-show-count.tsx | 29 + components/input/demo/textarea.md | 25 - components/input/demo/textarea.tsx | 15 + components/input/demo/tooltip.md | 67 - components/input/demo/tooltip.tsx | 57 + components/input/index.en-US.md | 130 +- components/input/index.tsx | 10 +- components/input/index.zh-CN.md | 120 +- .../__snapshots__/demo-extend.test.ts.snap | 18 +- .../__tests__/__snapshots__/demo.test.ts.snap | 18 +- .../layout/__tests__/demo-extend.test.ts | 2 +- components/layout/__tests__/demo.test.ts | 2 +- components/layout/__tests__/image.test.ts | 2 +- components/layout/demo/basic.md | 53 - components/layout/demo/basic.tsx | 43 + .../layout/demo/custom-trigger-debug.md | 115 -- .../layout/demo/custom-trigger-debug.tsx | 104 + components/layout/demo/custom-trigger.md | 75 - components/layout/demo/custom-trigger.tsx | 65 + components/layout/demo/fixed-sider.md | 79 - components/layout/demo/fixed-sider.tsx | 68 + components/layout/demo/fixed.md | 45 - components/layout/demo/fixed.tsx | 34 + components/layout/demo/responsive.md | 55 - components/layout/demo/responsive.tsx | 45 + components/layout/demo/side.md | 79 - components/layout/demo/side.tsx | 68 + components/layout/demo/top-side-2.md | 80 - components/layout/demo/top-side-2.tsx | 70 + components/layout/demo/top-side.md | 72 - components/layout/demo/top-side.tsx | 62 + components/layout/demo/top.md | 45 - components/layout/demo/top.tsx | 35 + components/layout/index.en-US.md | 58 +- components/layout/index.tsx | 4 +- components/layout/index.zh-CN.md | 58 +- .../__snapshots__/demo-extend.test.ts.snap | 18 +- .../__tests__/__snapshots__/demo.test.ts.snap | 18 +- components/list/__tests__/image.test.ts | 2 +- components/list/demo/basic.md | 45 - components/list/demo/basic.tsx | 35 + components/list/demo/grid-test.md | 67 - components/list/demo/grid-test.tsx | 56 + components/list/demo/grid.md | 41 - components/list/demo/grid.tsx | 31 + components/list/demo/infinite-load.md | 91 - components/list/demo/infinite-load.tsx | 81 + components/list/demo/loadmore.md | 108 - components/list/demo/loadmore.tsx | 98 + components/list/demo/responsive.md | 55 - components/list/demo/responsive.tsx | 45 + components/list/demo/simple.md | 57 - components/list/demo/simple.tsx | 47 + components/list/demo/vertical.md | 75 - components/list/demo/vertical.tsx | 65 + components/list/demo/virtual-list.md | 81 - components/list/demo/virtual-list.tsx | 71 + components/list/index.en-US.md | 17 +- components/list/index.tsx | 2 +- components/list/index.zh-CN.md | 17 +- .../__snapshots__/demo-extend.test.ts.snap | 18 +- .../__tests__/__snapshots__/demo.test.ts.snap | 18 +- components/mentions/demo/async.md | 60 - components/mentions/demo/async.tsx | 50 + components/mentions/demo/autoSize.md | 24 - components/mentions/demo/autoSize.tsx | 14 + components/mentions/demo/basic.md | 38 - components/mentions/demo/basic.tsx | 28 + components/mentions/demo/form.md | 81 - components/mentions/demo/form.tsx | 71 + components/mentions/demo/placement.md | 24 - components/mentions/demo/placement.tsx | 14 + components/mentions/demo/prefix.md | 46 - components/mentions/demo/prefix.tsx | 36 + components/mentions/demo/readonly.md | 36 - components/mentions/demo/readonly.tsx | 26 + components/mentions/demo/render-panel.md | 26 - components/mentions/demo/render-panel.tsx | 15 + components/mentions/demo/status.md | 46 - components/mentions/demo/status.tsx | 36 + components/mentions/index.en-US.md | 16 +- components/mentions/index.zh-CN.md | 16 +- .../__snapshots__/demo-extend.test.ts.snap | 22 +- .../__tests__/__snapshots__/demo.test.ts.snap | 22 +- components/menu/demo/deprecated.md | 39 - components/menu/demo/deprecated.tsx | 29 + components/menu/demo/horizontal.md | 84 - components/menu/demo/horizontal.tsx | 74 + components/menu/demo/inline-collapsed.md | 86 - components/menu/demo/inline-collapsed.tsx | 76 + components/menu/demo/inline.md | 71 - components/menu/demo/inline.tsx | 61 + components/menu/demo/menu-v4.md | 102 - components/menu/demo/menu-v4.tsx | 91 + components/menu/demo/sider-current.md | 80 - components/menu/demo/sider-current.tsx | 70 + components/menu/demo/style-debug.md | 104 - components/menu/demo/style-debug.tsx | 93 + components/menu/demo/submenu-theme.md | 81 - components/menu/demo/submenu-theme.tsx | 71 + components/menu/demo/switch-mode.md | 92 - components/menu/demo/switch-mode.tsx | 82 + components/menu/demo/theme.md | 92 - components/menu/demo/theme.tsx | 82 + components/menu/demo/vertical.md | 62 - components/menu/demo/vertical.tsx | 52 + components/menu/index.en-US.md | 19 +- components/menu/index.tsx | 12 +- components/menu/index.zh-CN.md | 19 +- .../__snapshots__/demo-extend.test.ts.snap | 18 +- .../__tests__/__snapshots__/demo.test.ts.snap | 18 +- components/message/demo/custom-style.md | 36 - components/message/demo/custom-style.tsx | 26 + components/message/demo/duration.md | 33 - components/message/demo/duration.tsx | 23 + components/message/demo/hooks.md | 37 - components/message/demo/hooks.tsx | 29 + components/message/demo/info.md | 24 - components/message/demo/info.tsx | 14 + components/message/demo/loading.md | 34 - components/message/demo/loading.tsx | 24 + components/message/demo/other.md | 50 - components/message/demo/other.tsx | 40 + components/message/demo/render-panel.md | 17 - components/message/demo/render-panel.tsx | 7 + components/message/demo/thenable.md | 36 - components/message/demo/thenable.tsx | 26 + components/message/demo/update.md | 44 - components/message/demo/update.tsx | 34 + components/message/index.en-US.md | 16 +- components/message/index.zh-CN.md | 16 +- .../__snapshots__/demo-extend.test.ts.snap | 30 +- .../__tests__/__snapshots__/demo.test.ts.snap | 30 +- components/modal/demo/async.md | 55 - components/modal/demo/async.tsx | 45 + components/modal/demo/basic.md | 43 - components/modal/demo/basic.tsx | 33 + components/modal/demo/button-props.md | 52 - components/modal/demo/button-props.tsx | 42 + components/modal/demo/confirm-router.md | 40 - components/modal/demo/confirm-router.tsx | 30 + components/modal/demo/confirm.md | 95 - components/modal/demo/confirm.tsx | 85 + components/modal/demo/dark.md | 573 ------ components/modal/demo/dark.tsx | 563 ++++++ components/modal/demo/footer.md | 72 - components/modal/demo/footer.tsx | 62 + components/modal/demo/hooks.md | 72 - components/modal/demo/hooks.tsx | 62 + components/modal/demo/info.md | 56 - components/modal/demo/info.tsx | 46 + components/modal/demo/locale.md | 64 - components/modal/demo/locale.tsx | 54 + components/modal/demo/manual.md | 37 - components/modal/demo/manual.tsx | 27 + components/modal/demo/modal-render.md | 100 - components/modal/demo/modal-render.tsx | 90 + components/modal/demo/position.md | 54 - components/modal/demo/position.tsx | 44 + components/modal/demo/render-panel.md | 30 - components/modal/demo/render-panel.tsx | 19 + components/modal/demo/width.md | 38 - components/modal/demo/width.tsx | 28 + components/modal/index.en-US.md | 22 +- components/modal/index.tsx | 2 +- components/modal/index.zh-CN.md | 22 +- .../__snapshots__/demo-extend.test.ts.snap | 20 +- .../__tests__/__snapshots__/demo.test.ts.snap | 20 +- components/notification/demo/basic.md | 30 - components/notification/demo/basic.tsx | 20 + components/notification/demo/custom-icon.md | 37 - components/notification/demo/custom-icon.tsx | 27 + components/notification/demo/custom-style.md | 38 - components/notification/demo/custom-style.tsx | 28 + components/notification/demo/duration.md | 36 - components/notification/demo/duration.tsx | 26 + components/notification/demo/hooks.md | 62 - components/notification/demo/hooks.tsx | 54 + components/notification/demo/placement.md | 88 - components/notification/demo/placement.tsx | 78 + components/notification/demo/render-panel.md | 28 - components/notification/demo/render-panel.tsx | 18 + components/notification/demo/update.md | 44 - components/notification/demo/update.tsx | 34 + components/notification/demo/with-btn.md | 55 - components/notification/demo/with-btn.tsx | 45 + components/notification/demo/with-icon.md | 40 - components/notification/demo/with-icon.tsx | 30 + components/notification/index.en-US.md | 17 +- components/notification/index.zh-CN.md | 17 +- components/overview/index.en-US.md | 3 +- components/overview/index.zh-CN.md | 3 +- components/pagination/Pagination.tsx | 4 +- .../__snapshots__/demo-extend.test.ts.snap | 20 +- .../__tests__/__snapshots__/demo.test.ts.snap | 20 +- components/pagination/demo/all.md | 23 - components/pagination/demo/all.tsx | 13 + components/pagination/demo/basic.md | 16 - components/pagination/demo/basic.tsx | 6 + components/pagination/demo/changer.md | 38 - components/pagination/demo/changer.tsx | 28 + components/pagination/demo/controlled.md | 26 - components/pagination/demo/controlled.tsx | 16 + components/pagination/demo/itemRender.md | 27 - components/pagination/demo/itemRender.tsx | 17 + components/pagination/demo/jump.md | 27 - components/pagination/demo/jump.tsx | 17 + components/pagination/demo/mini.md | 33 - components/pagination/demo/mini.tsx | 23 + components/pagination/demo/more.md | 16 - components/pagination/demo/more.tsx | 6 + components/pagination/demo/simple.md | 22 - components/pagination/demo/simple.tsx | 12 + components/pagination/demo/total.md | 32 - components/pagination/demo/total.tsx | 22 + components/pagination/index.en-US.md | 18 +- components/pagination/index.tsx | 2 +- components/pagination/index.zh-CN.md | 18 +- .../__snapshots__/demo-extend.test.ts.snap | 16 +- .../__tests__/__snapshots__/demo.test.ts.snap | 16 +- components/popconfirm/demo/async.md | 51 - components/popconfirm/demo/async.tsx | 41 + components/popconfirm/demo/basic.md | 36 - components/popconfirm/demo/basic.tsx | 26 + components/popconfirm/demo/dynamic-trigger.md | 67 - .../popconfirm/demo/dynamic-trigger.tsx | 57 + components/popconfirm/demo/icon.md | 21 - components/popconfirm/demo/icon.tsx | 11 + components/popconfirm/demo/locale.md | 20 - components/popconfirm/demo/locale.tsx | 10 + components/popconfirm/demo/placement.md | 105 - components/popconfirm/demo/placement.tsx | 95 + components/popconfirm/demo/promise.md | 28 - components/popconfirm/demo/promise.tsx | 17 + components/popconfirm/demo/render-panel.md | 24 - components/popconfirm/demo/render-panel.tsx | 13 + components/popconfirm/index.en-US.md | 15 +- components/popconfirm/index.zh-CN.md | 15 +- .../__snapshots__/demo-extend.test.ts.snap | 14 +- .../__tests__/__snapshots__/demo.test.ts.snap | 14 +- .../popover/demo/arrow-point-at-center.md | 32 - .../popover/demo/arrow-point-at-center.tsx | 22 + components/popover/demo/basic.md | 27 - components/popover/demo/basic.tsx | 17 + components/popover/demo/control.md | 38 - components/popover/demo/control.tsx | 28 + components/popover/demo/hover-with-click.md | 62 - components/popover/demo/hover-with-click.tsx | 52 + components/popover/demo/placement.md | 73 - components/popover/demo/placement.tsx | 63 + components/popover/demo/render-panel.md | 36 - components/popover/demo/render-panel.tsx | 25 + components/popover/demo/triggerType.md | 35 - components/popover/demo/triggerType.tsx | 25 + components/popover/index.en-US.md | 14 +- components/popover/index.zh-CN.md | 14 +- .../__snapshots__/demo-extend.test.ts.snap | 26 +- .../__tests__/__snapshots__/demo.test.ts.snap | 26 +- components/progress/demo/circle-dynamic.md | 45 - components/progress/demo/circle-dynamic.tsx | 35 + components/progress/demo/circle-micro.md | 28 - components/progress/demo/circle-micro.tsx | 18 + components/progress/demo/circle-mini.md | 22 - components/progress/demo/circle-mini.tsx | 12 + components/progress/demo/circle.md | 22 - components/progress/demo/circle.tsx | 12 + components/progress/demo/dashboard.md | 21 - components/progress/demo/dashboard.tsx | 11 + components/progress/demo/dynamic.md | 45 - components/progress/demo/dynamic.tsx | 35 + components/progress/demo/format.md | 21 - components/progress/demo/format.tsx | 11 + components/progress/demo/gradient-line.md | 28 - components/progress/demo/gradient-line.tsx | 18 + components/progress/demo/line-mini.md | 23 - components/progress/demo/line-mini.tsx | 13 + components/progress/demo/line.md | 24 - components/progress/demo/line.tsx | 14 + components/progress/demo/linecap.md | 22 - components/progress/demo/linecap.tsx | 12 + components/progress/demo/segment.md | 28 - components/progress/demo/segment.tsx | 18 + components/progress/demo/steps.md | 27 - components/progress/demo/steps.tsx | 17 + components/progress/index.en-US.md | 74 +- components/progress/index.tsx | 2 +- components/progress/index.zh-CN.md | 64 +- .../__snapshots__/demo-extend.test.ts.snap | 20 +- .../__tests__/__snapshots__/demo.test.ts.snap | 20 +- components/radio/demo/badge.md | 26 - components/radio/demo/badge.tsx | 15 + components/radio/demo/basic.md | 16 - components/radio/demo/basic.tsx | 6 + components/radio/demo/disabled.md | 37 - components/radio/demo/disabled.tsx | 27 + components/radio/demo/radiobutton-solid.md | 33 - components/radio/demo/radiobutton-solid.tsx | 23 + components/radio/demo/radiobutton.md | 44 - components/radio/demo/radiobutton.tsx | 34 + components/radio/demo/radiogroup-more.md | 38 - components/radio/demo/radiogroup-more.tsx | 28 + components/radio/demo/radiogroup-options.md | 74 - components/radio/demo/radiogroup-options.tsx | 64 + components/radio/demo/radiogroup-with-name.md | 23 - .../radio/demo/radiogroup-with-name.tsx | 13 + components/radio/demo/radiogroup.md | 33 - components/radio/demo/radiogroup.tsx | 23 + components/radio/demo/size.md | 37 - components/radio/demo/size.tsx | 27 + components/radio/index.en-US.md | 17 +- components/radio/index.zh-CN.md | 17 +- .../__snapshots__/demo-extend.test.ts.snap | 14 +- .../__tests__/__snapshots__/demo.test.ts.snap | 14 +- components/rate/demo/basic.md | 16 - components/rate/demo/basic.tsx | 6 + components/rate/demo/character-function.md | 31 - components/rate/demo/character-function.tsx | 21 + components/rate/demo/character.md | 25 - components/rate/demo/character.tsx | 15 + components/rate/demo/clear.md | 24 - components/rate/demo/clear.tsx | 14 + components/rate/demo/disabled.md | 16 - components/rate/demo/disabled.tsx | 6 + components/rate/demo/half.md | 16 - components/rate/demo/half.tsx | 6 + components/rate/demo/text.md | 27 - components/rate/demo/text.tsx | 17 + components/rate/index.en-US.md | 14 +- components/rate/index.zh-CN.md | 14 +- .../__snapshots__/demo-extend.test.ts.snap | 16 +- .../__tests__/__snapshots__/demo.test.ts.snap | 16 +- components/result/demo/403.md | 23 - components/result/demo/403.tsx | 13 + components/result/demo/404.md | 23 - components/result/demo/404.tsx | 13 + components/result/demo/500.md | 23 - components/result/demo/500.tsx | 13 + components/result/demo/customIcon.md | 23 - components/result/demo/customIcon.tsx | 13 + components/result/demo/error.md | 52 - components/result/demo/error.tsx | 42 + components/result/demo/info.md | 25 - components/result/demo/info.tsx | 15 + components/result/demo/success.md | 28 - components/result/demo/success.tsx | 18 + components/result/demo/warning.md | 26 - components/result/demo/warning.tsx | 16 + components/result/index.en-US.md | 16 +- components/result/index.zh-CN.md | 16 +- components/row/index.tsx | 4 +- .../__snapshots__/demo-extend.test.ts.snap | 22 +- .../__tests__/__snapshots__/demo.test.ts.snap | 22 +- components/segmented/demo/basic.md | 13 - components/segmented/demo/basic.tsx | 4 + components/segmented/demo/block.md | 15 - components/segmented/demo/block.tsx | 6 + components/segmented/demo/controlled-two.md | 26 - components/segmented/demo/controlled-two.tsx | 15 + components/segmented/demo/controlled.md | 20 - components/segmented/demo/controlled.tsx | 10 + components/segmented/demo/custom.md | 89 - components/segmented/demo/custom.tsx | 80 + components/segmented/demo/disabled.md | 27 - components/segmented/demo/disabled.tsx | 18 + components/segmented/demo/dynamic.md | 36 - components/segmented/demo/dynamic.tsx | 26 + components/segmented/demo/icon-only.md | 27 - components/segmented/demo/icon-only.tsx | 18 + components/segmented/demo/size-consistent.md | 33 - components/segmented/demo/size-consistent.tsx | 23 + components/segmented/demo/size.md | 21 - components/segmented/demo/size.tsx | 12 + components/segmented/demo/with-icon.md | 29 - components/segmented/demo/with-icon.tsx | 20 + components/segmented/index.en-US.md | 18 +- components/segmented/index.zh-CN.md | 18 +- .../__snapshots__/demo-extend.test.ts.snap | 44 +- .../__tests__/__snapshots__/demo.test.ts.snap | 46 +- .../select/__tests__/demo-extend.test.ts | 2 +- components/select/__tests__/demo.test.ts | 2 +- components/select/__tests__/image.test.ts | 2 +- .../select/demo/automatic-tokenization.md | 38 - .../select/demo/automatic-tokenization.tsx | 28 + components/select/demo/basic.md | 80 - components/select/demo/basic.tsx | 70 + components/select/demo/big-data.md | 55 - components/select/demo/big-data.tsx | 45 + components/select/demo/bordered.md | 50 - components/select/demo/bordered.tsx | 40 + components/select/demo/coordinate.md | 53 - components/select/demo/coordinate.tsx | 43 + .../select/demo/custom-dropdown-menu.md | 62 - .../select/demo/custom-dropdown-menu.tsx | 52 + components/select/demo/custom-tag-render.md | 47 - components/select/demo/custom-tag-render.tsx | 37 + components/select/demo/debug.md | 95 - components/select/demo/debug.tsx | 84 + components/select/demo/hide-selected.md | 36 - components/select/demo/hide-selected.tsx | 26 + components/select/demo/label-in-value.md | 37 - components/select/demo/label-in-value.tsx | 27 + components/select/demo/multiple.md | 51 - components/select/demo/multiple.tsx | 41 + components/select/demo/optgroup.md | 32 - components/select/demo/optgroup.tsx | 22 + components/select/demo/option-label-prop.md | 64 - components/select/demo/option-label-prop.tsx | 54 + components/select/demo/placement.md | 57 - components/select/demo/placement.tsx | 47 + components/select/demo/render-panel.md | 38 - components/select/demo/render-panel.tsx | 27 + components/select/demo/responsive.md | 53 - components/select/demo/responsive.tsx | 43 + components/select/demo/search-box.md | 87 - components/select/demo/search-box.tsx | 77 + components/select/demo/search-sort.md | 53 - components/select/demo/search-sort.tsx | 43 + components/select/demo/search.md | 49 - components/select/demo/search.tsx | 39 + components/select/demo/select-users.md | 100 - components/select/demo/select-users.tsx | 90 + components/select/demo/size.md | 75 - components/select/demo/size.tsx | 65 + components/select/demo/status.md | 22 - components/select/demo/status.tsx | 11 + components/select/demo/suffix.md | 65 - components/select/demo/suffix.tsx | 54 + components/select/demo/tags.md | 38 - components/select/demo/tags.tsx | 28 + components/select/index.en-US.md | 145 +- components/select/index.tsx | 6 +- components/select/index.zh-CN.md | 145 +- .../__snapshots__/demo-extend.test.ts.snap | 12 +- .../__tests__/__snapshots__/demo.test.ts.snap | 12 +- components/skeleton/demo/active.md | 16 - components/skeleton/demo/active.tsx | 6 + components/skeleton/demo/basic.md | 16 - components/skeleton/demo/basic.tsx | 6 + components/skeleton/demo/children.md | 44 - components/skeleton/demo/children.tsx | 34 + components/skeleton/demo/complex.md | 16 - components/skeleton/demo/complex.tsx | 6 + components/skeleton/demo/element.md | 102 - components/skeleton/demo/element.tsx | 92 + components/skeleton/demo/list.md | 89 - components/skeleton/demo/list.tsx | 79 + components/skeleton/index.en-US.md | 14 +- components/skeleton/index.tsx | 2 +- components/skeleton/index.zh-CN.md | 14 +- .../__snapshots__/demo-extend.test.ts.snap | 20 +- .../__tests__/__snapshots__/demo.test.ts.snap | 72 +- components/slider/__tests__/demo.test.ts | 2 +- components/slider/demo/basic.md | 30 - components/slider/demo/basic.tsx | 20 + components/slider/demo/dragableTrack.md | 16 - components/slider/demo/dragableTrack.tsx | 6 + components/slider/demo/event.md | 35 - components/slider/demo/event.tsx | 25 + components/slider/demo/icon-slider.md | 39 - components/slider/demo/icon-slider.tsx | 29 + components/slider/demo/input-number.md | 87 - components/slider/demo/input-number.tsx | 77 + components/slider/demo/mark.md | 44 - components/slider/demo/mark.tsx | 34 + components/slider/demo/reverse.md | 26 - components/slider/demo/reverse.tsx | 16 + components/slider/demo/show-tooltip.md | 16 - components/slider/demo/show-tooltip.tsx | 6 + components/slider/demo/tip-formatter.md | 23 - components/slider/demo/tip-formatter.tsx | 13 + components/slider/demo/vertical.md | 47 - components/slider/demo/vertical.tsx | 37 + components/slider/index.en-US.md | 17 +- components/slider/index.zh-CN.md | 17 +- .../__snapshots__/demo-extend.test.ts.snap | 28 +- .../__tests__/__snapshots__/demo.test.ts.snap | 28 +- components/space/demo/align.md | 47 - components/space/demo/align.tsx | 37 + components/space/demo/base.md | 30 - components/space/demo/base.tsx | 20 + .../space/demo/compact-button-vertical.md | 35 - .../space/demo/compact-button-vertical.tsx | 24 + components/space/demo/compact-buttons.md | 129 -- components/space/demo/compact-buttons.tsx | 118 ++ components/space/demo/compact-debug.md | 82 - components/space/demo/compact-debug.tsx | 70 + components/space/demo/compact-nested.md | 99 - components/space/demo/compact-nested.tsx | 87 + components/space/demo/compact.md | 225 --- components/space/demo/compact.tsx | 214 ++ components/space/demo/customize.md | 32 - components/space/demo/customize.tsx | 22 + components/space/demo/debug.md | 37 - components/space/demo/debug.tsx | 26 + components/space/demo/gap-in-line.md | 44 - components/space/demo/gap-in-line.tsx | 33 + components/space/demo/size.md | 37 - components/space/demo/size.tsx | 27 + components/space/demo/split.md | 22 - components/space/demo/split.tsx | 12 + components/space/demo/vertical.md | 31 - components/space/demo/vertical.tsx | 21 + components/space/demo/wrap.md | 23 - components/space/demo/wrap.tsx | 13 + components/space/index.en-US.md | 46 +- components/space/index.zh-CN.md | 46 +- .../__snapshots__/demo-extend.test.ts.snap | 14 +- .../__tests__/__snapshots__/demo.test.ts.snap | 14 +- components/spin/demo/basic.md | 16 - components/spin/demo/basic.tsx | 6 + components/spin/demo/custom-indicator.md | 19 - components/spin/demo/custom-indicator.tsx | 9 + components/spin/demo/delayAndDebounce.md | 41 - components/spin/demo/delayAndDebounce.tsx | 31 + components/spin/demo/inside.md | 20 - components/spin/demo/inside.tsx | 10 + components/spin/demo/nested.md | 38 - components/spin/demo/nested.tsx | 28 + components/spin/demo/size.md | 22 - components/spin/demo/size.tsx | 12 + components/spin/demo/tip.md | 24 - components/spin/demo/tip.tsx | 14 + components/spin/index.en-US.md | 14 +- components/spin/index.zh-CN.md | 14 +- .../__snapshots__/demo-extend.test.ts.snap | 8 +- .../__tests__/__snapshots__/demo.test.ts.snap | 8 +- components/statistic/__tests__/image.test.ts | 2 +- components/statistic/demo/basic.md | 31 - components/statistic/demo/basic.tsx | 21 + components/statistic/demo/card.md | 46 - components/statistic/demo/card.tsx | 36 + components/statistic/demo/countdown.md | 47 - components/statistic/demo/countdown.tsx | 37 + components/statistic/demo/unit.md | 26 - components/statistic/demo/unit.tsx | 16 + components/statistic/index.en-US.md | 11 +- components/statistic/index.tsx | 4 +- components/statistic/index.zh-CN.md | 11 +- .../__snapshots__/demo-extend.test.ts.snap | 36 +- .../__tests__/__snapshots__/demo.test.ts.snap | 36 +- components/steps/__tests__/image.test.ts | 2 +- components/steps/demo/clickable.md | 69 - components/steps/demo/clickable.tsx | 59 + .../steps/demo/customized-progress-dot.md | 52 - .../steps/demo/customized-progress-dot.tsx | 42 + components/steps/demo/deprecated.md | 25 - components/steps/demo/deprecated.tsx | 14 + components/steps/demo/error.md | 36 - components/steps/demo/error.tsx | 26 + components/steps/demo/icon.md | 42 - components/steps/demo/icon.tsx | 32 + components/steps/demo/inline.md | 74 - components/steps/demo/inline.tsx | 65 + components/steps/demo/label-placement.md | 39 - components/steps/demo/label-placement.tsx | 29 + components/steps/demo/nav.md | 105 - components/steps/demo/nav.tsx | 95 + components/steps/demo/progress-debug.md | 73 - components/steps/demo/progress-debug.tsx | 62 + components/steps/demo/progress-dot-small.md | 68 - components/steps/demo/progress-dot-small.tsx | 57 + components/steps/demo/progress-dot.md | 65 - components/steps/demo/progress-dot.tsx | 55 + components/steps/demo/progress.md | 37 - components/steps/demo/progress.tsx | 27 + components/steps/demo/simple.md | 36 - components/steps/demo/simple.tsx | 26 + components/steps/demo/small-size.md | 32 - components/steps/demo/small-size.tsx | 22 + components/steps/demo/step-next.md | 66 - components/steps/demo/step-next.tsx | 56 + components/steps/demo/steps-in-steps.md | 73 - components/steps/demo/steps-in-steps.tsx | 62 + components/steps/demo/vertical-small.md | 34 - components/steps/demo/vertical-small.tsx | 24 + components/steps/demo/vertical.md | 36 - components/steps/demo/vertical.tsx | 26 + components/steps/index.en-US.md | 90 +- components/steps/index.zh-CN.md | 88 +- .../__snapshots__/demo-extend.test.ts.snap | 10 +- .../__tests__/__snapshots__/demo.test.ts.snap | 10 +- components/switch/__tests__/image.test.ts | 2 +- components/switch/demo/basic.md | 20 - components/switch/demo/basic.tsx | 10 + components/switch/demo/disabled.md | 32 - components/switch/demo/disabled.tsx | 22 + components/switch/demo/loading.md | 22 - components/switch/demo/loading.tsx | 12 + components/switch/demo/size.md | 22 - components/switch/demo/size.tsx | 12 + components/switch/demo/text.md | 29 - components/switch/demo/text.tsx | 19 + components/switch/index.en-US.md | 12 +- components/switch/index.zh-CN.md | 12 +- components/table/Table.tsx | 5 +- .../__snapshots__/demo-extend.test.ts.snap | 273 +-- .../__tests__/__snapshots__/demo.test.ts.snap | 273 +-- components/table/demo/ajax.md | 122 -- components/table/demo/ajax.tsx | 112 + components/table/demo/basic.md | 98 - components/table/demo/basic.tsx | 88 + components/table/demo/bordered.md | 71 - components/table/demo/bordered.tsx | 61 + components/table/demo/colspan-rowspan.md | 126 -- components/table/demo/colspan-rowspan.tsx | 115 ++ components/table/demo/custom-filter-panel.md | 180 -- components/table/demo/custom-filter-panel.tsx | 170 ++ components/table/demo/drag-sorting-handler.md | 150 -- components/table/demo/drag-sorting.md | 154 -- components/table/demo/drag-sorting.tsx | 144 ++ components/table/demo/dynamic-settings.md | 286 --- components/table/demo/dynamic-settings.tsx | 276 +++ components/table/demo/edit-cell.md | 232 --- components/table/demo/edit-cell.tsx | 222 ++ components/table/demo/edit-row.md | 192 -- components/table/demo/edit-row.tsx | 182 ++ .../table/demo/ellipsis-custom-tooltip.md | 113 -- .../table/demo/ellipsis-custom-tooltip.tsx | 103 + components/table/demo/ellipsis.md | 88 - components/table/demo/ellipsis.tsx | 78 + components/table/demo/expand.md | 77 - components/table/demo/expand.tsx | 67 + components/table/demo/filter-in-tree.md | 123 -- components/table/demo/filter-in-tree.tsx | 112 + components/table/demo/filter-search.md | 103 - components/table/demo/filter-search.tsx | 92 + components/table/demo/fixed-columns-header.md | 103 - .../table/demo/fixed-columns-header.tsx | 93 + components/table/demo/fixed-columns.md | 71 - components/table/demo/fixed-columns.tsx | 61 + components/table/demo/fixed-header.md | 53 - components/table/demo/fixed-header.tsx | 43 + components/table/demo/grouping-columns.md | 136 -- components/table/demo/grouping-columns.tsx | 126 ++ components/table/demo/head.md | 112 - components/table/demo/head.tsx | 102 + components/table/demo/jsx.md | 87 - components/table/demo/jsx.tsx | 77 + components/table/demo/multiple-sorter.md | 91 - components/table/demo/multiple-sorter.tsx | 81 + components/table/demo/narrow.md | 55 - components/table/demo/narrow.tsx | 44 + .../table/demo/nest-table-border-debug.md | 137 -- .../table/demo/nest-table-border-debug.tsx | 126 ++ components/table/demo/nested-table.md | 130 -- components/table/demo/nested-table.tsx | 120 ++ components/table/demo/order-column.md | 74 - components/table/demo/order-column.tsx | 63 + components/table/demo/pagination.md | 147 -- components/table/demo/pagination.tsx | 137 ++ components/table/demo/reset-filter.md | 127 -- components/table/demo/reset-filter.tsx | 117 ++ components/table/demo/resizable-column.md | 144 -- components/table/demo/resizable-column.tsx | 133 ++ components/table/demo/responsive.md | 54 - components/table/demo/responsive.tsx | 44 + .../table/demo/row-selection-and-operation.md | 86 - .../demo/row-selection-and-operation.tsx | 76 + .../table/demo/row-selection-custom-debug.md | 51 - .../table/demo/row-selection-custom-debug.tsx | 40 + components/table/demo/row-selection-custom.md | 97 - .../table/demo/row-selection-custom.tsx | 87 + components/table/demo/row-selection.md | 105 - components/table/demo/row-selection.tsx | 95 + components/table/demo/size.md | 67 - components/table/demo/size.tsx | 57 + components/table/demo/sticky.md | 132 -- components/table/demo/sticky.tsx | 122 ++ components/table/demo/summary.md | 152 -- components/table/demo/summary.tsx | 142 ++ components/table/demo/tree-data.md | 139 -- components/table/demo/tree-data.tsx | 129 ++ components/table/demo/tree-table-ellipsis.md | 129 -- components/table/demo/tree-table-ellipsis.tsx | 118 ++ components/table/demo/virtual-list.md | 143 -- components/table/demo/virtual-list.tsx | 133 ++ components/table/index.en-US.md | 265 ++- components/table/index.tsx | 8 +- components/table/index.zh-CN.md | 257 ++- .../__snapshots__/demo-extend.test.ts.snap | 34 +- .../__tests__/__snapshots__/demo.test.ts.snap | 34 +- components/tabs/demo/animated.md | 72 - components/tabs/demo/animated.tsx | 61 + components/tabs/demo/basic.md | 42 - components/tabs/demo/basic.tsx | 32 + components/tabs/demo/card-top.md | 35 - components/tabs/demo/card-top.tsx | 25 + components/tabs/demo/card.md | 33 - components/tabs/demo/card.tsx | 23 + components/tabs/demo/centered.md | 29 - components/tabs/demo/centered.tsx | 19 + components/tabs/demo/custom-add-trigger.md | 69 - components/tabs/demo/custom-add-trigger.tsx | 59 + components/tabs/demo/custom-tab-bar-node.md | 129 -- components/tabs/demo/custom-tab-bar-node.tsx | 119 ++ components/tabs/demo/custom-tab-bar.md | 40 - components/tabs/demo/custom-tab-bar.tsx | 30 + components/tabs/demo/deprecated.md | 29 - components/tabs/demo/deprecated.tsx | 18 + components/tabs/demo/disabled.md | 38 - components/tabs/demo/disabled.tsx | 28 + components/tabs/demo/editable-card.md | 81 - components/tabs/demo/editable-card.tsx | 71 + components/tabs/demo/extra.md | 70 - components/tabs/demo/extra.tsx | 60 + components/tabs/demo/icon.md | 35 - components/tabs/demo/icon.tsx | 25 + components/tabs/demo/nest.md | 112 - components/tabs/demo/nest.tsx | 101 + components/tabs/demo/position.md | 50 - components/tabs/demo/position.tsx | 40 + components/tabs/demo/size.md | 60 - components/tabs/demo/size.tsx | 50 + components/tabs/demo/slide.md | 48 - components/tabs/demo/slide.tsx | 38 + components/tabs/index.en-US.md | 25 +- components/tabs/index.tsx | 4 +- components/tabs/index.zh-CN.md | 25 +- .../__snapshots__/demo-extend.test.ts.snap | 18 +- .../__tests__/__snapshots__/demo.test.ts.snap | 18 +- components/tag/__tests__/image.test.ts | 2 +- components/tag/demo/animation.md | 113 -- components/tag/demo/animation.tsx | 103 + components/tag/demo/basic.md | 38 - components/tag/demo/basic.tsx | 28 + components/tag/demo/checkable.md | 43 - components/tag/demo/checkable.tsx | 33 + components/tag/demo/colorful-inverse.md | 34 - components/tag/demo/colorful-inverse.tsx | 23 + components/tag/demo/colorful.md | 40 - components/tag/demo/colorful.tsx | 30 + components/tag/demo/control.md | 138 -- components/tag/demo/control.tsx | 128 ++ components/tag/demo/customize.md | 27 - components/tag/demo/customize.tsx | 16 + components/tag/demo/icon.md | 37 - components/tag/demo/icon.tsx | 27 + components/tag/demo/status.md | 56 - components/tag/demo/status.tsx | 46 + components/tag/index.en-US.md | 16 +- components/tag/index.tsx | 2 +- components/tag/index.zh-CN.md | 16 +- .../__snapshots__/demo-extend.test.ts.snap | 28 +- .../__tests__/__snapshots__/demo.test.ts.snap | 28 +- components/time-picker/demo/12hours.md | 27 - components/time-picker/demo/12hours.tsx | 17 + components/time-picker/demo/addon.md | 30 - components/time-picker/demo/addon.tsx | 20 + components/time-picker/demo/basic.md | 27 - components/time-picker/demo/basic.tsx | 17 + components/time-picker/demo/bordered.md | 23 - components/time-picker/demo/bordered.tsx | 13 + components/time-picker/demo/colored-popup.md | 32 - components/time-picker/demo/colored-popup.tsx | 21 + components/time-picker/demo/disabled.md | 20 - components/time-picker/demo/disabled.tsx | 10 + components/time-picker/demo/hide-column.md | 19 - components/time-picker/demo/hide-column.tsx | 9 + .../time-picker/demo/interval-options.md | 16 - .../time-picker/demo/interval-options.tsx | 6 + components/time-picker/demo/range-picker.md | 16 - components/time-picker/demo/range-picker.tsx | 6 + components/time-picker/demo/render-panel.md | 19 - components/time-picker/demo/render-panel.tsx | 8 + components/time-picker/demo/size.md | 23 - components/time-picker/demo/size.tsx | 13 + components/time-picker/demo/status.md | 24 - components/time-picker/demo/status.tsx | 13 + components/time-picker/demo/suffix.md | 33 - components/time-picker/demo/suffix.tsx | 22 + components/time-picker/demo/value.md | 25 - components/time-picker/demo/value.tsx | 15 + components/time-picker/index.en-US.md | 21 +- components/time-picker/index.zh-CN.md | 21 +- .../__snapshots__/demo-extend.test.ts.snap | 14 +- .../__tests__/__snapshots__/demo.test.ts.snap | 14 +- components/timeline/__tests__/image.test.ts | 2 +- components/timeline/demo/alternate.md | 32 - components/timeline/demo/alternate.tsx | 22 + components/timeline/demo/basic.md | 23 - components/timeline/demo/basic.tsx | 13 + components/timeline/demo/color.md | 45 - components/timeline/demo/color.tsx | 35 + components/timeline/demo/custom.md | 26 - components/timeline/demo/custom.tsx | 16 + components/timeline/demo/label.md | 45 - components/timeline/demo/label.tsx | 35 + components/timeline/demo/pending.md | 35 - components/timeline/demo/pending.tsx | 25 + components/timeline/demo/right.md | 26 - components/timeline/demo/right.tsx | 16 + components/timeline/index.en-US.md | 14 +- components/timeline/index.tsx | 4 +- components/timeline/index.zh-CN.md | 14 +- .../__snapshots__/demo-extend.test.ts.snap | 14 +- .../__tests__/__snapshots__/demo.test.ts.snap | 14 +- .../tooltip/demo/arrow-point-at-center.md | 25 - .../tooltip/demo/arrow-point-at-center.tsx | 15 + .../tooltip/demo/auto-adjust-overflow.md | 43 - .../tooltip/demo/auto-adjust-overflow.tsx | 32 + components/tooltip/demo/basic.md | 20 - components/tooltip/demo/basic.tsx | 10 + components/tooltip/demo/colorful.md | 52 - components/tooltip/demo/colorful.tsx | 42 + .../tooltip/demo/destroy-tooltip-on-hide.md | 21 - .../tooltip/demo/destroy-tooltip-on-hide.tsx | 10 + components/tooltip/demo/placement.md | 67 - components/tooltip/demo/placement.tsx | 57 + components/tooltip/demo/render-panel.md | 25 - components/tooltip/demo/render-panel.tsx | 14 + components/tooltip/index.en-US.md | 14 +- components/tooltip/index.tsx | 5 +- components/tooltip/index.zh-CN.md | 14 +- .../__snapshots__/demo-extend.test.ts.snap | 8 +- .../__tests__/__snapshots__/demo.test.ts.snap | 8 +- components/tour/demo/basic.md | 68 - components/tour/demo/basic.tsx | 58 + components/tour/demo/non-modal.md | 68 - components/tour/demo/non-modal.tsx | 58 + components/tour/demo/placement.md | 51 - components/tour/demo/placement.tsx | 41 + components/tour/demo/render-panel.md | 49 - components/tour/demo/render-panel.tsx | 38 + components/tour/index.en-US.md | 52 +- components/tour/index.zh-CN.md | 53 +- .../__snapshots__/demo-extend.test.ts.snap | 20 +- .../__tests__/__snapshots__/demo.test.ts.snap | 20 +- components/transfer/demo/advanced.md | 92 - components/transfer/demo/advanced.tsx | 82 + components/transfer/demo/basic.md | 65 - components/transfer/demo/basic.tsx | 55 + components/transfer/demo/custom-item.md | 85 - components/transfer/demo/custom-item.tsx | 75 + .../transfer/demo/custom-select-all-labels.md | 48 - .../demo/custom-select-all-labels.tsx | 37 + components/transfer/demo/large-data.md | 73 - components/transfer/demo/large-data.tsx | 63 + components/transfer/demo/oneWay.md | 92 - components/transfer/demo/oneWay.tsx | 82 + components/transfer/demo/search.md | 73 - components/transfer/demo/search.tsx | 63 + components/transfer/demo/status.md | 22 - components/transfer/demo/status.tsx | 11 + components/transfer/demo/table-transfer.md | 172 -- components/transfer/demo/table-transfer.tsx | 162 ++ components/transfer/demo/tree-transfer.md | 98 - components/transfer/demo/tree-transfer.tsx | 88 + components/transfer/index.en-US.md | 18 +- components/transfer/index.tsx | 6 +- components/transfer/index.zh-CN.md | 18 +- .../__snapshots__/demo-extend.test.ts.snap | 20 +- .../__tests__/__snapshots__/demo.test.ts.snap | 20 +- components/tree-select/demo/async.md | 64 - components/tree-select/demo/async.tsx | 54 + components/tree-select/demo/basic.md | 68 - components/tree-select/demo/basic.tsx | 58 + components/tree-select/demo/checkable.md | 76 - components/tree-select/demo/checkable.tsx | 66 + components/tree-select/demo/multiple.md | 70 - components/tree-select/demo/multiple.tsx | 60 + components/tree-select/demo/placement.md | 80 - components/tree-select/demo/placement.tsx | 70 + components/tree-select/demo/render-panel.md | 42 - components/tree-select/demo/render-panel.tsx | 31 + components/tree-select/demo/status.md | 27 - components/tree-select/demo/status.tsx | 16 + components/tree-select/demo/suffix.md | 74 - components/tree-select/demo/suffix.tsx | 63 + components/tree-select/demo/treeData.md | 56 - components/tree-select/demo/treeData.tsx | 46 + components/tree-select/demo/treeLine.md | 75 - components/tree-select/demo/treeLine.tsx | 65 + components/tree-select/index.en-US.md | 17 +- components/tree-select/index.zh-CN.md | 17 +- .../__snapshots__/demo-extend.test.ts.snap | 20 +- .../__tests__/__snapshots__/demo.test.ts.snap | 20 +- components/tree/__tests__/demo-extend.test.ts | 2 +- components/tree/__tests__/demo.test.ts | 2 +- components/tree/__tests__/image.test.ts | 2 +- components/tree/demo/basic-controlled.md | 98 - components/tree/demo/basic-controlled.tsx | 88 + components/tree/demo/basic.md | 67 - components/tree/demo/basic.tsx | 57 + components/tree/demo/big-data.md | 37 - components/tree/demo/big-data.tsx | 26 + components/tree/demo/customized-icon.md | 52 - components/tree/demo/customized-icon.tsx | 42 + components/tree/demo/directory.md | 56 - components/tree/demo/directory.tsx | 46 + components/tree/demo/drag-debug.md | 187 +- components/tree/demo/drag-debug.tsx | 177 ++ components/tree/demo/draggable.md | 131 -- components/tree/demo/draggable.tsx | 121 ++ components/tree/demo/dynamic.md | 69 - components/tree/demo/dynamic.tsx | 59 + components/tree/demo/line.md | 129 -- components/tree/demo/line.tsx | 119 ++ components/tree/demo/search.md | 141 -- components/tree/demo/search.tsx | 131 ++ components/tree/demo/switcher-icon.md | 83 - components/tree/demo/switcher-icon.tsx | 73 + components/tree/demo/virtual-scroll.md | 37 - components/tree/demo/virtual-scroll.tsx | 27 + components/tree/index.en-US.md | 19 +- components/tree/index.tsx | 11 +- components/tree/index.zh-CN.md | 19 +- .../__snapshots__/demo-extend.test.ts.snap | 22 +- .../__tests__/__snapshots__/demo.test.ts.snap | 22 +- components/typography/demo/basic.md | 105 - components/typography/demo/basic.tsx | 95 + components/typography/demo/ellipsis-debug.md | 98 - components/typography/demo/ellipsis-debug.tsx | 87 + components/typography/demo/ellipsis-middle.md | 37 - .../typography/demo/ellipsis-middle.tsx | 27 + components/typography/demo/ellipsis.md | 56 - components/typography/demo/ellipsis.tsx | 46 + components/typography/demo/interactive.md | 164 -- components/typography/demo/interactive.tsx | 155 ++ components/typography/demo/paragraph-debug.md | 111 - .../typography/demo/paragraph-debug.tsx | 100 + components/typography/demo/suffix.md | 42 - components/typography/demo/suffix.tsx | 32 + components/typography/demo/text.md | 37 - components/typography/demo/text.tsx | 27 + components/typography/demo/title.md | 26 - components/typography/demo/title.tsx | 16 + components/typography/index.en-US.md | 163 +- components/typography/index.zh-CN.md | 163 +- .../__snapshots__/demo-extend.test.ts.snap | 38 +- .../__tests__/__snapshots__/demo.test.ts.snap | 38 +- components/upload/demo/avatar.md | 75 - components/upload/demo/avatar.tsx | 65 + components/upload/demo/basic.md | 40 - components/upload/demo/basic.tsx | 30 + components/upload/demo/crop-image.md | 60 - components/upload/demo/crop-image.tsx | 50 + .../upload/demo/customize-progress-bar.md | 48 - .../upload/demo/customize-progress-bar.tsx | 38 + components/upload/demo/defaultFileList.md | 53 - components/upload/demo/defaultFileList.tsx | 43 + components/upload/demo/directory.md | 21 - components/upload/demo/directory.tsx | 11 + components/upload/demo/drag-sorting.md | 145 -- components/upload/demo/drag-sorting.tsx | 135 ++ components/upload/demo/drag.md | 51 - components/upload/demo/drag.tsx | 41 + components/upload/demo/file-type.md | 132 -- components/upload/demo/file-type.tsx | 121 ++ components/upload/demo/fileList.md | 58 - components/upload/demo/fileList.tsx | 48 + components/upload/demo/max-count.md | 35 - components/upload/demo/max-count.tsx | 25 + components/upload/demo/picture-card.md | 107 - components/upload/demo/picture-card.tsx | 97 + components/upload/demo/picture-style.md | 59 - components/upload/demo/picture-style.tsx | 49 + components/upload/demo/preview-file.md | 37 - components/upload/demo/preview-file.tsx | 27 + components/upload/demo/transform-file.md | 49 - components/upload/demo/transform-file.tsx | 39 + .../upload/demo/upload-custom-action-icon.md | 59 - .../upload/demo/upload-custom-action-icon.tsx | 49 + components/upload/demo/upload-manually.md | 77 - components/upload/demo/upload-manually.tsx | 67 + components/upload/demo/upload-png-only.md | 35 - components/upload/demo/upload-png-only.tsx | 25 + .../upload/demo/upload-with-aliyun-oss.md | 120 -- .../upload/demo/upload-with-aliyun-oss.tsx | 110 + components/upload/index.en-US.md | 26 +- components/upload/index.tsx | 10 +- components/upload/index.zh-CN.md | 26 +- docs/resources.en-US.md | 15 +- docs/resources.zh-CN.md | 15 +- docs/spec/alignment.en-US.md | 2 +- docs/spec/alignment.zh-CN.md | 2 +- docs/spec/buttons.en-US.md | 2 +- docs/spec/buttons.zh-CN.md | 2 +- docs/spec/cases.en-US.md | 2 +- docs/spec/cases.zh-CN.md | 2 +- docs/spec/colors.en-US.md | 4 +- docs/spec/colors.zh-CN.md | 4 +- docs/spec/contrast.en-US.md | 2 +- docs/spec/contrast.zh-CN.md | 2 +- docs/spec/copywriting.en-US.md | 2 +- docs/spec/copywriting.zh-CN.md | 2 +- docs/spec/dark.en-US.md | 2 +- docs/spec/dark.zh-CN.md | 2 +- docs/spec/data-display.en-US.md | 2 +- docs/spec/data-display.zh-CN.md | 2 +- docs/spec/data-entry.en-US.md | 2 +- docs/spec/data-entry.zh-CN.md | 2 +- docs/spec/data-format.en-US.md | 2 +- docs/spec/data-format.zh-CN.md | 2 +- .../spec/{data-list.md => data-list.en-US.md} | 12 +- docs/spec/data-list.zh-CN.md | 164 ++ docs/spec/detail-page.en-US.md | 2 +- docs/spec/detail-page.zh-CN.md | 2 +- docs/spec/direct.en-US.md | 2 +- docs/spec/direct.zh-CN.md | 2 +- docs/spec/feedback.en-US.md | 2 +- docs/spec/feedback.zh-CN.md | 2 +- docs/spec/font.en-US.md | 2 +- docs/spec/font.zh-CN.md | 2 +- .../spec/{form-page.md => form-page.en-US.md} | 12 +- docs/spec/form-page.zh-CN.md | 202 ++ docs/spec/icon.en-US.md | 2 +- docs/spec/icon.zh-CN.md | 2 +- docs/spec/illustration.en-US.md | 4 +- docs/spec/illustration.zh-CN.md | 4 +- docs/spec/introduce.en-US.md | 4 +- docs/spec/introduce.zh-CN.md | 4 +- docs/spec/invitation.en-US.md | 2 +- docs/spec/invitation.zh-CN.md | 2 +- docs/spec/layout.en-US.md | 2 +- docs/spec/layout.zh-CN.md | 2 +- docs/spec/lightweight.en-US.md | 2 +- docs/spec/lightweight.zh-CN.md | 2 +- docs/spec/navigation.en-US.md | 2 +- docs/spec/navigation.zh-CN.md | 2 +- docs/spec/overview.en-US.md | 4 +- docs/spec/overview.zh-CN.md | 4 +- docs/spec/proximity.en-US.md | 2 +- docs/spec/proximity.zh-CN.md | 2 +- docs/spec/reaction.en-US.md | 2 +- docs/spec/reaction.zh-CN.md | 2 +- docs/spec/repetition.en-US.md | 2 +- docs/spec/repetition.zh-CN.md | 2 +- docs/spec/research-empty.en-US.md | 2 +- docs/spec/research-empty.zh-CN.md | 2 +- docs/spec/research-exception.en-US.md | 2 +- docs/spec/research-exception.zh-CN.md | 2 +- docs/spec/research-form.en-US.md | 2 +- docs/spec/research-form.zh-CN.md | 2 +- docs/spec/research-list.en-US.md | 2 +- docs/spec/research-list.zh-CN.md | 2 +- .../research-message-and-feedback.en-US.md | 2 +- .../research-message-and-feedback.zh-CN.md | 2 +- docs/spec/research-navigation.en-US.md | 2 +- docs/spec/research-navigation.zh-CN.md | 2 +- docs/spec/research-overview.en-US.md | 4 +- docs/spec/research-overview.zh-CN.md | 4 +- docs/spec/research-result.en-US.md | 2 +- docs/spec/research-result.zh-CN.md | 2 +- docs/spec/research-workbench.en-US.md | 2 +- docs/spec/research-workbench.zh-CN.md | 2 +- docs/spec/shadow.en-US.md | 2 +- docs/spec/shadow.zh-CN.md | 2 +- docs/spec/stay.en-US.md | 2 +- docs/spec/stay.zh-CN.md | 2 +- docs/spec/transition.en-US.md | 2 +- docs/spec/transition.zh-CN.md | 2 +- docs/spec/values.en-US.md | 2 +- docs/spec/values.zh-CN.md | 2 +- docs/spec/visualization-page.en-US.md | 2 +- docs/spec/visualization-page.zh-CN.md | 2 +- package.json | 43 +- scripts/migrate.js | 206 ++ site/.eslintrc.js | 11 - site/antd.js | 1 - site/bisheng.config.js | 190 -- site/theme/en-US.d.ts | 9 - site/theme/en-US.js | 149 -- site/theme/index-css-only.js | 19 - site/theme/index.js | 106 - site/theme/static/colors.less | 269 --- site/theme/static/common.less | 312 --- site/theme/static/contributors.less | 11 - site/theme/static/dark.less | 407 ---- site/theme/static/demo.less | 366 ---- site/theme/static/design-doc.less | 18 - site/theme/static/docsearch.less | 28 - site/theme/static/footer.less | 34 - site/theme/static/header.less | 47 - site/theme/static/highlight.less | 141 -- site/theme/static/home.less | 2 - site/theme/static/icon-pic-searcher.less | 56 - site/theme/static/icons.less | 94 - site/theme/static/index.less | 27 - site/theme/static/markdown.less | 522 ----- site/theme/static/mock-browser.less | 53 - site/theme/static/motion.less | 41 - site/theme/static/not-found.less | 34 - site/theme/static/nprogress.less | 14 - site/theme/static/page-nav.less | 102 - site/theme/static/preview-img.less | 220 -- site/theme/static/reset.less | 46 - site/theme/static/responsive.less | 341 ---- site/theme/static/rtl.less | 13 - site/theme/static/template.html | 220 -- site/theme/static/theme.less | 9 - site/theme/static/toc.less | 103 - site/theme/style/color/bezierEasing.less | 110 - site/theme/style/color/colorPalette.less | 85 - site/theme/style/color/colors.less | 162 -- site/theme/style/color/tinyColor.less | 1184 ----------- site/theme/style/compact.less | 4 - site/theme/style/core/global.less | 491 ----- site/theme/style/core/iconfont.less | 22 - site/theme/style/core/index.less | 3 - site/theme/style/dark.less | 4 - site/theme/style/default.less | 4 - site/theme/style/index.less | 1 - site/theme/style/index.tsx | 1 - site/theme/style/mixins/box.less | 7 - site/theme/style/mixins/clearfix.less | 16 - site/theme/style/mixins/compatibility.less | 13 - site/theme/style/mixins/index.less | 7 - site/theme/style/mixins/modal-mask.less | 30 - site/theme/style/mixins/operation-unit.less | 15 - site/theme/style/mixins/reset.less | 11 - site/theme/style/mixins/rounded-arrow.less | 44 - site/theme/style/mixins/size.less | 10 - site/theme/style/themes/compact.less | 0 site/theme/style/themes/dark.less | 0 site/theme/style/themes/default.less | 1084 ---------- site/theme/style/themes/index.less | 7 - site/theme/style/themes/variable.less | 1139 ----------- site/theme/style/variable.less | 4 - site/theme/template/AppShell.tsx | 10 - site/theme/template/BrowserFrame.tsx | 11 - site/theme/template/Color/ColorBlock.jsx | 36 - .../theme/template/Color/ColorPaletteTool.jsx | 61 - .../template/Color/ColorPaletteToolDark.jsx | 107 - site/theme/template/Color/ColorPalettes.jsx | 94 - site/theme/template/Color/ColorPatterns.jsx | 11 - site/theme/template/Color/ColorPicker.tsx | 126 -- site/theme/template/Color/Palette.jsx | 89 - site/theme/template/Content/Article.tsx | 170 -- site/theme/template/Content/ComponentDoc.jsx | 243 --- .../template/Content/ComponentOverview.jsx | 153 -- .../template/Content/ComponentOverview.less | 48 - site/theme/template/Content/EditButton.tsx | 25 - site/theme/template/Content/MainContent.jsx | 558 ----- site/theme/template/Content/PrevAndNext.jsx | 18 - site/theme/template/Content/ThemeIcon.jsx | 20 - site/theme/template/Content/index.jsx | 30 - .../template/Home/Banner/Background.less | 35 - .../theme/template/Home/Banner/Background.tsx | 186 -- site/theme/template/Home/Banner/Logo.less | 46 - site/theme/template/Home/Banner/Logo.tsx | 114 -- site/theme/template/Home/Banner/index.less | 137 -- site/theme/template/Home/Banner/index.tsx | 51 - .../template/Home/DesignPage/Certainty.tsx | 61 - .../theme/template/Home/DesignPage/Growth.tsx | 101 - .../Home/DesignPage/InteractiveIcon.tsx | 46 - .../template/Home/DesignPage/Meaningful.tsx | 86 - .../template/Home/DesignPage/Natural.tsx | 125 -- .../theme/template/Home/DesignPage/index.less | 197 -- site/theme/template/Home/DesignPage/index.tsx | 306 --- site/theme/template/Home/MorePage.less | 73 - site/theme/template/Home/MorePage.tsx | 58 - site/theme/template/Home/RecommendPage.less | 141 -- site/theme/template/Home/RecommendPage.tsx | 75 - site/theme/template/Home/index.less | 80 - site/theme/template/Home/index.tsx | 93 - site/theme/template/Icon/index.tsx | 41 - site/theme/template/Icon/utils.ts | 45 - .../template/Layout/DynamicTheme/Diff.tsx | 36 - .../template/Layout/DynamicTheme/Preview.tsx | 176 -- .../template/Layout/DynamicTheme/Token.tsx | 178 -- .../template/Layout/DynamicTheme/index.tsx | 159 -- .../Layout/DynamicTheme/validateCheck.ts | 62 - .../template/Layout/Header/DocSearch.less | 32 - site/theme/template/Layout/Header/Github.less | 51 - site/theme/template/Layout/Header/Github.tsx | 21 - site/theme/template/Layout/Header/Logo.less | 41 - site/theme/template/Layout/Header/Logo.tsx | 21 - .../template/Layout/Header/Navigation.less | 83 - .../template/Layout/Header/SearchBar.less | 191 -- site/theme/template/Layout/Header/index.less | 54 - site/theme/template/Layout/Header/index.tsx | 342 ---- site/theme/template/Layout/index.tsx | 358 ---- site/theme/template/Resources/AffixTabs.less | 38 - .../template/Resources/Articles/index.less | 47 - site/theme/template/Resources/index.less | 152 -- site/theme/template/Resources/index.tsx | 167 -- site/theme/zh-CN.d.ts | 9 - site/theme/zh-CN.js | 144 -- site/themeConfig.d.ts | 11 - tests/shared/demoTest.tsx | 9 +- tests/shared/imageTest.tsx | 2 +- tsconfig.json | 2 +- 2006 files changed, 45330 insertions(+), 58438 deletions(-) create mode 100644 .dumi/hooks/useLocale.tsx create mode 100644 .dumi/hooks/useLocation.ts create mode 100644 .dumi/hooks/useMenu.tsx create mode 100644 .dumi/hooks/useSiteToken.ts rename site/theme/template/NotFound.tsx => .dumi/pages/404/index.tsx (71%) create mode 100644 .dumi/pages/index-cn/index.tsx create mode 100644 .dumi/pages/index/components/Banner.tsx create mode 100644 .dumi/pages/index/components/BannerRecommends.tsx create mode 100644 .dumi/pages/index/components/ComponentsList.tsx create mode 100644 .dumi/pages/index/components/DesignFramework.tsx create mode 100644 .dumi/pages/index/components/Group.tsx create mode 100644 .dumi/pages/index/components/RecommendsOld.tsx create mode 100644 .dumi/pages/index/components/Theme/BackgroundImage.tsx create mode 100644 .dumi/pages/index/components/Theme/ColorPicker.tsx create mode 100644 .dumi/pages/index/components/Theme/RadiusPicker.tsx create mode 100644 .dumi/pages/index/components/Theme/ThemePicker.tsx create mode 100644 .dumi/pages/index/components/Theme/colorUtil.ts create mode 100644 .dumi/pages/index/components/Theme/index.tsx rename {site/theme/template/Home => .dumi/pages/index/components}/util.tsx (100%) create mode 100644 .dumi/pages/index/index.tsx create mode 100644 .dumi/pages/theme-editor-cn/index.tsx create mode 100644 .dumi/pages/theme-editor/index.tsx create mode 100644 .dumi/rehypeAntd.ts create mode 100644 .dumi/theme/antd.js create mode 100644 .dumi/theme/builtins/APITable/index.tsx create mode 100644 .dumi/theme/builtins/ComponentOverview/ProComponentsList.ts create mode 100644 .dumi/theme/builtins/ComponentOverview/index.tsx create mode 100644 .dumi/theme/builtins/DemoWrapper/index.tsx rename {site/theme/template/IconDisplay => .dumi/theme/builtins/IconSearch}/Category.tsx (85%) rename {site/theme/template/IconDisplay => .dumi/theme/builtins/IconSearch}/CopyableIcon.tsx (100%) rename {site/theme/template/IconDisplay => .dumi/theme/builtins/IconSearch}/IconPicSearcher.tsx (83%) rename {site/theme/template/IconDisplay => .dumi/theme/builtins/IconSearch}/fields.ts (99%) rename {site/theme/template/IconDisplay => .dumi/theme/builtins/IconSearch}/index.tsx (79%) rename {site/theme/template/IconDisplay => .dumi/theme/builtins/IconSearch}/themeIcons.tsx (65%) create mode 100644 .dumi/theme/builtins/Previewer/fromDumiProps.tsx rename {site/theme/template/Content/Demo => .dumi/theme/builtins/Previewer}/index.jsx (96%) rename {site/theme/template/Resources/Articles => .dumi/theme/builtins/ResourceArticles}/index.tsx (51%) create mode 100644 .dumi/theme/builtins/ResourceCards/index.tsx create mode 100644 .dumi/theme/common/BrowserFrame.jsx rename {site/theme/template/Content/Demo => .dumi/theme/common}/CodePenIcon.jsx (100%) rename {site/theme/template/Content/Demo => .dumi/theme/common}/CodePreview.jsx (100%) rename {site/theme/template/Content/Demo => .dumi/theme/common}/CodeSandboxIcon.jsx (100%) create mode 100644 .dumi/theme/common/CommonHelmet.tsx create mode 100644 .dumi/theme/common/EditButton.tsx create mode 100644 .dumi/theme/common/GlobalStyles.tsx rename {site/theme/template/Components => .dumi/theme/common}/Helmet.tsx (100%) create mode 100644 .dumi/theme/common/PrevAndNext.tsx rename {site/theme/template/Content/Demo => .dumi/theme/common}/RiddleIcon.jsx (100%) create mode 100644 .dumi/theme/layouts/DocLayout/index.tsx create mode 100644 .dumi/theme/layouts/GlobalLayout.tsx rename {site/theme/template/Resources => .dumi/theme/layouts/ResourceLayout}/AffixTabs.tsx (63%) create mode 100644 .dumi/theme/layouts/ResourceLayout/index.tsx create mode 100644 .dumi/theme/layouts/SidebarLayout/index.tsx create mode 100644 .dumi/theme/locales/en-US.json create mode 100644 .dumi/theme/locales/zh-CN.json create mode 100644 .dumi/theme/plugin.ts create mode 100644 .dumi/theme/slots/Content/index.tsx create mode 100644 .dumi/theme/slots/DemoContext.tsx rename site/theme/template/Layout/Footer.tsx => .dumi/theme/slots/Footer/index.tsx (81%) create mode 100644 .dumi/theme/slots/Header/Github.tsx create mode 100644 .dumi/theme/slots/Header/Logo.tsx rename {site/theme/template/Layout => .dumi/theme/slots}/Header/More.tsx (67%) rename {site/theme/template/Layout => .dumi/theme/slots}/Header/Navigation.tsx (66%) rename {site/theme/template/Layout => .dumi/theme/slots}/Header/SearchBar.tsx (63%) rename {site/theme/template/Layout => .dumi/theme/slots}/Header/algolia-config.ts (100%) create mode 100644 .dumi/theme/slots/Header/index.tsx rename {site/theme/template/Layout => .dumi/theme/slots}/Header/interface.tsx (76%) create mode 100644 .dumi/theme/slots/Sidebar/index.tsx rename {site/theme/template/Layout => .dumi/theme/slots}/SiteContext.tsx (67%) create mode 100644 .dumi/theme/slots/ThemeContext.tsx rename {site => .dumi}/theme/static/style.js (71%) rename site/themeConfig.js => .dumi/theme/themeConfig.ts (95%) rename {site/theme/template => .dumi/theme}/utils.tsx (96%) create mode 100644 .dumi/tsconfig.json create mode 100644 .dumirc.ts create mode 100644 .surgeignore create mode 100644 components/affix/demo/basic.tsx create mode 100644 components/affix/demo/debug.tsx create mode 100644 components/affix/demo/on-change.tsx create mode 100644 components/affix/demo/target.tsx create mode 100644 components/alert/demo/action.tsx create mode 100644 components/alert/demo/banner.tsx create mode 100644 components/alert/demo/basic.tsx create mode 100644 components/alert/demo/closable.tsx create mode 100644 components/alert/demo/close-text.tsx create mode 100644 components/alert/demo/custom-icon.tsx create mode 100644 components/alert/demo/description.tsx create mode 100644 components/alert/demo/error-boundary.tsx create mode 100644 components/alert/demo/icon.tsx create mode 100644 components/alert/demo/loop-banner.tsx create mode 100644 components/alert/demo/smooth-closed.tsx create mode 100644 components/alert/demo/style.tsx create mode 100644 components/anchor/demo/basic.tsx create mode 100644 components/anchor/demo/customizeHighlight.tsx create mode 100644 components/anchor/demo/onChange.tsx create mode 100644 components/anchor/demo/onClick.tsx create mode 100644 components/anchor/demo/static.tsx create mode 100644 components/anchor/demo/targetOffset.tsx create mode 100644 components/auto-complete/demo/basic.tsx create mode 100644 components/auto-complete/demo/certain-category.tsx create mode 100644 components/auto-complete/demo/custom.tsx create mode 100644 components/auto-complete/demo/form-debug.tsx create mode 100644 components/auto-complete/demo/non-case-sensitive.tsx create mode 100644 components/auto-complete/demo/options.tsx create mode 100644 components/auto-complete/demo/render-panel.tsx create mode 100644 components/auto-complete/demo/status.tsx create mode 100644 components/auto-complete/demo/uncertain-category.tsx create mode 100644 components/avatar/demo/badge.tsx create mode 100644 components/avatar/demo/basic.tsx create mode 100644 components/avatar/demo/dynamic.tsx create mode 100644 components/avatar/demo/fallback.tsx create mode 100644 components/avatar/demo/group.tsx create mode 100644 components/avatar/demo/responsive.tsx create mode 100644 components/avatar/demo/toggle-debug.tsx create mode 100644 components/avatar/demo/type.tsx create mode 100644 components/back-top/demo/basic.tsx create mode 100644 components/back-top/demo/custom.tsx create mode 100644 components/badge/demo/basic.tsx create mode 100644 components/badge/demo/change.tsx create mode 100644 components/badge/demo/colorful-with-count-debug.tsx create mode 100644 components/badge/demo/colorful.tsx create mode 100644 components/badge/demo/dot.tsx create mode 100644 components/badge/demo/link.tsx create mode 100644 components/badge/demo/mix.tsx create mode 100644 components/badge/demo/no-wrapper.tsx create mode 100644 components/badge/demo/offset.tsx create mode 100644 components/badge/demo/overflow.tsx create mode 100644 components/badge/demo/ribbbon.tsx create mode 100644 components/badge/demo/ribbon-debug.tsx create mode 100644 components/badge/demo/size.tsx create mode 100644 components/badge/demo/status.tsx create mode 100644 components/badge/demo/title.tsx create mode 100644 components/breadcrumb/demo/basic.tsx create mode 100644 components/breadcrumb/demo/overlay.tsx create mode 100644 components/breadcrumb/demo/react-router.tsx create mode 100644 components/breadcrumb/demo/separator-component.tsx create mode 100644 components/breadcrumb/demo/separator.tsx create mode 100644 components/breadcrumb/demo/withIcon.tsx create mode 100644 components/button/demo/basic.tsx create mode 100644 components/button/demo/block.tsx create mode 100644 components/button/demo/chinese-chars-loading.tsx create mode 100644 components/button/demo/danger.tsx create mode 100644 components/button/demo/disabled.tsx create mode 100644 components/button/demo/ghost.tsx create mode 100644 components/button/demo/icon.tsx create mode 100644 components/button/demo/legacy-group.tsx create mode 100644 components/button/demo/loading.tsx create mode 100644 components/button/demo/multiple.tsx create mode 100644 components/button/demo/size.tsx create mode 100644 components/calendar/demo/basic.tsx create mode 100644 components/calendar/demo/card.tsx create mode 100644 components/calendar/demo/customize-header.tsx create mode 100644 components/calendar/demo/notice-calendar.tsx create mode 100644 components/calendar/demo/select.tsx create mode 100644 components/card/demo/basic.tsx create mode 100644 components/card/demo/border-less.tsx create mode 100644 components/card/demo/flexible-content.tsx create mode 100644 components/card/demo/grid-card.tsx create mode 100644 components/card/demo/in-column.tsx create mode 100644 components/card/demo/inner.tsx create mode 100644 components/card/demo/loading.tsx create mode 100644 components/card/demo/meta.tsx create mode 100644 components/card/demo/simple.tsx create mode 100644 components/card/demo/tabs.tsx create mode 100644 components/carousel/demo/autoplay.tsx create mode 100644 components/carousel/demo/basic.tsx create mode 100644 components/carousel/demo/fade.tsx create mode 100644 components/carousel/demo/position.tsx create mode 100644 components/cascader/demo/basic.tsx create mode 100644 components/cascader/demo/change-on-select.tsx create mode 100644 components/cascader/demo/custom-dropdown.tsx create mode 100644 components/cascader/demo/custom-render.tsx create mode 100644 components/cascader/demo/custom-trigger.tsx create mode 100644 components/cascader/demo/default-value.tsx create mode 100644 components/cascader/demo/disabled-option.tsx create mode 100644 components/cascader/demo/fields-name.tsx create mode 100644 components/cascader/demo/hover.tsx create mode 100644 components/cascader/demo/lazy.tsx create mode 100644 components/cascader/demo/multiple.tsx create mode 100644 components/cascader/demo/placement.tsx create mode 100644 components/cascader/demo/render-panel.tsx create mode 100644 components/cascader/demo/search.tsx create mode 100644 components/cascader/demo/showCheckedStrategy.tsx create mode 100644 components/cascader/demo/size.tsx create mode 100644 components/cascader/demo/status.tsx create mode 100644 components/cascader/demo/suffix.tsx create mode 100644 components/checkbox/demo/basic.tsx create mode 100644 components/checkbox/demo/check-all.tsx create mode 100644 components/checkbox/demo/controller.tsx create mode 100644 components/checkbox/demo/debug-line.tsx create mode 100644 components/checkbox/demo/disabled.tsx create mode 100644 components/checkbox/demo/group.tsx create mode 100644 components/checkbox/demo/layout.tsx create mode 100644 components/collapse/demo/accordion.tsx create mode 100644 components/collapse/demo/basic.tsx create mode 100644 components/collapse/demo/borderless.tsx create mode 100644 components/collapse/demo/collapsible.tsx create mode 100644 components/collapse/demo/custom.tsx create mode 100644 components/collapse/demo/extra.tsx create mode 100644 components/collapse/demo/ghost.tsx create mode 100644 components/collapse/demo/mix.tsx create mode 100644 components/collapse/demo/noarrow.tsx create mode 100644 components/config-provider/demo/direction.tsx create mode 100644 components/config-provider/demo/locale.tsx create mode 100644 components/config-provider/demo/prefixCls.tsx create mode 100644 components/config-provider/demo/size.tsx create mode 100644 components/config-provider/demo/theme.tsx create mode 100644 components/date-picker/demo/basic.tsx create mode 100644 components/date-picker/demo/bordered.tsx create mode 100644 components/date-picker/demo/date-render.tsx create mode 100644 components/date-picker/demo/disabled-date.tsx create mode 100644 components/date-picker/demo/disabled.tsx create mode 100644 components/date-picker/demo/extra-footer.tsx create mode 100644 components/date-picker/demo/format.tsx create mode 100644 components/date-picker/demo/mode.tsx create mode 100644 components/date-picker/demo/placement.tsx create mode 100644 components/date-picker/demo/presetted-ranges.tsx create mode 100644 components/date-picker/demo/range-picker.tsx create mode 100644 components/date-picker/demo/render-panel.tsx create mode 100644 components/date-picker/demo/select-in-range.tsx create mode 100644 components/date-picker/demo/size.tsx create mode 100644 components/date-picker/demo/start-end.tsx create mode 100644 components/date-picker/demo/status.tsx create mode 100644 components/date-picker/demo/suffix.tsx create mode 100644 components/date-picker/demo/switchable.tsx create mode 100644 components/date-picker/demo/time.tsx create mode 100644 components/descriptions/demo/basic.tsx create mode 100644 components/descriptions/demo/border.tsx create mode 100644 components/descriptions/demo/responsive.tsx create mode 100644 components/descriptions/demo/size.tsx create mode 100644 components/descriptions/demo/style.tsx create mode 100644 components/descriptions/demo/text.tsx create mode 100644 components/descriptions/demo/vertical-border.tsx create mode 100644 components/descriptions/demo/vertical.tsx create mode 100644 components/divider/demo/customize-style.tsx create mode 100644 components/divider/demo/horizontal.tsx create mode 100644 components/divider/demo/plain.tsx create mode 100644 components/divider/demo/vertical.tsx create mode 100644 components/divider/demo/with-text.tsx create mode 100644 components/drawer/demo/basic-right.tsx create mode 100644 components/drawer/demo/config-provider.tsx create mode 100644 components/drawer/demo/extra.tsx create mode 100644 components/drawer/demo/form-in-drawer.tsx create mode 100644 components/drawer/demo/multi-level-drawer.tsx create mode 100644 components/drawer/demo/no-mask.tsx create mode 100644 components/drawer/demo/placement.tsx create mode 100644 components/drawer/demo/render-in-current.tsx create mode 100644 components/drawer/demo/render-panel.tsx create mode 100644 components/drawer/demo/scroll-debug.tsx create mode 100644 components/drawer/demo/size.tsx create mode 100644 components/drawer/demo/user-profile.tsx create mode 100644 components/dropdown/demo/arrow-center.tsx create mode 100644 components/dropdown/demo/arrow.tsx create mode 100644 components/dropdown/demo/basic.tsx create mode 100644 components/dropdown/demo/context-menu.tsx create mode 100644 components/dropdown/demo/custom-dropdown.tsx create mode 100644 components/dropdown/demo/deprecated.tsx create mode 100644 components/dropdown/demo/dropdown-button.tsx create mode 100644 components/dropdown/demo/event.tsx create mode 100644 components/dropdown/demo/item.tsx create mode 100644 components/dropdown/demo/loading.tsx create mode 100644 components/dropdown/demo/menu-full.tsx create mode 100644 components/dropdown/demo/overlay-open.tsx create mode 100644 components/dropdown/demo/placement.tsx create mode 100644 components/dropdown/demo/render-panel.tsx create mode 100644 components/dropdown/demo/selectable.tsx create mode 100644 components/dropdown/demo/sub-menu.tsx create mode 100644 components/dropdown/demo/trigger.tsx create mode 100644 components/empty/demo/basic.tsx create mode 100644 components/empty/demo/config-provider.tsx create mode 100644 components/empty/demo/customize.tsx create mode 100644 components/empty/demo/description.tsx create mode 100644 components/empty/demo/simple.tsx create mode 100644 components/float-button/demo/back-top.tsx create mode 100644 components/float-button/demo/basic.tsx create mode 100644 components/float-button/demo/description.tsx create mode 100644 components/float-button/demo/group-menu.tsx create mode 100644 components/float-button/demo/group.tsx create mode 100644 components/float-button/demo/render-panel.tsx create mode 100644 components/float-button/demo/shape.tsx create mode 100644 components/float-button/demo/tooltip.tsx create mode 100644 components/float-button/demo/type.tsx create mode 100644 components/form/demo/advanced-search.tsx create mode 100644 components/form/demo/basic.tsx create mode 100644 components/form/demo/col-24-debug.tsx create mode 100644 components/form/demo/complex-form-control.tsx create mode 100644 components/form/demo/control-hooks.tsx create mode 100644 components/form/demo/control-ref.tsx create mode 100644 components/form/demo/customized-form-controls.tsx create mode 100644 components/form/demo/dep-debug.tsx create mode 100644 components/form/demo/disabled-input-debug.tsx create mode 100644 components/form/demo/disabled.tsx create mode 100644 components/form/demo/dynamic-form-item.tsx create mode 100644 components/form/demo/dynamic-form-items-complex.tsx create mode 100644 components/form/demo/dynamic-form-items-no-style.tsx create mode 100644 components/form/demo/dynamic-form-items.tsx create mode 100644 components/form/demo/dynamic-rule.tsx create mode 100644 components/form/demo/form-context.tsx create mode 100644 components/form/demo/form-in-modal.tsx create mode 100644 components/form/demo/global-state.tsx create mode 100644 components/form/demo/inline-login.tsx create mode 100644 components/form/demo/label-debug.tsx create mode 100644 components/form/demo/layout-can-wrap.tsx create mode 100644 components/form/demo/layout.tsx create mode 100644 components/form/demo/nest-messages.tsx create mode 100644 components/form/demo/normal-login.tsx create mode 100644 components/form/demo/ref-item.tsx create mode 100644 components/form/demo/register.tsx create mode 100644 components/form/demo/required-mark.tsx create mode 100644 components/form/demo/size.tsx create mode 100644 components/form/demo/time-related-controls.tsx create mode 100644 components/form/demo/useWatch.tsx create mode 100644 components/form/demo/validate-other.tsx create mode 100644 components/form/demo/validate-static.tsx create mode 100644 components/form/demo/warning-only.tsx create mode 100644 components/form/demo/without-form-create.tsx create mode 100644 components/grid/demo/basic.tsx create mode 100644 components/grid/demo/flex-align.tsx create mode 100644 components/grid/demo/flex-order.tsx create mode 100644 components/grid/demo/flex-stretch.tsx create mode 100644 components/grid/demo/flex.tsx create mode 100644 components/grid/demo/gutter.tsx create mode 100644 components/grid/demo/offset.tsx create mode 100644 components/grid/demo/playground.tsx create mode 100644 components/grid/demo/responsive-more.tsx create mode 100644 components/grid/demo/responsive.tsx create mode 100644 components/grid/demo/sort.tsx create mode 100644 components/grid/demo/useBreakpoint.tsx create mode 100644 components/icon/demo/basic.tsx create mode 100644 components/icon/demo/custom.tsx create mode 100644 components/icon/demo/iconfont.tsx create mode 100644 components/icon/demo/scriptUrl.tsx create mode 100644 components/icon/demo/two-tone.tsx create mode 100644 components/image/demo/basic.tsx create mode 100644 components/image/demo/controlled-preview.tsx create mode 100644 components/image/demo/fallback.tsx create mode 100644 components/image/demo/placeholder.tsx create mode 100644 components/image/demo/preview-group-top-progress.tsx create mode 100644 components/image/demo/preview-group-visible.tsx create mode 100644 components/image/demo/preview-group.tsx create mode 100644 components/image/demo/preview-mask.tsx create mode 100644 components/image/demo/previewSrc.tsx create mode 100644 components/input-number/demo/addon.tsx create mode 100644 components/input-number/demo/basic.tsx create mode 100644 components/input-number/demo/borderless.tsx create mode 100644 components/input-number/demo/controls.tsx create mode 100644 components/input-number/demo/debug-token.tsx create mode 100644 components/input-number/demo/digit.tsx create mode 100644 components/input-number/demo/disabled.tsx create mode 100644 components/input-number/demo/formatter.tsx create mode 100644 components/input-number/demo/keyboard.tsx create mode 100644 components/input-number/demo/out-of-range.tsx create mode 100644 components/input-number/demo/prefix.tsx create mode 100644 components/input-number/demo/render-panel.tsx create mode 100644 components/input-number/demo/size.tsx create mode 100644 components/input-number/demo/status.tsx create mode 100644 components/input/demo/addon.tsx create mode 100644 components/input/demo/align.tsx create mode 100644 components/input/demo/allowClear.tsx create mode 100644 components/input/demo/autosize-textarea.tsx create mode 100644 components/input/demo/basic.tsx create mode 100644 components/input/demo/borderless-debug.tsx create mode 100644 components/input/demo/borderless.tsx create mode 100644 components/input/demo/debug-addon.tsx create mode 100644 components/input/demo/focus.tsx create mode 100644 components/input/demo/group.tsx create mode 100644 components/input/demo/password-input.tsx create mode 100644 components/input/demo/presuffix.tsx create mode 100644 components/input/demo/search-input-loading.tsx create mode 100644 components/input/demo/search-input.tsx create mode 100644 components/input/demo/show-count.tsx create mode 100644 components/input/demo/size.tsx create mode 100644 components/input/demo/status.tsx create mode 100644 components/input/demo/textarea-resize.tsx create mode 100644 components/input/demo/textarea-show-count.tsx create mode 100644 components/input/demo/textarea.tsx create mode 100644 components/input/demo/tooltip.tsx create mode 100644 components/layout/demo/basic.tsx create mode 100644 components/layout/demo/custom-trigger-debug.tsx create mode 100644 components/layout/demo/custom-trigger.tsx create mode 100644 components/layout/demo/fixed-sider.tsx create mode 100644 components/layout/demo/fixed.tsx create mode 100644 components/layout/demo/responsive.tsx create mode 100644 components/layout/demo/side.tsx create mode 100644 components/layout/demo/top-side-2.tsx create mode 100644 components/layout/demo/top-side.tsx create mode 100644 components/layout/demo/top.tsx create mode 100644 components/list/demo/basic.tsx create mode 100644 components/list/demo/grid-test.tsx create mode 100644 components/list/demo/grid.tsx create mode 100644 components/list/demo/infinite-load.tsx create mode 100644 components/list/demo/loadmore.tsx create mode 100644 components/list/demo/responsive.tsx create mode 100644 components/list/demo/simple.tsx create mode 100644 components/list/demo/vertical.tsx create mode 100644 components/list/demo/virtual-list.tsx create mode 100644 components/mentions/demo/async.tsx create mode 100644 components/mentions/demo/autoSize.tsx create mode 100644 components/mentions/demo/basic.tsx create mode 100644 components/mentions/demo/form.tsx create mode 100644 components/mentions/demo/placement.tsx create mode 100644 components/mentions/demo/prefix.tsx create mode 100644 components/mentions/demo/readonly.tsx create mode 100644 components/mentions/demo/render-panel.tsx create mode 100644 components/mentions/demo/status.tsx create mode 100644 components/menu/demo/deprecated.tsx create mode 100644 components/menu/demo/horizontal.tsx create mode 100644 components/menu/demo/inline-collapsed.tsx create mode 100644 components/menu/demo/inline.tsx create mode 100644 components/menu/demo/menu-v4.tsx create mode 100644 components/menu/demo/sider-current.tsx create mode 100644 components/menu/demo/style-debug.tsx create mode 100644 components/menu/demo/submenu-theme.tsx create mode 100644 components/menu/demo/switch-mode.tsx create mode 100644 components/menu/demo/theme.tsx create mode 100644 components/menu/demo/vertical.tsx create mode 100644 components/message/demo/custom-style.tsx create mode 100644 components/message/demo/duration.tsx create mode 100644 components/message/demo/hooks.tsx create mode 100644 components/message/demo/info.tsx create mode 100644 components/message/demo/loading.tsx create mode 100644 components/message/demo/other.tsx create mode 100644 components/message/demo/render-panel.tsx create mode 100644 components/message/demo/thenable.tsx create mode 100644 components/message/demo/update.tsx create mode 100644 components/modal/demo/async.tsx create mode 100644 components/modal/demo/basic.tsx create mode 100644 components/modal/demo/button-props.tsx create mode 100644 components/modal/demo/confirm-router.tsx create mode 100644 components/modal/demo/confirm.tsx create mode 100644 components/modal/demo/dark.tsx create mode 100644 components/modal/demo/footer.tsx create mode 100644 components/modal/demo/hooks.tsx create mode 100644 components/modal/demo/info.tsx create mode 100644 components/modal/demo/locale.tsx create mode 100644 components/modal/demo/manual.tsx create mode 100644 components/modal/demo/modal-render.tsx create mode 100644 components/modal/demo/position.tsx create mode 100644 components/modal/demo/render-panel.tsx create mode 100644 components/modal/demo/width.tsx create mode 100644 components/notification/demo/basic.tsx create mode 100644 components/notification/demo/custom-icon.tsx create mode 100644 components/notification/demo/custom-style.tsx create mode 100644 components/notification/demo/duration.tsx create mode 100644 components/notification/demo/hooks.tsx create mode 100644 components/notification/demo/placement.tsx create mode 100644 components/notification/demo/render-panel.tsx create mode 100644 components/notification/demo/update.tsx create mode 100644 components/notification/demo/with-btn.tsx create mode 100644 components/notification/demo/with-icon.tsx create mode 100644 components/pagination/demo/all.tsx create mode 100644 components/pagination/demo/basic.tsx create mode 100644 components/pagination/demo/changer.tsx create mode 100644 components/pagination/demo/controlled.tsx create mode 100644 components/pagination/demo/itemRender.tsx create mode 100644 components/pagination/demo/jump.tsx create mode 100644 components/pagination/demo/mini.tsx create mode 100644 components/pagination/demo/more.tsx create mode 100644 components/pagination/demo/simple.tsx create mode 100644 components/pagination/demo/total.tsx create mode 100644 components/popconfirm/demo/async.tsx create mode 100644 components/popconfirm/demo/basic.tsx create mode 100644 components/popconfirm/demo/dynamic-trigger.tsx create mode 100644 components/popconfirm/demo/icon.tsx create mode 100644 components/popconfirm/demo/locale.tsx create mode 100644 components/popconfirm/demo/placement.tsx create mode 100644 components/popconfirm/demo/promise.tsx create mode 100644 components/popconfirm/demo/render-panel.tsx create mode 100644 components/popover/demo/arrow-point-at-center.tsx create mode 100644 components/popover/demo/basic.tsx create mode 100644 components/popover/demo/control.tsx create mode 100644 components/popover/demo/hover-with-click.tsx create mode 100644 components/popover/demo/placement.tsx create mode 100644 components/popover/demo/render-panel.tsx create mode 100644 components/popover/demo/triggerType.tsx create mode 100644 components/progress/demo/circle-dynamic.tsx create mode 100644 components/progress/demo/circle-micro.tsx create mode 100644 components/progress/demo/circle-mini.tsx create mode 100644 components/progress/demo/circle.tsx create mode 100644 components/progress/demo/dashboard.tsx create mode 100644 components/progress/demo/dynamic.tsx create mode 100644 components/progress/demo/format.tsx create mode 100644 components/progress/demo/gradient-line.tsx create mode 100644 components/progress/demo/line-mini.tsx create mode 100644 components/progress/demo/line.tsx create mode 100644 components/progress/demo/linecap.tsx create mode 100644 components/progress/demo/segment.tsx create mode 100644 components/progress/demo/steps.tsx create mode 100644 components/radio/demo/badge.tsx create mode 100644 components/radio/demo/basic.tsx create mode 100644 components/radio/demo/disabled.tsx create mode 100644 components/radio/demo/radiobutton-solid.tsx create mode 100644 components/radio/demo/radiobutton.tsx create mode 100644 components/radio/demo/radiogroup-more.tsx create mode 100644 components/radio/demo/radiogroup-options.tsx create mode 100644 components/radio/demo/radiogroup-with-name.tsx create mode 100644 components/radio/demo/radiogroup.tsx create mode 100644 components/radio/demo/size.tsx create mode 100644 components/rate/demo/basic.tsx create mode 100644 components/rate/demo/character-function.tsx create mode 100644 components/rate/demo/character.tsx create mode 100644 components/rate/demo/clear.tsx create mode 100644 components/rate/demo/disabled.tsx create mode 100644 components/rate/demo/half.tsx create mode 100644 components/rate/demo/text.tsx create mode 100644 components/result/demo/403.tsx create mode 100644 components/result/demo/404.tsx create mode 100644 components/result/demo/500.tsx create mode 100644 components/result/demo/customIcon.tsx create mode 100644 components/result/demo/error.tsx create mode 100644 components/result/demo/info.tsx create mode 100644 components/result/demo/success.tsx create mode 100644 components/result/demo/warning.tsx create mode 100644 components/segmented/demo/basic.tsx create mode 100644 components/segmented/demo/block.tsx create mode 100644 components/segmented/demo/controlled-two.tsx create mode 100644 components/segmented/demo/controlled.tsx create mode 100644 components/segmented/demo/custom.tsx create mode 100644 components/segmented/demo/disabled.tsx create mode 100644 components/segmented/demo/dynamic.tsx create mode 100644 components/segmented/demo/icon-only.tsx create mode 100644 components/segmented/demo/size-consistent.tsx create mode 100644 components/segmented/demo/size.tsx create mode 100644 components/segmented/demo/with-icon.tsx create mode 100644 components/select/demo/automatic-tokenization.tsx create mode 100644 components/select/demo/basic.tsx create mode 100644 components/select/demo/big-data.tsx create mode 100644 components/select/demo/bordered.tsx create mode 100644 components/select/demo/coordinate.tsx create mode 100644 components/select/demo/custom-dropdown-menu.tsx create mode 100644 components/select/demo/custom-tag-render.tsx create mode 100644 components/select/demo/debug.tsx create mode 100644 components/select/demo/hide-selected.tsx create mode 100644 components/select/demo/label-in-value.tsx create mode 100644 components/select/demo/multiple.tsx create mode 100644 components/select/demo/optgroup.tsx create mode 100644 components/select/demo/option-label-prop.tsx create mode 100644 components/select/demo/placement.tsx create mode 100644 components/select/demo/render-panel.tsx create mode 100644 components/select/demo/responsive.tsx create mode 100644 components/select/demo/search-box.tsx create mode 100644 components/select/demo/search-sort.tsx create mode 100644 components/select/demo/search.tsx create mode 100644 components/select/demo/select-users.tsx create mode 100644 components/select/demo/size.tsx create mode 100644 components/select/demo/status.tsx create mode 100644 components/select/demo/suffix.tsx create mode 100644 components/select/demo/tags.tsx create mode 100644 components/skeleton/demo/active.tsx create mode 100644 components/skeleton/demo/basic.tsx create mode 100644 components/skeleton/demo/children.tsx create mode 100644 components/skeleton/demo/complex.tsx create mode 100644 components/skeleton/demo/element.tsx create mode 100644 components/skeleton/demo/list.tsx create mode 100644 components/slider/demo/basic.tsx create mode 100644 components/slider/demo/dragableTrack.tsx create mode 100644 components/slider/demo/event.tsx create mode 100644 components/slider/demo/icon-slider.tsx create mode 100644 components/slider/demo/input-number.tsx create mode 100644 components/slider/demo/mark.tsx create mode 100644 components/slider/demo/reverse.tsx create mode 100644 components/slider/demo/show-tooltip.tsx create mode 100644 components/slider/demo/tip-formatter.tsx create mode 100644 components/slider/demo/vertical.tsx create mode 100644 components/space/demo/align.tsx create mode 100644 components/space/demo/base.tsx create mode 100644 components/space/demo/compact-button-vertical.tsx create mode 100644 components/space/demo/compact-buttons.tsx create mode 100644 components/space/demo/compact-debug.tsx create mode 100644 components/space/demo/compact-nested.tsx create mode 100644 components/space/demo/compact.tsx create mode 100644 components/space/demo/customize.tsx create mode 100644 components/space/demo/debug.tsx create mode 100644 components/space/demo/gap-in-line.tsx create mode 100644 components/space/demo/size.tsx create mode 100644 components/space/demo/split.tsx create mode 100644 components/space/demo/vertical.tsx create mode 100644 components/space/demo/wrap.tsx create mode 100644 components/spin/demo/basic.tsx create mode 100644 components/spin/demo/custom-indicator.tsx create mode 100644 components/spin/demo/delayAndDebounce.tsx create mode 100644 components/spin/demo/inside.tsx create mode 100644 components/spin/demo/nested.tsx create mode 100644 components/spin/demo/size.tsx create mode 100644 components/spin/demo/tip.tsx create mode 100644 components/statistic/demo/basic.tsx create mode 100644 components/statistic/demo/card.tsx create mode 100644 components/statistic/demo/countdown.tsx create mode 100644 components/statistic/demo/unit.tsx create mode 100644 components/steps/demo/clickable.tsx create mode 100644 components/steps/demo/customized-progress-dot.tsx create mode 100644 components/steps/demo/deprecated.tsx create mode 100644 components/steps/demo/error.tsx create mode 100644 components/steps/demo/icon.tsx create mode 100644 components/steps/demo/inline.tsx create mode 100644 components/steps/demo/label-placement.tsx create mode 100644 components/steps/demo/nav.tsx create mode 100644 components/steps/demo/progress-debug.tsx create mode 100644 components/steps/demo/progress-dot-small.tsx create mode 100644 components/steps/demo/progress-dot.tsx create mode 100644 components/steps/demo/progress.tsx create mode 100644 components/steps/demo/simple.tsx create mode 100644 components/steps/demo/small-size.tsx create mode 100644 components/steps/demo/step-next.tsx create mode 100644 components/steps/demo/steps-in-steps.tsx create mode 100644 components/steps/demo/vertical-small.tsx create mode 100644 components/steps/demo/vertical.tsx create mode 100644 components/switch/demo/basic.tsx create mode 100644 components/switch/demo/disabled.tsx create mode 100644 components/switch/demo/loading.tsx create mode 100644 components/switch/demo/size.tsx create mode 100644 components/switch/demo/text.tsx create mode 100644 components/table/demo/ajax.tsx create mode 100644 components/table/demo/basic.tsx create mode 100644 components/table/demo/bordered.tsx create mode 100644 components/table/demo/colspan-rowspan.tsx create mode 100644 components/table/demo/custom-filter-panel.tsx delete mode 100644 components/table/demo/drag-sorting-handler.md create mode 100644 components/table/demo/drag-sorting.tsx create mode 100644 components/table/demo/dynamic-settings.tsx create mode 100644 components/table/demo/edit-cell.tsx create mode 100644 components/table/demo/edit-row.tsx create mode 100644 components/table/demo/ellipsis-custom-tooltip.tsx create mode 100644 components/table/demo/ellipsis.tsx create mode 100644 components/table/demo/expand.tsx create mode 100644 components/table/demo/filter-in-tree.tsx create mode 100644 components/table/demo/filter-search.tsx create mode 100644 components/table/demo/fixed-columns-header.tsx create mode 100644 components/table/demo/fixed-columns.tsx create mode 100644 components/table/demo/fixed-header.tsx create mode 100644 components/table/demo/grouping-columns.tsx create mode 100644 components/table/demo/head.tsx create mode 100644 components/table/demo/jsx.tsx create mode 100644 components/table/demo/multiple-sorter.tsx create mode 100644 components/table/demo/narrow.tsx create mode 100644 components/table/demo/nest-table-border-debug.tsx create mode 100644 components/table/demo/nested-table.tsx create mode 100644 components/table/demo/order-column.tsx create mode 100644 components/table/demo/pagination.tsx create mode 100644 components/table/demo/reset-filter.tsx create mode 100644 components/table/demo/resizable-column.tsx create mode 100644 components/table/demo/responsive.tsx create mode 100644 components/table/demo/row-selection-and-operation.tsx create mode 100644 components/table/demo/row-selection-custom-debug.tsx create mode 100644 components/table/demo/row-selection-custom.tsx create mode 100644 components/table/demo/row-selection.tsx create mode 100644 components/table/demo/size.tsx create mode 100644 components/table/demo/sticky.tsx create mode 100644 components/table/demo/summary.tsx create mode 100644 components/table/demo/tree-data.tsx create mode 100644 components/table/demo/tree-table-ellipsis.tsx create mode 100644 components/table/demo/virtual-list.tsx create mode 100644 components/tabs/demo/animated.tsx create mode 100644 components/tabs/demo/basic.tsx create mode 100644 components/tabs/demo/card-top.tsx create mode 100644 components/tabs/demo/card.tsx create mode 100644 components/tabs/demo/centered.tsx create mode 100644 components/tabs/demo/custom-add-trigger.tsx create mode 100644 components/tabs/demo/custom-tab-bar-node.tsx create mode 100644 components/tabs/demo/custom-tab-bar.tsx create mode 100644 components/tabs/demo/deprecated.tsx create mode 100644 components/tabs/demo/disabled.tsx create mode 100644 components/tabs/demo/editable-card.tsx create mode 100644 components/tabs/demo/extra.tsx create mode 100644 components/tabs/demo/icon.tsx create mode 100644 components/tabs/demo/nest.tsx create mode 100644 components/tabs/demo/position.tsx create mode 100644 components/tabs/demo/size.tsx create mode 100644 components/tabs/demo/slide.tsx create mode 100644 components/tag/demo/animation.tsx create mode 100644 components/tag/demo/basic.tsx create mode 100644 components/tag/demo/checkable.tsx create mode 100644 components/tag/demo/colorful-inverse.tsx create mode 100644 components/tag/demo/colorful.tsx create mode 100644 components/tag/demo/control.tsx create mode 100644 components/tag/demo/customize.tsx create mode 100644 components/tag/demo/icon.tsx create mode 100644 components/tag/demo/status.tsx create mode 100644 components/time-picker/demo/12hours.tsx create mode 100644 components/time-picker/demo/addon.tsx create mode 100644 components/time-picker/demo/basic.tsx create mode 100644 components/time-picker/demo/bordered.tsx create mode 100644 components/time-picker/demo/colored-popup.tsx create mode 100644 components/time-picker/demo/disabled.tsx create mode 100644 components/time-picker/demo/hide-column.tsx create mode 100644 components/time-picker/demo/interval-options.tsx create mode 100644 components/time-picker/demo/range-picker.tsx create mode 100644 components/time-picker/demo/render-panel.tsx create mode 100644 components/time-picker/demo/size.tsx create mode 100644 components/time-picker/demo/status.tsx create mode 100644 components/time-picker/demo/suffix.tsx create mode 100644 components/time-picker/demo/value.tsx create mode 100644 components/timeline/demo/alternate.tsx create mode 100644 components/timeline/demo/basic.tsx create mode 100644 components/timeline/demo/color.tsx create mode 100644 components/timeline/demo/custom.tsx create mode 100644 components/timeline/demo/label.tsx create mode 100644 components/timeline/demo/pending.tsx create mode 100644 components/timeline/demo/right.tsx create mode 100644 components/tooltip/demo/arrow-point-at-center.tsx create mode 100644 components/tooltip/demo/auto-adjust-overflow.tsx create mode 100644 components/tooltip/demo/basic.tsx create mode 100644 components/tooltip/demo/colorful.tsx create mode 100644 components/tooltip/demo/destroy-tooltip-on-hide.tsx create mode 100644 components/tooltip/demo/placement.tsx create mode 100644 components/tooltip/demo/render-panel.tsx create mode 100644 components/tour/demo/basic.tsx create mode 100644 components/tour/demo/non-modal.tsx create mode 100644 components/tour/demo/placement.tsx create mode 100644 components/tour/demo/render-panel.tsx create mode 100644 components/transfer/demo/advanced.tsx create mode 100644 components/transfer/demo/basic.tsx create mode 100644 components/transfer/demo/custom-item.tsx create mode 100644 components/transfer/demo/custom-select-all-labels.tsx create mode 100644 components/transfer/demo/large-data.tsx create mode 100644 components/transfer/demo/oneWay.tsx create mode 100644 components/transfer/demo/search.tsx create mode 100644 components/transfer/demo/status.tsx create mode 100644 components/transfer/demo/table-transfer.tsx create mode 100644 components/transfer/demo/tree-transfer.tsx create mode 100644 components/tree-select/demo/async.tsx create mode 100644 components/tree-select/demo/basic.tsx create mode 100644 components/tree-select/demo/checkable.tsx create mode 100644 components/tree-select/demo/multiple.tsx create mode 100644 components/tree-select/demo/placement.tsx create mode 100644 components/tree-select/demo/render-panel.tsx create mode 100644 components/tree-select/demo/status.tsx create mode 100644 components/tree-select/demo/suffix.tsx create mode 100644 components/tree-select/demo/treeData.tsx create mode 100644 components/tree-select/demo/treeLine.tsx create mode 100644 components/tree/demo/basic-controlled.tsx create mode 100644 components/tree/demo/basic.tsx create mode 100644 components/tree/demo/big-data.tsx create mode 100644 components/tree/demo/customized-icon.tsx create mode 100644 components/tree/demo/directory.tsx create mode 100644 components/tree/demo/drag-debug.tsx create mode 100644 components/tree/demo/draggable.tsx create mode 100644 components/tree/demo/dynamic.tsx create mode 100644 components/tree/demo/line.tsx create mode 100644 components/tree/demo/search.tsx create mode 100644 components/tree/demo/switcher-icon.tsx create mode 100644 components/tree/demo/virtual-scroll.tsx create mode 100644 components/typography/demo/basic.tsx create mode 100644 components/typography/demo/ellipsis-debug.tsx create mode 100644 components/typography/demo/ellipsis-middle.tsx create mode 100644 components/typography/demo/ellipsis.tsx create mode 100644 components/typography/demo/interactive.tsx create mode 100644 components/typography/demo/paragraph-debug.tsx create mode 100644 components/typography/demo/suffix.tsx create mode 100644 components/typography/demo/text.tsx create mode 100644 components/typography/demo/title.tsx create mode 100644 components/upload/demo/avatar.tsx create mode 100644 components/upload/demo/basic.tsx create mode 100644 components/upload/demo/crop-image.tsx create mode 100644 components/upload/demo/customize-progress-bar.tsx create mode 100644 components/upload/demo/defaultFileList.tsx create mode 100644 components/upload/demo/directory.tsx create mode 100644 components/upload/demo/drag-sorting.tsx create mode 100644 components/upload/demo/drag.tsx create mode 100644 components/upload/demo/file-type.tsx create mode 100644 components/upload/demo/fileList.tsx create mode 100644 components/upload/demo/max-count.tsx create mode 100644 components/upload/demo/picture-card.tsx create mode 100644 components/upload/demo/picture-style.tsx create mode 100644 components/upload/demo/preview-file.tsx create mode 100644 components/upload/demo/transform-file.tsx create mode 100644 components/upload/demo/upload-custom-action-icon.tsx create mode 100644 components/upload/demo/upload-manually.tsx create mode 100644 components/upload/demo/upload-png-only.tsx create mode 100644 components/upload/demo/upload-with-aliyun-oss.tsx rename docs/spec/{data-list.md => data-list.en-US.md} (97%) create mode 100644 docs/spec/data-list.zh-CN.md rename docs/spec/{form-page.md => form-page.en-US.md} (98%) create mode 100644 docs/spec/form-page.zh-CN.md create mode 100644 scripts/migrate.js delete mode 100644 site/.eslintrc.js delete mode 100644 site/antd.js delete mode 100644 site/bisheng.config.js delete mode 100644 site/theme/en-US.d.ts delete mode 100644 site/theme/en-US.js delete mode 100644 site/theme/index-css-only.js delete mode 100644 site/theme/index.js delete mode 100644 site/theme/static/colors.less delete mode 100644 site/theme/static/common.less delete mode 100644 site/theme/static/contributors.less delete mode 100644 site/theme/static/dark.less delete mode 100644 site/theme/static/demo.less delete mode 100644 site/theme/static/design-doc.less delete mode 100644 site/theme/static/docsearch.less delete mode 100644 site/theme/static/footer.less delete mode 100644 site/theme/static/header.less delete mode 100644 site/theme/static/highlight.less delete mode 100644 site/theme/static/home.less delete mode 100644 site/theme/static/icon-pic-searcher.less delete mode 100644 site/theme/static/icons.less delete mode 100644 site/theme/static/index.less delete mode 100644 site/theme/static/markdown.less delete mode 100644 site/theme/static/mock-browser.less delete mode 100644 site/theme/static/motion.less delete mode 100644 site/theme/static/not-found.less delete mode 100644 site/theme/static/nprogress.less delete mode 100644 site/theme/static/page-nav.less delete mode 100644 site/theme/static/preview-img.less delete mode 100644 site/theme/static/reset.less delete mode 100644 site/theme/static/responsive.less delete mode 100644 site/theme/static/rtl.less delete mode 100644 site/theme/static/template.html delete mode 100644 site/theme/static/theme.less delete mode 100644 site/theme/static/toc.less delete mode 100644 site/theme/style/color/bezierEasing.less delete mode 100644 site/theme/style/color/colorPalette.less delete mode 100644 site/theme/style/color/colors.less delete mode 100644 site/theme/style/color/tinyColor.less delete mode 100644 site/theme/style/compact.less delete mode 100644 site/theme/style/core/global.less delete mode 100644 site/theme/style/core/iconfont.less delete mode 100644 site/theme/style/core/index.less delete mode 100644 site/theme/style/dark.less delete mode 100644 site/theme/style/default.less delete mode 100644 site/theme/style/index.less delete mode 100644 site/theme/style/index.tsx delete mode 100644 site/theme/style/mixins/box.less delete mode 100644 site/theme/style/mixins/clearfix.less delete mode 100644 site/theme/style/mixins/compatibility.less delete mode 100644 site/theme/style/mixins/index.less delete mode 100644 site/theme/style/mixins/modal-mask.less delete mode 100644 site/theme/style/mixins/operation-unit.less delete mode 100644 site/theme/style/mixins/reset.less delete mode 100644 site/theme/style/mixins/rounded-arrow.less delete mode 100644 site/theme/style/mixins/size.less delete mode 100644 site/theme/style/themes/compact.less delete mode 100644 site/theme/style/themes/dark.less delete mode 100644 site/theme/style/themes/default.less delete mode 100644 site/theme/style/themes/index.less delete mode 100644 site/theme/style/themes/variable.less delete mode 100644 site/theme/style/variable.less delete mode 100644 site/theme/template/AppShell.tsx delete mode 100644 site/theme/template/BrowserFrame.tsx delete mode 100644 site/theme/template/Color/ColorBlock.jsx delete mode 100644 site/theme/template/Color/ColorPaletteTool.jsx delete mode 100644 site/theme/template/Color/ColorPaletteToolDark.jsx delete mode 100644 site/theme/template/Color/ColorPalettes.jsx delete mode 100644 site/theme/template/Color/ColorPatterns.jsx delete mode 100644 site/theme/template/Color/ColorPicker.tsx delete mode 100644 site/theme/template/Color/Palette.jsx delete mode 100644 site/theme/template/Content/Article.tsx delete mode 100644 site/theme/template/Content/ComponentDoc.jsx delete mode 100644 site/theme/template/Content/ComponentOverview.jsx delete mode 100644 site/theme/template/Content/ComponentOverview.less delete mode 100644 site/theme/template/Content/EditButton.tsx delete mode 100644 site/theme/template/Content/MainContent.jsx delete mode 100644 site/theme/template/Content/PrevAndNext.jsx delete mode 100644 site/theme/template/Content/ThemeIcon.jsx delete mode 100644 site/theme/template/Content/index.jsx delete mode 100644 site/theme/template/Home/Banner/Background.less delete mode 100644 site/theme/template/Home/Banner/Background.tsx delete mode 100644 site/theme/template/Home/Banner/Logo.less delete mode 100644 site/theme/template/Home/Banner/Logo.tsx delete mode 100644 site/theme/template/Home/Banner/index.less delete mode 100644 site/theme/template/Home/Banner/index.tsx delete mode 100644 site/theme/template/Home/DesignPage/Certainty.tsx delete mode 100644 site/theme/template/Home/DesignPage/Growth.tsx delete mode 100644 site/theme/template/Home/DesignPage/InteractiveIcon.tsx delete mode 100644 site/theme/template/Home/DesignPage/Meaningful.tsx delete mode 100644 site/theme/template/Home/DesignPage/Natural.tsx delete mode 100644 site/theme/template/Home/DesignPage/index.less delete mode 100644 site/theme/template/Home/DesignPage/index.tsx delete mode 100644 site/theme/template/Home/MorePage.less delete mode 100644 site/theme/template/Home/MorePage.tsx delete mode 100644 site/theme/template/Home/RecommendPage.less delete mode 100644 site/theme/template/Home/RecommendPage.tsx delete mode 100644 site/theme/template/Home/index.less delete mode 100644 site/theme/template/Home/index.tsx delete mode 100644 site/theme/template/Icon/index.tsx delete mode 100644 site/theme/template/Icon/utils.ts delete mode 100644 site/theme/template/Layout/DynamicTheme/Diff.tsx delete mode 100644 site/theme/template/Layout/DynamicTheme/Preview.tsx delete mode 100644 site/theme/template/Layout/DynamicTheme/Token.tsx delete mode 100644 site/theme/template/Layout/DynamicTheme/index.tsx delete mode 100644 site/theme/template/Layout/DynamicTheme/validateCheck.ts delete mode 100644 site/theme/template/Layout/Header/DocSearch.less delete mode 100644 site/theme/template/Layout/Header/Github.less delete mode 100644 site/theme/template/Layout/Header/Github.tsx delete mode 100644 site/theme/template/Layout/Header/Logo.less delete mode 100644 site/theme/template/Layout/Header/Logo.tsx delete mode 100644 site/theme/template/Layout/Header/Navigation.less delete mode 100644 site/theme/template/Layout/Header/SearchBar.less delete mode 100644 site/theme/template/Layout/Header/index.less delete mode 100644 site/theme/template/Layout/Header/index.tsx delete mode 100644 site/theme/template/Layout/index.tsx delete mode 100644 site/theme/template/Resources/AffixTabs.less delete mode 100644 site/theme/template/Resources/Articles/index.less delete mode 100644 site/theme/template/Resources/index.less delete mode 100644 site/theme/template/Resources/index.tsx delete mode 100644 site/theme/zh-CN.d.ts delete mode 100644 site/theme/zh-CN.js delete mode 100644 site/themeConfig.d.ts diff --git a/.dumi/hooks/useLocale.tsx b/.dumi/hooks/useLocale.tsx new file mode 100644 index 0000000000..6ca4dd51c7 --- /dev/null +++ b/.dumi/hooks/useLocale.tsx @@ -0,0 +1,15 @@ +import * as React from 'react'; +import { useLocale as useDumiLocale } from 'dumi'; + +export interface LocaleMap { + cn: Record; + en: Record; +} + +export default function useLocale( + localeMap?: LocaleMap, +): [Record, 'cn' | 'en'] { + const { id } = useDumiLocale(); + const localeType = id === 'zh-CN' ? 'cn' : ('en' as const); + return [localeMap?.[localeType]!, localeType]; +} diff --git a/.dumi/hooks/useLocation.ts b/.dumi/hooks/useLocation.ts new file mode 100644 index 0000000000..3499a3bbe2 --- /dev/null +++ b/.dumi/hooks/useLocation.ts @@ -0,0 +1,47 @@ +import { useLocation as useDumiLocation } from 'dumi'; +import * as React from 'react'; +import useLocale from './useLocale'; + +function clearPath(path: string) { + return path.replace('-cn', '').replace(/\/$/, ''); +} + +export default function useLocation() { + const location = useDumiLocation(); + const { search } = location; + const [, localeType] = useLocale(); + + const getLink = React.useCallback( + (path: string, hash?: string | { cn: string; en: string }) => { + let pathname = clearPath(path); + + if (localeType === 'cn') { + pathname = `${pathname}-cn`; + } + + if (search) { + pathname = `${pathname}${search}`; + } + + if (hash) { + let hashStr: string; + if (typeof hash === 'object') { + hashStr = hash[localeType]; + } else { + hashStr = hash; + } + + pathname = `${pathname}#${hashStr}`; + } + + return pathname; + }, + [localeType, search], + ); + + return { + ...location, + pathname: clearPath(location.pathname), + getLink, + }; +} diff --git a/.dumi/hooks/useMenu.tsx b/.dumi/hooks/useMenu.tsx new file mode 100644 index 0000000000..a537adac3b --- /dev/null +++ b/.dumi/hooks/useMenu.tsx @@ -0,0 +1,138 @@ +import React, { ReactNode, useMemo } from 'react'; +import { MenuProps } from 'antd'; +import { Link, useFullSidebarData, useSidebarData } from 'dumi'; +import useLocation from './useLocation'; + +export type UseMenuOptions = { + before?: ReactNode; + after?: ReactNode; +}; + +const useMenu = (options: UseMenuOptions = {}): [MenuProps['items'], string] => { + const fullData = useFullSidebarData(); + const { pathname } = useLocation(); + const sidebarData = useSidebarData(); + const { before, after } = options; + + const menuItems = useMemo(() => { + const sidebarItems = [...(sidebarData ?? [])]; + + // 将设计文档未分类的放在最后 + if (pathname.startsWith('/docs/spec')) { + const notGrouped = sidebarItems.splice(0, 1); + sidebarItems.push(...notGrouped); + } + + // 把 /changelog 拼到开发文档中 + if (pathname.startsWith('/docs/react')) { + const changelogData = Object.entries(fullData).find(([key]) => + key.startsWith('/changelog'), + )?.[1]; + if (changelogData) { + sidebarItems.push(...changelogData); + } + } + if (pathname.startsWith('/changelog')) { + const reactDocData = Object.entries(fullData).find(([key]) => + key.startsWith('/docs/react'), + )?.[1]; + if (reactDocData) { + sidebarItems.unshift(...reactDocData); + } + } + + return ( + sidebarItems?.reduce>((result, group) => { + if (group.title) { + // 设计文档特殊处理二级分组 + if (pathname.startsWith('/docs/spec')) { + const childrenGroup = group.children.reduce< + Record[number]['children']> + >((childrenResult, child) => { + const type = (child.frontmatter as any).type ?? 'default'; + if (!childrenResult[type]) { + childrenResult[type] = []; + } + childrenResult[type].push(child); + return childrenResult; + }, {}); + const childItems = []; + childItems.push( + ...childrenGroup.default.map(item => ({ + label: ( + + {before} + {item.title} + {after} + + ), + key: item.link.replace(/(-cn$)/g, ''), + })), + ); + Object.entries(childrenGroup).forEach(([type, children]) => { + if (type !== 'default') { + childItems.push({ + type: 'group', + label: type, + key: type, + children: children?.map(item => ({ + label: ( + + {before} + {item.title} + {after} + + ), + key: item.link.replace(/(-cn$)/g, ''), + })), + }); + } + }); + result.push({ + label: group.title, + key: group.title, + children: childItems, + }); + } else { + result.push({ + type: 'group', + label: group.title, + key: group.title, + children: group.children?.map(item => ({ + label: ( + + {before} + {item.title} + + {(item.frontmatter as any).subtitle} + + {after} + + ), + key: item.link.replace(/(-cn$)/g, ''), + })), + }); + } + } else { + result.push( + ...group.children?.map(item => ({ + label: ( + + {before} + {item.title} + {after} + + ), + key: item.link.replace(/(-cn$)/g, ''), + })), + ); + } + return result; + }, []) ?? [] + ); + }, [sidebarData, fullData, pathname]); + + return [menuItems, pathname]; +}; + +export default useMenu; diff --git a/.dumi/hooks/useSiteToken.ts b/.dumi/hooks/useSiteToken.ts new file mode 100644 index 0000000000..425114ea96 --- /dev/null +++ b/.dumi/hooks/useSiteToken.ts @@ -0,0 +1,35 @@ +import { theme } from 'antd'; +import { useContext } from 'react'; +import { ConfigContext } from 'antd/es/config-provider'; + +const { useToken } = theme; + +const useSiteToken = () => { + const result = useToken(); + const { getPrefixCls, iconPrefixCls } = useContext(ConfigContext); + const rootPrefixCls = getPrefixCls(); + const { token } = result; + const siteMarkdownCodeBg = token.colorFillTertiary; + + return { + ...result, + token: { + ...token, + headerHeight: 64, + menuItemBorder: 2, + mobileMaxWidth: 767.99, + siteMarkdownCodeBg, + antCls: `.${rootPrefixCls}`, + iconCls: `.${iconPrefixCls}`, + /** 56 */ + marginFarXS: (token.marginXXL / 6) * 7, + /** 80 */ + marginFarSM: (token.marginXXL / 3) * 5, + /** 96 */ + marginFar: token.marginXXL * 2, + codeFamily: `'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace`, + }, + }; +}; + +export default useSiteToken; diff --git a/site/theme/template/NotFound.tsx b/.dumi/pages/404/index.tsx similarity index 71% rename from site/theme/template/NotFound.tsx rename to .dumi/pages/404/index.tsx index 52bbb2438f..4f8d37c526 100644 --- a/site/theme/template/NotFound.tsx +++ b/.dumi/pages/404/index.tsx @@ -1,20 +1,10 @@ import React, { useEffect } from 'react'; -import { Link } from 'bisheng/router'; import { Result, Button } from 'antd'; import { HomeOutlined } from '@ant-design/icons'; -import * as utils from './utils'; +import { Link, useLocation } from 'dumi'; +import * as utils from '../../theme/utils'; export interface NotFoundProps { - location: { - pathname: string; - search: string; - hash: string; - state: any; - action: string; - key: any; - basename: string; - query: Record; - }; router: { push: (pathname: string) => void; replace: (pathname: string) => void; @@ -26,11 +16,8 @@ const DIRECT_MAP: Record = { 'docs/spec/work-with-us': 'docs/resources', }; -export default function NotFound(props: NotFoundProps) { - const { - location: { pathname }, - router, - } = props; +const NotFoundPage: React.FC = ({ router }) => { + const { pathname } = useLocation(); const isZhCN = utils.isZhCN(pathname); @@ -62,11 +49,8 @@ export default function NotFound(props: NotFoundProps) { } /> - diff --git a/components/table/demo/size.tsx b/components/table/demo/size.tsx new file mode 100644 index 0000000000..46b69e8fda --- /dev/null +++ b/components/table/demo/size.tsx @@ -0,0 +1,57 @@ +import React from 'react'; +import { Table } from 'antd'; +import type { ColumnsType } from 'antd/es/table'; + +interface DataType { + key: React.Key; + name: string; + age: number; + address: string; +} + +const columns: ColumnsType = [ + { + title: 'Name', + dataIndex: 'name', + }, + { + title: 'Age', + dataIndex: 'age', + }, + { + title: 'Address', + dataIndex: 'address', + }, +]; + +const data: DataType[] = [ + { + key: '1', + name: 'John Brown', + age: 32, + address: 'New York No. 1 Lake Park', + }, + { + key: '2', + name: 'Jim Green', + age: 42, + address: 'London No. 1 Lake Park', + }, + { + key: '3', + name: 'Joe Black', + age: 32, + address: 'Sidney No. 1 Lake Park', + }, +]; + +const App: React.FC = () => ( +
+

Middle size table

+ +

Small size table

+
+ +); + +export default App; diff --git a/components/table/demo/sticky.md b/components/table/demo/sticky.md index d3893c0153..3265288c59 100644 --- a/components/table/demo/sticky.md +++ b/components/table/demo/sticky.md @@ -1,10 +1,3 @@ ---- -order: 99 -title: - en-US: Fixed header and scroll bar with the page - zh-CN: 随页面滚动的固定表头和滚动条 ---- - ## zh-CN 对于长表格,需要滚动才能查看表头和滚动条,那么现在可以设置跟随页面固定表头和滚动条。 @@ -12,128 +5,3 @@ title: ## en-US For long table,need to scroll to view the header and scroll bar,then you can now set the fixed header and scroll bar to follow the page. - -```tsx -import { Switch, Table } from 'antd'; -import type { ColumnsType } from 'antd/es/table'; -import React, { useState } from 'react'; - -interface DataType { - key: React.Key; - name: string; - age: number; - address: string; -} - -const columns: ColumnsType = [ - { - title: 'Full Name', - width: 100, - dataIndex: 'name', - key: 'name', - fixed: 'left', - }, - { - title: 'Age', - width: 100, - dataIndex: 'age', - key: 'age', - fixed: 'left', - }, - { - title: 'Column 1', - dataIndex: 'address', - key: '1', - width: 150, - }, - { - title: 'Column 2', - dataIndex: 'address', - key: '2', - width: 150, - }, - { - title: 'Column 3', - dataIndex: 'address', - key: '3', - width: 150, - }, - { - title: 'Column 4', - dataIndex: 'address', - key: '4', - width: 150, - }, - { - title: 'Column 5', - dataIndex: 'address', - key: '5', - width: 150, - }, - { - title: 'Column 6', - dataIndex: 'address', - key: '6', - width: 150, - }, - { - title: 'Column 7', - dataIndex: 'address', - key: '7', - width: 150, - }, - { title: 'Column 8', dataIndex: 'address', key: '8' }, - { - title: 'Action', - key: 'operation', - fixed: 'right', - width: 100, - render: () => action, - }, -]; - -const data: DataType[] = []; -for (let i = 0; i < 100; i++) { - data.push({ - key: i, - name: `Edrward ${i}`, - age: 32, - address: `London Park no. ${i}`, - }); -} - -const App: React.FC = () => { - const [fixedTop, setFixedTop] = useState(false); - - return ( -
( - - - - { - setFixedTop(!fixedTop); - }} - /> - - - Scroll Context - - Fix Right - - - )} - sticky - /> - ); -}; - -export default App; -``` diff --git a/components/table/demo/sticky.tsx b/components/table/demo/sticky.tsx new file mode 100644 index 0000000000..61665550ca --- /dev/null +++ b/components/table/demo/sticky.tsx @@ -0,0 +1,122 @@ +import React, { useState } from 'react'; +import { Switch, Table } from 'antd'; +import type { ColumnsType } from 'antd/es/table'; + +interface DataType { + key: React.Key; + name: string; + age: number; + address: string; +} + +const columns: ColumnsType = [ + { + title: 'Full Name', + width: 100, + dataIndex: 'name', + key: 'name', + fixed: 'left', + }, + { + title: 'Age', + width: 100, + dataIndex: 'age', + key: 'age', + fixed: 'left', + }, + { + title: 'Column 1', + dataIndex: 'address', + key: '1', + width: 150, + }, + { + title: 'Column 2', + dataIndex: 'address', + key: '2', + width: 150, + }, + { + title: 'Column 3', + dataIndex: 'address', + key: '3', + width: 150, + }, + { + title: 'Column 4', + dataIndex: 'address', + key: '4', + width: 150, + }, + { + title: 'Column 5', + dataIndex: 'address', + key: '5', + width: 150, + }, + { + title: 'Column 6', + dataIndex: 'address', + key: '6', + width: 150, + }, + { + title: 'Column 7', + dataIndex: 'address', + key: '7', + width: 150, + }, + { title: 'Column 8', dataIndex: 'address', key: '8' }, + { + title: 'Action', + key: 'operation', + fixed: 'right', + width: 100, + render: () => action, + }, +]; + +const data: DataType[] = []; +for (let i = 0; i < 100; i++) { + data.push({ + key: i, + name: `Edrward ${i}`, + age: 32, + address: `London Park no. ${i}`, + }); +} + +const App: React.FC = () => { + const [fixedTop, setFixedTop] = useState(false); + + return ( +
( + + + + { + setFixedTop(!fixedTop); + }} + /> + + + Scroll Context + + Fix Right + + + )} + sticky + /> + ); +}; + +export default App; diff --git a/components/table/demo/summary.md b/components/table/demo/summary.md index e8d4caa0a8..d1c65d2204 100644 --- a/components/table/demo/summary.md +++ b/components/table/demo/summary.md @@ -1,10 +1,3 @@ ---- -order: 29 -title: - en-US: Summary - zh-CN: 总结栏 ---- - ## zh-CN 通过 `summary` 设置总结栏。使用 `Table.Summary.Cell` 同步 Column 的固定状态。你可以通过配置 `Table.Summary` 的 `fixed` 属性使其固定(`4.16.0` 支持)。 @@ -13,151 +6,6 @@ title: Set summary content by `summary` prop. Sync column fixed status with `Table.Summary.Cell`. You can fixed it by set `Table.Summary` `fixed` prop(since `4.16.0`). -```tsx -import { Table, Typography } from 'antd'; -import type { ColumnsType } from 'antd/es/table'; -import React from 'react'; - -const { Text } = Typography; - -interface DataType { - key: string; - name: string; - borrow: number; - repayment: number; -} - -interface FixedDataType { - key: React.Key; - name: string; - description: string; -} - -const columns: ColumnsType = [ - { - title: 'Name', - dataIndex: 'name', - }, - { - title: 'Borrow', - dataIndex: 'borrow', - }, - { - title: 'Repayment', - dataIndex: 'repayment', - }, -]; - -const data: DataType[] = [ - { - key: '1', - name: 'John Brown', - borrow: 10, - repayment: 33, - }, - { - key: '2', - name: 'Jim Green', - borrow: 100, - repayment: 0, - }, - { - key: '3', - name: 'Joe Black', - borrow: 10, - repayment: 10, - }, - { - key: '4', - name: 'Jim Red', - borrow: 75, - repayment: 45, - }, -]; - -const fixedColumns: ColumnsType = [ - { - title: 'Name', - dataIndex: 'name', - fixed: true, - width: 100, - }, - { - title: 'Description', - dataIndex: 'description', - }, -]; - -const fixedData: FixedDataType[] = []; -for (let i = 0; i < 20; i += 1) { - fixedData.push({ - key: i, - name: ['Light', 'Bamboo', 'Little'][i % 3], - description: 'Everything that has a beginning, has an end.', - }); -} - -const App: React.FC = () => ( - <> -
{ - let totalBorrow = 0; - let totalRepayment = 0; - - pageData.forEach(({ borrow, repayment }) => { - totalBorrow += borrow; - totalRepayment += repayment; - }); - - return ( - <> - - Total - - {totalBorrow} - - - {totalRepayment} - - - - Balance - - {totalBorrow - totalRepayment} - - - - ); - }} - /> - -
- -
( - - - Summary - This is a summary content - - - )} - /> - -); - -export default App; -``` - - - - - - - - -
{{ content | safe }}
- {% for jsFile in manifest["js"] %} - - {% endfor %} - - - - - - - - - diff --git a/site/theme/static/theme.less b/site/theme/static/theme.less deleted file mode 100644 index 771b27c3d7..0000000000 --- a/site/theme/static/theme.less +++ /dev/null @@ -1,9 +0,0 @@ -@import './colors.less'; -@import './home.less'; - -@site-heading-color: @heading-color; -@site-text-color: @heading-color; -@site-text-color-secondary: @text-color-secondary; -@site-border-color-split: @border-color-split; -@site-header-box-shadow: 0 2px 8px rgba(240, 241, 242, 65); -@site-markdown-code-bg: #f2f4f5; diff --git a/site/theme/static/toc.less b/site/theme/static/toc.less deleted file mode 100644 index 4a35de67fb..0000000000 --- a/site/theme/static/toc.less +++ /dev/null @@ -1,103 +0,0 @@ -.toc { - margin: 16px 0; - padding-left: 0; - font-size: 12px; - list-style: none; - border-left: 1px solid @site-border-color-split; - - .ant-row-rtl & { - border-right: 1px solid @site-border-color-split; - border-left: none; - } -} - -ul.toc > li { - margin-left: 0; - padding-left: 0; - line-height: 1.5; - list-style: none; - - &:not(:last-child) { - margin-bottom: 4px; - } - - .ant-row-rtl & { - margin-right: 0; - padding-right: 0; - } - - &.toc-debug a { - color: @purple-6 !important; - } -} - -.toc li > ul { - display: none; - font-size: 12px; - text-indent: 8px; -} - -.toc a { - display: block; - width: 110px; - margin-left: -1px; - padding-left: 16px; - overflow: hidden; - color: @site-text-color !important; - white-space: nowrap; - text-overflow: ellipsis; - border-left: 1px solid transparent; - transition: all 0.3s ease; - - .ant-row-rtl & { - margin-right: -1px; - margin-left: 0; - padding-right: 16px; - padding-left: 0; - border-right: 1px solid transparent; - border-left: none; - } -} - -.toc a:hover { - color: @primary-color !important; -} - -.toc a.current { - color: @primary-color !important; - border-color: @primary-color; -} - -.toc-affix { - position: absolute; - top: 8px; - right: 20px; - - .ant-affix { - z-index: 9; - max-height: ~'calc(100vh - 16px)'; - overflow-x: hidden; - overflow-y: auto; - background: #fff; - } - - .ant-row-rtl & { - right: auto; - left: 20px; - } -} - -.toc-affix-bottom { - position: absolute; - right: 20px; - bottom: 88px; - - .ant-affix { - background: @body-background; - } - - .ant-row-rtl & { - right: auto; - left: 20px; - } -} diff --git a/site/theme/style/color/bezierEasing.less b/site/theme/style/color/bezierEasing.less deleted file mode 100644 index f53ffb3680..0000000000 --- a/site/theme/style/color/bezierEasing.less +++ /dev/null @@ -1,110 +0,0 @@ -/* stylelint-disable */ -.bezierEasingMixin() { -@functions: ~`(function() { - var NEWTON_ITERATIONS = 4; - var NEWTON_MIN_SLOPE = 0.001; - var SUBDIVISION_PRECISION = 0.0000001; - var SUBDIVISION_MAX_ITERATIONS = 10; - - var kSplineTableSize = 11; - var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0); - - var float32ArraySupported = typeof Float32Array === 'function'; - - function A (aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1; } - function B (aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1; } - function C (aA1) { return 3.0 * aA1; } - - // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. - function calcBezier (aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; } - - // Returns dx/dt given t, x1, and x2, or dy/dt given t, y1, and y2. - function getSlope (aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); } - - function binarySubdivide (aX, aA, aB, mX1, mX2) { - var currentX, currentT, i = 0; - do { - currentT = aA + (aB - aA) / 2.0; - currentX = calcBezier(currentT, mX1, mX2) - aX; - if (currentX > 0.0) { - aB = currentT; - } else { - aA = currentT; - } - } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); - return currentT; - } - - function newtonRaphsonIterate (aX, aGuessT, mX1, mX2) { - for (var i = 0; i < NEWTON_ITERATIONS; ++i) { - var currentSlope = getSlope(aGuessT, mX1, mX2); - if (currentSlope === 0.0) { - return aGuessT; - } - var currentX = calcBezier(aGuessT, mX1, mX2) - aX; - aGuessT -= currentX / currentSlope; - } - return aGuessT; - } - - var BezierEasing = function (mX1, mY1, mX2, mY2) { - if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { - throw new Error('bezier x values must be in [0, 1] range'); - } - - // Precompute samples table - var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); - if (mX1 !== mY1 || mX2 !== mY2) { - for (var i = 0; i < kSplineTableSize; ++i) { - sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); - } - } - - function getTForX (aX) { - var intervalStart = 0.0; - var currentSample = 1; - var lastSample = kSplineTableSize - 1; - - for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { - intervalStart += kSampleStepSize; - } - --currentSample; - - // Interpolate to provide an initial guess for t - var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); - var guessForT = intervalStart + dist * kSampleStepSize; - - var initialSlope = getSlope(guessForT, mX1, mX2); - if (initialSlope >= NEWTON_MIN_SLOPE) { - return newtonRaphsonIterate(aX, guessForT, mX1, mX2); - } else if (initialSlope === 0.0) { - return guessForT; - } else { - return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); - } - } - - return function BezierEasing (x) { - if (mX1 === mY1 && mX2 === mY2) { - return x; // linear - } - // Because JavaScript number are imprecise, we should guarantee the extremes are right. - if (x === 0) { - return 0; - } - if (x === 1) { - return 1; - } - return calcBezier(getTForX(x), mY1, mY2); - }; - }; - - this.colorEasing = BezierEasing(0.26, 0.09, 0.37, 0.18); - // less 3 requires a return - return ''; -})()`; -} -// It is hacky way to make this function will be compiled preferentially by less -// resolve error: `ReferenceError: colorPalette is not defined` -// https://github.com/ant-design/ant-motion/issues/44 -.bezierEasingMixin(); diff --git a/site/theme/style/color/colorPalette.less b/site/theme/style/color/colorPalette.less deleted file mode 100644 index 9e2e129431..0000000000 --- a/site/theme/style/color/colorPalette.less +++ /dev/null @@ -1,85 +0,0 @@ -/* stylelint-disable */ -@import "bezierEasing"; -@import "tinyColor"; - -// We create a very complex algorithm which take the place of original tint/shade color system -// to make sure no one can understand it 👻 -// and create an entire color palette magicly by inputing just a single primary color. -// We are using bezier-curve easing function and some color manipulations like tint/shade/darken/spin -.colorPaletteMixin() { -@functions: ~`(function() { - var hueStep = 2; - var saturationStep = 0.16; - var saturationStep2 = 0.05; - var brightnessStep1 = 0.05; - var brightnessStep2 = 0.15; - var lightColorCount = 5; - var darkColorCount = 4; - - var getHue = function(hsv, i, isLight) { - var hue; - if (hsv.h >= 60 && hsv.h <= 240) { - hue = isLight ? hsv.h - hueStep * i : hsv.h + hueStep * i; - } else { - hue = isLight ? hsv.h + hueStep * i : hsv.h - hueStep * i; - } - if (hue < 0) { - hue += 360; - } else if (hue >= 360) { - hue -= 360; - } - return Math.round(hue); - }; - var getSaturation = function(hsv, i, isLight) { - // grey color don't change saturation - if (hsv.h === 0 && hsv.s === 0) { - return hsv.s; - } - var saturation; - if (isLight) { - saturation = hsv.s - saturationStep * i; - } else if (i === darkColorCount) { - saturation = hsv.s + saturationStep; - } else { - saturation = hsv.s + saturationStep2 * i; - } - if (saturation > 1) { - saturation = 1; - } - if (isLight && i === lightColorCount && saturation > 0.1) { - saturation = 0.1; - } - if (saturation < 0.06) { - saturation = 0.06; - } - return Number(saturation.toFixed(2)); - }; - var getValue = function(hsv, i, isLight) { - var value; - if (isLight) { - value = hsv.v + brightnessStep1 * i; - }else{ - value = hsv.v - brightnessStep2 * i - } - if (value > 1) { - value = 1; - } - return Number(value.toFixed(2)) - }; - - this.colorPalette = function(color, index) { - var isLight = index <= 6; - var hsv = tinycolor(color).toHsv(); - var i = isLight ? lightColorCount + 1 - index : index - lightColorCount - 1; - return tinycolor({ - h: getHue(hsv, i, isLight), - s: getSaturation(hsv, i, isLight), - v: getValue(hsv, i, isLight), - }).toHexString(); - }; -})()`; -} -// It is hacky way to make this function will be compiled preferentially by less -// resolve error: `ReferenceError: colorPalette is not defined` -// https://github.com/ant-design/ant-motion/issues/44 -.colorPaletteMixin(); diff --git a/site/theme/style/color/colors.less b/site/theme/style/color/colors.less deleted file mode 100644 index 51540bf459..0000000000 --- a/site/theme/style/color/colors.less +++ /dev/null @@ -1,162 +0,0 @@ -@import 'colorPalette'; - -// color palettes -@blue-base: #1890ff; -@blue-1: color(~`colorPalette('@{blue-6}', 1) `); -@blue-2: color(~`colorPalette('@{blue-6}', 2) `); -@blue-3: color(~`colorPalette('@{blue-6}', 3) `); -@blue-4: color(~`colorPalette('@{blue-6}', 4) `); -@blue-5: color(~`colorPalette('@{blue-6}', 5) `); -@blue-6: @blue-base; -@blue-7: color(~`colorPalette('@{blue-6}', 7) `); -@blue-8: color(~`colorPalette('@{blue-6}', 8) `); -@blue-9: color(~`colorPalette('@{blue-6}', 9) `); -@blue-10: color(~`colorPalette('@{blue-6}', 10) `); - -@purple-base: #722ed1; -@purple-1: color(~`colorPalette('@{purple-6}', 1) `); -@purple-2: color(~`colorPalette('@{purple-6}', 2) `); -@purple-3: color(~`colorPalette('@{purple-6}', 3) `); -@purple-4: color(~`colorPalette('@{purple-6}', 4) `); -@purple-5: color(~`colorPalette('@{purple-6}', 5) `); -@purple-6: @purple-base; -@purple-7: color(~`colorPalette('@{purple-6}', 7) `); -@purple-8: color(~`colorPalette('@{purple-6}', 8) `); -@purple-9: color(~`colorPalette('@{purple-6}', 9) `); -@purple-10: color(~`colorPalette('@{purple-6}', 10) `); - -@cyan-base: #13c2c2; -@cyan-1: color(~`colorPalette('@{cyan-6}', 1) `); -@cyan-2: color(~`colorPalette('@{cyan-6}', 2) `); -@cyan-3: color(~`colorPalette('@{cyan-6}', 3) `); -@cyan-4: color(~`colorPalette('@{cyan-6}', 4) `); -@cyan-5: color(~`colorPalette('@{cyan-6}', 5) `); -@cyan-6: @cyan-base; -@cyan-7: color(~`colorPalette('@{cyan-6}', 7) `); -@cyan-8: color(~`colorPalette('@{cyan-6}', 8) `); -@cyan-9: color(~`colorPalette('@{cyan-6}', 9) `); -@cyan-10: color(~`colorPalette('@{cyan-6}', 10) `); - -@green-base: #52c41a; -@green-1: color(~`colorPalette('@{green-6}', 1) `); -@green-2: color(~`colorPalette('@{green-6}', 2) `); -@green-3: color(~`colorPalette('@{green-6}', 3) `); -@green-4: color(~`colorPalette('@{green-6}', 4) `); -@green-5: color(~`colorPalette('@{green-6}', 5) `); -@green-6: @green-base; -@green-7: color(~`colorPalette('@{green-6}', 7) `); -@green-8: color(~`colorPalette('@{green-6}', 8) `); -@green-9: color(~`colorPalette('@{green-6}', 9) `); -@green-10: color(~`colorPalette('@{green-6}', 10) `); - -@magenta-base: #eb2f96; -@magenta-1: color(~`colorPalette('@{magenta-6}', 1) `); -@magenta-2: color(~`colorPalette('@{magenta-6}', 2) `); -@magenta-3: color(~`colorPalette('@{magenta-6}', 3) `); -@magenta-4: color(~`colorPalette('@{magenta-6}', 4) `); -@magenta-5: color(~`colorPalette('@{magenta-6}', 5) `); -@magenta-6: @magenta-base; -@magenta-7: color(~`colorPalette('@{magenta-6}', 7) `); -@magenta-8: color(~`colorPalette('@{magenta-6}', 8) `); -@magenta-9: color(~`colorPalette('@{magenta-6}', 9) `); -@magenta-10: color(~`colorPalette('@{magenta-6}', 10) `); - -// alias of magenta -@pink-base: #eb2f96; -@pink-1: color(~`colorPalette('@{pink-6}', 1) `); -@pink-2: color(~`colorPalette('@{pink-6}', 2) `); -@pink-3: color(~`colorPalette('@{pink-6}', 3) `); -@pink-4: color(~`colorPalette('@{pink-6}', 4) `); -@pink-5: color(~`colorPalette('@{pink-6}', 5) `); -@pink-6: @pink-base; -@pink-7: color(~`colorPalette('@{pink-6}', 7) `); -@pink-8: color(~`colorPalette('@{pink-6}', 8) `); -@pink-9: color(~`colorPalette('@{pink-6}', 9) `); -@pink-10: color(~`colorPalette('@{pink-6}', 10) `); - -@red-base: #f5222d; -@red-1: color(~`colorPalette('@{red-6}', 1) `); -@red-2: color(~`colorPalette('@{red-6}', 2) `); -@red-3: color(~`colorPalette('@{red-6}', 3) `); -@red-4: color(~`colorPalette('@{red-6}', 4) `); -@red-5: color(~`colorPalette('@{red-6}', 5) `); -@red-6: @red-base; -@red-7: color(~`colorPalette('@{red-6}', 7) `); -@red-8: color(~`colorPalette('@{red-6}', 8) `); -@red-9: color(~`colorPalette('@{red-6}', 9) `); -@red-10: color(~`colorPalette('@{red-6}', 10) `); - -@orange-base: #fa8c16; -@orange-1: color(~`colorPalette('@{orange-6}', 1) `); -@orange-2: color(~`colorPalette('@{orange-6}', 2) `); -@orange-3: color(~`colorPalette('@{orange-6}', 3) `); -@orange-4: color(~`colorPalette('@{orange-6}', 4) `); -@orange-5: color(~`colorPalette('@{orange-6}', 5) `); -@orange-6: @orange-base; -@orange-7: color(~`colorPalette('@{orange-6}', 7) `); -@orange-8: color(~`colorPalette('@{orange-6}', 8) `); -@orange-9: color(~`colorPalette('@{orange-6}', 9) `); -@orange-10: color(~`colorPalette('@{orange-6}', 10) `); - -@yellow-base: #fadb14; -@yellow-1: color(~`colorPalette('@{yellow-6}', 1) `); -@yellow-2: color(~`colorPalette('@{yellow-6}', 2) `); -@yellow-3: color(~`colorPalette('@{yellow-6}', 3) `); -@yellow-4: color(~`colorPalette('@{yellow-6}', 4) `); -@yellow-5: color(~`colorPalette('@{yellow-6}', 5) `); -@yellow-6: @yellow-base; -@yellow-7: color(~`colorPalette('@{yellow-6}', 7) `); -@yellow-8: color(~`colorPalette('@{yellow-6}', 8) `); -@yellow-9: color(~`colorPalette('@{yellow-6}', 9) `); -@yellow-10: color(~`colorPalette('@{yellow-6}', 10) `); - -@volcano-base: #fa541c; -@volcano-1: color(~`colorPalette('@{volcano-6}', 1) `); -@volcano-2: color(~`colorPalette('@{volcano-6}', 2) `); -@volcano-3: color(~`colorPalette('@{volcano-6}', 3) `); -@volcano-4: color(~`colorPalette('@{volcano-6}', 4) `); -@volcano-5: color(~`colorPalette('@{volcano-6}', 5) `); -@volcano-6: @volcano-base; -@volcano-7: color(~`colorPalette('@{volcano-6}', 7) `); -@volcano-8: color(~`colorPalette('@{volcano-6}', 8) `); -@volcano-9: color(~`colorPalette('@{volcano-6}', 9) `); -@volcano-10: color(~`colorPalette('@{volcano-6}', 10) `); - -@geekblue-base: #2f54eb; -@geekblue-1: color(~`colorPalette('@{geekblue-6}', 1) `); -@geekblue-2: color(~`colorPalette('@{geekblue-6}', 2) `); -@geekblue-3: color(~`colorPalette('@{geekblue-6}', 3) `); -@geekblue-4: color(~`colorPalette('@{geekblue-6}', 4) `); -@geekblue-5: color(~`colorPalette('@{geekblue-6}', 5) `); -@geekblue-6: @geekblue-base; -@geekblue-7: color(~`colorPalette('@{geekblue-6}', 7) `); -@geekblue-8: color(~`colorPalette('@{geekblue-6}', 8) `); -@geekblue-9: color(~`colorPalette('@{geekblue-6}', 9) `); -@geekblue-10: color(~`colorPalette('@{geekblue-6}', 10) `); - -@lime-base: #a0d911; -@lime-1: color(~`colorPalette('@{lime-6}', 1) `); -@lime-2: color(~`colorPalette('@{lime-6}', 2) `); -@lime-3: color(~`colorPalette('@{lime-6}', 3) `); -@lime-4: color(~`colorPalette('@{lime-6}', 4) `); -@lime-5: color(~`colorPalette('@{lime-6}', 5) `); -@lime-6: @lime-base; -@lime-7: color(~`colorPalette('@{lime-6}', 7) `); -@lime-8: color(~`colorPalette('@{lime-6}', 8) `); -@lime-9: color(~`colorPalette('@{lime-6}', 9) `); -@lime-10: color(~`colorPalette('@{lime-6}', 10) `); - -@gold-base: #faad14; -@gold-1: color(~`colorPalette('@{gold-6}', 1) `); -@gold-2: color(~`colorPalette('@{gold-6}', 2) `); -@gold-3: color(~`colorPalette('@{gold-6}', 3) `); -@gold-4: color(~`colorPalette('@{gold-6}', 4) `); -@gold-5: color(~`colorPalette('@{gold-6}', 5) `); -@gold-6: @gold-base; -@gold-7: color(~`colorPalette('@{gold-6}', 7) `); -@gold-8: color(~`colorPalette('@{gold-6}', 8) `); -@gold-9: color(~`colorPalette('@{gold-6}', 9) `); -@gold-10: color(~`colorPalette('@{gold-6}', 10) `); - -@preset-colors: pink, magenta, red, volcano, orange, yellow, gold, cyan, lime, green, blue, geekblue, - purple; diff --git a/site/theme/style/color/tinyColor.less b/site/theme/style/color/tinyColor.less deleted file mode 100644 index e576c78687..0000000000 --- a/site/theme/style/color/tinyColor.less +++ /dev/null @@ -1,1184 +0,0 @@ -/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */ -.tinyColorMixin() { -@functions: ~`(function() { -// TinyColor v1.4.1 -// https://github.com/bgrins/TinyColor -// 2016-07-07, Brian Grinstead, MIT License -var trimLeft = /^\s+/, - trimRight = /\s+$/, - tinyCounter = 0, - mathRound = Math.round, - mathMin = Math.min, - mathMax = Math.max, - mathRandom = Math.random; - -function tinycolor (color, opts) { - - color = (color) ? color : ''; - opts = opts || { }; - - // If input is already a tinycolor, return itself - if (color instanceof tinycolor) { - return color; - } - // If we are called as a function, call using new instead - if (!(this instanceof tinycolor)) { - return new tinycolor(color, opts); - } - - var rgb = inputToRGB(color); - this._originalInput = color, - this._r = rgb.r, - this._g = rgb.g, - this._b = rgb.b, - this._a = rgb.a, - this._roundA = mathRound(100*this._a) / 100, - this._format = opts.format || rgb.format; - this._gradientType = opts.gradientType; - - // Don't let the range of [0,255] come back in [0,1]. - // Potentially lose a little bit of precision here, but will fix issues where - // .5 gets interpreted as half of the total, instead of half of 1 - // If it was supposed to be 128, this was already taken care of by inputToRgb - if (this._r < 1) { this._r = mathRound(this._r); } - if (this._g < 1) { this._g = mathRound(this._g); } - if (this._b < 1) { this._b = mathRound(this._b); } - - this._ok = rgb.ok; - this._tc_id = tinyCounter++; -} - -tinycolor.prototype = { - isDark: function() { - return this.getBrightness() < 128; - }, - isLight: function() { - return !this.isDark(); - }, - isValid: function() { - return this._ok; - }, - getOriginalInput: function() { - return this._originalInput; - }, - getFormat: function() { - return this._format; - }, - getAlpha: function() { - return this._a; - }, - getBrightness: function() { - //http://www.w3.org/TR/AERT#color-contrast - var rgb = this.toRgb(); - return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000; - }, - getLuminance: function() { - //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef - var rgb = this.toRgb(); - var RsRGB, GsRGB, BsRGB, R, G, B; - RsRGB = rgb.r/255; - GsRGB = rgb.g/255; - BsRGB = rgb.b/255; - - if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);} - if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);} - if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);} - return (0.2126 * R) + (0.7152 * G) + (0.0722 * B); - }, - setAlpha: function(value) { - this._a = boundAlpha(value); - this._roundA = mathRound(100*this._a) / 100; - return this; - }, - toHsv: function() { - var hsv = rgbToHsv(this._r, this._g, this._b); - return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a }; - }, - toHsvString: function() { - var hsv = rgbToHsv(this._r, this._g, this._b); - var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100); - return (this._a == 1) ? - "hsv(" + h + ", " + s + "%, " + v + "%)" : - "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")"; - }, - toHsl: function() { - var hsl = rgbToHsl(this._r, this._g, this._b); - return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a }; - }, - toHslString: function() { - var hsl = rgbToHsl(this._r, this._g, this._b); - var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100); - return (this._a == 1) ? - "hsl(" + h + ", " + s + "%, " + l + "%)" : - "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")"; - }, - toHex: function(allow3Char) { - return rgbToHex(this._r, this._g, this._b, allow3Char); - }, - toHexString: function(allow3Char) { - return '#' + this.toHex(allow3Char); - }, - toHex8: function(allow4Char) { - return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char); - }, - toHex8String: function(allow4Char) { - return '#' + this.toHex8(allow4Char); - }, - toRgb: function() { - return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a }; - }, - toRgbString: function() { - return (this._a == 1) ? - "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" : - "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")"; - }, - toPercentageRgb: function() { - return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a }; - }, - toPercentageRgbString: function() { - return (this._a == 1) ? - "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" : - "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")"; - }, - toName: function() { - if (this._a === 0) { - return "transparent"; - } - - if (this._a < 1) { - return false; - } - - return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false; - }, - toFilter: function(secondColor) { - var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a); - var secondHex8String = hex8String; - var gradientType = this._gradientType ? "GradientType = 1, " : ""; - - if (secondColor) { - var s = tinycolor(secondColor); - secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a); - } - - return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")"; - }, - toString: function(format) { - var formatSet = !!format; - format = format || this._format; - - var formattedString = false; - var hasAlpha = this._a < 1 && this._a >= 0; - var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name"); - - if (needsAlphaFormat) { - // Special case for "transparent", all other non-alpha formats - // will return rgba when there is transparency. - if (format === "name" && this._a === 0) { - return this.toName(); - } - return this.toRgbString(); - } - if (format === "rgb") { - formattedString = this.toRgbString(); - } - if (format === "prgb") { - formattedString = this.toPercentageRgbString(); - } - if (format === "hex" || format === "hex6") { - formattedString = this.toHexString(); - } - if (format === "hex3") { - formattedString = this.toHexString(true); - } - if (format === "hex4") { - formattedString = this.toHex8String(true); - } - if (format === "hex8") { - formattedString = this.toHex8String(); - } - if (format === "name") { - formattedString = this.toName(); - } - if (format === "hsl") { - formattedString = this.toHslString(); - } - if (format === "hsv") { - formattedString = this.toHsvString(); - } - - return formattedString || this.toHexString(); - }, - clone: function() { - return tinycolor(this.toString()); - }, - - _applyModification: function(fn, args) { - var color = fn.apply(null, [this].concat([].slice.call(args))); - this._r = color._r; - this._g = color._g; - this._b = color._b; - this.setAlpha(color._a); - return this; - }, - lighten: function() { - return this._applyModification(lighten, arguments); - }, - brighten: function() { - return this._applyModification(brighten, arguments); - }, - darken: function() { - return this._applyModification(darken, arguments); - }, - desaturate: function() { - return this._applyModification(desaturate, arguments); - }, - saturate: function() { - return this._applyModification(saturate, arguments); - }, - greyscale: function() { - return this._applyModification(greyscale, arguments); - }, - spin: function() { - return this._applyModification(spin, arguments); - }, - - _applyCombination: function(fn, args) { - return fn.apply(null, [this].concat([].slice.call(args))); - }, - analogous: function() { - return this._applyCombination(analogous, arguments); - }, - complement: function() { - return this._applyCombination(complement, arguments); - }, - monochromatic: function() { - return this._applyCombination(monochromatic, arguments); - }, - splitcomplement: function() { - return this._applyCombination(splitcomplement, arguments); - }, - triad: function() { - return this._applyCombination(triad, arguments); - }, - tetrad: function() { - return this._applyCombination(tetrad, arguments); - } -}; - -// If input is an object, force 1 into "1.0" to handle ratios properly -// String input requires "1.0" as input, so 1 will be treated as 1 -tinycolor.fromRatio = function(color, opts) { - if (typeof color == "object") { - var newColor = {}; - for (var i in color) { - if (color.hasOwnProperty(i)) { - if (i === "a") { - newColor[i] = color[i]; - } - else { - newColor[i] = convertToPercentage(color[i]); - } - } - } - color = newColor; - } - - return tinycolor(color, opts); -}; - -// Given a string or object, convert that input to RGB -// Possible string inputs: -// -// "red" -// "#f00" or "f00" -// "#ff0000" or "ff0000" -// "#ff000000" or "ff000000" -// "rgb 255 0 0" or "rgb (255, 0, 0)" -// "rgb 1.0 0 0" or "rgb (1, 0, 0)" -// "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" -// "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" -// "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" -// "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" -// "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" -// -function inputToRGB(color) { - - var rgb = { r: 0, g: 0, b: 0 }; - var a = 1; - var s = null; - var v = null; - var l = null; - var ok = false; - var format = false; - - if (typeof color == "string") { - color = stringInputToObject(color); - } - - if (typeof color == "object") { - if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) { - rgb = rgbToRgb(color.r, color.g, color.b); - ok = true; - format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"; - } - else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) { - s = convertToPercentage(color.s); - v = convertToPercentage(color.v); - rgb = hsvToRgb(color.h, s, v); - ok = true; - format = "hsv"; - } - else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) { - s = convertToPercentage(color.s); - l = convertToPercentage(color.l); - rgb = hslToRgb(color.h, s, l); - ok = true; - format = "hsl"; - } - - if (color.hasOwnProperty("a")) { - a = color.a; - } - } - - a = boundAlpha(a); - - return { - ok: ok, - format: color.format || format, - r: mathMin(255, mathMax(rgb.r, 0)), - g: mathMin(255, mathMax(rgb.g, 0)), - b: mathMin(255, mathMax(rgb.b, 0)), - a: a - }; -} - -// Conversion Functions -// -------------------- - -// rgbToHsl, rgbToHsv, hslToRgb, hsvToRgb modified from: -// - -// rgbToRgb -// Handle bounds / percentage checking to conform to CSS color spec -// -// *Assumes:* r, g, b in [0, 255] or [0, 1] -// *Returns:* { r, g, b } in [0, 255] -function rgbToRgb(r, g, b){ - return { - r: bound01(r, 255) * 255, - g: bound01(g, 255) * 255, - b: bound01(b, 255) * 255 - }; -} - -// rgbToHsl -// Converts an RGB color value to HSL. -// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] -// *Returns:* { h, s, l } in [0,1] -function rgbToHsl(r, g, b) { - - r = bound01(r, 255); - g = bound01(g, 255); - b = bound01(b, 255); - - var max = mathMax(r, g, b), min = mathMin(r, g, b); - var h, s, l = (max + min) / 2; - - if(max == min) { - h = s = 0; // achromatic - } - else { - var d = max - min; - s = l > 0.5 ? d / (2 - max - min) : d / (max + min); - switch(max) { - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - - h /= 6; - } - - return { h: h, s: s, l: l }; -} - -// hslToRgb -// Converts an HSL color value to RGB. -// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] -// *Returns:* { r, g, b } in the set [0, 255] -function hslToRgb(h, s, l) { - var r, g, b; - - h = bound01(h, 360); - s = bound01(s, 100); - l = bound01(l, 100); - - function hue2rgb(p, q, t) { - if(t < 0) t += 1; - if(t > 1) t -= 1; - if(t < 1/6) return p + (q - p) * 6 * t; - if(t < 1/2) return q; - if(t < 2/3) return p + (q - p) * (2/3 - t) * 6; - return p; - } - - if(s === 0) { - r = g = b = l; // achromatic - } - else { - var q = l < 0.5 ? l * (1 + s) : l + s - l * s; - var p = 2 * l - q; - r = hue2rgb(p, q, h + 1/3); - g = hue2rgb(p, q, h); - b = hue2rgb(p, q, h - 1/3); - } - - return { r: r * 255, g: g * 255, b: b * 255 }; -} - -// rgbToHsv -// Converts an RGB color value to HSV -// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] -// *Returns:* { h, s, v } in [0,1] -function rgbToHsv(r, g, b) { - - r = bound01(r, 255); - g = bound01(g, 255); - b = bound01(b, 255); - - var max = mathMax(r, g, b), min = mathMin(r, g, b); - var h, s, v = max; - - var d = max - min; - s = max === 0 ? 0 : d / max; - - if(max == min) { - h = 0; // achromatic - } - else { - switch(max) { - case r: h = (g - b) / d + (g < b ? 6 : 0); break; - case g: h = (b - r) / d + 2; break; - case b: h = (r - g) / d + 4; break; - } - h /= 6; - } - return { h: h, s: s, v: v }; -} - -// hsvToRgb -// Converts an HSV color value to RGB. -// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] -// *Returns:* { r, g, b } in the set [0, 255] - function hsvToRgb(h, s, v) { - - h = bound01(h, 360) * 6; - s = bound01(s, 100); - v = bound01(v, 100); - - var i = Math.floor(h), - f = h - i, - p = v * (1 - s), - q = v * (1 - f * s), - t = v * (1 - (1 - f) * s), - mod = i % 6, - r = [v, q, p, p, t, v][mod], - g = [t, v, v, q, p, p][mod], - b = [p, p, t, v, v, q][mod]; - - return { r: r * 255, g: g * 255, b: b * 255 }; -} - -// rgbToHex -// Converts an RGB color to hex -// Assumes r, g, and b are contained in the set [0, 255] -// Returns a 3 or 6 character hex -function rgbToHex(r, g, b, allow3Char) { - - var hex = [ - pad2(mathRound(r).toString(16)), - pad2(mathRound(g).toString(16)), - pad2(mathRound(b).toString(16)) - ]; - - // Return a 3 character hex if possible - if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) { - return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); - } - - return hex.join(""); -} - -// rgbaToHex -// Converts an RGBA color plus alpha transparency to hex -// Assumes r, g, b are contained in the set [0, 255] and -// a in [0, 1]. Returns a 4 or 8 character rgba hex -function rgbaToHex(r, g, b, a, allow4Char) { - - var hex = [ - pad2(mathRound(r).toString(16)), - pad2(mathRound(g).toString(16)), - pad2(mathRound(b).toString(16)), - pad2(convertDecimalToHex(a)) - ]; - - // Return a 4 character hex if possible - if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) { - return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0); - } - - return hex.join(""); -} - -// rgbaToArgbHex -// Converts an RGBA color to an ARGB Hex8 string -// Rarely used, but required for "toFilter()" -function rgbaToArgbHex(r, g, b, a) { - - var hex = [ - pad2(convertDecimalToHex(a)), - pad2(mathRound(r).toString(16)), - pad2(mathRound(g).toString(16)), - pad2(mathRound(b).toString(16)) - ]; - - return hex.join(""); -} - -// equals -// Can be called with any tinycolor input -tinycolor.equals = function (color1, color2) { - if (!color1 || !color2) { return false; } - return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString(); -}; - -tinycolor.random = function() { - return tinycolor.fromRatio({ - r: mathRandom(), - g: mathRandom(), - b: mathRandom() - }); -}; - -// Modification Functions -// ---------------------- -// Thanks to less.js for some of the basics here -// - -function desaturate(color, amount) { - amount = (amount === 0) ? 0 : (amount || 10); - var hsl = tinycolor(color).toHsl(); - hsl.s -= amount / 100; - hsl.s = clamp01(hsl.s); - return tinycolor(hsl); -} - -function saturate(color, amount) { - amount = (amount === 0) ? 0 : (amount || 10); - var hsl = tinycolor(color).toHsl(); - hsl.s += amount / 100; - hsl.s = clamp01(hsl.s); - return tinycolor(hsl); -} - -function greyscale(color) { - return tinycolor(color).desaturate(100); -} - -function lighten (color, amount) { - amount = (amount === 0) ? 0 : (amount || 10); - var hsl = tinycolor(color).toHsl(); - hsl.l += amount / 100; - hsl.l = clamp01(hsl.l); - return tinycolor(hsl); -} - -function brighten(color, amount) { - amount = (amount === 0) ? 0 : (amount || 10); - var rgb = tinycolor(color).toRgb(); - rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100)))); - rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100)))); - rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100)))); - return tinycolor(rgb); -} - -function darken (color, amount) { - amount = (amount === 0) ? 0 : (amount || 10); - var hsl = tinycolor(color).toHsl(); - hsl.l -= amount / 100; - hsl.l = clamp01(hsl.l); - return tinycolor(hsl); -} - -// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue. -// Values outside of this range will be wrapped into this range. -function spin(color, amount) { - var hsl = tinycolor(color).toHsl(); - var hue = (hsl.h + amount) % 360; - hsl.h = hue < 0 ? 360 + hue : hue; - return tinycolor(hsl); -} - -// Combination Functions -// --------------------- -// Thanks to jQuery xColor for some of the ideas behind these -// - -function complement(color) { - var hsl = tinycolor(color).toHsl(); - hsl.h = (hsl.h + 180) % 360; - return tinycolor(hsl); -} - -function triad(color) { - var hsl = tinycolor(color).toHsl(); - var h = hsl.h; - return [ - tinycolor(color), - tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }), - tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l }) - ]; -} - -function tetrad(color) { - var hsl = tinycolor(color).toHsl(); - var h = hsl.h; - return [ - tinycolor(color), - tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }), - tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }), - tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l }) - ]; -} - -function splitcomplement(color) { - var hsl = tinycolor(color).toHsl(); - var h = hsl.h; - return [ - tinycolor(color), - tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}), - tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l}) - ]; -} - -function analogous(color, results, slices) { - results = results || 6; - slices = slices || 30; - - var hsl = tinycolor(color).toHsl(); - var part = 360 / slices; - var ret = [tinycolor(color)]; - - for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) { - hsl.h = (hsl.h + part) % 360; - ret.push(tinycolor(hsl)); - } - return ret; -} - -function monochromatic(color, results) { - results = results || 6; - var hsv = tinycolor(color).toHsv(); - var h = hsv.h, s = hsv.s, v = hsv.v; - var ret = []; - var modification = 1 / results; - - while (results--) { - ret.push(tinycolor({ h: h, s: s, v: v})); - v = (v + modification) % 1; - } - - return ret; -} - -// Utility Functions -// --------------------- - -tinycolor.mix = function(color1, color2, amount) { - amount = (amount === 0) ? 0 : (amount || 50); - - var rgb1 = tinycolor(color1).toRgb(); - var rgb2 = tinycolor(color2).toRgb(); - - var p = amount / 100; - - var rgba = { - r: ((rgb2.r - rgb1.r) * p) + rgb1.r, - g: ((rgb2.g - rgb1.g) * p) + rgb1.g, - b: ((rgb2.b - rgb1.b) * p) + rgb1.b, - a: ((rgb2.a - rgb1.a) * p) + rgb1.a - }; - - return tinycolor(rgba); -}; - -// Readability Functions -// --------------------- -// false -// tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false -tinycolor.isReadable = function(color1, color2, wcag2) { - var readability = tinycolor.readability(color1, color2); - var wcag2Parms, out; - - out = false; - - wcag2Parms = validateWCAG2Parms(wcag2); - switch (wcag2Parms.level + wcag2Parms.size) { - case "AAsmall": - case "AAAlarge": - out = readability >= 4.5; - break; - case "AAlarge": - out = readability >= 3; - break; - case "AAAsmall": - out = readability >= 7; - break; - } - return out; - -}; - -// mostReadable -// Given a base color and a list of possible foreground or background -// colors for that base, returns the most readable color. -// Optionally returns Black or White if the most readable color is unreadable. -// *Example* -// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255" -// tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff" -// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3" -// tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff" -tinycolor.mostReadable = function(baseColor, colorList, args) { - var bestColor = null; - var bestScore = 0; - var readability; - var includeFallbackColors, level, size ; - args = args || {}; - includeFallbackColors = args.includeFallbackColors ; - level = args.level; - size = args.size; - - for (var i= 0; i < colorList.length ; i++) { - readability = tinycolor.readability(baseColor, colorList[i]); - if (readability > bestScore) { - bestScore = readability; - bestColor = tinycolor(colorList[i]); - } - } - - if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) { - return bestColor; - } - else { - args.includeFallbackColors=false; - return tinycolor.mostReadable(baseColor,["#fff", "#000"],args); - } -}; - -// Big List of Colors -// ------------------ -// -var names = tinycolor.names = { - aliceblue: "f0f8ff", - antiquewhite: "faebd7", - aqua: "0ff", - aquamarine: "7fffd4", - azure: "f0ffff", - beige: "f5f5dc", - bisque: "ffe4c4", - black: "000", - blanchedalmond: "ffebcd", - blue: "00f", - blueviolet: "8a2be2", - brown: "a52a2a", - burlywood: "deb887", - burntsienna: "ea7e5d", - cadetblue: "5f9ea0", - chartreuse: "7fff00", - chocolate: "d2691e", - coral: "ff7f50", - cornflowerblue: "6495ed", - cornsilk: "fff8dc", - crimson: "dc143c", - cyan: "0ff", - darkblue: "00008b", - darkcyan: "008b8b", - darkgoldenrod: "b8860b", - darkgray: "a9a9a9", - darkgreen: "006400", - darkgrey: "a9a9a9", - darkkhaki: "bdb76b", - darkmagenta: "8b008b", - darkolivegreen: "556b2f", - darkorange: "ff8c00", - darkorchid: "9932cc", - darkred: "8b0000", - darksalmon: "e9967a", - darkseagreen: "8fbc8f", - darkslateblue: "483d8b", - darkslategray: "2f4f4f", - darkslategrey: "2f4f4f", - darkturquoise: "00ced1", - darkviolet: "9400d3", - deeppink: "ff1493", - deepskyblue: "00bfff", - dimgray: "696969", - dimgrey: "696969", - dodgerblue: "1e90ff", - firebrick: "b22222", - floralwhite: "fffaf0", - forestgreen: "228b22", - fuchsia: "f0f", - gainsboro: "dcdcdc", - ghostwhite: "f8f8ff", - gold: "ffd700", - goldenrod: "daa520", - gray: "808080", - green: "008000", - greenyellow: "adff2f", - grey: "808080", - honeydew: "f0fff0", - hotpink: "ff69b4", - indianred: "cd5c5c", - indigo: "4b0082", - ivory: "fffff0", - khaki: "f0e68c", - lavender: "e6e6fa", - lavenderblush: "fff0f5", - lawngreen: "7cfc00", - lemonchiffon: "fffacd", - lightblue: "add8e6", - lightcoral: "f08080", - lightcyan: "e0ffff", - lightgoldenrodyellow: "fafad2", - lightgray: "d3d3d3", - lightgreen: "90ee90", - lightgrey: "d3d3d3", - lightpink: "ffb6c1", - lightsalmon: "ffa07a", - lightseagreen: "20b2aa", - lightskyblue: "87cefa", - lightslategray: "789", - lightslategrey: "789", - lightsteelblue: "b0c4de", - lightyellow: "ffffe0", - lime: "0f0", - limegreen: "32cd32", - linen: "faf0e6", - magenta: "f0f", - maroon: "800000", - mediumaquamarine: "66cdaa", - mediumblue: "0000cd", - mediumorchid: "ba55d3", - mediumpurple: "9370db", - mediumseagreen: "3cb371", - mediumslateblue: "7b68ee", - mediumspringgreen: "00fa9a", - mediumturquoise: "48d1cc", - mediumvioletred: "c71585", - midnightblue: "191970", - mintcream: "f5fffa", - mistyrose: "ffe4e1", - moccasin: "ffe4b5", - navajowhite: "ffdead", - navy: "000080", - oldlace: "fdf5e6", - olive: "808000", - olivedrab: "6b8e23", - orange: "ffa500", - orangered: "ff4500", - orchid: "da70d6", - palegoldenrod: "eee8aa", - palegreen: "98fb98", - paleturquoise: "afeeee", - palevioletred: "db7093", - papayawhip: "ffefd5", - peachpuff: "ffdab9", - peru: "cd853f", - pink: "ffc0cb", - plum: "dda0dd", - powderblue: "b0e0e6", - purple: "800080", - rebeccapurple: "663399", - red: "f00", - rosybrown: "bc8f8f", - royalblue: "4169e1", - saddlebrown: "8b4513", - salmon: "fa8072", - sandybrown: "f4a460", - seagreen: "2e8b57", - seashell: "fff5ee", - sienna: "a0522d", - silver: "c0c0c0", - skyblue: "87ceeb", - slateblue: "6a5acd", - slategray: "708090", - slategrey: "708090", - snow: "fffafa", - springgreen: "00ff7f", - steelblue: "4682b4", - tan: "d2b48c", - teal: "008080", - thistle: "d8bfd8", - tomato: "ff6347", - turquoise: "40e0d0", - violet: "ee82ee", - wheat: "f5deb3", - white: "fff", - whitesmoke: "f5f5f5", - yellow: "ff0", - yellowgreen: "9acd32" -}; - -// Make it easy to access colors via hexNames[hex] -var hexNames = tinycolor.hexNames = flip(names); - -// Utilities -// --------- - -// { 'name1': 'val1' } becomes { 'val1': 'name1' } -function flip(o) { - var flipped = { }; - for (var i in o) { - if (o.hasOwnProperty(i)) { - flipped[o[i]] = i; - } - } - return flipped; -} - -// Return a valid alpha value [0,1] with all invalid values being set to 1 -function boundAlpha(a) { - a = parseFloat(a); - - if (isNaN(a) || a < 0 || a > 1) { - a = 1; - } - - return a; -} - -// Take input from [0, n] and return it as [0, 1] -function bound01(n, max) { - if (isOnePointZero(n)) { n = "100%"; } - - var processPercent = isPercentage(n); - n = mathMin(max, mathMax(0, parseFloat(n))); - - // Automatically convert percentage into number - if (processPercent) { - n = parseInt(n * max, 10) / 100; - } - - // Handle floating point rounding errors - if ((Math.abs(n - max) < 0.000001)) { - return 1; - } - - // Convert into [0, 1] range if it isn't already - return (n % max) / parseFloat(max); -} - -// Force a number between 0 and 1 -function clamp01(val) { - return mathMin(1, mathMax(0, val)); -} - -// Parse a base-16 hex value into a base-10 integer -function parseIntFromHex(val) { - return parseInt(val, 16); -} - -// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 -// -function isOnePointZero(n) { - return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1; -} - -// Check to see if string passed in is a percentage -function isPercentage(n) { - return typeof n === "string" && n.indexOf('%') != -1; -} - -// Force a hex value to have 2 characters -function pad2(c) { - return c.length == 1 ? '0' + c : '' + c; -} - -// Replace a decimal with it's percentage value -function convertToPercentage(n) { - if (n <= 1) { - n = (n * 100) + "%"; - } - - return n; -} - -// Converts a decimal to a hex value -function convertDecimalToHex(d) { - return Math.round(parseFloat(d) * 255).toString(16); -} -// Converts a hex value to a decimal -function convertHexToDecimal(h) { - return (parseIntFromHex(h) / 255); -} - -var matchers = (function() { - - // - var CSS_INTEGER = "[-\\+]?\\d+%?"; - - // - var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; - - // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome. - var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; - - // Actual matching. - // Parentheses and commas are optional, but not required. - // Whitespace can take the place of commas or opening paren - var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; - var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; - - return { - CSS_UNIT: new RegExp(CSS_UNIT), - rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), - rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), - hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), - hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), - hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), - hsva: new RegExp("hsva" + PERMISSIVE_MATCH4), - hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, - hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, - hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, - hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ - }; -})(); - -// isValidCSSUnit -// Take in a single string / number and check to see if it looks like a CSS unit -// (see matchers above for definition). -function isValidCSSUnit(color) { - return !!matchers.CSS_UNIT.exec(color); -} - -// stringInputToObject -// Permissive string parsing. Take in a number of formats, and output an object -// based on detected format. Returns { r, g, b } or { h, s, l } or { h, s, v} -function stringInputToObject(color) { - - color = color.replace(trimLeft, '').replace(trimRight, '').toLowerCase(); - var named = false; - if (names[color]) { - color = names[color]; - named = true; - } - else if (color == 'transparent') { - return { r: 0, g: 0, b: 0, a: 0, format: "name" }; - } - - // Try to match string input using regular expressions. - // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360] - // Just return an object and let the conversion functions handle that. - // This way the result will be the same whether the tinycolor is initialized with string or object. - var match; - if ((match = matchers.rgb.exec(color))) { - return { r: match[1], g: match[2], b: match[3] }; - } - if ((match = matchers.rgba.exec(color))) { - return { r: match[1], g: match[2], b: match[3], a: match[4] }; - } - if ((match = matchers.hsl.exec(color))) { - return { h: match[1], s: match[2], l: match[3] }; - } - if ((match = matchers.hsla.exec(color))) { - return { h: match[1], s: match[2], l: match[3], a: match[4] }; - } - if ((match = matchers.hsv.exec(color))) { - return { h: match[1], s: match[2], v: match[3] }; - } - if ((match = matchers.hsva.exec(color))) { - return { h: match[1], s: match[2], v: match[3], a: match[4] }; - } - if ((match = matchers.hex8.exec(color))) { - return { - r: parseIntFromHex(match[1]), - g: parseIntFromHex(match[2]), - b: parseIntFromHex(match[3]), - a: convertHexToDecimal(match[4]), - format: named ? "name" : "hex8" - }; - } - if ((match = matchers.hex6.exec(color))) { - return { - r: parseIntFromHex(match[1]), - g: parseIntFromHex(match[2]), - b: parseIntFromHex(match[3]), - format: named ? "name" : "hex" - }; - } - if ((match = matchers.hex4.exec(color))) { - return { - r: parseIntFromHex(match[1] + '' + match[1]), - g: parseIntFromHex(match[2] + '' + match[2]), - b: parseIntFromHex(match[3] + '' + match[3]), - a: convertHexToDecimal(match[4] + '' + match[4]), - format: named ? "name" : "hex8" - }; - } - if ((match = matchers.hex3.exec(color))) { - return { - r: parseIntFromHex(match[1] + '' + match[1]), - g: parseIntFromHex(match[2] + '' + match[2]), - b: parseIntFromHex(match[3] + '' + match[3]), - format: named ? "name" : "hex" - }; - } - - return false; -} - -function validateWCAG2Parms(parms) { - // return valid WCAG2 parms for isReadable. - // If input parms are invalid, return {"level":"AA", "size":"small"} - var level, size; - parms = parms || {"level":"AA", "size":"small"}; - level = (parms.level || "AA").toUpperCase(); - size = (parms.size || "small").toLowerCase(); - if (level !== "AA" && level !== "AAA") { - level = "AA"; - } - if (size !== "small" && size !== "large") { - size = "small"; - } - return {"level":level, "size":size}; -} - -this.tinycolor = tinycolor; - -})()`; -} -// It is hacky way to make this function will be compiled preferentially by less -// resolve error: `ReferenceError: colorPalette is not defined` -// https://github.com/ant-design/ant-motion/issues/44 -.tinyColorMixin(); diff --git a/site/theme/style/compact.less b/site/theme/style/compact.less deleted file mode 100644 index ef0008ba3c..0000000000 --- a/site/theme/style/compact.less +++ /dev/null @@ -1,4 +0,0 @@ -@root-entry-name: default; - -@import './themes/compact.less'; -@import './core/index'; diff --git a/site/theme/style/core/global.less b/site/theme/style/core/global.less deleted file mode 100644 index cb26cce389..0000000000 --- a/site/theme/style/core/global.less +++ /dev/null @@ -1,491 +0,0 @@ -/* stylelint-disable property-no-vendor-prefix, at-rule-no-vendor-prefix */ - -// Reboot -// -// Normalization of HTML elements, manually forked from Normalize.css to remove -// styles targeting irrelevant browsers while applying new styles. -// -// Normalize is licensed MIT. https://github.com/necolas/normalize.css - -// HTML & Body reset -@{html-selector}, -body { - .square(100%); -} - -// remove the clear button of a text input control in IE10+ -input::-ms-clear, -input::-ms-reveal { - display: none; -} - -// Document -// -// 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`. -// 2. Change the default font family in all browsers. -// 3. Correct the line height in all browsers. -// 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS. -// 5. Setting @viewport causes scrollbars to overlap content in IE11 and Edge, so -// we force a non-overlapping, non-auto-hiding scrollbar to counteract. -// 6. Change the default tap highlight to be completely transparent in iOS. - -*, -*::before, -*::after { - box-sizing: border-box; // 1 -} - -@{html-selector} { - font-family: sans-serif; // 2 - line-height: 1.15; // 3 - -webkit-text-size-adjust: 100%; // 4 - -ms-text-size-adjust: 100%; // 4 - -ms-overflow-style: scrollbar; // 5 - -webkit-tap-highlight-color: fade(@black, 0%); // 6 -} - -// IE10+ doesn't honor `` in some cases. -@-ms-viewport { - width: device-width; -} - -// Body -// -// 1. remove the margin in all browsers. -// 2. As a best practice, apply a default `body-background`. - -body { - margin: 0; // 1 - color: @text-color; - font-size: @font-size-base; - font-family: @font-family; - font-variant: @font-variant-base; - line-height: @line-height-base; - background-color: @body-background; // 2 - font-feature-settings: @font-feature-settings-base; -} - -// Suppress the focus outline on elements that cannot be accessed via keyboard. -// This prevents an unwanted focus outline from appearing around elements that -// might still respond to pointer events. -// -// Credit: https://github.com/suitcss/base -[tabindex='-1']:focus { - outline: none !important; -} - -// Content grouping -// -// 1. Add the correct box sizing in Firefox. -// 2. Show the overflow in Edge and IE. - -hr { - box-sizing: content-box; // 1 - height: 0; // 1 - overflow: visible; // 2 -} - -// -// Typography -// - -// remove top margins from headings -// -// By default, `

`-`

` all receive top and bottom margins. We nuke the top -// margin for easier control within type scales as it avoids margin collapsing. -h1, -h2, -h3, -h4, -h5, -h6 { - margin-top: 0; - margin-bottom: 0.5em; - color: @heading-color; - font-weight: 500; -} - -// Reset margins on paragraphs -// -// Similarly, the top margin on `

`s get reset. However, we also reset the -// bottom margin to use `em` units instead of `em`. -p { - margin-top: 0; - margin-bottom: 1em; -} - -// Abbreviations -// -// 1. remove the bottom border in Firefox 39-. -// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. -// 3. Add explicit cursor to indicate changed behavior. -// 4. Duplicate behavior to the data-* attribute for our tooltip plugin - -abbr[title], -abbr[data-original-title] { - // 4 - text-decoration: underline; // 2 - text-decoration: underline dotted; // 2 - border-bottom: 0; // 1 - cursor: help; // 3 -} - -address { - margin-bottom: 1em; - font-style: normal; - line-height: inherit; -} - -input[type='text'], -input[type='password'], -input[type='number'], -textarea { - -webkit-appearance: none; -} - -ol, -ul, -dl { - margin-top: 0; - margin-bottom: 1em; -} - -ol ol, -ul ul, -ol ul, -ul ol { - margin-bottom: 0; -} - -dt { - font-weight: 500; -} - -dd { - margin-bottom: 0.5em; - margin-left: 0; // Undo browser default -} - -blockquote { - margin: 0 0 1em; -} - -dfn { - font-style: italic; // Add the correct font style in Android 4.3- -} - -b, -strong { - font-weight: bolder; // Add the correct font weight in Chrome, Edge, and Safari -} - -small { - font-size: 80%; // Add the correct font size in all browsers -} - -// -// Prevent `sub` and `sup` elements from affecting the line height in -// all browsers. -// - -sub, -sup { - position: relative; - font-size: 75%; - line-height: 0; - vertical-align: baseline; -} - -sub { - bottom: -0.25em; -} - -sup { - top: -0.5em; -} - -// -// Links -// - -a { - color: @link-color; - text-decoration: @link-decoration; - background-color: transparent; // remove the gray background on active links in IE 10. - outline: none; - cursor: pointer; - transition: color 0.3s; - -webkit-text-decoration-skip: objects; // remove gaps in links underline in iOS 8+ and Safari 8+. - - &:hover { - color: @link-hover-color; - } - - &:active { - color: @link-active-color; - } - - &:active, - &:hover { - text-decoration: @link-hover-decoration; - outline: 0; - } - - // https://github.com/ant-design/ant-design/issues/22503 - &:focus { - text-decoration: @link-focus-decoration; - outline: @link-focus-outline; - } - - &[disabled] { - color: @disabled-color; - cursor: not-allowed; - } -} - -// -// Code -// - -pre, -code, -kbd, -samp { - font-size: 1em; // Correct the odd `em` font sizing in all browsers. - font-family: @code-family; -} - -pre { - // remove browser default top margin - margin-top: 0; - // Reset browser default of `1em` to use `em`s - margin-bottom: 1em; - // Don't allow content to break outside - overflow: auto; -} - -// -// Figures -// -figure { - // Apply a consistent margin strategy (matches our type styles). - margin: 0 0 1em; -} - -// -// Images and content -// - -img { - vertical-align: middle; - border-style: none; // remove the border on images inside links in IE 10-. -} - -// Avoid 300ms click delay on touch devices that support the `touch-action` CSS property. -// -// In particular, unlike most other browsers, IE11+Edge on Windows 10 on touch devices and IE Mobile 10-11 -// DON'T remove the click delay when `` is present. -// However, they DO support emoving the click delay via `touch-action: manipulation`. -// See: -// * https://getbootstrap.com/docs/4.0/content/reboot/#click-delay-optimization-for-touch -// * http://caniuse.com/#feat=css-touch-action -// * https://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay - -a, -area, -button, -[role='button'], -input:not([type='range']), -label, -select, -summary, -textarea { - touch-action: manipulation; -} - -// -// Tables -// - -table { - border-collapse: collapse; // Prevent double borders -} - -caption { - padding-top: 0.75em; - padding-bottom: 0.3em; - color: @text-color-secondary; - text-align: left; - caption-side: bottom; -} - -// -// Forms -// - -input, -button, -select, -optgroup, -textarea { - margin: 0; // remove the margin in Firefox and Safari - color: inherit; - font-size: inherit; - font-family: inherit; - line-height: inherit; -} - -button, -input { - overflow: visible; // Show the overflow in Edge -} - -button, -select { - text-transform: none; // remove the inheritance of text transform in Firefox -} - -// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` -// controls in Android 4. -// 2. Correct the inability to style clickable types in iOS and Safari. -button, -@{html-selector} [type="button"], /* 1 */ -[type="reset"], -[type="submit"] { - -webkit-appearance: button; // 2 -} - -// remove inner border and padding from Firefox, but don't restore the outline like Normalize. -button::-moz-focus-inner, -[type='button']::-moz-focus-inner, -[type='reset']::-moz-focus-inner, -[type='submit']::-moz-focus-inner { - padding: 0; - border-style: none; -} - -input[type='radio'], -input[type='checkbox'] { - box-sizing: border-box; // 1. Add the correct box sizing in IE 10- - padding: 0; // 2. remove the padding in IE 10- -} - -input[type='date'], -input[type='time'], -input[type='datetime-local'], -input[type='month'] { - // remove the default appearance of temporal inputs to avoid a Mobile Safari - // bug where setting a custom line-height prevents text from being vertically - // centered within the input. - // See https://bugs.webkit.org/show_bug.cgi?id=139848 - // and https://github.com/twbs/bootstrap/issues/11266 - -webkit-appearance: listbox; -} - -textarea { - overflow: auto; // remove the default vertical scrollbar in IE. - // Textareas should really only resize vertically so they don't break their (horizontal) containers. - resize: vertical; -} - -fieldset { - // Browsers set a default `min-width: min-content;` on fieldsets, - // unlike e.g. `

`s, which have `min-width: 0;` by default. - // So we reset that to ensure fieldsets behave more like a standard block element. - // See https://github.com/twbs/bootstrap/issues/12359 - // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements - min-width: 0; - margin: 0; - // Reset the default outline behavior of fieldsets so they don't affect page layout. - padding: 0; - border: 0; -} - -// 1. Correct the text wrapping in Edge and IE. -// 2. Correct the color inheritance from `fieldset` elements in IE. -legend { - display: block; - width: 100%; - max-width: 100%; // 1 - margin-bottom: 0.5em; - padding: 0; - color: inherit; // 2 - font-size: 1.5em; - line-height: inherit; - white-space: normal; // 1 -} - -progress { - vertical-align: baseline; // Add the correct vertical alignment in Chrome, Firefox, and Opera. -} - -// Correct the cursor style of incement and decement buttons in Chrome. -[type='number']::-webkit-inner-spin-button, -[type='number']::-webkit-outer-spin-button { - height: auto; -} - -[type='search'] { - // This overrides the extra rounded corners on search inputs in iOS so that our - // `.form-control` class can properly style them. Note that this cannot simply - // be added to `.form-control` as it's not specific enough. For details, see - // https://github.com/twbs/bootstrap/issues/11586. - outline-offset: -2px; // 2. Correct the outline style in Safari. - -webkit-appearance: none; -} - -// -// remove the inner padding and cancel buttons in Chrome and Safari on macOS. -// - -[type='search']::-webkit-search-cancel-button, -[type='search']::-webkit-search-decoration { - -webkit-appearance: none; -} - -// -// 1. Correct the inability to style clickable types in iOS and Safari. -// 2. Change font properties to `inherit` in Safari. -// - -::-webkit-file-upload-button { - font: inherit; // 2 - -webkit-appearance: button; // 1 -} - -// -// Correct element displays -// - -output { - display: inline-block; -} - -summary { - display: list-item; // Add the correct display in all browsers -} - -template { - display: none; // Add the correct display in IE -} - -// Always hide an element with the `hidden` HTML attribute (from PureCSS). -// Needed for proper display in IE 10-. -[hidden] { - display: none !important; -} - -mark { - padding: 0.2em; - background-color: @yellow-1; -} - -::selection { - color: @text-color-inverse; - background: @text-selection-bg; -} - -// Utility classes -.clearfix { - .clearfix(); -} diff --git a/site/theme/style/core/iconfont.less b/site/theme/style/core/iconfont.less deleted file mode 100644 index 597b8549e9..0000000000 --- a/site/theme/style/core/iconfont.less +++ /dev/null @@ -1,22 +0,0 @@ -@import '../themes/index'; -@import '../mixins/iconfont'; - -.@{iconfont-css-prefix} { - .iconfont-mixin(); - - // https://github.com/ant-design/ant-design/issues/33703 - & > & { - line-height: 0; - vertical-align: 0; - } - - &[tabindex] { - cursor: pointer; - } -} - -.@{iconfont-css-prefix}-spin, -.@{iconfont-css-prefix}-spin::before { - display: inline-block; - animation: loadingCircle 1s infinite linear; -} diff --git a/site/theme/style/core/index.less b/site/theme/style/core/index.less deleted file mode 100644 index d2be2092da..0000000000 --- a/site/theme/style/core/index.less +++ /dev/null @@ -1,3 +0,0 @@ -@import '../mixins/index'; -@import '../themes/index'; -@import 'global'; diff --git a/site/theme/style/dark.less b/site/theme/style/dark.less deleted file mode 100644 index 12a37313e3..0000000000 --- a/site/theme/style/dark.less +++ /dev/null @@ -1,4 +0,0 @@ -@root-entry-name: default; - -@import './themes/dark.less'; -@import './core/index'; diff --git a/site/theme/style/default.less b/site/theme/style/default.less deleted file mode 100644 index ecec084536..0000000000 --- a/site/theme/style/default.less +++ /dev/null @@ -1,4 +0,0 @@ -// This is same as `index.less` but given `root-entry-name` for `dist/antd.less` usage -@root-entry-name: default; - -@import './index'; diff --git a/site/theme/style/index.less b/site/theme/style/index.less deleted file mode 100644 index 2a2b00d858..0000000000 --- a/site/theme/style/index.less +++ /dev/null @@ -1 +0,0 @@ -@import './core/index'; diff --git a/site/theme/style/index.tsx b/site/theme/style/index.tsx deleted file mode 100644 index d74e52ee9f..0000000000 --- a/site/theme/style/index.tsx +++ /dev/null @@ -1 +0,0 @@ -import './index.less'; diff --git a/site/theme/style/mixins/box.less b/site/theme/style/mixins/box.less deleted file mode 100644 index 4bd3ffad73..0000000000 --- a/site/theme/style/mixins/box.less +++ /dev/null @@ -1,7 +0,0 @@ -.box(@position: absolute) { - position: @position; - top: 0; - right: 0; - bottom: 0; - left: 0; -} diff --git a/site/theme/style/mixins/clearfix.less b/site/theme/style/mixins/clearfix.less deleted file mode 100644 index 07e89f8012..0000000000 --- a/site/theme/style/mixins/clearfix.less +++ /dev/null @@ -1,16 +0,0 @@ -// mixins for clearfix -// ------------------------ -.clearfix() { - // https://github.com/ant-design/ant-design/issues/21301#issuecomment-583955229 - &::before { - display: table; - content: ''; - } - - &::after { - // https://github.com/ant-design/ant-design/issues/21864 - display: table; - clear: both; - content: ''; - } -} diff --git a/site/theme/style/mixins/compatibility.less b/site/theme/style/mixins/compatibility.less deleted file mode 100644 index 9464a754a7..0000000000 --- a/site/theme/style/mixins/compatibility.less +++ /dev/null @@ -1,13 +0,0 @@ -// Compatibility for browsers. - -// Placeholder text -.placeholder(@color: @input-placeholder-color) { - &::placeholder { - color: @color; - user-select: none; // https://github.com/ant-design/ant-design/pull/32639 - } - - &:placeholder-shown { - text-overflow: ellipsis; - } -} diff --git a/site/theme/style/mixins/index.less b/site/theme/style/mixins/index.less deleted file mode 100644 index 3f1a0ce71c..0000000000 --- a/site/theme/style/mixins/index.less +++ /dev/null @@ -1,7 +0,0 @@ -// Mixins -// -------------------------------------------------- -@import 'size'; -@import 'clearfix'; -@import 'box'; -@import 'reset'; -@import 'operation-unit'; diff --git a/site/theme/style/mixins/modal-mask.less b/site/theme/style/mixins/modal-mask.less deleted file mode 100644 index b406bc1b41..0000000000 --- a/site/theme/style/mixins/modal-mask.less +++ /dev/null @@ -1,30 +0,0 @@ -@import 'box'; - -.modal-mask() { - pointer-events: none; - - &.@{ant-prefix}-zoom-enter, - &.@{ant-prefix}-zoom-appear { - transform: none; // reset scale avoid mousePosition bug - opacity: 0; - animation-duration: @animation-duration-slow; - user-select: none; // https://github.com/ant-design/ant-design/issues/11777 - } - - &-mask { - .box(fixed); - z-index: @zindex-modal-mask; - height: 100%; - background-color: @modal-mask-bg; - - &-hidden { - display: none; - } - } - - &-wrap { - .box(fixed); - overflow: auto; - outline: 0; - } -} diff --git a/site/theme/style/mixins/operation-unit.less b/site/theme/style/mixins/operation-unit.less deleted file mode 100644 index b69517111b..0000000000 --- a/site/theme/style/mixins/operation-unit.less +++ /dev/null @@ -1,15 +0,0 @@ -.operation-unit() { - color: @link-color; - outline: none; - cursor: pointer; - transition: color 0.3s; - - &:focus-visible, - &:hover { - color: @link-hover-color; - } - - &:active { - color: @link-active-color; - } -} diff --git a/site/theme/style/mixins/reset.less b/site/theme/style/mixins/reset.less deleted file mode 100644 index 905c16e247..0000000000 --- a/site/theme/style/mixins/reset.less +++ /dev/null @@ -1,11 +0,0 @@ -.reset-component() { - box-sizing: border-box; - margin: 0; - padding: 0; - color: @text-color; - font-size: @font-size-base; - font-variant: @font-variant-base; - line-height: @line-height-base; - list-style: none; - font-feature-settings: @font-feature-settings-base; -} diff --git a/site/theme/style/mixins/rounded-arrow.less b/site/theme/style/mixins/rounded-arrow.less deleted file mode 100644 index 1c8264336d..0000000000 --- a/site/theme/style/mixins/rounded-arrow.less +++ /dev/null @@ -1,44 +0,0 @@ -.roundedArrow(@width, @outer-radius, @bg-color: var(--antd-arrow-background-color)) { - @corner-height: unit(((@outer-radius) * (1 - 1 / sqrt(2)))); - - @width-without-unit: unit(@width); - @outer-radius-without-unit: unit(@outer-radius); - @inner-radius-without-unit: unit(@arrow-border-radius); - - @a-x: @width-without-unit - @corner-height; - @a-y: 2 * @width-without-unit + @corner-height; - @b-x: @a-x + @outer-radius-without-unit * (1 / sqrt(2)); - @b-y: 2 * @width-without-unit; - @c-x: 2 * @width-without-unit - @inner-radius-without-unit; - @c-y: 2 * @width-without-unit; - @d-x: 2 * @width-without-unit; - @d-y: 2 * @width-without-unit - @inner-radius-without-unit; - @e-x: 2 * @width-without-unit; - @e-y: @f-y + @outer-radius-without-unit * (1 / sqrt(2)); - @f-x: 2 * @width-without-unit + @corner-height; - @f-y: @width-without-unit - @corner-height; - @g-x: @f-x - 1; - @g-y: @f-y; - @h-x: @a-x; - @h-y: @a-y - 1; - - border-radius: 0 0 @arrow-border-radius; - pointer-events: none; - - &::before { - position: absolute; - top: -@width; - left: -@width; - width: @width * 3; - height: @width * 3; - background: @bg-color; - // Hack firefox: https://github.com/ant-design/ant-design/pull/33710#issuecomment-1015287825 - background-repeat: no-repeat; - background-position: ceil(-@width + 1px) ceil(-@width + 1px); - content: ''; - clip-path: inset(33% 33%); // For browsers that do not support path() - clip-path: path( - 'M @{a-x} @{a-y} A @{outer-radius-without-unit} @{outer-radius-without-unit} 0 0 1 @{b-x} @{b-y} L @{c-x} @{c-y} A @{inner-radius-without-unit} @{inner-radius-without-unit} 0 0 0 @{d-x} @{d-y} L @{e-x} @{e-y} A @{outer-radius-without-unit} @{outer-radius-without-unit} 0 0 1 @{f-x} @{f-y} L @{g-x} @{g-y} L @{h-x} @{h-y} Z' - ); - } -} diff --git a/site/theme/style/mixins/size.less b/site/theme/style/mixins/size.less deleted file mode 100644 index a8be650896..0000000000 --- a/site/theme/style/mixins/size.less +++ /dev/null @@ -1,10 +0,0 @@ -// Sizing shortcuts - -.size(@width; @height) { - width: @width; - height: @height; -} - -.square(@size) { - .size(@size; @size); -} diff --git a/site/theme/style/themes/compact.less b/site/theme/style/themes/compact.less deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/site/theme/style/themes/dark.less b/site/theme/style/themes/dark.less deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/site/theme/style/themes/default.less b/site/theme/style/themes/default.less deleted file mode 100644 index 7321f9b20b..0000000000 --- a/site/theme/style/themes/default.less +++ /dev/null @@ -1,1084 +0,0 @@ -/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ -@import '../color/colors'; - -@theme: default; - -// The prefix to use on all css classes from ant. -@ant-prefix: ant; - -// An override for the html selector for theme prefixes -@html-selector: html; - -// [CSS-VARIABLE-REPLACE-BEGIN: html-variables] -// [CSS-VARIABLE-REPLACE-END: html-variables] - -// -------- Colors ----------- -// >>> Primary -@primary-color: @blue-6; -@primary-color-hover: color(~`colorPalette('@{primary-color}', 5) `); -@primary-color-active: color(~`colorPalette('@{primary-color}', 7) `); -@primary-color-outline: fade(@primary-color, @outline-fade); - -@processing-color: @blue-6; - -// >>> Info -@info-color: @primary-color; -@info-color-deprecated-bg: color(~`colorPalette('@{info-color}', 1) `); -@info-color-deprecated-border: color(~`colorPalette('@{info-color}', 3) `); - -// >>> Success -@success-color: @green-6; -@success-color-hover: color(~`colorPalette('@{success-color}', 5) `); -@success-color-active: color(~`colorPalette('@{success-color}', 7) `); -@success-color-outline: fade(@success-color, @outline-fade); -@success-color-deprecated-bg: color(~`colorPalette('@{success-color}', 1) `); -@success-color-deprecated-border: color(~`colorPalette('@{success-color}', 3) `); - -// >>> Warning -@warning-color: @gold-6; -@warning-color-hover: color(~`colorPalette('@{warning-color}', 5) `); -@warning-color-active: color(~`colorPalette('@{warning-color}', 7) `); -@warning-color-outline: fade(@warning-color, @outline-fade); -@warning-color-deprecated-bg: color(~`colorPalette('@{warning-color}', 1) `); -@warning-color-deprecated-border: color(~`colorPalette('@{warning-color}', 3) `); - -// >>> Error -@error-color: @red-5; -@error-color-hover: color(~`colorPalette('@{error-color}', 5) `); -@error-color-active: color(~`colorPalette('@{error-color}', 7) `); -@error-color-outline: fade(@error-color, @outline-fade); -@error-color-deprecated-bg: color(~`colorPalette('@{error-color}', 1) `); -@error-color-deprecated-border: color(~`colorPalette('@{error-color}', 3) `); - -@highlight-color: @red-5; -@normal-color: #d9d9d9; -@white: #fff; -@black: #000; - -// Color used by default to control hover and active backgrounds and for -// alert info backgrounds. -@primary-1: color(~`colorPalette('@{primary-color}', 1) `); // replace tint(@primary-color, 90%) -@primary-2: color(~`colorPalette('@{primary-color}', 2) `); // replace tint(@primary-color, 80%) -@primary-3: color(~`colorPalette('@{primary-color}', 3) `); // unused -@primary-4: color(~`colorPalette('@{primary-color}', 4) `); // unused -@primary-5: color( - ~`colorPalette('@{primary-color}', 5) ` -); // color used to control the text color in many active and hover states, replace tint(@primary-color, 20%) -@primary-6: @primary-color; // color used to control the text color of active buttons, don't use, use @primary-color -@primary-7: color(~`colorPalette('@{primary-color}', 7) `); // replace shade(@primary-color, 5%) -@primary-8: color(~`colorPalette('@{primary-color}', 8) `); // unused -@primary-9: color(~`colorPalette('@{primary-color}', 9) `); // unused -@primary-10: color(~`colorPalette('@{primary-color}', 10) `); // unused - -// Base Scaffolding Variables -// --- - -// Background color for `` -@body-background: #fff; -// Base background color for most components -@component-background: #fff; -// Popover background color -@popover-background: @component-background; -@popover-customize-border-color: @border-color-split; -@font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, - 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', - 'Noto Color Emoji'; -@code-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; -@text-color: fade(@black, 85%); -@text-color-secondary: fade(@black, 45%); -@text-color-inverse: @white; -@icon-color: inherit; -@icon-color-hover: fade(@black, 75%); -@heading-color: fade(@black, 85%); -@text-color-dark: fade(@white, 85%); -@text-color-secondary-dark: fade(@white, 65%); -@text-selection-bg: @primary-color; -@font-variant-base: tabular-nums; -@font-feature-settings-base: 'tnum'; -@font-size-base: 14px; -@font-size-lg: @font-size-base + 2px; -@font-size-sm: 12px; -@heading-1-size: ceil(@font-size-base * 2.71); -@heading-2-size: ceil(@font-size-base * 2.14); -@heading-3-size: ceil(@font-size-base * 1.71); -@heading-4-size: ceil(@font-size-base * 1.42); -@heading-5-size: ceil(@font-size-base * 1.14); -// https://github.com/ant-design/ant-design/issues/20210 -@line-height-base: 1.5715; -@border-radius-base: 2px; -@border-radius-sm: 2px; - -// control border -@control-border-radius: @border-radius-base; - -// arrow border -@arrow-border-radius: 2px; - -// vertical paddings -@padding-lg: 24px; // containers -@padding-md: 16px; // small containers and buttons -@padding-sm: 12px; // Form controls and items -@padding-xs: 8px; // small items -@padding-xss: 4px; // more small - -// vertical padding for all form controls -@control-padding-horizontal: @padding-sm; -@control-padding-horizontal-sm: @padding-xs; - -// vertical margins -@margin-lg: 24px; // containers -@margin-md: 16px; // small containers and buttons -@margin-sm: 12px; // Form controls and items -@margin-xs: 8px; // small items -@margin-xss: 4px; // more small - -// height rules -@height-base: 32px; -@height-lg: 40px; -@height-sm: 24px; - -// The background colors for active and hover states for things like -// list items or table cells. -@item-active-bg: @primary-1; -@item-hover-bg: #f5f5f5; - -// ICONFONT -@iconfont-css-prefix: anticon; - -// LINK -@link-color: @primary-color; -@link-hover-color: color(~`colorPalette('@{link-color}', 5) `); -@link-active-color: color(~`colorPalette('@{link-color}', 7) `); -@link-decoration: none; -@link-hover-decoration: none; -@link-focus-decoration: none; -@link-focus-outline: 0; - -// Animation -@ease-base-out: cubic-bezier(0.7, 0.3, 0.1, 1); -@ease-base-in: cubic-bezier(0.9, 0, 0.3, 0.7); -@ease-out: cubic-bezier(0.215, 0.61, 0.355, 1); -@ease-in: cubic-bezier(0.55, 0.055, 0.675, 0.19); -@ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1); -@ease-out-back: cubic-bezier(0.12, 0.4, 0.29, 1.46); -@ease-in-back: cubic-bezier(0.71, -0.46, 0.88, 0.6); -@ease-in-out-back: cubic-bezier(0.71, -0.46, 0.29, 1.46); -@ease-out-circ: cubic-bezier(0.08, 0.82, 0.17, 1); -@ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.34); -@ease-in-out-circ: cubic-bezier(0.78, 0.14, 0.15, 0.86); -@ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1); -@ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06); -@ease-in-out-quint: cubic-bezier(0.86, 0, 0.07, 1); - -// Border color -@border-color-base: hsv(0, 0, 85%); // base border outline a component -@border-color-split: hsv(0, 0, 94%); // split border inside a component -@border-color-inverse: @white; -@border-width-base: 1px; // width of the border for a component -@border-style-base: solid; // style of a components border - -// Outline -@outline-blur-size: 0; -@outline-width: 2px; -@outline-color: @primary-color; // No use anymore -@outline-fade: 20%; - -@background-color-light: hsv(0, 0, 98%); // background of header and selected item -@background-color-base: hsv(0, 0, 96%); // Default grey background color - -// Disabled states -@disabled-color: fade(#000, 25%); -@disabled-bg: @background-color-base; -@disabled-active-bg: tint(@black, 90%); -@disabled-color-dark: fade(#fff, 35%); - -// Shadow -@shadow-color: rgba(0, 0, 0, 0.15); -@shadow-color-inverse: @component-background; -@box-shadow-base: @shadow-2; -@shadow-1-up: 0 -6px 16px -8px rgba(0, 0, 0, 0.08), 0 -9px 28px 0 rgba(0, 0, 0, 0.05), - 0 -12px 48px 16px rgba(0, 0, 0, 0.03); -@shadow-1-down: 0 6px 16px -8px rgba(0, 0, 0, 0.08), 0 9px 28px 0 rgba(0, 0, 0, 0.05), - 0 12px 48px 16px rgba(0, 0, 0, 0.03); -@shadow-1-left: -6px 0 16px -8px rgba(0, 0, 0, 0.08), -9px 0 28px 0 rgba(0, 0, 0, 0.05), - -12px 0 48px 16px rgba(0, 0, 0, 0.03); -@shadow-1-right: 6px 0 16px -8px rgba(0, 0, 0, 0.08), 9px 0 28px 0 rgba(0, 0, 0, 0.05), - 12px 0 48px 16px rgba(0, 0, 0, 0.03); -@shadow-2: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), - 0 9px 28px 8px rgba(0, 0, 0, 0.05); - -// Buttons -@btn-font-weight: 400; -@btn-border-radius-base: @border-radius-base; -@btn-border-radius-sm: @border-radius-base; -@btn-border-width: @border-width-base; -@btn-border-style: @border-style-base; -@btn-shadow: 0 2px 0 rgba(0, 0, 0, 0.015); -@btn-primary-shadow: 0 2px 0 rgba(0, 0, 0, 0.045); -@btn-text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12); - -@btn-primary-color: #fff; -@btn-primary-bg: @primary-color; - -@btn-default-color: @text-color; -@btn-default-bg: @component-background; -@btn-default-border: @border-color-base; - -@btn-danger-color: #fff; -@btn-danger-bg: @error-color; -@btn-danger-border: @error-color; - -@btn-disable-color: @disabled-color; -@btn-disable-bg: @disabled-bg; -@btn-disable-border: @border-color-base; - -@btn-default-ghost-color: @component-background; -@btn-default-ghost-bg: transparent; -@btn-default-ghost-border: @component-background; - -@btn-font-size-lg: @font-size-lg; -@btn-font-size-sm: @font-size-base; -@btn-padding-horizontal-base: @padding-md - 1px; -@btn-padding-horizontal-lg: @btn-padding-horizontal-base; -@btn-padding-horizontal-sm: @padding-xs - 1px; - -@btn-height-base: @height-base; -@btn-height-lg: @height-lg; -@btn-height-sm: @height-sm; - -@btn-line-height: @line-height-base; - -@btn-circle-size: @btn-height-base; -@btn-circle-size-lg: @btn-height-lg; -@btn-circle-size-sm: @btn-height-sm; - -@btn-square-size: @btn-height-base; -@btn-square-size-lg: @btn-height-lg; -@btn-square-size-sm: @btn-height-sm; -@btn-square-only-icon-size: @font-size-base + 2px; -@btn-square-only-icon-size-sm: @font-size-base; -@btn-square-only-icon-size-lg: @btn-font-size-lg + 2px; - -@btn-group-border: @primary-5; - -@btn-link-hover-bg: transparent; -@btn-text-hover-bg: rgba(0, 0, 0, 0.018); - -// Checkbox -@checkbox-size: 16px; -@checkbox-color: @primary-color; -@checkbox-check-color: #fff; -@checkbox-check-bg: @checkbox-check-color; -@checkbox-border-width: @border-width-base; -@checkbox-border-radius: @border-radius-base; -@checkbox-group-item-margin-right: 8px; - -// Descriptions -@descriptions-bg: #fafafa; -@descriptions-title-margin-bottom: 20px; -@descriptions-default-padding: @padding-md @padding-lg; -@descriptions-middle-padding: @padding-sm @padding-lg; -@descriptions-small-padding: @padding-xs @padding-md; -@descriptions-item-padding-bottom: @padding-md; -@descriptions-item-trailing-colon: true; -@descriptions-item-label-colon-margin-right: 8px; -@descriptions-item-label-colon-margin-left: 2px; -@descriptions-extra-color: @text-color; - -// Divider -@divider-text-padding: 1em; -@divider-orientation-margin: 5%; -@divider-color: rgba(0, 0, 0, 6%); -@divider-vertical-gutter: 8px; - -// Dropdown -@dropdown-selected-color: @primary-color; -@dropdown-menu-submenu-disabled-bg: @component-background; -@dropdown-selected-bg: @item-active-bg; - -// Empty -@empty-font-size: @font-size-base; - -// Radio -@radio-size: 16px; -@radio-top: 0.2em; -@radio-border-width: 1px; -@radio-dot-size: @radio-size - 8px; -@radio-dot-color: @primary-color; -@radio-dot-disabled-color: fade(@black, 20%); -@radio-solid-checked-color: @component-background; - -// Radio buttons -@radio-button-bg: @btn-default-bg; -@radio-button-checked-bg: @btn-default-bg; -@radio-button-color: @btn-default-color; -@radio-button-hover-color: @primary-5; -@radio-button-active-color: @primary-7; -@radio-button-padding-horizontal: @padding-md - 1px; -@radio-disabled-button-checked-bg: @disabled-active-bg; -@radio-disabled-button-checked-color: @disabled-color; -@radio-wrapper-margin-right: 8px; - -// Media queries breakpoints -// @screen-xs and @screen-xs-min is not used in Grid -// smallest break point is @screen-md -@screen-xs: 480px; -@screen-xs-min: @screen-xs; -// 👆 Extra small screen / phone - -// 👇 Small screen / tablet -@screen-sm: 576px; -@screen-sm-min: @screen-sm; - -// Medium screen / desktop -@screen-md: 768px; -@screen-md-min: @screen-md; - -// Large screen / wide desktop -@screen-lg: 992px; -@screen-lg-min: @screen-lg; - -// Extra large screen / full hd -@screen-xl: 1200px; -@screen-xl-min: @screen-xl; - -// Extra extra large screen / large desktop -@screen-xxl: 1600px; -@screen-xxl-min: @screen-xxl; - -// provide a maximum -@screen-xs-max: (@screen-sm-min - 1px); -@screen-sm-max: (@screen-md-min - 1px); -@screen-md-max: (@screen-lg-min - 1px); -@screen-lg-max: (@screen-xl-min - 1px); -@screen-xl-max: (@screen-xxl-min - 1px); - -// Grid system -@grid-columns: 24; - -// Layout -@layout-body-background: #f0f2f5; -@layout-header-background: #001529; -@layout-header-height: 64px; -@layout-header-padding: 0 50px; -@layout-header-color: @text-color; -@layout-footer-padding: 24px 50px; -@layout-footer-background: @layout-body-background; -@layout-sider-background: @layout-header-background; -@layout-trigger-height: 48px; -@layout-trigger-background: #002140; -@layout-trigger-color: #fff; -@layout-zero-trigger-width: 36px; -@layout-zero-trigger-height: 42px; -// Layout light theme -@layout-sider-background-light: #fff; -@layout-trigger-background-light: #fff; -@layout-trigger-color-light: @text-color; - -// z-index list, order by `z-index` -@zindex-badge: auto; -@zindex-table-fixed: 2; -@zindex-affix: 10; -@zindex-back-top: 10; -@zindex-picker-panel: 10; -@zindex-popup-close: 10; -@zindex-modal: 1000; -@zindex-modal-mask: 1000; -@zindex-message: 1010; -@zindex-notification: 1010; -@zindex-popover: 1030; -@zindex-dropdown: 1050; -@zindex-picker: 1050; -@zindex-popoconfirm: 1060; -@zindex-tooltip: 1070; -@zindex-image: 1080; - -// Animation -@animation-duration-slow: 0.3s; // Modal -@animation-duration-base: 0.2s; -@animation-duration-fast: 0.1s; // Tooltip - -//CollapsePanel -@collapse-panel-border-radius: @border-radius-base; - -//Dropdown -@dropdown-menu-bg: @component-background; -@dropdown-vertical-padding: 5px; -@dropdown-edge-child-vertical-padding: 4px; -@dropdown-font-size: @font-size-base; -@dropdown-line-height: 22px; - -// Form -// --- -@label-required-color: @highlight-color; -@label-color: @heading-color; -@form-warning-input-bg: @input-bg; -@form-item-margin-bottom: 24px; -@form-item-trailing-colon: true; -@form-vertical-label-padding: 0 0 8px; -@form-vertical-label-margin: 0; -@form-item-label-font-size: @font-size-base; -@form-item-label-height: @input-height-base; -@form-item-label-colon-margin-right: 8px; -@form-item-label-colon-margin-left: 2px; -@form-error-input-bg: @input-bg; - -// Input -// --- -@input-height-base: @height-base; -@input-height-lg: @height-lg; -@input-height-sm: @height-sm; -@input-padding-horizontal: @control-padding-horizontal - 1px; -@input-padding-horizontal-base: @input-padding-horizontal; -@input-padding-horizontal-sm: @control-padding-horizontal-sm - 1px; -@input-padding-horizontal-lg: @input-padding-horizontal; -@input-padding-vertical-base: max( - (round(((@input-height-base - @font-size-base * @line-height-base) / 2) * 10) / 10) - - @border-width-base, - 3px -); -@input-padding-vertical-sm: max( - (round(((@input-height-sm - @font-size-base * @line-height-base) / 2) * 10) / 10) - - @border-width-base, - 0 -); -@input-padding-vertical-lg: ( - ceil(((@input-height-lg - @font-size-lg * @line-height-base) / 2) * 10) / 10 - ) - @border-width-base; -@input-placeholder-color: hsv(0, 0, 75%); -@input-color: @text-color; -@input-icon-color: @input-color; -@input-border-color: @border-color-base; -@input-bg: @component-background; -@input-number-hover-border-color: @input-hover-border-color; -@input-number-handler-active-bg: #f4f4f4; -@input-number-handler-hover-bg: @primary-5; -@input-number-handler-bg: @component-background; -@input-number-handler-border-color: @border-color-base; -@input-addon-bg: @background-color-light; -@input-hover-border-color: @primary-5; -@input-disabled-bg: @disabled-bg; -@input-outline-offset: 0 0; -@input-icon-hover-color: fade(@black, 85%); -@input-disabled-color: @disabled-color; - -// Mentions -// --- -@mentions-dropdown-bg: @component-background; -@mentions-dropdown-menu-item-hover-bg: @mentions-dropdown-bg; - -// Select -// --- -@select-border-color: @border-color-base; -@select-item-selected-color: @text-color; -@select-item-selected-font-weight: 600; -@select-dropdown-bg: @component-background; -@select-item-selected-bg: @primary-1; -@select-item-active-bg: @item-hover-bg; -@select-dropdown-vertical-padding: @dropdown-vertical-padding; -@select-dropdown-font-size: @dropdown-font-size; -@select-dropdown-line-height: @dropdown-line-height; -@select-dropdown-height: 32px; -@select-background: @component-background; -@select-clear-background: @select-background; -@select-selection-item-bg: @background-color-base; -@select-selection-item-border-color: @border-color-split; -@select-single-item-height-lg: 40px; -@select-multiple-item-height: @input-height-base - @input-padding-vertical-base * 2; // Normal 24px -@select-multiple-item-height-lg: 32px; -@select-multiple-item-spacing-half: ceil((@input-padding-vertical-base / 2)); -@select-multiple-disabled-background: @input-disabled-bg; -@select-multiple-item-disabled-color: #bfbfbf; -@select-multiple-item-disabled-border-color: @select-border-color; - -// Cascader -// --- -@cascader-bg: @component-background; -@cascader-item-selected-bg: @primary-1; -@cascader-menu-bg: @component-background; -@cascader-menu-border-color-split: @border-color-split; - -// Cascader -// ---- -@cascader-dropdown-vertical-padding: @dropdown-vertical-padding; -@cascader-dropdown-edge-child-vertical-padding: @dropdown-edge-child-vertical-padding; -@cascader-dropdown-font-size: @dropdown-font-size; -@cascader-dropdown-line-height: @dropdown-line-height; - -// Anchor -// --- -@anchor-bg: transparent; -@anchor-border-color: @border-color-split; -@anchor-link-top: 4px; -@anchor-link-left: 16px; -@anchor-link-padding: @anchor-link-top 0 @anchor-link-top @anchor-link-left; - -// Tooltip -// --- -// Tooltip max width -@tooltip-max-width: 250px; -// Tooltip text color -@tooltip-color: #fff; -// Tooltip background color -@tooltip-bg: rgba(0, 0, 0, 0.75); -// Tooltip arrow width -@tooltip-arrow-width: 8px * sqrt(2); -// Tooltip distance with trigger -@tooltip-distance: @tooltip-arrow-width - 1px + 4px; -// Tooltip arrow color -@tooltip-arrow-color: @tooltip-bg; -@tooltip-border-radius: @border-radius-base; - -// Popover -// --- -// Popover body background color -@popover-bg: @component-background; -// Popover text color -@popover-color: @text-color; -// Popover maximum width -@popover-min-width: 177px; -@popover-min-height: 32px; -// Popover arrow width -@popover-arrow-width: @tooltip-arrow-width; -// Popover arrow color -@popover-arrow-color: @popover-bg; -// Popover outer arrow width -// Popover outer arrow color -@popover-arrow-outer-color: @popover-bg; -// Popover distance with trigger -@popover-distance: @popover-arrow-width + 4px; -@popover-padding-horizontal: @padding-md; - -// Modal -// -- -@modal-header-padding-vertical: @padding-md; -@modal-header-padding-horizontal: @padding-lg; -@modal-body-padding: @padding-lg; -@modal-header-bg: @component-background; -@modal-header-padding: @modal-header-padding-vertical @modal-header-padding-horizontal; -@modal-header-border-width: @border-width-base; -@modal-header-border-style: @border-style-base; -@modal-header-title-line-height: 22px; -@modal-header-title-font-size: @font-size-lg; -@modal-header-border-color-split: @border-color-split; -@modal-header-close-size: @modal-header-title-line-height + 2 * @modal-header-padding-vertical; -@modal-content-bg: @component-background; -@modal-heading-color: @heading-color; -@modal-close-color: @text-color-secondary; -@modal-footer-bg: transparent; -@modal-footer-border-color-split: @border-color-split; -@modal-footer-border-style: @border-style-base; -@modal-footer-padding-vertical: 10px; -@modal-footer-padding-horizontal: 16px; -@modal-footer-border-width: @border-width-base; -@modal-mask-bg: fade(@black, 45%); -@modal-confirm-body-padding: 32px 32px 24px; -@modal-confirm-title-font-size: @font-size-lg; -@modal-border-radius: @border-radius-base; - -// Progress -// -- -@progress-default-color: @processing-color; -@progress-remaining-color: @background-color-base; -@progress-info-text-color: @progress-text-color; -@progress-radius: 100px; -@progress-steps-item-bg: #f3f3f3; -@progress-text-font-size: 1em; -@progress-text-color: @text-color; // This is for circle text color, should be renamed better -@progress-circle-text-font-size: 1em; -// Menu -// --- -@menu-inline-toplevel-item-height: 40px; -@menu-item-height: 40px; -@menu-item-group-height: @line-height-base; -@menu-collapsed-width: 80px; -@menu-bg: @component-background; -@menu-popup-bg: @component-background; -@menu-item-color: @text-color; -@menu-inline-submenu-bg: @background-color-light; -@menu-highlight-color: @primary-color; -@menu-highlight-danger-color: @error-color; -@menu-item-active-bg: @primary-1; -@menu-item-active-danger-bg: @red-1; -@menu-item-active-border-width: 3px; -@menu-item-group-title-color: @text-color-secondary; -@menu-item-vertical-margin: 4px; -@menu-item-font-size: @font-size-base; -@menu-item-boundary-margin: 8px; -@menu-item-padding-horizontal: 20px; -@menu-item-padding: 0 @menu-item-padding-horizontal; -@menu-horizontal-line-height: 46px; -@menu-icon-margin-right: 10px; -@menu-icon-size: @menu-item-font-size; -@menu-icon-size-lg: @font-size-lg; -@menu-item-group-title-font-size: @menu-item-font-size; - -// dark theme -@menu-dark-color: @text-color-secondary-dark; -@menu-dark-danger-color: @error-color; -@menu-dark-bg: @layout-header-background; -@menu-dark-arrow-color: #fff; -@menu-dark-inline-submenu-bg: #000c17; -@menu-dark-highlight-color: #fff; -@menu-dark-item-active-bg: @primary-color; -@menu-dark-item-active-danger-bg: @error-color; -@menu-dark-selected-item-icon-color: @white; -@menu-dark-selected-item-text-color: @white; -@menu-dark-item-hover-bg: transparent; -// Spin -// --- -@spin-dot-size-sm: 14px; -@spin-dot-size: 20px; -@spin-dot-size-lg: 32px; - -// Table -// -- -@table-bg: @component-background; -@table-header-bg: @background-color-light; -@table-header-color: @heading-color; -@table-header-sort-bg: @background-color-base; -@table-body-sort-bg: #fafafa; -@table-row-hover-bg: @background-color-light; -@table-selected-row-color: inherit; -@table-selected-row-bg: @primary-1; -@table-body-selected-sort-bg: @table-selected-row-bg; -@table-selected-row-hover-bg: darken(@table-selected-row-bg, 2%); -@table-expanded-row-bg: #fbfbfb; -@table-padding-vertical: 16px; -@table-padding-horizontal: 16px; -@table-padding-vertical-md: (@table-padding-vertical * 3 / 4); -@table-padding-horizontal-md: (@table-padding-horizontal / 2); -@table-padding-vertical-sm: (@table-padding-vertical / 2); -@table-padding-horizontal-sm: (@table-padding-horizontal / 2); -@table-border-color: @border-color-split; -@table-border-radius-base: @border-radius-base; -@table-footer-bg: @background-color-light; -@table-footer-color: @heading-color; -@table-header-bg-sm: @table-header-bg; -@table-font-size: @font-size-base; -@table-font-size-md: @table-font-size; -@table-font-size-sm: @table-font-size; -@table-header-cell-split-color: rgba(0, 0, 0, 0.06); -// Sorter -// Legacy: `table-header-sort-active-bg` is used for hover not real active -@table-header-sort-active-bg: rgba(0, 0, 0, 0.04); -@table-fixed-header-sort-active-bg: hsv(0, 0, 96%); - -// Filter -@table-header-filter-active-bg: rgba(0, 0, 0, 0.04); -@table-filter-btns-bg: inherit; -@table-filter-dropdown-bg: @component-background; -@table-expand-icon-bg: @component-background; -@table-selection-column-width: 32px; -// Sticky -@table-sticky-scroll-bar-bg: fade(#000, 35%); -@table-sticky-scroll-bar-radius: 4px; - -// Tag -// -- -@tag-border-radius: @border-radius-base; -@tag-default-bg: @background-color-light; -@tag-default-color: @text-color; -@tag-font-size: @font-size-sm; -@tag-line-height: 20px; - -// TimePicker -// --- -@picker-bg: @component-background; -@picker-basic-cell-hover-color: @item-hover-bg; -@picker-basic-cell-active-with-range-color: @primary-1; -@picker-basic-cell-hover-with-range-color: lighten(@primary-color, 35%); -@picker-basic-cell-disabled-bg: rgba(0, 0, 0, 0.04); -@picker-border-color: @border-color-split; -@picker-date-hover-range-border-color: lighten(@primary-color, 20%); -@picker-date-hover-range-color: @picker-basic-cell-hover-with-range-color; -@picker-time-panel-column-width: 56px; -@picker-time-panel-column-height: 224px; -@picker-time-panel-cell-height: 28px; -@picker-panel-cell-height: 24px; -@picker-panel-cell-width: 36px; -@picker-text-height: 40px; -@picker-panel-without-time-cell-height: 66px; - -// Calendar -// --- -@calendar-bg: @component-background; -@calendar-input-bg: @input-bg; -@calendar-border-color: @border-color-inverse; -@calendar-item-active-bg: @item-active-bg; -@calendar-column-active-bg: fade(@calendar-item-active-bg, 20%); -@calendar-full-bg: @calendar-bg; -@calendar-full-panel-bg: @calendar-full-bg; - -// Carousel -// --- -@carousel-dot-width: 16px; -@carousel-dot-height: 3px; -@carousel-dot-active-width: 24px; - -// Badge -// --- -@badge-height: 20px; -@badge-height-sm: 14px; -@badge-dot-size: 6px; -@badge-font-size: @font-size-sm; -@badge-font-size-sm: @font-size-sm; -@badge-font-weight: normal; -@badge-status-size: 6px; -@badge-text-color: @component-background; -@badge-color: @highlight-color; - -// Rate -// --- -@rate-star-color: @yellow-6; -@rate-star-bg: @border-color-split; -@rate-star-size: 20px; -@rate-star-hover-scale: scale(1.1); - -// Card -// --- -@card-head-color: @heading-color; -@card-head-background: transparent; -@card-head-font-size: @font-size-lg; -@card-head-font-size-sm: @font-size-base; -@card-head-padding: 16px; -@card-head-padding-sm: (@card-head-padding / 2); -@card-head-height: 48px; -@card-head-height-sm: 36px; -@card-inner-head-padding: 12px; -@card-padding-base: 24px; -@card-padding-base-sm: (@card-padding-base / 2); -@card-actions-background: @component-background; -@card-actions-li-margin: 12px 0; -@card-skeleton-bg: #cfd8dc; -@card-background: @component-background; -@card-shadow: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), - 0 5px 12px 4px rgba(0, 0, 0, 0.09); -@card-radius: @border-radius-base; -@card-head-tabs-margin-bottom: -17px; -@card-head-extra-color: @text-color; - -// Comment -// --- -@comment-bg: inherit; -@comment-padding-base: @padding-md 0; -@comment-nest-indent: 44px; -@comment-font-size-base: @font-size-base; -@comment-font-size-sm: @font-size-sm; -@comment-author-name-color: @text-color-secondary; -@comment-author-time-color: #ccc; -@comment-action-color: @text-color-secondary; -@comment-action-hover-color: #595959; -@comment-actions-margin-bottom: inherit; -@comment-actions-margin-top: @margin-sm; -@comment-content-detail-p-margin-bottom: inherit; - -// Tabs -// --- -@tabs-card-head-background: @background-color-light; -@tabs-card-height: 40px; -@tabs-card-active-color: @primary-color; -@tabs-card-horizontal-padding: ( - (@tabs-card-height - floor(@font-size-base * @line-height-base)) / 2 - ) - @border-width-base @padding-md; -@tabs-card-horizontal-padding-sm: 6px @padding-md; -@tabs-card-horizontal-padding-lg: 7px @padding-md 6px; -@tabs-title-font-size: @font-size-base; -@tabs-title-font-size-lg: @font-size-lg; -@tabs-title-font-size-sm: @font-size-base; -@tabs-ink-bar-color: @primary-color; -@tabs-bar-margin: 0 0 @margin-md 0; -@tabs-horizontal-gutter: 32px; -@tabs-horizontal-margin: 0 0 0 @tabs-horizontal-gutter; -@tabs-horizontal-margin-rtl: 0 0 0 32px; -@tabs-horizontal-padding: @padding-sm 0; -@tabs-horizontal-padding-lg: @padding-md 0; -@tabs-horizontal-padding-sm: @padding-xs 0; -@tabs-vertical-padding: @padding-xs @padding-lg; -@tabs-vertical-margin: @margin-md 0 0 0; -@tabs-scrolling-size: 32px; -@tabs-highlight-color: @primary-color; -@tabs-hover-color: @primary-5; -@tabs-active-color: @primary-7; -@tabs-card-gutter: 2px; -@tabs-card-tab-active-border-top: 2px solid transparent; - -// BackTop -// --- -@back-top-color: #fff; -@back-top-bg: @text-color-secondary; -@back-top-hover-bg: @text-color; - -// Avatar -// --- -@avatar-size-base: 32px; -@avatar-size-lg: 40px; -@avatar-size-sm: 24px; -@avatar-font-size-base: 18px; -@avatar-font-size-lg: 24px; -@avatar-font-size-sm: 14px; -@avatar-bg: #ccc; -@avatar-color: #fff; -@avatar-border-radius: @border-radius-base; -@avatar-group-overlapping: -8px; -@avatar-group-space: 3px; -@avatar-group-border-color: #fff; - -// Switch -// --- -@switch-height: 22px; -@switch-sm-height: 16px; -@switch-min-width: 44px; -@switch-sm-min-width: 28px; -@switch-disabled-opacity: 0.4; -@switch-color: @primary-color; -@switch-bg: @component-background; -@switch-shadow-color: fade(#00230b, 20%); -@switch-padding: 2px; -@switch-inner-margin-min: ceil(@switch-height * 0.3); -@switch-inner-margin-max: ceil(@switch-height * 1.1); -@switch-sm-inner-margin-min: ceil(@switch-sm-height * 0.3); -@switch-sm-inner-margin-max: ceil(@switch-sm-height * 1.1); - -// Pagination -// --- -@pagination-item-bg: @component-background; -@pagination-item-size: @height-base; -@pagination-item-size-sm: 24px; -@pagination-font-family: @font-family; -@pagination-font-weight-active: 500; -@pagination-item-bg-active: @component-background; -@pagination-item-link-bg: @component-background; -@pagination-item-disabled-color-active: @disabled-color; -@pagination-item-disabled-bg-active: @disabled-active-bg; -@pagination-item-input-bg: @component-background; -@pagination-mini-options-size-changer-top: 0px; - -// PageHeader -// --- -@page-header-padding: @padding-lg; -@page-header-padding-vertical: @padding-md; -@page-header-padding-breadcrumb: @padding-sm; -@page-header-content-padding-vertical: @padding-sm; -@page-header-back-color: #000; -@page-header-ghost-bg: inherit; -@page-header-heading-title: @heading-4-size; -@page-header-heading-sub-title: 14px; -@page-header-tabs-tab-font-size: 16px; - -// Breadcrumb -// --- -@breadcrumb-base-color: @text-color-secondary; -@breadcrumb-last-item-color: @text-color; -@breadcrumb-font-size: @font-size-base; -@breadcrumb-icon-font-size: @font-size-base; -@breadcrumb-link-color: @text-color-secondary; -@breadcrumb-link-color-hover: @text-color; -@breadcrumb-separator-color: @text-color-secondary; -@breadcrumb-separator-margin: 0 @padding-xs; - -// Slider -// --- -@slider-margin: 10px 6px 10px; -@slider-rail-background-color: @background-color-base; -@slider-rail-background-color-hover: #e1e1e1; -@slider-track-background-color: @primary-3; -@slider-track-background-color-hover: @primary-4; -@slider-handle-border-width: 2px; -@slider-handle-background-color: @component-background; -@slider-handle-color: @primary-3; -@slider-handle-color-hover: @primary-4; -@slider-handle-color-focus: tint(@primary-color, 20%); -@slider-handle-color-focus-shadow: fade(@primary-color, 12%); -@slider-handle-color-tooltip-open: @primary-color; -@slider-handle-size: 14px; -@slider-handle-margin-top: -5px; -@slider-handle-margin-left: -5px; -@slider-handle-shadow: 0; -@slider-dot-border-color: @border-color-split; -@slider-dot-border-color-active: tint(@primary-color, 50%); -@slider-disabled-color: @disabled-color; -@slider-disabled-background-color: @component-background; - -// Tree -// --- -@tree-bg: @component-background; -@tree-title-height: 24px; -@tree-child-padding: 18px; -@tree-directory-selected-color: #fff; -@tree-directory-selected-bg: @primary-color; -@tree-node-hover-bg: @item-hover-bg; -@tree-node-selected-bg: @primary-2; - -// Collapse -// --- -@collapse-header-padding: @padding-sm @padding-md; -@collapse-header-padding-extra: 40px; -@collapse-header-bg: @background-color-light; -@collapse-content-padding: @padding-md; -@collapse-content-bg: @component-background; -@collapse-header-arrow-left: 16px; - -// Skeleton -// --- -@skeleton-color: rgba(190, 190, 190, 0.2); -@skeleton-to-color: shade(@skeleton-color, 5%); -@skeleton-paragraph-margin-top: 28px; -@skeleton-paragraph-li-margin-top: @margin-md; -@skeleton-paragraph-li-height: 16px; -@skeleton-title-height: 16px; -@skeleton-title-paragraph-margin-top: @margin-lg; - -// Transfer -// --- -@transfer-header-height: 40px; -@transfer-item-height: @height-base; -@transfer-disabled-bg: @disabled-bg; -@transfer-list-height: 200px; -@transfer-item-hover-bg: @item-hover-bg; -@transfer-item-selected-hover-bg: darken(@item-active-bg, 2%); -@transfer-item-padding-vertical: 6px; -@transfer-list-search-icon-top: 12px; - -// Message -// --- -@message-notice-content-padding: 10px 16px; -@message-notice-content-bg: @component-background; -// Motion -// --- -@wave-animation-width: 6px; - -// Alert -// --- -@alert-success-border-color: ~`colorPalette('@{success-color}', 3) `; -@alert-success-bg-color: ~`colorPalette('@{success-color}', 1) `; -@alert-success-icon-color: @success-color; -@alert-info-border-color: ~`colorPalette('@{info-color}', 3) `; -@alert-info-bg-color: ~`colorPalette('@{info-color}', 1) `; -@alert-info-icon-color: @info-color; -@alert-warning-border-color: ~`colorPalette('@{warning-color}', 3) `; -@alert-warning-bg-color: ~`colorPalette('@{warning-color}', 1) `; -@alert-warning-icon-color: @warning-color; -@alert-error-border-color: ~`colorPalette('@{error-color}', 3) `; -@alert-error-bg-color: ~`colorPalette('@{error-color}', 1) `; -@alert-error-icon-color: @error-color; -@alert-message-color: @heading-color; -@alert-text-color: @text-color; -@alert-close-color: @text-color-secondary; -@alert-close-hover-color: @icon-color-hover; -@alert-padding-vertical: @padding-xs; -@alert-padding-horizontal: @padding-md - 1px; -@alert-no-icon-padding-vertical: @padding-xs; -@alert-with-description-no-icon-padding-vertical: @padding-md - 1px; -@alert-with-description-padding-vertical: @padding-md - 1px; -@alert-with-description-padding: @alert-with-description-padding-vertical 15px - @alert-with-description-no-icon-padding-vertical @alert-with-description-icon-size; -@alert-icon-top: 8px + @font-size-base * (@line-height-base / 2) - (@font-size-base / 2); -@alert-with-description-icon-size: 24px; - -// List -// --- -@list-header-background: transparent; -@list-footer-background: transparent; -@list-empty-text-padding: @padding-md; -@list-item-padding: @padding-sm 0; -@list-item-padding-sm: @padding-xs @padding-md; -@list-item-padding-lg: 16px 24px; -@list-item-meta-margin-bottom: @padding-md; -@list-item-meta-avatar-margin-right: @padding-md; -@list-item-meta-title-margin-bottom: @padding-sm; -@list-customize-card-bg: @component-background; -@list-item-meta-description-font-size: @font-size-base; - -// Statistic -// --- -@statistic-title-font-size: @font-size-base; -@statistic-content-font-size: 24px; -@statistic-unit-font-size: 24px; -@statistic-font-family: @font-family; - -// Drawer -// --- -@drawer-header-padding: @padding-md @padding-lg; -@drawer-body-padding: @padding-lg; -@drawer-bg: @component-background; -@drawer-footer-padding-vertical: @modal-footer-padding-vertical; -@drawer-footer-padding-horizontal: @modal-footer-padding-horizontal; -@drawer-header-close-size: 56px; -@drawer-title-font-size: @font-size-lg; -@drawer-title-line-height: 22px; - -// Timeline -// --- -@timeline-width: 2px; -@timeline-color: @border-color-split; -@timeline-dot-border-width: 2px; -@timeline-dot-color: @primary-color; -@timeline-dot-bg: @component-background; -@timeline-item-padding-bottom: 20px; - -// Typography -// --- -@typography-title-font-weight: 600; -@typography-title-margin-top: 1.2em; -@typography-title-margin-bottom: 0.5em; - -// Upload -// --- -@upload-actions-color: @text-color-secondary; - -// Steps -// --- -@process-tail-color: @border-color-split; -@steps-nav-arrow-color: fade(@black, 25%); -@steps-background: @component-background; -@steps-icon-size: 32px; -@steps-icon-custom-size: @steps-icon-size; -@steps-icon-custom-top: 0px; -@steps-icon-custom-font-size: 24px; -@steps-icon-top: -0.5px; -@steps-icon-font-size: @font-size-lg; -@steps-icon-margin: 0 8px 0 0; -@steps-title-line-height: @height-base; -@steps-small-icon-size: 24px; -@steps-small-icon-margin: 0 8px 0 0; -@steps-dot-size: 8px; -@steps-dot-top: 2px; -@steps-current-dot-size: 10px; -@steps-description-max-width: 140px; -@steps-nav-content-max-width: auto; -@steps-vertical-icon-width: 16px; -@steps-vertical-tail-width: 16px; -@steps-vertical-tail-width-sm: 12px; - -// Notification -// --- -@notification-bg: @component-background; -@notification-padding-vertical: 16px; -@notification-padding-horizontal: 24px; - -// Result -// --- -@result-title-font-size: 24px; -@result-subtitle-font-size: @font-size-base; -@result-icon-font-size: 72px; -@result-extra-margin: 24px 0 0 0; - -// Image -// --- -@image-size-base: 48px; -@image-font-size-base: 24px; -@image-bg: #f5f5f5; -@image-color: #fff; -@image-mask-font-size: 16px; -@image-preview-operation-size: 18px; -@image-preview-operation-color: @text-color-dark; -@image-preview-operation-disabled-color: fade(@image-preview-operation-color, 25%); - -// Segmented -// --- -@segmented-bg: fade(@black, 4%); -@segmented-hover-bg: fade(@black, 6%); -@segmented-selected-bg: @white; -@segmented-label-color: fade(@black, 65%); -@segmented-label-hover-color: #262626; diff --git a/site/theme/style/themes/index.less b/site/theme/style/themes/index.less deleted file mode 100644 index fd29f584c3..0000000000 --- a/site/theme/style/themes/index.less +++ /dev/null @@ -1,7 +0,0 @@ -// Default using variable as entry to support site variable version -// This will be replaced in webpack bundle -// @root-entry-name: variable; - -// @import './default.less'; -// @import './variable.less'; -@import './@{root-entry-name}.less'; diff --git a/site/theme/style/themes/variable.less b/site/theme/style/themes/variable.less deleted file mode 100644 index 2a7f995d07..0000000000 --- a/site/theme/style/themes/variable.less +++ /dev/null @@ -1,1139 +0,0 @@ -/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */ -@import '../color/colors'; - -@theme: variable; - -// The prefix to use on all css classes from ant. -@ant-prefix: ant; - -// An override for the html selector for theme prefixes -@html-selector: html; - -@{html-selector} { - @base-primary: @blue-6; - - // ========= Primary Color ========= - --@{ant-prefix}-primary-color: @base-primary; - --@{ant-prefix}-primary-color-hover: color(~`colorPalette('@{base-primary}', 5) `); - --@{ant-prefix}-primary-color-active: color(~`colorPalette('@{base-primary}', 7) `); - --@{ant-prefix}-primary-color-outline: fade(@base-primary, @outline-fade); - - // Legacy - @legacy-primary-1: color(~`colorPalette('@{base-primary}', 1) `); - - --@{ant-prefix}-primary-1: @legacy-primary-1; - --@{ant-prefix}-primary-2: color(~`colorPalette('@{base-primary}', 2) `); - --@{ant-prefix}-primary-3: color(~`colorPalette('@{base-primary}', 3) `); - --@{ant-prefix}-primary-4: color(~`colorPalette('@{base-primary}', 4) `); - --@{ant-prefix}-primary-5: color(~`colorPalette('@{base-primary}', 5) `); - --@{ant-prefix}-primary-6: @base-primary; - --@{ant-prefix}-primary-7: color(~`colorPalette('@{base-primary}', 7) `); - - // Deprecated - --@{ant-prefix}-primary-color-deprecated-pure: ~''; - --@{ant-prefix}-primary-color-deprecated-l-35: lighten(@base-primary, 35%); - --@{ant-prefix}-primary-color-deprecated-l-20: lighten(@base-primary, 20%); - --@{ant-prefix}-primary-color-deprecated-t-20: tint(@base-primary, 20%); - --@{ant-prefix}-primary-color-deprecated-t-50: tint(@base-primary, 50%); - --@{ant-prefix}-primary-color-deprecated-f-12: fade(@base-primary, 12%); - --@{ant-prefix}-primary-color-active-deprecated-f-30: fade(@legacy-primary-1, 30%); - --@{ant-prefix}-primary-color-active-deprecated-d-02: darken(@legacy-primary-1, 2%); - - // ========= Success Color ========= - --@{ant-prefix}-success-color: @green-6; - --@{ant-prefix}-success-color-hover: color(~`colorPalette('@{green-6}', 5) `); - --@{ant-prefix}-success-color-active: color(~`colorPalette('@{green-6}', 7) `); - --@{ant-prefix}-success-color-outline: fade(@green-6, @outline-fade); - --@{ant-prefix}-success-color-deprecated-bg: ~`colorPalette('@{green-6}', 1) `; - --@{ant-prefix}-success-color-deprecated-border: ~`colorPalette('@{green-6}', 3) `; - - // ========== Error Color ========== - --@{ant-prefix}-error-color: @red-5; - --@{ant-prefix}-error-color-hover: color(~`colorPalette('@{red-5}', 5) `); - --@{ant-prefix}-error-color-active: color(~`colorPalette('@{red-5}', 7) `); - --@{ant-prefix}-error-color-outline: fade(@red-5, @outline-fade); - --@{ant-prefix}-error-color-deprecated-bg: ~`colorPalette('@{red-5}', 1) `; - --@{ant-prefix}-error-color-deprecated-border: ~`colorPalette('@{red-5}', 3) `; - - // ========= Warning Color ========= - --@{ant-prefix}-warning-color: @gold-6; - --@{ant-prefix}-warning-color-hover: color(~`colorPalette('@{gold-6}', 5) `); - --@{ant-prefix}-warning-color-active: color(~`colorPalette('@{gold-6}', 7) `); - --@{ant-prefix}-warning-color-outline: fade(@gold-6, @outline-fade); - --@{ant-prefix}-warning-color-deprecated-bg: ~`colorPalette('@{gold-6}', 1) `; - --@{ant-prefix}-warning-color-deprecated-border: ~`colorPalette('@{gold-6}', 3) `; - - // ========== Info Color =========== - --@{ant-prefix}-info-color: @base-primary; - --@{ant-prefix}-info-color-deprecated-bg: ~`colorPalette('@{base-primary}', 1) `; - --@{ant-prefix}-info-color-deprecated-border: ~`colorPalette('@{base-primary}', 3) `; -} - -// -------- Colors ----------- -// >>> Primary -@primary-color: ~'var(--@{ant-prefix}-primary-color)'; -@primary-color-hover: ~'var(--@{ant-prefix}-primary-color-hover)'; -@primary-color-active: ~'var(--@{ant-prefix}-primary-color-active)'; -@primary-color-outline: ~'var(--@{ant-prefix}-primary-color-outline)'; - -@processing-color: @primary-color; - -// >>> Info -@info-color: ~'var(--@{ant-prefix}-info-color)'; -@info-color-deprecated-bg: ~'var(--@{ant-prefix}-info-color-deprecated-bg)'; -@info-color-deprecated-border: ~'var(--@{ant-prefix}-info-color-deprecated-border)'; - -// >>> Success -@success-color: ~'var(--@{ant-prefix}-success-color)'; -@success-color-hover: ~'var(--@{ant-prefix}-success-color-hover)'; -@success-color-active: ~'var(--@{ant-prefix}-success-color-active)'; -@success-color-outline: ~'var(--@{ant-prefix}-success-color-outline)'; -@success-color-deprecated-bg: ~'var(--@{ant-prefix}-success-color-deprecated-bg)'; -@success-color-deprecated-border: ~'var(--@{ant-prefix}-success-color-deprecated-border)'; - -// >>> Warning -@warning-color: ~'var(--@{ant-prefix}-warning-color)'; -@warning-color-hover: ~'var(--@{ant-prefix}-warning-color-hover)'; -@warning-color-active: ~'var(--@{ant-prefix}-warning-color-active)'; -@warning-color-outline: ~'var(--@{ant-prefix}-warning-color-outline)'; -@warning-color-deprecated-bg: ~'var(--@{ant-prefix}-warning-color-deprecated-bg)'; -@warning-color-deprecated-border: ~'var(--@{ant-prefix}-warning-color-deprecated-border)'; - -// >>> Error -@error-color: ~'var(--@{ant-prefix}-error-color)'; -@error-color-hover: ~'var(--@{ant-prefix}-error-color-hover)'; -@error-color-active: ~'var(--@{ant-prefix}-error-color-active)'; -@error-color-outline: ~'var(--@{ant-prefix}-error-color-outline)'; -@error-color-deprecated-bg: ~'var(--@{ant-prefix}-error-color-deprecated-bg)'; -@error-color-deprecated-border: ~'var(--@{ant-prefix}-error-color-deprecated-border)'; - -@highlight-color: @red-5; -@normal-color: #d9d9d9; -@white: #fff; -@black: #000; - -// Color used by default to control hover and active backgrounds and for -// alert info backgrounds. -@primary-1: ~'var(--@{ant-prefix}-primary-1)'; // replace tint(@primary-color, 90%) -@primary-2: ~'var(--@{ant-prefix}-primary-2)'; // replace tint(@primary-color, 80%) -@primary-3: ~'var(--@{ant-prefix}-primary-3)'; // unused -@primary-4: ~'var(--@{ant-prefix}-primary-4)'; // unused -@primary-5: ~'var(--@{ant-prefix}-primary-5)'; // color used to control the text color in many active and hover states, replace tint(@primary-color, 20%) -@primary-6: ~'var(--@{ant-prefix}-primary-6)'; // color used to control the text color of active buttons, don't use, use @primary-color -@primary-7: ~'var(--@{ant-prefix}-primary-7)'; // replace shade(@primary-color, 5%) -@primary-8: color(~`colorPalette('@{primary-color}', 8) `); // unused -@primary-9: color(~`colorPalette('@{primary-color}', 9) `); // unused -@primary-10: color(~`colorPalette('@{primary-color}', 10) `); // unused - -// Base Scaffolding Variables -// --- - -// Background color for `` -@body-background: #fff; -// Base background color for most components -@component-background: #fff; -// Popover background color -@popover-background: @component-background; -@popover-customize-border-color: @border-color-split; -@font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, - 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', - 'Noto Color Emoji'; -@code-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; -@text-color: fade(@black, 85%); -@text-color-secondary: fade(@black, 45%); -@text-color-inverse: @white; -@icon-color: inherit; -@icon-color-hover: fade(@black, 75%); -@heading-color: fade(@black, 85%); -@text-color-dark: fade(@white, 85%); -@text-color-secondary-dark: fade(@white, 65%); -@text-selection-bg: @primary-color; -@font-variant-base: tabular-nums; -@font-feature-settings-base: 'tnum'; -@font-size-base: 14px; -@font-size-lg: @font-size-base + 2px; -@font-size-sm: 12px; -@heading-1-size: ceil(@font-size-base * 2.71); -@heading-2-size: ceil(@font-size-base * 2.14); -@heading-3-size: ceil(@font-size-base * 1.71); -@heading-4-size: ceil(@font-size-base * 1.42); -@heading-5-size: ceil(@font-size-base * 1.14); -// https://github.com/ant-design/ant-design/issues/20210 -@line-height-base: 1.5715; -@border-radius-base: 2px; -@border-radius-sm: 2px; - -// control border -@control-border-radius: @border-radius-base; - -// arrow border -@arrow-border-radius: @border-radius-sm; - -// vertical paddings -@padding-lg: 24px; // containers -@padding-md: 16px; // small containers and buttons -@padding-sm: 12px; // Form controls and items -@padding-xs: 8px; // small items -@padding-xss: 4px; // more small - -// vertical padding for all form controls -@control-padding-horizontal: @padding-sm; -@control-padding-horizontal-sm: @padding-xs; - -// vertical margins -@margin-lg: 24px; // containers -@margin-md: 16px; // small containers and buttons -@margin-sm: 12px; // Form controls and items -@margin-xs: 8px; // small items -@margin-xss: 4px; // more small - -// height rules -@height-base: 32px; -@height-lg: 40px; -@height-sm: 24px; - -// The background colors for active and hover states for things like -// list items or table cells. -@item-active-bg: @primary-1; -@item-hover-bg: #f5f5f5; - -// ICONFONT -@iconfont-css-prefix: anticon; - -// LINK -@link-color: @primary-color; -@link-hover-color: @primary-color-hover; -@link-active-color: @primary-color-active; -@link-decoration: none; -@link-hover-decoration: none; -@link-focus-decoration: none; -@link-focus-outline: 0; - -// Animation -@ease-base-out: cubic-bezier(0.7, 0.3, 0.1, 1); -@ease-base-in: cubic-bezier(0.9, 0, 0.3, 0.7); -@ease-out: cubic-bezier(0.215, 0.61, 0.355, 1); -@ease-in: cubic-bezier(0.55, 0.055, 0.675, 0.19); -@ease-in-out: cubic-bezier(0.645, 0.045, 0.355, 1); -@ease-out-back: cubic-bezier(0.12, 0.4, 0.29, 1.46); -@ease-in-back: cubic-bezier(0.71, -0.46, 0.88, 0.6); -@ease-in-out-back: cubic-bezier(0.71, -0.46, 0.29, 1.46); -@ease-out-circ: cubic-bezier(0.08, 0.82, 0.17, 1); -@ease-in-circ: cubic-bezier(0.6, 0.04, 0.98, 0.34); -@ease-in-out-circ: cubic-bezier(0.78, 0.14, 0.15, 0.86); -@ease-out-quint: cubic-bezier(0.23, 1, 0.32, 1); -@ease-in-quint: cubic-bezier(0.755, 0.05, 0.855, 0.06); -@ease-in-out-quint: cubic-bezier(0.86, 0, 0.07, 1); - -// Border color -@border-color-base: hsv(0, 0, 85%); // base border outline a component -@border-color-split: rgba(0, 0, 0, 0.06); // split border inside a component -@border-color-inverse: @white; -@border-width-base: 1px; // width of the border for a component -@border-style-base: solid; // style of a components border - -// Outline -@outline-blur-size: 0; -@outline-width: 2px; -@outline-color: @primary-color; // No use anymore -@outline-fade: 20%; - -@background-color-light: hsv(0, 0, 98%); // background of header and selected item -@background-color-base: hsv(0, 0, 96%); // Default grey background color - -// Disabled states -@disabled-color: fade(#000, 25%); -@disabled-bg: @background-color-base; -@disabled-active-bg: tint(@black, 90%); -@disabled-color-dark: fade(#fff, 35%); - -// Shadow -@shadow-color: rgba(0, 0, 0, 0.15); -@shadow-color-inverse: @component-background; -@box-shadow-base: @shadow-2; -@shadow-1-up: 0 -6px 16px -8px rgba(0, 0, 0, 0.08), 0 -9px 28px 0 rgba(0, 0, 0, 0.05), - 0 -12px 48px 16px rgba(0, 0, 0, 0.03); -@shadow-1-down: 0 6px 16px -8px rgba(0, 0, 0, 0.08), 0 9px 28px 0 rgba(0, 0, 0, 0.05), - 0 12px 48px 16px rgba(0, 0, 0, 0.03); -@shadow-1-left: -6px 0 16px -8px rgba(0, 0, 0, 0.08), -9px 0 28px 0 rgba(0, 0, 0, 0.05), - -12px 0 48px 16px rgba(0, 0, 0, 0.03); -@shadow-1-right: 6px 0 16px -8px rgba(0, 0, 0, 0.08), 9px 0 28px 0 rgba(0, 0, 0, 0.05), - 12px 0 48px 16px rgba(0, 0, 0, 0.03); -@shadow-2: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), - 0 9px 28px 8px rgba(0, 0, 0, 0.05); - -// Buttons -@btn-font-weight: 400; -@btn-border-radius-base: @border-radius-base; -@btn-border-radius-sm: @border-radius-base; -@btn-border-width: @border-width-base; -@btn-border-style: @border-style-base; -@btn-shadow: 0 2px 0 rgba(0, 0, 0, 0.015); -@btn-primary-shadow: 0 2px 0 rgba(0, 0, 0, 0.045); -@btn-text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.12); - -@btn-primary-color: #fff; -@btn-primary-bg: @primary-color; - -@btn-default-color: @text-color; -@btn-default-bg: @component-background; -@btn-default-border: @border-color-base; - -@btn-danger-color: #fff; -@btn-danger-bg: @error-color; -@btn-danger-border: @error-color; - -@btn-disable-color: @disabled-color; -@btn-disable-bg: @disabled-bg; -@btn-disable-border: @border-color-base; - -@btn-default-ghost-color: @component-background; -@btn-default-ghost-bg: transparent; -@btn-default-ghost-border: @component-background; - -@btn-font-size-lg: @font-size-lg; -@btn-font-size-sm: @font-size-base; -@btn-padding-horizontal-base: @padding-md - 1px; -@btn-padding-horizontal-lg: @btn-padding-horizontal-base; -@btn-padding-horizontal-sm: @padding-xs - 1px; - -@btn-height-base: @height-base; -@btn-height-lg: @height-lg; -@btn-height-sm: @height-sm; - -@btn-line-height: @line-height-base; - -@btn-circle-size: @btn-height-base; -@btn-circle-size-lg: @btn-height-lg; -@btn-circle-size-sm: @btn-height-sm; - -@btn-square-size: @btn-height-base; -@btn-square-size-lg: @btn-height-lg; -@btn-square-size-sm: @btn-height-sm; -@btn-square-only-icon-size: @font-size-base + 2px; -@btn-square-only-icon-size-sm: @font-size-base; -@btn-square-only-icon-size-lg: @btn-font-size-lg + 2px; - -@btn-group-border: @primary-5; - -@btn-link-hover-bg: transparent; -@btn-text-hover-bg: rgba(0, 0, 0, 0.018); - -// Checkbox -@checkbox-size: 16px; -@checkbox-color: @primary-color; -@checkbox-check-color: #fff; -@checkbox-check-bg: @checkbox-check-color; -@checkbox-border-width: @border-width-base; -@checkbox-border-radius: @border-radius-base; -@checkbox-group-item-margin-right: 8px; - -// Descriptions -@descriptions-bg: #fafafa; -@descriptions-title-margin-bottom: 20px; -@descriptions-default-padding: @padding-md @padding-lg; -@descriptions-middle-padding: @padding-sm @padding-lg; -@descriptions-small-padding: @padding-xs @padding-md; -@descriptions-item-padding-bottom: @padding-md; -@descriptions-item-trailing-colon: true; -@descriptions-item-label-colon-margin-right: 8px; -@descriptions-item-label-colon-margin-left: 2px; -@descriptions-extra-color: @text-color; - -// Divider -@divider-text-padding: 1em; -@divider-orientation-margin: 5%; -@divider-color: rgba(0, 0, 0, 6%); -@divider-vertical-gutter: 8px; - -// Dropdown -@dropdown-selected-color: @primary-color; -@dropdown-menu-submenu-disabled-bg: @component-background; -@dropdown-selected-bg: @item-active-bg; - -// Empty -@empty-font-size: @font-size-base; - -// Radio -@radio-size: 16px; -@radio-top: 0.2em; -@radio-border-width: 1px; -@radio-dot-size: @radio-size - 8px; -@radio-dot-color: @primary-color; -@radio-dot-disabled-color: fade(@black, 20%); -@radio-solid-checked-color: @component-background; - -// Radio buttons -@radio-button-bg: @btn-default-bg; -@radio-button-checked-bg: @btn-default-bg; -@radio-button-color: @btn-default-color; -@radio-button-hover-color: @primary-5; -@radio-button-active-color: @primary-7; -@radio-button-padding-horizontal: @padding-md - 1px; -@radio-disabled-button-checked-bg: @disabled-active-bg; -@radio-disabled-button-checked-color: @disabled-color; -@radio-wrapper-margin-right: 8px; - -// Media queries breakpoints -// @screen-xs and @screen-xs-min is not used in Grid -// smallest break point is @screen-md -@screen-xs: 480px; -@screen-xs-min: @screen-xs; -// 👆 Extra small screen / phone - -// 👇 Small screen / tablet -@screen-sm: 576px; -@screen-sm-min: @screen-sm; - -// Medium screen / desktop -@screen-md: 768px; -@screen-md-min: @screen-md; - -// Large screen / wide desktop -@screen-lg: 992px; -@screen-lg-min: @screen-lg; - -// Extra large screen / full hd -@screen-xl: 1200px; -@screen-xl-min: @screen-xl; - -// Extra extra large screen / large desktop -@screen-xxl: 1600px; -@screen-xxl-min: @screen-xxl; - -// provide a maximum -@screen-xs-max: (@screen-sm-min - 1px); -@screen-sm-max: (@screen-md-min - 1px); -@screen-md-max: (@screen-lg-min - 1px); -@screen-lg-max: (@screen-xl-min - 1px); -@screen-xl-max: (@screen-xxl-min - 1px); - -// Grid system -@grid-columns: 24; - -// Layout -@layout-body-background: #f0f2f5; -@layout-header-background: #001529; -@layout-header-height: 64px; -@layout-header-padding: 0 50px; -@layout-header-color: @text-color; -@layout-footer-padding: 24px 50px; -@layout-footer-background: @layout-body-background; -@layout-sider-background: @layout-header-background; -@layout-trigger-height: 48px; -@layout-trigger-background: #002140; -@layout-trigger-color: #fff; -@layout-zero-trigger-width: 36px; -@layout-zero-trigger-height: 42px; -// Layout light theme -@layout-sider-background-light: #fff; -@layout-trigger-background-light: #fff; -@layout-trigger-color-light: @text-color; - -// z-index list, order by `z-index` -@zindex-badge: auto; -@zindex-table-fixed: 2; -@zindex-affix: 10; -@zindex-back-top: 10; -@zindex-picker-panel: 10; -@zindex-popup-close: 10; -@zindex-modal: 1000; -@zindex-modal-mask: 1000; -@zindex-message: 1010; -@zindex-notification: 1010; -@zindex-popover: 1030; -@zindex-dropdown: 1050; -@zindex-picker: 1050; -@zindex-popoconfirm: 1060; -@zindex-tooltip: 1070; -@zindex-image: 1080; - -// Animation -@animation-duration-slow: 0.3s; // Modal -@animation-duration-base: 0.2s; -@animation-duration-fast: 0.1s; // Tooltip - -//CollapsePanel -@collapse-panel-border-radius: @border-radius-base; - -//Dropdown -@dropdown-menu-bg: @component-background; -@dropdown-vertical-padding: 5px; -@dropdown-edge-child-vertical-padding: 4px; -@dropdown-font-size: @font-size-base; -@dropdown-line-height: 22px; - -// Form -// --- -@label-required-color: @highlight-color; -@label-color: @heading-color; -@form-warning-input-bg: @input-bg; -@form-item-margin-bottom: 24px; -@form-item-trailing-colon: true; -@form-vertical-label-padding: 0 0 8px; -@form-vertical-label-margin: 0; -@form-item-label-font-size: @font-size-base; -@form-item-label-height: @input-height-base; -@form-item-label-colon-margin-right: 8px; -@form-item-label-colon-margin-left: 2px; -@form-error-input-bg: @input-bg; - -// Input -// --- -@input-height-base: @height-base; -@input-height-lg: @height-lg; -@input-height-sm: @height-sm; -@input-padding-horizontal: @control-padding-horizontal - 1px; -@input-padding-horizontal-base: @input-padding-horizontal; -@input-padding-horizontal-sm: @control-padding-horizontal-sm - 1px; -@input-padding-horizontal-lg: @input-padding-horizontal; -@input-padding-vertical-base: max( - (round(((@input-height-base - @font-size-base * @line-height-base) / 2) * 10) / 10) - - @border-width-base, - 3px -); -@input-padding-vertical-sm: max( - (round(((@input-height-sm - @font-size-base * @line-height-base) / 2) * 10) / 10) - - @border-width-base, - 0 -); -@input-padding-vertical-lg: ( - ceil(((@input-height-lg - @font-size-lg * @line-height-base) / 2) * 10) / 10 - ) - @border-width-base; -@input-placeholder-color: hsv(0, 0, 75%); -@input-color: @text-color; -@input-icon-color: @input-color; -@input-border-color: @border-color-base; -@input-bg: @component-background; -@input-number-hover-border-color: @input-hover-border-color; -@input-number-handler-active-bg: #f4f4f4; -@input-number-handler-hover-bg: @primary-5; -@input-number-handler-bg: @component-background; -@input-number-handler-border-color: @border-color-base; -@input-addon-bg: @background-color-light; -@input-hover-border-color: @primary-5; -@input-disabled-bg: @disabled-bg; -@input-outline-offset: 0 0; -@input-icon-hover-color: fade(@black, 85%); -@input-disabled-color: @disabled-color; - -// Mentions -// --- -@mentions-dropdown-bg: @component-background; -@mentions-dropdown-menu-item-hover-bg: @mentions-dropdown-bg; - -// Select -// --- -@select-border-color: @border-color-base; -@select-item-selected-color: @text-color; -@select-item-selected-font-weight: 600; -@select-dropdown-bg: @component-background; -@select-item-selected-bg: @primary-1; -@select-item-active-bg: @item-hover-bg; -@select-dropdown-vertical-padding: @dropdown-vertical-padding; -@select-dropdown-font-size: @dropdown-font-size; -@select-dropdown-line-height: @dropdown-line-height; -@select-dropdown-height: 32px; -@select-background: @component-background; -@select-clear-background: @select-background; -@select-selection-item-bg: @background-color-base; -@select-selection-item-border-color: @border-color-split; -@select-single-item-height-lg: 40px; -@select-multiple-item-height: @input-height-base - @input-padding-vertical-base * 2; // Normal 24px -@select-multiple-item-height-lg: 32px; -@select-multiple-item-spacing-half: ceil((@input-padding-vertical-base / 2)); -@select-multiple-disabled-background: @input-disabled-bg; -@select-multiple-item-disabled-color: #bfbfbf; -@select-multiple-item-disabled-border-color: @select-border-color; - -// Cascader -// --- -@cascader-bg: @component-background; -@cascader-item-selected-bg: @primary-1; -@cascader-menu-bg: @component-background; -@cascader-menu-border-color-split: @border-color-split; - -// Cascader -// ---- -@cascader-dropdown-vertical-padding: @dropdown-vertical-padding; -@cascader-dropdown-edge-child-vertical-padding: @dropdown-edge-child-vertical-padding; -@cascader-dropdown-font-size: @dropdown-font-size; -@cascader-dropdown-line-height: @dropdown-line-height; - -// Anchor -// --- -@anchor-bg: transparent; -@anchor-border-color: @border-color-split; -@anchor-link-top: 4px; -@anchor-link-left: 16px; -@anchor-link-padding: @anchor-link-top 0 @anchor-link-top @anchor-link-left; - -// Tooltip -// --- -// Tooltip max width -@tooltip-max-width: 250px; -// Tooltip text color -@tooltip-color: #fff; -// Tooltip background color -@tooltip-bg: rgba(0, 0, 0, 0.75); -// Tooltip arrow width -@tooltip-arrow-width: 8px * sqrt(2); -// Tooltip distance with trigger -@tooltip-distance: @tooltip-arrow-width - 1px + 4px; -// Tooltip arrow color -@tooltip-arrow-color: @tooltip-bg; -@tooltip-border-radius: @border-radius-base; - -// Popover -// --- -// Popover body background color -@popover-bg: @component-background; -// Popover text color -@popover-color: @text-color; -// Popover maximum width -@popover-min-width: 177px; -@popover-min-height: 32px; -// Popover arrow width -@popover-arrow-width: @tooltip-arrow-width; -// Popover arrow color -@popover-arrow-color: @popover-bg; -// Popover outer arrow width -// Popover outer arrow color -@popover-arrow-outer-color: @popover-bg; -// Popover distance with trigger -@popover-distance: @popover-arrow-width + 4px; -@popover-padding-horizontal: @padding-md; - -// Modal -// -- -@modal-header-padding-vertical: @padding-md; -@modal-header-padding-horizontal: @padding-lg; -@modal-body-padding: @padding-lg; -@modal-header-bg: @component-background; -@modal-header-padding: @modal-header-padding-vertical @modal-header-padding-horizontal; -@modal-header-border-width: @border-width-base; -@modal-header-border-style: @border-style-base; -@modal-header-title-line-height: 22px; -@modal-header-title-font-size: @font-size-lg; -@modal-header-border-color-split: @border-color-split; -@modal-header-close-size: @modal-header-title-line-height + 2 * @modal-header-padding-vertical; -@modal-content-bg: @component-background; -@modal-heading-color: @heading-color; -@modal-close-color: @text-color-secondary; -@modal-footer-bg: transparent; -@modal-footer-border-color-split: @border-color-split; -@modal-footer-border-style: @border-style-base; -@modal-footer-padding-vertical: 10px; -@modal-footer-padding-horizontal: 16px; -@modal-footer-border-width: @border-width-base; -@modal-mask-bg: fade(@black, 45%); -@modal-confirm-body-padding: 32px 32px 24px; -@modal-confirm-title-font-size: @font-size-lg; -@modal-border-radius: @border-radius-base; - -// Progress -// -- -@progress-default-color: @processing-color; -@progress-remaining-color: rgba(0, 0, 0, 0.04); -@progress-info-text-color: @progress-text-color; -@progress-radius: 100px; -@progress-steps-item-bg: #f3f3f3; -@progress-text-font-size: 1em; -@progress-text-color: @text-color; // This is for circle text color, should be renamed better -@progress-circle-text-font-size: 1em; -// Menu -// --- -@menu-inline-toplevel-item-height: 40px; -@menu-item-height: 40px; -@menu-item-group-height: @line-height-base; -@menu-collapsed-width: 80px; -@menu-bg: @component-background; -@menu-popup-bg: @component-background; -@menu-item-color: @text-color; -@menu-inline-submenu-bg: @background-color-light; -@menu-highlight-color: @primary-color; -@menu-highlight-danger-color: @error-color; -@menu-item-active-bg: @primary-1; -@menu-item-active-danger-bg: @red-1; -@menu-item-active-border-width: 3px; -@menu-item-group-title-color: @text-color-secondary; -@menu-item-vertical-margin: 4px; -@menu-item-font-size: @font-size-base; -@menu-item-boundary-margin: 8px; -@menu-item-padding-horizontal: 20px; -@menu-item-padding: 0 @menu-item-padding-horizontal; -@menu-horizontal-line-height: 46px; -@menu-icon-margin-right: 10px; -@menu-icon-size: @menu-item-font-size; -@menu-icon-size-lg: @font-size-lg; -@menu-item-group-title-font-size: @menu-item-font-size; - -// dark theme -@menu-dark-color: @text-color-secondary-dark; -@menu-dark-danger-color: @error-color; -@menu-dark-bg: @layout-header-background; -@menu-dark-arrow-color: #fff; -@menu-dark-inline-submenu-bg: #000c17; -@menu-dark-highlight-color: #fff; -@menu-dark-item-active-bg: @primary-color; -@menu-dark-item-active-danger-bg: @error-color; -@menu-dark-selected-item-icon-color: @white; -@menu-dark-selected-item-text-color: @white; -@menu-dark-item-hover-bg: transparent; -// Spin -// --- -@spin-dot-size-sm: 14px; -@spin-dot-size: 20px; -@spin-dot-size-lg: 32px; - -// Table -// -- -@table-bg: @component-background; -@table-header-bg: @background-color-light; -@table-header-color: @heading-color; -@table-header-sort-bg: @background-color-base; -@table-body-sort-bg: #fafafa; -@table-row-hover-bg: @background-color-light; -@table-selected-row-color: inherit; -@table-selected-row-bg: @primary-1; -@table-body-selected-sort-bg: @table-selected-row-bg; -@table-selected-row-hover-bg: ~'var(--@{ant-prefix}-primary-color-active-deprecated-d-02)'; -@table-expanded-row-bg: #fbfbfb; -@table-padding-vertical: 16px; -@table-padding-horizontal: 16px; -@table-padding-vertical-md: (@table-padding-vertical * 3 / 4); -@table-padding-horizontal-md: (@table-padding-horizontal / 2); -@table-padding-vertical-sm: (@table-padding-vertical / 2); -@table-padding-horizontal-sm: (@table-padding-horizontal / 2); -@table-border-color: @border-color-split; -@table-border-radius-base: @border-radius-base; -@table-footer-bg: @background-color-light; -@table-footer-color: @heading-color; -@table-header-bg-sm: @table-header-bg; -@table-font-size: @font-size-base; -@table-font-size-md: @table-font-size; -@table-font-size-sm: @table-font-size; -@table-header-cell-split-color: rgba(0, 0, 0, 0.06); -// Sorter -// Legacy: `table-header-sort-active-bg` is used for hover not real active -@table-header-sort-active-bg: rgba(0, 0, 0, 0.04); -@table-fixed-header-sort-active-bg: hsv(0, 0, 96%); - -// Filter -@table-header-filter-active-bg: rgba(0, 0, 0, 0.04); -@table-filter-btns-bg: inherit; -@table-filter-dropdown-bg: @component-background; -@table-expand-icon-bg: @component-background; -@table-selection-column-width: 32px; -// Sticky -@table-sticky-scroll-bar-bg: fade(#000, 35%); -@table-sticky-scroll-bar-radius: 4px; - -// Tag -// -- -@tag-border-radius: @border-radius-base; -@tag-default-bg: @background-color-light; -@tag-default-color: @text-color; -@tag-font-size: @font-size-sm; -@tag-line-height: 20px; - -// TimePicker -// --- -@picker-bg: @component-background; -@picker-basic-cell-hover-color: @item-hover-bg; -@picker-basic-cell-active-with-range-color: @primary-1; -@picker-basic-cell-hover-with-range-color: ~'var(--@{ant-prefix}-primary-color-deprecated-l-35)'; -@picker-basic-cell-disabled-bg: rgba(0, 0, 0, 0.04); -@picker-border-color: @border-color-split; -@picker-date-hover-range-border-color: ~'var(--@{ant-prefix}-primary-color-deprecated-l-20)'; -@picker-date-hover-range-color: @picker-basic-cell-hover-with-range-color; -@picker-time-panel-column-width: 56px; -@picker-time-panel-column-height: 224px; -@picker-time-panel-cell-height: 28px; -@picker-panel-cell-height: 24px; -@picker-panel-cell-width: 36px; -@picker-text-height: 40px; -@picker-panel-without-time-cell-height: 66px; - -// Calendar -// --- -@calendar-bg: @component-background; -@calendar-input-bg: @input-bg; -@calendar-border-color: @border-color-inverse; -@calendar-item-active-bg: @item-active-bg; -@calendar-column-active-bg: ~'var(--@{ant-prefix}-primary-color-active-deprecated-f-30)'; -@calendar-full-bg: @calendar-bg; -@calendar-full-panel-bg: @calendar-full-bg; - -// Carousel -// --- -@carousel-dot-width: 16px; -@carousel-dot-height: 3px; -@carousel-dot-active-width: 24px; - -// Badge -// --- -@badge-height: 20px; -@badge-height-sm: 14px; -@badge-dot-size: 6px; -@badge-font-size: @font-size-sm; -@badge-font-size-sm: @font-size-sm; -@badge-font-weight: normal; -@badge-status-size: 6px; -@badge-text-color: @component-background; -@badge-color: @highlight-color; - -// Rate -// --- -@rate-star-color: @yellow-6; -@rate-star-bg: @border-color-split; -@rate-star-size: 20px; -@rate-star-hover-scale: scale(1.1); - -// Card -// --- -@card-head-color: @heading-color; -@card-head-background: transparent; -@card-head-font-size: @font-size-lg; -@card-head-font-size-sm: @font-size-base; -@card-head-padding: 16px; -@card-head-padding-sm: (@card-head-padding / 2); -@card-head-height: 48px; -@card-head-height-sm: 36px; -@card-inner-head-padding: 12px; -@card-padding-base: 24px; -@card-padding-base-sm: (@card-padding-base / 2); -@card-actions-background: @component-background; -@card-actions-li-margin: 12px 0; -@card-skeleton-bg: #cfd8dc; -@card-background: @component-background; -@card-shadow: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), - 0 5px 12px 4px rgba(0, 0, 0, 0.09); -@card-radius: @border-radius-base; -@card-head-tabs-margin-bottom: -17px; -@card-head-extra-color: @text-color; - -// Comment -// --- -@comment-bg: inherit; -@comment-padding-base: @padding-md 0; -@comment-nest-indent: 44px; -@comment-font-size-base: @font-size-base; -@comment-font-size-sm: @font-size-sm; -@comment-author-name-color: @text-color-secondary; -@comment-author-time-color: #ccc; -@comment-action-color: @text-color-secondary; -@comment-action-hover-color: #595959; -@comment-actions-margin-bottom: inherit; -@comment-actions-margin-top: @margin-sm; -@comment-content-detail-p-margin-bottom: inherit; - -// Tabs -// --- -@tabs-card-head-background: @background-color-light; -@tabs-card-height: 40px; -@tabs-card-active-color: @primary-color; -@tabs-card-horizontal-padding: ( - (@tabs-card-height - floor(@font-size-base * @line-height-base)) / 2 - ) - @border-width-base @padding-md; -@tabs-card-horizontal-padding-sm: 6px @padding-md; -@tabs-card-horizontal-padding-lg: 7px @padding-md 6px; -@tabs-title-font-size: @font-size-base; -@tabs-title-font-size-lg: @font-size-lg; -@tabs-title-font-size-sm: @font-size-base; -@tabs-ink-bar-color: @primary-color; -@tabs-bar-margin: 0 0 @margin-md 0; -@tabs-horizontal-gutter: 32px; -@tabs-horizontal-margin: 0 0 0 @tabs-horizontal-gutter; -@tabs-horizontal-margin-rtl: 0 0 0 32px; -@tabs-horizontal-padding: @padding-sm 0; -@tabs-horizontal-padding-lg: @padding-md 0; -@tabs-horizontal-padding-sm: @padding-xs 0; -@tabs-vertical-padding: @padding-xs @padding-lg; -@tabs-vertical-margin: @margin-md 0 0 0; -@tabs-scrolling-size: 32px; -@tabs-highlight-color: @primary-color; -@tabs-hover-color: @primary-5; -@tabs-active-color: @primary-7; -@tabs-card-gutter: 2px; -@tabs-card-tab-active-border-top: 2px solid transparent; - -// BackTop -// --- -@back-top-color: #fff; -@back-top-bg: @text-color-secondary; -@back-top-hover-bg: @text-color; - -// Avatar -// --- -@avatar-size-base: 32px; -@avatar-size-lg: 40px; -@avatar-size-sm: 24px; -@avatar-font-size-base: 18px; -@avatar-font-size-lg: 24px; -@avatar-font-size-sm: 14px; -@avatar-bg: #ccc; -@avatar-color: #fff; -@avatar-border-radius: @border-radius-base; -@avatar-group-overlapping: -8px; -@avatar-group-space: 3px; -@avatar-group-border-color: #fff; - -// Switch -// --- -@switch-height: 22px; -@switch-sm-height: 16px; -@switch-min-width: 44px; -@switch-sm-min-width: 28px; -@switch-disabled-opacity: 0.4; -@switch-color: @primary-color; -@switch-bg: @component-background; -@switch-shadow-color: fade(#00230b, 20%); -@switch-padding: 2px; -@switch-inner-margin-min: ceil(@switch-height * 0.3); -@switch-inner-margin-max: ceil(@switch-height * 1.1); -@switch-sm-inner-margin-min: ceil(@switch-sm-height * 0.3); -@switch-sm-inner-margin-max: ceil(@switch-sm-height * 1.1); - -// Pagination -// --- -@pagination-item-bg: @component-background; -@pagination-item-size: @height-base; -@pagination-item-size-sm: 24px; -@pagination-font-family: @font-family; -@pagination-font-weight-active: 500; -@pagination-item-bg-active: @component-background; -@pagination-item-link-bg: @component-background; -@pagination-item-disabled-color-active: @disabled-color; -@pagination-item-disabled-bg-active: @disabled-active-bg; -@pagination-item-input-bg: @component-background; -@pagination-mini-options-size-changer-top: 0px; - -// PageHeader -// --- -@page-header-padding: @padding-lg; -@page-header-padding-vertical: @padding-md; -@page-header-padding-breadcrumb: @padding-sm; -@page-header-content-padding-vertical: @padding-sm; -@page-header-back-color: #000; -@page-header-ghost-bg: inherit; -@page-header-heading-title: @heading-4-size; -@page-header-heading-sub-title: 14px; -@page-header-tabs-tab-font-size: 16px; - -// Breadcrumb -// --- -@breadcrumb-base-color: @text-color-secondary; -@breadcrumb-last-item-color: @text-color; -@breadcrumb-font-size: @font-size-base; -@breadcrumb-icon-font-size: @font-size-base; -@breadcrumb-link-color: @text-color-secondary; -@breadcrumb-link-color-hover: @text-color; -@breadcrumb-separator-color: @text-color-secondary; -@breadcrumb-separator-margin: 0 @padding-xs; - -// Slider -// --- -@slider-margin: 10px 6px 10px; -@slider-rail-background-color: @background-color-base; -@slider-rail-background-color-hover: #e1e1e1; -@slider-track-background-color: @primary-3; -@slider-track-background-color-hover: @primary-4; -@slider-handle-border-width: 2px; -@slider-handle-background-color: @component-background; -@slider-handle-color: @primary-3; -@slider-handle-color-hover: @primary-4; -@slider-handle-color-focus: ~'var(--@{ant-prefix}-primary-color-deprecated-t-20)'; -@slider-handle-color-focus-shadow: ~'var(--@{ant-prefix}-primary-color-deprecated-f-12)'; -@slider-handle-color-tooltip-open: @primary-color; -@slider-handle-size: 14px; -@slider-handle-margin-top: -5px; -@slider-handle-margin-left: -5px; -@slider-handle-shadow: 0; -@slider-dot-border-color: @border-color-split; -@slider-dot-border-color-active: ~'var(--@{ant-prefix}-primary-color-deprecated-t-50)'; -@slider-disabled-color: @disabled-color; -@slider-disabled-background-color: @component-background; - -// Tree -// --- -@tree-bg: @component-background; -@tree-title-height: 24px; -@tree-child-padding: 18px; -@tree-directory-selected-color: #fff; -@tree-directory-selected-bg: @primary-color; -@tree-node-hover-bg: @item-hover-bg; -@tree-node-selected-bg: @primary-2; - -// Collapse -// --- -@collapse-header-padding: @padding-sm @padding-md; -@collapse-header-padding-extra: 40px; -@collapse-header-bg: @background-color-light; -@collapse-content-padding: @padding-md; -@collapse-content-bg: @component-background; -@collapse-header-arrow-left: 16px; - -// Skeleton -// --- -@skeleton-color: rgba(190, 190, 190, 0.2); -@skeleton-to-color: shade(@skeleton-color, 5%); -@skeleton-paragraph-margin-top: 28px; -@skeleton-paragraph-li-margin-top: @margin-md; -@skeleton-paragraph-li-height: 16px; -@skeleton-title-height: 16px; -@skeleton-title-paragraph-margin-top: @margin-lg; - -// Transfer -// --- -@transfer-header-height: 40px; -@transfer-item-height: @height-base; -@transfer-disabled-bg: @disabled-bg; -@transfer-list-height: 200px; -@transfer-item-hover-bg: @item-hover-bg; -@transfer-item-selected-hover-bg: ~'var(--@{ant-prefix}-primary-color-active-deprecated-d-02)'; -@transfer-item-padding-vertical: 6px; -@transfer-list-search-icon-top: 12px; - -// Message -// --- -@message-notice-content-padding: 10px 16px; -@message-notice-content-bg: @component-background; -// Motion -// --- -@wave-animation-width: 6px; - -// Alert -// --- -@alert-success-border-color: @success-color-deprecated-border; -@alert-success-bg-color: @success-color-deprecated-bg; -@alert-success-icon-color: @success-color; -@alert-info-border-color: @info-color-deprecated-border; -@alert-info-bg-color: @info-color-deprecated-bg; -@alert-info-icon-color: @info-color; -@alert-warning-border-color: @warning-color-deprecated-border; -@alert-warning-bg-color: @warning-color-deprecated-bg; -@alert-warning-icon-color: @warning-color; -@alert-error-border-color: @error-color-deprecated-border; -@alert-error-bg-color: @error-color-deprecated-bg; -@alert-error-icon-color: @error-color; -@alert-message-color: @heading-color; -@alert-text-color: @text-color; -@alert-close-color: @text-color-secondary; -@alert-close-hover-color: @icon-color-hover; -@alert-padding-vertical: @padding-xs; -@alert-padding-horizontal: @padding-md - 1px; -@alert-no-icon-padding-vertical: @padding-xs; -@alert-with-description-no-icon-padding-vertical: @padding-md - 1px; -@alert-with-description-padding-vertical: @padding-md - 1px; -@alert-with-description-padding: @alert-with-description-padding-vertical 15px - @alert-with-description-no-icon-padding-vertical @alert-with-description-icon-size; -@alert-icon-top: 8px + @font-size-base * (@line-height-base / 2) - (@font-size-base / 2); -@alert-with-description-icon-size: 24px; - -// List -// --- -@list-header-background: transparent; -@list-footer-background: transparent; -@list-empty-text-padding: @padding-md; -@list-item-padding: @padding-sm 0; -@list-item-padding-sm: @padding-xs @padding-md; -@list-item-padding-lg: 16px 24px; -@list-item-meta-margin-bottom: @padding-md; -@list-item-meta-avatar-margin-right: @padding-md; -@list-item-meta-title-margin-bottom: @padding-sm; -@list-customize-card-bg: @component-background; -@list-item-meta-description-font-size: @font-size-base; - -// Statistic -// --- -@statistic-title-font-size: @font-size-base; -@statistic-content-font-size: 24px; -@statistic-unit-font-size: 24px; -@statistic-font-family: @font-family; - -// Drawer -// --- -@drawer-header-padding: @padding-md @padding-lg; -@drawer-body-padding: @padding-lg; -@drawer-bg: @component-background; -@drawer-footer-padding-vertical: @modal-footer-padding-vertical; -@drawer-footer-padding-horizontal: @modal-footer-padding-horizontal; -@drawer-header-close-size: 56px; -@drawer-title-font-size: @font-size-lg; -@drawer-title-line-height: 22px; - -// Timeline -// --- -@timeline-width: 2px; -@timeline-color: @border-color-split; -@timeline-dot-border-width: 2px; -@timeline-dot-color: @primary-color; -@timeline-dot-bg: @component-background; -@timeline-item-padding-bottom: 20px; - -// Typography -// --- -@typography-title-font-weight: 600; -@typography-title-margin-top: 1.2em; -@typography-title-margin-bottom: 0.5em; - -// Upload -// --- -@upload-actions-color: @text-color-secondary; - -// Steps -// --- -@process-tail-color: @border-color-split; -@steps-nav-arrow-color: fade(@black, 25%); -@steps-background: @component-background; -@steps-icon-size: 32px; -@steps-icon-custom-size: @steps-icon-size; -@steps-icon-custom-top: 0px; -@steps-icon-custom-font-size: 24px; -@steps-icon-top: -0.5px; -@steps-icon-font-size: @font-size-lg; -@steps-icon-margin: 0 8px 0 0; -@steps-title-line-height: @height-base; -@steps-small-icon-size: 24px; -@steps-small-icon-margin: 0 8px 0 0; -@steps-dot-size: 8px; -@steps-dot-top: 2px; -@steps-current-dot-size: 10px; -@steps-description-max-width: 140px; -@steps-nav-content-max-width: auto; -@steps-vertical-icon-width: 16px; -@steps-vertical-tail-width: 16px; -@steps-vertical-tail-width-sm: 12px; - -// Notification -// --- -@notification-bg: @component-background; -@notification-padding-vertical: 16px; -@notification-padding-horizontal: 24px; - -// Result -// --- -@result-title-font-size: 24px; -@result-subtitle-font-size: @font-size-base; -@result-icon-font-size: 72px; -@result-extra-margin: 24px 0 0 0; - -// Image -// --- -@image-size-base: 48px; -@image-font-size-base: 24px; -@image-bg: #f5f5f5; -@image-color: #fff; -@image-mask-font-size: 16px; -@image-preview-operation-size: 18px; -@image-preview-operation-color: @text-color-dark; -@image-preview-operation-disabled-color: fade(@image-preview-operation-color, 25%); - -// Segmented -// --- -@segmented-bg: fade(@black, 4%); -@segmented-hover-bg: fade(@black, 6%); -@segmented-selected-bg: @white; -@segmented-label-color: fade(@black, 65%); -@segmented-label-hover-color: #262626; diff --git a/site/theme/style/variable.less b/site/theme/style/variable.less deleted file mode 100644 index 6c702934cc..0000000000 --- a/site/theme/style/variable.less +++ /dev/null @@ -1,4 +0,0 @@ -@root-entry-name: variable; - -@import './themes/variable.less'; -@import './core/index'; diff --git a/site/theme/template/AppShell.tsx b/site/theme/template/AppShell.tsx deleted file mode 100644 index aa7de688eb..0000000000 --- a/site/theme/template/AppShell.tsx +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Empty component for app shell - * - * See https://github.com/NekR/offline-plugin/blob/master/docs/app-shell.md - */ -import React from 'react'; - -const AppShell: React.FC = () =>
; - -export default AppShell; diff --git a/site/theme/template/BrowserFrame.tsx b/site/theme/template/BrowserFrame.tsx deleted file mode 100644 index dd42b1aaf2..0000000000 --- a/site/theme/template/BrowserFrame.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; - -interface BrowserFrameProps { - children?: React.ReactNode; -} - -const BrowserFrame: React.FC = ({ children }) => ( -
{children}
-); - -export default BrowserFrame; diff --git a/site/theme/template/Color/ColorBlock.jsx b/site/theme/template/Color/ColorBlock.jsx deleted file mode 100644 index 282c6a6ca0..0000000000 --- a/site/theme/template/Color/ColorBlock.jsx +++ /dev/null @@ -1,36 +0,0 @@ -import React, { Component } from 'react'; -import CopyToClipboard from 'react-copy-to-clipboard'; -import { message } from 'antd'; - -export default class ColorBlock extends Component { - getTextStyle() { - const { color, index, dark } = this.props; - const colorMap = { - default: ['#fff', 'unset'], - dark: ['#314659', '#fff'], - }; - const [lastColor, firstColor] = dark ? colorMap.dark : colorMap.default; - return { - background: color, - color: index > 5 ? lastColor : firstColor, - fontWeight: index === 6 ? 'bold' : 'normal', - }; - } - - onCopied = () => { - const { color } = this.props; - message.success(`Copied: ${color}`); - }; - - render() { - const { color, index } = this.props; - return ( - -
- color-{index} - {color.toLowerCase()} -
-
- ); - } -} diff --git a/site/theme/template/Color/ColorPaletteTool.jsx b/site/theme/template/Color/ColorPaletteTool.jsx deleted file mode 100644 index 3030210de0..0000000000 --- a/site/theme/template/Color/ColorPaletteTool.jsx +++ /dev/null @@ -1,61 +0,0 @@ -import React, { Component } from 'react'; -import { FormattedMessage } from 'react-intl'; -import ColorPicker from './ColorPicker'; -import ColorPatterns from './ColorPatterns'; - -const primaryMinSaturation = 70; // 主色推荐最小饱和度 -const primaryMinBrightness = 70; // 主色推荐最小亮度 - -export default class ColorPaletteTool extends Component { - state = { - primaryColor: '#1890ff', - primaryColorInstance: null, - }; - - handleChangeColor = (e, color) => { - const value = e.target ? e.target.value : e; - this.setState({ - primaryColor: value, - primaryColorInstance: color, - }); - }; - - renderColorValidation() { - const { primaryColorInstance } = this.state; - let text = ''; - if (primaryColorInstance) { - if (primaryColorInstance.hsv.s * 100 < primaryMinSaturation) { - text += ` 饱和度建议不低于${primaryMinSaturation}(现在 ${( - primaryColorInstance.hsv.s * 100 - ).toFixed(2)})`; - } - if (primaryColorInstance.hsv.v * 100 < primaryMinBrightness) { - text += ` 亮度建议不低于${primaryMinBrightness}(现在 ${( - primaryColorInstance.hsv.v * 100 - ).toFixed(2)})`; - } - } - return {text.trim()}; - } - - render() { - const { primaryColor } = this.state; - return ( -
-
- -
-
- -
-
- - - - {primaryColor} - {this.renderColorValidation()} -
-
- ); - } -} diff --git a/site/theme/template/Color/ColorPaletteToolDark.jsx b/site/theme/template/Color/ColorPaletteToolDark.jsx deleted file mode 100644 index 46ea8cedaa..0000000000 --- a/site/theme/template/Color/ColorPaletteToolDark.jsx +++ /dev/null @@ -1,107 +0,0 @@ -import React, { Component } from 'react'; -import { FormattedMessage } from 'react-intl'; -import { Row, Col } from 'antd'; -import ColorPicker from './ColorPicker'; -import ColorPatterns from './ColorPatterns'; - -const primaryMinSaturation = 70; // 主色推荐最小饱和度 -const primaryMinBrightness = 70; // 主色推荐最小亮度 - -export default class ColorPaletteTool extends Component { - state = { - primaryColor: '#1890ff', - backgroundColor: '#141414', - primaryColorInstance: null, - }; - - handleChangeColor = (e, color) => { - const value = e.target ? e.target.value : e; - this.setState({ - primaryColor: value, - primaryColorInstance: color, - }); - }; - - handleChangeBackgroundColor = e => { - const value = e.target ? e.target.value : e; - this.setState({ - backgroundColor: value, - }); - }; - - renderColorValidation() { - const { primaryColorInstance } = this.state; - let text = ''; - if (primaryColorInstance) { - if (primaryColorInstance.hsv.s * 100 < primaryMinSaturation) { - text += ` 饱和度建议不低于${primaryMinSaturation}(现在 ${( - primaryColorInstance.hsv.s * 100 - ).toFixed(2)})`; - } - if (primaryColorInstance.hsv.v * 100 < primaryMinBrightness) { - text += ` 亮度建议不低于${primaryMinBrightness}(现在 ${( - primaryColorInstance.hsv.v * 100 - ).toFixed(2)})`; - } - } - return ( - - {text.trim()} - - ); - } - - render() { - const { primaryColor, backgroundColor } = this.state; - return ( -
-
- -
-
- -
-
- -
- - - - - - - {primaryColor} - - - - - -
- -
- - - - - - - {backgroundColor} - - - - - - {this.renderColorValidation()} - - - ); - } -} diff --git a/site/theme/template/Color/ColorPalettes.jsx b/site/theme/template/Color/ColorPalettes.jsx deleted file mode 100644 index a2c2869f01..0000000000 --- a/site/theme/template/Color/ColorPalettes.jsx +++ /dev/null @@ -1,94 +0,0 @@ -import React from 'react'; -import cls from 'classnames'; -import Palette from './Palette'; - -const ColorPalettes = props => { - const { dark } = props; - - const colors = [ - { - name: 'red', - english: 'Dust Red', - chinese: '薄暮', - description: '斗志、奔放', - }, - { - name: 'volcano', - english: 'Volcano', - chinese: '火山', - description: '醒目、澎湃', - }, - { - name: 'orange', - english: 'Sunset Orange', - chinese: '日暮', - description: '温暖、欢快', - }, - { - name: 'gold', - english: 'Calendula Gold', - chinese: '金盏花', - description: '活力、积极', - }, - { - name: 'yellow', - english: 'Sunrise Yellow', - chinese: '日出', - description: '出生、阳光', - }, - { - name: 'lime', - english: 'Lime', - chinese: '青柠', - description: '自然、生机', - }, - { - name: 'green', - english: 'Polar Green', - chinese: '极光绿', - description: '健康、创新', - }, - { - name: 'cyan', - english: 'Cyan', - chinese: '明青', - description: '希望、坚强', - }, - { - name: 'blue', - english: 'Daybreak Blue', - chinese: '拂晓蓝', - description: '包容、科技、普惠', - }, - { - name: 'geekblue', - english: 'Geek Blue', - chinese: '极客蓝', - description: '探索、钻研', - }, - { - name: 'purple', - english: 'Golden Purple', - chinese: '酱紫', - description: '优雅、浪漫', - }, - { - name: 'magenta', - english: 'Magenta', - chinese: '法式洋红', - description: '明快、感性', - }, - ]; - const colorCls = cls('color-palettes', { - 'color-palettes-dark': !!dark, - }); - return ( -
- {colors.map(color => ( - - ))} -
- ); -}; - -export default ColorPalettes; diff --git a/site/theme/template/Color/ColorPatterns.jsx b/site/theme/template/Color/ColorPatterns.jsx deleted file mode 100644 index 6989b20215..0000000000 --- a/site/theme/template/Color/ColorPatterns.jsx +++ /dev/null @@ -1,11 +0,0 @@ -import React from 'react'; -import { generate } from '@ant-design/colors'; -import uniq from 'lodash/uniq'; -import ColorBlock from './ColorBlock'; - -export default function ColorPatterns({ color, dark, backgroundColor }) { - const colors = generate(color, dark ? { theme: 'dark', backgroundColor } : {}); - return uniq(colors).map((colorString, i) => ( - - )); -} diff --git a/site/theme/template/Color/ColorPicker.tsx b/site/theme/template/Color/ColorPicker.tsx deleted file mode 100644 index 5e7fe77f5b..0000000000 --- a/site/theme/template/Color/ColorPicker.tsx +++ /dev/null @@ -1,126 +0,0 @@ -import React, { Component } from 'react'; -import { SketchPicker } from 'react-color'; - -const noop = () => {}; - -interface ColorPickerProps { - color?: string; - small: boolean; - position: string; - presetColors?: string[]; - onChange: (hex: string, color: { hex: string }) => void; - onChangeComplete: (hex: string) => void; -} - -export default class ColorPicker extends Component { - static getDerivedStateFromProps(props: ColorPickerProps) { - if ('color' in props) { - return { - color: props.color, - }; - } - return null; - } - - state = { - displayColorPicker: false, - color: undefined, - }; - - handleClick = () => { - const { displayColorPicker } = this.state; - this.setState({ displayColorPicker: !displayColorPicker }); - }; - - handleClose = () => { - this.setState({ displayColorPicker: false }); - }; - - handleChange = (color: { hex: string }) => { - const { onChange = noop } = this.props; - this.setState({ color: color.hex }); - onChange(color.hex, color); - }; - - handleChangeComplete = (color: { hex: string }) => { - const { onChangeComplete = noop } = this.props; - this.setState({ color: color.hex }); - onChangeComplete(color.hex); - }; - - render() { - const { small, position = 'bottom', presetColors } = this.props; - const { color, displayColorPicker } = this.state; - const width = small ? 80 : 120; - const styles: Record = { - color: { - width: `${width}px`, - height: small ? '16px' : '24px', - borderRadius: '2px', - background: color, - }, - swatch: { - padding: '4px', - background: '#fff', - borderRadius: '2px', - boxShadow: '0 0 0 1px rgba(0,0,0,.1)', - display: 'inline-block', - cursor: 'pointer', - }, - popover: { - position: 'absolute', - zIndex: 10, - }, - cover: { - position: 'fixed', - top: '0px', - right: '0px', - bottom: '0px', - left: '0px', - }, - wrapper: { - position: 'inherit', - zIndex: 100, - }, - }; - - if (position === 'top') { - styles.wrapper.transform = `translate(calc(-100% + ${width + 8}px), -100%)`; - styles.wrapper.paddingBottom = 8; - } - - const swatch = ( -
-
-
- ); - const picker = displayColorPicker ? ( -
-
-
- -
-
- ) : null; - - if (position === 'top') { - return ( -
- {picker} - {swatch} -
- ); - } - return ( -
- {swatch} - {picker} -
- ); - } -} diff --git a/site/theme/template/Color/Palette.jsx b/site/theme/template/Color/Palette.jsx deleted file mode 100644 index cfff5d67ca..0000000000 --- a/site/theme/template/Color/Palette.jsx +++ /dev/null @@ -1,89 +0,0 @@ -import React from 'react'; -import { message } from 'antd'; -import CopyToClipboard from 'react-copy-to-clipboard'; -import { presetDarkPalettes } from '@ant-design/colors'; - -const rgbToHex = rgbString => { - const rgb = rgbString.match(/\d+/g); - let r = parseInt(rgb[0], 10).toString(16); - let g = parseInt(rgb[1], 10).toString(16); - let b = parseInt(rgb[2], 10).toString(16); - r = r.length === 1 ? `0${r}` : r; - g = g.length === 1 ? `0${g}` : g; - b = b.length === 1 ? `0${b}` : b; - return `#${r}${g}${b}`; -}; - -export default class Palette extends React.Component { - componentDidMount() { - this.hexColors = {}; - Object.keys(this.colorNodes).forEach(key => { - const computedColor = getComputedStyle(this.colorNodes[key])['background-color']; - if (computedColor.includes('rgba')) { - this.hexColors[key] = computedColor; - } else { - this.hexColors[key] = rgbToHex(computedColor); - } - }); - this.forceUpdate(); - } - - render() { - this.colorNodes = this.colorNodes || {}; - const { - showTitle, - direction, - dark, - color: { name, description, english, chinese, count = 10 }, - } = this.props; - const className = direction === 'horizontal' ? 'color-palette-horizontal' : 'color-palette'; - const colors = []; - const colorName = `${english} / ${chinese}`; - const colorPaletteMap = { - dark: ['#fff', 'unset'], - default: ['rgba(0,0,0,0.85)', '#fff'], - }; - const [lastColor, firstColor] = dark ? colorPaletteMap.dark : colorPaletteMap.default; - for (let i = 1; i <= count; i += 1) { - const colorText = `${name}-${i}`; - const defaultBgStyle = dark ? presetDarkPalettes[name][i - 1] : ''; - colors.push( - message.success(`@${colorText} copied: ${this.hexColors[colorText]}`)} - key={colorText} - > -
{ - this.colorNodes[`${name}-${i}`] = node; - }} - className={`main-color-item palette-${name}-${i}`} - style={{ - color: (name === 'yellow' ? i > 6 : i > 5) ? firstColor : lastColor, - fontWeight: i === 6 ? 'bold' : 'normal', - backgroundColor: defaultBgStyle, - }} - title="click to copy color" - > - {colorText} - {this.hexColors ? ( - {this.hexColors[colorText]} - ) : null} -
-
, - ); - } - return ( -
- {showTitle && ( -
- {colorName} - {description} -
- )} -
{colors}
-
- ); - } -} diff --git a/site/theme/template/Content/Article.tsx b/site/theme/template/Content/Article.tsx deleted file mode 100644 index 0796ec2804..0000000000 --- a/site/theme/template/Content/Article.tsx +++ /dev/null @@ -1,170 +0,0 @@ -import React, { Children, cloneElement } from 'react'; -import { FormattedMessage, injectIntl } from 'react-intl'; -import { getChildren } from 'jsonml.js/lib/utils'; -import { Timeline, Alert, Affix } from 'antd'; -import EditButton from './EditButton'; -import { getMetaDescription } from '../utils'; -import WrapHelmet from '../Components/Helmet'; - -interface LocaleString { - [locale: string]: string; -} - -export interface ArticleProps { - titleRegionClassName?: string; - location: { - pathname: string; - }; - content: { - meta: { - toc?: boolean; - timeline?: boolean; - title: string | LocaleString; - subtitle?: string; - filename?: string; - }; - description?: any[]; - toc: string[]; - content: any[]; - api?: any; - }; - intl: { locale: string }; - utils: { - toReactComponent: (content: any[]) => React.ReactElement; - }; -} - -class Article extends React.Component { - shouldComponentUpdate(nextProps: ArticleProps) { - const { location } = this.props; - const { location: nextLocation } = nextProps; - - if (nextLocation.pathname === location.pathname) { - return false; - } - return true; - } - - // eslint-disable-next-line class-methods-use-this - onResourceClick: React.MouseEventHandler = event => { - const { target } = event as unknown as { target: HTMLAnchorElement }; - if (!window.gtag) { - return; - } - const cardNode = target.closest('.resource-card') as HTMLAnchorElement; - if (cardNode) { - window.gtag('event', 'resource', { - event_category: 'Download', - event_label: cardNode.href, - }); - } - if ( - window.location.href.indexOf('docs/react/recommendation') > 0 && - target.matches('.markdown > table td > a[href]') - ) { - window.gtag('event', 'recommendation', { - event_category: 'Click', - event_label: target.href, - }); - } - }; - - getArticle(article: React.ReactElement) { - const { content } = this.props; - const { meta } = content; - if (!meta.timeline) { - return article; - } - const timelineItems = []; - let temp: React.ReactNode[] = []; - let i = 1; - Children.forEach(article.props.children, child => { - if (child.type === 'h2' && temp.length > 0) { - timelineItems.push({temp}); - temp = []; - i += 1; - } - temp.push(child); - }); - if (temp.length > 0) { - timelineItems.push({temp}); - } - return cloneElement(article, { - children: {timelineItems}, - }); - } - - render() { - const { - titleRegionClassName, - content, - intl: { locale }, - utils, - } = this.props; - const { meta, description } = content; - const { title, subtitle, filename } = meta; - const isNotTranslated = locale === 'en-US' && typeof title === 'object'; - const helmetTitle = `${(title as LocaleString)[locale] || title} - Ant Design`; - const helmetDesc = getMetaDescription(description); - const contentChild = getMetaDescription(getChildren(content.content)); - const metaDesc = helmetDesc || contentChild; - - return ( -
- - {helmetTitle && {helmetTitle}} - {helmetTitle && } - {metaDesc && } - - {isNotTranslated && ( - - This article has not been translated yet. Wanna help us out?  - - See this issue on GitHub. - - - } - /> - )} -
-

- {typeof title === 'object' && title ? title[locale] : title} - {!subtitle || locale === 'en-US' ? null : {subtitle}} - } - filename={filename} - /> -

- {!description - ? null - : utils.toReactComponent( - ['section', { className: 'markdown' }].concat(getChildren(description)), - )} -
- {!content.toc || content.toc.length <= 1 || meta.toc === false ? null : ( - - {utils.toReactComponent(['ul', { className: 'toc' }].concat(getChildren(content.toc)))} - - )} - {this.getArticle( - utils.toReactComponent( - ['section', { className: 'markdown' }].concat(getChildren(content.content)), - ), - )} - {utils.toReactComponent( - [ - 'section', - { - className: 'markdown api-container', - }, - ].concat(getChildren(content.api || ['placeholder'])), - )} -
- ); - } -} - -export default injectIntl(Article as any) as any as React.ComponentClass; diff --git a/site/theme/template/Content/ComponentDoc.jsx b/site/theme/template/Content/ComponentDoc.jsx deleted file mode 100644 index c2d0a2dd18..0000000000 --- a/site/theme/template/Content/ComponentDoc.jsx +++ /dev/null @@ -1,243 +0,0 @@ -import React from 'react'; -import { Helmet } from 'react-helmet-async'; -import { FormattedMessage, injectIntl } from 'react-intl'; -import classNames from 'classnames'; -import { Row, Col, Affix, Tooltip } from 'antd'; -import { getChildren } from 'jsonml.js/lib/utils'; -import { CodeFilled, CodeOutlined, BugFilled, BugOutlined } from '@ant-design/icons'; -import Demo from './Demo'; -import EditButton from './EditButton'; -import { ping, getMetaDescription } from '../utils'; - -const ComponentInMarkdown = React.memo(({ content, utils }) => - utils.toReactComponent(['section', { className: 'markdown' }].concat(getChildren(content))), -); - -class ComponentDoc extends React.Component { - state = { - expandAll: false, - visibleAll: process.env.NODE_ENV !== 'production', - showRiddleButton: false, - }; - - componentDidMount() { - const { demos = {}, location = {} } = this.props; - if (location.hash) { - const demoKey = location.hash.split('-demo-')[1]; - const demoData = demos[demoKey]; - if (demoData && demoData.meta && demoData.meta.debug) { - this.setState({ visibleAll: true }); - } - } - this.pingTimer = ping(status => { - if (status !== 'timeout' && status !== 'error') { - this.setState({ - showRiddleButton: true, - }); - } - }); - } - - shouldComponentUpdate(nextProps, nextState) { - const { location, theme } = this.props; - const { location: nextLocation, theme: nextTheme } = nextProps; - const { expandAll, visibleAll, showRiddleButton, react17Demo } = this.state; - const { - expandAll: nextExpandAll, - visibleAll: nextVisibleAll, - showRiddleButton: nextShowRiddleButton, - react17Demo: nextReact17Demo, - } = nextState; - - if ( - nextLocation.pathname === location.pathname && - expandAll === nextExpandAll && - showRiddleButton === nextShowRiddleButton && - theme === nextTheme && - visibleAll === nextVisibleAll && - showRiddleButton === nextShowRiddleButton && - react17Demo === nextReact17Demo - ) { - return false; - } - return true; - } - - componentWillUnmount() { - clearTimeout(this.pingTimer); - } - - handleExpandToggle = () => { - const { expandAll } = this.state; - this.setState({ - expandAll: !expandAll, - }); - }; - - handleVisibleToggle = () => { - const { visibleAll } = this.state; - this.setState({ - visibleAll: !visibleAll, - }); - }; - - handleDemoVersionToggle = () => { - const { react17Demo } = this.state; - this.setState({ - react17Demo: !react17Demo, - }); - }; - - render() { - const { - doc, - location, - intl: { locale }, - utils, - theme, - setIframeTheme, - demos, - } = this.props; - const { content, meta } = doc; - const demoValues = Object.keys(demos).map(key => demos[key]); - const { expandAll, visibleAll, showRiddleButton } = this.state; - const isSingleCol = meta.cols === 1; - const leftChildren = []; - const rightChildren = []; - let showedDemo = demoValues.some(demo => demo.meta.only) - ? demoValues.filter(demo => demo.meta.only) - : demoValues.filter(demo => demo.preview); - if (!visibleAll) { - showedDemo = showedDemo.filter(item => !item.meta.debug); - } - showedDemo - .sort((a, b) => a.meta.order - b.meta.order) - .forEach((demoData, index) => { - const demoElem = ( - - ); - if (index % 2 === 0 || isSingleCol) { - leftChildren.push(demoElem); - } else { - rightChildren.push(demoElem); - } - }); - const expandTriggerClass = classNames('code-box-expand-trigger', { - 'code-box-expand-trigger-active': expandAll, - }); - - const jumper = showedDemo.map(demo => { - const { title } = demo.meta; - const localizeTitle = title[locale] || title; - return ( -
  • - {localizeTitle} -
  • - ); - }); - - const { title, subtitle, filename } = meta; - const helmetTitle = `${subtitle || ''} ${title[locale] || title} - Ant Design`; - const contentChild = getMetaDescription(getChildren(content)); - - return ( -
    - - {helmetTitle} - - {contentChild && } - - -
      - {jumper} - {doc.api && ( -
    • - API -
    • - )} -
    -
    -
    -

    - {title[locale] || title} - {!subtitle ? null : {subtitle}} - } - filename={filename} - /> -

    - -

    - - - - } - > - {expandAll ? ( - - ) : ( - - )} - - - } - > - {visibleAll ? ( - - ) : ( - - )} - - -

    -
    - -
    - {leftChildren} - - {isSingleCol ? null : ( - - {rightChildren} - - )} - - {utils.toReactComponent( - [ - 'section', - { - className: 'markdown api-container', - }, - ].concat(getChildren(doc.api || ['placeholder'])), - )} - - ); - } -} - -export default injectIntl(ComponentDoc); diff --git a/site/theme/template/Content/ComponentOverview.jsx b/site/theme/template/Content/ComponentOverview.jsx deleted file mode 100644 index 68810de31d..0000000000 --- a/site/theme/template/Content/ComponentOverview.jsx +++ /dev/null @@ -1,153 +0,0 @@ -import React, { useState } from 'react'; -import { Helmet } from 'react-helmet-async'; -import { Link } from 'bisheng/router'; -import { useIntl } from 'react-intl'; -import debounce from 'lodash/debounce'; -import { Input, Divider, Row, Col, Card, Typography, Tag, Space } from 'antd'; -import { SearchOutlined } from '@ant-design/icons'; -import { getChildren } from 'jsonml.js/lib/utils'; -import { getMetaDescription, getLocalizedPathname, getThemeConfig, getMenuItems } from '../utils'; -import './ComponentOverview.less'; - -const onClickCard = pathname => { - if (window.gtag) { - window.gtag('event', '点击', { - event_category: '组件总览卡片', - event_label: pathname, - }); - } -}; - -const reportSearch = debounce(value => { - if (window.gtag) { - window.gtag('event', '搜索', { - event_category: '组件总览卡片', - event_label: value, - }); - } -}, 2000); - -const { Title } = Typography; -const ComponentOverview = ({ - componentsData = [], - doc: { - meta: { title }, - content, - }, - location, - utils: { toReactComponent }, -}) => { - const { locale, formatMessage } = useIntl(); - const documentTitle = `${title} - Ant Design`; - const contentChild = getMetaDescription(getChildren(content)); - const themeConfig = getThemeConfig(); - const menuItems = getMenuItems( - componentsData, - locale, - themeConfig.categoryOrder, - themeConfig.typeOrder, - ); - const [search, setSearch] = useState(''); - - // keydown.enter goto first component - const sectionRef = React.createRef(); - const onKeyDown = event => { - if (event.keyCode === 13 && search.trim().length) { - sectionRef.current?.querySelector('.components-overview-card')?.click(); - } - }; - - return ( -
    - - {documentTitle} - - {contentChild && } - -

    {title}

    - {toReactComponent(['section', { className: 'markdown' }].concat(getChildren(content)))} - - { - setSearch(e.target.value); - reportSearch(e.target.value); - }} - onKeyDown={onKeyDown} - autoFocus // eslint-disable-line jsx-a11y/no-autofocus - suffix={} - /> - - {menuItems - .filter(i => i.order > -1) - .map(group => { - const components = group.children.filter( - component => - !search.trim() || - component.title.toLowerCase().includes(search.trim().toLowerCase()) || - (component.subtitle || '').toLowerCase().includes(search.trim().toLowerCase()), - ); - return components.length ? ( -
    - - <Space align="center"> - {group.title} - <Tag style={{ display: 'block' }}>{components.length}</Tag> - </Space> - - - {components - .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()}/`; - - // 如果是 https 就不用处理了 - const href = url.startsWith('http') - ? url - : getLocalizedPathname(url, locale === 'zh-CN', location.query); - - /** Link 不能跳转到外链 */ - const ComponentLink = !url.startsWith('http') ? Link : 'a'; - - return ( -
    - onClickCard(href.onClickCard)} - > - - {component.title} {component.subtitle} - - } - > -
    - {component.title} -
    -
    -
    - - ); - })} - - - ) : null; - })} - - ); -}; - -export default ComponentOverview; diff --git a/site/theme/template/Content/ComponentOverview.less b/site/theme/template/Content/ComponentOverview.less deleted file mode 100644 index 8d81d0d1e0..0000000000 --- a/site/theme/template/Content/ComponentOverview.less +++ /dev/null @@ -1,48 +0,0 @@ -@import (reference) '../../style/themes/index.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 0.5s; - - &:hover { - box-shadow: @shadow-1-down; - } - } -} - -.components-overview-search.ant-input-affix-wrapper { - width: 100%; - padding: 0; - font-size: 20px; - border: 0; - box-shadow: none; - - input { - color: rgba(0, 0, 0, 0.85); - font-size: 20px; - } - - .anticon { - color: #bbb; - } -} diff --git a/site/theme/template/Content/EditButton.tsx b/site/theme/template/Content/EditButton.tsx deleted file mode 100644 index 031cad4368..0000000000 --- a/site/theme/template/Content/EditButton.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import React from 'react'; -import { Tooltip } from 'antd'; -import { EditOutlined } from '@ant-design/icons'; - -const branchUrl = 'https://github.com/ant-design/ant-design/edit/master/'; - -export interface EditButtonProps { - title: React.ReactNode; - filename?: string; -} - -export default function EditButton({ title, filename }: EditButtonProps) { - return ( - - - - - - ); -} diff --git a/site/theme/template/Content/MainContent.jsx b/site/theme/template/Content/MainContent.jsx deleted file mode 100644 index bea871872a..0000000000 --- a/site/theme/template/Content/MainContent.jsx +++ /dev/null @@ -1,558 +0,0 @@ -import React, { cloneElement, Component } from 'react'; -import { browserHistory, Link } from 'bisheng/router'; -import { Affix, Avatar, Col, Drawer, Menu, Row, Tooltip } from 'antd'; -import { FormattedMessage, injectIntl } from 'react-intl'; -import { - DoubleRightOutlined, - ExportOutlined, - LeftOutlined, - RightOutlined, -} from '@ant-design/icons'; -import ContributorsList from '@qixian.cs/github-contributors-list'; -import classNames from 'classnames'; -import get from 'lodash/get'; -import Article from './Article'; -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'; - -function getModuleData(props) { - const { pathname } = props.location; - const moduleName = /^\/?components/.test(pathname) - ? 'components' - : pathname - .split('/') - .filter(item => item) - .slice(0, 2) - .join('/'); - const excludedSuffix = utils.isZhCN(props.location.pathname) ? 'en-US.md' : 'zh-CN.md'; - let data; - switch (moduleName) { - case 'docs/react': - case 'changelog': - case 'changelog-cn': - data = [...props.picked['docs/react'], ...props.picked.changelog]; - break; - default: - data = props.picked[moduleName]; - } - return data.filter(({ meta }) => !meta.filename.endsWith(excludedSuffix)); -} - -function fileNameToPath(filename) { - const snippets = filename.replace(/(\/index)?((\.zh-cn)|(\.en-us))?\.md$/i, '').split('/'); - return snippets[snippets.length - 1]; -} - -function getSideBarOpenKeys(nextProps) { - const { themeConfig } = nextProps; - const { pathname } = nextProps.location; - const locale = utils.isZhCN(pathname) ? 'zh-CN' : 'en-US'; - const moduleData = getModuleData(nextProps); - const shouldOpenKeys = utils - .getMenuItems(moduleData, locale, themeConfig.categoryOrder, themeConfig.typeOrder) - .map(m => (m.title && m.title[locale]) || m.title); - return shouldOpenKeys; -} - -function clearActiveToc() { - [].forEach.call(document.querySelectorAll('.toc-affix li a'), node => { - node.className = ''; - }); -} - -function updateActiveToc(id) { - const currentNode = document.querySelectorAll(`.toc-affix li a[href="#${id}"]`)[0]; - if (currentNode) { - clearActiveToc(); - currentNode.className = 'current'; - } -} - -class MainContent extends Component { - static contextType = SiteContext; - - state = { - openKeys: undefined, - }; - - componentDidMount() { - window.addEventListener('load', this.handleLoad); - window.addEventListener('hashchange', this.handleHashChange); - } - - static getDerivedStateFromProps(props, state) { - if (!state.openKeys) { - return { - ...state, - openKeys: getSideBarOpenKeys(props), - }; - } - return null; - } - - componentDidUpdate(prevProps) { - const { location } = this.props; - const { location: prevLocation = {} } = prevProps || {}; - if (!prevProps || prevLocation.pathname !== location.pathname) { - this.bindScroller(); - } - if (!window.location.hash && prevLocation.pathname !== location.pathname) { - clearActiveToc(); - window.scrollTo(0, 0); - } - // when subMenu not equal - if (get(this.props, 'route.path') !== get(prevProps, 'route.path')) { - // reset menu OpenKeys - this.handleMenuOpenChange(); - } - } - - componentWillUnmount() { - if (this.scroller) { - this.scroller.destroy(); - } - window.removeEventListener('load', this.handleLoad); - window.removeEventListener('hashchange', this.handleHashChange); - clearTimeout(this.timeout); - } - - getMenuItems(footerNavIcons = {}) { - const { - themeConfig, - intl: { locale }, - } = this.props; - const moduleData = getModuleData(this.props); - const menuItems = utils.getMenuItems( - moduleData, - locale, - themeConfig.categoryOrder, - 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 ( - - {menuItem.children - .sort((a, b) => a.title.localeCompare(b.title)) - .map(leaf => this.generateMenuItem(false, leaf, footerNavIcons))} - - ); - } - if (menuItem.children) { - return ( - - {menuItem.children.map(child => { - if (child.type === 'type') { - return ( - - {child.children.map(leaf => this.generateMenuItem(false, leaf, footerNavIcons))} - - ); - } - return this.generateMenuItem(false, child, footerNavIcons); - })} - - ); - } - return this.generateMenuItem(true, menuItem, footerNavIcons); - }); - } - - getFooterNav(menuItems, activeMenuItem) { - const menuItemsList = this.flattenMenu(menuItems); - let activeMenuItemIndex = -1; - menuItemsList.forEach((menuItem, i) => { - if (menuItem && menuItem.key === activeMenuItem) { - activeMenuItemIndex = i; - } - }); - const prev = menuItemsList[activeMenuItemIndex - 1]; - const next = menuItemsList[activeMenuItemIndex + 1]; - return { prev, next }; - } - - getActiveMenuItem() { - const { - params: { children }, - location, - } = this.props; - return ( - (children && children.replace('-cn', '')) || location.pathname.replace(/(^\/|-cn$)/g, '') - ); - } - - handleMenuOpenChange = openKeys => { - this.setState({ openKeys }); - }; - - handleLoad = () => { - if (window.location.hash) { - updateActiveToc(window.location.hash.replace(/^#/, '')); - - // 有时候不滚动,强制触发一次滚动逻辑 - setTimeout(() => { - const target = document.querySelector(window.location.hash); - if (target) { - target.scrollIntoView(); - } - }, 100); - } - this.bindScroller(); - }; - - handleHashChange = () => { - this.timeout = setTimeout(() => { - updateActiveToc(window.location.hash.replace(/^#/, '')); - }); - }; - - bindScroller() { - if (this.scroller) { - this.scroller.destroy(); - } - if (!document.querySelector('.markdown > h2, .code-box')) { - return; - } - // eslint-disable-next-line global-require - require('intersection-observer'); - // eslint-disable-next-line global-require - const scrollama = require('scrollama'); - this.scroller = scrollama(); - this.scroller - .setup({ - step: '.markdown > h2, .code-box', // required - offset: '10px', - }) - .onStepEnter(({ element }) => { - updateActiveToc(element.id); - }); - } - - generateMenuItem(isTop, item, { before = null, after = null }) { - const { - intl: { locale }, - location, - } = this.props; - const key = fileNameToPath(item.filename); - if (!item.title) { - return null; - } - const title = item.title[locale] || item.title; - const text = isTop - ? title - : [ - {title}, - - {item.subtitle} - , - ]; - const { disabled } = item; - const url = item.filename.replace(/(\/index)?((\.zh-cn)|(\.en-us))?\.md$/i, '').toLowerCase(); - - const child = !item.link ? ( - - {before} - {text} - {after} - - ) : ( - - {before} - {text} - {after} - - ); - - return ( - - {child} - - ); - } - - getThemeSwitchMenu() { - const { theme } = this.context; - const { - intl: { formatMessage }, - } = this.props; - return { - onClick: ({ key }) => this.changeThemeMode(key), - selectedKeys: [theme], - items: [ - { key: 'default', label: formatMessage({ id: 'app.theme.switch.default' }) }, - { key: 'dark', label: formatMessage({ id: 'app.theme.switch.dark' }) }, - { key: 'compact', label: formatMessage({ id: 'app.theme.switch.compact' }) }, - ], - }; - } - - flattenMenu(menu) { - if (!menu) { - return null; - } - if (menu.type && menu.type === Menu.Item) { - return menu; - } - if (Array.isArray(menu)) { - return menu.reduce((acc, item) => acc.concat(this.flattenMenu(item)), []); - } - return this.flattenMenu((menu.props && menu.props.children) || menu.children); - } - - changeThemeMode = theme => { - const { setTheme, theme: selectedTheme } = this.context; - const { pathname, hash, query } = this.props.location; - if (selectedTheme !== theme) { - setTheme(theme); - if (theme === 'default') { - document.documentElement.style.colorScheme = 'light'; - setColor(false); - delete query.theme; - } else { - if (theme === 'dark') { - document.documentElement.style.colorScheme = 'dark'; - setColor(true); - } - query.theme = theme; - } - browserHistory.push({ - pathname: `/${pathname}`, - query, - hash, - }); - } - }; - - renderContributors() { - const { - localizedPageData: { meta }, - intl: { formatMessage }, - } = this.props; - return ( - - loading ? ( - - ) : ( - - - {item.username} - - - ) - } - repo="ant-design" - owner="ant-design" - /> - ); - } - - renderMainContent({ theme, setIframeTheme }) { - const { localizedPageData, demos, location } = this.props; - if (location.pathname.includes('components/overview')) { - const type = utils.isZhCN(location.pathname) ? '重型组件' : 'ProComponents'; - return ( - meta.category === 'Components') - .concat([ - { - meta: { - category: 'Components', - cover: - 'https://gw.alipayobjects.com/zos/antfincdn/4n5H%24UX%24j/bianzu%2525204.svg', - filename: 'https://procomponents.ant.design/components/layout', - subtitle: '高级布局', - title: 'ProLayout', - type, - tag: 'https://gw.alipayobjects.com/zos/antfincdn/OG4ajVYzh/bianzu%2525202.svg', - }, - }, - { - meta: { - category: 'Components', - cover: 'https://gw.alipayobjects.com/zos/antfincdn/mStei5BFC/bianzu%2525207.svg', - filename: 'https://procomponents.ant.design/components/form', - subtitle: '高级表单', - title: 'ProForm', - type, - tag: 'https://gw.alipayobjects.com/zos/antfincdn/OG4ajVYzh/bianzu%2525202.svg', - }, - }, - { - meta: { - category: 'Components', - cover: - 'https://gw.alipayobjects.com/zos/antfincdn/AwU0Cv%26Ju/bianzu%2525208.svg', - filename: 'https://procomponents.ant.design/components/table', - subtitle: '高级表格', - title: 'ProTable', - type, - tag: 'https://gw.alipayobjects.com/zos/antfincdn/OG4ajVYzh/bianzu%2525202.svg', - }, - }, - { - meta: { - category: 'Components', - cover: - 'https://gw.alipayobjects.com/zos/antfincdn/H0%26LSYYfh/bianzu%2525209.svg', - filename: 'https://procomponents.ant.design/components/descriptions', - subtitle: '高级定义列表', - title: 'ProDescriptions', - type, - tag: 'https://gw.alipayobjects.com/zos/antfincdn/OG4ajVYzh/bianzu%2525202.svg', - }, - }, - { - meta: { - category: 'Components', - cover: 'https://gw.alipayobjects.com/zos/antfincdn/uZUmLtne5/bianzu%2525209.svg', - filename: 'https://procomponents.ant.design/components/list', - subtitle: '高级列表', - title: 'ProList', - type, - tag: 'https://gw.alipayobjects.com/zos/antfincdn/OG4ajVYzh/bianzu%2525202.svg', - }, - }, - { - meta: { - category: 'Components', - cover: 'https://gw.alipayobjects.com/zos/antfincdn/N3eU432oA/bianzu%2525209.svg', - filename: 'https://procomponents.ant.design/components/editable-table', - subtitle: '可编辑表格', - title: 'EditableProTable', - type, - tag: 'https://gw.alipayobjects.com/zos/antfincdn/OG4ajVYzh/bianzu%2525202.svg', - }, - }, - ])} - /> - ); - } - if (demos) { - return ( - <> - - {this.renderContributors()} - - ); - } - return ( - <> -
    - {this.renderContributors()} - - ); - } - - render() { - const { demos, location } = this.props; - const { openKeys, mobileMenuOpen } = 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 = ( - this.setState({ mobileMenuOpen: false })} - > - {menuItems} - - ); - return ( -
    - - {isMobile ? ( - <> - this.setState({ mobileMenuOpen: true })} - className="mobile-menu-trigger" - > - - - - this.setState({ mobileMenuOpen: false })} - > - {cloneElement(menuChild, { - style: { margin: '0 -24px' }, - })} - - - ) : ( -
    - -
    {menuChild}
    -
    - - )} - -
    - {this.renderMainContent({ theme, setIframeTheme })} -
    - -
    - - - - ); - } -} - -export default injectIntl(MainContent); diff --git a/site/theme/template/Content/PrevAndNext.jsx b/site/theme/template/Content/PrevAndNext.jsx deleted file mode 100644 index 7f9a1083ad..0000000000 --- a/site/theme/template/Content/PrevAndNext.jsx +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; - -const PrevAndNext = ({ prev, next }) => ( -
    - {prev - ? React.cloneElement(prev.props.children || prev.children[0], { - className: 'prev-page', - }) - : null} - {next - ? React.cloneElement(next.props.children || next.children[0], { - className: 'next-page', - }) - : null} -
    -); - -export default PrevAndNext; diff --git a/site/theme/template/Content/ThemeIcon.jsx b/site/theme/template/Content/ThemeIcon.jsx deleted file mode 100644 index 440cb04ec5..0000000000 --- a/site/theme/template/Content/ThemeIcon.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import Icon from '@ant-design/icons'; - -const ThemeIcon = props => { - const SVGIcon = React.useCallback( - () => ( - - - - - - - - ), - [props], - ); - return ; -}; - -export default ThemeIcon; diff --git a/site/theme/template/Content/index.jsx b/site/theme/template/Content/index.jsx deleted file mode 100644 index 8e5a7b3c04..0000000000 --- a/site/theme/template/Content/index.jsx +++ /dev/null @@ -1,30 +0,0 @@ -import collect from 'bisheng/collect'; -import MainContent from './MainContent'; -import * as utils from '../utils'; - -function isChangelog(pathname) { - return pathname.includes('changelog'); -} - -export default collect(async nextProps => { - const { pathname } = nextProps.location; - const pageDataPath = pathname.replace('-cn', '').split('/'); - const pageData = isChangelog(pathname) - ? nextProps.data.changelog.CHANGELOG - : nextProps.utils.get(nextProps.data, pageDataPath); - if (!pageData) { - throw 404; // eslint-disable-line no-throw-literal - } - - const locale = utils.isZhCN(pathname) ? 'zh-CN' : 'en-US'; - const pageDataPromise = - typeof pageData === 'function' - ? pageData() - : (pageData[locale] || pageData.index[locale] || pageData.index)(); - const demosFetcher = nextProps.utils.get(nextProps.data, [...pageDataPath, 'demo']); - if (demosFetcher) { - const [localizedPageData, demos] = await Promise.all([pageDataPromise, demosFetcher()]); - return { localizedPageData, demos }; - } - return { localizedPageData: await pageDataPromise }; -})(MainContent); diff --git a/site/theme/template/Home/Banner/Background.less b/site/theme/template/Home/Banner/Background.less deleted file mode 100644 index a81991f6bb..0000000000 --- a/site/theme/template/Home/Banner/Background.less +++ /dev/null @@ -1,35 +0,0 @@ -@import (reference) '../../../style/themes/index.less'; - -.home-banner-background { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - - > * { - width: 100%; - height: 100%; - vertical-align: top; - } - - > img { - display: block; - } - - > svg { - display: none; - } -} - -@media (min-width: @screen-sm-min) { - .home-banner-background { - > img { - display: none; - } - - > svg { - display: block; - } - } -} diff --git a/site/theme/template/Home/Banner/Background.tsx b/site/theme/template/Home/Banner/Background.tsx deleted file mode 100644 index 132fd674ff..0000000000 --- a/site/theme/template/Home/Banner/Background.tsx +++ /dev/null @@ -1,186 +0,0 @@ -import * as React from 'react'; -import Hitu from '@ant-design/hitu'; -import './Background.less'; - -const RANDOM_OFFSET = 50; -const TOTAL_FRAMES = 600; - -function randomFrames(x: number, y: number): any[] { - const common = { x, y, cubic: Hitu.CUBIC_EASE_IN_OUT }; - - return [ - { - frame: 0, - ...common, - }, - { - frame: TOTAL_FRAMES / 2, - ...common, - x: x - Math.random() * RANDOM_OFFSET * 2 + RANDOM_OFFSET, - y: y - Math.random() * RANDOM_OFFSET * 2 + RANDOM_OFFSET, - }, - { - frame: TOTAL_FRAMES, - ...common, - }, - ]; -} - -const ShadowSize = 30; - -// =================================== Circle 1 =================================== -const CircleSize1 = 140; -const Circle1 = () => ( - - - - - - - -); -Circle1.width = (CircleSize1 + ShadowSize) * 2; -Circle1.height = (CircleSize1 + ShadowSize) * 2; - -// =================================== Circle 2 =================================== -const CircleSize2 = 200; -const Circle2 = () => ( - - - - - - - -); -Circle2.width = (CircleSize2 + ShadowSize) * 2; -Circle2.height = (CircleSize2 + ShadowSize) * 2; - -// ==================================== Rect 1 ==================================== -const ReactSize1 = 90; -const React1 = () => ( - - - - - - - -); -React1.width = (ReactSize1 + ShadowSize) * 2; -React1.height = (ReactSize1 + ShadowSize) * 2; - -// ================================== Diamond 1 =================================== -const DiamondSize1 = 400; -const Diamond1 = () => { - const start = ShadowSize; - const center = ShadowSize + DiamondSize1; - const end = ShadowSize + DiamondSize1 * 2; - - return ( - - - - - - - - - ); -}; -Diamond1.width = (DiamondSize1 + ShadowSize) * 2; -Diamond1.height = (DiamondSize1 + ShadowSize) * 2; - -export default function Background() { - const [circleFrames, setCircleFrames] = React.useState(() => randomFrames(550, 200)); - const [circle2Frames, setCircle2Frames] = React.useState(() => randomFrames(0, 448)); - const [reactFrames, setReactFrames] = React.useState(() => randomFrames(1400, 300)); - const [diamondFrames, setDiamondFrames] = React.useState(() => randomFrames(1100, -230)); - - return ( -
    - background - { - if (frame === 0) { - setCircleFrames(randomFrames(550, 200)); - setCircle2Frames(randomFrames(0, 448)); - setReactFrames(randomFrames(1400, 300)); - setDiamondFrames(randomFrames(1100, -230)); - } - }} - shapes={[ - { - type: 'shape', - source: Circle1, - frames: circleFrames, - }, - { - type: 'shape', - source: Circle2, - frames: circle2Frames, - }, - { - type: 'shape', - source: React1, - frames: reactFrames, - }, - { - type: 'shape', - source: Diamond1, - frames: diamondFrames, - }, - ]} - /> -
    - ); -} diff --git a/site/theme/template/Home/Banner/Logo.less b/site/theme/template/Home/Banner/Logo.less deleted file mode 100644 index 2ce2837705..0000000000 --- a/site/theme/template/Home/Banner/Logo.less +++ /dev/null @@ -1,46 +0,0 @@ -@import (reference) '../../../style/themes/index.less'; - -.home-card-logo { - position: relative; - display: inline-block; - max-width: 500px; - margin: 0 32px; - cursor: pointer; - - .home-card-logo-icon { - position: absolute; - top: -38px; - left: 339px; - display: none; - width: 64px; - height: 64px; - } - - .home-banner-mini { - display: block; - max-width: 100%; - } - - .home-banner-normal { - display: none; - } -} - -@media (min-width: @screen-sm-min) { - .home-card-logo { - height: 90px; - vertical-align: top; - - .home-banner-mini { - display: none; - } - - .home-banner-normal { - display: block; - } - - .home-card-logo-icon { - display: block; - } - } -} diff --git a/site/theme/template/Home/Banner/Logo.tsx b/site/theme/template/Home/Banner/Logo.tsx deleted file mode 100644 index 60a3f31170..0000000000 --- a/site/theme/template/Home/Banner/Logo.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import * as React from 'react'; -import Hitu from '@ant-design/hitu'; -import type { HiTuRefObject } from '@ant-design/hitu/lib/HiTu'; -import './Logo.less'; -import { preLoad } from '../util'; - -const ICON_IMAGES = [ - 'https://gw.alipayobjects.com/zos/basement_prod/fef2f3d5-9326-48e3-a8f3-a99584efd425.svg', - 'https://gw.alipayobjects.com/zos/basement_prod/95736b64-de90-4fcd-bae9-a827091a247d.svg', - 'https://gw.alipayobjects.com/zos/basement_prod/7002f57b-bf16-4640-8373-2c4cfcfa7f8c.svg', - 'https://gw.alipayobjects.com/zos/basement_prod/29aa8cd8-de97-42b8-a370-f901be43e18a.svg', - 'https://gw.alipayobjects.com/zos/basement_prod/d7bc5cdf-07f9-4ddf-8135-78d3cc6ca009.svg', - 'https://gw.alipayobjects.com/zos/basement_prod/8737ccb7-3b5d-40ca-ae36-6a904047caa4.svg', - 'https://gw.alipayobjects.com/zos/basement_prod/1fdf5981-2d9d-4315-bb84-4590d5c5b989.svg', - 'https://gw.alipayobjects.com/zos/basement_prod/b9d17ebc-2af1-4926-ba1b-c1376ddaa479.svg', - 'https://gw.alipayobjects.com/zos/basement_prod/dcb1b8f8-becd-4f90-ba32-574260a7b18d.svg', - 'https://gw.alipayobjects.com/zos/basement_prod/ba0958ce-b194-4910-84de-7e3274742dbb.svg', - 'https://gw.alipayobjects.com/zos/basement_prod/ad510b94-5f85-4b30-b929-2e3a34ad673c.svg', - 'https://gw.alipayobjects.com/zos/basement_prod/43d010fa-71ac-44e3-8475-bb77d95c331c.svg', -]; - -preLoad(ICON_IMAGES); - -const AntDesign = () => ( - - - -); - -AntDesign.width = 32; -AntDesign.height = 32; - -const ICONS = ICON_IMAGES.map(href => { - function Icon() { - return ( - - {/* Image size will follow outer svg size, let's cut to half here */} - - - ); - } - - Icon.width = 32; - Icon.height = 32; - - return Icon; -}); - -export default function Logo() { - const hituRef = React.useRef(null); - const [loop, setLoop] = React.useState(false); - const [iconIndex, setIconIndex] = React.useState(-1); - const Icon = ICONS[iconIndex] || AntDesign; - - return ( -
    { - setLoop(true); - if (hituRef.current) { - hituRef.current.triggerMotion(true); - } - }} - onMouseLeave={() => { - setLoop(false); - }} - > - Ant Design - Ant Design - { - if (frame === 5) { - const newIndex = (iconIndex + 1) % ICONS.length; - setIconIndex(newIndex); - } - }} - shapes={[ - { - type: 'shape', - source: Icon, - frames: [ - { - frame: 0, - x: 32, - y: 32, - scaleX: 1, - scaleY: 1, - opacity: 1, - cubic: Hitu.CUBIC_EASE, - }, - ], - }, - ]} - /> -
    - ); -} diff --git a/site/theme/template/Home/Banner/index.less b/site/theme/template/Home/Banner/index.less deleted file mode 100644 index 5a672e4683..0000000000 --- a/site/theme/template/Home/Banner/index.less +++ /dev/null @@ -1,137 +0,0 @@ -@import (reference) '../../../style/themes/index.less'; - -@home-color: #0170fe; - -.home-banner { - position: relative; - height: 512px; - overflow: hidden; - // background: radial-gradient(rgba(255, 255, 255, 0.5), rgba(235, 245, 255, 0.58)), - // linear-gradient(150deg, #fbfcfd, #f8fcff); - background: url('https://gw.alipayobjects.com/zos/basement_prod/a8cf2dfe-ff6a-4a2e-ab73-f72dced0df99.svg'); - background-size: cover; - - &-holder { - position: relative; - z-index: 1; - margin-top: 160px; - } - - &-content { - margin: 0 auto; - padding: 0 16px; - font-size: 14px; - text-align: center; - - p { - margin: 16px 0 0; - font-weight: lighter; - } - - .banner-video { - display: none; - margin: 20px auto 0; - color: @home-color; - } - - .banner-qr { - margin: 8px auto 0; - font-weight: normal; - text-align: center; - - a { - color: #0170fe; - } - - img { - display: inline-block; - width: 18px; - margin-right: 8px; - vertical-align: text-bottom; - - .rtl & { - margin-right: 0; - margin-left: 8px; - } - } - } - - &-operations { - margin-top: 72px; - white-space: nowrap; - - a { - margin: 0 8px; - } - - button.ant-btn { - height: auto; - padding: 8px 24px; - color: @home-color; - font-size: 14px; - border-color: @home-color; - - &:hover { - color: tint(@home-color, 20%); - border-color: tint(@home-color, 20%); - } - - &.ant-btn-primary { - color: #fff; - background: @home-color; - - &:hover { - background-color: tint(@home-color, 20%); - } - } - } - } - } -} - -.banner-qr-code { - .ant-popover-inner-content { - padding: 12px; - } - - img { - width: 136px; - height: 136px; - } - - p { - margin: 8px 0 0; - color: #314659; - text-align: center; - } -} - -@media (min-width: @screen-sm-min) { - .home-banner { - height: 448px; - - &-holder { - margin-top: 130px; - } - - &-content { - font-size: 16px; - - p { - margin-top: 24px; - } - - .video { - margin: 8px auto; - } - - &-operations { - margin-top: 40px; - - button.ant-btn { - font-size: 16px; - } - } - } - } -} diff --git a/site/theme/template/Home/Banner/index.tsx b/site/theme/template/Home/Banner/index.tsx deleted file mode 100644 index bf08652e80..0000000000 --- a/site/theme/template/Home/Banner/index.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import * as React from 'react'; -import { Button } from 'antd'; -import { Link } from 'bisheng/router'; -import { FormattedMessage, useIntl } from 'react-intl'; -import Background from './Background'; -import { getLocalizedPathname } from '../../utils'; -import Logo from './Logo'; - -import './index.less'; - -const Banner = (props: { location: any }) => { - const { location } = props; - const { locale } = useIntl(); - const isZhCN = locale === 'zh-CN'; - - return ( -
    - - -

    - -

    - -
    -
    -
    - -
    -

    - -

    - -
    - - - - - - -
    -
    -
    -
    - ); -}; - -export default Banner; diff --git a/site/theme/template/Home/DesignPage/Certainty.tsx b/site/theme/template/Home/DesignPage/Certainty.tsx deleted file mode 100644 index 37fb00da7c..0000000000 --- a/site/theme/template/Home/DesignPage/Certainty.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import * as React from 'react'; -import Hitu from '@ant-design/hitu'; -import type { Shape, FrameInfo } from '@ant-design/hitu/lib/interface'; -import InteractiveIcon from './InteractiveIcon'; - -function Rect() { - return ; -} - -Rect.width = 14; -Rect.height = 14; - -function getFrames(x: number, y: number): FrameInfo[] { - const delay = (x + y) * 5 + 1; - - const position = { - x: x * (14 + 12) + 21, - y: y * (14 + 12) + 21, - }; - - return [ - { - frame: 0, - rotate: 0, - ...position, - }, - { - frame: delay, - rotate: 0, - ...position, - cubic: Hitu.CUBIC_EASE, - }, - { - frame: 15 + delay, - scaleX: 1.3, - scaleY: 1.3, - cubic: Hitu.CUBIC_EASE, - }, - { - frame: 30 + delay, - scaleX: 1, - scaleY: 1, - }, - ]; -} - -const shapes: Shape[] = []; - -for (let x = 0; x < 4; x += 1) { - for (let y = 0; y < 4; y += 1) { - shapes.push({ - type: 'shape', - source: Rect, - frames: getFrames(x, y), - }); - } -} - -export default function Certainty() { - return ; -} diff --git a/site/theme/template/Home/DesignPage/Growth.tsx b/site/theme/template/Home/DesignPage/Growth.tsx deleted file mode 100644 index 5f151276e6..0000000000 --- a/site/theme/template/Home/DesignPage/Growth.tsx +++ /dev/null @@ -1,101 +0,0 @@ -import * as React from 'react'; -import Hitu from '@ant-design/hitu'; -import type { Shape, FrameInfo } from '@ant-design/hitu/lib/interface'; -import InteractiveIcon from './InteractiveIcon'; - -function Arrow() { - return ( - - ); -} - -Arrow.width = 84; -Arrow.height = 70; - -function Rect() { - return ; -} - -Rect.width = 10; -Rect.height = 10; - -const rectShared: Partial = { - originX: 0, - originY: 1, - y: 98, -}; - -const rectDistance = Rect.width + 9; -function getRectFrames(scaleY: number, index: number): FrameInfo[] { - const delay = index * 3; - - return [ - { - frame: 0, - scaleY, - ...rectShared, - x: 18 + rectDistance * index, - cubic: Hitu.CUBIC_EASE, - }, - { - frame: 1 + delay, - scaleY: 0, - cubic: Hitu.CUBIC_EASE, - }, - { - frame: 30 + delay, - scaleY: scaleY * 1.05, - }, - { - frame: 40 + delay, - scaleY: scaleY * 0.95, - }, - { - frame: 50 + delay, - scaleY, - }, - ]; -} - -const shapes: Shape[] = [ - { - type: 'shape', - source: Arrow, - frames: [ - { - frame: 0, - originX: 0, - originY: 0, - x: 20, - y: 12, - opacity: 1, - cubic: Hitu.CUBIC_EASE, - }, - { - frame: 1, - y: 17, - opacity: 0, - }, - { - frame: 30, - y: 12, - opacity: 1, - }, - ], - }, -]; - -[1.2, 2.1, 3.1, 4.5, 6].forEach((scaleY, index) => { - shapes.push({ - type: 'shape', - source: Rect, - frames: getRectFrames(scaleY, index), - }); -}); - -export default function Meaningful() { - return ; -} diff --git a/site/theme/template/Home/DesignPage/InteractiveIcon.tsx b/site/theme/template/Home/DesignPage/InteractiveIcon.tsx deleted file mode 100644 index e008635866..0000000000 --- a/site/theme/template/Home/DesignPage/InteractiveIcon.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import * as React from 'react'; -import type { HiTuRefObject } from '@ant-design/hitu'; -import Hitu from '@ant-design/hitu'; -import type { Shape } from '@ant-design/hitu/lib/interface'; - -const HOVER_LOOP = false; - -export interface InteractiveIconProps { - shapes: Shape[]; - debug?: boolean; - frames?: number; -} - -export default function InteractiveIcon({ shapes, debug, frames }: InteractiveIconProps) { - const hituRef = React.useRef(null); - const [loop, setLoop] = React.useState(false); - - return ( - { - if (HOVER_LOOP) { - setLoop(true); - } - - if (hituRef.current) { - hituRef.current.triggerMotion(true); - } - }} - onMouseLeave={() => { - setLoop(false); - }} - > - - - ); -} diff --git a/site/theme/template/Home/DesignPage/Meaningful.tsx b/site/theme/template/Home/DesignPage/Meaningful.tsx deleted file mode 100644 index 7b748f19ad..0000000000 --- a/site/theme/template/Home/DesignPage/Meaningful.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import * as React from 'react'; -import Hitu from '@ant-design/hitu'; -import type { Shape } from '@ant-design/hitu/lib/interface'; -import InteractiveIcon from './InteractiveIcon'; - -function Heart() { - return ( - - ); -} - -Heart.width = 26; -Heart.height = 24; - -function Circle() { - return ; -} - -Circle.width = 72; -Circle.height = 72; - -const center = { x: 60, y: 60 }; - -const shapes: Shape[] = [ - { - type: 'shape', - source: Circle, - frames: [ - { - frame: 0, - scaleX: 1.3, - scaleY: 1.3, - opacity: 0.4, - ...center, - }, - { - frame: 20, - scaleX: 1.5, - scaleY: 1.5, - opacity: 0, - }, - { - frame: 21, - scaleX: 1, - scaleY: 1, - opacity: 0, - }, - { - frame: 40, - scaleX: 1.3, - scaleY: 1.3, - opacity: 0.4, - }, - ], - }, - { - type: 'shape', - source: Circle, - frames: [ - { - frame: 0, - scaleX: 1, - scaleY: 1, - ...center, - }, - ], - }, - { - type: 'shape', - source: Heart, - frames: [ - { - frame: 0, - ...center, - cubic: Hitu.CUBIC_EASE, - }, - ], - }, -]; - -export default function Meaningful() { - return ; -} diff --git a/site/theme/template/Home/DesignPage/Natural.tsx b/site/theme/template/Home/DesignPage/Natural.tsx deleted file mode 100644 index 321539fd8a..0000000000 --- a/site/theme/template/Home/DesignPage/Natural.tsx +++ /dev/null @@ -1,125 +0,0 @@ -import * as React from 'react'; -import type { Shape } from '@ant-design/hitu'; -import Hitu from '@ant-design/hitu'; -import InteractiveIcon from './InteractiveIcon'; - -const CenterLeaf = () => ( - - - -); -CenterLeaf.width = 40; -CenterLeaf.height = 52; - -const LeftLeaf = () => ( - - - - -); -LeftLeaf.width = 38; -LeftLeaf.height = 38; - -const RightLeaf = () => ( - - - -); -RightLeaf.width = 38; -RightLeaf.height = 38; - -const shapes: Shape[] = [ - { - type: 'shape', - source: CenterLeaf, - frames: [ - { frame: 0, originY: 1, x: 60, y: 62, rotate: 0 }, - { frame: 20, rotate: -7 }, - { frame: 40, rotate: 9 }, - { frame: 60, rotate: -7 }, - { frame: 80, rotate: 0 }, - ], - }, - { - type: 'shape', - source: LeftLeaf, - frames: [ - { - frame: 0, - originX: 1, - originY: 1, - x: 56, - y: 96, - cubic: Hitu.CUBIC_EASE_IN_OUT, - }, - { - frame: 20, - rotate: 7, - - cubic: Hitu.CUBIC_EASE_IN_OUT, - }, - { - frame: 40, - rotate: -5, - cubic: Hitu.CUBIC_EASE_IN_OUT, - }, - { - frame: 60, - rotate: 7, - }, - { - frame: 80, - rotate: 0, - }, - ], - }, - { - type: 'shape', - source: RightLeaf, - frames: [ - { - frame: 0, - originX: 0, - originY: 1, - x: 64, - y: 96, - }, - { - frame: 20, - rotate: -5, - cubic: Hitu.CUBIC_EASE_IN_OUT, - }, - { - frame: 40, - rotate: 7, - cubic: Hitu.CUBIC_EASE_IN_OUT, - }, - { - frame: 60, - rotate: -5, - }, - { - frame: 80, - rotate: 0, - }, - ], - }, -]; - -export default function Natural() { - return ; -} diff --git a/site/theme/template/Home/DesignPage/index.less b/site/theme/template/Home/DesignPage/index.less deleted file mode 100644 index 1da09fe509..0000000000 --- a/site/theme/template/Home/DesignPage/index.less +++ /dev/null @@ -1,197 +0,0 @@ -@import (reference) '../../../style/themes/index.less'; - -.design-card { - position: relative; - min-height: 278px; - padding: 32px 40px; - color: #697b8c; - line-height: 2; - background: rgba(0, 0, 0, 0.1); - - &.main-card { - background-image: url('https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*i1EySrFVZvAAAAAAAAAAAABkARQnAQ'); - background-size: cover; - } - - h3, - h4 { - color: #0d1a26; - } - - a { - color: #2f54eb; - } - - .design-card-detail { - display: block; - margin-top: 12px; - } - - .design-values { - text-align: center; - - img { - display: block; - display: none; - width: 56px; - height: 56px; - margin: 20px auto 0; - } - - h4 { - margin-top: 18px; - font-weight: normal; - } - } - - &.sub-card { - padding: 0; - - .card-info { - display: flex; - flex-direction: column; - padding: 40px 0 32px 40px; - - .ant-row-rtl & { - padding: 40px 40px 32px 0; - } - - ul { - margin-top: auto; - - li { - margin-top: 16px; - - a { - color: #2f54eb; - } - } - } - } - } -} - -.design-mini-panel { - &:hover { - box-shadow: @shadow-2; - } - - .ant-card-meta-title { - color: #0d1a26; - font-weight: 400; - font-size: 20px; - } - - .ant-card-body { - padding: 16px 20px 20px; - } - - .ant-card-meta-description { - color: #697b8c; - } -} - -@media (min-width: @screen-sm-min) { - .design-card { - &.main-card { - padding-right: 0; - - .ant-row-rtl & { - padding-right: 40px; - padding-left: 0; - } - } - - &.sub-card { - background-image: none !important; - } - } -} - -@media (max-width: @screen-sm-min) { - .design-card { - height: 478px; - padding: 24px 16px; - - &.main-card { - height: auto; - padding-bottom: 16px; - background-image: url('https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*a8u5Q4QIJzcAAAAAAAAAAABkARQnAQ'); - } - - h3.ant-typography { - margin-bottom: 16px; - font-size: 18px; - } - - .design-card-detail { - position: relative; - display: block; - margin-top: 12px; - line-height: 22px; - } - - .design-values { - img { - display: block; - } - - svg { - display: none; - } - - h4 { - margin-top: 8px; - } - } - - &.sub-card { - padding: 0; - line-height: 1.5; - background-repeat: no-repeat !important; - background-position: left 50% bottom 0% !important; - background-size: contain !important; - - h3.ant-typography { - margin-bottom: 4px; - } - - .card-info { - padding: 24px 16px 0; - } - - ul { - margin-top: auto; - - li { - margin-top: 12px; - } - } - } - - .design-card-img-col { - display: none; - } - } - - .design-mini-panels { - margin-top: -23px !important; - - .design-mini-panel { - .ant-card-body { - padding: 16px 16px 20px; - - .ant-card-meta-title { - margin-bottom: 4px; - font-size: 18px; - } - } - } - } -} - -html.en-us { - .design-card.main-card { - line-height: 22px; - } -} diff --git a/site/theme/template/Home/DesignPage/index.tsx b/site/theme/template/Home/DesignPage/index.tsx deleted file mode 100644 index 4ae8375181..0000000000 --- a/site/theme/template/Home/DesignPage/index.tsx +++ /dev/null @@ -1,306 +0,0 @@ -import * as React from 'react'; -import { Row, Col, Typography, Card } from 'antd'; -import { RightOutlined, LeftOutlined } from '@ant-design/icons'; -import { FormattedMessage, useIntl } from 'react-intl'; -import { Link } from 'bisheng/router'; -import { getLocalizedPathname } from '../../utils'; -import './index.less'; -import Certainty from './Certainty'; -import Meaningful from './Meaningful'; -import Growth from './Growth'; -import Natural from './Natural'; -import SiteContext from '../../Layout/SiteContext'; - -const { Title } = Typography; - -interface PanelProps { - img: string; - title: React.ReactNode; - description: string; - href?: string; - link?: string; -} - -const MINI_LIST: PanelProps[] = [ - { - img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*ZhzDQLMyYlYAAAAAAAAAAABkARQnAQ', - title: 'AntV', - description: 'app.home.product-antv-slogan', - href: 'https://antv.vision', - }, - { - img: - 'https://gw.alipayobjects.com/zos/antfincdn/888xda6kBc/Ant%252520Design%252520shouyepeitu.svg', - title: 'Ant Design Pro', - description: 'app.home.product-pro-slogan', - href: 'https://pro.ant.design/', - }, - { - img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*mb-WQILTlSEAAAAAAAAAAABkARQnAQ', - title: 'Ant Design Mobile', - description: 'app.home.product-mobile-slogan', - href: 'https://mobile.ant.design/', - }, - { - img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*PrLWSpmWZmIAAAAAAAAAAABkARQnAQ', - title: , - description: 'app.home.product-hitu-slogan', - link: '/docs/spec/illustration', - }, - { - img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*MaL2SYtHPuMAAAAAAAAAAABkARQnAQ', - title: 'Kitchen', - description: 'app.home.product-kitchen-slogan', - href: 'https://kitchen.alipay.com/', - }, - { - img: 'https://gw.alipayobjects.com/mdn/rms_08e378/afts/img/A*T_HeSIJ30IIAAAAAAAAAAABkARQnAQ', - title: 'Icons', - description: 'app.home.product-icons-slogan', - link: '/components/icon/', - }, -]; - -const MiniPanel = ({ - title, - img, - description, - href, - link, - isZhCN, - query, -}: PanelProps & { isZhCN: boolean } & { query: object }) => { - let content = ( - } - > - } /> - - ); - - if (href) { - content = ( - - {content} - - ); - } else if (link) { - content = {content}; - } - - return ( -
    - {content} - - ); -}; - -const DesignPage = (props: { location: any }) => { - const { location } = props; - const { locale } = useIntl(); - const isZhCN = locale === 'zh-CN'; - const { direction } = React.useContext(SiteContext); - let IconComponent = ; - - if (direction === 'rtl') { - IconComponent = ; - } - - const smallStyle = { fontSize: 12, color: '#888', marginLeft: '0.3em' }; - - return ( -
    - {/* ***************************** Group 1 ***************************** */} - - {/* *********************** Design Values *********************** */} -
    -
    - - <FormattedMessage id="app.home.design-values" /> - - - -
    - - - - - {IconComponent} - - - - - - certainty - -

    - -

    - -
    - meaningful - -

    - -

    - -
    - growth - -

    - -

    - -
    - natural - -

    - -

    - - - - - - - - {/* *********************** Design Guides *********************** */} -
    -
    - -
    - - <FormattedMessage id="app.home.design-guide" /> - - -
      -
    • - - - {IconComponent} - -
    • -
    • - - - {IconComponent} - -
    • -
    - - - design guide - - - - - - {/* ************************* Component ************************* */} - -
    - -
    - - <FormattedMessage id="app.home.components" /> - - - - - - components - - - - - - - {/* ***************************** Group 2 ***************************** */} - - {MINI_LIST.map(panel => ( - - ))} - - - ); -}; - -export default DesignPage; diff --git a/site/theme/template/Home/MorePage.less b/site/theme/template/Home/MorePage.less deleted file mode 100644 index df2b94c902..0000000000 --- a/site/theme/template/Home/MorePage.less +++ /dev/null @@ -1,73 +0,0 @@ -@import (reference) '../../style/themes/index.less'; - -.more-card { - &:hover { - box-shadow: @shadow-2; - } - - .ant-card-cover { - padding: 24px 24px 0; - } - - .ant-card-body { - color: #314659; - } - - .ant-card-meta-detail { - display: flex; - flex-direction: column; - min-height: 170px; - - .ant-card-meta-title { - min-height: 50px; - margin-bottom: 16px; - color: #0d1a26; - font-weight: 400; - white-space: normal; - text-overflow: initial; - word-break: break-word; - } - - .ant-card-meta-description { - flex: auto; - color: #697b8c; - } - } - - .more-card-source { - float: right; - - .ant-row-rtl & { - float: left; - } - - > img { - vertical-align: baseline; - } - } -} - -@media (max-width: @screen-sm-min) { - .more-card { - .ant-card-cover { - margin-bottom: 12px; - padding: 16px 16px 0; - - img { - height: 184px; - } - } - - .ant-card-meta-title { - font-size: 18px; - } - - .ant-card-body { - padding: 16px; - - .ant-card-meta-detail { - min-height: 150px; - } - } - } -} diff --git a/site/theme/template/Home/MorePage.tsx b/site/theme/template/Home/MorePage.tsx deleted file mode 100644 index 95022a72e4..0000000000 --- a/site/theme/template/Home/MorePage.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import * as React from 'react'; -import { useIntl } from 'react-intl'; -import { Card, Row, Col } from 'antd'; -import { useSiteData } from './util'; -import type { Icons, Extra } from './util'; -import './MorePage.less'; - -type MoreProps = Partial & { - icons?: Icons; - loading?: boolean; -}; - -const MoreCard = ({ title, description, date, img, source, href, icons, loading }: MoreProps) => ( - - { - window?.gtag('event', '点击', { - event_category: '首页文章', - event_label: href, - }); - }} - > - } - loading={loading} - className="more-card" - > - -
    - {date} - - {icons ? ( - icon.name === source)?.href} alt={source} /> - ) : null} - -
    -
    -
    - -); - -export default function MorePage() { - const { locale } = useIntl(); - const [{ extras, icons }, loading] = useSiteData(); - const list = extras?.[locale === 'zh-CN' ? 'cn' : 'en'] || []; - const loadingProps = { loading: loading || list.length === 0 } as MoreProps; - return ( - - {(list ?? [loadingProps, loadingProps, loadingProps, loadingProps]).map((more, i) => ( - - ))} - - ); -} diff --git a/site/theme/template/Home/RecommendPage.less b/site/theme/template/Home/RecommendPage.less deleted file mode 100644 index 61747019aa..0000000000 --- a/site/theme/template/Home/RecommendPage.less +++ /dev/null @@ -1,141 +0,0 @@ -@import (reference) '../../style/themes/index.less'; - -.linear-gradient(@mid-pos, @end-pos) { - background: linear-gradient( - rgba(0, 0, 0, 0) 0%, - rgba(0, 0, 0, 0.25) @mid-pos, - rgba(0, 0, 0, 0.65) @end-pos - ); -} - -.recommend-block { - position: relative; - display: block; - height: 192px; - overflow: hidden; - border-radius: 2px; - - img { - position: relative; - z-index: -1; - width: 100%; - height: 100%; - vertical-align: top; - background-clip: cover; - transition: all 0.36s ease-out; - } - - &-loading { - background: linear-gradient( - 90deg, - rgba(207, 216, 220, 0.2), - rgba(207, 216, 220, 0.4), - rgba(207, 216, 220, 0.2) - ); - border-radius: 4px; - - img, - &::before { - display: none; - } - } - - &:hover img { - transform: scale(1.04); - } - - &::before { - .linear-gradient(40%, 100%); - - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - opacity: 0.3; - transition: all 0.5s; - content: ''; - pointer-events: none; - } - - .recommend-popularize { - position: absolute; - top: 0; - left: 0; - padding: 0 8px; - color: #314659; - line-height: 28px; - background: #ffd75a; - border-radius: 0 0 4px; - } - - .recommend-content { - position: absolute; - right: 0; - bottom: 0; - left: 0; - padding: 0 16px 16px; - transform: translateY(100%); - transition: transform 0.3s; - - .ant-typography { - margin: 0; - color: #fff; - } - - h4 { - position: absolute; - top: 0; - right: 0; - left: 0; - padding: 0 16px 16px; - transform: translateY(-100%); - transition: padding 0.3s; - } - - p { - color: rgba(255, 255, 255, 0.85); - opacity: 0; - transition: opacity 0.3s, margin 0.3s; - } - } -} - -@media (max-width: @screen-sm-min) { - .recommend-block { - h4.ant-typography { - padding: 0 16px 16px; - font-size: 18px; - } - } -} - -@media (min-width: @screen-sm-min) { - .recommend-block { - &-main { - height: 408px; - - &::before { - .linear-gradient(70%, 100%); - } - } - - &:hover { - &::before { - opacity: 1; - } - - .recommend-content { - transform: translateY(0); - - h4 { - padding-bottom: 8px; - } - - p { - opacity: 1; - } - } - } - } -} diff --git a/site/theme/template/Home/RecommendPage.tsx b/site/theme/template/Home/RecommendPage.tsx deleted file mode 100644 index 781ab974e4..0000000000 --- a/site/theme/template/Home/RecommendPage.tsx +++ /dev/null @@ -1,75 +0,0 @@ -import * as React from 'react'; -import classNames from 'classnames'; -import { FormattedMessage, useIntl } from 'react-intl'; -import { Row, Col, Typography } from 'antd'; -import { useSiteData } from './util'; -import type { Recommendation } from './util'; -import './RecommendPage.less'; - -const { Title, Paragraph } = Typography; - -interface RecommendBlockProps extends Recommendation { - main?: boolean; - loading?: boolean; -} - -const RecommendBlock = ({ - main, - title, - popularize, - description, - img, - href, - loading, -}: RecommendBlockProps) => ( - { - window?.gtag('event', '点击', { - event_category: '首页推广', - event_label: href, - }); - }} - > - {title} - {popularize && ( - - - - )} -
    - {title} - {description} -
    -
    -); - -export default function RecommendPage() { - const { locale } = useIntl(); - const [{ recommendations }, loading] = useSiteData(); - const list = recommendations?.[locale === 'zh-CN' ? 'cn' : 'en']; - const isLoading = loading || !list || list.length === 0; - return ( - - - - - - - - - - - - - - - - ); -} diff --git a/site/theme/template/Home/index.less b/site/theme/template/Home/index.less deleted file mode 100644 index 2dd5e9b6e4..0000000000 --- a/site/theme/template/Home/index.less +++ /dev/null @@ -1,80 +0,0 @@ -@import (reference) '../../style/themes/index.less'; - -.home-container { - h1, - h2, - h3, - h4 { - &.ant-typography { - font-weight: 400; - } - } - - img { - object-fit: cover; - } - - .home-block-content { - margin: 88px 40px 124px; - - h2.ant-typography { - margin-bottom: 56px; - } - - &-extra { - float: right; - padding-top: 12px; - font-weight: 200; - font-size: 16px; - - html.rtl & { - float: left; - } - } - } - - .home-link-arrow { - position: relative; - margin-left: 0.3em; - font-size: 0.85em; - opacity: 0.75; - transition: all 0.2s; - - &-rtl { - margin-right: 0.3em; - margin-left: 0; - } - } - - a:hover .home-link-arrow { - transform: translateX(3px); - opacity: 1; - } - - a:hover .home-link-arrow-rtl { - transform: translateX(-3px); - opacity: 1; - } -} - -@media (max-width: @screen-sm-min) { - .home-container { - .home-block-content { - margin-top: 64px; - margin-bottom: 96px; - - h2.ant-typography { - margin-bottom: 44px; - } - } - } -} - -@media only screen and (max-width: 767.99px) { - .home-container { - .home-block-content { - margin-right: 24px; - margin-left: 24px; - } - } -} diff --git a/site/theme/template/Home/index.tsx b/site/theme/template/Home/index.tsx deleted file mode 100644 index 6b7c199d29..0000000000 --- a/site/theme/template/Home/index.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import * as React from 'react'; -import { FormattedMessage, useIntl } from 'react-intl'; -import { Typography } from 'antd'; -import { Link } from 'bisheng/router'; -import Banner from './Banner'; -import RecommendPage from './RecommendPage'; -import DesignPage from './DesignPage'; -import MorePage from './MorePage'; -import Footer from '../Layout/Footer'; -import { getLocalizedPathname } from '../utils'; -import './index.less'; - -const { Title } = Typography; - -function getStyle() { - return ` - .rc-footer-container { - padding-left: 0; - padding-right: 0; - } - - .rc-footer-columns { - max-width: 1208px; - margin: 0 auto; - } - `; -} - -interface BlockContentProps { - title: React.ReactNode; - extra?: React.ReactNode; - children?: React.ReactNode; -} - -const BlockContent: React.FC = ({ title, children, extra }) => ( -
    - - {title} - - {extra && <div className="home-block-content-extra">{extra}</div>} - - {children} -
    -); - -const Home = (props: { location: any }) => { - const { location } = props; - const { locale } = useIntl(); - const isZhCN = locale === 'zh-CN'; - - const getLink = () => { - const path = getLocalizedPathname('/docs/resources', isZhCN, location.query, { - zhCN: '文章', - enUS: 'Articles', - }); - const { pathname, query = {} } = path; - const pathnames = pathname.split('#'); - if ('direction' in query) { - return `${pathnames[0]}?direction=rtl#${pathnames[1]}`; - } - return path; - }; - - return ( -
    -