diff --git a/components/grid/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/grid/__tests__/__snapshots__/demo-extend.test.ts.snap index bc365b9f12..62d97b5865 100644 --- a/components/grid/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/grid/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -1500,16 +1500,14 @@ exports[`renders components/grid/demo/sort.tsx extend context correctly 1`] = ` exports[`renders components/grid/demo/sort.tsx extend context correctly 2`] = `[]`; exports[`renders components/grid/demo/useBreakpoint.tsx extend context correctly 1`] = ` -
- Current break point: +Array [ + Current break point: , xs - -
+ , +] `; exports[`renders components/grid/demo/useBreakpoint.tsx extend context correctly 2`] = `[]`; diff --git a/components/grid/__tests__/__snapshots__/demo.test.ts.snap b/components/grid/__tests__/__snapshots__/demo.test.ts.snap index d55d0afdb9..ea31e061cc 100644 --- a/components/grid/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/grid/__tests__/__snapshots__/demo.test.ts.snap @@ -1419,9 +1419,9 @@ exports[`renders components/grid/demo/sort.tsx correctly 1`] = ` `; exports[`renders components/grid/demo/useBreakpoint.tsx correctly 1`] = ` -
- Current break point: -
+Array [ + Current break point:, + , + , +] `; diff --git a/components/grid/demo/useBreakpoint.tsx b/components/grid/demo/useBreakpoint.tsx index 160233c51d..90baf90e24 100644 --- a/components/grid/demo/useBreakpoint.tsx +++ b/components/grid/demo/useBreakpoint.tsx @@ -1,21 +1,22 @@ import React from 'react'; -import { Flex, Grid, Tag } from 'antd'; +import { Grid, Tag } from 'antd'; const { useBreakpoint } = Grid; const App: React.FC = () => { const screens = useBreakpoint(); + return ( - - Current break point: + <> + Current break point:{' '} {Object.entries(screens) .filter((screen) => !!screen[1]) - .map((screen) => ( + .map((screen) => ( {screen[0]} ))} - + ); }; diff --git a/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap index 5cce851ef8..9b3737c359 100644 --- a/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/select/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -1522,11 +1522,9 @@ exports[`renders components/select/demo/custom-tag-render.tsx extend context cor - - gold - + gold - - cyan - + cyan
- - gold - + gold
, @@ -178,7 +172,7 @@ exports[`renders components/tag/demo/basic.tsx extend context correctly 1`] = ` /> -
+
, @@ -207,8 +201,8 @@ exports[`renders components/tag/demo/basic.tsx extend context correctly 1`] = `
-
- +
, +] `; exports[`renders components/tag/demo/basic.tsx extend context correctly 2`] = `[]`; @@ -216,7 +210,8 @@ exports[`renders components/tag/demo/basic.tsx extend context correctly 2`] = `[ exports[`renders components/tag/demo/borderless.tsx extend context correctly 1`] = ` Array [
,
Categories: @@ -552,7 +551,8 @@ Array [
,
,
,
,
-
+ Tag 1 - Tag 1 - + + + + + Tag 2 - Tag 2 - + + + + + Tag 3 - Tag 3 - + + -
+
, +Array [ Tag 1 - + , @@ -150,7 +144,7 @@ exports[`renders components/tag/demo/basic.tsx correctly 1`] = ` > Link - +
, @@ -176,7 +170,7 @@ exports[`renders components/tag/demo/basic.tsx correctly 1`] = ` /> - + , @@ -205,14 +199,15 @@ exports[`renders components/tag/demo/basic.tsx correctly 1`] = ` - -
+
, +] `; exports[`renders components/tag/demo/borderless.tsx correctly 1`] = ` Array [
,
Categories: @@ -542,7 +541,8 @@ Array [
,
,
,
,
{ @@ -73,9 +73,7 @@ const App: React.FC = () => { } }} > - - {tagChild} - + {tagChild}
{inputVisible ? ( diff --git a/components/tag/demo/basic.tsx b/components/tag/demo/basic.tsx index 5476737640..21134b87d6 100644 --- a/components/tag/demo/basic.tsx +++ b/components/tag/demo/basic.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { CloseCircleOutlined } from '@ant-design/icons'; -import { Flex, Tag } from 'antd'; +import { Tag } from 'antd'; const preventDefault = (e: React.MouseEvent) => { e.preventDefault(); @@ -8,7 +8,7 @@ const preventDefault = (e: React.MouseEvent) => { }; const App: React.FC = () => ( - + <> Tag 1 Link @@ -19,7 +19,7 @@ const App: React.FC = () => ( } onClose={console.log}> Tag 2 - + ); export default App; diff --git a/components/tag/demo/borderless.tsx b/components/tag/demo/borderless.tsx index 26ccb9ae98..da95014d87 100644 --- a/components/tag/demo/borderless.tsx +++ b/components/tag/demo/borderless.tsx @@ -3,7 +3,7 @@ import { Divider, Flex, Tag } from 'antd'; const App: React.FC = () => ( <> - + Tag 1 Tag 2 @@ -14,7 +14,7 @@ const App: React.FC = () => ( - + processing diff --git a/components/tag/demo/borderlessLayout.tsx b/components/tag/demo/borderlessLayout.tsx index 8ad6fc8618..a3c614732d 100644 --- a/components/tag/demo/borderlessLayout.tsx +++ b/components/tag/demo/borderlessLayout.tsx @@ -5,7 +5,7 @@ const App: React.FC = () => { const { token } = theme.useToken(); return (
- + Tag 1 Tag 2 @@ -16,7 +16,7 @@ const App: React.FC = () => { - + magenta diff --git a/components/tag/demo/checkable.tsx b/components/tag/demo/checkable.tsx index 412052603f..65cea1425d 100644 --- a/components/tag/demo/checkable.tsx +++ b/components/tag/demo/checkable.tsx @@ -14,7 +14,7 @@ const App: React.FC = () => { }; return ( - + Categories: {tagsData.map((tag) => ( ( - + magenta red volcano diff --git a/components/tag/demo/colorful.tsx b/components/tag/demo/colorful.tsx index 0ab8125033..e0e4e4765f 100644 --- a/components/tag/demo/colorful.tsx +++ b/components/tag/demo/colorful.tsx @@ -4,7 +4,7 @@ import { Divider, Flex, Tag } from 'antd'; const App: React.FC = () => ( <> Presets - + magenta red volcano @@ -18,7 +18,7 @@ const App: React.FC = () => ( purple Custom - + #f50 #2db7f5 #87d068 diff --git a/components/tag/demo/component-token.tsx b/components/tag/demo/component-token.tsx index fa918c49cb..f47a7fa493 100644 --- a/components/tag/demo/component-token.tsx +++ b/components/tag/demo/component-token.tsx @@ -6,7 +6,7 @@ const App: React.FC = () => ( - + Link diff --git a/components/tag/demo/control.tsx b/components/tag/demo/control.tsx index fcb775981b..bf25ca662b 100644 --- a/components/tag/demo/control.tsx +++ b/components/tag/demo/control.tsx @@ -71,7 +71,7 @@ const App: React.FC = () => { }; return ( - + {tags.map((tag, index) => { if (editInputIndex === index) { return ( diff --git a/components/tag/demo/customize.tsx b/components/tag/demo/customize.tsx index d52605cb79..007608b36c 100644 --- a/components/tag/demo/customize.tsx +++ b/components/tag/demo/customize.tsx @@ -3,7 +3,7 @@ import { CloseCircleOutlined } from '@ant-design/icons'; import { Flex, Tag } from 'antd'; const App: React.FC = () => ( - + Tag1 diff --git a/components/tag/demo/draggable.tsx b/components/tag/demo/draggable.tsx index 6b0dcca70b..ad4b7e792e 100644 --- a/components/tag/demo/draggable.tsx +++ b/components/tag/demo/draggable.tsx @@ -68,7 +68,7 @@ const App: React.FC = () => { return ( - + {items.map((item) => ( ))} diff --git a/components/tag/demo/icon.tsx b/components/tag/demo/icon.tsx index 5749eb0f7f..04fbbe9563 100644 --- a/components/tag/demo/icon.tsx +++ b/components/tag/demo/icon.tsx @@ -8,7 +8,7 @@ import { import { Flex, Tag } from 'antd'; const App: React.FC = () => ( - + } color="#55acee"> Twitter diff --git a/components/tag/demo/status.tsx b/components/tag/demo/status.tsx index 91d55f375b..af768a92c5 100644 --- a/components/tag/demo/status.tsx +++ b/components/tag/demo/status.tsx @@ -12,7 +12,7 @@ import { Divider, Flex, Tag } from 'antd'; const App: React.FC = () => ( <> Without icon - + success processing error @@ -20,7 +20,7 @@ const App: React.FC = () => ( default With icon - + } color="success"> success diff --git a/components/tag/style/index.ts b/components/tag/style/index.ts index 365b095849..4165b0abe9 100644 --- a/components/tag/style/index.ts +++ b/components/tag/style/index.ts @@ -40,6 +40,8 @@ const genBaseStyle = (token: TagToken): CSSInterpolation => { ...resetComponent(token), display: 'inline-block', height: 'auto', + // https://github.com/ant-design/ant-design/pull/47504 + marginInlineEnd: token.marginXS, paddingInline, fontSize: token.tagFontSize, lineHeight: token.tagLineHeight,