mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-05 23:46:28 +08:00
chore: auto merge branches (#52609)
Some checks failed
Publish Any Commit / build (push) Has been cancelled
🔀 Sync mirror to Gitee / mirror (push) Has been cancelled
✅ test / lint (push) Has been cancelled
✅ test / test-react-legacy (16, 1/2) (push) Has been cancelled
✅ test / test-react-legacy (16, 2/2) (push) Has been cancelled
✅ test / test-react-legacy (17, 1/2) (push) Has been cancelled
✅ test / test-react-legacy (17, 2/2) (push) Has been cancelled
✅ test / test-node (push) Has been cancelled
✅ test / test-react-latest (dom, 1/2) (push) Has been cancelled
✅ test / test-react-latest (dom, 2/2) (push) Has been cancelled
✅ test / build (push) Has been cancelled
✅ test / test lib/es module (es, 1/2) (push) Has been cancelled
✅ test / test lib/es module (es, 2/2) (push) Has been cancelled
✅ test / test lib/es module (lib, 1/2) (push) Has been cancelled
✅ test / test lib/es module (lib, 2/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist, 1/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist, 2/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist-min, 1/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist-min, 2/2) (push) Has been cancelled
✅ test / test-coverage (push) Has been cancelled
Some checks failed
Publish Any Commit / build (push) Has been cancelled
🔀 Sync mirror to Gitee / mirror (push) Has been cancelled
✅ test / lint (push) Has been cancelled
✅ test / test-react-legacy (16, 1/2) (push) Has been cancelled
✅ test / test-react-legacy (16, 2/2) (push) Has been cancelled
✅ test / test-react-legacy (17, 1/2) (push) Has been cancelled
✅ test / test-react-legacy (17, 2/2) (push) Has been cancelled
✅ test / test-node (push) Has been cancelled
✅ test / test-react-latest (dom, 1/2) (push) Has been cancelled
✅ test / test-react-latest (dom, 2/2) (push) Has been cancelled
✅ test / build (push) Has been cancelled
✅ test / test lib/es module (es, 1/2) (push) Has been cancelled
✅ test / test lib/es module (es, 2/2) (push) Has been cancelled
✅ test / test lib/es module (lib, 1/2) (push) Has been cancelled
✅ test / test lib/es module (lib, 2/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist, 1/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist, 2/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist-min, 1/2) (push) Has been cancelled
✅ test / test-react-latest-dist (dist-min, 2/2) (push) Has been cancelled
✅ test / test-coverage (push) Has been cancelled
chore: sync master into feature
This commit is contained in:
commit
0a2a19f349
@ -15,6 +15,27 @@ tag: vVERSION
|
||||
|
||||
---
|
||||
|
||||
## 5.23.3
|
||||
|
||||
`2025-01-28`
|
||||
|
||||
Last version of the Dragon Year, Happy Chinese New Year! 🐲
|
||||
|
||||
- ⌨️ MISC: Add accessibility tests for all component demos to ensure compliance with accessibility standards. Optimize accessibility support for some components, improving compatibility with screen readers and keyboard operations. [#51372](https://github.com/ant-design/ant-design/pull/51372) [@aojunhao123](https://github.com/aojunhao123)
|
||||
- 🐞 MISC: Fix importing `antd/dist/reset.css` file issue. [#52559](https://github.com/ant-design/ant-design/pull/52559) [@CaptainVolcom](https://github.com/CaptainVolcom)
|
||||
- 🐞 Fix Button throwing error when `loading` is `null`. [#52508](https://github.com/ant-design/ant-design/pull/52508) [@li-jia-nan](https://github.com/li-jia-nan)
|
||||
- 🐞 Fix Table last row border color transition issue. [#52549](https://github.com/ant-design/ant-design/pull/52549) [@DDDDD12138](https://github.com/DDDDD12138)
|
||||
- 💄 Fix Cascader checkbox cursor style in disabled state. [#52539](https://github.com/ant-design/ant-design/pull/52539) [@aojunhao123](https://github.com/aojunhao123)
|
||||
- 💄 Fix ConfigProvider not correctly modifying icon style priority when StyleProvider configures `layer`. [#52533](https://github.com/ant-design/ant-design/pull/52533) [@zombieJ](https://github.com/zombieJ)
|
||||
- 🐞 Fix Layout sidebar toggle button style missing in non-cssVar mode. [#52537](https://github.com/ant-design/ant-design/pull/52537) [@afc163](https://github.com/afc163)
|
||||
- 🐞 Fix Tree checkbox cursor style in disabled state. [#52525](https://github.com/ant-design/ant-design/pull/52525) [@aojunhao123](https://github.com/aojunhao123)
|
||||
- notification
|
||||
- 🐞 Fix notification `useNotification` `closeIcon` configuration not working. [#52516](https://github.com/ant-design/ant-design/pull/52516) [@typenoob](https://github.com/typenoob)
|
||||
- 🐞 Fix notification component display flicker issue under App component. [#52499](https://github.com/ant-design/ant-design/pull/52499) [@afc163](https://github.com/afc163)
|
||||
- RTL
|
||||
- 🐞 Fix Splitter abnormal collapse behavior in RTL mode. [#52501](https://github.com/ant-design/ant-design/pull/52501) [@aojunhao123](https://github.com/aojunhao123)
|
||||
- 💄 Fix Spin style issue in RTL mode. [#52538](https://github.com/ant-design/ant-design/pull/52538) [@afc163](https://github.com/afc163)
|
||||
|
||||
## 5.23.2
|
||||
|
||||
`2025-01-20`
|
||||
|
@ -15,6 +15,27 @@ tag: vVERSION
|
||||
|
||||
---
|
||||
|
||||
## 5.23.3
|
||||
|
||||
`2025-01-28`
|
||||
|
||||
龙年最后一版,祝各位新春愉快!🐲
|
||||
|
||||
- ⌨️ MISC: 为所有组件的示例添加了可访问性测试,确保符合无障碍标准。并优化了部分组件的可访问性支持,改进了对屏幕阅读器和键盘操作的兼容性。[#51372](https://github.com/ant-design/ant-design/pull/51372) [@aojunhao123](https://github.com/aojunhao123)
|
||||
- 🐞 MISC: 修复导入 `antd/dist/reset.css` 文件的问题。[#52559](https://github.com/ant-design/ant-design/pull/52559) [@CaptainVolcom](https://github.com/CaptainVolcom)
|
||||
- 🐞 修复 Button `loading` 为 `null` 时抛错的问题。[#52508](https://github.com/ant-design/ant-design/pull/52508) [@li-jia-nan](https://github.com/li-jia-nan)
|
||||
- 🐞 修复 Table 最后一行边框颜色过渡问题。[#52549](https://github.com/ant-design/ant-design/pull/52549) [@DDDDD12138](https://github.com/DDDDD12138)
|
||||
- 💄 修复 Cascader 组件禁用状态下复选框的鼠标指针样式问题。[#52539](https://github.com/ant-design/ant-design/pull/52539) [@aojunhao123](https://github.com/aojunhao123)
|
||||
- 💄 修复 ConfigProvider 在 StyleProvider 配置 `layer` 时不会正确修改图标对应样式优先级的问题。[#52533](https://github.com/ant-design/ant-design/pull/52533) [@zombieJ](https://github.com/zombieJ)
|
||||
- 🐞 修复 Layout 切换侧边栏按钮在非 cssVar 模式下样式丢失的问题。. [#52537](https://github.com/ant-design/ant-design/pull/52537) [@afc163](https://github.com/afc163)
|
||||
- 🐞 修复 Tree 组件禁用状态下复选框的鼠标指针样式问题。[#52525](https://github.com/ant-design/ant-design/pull/52525) [@aojunhao123](https://github.com/aojunhao123)
|
||||
- notification
|
||||
- 🐞 修复 notification `useNotification` 中 `closeIcon` 配置无效的问题。[#52516](https://github.com/ant-design/ant-design/pull/52516) [@typenoob](https://github.com/typenoob)
|
||||
- 🐞 修复 notification 组件在 App 组件下的显示闪烁问题。[#52499](https://github.com/ant-design/ant-design/pull/52499) [@afc163](https://github.com/afc163)
|
||||
- RTL
|
||||
- 🐞 修复 Splitter 在 rtl 模式下折叠行为异常的问题。[#52501](https://github.com/ant-design/ant-design/pull/52501) [@aojunhao123](https://github.com/aojunhao123)
|
||||
- 💄 修复 Spin 在 rtl 模式下的样式问题。[#52538](https://github.com/ant-design/ant-design/pull/52538) [@afc163](https://github.com/afc163)
|
||||
|
||||
## 5.23.2
|
||||
|
||||
`2025-01-20`
|
||||
|
@ -4,7 +4,8 @@ import CSSMotion from 'rc-motion';
|
||||
import raf from 'rc-util/lib/raf';
|
||||
import { composeRef } from 'rc-util/lib/ref';
|
||||
|
||||
import { getReactRender, type UnmountType } from '../../config-provider/UnstableContext';
|
||||
import { getReactRender } from '../../config-provider/UnstableContext';
|
||||
import type { UnmountType } from '../../config-provider/UnstableContext';
|
||||
import { TARGET_CLS } from './interface';
|
||||
import type { ShowWaveEffect } from './interface';
|
||||
import { getTargetWaveColor } from './util';
|
||||
|
@ -1,5 +1,3 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
describe('affix demo a11y', () => {
|
||||
accessibilityDemoTest('affix');
|
||||
});
|
||||
accessibilityDemoTest('affix');
|
||||
|
@ -1,5 +1,3 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
describe('alert demo a11y', () => {
|
||||
accessibilityDemoTest('alert', { disabledRules: ['button-name'] });
|
||||
});
|
||||
accessibilityDemoTest('alert', { disabledRules: ['button-name'] });
|
||||
|
@ -1,5 +1,3 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
describe('anchor demo a11y', () => {
|
||||
accessibilityDemoTest('anchor');
|
||||
});
|
||||
accessibilityDemoTest('anchor');
|
||||
|
@ -1,5 +1,3 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
describe('app demo a11y', () => {
|
||||
accessibilityDemoTest('app');
|
||||
});
|
||||
accessibilityDemoTest('app');
|
||||
|
6
components/auto-complete/__tests__/a11y.test.ts
Normal file
6
components/auto-complete/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('auto-complete', {
|
||||
disabledRules: ['label'],
|
||||
skip: ['render-panel.tsx', 'custom.tsx'],
|
||||
});
|
@ -61,8 +61,10 @@ Common props ref:[Common props](/docs/react/common-props)
|
||||
| options | Select options. Will get better perf than jsx definition | { label, value }\[] | - | |
|
||||
| placeholder | The placeholder of input | string | - | |
|
||||
| status | Set validation status | 'error' \| 'warning' | - | 4.19.0 |
|
||||
| size | The size of the input box | `large` \| `middle` \| `small` | - | |
|
||||
| value | Selected option | string | - | |
|
||||
| variant | Variants of input | `outlined` \| `borderless` \| `filled` | `outlined` | 5.13.0 |
|
||||
| virtual | Disable virtual scroll when set to false | boolean | true | 4.1.0 |
|
||||
| onBlur | Called when leaving the component | function() | - | |
|
||||
| onChange | Called when selecting an option or changing an input value | function(value) | - | |
|
||||
| onDropdownVisibleChange | Call when dropdown open | function(open) | - | |
|
||||
@ -70,6 +72,8 @@ Common props ref:[Common props](/docs/react/common-props)
|
||||
| onSearch | Called when searching items | function(value) | - | |
|
||||
| onSelect | Called when a option is selected. param is option's value and option instance | function(value, option) | - | |
|
||||
| onClear | Called when clear | function | - | 4.6.0 |
|
||||
| onInputKeyDown | Called when key pressed | (event: KeyboardEvent) => void | - | |
|
||||
| onPopupScroll | Called when dropdown scrolls | (event: UIEvent) => void | - | |
|
||||
|
||||
## Methods
|
||||
|
||||
|
@ -62,8 +62,10 @@ demo:
|
||||
| options | 数据化配置选项内容,相比 jsx 定义会获得更好的渲染性能 | { label, value }\[] | - | |
|
||||
| placeholder | 输入框提示 | string | - | |
|
||||
| status | 设置校验状态 | 'error' \| 'warning' | - | 4.19.0 |
|
||||
| size | 控件大小 | `large` \| `middle` \| `small` | - | |
|
||||
| value | 指定当前选中的条目 | string | - | |
|
||||
| variant | 形态变体 | `outlined` \| `borderless` \| `filled` | `outlined` | 5.13.0 |
|
||||
| virtual | 设置 false 时关闭虚拟滚动 | boolean | true | 4.1.0 |
|
||||
| onBlur | 失去焦点时的回调 | function() | - | |
|
||||
| onChange | 选中 option,或 input 的 value 变化时,调用此函数 | function(value) | - | |
|
||||
| onDropdownVisibleChange | 展开下拉菜单的回调 | function(open) | - | |
|
||||
@ -71,6 +73,8 @@ demo:
|
||||
| onSearch | 搜索补全项的时候调用 | function(value) | - | |
|
||||
| onSelect | 被选中时调用,参数为选中项的 value 值 | function(value, option) | - | |
|
||||
| onClear | 清除内容时的回调 | function | - | 4.6.0 |
|
||||
| onInputKeyDown | 按键按下时回调 | (event: KeyboardEvent) => void | - | |
|
||||
| onPopupScroll | 下拉列表滚动时的回调 | (event: UIEvent) => void | - | |
|
||||
|
||||
## 方法
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
describe('avatar demo a11y', () => {
|
||||
accessibilityDemoTest('avatar', { disabledRules: ['image-alt'] });
|
||||
});
|
||||
accessibilityDemoTest('avatar', { disabledRules: ['image-alt'] });
|
||||
|
@ -1,5 +1,3 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
describe('back-top demo a11y', () => {
|
||||
accessibilityDemoTest('back-top');
|
||||
});
|
||||
accessibilityDemoTest('back-top');
|
||||
|
@ -1,5 +1,3 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
describe('badge demo a11y', () => {
|
||||
accessibilityDemoTest('badge', { disabledRules: ['button-name'] });
|
||||
});
|
||||
accessibilityDemoTest('badge', { disabledRules: ['button-name'] });
|
||||
|
@ -1,5 +1,3 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
describe('breadcrumb demo a11y', () => {
|
||||
accessibilityDemoTest('breadcrumb');
|
||||
});
|
||||
accessibilityDemoTest('breadcrumb');
|
||||
|
@ -1,5 +1,3 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
describe('button demo a11y', () => {
|
||||
accessibilityDemoTest('button');
|
||||
});
|
||||
accessibilityDemoTest('button');
|
||||
|
@ -24,18 +24,16 @@ const ButtonGroup: React.FC<ButtonGroupProps> = (props) => {
|
||||
|
||||
const [, , hashId] = useToken();
|
||||
|
||||
let sizeCls = '';
|
||||
|
||||
switch (size) {
|
||||
case 'large':
|
||||
sizeCls = 'lg';
|
||||
break;
|
||||
case 'small':
|
||||
sizeCls = 'sm';
|
||||
break;
|
||||
default:
|
||||
// Do nothing
|
||||
}
|
||||
const sizeCls = React.useMemo<string>(() => {
|
||||
switch (size) {
|
||||
case 'large':
|
||||
return 'lg';
|
||||
case 'small':
|
||||
return 'sm';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
}, [size]);
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warning = devUseWarning('Button.Group');
|
||||
|
8
components/calendar/__tests__/a11y.test.ts
Normal file
8
components/calendar/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('calendar', {
|
||||
// waiting for rc-picker fix
|
||||
skip: ['week.tsx'],
|
||||
// fix in another pr
|
||||
disabledRules: ['label'],
|
||||
});
|
6
components/card/__tests__/a11y.test.ts
Normal file
6
components/card/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('card', {
|
||||
disabledRules: ['button-name', 'image-alt'],
|
||||
skip: ['tabs.tsx'],
|
||||
});
|
3
components/carousel/__tests__/a11y.test.ts
Normal file
3
components/carousel/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('carousel');
|
6
components/checkbox/__tests__/a11y.test.ts
Normal file
6
components/checkbox/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('checkbox', {
|
||||
// skip debug demo
|
||||
skip: ['custom-line-width.tsx', 'disabled.tsx'],
|
||||
});
|
@ -1,5 +1,5 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
describe('collapse demo a11y', () => {
|
||||
accessibilityDemoTest('collapse', { skip: ['extra.tsx'] });
|
||||
accessibilityDemoTest('collapse', {
|
||||
skip: ['extra.tsx'],
|
||||
});
|
||||
|
@ -1,4 +1,5 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
// skip _InternalPanelDoNotUseOrYouWillBeFired
|
||||
accessibilityDemoTest('color-picker', { skip: ['pure-panel.tsx'] });
|
||||
accessibilityDemoTest('color-picker', {
|
||||
skip: ['pure-panel.tsx'],
|
||||
});
|
||||
|
6
components/flex/__tests__/a11y.test.ts
Normal file
6
components/flex/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('flex', {
|
||||
// waiting for rc-segmented fix
|
||||
skip: ['align.tsx'],
|
||||
});
|
6
components/grid/__tests__/a11y.test.ts
Normal file
6
components/grid/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('grid', {
|
||||
// waiting for slider fix
|
||||
skip: ['playground.tsx'],
|
||||
});
|
@ -54,7 +54,7 @@ Common props ref:[Common props](/docs/react/common-props)
|
||||
| addonAfter | The label text displayed after (on the right side of) the input field | ReactNode | - | |
|
||||
| addonBefore | The label text displayed before (on the left side of) the input field | ReactNode | - | |
|
||||
| allowClear | If allow to remove input content with clear icon | boolean \| { clearIcon: ReactNode } | false | |
|
||||
| ~~bordered~~ | Whether has border style | boolean | true | 4.5.0 |
|
||||
| ~~bordered~~ | Whether has border style, please use `variant` instead | boolean | true | 4.5.0 |
|
||||
| classNames | Semantic DOM class | Record<[SemanticDOM](#input-1), string> | - | 5.4.0 |
|
||||
| count | Character count config | [CountConfig](#countconfig) | - | 5.10.0 |
|
||||
| defaultValue | The initial input content | string | - | |
|
||||
|
@ -55,7 +55,7 @@ demo:
|
||||
| addonAfter | 带标签的 input,设置后置标签 | ReactNode | - | |
|
||||
| addonBefore | 带标签的 input,设置前置标签 | ReactNode | - | |
|
||||
| allowClear | 可以点击清除图标删除内容 | boolean \| { clearIcon: ReactNode } | - | |
|
||||
| ~~bordered~~ | 是否有边框 | boolean | true | 4.5.0 |
|
||||
| ~~bordered~~ | 是否有边框, 请使用 `variant` 替换 | boolean | true | 4.5.0 |
|
||||
| classNames | 语义化结构 class | Record<[SemanticDOM](#input-1), string> | - | 5.4.0 |
|
||||
| count | 字符计数配置 | [CountConfig](#countconfig) | - | 5.10.0 |
|
||||
| defaultValue | 输入框默认内容 | string | - | |
|
||||
|
8
components/list/__tests__/a11y.test.ts
Normal file
8
components/list/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('list', {
|
||||
// waiting for fix
|
||||
skip: ['infinite-load.tsx'],
|
||||
// we can set alt for img in list demo
|
||||
disabledRules: ['image-alt'],
|
||||
});
|
6
components/pagination/__tests__/a11y.test.ts
Normal file
6
components/pagination/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('pagination', {
|
||||
// waiting for rc-pagination fix
|
||||
skip: ['simple.tsx'],
|
||||
});
|
5
components/popover/__tests__/a11y.test.ts
Normal file
5
components/popover/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('popover', {
|
||||
skip: ['arrow.tsx'],
|
||||
});
|
8
components/progress/__tests__/a11y.test.ts
Normal file
8
components/progress/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('progress', {
|
||||
// we can set aria attribute to fix it
|
||||
disabledRules: ['aria-progressbar-name'],
|
||||
// we can set aria attribute to fix it
|
||||
skip: ['circle-steps.tsx'],
|
||||
});
|
8
components/qr-code/__tests__/a11y.test.ts
Normal file
8
components/qr-code/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('qr-code', {
|
||||
// we can add aria attributes to fix it
|
||||
disabledRules: ['role-img-alt', 'svg-img-alt'],
|
||||
// waiting for rc-segmented fix
|
||||
skip: ['errorlevel.tsx', 'download.tsx'],
|
||||
});
|
@ -1,4 +1,4 @@
|
||||
import React, { useContext, type AriaAttributes } from 'react';
|
||||
import React, { useContext } from 'react';
|
||||
import { QRCodeCanvas, QRCodeSVG } from '@rc-component/qrcode';
|
||||
import classNames from 'classnames';
|
||||
import omit from 'rc-util/lib/omit';
|
||||
@ -50,9 +50,10 @@ const QRCode: React.FC<QRCodeProps> = (props) => {
|
||||
};
|
||||
|
||||
const a11yProps = pickAttrs(rest, true);
|
||||
const restProps = omit<React.HTMLAttributes<HTMLDivElement>, keyof AriaAttributes>(
|
||||
|
||||
const restProps = omit<React.HTMLAttributes<HTMLDivElement>, keyof React.AriaAttributes>(
|
||||
rest,
|
||||
Object.keys(a11yProps) as Array<keyof AriaAttributes>,
|
||||
Object.keys(a11yProps) as (keyof React.AriaAttributes)[],
|
||||
);
|
||||
|
||||
const qrCodeProps = {
|
||||
|
6
components/rate/__tests__/a11y.test.ts
Normal file
6
components/rate/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('rate', {
|
||||
// waiting for rc-rate fix
|
||||
disabledRules: ['listitem'],
|
||||
});
|
8
components/segmented/__tests__/a11y.test.ts
Normal file
8
components/segmented/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('segmented', {
|
||||
// we can add aria attributes to fix it
|
||||
skip: ['custom.tsx', 'size-consistent.tsx'],
|
||||
// waiting for rc-segmented fix
|
||||
disabledRules: ['aria-allowed-attr'],
|
||||
});
|
8
components/skeleton/__tests__/a11y.test.ts
Normal file
8
components/skeleton/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,8 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('skeleton', {
|
||||
// waiting for fix
|
||||
disabledRules: ['empty-heading'],
|
||||
// we can set aria attribute to fix it
|
||||
skip: ['list.tsx', 'element.tsx'],
|
||||
});
|
6
components/slider/__tests__/a11y.test.ts
Normal file
6
components/slider/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('slider', {
|
||||
// we can set aria attribute to fix it
|
||||
disabledRules: ['aria-input-field-name', 'label', 'button-name'],
|
||||
});
|
@ -86,6 +86,13 @@ export interface SliderBaseProps {
|
||||
getTooltipPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
||||
/** @deprecated `tooltipPlacement` is deprecated. Please use `tooltip.placement` instead. */
|
||||
tooltipPlacement?: TooltipPlacement;
|
||||
|
||||
// Accessibility
|
||||
tabIndex?: SliderProps['tabIndex'];
|
||||
ariaLabelForHandle?: SliderProps['ariaLabelForHandle'];
|
||||
ariaLabelledByForHandle?: SliderProps['ariaLabelledByForHandle'];
|
||||
ariaRequired?: SliderProps['ariaRequired'];
|
||||
ariaValueTextFormatterForHandle?: SliderProps['ariaValueTextFormatterForHandle'];
|
||||
}
|
||||
|
||||
export interface SliderSingleProps extends SliderBaseProps {
|
||||
|
@ -43,9 +43,12 @@ export const useCompactItemContext = (prefixCls: string, direction: DirectionTyp
|
||||
};
|
||||
};
|
||||
|
||||
export const NoCompactStyle: React.FC<React.PropsWithChildren<unknown>> = ({ children }) => (
|
||||
<SpaceCompactItemContext.Provider value={null}>{children}</SpaceCompactItemContext.Provider>
|
||||
);
|
||||
export const NoCompactStyle: React.FC<Readonly<React.PropsWithChildren>> = (props) => {
|
||||
const { children } = props;
|
||||
return (
|
||||
<SpaceCompactItemContext.Provider value={null}>{children}</SpaceCompactItemContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export interface SpaceCompactProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
prefixCls?: string;
|
||||
@ -55,12 +58,16 @@ export interface SpaceCompactProps extends React.HTMLAttributes<HTMLDivElement>
|
||||
rootClassName?: string;
|
||||
}
|
||||
|
||||
const CompactItem: React.FC<React.PropsWithChildren<SpaceCompactItemContextType>> = ({
|
||||
children,
|
||||
...otherProps
|
||||
}) => (
|
||||
<SpaceCompactItemContext.Provider value={otherProps}>{children}</SpaceCompactItemContext.Provider>
|
||||
);
|
||||
const CompactItem: React.FC<React.PropsWithChildren<SpaceCompactItemContextType>> = (props) => {
|
||||
const { children, ...others } = props;
|
||||
return (
|
||||
<SpaceCompactItemContext.Provider
|
||||
value={React.useMemo<SpaceCompactItemContextType>(() => others, [others])}
|
||||
>
|
||||
{children}
|
||||
</SpaceCompactItemContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
const Compact: React.FC<SpaceCompactProps> = (props) => {
|
||||
const { getPrefixCls, direction: directionConfig } = React.useContext(ConfigContext);
|
||||
@ -95,6 +102,7 @@ const Compact: React.FC<SpaceCompactProps> = (props) => {
|
||||
const compactItemContext = React.useContext(SpaceCompactItemContext);
|
||||
|
||||
const childNodes = toArray(children);
|
||||
|
||||
const nodes = React.useMemo(
|
||||
() =>
|
||||
childNodes.map((child, i) => {
|
||||
|
6
components/statistic/__tests__/a11y.test.ts
Normal file
6
components/statistic/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('statistic', {
|
||||
// wait for skeleton fix
|
||||
skip: ['basic.tsx'],
|
||||
});
|
6
components/steps/__tests__/a11y.test.ts
Normal file
6
components/steps/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('steps', {
|
||||
// we can set aria attribute to fix it
|
||||
skip: ['inline.tsx', 'label-placement.tsx', 'progress.tsx'],
|
||||
});
|
@ -1,3 +1,5 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('switch', { disabledRules: ['button-name'] });
|
||||
accessibilityDemoTest('switch', {
|
||||
disabledRules: ['button-name'],
|
||||
});
|
||||
|
5
components/tooltip/__tests__/a11y.test.ts
Normal file
5
components/tooltip/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('tooltip', {
|
||||
skip: ['arrow.tsx', 'disabled-children.tsx'],
|
||||
});
|
11
components/tree/__tests__/a11y.test.ts
Normal file
11
components/tree/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('tree', {
|
||||
skip: [
|
||||
// Skip large data demos to prevent test timeout
|
||||
'virtual-scroll.tsx',
|
||||
'big-data.tsx',
|
||||
// we can set aria attributes to fix it
|
||||
'line.tsx',
|
||||
],
|
||||
});
|
6
components/upload/__tests__/a11y.test.ts
Normal file
6
components/upload/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('upload', {
|
||||
// Skip due to external dependency issue
|
||||
skip: ['drag-sorting.tsx'],
|
||||
});
|
6
components/watermark/__tests__/a11y.test.ts
Normal file
6
components/watermark/__tests__/a11y.test.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import accessibilityDemoTest from '../../../tests/shared/accessibilityTest';
|
||||
|
||||
accessibilityDemoTest('watermark', {
|
||||
// we can add aria attributes to fix it
|
||||
skip: ['custom.tsx'],
|
||||
});
|
12
package.json
12
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "antd",
|
||||
"version": "5.23.2",
|
||||
"version": "5.23.3",
|
||||
"description": "An enterprise-class UI design language and React components implementation",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@ -26,7 +26,7 @@
|
||||
"react-component",
|
||||
"ui"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"sideEffects": ["*.css"],
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"unpkg": "dist/antd.min.js",
|
||||
@ -161,7 +161,7 @@
|
||||
"@ant-design/happy-work-theme": "^1.0.0",
|
||||
"@ant-design/tools": "^18.0.3",
|
||||
"@ant-design/v5-patch-for-react-19": "^1.0.2",
|
||||
"@antfu/eslint-config": "^3.11.2",
|
||||
"@antfu/eslint-config": "^4.0.0",
|
||||
"@antv/g6": "^4.8.24",
|
||||
"@biomejs/biome": "^1.9.4",
|
||||
"@codecov/webpack-plugin": "^1.4.0",
|
||||
@ -348,11 +348,5 @@
|
||||
"title": "Ant Design",
|
||||
"tnpm": {
|
||||
"mode": "npm"
|
||||
},
|
||||
"overrides": {
|
||||
"react-intl": "7.0.4"
|
||||
},
|
||||
"resolutions": {
|
||||
"react-intl": "7.0.4"
|
||||
}
|
||||
}
|
||||
|
@ -112,7 +112,15 @@ export function accessibilityTest(Component: React.ComponentType, disabledRules?
|
||||
}
|
||||
|
||||
type Options = {
|
||||
/**
|
||||
* skip test
|
||||
* @default false
|
||||
*/
|
||||
skip?: boolean | string[];
|
||||
/**
|
||||
* Disable axe rule checks
|
||||
* @default []
|
||||
*/
|
||||
disabledRules?: string[];
|
||||
};
|
||||
|
||||
|
@ -62,6 +62,7 @@ function addPluginsForProduction(config) {
|
||||
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
|
||||
bundleName: 'antd.min',
|
||||
uploadToken: process.env.CODECOV_TOKEN,
|
||||
gitService: "github",
|
||||
}),
|
||||
new CircularDependencyPlugin({
|
||||
failOnError: true,
|
||||
|
Loading…
Reference in New Issue
Block a user