Skip to content

Comments

feat: ConfigProvider support classNames and styles for Empty#52208

Merged
zombieJ merged 4 commits intoant-design:featurefrom
thinkasany-forks:cp-empty
Jan 3, 2025
Merged

feat: ConfigProvider support classNames and styles for Empty#52208
zombieJ merged 4 commits intoant-design:featurefrom
thinkasany-forks:cp-empty

Conversation

@thinkasany
Copy link
Member

🤔 This is a ...

  • 🆕 New feature

📝 Change Log

Language Changelog
🇺🇸 English feat: ConfigProvider support classNames and styles for Empty
🇨🇳 Chinese feat: ConfigProvider 支持 Empty 的classNames 和 styles 配置

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2025

👁 Visual Regression Report for PR #52208 Failed ❌

🎯 Target branch: feature (b202873)
📖 View Full Report ↗︎

Expected (Branch feature) Actual (Current PR) Diff
button-color-variant.dark.png button-color-variant.dark.png button-color-variant.dark.css-var.png button-color-variant.dark.css-var.png
button-debug-color-variant.compact.png button-debug-color-variant.compact.png button-debug-color-variant.compact.css-var.png button-debug-color-variant.compact.css-var.png
button-debug-color-variant.dark.png button-debug-color-variant.dark.png button-debug-color-variant.dark.css-var.png button-debug-color-variant.dark.css-var.png
button-debug-color-variant.default.png button-debug-color-variant.default.png button-debug-color-variant.default.css-var.png button-debug-color-variant.default.css-var.png
checkbox-custom-line-width.compact.png checkbox-custom-line-width.compact.png checkbox-custom-line-width.compact.css-var.png checkbox-custom-line-width.compact.css-var.png
checkbox-custom-line-width.dark.png checkbox-custom-line-width.dark.png checkbox-custom-line-width.dark.css-var.png checkbox-custom-line-width.dark.css-var.png
checkbox-custom-line-width.default.png checkbox-custom-line-width.default.png checkbox-custom-line-width.default.css-var.png checkbox-custom-line-width.default.css-var.png
checkbox-debug-line.compact.png checkbox-debug-line.compact.png checkbox-debug-line.compact.css-var.png checkbox-debug-line.compact.css-var.png

Warning

There are more diffs not shown in the table. Please check the Full Report for details.


Important

There are 49 diffs found in this PR: 🔄 49 changed.
Please check all items:

  • Checked all diffs in the full report
  • Visual diff is acceptable

@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2025

Preview is ready

@petercat-assistant
Copy link

Walkthrough

This pull request introduces a new feature to the ConfigProvider component, allowing support for classNames and styles specifically for the Empty component. This enhancement provides developers with more flexibility in customizing the appearance of the Empty component.

Changes

File Summary
components/config-provider/context.ts Added EmptyConfig type to support classNames and styles for Empty.
components/config-provider/index.en-US.md, components/config-provider/index.zh-CN.md Updated documentation to reflect the new classNames and styles support for Empty.
components/config-provider/index.tsx Integrated EmptyConfig into the ConfigProvider.
components/empty/tests/index.test.tsx Added tests to verify custom classNames and styles for Empty.
components/empty/demo/_semantic.tsx Added a new demo showcasing semantic DOM usage with Empty.
components/empty/demo/customize.tsx Updated demo to use new styles prop for Empty.
components/empty/index.en-US.md, components/empty/index.zh-CN.md Added documentation for semantic DOM usage with Empty.
components/empty/index.tsx Enhanced Empty component to support classNames and styles, with deprecation warning for imageStyle.


// ============================= Warning ==============================
if (process.env.NODE_ENV !== 'production') {
const warning = devUseWarning('Slider');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The warning message uses devUseWarning('Slider'), which seems incorrect for the Empty component. It should be updated to reflect the correct component name to avoid confusion.

@thinkasany thinkasany mentioned this pull request Jan 2, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 2, 2025

Open in Stackblitz

More templates

npm i https://pkg.pr.new/ant-design/ant-design/antd@52208

commit: 0816dc8

@codecov
Copy link

codecov bot commented Jan 2, 2025

Bundle Report

Changes will increase total bundle size by 1.68kB (0.05%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.37MB 1.68kB (0.05%) ⬆️

@codecov
Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (5163516) to head (0816dc8).
Report is 2 commits behind head on feature.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #52208   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          763       763           
  Lines        13748     13754    +6     
  Branches      3592      3595    +3     
=========================================
+ Hits         13748     13754    +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

const locales = {
cn: {
root: '根元素',
icon: '图片元素',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

>
<div className={`${prefixCls}-image`} style={imageStyle}>
<div
className={classNames(`${prefixCls}-image`, empty?.classNames?.icon, emptyClassNames?.icon)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个看起来应该去 next,这样 -image 也能改成 -icon

@thinkasany thinkasany changed the base branch from feature to next January 2, 2025 10:42
]}
>
<Empty
image="https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用这个图,用默认的。

const locales = {
cn: {
root: '根元素',
icon: '图标元素',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

诶,等等。我发现我错了。这个是 Empty 不是 Result。默认的的确就是 image 不是 icon 的

@thinkasany thinkasany changed the base branch from next to feature January 3, 2025 02:26
@zombieJ zombieJ merged commit 9fcce8f into ant-design:feature Jan 3, 2025
37 checks passed
@zombieJ zombieJ mentioned this pull request Jan 6, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants