From 65e018645112484ce921cbfe9336186fc0cf4017 Mon Sep 17 00:00:00 2001 From: Denis Vershkov Date: Thu, 7 Sep 2023 14:50:58 +0200 Subject: [PATCH 1/2] feat: add popper modifiers to popover props --- src/components/Popover/Popover.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/Popover/Popover.tsx b/src/components/Popover/Popover.tsx index c0090739ce..0e8b59e65f 100644 --- a/src/components/Popover/Popover.tsx +++ b/src/components/Popover/Popover.tsx @@ -6,6 +6,7 @@ import {Button} from '../Button'; import {Icon} from '../Icon'; import {Popup} from '../Popup'; import type {QAProps} from '../types'; +import type {PopperProps} from '../utils/usePopper'; import {cnPopover} from './Popover.classname'; import {Buttons} from './components/Buttons/Buttons'; @@ -18,7 +19,10 @@ import type {PopoverInstanceProps, PopoverProps} from './types'; import './Popover.scss'; -export const Popover = React.forwardRef(function ( +export const Popover = React.forwardRef< + PopoverInstanceProps, + PopoverProps & Pick & QAProps +>(function ( { initialOpen = false, disabled = false, @@ -57,6 +61,7 @@ export const Popover = React.forwardRef {title &&

{title}

} From 6bb423e34a64eeefae04f093d8b2077a57ecbbfa Mon Sep 17 00:00:00 2001 From: Denis Vershkov Date: Thu, 7 Sep 2023 15:11:33 +0200 Subject: [PATCH 2/2] fix: move modifiers pick to types.ts file --- src/components/Popover/Popover.tsx | 6 +----- src/components/Popover/types.ts | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/Popover/Popover.tsx b/src/components/Popover/Popover.tsx index 0e8b59e65f..54cdce470e 100644 --- a/src/components/Popover/Popover.tsx +++ b/src/components/Popover/Popover.tsx @@ -6,7 +6,6 @@ import {Button} from '../Button'; import {Icon} from '../Icon'; import {Popup} from '../Popup'; import type {QAProps} from '../types'; -import type {PopperProps} from '../utils/usePopper'; import {cnPopover} from './Popover.classname'; import {Buttons} from './components/Buttons/Buttons'; @@ -19,10 +18,7 @@ import type {PopoverInstanceProps, PopoverProps} from './types'; import './Popover.scss'; -export const Popover = React.forwardRef< - PopoverInstanceProps, - PopoverProps & Pick & QAProps ->(function ( +export const Popover = React.forwardRef(function ( { initialOpen = false, disabled = false, diff --git a/src/components/Popover/types.ts b/src/components/Popover/types.ts index 15ec469f8c..33528396aa 100644 --- a/src/components/Popover/types.ts +++ b/src/components/Popover/types.ts @@ -119,7 +119,7 @@ export type PopoverDefaultProps = { size: 's' | 'l'; }; -export type PopoverProps = Pick & +export type PopoverProps = Pick & PopoverExternalProps & PopoverBehaviorProps & Partial;