diff --git a/sparkle/src/components/Chip.tsx b/sparkle/src/components/Chip.tsx index ba05d19447dc..8da67debcf9a 100644 --- a/sparkle/src/components/Chip.tsx +++ b/sparkle/src/components/Chip.tsx @@ -78,22 +78,18 @@ const chipVariants = cva("s-inline-flex s-box-border s-items-center", { }, }); -export function Chip({ - size, - color, - label, - children, - className, - isBusy, - icon, -}: ChipProps) { - return ( +const Chip = React.forwardRef( + ( + { size, color, label, children, className, isBusy, icon }: ChipProps, + ref + ) => (
{icon && } {label && ( @@ -107,26 +103,9 @@ export function Chip({ )} {children}
- ); -} + ) +); -interface ListChipProps { - children: ReactNode; - className?: string; - isWrapping?: boolean; -} +Chip.displayName = "Chip"; -Chip.List = function ({ children, className, isWrapping }: ListChipProps) { - return ( -
-
- {children} -
-
- ); -}; +export { Chip }; diff --git a/sparkle/src/components/Tooltip.tsx b/sparkle/src/components/Tooltip.tsx index 7af57bf7d7aa..549b51aeeed7 100644 --- a/sparkle/src/components/Tooltip.tsx +++ b/sparkle/src/components/Tooltip.tsx @@ -36,23 +36,23 @@ interface TooltipProps extends TooltipContentProps { triggerAsChild?: boolean; } -function Tooltip({ - trigger, - tooltipTriggerAsChild = false, - label, - ...props -}: TooltipProps) { - return ( +const Tooltip = React.forwardRef( + ( + { trigger, tooltipTriggerAsChild = false, label, ...props }: TooltipProps, + ref + ) => ( {trigger} - {label} + + {label} + - ); -} + ) +); TooltipContent.displayName = TooltipPrimitive.Content.displayName;