Skip to content

Commit

Permalink
Add removed properties for backwards compat
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Jan 31, 2023
1 parent 55dd3ef commit 66a0111
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
5 changes: 3 additions & 2 deletions code/ui/components/src/tabs/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export interface TabsProps {
backgroundColor?: string;
absolute?: boolean;
bordered?: boolean;
menuName: string;
menuName?: string;
}

export const Tabs: FC<TabsProps> = memo(
Expand Down Expand Up @@ -184,13 +184,14 @@ export const Tabs: FC<TabsProps> = 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;
Expand Down
24 changes: 21 additions & 3 deletions code/ui/components/src/tooltip/WithTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -55,6 +67,9 @@ const WithTooltipPure: FC<WithTooltipPureProps> = ({
children,
closeOnTriggerHidden,
mutationObserverOptions,
closeOnClick,
tooltipShown,
onVisibilityChange,
defaultVisible,
delayHide,
visible,
Expand All @@ -78,12 +93,15 @@ const WithTooltipPure: FC<WithTooltipPureProps> = ({
{
trigger,
placement,
defaultVisible,
defaultVisible: defaultVisible ?? tooltipShown,
delayHide,
interactive,
closeOnOutsideClick,
closeOnOutsideClick: closeOnOutsideClick ?? closeOnClick,
closeOnTriggerHidden,
onVisibleChange,
onVisibleChange: (_isVisible) => {
onVisibilityChange?.(_isVisible);
onVisibleChange?.(_isVisible);
},
delayShow,
followCursor,
mutationObserverOptions,
Expand Down

0 comments on commit 66a0111

Please sign in to comment.