-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui-library): rename tooltip component (#860)
- Loading branch information
1 parent
aa7bee3
commit 3bd6ca4
Showing
14 changed files
with
128 additions
and
347 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
75 changes: 0 additions & 75 deletions
75
packages/ui-library/src/components/tooltip-bubble/index.css.ts
This file was deleted.
Oops, something went wrong.
135 changes: 0 additions & 135 deletions
135
packages/ui-library/src/components/tooltip-bubble/index.stories.ts
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
packages/ui-library/src/components/tooltip-bubble/index.test.ts
This file was deleted.
Oops, something went wrong.
54 changes: 0 additions & 54 deletions
54
packages/ui-library/src/components/tooltip-bubble/index.ts
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
packages/ui-library/src/components/tooltip-bubble/indexReact.ts
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
packages/ui-library/src/components/tooltip-bubble/renderFunction.ts
This file was deleted.
Oops, something went wrong.
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,7 +1,71 @@ | ||
import { typeSafeNestedCss } from "../../utils/nested-typesafe-css-literals"; | ||
import { renderThemedCssStrings } from "../../foundation/_tokens-generated/index.pseudo.generated"; | ||
|
||
export const styleCustom = typeSafeNestedCss` | ||
:host { | ||
display: inline-block; | ||
} | ||
`; | ||
|
||
export const { tokenizedLight: light, tokenizedDark: dark } = renderThemedCssStrings((componentTokens) => { | ||
const { Tooltip } = componentTokens.cmp; | ||
|
||
return typeSafeNestedCss` | ||
#tooltipElement { | ||
left: 0; | ||
top: 0; | ||
max-width: ${Tooltip.TextWrapper.MaxWidth}; | ||
min-width: ${Tooltip.TextWrapper.MinWidth}; | ||
position: absolute; | ||
transition: opacity 0.2s; | ||
visibility: hidden; | ||
width: max-content; | ||
.content { | ||
background-color: ${Tooltip.Container.BackgroundColor}; | ||
border-radius: ${Tooltip.TextWrapper.BorderRadius}; | ||
color: ${Tooltip.Text.TextColor}; | ||
font-family: ${Tooltip.Text.Typography.fontFamily}, sans-serif; | ||
font-size: ${Tooltip.Text.Typography.fontSize}; | ||
font-weight: ${Tooltip.Text.Typography.fontWeight}; | ||
line-height: ${Tooltip.Text.Typography.lineHeight}; | ||
padding: ${Tooltip.TextWrapper.Padding}; | ||
text-align: center; | ||
} | ||
.elevation { | ||
filter: drop-shadow( | ||
${Tooltip.Container.Elevation.Elevated.x} ${Tooltip.Container.Elevation.Elevated.y} ${Tooltip.Container.Elevation.Elevated.blur} | ||
${Tooltip.Container.Elevation.Elevated.color} | ||
); | ||
} | ||
.visible { | ||
visibility: visible; | ||
} | ||
${ | ||
/* | ||
The layout box of the arrow element should be a square with equal width and height. | ||
Inner or pseudo-elements may have a different aspect ratio. | ||
https://floating-ui.com/docs/arrow#usage | ||
*/ | ||
"" | ||
} | ||
.arrow { | ||
align-items: flex-end; | ||
display: flex; | ||
height: 12px; | ||
justify-content: center; | ||
position: absolute; | ||
width: 12px; | ||
z-index: 1; | ||
& > svg > path { | ||
fill: ${Tooltip.Container.BackgroundColor}; | ||
} | ||
} | ||
} | ||
`; | ||
}); |
Oops, something went wrong.