diff --git a/code/ui/components/src/tabs/tabs.tsx b/code/ui/components/src/tabs/tabs.tsx index 33d12e468cc6..284725a759fd 100644 --- a/code/ui/components/src/tabs/tabs.tsx +++ b/code/ui/components/src/tabs/tabs.tsx @@ -120,7 +120,7 @@ export interface TabsProps { backgroundColor?: string; absolute?: boolean; bordered?: boolean; - menuName: string; + menuName?: string; } export const Tabs: FC = memo( @@ -184,13 +184,14 @@ export const Tabs: FC = memo( } ); Tabs.displayName = 'Tabs'; -(Tabs as any).defaultProps = { +Tabs.defaultProps = { id: null, children: null, tools: null, selected: null, absolute: false, bordered: false, + menuName: 'Tabs', }; type FuncChildren = ({ active }: { active: boolean }) => JSX.Element; diff --git a/code/ui/components/src/tooltip/WithTooltip.tsx b/code/ui/components/src/tooltip/WithTooltip.tsx index b0a295f330a4..b60443a76124 100644 --- a/code/ui/components/src/tooltip/WithTooltip.tsx +++ b/code/ui/components/src/tooltip/WithTooltip.tsx @@ -35,6 +35,18 @@ export interface WithTooltipPureProps tooltip: ReactNode | ((p: WithHideFn) => ReactNode); children: ReactNode; onDoubleClick?: () => void; + /** + * @deprecated use `defaultVisible` property instead. This property will be removed in SB 8.0 + */ + tooltipShown?: boolean; + /** + * @deprecated use `closeOnOutsideClick` property instead. This property will be removed in SB 8.0 + */ + closeOnClick?: boolean; + /** + * @deprecated use `onVisibleChange` property instead. This property will be removed in SB 8.0 + */ + onVisibilityChange?: (visibility: boolean) => void | boolean; /** * If `true`, a click outside the trigger element closes the tooltip * @default false @@ -55,6 +67,9 @@ const WithTooltipPure: FC = ({ children, closeOnTriggerHidden, mutationObserverOptions, + closeOnClick, + tooltipShown, + onVisibilityChange, defaultVisible, delayHide, visible, @@ -78,12 +93,15 @@ const WithTooltipPure: FC = ({ { trigger, placement, - defaultVisible, + defaultVisible: defaultVisible ?? tooltipShown, delayHide, interactive, - closeOnOutsideClick, + closeOnOutsideClick: closeOnOutsideClick ?? closeOnClick, closeOnTriggerHidden, - onVisibleChange, + onVisibleChange: (_isVisible) => { + onVisibilityChange?.(_isVisible); + onVisibleChange?.(_isVisible); + }, delayShow, followCursor, mutationObserverOptions,