Skip to content

Commit

Permalink
chore: replace StyledTooltipChildren for class selector
Browse files Browse the repository at this point in the history
  • Loading branch information
DSil committed Oct 3, 2023
1 parent e2280ae commit e825ccd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Text from "../../Text";
import { TYPE_OPTIONS, SIZE_OPTIONS } from "../consts";
import defaultTheme from "../../defaultTheme";
import { ICON_COLORS } from "../../Icon/consts";
import { StyledTooltipChildren } from "../../primitives/TooltipPrimitive";
import { right } from "../../utils/rtl";
import type { Props, Type } from "./types";
import type { Props as IconProps } from "../../Icon/types";
Expand Down Expand Up @@ -73,7 +72,7 @@ export const StyledBadgeContent = styled.div`
display: inline-flex;
align-items: center;
${StyledTooltipChildren} .orbit-text {
.orbit-tooltip-wrapper .orbit-text {
font-weight: ${theme.orbit.fontWeightMedium};
}
`};
Expand Down
2 changes: 1 addition & 1 deletion packages/orbit-components/src/Tooltip/Tooltip.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const WithImageInside = () => {
content={
<Stack>
<img
src="/tooltip_card_preview.png"
src="https://images.kiwi.com/illustrations/0x200/Rating-Q85.png"
alt="Preview
of card help in Tooltip component"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as React from "react";
import useRandomId from "../../hooks/useRandomId";
import useStateWithTimeout from "../../hooks/useStateWithTimeout";
import Portal from "../../Portal";
import { StyledTooltipChildren } from "../TooltipPrimitive";
import { TooltipWrapper } from "../TooltipPrimitive";
import DialogContent from "./components/DialogContent";
import type { Props } from "./types";

Expand Down Expand Up @@ -69,7 +69,7 @@ const MobileDialog = ({

return (
<>
<StyledTooltipChildren
<TooltipWrapper
onClick={handleInMobile}
aria-describedby={enabled ? mobileDialogID : undefined}
tabIndex={enabled ? Number(tabIndex) : undefined}
Expand All @@ -78,7 +78,7 @@ const MobileDialog = ({
block={block}
>
{children}
</StyledTooltipChildren>
</TooltipWrapper>
{enabled &&
render &&
(renderInPortal ? <Portal renderInto="dialogs">{dialog}</Portal> : dialog)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const WithImageInside = () => {
content={
<Stack>
<img
src="/tooltipPrimitive_card_preview.png"
src="https://images.kiwi.com/illustrations/0x200/Rating-Q85.png"
alt="Preview
of card help in TooltipPrimitive component"
/>
Expand Down Expand Up @@ -190,6 +190,8 @@ export const Playground = () => {
const Icon = getIcon(getIcons("Airplane"));
const size = select("size", Object.values(SIZE_OPTIONS), SIZE_OPTIONS.SMALL);
const tabIndex = text("TabIndex", "0");
const error = boolean("error", false);
const help = boolean("help", false);
const enabled = boolean("enabled", true);
const removeUnderlinedText = boolean("removeUnderlinedText", false);
const placement = select("placement", Object.values(PLACEMENTS), PLACEMENTS.BOTTOM);
Expand All @@ -204,6 +206,8 @@ export const Playground = () => {
tabIndex={tabIndex}
enabled={enabled}
removeUnderlinedText={removeUnderlinedText}
error={error}
help={help}
>
<Icon />
</TooltipPrimitive>
Expand Down
Binary file not shown.

0 comments on commit e825ccd

Please sign in to comment.