Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from ant-design:master #85

Closed
wants to merge 242 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
242 commits
Select commit Hold shift + click to select a range
a4212f4
chore: auto merge branches (#43940)
github-actions[bot] Aug 2, 2023
1f03d37
chore: auto merge branches (#44052)
github-actions[bot] Aug 6, 2023
5e9ef68
feat: Form requiredMark support renderProps (#44073)
zombieJ Aug 7, 2023
9436ece
feat: upload support rootClassName (#44060)
kiner-tang Aug 7, 2023
915514f
feat: TimePicker support rootClassName (#44059)
kiner-tang Aug 7, 2023
77ecdcb
feat(DatePicker): RangePicker support rootClassName (#44057)
kiner-tang Aug 7, 2023
dcba47b
feat: Input.TextArea support rootClassName (#44058)
kiner-tang Aug 7, 2023
5351fac
feat: Badge.Ribbon support rootClassName (#44056)
kiner-tang Aug 7, 2023
bd54d4e
chore: auto merge branches (#44085)
github-actions[bot] Aug 7, 2023
9d122a6
feat(AutoComplete): AutoComplete support rootClassName (#44055)
kiner-tang Aug 8, 2023
4fe27ba
feat: button component token (#44090)
MadCcc Aug 8, 2023
8a3870f
feat: Watermark support nest Modal & Drawer (#44104)
zombieJ Aug 8, 2023
5465975
feat: table component token (#44118)
MadCcc Aug 9, 2023
cfdc446
docs(Image): fix render originalNode ts (#44125)
linxianxi Aug 9, 2023
a67f943
feat(Cascader): support autoClearSearchValue (#44033)
linxianxi Aug 9, 2023
1a86204
feat: Form validateFields support recursive (#44130)
zombieJ Aug 9, 2023
ba90af1
Merge branch 'master' into feature-merge-master
MadCcc Aug 10, 2023
7f32c9e
chore: auto merge branches (#44164)
github-actions[bot] Aug 11, 2023
1c1ebbe
feat: Divider Component Token (#42627)
hms181231 Aug 11, 2023
a5203eb
feat: layout token (#44174)
MadCcc Aug 11, 2023
5ddec3a
chore: CI of PR welcome (#44184)
zombieJ Aug 11, 2023
56f2bc5
fix: (tabs)Unexpected color change in the click area of the mobile ta…
electroluxcode Aug 14, 2023
72b449a
docs: update faq (#44198)
zombieJ Aug 14, 2023
0a4463e
chore: auto merge branches (#44202)
github-actions[bot] Aug 14, 2023
6de03ae
feat: Tabs support token (#44201)
MadCcc Aug 14, 2023
db07a2f
feat: Progress Component Token (#42757)
hms181231 Aug 14, 2023
ee984fe
fix: Modal open should not block dropdown hidden (#44204)
zombieJ Aug 14, 2023
6a6f1b7
feat(badge): migrate less to token (#42778)
Wxh16144 Aug 14, 2023
d1bd2d0
docs: Update recommendation (#44207)
afc163 Aug 14, 2023
e0e373f
fix(badge): fix badge number is rtl (#43998)
NotEvenANeko Aug 14, 2023
1b479c4
feat(collapse): migrate less to token (#42938)
Wxh16144 Aug 14, 2023
009779c
chore: collapse token meta (#44211)
MadCcc Aug 14, 2023
41cb8be
fix(DatePicker): optimize RangePicker's range area style (#44206)
kiner-tang Aug 14, 2023
16f0738
chore(deps-dev): bump lint-staged from 13.3.0 to 14.0.0 (#44212)
dependabot[bot] Aug 14, 2023
20cb8fc
site: revert lost api description (#44216)
li-jia-nan Aug 15, 2023
d493594
docs: fix menu sider-current demo (#44222)
MadCcc Aug 15, 2023
aff2bb7
chore: update pagination (#44226)
zombieJ Aug 15, 2023
9ec8534
docs(cascader): fix allowClear default value in doc (#44230)
zbw-zbw Aug 15, 2023
4fb448f
doc: upload doc line break (#44234)
1587315093 Aug 15, 2023
3f0e747
docs: fix theme editor page (#44232)
MadCcc Aug 15, 2023
65989b4
feat: select component token (#44228)
MadCcc Aug 15, 2023
8a65ad6
docs: fix font color (#44236)
MadCcc Aug 15, 2023
83e3b52
docs(Tabs): update animated prop's description (#44227)
kovsu Aug 15, 2023
a92a883
docs: render china mirror link before hydration (#44233)
afc163 Aug 16, 2023
b9f77fd
feat: migrate less to token for Switch (#42192)
Yuiai01 Aug 16, 2023
947ea38
fix(Button): fix fontSizeSM token not working (#44217)
CHENGTIANG Aug 16, 2023
9ba9da2
fix: ColorPicker HEX input cursor jump bug (#44137)
gouge666 Aug 16, 2023
808452e
fix(DataPicker):fix picker content is not centered (#44245)
Zian502 Aug 17, 2023
27e54c9
feat: Button support contentFontSize token (#44257)
MadCcc Aug 17, 2023
cdc4e50
feat: migrate less to token for Alert (#42142)
linhf123 Aug 17, 2023
030f385
feat: cascader token (#44261)
MadCcc Aug 17, 2023
f1c38bf
site(Calendar): add lunar calendar demo (#44166)
kiner-tang Aug 17, 2023
2e18b63
feat(list): list support using the componentSize configuration size f…
Yuiai01 Aug 17, 2023
3525966
docs: Update faq.zh-CN.md (#44274)
afc163 Aug 17, 2023
7179dc8
docs: update footer links (#44272)
afc163 Aug 17, 2023
73cfd37
fix: `Descriptions` key prop issue (#44278)
RedJue Aug 17, 2023
affd62f
chore(deps-dev): bump @testing-library/jest-dom from 5.17.0 to 6.0.0 …
dependabot[bot] Aug 17, 2023
ce687c5
fix(ColorPicker): color clear deformation (#44258) (#44273)
kouchao Aug 18, 2023
74d9654
feat: tree token (#44282)
MadCcc Aug 18, 2023
3b913cf
site: add internationalization for docs (#44263)
li-jia-nan Aug 18, 2023
d375cbd
feat: Avatar support size from ConfigProvider (#44288)
li-jia-nan Aug 18, 2023
39ca9d8
chore: merge master into feature
li-jia-nan Aug 18, 2023
7226c53
docs: add third-party library to the development section (#44283)
ArtyomVancyan Aug 18, 2023
8177c52
docs: add changelog 5.8.4 (#44293)
xrkffgg Aug 18, 2023
558ec7f
Merge branch master into feature-merge-master
li-jia-nan Aug 18, 2023
80bd54f
chore: redirect with rest url (#44298)
iola1999 Aug 18, 2023
8afbe69
docs(demo): Replace backticks with single quotes (#44302)
thinkasany Aug 20, 2023
7fe4d4e
Merge branch 'master' into feature-merge-master
li-jia-nan Aug 20, 2023
f91bc7b
test: update snap
li-jia-nan Aug 20, 2023
8ca7ab9
chore: auto merge branches (#44292)
github-actions[bot] Aug 20, 2023
65fd05c
style: add prettier-plugin-sort-imports (#44287)
crazyair Aug 21, 2023
3b5e3e8
docs(tabs): remove useless string in Description (#44307)
thinkasany Aug 21, 2023
b50928f
chore: split previewer (#44310)
MadCcc Aug 21, 2023
8e7d02c
feat: support closeIcon (#44312)
kiner-tang Aug 21, 2023
e02e53b
docs: link preload => prefetch (#44320)
afc163 Aug 21, 2023
21a2265
docs: show mirror modal on page load (#44291)
MadCcc Aug 21, 2023
b26e3a7
fix: WaterMark clip logic (#44321)
zombieJ Aug 21, 2023
3f84618
chore: merge master
zombieJ Aug 21, 2023
73c5ce1
test: update snapshot
zombieJ Aug 21, 2023
be80d1f
chore: clean up
zombieJ Aug 21, 2023
beb61e6
chore: fix lint
zombieJ Aug 21, 2023
da699b1
docs: add fallback for previewer (#44327)
MadCcc Aug 21, 2023
f34ff52
chore: auto merge branches (#44328)
github-actions[bot] Aug 21, 2023
d1d3b57
feat: input token (#44325)
MadCcc Aug 22, 2023
06d1c9a
docs: font flash in home page (#44333)
afc163 Aug 22, 2023
820a921
feat: Spin token (#44334)
MadCcc Aug 22, 2023
af301a9
fix(date-picker):fix format type processing for showTime. (#44306)
Zian502 Aug 22, 2023
80e1bc8
style: remove importOrderSeparation from prettier config (#44336)
crazyair Aug 22, 2023
d57c86d
feat: migrate less to token for DatePicker (#42607)
poyiding Aug 22, 2023
477b1ec
feat: migrate less to token for Form (#42774)
poyiding Aug 22, 2023
70d9a90
docs: fix anchor positioning (#44348)
MadCcc Aug 22, 2023
0295322
docs: prevent highlight code initially (#44344)
afc163 Aug 22, 2023
4d12efe
chore: Update pr-contributor-welcome.yml (#44340)
afc163 Aug 22, 2023
24d055e
chore(deps-dev): bump vanilla-jsoneditor from 0.17.10 to 0.18.0 (#44352)
dependabot[bot] Aug 22, 2023
f5fcb70
fix: rm useless form inline style (#44360)
zombieJ Aug 22, 2023
5d522a3
chore: remove duplicate styles (#44368)
Wxh16144 Aug 23, 2023
f06d851
Merge branch 'master' into feature-merge-master
yoyo837 Aug 23, 2023
609c009
chore: auto merge branches (#44374)
github-actions[bot] Aug 23, 2023
79825c0
fix: Table should not crash if filterDropdown is boolean (#44357)
MadCcc Aug 23, 2023
4cf3ba1
fix: Select popup size in transform layout (#44378)
zombieJ Aug 23, 2023
e91f927
fix: radio should work in tree (#44380)
MadCcc Aug 24, 2023
a3bd7a7
fix: rm useless form inline style (#44375)
yoyo837 Aug 24, 2023
4321cf9
feat: Tour support horizontal gap (#44377)
RedJue Aug 24, 2023
2096c01
feat: Radio add component token (#44389)
MadCcc Aug 24, 2023
eaa8635
ColorPresets: fix duplicate keys (#44370)
xr0master Aug 24, 2023
0dd651c
docs: Fix Form provider demo (#44391)
zombieJ Aug 24, 2023
9312b00
chore: update icon snapshot (#44414)
MadCcc Aug 24, 2023
68ee322
Merge branch 'master' into feature-merge-master
MadCcc Aug 24, 2023
dd5628b
chore: auto merge branches (#44416)
github-actions[bot] Aug 24, 2023
3405450
fix: Form xs breakpoint (#44388)
zombieJ Aug 24, 2023
d373bf3
feat: Progress.Circle support conic (#44404)
zombieJ Aug 24, 2023
4755aca
feat: support Input shadow token (#44410)
MadCcc Aug 25, 2023
d7d493e
refactor(notification): reduce the configuration parameter code (#44372)
Yuiai01 Aug 25, 2023
94339be
feat: lunisolar => lunar-typescript (#44420)
kiner-tang Aug 25, 2023
4e9ac02
fix: Tour panel token & home support dark mode (#44428)
zombieJ Aug 25, 2023
e8b5a18
docs: update next.js docs (#44440)
li-jia-nan Aug 26, 2023
cc2c26b
fix : type error at align property in dropdown (#44423)
LeTuongKhanh Aug 26, 2023
b1a5738
type: fix notification config typings (#44163)
StefanoMagrassi Aug 27, 2023
c07d61a
chore: auto merge branches (#44448)
github-actions[bot] Aug 27, 2023
50bf708
fix: hooks call warning (#44450)
zombieJ Aug 27, 2023
3c73256
chore(deps): update dependency typedoc to ^0.25.0 (#44443)
renovate[bot] Aug 27, 2023
ca03968
refactor: abstract ribbon style (#44451)
zombieJ Aug 27, 2023
20d12f8
chore(deps-dev): bump typescript from 5.1.6 to 5.2.2 (#44430)
dependabot[bot] Aug 27, 2023
20593af
type: revert type import path (#44453)
li-jia-nan Aug 28, 2023
4ba36dc
chore: Update index.zh-CN.md (#44441)
afc163 Aug 28, 2023
3e171a9
feat: default add resetIcon Style (#41208)
Wxh16144 Aug 28, 2023
ef61160
doc: update token note (#44447)
poyiding Aug 28, 2023
e7c7601
feat: Modal footer support custom render function (#44318)
RedJue Aug 28, 2023
4a896e9
feat: Support source in the onSearch handler of Input.Search Componen…
kiner-tang Aug 28, 2023
74f6040
fix: carousel vertical drag issue (#44460)
RedJue Aug 28, 2023
bbbc3d9
docs: v5.8.5 (#44461)
vagusX Aug 28, 2023
6f2bddd
feat: Table support `virtual` (#44349)
zombieJ Aug 28, 2023
97b03dc
fix: rm useless ts def of upload (#44468)
zombieJ Aug 28, 2023
07056fa
docs: fix theme card style in Firefox (#44473)
afc163 Aug 28, 2023
4d1bac4
site: add code-hide Button for CodePreviewer (#44449)
li-jia-nan Aug 28, 2023
2d1d987
fix: color picker open popup when disabled (#44466)
RedJue Aug 28, 2023
a95662d
refactor: button default not use compact style (#44475)
zombieJ Aug 28, 2023
16f8228
chore: merge master
zombieJ Aug 28, 2023
345a3a0
fix: Form 与 Grid 样式冲突问题 (#44472)
crazyair Aug 28, 2023
fec423e
docs: Update definition for dashed button (#44481)
fulldecent Aug 29, 2023
bb8705a
chore: auto merge branches (#44479)
github-actions[bot] Aug 29, 2023
c70ba36
chore: disabled compat/compat in test files (#44496)
MadCcc Aug 29, 2023
fae1fef
fix: add role="button" props to div (#44494)
li-jia-nan Aug 29, 2023
457feb7
docs(select): fix incorrect link of AutoComplete (#44500)
xhofe Aug 29, 2023
7a66d46
refactor: Form style should always before Grid (#44485)
zombieJ Aug 29, 2023
d31a19a
chore: feature merge master
zombieJ Aug 29, 2023
230231a
chore: auto merge branches (#44502)
github-actions[bot] Aug 29, 2023
0f87c9d
fix: Watermark should not crash if content is empty (#44501)
MadCcc Aug 29, 2023
07c03d1
feat: Tabs support indicatorLength (#44406)
MadCcc Aug 29, 2023
9c494ab
fix: transfer label height (#44471)
kovsu Aug 29, 2023
8d7dd80
docs: Update batch of docs & demos (#44509)
zombieJ Aug 29, 2023
629efb7
perf: Notification style should be generated when shown (#44488)
MadCcc Aug 29, 2023
acdf115
refactor: Extract Tag unused style (#44512)
zombieJ Aug 29, 2023
620e168
chore: feature merge master
zombieJ Aug 29, 2023
64d7ac1
test: update snapshot
zombieJ Aug 29, 2023
64fd1cd
chore(deps-dev): bump @typescript-eslint/eslint-plugin from 5.62.0 to…
dependabot[bot] Aug 29, 2023
f5de020
Merge branch 'master' into feature-merge-master
li-jia-nan Aug 29, 2023
59cc096
test: fix test case
zombieJ Aug 29, 2023
0cd139e
Merge branch 'feature-merge-master' of https://github.com/ant-design/…
zombieJ Aug 29, 2023
6ebbdc9
feat✨(transfer):Add a new direction parameter for filterOption func…
Zian502 Aug 29, 2023
25e7641
chore: fix lint
zombieJ Aug 29, 2023
639c0c2
chore: auto merge branches (#44516)
github-actions[bot] Aug 29, 2023
7e1e6d8
chore: fix overview search (#44523)
crazyair Aug 30, 2023
e88581c
chore: migrate rome to biome (#44522)
fz6m Aug 30, 2023
659054e
docs: Blog virtual table (#44526)
zombieJ Aug 30, 2023
b0dd138
feat: ConfigProvider support Tabs `indicatorSize` (#44517)
MadCcc Aug 30, 2023
cbfb126
feat: Descriptions `items.span` support responsive config (#44534)
zombieJ Aug 30, 2023
3f148d9
docs: add help text for token customization
afc163 Aug 30, 2023
a265257
fix: record the completed length of the last calculation as the trans…
bbb169 Aug 30, 2023
d0cc758
fix: Form sm 24 not working (#44541)
zombieJ Aug 31, 2023
ae53a45
docs: add help text for token customization (#44540)
afc163 Aug 31, 2023
a608bfa
chore: fix form demo error (#44549)
li-jia-nan Aug 31, 2023
48ebf3a
site: fix a link flash jump (#44556)
poyiding Aug 31, 2023
d3c2f75
refactor: ConfirmModal layout to fix batch of bug (#44557)
zombieJ Aug 31, 2023
b0f0975
docs: update form docs description (#44548)
serene-ding Aug 31, 2023
b12d69c
chore: merge master into feature
li-jia-nan Aug 31, 2023
e19a808
chore: auto merge branches (#44567)
github-actions[bot] Aug 31, 2023
a3d8bf9
chore: update docs use with Next.js (#44569)
li-jia-nan Sep 1, 2023
e23cc69
feat: support hide expandIcon (#44554)
kiner-tang Sep 1, 2023
e689878
chore: Update happy-work.zh-CN.md (#44572)
afc163 Sep 1, 2023
41ef050
chore: typo (#44579)
kovsu Sep 1, 2023
9258dea
docs: add note regarding considerations for using getContainer (#44504)
Wxh16144 Sep 1, 2023
7198497
fix: hide arrow for last item in vertical Steps (#44582)
ohhoney1 Sep 1, 2023
edf907b
fix: slider track draggale range height/width error (#44503)
yoyo837 Sep 1, 2023
24c7b2e
site: optimize site scroll bar dark mode style (#44588)
KuangPF Sep 2, 2023
9a2ef0e
chore: update README (#44589)
poyiding Sep 2, 2023
9f8d68d
fix: fix CI fail (#44592)
li-jia-nan Sep 2, 2023
3f01f83
docs: remove READMEs but ENG and CHN (#44596)
afc163 Sep 2, 2023
27d8f62
chore(float-button): remove unused css code (#44587)
zbw-zbw Sep 2, 2023
5706f21
chore: skip husky install in ci environment (#44600)
afc163 Sep 2, 2023
8099247
docs(:sparkles:): release 5.8.6 (#44597)
afc163 Sep 2, 2023
ad46da1
Merge branch 'master' into feature-merge-master
yoyo837 Sep 2, 2023
9d162d3
docs: sort i18n table (#44603)
yoyo837 Sep 2, 2023
5a5af38
fix: CheckableTag miss CP tag (#44602)
zombieJ Sep 3, 2023
18af537
Merge branch 'master' into feature-merge-master
li-jia-nan Sep 3, 2023
c83c587
chore: auto merge branches (#44601)
github-actions[bot] Sep 3, 2023
0f843cf
chore: fix docs typo (#44604)
li-jia-nan Sep 4, 2023
0396899
fix: Form.Item `noStyle` support validation status (#44576)
zombieJ Sep 4, 2023
85dc67f
feature: add itemSelectedFontColor token in Segemented Component (#4…
xiaozisong Sep 4, 2023
c29e91d
docs: Blog of extends of ConfigProvider (#44606)
zombieJ Sep 4, 2023
c7a0928
docs: add faq about valuePropName (#44609)
zombieJ Sep 4, 2023
56724cd
fix(Upload): action buttons focus style leave after click it (#44594)
zbw-zbw Sep 4, 2023
b284648
refactor: fix compiling (#44616)
MadCcc Sep 4, 2023
54316f7
test: disable timeout for puppeteer waitForSelector (#44611)
afc163 Sep 4, 2023
f0c105d
feat: insert `use client` automatically at compilations instead of …
Dunqing Sep 4, 2023
4c91896
refactor: use token instead of constant in size (#44598)
li-jia-nan Sep 4, 2023
46341b1
feat: custom feedback icons (#43894)
gldio Sep 4, 2023
6a5e7de
refactor: remove Space & Grid IE compatible logic (#44620)
li-jia-nan Sep 5, 2023
ef4ccae
chore: migrate to actions/checkout@v4 (#44623)
MadCcc Sep 5, 2023
114ff39
Merge branch 'master' into feature-merge-master
MadCcc Sep 5, 2023
03fee8d
feat: export BasicDataNode type from tree (#44624)
kiner-tang Sep 5, 2023
caa71d4
chore: auto merge branches (#44629)
github-actions[bot] Sep 5, 2023
69c52b7
feat: ColorPicker support defaultFormat (#44487)
CYBYOB Sep 5, 2023
49e1efa
fix: fix date-picker footer style (#44642)
li-jia-nan Sep 5, 2023
ee8cf22
feat: Form validation support `validateDebounce` (#44633)
zombieJ Sep 5, 2023
1b61870
fix: Modal hooks press esc can not trigger await (#44646)
zombieJ Sep 5, 2023
002382c
chore: install using pnpm (#44639)
btea Sep 5, 2023
dff3c63
docs: fix wrong description about Avatar's Design Token (#44634)
yyxTheOracle Sep 5, 2023
70466b0
chore: merge master into feature
li-jia-nan Sep 5, 2023
bddcd17
chore: auto merge branches (#44648)
github-actions[bot] Sep 5, 2023
f0bf373
chore: change notification sound (#44661)
afc163 Sep 6, 2023
dab3cc9
fix: fix Input.Search style (#44660)
daledelv Sep 6, 2023
d266ca2
chore(deps-dev): bump size-limit from 8.2.6 to 9.0.0 (#44664)
dependabot[bot] Sep 6, 2023
875ef97
fix: Tag with Popover/Popconfirm should not affect style (#44663)
afc163 Sep 7, 2023
7344f5e
chore: replace useToken with useInternalToken (#44670)
li-jia-nan Sep 7, 2023
a873471
merge
chenshuai2144 Sep 7, 2023
0ef1cd1
change version
chenshuai2144 Sep 7, 2023
5905f33
Merge pull request #44679 from ant-design/fix-merge-conflicting
chenshuai2144 Sep 7, 2023
ff845fe
chore: lock @swc/core 1.3.82 (#44680)
li-jia-nan Sep 7, 2023
8ce23ea
chore: Delete pr-contributor-welcome action (#44685)
afc163 Sep 7, 2023
a41a756
chore: using `tsx` instead of `ts-node` (#44688)
Dunqing Sep 7, 2023
c28e1ff
docs: mark deprecated for date-picker defaultPickerValue prop (#43781)
zbw-zbw Sep 7, 2023
3b6b840
chore: missing @types/jsdom (#44689)
Dunqing Sep 7, 2023
5183e5d
chore: update authors list (#44694)
li-jia-nan Sep 7, 2023
59366da
docs: correct typos (#44705)
whalesink Sep 8, 2023
ec607dd
docs: add blog (#44698)
RedJue Sep 8, 2023
9a1fbad
chore: bump rc-* (#44709)
yoyo837 Sep 8, 2023
fa4c0c0
fix(float-button): marginBottom is invalid after the href is added (#…
Yuiai01 Sep 8, 2023
56b1b3f
chore: update ignore (#44710)
yoyo837 Sep 8, 2023
584326b
docs: add 5.9.0 changelog (#44692)
chenshuai2144 Sep 8, 2023
2cf22e8
docs: add theme toggle animation (#44655)
RedJue Sep 8, 2023
32d0a1f
docs: replace blog pic (#44717)
RedJue Sep 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ version: 2.1
jobs:
test-argos-ci:
docker:
- image: cimg/node:16.20-browsers
- image: cimg/node:18.17-browsers
environment:
NODE_OPTIONS: --openssl-legacy-provider
steps:
- checkout
- run:
Expand Down
7 changes: 7 additions & 0 deletions .dumi/hooks/useDark.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from 'react';

export const DarkContext = React.createContext(false);

export default function useDark() {
return React.useContext(DarkContext);
}
126 changes: 126 additions & 0 deletions .dumi/hooks/useThemeAnimation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
import { useEffect, useRef } from 'react';
import { removeCSS, updateCSS } from 'rc-util/lib/Dom/dynamicCSS';

import theme from '../../components/theme';

const viewTransitionStyle = `
::view-transition-old(root),
::view-transition-new(root) {
animation: none;
mix-blend-mode: normal;
}

.dark::view-transition-old(root) {
z-index: 1;
}

.dark::view-transition-new(root) {
z-index: 999;
}

::view-transition-old(root) {
z-index: 999;
}

::view-transition-new(root) {
z-index: 1;
}
`;

const useThemeAnimation = () => {
const {
token: { colorBgElevated },
} = theme.useToken();

const animateRef = useRef<{
colorBgElevated: string;
}>({
colorBgElevated,
});

const startAnimationTheme = (clipPath: string[], isDark: boolean) => {
updateCSS(
`
* {
transition: none !important;
}
`,
'disable-transition',
);

document.documentElement
.animate(
{
clipPath: isDark ? [...clipPath].reverse() : clipPath,
},
{
duration: 500,
easing: 'ease-in',
pseudoElement: isDark ? '::view-transition-old(root)' : '::view-transition-new(root)',
},
)
.addEventListener('finish', () => {
removeCSS('disable-transition');
});
};

const toggleAnimationTheme = (event: MouseEvent, isDark: boolean) => {
// @ts-ignore
if (!(event && typeof document.startViewTransition === 'function')) return;
const x = event.clientX;
const y = event.clientY;
const endRadius = Math.hypot(Math.max(x, innerWidth - x), Math.max(y, innerHeight - y));
updateCSS(
`
[data-prefers-color='dark'] {
color-scheme: light !important;
}

[data-prefers-color='light'] {
color-scheme: dark !important;
}
`,
'color-scheme',
);
document
// @ts-ignore
.startViewTransition(async () => {
// wait for theme change end
while (colorBgElevated === animateRef.current.colorBgElevated) {
// eslint-disable-next-line no-await-in-loop
await new Promise((resolve) => {
setTimeout(resolve, 1000 / 60);
});
}
const root = document.documentElement;
root.classList.remove(isDark ? 'dark' : 'light');
root.classList.add(isDark ? 'light' : 'dark');
})
.ready.then(() => {
const clipPath = [
`circle(0px at ${x}px ${y}px)`,
`circle(${endRadius}px at ${x}px ${y}px)`,
];
removeCSS('color-scheme');
startAnimationTheme(clipPath, isDark);
});
};

// inject transition style
useEffect(() => {
// @ts-ignore
if (typeof document.startViewTransition === 'function') {
updateCSS(viewTransitionStyle, 'view-transition-style');
}
}, []);

useEffect(() => {
if (colorBgElevated !== animateRef.current.colorBgElevated) {
animateRef.current.colorBgElevated = colorBgElevated;
}
}, [colorBgElevated]);

return toggleAnimationTheme;
};

export default useThemeAnimation;
172 changes: 172 additions & 0 deletions .dumi/mirror-modal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
(function createMirrorModal() {
if (
(navigator.languages.includes('zh') || navigator.languages.includes('zh-CN')) &&
/-cn\/?$/.test(window.location.pathname) &&
!['ant-design.gitee.io', 'ant-design.antgroup.com'].includes(window.location.hostname)
) {
const ANTD_DOT_NOT_SHOW_MIRROR_MODAL = 'ANT_DESIGN_DO_NOT_OPEN_MIRROR_MODAL';

const lastShowTime = window.localStorage.getItem(ANTD_DOT_NOT_SHOW_MIRROR_MODAL);
if (
lastShowTime &&
lastShowTime !== 'true' &&
Date.now() - new Date(lastShowTime).getTime() < 7 * 24 * 60 * 60 * 1000
) {
return;
}

const style = document.createElement('style');
style.innerHTML = `
@keyframes mirror-fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}

@keyframes mirror-zoom-in {
from {
transform: scale(0.8);
}
to {
transform: scale(1);
}
}

.mirror-modal-mask {
position: fixed;
inset: 0;
height: '100vh';
width: '100vw';
background: rgba(0, 0, 0, 0.3);
z-index: 9999;
animation: mirror-fade-in 0.3s forwards;
}

.mirror-modal-dialog {
position: fixed;
inset: 0;
top: 120px;
margin-left: auto;
margin-right: auto;
width: 400px;
height: 120px;
display: flex;
align-items: center;
flex-direction: column;
border-radius: 8px;
border: 1px solid #eee;
background: #fff;
padding: 20px 24px;
box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
animation: mirror-zoom-in 0.3s forwards;
}

.mirror-modal-title {
font-size: 16px;
font-weight: 500;
align-self: flex-start;
margin-bottom: 8px;
}

.mirror-modal-content {
font-size: 14px;
align-self: flex-start;
margin-bottom: 16px;
}

.mirror-modal-btns {
align-self: flex-end;
margin-top: auto;
display: flex;
align-items: center;
}

.mirror-modal-btn {
border-radius: 6px;
cursor: pointer;
height: 32px;
box-sizing: border-box;
font-size: 14px;
padding: 4px 16px;
display: inline-flex;
align-items: center;
text-decoration: none;
transition: all 0.2s;
}

.mirror-modal-confirm-btn {
background: #1677ff;
color: #fff;
}

.mirror-modal-confirm-btn:hover {
background: #4096ff;
}

.mirror-modal-confirm-btn:active {
background: #0958d9;
}

.mirror-modal-cancel-btn {
border: 1px solid #eee;
color: #000;
margin-right: 8px;
}

.mirror-modal-cancel-btn:hover {
border-color: #4096ff;
color: #4096ff
}

.mirror-modal-cancel-btn:active {
border-color: #0958d9;
color: #0958d9;
}
`;
document.head.append(style);

const modal = document.createElement('div');
modal.className = 'mirror-modal-mask';

const dialog = document.createElement('div');
dialog.className = 'mirror-modal-dialog';
modal.append(dialog);

const title = document.createElement('div');
title.className = 'mirror-modal-title';
title.innerText = '提示';
dialog.append(title);

const content = document.createElement('div');
content.className = 'mirror-modal-content';
content.innerText = '国内用户推荐访问国内镜像以获得极速体验~';
dialog.append(content);

const btnWrapper = document.createElement('div');
btnWrapper.className = 'mirror-modal-btns';
dialog.append(btnWrapper);

const cancelBtn = document.createElement('a');
cancelBtn.className = 'mirror-modal-cancel-btn mirror-modal-btn';
cancelBtn.innerText = '7 天内不再显示';
btnWrapper.append(cancelBtn);
cancelBtn.addEventListener('click', () => {
window.localStorage.setItem(ANTD_DOT_NOT_SHOW_MIRROR_MODAL, new Date().toISOString());
document.body.removeChild(modal);
document.head.removeChild(style);
document.body.style.overflow = '';
});

const confirmBtn = document.createElement('a');
confirmBtn.className = 'mirror-modal-confirm-btn mirror-modal-btn';
confirmBtn.href = window.location.href.replace(window.location.host, 'ant-design.antgroup.com');
confirmBtn.innerText = '🚀 立刻前往';
btnWrapper.append(confirmBtn);

document.body.append(modal);
document.body.style.overflow = 'hidden';
}
})();
Loading