(
+ (acc, direction) => ({ ...acc, [direction]: operationsSlot[direction] }),
{},
);
}, [position]);
@@ -44,13 +45,7 @@ const App: React.FC = () => {
You can also specify its direction or both side
- {
- setPosition(value as PositionType[]);
- }}
- />
+ options={options} value={position} onChange={setPosition} />
diff --git a/components/tag/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/tag/__tests__/__snapshots__/demo-extend.test.ts.snap
index dad0cd785b..4ec5f350fa 100644
--- a/components/tag/__tests__/__snapshots__/demo-extend.test.ts.snap
+++ b/components/tag/__tests__/__snapshots__/demo-extend.test.ts.snap
@@ -1266,8 +1266,7 @@ Array [
/>
,
,
,
,
{
return (
<>
Tag with icon
-
+
} color="#55acee">
Twitter
@@ -34,7 +34,7 @@ const App: React.FC = () => {
CheckableTag with icon
-
+
}
checked={checked[0]}
diff --git a/components/theme/interface/maps/colors.ts b/components/theme/interface/maps/colors.ts
index fe3d1b1480..520405ebe5 100644
--- a/components/theme/interface/maps/colors.ts
+++ b/components/theme/interface/maps/colors.ts
@@ -626,8 +626,8 @@ export interface ColorMapToken
/**
* @nameZH 浮层的背景蒙层颜色
* @nameEN Background color of the mask
- * @desc 浮层的背景蒙层颜色,用于遮罩浮层下面的内容,Modal、Drawer 等组件的蒙层使用的是该 token
- * @descEN The background color of the mask, used to cover the content below the mask, Modal, Drawer and other components use this token
+ * @desc 浮层的背景蒙层颜色,用于遮罩浮层下面的内容,Modal、Drawer、Image 等组件的蒙层使用的是该 token
+ * @descEN The background color of the mask, used to cover the content below the mask, Modal, Drawer, Image and other components use this token
*/
colorBgMask: string;
diff --git a/components/time-picker/index.en-US.md b/components/time-picker/index.en-US.md
index 20544a4b6a..1792778ca3 100644
--- a/components/time-picker/index.en-US.md
+++ b/components/time-picker/index.en-US.md
@@ -52,7 +52,6 @@ dayjs.extend(customParseFormat)
| Property | Description | Type | Default | Version |
| --- | --- | --- | --- | --- |
| allowClear | Customize clear icon | boolean \| { clearIcon?: ReactNode } | true | 5.8.0: Support object type |
-| autoFocus | If get focus when component mounted | boolean | false | |
| cellRender | Custom rendering function for picker cells | (current: number, info: { originNode: React.ReactElement, today: dayjs, range?: 'start' \| 'end', subType: 'hour' \| 'minute' \| 'second' \| 'meridiem' }) => React.ReactNode | - | 5.4.0 |
| changeOnScroll | Trigger selection when scroll the column | boolean | false | 5.14.0 |
| className | The className of picker | string | - | |
diff --git a/components/time-picker/index.zh-CN.md b/components/time-picker/index.zh-CN.md
index 9364bacad0..d562606272 100644
--- a/components/time-picker/index.zh-CN.md
+++ b/components/time-picker/index.zh-CN.md
@@ -52,7 +52,6 @@ dayjs.extend(customParseFormat)
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| allowClear | 自定义清除按钮 | boolean \| { clearIcon?: ReactNode } | true | 5.8.0: 支持对象类型 |
-| autoFocus | 自动获取焦点 | boolean | false | |
| cellRender | 自定义单元格的内容 | (current: number, info: { originNode: React.ReactNode, today: dayjs, range?: 'start' \| 'end', subType: 'hour' \| 'minute' \| 'second' \| 'meridiem' }) => React.ReactNode | - | 5.4.0 |
| changeOnScroll | 在滚动时改变选择值 | boolean | false | 5.14.0 |
| className | 选择器类名 | string | - | |
diff --git a/docs/react/common-props.en-US.md b/docs/react/common-props.en-US.md
index 340f9ae27f..93502371a8 100644
--- a/docs/react/common-props.en-US.md
+++ b/docs/react/common-props.en-US.md
@@ -7,8 +7,9 @@ title: Common Props
> Tips: The following generic properties apply to most antd components; those not supported are described separately.
-| Property | Description | Type | Default |
-| ------------- | ----------------------------- | ------------- | ------- |
-| style | The additional style | CSSProperties | - |
-| className | The additional css class | string | - |
-| rootClassName | ClassName on the root element | string | - |
+| Property | Description | Type | Default |
+| --- | --- | --- | --- |
+| style | The additional style | CSSProperties | - |
+| className | The additional css class | string | - |
+| rootClassName | ClassName on the root element | string | - |
+| autoFocus | Auto focus when component mounted, only effective for focusable elements like forms, links, etc. | boolean | false |
diff --git a/docs/react/common-props.zh-CN.md b/docs/react/common-props.zh-CN.md
index 24a5042b1e..70a2128d35 100644
--- a/docs/react/common-props.zh-CN.md
+++ b/docs/react/common-props.zh-CN.md
@@ -7,8 +7,9 @@ title: 通用属性
> Tips: 以下通用属性适用于 antd 大部分组件,不支持的组件会单独说明。
-| 参数 | 说明 | 类型 | 默认值 |
-| ------------- | ---------------------------- | ------------- | ------ |
-| style | 自定义样式 | CSSProperties | - |
-| className | 自定义类名 | string | - |
-| rootClassName | 添加在组件最外层的 className | string | - |
+| 参数 | 说明 | 类型 | 默认值 |
+| --- | --- | --- | --- |
+| style | 自定义样式 | CSSProperties | - |
+| className | 自定义类名 | string | - |
+| rootClassName | 添加在组件最外层的 className | string | - |
+| autoFocus | 自动获取焦点,仅对表单类、链接、交互容器等可聚焦元素生效 | boolean | false |
diff --git a/package.json b/package.json
index 49ec9549f4..d299558881 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "antd",
- "version": "6.0.0",
+ "version": "6.0.1",
"description": "An enterprise-class UI design language and React components implementation",
"license": "MIT",
"funding": {
@@ -115,33 +115,34 @@
"@ant-design/fast-color": "^3.0.0",
"@ant-design/icons": "^6.1.0",
"@ant-design/react-slick": "~1.1.2",
+ "@babel/runtime": "^7.28.4",
"@rc-component/cascader": "~1.8.0",
- "@rc-component/checkbox": "~1.0.0",
- "@rc-component/collapse": "~1.1.1",
- "@rc-component/color-picker": "~3.0.2",
- "@rc-component/dialog": "~1.5.0",
+ "@rc-component/checkbox": "~1.0.1",
+ "@rc-component/collapse": "~1.1.2",
+ "@rc-component/color-picker": "~3.0.3",
+ "@rc-component/dialog": "~1.5.1",
"@rc-component/drawer": "~1.3.0",
- "@rc-component/dropdown": "~1.0.0",
+ "@rc-component/dropdown": "~1.0.2",
"@rc-component/form": "~1.4.0",
- "@rc-component/image": "~1.5.1",
+ "@rc-component/image": "~1.5.2",
"@rc-component/input": "~1.1.2",
"@rc-component/input-number": "~1.6.2",
"@rc-component/mentions": "~1.5.5",
"@rc-component/menu": "~1.1.5",
- "@rc-component/motion": "~1.1.4",
- "@rc-component/mutate-observer": "^2.0.0",
+ "@rc-component/motion": "~1.1.5",
+ "@rc-component/mutate-observer": "^2.0.1",
"@rc-component/notification": "~1.2.0",
"@rc-component/pagination": "~1.2.0",
"@rc-component/picker": "~1.7.1",
- "@rc-component/progress": "~1.0.1",
- "@rc-component/qrcode": "~1.1.0",
- "@rc-component/rate": "~1.0.0",
+ "@rc-component/progress": "~1.0.2",
+ "@rc-component/qrcode": "~1.1.1",
+ "@rc-component/rate": "~1.0.1",
"@rc-component/resize-observer": "^1.0.1",
"@rc-component/segmented": "~1.2.3",
- "@rc-component/select": "~1.2.3",
- "@rc-component/slider": "~1.0.0",
+ "@rc-component/select": "~1.2.4",
+ "@rc-component/slider": "~1.0.1",
"@rc-component/steps": "~1.2.2",
- "@rc-component/switch": "~1.0.2",
+ "@rc-component/switch": "~1.0.3",
"@rc-component/table": "~1.8.2",
"@rc-component/tabs": "~1.6.0",
"@rc-component/textarea": "~1.1.2",
@@ -164,7 +165,7 @@
"@ant-design/x": "^1.6.1",
"@antfu/eslint-config": "^6.0.0",
"@antv/g6": "^4.8.25",
- "@biomejs/biome": "^2.2.5",
+ "@biomejs/biome": "^2.3.8",
"@blazediff/core": "^1.4.0",
"@codecov/webpack-plugin": "^1.9.1",
"@codesandbox/sandpack-react": "^2.20.0",
@@ -184,7 +185,7 @@
"@octokit/rest": "^22.0.0",
"@prettier/sync": "^0.6.1",
"@qixian.cs/github-contributors-list": "^2.0.2",
- "@size-limit/file": "^11.2.0",
+ "@size-limit/file": "^12.0.0",
"@stackblitz/sdk": "^1.11.0",
"@testing-library/dom": "^10.4.1",
"@testing-library/jest-dom": "^6.9.1",
@@ -316,7 +317,7 @@
"semver": "^7.7.2",
"sharp": "^0.34.4",
"simple-git": "^3.28.0",
- "size-limit": "^11.2.0",
+ "size-limit": "^12.0.0",
"spinnies": "^0.5.1",
"swr": "^2.3.6",
"tar": "^7.5.1",
diff --git a/scripts/generate-authors.ts b/scripts/generate-authors.ts
index 89d6c39963..e34b40d494 100644
--- a/scripts/generate-authors.ts
+++ b/scripts/generate-authors.ts
@@ -22,6 +22,7 @@ const excludes = [
'renovate[bot]',
'dependabot',
'dependabot[bot]',
+ 'gemini-code-assist[bot]',
];
async function execute() {
diff --git a/scripts/visual-regression/reportAdapter.ts b/scripts/visual-regression/reportAdapter.ts
index ce19d0d6af..b92b097229 100644
--- a/scripts/visual-regression/reportAdapter.ts
+++ b/scripts/visual-regression/reportAdapter.ts
@@ -15,7 +15,7 @@ const REPORT_DIR = path.join(ROOT, 'visualRegressionReport');
const components = fg
.sync('components/*/index.ts[x]', { cwd: ROOT })
- .reduce((acc, file) => {
+ .reduce((acc, file) => {
const basePath = path.dirname(file);
if (
[
@@ -26,9 +26,8 @@ const components = fg
) {
acc.push(path.basename(basePath));
}
-
return acc;
- }, [] as string[])
+ }, [])
.sort((a, b) => b.length - a.length);
const processedComponents = new Set();
diff --git a/tests/__mocks__/rc-util/lib/Portal.tsx b/tests/__mocks__/rc-util/lib/Portal.tsx
index e1e98cae59..7999181e17 100644
--- a/tests/__mocks__/rc-util/lib/Portal.tsx
+++ b/tests/__mocks__/rc-util/lib/Portal.tsx
@@ -2,8 +2,9 @@ import React from 'react';
import type { PortalProps, PortalRef } from '@rc-component/util/lib/Portal';
import { TriggerMockContext } from '../../../shared/demoTestContext';
-let OriginPortal = jest.requireActual('@rc-component/util/lib/Portal');
-OriginPortal = OriginPortal.default ?? OriginPortal;
+const OriginPortalModule = jest.requireActual('@rc-component/util/lib/Portal');
+
+const OriginPortal = OriginPortalModule.default ?? OriginPortalModule;
class MockPortal extends React.Component {
container: boolean | undefined;
@@ -28,7 +29,7 @@ class MockPortal extends React.Component {
}
}
-const CustomPortal = React.forwardRef(
+const CustomPortal = React.forwardRef>(
(props, ref) => {
const context = React.useContext(TriggerMockContext);
if (context?.mock === false) {
diff --git a/tests/shared/accessibilityTest.tsx b/tests/shared/accessibilityTest.tsx
index 78bf39feb4..0ccf6d3acd 100644
--- a/tests/shared/accessibilityTest.tsx
+++ b/tests/shared/accessibilityTest.tsx
@@ -49,18 +49,15 @@ type Rules = {
};
};
-const convertRulesToAxeFormat = (rules: string[]): Rules => {
- return rules.reduce(
- (acc, rule) => ({
- ...acc,
- [rule]: { enabled: false },
- }),
- {},
- );
+const convertRulesToAxeFormat = (rules: string[]) => {
+ return rules.reduce((acc, rule) => ({ ...acc, [rule]: { enabled: false } }), {});
};
// eslint-disable-next-line jest/no-export
-export function accessibilityTest(Component: React.ComponentType, disabledRules?: string[]) {
+export const accessibilityTest = (
+ Component: React.ComponentType,
+ disabledRules?: string[],
+) => {
beforeAll(() => {
// Fake ResizeObserver
global.ResizeObserver = jest.fn(() => {
@@ -109,7 +106,7 @@ export function accessibilityTest(Component: React.ComponentType, disabledRules?
expect(results).toHaveNoViolations();
}, 50000);
});
-}
+};
type Options = {
/**
@@ -146,7 +143,7 @@ export default function accessibilityDemoTest(component: string, options: Option
const testMethod = shouldSkip ? describe.skip : describe;
testMethod(`Test ${file} accessibility`, () => {
- const Demo = require(`../../${file}`).default;
+ const Demo: React.ComponentType = require(`../../${file}`).default;
accessibilityTest(Demo, options.disabledRules);
});
});