Skip to content

Comments

feat(Tag): support classNames and styles for component and ConfigProvider#52764

Merged
thinkasany merged 3 commits intonextfrom
cp-tag
Feb 13, 2025
Merged

feat(Tag): support classNames and styles for component and ConfigProvider#52764
thinkasany merged 3 commits intonextfrom
cp-tag

Conversation

@thinkasany
Copy link
Member

中文版模板 / Chinese template

🤔 This is a ...

  • 🆕 New feature

📝 Change Log

Language Changelog
🇺🇸 English feat: ConfigProvider support classnames and styles for tag
🇨🇳 Chinese feat: ConfigProvider support classnames and styles for tag

@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 Feb 12, 2025

👁 Visual Regression Report for PR #52764 Failed ❌

🎯 Target branch: next (aaf384a)
📖 View Full Report ↗︎
📖 Alternative Report ↗︎
📊 Summary: 🔄 2 changed

Expected (Branch next) Actual (Current PR) Diff
input-group.compact.png input-group.compact.png input-group.compact.css-var.png input-group.compact.css-var.png
input-otp.compact.png input-otp.compact.png input-otp.compact.css-var.png input-otp.compact.css-var.png

Important

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

  • Visual diff is acceptable

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2025

Preview is ready

@petercat-assistant
Copy link

Walkthrough

This pull request introduces a new feature to the ConfigProvider component, allowing it to support class names and styles for the Tag component. This enhancement provides more customization options for developers when styling tags.

Changes

Files Summary
components/config-provider/context.ts Added classNames and styles to TagConfig type.
components/config-provider/index.en-US.md, components/config-provider/index.zh-CN.md Updated documentation to reflect new classNames and styles properties for Tag.
components/tag/tests/snapshots/demo-extend.test.ts.snap, components/tag/tests/snapshots/demo.test.ts.snap Updated snapshots to include new classNames and styles.
components/tag/tests/index.test.tsx Added test to verify classNames and styles are applied correctly.
components/tag/demo/_semantic.tsx Added semantic demo for new Tag properties.
components/tag/index.en-US.md, components/tag/index.zh-CN.md Added semantic DOM section for Tag.
components/tag/index.tsx Implemented classNames and styles support in Tag component.

href?: string;
target?: string;
disabled?: boolean;
classNames?: Partial<Record<SemanticName, string>>;

Choose a reason for hiding this comment

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

Ensure that the classNames and styles properties are correctly typed and handled to avoid potential runtime errors. Consider adding type checks or validation where necessary.

@thinkasany thinkasany mentioned this pull request Feb 12, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2025

size-limit report 📦

Path Size
dist/antd.min.js 503.07 KB (+120 B 🔺)
dist/antd-with-locales.min.js 572.08 KB (+103 B 🔺)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 12, 2025

Open in Stackblitz

More templates

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

commit: f165727

@codecov
Copy link

codecov bot commented Feb 12, 2025

Bundle Report

Changes will increase total bundle size by 900 bytes (0.02%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
antd.min-array-push 3.75MB 900 bytes (0.02%) ⬆️

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.min.js 450 bytes 2.03MB 0.02%
antd.min.js 450 bytes 1.72MB 0.03%

Files in antd-with-locales.min.js:

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

Files in antd.min.js:

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

@cloudflare-workers-and-pages
Copy link

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

Deploying ant-design with  Cloudflare Pages  Cloudflare Pages

Latest commit: f165727
Status: ✅  Deploy successful!
Preview URL: https://2b74b333.ant-design.pages.dev
Branch Preview URL: https://cp-tag.ant-design.pages.dev

View logs

@codecov
Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (c0008df) to head (f165727).
Report is 4 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff            @@
##              next    #52764   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          765       765           
  Lines        13770     13772    +2     
  Branches      3601      3603    +2     
=========================================
+ Hits         13770     13772    +2     

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

(children && (children as React.ReactElement<any>).type === 'a');

const iconNode: React.ReactNode = icon || null;
const iconNode: React.ReactNode = cloneElement(icon, {
Copy link
Member

Choose a reason for hiding this comment

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

icon 是 ReactNode,不一定是可以 clone 的,是不是和其他的一样 wrap 一下?

@thinkasany thinkasany merged commit da595e6 into next Feb 13, 2025
42 checks passed
@thinkasany thinkasany deleted the cp-tag branch February 13, 2025 03:45
@Wxh16144 Wxh16144 changed the title feat: ConfigProvider support classnames and styles for tag feat(Tag): 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