Skip to content

Commit

Permalink
Merge pull request #1272 from textkernel/feat/update-tooltip-molecule
Browse files Browse the repository at this point in the history
feat(Tooltip): updated the tooltip to the new design
  • Loading branch information
AlsasaAmmar authored Nov 4, 2024
2 parents fa65305 + 07410ed commit acd949a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable import/no-extraneous-dependencies, import/no-unresolved */
import * as React from 'react';
import Tippy, { TippyProps } from '@tippyjs/react';
import 'tippy.js/dist/tippy.css?external';
import 'tippy.js/animations/shift-toward.css?external';
import 'tippy.js/dist/tippy.css?external';

export type TooltipProps = TippyProps;

Expand All @@ -20,7 +20,7 @@ export const Tooltip: React.FC<TooltipProps> = ({ content, children, disabled, .
isDisabled = true;
}
return (
<Tippy content={content} disabled={isDisabled} {...rest}>
<Tippy content={content} disabled={isDisabled} maxWidth={320} arrow={false} {...rest}>
{children}
</Tippy>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exports[`<Tooltip> that renders a Tooltip should render default Tooltip correctl
data-reference-hidden=""
data-state="visible"
role="tooltip"
style="max-width: 350px; transition-duration: 300ms;"
style="max-width: 320px; transition-duration: 300ms;"
tabindex="-1"
>
<div
Expand All @@ -34,10 +34,6 @@ exports[`<Tooltip> that renders a Tooltip should render default Tooltip correctl
content
</div>
</div>
<div
class="tippy-arrow"
style="position: absolute; left: 0px; transform: translate(3px, 0px);"
/>
</div>
</div>
</body>
Expand Down
1 change: 0 additions & 1 deletion stories/molecules/Tooltip.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const _Tooltip: Story = {
args: {
placement: 'bottom',
content: 'this is my tooltip text',
arrow: true,
children: <div>hover here to see the tooltip</div>,
},
render: (args) => (
Expand Down

0 comments on commit acd949a

Please sign in to comment.