Skip to content

Conversation

thinkasany
Copy link
Member

🤔 This is a ...

  • 🆕 New feature

📝 Change Log

Language Changelog
🇺🇸 English feat: ConfigProvider support classnames and styles for Alert
🇨🇳 Chinese feat: ConfigProvider 支持 Alert 的classnames and styles

Copy link

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

Copy link
Contributor

github-actions bot commented Feb 6, 2025

Preview is ready

Copy link
Contributor

github-actions bot commented Feb 6, 2025

👁 Visual Regression Report for PR #52669 Failed ❌

🎯 Target branch: next (26234bc)
📖 View Full Report ↗︎
📊 Summary: 🔄 131 changed

Expected (Branch next) Actual (Current PR) Diff
card-component-token.compact.png card-component-token.compact.png card-component-token.compact.png card-component-token.compact.png
card-component-token.compact.png card-component-token.compact.png card-component-token.compact.css-var.png card-component-token.compact.css-var.png
card-component-token.dark.png card-component-token.dark.png card-component-token.dark.png card-component-token.dark.png
card-component-token.dark.png card-component-token.dark.png card-component-token.dark.css-var.png card-component-token.dark.css-var.png
card-component-token.default.png card-component-token.default.png card-component-token.default.png card-component-token.default.png
card-component-token.default.png card-component-token.default.png card-component-token.default.css-var.png card-component-token.default.css-var.png
card-tabs.compact.png card-tabs.compact.png card-tabs.compact.png card-tabs.compact.png
card-tabs.compact.png card-tabs.compact.png card-tabs.compact.css-var.png card-tabs.compact.css-var.png

Warning

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


Important

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

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

Copy link

  • Walkthrough: This PR introduces a new feature allowing ConfigProvider to support custom class names and styles for the Alert component. It enhances the flexibility of styling alerts by adding classNames and styles properties.
  • Changes:
    File Summary
    components/alert/Alert.tsx Added classNames and styles properties to AlertProps and updated the rendering logic to apply these styles.
    components/alert/tests/index.test.tsx Added tests to verify the application of custom styles and class names.
    components/alert/demo/_semantic.tsx Added a new demo file showcasing the semantic DOM structure of the Alert component.
    components/alert/index.en-US.md, components/alert/index.zh-CN.md Updated documentation to include information about the semantic DOM.
    components/config-provider/context.ts Extended AlertConfig to include classNames and styles.

@@ -20,6 +20,7 @@ export interface AlertRef {
nativeElement: HTMLDivElement;
}

type SemanticName = 'root' | 'icon' | 'content' | 'message' | 'description' | 'action';

Choose a reason for hiding this comment

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

The introduction of SemanticName type is a good addition for better type safety and clarity when dealing with class names and styles.

Copy link
Member

Choose a reason for hiding this comment

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

v6 里正好可以改成 title 了

Copy link
Contributor

github-actions bot commented Feb 6, 2025

size-limit report 📦

Path Size
dist/antd.min.js 499.66 KB (+219 B 🔺)
dist/antd-with-locales.min.js 568.3 KB (+261 B 🔺)

Copy link

codecov bot commented Feb 6, 2025

Bundle Report

Changes will increase total bundle size by 7.88MB (211.36%) ⬆️⚠️, exceeding the configured threshold of 5%.

Bundle name Size Change
antd.min-array-push 11.6MB 7.88MB (211.36%) ⬆️⚠️

Affected Assets, Files, and Routes:

view changes for bundle: antd.min-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
antd-with-locales.js (New) 6.05MB 6.05MB 100.0% 🚀
antd.js (New) 5.55MB 5.55MB 100.0% 🚀
antd-with-locales.min.js (Deleted) -2.01MB 0 bytes -100.0% 🗑️
antd.min.js (Deleted) -1.71MB 0 bytes -100.0% 🗑️

Files in antd-with-locales.js:

  • ./components/config-provider/context.ts → Total Size: 1.51kB

Files in antd.js:

  • ./components/config-provider/context.ts → Total Size: 1.51kB

Copy link

cloudflare-workers-and-pages bot commented Feb 6, 2025

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2748468
Status:⚡️  Build in progress...

View logs

Copy link

pkg-pr-new bot commented Feb 7, 2025

Copy link

codecov bot commented Feb 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (b9e3fb8) to head (2748468).
Report is 3 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff            @@
##              next    #52669   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          765       765           
  Lines        13738     13745    +7     
  Branches      3578      3583    +5     
=========================================
+ Hits         13738     13745    +7     

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

@thinkasany thinkasany merged commit fc97a4d into next Feb 7, 2025
39 of 41 checks passed
@thinkasany thinkasany deleted the cp-alert branch February 7, 2025 09:39
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