8000
Skip to content

feat(Alert): support classNames and styles for component and ConfigProvider#52669

Merged
thinkasany merged 5 commits intonextfrom
cp-alert
Feb 7, 2025
Merged

feat(Alert): support classNames and styles for component and ConfigProvider#52669
thinkasany merged 5 commits intonextfrom
cp-alert

Conversation

@thinkasany
Copy link
Copy Markdown
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

@bolt-new-by-stackblitz
Copy link
Copy Markdown

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

@github-actions
Copy link
Copy Markdown
Contributor
github-actions bot commented Feb 6, 2025

Preview is ready

@github-actions
Copy link
Copy Markdown
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

@petercat-assistant
Copy link
Copy Markdown
  • 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.

nativeElement: HTMLDivElement;
}

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

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
Copy Markdown
Member

Choose a reason for hiding this comment

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

v6 ι‡Œζ­£ε₯½ε―δ»₯ζ”Ήζˆ title δΊ†

@thinkasany thinkasany mentioned this pull request Feb 6, 2025
@github-actions
Copy link
Copy Markdown
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 πŸ”Ί)

@codecov
Copy link
Copy Markdown
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

@cloudflare-workers-and-pages
Copy link
Copy Markdown
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

@pkg-pr-new
Copy link
Copy Markdown
pkg-pr-new bot commented Feb 7, 2025

@codecov
Copy link
Copy Markdown
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
@thinkasany thinkasany deleted the cp-alert branch February 7, 2025 09:39
@Wxh16144 Wxh16144 changed the title feat: ConfigProvider support classnames and styles for Alert feat(Alert): support classNames and styles for component and ConfigProvider Nov 28, 2025
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

0