-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪟 🧹 Cleanup Tooltip component usages (#15789)
* Temp rename tooltip folder to lowercase * Move Tooltip to components/base and rename to one word * Move InfoTooltip to base/Tooltip and eliminate redundancies * Fix cursor field and primary key dropdowns in the catalog tree, remove duplicate tooltip * Update ArraySection to show tooltip at the top Update ArrayOfObjectsEditor to render description with TooltipTable * Update InfoTooltip to SCSS, ensure that it's centered aligned * Ensure that Tooltips auto update on scroll * Add TooltipLearnMoreLink to Tooltip index and update imports * Fix InfoTooltip icon math in SCSS
- Loading branch information
Showing
27 changed files
with
228 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
airbyte-webapp/src/components/base/Tooltip/InfoTooltip.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@use "sass:math"; | ||
@use "../../../scss/colors"; | ||
@use "../../../scss/variables"; | ||
|
||
$line-height: 17px; | ||
$icon-size: 14px; | ||
$icon-top: math.div($line-height - $icon-size, 2); | ||
|
||
.container { | ||
display: inline-block; | ||
margin-left: variables.$spacing-sm; | ||
color: colors.$grey; | ||
width: $icon-size; | ||
} | ||
|
||
.icon { | ||
position: absolute; | ||
top: $icon-top; | ||
} |
22 changes: 22 additions & 0 deletions
22
airbyte-webapp/src/components/base/Tooltip/InfoTooltip.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react"; | ||
|
||
import { InfoIcon } from "components/icons/InfoIcon"; | ||
|
||
import styles from "./InfoTooltip.module.scss"; | ||
import { Tooltip } from "./Tooltip"; | ||
|
||
export const InfoTooltip: React.FC = ({ children }) => { | ||
return ( | ||
<Tooltip | ||
control={ | ||
<div className={styles.container}> | ||
<div className={styles.icon}> | ||
<InfoIcon /> | ||
</div> | ||
</div> | ||
} | ||
> | ||
{children} | ||
</Tooltip> | ||
); | ||
}; |
6 changes: 3 additions & 3 deletions
6
...rc/components/ToolTip/ToolTip.module.scss → ...mponents/base/Tooltip/Tooltip.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../ToolTip/TooltipLearnMoreLink.module.scss → .../Tooltip/TooltipLearnMoreLink.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@use "../../scss/variables"; | ||
@use "../../../scss/variables"; | ||
|
||
.container { | ||
margin-top: variables.$spacing-md; | ||
|
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...mponents/ToolTip/TooltipTable.module.scss → ...nts/base/Tooltip/TooltipTable.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions
12
.../src/components/ToolTip/index.stories.tsx → ...components/base/Tooltip/index.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export * from "./context"; | ||
export * from "./InfoTooltip"; | ||
export * from "./Tooltip"; | ||
export * from "./TooltipLearnMoreLink"; | ||
export * from "./TooltipTable"; | ||
export * from "./types"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Placement } from "@floating-ui/react-dom"; | ||
|
||
export type TooltipCursor = "pointer" | "help" | "not-allowed" | "initial"; | ||
export type TooltipTheme = "dark" | "light"; | ||
|
||
export interface TooltipProps { | ||
control: React.ReactNode; | ||
className?: string; | ||
disabled?: boolean; | ||
cursor?: TooltipCursor; | ||
theme?: TooltipTheme; | ||
placement?: Placement; | ||
} | ||
|
||
export type TooltipContext = TooltipProps; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.