Skip to content

Commit

Permalink
Merge pull request #5137 from gooddata/pdo-lx-372-setting-tooltip
Browse files Browse the repository at this point in the history
feat: allow to define hide delay for setting item tooltip
  • Loading branch information
xMort authored Jul 17, 2024
2 parents 43c235f + 53e32ab commit 9229b7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions libs/sdk-ui-kit/api/sdk-ui-kit.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3573,6 +3573,8 @@ export interface ISettingItem {
// (undocumented)
title: string;
// (undocumented)
titleTooltipHideDelay?: number;
// (undocumented)
titleTooltipText?: ReactNode;
// (undocumented)
value: string | ReactNode;
Expand Down
5 changes: 3 additions & 2 deletions libs/sdk-ui-kit/src/SettingItem/SettingItem.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2022-2023 GoodData Corporation
// (C) 2022-2024 GoodData Corporation

import React from "react";
import cx from "classnames";
Expand Down Expand Up @@ -71,13 +71,14 @@ export const SettingItem: React.FC<ISettingItem> = ({
alignPointActionTooltip,
onAction,
renderSubtitle,
titleTooltipHideDelay = 0,
}) => {
return (
<div className={cx(className, "gd-setting-item-container", { divider: hasDivider })}>
<div className="gd-setting-item-title">
<span className="title">{title}</span>
{titleTooltipText ? (
<BubbleHoverTrigger>
<BubbleHoverTrigger hideDelay={titleTooltipHideDelay}>
<span className="icon-circle-question gd-icon-circle-question" />
<Bubble
className={cx(className, "bubble-primary")}
Expand Down
1 change: 1 addition & 0 deletions libs/sdk-ui-kit/src/SettingItem/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface ISettingItem {
className?: string;
title: string;
titleTooltipText?: ReactNode;
titleTooltipHideDelay?: number;
alignPointTitleTooltip?: { align: string }[];
value: string | ReactNode;
actionType: ActionType;
Expand Down

0 comments on commit 9229b7a

Please sign in to comment.