diff --git a/packages/core/docs/vibe-3-changelog.md b/packages/core/docs/vibe-3-changelog.md index 7e2bf6cc49..5b5b5b1ae5 100644 --- a/packages/core/docs/vibe-3-changelog.md +++ b/packages/core/docs/vibe-3-changelog.md @@ -245,6 +245,8 @@ codemod: `search-component-import-migration` - `position` changed to only accept "top, right, bottom, left" - `justify` removed - `arrowPosition` removed +- `withMaxWidth` prop removed, max-width is now set to 240px [codemod] +- Tooltip's content is now wrapped in another div, non-block layouts inside the tooltip may break ### ColorPicker diff --git a/packages/core/src/components/Slider/__tests__/__snapshots__/Slider-non-ranged.test.js.snap b/packages/core/src/components/Slider/__tests__/__snapshots__/Slider-non-ranged.test.js.snap index 33d84429d0..32f0ec447b 100644 --- a/packages/core/src/components/Slider/__tests__/__snapshots__/Slider-non-ranged.test.js.snap +++ b/packages/core/src/components/Slider/__tests__/__snapshots__/Slider-non-ranged.test.js.snap @@ -59,7 +59,11 @@ Snapshot Diff: +
-+ 20% ++
++ 20% ++
+
+
-- 20% +-
+- 20% +-
-
-
-+ 20% ++
++ 20% ++
+
+
-- 20% +-
+- 20% +-
-
-
-+ 25% ++
++ 25% ++
+
+
-+ 65% ++
++ 65% ++
+
+
-- 25% +-
+- 25% +-
-
-
-+ 25% ++
++ 25% ++
+
+
-- 25% -+ 65% +
+- 25% ++ 65% +
@@ -285,7 +301,11 @@ Snapshot Diff: -
-- 65% +-
+- 65% +-
-
-
+
+
+
+ +
+

+ content +

+
+
+
+
+
+ + +`; + +exports[`Snapshot tests Tipseen tests renders correctly with floating variation 1`] = ` + +
+
+
-
-
- - -`; - -exports[`Snapshot tests Tipseen tests renders correctly with floating variation 1`] = ` - -
-
-
-
- -
-

- content -

-
@@ -216,17 +224,21 @@ exports[`Snapshot tests Tipseen tests renders correctly without close 1`] = `
-
-
-

- content -

+
+
+
+

+ content +

+
{ } renderTooltipContent() { - const { theme, content, className, style, withMaxWidth, title, image, icon } = this.props; + const { theme, content, className, style, title, image, icon } = this.props; if (!content) { // don't render empty tooltip return null; @@ -215,44 +210,18 @@ export default class Tooltip extends PureComponent { return null; } - if (title || image) { - return ( -
+ {image && } +
+ {title && ( + + {icon && } +
{title}
+
)} - > - {image && } -
- {title && ( - - {icon && } -
{title}
-
- )} - {contentValue} -
+ {contentValue}
- ); - } - - // TODO: remove in next major, use (title || image) variant instead - return ( -
- {contentValue}
); } diff --git a/packages/core/src/components/Tooltip/__stories__/Tooltip.mdx b/packages/core/src/components/Tooltip/__stories__/Tooltip.mdx index 27b6b53230..cc6e010a80 100644 --- a/packages/core/src/components/Tooltip/__stories__/Tooltip.mdx +++ b/packages/core/src/components/Tooltip/__stories__/Tooltip.mdx @@ -118,7 +118,6 @@ Tooltip's arrow can appear from top, bottom, left or right. component: ( { // The modifier's purpose is to prevent the tipseen from being displayed when the user scrolls the story upwards / downwards. // Therefore, there is no need to move this prop in your implementations. modifiers={modifiers} - withMaxWidth {...args} open > @@ -57,7 +56,6 @@ export const TooltipWithTitle = () => ( ( {/* The modifier's purpose is to prevent the tipseen from being displayed when the user scrolls the story upwards / downwards. Therefore, there is no need to move this prop in your implementations. */} - +
- +
- +
- +
@@ -124,13 +121,13 @@ export const Positions = { }; export const IconTooltip = () => ( - + ); export const DefinitionTooltip = () => ( - + @@ -139,13 +136,13 @@ export const DefinitionTooltip = () => ( export const ImmediateTooltips = () => ( - + - + - + diff --git a/packages/core/src/components/Tooltip/__tests__/__snapshots__/Tooltip.snapshot.test.tsx.snap b/packages/core/src/components/Tooltip/__tests__/__snapshots__/Tooltip.snapshot.test.tsx.snap index ab54ef1def..325b10392a 100644 --- a/packages/core/src/components/Tooltip/__tests__/__snapshots__/Tooltip.snapshot.test.tsx.snap +++ b/packages/core/src/components/Tooltip/__tests__/__snapshots__/Tooltip.snapshot.test.tsx.snap @@ -34,7 +34,11 @@ exports[`Tooltip renders correctly with data-testid 1`] = ` onMouseEnter={[Function]} onMouseLeave={[Function]} > - test +
+ test +
- test +
+ test +
- test +
+ test +
- test +
+ test +
- test +
+ test +
- test +
+ test +
`; @@ -307,7 +331,11 @@ exports[`Tooltip renders correctly without arrow 1`] = ` onMouseEnter={[Function]} onMouseLeave={[Function]} > - test +
+ test +
, diff --git a/packages/core/src/storybook/components/related-components/descriptions/tab-description.jsx b/packages/core/src/storybook/components/related-components/descriptions/tab-description.jsx index 69261bad26..eb261b6b81 100644 --- a/packages/core/src/storybook/components/related-components/descriptions/tab-description.jsx +++ b/packages/core/src/storybook/components/related-components/descriptions/tab-description.jsx @@ -5,11 +5,8 @@ import TabList from "../../../../components/Tabs/TabList/TabList"; export const TabsDescription = () => { const component = useMemo(() => { - const style = { - marginLeft: "-40px" - }; return ( -
+
Tab Tab