Skip to content

Commit

Permalink
fix(sdds-*,plasma-*,caldera-online): Update Portal component usage
Browse files Browse the repository at this point in the history
  • Loading branch information
neretin-trike committed Jul 16, 2024
1 parent 885bb38 commit 719734a
Show file tree
Hide file tree
Showing 27 changed files with 25 additions and 98 deletions.
5 changes: 2 additions & 3 deletions packages/caldera-online/api/caldera-online.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import { PopupInfo } from '@salutejs/plasma-new-hope/styled-components';
import { PopupPlacement } from '@salutejs/plasma-new-hope/styled-components';
import { PopupProps } from '@salutejs/plasma-new-hope/styled-components';
import { PopupProvider } from '@salutejs/plasma-new-hope/styled-components';
import { Portal } from '@salutejs/plasma-new-hope/styled-components';
import { PortalProps } from '@salutejs/plasma-new-hope/styled-components';
import { PropsType } from '@salutejs/plasma-new-hope/types/engines/types';
import { RadioGroup } from '@salutejs/plasma-new-hope/styled-components';
Expand Down Expand Up @@ -88,7 +89,6 @@ import { ToastRole } from '@salutejs/plasma-new-hope/styled-components';
import { usePopupContext } from '@salutejs/plasma-new-hope/styled-components';
import { useSegment } from '@salutejs/plasma-new-hope/styled-components';
import { useToast } from '@salutejs/plasma-new-hope/styled-components';
import { Variants } from '@salutejs/plasma-new-hope/types/engines/types';

export { addFocus }

Expand Down Expand Up @@ -441,8 +441,7 @@ export { PopupProps }

export { PopupProvider }

// @public (undocumented)
export const Portal: FunctionComponent<PropsType<Variants> & PortalProps & RefAttributes<HTMLDivElement>>;
export { Portal }

export { PortalProps }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import styled from 'styled-components';
import { Button } from '../Button/Button';
import { BodyM } from '../Typography';

import { Portal } from './Portal';
import { Portal } from '.';

const meta: Meta<typeof Portal> = {
title: 'Controls/Portal',
Expand Down
10 changes: 0 additions & 10 deletions packages/caldera-online/src/components/Portal/Portal.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/caldera-online/src/components/Portal/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { Portal } from './Portal';
export { Portal } from '@salutejs/plasma-new-hope/styled-components';

export type { PortalProps } from '@salutejs/plasma-new-hope/styled-components';
4 changes: 2 additions & 2 deletions packages/plasma-b2c/api/plasma-b2c.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ import { PopupProps as PopupBaseProps } from '@salutejs/plasma-new-hope/styled-c
import { PopupProvider as PopupBaseProvider } from '@salutejs/plasma-new-hope/styled-components';
import { PopupInfo } from '@salutejs/plasma-new-hope/styled-components';
import { PopupProps } from '@salutejs/plasma-hope';
import { Portal } from '@salutejs/plasma-new-hope/styled-components';
import { PortalProps } from '@salutejs/plasma-new-hope/styled-components';
import { PreviewGallery } from '@salutejs/plasma-hope';
import { PreviewGalleryItemProps } from '@salutejs/plasma-hope';
Expand Down Expand Up @@ -1672,8 +1673,7 @@ export { PopupInfo }

export { PopupProps }

// @public (undocumented)
export const Portal: FunctionComponent<PropsType<Variants> & PortalProps & RefAttributes<HTMLDivElement>>;
export { Portal }

export { PortalProps }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import styled from 'styled-components';
import { Button } from '../Button/Button';
import { BodyM } from '../Typography';

import { Portal } from './Portal';
import { Portal } from '.';

const meta: Meta<typeof Portal> = {
title: 'Controls/Portal',
Expand Down
10 changes: 0 additions & 10 deletions packages/plasma-b2c/src/components/Portal/Portal.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/plasma-b2c/src/components/Portal/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { Portal } from './Portal';
export { Portal } from '@salutejs/plasma-new-hope/styled-components';

export type { PortalProps } from '@salutejs/plasma-new-hope/styled-components';
6 changes: 1 addition & 5 deletions packages/plasma-new-hope/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import type { CSSProperties } from 'react';
import { usePopper } from 'react-popper';
import { useFocusTrap, useForkRef } from '@salutejs/plasma-core';

import { component, mergeConfig } from '../../engines';
import type { RootProps } from '../../engines/types';
import { cx } from '../../utils';
import { portalConfig } from '../Portal';
import { Portal } from '../Portal';

import { base as viewCSS } from './variations/_view/base';
import type { PopoverPlacement, PopoverProps } from './Popover.types';
Expand All @@ -16,9 +15,6 @@ import { classes } from './Popover.tokens';
export const ESCAPE_KEYCODE = 27;
export const POPOVER_PORTAL_ID = 'plasma-popover-root';

const mergedPortalConfig = mergeConfig(portalConfig);
const Portal = component(mergedPortalConfig);

/**
* Всплывающее окно с возможностью позиционирования
* и вызова по клику либо ховеру.
Expand Down
6 changes: 1 addition & 5 deletions packages/plasma-new-hope/src/components/Popup/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { useForkRef, safeUseId } from '@salutejs/plasma-core';

import { RootProps } from '../../engines/types';
import { cx } from '../../utils';
import { portalConfig } from '../Portal';
import { component, mergeConfig } from '../../engines';
import { Portal } from '../Portal';

import type { PopupPlacementBasic, PopupPlacement, PopupPositionType, PopupProps } from './Popup.types';
import { POPUP_PORTAL_ID } from './PopupContext';
Expand Down Expand Up @@ -79,9 +78,6 @@ export const handlePosition = (
};
};

const mergedPortalConfig = mergeConfig(portalConfig);
const Portal = component(mergedPortalConfig);

/**
* Базовый копмонент Popup.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/plasma-new-hope/src/components/Portal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { portalConfig, portalRoot } from './Portal';
export { Portal } from './Portal';
export type { PortalProps } from './Portal.types';
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { styled } from '@linaria/react';
import { Button } from '../Button/Button';
import { WithTheme } from '../../../_helpers';
import { Body } from '../../../typograpy/components/Body/Body';

import { Portal } from './Portal';
import { Portal } from '../../../../components/Portal';

const meta: Meta<typeof Portal> = {
title: 'plasma_b2c/Portal',
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { styled } from '@linaria/react';
import { Button } from '../Button/Button';
import { WithTheme } from '../../../_helpers';
import { Body } from '../../../typograpy/components/Body/Body';

import { Portal } from './Portal';
import { Portal } from '../../../../components/Portal';

const meta: Meta<typeof Portal> = {
title: 'plasma_web/Portal',
Expand Down

This file was deleted.

4 changes: 2 additions & 2 deletions packages/plasma-web/api/plasma-web.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ import { PopupProps as PopupBaseProps } from '@salutejs/plasma-new-hope/styled-c
import { PopupProvider as PopupBaseProvider } from '@salutejs/plasma-new-hope/styled-components';
import { PopupInfo } from '@salutejs/plasma-new-hope/styled-components';
import { PopupProps } from '@salutejs/plasma-hope';
import { Portal } from '@salutejs/plasma-new-hope/styled-components';
import { PortalProps } from '@salutejs/plasma-new-hope/styled-components';
import { PreviewGallery } from '@salutejs/plasma-hope';
import { PreviewGalleryItemProps } from '@salutejs/plasma-hope';
Expand Down Expand Up @@ -1674,8 +1675,7 @@ export { PopupInfo }

export { PopupProps }

// @public (undocumented)
export const Portal: FunctionComponent<PropsType<Variants> & PortalProps & RefAttributes<HTMLDivElement>>;
export { Portal }

export { PortalProps }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import styled from 'styled-components';
import { Button } from '../Button/Button';
import { BodyM } from '../Typography';

import { Portal } from './Portal';
import { Portal } from '.';

const meta: Meta<typeof Portal> = {
title: 'Controls/Portal',
Expand Down
10 changes: 0 additions & 10 deletions packages/plasma-web/src/components/Portal/Portal.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/plasma-web/src/components/Portal/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { Portal } from './Portal';
export { Portal } from '@salutejs/plasma-new-hope/styled-components';

export type { PortalProps } from '@salutejs/plasma-new-hope/styled-components';
4 changes: 2 additions & 2 deletions packages/sdds-dfa/api/sdds-dfa.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ import { PopupInfo } from '@salutejs/plasma-new-hope/styled-components';
import { PopupPlacement } from '@salutejs/plasma-new-hope/styled-components';
import { PopupProps } from '@salutejs/plasma-new-hope/styled-components';
import { PopupProvider } from '@salutejs/plasma-new-hope/styled-components';
import { Portal } from '@salutejs/plasma-new-hope/styled-components';
import { PortalProps } from '@salutejs/plasma-new-hope/styled-components';
import { ProgressProps } from '@salutejs/plasma-new-hope/styled-components';
import { PropsType } from '@salutejs/plasma-new-hope/types/engines/types';
Expand Down Expand Up @@ -1278,8 +1279,7 @@ export { PopupProps }

export { PopupProvider }

// @public (undocumented)
export const Portal: FunctionComponent<PropsType<Variants> & PortalProps & RefAttributes<HTMLDivElement>>;
export { Portal }

export { PortalProps }

Expand Down
2 changes: 1 addition & 1 deletion packages/sdds-dfa/src/components/Portal/Portal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import styled from 'styled-components';
import { Button } from '../Button/Button';
import { BodyM } from '../Typography';

import { Portal } from './Portal';
import { Portal } from '.';

const meta: Meta<typeof Portal> = {
title: 'Controls/Portal',
Expand Down
10 changes: 0 additions & 10 deletions packages/sdds-dfa/src/components/Portal/Portal.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/sdds-dfa/src/components/Portal/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { Portal } from './Portal';
export { Portal } from '@salutejs/plasma-new-hope/styled-components';

export type { PortalProps } from '@salutejs/plasma-new-hope/styled-components';
4 changes: 2 additions & 2 deletions packages/sdds-serv/api/sdds-serv.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ import { PopupInfo } from '@salutejs/plasma-new-hope/styled-components';
import { PopupPlacement } from '@salutejs/plasma-new-hope/styled-components';
import { PopupProps } from '@salutejs/plasma-new-hope/styled-components';
import { PopupProvider } from '@salutejs/plasma-new-hope/styled-components';
import { Portal } from '@salutejs/plasma-new-hope/styled-components';
import { PortalProps } from '@salutejs/plasma-new-hope/styled-components';
import { ProgressProps } from '@salutejs/plasma-new-hope/styled-components';
import { PropsType } from '@salutejs/plasma-new-hope/types/engines/types';
Expand Down Expand Up @@ -1140,8 +1141,7 @@ export { PopupProps }

export { PopupProvider }

// @public (undocumented)
export const Portal: FunctionComponent<PropsType<Variants> & PortalProps & RefAttributes<HTMLDivElement>>;
export { Portal }

export { PortalProps }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import styled from 'styled-components';
import { Button } from '../Button/Button';
import { BodyM } from '../Typography';

import { Portal } from './Portal';
import { Portal } from '.';

const meta: Meta<typeof Portal> = {
title: 'Controls/Portal',
Expand Down
10 changes: 0 additions & 10 deletions packages/sdds-serv/src/components/Portal/Portal.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion packages/sdds-serv/src/components/Portal/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { Portal } from './Portal';
export { Portal } from '@salutejs/plasma-new-hope/styled-components';

export type { PortalProps } from '@salutejs/plasma-new-hope/styled-components';

0 comments on commit 719734a

Please sign in to comment.