From 62c4cd428876de1d4ea7452f01372c784b64a68a Mon Sep 17 00:00:00 2001 From: Matthias Prost Date: Tue, 24 Jan 2023 10:40:48 +0100 Subject: [PATCH] fix(TooltipIcon): remove component (#2215) --- packages/ui/src/__tests__/a11y.test.tsx | 1 - .../__stories__/Colors.stories.tsx | 8 ----- .../__stories__/Playground.stories.tsx | 3 -- .../TooltipIcon/__stories__/Sizes.stories.tsx | 8 ----- .../__stories__/Template.stories.tsx | 10 ------ .../TooltipIcon/__stories__/index.stories.tsx | 18 ---------- .../__tests__/__snapshots__/index.tsx.snap | 32 ------------------ .../TooltipIcon/__tests__/index.tsx | 9 ----- .../ui/src/components/TooltipIcon/index.tsx | 33 ------------------- packages/ui/src/components/index.ts | 1 - packages/ui/src/index.ts | 1 - 11 files changed, 124 deletions(-) delete mode 100644 packages/ui/src/components/TooltipIcon/__stories__/Colors.stories.tsx delete mode 100644 packages/ui/src/components/TooltipIcon/__stories__/Playground.stories.tsx delete mode 100644 packages/ui/src/components/TooltipIcon/__stories__/Sizes.stories.tsx delete mode 100644 packages/ui/src/components/TooltipIcon/__stories__/Template.stories.tsx delete mode 100644 packages/ui/src/components/TooltipIcon/__stories__/index.stories.tsx delete mode 100644 packages/ui/src/components/TooltipIcon/__tests__/__snapshots__/index.tsx.snap delete mode 100644 packages/ui/src/components/TooltipIcon/__tests__/index.tsx delete mode 100644 packages/ui/src/components/TooltipIcon/index.tsx diff --git a/packages/ui/src/__tests__/a11y.test.tsx b/packages/ui/src/__tests__/a11y.test.tsx index 61f5a6c8da..09d6e1747b 100644 --- a/packages/ui/src/__tests__/a11y.test.tsx +++ b/packages/ui/src/__tests__/a11y.test.tsx @@ -27,7 +27,6 @@ const testedComponents = [ 'SelectableCard', 'StepList', 'Toaster', - 'TooltipIcon', 'Tag', 'Tags', 'TextInput', diff --git a/packages/ui/src/components/TooltipIcon/__stories__/Colors.stories.tsx b/packages/ui/src/components/TooltipIcon/__stories__/Colors.stories.tsx deleted file mode 100644 index 04d386cdd0..0000000000 --- a/packages/ui/src/components/TooltipIcon/__stories__/Colors.stories.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { Template } from './Template.stories' - -export const Colors = Template.bind({}) - -Colors.args = { - color: 'primary', - tooltip: 'Icon color is primary', -} diff --git a/packages/ui/src/components/TooltipIcon/__stories__/Playground.stories.tsx b/packages/ui/src/components/TooltipIcon/__stories__/Playground.stories.tsx deleted file mode 100644 index 1bb1300883..0000000000 --- a/packages/ui/src/components/TooltipIcon/__stories__/Playground.stories.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import { Template } from './Template.stories' - -export const Playground = Template.bind({}) diff --git a/packages/ui/src/components/TooltipIcon/__stories__/Sizes.stories.tsx b/packages/ui/src/components/TooltipIcon/__stories__/Sizes.stories.tsx deleted file mode 100644 index 867c751e16..0000000000 --- a/packages/ui/src/components/TooltipIcon/__stories__/Sizes.stories.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { Template } from './Template.stories' - -export const Sizes = Template.bind({}) - -Sizes.args = { - size: 40, - tooltip: 'Icon size is 40 px', -} diff --git a/packages/ui/src/components/TooltipIcon/__stories__/Template.stories.tsx b/packages/ui/src/components/TooltipIcon/__stories__/Template.stories.tsx deleted file mode 100644 index da7e48aaa8..0000000000 --- a/packages/ui/src/components/TooltipIcon/__stories__/Template.stories.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import type { ComponentStory } from '@storybook/react' -import { TooltipIcon } from '..' - -export const Template: ComponentStory = args => ( - -) - -Template.args = { - tooltip: 'Hello there!', -} diff --git a/packages/ui/src/components/TooltipIcon/__stories__/index.stories.tsx b/packages/ui/src/components/TooltipIcon/__stories__/index.stories.tsx deleted file mode 100644 index 1eae3546b3..0000000000 --- a/packages/ui/src/components/TooltipIcon/__stories__/index.stories.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import type { ComponentMeta } from '@storybook/react' -import { TooltipIcon } from '..' - -export default { - component: TooltipIcon, - parameters: { - docs: { - description: { - component: 'An icon with tooltip when hovered.', - }, - }, - }, - title: 'Components/Feedback/TooltipIcon', -} as ComponentMeta - -export { Playground } from './Playground.stories' -export { Colors } from './Colors.stories' -export { Sizes } from './Sizes.stories' diff --git a/packages/ui/src/components/TooltipIcon/__tests__/__snapshots__/index.tsx.snap b/packages/ui/src/components/TooltipIcon/__tests__/__snapshots__/index.tsx.snap deleted file mode 100644 index b9ca45b809..0000000000 --- a/packages/ui/src/components/TooltipIcon/__tests__/__snapshots__/index.tsx.snap +++ /dev/null @@ -1,32 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`TooltipIcon renders with default props 1`] = ` - - .cache-yb56yg-StyledChildrenContainer { - display: inherit; -} - -.cache-dwb18c-StyledIcon-sizeStyles { - vertical-align: middle; - fill: #b2b6c3; - height: 20px; - width: 20px; - min-width: 20px; - min-height: 20px; -} - -
- - - -
-
-`; diff --git a/packages/ui/src/components/TooltipIcon/__tests__/index.tsx b/packages/ui/src/components/TooltipIcon/__tests__/index.tsx deleted file mode 100644 index a2405b465a..0000000000 --- a/packages/ui/src/components/TooltipIcon/__tests__/index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { TooltipIcon } from '..' -import { shouldMatchEmotionSnapshotWithPortal } from '../../../../.jest/helpers' - -describe('TooltipIcon', () => { - test(`renders with default props`, () => - shouldMatchEmotionSnapshotWithPortal( - , - )) -}) diff --git a/packages/ui/src/components/TooltipIcon/index.tsx b/packages/ui/src/components/TooltipIcon/index.tsx deleted file mode 100644 index e846606e98..0000000000 --- a/packages/ui/src/components/TooltipIcon/index.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { useTheme } from '@emotion/react' -import type { ComponentProps, ReactNode } from 'react' -import { Icon } from '../Icon' -import { Tooltip } from '../Tooltip' - -type TooltipIconProps = { - baseId?: string - color?: string - name?: ComponentProps['name'] - size?: number - tooltip: ReactNode -} - -export const TooltipIcon = ({ - color, - name = 'help-circle-outline', - size = 20, - tooltip, - baseId, -}: TooltipIconProps) => { - const theme = useTheme() - - return ( - - - - ) -} diff --git a/packages/ui/src/components/index.ts b/packages/ui/src/components/index.ts index 12b874030b..d20f2cda9c 100644 --- a/packages/ui/src/components/index.ts +++ b/packages/ui/src/components/index.ts @@ -60,7 +60,6 @@ export { TimeInput } from './TimeInput' export { ToastContainer, toast } from './Toaster' export { Toggle } from './Toggle' export { Tooltip } from './Tooltip' -export { TooltipIcon } from './TooltipIcon' export { usePagination } from './Pagination/usePagination' export { Grid, Row, Col } from './Grid' export { List as ListV2 } from './ListV2' diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 7de9fd6c4b..b2ff673a5a 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -63,7 +63,6 @@ export { ToastContainer, toast, Tooltip, - TooltipIcon, UnitInput, usePagination, VerificationCode,