Compare commits

..

69 Commits
theme ... 6.2.3

Author SHA1 Message Date
afc163
20f8a9a9ed chore: bump version to 6.2.3 (#56813)
* chore: bump version to 6.2.3

* docs: update AGENTS.md with comprehensive development guidelines

* Update CHANGELOG.zh-CN.md

Co-authored-by: lijianan <574980606@qq.com>
Signed-off-by: afc163 <afc163@gmail.com>

* Update CHANGELOG.en-US.md

Signed-off-by: afc163 <afc163@gmail.com>

* Update CHANGELOG.zh-CN.md

Signed-off-by: afc163 <afc163@gmail.com>

---------

Signed-off-by: afc163 <afc163@gmail.com>
Co-authored-by: lijianan <574980606@qq.com>
2026-02-02 14:57:45 +08:00
dependabot[bot]
f20a3d6fba chore: bump eslint-plugin-react-refresh from 0.4.26 to 0.5.0 (#56828)
Bumps [eslint-plugin-react-refresh](https://github.com/ArnaudBarre/eslint-plugin-react-refresh) from 0.4.26 to 0.5.0.
- [Release notes](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/releases)
- [Changelog](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ArnaudBarre/eslint-plugin-react-refresh/compare/v0.4.26...v0.5.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-react-refresh
  dependency-version: 0.5.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-02 09:15:08 +08:00
lijianan
191db91774 site(a11y): apply prefers-reduced-motion handling for transitions (#56823)
* site(a11y): apply prefers-reduced-motion handling for transitions

* site(a11y): apply prefers-reduced-motion handling for transitions
2026-02-01 17:52:13 +08:00
renovate[bot]
a28f8aa863 chore(deps): update dependency @types/react to v19.2.9 (#56819)
* chore(deps): update dependency @types/react to v19.2.10

* improve type

* update

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: thinkasany <480968828@qq.com>
2026-02-01 10:26:09 +08:00
renovate[bot]
4ab4a826c9 chore(deps): update dawidd6/action-download-artifact action to v13 (#56820)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-02-01 09:44:45 +08:00
Rain120
ffbf6e3024 docs: style issues in site design tabs (#56810)
Co-authored-by: 遇见同学 <1875694521@qq.com>
2026-01-30 17:27:22 +08:00
高艳兵
4b9085624b chore: merge duplicate debug demos (#56809)
* chore(Button): remove debug demo

* feat: update snap
2026-01-30 15:34:38 +08:00
ug
7dd385bb43 fix(Button): defaultBg, defaultColor, defaultHoverColor and defaultActiveColor token does not work (#56238)
* fix(Button): token does not work

* Update components/button/style/variant.ts

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: ug <62086147+ug-hero@users.noreply.github.com>

* update

* fix

* Update components/button/demo/component-token.tsx

Co-authored-by:  高艳兵 <66234749+QDyanbing@users.noreply.github.com>
Signed-off-by: thinkasany <480968828@qq.com>

* format

* Update components/button/style/variant.ts

Co-authored-by:  高艳兵 <66234749+QDyanbing@users.noreply.github.com>
Signed-off-by: thinkasany <480968828@qq.com>

* Update components/button/style/variant.ts

Co-authored-by:  高艳兵 <66234749+QDyanbing@users.noreply.github.com>
Signed-off-by: thinkasany <480968828@qq.com>

---------

Signed-off-by: ug <62086147+ug-hero@users.noreply.github.com>
Signed-off-by: thinkasany <480968828@qq.com>
Co-authored-by: liuqiang <qiang.liu@xinjifamily.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: 遇见同学 <1875694521@qq.com>
Co-authored-by: thinkasany <480968828@qq.com>
Co-authored-by: 高艳兵 <66234749+QDyanbing@users.noreply.github.com>
2026-01-30 14:44:38 +08:00
二货爱吃白萝卜
44a4161dd8 fix: Textarea ref miss nativeElement (#56803)
* fix: Textarea miss nativeElement

* chore: update snap

---------

Co-authored-by: 遇见同学 <1875694521@qq.com>
2026-01-30 09:56:00 +08:00
github-actions[bot]
10e43e1405 chore: upgrade deps (#56805)
Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>
2026-01-30 07:00:34 +08:00
高艳兵
93fb6c35e2 chore(test): merge semantic tests into jest and drop dedicated config (#56795)
* chore(test): merge semantic tests into jest and drop dedicated config

* chore(test): simplify SKIP_SEMANTIC env check
2026-01-29 15:30:07 +08:00
thinkasany
3073cf188d docs: Why can't the Segmented be disabled? (#56786)
* docs: add Why can't Segmented be disabled

* Update components/form/index.en-US.md

Signed-off-by: thinkasany <480968828@qq.com>

* Update components/form/index.en-US.md

Signed-off-by: thinkasany <480968828@qq.com>

* Apply suggestion from @meet-student

Signed-off-by: 遇见同学 <1875694521@qq.com>

* Apply suggestion from @meet-student

Signed-off-by: 遇见同学 <1875694521@qq.com>

* docs: update faq

* Update components/form/__tests__/index.test.tsx

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: 二货爱吃白萝卜 <smith3816@gmail.com>

---------

Signed-off-by: thinkasany <480968828@qq.com>
Signed-off-by: 遇见同学 <1875694521@qq.com>
Signed-off-by: 二货爱吃白萝卜 <smith3816@gmail.com>
Co-authored-by: 遇见同学 <1875694521@qq.com>
Co-authored-by: 二货机器人 <smith3816@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-01-29 12:09:01 +08:00
Yingtao Mo
f78e800519 fix(Flex): default align when use orientation (#55950)
Co-authored-by: thinkasany <480968828@qq.com>
2026-01-29 11:14:33 +08:00
thinkasany
ebc17059de chore(test): turn off no-nested-component-definitions (#56793)
Co-authored-by: 遇见同学 <1875694521@qq.com>
2026-01-29 10:39:51 +08:00
github-actions[bot]
a93b4122ff chore: upgrade deps (#56791)
Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>
2026-01-29 08:09:09 +08:00
unknowntocka
ead5840d90 fix(Button): default button token (#56719)
* fix(Button): default button token

* feat(Button): add default button token with custom colors in debug demo

---------

Co-authored-by: lijianan <574980606@qq.com>
2026-01-28 17:57:18 +08:00
高艳兵
166e9c88e5 fix(Typography): lower link selector specificity (#56759)
* fix(Typography): lower link selector specificity and add danger debug demo

* fix(Typography): scope link styles and raise type color priority

* chore: update snap

* chore: update snap

* fix(Typography): scope link styles and ensure type colors win

---------

Co-authored-by: 遇见同学 <1875694521@qq.com>
2026-01-28 16:01:51 +08:00
Junbeom Park
b2d14dd478 fix(ColorPicker): restrict HEX input to valid hex characters (#56752)
* fix(color-picker): restrict HEX input to valid hex characters

* test(ColorPicker): add test invalid input like ff_00_gg

* Update components/color-picker/__tests__/components.test.tsx

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: 二货爱吃白萝卜 <smith3816@gmail.com>

---------

Signed-off-by: 二货爱吃白萝卜 <smith3816@gmail.com>
Co-authored-by: 二货爱吃白萝卜 <smith3816@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-01-28 15:38:43 +08:00
github-actions[bot]
076c84b181 chore: upgrade deps (#56773)
Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>
2026-01-28 08:49:49 +08:00
thinkasany
50a3f30a72 chore: lock @types/react 19.2.7 (#56770) 2026-01-27 22:53:59 +08:00
afc163
5629062ba1 docs: remove community link from resources docs (#56760)
Co-authored-by: 遇见同学 <1875694521@qq.com>
2026-01-27 20:35:29 +08:00
遇见同学
63e4d29760 docs: fix token table title style issue (#56766) 2026-01-27 18:30:58 +08:00
遇见同学
94fe19feef chore: fix ci update snap (#56761)
* chore: fix ci update snap

* up

* chore up
2026-01-27 17:24:56 +08:00
Anton Cherniavskyi
9df0d7656f fix(Button): solid variant borders inside Space Compact (#56486)
* fix(Button): solid variant borders inside Space Compact

* refactor(Button): use genCssVar hook to generate CSS variables

* chore: adjust logic of compact

* test: update demo

---------

Co-authored-by: 遇见同学 <1875694521@qq.com>
Co-authored-by: afc163 <afc163@gmail.com>
Co-authored-by: 二货机器人 <smith3816@gmail.com>
2026-01-27 14:29:34 +08:00
lijianan
dc8acf547d type: TypeScript definition improvement (#56753) 2026-01-27 10:30:14 +08:00
Amumu
c880c2e806 chore: bunp x (#56747) 2026-01-26 20:50:04 +08:00
xrkffgg
58c5fc4625 docs: add changelog 6.2.2 (#56742)
* docs: add changelog 6.2.2

* Update CHANGELOG.en-US.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: xrkffgg <xrkffgg@vip.qq.com>

* Update CHANGELOG.en-US.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: xrkffgg <xrkffgg@vip.qq.com>

* Update CHANGELOG.en-US.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: xrkffgg <xrkffgg@vip.qq.com>

* docs: update

* docs: update

---------

Signed-off-by: xrkffgg <xrkffgg@vip.qq.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: afc163 <afc163@gmail.com>
2026-01-26 19:11:00 +08:00
二货爱吃白萝卜
250597ea0c test: update snapshot (#56745) 2026-01-26 18:15:37 +08:00
𝑾𝒖𝒙𝒉
3034888500 fix(Propover): Isolate Form.Item status from popup-type components (#56728)
* 🧪 add unit test

* fix(Propover): Isolate `Form.Item` status from popup-type components
2026-01-26 14:49:03 +08:00
thinkasany
705c3642d3 chore: add deprecated comments (#56733) 2026-01-26 13:04:55 +08:00
renovate[bot]
fbe7864e10 chore(deps): update dependency env-paths to v4 (#56736)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-25 10:47:11 +08:00
afc163
2f6548209d test: fix test case skip logic (#56701)
* test: fix test case skip logic

* fix

* fix

* test: add snapshot tests for splitter and table demos

* test: remove skip options from splitter tests

* test: add snapshot for size-mix demo in splitter component
2026-01-23 13:02:04 +08:00
高艳兵
6f90801861 fix(Button): text variant tokens not working (#56291)
* fix(Button): text variant tokens not working

* test(Button): add debug demo for text variant component tokens

* test: update button debug color variant snapshots

* fix: getCssVar to varName

---------

Co-authored-by: 遇见同学 <1875694521@qq.com>
Co-authored-by: thinkasany <480968828@qq.com>
2026-01-23 09:49:48 +08:00
高艳兵
b5b735a490 fix: align pagination container items vertically (#56715)
* fix: align pagination container items vertically

* fix: quick-jumper center
2026-01-23 09:08:44 +08:00
QdabuliuQ
8bebba7af8 docs(Drawer): add maxSize prop documentation to Drawer (#56704)
* fix: replace insetInline properties with left/right in drawer style

* docu: add maxSize prop documentation to Drawer

Documented the new `maxSize` property for the Drawer component in both English and Chinese docs, describing its purpose and usage when the Drawer is resizable.

* chore: update drawer markdown

* fix: resolve file content conflict

* doc: modify the order of maxSize property in markdown

* docs: improve drawer api table

* docs: improve drawer api table

* fix: update Drawer 'open' prop default value in docs

* fix: deprecate headerStyle prop in Drawer documentation

* Update components/drawer/index.en-US.md

Signed-off-by: thinkasany <480968828@qq.com>

* Update components/drawer/index.zh-CN.md

Signed-off-by: thinkasany <480968828@qq.com>

---------

Signed-off-by: thinkasany <480968828@qq.com>
Co-authored-by: thinkasany <480968828@qq.com>
2026-01-22 22:39:22 +08:00
ug
3ac1fc78e7 perf(Empty/Skeleton): Reduce the size of the SVG (#56682)
* optimize(Empty): Reduce the size of the SVG.

* update

* update

* update

---------

Co-authored-by: liuqiang <qiang.liu@xinjifamily.com>
Co-authored-by: afc163 <afc163@gmail.com>
2026-01-21 23:59:13 +08:00
Copilot
f091c1e01b test: skip table sticky demo from visual regression (#56698)
* Initial plan

* test: skip table-sticky demo from UI comparison

Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>
2026-01-21 23:43:47 +08:00
thinkasany
acc11dfccb chore(eslint): add fetch to polyfills configuration (#56697) 2026-01-21 23:05:52 +08:00
QdabuliuQ
964eb9d9d5 fix: replace insetInline properties with left/right in drawer style (#56693)
Co-authored-by: thinkasany <480968828@qq.com>
2026-01-21 21:01:32 +08:00
thinkasany
3ee9ff0811 chore: rm useless type (#56695) 2026-01-21 20:54:24 +08:00
QdabuliuQ
092e37861a fix(Typography): button with href wrapped by Typography showing incorrect color and flickering outline on hover (#56619)
* style: The typography component is showing styling issues, including with the button component

* style: refactor link styles for Button consistency

* style: modify mixins.ts file

* fix: reset border styles for Typography links

* fix: link style conflicts with ant-btn in typography component

* fix: link styles to avoid conflicts with Button component

---------

Co-authored-by: 遇见同学 <1875694521@qq.com>
2026-01-21 18:45:12 +08:00
lijianan
01fdc86b39 chore: update test script to include semantic snap (#56679)
* chore: update test script to include semantic snap

* update

* Update package.json

Co-authored-by: thinkasany <480968828@qq.com>
Signed-off-by: lijianan <574980606@qq.com>

---------

Signed-off-by: lijianan <574980606@qq.com>
Co-authored-by: thinkasany <480968828@qq.com>
2026-01-21 09:29:06 +08:00
lijianan
a3dcbdfae4 chore: remove unnecessary unit in style (#56677) 2026-01-21 09:02:36 +08:00
github-actions[bot]
d5b3409660 chore: upgrade deps (#56675)
Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>
2026-01-21 03:49:10 +08:00
Peach
8b4235a53b docs: changelog for 6.2.1 (#56667)
* docs: changelog for 6.2.1

* chore: bump version to 6.2.1

* refactor: update changelog

* docs: update changelog
2026-01-20 14:59:30 +08:00
高艳兵
c46ce7fb86 fix: pagination size docs (#56668) 2026-01-20 14:59:26 +08:00
高艳兵
8574b941a7 feat: add semantic ci (#56670)
* feat: add semantic ci

* fix: version

* ci: move version step into test:semantic and run in test workflow
2026-01-20 14:30:35 +08:00
lijianan
edf65d3eeb chore: remove unnecessary brackets in style (#56665)
* refactor: remove unnecessary brackets in style

* update
2026-01-20 09:48:00 +08:00
高艳兵
c5e5ac7c3f feat: add semantic snap (#56600)
* feat: add semantic.md generation plugin for components

* refactor: extract locales from SelectSemanticTemplate to component props

* fix: remove unuse locales

* feat: multipleProps add defaultValue

* feat: update select snap

* feat: update table snap

* feat: tour add snap

* feat: delete semantic-md plugin

* feat: add sematic snap

* refactor: replace hardcoded button clicks with configurable postRenderFn in semantic demo test

* revert: locales

* fix: maxTagCount responsive

* fix: test  maxTagCount set 1

* feat: add test:semantic script

* fix: ci add collectCoverageFrom

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: thinkasany <480968828@qq.com>
2026-01-19 22:10:33 +08:00
ug
937f5d0738 fix(card): Fixed the overflow issue in the Card component body (#56653)
* fix(card): Fixed the overflow issue in the Card component body

* update

---------

Co-authored-by: liuqiang <qiang.liu@xinjifamily.com>
2026-01-19 15:13:02 +08:00
Wanpan
3848b6bb82 docs: fix SemanticPreview not work (#56650) 2026-01-19 09:49:54 +08:00
thinkasany
bb5642f90b chore: improve tree DirectoryTree (#56648)
* chore: improve tree DirectoryTree

* fix
2026-01-18 18:16:19 +08:00
thinkasany
60442f9d44 chore: improve tooltip (#56645) 2026-01-18 16:16:03 +08:00
renovate[bot]
c8e79dda70 chore(deps): update dependency @eslint-react/eslint-plugin to v2.7.2 (#56643)
* chore(deps): update dependency @eslint-react/eslint-plugin to v2.7.2

* Update package.json

Signed-off-by: lijianan <574980606@qq.com>

---------

Signed-off-by: lijianan <574980606@qq.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: lijianan <574980606@qq.com>
2026-01-18 09:15:18 +08:00
renovate[bot]
2389eb8731 chore(deps): update dependency @eslint-react/eslint-plugin to v2.7.1 (#56641)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-18 09:02:13 +08:00
renovate[bot]
b9d23a1d96 chore(deps): update dependency jquery to v4 (#56642)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-01-18 09:01:28 +08:00
沈鸿飞
3eecc366bb fix: import individual icons from antd-icons (#56640) 2026-01-17 23:38:37 +08:00
hu
fecb9a04f6 refactor: replace SuffixIcon with useSuffixIcon in date-picker for prevent suffix icon rendering when user set suffixIcon to null or false (#56637)
Co-authored-by: thinkasany <480968828@qq.com>
2026-01-17 23:08:28 +08:00
高艳兵
77f0f1a9fe fix(table): border radius not work (#56478)
* fix(table): border radius  not work

* fix(table): apply border radius to shadow pseudo elements
2026-01-17 22:57:06 +08:00
沈鸿飞
aeff7cab63 fix: import a single DownOutlined icon from antd-icons (#56639)
* fix: import a single DownOutlined icon from antd-icons

Signed-off-by: 沈鸿飞 <shen.hongfei@outlook.com>

* Update components/breadcrumb/Breadcrumb.tsx

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: 沈鸿飞 <shen.hongfei@outlook.com>

---------

Signed-off-by: 沈鸿飞 <shen.hongfei@outlook.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-01-17 22:55:02 +08:00
lijianan
5df2c59516 refactor(Grid): use genCssVar hook to generate CSS variables (#56635) 2026-01-17 10:44:40 +08:00
lijianan
247c41c79b fix: should skip appendStyle when value is null or undefined (#56636) 2026-01-17 10:42:45 +08:00
QdabuliuQ
4dc35000b1 docs: improve site locale detection (#56618)
* fix(Site): improve changelog header styles and locale detection

* style: fix link and button style conflicts in typography

* style: modify style file

* style: reset typography mixins.ts file

---------

Co-authored-by: 遇见同学 <1875694521@qq.com>
2026-01-16 09:37:26 +08:00
dependabot[bot]
a9e9c04cbc chore: bump @eslint-react/eslint-plugin from 2.6.2 to 2.6.4 (#56627)
Bumps [@eslint-react/eslint-plugin](https://github.com/Rel1cx/eslint-react/tree/HEAD/packages/plugins/eslint-plugin) from 2.6.2 to 2.6.4.
- [Release notes](https://github.com/Rel1cx/eslint-react/releases)
- [Changelog](https://github.com/Rel1cx/eslint-react/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Rel1cx/eslint-react/commits/v2.6.4/packages/plugins/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@eslint-react/eslint-plugin"
  dependency-version: 2.6.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-16 06:44:49 +08:00
github-actions[bot]
4f61124be4 chore: upgrade deps (#56625)
Co-authored-by: afc163 <507615+afc163@users.noreply.github.com>
2026-01-16 04:20:32 +08:00
thinkasany
fccc092154 chore: improve collapse cloneElement (#56622)
Co-authored-by: 遇见同学 <1875694521@qq.com>
2026-01-15 23:21:30 +08:00
二货爱吃白萝卜
a680d84865 test: fix test case (#56620)
* test: fix test case

* chore: fix lint
2026-01-15 18:15:27 +08:00
lijianan
f7446f3f1f refactor(css): replace background transition with background-color (#56598)
* fix(css): replace background transition with background-color

* chore: update

---------

Co-authored-by: thinkasany <480968828@qq.com>
2026-01-15 11:04:33 +08:00
lijianan
28d674445b fix: replace disabled with mergedDisabled (#56613)
* fix: replace disable with mergedDisabled

* update

* update

---------

Co-authored-by: 遇见同学 <1875694521@qq.com>
2026-01-15 10:49:44 +08:00
318 changed files with 54437 additions and 3619 deletions

View File

@@ -1,6 +1,15 @@
// FIXME: workaround for avoid searchbar styles be extracted to async chunk
@import 'dumi/theme-default/slots/SearchBar/index.less';
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation: none;
transition: none;
}
}
.demo-logo {
width: 120px;
min-width: 120px;

View File

@@ -7,7 +7,6 @@ const isNumber = (value: any): value is number => {
};
const fetcher = async (url: string): Promise<number> => {
// eslint-disable-next-line compat/compat
const res = await fetch(url, { headers: { Accept: 'application/vnd.github+json' } });
const data = await res.json();
const totalCount = isNumber(data?.total_count) ? data.total_count : 0;

View File

@@ -49,8 +49,7 @@ const useStyle = createStyles(({ cssVar, css, cx }) => {
max-width: 100%;
margin-inline: auto;
box-sizing: border-box;
column-gap: ${cssVar.paddingMD};
padding: 0 ${cssVar.padding};
column-gap: calc(${cssVar.paddingMD} * 2);
align-items: stretch;
text-align: start;
min-height: 178px;

View File

@@ -5,7 +5,6 @@ import {
Button,
Checkbox,
ColorPicker,
ConfigProvider,
Dropdown,
Input,
message,
@@ -19,10 +18,8 @@ import {
Tooltip,
} from 'antd';
import { createStaticStyles } from 'antd-style';
import type { ConfigProviderProps } from 'antd';
import useLocale from '../../../../hooks/useLocale';
import Tilt from './Tilt';
const { _InternalPanelDoNotUseOrYouWillBeFired: ModalPanel } = Modal;
@@ -106,123 +103,117 @@ const styles = createStaticStyles(({ cssVar, css }) => {
`,
};
});
interface ComponentsBlockProps {
config: ConfigProviderProps;
}
const ComponentsBlock: React.FC<ComponentsBlockProps> = (props) => {
const ComponentsBlock: React.FC = () => {
const [locale] = useLocale(locales);
const { config } = props;
return (
<ConfigProvider {...config}>
<Tilt options={{ max: 4, glare: false, scale: 0.98 }} className={styles.holder}>
<ModalPanel title="Ant Design" width="100%">
{locale.text}
</ModalPanel>
<Alert title={locale.infoText} type="info" />
{/* Line */}
<div className={styles.flex}>
<ColorPicker style={{ flex: 'none' }} />
<div style={{ flex: 'none' }}>
<Space.Compact>
<Button>{locale.dropdown}</Button>
<Dropdown
menu={{
items: Array.from({ length: 5 }).map((_, index) => ({
key: `opt${index}`,
label: `${locale.option} ${index}`,
})),
}}
>
<Button icon={<DownOutlined />} />
</Dropdown>
</Space.Compact>
</div>
<Select
style={{ flex: 'auto' }}
mode="multiple"
maxTagCount="responsive"
defaultValue={[{ value: 'apple' }, { value: 'banana' }]}
options={[
{ value: 'apple', label: locale.apple },
{ value: 'banana', label: locale.banana },
{ value: 'orange', label: locale.orange },
{ value: 'watermelon', label: locale.watermelon },
]}
/>
<Input style={{ flex: 'none', width: 120 }} />
<Tilt options={{ max: 4, glare: false, scale: 0.98 }} className={styles.holder}>
<ModalPanel title="Ant Design" width="100%">
{locale.text}
</ModalPanel>
<Alert title={locale.infoText} type="info" />
{/* Line */}
<div className={styles.flex}>
<ColorPicker style={{ flex: 'none' }} />
<div style={{ flex: 'none' }}>
<Space.Compact>
<Button>{locale.dropdown}</Button>
<Dropdown
menu={{
items: Array.from({ length: 5 }).map((_, index) => ({
key: `opt${index}`,
label: `${locale.option} ${index}`,
})),
}}
>
<Button icon={<DownOutlined />} />
</Dropdown>
</Space.Compact>
</div>
<Progress
style={{ margin: 0 }}
percent={100}
strokeColor={{ '0%': '#108ee9', '100%': '#87d068' }}
/>
<Progress style={{ margin: 0 }} percent={33} status="exception" />
<Steps
current={1}
items={[
{ title: locale.finished },
{ title: locale.inProgress },
{ title: locale.waiting },
<Select
style={{ flex: 'auto' }}
mode="multiple"
maxTagCount="responsive"
defaultValue={[{ value: 'apple' }, { value: 'banana' }]}
options={[
{ value: 'apple', label: locale.apple },
{ value: 'banana', label: locale.banana },
{ value: 'orange', label: locale.orange },
{ value: 'watermelon', label: locale.watermelon },
]}
/>
{/* Line */}
<div className={styles.block}>
<Slider
style={{ marginInline: 20 }}
range
marks={{
0: '0°C',
26: '26°C',
37: '37°C',
100: {
style: { color: '#f50' },
label: <strong>100°C</strong>,
},
}}
defaultValue={[26, 37]}
<Input style={{ flex: 'none', width: 120 }} />
</div>
<Progress
style={{ margin: 0 }}
percent={100}
strokeColor={{ '0%': '#108ee9', '100%': '#87d068' }}
/>
<Progress style={{ margin: 0 }} percent={33} status="exception" />
<Steps
current={1}
items={[
{ title: locale.finished },
{ title: locale.inProgress },
{ title: locale.waiting },
]}
/>
{/* Line */}
<div className={styles.block}>
<Slider
style={{ marginInline: 20 }}
range
marks={{
0: '0°C',
26: '26°C',
37: '37°C',
100: {
style: { color: '#f50' },
label: <strong>100°C</strong>,
},
}}
defaultValue={[26, 37]}
/>
</div>
{/* Line */}
<div className={styles.flex}>
<Button className={styles.ptg_20} type="primary">
{locale.primary}
</Button>
<Button className={styles.ptg_20} type="primary" danger>
{locale.danger}
</Button>
<Button className={styles.ptg_20}>{locale.default}</Button>
<Button className={styles.ptg_20} type="dashed">
{locale.dashed}
</Button>
<Button className={styles.ptg_20} icon={<AntDesignOutlined />}>
{locale.icon}
</Button>
</div>
{/* Line */}
<div className={styles.block}>
<div className={styles.flex}>
<Switch
className={styles.ptg_none}
defaultChecked
checkedChildren={<CheckOutlined />}
unCheckedChildren={<CloseOutlined />}
/>
<Checkbox.Group
className={styles.ptg_none}
options={[locale.apple, locale.banana, locale.orange]}
defaultValue={[locale.apple]}
/>
</div>
{/* Line */}
<div className={styles.flex}>
<Button className={styles.ptg_20} type="primary">
{locale.primary}
</Button>
<Button className={styles.ptg_20} type="primary" danger>
{locale.danger}
</Button>
<Button className={styles.ptg_20}>{locale.default}</Button>
<Button className={styles.ptg_20} type="dashed">
{locale.dashed}
</Button>
<Button className={styles.ptg_20} icon={<AntDesignOutlined />}>
{locale.icon}
</Button>
</div>
{/* Line */}
<div className={styles.block}>
<div className={styles.flex}>
<Switch
className={styles.ptg_none}
defaultChecked
checkedChildren={<CheckOutlined />}
unCheckedChildren={<CloseOutlined />}
/>
<Checkbox.Group
className={styles.ptg_none}
options={[locale.apple, locale.banana, locale.orange]}
defaultValue={[locale.apple]}
/>
</div>
</div>
<div>
<InternalMessage content={locale.release} type="success" />
</div>
<InternalTooltip title={locale.hello} placement="topLeft" className={styles.noMargin} />
<Alert title="Ant Design love you!" type="success" />
</Tilt>
</ConfigProvider>
</div>
<div>
<InternalMessage content={locale.release} type="success" />
</div>
<InternalTooltip title={locale.hello} placement="topLeft" className={styles.noMargin} />
<Alert title="Ant Design love you!" type="success" />
</Tilt>
);
};

View File

@@ -1,21 +1,15 @@
import React, { Suspense, use, useState } from 'react';
import { Button, Flex, Typography } from 'antd';
import type { ConfigProviderProps, ThemeConfig } from 'antd';
import React, { Suspense, use } from 'react';
import { Flex, Typography } from 'antd';
import { createStyles } from 'antd-style';
import { clsx } from 'clsx';
import { useLocation } from 'dumi';
import { DarkContext } from '../../../../hooks/useDark';
import useLocale from '../../../../hooks/useLocale';
import LinkButton from '../../../../theme/common/LinkButton';
import PromptDrawer from '../../../../theme/common/ThemeSwitch/PromptDrawer';
import ThemeIcon from '../../../../theme/common/ThemeSwitch/ThemeIcon';
import SiteContext from '../../../../theme/slots/SiteContext';
import type { SiteContextProps } from '../../../../theme/slots/SiteContext';
import * as utils from '../../../../theme/utils';
import GroupMaskLayer from '../GroupMaskLayer';
import { muiComponentConfig, muiDark, muiLight } from './themes/mui';
import { shadcnComponentConfig, shadcnDark, shadcnLight } from './themes/shadcn';
import '../SiteContext';
@@ -125,251 +119,64 @@ const useStyle = createStyles(({ cssVar, css, cx }, siteConfig: SiteContextProps
bottom: 120px;
inset-inline-end: ${siteConfig.isMobile ? 0 : '40%'};
`,
themeBar: css`
display: flex;
gap: 12px;
margin: 24px 0;
align-items: center;
justify-content: center;
`,
themeLabel: css`
background: ${cssVar.colorBgElevated};
padding: 6px 12px;
border-radius: 20px;
box-shadow: ${cssVar.boxShadowSecondary};
color: ${cssVar.colorText};
font-weight: 600;
font-size: ${cssVar.fontSizeSM};
`,
presets: css`
display: flex;
gap: 8px;
align-items: center;
`,
presetButton: cx(css`
display: inline-flex;
align-items: center;
gap: 8px;
border-radius: 14px;
background: ${cssVar.colorBgElevated};
color: ${cssVar.colorText};
cursor: pointer;
border: 1px solid transparent;
box-shadow: ${cssVar.boxShadowSecondary};
transition: all 0.2s ease;
font-size: ${cssVar.fontSizeSM};
padding: 7px 18px;
line-height: 18px;
border-radius: 6px;
font-size: 14px;
&:hover {
transform: translateY(-2px);
}
`),
swatches: css`
display: inline-flex;
align-items: center;
gap: 6px;
`,
swatch: css`
width: 10px;
height: 10px;
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
`,
name: css`
margin-left: 10px;
text-transform: capitalize;
`,
};
});
type THEME_MAP = 'antd' | 'shadcn' | 'mui';
interface Theme {
name: THEME_MAP;
theme: ThemeConfig;
componentsConfig: Partial<ConfigProviderProps>;
style?: React.CSSProperties;
activeStyle: React.CSSProperties;
swatches: string[];
}
const PreviewBanner: React.FC<Readonly<React.PropsWithChildren>> = (props) => {
const { updateSiteConfig } = use<SiteContextProps>(SiteContext);
const [isMarketDrawerOpen, setIsMarketDrawerOpen] = useState(false);
const { children } = props;
const [locale] = useLocale(locales);
const siteConfig = use(SiteContext);
const { styles } = useStyle(siteConfig);
const { pathname, search } = useLocation();
const isZhCN = utils.isZhCN(pathname);
const [theme, setTheme] = useState<THEME_MAP>('antd');
const isDark = React.use(DarkContext);
const themeMap: Record<THEME_MAP, Theme> = {
antd: {
name: 'antd',
theme: {},
componentsConfig: {},
activeStyle: {
border: '1px solid #1677ff',
},
swatches: ['#1677ff', '#91d5ff', '#f0f5ff'],
},
shadcn: {
name: 'shadcn',
theme: isDark ? shadcnDark : shadcnLight,
style: {
backgroundColor: 'rgba(0, 0, 0, 0.1)',
},
activeStyle: {
border: '1px solid oklch(0.205 0 0)',
},
componentsConfig: shadcnComponentConfig,
swatches: ['oklch(0.205 0 0)', 'oklch(0.556 0 0)', 'rgba(0, 0, 0, 0.05)'],
},
mui: {
name: 'mui',
theme: isDark ? muiDark : muiLight,
componentsConfig: muiComponentConfig,
style: {
color: '#fff',
backgroundColor: 'rgb(2, 136, 209, 0.5)',
},
activeStyle: {
border: '1px solid rgb(25, 118, 210)',
},
swatches: ['#1677ff', '#91d5ff', '#f0f5ff'],
},
};
const config: ConfigProviderProps = {
theme: themeMap[theme].theme,
...themeMap[theme].componentsConfig,
};
return (
<GroupMaskLayer>
<div
className={styles.holder}
style={{
display: 'flex',
flexDirection: 'row',
alignItems: 'stretch',
justifyContent: 'center',
height: 640,
position: 'relative',
overflow: 'hidden',
perspective: 800,
}}
>
<div
style={{
flex: 1,
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
position: 'relative',
zIndex: 1,
}}
>
<img
alt="bg"
src="https://gw.alipayobjects.com/zos/bmw-prod/49f963db-b2a8-4f15-857a-270d771a1204.svg"
draggable={false}
className={clsx(styles.bgImg, styles.bgImgTop)}
style={{ position: 'absolute', left: 0, top: 0, zIndex: 0 }}
/>
<div className={styles.mask} />
{/* Image Left Top */}
<img
alt="bg"
src="https://gw.alipayobjects.com/zos/bmw-prod/49f963db-b2a8-4f15-857a-270d771a1204.svg"
draggable={false}
className={clsx(styles.bgImg, styles.bgImgTop)}
/>
{/* Image Right Top */}
<img
alt="bg"
src="https://gw.alipayobjects.com/zos/bmw-prod/e152223c-bcae-4913-8938-54fda9efe330.svg"
draggable={false}
className={clsx(styles.bgImg, styles.bgImgBottom)}
/>
<Typography className={styles.typography}>
<h1>Ant Design</h1>
<p>{locale.slogan}</p>
</Typography>
<div className={styles.themeBar}>
<div className={styles.presets}>
{Object.keys(themeMap).map((v, i) => {
const key = v as THEME_MAP;
return (
<div
key={i}
role="button"
tabIndex={0}
onClick={() => setTheme(themeMap[key].name)}
className={clsx(styles.presetButton)}
style={{
...themeMap[key].style,
...(theme === themeMap[key].name ? themeMap[key].activeStyle : {}),
}}
>
<div className={styles.swatches}>
{themeMap[key].swatches?.map((s: any) => (
<span key={s} className={styles.swatch} style={{ background: s }} />
))}
</div>
<span className={styles.name}>{themeMap[key].name}</span>
</div>
);
})}
<Button
variant="solid"
icon={<ThemeIcon />}
onClick={() => setIsMarketDrawerOpen(true)}
style={{ fontSize: 16 }}
/>
<div className={styles.holder}>
{/* Mobile not show the component preview */}
<Suspense fallback={null}>
{siteConfig.isMobile ? null : (
<div className={styles.block}>
<ComponentsBlock />
</div>
</div>
<Flex gap="middle" className={styles.btnWrap}>
<LinkButton
size="large"
type="primary"
to={utils.getLocalizedPathname('/components/overview/', isZhCN, search)}
>
{locale.start}
</LinkButton>
<LinkButton
size="large"
to={utils.getLocalizedPathname('/docs/spec/introduce/', isZhCN, search)}
>
{locale.designLanguage}
</LinkButton>
</Flex>
<div className={styles.child}>{children}</div>
</div>
<PromptDrawer
open={isMarketDrawerOpen}
onClose={() => setIsMarketDrawerOpen(false)}
onThemeChange={(nextTheme) => {
updateSiteConfig({
dynamicTheme: nextTheme,
});
}}
/>
<div
style={{
width: '40%',
display: 'flex',
alignItems: 'center',
position: 'relative',
backgroundColor: isDark ? '#393F4A' : '#f4f8ff',
borderRadius: '0 0px 0px 12px',
}}
>
<img
alt="bg"
src="https://gw.alipayobjects.com/zos/bmw-prod/e152223c-bcae-4913-8938-54fda9efe330.svg"
draggable={false}
className={clsx(styles.bgImg, styles.bgImgBottom)}
style={{ position: 'absolute', right: 0, top: 0, zIndex: 0 }}
/>
<Suspense fallback={null}>
{siteConfig.isMobile ? null : (
<div className={styles.block} style={{ position: 'relative', zIndex: 1 }}>
<ComponentsBlock config={config} />
</div>
)}
</Suspense>
</div>
)}
</Suspense>
<div className={styles.mask} />
<Typography className={styles.typography}>
<h1>Ant Design</h1>
<p>{locale.slogan}</p>
</Typography>
<Flex gap="middle" className={styles.btnWrap}>
<LinkButton
size="large"
type="primary"
to={utils.getLocalizedPathname('/components/overview/', isZhCN, search)}
>
{locale.start}
</LinkButton>
<LinkButton
size="large"
to={utils.getLocalizedPathname('/docs/spec/introduce/', isZhCN, search)}
>
{locale.designLanguage}
</LinkButton>
</Flex>
<div className={styles.child}>{children}</div>
</div>
</GroupMaskLayer>
);

View File

@@ -1,244 +0,0 @@
import type { ConfigProviderProps, ThemeConfig } from 'antd';
import { theme } from 'antd';
const { darkAlgorithm, defaultAlgorithm } = theme;
export const mui: ThemeConfig = {
token: {
colorPrimary: '#1976d2',
colorSuccess: '#2e7d32',
colorWarning: '#ed6c02',
colorError: '#d32f2f',
colorInfo: '#0288d1',
colorTextBase: '#212121',
colorBgBase: '#fafafa',
colorPrimaryBg: '#e3f2fd',
colorPrimaryBgHover: '#bbdefb',
colorPrimaryBorder: '#90caf9',
colorPrimaryBorderHover: '#64b5f6',
colorPrimaryHover: '#42a5f5',
colorPrimaryActive: '#1565c0',
colorPrimaryText: '#1976d2',
colorPrimaryTextHover: '#42a5f5',
colorPrimaryTextActive: '#1565c0',
colorSuccessBg: '#e8f5e9',
colorSuccessBgHover: '#c8e6c9',
colorSuccessBorder: '#a5d6a7',
colorSuccessBorderHover: '#81c784',
colorSuccessHover: '#4caf50',
colorSuccessActive: '#1b5e20',
colorSuccessText: '#2e7d32',
colorSuccessTextHover: '#4caf50',
colorSuccessTextActive: '#1b5e20',
colorWarningBg: '#fff3e0',
colorWarningBgHover: '#ffe0b2',
colorWarningBorder: '#ffcc02',
colorWarningBorderHover: '#ffb74d',
colorWarningHover: '#ff9800',
colorWarningActive: '#e65100',
colorWarningText: '#ed6c02',
colorWarningTextHover: '#ff9800',
colorWarningTextActive: '#e65100',
colorErrorBg: '#ffebee',
colorErrorBgHover: '#ffcdd2',
colorErrorBorder: '#ef9a9a',
colorErrorBorderHover: '#e57373',
colorErrorHover: '#ef5350',
colorErrorActive: '#c62828',
colorErrorText: '#d32f2f',
colorErrorTextHover: '#ef5350',
colorErrorTextActive: '#c62828',
colorInfoBg: '#e1f5fe',
colorInfoBgHover: '#b3e5fc',
colorInfoBorder: '#81d4fa',
colorInfoBorderHover: '#4fc3f7',
colorInfoHover: '#03a9f4',
colorInfoActive: '#01579b',
colorInfoText: '#0288d1',
colorInfoTextHover: '#03a9f4',
colorInfoTextActive: '#01579b',
colorText: 'rgba(33, 33, 33, 0.87)',
colorTextSecondary: 'rgba(33, 33, 33, 0.6)',
colorTextTertiary: 'rgba(33, 33, 33, 0.38)',
colorTextQuaternary: 'rgba(33, 33, 33, 0.26)',
colorTextDisabled: 'rgba(33, 33, 33, 0.38)',
colorBgContainer: '#ffffff',
colorBgElevated: '#ffffff',
colorBgLayout: '#f5f5f5',
colorBgSpotlight: 'rgba(33, 33, 33, 0.85)',
colorBgMask: 'rgba(33, 33, 33, 0.5)',
colorBorder: '#e0e0e0',
colorBorderSecondary: '#eeeeee',
borderRadius: 4,
borderRadiusXS: 1,
borderRadiusSM: 2,
borderRadiusLG: 6,
padding: 16,
paddingSM: 8,
paddingLG: 24,
margin: 16,
marginSM: 8,
marginLG: 24,
boxShadow:
'0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)',
boxShadowSecondary:
'0px 3px 3px -2px rgba(0,0,0,0.2),0px 3px 4px 0px rgba(0,0,0,0.14),0px 1px 8px 0px rgba(0,0,0,0.12)',
},
components: {
Button: {
primaryShadow:
'0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12)',
defaultShadow:
'0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12)',
dangerShadow:
'0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12)',
fontWeight: 500,
defaultBorderColor: 'rgba(0, 0, 0, 0.23)',
defaultColor: 'rgba(0, 0, 0, 0.87)',
defaultBg: '#ffffff',
defaultHoverBg: 'rgba(25, 118, 210, 0.04)',
defaultHoverBorderColor: 'rgba(0, 0, 0, 0.23)',
paddingInline: 16,
paddingBlock: 6,
contentFontSize: 14,
borderRadius: 4,
},
Alert: {
borderRadiusLG: 4,
},
Modal: {
borderRadiusLG: 4,
},
Progress: {
defaultColor: '#1976d2',
remainingColor: 'rgba(25, 118, 210, 0.12)',
},
Steps: {
iconSize: 24,
},
Checkbox: {
borderRadiusSM: 2,
},
Slider: {
trackBg: 'rgba(25, 118, 210, 0.26)',
trackHoverBg: 'rgba(25, 118, 210, 0.38)',
handleSize: 20,
handleSizeHover: 20,
railSize: 4,
},
ColorPicker: {
borderRadius: 4,
},
},
};
export const muiLight: ThemeConfig = {
algorithm: defaultAlgorithm,
token: mui.token,
components: mui.components,
};
export const muiDark: ThemeConfig = {
algorithm: darkAlgorithm,
token: {
...mui.token,
},
components: {
...mui.components,
Message: {
contentBg: '#212121',
contentPadding: '8px 16px',
zIndexPopup: 1010,
},
},
};
export const muiComponentConfig: Partial<ConfigProviderProps> = {
button: {
styles: (info) => {
const { props } = info;
if (props.type === 'primary') {
return {
root: {
backgroundColor: '#1976d2',
color: '#ffffff',
border: 'none',
fontWeight: 500,
textTransform: 'uppercase' as const,
letterSpacing: '0.02857em',
boxShadow:
'0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12)',
transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
},
};
}
if (props.type === 'default') {
return {
root: {
backgroundColor: '#ffffff',
color: 'rgba(0, 0, 0, 0.87)',
border: '1px solid rgba(0, 0, 0, 0.23)',
fontWeight: 500,
textTransform: 'uppercase' as const,
letterSpacing: '0.02857em',
transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
},
};
}
if (props.danger) {
return {
root: {
backgroundColor: '#d32f2f',
color: '#ffffff',
border: 'none',
fontWeight: 500,
textTransform: 'uppercase' as const,
letterSpacing: '0.02857em',
boxShadow:
'0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12)',
},
};
}
return {};
},
},
input: {
styles: (info) => {
const { props } = info;
const baseStyle = {
root: {
borderColor: 'rgba(0, 0, 0, 0.23)',
transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
},
input: {
color: 'rgba(0, 0, 0, 0.87)',
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
},
};
if (props.status === 'error') {
return {
...baseStyle,
root: {
...baseStyle.root,
borderColor: '#d32f2f',
},
};
}
return baseStyle;
},
},
select: {
styles: {
root: {
borderColor: 'rgba(0, 0, 0, 0.23)',
fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
},
popup: {
root: {
borderRadius: 4,
boxShadow:
'0px 5px 5px -3px rgba(0,0,0,0.2), 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12)',
},
},
},
},
};

View File

@@ -1,243 +0,0 @@
import type { ConfigProviderProps, ThemeConfig } from 'antd';
import { theme } from 'antd';
const { darkAlgorithm, defaultAlgorithm } = theme;
export const shadcn: ThemeConfig = {
algorithm: defaultAlgorithm,
token: {
colorPrimary: '#262626',
colorSuccess: '#22c55e',
colorWarning: '#f97316',
colorError: '#ef4444',
colorInfo: '#262626',
colorTextBase: '#262626',
colorBgBase: '#ffffff',
colorPrimaryBg: '#f5f5f5',
colorPrimaryBgHover: '#e5e5e5',
colorPrimaryBorder: '#d4d4d4',
colorPrimaryBorderHover: '#a3a3a3',
colorPrimaryHover: '#404040',
colorPrimaryActive: '#171717',
colorPrimaryText: '#262626',
colorPrimaryTextHover: '#404040',
colorPrimaryTextActive: '#171717',
colorSuccessBg: '#f0fdf4',
colorSuccessBgHover: '#dcfce7',
colorSuccessBorder: '#bbf7d0',
colorSuccessBorderHover: '#86efac',
colorSuccessHover: '#16a34a',
colorSuccessActive: '#15803d',
colorSuccessText: '#16a34a',
colorSuccessTextHover: '#16a34a',
colorSuccessTextActive: '#15803d',
colorWarningBg: '#fff7ed',
colorWarningBgHover: '#fed7aa',
colorWarningBorder: '#fdba74',
colorWarningBorderHover: '#fb923c',
colorWarningHover: '#ea580c',
colorWarningActive: '#c2410c',
colorWarningText: '#ea580c',
colorWarningTextHover: '#ea580c',
colorWarningTextActive: '#c2410c',
colorErrorBg: '#fef2f2',
colorErrorBgHover: '#fecaca',
colorErrorBorder: '#fca5a5',
colorErrorBorderHover: '#f87171',
colorErrorHover: '#dc2626',
colorErrorActive: '#b91c1c',
colorErrorText: '#dc2626',
colorErrorTextHover: '#dc2626',
colorErrorTextActive: '#b91c1c',
colorInfoBg: '#f5f5f5',
colorInfoBgHover: '#e5e5e5',
colorInfoBorder: '#d4d4d4',
colorInfoBorderHover: '#a3a3a3',
colorInfoHover: '#404040',
colorInfoActive: '#171717',
colorInfoText: '#262626',
colorInfoTextHover: '#404040',
colorInfoTextActive: '#171717',
colorText: '#262626',
colorTextSecondary: '#525252',
colorTextTertiary: '#737373',
colorTextQuaternary: '#a3a3a3',
colorTextDisabled: '#a3a3a3',
colorBgContainer: '#ffffff',
colorBgElevated: '#ffffff',
colorBgLayout: '#fafafa',
colorBgSpotlight: 'rgba(38, 38, 38, 0.85)',
colorBgMask: 'rgba(38, 38, 38, 0.45)',
colorBorder: '#e5e5e5',
colorBorderSecondary: '#f5f5f5',
borderRadius: 10,
borderRadiusXS: 2,
borderRadiusSM: 6,
borderRadiusLG: 14,
padding: 16,
paddingSM: 12,
paddingLG: 24,
margin: 16,
marginSM: 12,
marginLG: 24,
boxShadow: '0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1)',
boxShadowSecondary: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)',
},
components: {
Button: {
primaryShadow: 'none',
defaultShadow: 'none',
dangerShadow: 'none',
defaultBorderColor: '#e4e4e7',
defaultColor: '#18181b',
defaultBg: '#ffffff',
defaultHoverBg: '#f4f4f5',
defaultHoverBorderColor: '#d4d4d8',
defaultHoverColor: '#18181b',
defaultActiveBg: '#e4e4e7',
defaultActiveBorderColor: '#d4d4d8',
borderRadius: 6,
},
Input: {
activeShadow: 'none',
hoverBorderColor: '#a1a1aa',
activeBorderColor: '#18181b',
borderRadius: 6,
},
Select: {
optionSelectedBg: '#f4f4f5',
optionActiveBg: '#fafafa',
optionSelectedFontWeight: 500,
borderRadius: 6,
},
Alert: {
borderRadiusLG: 8,
},
Modal: {
borderRadiusLG: 12,
},
Progress: {
defaultColor: '#18181b',
remainingColor: '#f4f4f5',
},
Steps: {
iconSize: 32,
},
Switch: {
trackHeight: 24,
trackMinWidth: 44,
innerMinMargin: 4,
innerMaxMargin: 24,
},
Checkbox: {
borderRadiusSM: 4,
},
Slider: {
trackBg: '#f4f4f5',
trackHoverBg: '#e4e4e7',
handleSize: 18,
handleSizeHover: 20,
railSize: 6,
},
ColorPicker: {
borderRadius: 6,
},
},
};
export const shadcnLight: ThemeConfig = {
algorithm: defaultAlgorithm,
token: shadcn.token,
components: shadcn.components,
};
export const shadcnDark: ThemeConfig = {
algorithm: darkAlgorithm,
token: {
...shadcn.token,
},
components: {
...shadcn.components,
Message: {
contentBg: '#212121',
},
},
};
export const shadcnComponentConfig: Partial<ConfigProviderProps> = {
button: {
styles: (info) => {
const { props } = info;
if (props.type === 'primary') {
return {
root: {
backgroundColor: '#18181b',
color: '#ffffff',
border: '1px solid #18181b',
fontWeight: 500,
transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
},
};
}
if (props.type === 'default') {
return {
root: {
backgroundColor: '#ffffff',
color: '#18181b',
border: '1px solid #e4e4e7',
fontWeight: 500,
transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
},
};
}
if (props.danger) {
return {
root: {
backgroundColor: '#dc2626',
color: '#ffffff',
border: '1px solid #dc2626',
fontWeight: 500,
},
};
}
return {};
},
},
input: {
styles: (info) => {
const { props } = info;
const baseStyle = {
root: {
borderColor: '#e4e4e7',
transition: 'all 0.2s cubic-bezier(0.4, 0, 0.2, 1)',
},
input: {
color: '#18181b',
},
};
if (props.status === 'error') {
return {
...baseStyle,
root: {
...baseStyle.root,
borderColor: '#dc2626',
},
};
}
return baseStyle;
},
},
select: {
styles: {
root: {
borderColor: '#e4e4e7',
},
popup: {
root: {
borderRadius: 8,
boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1)',
},
},
},
},
};

View File

@@ -1,4 +1,3 @@
/* eslint-disable compat/compat */
import { css } from 'antd-style';
import useSWR from 'swr';

View File

@@ -49,6 +49,13 @@ const Homepage: React.FC = () => {
</PreviewBanner>
<div>
{/* 定制主题 */}
<ConfigProvider theme={{ algorithm: theme.defaultAlgorithm }}>
<Suspense fallback={null}>
<Theme />
</Suspense>
</ConfigProvider>
{/* 组件列表 */}
<Group
background={token.colorBgElevated}
@@ -62,18 +69,11 @@ const Homepage: React.FC = () => {
</Suspense>
</Group>
{/* 定制主题 */}
<ConfigProvider theme={{ algorithm: theme.defaultAlgorithm }}>
<Suspense fallback={null}>
<Theme />
</Suspense>
</ConfigProvider>
{/* 设计语言 */}
<Group
title={locale.designTitle}
description={locale.designDesc}
background={isDark ? '#393F4A' : token.colorBgContainer}
background={isDark ? '#393F4A' : '#F5F8FF'}
decoration={
<img
draggable={false}

View File

@@ -1,7 +1,7 @@
import React, { useMemo, useState } from 'react';
import { LinkOutlined, QuestionCircleOutlined, RightOutlined } from '@ant-design/icons';
import { ConfigProvider, Flex, Popover, Table, Typography } from 'antd';
import { createStaticStyles, css, useTheme } from 'antd-style';
import { createStyles, css, useTheme } from 'antd-style';
import { getDesignToken } from 'antd-token-previewer';
import tokenMeta from 'antd/es/version/token-meta.json';
import tokenData from 'antd/es/version/token.json';
@@ -53,7 +53,7 @@ const locales = {
},
};
const styles = createStaticStyles(({ cssVar }) => ({
const useStyle = createStyles(({ cssVar }) => ({
tableTitle: css`
cursor: pointer;
position: relative;
@@ -104,6 +104,8 @@ const SubTokenTable: React.FC<SubTokenTableProps> = (props) => {
const [open, setOpen] = useState<boolean>(defaultOpen ?? process.env.NODE_ENV !== 'production');
const { styles } = useStyle();
if (!tokens.length) {
return null;
}

View File

@@ -27,7 +27,7 @@ const styles = createStaticStyles(({ cssVar, css }) => ({
position: relative;
border: 1px solid ${cssVar.colorBorderSecondary};
border-radius: ${cssVar.borderRadius};
padding: ${cssVar.paddingMD} ${cssVar.paddingLG} ${cssVar.paddingMD * 2};
padding: ${cssVar.paddingMD} ${cssVar.paddingLG} calc(${cssVar.paddingMD} * 2);
margin-bottom: ${cssVar.marginLG};
`,
title: css`
@@ -67,7 +67,7 @@ const styles = createStaticStyles(({ cssVar, css }) => ({
`,
tip: css`
color: ${cssVar.colorTextTertiary};
margin-top: ${cssVar.marginMD * 2};
margin-top: calc(${cssVar.marginMD} * 2);
`,
}));

View File

@@ -72,6 +72,7 @@ const useStyle = createStyles(({ cssVar, token, css }) => ({
font-weight: 600;
font-size: 20px;
margin: 0 !important;
padding: 0;
`,
versionTag: css`
user-select: none;

View File

@@ -1,8 +1,8 @@
import * as React from 'react';
import { createStaticStyles } from 'antd-style';
import { createStyles, css } from 'antd-style';
import { clsx } from 'clsx';
const styles = createStaticStyles(({ cssVar, css, cx }) => {
const useStyle = createStyles(({ cssVar, cx }) => {
const duration = cssVar.motionDurationSlow;
const marker = css`
@@ -55,6 +55,8 @@ export interface MarkerProps {
}
const Marker = React.memo<MarkerProps>((props) => {
const { styles } = useStyle();
const { rect, primary, ...restProps } = props;
const rectRef = React.useRef(rect);

View File

@@ -67,11 +67,14 @@ const Block: React.FC<BlockProps> = ({
...props
}) => {
const divRef = React.useRef<HTMLDivElement>(null);
const [value, setValue] = React.useState(defaultValue);
// 多选模式下,优先使用 multipleProps 中的 defaultValue
const multipleDefaultValue = (multipleProps as any)?.defaultValue;
const initialValue = mode === 'single' ? defaultValue : multipleDefaultValue;
const [value, setValue] = React.useState(initialValue);
React.useEffect(() => {
setValue(defaultValue);
}, [mode]);
setValue(mode === 'single' ? defaultValue : multipleDefaultValue);
}, [mode, defaultValue, multipleDefaultValue]);
return (
<Flex
@@ -101,7 +104,7 @@ const Block: React.FC<BlockProps> = ({
options={options}
{...(mode === 'multiple' ? multipleProps : {})}
styles={{ popup: { zIndex: 1 } }}
maxTagCount="responsive"
maxTagCount={process.env.NODE_ENV === 'test' ? 1 : 'responsive'}
placeholder="Please select"
allowClear
/>

View File

@@ -1,5 +1,4 @@
import React, { useRef, useState } from 'react';
import { StyleProvider } from '@ant-design/cssinjs';
import { AntDesignOutlined, UserOutlined } from '@ant-design/icons';
import { Bubble, Sender } from '@ant-design/x';
import type { SenderRef } from '@ant-design/x/es/sender';
@@ -100,21 +99,16 @@ const PromptDrawer: React.FC<PromptDrawerProps> = ({ open, onClose, onThemeChang
afterOpenChange={handleAfterOpenChange}
>
<Flex vertical style={{ height: '100%' }}>
{/* Workaround for layer incompat between site `StyleProvider layer` and `@ant-design/x`.
* See: https://github.com/ant-design/x/issues/1588
*/}
<StyleProvider layer={false}>
<Bubble.List style={{ flex: 1, overflow: 'auto' }} items={items} />
<Sender
ref={senderRef}
style={{ flex: 0 }}
value={inputValue}
onChange={setInputValue}
onSubmit={handleSubmit}
loading={loading}
onCancel={cancelRequest}
/>
</StyleProvider>
<Bubble.List style={{ flex: 1, overflow: 'auto' }} items={items} />
<Sender
ref={senderRef}
style={{ flex: 0 }}
value={inputValue}
onChange={setInputValue}
onSubmit={handleSubmit}
loading={loading}
onCancel={cancelRequest}
/>
</Flex>
</Drawer>
);

View File

@@ -1,4 +1,3 @@
/* eslint-disable compat/compat */
import { useRef, useState } from 'react';
import { XStream } from '@ant-design/x-sdk';

View File

@@ -61,11 +61,14 @@ const Block: React.FC<BlockProps> = ({
...props
}) => {
const divRef = React.useRef<HTMLDivElement>(null);
const [value, setValue] = React.useState(defaultValue);
// 多选模式下,优先使用 multipleProps 中的 defaultValue
const multipleDefaultValue = (multipleProps as any)?.defaultValue;
const initialValue = mode === 'single' ? defaultValue : multipleDefaultValue;
const [value, setValue] = React.useState(initialValue);
React.useEffect(() => {
setValue(defaultValue);
}, [mode]);
setValue(mode === 'single' ? defaultValue : multipleDefaultValue);
}, [mode, defaultValue, multipleDefaultValue]);
return (
<Flex
@@ -93,7 +96,7 @@ const Block: React.FC<BlockProps> = ({
treeData={treeData}
{...(mode === 'multiple' ? multipleProps : {})}
styles={{ popup: { zIndex: 1 } }}
maxTagCount="responsive"
maxTagCount={process.env.NODE_ENV === 'test' ? 1 : 'responsive'}
placeholder="Please select"
/>
</Flex>

View File

@@ -159,7 +159,6 @@ interface VersionItem {
}
const fetcher = (...args: Parameters<typeof fetch>) => {
// eslint-disable-next-line compat/compat
return fetch(...args).then((res) => res.json());
};

View File

@@ -160,18 +160,27 @@ export default defineConfig({
}
// 首页无视链接里面的语言设置 https://github.com/ant-design/ant-design/issues/4552
if (pathname === '/' || pathname === '/index-cn') {
const lang =
(window.localStorage && localStorage.getItem('locale')) ||
((navigator.language || navigator.browserLanguage).toLowerCase() === 'zh-cn'
const normalizedPathname = pathname || '/';
if (normalizedPathname === '/' || normalizedPathname === '/index-cn') {
let lang;
if (window.localStorage) {
const antLocale = localStorage.getItem('ANT_LOCAL_TYPE_KEY');
// 尝试解析 JSON因为可能是被序列化后存储的 "en-US" / en-US https://github.com/ant-design/ant-design/issues/56606
try {
lang = antLocale ? JSON.parse(antLocale) : localStorage.getItem('locale');
} catch (e) {
lang = antLocale ? antLocale : localStorage.getItem('locale');
}
}
lang = lang || ((navigator.language || navigator.browserLanguage).toLowerCase() === 'zh-cn'
? 'zh-CN'
: 'en-US');
// safari is 'zh-cn', while other browser is 'zh-CN';
if ((lang === 'zh-CN') !== isZhCN(pathname)) {
location.pathname = getLocalizedPathname(pathname, lang === 'zh-CN');
if ((lang === 'zh-CN') !== isZhCN(normalizedPathname)) {
location.pathname = getLocalizedPathname(normalizedPathname, lang === 'zh-CN');
}
}
document.documentElement.className += isZhCN(pathname) ? 'zh-cn' : 'en-us';
document.documentElement.className += isZhCN(normalizedPathname) ? 'zh-cn' : 'en-us';
})();
`,
],

View File

@@ -63,7 +63,7 @@ jobs:
steps:
# We need get PR id first
- name: download pr artifact
uses: dawidd6/action-download-artifact@v12
uses: dawidd6/action-download-artifact@v13
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
@@ -83,7 +83,7 @@ jobs:
# Download site artifact
- name: download site artifact
if: ${{ fromJSON(needs.upstream-workflow-summary.outputs.build-success) }}
uses: dawidd6/action-download-artifact@v12
uses: dawidd6/action-download-artifact@v13
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}

View File

@@ -34,6 +34,7 @@ jobs:
shard: [1/2, 2/2]
env:
REACT: ${{ matrix.react }}
SKIP_SEMANTIC: '1'
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v6

View File

@@ -70,7 +70,7 @@ jobs:
# We need get persist-index first
- name: download image snapshot artifact
uses: dawidd6/action-download-artifact@v12
uses: dawidd6/action-download-artifact@v13
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
@@ -92,7 +92,7 @@ jobs:
- name: download report artifact
id: download_report
if: ${{ needs.upstream-workflow-summary.outputs.build-status == 'success' || needs.upstream-workflow-summary.outputs.build-status == 'failure' }}
uses: dawidd6/action-download-artifact@v12
uses: dawidd6/action-download-artifact@v13
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}

View File

@@ -67,7 +67,7 @@ jobs:
# We need get persist key first
- name: Download Visual Regression Ref
uses: dawidd6/action-download-artifact@v12
uses: dawidd6/action-download-artifact@v13
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}
@@ -81,7 +81,7 @@ jobs:
- name: Download Visual-Regression Artifact
if: ${{ fromJSON(needs.upstream-workflow-summary.outputs.build-success) }}
uses: dawidd6/action-download-artifact@v12
uses: dawidd6/action-download-artifact@v13
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
run_id: ${{ github.event.workflow_run.id }}

View File

@@ -34,6 +34,10 @@ function getTestRegex(libDir) {
return '.*\\.test\\.(j|t)sx?$';
}
const shouldIgnoreSemantic =
['dist', 'lib', 'es', 'dist-min'].includes(process.env.LIB_DIR) ||
['1', 'true'].includes(process.env.SKIP_SEMANTIC);
module.exports = {
verbose: true,
testEnvironment: 'jsdom',
@@ -48,7 +52,14 @@ module.exports = {
'^antd/lib/(.*)$': '<rootDir>/components/$1',
'^antd/locale/(.*)$': '<rootDir>/components/locale/$1',
},
testPathIgnorePatterns: ['/node_modules/', 'dekko', 'node', 'image.test.js', 'image.test.ts'],
testPathIgnorePatterns: [
'/node_modules/',
'dekko',
'node',
'image.test.js',
'image.test.ts',
...(shouldIgnoreSemantic ? ['demo-semantic.test'] : []),
],
transform: {
'\\.tsx?$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
'\\.(m?)js$': './node_modules/@ant-design/tools/lib/jest/codePreprocessor',
@@ -64,6 +75,7 @@ module.exports = {
'!components/*/__tests__/type.test.tsx',
'!components/**/*/interface.{ts,tsx}',
'!components/*/__tests__/image.test.{ts,tsx}',
'!components/*/__tests__/demo-semantic.test.tsx',
'!components/__tests__/node.test.tsx',
'!components/*/demo/*.tsx',
'!components/*/design/**',

645
AGENTS.md
View File

@@ -1,92 +1,166 @@
# AGENTS.md
> Ant Design 项目开发指南 - 为 AI 编程助手提供项目上下文和开发规范
## 📑 目录
- [项目背景](#项目背景)
- [快速开始](#快速开始)
- [代码规范](#代码规范)
- [基本编码规范](#基本编码规范)
- [命名规范](#命名规范)
- [TypeScript 规范](#typescript-规范)
- [样式规范](#样式规范)
- [开发指南](#开发指南)
- [测试指南](#测试指南)
- [演示代码规范](#演示代码规范)
- [国际化规范](#国际化规范)
- [文档和 Changelog](#文档和-changelog-规范)
- [Git 和 Pull Request](#git-和-pull-request-规范)
- [质量保证](#质量保证)
- [工具链和环境](#工具链和环境)
---
## 项目背景
这是 ant-design/ant-designantd的源代码仓库是一个 React 组件库,发布为 npm 包 antd。
这是 [ant-design/ant-design](https://github.com/ant-design/ant-design)antd的源代码仓库是一个 React 组件库,发布为 npm 包 `antd`
### 核心特性
- 使用 TypeScript 和 React 开发
- 兼容 React 18 ~ 19 版本
- 组件库设计精美,功能完善,广泛应用于企业级中后台产品
- 遵循 Ant Design 设计规范
- 支持国际化
- 支持国际化i18n
- 支持主题定制和暗色模式
- 支持 RTL从右到左布局
## 安装和设置
---
## 快速开始
### 开发环境要求
- Node.js 版本 >= 16
- 推荐使用 npm 或 yarn
- Chrome 80+ 浏览器兼容性
- **Node.js**: >= 16
- **包管理器**: npm 或 utoo
- **浏览器兼容性**: Chrome 80+
- **编辑器**: VS Code推荐或其他支持 TypeScript 的编辑器
### 安装依赖
```bash
npm install
# 或
yarn install
utoo install
```
### 开发命令
### 常用开发命令
```bash
npm start # 启动开发服务器
npm run build # 构建项目
npm test # 运行测试
npm run lint # 代码检查
# 启动开发服务器(访问 http://127.0.0.1:8001
npm start
# 编译 TypeScript 代码到 lib 和 es 目录
npm run compile
# 构建 UMD 格式的构建产物
npm run build
# 运行所有测试
npm test
# 监听模式运行测试
npm test -- --watch
# 生成测试覆盖率报告
npm run test:coverage
# 代码检查(包括 TypeScript、ESLint、Biome、Markdown、Changelog
npm run lint
# 格式化代码
npm run format
# 生成 Changelog交互式
npm run changelog
# 清理构建产物
npm run clean
```
## 代码风格指南
### 项目结构
```
ant-design/
├── components/ # 组件源代码
│ └── [component]/ # 单个组件目录
│ ├── demo/ # 演示代码
│ ├── style/ # 样式文件
│ ├── index.tsx # 组件入口
│ └── index.zh-CN.md # 组件文档
├── scripts/ # 构建和工具脚本
├── tests/ # 测试文件
├── CHANGELOG.zh-CN.md # 中文更新日志
├── CHANGELOG.en-US.md # 英文更新日志
└── package.json # 项目配置
```
---
## 代码规范
### 基本编码规范
- 使用 TypeScript 和 React 书写
- 使用函数式组件和 hooks避免类组件
- 使用提前返回early returns提高代码可读性
- 避免引入新依赖,严控打包体积
- 兼容 Chrome 80+ 浏览器
- 支持服务端渲染
- 保持向下兼容,避免 breaking change
- 组件名使用大驼峰PascalCase
- 属性名使用小驼峰camelCase
- 合理使用 React.memouseMemo 和 useCallback 优化性能
### 命名规范
Antd 命名要求使用**完整名称**而非缩写。
- 使用 TypeScript 和 React 书写
- 使用函数式组件和 Hooks**避免类组件**
- 使用提前返回early returns提高代码可读性
- 避免引入新依赖,严控打包体积
- 兼容 Chrome 80+ 浏览器
- 支持服务端渲染SSR
- 保持向下兼容,避免 breaking change
- 组件名使用大驼峰PascalCase,如 `Button``DatePicker`
- 属性名使用小驼峰camelCase,如 `onClick``defaultValue`
- 合理使用 `React.memo``useMemo``useCallback` 优化性能
#### Props 命名
- 初始化属性:`default` + `PropName`
- 强制渲染:`forceRender`
- 子组件强制渲染:`force` + `Sub Component Name` + `Render`
- 子组件渲染:`Sub Component Name` + `Render`
- 数据源:`dataSource`
- 面板开启:使用 `open`,避免使用 `visible`
- 显示相关:`show` + `PropName`
- 功能性:`PropName` + `able`
- 禁用:`disabled`
- 额外内容:`extra`
- 图标:`icon`
- 触发器:`trigger`
- 类名:`className`
| 用途 | 命名规则 | 示例 |
| -------------- | --------------------------------------- | ----------------------------- |
| 初始化属性 | `default` + `PropName` | `defaultValue``defaultOpen` |
| 强制渲染 | `forceRender` | `forceRender` |
| 子组件强制渲染 | `force` + `SubComponentName` + `Render` | `forcePanelRender` |
| 子组件渲染 | `SubComponentName` + `Render` | `titleRender``footerRender` |
| 数据源 | `dataSource` | `dataSource` |
| 面板开启 | 使用 `open`,避免使用 `visible` | `open``defaultOpen` |
| 显示相关 | `show` + `PropName` | `showSearch``showHeader` |
| 功能性 | `PropName` + `able` | `disabled``readable` |
| 禁用 | `disabled` | `disabled` |
| 额外内容 | `extra` | `extra` |
| 图标 | `icon` | `icon``prefixIcon` |
| 触发器 | `trigger` | `trigger` |
| 类名 | `className` | `className` |
#### 事件命名
- 触发事件:`on` + `EventName`
- 子组件事件:`on` + `SubComponentName` + `EventName`
- 前置事件:`before` + `EventName`
- 后置事件:`after` + `EventName`
- 连续动作完成:`on` + `EventName` + `Complete`
| 类型 | 命名规则 | 示例 |
| ------------ | --------------------------------------- | --------------------- |
| 触发事件 | `on` + `EventName` | `onClick``onChange` |
| 子组件事件 | `on` + `SubComponentName` + `EventName` | `onPanelChange` |
| 前置事件 | `before` + `EventName` | `beforeUpload` |
| 后置事件 | `after` + `EventName` | `afterClose` |
| 连续动作完成 | `on` + `EventName` + `Complete` | `onUploadComplete` |
#### 组件引用
#### 组件引用Ref
组件应提供 `ref` 属性,结构如下:
```tsx
ComponentRef {
interface ComponentRef {
nativeElement: HTMLElement;
focus: VoidFunction;
// 其他函数
blur: VoidFunction;
// 其他方法...
}
```
@@ -94,54 +168,99 @@ ComponentRef {
格式:`variant (optional)` + `semantic part` + `semantic part variant (optional)` + `css property` + `size/disabled (optional)`
示例:
- `buttonPrimaryColor` - Button 主色
- `inputPaddingBlock` - Input 垂直内边距
- `menuItemActiveBg` - Menu 激活项背景色
### API 文档规范
| Property | Description | Type | Default |
| --------- | ----------- | ---------------------------- | ------------ |
| htmlType | xxx | string | `button ` |
| type | xxx | `horizontal ` \| `vertical ` | `horizontal` |
| disabled | xxx | boolean | false |
| minLength | xxx | number | 0 |
| style | xxx | CSSProperties | - |
#### API 表格格式
| Property | Description | Type | Default |
| --------- | --------------- | ------------------------------------------------------ | --------- |
| htmlType | Button 原生类型 | string | `button` |
| type | 按钮类型 | `primary` \| `default` \| `dashed` \| `link` \| `text` | `default` |
| disabled | 是否禁用 | boolean | false |
| minLength | 最小长度 | number | 0 |
| style | 自定义样式 | CSSProperties | - |
#### API 文档要求
- 字符串类型的默认值使用反引号
- 布尔类型直接使用 true 或 false
- 数字类型直接使用数字
- 函数类型使用箭头函数表达式
- 无默认值使用 `-`
- 描述首字母大写,结尾无句号
- API 按字母顺序排列
- 字符串类型的默认值使用反引号包裹,如 `` `button` ``
- 布尔类型直接使用 `true``false`
- 数字类型直接使用数字,如 `0``100`
- 函数类型使用箭头函数表达式,如 `(e: Event) => void`
- 无默认值使用 `-`
- 描述首字母大写,结尾无句号
- API 按字母顺序排列
---
## TypeScript 规范
### 基本原则
- 所有组件和函数必须提供准确的类型定义
- 避免使用 `any` 类型,尽可能精确地定义类型
- 使用接口而非类型别名定义对象结构
- 导出所有公共接口类型,方便用户使用
- 严格遵循 TypeScript 类型设计原则,确保类型安全
- 确保编译无任何类型错误或警告
- 所有组件和函数必须提供准确的类型定义
- 避免使用 `any` 类型,尽可能精确地定义类型
- 使用接口interface而非类型别名type定义对象结构
- 导出所有公共接口类型,方便用户使用
- 严格遵循 TypeScript 类型设计原则,确保类型安全
- 确保编译无任何类型错误或警告
### 组件类型定义
- 组件 props 应使用 interface 定义,便于扩展
- 组件 props 接口命名应为 `ComponentNameProps`
- 为组件状态定义专门的接口,如 `ComponentNameState`
- 复杂的数据结构应拆分为多个接口定义
- 组件的 ref 类型应该明确定义,使用 `React.ForwardRefRenderFunction`
- 所有回调函数类型应明确定义参数和返回值
```tsx
// ✅ 正确:使用 interface 定义 Props
interface ButtonProps {
type?: 'primary' | 'default' | 'dashed';
onClick?: (e: React.MouseEvent) => void;
}
// ❌ 错误:避免使用 type 定义对象结构
type ButtonProps = {
type?: 'primary' | 'default';
};
// ✅ 正确:组件 Props 接口命名
interface ComponentNameProps {
// ...
}
// ✅ 正确:组件状态接口命名
interface ComponentNameState {
// ...
}
// ✅ 正确:使用 ForwardRefRenderFunction 定义 ref
const Component = React.forwardRef<ComponentRef, ComponentProps>((props, ref) => {
// ...
});
```
### 类型使用最佳实践
- 适当使用泛型增强类型灵活性
- 使用交叉类型(&)合并多个类型
- 使用字面量联合类型定义有限的选项集合
- 避免使用 `enum`,优先使用联合类型和 `as const`
- 尽可能依赖 TypeScript 的类型推断
- 只在必要时使用类型断言(as
- 适当使用泛型增强类型灵活性
- 使用交叉类型(&)合并多个类型
- 使用字面量联合类型定义有限的选项集合
- 避免使用 `enum`,优先使用联合类型和 `as const`
- 尽可能依赖 TypeScript 的类型推断
- 只在必要时使用类型断言(`as`
```tsx
// ✅ 推荐:使用联合类型和 as const
const ButtonTypes = ['primary', 'default', 'dashed'] as const;
type ButtonType = (typeof ButtonTypes)[number];
// ❌ 不推荐:使用 enum
enum ButtonType {
Primary = 'primary',
Default = 'default',
}
```
---
## 样式规范
@@ -165,17 +284,17 @@ ComponentRef {
### 响应式和主题支持
- 组件应支持在不同屏幕尺寸下良好展示
- 所有组件必须支持暗色模式
- 组件应支持从右到左RTL的阅读方向
- 使用 CSS 逻辑属性(如 margin-inline-start替代方向性属性如 margin-left
- 支持通过 ConfigProvider 进行主题定制
- 组件应支持在不同屏幕尺寸下良好展示
- 所有组件必须支持暗色模式
- 组件应支持从右到左RTL的阅读方向
- 使用 CSS 逻辑属性(如 `margin-inline-start`)替代方向性属性(如 `margin-left`
- 支持通过 `ConfigProvider` 进行主题定制
### 动画效果
- 使用 CSS 过渡实现简单动画
- 复杂动画使用 @rc-component/motion 实现
- 尊重用户的减少动画设置prefers-reduced-motion
- 复杂动画使用 `@rc-component/motion` 实现
- 尊重用户的减少动画设置(`prefers-reduced-motion`
- 动画时长和缓动函数应保持一致性
- 动画不应干扰用户的操作和阅读体验
@@ -188,67 +307,108 @@ ComponentRef {
- 支持用户放大页面至 200% 时的正常布局
- 避免使用会导致闪烁的动画
## 测试指南
---
### 测试框架和工具
## 开发指南
### 测试指南
#### 测试框架和工具
- 使用 Jest 和 React Testing Library 编写单元测试
- 对 UI 组件使用快照测试 (Snapshot Testing)
- 测试覆盖率要求 100%
- 测试文件放在 **tests** 目录命名格式为index.test.tsx 或 xxx.test.tsx
- 对 UI 组件使用快照测试Snapshot Testing
- 测试覆盖率要求 **100%**
- 测试文件放在 `tests/` 目录,命名格式为:`index.test.tsx``xxx.test.tsx`
### 运行测试
#### 运行测试
```bash
npm test # 运行所有测试
npm test -- --watch # 监听模式
npm run test:coverage # 生成覆盖率报告
npm test -- --watch # 监听模式
npm run test:coverage # 生成覆盖率报告
npm run test:image # UI 快照测试(需要 Docker
```
## 演示代码规范
#### 测试最佳实践
### Demo 基本要求
- ✅ 测试用户行为而非实现细节
- ✅ 使用有意义的测试描述
- ✅ 每个测试用例应该独立,不依赖其他测试
- ✅ 测试边界情况和错误处理
- demo 代码尽可能简洁
- 避免冗余代码,方便用户复制到项目直接使用
- 每个 demo 聚焦展示一个功能点
- 提供中英文两个版本的说明
- 遵循展示优先原则,确保视觉效果良好
- 展示组件的主要使用场景
- 按照由简到繁的顺序排列 demo
### 演示代码规范
### 文件组织
#### Demo 基本要求
- ✅ demo 代码尽可能简洁
- ✅ 避免冗余代码,方便用户复制到项目直接使用
- ✅ 每个 demo 聚焦展示一个功能点
- ✅ 提供中英文两个版本的说明
- ✅ 遵循展示优先原则,确保视觉效果良好
- ✅ 展示组件的主要使用场景
- ✅ 按照由简到繁的顺序排列 demo
#### 文件组织
- 每个组件演示包含 `.md`(说明文档)和 `.tsx`(实际代码)两个文件
- 位置:组件目录下的 `demo` 子目录,如 `components/button/demo/`
- 命名:短横线连接的小写英文单词,如 `basic.tsx``custom-filter.tsx`
- 文件名应简洁地描述示例内容
### TSX 代码规范
#### TSX 代码规范
```tsx
// ✅ 正确的导入顺序
import React, { useState } from 'react';
import { Button, Space } from 'antd';
import type { ButtonProps } from 'antd';
import './custom.css';
// ✅ 使用函数式组件和 Hooks
const Demo: React.FC = () => {
const [loading, setLoading] = useState(false);
const handleClick = () => {
setLoading(true);
// ...
};
return (
<Space>
<Button loading={loading} onClick={handleClick}>
Click me
</Button>
</Space>
);
};
export default Demo;
```
**规范要点**
- 导入顺序React → 依赖库 → 组件库 → 自定义组件 → 类型 → 样式
- 类型:为复杂数据定义清晰接口,避免 `any`
- 使用函数式组件和 Hooks
- 2空格缩进箭头函数驼峰命名
- 2 空格缩进,箭头函数,驼峰命名
- 优先使用 antd 内置组件,减少外部依赖
- 性能优化:适当使用 `useMemo`/`useCallback`,清理副作用
## 国际化规范
### 国际化规范
### 类型定义
#### 类型定义
antd 的本地化配置的类型定义的入口文件是 `components/locale/index.tsx`,当需要添加新的本地化配置时,需要检查对应组件或全局配置的类型是否存在,如果不存在,则需要增加相应的类型描述。
### 本地化配置
#### 本地化配置
- 本地化配置文件命名规则:`*_*.ts`,如:`zh_CN.ts`
- 通常在为 antd 添加修改某一项本地化配置时,如无特殊说明,需要同时修改所有语言的本地化配置
- 本地化配置文件命名规则:`*_*.ts`,如:`zh_CN.ts``en_US.ts`
- 通常在为 antd 添加修改某一项本地化配置时,如无特殊说明,需要同时修改所有语言的本地化配置
- 本地化配置的内容通常是纯字符串
- 带有 `${}` 的变量将在实际使用的地方被实时替换成对应的变量内容
### 使用本地化
使用 `components/locale/index.tsx` 文件中导出的 `useLocale` 获取全局上下文中配置的本地化:
#### 使用本地化
```tsx
import { useLocale } from '../locale';
@@ -256,7 +416,7 @@ import enUS from '../locale/en_US';
export function TestComp(props) {
const { locale: propLocale } = props;
const [contextLocale] = useLocale('TestComp', enUs);
const [contextLocale] = useLocale('TestComp', enUS);
const locale = { ...contextLocale, ...propLocale };
@@ -264,162 +424,105 @@ export function TestComp(props) {
}
```
---
## 文档和 Changelog 规范
### 基本要求
- 提供中英文两个版本
- 新的属性需要声明可用的版本号
- 属性命名符合 antd 的 API 命名规则
- 提供中英文两个版本
- 新的属性需要声明可用的版本号
- 属性命名符合 antd 的 API 命名规则
### 文档锚点 ID 规范
- 针对 Markdown 文件中的标题(# 到 ######)自动生成锚点 ID
- 所有中文标题H1-H6必须手动指定一个简洁、有意义的英文锚点
- 格式: ## 中文标题 {#english-anchor-id}
- 英文标题通常不需要手动指定锚点,但如果需要,可以使用相同的格式
- 锚点 ID 必须符合正则表达式 `^[a-zA-Z][\w-:\.]*$`, 且长度不应超过 32 个字符
- 用于演示demo且包含 `-demo-` 的 id 不受前面的长度限制
- FAQ 章节下的所有标题锚点必须以 `faq-` 作为前缀
- 为确保在不同语言间切换时锚点依然有效,同一问题的中英文锚点应保持完全一致
- 例如:
- 中文标题:`### 如何使用组件 {#how-to-use-component}`
- 英文标题:`### How to Use the Component {#how-to-use-component}`
- 所有中文标题H1-H6必须手动指定一个简洁、有意义的英文锚点
- 格式: `## 中文标题 {#english-anchor-id}`
- 英文标题通常不需要手动指定锚点,但如果需要,可以使用相同的格式
- 锚点 ID 必须符合正则表达式 `^[a-zA-Z][\w-:\.]*$`且长度不应超过 32 个字符
- 用于演示demo且包含 `-demo-` 的 id 不受前面的长度限制
- FAQ 章节下的所有标题锚点必须以 `faq-` 作为前缀
- 为确保在不同语言间切换时锚点依然有效,同一问题的中英文锚点应保持完全一致
**示例**
- 中文标题:`### 如何使用组件 {#how-to-use-component}`
- 英文标题:`### How to Use the Component {#how-to-use-component}`
### Changelog 规范
- 在 CHANGELOG.en-US.md 和 CHANGELOG.zh-CN.md 书写每个版本的变更
- 对用户使用上无感知的改动建议不要提及,保持 CHANGELOG 的内容有效性
- 用面向开发者的角度和叙述方式撰写 CHANGELOG
- 描述用户的原始问题,而非解决方式
- 尽量给出原始的 PR 链接,社区提交的 PR 改动加上提交者的链接
#### 🎯 核心原则
### 🎯 核心原则
1. **文件位置**:在 `CHANGELOG.en-US.md``CHANGELOG.zh-CN.md` 书写每个版本的变更
- 有效性过滤:忽略用户无感知的改动(如文档网站改进、纯测试用例更新、内部重构、工具链优化等),除非其对开发者有直接影响。
- 开发者视角:描述“用户的原始问题”和“对开发者的影响”,而非“具体的解决代码”。
- ❌ 修复 Typography 的 DOM 结构问题。
- ✅ Typography: 💄 重构并简化了 Typography 的 DOM 结构,修复了内容空格丢失的问题。
- 版本与命名:
- 新增属性必须符合 antd API 命名规则。
- 新增属性建议在描述中暗示或明确声明可用版本号。
- 双语输出:每次处理必须同时提供 **中文版****英文版**
2. **有效性过滤**:忽略用户无感知的改动(如文档网站改进、纯测试用例更新、内部重构、工具链优化等),除非其对开发者有直接影响。保持 CHANGELOG 的内容有效性。
### 🎨 格式与结构规范
3. **开发者视角**:用面向开发者的角度和叙述方式撰写 CHANGELOG描述"用户的原始问题"和"对开发者的影响",而非"具体的解决代码"。
- ❌ 修复 Typography 的 DOM 结构问题。
- ✅ Typography: 💄 重构并简化了 Typography 的 DOM 结构,修复了内容空格丢失的问题。
- 单条条目结构:`组件名称: 图标 描述内容 [#PR号](链接) [@贡献者]`
- 组件名\*需加粗,后接英文冒号和空格。
- 分组逻辑:
- 多项改动:同一组件有 2 条及以上改动时,使用 `- 组件名` 作为分类标题(不加粗),具体条目缩进排列。
- 单项改动:直接编写单行条目,不设分类标题。
- 文本细节:
- 代码包裹所有属性名、方法名、API、`role`/`aria` 属性必须使用反引号 ` ` 包裹。
- 中英空格:中文与英文、数字、链接、`@` 用户名之间必须保留 **一个空格**
4. **版本与命名**
- 新增属性必须符合 antd API 命名规则
- 新增属性建议在描述中暗示或明确声明可用版本号
### 🏷️ Emoji 规范 (严格执行)
5. **双语输出**:每次处理必须同时提供 **中文版****英文版**
- 🐞 修复 Bug
- 💄 样式更新或 token 更新
- 🆕 新增特性 / 新增属性
- 🔥 极其值得关注的新增特性
- 🇺🇸🇨🇳🇬🇧 国际化改动
- 📖 📝 文档或网站改进
- ✅ 新增或更新测试用例
- 🛎 更新警告/提示信息
- ⌨️ ♿ 可访问性增强
- 🗑 废弃或移除
- 🛠 重构或工具链优化
- ⚡️ 性能提升
6. **PR 链接**:尽量给出原始的 PR 链接,社区提交的 PR 改动加上提交者的链接
---
#### 🎨 格式与结构规范
### 💡 输出示例参考
```md
#### 中文
- 🐞 Drawer: 修复 Drawer.PurePanel 无法响应鼠标交互的问题。[#56387](https://github.com/ant-design/ant-design/pull/56387) [@wanpan11](https://github.com/wanpan11)
- 🐞 Select: 修复 Select options 属性透传至原生 DOM 导致 React 未知属性警告的问题。[#56341](https://github.com/ant-design/ant-design/pull/56341) [@afc163](https://github.com/afc163)
#### English
- 🐞 Drawer: Fix Drawer.PurePanel failing to respond to mouse interactions. [#56387](https://github.com/ant-design/ant-design/pull/56387) [@wanpan11](https://github.com/wanpan11)
- 🐞 Select: Fix Select `options` props leaking to DOM elements and causing React unknown-prop warnings. [#56341](https://github.com/ant-design/ant-design/pull/56341) [@afc163](https://github.com/afc163)
```
### 提示词
```md
### 🤖 角色定义
你是一位 Ant Design 核心维护者,负责编写 `CHANGELOG.zh-CN.md``CHANGELOG.en-US.md`。你需要将原始 PR 列表转化为专业、简洁、面向开发者的发布日志。
### 🎯 核心原则
1. **有效性过滤**:忽略用户无感知的改动(如文档网站改进、纯测试用例更新、内部重构、工具链优化等),除非其对开发者有直接影响。
2. **开发者视角**:描述“用户的原始问题”和“对开发者的影响”,而非“具体的解决代码”。
- ❌ 修复 Typography 的 DOM 结构问题。
- ✅ Typography: 💄 重构并简化了 Typography 的 DOM 结构,修复了内容空格丢失的问题。
3. **版本与命名**
- 新增属性必须符合 antd API 命名规则。
- 新增属性建议在描述中暗示或明确声明可用版本号。
### 🎨 格式与结构规范
1. **单条条目结构**`组件名称: 图标 描述内容 [#PR号](链接) [@贡献者]`
- 组件名**无需加粗**,后接英文冒号和空格。
1. **单条条目结构**`组件名称: 图标 描述内容 [#PR号](链接) [@贡献者]`
- 组件名**无需加粗**,后接英文冒号和空格
2. **分组逻辑**
- **项改动**同一组件有 2 条及以上改动时,使用 `- 组件名` 作为分类标题(不加粗),具体条目缩进排列。
- **单项改动**:直接编写单行条目,不设分类标题。
- **多项改动**:同一组件有 2 条及以上改动时,使用 `- 组件名` 作为分类标题(不加粗),具体条目缩进排列
- **项改动**直接编写单行条目,不设分类标题
3. **文本细节**
- **代码包裹**所有属性名、方法名、API、`role`/`aria` 属性必须使用反引号 `` ` `` 包裹
- **中英空格**:中文与英文、数字、链接、`@` 用户名之间必须保留 **一个空格**
- **代码包裹**所有属性名、方法名、API、`role`/`aria` 属性必须使用反引号 ` ` 包裹。
- **中英空格**:中文与英文、数字、链接、`@` 用户名之间必须保留 **一个空格**
#### 🏷️ Emoji 规范(严格执行)
### 🏷️ Emoji 规范 (严格执行)
| Emoji | 用途 |
| ------ | ---------------------- |
| 🐞 | 修复 Bug |
| 💄 | 样式更新或 token 更新 |
| 🆕 | 新增特性 / 新增属性 |
| 🔥 | 极其值得关注的新增特性 |
| 🇺🇸🇨🇳🇬🇧 | 国际化改动 |
| 📖 📝 | 文档或网站改进 |
| ✅ | 新增或更新测试用例 |
| 🛎 | 更新警告/提示信息 |
| ⌨️ ♿ | 可访问性增强 |
| 🗑 | 废弃或移除 |
| 🛠 | 重构或工具链优化 |
| ⚡️ | 性能提升 |
- 🐞 修复 Bug
- 💄 样式更新或 token 更新
- 🆕 新增特性 / 新增属性
- 🔥 极其值得关注的新增特性
- 🇺🇸🇨🇳🇬🇧 国际化改动
- 📖 📝 文档或网站改进
- ✅ 新增或更新测试用例
- 🛎 更新警告/提示信息
- ⌨️ ♿ 可访问性增强
- 🗑 废弃或移除
- 🛠 重构或工具链优化
- ⚡️ 性能提升
#### 💡 输出示例参考
---
### 🏗️ 任务执行:请处理以下 PR 数据
#### 💡 输出示例参考:
**中文版:**
**中文版**
```markdown
- 🐞 Drawer: 修复 Drawer.PurePanel 无法响应鼠标交互的问题。[#56387](https://github.com/ant-design/ant-design/pull/56387) [@wanpan11](https://github.com/wanpan11)
- 🐞 Select: 修复 Select options 属性透传至原生 DOM 导致 React 未知属性警告的问题。[#56341](https://github.com/ant-design/ant-design/pull/56341) [@afc163](https://github.com/afc163)
- 🐞 Select: 修复 Select `options` 属性透传至原生 DOM 导致 React 未知属性警告的问题。[#56341](https://github.com/ant-design/ant-design/pull/56341) [@afc163](https://github.com/afc163)
```
**English Version:**
**English Version**
```markdown
- 🐞 Drawer: Fix Drawer.PurePanel failing to respond to mouse interactions. [#56387](https://github.com/ant-design/ant-design/pull/56387) [@wanpan11](https://github.com/wanpan11)
- 🐞 Select: Fix Select `options` props leaking to DOM elements and causing React unknown-prop warnings. [#56341](https://github.com/ant-design/ant-design/pull/56341) [@afc163](https://github.com/afc163)
```
---
## Git 和 Pull Request 规范
### 分支管理
禁止直接提交到以下保护分支:
**禁止直接提交到以下保护分支**
- `master`:主分支,用于发布
- `feature`:特性分支,用于开发新版本
@@ -435,18 +538,20 @@ export function TestComp(props) {
### 分支命名规范
- 功能开发:`feat/description-of-feature`
- 问题修复:`fix/issue-number-or-description`
- 文档更新:`docs/what-is-changed`
- 代码重构:`refactor/what-is-changed`
- 样式修改:`style/what-is-changed`
- 测试相关:`test/what-is-changed`
- 构建相关:`build/what-is-changed`
- 持续集成:`ci/what-is-changed`
- 性能优化:`perf/what-is-changed`
- 依赖升级:`deps/package-name-version`
| 类型 | 格式 | 示例 |
| -------- | --------------------------------- | ----------------------------- |
| 功能开发 | `feat/description-of-feature` | `feat/add-dark-mode` |
| 问题修复 | `fix/issue-number-or-description` | `fix/button-style-issue` |
| 文档更新 | `docs/what-is-changed` | `docs/update-api-docs` |
| 代码重构 | `refactor/what-is-changed` | `refactor/button-component` |
| 样式修改 | `style/what-is-changed` | `style/fix-button-padding` |
| 测试相关 | `test/what-is-changed` | `test/add-button-tests` |
| 构建相关 | `build/what-is-changed` | `build/update-webpack-config` |
| 持续集成 | `ci/what-is-changed` | `ci/add-github-actions` |
| 性能优化 | `perf/what-is-changed` | `perf/optimize-render` |
| 依赖升级 | `deps/package-name-version` | `deps/upgrade-react-19` |
### 分支命名注意事项
**分支命名注意事项**
1. 使用小写字母
2. 使用连字符(-)分隔单词
@@ -460,8 +565,9 @@ export function TestComp(props) {
- PR 标题始终使用英文
- 遵循格式:`类型: 简短描述`
- 例如:`fix: fix button style issues in Safari browser`
- 例如:`feat: add dark mode support`
- 示例:
- `fix: fix button style issues in Safari browser`
- `feat: add dark mode support`
#### PR 内容
@@ -473,8 +579,8 @@ export function TestComp(props) {
提交 PR 时请使用项目中提供的模板:
- 英文模板推荐PULL_REQUEST_TEMPLATE.md
- 中文模板PULL_REQUEST_TEMPLATE_CN.md
- 英文模板(推荐):`PULL_REQUEST_TEMPLATE.md`
- 中文模板:`PULL_REQUEST_TEMPLATE_CN.md`
#### PR 提交注意事项
@@ -496,7 +602,7 @@ export function TestComp(props) {
4. **工具标注**
- 如果是用 Cursor 提交的代码,请在 PR body 末尾进行标注:`> Submitted by Cursor`
### PR 改动类型
#### PR 改动类型
- 🆕 新特性提交
- 🐞 Bug 修复
@@ -508,31 +614,35 @@ export function TestComp(props) {
- ⚡️ 性能优化
- 🌐 国际化改进
---
## 质量保证
### 代码质量要求
- 确保代码运行正常,无控制台错误
- 适配常见浏览器
- 避免过时 API及时更新到新推荐用法
- 测试覆盖率达到 100%
- 通过所有 ESLint 和 TypeScript 检查
- 确保代码运行正常,无控制台错误
- 适配常见浏览器
- 避免过时 API及时更新到新推荐用法
- 测试覆盖率达到 100%
- 通过所有 ESLint 和 TypeScript 检查
### 性能要求
- 避免不必要的重新渲染
- 合理使用 React.memouseMemo 和 useCallback
- 样式计算应当高效,避免重复计算
- 图片和资源应当优化
- 支持 Tree Shaking
- 避免不必要的重新渲染
- 合理使用 `React.memo``useMemo``useCallback`
- 样式计算应当高效,避免重复计算
- 图片和资源应当优化
- 支持 Tree Shaking
### 兼容性要求
- 支持 React 18 ~ 19 版本
- 兼容 Chrome 80+ 浏览器
- 支持服务端渲染
- 保持向下兼容,避免 breaking change
- 支持 TypeScript 4.0+
- 支持 React 18 ~ 19 版本
- 兼容 Chrome 80+ 浏览器
- 支持服务端渲染SSR
- 保持向下兼容,避免 breaking change
- 支持 TypeScript 4.0+
---
## 工具链和环境
@@ -557,12 +667,11 @@ export function TestComp(props) {
- 自动化发布流程
- 支持多环境部署
---
## 参考资料
- [API Naming Rules](https://github.com/ant-design/ant-design/wiki/API-Naming-rules)
- [#16048](https://github.com/ant-design/ant-design/issues/16048) - Current listing api & Chinese version
- [#25066](https://github.com/ant-design/ant-design/issues/25066) - API standard in the document
## 特别说明
如果使用 AI 编程助手(如 Cursor进行开发请在提交 PR 时在末尾标注:`> Submitted by Cursor`
- [Development Guide](https://github.com/ant-design/ant-design/wiki/Development)

View File

@@ -15,6 +15,44 @@ tag: vVERSION
---
## 6.2.3
`2026-02-01`
- Button
- 🐞 Fix Button `defaultBg`, `defaultColor`, `defaultHoverColor` and `defaultActiveColor` tokens not taking effect. [#56238](https://github.com/ant-design/ant-design/pull/56238) [@ug-hero](https://github.com/ug-hero)
- 🐞 Fix Button default tokens not taking effect. [#56719](https://github.com/ant-design/ant-design/pull/56719) [@unknowntocka](https://github.com/unknowntocka)
- 🐞 Fix Button `variant="solid"` borders displaying incorrectly inside Space.Compact. [#56486](https://github.com/ant-design/ant-design/pull/56486) [@Pareder](https://github.com/Pareder)
- 🐞 Fix Input.TextArea ref missing `nativeElement` property. [#56803](https://github.com/ant-design/ant-design/pull/56803) [@smith3816](https://github.com/smith3816)
- 🐞 Fix Flex default `align` not taking effect when using `orientation`. [#55950](https://github.com/ant-design/ant-design/pull/55950) [@YingtaoMo](https://github.com/YingtaoMo)
- 🐞 Fix Typography link selector specificity being too low causing styles to be overridden. [#56759](https://github.com/ant-design/ant-design/pull/56759) [@QDyanbing](https://github.com/QDyanbing)
- 🐞 Fix ColorPicker HEX input allowing invalid characters. [#56752](https://github.com/ant-design/ant-design/pull/56752) [@treephesians](https://github.com/treephesians)
## 6.2.2
`2026-01-26`
- 🐞 Fix Button with href wrapped by Typography showing incorrect color and flickering outline on hover. [#56619](https://github.com/ant-design/ant-design/pull/56619) [@QdabuliuQ](https://github.com/QdabuliuQ)
- 🐞 Fix component token not taking effect for Button with `type="text"`. [#56291](https://github.com/ant-design/ant-design/pull/56291) [@QDyanbing](https://github.com/QDyanbing)
- 🐞 Fix where components within the Popover were affected by the state association with Form.Item. [#56728](https://github.com/ant-design/ant-design/pull/56728)
- 🐞 Fix the placeholders displayed incorrectly when selecting multiple items in Select. [#56675](https://github.com/ant-design/ant-design/pull/56675)
- 💄 Fix misaligned elements in Pagination when the global `fontSize` is increased. [#56715](https://github.com/ant-design/ant-design/pull/56715) [@QDyanbing](https://github.com/QDyanbing)
- 💄 Fix incorrect Drawer dragger position in RTL mode. [#56693](https://github.com/ant-design/ant-design/pull/56693) [@QdabuliuQ](https://github.com/QdabuliuQ)
## 6.2.1
`2026-01-20`
- 🐞 Fix Button child element's `className` be cleared if it contains two Chinese characters. [#56593](https://github.com/ant-design/ant-design/pull/56593) [@QdabuliuQ](https://github.com/QdabuliuQ)
- 🐞 Fix DatePicker DOM not updated bug after update `suffixIcon` as `null`. [#56637](https://github.com/ant-design/ant-design/pull/56637) [@AlanQtten](https://github.com/AlanQtten)
- 🐞 Fix Table content area border radius when set border radius for container. [#56478](https://github.com/ant-design/ant-design/pull/56478) [@QDyanbing](https://github.com/QDyanbing)
- 💄 Fix Card unexpected border radius for Body area. [#56653](https://github.com/ant-design/ant-design/pull/56653) [@ug-hero](https://github.com/ug-hero)
- 💄 MISC: Fix unexpected `undefined` and `null` in the injected styles. [#56636](https://github.com/ant-design/ant-design/pull/56636) [@li-jia-nan](https://github.com/li-jia-nan)
- 💄 MISC: Improve `background` transition to `background-color` for all components. [#56598](https://github.com/ant-design/ant-design/pull/56598) [@li-jia-nan](https://github.com/li-jia-nan)
- 🛠 Improve Grid use `genCssVar` method to generate more stable CSS variable names. [#56635](https://github.com/ant-design/ant-design/pull/56635) [@li-jia-nan](https://github.com/li-jia-nan)
- 🛠 Improve @ant-design/icons usage to avoid depend on full package since externals. [#56639](https://github.com/ant-design/ant-design/pull/56639) [@ShenHongFei](https://github.com/ShenHongFei)
## 6.2.0
`2026-01-13`

View File

@@ -15,6 +15,43 @@ tag: vVERSION
---
## 6.2.3
`2026-02-02`
- Button
- 🐞 修复 Button `defaultBg``defaultColor``defaultHoverColor``defaultActiveColor` token 不生效的问题。[#56238](https://github.com/ant-design/ant-design/pull/56238) [@ug-hero](https://github.com/ug-hero)
- 🐞 修复 Button 默认 token 不生效的问题。[#56719](https://github.com/ant-design/ant-design/pull/56719) [@unknowntocka](https://github.com/unknowntocka)
- 🐞 修复 Button `variant="solid"` 在 Space.Compact 中边框显示异常的问题。[#56486](https://github.com/ant-design/ant-design/pull/56486) [@Pareder](https://github.com/Pareder)
- 🐞 修复 Input.TextArea ref 缺少 `nativeElement` 属性的问题。[#56803](https://github.com/ant-design/ant-design/pull/56803) [@smith3816](https://github.com/smith3816)
- 🐞 修复 Flex 使用 `orientation` 时默认 `align` 不生效的问题。[#55950](https://github.com/ant-design/ant-design/pull/55950) [@YingtaoMo](https://github.com/YingtaoMo)
- 🐞 修复 Typography 链接选择器特异性过低导致样式被覆盖的问题。[#56759](https://github.com/ant-design/ant-design/pull/56759) [@QDyanbing](https://github.com/QDyanbing)
- 🐞 修复 ColorPicker HEX 输入框可以输入无效字符的问题。[#56752](https://github.com/ant-design/ant-design/pull/56752) [@treephesians](https://github.com/treephesians)
## 6.2.2
`2026-01-26`
- 🐞 修复被 Typography 包裹的带 href 的 Button 显示错误颜色和 hover 时 outline 闪烁的问题。[#56619](https://github.com/ant-design/ant-design/pull/56619) [@QdabuliuQ](https://github.com/QdabuliuQ)
- 🐞 修复 Button `type="text"` 时组件 Token 不生效的问题。[#56291](https://github.com/ant-design/ant-design/pull/56291) [@QDyanbing](https://github.com/QDyanbing)
- 🐞 修复 Popover 内组件被 Form.Item 状态关联影响的问题。[#56728](https://github.com/ant-design/ant-design/pull/56728)
- 🐞 修复 Select 多选时占位符显示异常的问题。[#56675](https://github.com/ant-design/ant-design/pull/56675)
- 💄 修复 Pagination 全局 `fontSize` 变大时各元素上下错位的问题。[#56715](https://github.com/ant-design/ant-design/pull/56715) [@QDyanbing](https://github.com/QDyanbing)
- 💄 修复 Drawer 在 rtl 模式下 dragger 位置错误的样式问题。[#56693](https://github.com/ant-design/ant-design/pull/56693) [@QdabuliuQ](https://github.com/QdabuliuQ)
## 6.2.1
`2026-01-20`
- 🐞 修复 Button 子元素为包含两个中文字符的标签时,原有 `className` 被清空的问题。[#56593](https://github.com/ant-design/ant-design/pull/56593) [@QdabuliuQ](https://github.com/QdabuliuQ)
- 🐞 修复 DatePicker 在设置 `suffixIcon``null` 后不会更新 DOM 的问题。[#56637](https://github.com/ant-design/ant-design/pull/56637) [@AlanQtten](https://github.com/AlanQtten)
- 🐞 修复 Table 容器设置圆角时,内部内容区域圆角不一致的问题。[#56478](https://github.com/ant-design/ant-design/pull/56478) [@QDyanbing](https://github.com/QDyanbing)
- 💄 修复 Card Body 区域有非预期圆角值的问题。[#56653](https://github.com/ant-design/ant-design/pull/56653) [@ug-hero](https://github.com/ug-hero)
- 💄 杂项:修复 `undefined``null` 值被注入到 CSS 的问题。[#56636](https://github.com/ant-design/ant-design/pull/56636) [@li-jia-nan](https://github.com/li-jia-nan)
- 💄 杂项:优化所有组件中的 `background` 过渡为 `background-color`。[#56598](https://github.com/ant-design/ant-design/pull/56598) [@li-jia-nan](https://github.com/li-jia-nan)
- 🛠 优化 Grid 使用 `genCssVar` 方法以生成更加稳定的 CSS 变量名。[#56635](https://github.com/ant-design/ant-design/pull/56635) [@li-jia-nan](https://github.com/li-jia-nan)
- 🛠 优化 @ant-design/icons 引入方式为独立图标引入,避免被 externals 增加前置依赖。[#56639](https://github.com/ant-design/ant-design/pull/56639) [@ShenHongFei](https://github.com/ShenHongFei)
## 6.2.0
`2026-01-13`

View File

@@ -130,10 +130,10 @@ const items: MenuProps['items'] = [
];
const consumerComponent: Partial<
Record<ZIndexConsumer, React.FC<Readonly<{ rootClassName: string }>>>
Record<ZIndexConsumer, React.FC<Readonly<{ rootClassName: string; ref?: React.Ref<any> }>>>
> = {
SelectLike: ({ rootClassName, ...props }) => (
<>
SelectLike: ({ rootClassName, ref, ...props }) => (
<div ref={ref}>
<Select
{...props}
rootClassName={`${rootClassName} comp-item comp-Select`}
@@ -159,7 +159,7 @@ const consumerComponent: Partial<
open
/>
<ColorPicker {...props} open rootClassName={`${rootClassName} comp-item comp-ColorPicker`} />
</>
</div>
),
Dropdown: (props) => (
<Dropdown
@@ -175,15 +175,15 @@ const consumerComponent: Partial<
<button type="button">test</button>
</Dropdown>
),
DatePicker: ({ rootClassName, ...props }) => (
<>
DatePicker: ({ rootClassName, ref, ...props }) => (
<div ref={ref}>
<DatePicker {...props} rootClassName={`${rootClassName} comp-item comp-DatePicker`} open />
<DatePicker.TimePicker
{...props}
rootClassName={`${rootClassName} comp-item comp-TimePicker`}
open
/>
</>
</div>
),
Menu: (props) => <Menu {...props} items={items} defaultOpenKeys={['SubMenu']} />,
ImagePreview: ({ rootClassName }: ImageProps) => (

View File

@@ -4,16 +4,16 @@ import { isValidElement } from 'react';
import type { TooltipProps } from '../tooltip';
import isNonNullable from './isNonNullable';
const convertToTooltipProps = <P extends TooltipProps>(tooltip: P | ReactNode, context?: P) => {
const convertToTooltipProps = <P extends TooltipProps>(tooltip: P | ReactNode) => {
if (!isNonNullable(tooltip)) {
return null;
}
if (typeof tooltip === 'object' && !isValidElement(tooltip)) {
return { ...context, ...tooltip } as P;
return tooltip as P;
}
return { ...context, title: tooltip } as P;
return { title: tooltip } as P;
};
export default convertToTooltipProps;

View File

@@ -0,0 +1,811 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`renders components/alert/demo/_semantic.tsx correctly 1`] = `
<div
class="acss-1ucck97"
>
<div
class="ant-row css-var-test-id"
>
<div
class="ant-col ant-col-16 acss-my3sst css-var-test-id"
>
<div
class="ant-alert ant-alert-info ant-alert-with-description semantic-mark-root css-var-test-id"
data-show="true"
role="alert"
>
<span
class="ant-alert-icon semantic-mark-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"
/>
</svg>
</span>
</span>
<div
class="ant-alert-section semantic-mark-section"
>
<div
class="ant-alert-title semantic-mark-title"
>
Info Text
</div>
<div
class="ant-alert-description semantic-mark-description"
>
Info Description Info Description Info Description Info Description
</div>
</div>
<div
class="ant-alert-actions semantic-mark-actions"
>
<div
class="ant-space ant-space-vertical ant-space-gap-row-small ant-space-gap-col-small css-var-test-id"
>
<div
class="ant-space-item"
>
<button
class="ant-btn css-var-test-id ant-btn-primary ant-btn-color-primary ant-btn-variant-solid ant-btn-sm"
type="button"
>
<span>
Accept
</span>
</button>
</div>
<div
class="ant-space-item"
>
<button
class="ant-btn css-var-test-id ant-btn-default ant-btn-dangerous ant-btn-color-dangerous ant-btn-variant-outlined ant-btn-sm ant-btn-background-ghost"
type="button"
>
<span>
Decline
</span>
</button>
</div>
</div>
</div>
<button
class="ant-alert-close-icon semantic-mark-close"
tabindex="0"
type="button"
>
<span
aria-label="close"
class="anticon anticon-close"
role="img"
>
<svg
aria-hidden="true"
data-icon="close"
fill="currentColor"
fill-rule="evenodd"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"
/>
</svg>
</span>
</button>
</div>
</div>
<div
class="ant-col ant-col-8 css-var-test-id"
>
<ul
class="acss-1ry21g5"
>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
root
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
根元素,包含边框、背景色、内边距、圆角、位置布局等警告提示框的基础样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
icon
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
图标元素,包含图标的颜色、行高、外边距等样式,支持不同类型的状态图标
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
section
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
内容元素,采用 flex 布局控制内容区域的排版和最小宽度
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
title
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
标题元素,包含标题文字的颜色、字体等样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
description
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
描述元素,包含描述文字的字体大小、行高等排版样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
actions
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
操作组元素,包含操作按钮的布局和间距样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
close
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.1.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
关闭按钮元素,包含按钮的基础样式
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
`;

View File

@@ -0,0 +1,3 @@
import { semanticDemoTest } from '../../../tests/shared/demoTest';
semanticDemoTest('alert');

View File

@@ -0,0 +1,483 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`renders components/anchor/demo/_semantic.tsx correctly 1`] = `
<div
class="acss-1ucck97"
>
<div
class="ant-row css-var-test-id"
>
<div
class="ant-col ant-col-16 acss-my3sst css-var-test-id"
>
<div
class="css-var-test-id ant-anchor-css-var ant-anchor-wrapper semantic-mark-root"
style="max-height: 100vh;"
>
<div
class="ant-anchor ant-anchor-fixed"
>
<span
class="ant-anchor-ink semantic-mark-indicator"
/>
<div
class="ant-anchor-link semantic-mark-item"
>
<a
class="ant-anchor-link-title semantic-mark-itemTitle"
href="#api"
title="API"
>
API
</a>
<div
class="ant-anchor-link semantic-mark-item"
>
<a
class="ant-anchor-link-title semantic-mark-itemTitle"
href="#anchor-props"
title="Anchor Props"
>
Anchor Props
</a>
</div>
<div
class="ant-anchor-link semantic-mark-item"
>
<a
class="ant-anchor-link-title semantic-mark-itemTitle"
href="#link-props"
title="Link Props"
>
Link Props
</a>
</div>
</div>
<div
class="ant-anchor-link semantic-mark-item"
>
<a
class="ant-anchor-link-title semantic-mark-itemTitle"
href="#anchor-demo-basic"
title="Basic demo"
>
Basic demo
</a>
</div>
<div
class="ant-anchor-link semantic-mark-item"
>
<a
class="ant-anchor-link-title semantic-mark-itemTitle"
href="#anchor-demo-static"
title="Static demo"
>
Static demo
</a>
</div>
</div>
</div>
</div>
<div
class="ant-col ant-col-8 css-var-test-id"
>
<ul
class="acss-1ry21g5"
>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
root
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
根元素,包含布局定位、内边距、边距、背景色等基础样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
item
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
链接项元素,包含内边距、文字颜色、悬停状态、过渡动画等样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
itemTitle
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
标题文字元素,包含字体样式、颜色变化、文本装饰、过渡效果等样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
indicator
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
指示器元素,包含宽度、高度、背景色、位置变化、过渡动画等样式
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
`;

View File

@@ -0,0 +1,3 @@
import { semanticDemoTest } from '../../../tests/shared/demoTest';
semanticDemoTest('anchor');

View File

@@ -100,10 +100,10 @@ exports[`renders components/auto-complete/demo/AutoComplete-and-Select.tsx exten
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -254,10 +254,10 @@ exports[`renders components/auto-complete/demo/AutoComplete-and-Select.tsx exten
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -408,10 +408,10 @@ exports[`renders components/auto-complete/demo/AutoComplete-and-Select.tsx exten
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -1221,10 +1221,10 @@ exports[`renders components/auto-complete/demo/form-debug.tsx extend context cor
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -1362,10 +1362,10 @@ exports[`renders components/auto-complete/demo/form-debug.tsx extend context cor
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -1631,10 +1631,10 @@ exports[`renders components/auto-complete/demo/form-debug.tsx extend context cor
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -1835,10 +1835,10 @@ exports[`renders components/auto-complete/demo/form-debug.tsx extend context cor
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -2044,10 +2044,10 @@ exports[`renders components/auto-complete/demo/form-debug.tsx extend context cor
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>

View File

@@ -0,0 +1,987 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`renders components/auto-complete/demo/_semantic.tsx correctly 1`] = `
<div
class="acss-1ucck97"
>
<div
class="ant-row css-var-test-id"
>
<div
class="ant-col ant-col-16 acss-my3sst css-var-test-id"
style="align-items: flex-start;"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-middle ant-flex-vertical"
style="position: absolute; margin-bottom: 80px;"
>
<div
class="ant-select ant-select-outlined ant-select-auto-complete semantic-mark-root css-var-test-id ant-select-css-var ant-select-single ant-select-open ant-select-show-search"
style="width: 200px;"
>
<div
class="ant-select-prefix semantic-mark-prefix"
>
prefix
</div>
<div
class="ant-select-content semantic-mark-content"
>
<div
class="ant-select-placeholder semantic-mark-placeholder"
style="visibility: visible;"
>
Please select
</div>
<input
aria-activedescendant="test-id_list_-1"
aria-autocomplete="list"
aria-controls="test-id_list"
aria-expanded="true"
aria-haspopup="listbox"
aria-owns="test-id_list"
autocomplete="off"
class="ant-select-input semantic-mark-input"
id="test-id"
role="combobox"
type="text"
value=""
/>
</div>
</div>
<div
class="ant-select-dropdown ant-slide-up-appear ant-slide-up-appear-prepare ant-slide-up semantic-mark-popup-root css-var-test-id ant-select-css-var ant-select-dropdown-placement-bottomLeft"
style="--arrow-x: 0px; --arrow-y: 0px; left: -1000vw; top: -1000vh; right: auto; bottom: auto; box-sizing: border-box;"
>
<div>
<div
id="test-id_list"
role="listbox"
style="height: 0px; width: 0px; overflow: hidden;"
>
<div
aria-label="aojunhao123"
aria-selected="false"
id="test-id_list_0"
role="option"
>
aojunhao123
</div>
</div>
<div
class="rc-virtual-list semantic-mark-popup-list"
style="position: relative;"
>
<div
class="rc-virtual-list-holder"
style="max-height: 256px; overflow-y: auto; overflow-anchor: none;"
>
<div>
<div
class="rc-virtual-list-holder-inner"
style="display: flex; flex-direction: column;"
>
<div
class="ant-select-item ant-select-item-option semantic-mark-popup-listItem"
title="aojunhao123"
>
<div
class="ant-select-item-option-content"
>
aojunhao123
</div>
<span
aria-hidden="true"
class="ant-select-item-option-state"
style="user-select: none;"
unselectable="on"
/>
</div>
<div
class="ant-select-item ant-select-item-option semantic-mark-popup-listItem"
title="thinkasany"
>
<div
class="ant-select-item-option-content"
>
thinkasany
</div>
<span
aria-hidden="true"
class="ant-select-item-option-state"
style="user-select: none;"
unselectable="on"
/>
</div>
<div
class="ant-select-item ant-select-item-option semantic-mark-popup-listItem"
title="meet-student"
>
<div
class="ant-select-item-option-content"
>
meet-student
</div>
<span
aria-hidden="true"
class="ant-select-item-option-state"
style="user-select: none;"
unselectable="on"
/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="ant-col ant-col-8 css-var-test-id"
>
<ul
class="acss-1ry21g5"
>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
root
</h5>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
根元素,包含相对定位、行内 flex 布局、光标样式、过渡动画、边框等选择器容器的基础样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
prefix
</h5>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
前缀元素,包含前缀内容的布局和样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
content
</h5>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
多选容器,包含已选项的布局、间距、换行相关样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
placeholder
</h5>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
占位符元素,包含占位符文本的字体样式和颜色
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
clear
</h5>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
清除按钮元素,包含清除按钮的布局、样式和交互效果
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
input
</h5>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
输入框元素,包含搜索输入框的样式、光标控制、字体继承等搜索相关样式,去除了边框样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
popup.root
</h5>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
弹出菜单元素,包含弹出层的定位、层级、背景、边框、阴影等弹出容器样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
popup.list
</h5>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
弹出菜单列表元素,包含选项列表的布局、滚动、最大高度等列表容器样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
popup.listItem
</h5>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
弹出菜单条目元素,包含选项项的内边距、悬浮效果、选中状态、禁用状态等选项交互样式
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
`;

View File

@@ -0,0 +1,3 @@
import { semanticDemoTest } from '../../../tests/shared/demoTest';
semanticDemoTest('auto-complete');

View File

@@ -20,6 +20,7 @@ const PurePanel = genPurePanel(RefAutoComplete, 'popupAlign', (props: any) =>
);
type CompoundedComponent = typeof RefAutoComplete & {
/** @deprecated Please use `options` instead. */
Option: typeof Option;
_InternalPanelDoNotUseOrYouWillBeFired: typeof PurePanel;
};

View File

@@ -18,7 +18,7 @@ export interface AvatarProps {
/** Shape of avatar, options: `circle`, `square` */
shape?: 'circle' | 'square';
/*
* Size of avatar, options: `large`, `medium`, `small`
* Size of avatar, options: `large`, `small`, `default`
* or a custom number size
* */
size?: AvatarSize;
@@ -111,7 +111,7 @@ const Avatar = React.forwardRef<HTMLSpanElement, AvatarProps>((props, ref) => {
}
};
const size = useSize((ctxSize) => customSize ?? avatarCtx?.size ?? ctxSize ?? 'medium');
const size = useSize((ctxSize) => customSize ?? avatarCtx?.size ?? ctxSize ?? 'default');
const needResponsive = Object.keys(typeof size === 'object' ? size || {} : {}).some((key) =>
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].includes(key),

View File

@@ -1,12 +1,8 @@
import * as React from 'react';
import type { ScreenSizeMap } from '../_util/responsiveObserver';
import type { SizeType } from '../config-provider/SizeContext';
/**
* 'default' is deprecated and will be removed in v7, please use `medium` instead.
*/
export type AvatarSize = SizeType | 'default' | number | ScreenSizeMap;
export type AvatarSize = 'large' | 'small' | 'default' | number | ScreenSizeMap;
export interface AvatarContextType {
size?: AvatarSize;

View File

@@ -44,7 +44,7 @@ export interface AvatarGroupProps {
popover?: PopoverProps;
};
/*
* Size of avatar, options: `large`, `medium`, `small`
* Size of avatar, options: `large`, `small`, `default`
* or a custom number size
* */
size?: AvatarSize;

View File

@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { Avatar, Button, Space } from 'antd';
type SizeType = 'large' | 'small' | 'medium' | number;
type SizeType = 'large' | 'small' | 'default' | number;
const App: React.FC = () => {
const [hide, setHide] = useState(true);
@@ -13,7 +13,7 @@ const App: React.FC = () => {
};
const toggleSize = () => {
const sizes = ['small', 'medium', 'large'] as SizeType[];
const sizes = ['small', 'default', 'large'] as SizeType[];
let current = sizes.indexOf(size) + 1;
if (current > 2) {
current = 0;

View File

@@ -36,7 +36,7 @@ Common props ref[Common props](/docs/react/common-props)
| gap | Letter type unit distance between left and right sides | number | 4 | 4.3.0 |
| icon | Custom icon type for an icon avatar | ReactNode | - | |
| shape | The shape of avatar | `circle` \| `square` | `circle` | |
| size | The size of the avatar | number \| `large` \| `medium` \| `small` \| { xs: number, sm: number, ...} | `medium` | 4.7.0 |
| size | The size of the avatar | number \| `large` \| `small` \| `default` \| { xs: number, sm: number, ...} | `default` | 4.7.0 |
| src | The address of the image for an image avatar or image element | string \| ReactNode | - | ReactNode: 4.8.0 |
| srcSet | A list of sources to use for different screen resolutions | string | - | |
| draggable | Whether the picture is allowed to be dragged | boolean \| `'true'` \| `'false'` | true | |
@@ -50,7 +50,7 @@ Common props ref[Common props](/docs/react/common-props)
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| max | Set maximum display related configurations, Before `5.18.0` you can use [parameters](https://github.com/ant-design/ant-design/blob/9d134859becbdae5b9ce276f6d9af4264691d81f/components/avatar/group.tsx#L35-L38) | `{ count?: number; style?: CSSProperties; popover?: PopoverProps }` | - | 5.18.0 |
| size | The size of the avatar | number \| `large` \| `medium` \| `small` \| { xs: number, sm: number, ...} | `medium` | 4.8.0 |
| size | The size of the avatar | number \| `large` \| `small` \| `default` \| { xs: number, sm: number, ...} | `default` | 4.8.0 |
| shape | The shape of the avatar | `circle` \| `square` | `circle` | 5.8.0 |
## Design Token

View File

@@ -41,7 +41,7 @@ group:
| gap | 字符类型距离左右两侧边界单位像素 | number | 4 | 4.3.0 |
| icon | 设置头像的自定义图标 | ReactNode | - | |
| shape | 指定头像的形状 | `circle` \| `square` | `circle` | |
| size | 设置头像的大小 | number \| `large` \| `medium` \| `small` \| { xs: number, sm: number, ...} | `medium` | 4.7.0 |
| size | 设置头像的大小 | number \| `large` \| `small` \| `default` \| { xs: number, sm: number, ...} | `default` | 4.7.0 |
| src | 图片类头像的资源地址或者图片元素 | string \| ReactNode | - | ReactNode: 4.8.0 |
| srcSet | 设置图片类头像响应式资源地址 | string | - | |
| draggable | 图片是否允许拖动 | boolean \| `'true'` \| `'false'` | true | |
@@ -55,7 +55,7 @@ group:
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| max | 设置最多显示相关配置,`5.18.0` 前可使用 [参数](https://github.com/ant-design/ant-design/blob/9d134859becbdae5b9ce276f6d9af4264691d81f/components/avatar/group.tsx#L35-L38) | `{ count?: number; style?: CSSProperties; popover?: PopoverProps }` | - | 5.18.0 |
| size | 设置头像的大小 | number \| `large` \| `medium` \| `small` \| { xs: number, sm: number, ...} | `medium` | 4.8.0 |
| size | 设置头像的大小 | number \| `large` \| `small` \| `default` \| { xs: number, sm: number, ...} | `default` | 4.8.0 |
| shape | 设置头像的形状 | `circle` \| `square` | `circle` | 5.8.0 |
## 主题变量Design Token{#design-token}

View File

@@ -0,0 +1,609 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`renders components/badge/demo/_semantic.tsx correctly 1`] = `
<div
class="acss-1ucck97"
>
<div
class="ant-row css-var-test-id"
>
<div
class="ant-col ant-col-16 acss-my3sst css-var-test-id"
>
<span
class="ant-badge semantic-mark-root css-var-test-id"
>
<span
class="ant-avatar ant-avatar-lg ant-avatar-square css-var-test-id ant-avatar-css-var"
>
<span
class="ant-avatar-string"
style="-webkit-transform: scale(1); transform: scale(1);"
/>
</span>
<sup
class="ant-scroll-number semantic-mark-indicator ant-badge-count"
data-show="true"
title="5"
>
<bdi>
<span
class="ant-scroll-number-only"
style="transition: none;"
>
<span
class="ant-scroll-number-only-unit current"
>
5
</span>
</span>
</bdi>
</sup>
</span>
</div>
<div
class="ant-col ant-col-8 css-var-test-id"
>
<ul
class="acss-1ry21g5"
>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
root
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
5.7.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
根元素,包含相对定位、行内块布局、适应内容宽度等基础布局样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
indicator
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
5.7.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
指示器元素,包含定位、层级、尺寸、颜色、字体、文本对齐、背景、圆角、阴影、过渡动画等完整的徽标样式
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
`;
exports[`renders components/badge/demo/_semantic_ribbon.tsx correctly 1`] = `
<div
class="acss-1ucck97"
>
<div
class="ant-row css-var-test-id"
>
<div
class="ant-col ant-col-16 acss-my3sst css-var-test-id"
>
<div
style="width: 100%;"
>
<div
class="ant-ribbon-wrapper css-var-test-id semantic-mark-root"
>
<div
class="ant-card ant-card-bordered ant-card-small css-var-test-id"
>
<div
class="ant-card-head"
>
<div
class="ant-card-head-wrapper"
>
<div
class="ant-card-head-title"
>
Pushes open the window
</div>
</div>
</div>
<div
class="ant-card-body"
>
and raises the spyglass.
</div>
</div>
<div
class="ant-ribbon ant-ribbon-placement-end ant-ribbon-color-pink semantic-mark-indicator"
>
<span
class="ant-ribbon-content semantic-mark-content"
>
Hippies
</span>
<div
class="ant-ribbon-corner"
/>
</div>
</div>
</div>
</div>
<div
class="ant-col ant-col-8 css-var-test-id"
>
<ul
class="acss-1ry21g5"
>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
root
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
根元素,设置相对定位和包装容器样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
indicator
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
指示器元素,设置绝对定位、内边距、背景色、圆角和缎带样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
content
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
文本元素,设置文本颜色和缎带内容显示样式
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
`;

View File

@@ -0,0 +1,3 @@
import { semanticDemoTest } from '../../../tests/shared/demoTest';
semanticDemoTest('badge');

View File

@@ -192,7 +192,7 @@ const genSharedBadgeStyle: GenerateStyle<BadgeToken> = (token) => {
background: token.badgeColor,
borderRadius: calc(indicatorHeight).div(2).equal(),
boxShadow: `0 0 0 ${unit(badgeShadowSize)} ${token.badgeShadowColor}`,
transition: `background ${token.motionDurationMid}`,
transition: `background-color ${token.motionDurationMid}`,
a: {
color: token.badgeTextColor,

View File

@@ -1,5 +1,5 @@
import * as React from 'react';
import { DownOutlined } from '@ant-design/icons';
import DownOutlined from '@ant-design/icons/DownOutlined';
import { toArray } from '@rc-component/util';
import pickAttrs from '@rc-component/util/lib/pickAttrs';
import { clsx } from 'clsx';

View File

@@ -0,0 +1,404 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`renders components/breadcrumb/demo/_semantic.tsx correctly 1`] = `
<div
class="acss-1ucck97"
>
<div
class="ant-row css-var-test-id"
>
<div
class="ant-col ant-col-16 acss-my3sst css-var-test-id"
>
<nav
class="ant-breadcrumb semantic-mark-root css-var-test-id"
>
<ol>
<li
class="ant-breadcrumb-item semantic-mark-item"
>
<a
class="ant-breadcrumb-link"
href=""
>
<span
aria-label="home"
class="anticon anticon-home"
role="img"
>
<svg
aria-hidden="true"
data-icon="home"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M946.5 505L560.1 118.8l-25.9-25.9a31.5 31.5 0 00-44.4 0L77.5 505a63.9 63.9 0 00-18.8 46c.4 35.2 29.7 63.3 64.9 63.3h42.5V940h691.8V614.3h43.4c17.1 0 33.2-6.7 45.3-18.8a63.6 63.6 0 0018.7-45.3c0-17-6.7-33.1-18.8-45.2zM568 868H456V664h112v204zm217.9-325.7V868H632V640c0-22.1-17.9-40-40-40H432c-22.1 0-40 17.9-40 40v228H238.1V542.3h-96l370-369.7 23.1 23.1L882 542.3h-96.1z"
/>
</svg>
</span>
</a>
</li>
<li
aria-hidden="true"
class="ant-breadcrumb-separator semantic-mark-separator"
>
/
</li>
<li
class="ant-breadcrumb-item semantic-mark-item"
>
<a
class="ant-breadcrumb-link"
href=""
>
<span
aria-label="user"
class="anticon anticon-user"
role="img"
>
<svg
aria-hidden="true"
data-icon="user"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M858.5 763.6a374 374 0 00-80.6-119.5 375.63 375.63 0 00-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 00-80.6 119.5A371.7 371.7 0 00136 901.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 008-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"
/>
</svg>
</span>
<span>
Application List
</span>
</a>
</li>
<li
aria-hidden="true"
class="ant-breadcrumb-separator semantic-mark-separator"
>
/
</li>
<li
class="ant-breadcrumb-item semantic-mark-item"
>
<span
class="ant-breadcrumb-link"
>
Application
</span>
</li>
</ol>
</nav>
</div>
<div
class="ant-col ant-col-8 css-var-test-id"
>
<ul
class="acss-1ry21g5"
>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
root
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
根元素,包含文字颜色、字体大小、图标尺寸等基础样式,内部使用 flex 布局的有序列表
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
item
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
Item 元素,包含文字颜色、链接的颜色变化、悬浮效果、内边距、圆角、高度、外边距等样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
separator
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
分隔符元素,包含分隔符的外边距和颜色样式
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
`;

View File

@@ -0,0 +1,3 @@
import { semanticDemoTest } from '../../../tests/shared/demoTest';
semanticDemoTest('breadcrumb');

View File

@@ -11,7 +11,9 @@ export type {
export type { BreadcrumbItemProps, SeparatorType } from './BreadcrumbItem';
type CompoundedComponent = typeof InternalBreadcrumb & {
/** @deprecated Please use `items` instead. */
Item: typeof BreadcrumbItem;
/** @deprecated Please use `separator` instead. */
Separator: typeof BreadcrumbSeparator;
};

View File

@@ -331,7 +331,7 @@ const InternalCompoundedButton = React.forwardRef<
// ========================== Size ==========================
const { compactSize, compactItemClassnames } = useCompactItemContext(prefixCls, direction);
const sizeClassNameMap = { large: 'lg', small: 'sm', middle: undefined, medium: undefined };
const sizeClassNameMap = { large: 'lg', small: 'sm', middle: undefined };
const sizeFullName = useSize((ctxSize) => customizeSize ?? compactSize ?? groupSize ?? ctxSize);

View File

@@ -0,0 +1,351 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`renders components/button/demo/_semantic.tsx correctly 1`] = `
<div
class="acss-1ucck97"
>
<div
class="ant-row css-var-test-id"
>
<div
class="ant-col ant-col-16 acss-my3sst css-var-test-id"
>
<button
class="ant-btn css-var-test-id ant-btn-primary ant-btn-color-primary ant-btn-variant-solid semantic-mark-root"
type="button"
>
<span
class="ant-btn-icon semantic-mark-icon"
>
<span
aria-label="ant-design"
class="anticon anticon-ant-design"
role="img"
>
<svg
aria-hidden="true"
data-icon="ant-design"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M716.3 313.8c19-18.9 19-49.7 0-68.6l-69.9-69.9.1.1c-18.5-18.5-50.3-50.3-95.3-95.2-21.2-20.7-55.5-20.5-76.5.5L80.9 474.2a53.84 53.84 0 000 76.4L474.6 944a54.14 54.14 0 0076.5 0l165.1-165c19-18.9 19-49.7 0-68.6a48.7 48.7 0 00-68.7 0l-125 125.2c-5.2 5.2-13.3 5.2-18.5 0L189.5 521.4c-5.2-5.2-5.2-13.3 0-18.5l314.4-314.2c.4-.4.9-.7 1.3-1.1 5.2-4.1 12.4-3.7 17.2 1.1l125.2 125.1c19 19 49.8 19 68.7 0zM408.6 514.4a106.3 106.2 0 10212.6 0 106.3 106.2 0 10-212.6 0zm536.2-38.6L821.9 353.5c-19-18.9-49.8-18.9-68.7.1a48.4 48.4 0 000 68.6l83 82.9c5.2 5.2 5.2 13.3 0 18.5l-81.8 81.7a48.4 48.4 0 000 68.6 48.7 48.7 0 0068.7 0l121.8-121.7a53.93 53.93 0 00-.1-76.4z"
/>
</svg>
</span>
</span>
<span
class="semantic-mark-content"
>
Ant Design
</span>
</button>
</div>
<div
class="ant-col ant-col-8 css-var-test-id"
>
<ul
class="acss-1ry21g5"
>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
root
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
根元素,包含边框样式、背景色、内边距、圆角、阴影效果、过渡动画、光标样式、文字权重、对齐方式等完整的按钮外观样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
icon
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
5.5.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
图标元素包含图标的字体大小、颜色继承、SVG 样式重置等图标显示相关样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
content
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
内容元素,包装按钮文本内容,控制文本的不换行显示、居中对齐、中文字符间距优化等文本排版样式
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
`;

View File

@@ -0,0 +1,3 @@
import { semanticDemoTest } from '../../../tests/shared/demoTest';
semanticDemoTest('button');

View File

@@ -1,5 +1,5 @@
import { imageDemoTest } from '../../../tests/shared/imageTest';
describe('Button image', () => {
imageDemoTest('button', { skip: ['loading.tsx'] });
imageDemoTest('button', { skip: ['loading.tsx', 'chinese-chars-loading.tsx'] });
});

View File

@@ -103,6 +103,29 @@ const App: React.FC = () => (
</Button>
</Flex>
</ConfigProvider>
<ConfigProvider
theme={{
components: {
Button: {
defaultBg: 'red',
defaultColor: 'blue',
defaultHoverColor: 'green',
defaultActiveColor: 'yellow',
textTextColor: 'purple',
textTextHoverColor: 'orange',
textTextActiveColor: 'pink',
textHoverBg: 'brown',
},
},
}}
>
<Flex gap="small" align="start">
<Button>Default Button</Button>
<Button type="dashed">Dashed Button</Button>
<Button type="text">Text Button</Button>
</Flex>
</ConfigProvider>
</Flex>
);

View File

@@ -5,38 +5,67 @@ import { genCompactItemStyle } from '../../style/compact-item';
import { genCompactItemVerticalStyle } from '../../style/compact-item-vertical';
import type { GenerateStyle } from '../../theme/internal';
import { genSubStyleComponent } from '../../theme/internal';
import { genCssVar } from '../../theme/util/genStyleUtils';
import type { ButtonToken } from './token';
import { prepareComponentToken, prepareToken } from './token';
const genButtonCompactStyle: GenerateStyle<ButtonToken> = (token) => {
const { componentCls, colorPrimaryHover, lineWidth, calc } = token;
const { antCls, componentCls, lineWidth, calc, colorBgContainer } = token;
const solidSelector = `${componentCls}-variant-solid:not([disabled])`;
const insetOffset = calc(lineWidth).mul(-1).equal();
const getCompactBorderStyle = (vertical?: boolean) => {
const [varName, varRef] = genCssVar(antCls, 'btn');
const getCompactBorderStyle = (vertical?: boolean): CSSObject => {
const itemCls = `${componentCls}-compact${vertical ? '-vertical' : ''}-item`;
const selector = `${itemCls}${componentCls}-primary:not([disabled])`;
return {
// TODO: Border color transition should be not cover when has color.
[itemCls]: {
transition: `none`,
},
[varName('compact-connect-border-color')]: varRef('bg-color-hover'),
[`${selector} + ${selector}::before`]: {
position: 'absolute',
top: vertical ? insetOffset : 0,
insetInlineStart: vertical ? 0 : insetOffset,
backgroundColor: colorPrimaryHover,
content: '""',
width: vertical ? '100%' : lineWidth,
height: vertical ? lineWidth : '100%',
} as CSSObject,
[`&${solidSelector}`]: {
transition: `none`,
[`& + ${solidSelector}:before`]: [
{
position: 'absolute',
backgroundColor: varRef('compact-connect-border-color'),
content: '""',
},
vertical
? {
top: insetOffset,
insetInline: insetOffset,
height: lineWidth,
}
: {
insetBlock: insetOffset,
insetInlineStart: insetOffset,
width: lineWidth,
},
],
'&:hover:before': {
display: 'none',
},
},
},
};
};
// Special styles for Primary Button
return {
...getCompactBorderStyle(),
...getCompactBorderStyle(true),
};
// Special styles for solid Button
return [
getCompactBorderStyle(),
getCompactBorderStyle(true),
{
[`${solidSelector}${componentCls}-color-default`]: {
[varName('compact-connect-border-color')]:
`color-mix(in srgb, ${varRef('bg-color-hover')} 75%, ${colorBgContainer})`,
},
},
];
};
// ============================== Export ==============================

View File

@@ -218,9 +218,9 @@ const genVariantStyle: GenerateStyle<ButtonToken> = (token) => {
[varName('color-light-hover')]: token.colorFillSecondary,
[varName('color-light-active')]: token.colorFill,
[varName('text-color')]: token.colorText,
[varName('text-color-hover')]: token.defaultHoverBorderColor,
[varName('text-color-active')]: token.defaultActiveBorderColor,
[varName('text-color')]: token.defaultColor,
[varName('text-color-hover')]: token.defaultHoverColor,
[varName('text-color-active')]: token.defaultActiveColor,
[varName('shadow')]: token.defaultShadow,
[`&${componentCls}-variant-solid`]: {
@@ -235,10 +235,21 @@ const genVariantStyle: GenerateStyle<ButtonToken> = (token) => {
},
[`&${componentCls}-variant-outlined, &${componentCls}-variant-dashed`]: {
[varName('bg-color-hover')]: token.defaultHoverBg,
[varName('text-color')]: token.defaultColor,
[varName('text-color-hover')]: token.defaultHoverColor,
[varName('text-color-active')]: token.defaultActiveColor,
[varName('bg-color-container')]: token.defaultBg,
[varName('bg-color-hover')]: token.defaultHoverBg,
[varName('bg-color-active')]: token.defaultActiveBg,
},
[`&${componentCls}-variant-text`]: {
[varName('text-color')]: token.textTextColor,
[varName('text-color-hover')]: token.textTextHoverColor,
[varName('text-color-active')]: token.textTextActiveColor,
[varName('bg-color-hover')]: token.textHoverBg,
},
[`&${componentCls}-background-ghost`]: {
[`&${componentCls}-variant-outlined, &${componentCls}-variant-dashed`]: {
[varName('text-color')]: token.defaultGhostColor,

View File

@@ -72,7 +72,7 @@ function YearSelect<DateType>(props: SharedProps<DateType>) {
onChange(newDate);
}}
getPopupContainer={() => divRef!.current!}
getPopupContainer={() => divRef.current}
/>
);
}
@@ -114,7 +114,7 @@ function MonthSelect<DateType>(props: SharedProps<DateType>) {
onChange={(newMonth) => {
onChange(generateConfig.setMonth(value, newMonth));
}}
getPopupContainer={() => divRef!.current!}
getPopupContainer={() => divRef.current}
/>
);
}

View File

@@ -15,7 +15,6 @@ exports[`renders components/calendar/demo/basic.tsx extend context correctly 1`]
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2016"
>
2016
@@ -431,7 +430,6 @@ exports[`renders components/calendar/demo/basic.tsx extend context correctly 1`]
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Nov"
>
Nov
@@ -1555,7 +1553,6 @@ exports[`renders components/calendar/demo/card.tsx extend context correctly 1`]
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2016"
>
2016
@@ -1971,7 +1968,6 @@ exports[`renders components/calendar/demo/card.tsx extend context correctly 1`]
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Nov"
>
Nov
@@ -3094,7 +3090,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2016"
>
2016
@@ -3510,7 +3505,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Nov"
>
Nov
@@ -4627,7 +4621,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2016"
>
2016
@@ -5043,7 +5036,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Nov"
>
Nov
@@ -6227,7 +6219,6 @@ exports[`renders components/calendar/demo/customize-header.tsx extend context co
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2016"
>
2016
@@ -6683,7 +6674,6 @@ exports[`renders components/calendar/demo/customize-header.tsx extend context co
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Nov"
>
Nov
@@ -7772,7 +7762,6 @@ exports[`renders components/calendar/demo/notice-calendar.tsx extend context cor
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2016"
>
2016
@@ -8188,7 +8177,6 @@ exports[`renders components/calendar/demo/notice-calendar.tsx extend context cor
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Nov"
>
Nov
@@ -9722,7 +9710,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2017"
>
2017
@@ -10138,7 +10125,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Jan"
>
Jan
@@ -11264,7 +11250,6 @@ exports[`renders components/calendar/demo/style-class.tsx extend context correct
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2016"
>
2016
@@ -11680,7 +11665,6 @@ exports[`renders components/calendar/demo/style-class.tsx extend context correct
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Nov"
>
Nov
@@ -12797,7 +12781,6 @@ exports[`renders components/calendar/demo/style-class.tsx extend context correct
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2016"
>
2016
@@ -13213,7 +13196,6 @@ exports[`renders components/calendar/demo/style-class.tsx extend context correct
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Nov"
>
Nov
@@ -14336,7 +14318,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2016"
>
2016
@@ -14752,7 +14733,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Nov"
>
Nov
@@ -15930,7 +15910,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2016"
>
2016
@@ -16346,7 +16325,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Nov"
>
Nov

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,6 @@ exports[`renders components/calendar/demo/basic.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="2016"
>
2016
@@ -65,7 +64,6 @@ exports[`renders components/calendar/demo/basic.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="Nov"
>
Nov
@@ -949,7 +947,6 @@ exports[`renders components/calendar/demo/card.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="2016"
>
2016
@@ -999,7 +996,6 @@ exports[`renders components/calendar/demo/card.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="Nov"
>
Nov
@@ -1882,7 +1878,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="2016"
>
2016
@@ -1932,7 +1927,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="Nov"
>
Nov
@@ -2811,7 +2805,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="2016"
>
2016
@@ -2861,7 +2854,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="Nov"
>
Nov
@@ -3805,7 +3797,6 @@ exports[`renders components/calendar/demo/customize-header.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="2016"
>
2016
@@ -3855,7 +3846,6 @@ exports[`renders components/calendar/demo/customize-header.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="Nov"
>
Nov
@@ -4688,7 +4678,6 @@ exports[`renders components/calendar/demo/notice-calendar.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="2016"
>
2016
@@ -4738,7 +4727,6 @@ exports[`renders components/calendar/demo/notice-calendar.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="Nov"
>
Nov
@@ -6032,7 +6020,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="2017"
>
2017
@@ -6082,7 +6069,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="Jan"
>
Jan
@@ -6968,7 +6954,6 @@ exports[`renders components/calendar/demo/style-class.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="2016"
>
2016
@@ -7018,7 +7003,6 @@ exports[`renders components/calendar/demo/style-class.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="Nov"
>
Nov
@@ -7897,7 +7881,6 @@ exports[`renders components/calendar/demo/style-class.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="2016"
>
2016
@@ -7947,7 +7930,6 @@ exports[`renders components/calendar/demo/style-class.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="Nov"
>
Nov
@@ -8830,7 +8812,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="2016"
>
2016
@@ -8880,7 +8861,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="Nov"
>
Nov
@@ -9820,7 +9800,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="2016"
>
2016
@@ -9870,7 +9849,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="Nov"
>
Nov

View File

@@ -15,7 +15,6 @@ exports[`Calendar Calendar MonthSelect should display correct label 1`] = `
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2019"
>
2019
@@ -65,7 +64,6 @@ exports[`Calendar Calendar MonthSelect should display correct label 1`] = `
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Jan"
>
Jan
@@ -946,7 +944,6 @@ exports[`Calendar Calendar should support locale 1`] = `
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2018年"
>
2018年
@@ -996,7 +993,6 @@ exports[`Calendar Calendar should support locale 1`] = `
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="10月"
>
10月
@@ -1877,7 +1873,6 @@ exports[`Calendar rtl render component should be rendered correctly in RTL direc
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2000"
>
2000
@@ -1927,7 +1922,6 @@ exports[`Calendar rtl render component should be rendered correctly in RTL direc
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Sep"
>
Sep
@@ -2808,7 +2802,6 @@ exports[`Calendar support Calendar.generateCalendar 1`] = `
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="2000"
>
2000
@@ -2858,7 +2851,6 @@ exports[`Calendar support Calendar.generateCalendar 1`] = `
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Jan"
>
Jan

View File

@@ -0,0 +1,3 @@
import { semanticDemoTest } from '../../../tests/shared/demoTest';
semanticDemoTest('calendar');

View File

@@ -196,7 +196,7 @@ export const genCalendarStyles = (token: CalendarToken): CSSObject => {
border: 0,
borderTop: `${unit(token.lineWidthBold)} ${token.lineType} ${token.colorSplit}`,
borderRadius: 0,
transition: `background ${token.motionDurationSlow}`,
transition: `background-color ${token.motionDurationSlow}`,
'&-value': {
lineHeight: unit(token.dateValueHeight),
transition: `color ${token.motionDurationSlow}`,

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,3 @@
import { semanticDemoTest } from '../../../tests/shared/demoTest';
semanticDemoTest('card');

View File

@@ -342,6 +342,14 @@ const genCardStyle: GenerateStyle<CardToken> = (token): CSSObject => {
[`${componentCls}-body`]: {
padding: bodyPadding,
borderRadius: `0 0 ${unit(token.borderRadiusLG)} ${unit(token.borderRadiusLG)}`,
'&:first-child': {
borderStartStartRadius: token.borderRadiusLG,
borderStartEndRadius: token.borderRadiusLG,
},
'&:not(:last-child)': {
borderEndStartRadius: 0,
borderEndEndRadius: 0,
},
},
[`${componentCls}-grid`]: genCardGridStyle(token),

View File

@@ -601,7 +601,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
>
<span>
Zhejiang /
@@ -880,7 +879,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Zhejiang / Hangzhou / West Lake"
>
Zhejiang / Hangzhou / West Lake
@@ -2025,10 +2023,10 @@ exports[`renders components/cascader/demo/panel.tsx extend context correctly 1`]
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -3499,10 +3497,10 @@ exports[`renders components/cascader/demo/status.tsx extend context correctly 1`
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -3638,10 +3636,10 @@ exports[`renders components/cascader/demo/status.tsx extend context correctly 1`
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -4740,10 +4738,10 @@ exports[`renders components/cascader/demo/variant.tsx extend context correctly 1
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -4864,10 +4862,10 @@ exports[`renders components/cascader/demo/variant.tsx extend context correctly 1
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -4988,10 +4986,10 @@ exports[`renders components/cascader/demo/variant.tsx extend context correctly 1
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -5112,10 +5110,10 @@ exports[`renders components/cascader/demo/variant.tsx extend context correctly 1
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>

File diff suppressed because it is too large Load Diff

View File

@@ -216,7 +216,6 @@ exports[`renders components/cascader/demo/custom-render.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
>
<span>
Zhejiang
@@ -320,7 +319,6 @@ exports[`renders components/cascader/demo/default-value.tsx correctly 1`] = `
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="Zhejiang / Hangzhou / West Lake"
>
Zhejiang / Hangzhou / West Lake
@@ -899,10 +897,10 @@ exports[`renders components/cascader/demo/panel.tsx correctly 1`] = `
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>

View File

@@ -1165,7 +1165,6 @@ exports[`Cascader popup correctly with defaultValue RTL 1`] = `
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Zhejiang / Hangzhou"
>
Zhejiang / Hangzhou
@@ -1343,10 +1342,10 @@ exports[`Cascader should render not found content 1`] = `
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -1421,10 +1420,10 @@ exports[`Cascader should show not found content when options.length is 0 1`] = `
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -1454,7 +1453,6 @@ exports[`Cascader support controlled mode 1`] = `
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Zhejiang / Hangzhou / West Lake"
>
Zhejiang / Hangzhou / West Lake

View File

@@ -0,0 +1,3 @@
import { createPostFn, semanticDemoTest } from '../../../tests/shared/demoTest';
semanticDemoTest('cascader', { postRenderFn: createPostFn(['Multiple']) });

View File

@@ -40,7 +40,10 @@ const App: React.FC = () => {
prefix="prefix"
style={{ width: 200 }}
options={options}
multipleProps={{ multiple: true }}
multipleProps={{
multiple: true,
defaultValue: [['contributors', 'thinkasany']],
}}
/>
);
};

View File

@@ -0,0 +1,338 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`renders components/checkbox/demo/_semantic.tsx correctly 1`] = `
<div
class="acss-1ucck97"
>
<div
class="ant-row css-var-test-id"
>
<div
class="ant-col ant-col-16 acss-my3sst css-var-test-id"
>
<label
class="ant-checkbox-wrapper semantic-mark-root css-var-test-id ant-checkbox-css-var"
>
<span
class="ant-checkbox semantic-mark-icon ant-wave-target"
>
<input
class="ant-checkbox-input"
type="checkbox"
/>
<span
class="ant-checkbox-inner"
/>
</span>
<span
class="ant-checkbox-label semantic-mark-label"
>
Checkbox
</span>
</label>
</div>
<div
class="ant-col ant-col-8 css-var-test-id"
>
<ul
class="acss-1ry21g5"
>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
root
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
根元素,包含行内 flex 布局、基线对齐、光标样式、重置样式等复选框容器的基础样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
icon
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
选中框元素,包含尺寸、方向、背景色、边框、圆角、过渡动画,以及选中状态的勾选标记样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
label
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
文本元素,包含文本的内边距和与复选框的间距样式
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
`;

View File

@@ -0,0 +1,3 @@
import { semanticDemoTest } from '../../../tests/shared/demoTest';
semanticDemoTest('checkbox');

View File

@@ -164,11 +164,8 @@ const Collapse = React.forwardRef<HTMLDivElement, CollapseProps>((props, ref) =>
aria-label={panelProps.isActive ? 'expanded' : 'collapsed'}
/>
);
return cloneElement(icon, () => ({
className: clsx(
(icon as React.ReactElement<{ className?: string }>)?.props?.className,
`${prefixCls}-arrow`,
),
return cloneElement(icon, (oriProps) => ({
className: clsx(oriProps.className, `${prefixCls}-arrow`),
}));
},
[mergedExpandIcon, prefixCls, direction],

View File

@@ -1102,7 +1102,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="start"
>
start

View File

@@ -0,0 +1,574 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`renders components/collapse/demo/_semantic.tsx correctly 1`] = `
<div
class="acss-1ucck97"
>
<div
class="ant-row css-var-test-id"
>
<div
class="ant-col ant-col-16 acss-my3sst css-var-test-id"
>
<div
style="position: absolute; inset: 0; margin: 32px;"
>
<div
class="ant-collapse ant-collapse-icon-placement-start css-var-test-id semantic-mark-root"
>
<div
class="ant-collapse-item ant-collapse-item-active"
>
<div
aria-disabled="false"
aria-expanded="true"
class="ant-collapse-header semantic-mark-header"
role="button"
tabindex="0"
>
<div
class="ant-collapse-expand-icon semantic-mark-icon"
>
<span
aria-label="expanded"
class="anticon anticon-right ant-collapse-arrow"
role="img"
>
<svg
aria-hidden="true"
data-icon="right"
fill="currentColor"
focusable="false"
height="1em"
style="transform: rotate(90deg);"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"
/>
</svg>
</span>
</div>
<span
class="ant-collapse-title semantic-mark-title"
>
This is panel header
</span>
</div>
<div
class="ant-collapse-panel ant-collapse-panel-active"
>
<div
class="ant-collapse-body semantic-mark-body"
>
<p>
This is panel body
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="ant-col ant-col-8 css-var-test-id"
>
<ul
class="acss-1ry21g5"
>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
root
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
根元素,包含折叠面板的边框、圆角、背景色等容器样式,控制面板的整体布局和外观
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
header
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
5.21.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
头部元素包含flex布局、内边距、颜色、行高、光标样式、过渡动画等面板头部的交互和样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
icon
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
图标元素,包含字体大小、过渡动画、旋转变换等展开收起箭头的样式和动效
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
title
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
6.0.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
标题元素包含flex自适应布局、右边距等标题文字的布局和排版样式
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
body
</h5>
<span
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
>
5.21.0
</span>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
内容元素,包含内边距、颜色、背景色等面板内容区域的展示样式
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
`;

View File

@@ -1090,7 +1090,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility:visible"
title="start"
>
start

View File

@@ -0,0 +1,3 @@
import { semanticDemoTest } from '../../../tests/shared/demoTest';
semanticDemoTest('collapse');

View File

@@ -225,7 +225,7 @@ const ColorPicker: CompoundedComponent = (props) => {
const rootCls = useCSSVarCls(prefixCls);
const [hashId, cssVarCls] = useStyle(prefixCls, rootCls);
const rtlCls = { [`${prefixCls}-rtl`]: direction };
const mergedRootCls = clsx(rootClassName, cssVarCls, rootCls, rtlCls);
const mergedRootCls = clsx(mergedClassNames.root, rootClassName, cssVarCls, rootCls, rtlCls);
const mergedCls = clsx(
getStatusClassNames(prefixCls, contextStatus),
{
@@ -262,7 +262,7 @@ const ColorPicker: CompoundedComponent = (props) => {
destroyOnHidden: destroyOnHidden ?? !!destroyTooltipOnHide,
};
const mergedStyle: React.CSSProperties = { ...contextStyle, ...style };
const mergedStyle: React.CSSProperties = { ...mergedStyles.root, ...contextStyle, ...style };
// ============================ zIndex ============================
@@ -305,8 +305,6 @@ const ColorPicker: CompoundedComponent = (props) => {
open={popupOpen}
className={mergedCls}
style={mergedStyle}
classNames={mergedClassNames}
styles={mergedStyles}
prefixCls={prefixCls}
disabled={mergedDisabled}
showText={showText}

View File

@@ -144,7 +144,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -518,7 +517,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -897,7 +895,6 @@ exports[`renders components/color-picker/demo/controlled.tsx extend context corr
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -1268,7 +1265,6 @@ exports[`renders components/color-picker/demo/controlled.tsx extend context corr
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -1648,7 +1644,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -2000,7 +1995,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -2314,7 +2308,6 @@ exports[`renders components/color-picker/demo/format.tsx extend context correctl
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -2700,7 +2693,6 @@ exports[`renders components/color-picker/demo/format.tsx extend context correctl
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HSB"
>
HSB
@@ -3292,7 +3284,6 @@ exports[`renders components/color-picker/demo/format.tsx extend context correctl
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="RGB"
>
RGB
@@ -3984,7 +3975,6 @@ exports[`renders components/color-picker/demo/line-gradient.tsx extend context c
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -4409,7 +4399,6 @@ exports[`renders components/color-picker/demo/line-gradient.tsx extend context c
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -4810,7 +4799,6 @@ exports[`renders components/color-picker/demo/panel-render.tsx extend context co
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -5767,7 +5755,6 @@ exports[`renders components/color-picker/demo/panel-render.tsx extend context co
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -6145,7 +6132,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -6948,7 +6934,6 @@ exports[`renders components/color-picker/demo/pure-panel.tsx extend context corr
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -7334,7 +7319,6 @@ exports[`renders components/color-picker/demo/size.tsx extend context correctly
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -7705,7 +7689,6 @@ exports[`renders components/color-picker/demo/size.tsx extend context correctly
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -8076,7 +8059,6 @@ exports[`renders components/color-picker/demo/size.tsx extend context correctly
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -8460,7 +8442,6 @@ exports[`renders components/color-picker/demo/size.tsx extend context correctly
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -8836,7 +8817,6 @@ exports[`renders components/color-picker/demo/size.tsx extend context correctly
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -9212,7 +9192,6 @@ exports[`renders components/color-picker/demo/size.tsx extend context correctly
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -9465,7 +9444,7 @@ exports[`renders components/color-picker/demo/style-class.tsx extend context cor
>
<div
aria-describedby="test-id"
class="ant-color-picker-trigger css-var-test-id ant-color-picker-css-var acss-pbemrr"
class="ant-color-picker-trigger acss-pbemrr css-var-test-id ant-color-picker-css-var"
>
<div
class="ant-color-picker-color-block"
@@ -9477,7 +9456,7 @@ exports[`renders components/color-picker/demo/style-class.tsx extend context cor
</div>
</div>
<div
class="ant-popover ant-zoom-big-appear ant-zoom-big-appear-prepare ant-zoom-big ant-popover-css-var css-var-test-id css-var-test-id ant-color-picker css-var-test-id ant-color-picker-css-var ant-popover-placement-bottomLeft"
class="ant-popover ant-zoom-big-appear ant-zoom-big-appear-prepare ant-zoom-big ant-popover-css-var css-var-test-id css-var-test-id ant-color-picker acss-pbemrr css-var-test-id ant-color-picker-css-var ant-popover-placement-bottomLeft"
style="--arrow-x: 0px; --arrow-y: 0px; left: -1000vw; top: -1000vh; right: auto; bottom: auto; box-sizing: border-box; border: 1px solid rgb(255, 255, 255);"
>
<div
@@ -9590,7 +9569,6 @@ exports[`renders components/color-picker/demo/style-class.tsx extend context cor
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -9832,7 +9810,7 @@ exports[`renders components/color-picker/demo/style-class.tsx extend context cor
>
<div
aria-describedby="test-id"
class="ant-color-picker-trigger ant-color-picker-lg css-var-test-id ant-color-picker-css-var acss-pbemrr"
class="ant-color-picker-trigger ant-color-picker-lg acss-pbemrr css-var-test-id ant-color-picker-css-var"
>
<div
class="ant-color-picker-color-block"
@@ -9844,7 +9822,7 @@ exports[`renders components/color-picker/demo/style-class.tsx extend context cor
</div>
</div>
<div
class="ant-popover ant-zoom-big-appear ant-zoom-big-appear-prepare ant-zoom-big ant-popover-css-var css-var-test-id css-var-test-id ant-color-picker css-var-test-id ant-color-picker-css-var ant-popover-placement-bottomLeft"
class="ant-popover ant-zoom-big-appear ant-zoom-big-appear-prepare ant-zoom-big ant-popover-css-var css-var-test-id css-var-test-id ant-color-picker acss-pbemrr css-var-test-id ant-color-picker-css-var ant-popover-placement-bottomLeft"
style="--arrow-x: 0px; --arrow-y: 0px; left: -1000vw; top: -1000vh; right: auto; bottom: auto; box-sizing: border-box; border: 1px solid rgb(114, 46, 209);"
>
<div
@@ -9957,7 +9935,6 @@ exports[`renders components/color-picker/demo/style-class.tsx extend context cor
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -10350,7 +10327,6 @@ exports[`renders components/color-picker/demo/text-render.tsx extend context cor
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -10728,7 +10704,6 @@ exports[`renders components/color-picker/demo/text-render.tsx extend context cor
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -11123,7 +11098,6 @@ exports[`renders components/color-picker/demo/text-render.tsx extend context cor
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -11495,7 +11469,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -11869,7 +11842,6 @@ Array [
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX

View File

@@ -0,0 +1,486 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`renders components/color-picker/demo/_semantic.tsx correctly 1`] = `
<div
class="acss-1ucck97"
>
<div
class="ant-row css-var-test-id"
>
<div
class="ant-col ant-col-16 acss-my3sst css-var-test-id"
>
<div
style="height: 300px;"
>
<div
aria-describedby="test-id"
class="ant-color-picker-trigger semantic-mark-root css-var-test-id ant-color-picker-css-var ant-popover-open ant-color-picker-trigger-active"
>
<div
class="ant-color-picker-color-block"
>
<div
class="ant-color-picker-color-block-inner"
style="background: rgb(22, 119, 255);"
/>
</div>
</div>
<div
class="ant-popover ant-zoom-big-appear ant-zoom-big-appear-prepare ant-zoom-big ant-popover-css-var css-var-test-id css-var-test-id ant-color-picker semantic-mark-root css-var-test-id ant-color-picker-css-var semantic-mark-popup-root ant-popover-placement-bottomLeft"
style="--arrow-x: 0px; --arrow-y: 0px; left: -1000vw; top: -1000vh; right: auto; bottom: auto; box-sizing: border-box; z-index: 1;"
>
<div
class="ant-popover-arrow"
style="position: absolute;"
>
<span
class="ant-popover-arrow-content"
/>
</div>
<div
class="ant-popover-container"
id="test-id"
role="tooltip"
>
<div
class="ant-popover-content"
>
<div
class="ant-color-picker-inner"
>
<div
class="ant-color-picker-inner-content"
>
<div
class="ant-color-picker-panel"
>
<div
class="ant-color-picker-select"
>
<div
class="ant-color-picker-palette"
style="position: relative;"
>
<div
style="position: absolute; left: 91.37254901960785%; top: 0%; z-index: 1; transform: translate(-50%, -50%);"
>
<div
class="ant-color-picker-handler"
style="background-color: rgb(22, 119, 255);"
/>
</div>
<div
class="ant-color-picker-saturation"
style="background-color: rgb(0, 106, 255); background-image: linear-gradient(0deg, #000, transparent), linear-gradient(90deg, #fff, hsla(0, 0%, 100%, 0));"
/>
</div>
</div>
<div
class="ant-color-picker-slider-container"
>
<div
class="ant-color-picker-slider-group"
>
<div
class="ant-slider ant-color-picker-slider css-var-test-id ant-slider-horizontal"
>
<div
class="ant-slider-rail ant-color-picker-slider-rail"
style="background: linear-gradient(90deg, rgb(255, 0, 0) 0%, rgb(255, 255, 0) 17%, rgb(0, 255, 0) 33%, rgb(0, 255, 255) 50%, rgb(0, 0, 255) 67%, rgb(255, 0, 255) 83%, rgb(255, 0, 0) 100%);"
/>
<div
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-orientation="horizontal"
aria-valuemax="359"
aria-valuemin="0"
aria-valuenow="215"
class="ant-slider-handle ant-slider-handle-1 ant-color-picker-slider-handle"
role="slider"
style="left: 59.888579387186624%; transform: translateX(-50%); background: rgb(0, 106, 255);"
tabindex="0"
/>
</div>
<div
class="ant-slider ant-color-picker-slider css-var-test-id ant-slider-horizontal"
>
<div
class="ant-slider-rail ant-color-picker-slider-rail"
style="background: linear-gradient(90deg, rgba(255, 0, 4, 0) 0%, rgb(22,119,255) 100%);"
/>
<div
class="ant-slider-step"
/>
<div
aria-disabled="false"
aria-orientation="horizontal"
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="100"
class="ant-slider-handle ant-slider-handle-1 ant-color-picker-slider-handle"
role="slider"
style="left: 100%; transform: translateX(-50%); background: rgb(22, 119, 255);"
tabindex="0"
/>
</div>
</div>
<div
class="ant-color-picker-color-block"
>
<div
class="ant-color-picker-color-block-inner"
style="background: rgb(22, 119, 255);"
/>
</div>
</div>
</div>
<div
class="ant-color-picker-input-container"
>
<div
class="ant-select ant-select-sm ant-select-borderless ant-color-picker-format-select css-var-test-id ant-select-css-var ant-select-single ant-select-show-arrow"
>
<div
class="ant-select-content"
>
<div
class="ant-select-content-value"
title="HEX"
>
HEX
</div>
<input
aria-autocomplete="list"
aria-expanded="false"
aria-haspopup="listbox"
autocomplete="off"
class="ant-select-input"
id="test-id"
readonly=""
role="combobox"
type="search"
value=""
/>
</div>
<div
class="ant-select-suffix"
>
<span
aria-label="down"
class="anticon anticon-down"
role="img"
>
<svg
aria-hidden="true"
data-icon="down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
/>
</svg>
</span>
</div>
</div>
<div
class="ant-color-picker-input"
>
<span
class="ant-input-affix-wrapper ant-input-affix-wrapper-sm ant-input-outlined ant-color-picker-hex-input css-var-test-id ant-input-css-var"
>
<span
class="ant-input-prefix"
>
#
</span>
<input
class="ant-input ant-input-sm"
type="text"
value="1677ff"
/>
</span>
</div>
<div
class="ant-input-number ant-input-number-mode-input css-var-test-id ant-input-number-css-var ant-color-picker-steppers ant-color-picker-alpha-input ant-input-number-outlined ant-input-number-sm"
>
<input
aria-valuemax="100"
aria-valuemin="0"
aria-valuenow="100"
autocomplete="off"
class="ant-input-number-input"
role="spinbutton"
step="1"
value="100%"
/>
<div
class="ant-input-number-actions"
>
<span
aria-disabled="true"
aria-label="Increase Value"
class="ant-input-number-action ant-input-number-action-up ant-input-number-action-up-disabled"
role="button"
unselectable="on"
>
<span
aria-label="up"
class="anticon anticon-up"
role="img"
>
<svg
aria-hidden="true"
data-icon="up"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"
/>
</svg>
</span>
</span>
<span
aria-disabled="false"
aria-label="Decrease Value"
class="ant-input-number-action ant-input-number-action-down"
role="button"
unselectable="on"
>
<span
aria-label="down"
class="anticon anticon-down"
role="img"
>
<svg
aria-hidden="true"
data-icon="down"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
/>
</svg>
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class="ant-col ant-col-8 css-var-test-id"
>
<ul
class="acss-1ry21g5"
>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
root
</h5>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
触发器容器,包含边框样式、过渡动画、尺寸控制等样式,显示颜色块和文本内容
</div>
</div>
</li>
<li
class="acss-1ehfz5v"
>
<div
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<h5
class="ant-typography css-var-test-id"
style="margin: 0px;"
>
popup.root
</h5>
</div>
<div
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-default ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="pushpin"
class="anticon anticon-pushpin"
role="img"
>
<svg
aria-hidden="true"
data-icon="pushpin"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M878.3 392.1L631.9 145.7c-6.5-6.5-15-9.7-23.5-9.7s-17 3.2-23.5 9.7L423.8 306.9c-12.2-1.4-24.5-2-36.8-2-73.2 0-146.4 24.1-206.5 72.3a33.23 33.23 0 00-2.7 49.4l181.7 181.7-215.4 215.2a15.8 15.8 0 00-4.6 9.8l-3.4 37.2c-.9 9.4 6.6 17.4 15.9 17.4.5 0 1 0 1.5-.1l37.2-3.4c3.7-.3 7.2-2 9.8-4.6l215.4-215.4 181.7 181.7c6.5 6.5 15 9.7 23.5 9.7 9.7 0 19.3-4.2 25.9-12.4 56.3-70.3 79.7-158.3 70.2-243.4l161.1-161.1c12.9-12.8 12.9-33.8 0-46.8zM666.2 549.3l-24.5 24.5 3.8 34.4a259.92 259.92 0 01-30.4 153.9L262 408.8c12.9-7.1 26.3-13.1 40.3-17.9 27.2-9.4 55.7-14.1 84.7-14.1 9.6 0 19.3.5 28.9 1.6l34.4 3.8 24.5-24.5L608.5 224 800 415.5 666.2 549.3z"
/>
</svg>
</span>
</span>
</button>
<button
aria-hidden="true"
class="ant-btn css-var-test-id ant-btn-text ant-btn-color-default ant-btn-variant-text ant-btn-sm ant-btn-icon-only"
type="button"
>
<span
class="ant-btn-icon"
>
<span
aria-label="info-circle"
class="anticon anticon-info-circle"
role="img"
>
<svg
aria-hidden="true"
data-icon="info-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"
/>
<path
d="M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"
/>
</svg>
</span>
</span>
</button>
</div>
</div>
<div
class="ant-typography css-var-test-id"
style="margin: 0px; font-size: 12px;"
>
弹出面板根容器,包含背景色、阴影效果、色彩选择面板、滑块控制和预设颜色等样式
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
`;

View File

@@ -552,7 +552,7 @@ exports[`renders components/color-picker/demo/style-class.tsx correctly 1`] = `
class="ant-flex css-var-test-id ant-flex-gap-small"
>
<div
class="ant-color-picker-trigger css-var-test-id ant-color-picker-css-var acss-pbemrr"
class="ant-color-picker-trigger acss-pbemrr css-var-test-id ant-color-picker-css-var"
>
<div
class="ant-color-picker-color-block"
@@ -572,7 +572,7 @@ exports[`renders components/color-picker/demo/style-class.tsx correctly 1`] = `
class="ant-flex css-var-test-id ant-flex-gap-small"
>
<div
class="ant-color-picker-trigger ant-color-picker-lg css-var-test-id ant-color-picker-css-var acss-pbemrr"
class="ant-color-picker-trigger ant-color-picker-lg acss-pbemrr css-var-test-id ant-color-picker-css-var"
>
<div
class="ant-color-picker-color-block"

View File

@@ -147,7 +147,6 @@ exports[`ColorPicker Should panelRender work 1`] = `
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX
@@ -421,7 +420,6 @@ exports[`ColorPicker Should panelRender work 2`] = `
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="HEX"
>
HEX

View File

@@ -149,9 +149,15 @@ describe('ColorPicker Components test', () => {
fireEvent.change(input, { target: { value: 'xyz' } });
// Verify input value has been updated but formatted as valid hex format
expect(input.getAttribute('value')).toEqual('xyz');
expect(input.getAttribute('value')).toEqual('');
// onChange should not be called because the input is invalid
// Simulate another invalid input
fireEvent.change(input, { target: { value: 'ff_00_gg' } });
// Verify input value is filtered
expect(input.getAttribute('value')).toEqual('ff00');
// onChange should not be called for invalid inputs
expect(onChange).toHaveBeenCalledTimes(1);
});
});

View File

@@ -0,0 +1,3 @@
import { semanticDemoTest } from '../../../tests/shared/demoTest';
semanticDemoTest('color-picker');

View File

@@ -3,7 +3,7 @@ import { Color as RcColor } from '@rc-component/color-picker';
import type { ColorGenInput, Colors } from './interface';
export const toHexFormat = (value?: string, alpha?: boolean) =>
value?.replace(/[^\w/]/g, '').slice(0, alpha ? 8 : 6) || '';
value?.replace(/[^0-9a-f]/gi, '').slice(0, alpha ? 8 : 6) || '';
export const getHex = (value?: string, alpha?: boolean) => (value ? toHexFormat(value, alpha) : '');

View File

@@ -1,6 +1,5 @@
import type { FC } from 'react';
import React from 'react';
import clsx from 'clsx';
import type { AggregationColor } from '../color';
import { generateColor } from '../util';
@@ -9,12 +8,10 @@ interface ColorClearProps {
prefixCls: string;
value?: AggregationColor;
onChange?: (value: AggregationColor) => void;
className?: string;
style?: React.CSSProperties;
}
const ColorClear: FC<ColorClearProps> = ({ prefixCls, value, onChange, className, style }) => {
const onClick = () => {
const ColorClear: FC<ColorClearProps> = ({ prefixCls, value, onChange }) => {
const handleClick = () => {
if (onChange && value && !value.cleared) {
const hsba = value.toHsb();
hsba.a = 0;
@@ -24,7 +21,7 @@ const ColorClear: FC<ColorClearProps> = ({ prefixCls, value, onChange, className
onChange(genColor);
}
};
return <div className={clsx(`${prefixCls}-clear`, className)} style={style} onClick={onClick} />;
return <div className={`${prefixCls}-clear`} onClick={handleClick} />;
};
export default ColorClear;

View File

@@ -7,12 +7,7 @@ import { clsx } from 'clsx';
import { useLocale } from '../../locale';
import type { AggregationColor } from '../color';
import type {
ColorFormatType,
ColorPickerProps,
ColorPickerSemanticClassNames,
ColorPickerSemanticStyles,
} from '../interface';
import type { ColorFormatType, ColorPickerProps } from '../interface';
import { getColorAlpha } from '../util';
import ColorClear from './ColorClear';
@@ -25,8 +20,6 @@ export interface ColorTriggerProps {
showText?: ColorPickerProps['showText'];
className?: string;
style?: CSSProperties;
classNames: ColorPickerSemanticClassNames;
styles: ColorPickerSemanticStyles;
onClick?: MouseEventHandler<HTMLDivElement>;
onMouseEnter?: MouseEventHandler<HTMLDivElement>;
onMouseLeave?: MouseEventHandler<HTMLDivElement>;
@@ -34,20 +27,8 @@ export interface ColorTriggerProps {
}
const ColorTrigger = forwardRef<HTMLDivElement, ColorTriggerProps>((props, ref) => {
const {
color,
prefixCls,
open,
disabled,
format,
className,
style,
classNames,
styles,
showText,
activeIndex,
...rest
} = props;
const { color, prefixCls, open, disabled, format, className, showText, activeIndex, ...rest } =
props;
const colorTriggerPrefixCls = `${prefixCls}-trigger`;
const colorTextPrefixCls = `${colorTriggerPrefixCls}-text`;
@@ -104,42 +85,24 @@ const ColorTrigger = forwardRef<HTMLDivElement, ColorTriggerProps>((props, ref)
const containerNode = useMemo<React.ReactNode>(
() =>
color.cleared ? (
<ColorClear prefixCls={prefixCls} className={classNames.body} style={styles.body} />
<ColorClear prefixCls={prefixCls} />
) : (
<ColorBlock
prefixCls={prefixCls}
color={color.toCssString()}
className={classNames.body}
innerClassName={classNames.content}
style={styles.body}
innerStyle={styles.content}
/>
<ColorBlock prefixCls={prefixCls} color={color.toCssString()} />
),
[color, prefixCls, classNames.body, classNames.content, styles.body, styles.content],
[color, prefixCls],
);
return (
<div
ref={ref}
className={clsx(colorTriggerPrefixCls, className, classNames.root, {
className={clsx(colorTriggerPrefixCls, className, {
[`${colorTriggerPrefixCls}-active`]: open,
[`${colorTriggerPrefixCls}-disabled`]: disabled,
})}
style={{
...styles.root,
...style,
}}
{...pickAttrs(rest)}
>
{containerNode}
{showText && (
<div
className={clsx(colorTextPrefixCls, classNames.description)}
style={styles.description}
>
{desc}
</div>
)}
{showText && <div className={colorTextPrefixCls}>{desc}</div>}
</div>
);
});

View File

@@ -1,6 +1,6 @@
import React from 'react';
import type { ColorPickerProps } from 'antd';
import { ColorPicker, Flex } from 'antd';
import { ColorPicker } from 'antd';
import useLocale from '../../../.dumi/hooks/useLocale';
import SemanticPreview from '../../../.dumi/theme/common/SemanticPreview';
@@ -8,16 +8,10 @@ import SemanticPreview from '../../../.dumi/theme/common/SemanticPreview';
const locales = {
cn: {
root: '触发器容器,包含边框样式、过渡动画、尺寸控制等样式,显示颜色块和文本内容',
body: '色块容器,包含底色、边框等样式',
content: '色块颜色元素,包含实际选择的颜色样式',
description: '描述文本内容,包含字体样式、颜色等样式',
'popup.root': '弹出面板根容器,包含背景色、阴影效果、色彩选择面板、滑块控制和预设颜色等样式',
},
en: {
root: 'Trigger container with border styles, transition animations, size controls, displaying color block and text content',
body: 'Color block container with background color, border styles',
content: 'Color block element with actual selected color styles',
description: 'Description text content with font styles and color',
'popup.root':
'Popup panel root container with background color, shadow effects, color selection panel, slider controls and preset colors',
},
@@ -26,21 +20,19 @@ const locales = {
const Block: React.FC<Readonly<ColorPickerProps>> = (props) => {
const divRef = React.useRef<HTMLDivElement>(null);
return (
<Flex ref={divRef} style={{ height: 300 }} align="flex-start" gap="small">
<div ref={divRef} style={{ height: 300 }}>
<ColorPicker
defaultValue="#1677ff"
open
showText
{...props}
getPopupContainer={() => divRef!.current!}
getPopupContainer={() => divRef.current || document.body}
styles={{
popup: {
root: { zIndex: 1 },
},
}}
/>
<ColorPicker open={false} allowClear {...props} />
</Flex>
</div>
);
};
@@ -51,9 +43,6 @@ const App: React.FC = () => {
componentName="ColorPicker"
semantics={[
{ name: 'root', desc: locale.root },
{ name: 'body', desc: locale.body },
{ name: 'content', desc: locale.content },
{ name: 'description', desc: locale.description },
{ name: 'popup.root', desc: locale['popup.root'] },
]}
>

View File

@@ -59,16 +59,10 @@ export type ColorPickerSemanticName = keyof ColorPickerSemanticClassNames &
export type ColorPickerSemanticClassNames = {
root?: string;
body?: string;
content?: string;
description?: string;
};
export type ColorPickerSemanticStyles = {
root?: React.CSSProperties;
body?: React.CSSProperties;
content?: React.CSSProperties;
description?: React.CSSProperties;
};
export type ColorPickerClassNamesType = SemanticClassNamesType<

View File

@@ -1,9 +1,6 @@
import * as React from 'react';
/**
* Note: `middle` is deprecated and will be removed in v7, please use `medium` instead.
*/
export type SizeType = 'small' | 'medium' | 'middle' | 'large' | undefined;
export type SizeType = 'small' | 'middle' | 'large' | undefined;
const SizeContext = React.createContext<SizeType>(undefined);

View File

@@ -33,10 +33,10 @@ exports[`renderEmpty should render Cascader empty 1`] = `
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -84,10 +84,10 @@ exports[`renderEmpty should render List empty 1`] = `
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -135,10 +135,10 @@ exports[`renderEmpty should render Mentions empty 1`] = `
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -186,10 +186,10 @@ exports[`renderEmpty should render Select empty 1`] = `
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -237,10 +237,10 @@ exports[`renderEmpty should render Table empty 1`] = `
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -290,10 +290,10 @@ exports[`renderEmpty should render Transfer empty 1`] = `
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -341,10 +341,10 @@ exports[`renderEmpty should render TreeSelect empty 1`] = `
stroke="#d9d9d9"
>
<path
d="M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
d="M55 12.8 44.9 1.3Q44 0 42.9 0H21.1q-1.2 0-2 1.3L9 12.8V22h46z"
/>
<path
d="M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z"
d="M41.6 16c0-1.7 1-3 2.2-3H55v18.1c0 2.2-1.3 3.9-3 3.9H12c-1.7 0-3-1.7-3-3.9V13h11.2c1.2 0 2.2 1.3 2.2 3s1 2.9 2.2 2.9h14.8c1.2 0 2.2-1.4 2.2-3"
fill="#fafafa"
/>
</g>
@@ -380,50 +380,44 @@ exports[`renderEmpty should return empty when componentName is not matched 1`] =
fill-rule="evenodd"
>
<g
transform="translate(24 31.67)"
transform="translate(24 31.7)"
>
<ellipse
cx="67.797"
cy="106.89"
cx="67.8"
cy="106.9"
fill="#F5F5F7"
fill-opacity=".8"
rx="67.797"
ry="12.668"
rx="67.8"
ry="12.7"
/>
<path
d="M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"
fill="#AEB8C2"
d="M122 69.7 98.1 40.2a6 6 0 0 0-4.6-2.2H42.1a6 6 0 0 0-4.6 2.2l-24 29.5V85H122z"
fill="#aeb8c2"
/>
<path
d="M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z"
fill="url(#linearGradient-1)"
transform="translate(13.56)"
d="M33.8 0h68a4 4 0 0 1 4 4v93.3a4 4 0 0 1-4 4h-68a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4"
fill="#f5f5f7"
/>
<path
d="M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"
fill="#F5F5F7"
/>
<path
d="M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"
fill="#DCE0E6"
d="M42.7 10h50.2a2 2 0 0 1 2 2v25a2 2 0 0 1-2 2H42.7a2 2 0 0 1-2-2V12a2 2 0 0 1 2-2m.2 39.8h49.8a2.3 2.3 0 1 1 0 4.5H42.9a2.3 2.3 0 0 1 0-4.5m0 11.7h49.8a2.3 2.3 0 1 1 0 4.6H42.9a2.3 2.3 0 0 1 0-4.6m79 43.5a7 7 0 0 1-6.8 5.4H20.5a7 7 0 0 1-6.7-5.4l-.2-1.8V69.7h26.3c2.9 0 5.2 2.4 5.2 5.4s2.4 5.4 5.3 5.4h34.8c2.9 0 5.3-2.4 5.3-5.4s2.3-5.4 5.2-5.4H122v33.5q0 1-.2 1.8"
fill="#dce0e6"
/>
</g>
<path
d="M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"
fill="#DCE0E6"
d="m149.1 33.3-6.8 2.6a1 1 0 0 1-1.3-1.2l2-6.2q-4.1-4.5-4.2-10.4c0-10 10.1-18.1 22.6-18.1S184 8.1 184 18.1s-10.1 18-22.6 18q-6.8 0-12.3-2.8"
fill="#dce0e6"
/>
<g
fill="#FFF"
transform="translate(149.65 15.383)"
fill="#fff"
transform="translate(149.7 15.4)"
>
<ellipse
cx="20.654"
cy="3.167"
rx="2.849"
ry="2.815"
<circle
cx="20.7"
cy="3.2"
r="2.8"
/>
<path
d="M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
d="M5.7 5.6H0L2.9.7zM9.3.7h5v5h-5z"
/>
</g>
</g>

View File

@@ -298,7 +298,6 @@ export type FormConfig = ComponentStyleConfig &
| 'variant'
| 'classNames'
| 'styles'
| 'tooltip'
>;
export type FloatButtonConfig = ComponentStyleConfig &
@@ -310,7 +309,10 @@ export type FloatButtonGroupConfig = ComponentStyleConfig &
Pick<FloatButtonGroupProps, 'closeIcon' | 'classNames' | 'styles'>;
export type PaginationConfig = ComponentStyleConfig &
Pick<PaginationProps, 'showSizeChanger' | 'totalBoundaryShowSizeChanger' | 'classNames' | 'styles'>;
Pick<
PaginationProps,
'showSizeChanger' | 'totalBoundaryShowSizeChanger' | 'classNames' | 'styles'
>;
export type ProgressConfig = ComponentStyleConfig & Pick<ProgressProps, 'classNames' | 'styles'>;

View File

@@ -133,7 +133,7 @@ const {
| flex | Set Flex common props | { className?: string, style?: React.CSSProperties, vertical?: boolean } | - | 5.10.0 |
| floatButton | Set FloatButton common props | { className?: string, style?: React.CSSProperties, classNames?: [FloatButtonProps\["classNames"\]](/components/float-button#semantic-dom), styles?: [FloatButtonProps\["styles"\]](/components/float-button#semantic-dom), backTopIcon?: React.ReactNode } | - | |
| floatButtonGroup | Set FloatButton.Group common props | { closeIcon?: React.ReactNode, className?: string, style?: React.CSSProperties, classNames?: [FloatButtonProps\["classNames"\]](/components/float-button#semantic-dom), styles?: [FloatButtonProps\["styles"\]](/components/float-button#semantic-dom) } | - | |
| form | Set Form common props | { className?: string, style?: React.CSSProperties, validateMessages?: [ValidateMessages](/components/form/#validatemessages), requiredMark?: boolean \| `optional`, scrollToFirstError?: boolean \| [Options](https://github.com/stipsan/scroll-into-view-if-needed/tree/ece40bd9143f48caf4b99503425ecb16b0ad8249#options), classNames?:[FormConfig\["classNames"\]](/components/form#semantic-dom), styles?: [FormConfig\["styles"\]](/components/form#semantic-dom), tooltip?: [TooltipProps](/components/tooltip#api) & { icon?: ReactNode } } | - | `requiredMark`: 4.8.0; `colon`: 4.18.0; `scrollToFirstError`: 5.2.0; `className` and `style`: 5.7.0; `tooltip`: 6.3.0 |
| form | Set Form common props | { className?: string, style?: React.CSSProperties, validateMessages?: [ValidateMessages](/components/form/#validatemessages), requiredMark?: boolean \| `optional`, scrollToFirstError?: boolean \| [Options](https://github.com/stipsan/scroll-into-view-if-needed/tree/ece40bd9143f48caf4b99503425ecb16b0ad8249#options), classNames?:[FormConfig\["classNames"\]](/components/form#semantic-dom), styles?: [FormConfig\["styles"\]](/components/form#semantic-dom) } | - | `requiredMark`: 4.8.0; `colon`: 4.18.0; `scrollToFirstError`: 5.2.0; `className` and `style`: 5.7.0 |
| image | Set Image common props | { className?: string, style?: React.CSSProperties, preview?: { closeIcon?: React.ReactNode, classNames?:[ImageConfig\["classNames"\]](/components/image#semantic-dom), styles?: [ImageConfig\["styles"\]](/components/image#semantic-dom) }, fallback?: string } | - | 5.7.0, `closeIcon`: 5.14.0, `classNames` and `styles`: 6.0.0 |
| input | Set Input common props | { autoComplete?: string, className?: string, style?: React.CSSProperties, allowClear?: boolean \| { clearIcon?: ReactNode } } | - | 4.2.0, `allowClear`: 5.15.0 |
| inputNumber | Set InputNumber common props | { className?: string, style?: React.CSSProperties, classNames?: [InputNumberConfig\["classNames"\]](/components/input-number#semantic-dom), styles?: [InputNumberConfig\["styles"\]](/components/input-number#semantic-dom) } | - | |

View File

@@ -135,7 +135,7 @@ const {
| flex | 设置 Flex 组件的通用属性 | { className?: string, style?: React.CSSProperties, vertical?: boolean } | - | 5.10.0 |
| floatButton | 设置 FloatButton 组件的通用属性 | { className?: string, style?: React.CSSProperties, classNames?: [FloatButtonProps\["classNames"\]](/components/float-button-cn#semantic-dom), styles?: [FloatButtonProps\["styles"\]](/components/float-button-cn#semantic-dom), backTopIcon?: React.ReactNode } | - | |
| floatButtonGroup | 设置 FloatButton.Group 组件的通用属性 | { closeIcon?: React.ReactNode, className?: string, style?: React.CSSProperties, classNames?: [FloatButtonProps\["classNames"\]](/components/float-button-cn#semantic-dom), styles?: [FloatButtonProps\["styles"\]](/components/float-button-cn#semantic-dom) } | - | |
| form | 设置 Form 组件的通用属性 | { className?: string, style?: React.CSSProperties, validateMessages?: [ValidateMessages](/components/form-cn#validatemessages), requiredMark?: boolean \| `optional`, colon?: boolean, scrollToFirstError?: boolean \| [Options](https://github.com/stipsan/scroll-into-view-if-needed/tree/ece40bd9143f48caf4b99503425ecb16b0ad8249#options), classNames?:[FormConfig\["classNames"\]](/components/form-cn#semantic-dom), styles?: [FormConfig\["styles"\]](/components/form-cn#semantic-dom), tooltip?: [TooltipProps](/components/tooltip-cn#api) & { icon?: ReactNode } } | - | `requiredMark`: 4.8.0; `colon`: 4.18.0; `scrollToFirstError`: 5.2.0; `className``style`: 5.7.0; `tooltip`: 6.3.0 |
| form | 设置 Form 组件的通用属性 | { className?: string, style?: React.CSSProperties, validateMessages?: [ValidateMessages](/components/form-cn#validatemessages), requiredMark?: boolean \| `optional`, colon?: boolean, scrollToFirstError?: boolean \| [Options](https://github.com/stipsan/scroll-into-view-if-needed/tree/ece40bd9143f48caf4b99503425ecb16b0ad8249#options), classNames?:[FormConfig\["classNames"\]](/components/form-cn#semantic-dom), styles?: [FormConfig\["styles"\]](/components/form-cn#semantic-dom) } | - | `requiredMark`: 4.8.0; `colon`: 4.18.0; `scrollToFirstError`: 5.2.0; `className``style`: 5.7.0 |
| image | 设置 Image 组件的通用属性 | { className?: string, style?: React.CSSProperties, preview?: { closeIcon?: React.ReactNode, classNames?:[ImageConfig\["classNames"\]](/components/image-cn#semantic-dom), styles?: [ImageConfig\["styles"\]](/components/image-cn#semantic-dom) }, fallback?: string } | - | 5.7.0, `closeIcon`: 5.14.0, `classNames``styles`: 6.0.0 |
| input | 设置 Input 组件的通用属性 | { autoComplete?: string, className?: string, style?: React.CSSProperties,classNames?:[InputConfig\["classNames"\]](/components/input-cn#semantic-input), styles?: [InputConfig\["styles"\]](/components/input-cn#semantic-input), allowClear?: boolean \| { clearIcon?: ReactNode } } | - | 5.7.0, `allowClear`: 5.15.0 |
| inputNumber | 设置 Input 组件的通用属性 | { className?: string, style?: React.CSSProperties, classNames?: [InputNumberConfig\["classNames"\]](/components/input-number-cn#semantic-dom), styles?: [InputNumberConfig\["styles"\]](/components/input-number-cn#semantic-dom) } | - | |

View File

@@ -491,10 +491,10 @@ describe('DatePicker', () => {
expect(container.querySelector('.ant-picker-suffix')!.children.length).toBeTruthy();
rerender(<DatePicker suffixIcon={false} />);
expect(container.querySelector('.ant-picker-suffix')!.children.length).toBeFalsy();
expect(container.querySelector('.ant-picker-suffix')).toBeFalsy();
rerender(<DatePicker suffixIcon={null} />);
expect(container.querySelector('.ant-picker-suffix')!.children.length).toBeFalsy();
expect(container.querySelector('.ant-picker-suffix')).toBeFalsy();
rerender(<DatePicker suffixIcon={'123'} />);
expect(container.querySelector('.ant-picker-suffix')?.textContent).toBe('123');

View File

@@ -85686,9 +85686,6 @@ exports[`renders components/date-picker/demo/suffixIcon-debug.tsx extend context
size="12"
value=""
/>
<span
class="ant-picker-suffix"
/>
</div>
</div>
<div
@@ -86900,9 +86897,6 @@ exports[`renders components/date-picker/demo/suffixIcon-debug.tsx extend context
size="12"
value=""
/>
<span
class="ant-picker-suffix"
/>
</div>
</div>
<div
@@ -88100,7 +88094,6 @@ exports[`renders components/date-picker/demo/switchable.tsx extend context corre
>
<div
class="ant-select-content-value"
style="visibility: visible;"
title="Time"
>
Time

Some files were not shown because too many files have changed in this diff Show More