From 52565da2db7ed260cdb7606887dbd111fd0e9405 Mon Sep 17 00:00:00 2001 From: Maddipatla Chatan Date: Wed, 16 Sep 2026 07:00:13 +0530 Subject: [PATCH] Refactor badge props to use BaseBadgeProps Refactor BadgeProps, NotificationCircleProps, and HintDotProps to share common fields through BaseBadgeProps. --- src/badge/types.ts | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/badge/types.ts b/src/badge/types.ts index 087eb73c9c..bae548e325 100644 --- a/src/badge/types.ts +++ b/src/badge/types.ts @@ -20,12 +20,10 @@ export type BadgeOverrides = { Badge?: Override; }; -export type BadgeProps = { - content: React.ReactNode; - hierarchy?: Hierarchy; - shape?: Shape; +// Fields shared by BadgeProps, NotificationCircleProps, and HintDotProps. +// Extracted so a future change to any of these only needs to happen once. +type BaseBadgeProps = { color?: Color; - placement?: Placement; hidden?: boolean; horizontalOffset?: string; verticalOffset?: string; @@ -33,22 +31,16 @@ export type BadgeProps = { children?: React.ReactNode; }; -export type NotificationCircleProps = { +export type BadgeProps = BaseBadgeProps & { content: React.ReactNode; - color?: Color; + hierarchy?: Hierarchy; + shape?: Shape; placement?: Placement; - hidden?: boolean; - horizontalOffset?: string; - verticalOffset?: string; - overrides?: BadgeOverrides; - children?: React.ReactNode; }; -export type HintDotProps = { - color?: Color; - hidden?: boolean; - horizontalOffset?: string; - verticalOffset?: string; - overrides?: BadgeOverrides; - children?: React.ReactNode; +export type NotificationCircleProps = BaseBadgeProps & { + content: React.ReactNode; + placement?: Placement; }; + +export type HintDotProps = BaseBadgeProps;