Refactor badge props to use BaseBadgeProps - #5419
MaddipatlaChetan24 wants to merge 1 commit into
Conversation
Refactor BadgeProps, NotificationCircleProps, and HintDotProps to share common fields through BaseBadgeProps.
|
please check this !!! |
|
Thanks for the PR. Before we review it, please note that "check this" isn't a submission we can accept. It hands the verification work to maintainers, and our review time is limited. We welcome AI-assisted contributions, but you are the author and must stand behind every line. Before requesting review, please: Run it. Set up the dev environment, run the full test suite, and confirm the change works as intended. Once you can confirm all of the above in the PR description, we're happy to take a look. Until then, we'll mark this as a draft. |
Fixes #1, Fixes #2
Description
Extracts the fields shared by
BadgeProps,NotificationCircleProps,and
HintDotProps(color,hidden,horizontalOffset,verticalOffset,overrides,children) into a new internalBaseBadgePropstype, and builds each of the three exported types ontop of it via intersection instead of repeating the six fields
independently in each.
contentandplacement, which are shared byonly two of the three types, stay declared individually on
BadgeProps/NotificationCirclePropsrather than being pulled intothe base, since
HintDotPropsdoesn't have them.BaseBadgePropsis not exported — it's purely an internalorganizational detail, not a new public API surface.
Verified structural equivalence with the TypeScript compiler: wrote a
mutual-assignability check (
A extends B ? (B extends A ? ... ))between the original and refactored versions of all three types and
confirmed it compiles cleanly under
tsc --strict, meaning eachrefactored type is identical, field-for-field, to what it was before.
No consumer of these types is affected.
Scope
Patch: Cleanup