Skip to content

Commit

Permalink
fix(plasma-core): Popover refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
kayman233 committed Sep 26, 2023
1 parent 003f4e9 commit 2366fa8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Live.args = {
trigger: 'click',
closeOnOverlayClick: true,
closeOnEsc: true,
isFocusTrapped: false,
isFocusTrapped: true,
skidding: 0,
distance: 6,
};
Expand Down
6 changes: 3 additions & 3 deletions packages/plasma-core/api/plasma-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -818,10 +818,10 @@ export interface PinProps {
// @public
export const Popover: React_2.NamedExoticComponent<PopoverProps & React_2.RefAttributes<HTMLDivElement>>;

// Warning: (ae-forgotten-export) The symbol "PopoverBasicPlacement" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "PopoverPlacementBasic" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export type PopoverPlacement = PopoverBasicPlacement | 'auto';
export type PopoverPlacement = PopoverPlacementBasic | 'auto';

// @public (undocumented)
export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
Expand All @@ -833,7 +833,7 @@ export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
isOpen?: boolean;
offset?: [number, number];
onToggle?: (isOpen: boolean, event: SyntheticEvent | Event) => void;
placement?: PopoverPlacement | Array<PopoverBasicPlacement>;
placement?: PopoverPlacement | Array<PopoverPlacementBasic>;
target?: ReactNode;
trigger: 'hover' | 'click';
}
Expand Down
10 changes: 5 additions & 5 deletions packages/plasma-core/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { useFocusTrap, useForkRef } from '../../hooks';

const ESCAPE_KEYCODE = 27;

export type PopoverBasicPlacement = 'top' | 'bottom' | 'right' | 'left';
export type PopoverPlacement = PopoverBasicPlacement | 'auto';
export type PopoverPlacementBasic = 'top' | 'bottom' | 'right' | 'left';
export type PopoverPlacement = PopoverPlacementBasic | 'auto';

export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
/**
Expand All @@ -23,7 +23,7 @@ export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
/**
* Расположение всплывающего окна. По умолчанию "auto".
*/
placement?: PopoverPlacement | Array<PopoverBasicPlacement>;
placement?: PopoverPlacement | Array<PopoverPlacementBasic>;
/**
* Отступ окна относительно элемента, у которого оно вызвано.
*/
Expand All @@ -41,7 +41,7 @@ export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
*/
children?: ReactNode;
/**
* Блокировать ли фокус на всплывающем окне.
* Блокировать ли фокус на всплывающем окне(по умолчанию true).
*/
isFocusTrapped?: boolean;
/**
Expand Down Expand Up @@ -109,7 +109,7 @@ export const Popover = memo<PopoverProps & RefAttributes<HTMLDivElement>>(
arrow,
placement = 'auto',
offset = [0, 0],
isFocusTrapped = false,
isFocusTrapped = true,
closeOnOverlayClick = true,
closeOnEsc = true,
onToggle,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Live.args = {
trigger: 'click',
closeOnOverlayClick: true,
closeOnEsc: true,
isFocusTrapped: false,
isFocusTrapped: true,
skidding: 0,
distance: 6,
};
Expand Down

0 comments on commit 2366fa8

Please sign in to comment.