Skip to content

Commit fd16720

Browse files
authored
Merge branch 'feature' into feat/dialog_semantic
2 parents 16d21de + e6aaa1b commit fd16720

14 files changed

Lines changed: 1208 additions & 38 deletions

File tree

components/image/__tests__/__snapshots__/demo-semantic.test.tsx.snap

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ exports[`renders components/image/demo/_semantic.tsx correctly 1`] = `
5252
/>
5353
</div>
5454
<button
55-
class="ant-image-preview-close"
55+
class="ant-image-preview-close semantic-mark-popup-close"
5656
>
5757
<span
5858
aria-label="close"
@@ -1041,6 +1041,104 @@ exports[`renders components/image/demo/_semantic.tsx correctly 1`] = `
10411041
</div>
10421042
</div>
10431043
</li>
1044+
<li
1045+
class="acss-1ehfz5v"
1046+
>
1047+
<div
1048+
class="ant-flex css-var-test-id ant-flex-align-stretch ant-flex-gap-small ant-flex-vertical"
1049+
>
1050+
<div
1051+
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-justify-space-between ant-flex-gap-small"
1052+
>
1053+
<div
1054+
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
1055+
>
1056+
<h5
1057+
class="ant-typography css-var-test-id"
1058+
style="margin: 0px;"
1059+
>
1060+
popup.close
1061+
</h5>
1062+
<span
1063+
class="ant-tag ant-tag-filled ant-tag-blue css-var-test-id"
1064+
>
1065+
6.4.0
1066+
</span>
1067+
</div>
1068+
<div
1069+
class="ant-flex css-var-test-id ant-flex-align-center ant-flex-gap-small"
1070+
>
1071+
<button
1072+
aria-hidden="true"
1073+
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"
1074+
type="button"
1075+
>
1076+
<span
1077+
class="ant-btn-icon"
1078+
>
1079+
<span
1080+
aria-label="pushpin"
1081+
class="anticon anticon-pushpin"
1082+
role="img"
1083+
>
1084+
<svg
1085+
aria-hidden="true"
1086+
data-icon="pushpin"
1087+
fill="currentColor"
1088+
focusable="false"
1089+
height="1em"
1090+
viewBox="64 64 896 896"
1091+
width="1em"
1092+
>
1093+
<path
1094+
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"
1095+
/>
1096+
</svg>
1097+
</span>
1098+
</span>
1099+
</button>
1100+
<button
1101+
aria-hidden="true"
1102+
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"
1103+
type="button"
1104+
>
1105+
<span
1106+
class="ant-btn-icon"
1107+
>
1108+
<span
1109+
aria-label="info-circle"
1110+
class="anticon anticon-info-circle"
1111+
role="img"
1112+
>
1113+
<svg
1114+
aria-hidden="true"
1115+
data-icon="info-circle"
1116+
fill="currentColor"
1117+
focusable="false"
1118+
height="1em"
1119+
viewBox="64 64 896 896"
1120+
width="1em"
1121+
>
1122+
<path
1123+
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"
1124+
/>
1125+
<path
1126+
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"
1127+
/>
1128+
</svg>
1129+
</span>
1130+
</span>
1131+
</button>
1132+
</div>
1133+
</div>
1134+
<div
1135+
class="ant-typography css-var-test-id"
1136+
style="margin: 0px; font-size: 12px;"
1137+
>
1138+
预览关闭按钮元素,设置按钮的基础样式
1139+
</div>
1140+
</div>
1141+
</li>
10441142
</ul>
10451143
</div>
10461144
</div>

components/image/__tests__/semantic.test.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ describe('Image.Semantic', () => {
2525
body: 'preview-body',
2626
footer: 'preview-footer',
2727
actions: 'preview-actions',
28+
close: 'preview-close',
2829
};
2930
const previewStyles = {
3031
root: { color: 'rgb(255, 0, 0)' },
3132
mask: { color: 'rgb(0, 0, 255)' },
3233
body: { color: 'rgb(0, 255, 0)' },
3334
footer: { color: 'rgb(0, 0, 0)' },
3435
actions: { color: 'rgb(255, 255, 255)' },
36+
close: { color: 'rgb(1, 2, 3)' },
3537
};
3638

3739
render(
@@ -79,6 +81,9 @@ describe('Image.Semantic', () => {
7981
previewClassNames.actions,
8082
);
8183
expect(document.querySelector('.ant-image-preview-actions')).toHaveStyle(previewStyles.actions);
84+
85+
expect(document.querySelector('.ant-image-preview-close')).toHaveClass(previewClassNames.close);
86+
expect(document.querySelector('.ant-image-preview-close')).toHaveStyle(previewStyles.close);
8287
});
8388
it('support classNames and styles as functions', () => {
8489
render(

components/image/demo/_semantic.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
2+
import type { ImageProps as RcImageProps } from '@rc-component/image';
23
import { Flex, Image, theme } from 'antd';
34
import type { ImageProps } from 'antd';
4-
import type { ImageProps as RcImageProps } from '@rc-component/image';
55
import { createStaticStyles } from 'antd-style';
66
import { clsx } from 'clsx';
77

@@ -26,6 +26,7 @@ const locales = {
2626
'popup.body': '预览内容元素,设置flex布局、居中对齐和指针事件样式',
2727
'popup.footer': '预览页脚元素,设置绝对定位、居中布局和底部操作区域样式',
2828
'popup.actions': '预览操作组元素,设置flex布局、背景色、圆角和操作按钮样式',
29+
'popup.close': '预览关闭按钮元素,设置按钮的基础样式',
2930
},
3031
en: {
3132
root: 'Root element, sets relative positioning and inline-block layout styles',
@@ -42,6 +43,7 @@ const locales = {
4243
'Preview footer element, sets absolute positioning, center layout and bottom operation area styles',
4344
'popup.actions':
4445
'Preview actions group element, sets flex layout, background color, border radius and action button styles',
46+
'popup.close': 'Preview close button element, sets basic button styles',
4547
},
4648
};
4749
interface ImagePropsBlock extends Omit<ImageProps, 'classNames'> {
@@ -93,6 +95,7 @@ const App: React.FC = () => {
9395
{ name: 'popup.body', desc: locale['popup.body'] },
9496
{ name: 'popup.footer', desc: locale['popup.footer'] },
9597
{ name: 'popup.actions', desc: locale['popup.actions'] },
98+
{ name: 'popup.close', desc: locale['popup.close'], version: '6.4.0' },
9699
]}
97100
>
98101
<Block />

components/image/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export type ImageSemanticType = {
7777
body?: string;
7878
footer?: string;
7979
actions?: string;
80+
close?: string;
8081
};
8182
};
8283
styles?: {
@@ -92,6 +93,7 @@ export type ImageSemanticType = {
9293
body?: React.CSSProperties;
9394
footer?: React.CSSProperties;
9495
actions?: React.CSSProperties;
96+
close?: React.CSSProperties;
9597
};
9698
};
9799
};

0 commit comments

Comments
 (0)