diff --git a/.changeset/tall-elephants-trade.md b/.changeset/tall-elephants-trade.md new file mode 100644 index 0000000000..2ed9991fdf --- /dev/null +++ b/.changeset/tall-elephants-trade.md @@ -0,0 +1,5 @@ +--- +'@alfalab/core-components-tooltip': minor +--- + +Добавлено свойство withTransition diff --git a/packages/tooltip/src/desktop/Component.desktop.tsx b/packages/tooltip/src/desktop/Component.desktop.tsx index a787c67ba9..706e48391d 100644 --- a/packages/tooltip/src/desktop/Component.desktop.tsx +++ b/packages/tooltip/src/desktop/Component.desktop.tsx @@ -55,6 +55,7 @@ export const TooltipDesktop: FC = ({ colors = 'default', useAnchorWidth, onTargetClick, + withTransition = true, }) => { const [visible, setVisible] = useState(!!forcedOpen); const [target, setTarget] = useState(null); @@ -238,6 +239,7 @@ export const TooltipDesktop: FC = ({ preventOverflow={preventOverflow} availableHeight={availableHeight} useAnchorWidth={useAnchorWidth} + withTransition={withTransition} >
{content}
diff --git a/packages/tooltip/src/docs/Component.stories.tsx b/packages/tooltip/src/docs/Component.stories.tsx index 0922dfe0fc..41c17b579f 100644 --- a/packages/tooltip/src/docs/Component.stories.tsx +++ b/packages/tooltip/src/docs/Component.stories.tsx @@ -84,6 +84,7 @@ export const tooltip_desktop: Story = { onOpenDelay={number('onOpenDelay (in ms)', 300)} view={select('view', ['tooltip', 'hint'], 'tooltip')} colors={select('colors', ['default', 'inverted'], 'default')} + withTransition={select('withTransition', [true, false], true)} dataTestId='test-id' > {isPreview ? ( diff --git a/packages/tooltip/src/types.ts b/packages/tooltip/src/types.ts index b260797e37..30b7e3c201 100644 --- a/packages/tooltip/src/types.ts +++ b/packages/tooltip/src/types.ts @@ -140,6 +140,11 @@ export type TooltipDesktopProps = { */ useAnchorWidth?: boolean; + /** + * Показывать тултип с анимацией + */ + withTransition?: boolean; + /** * Тэг для target обертки * @default div