Skip to content

Commit

Permalink
feat(plasma-new-hope/web/b2c/docs): fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
TitanKuzmich committed Oct 11, 2023
1 parent cb4a7da commit e253f74
Show file tree
Hide file tree
Showing 12 changed files with 185 additions and 189 deletions.
2 changes: 0 additions & 2 deletions packages/plasma-b2c/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { popoverConfig, component, mergeConfig } from '@salutejs/plasma-new-hope/styled-components';

export type { PopoverPlacement, PopoverTrigger } from '@salutejs/plasma-new-hope/types';

const mergedConfig = mergeConfig(popoverConfig);
const PopoverComponent = component(mergedConfig);

Expand Down
2 changes: 1 addition & 1 deletion packages/plasma-b2c/src/components/Popover/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { Popover } from './Popover';
export type { PopoverPlacement, PopoverTrigger } from './Popover';
export type { PopoverProps, PopoverPlacement, PopoverTrigger } from '@salutejs/plasma-new-hope/types';
345 changes: 171 additions & 174 deletions packages/plasma-new-hope/src/components/Popover/Popover.tsx

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/plasma-new-hope/src/components/Popover/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { popoverRoot, popoverConfig } from './Popover';
export type { PopoverPlacement, PopoverTrigger } from './type';
export type { PopoverProps, PopoverPlacement, PopoverTrigger } from './type';
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { css } from '@linaria/core';
import styled from 'styled-components';
import { styled } from '@linaria/react';

export const StyledRoot = css`
position: relative;
box-sizing: border-box;
display: inline-flex;
`;

export const StyledArrow = styled.div``;

export const StyledPopover = styled.div`
position: absolute;
z-index: 1;
/* stylelint-disable selector-max-id */
&[data-popper-placement^='top'] > #popover-arrow {
bottom: -0.25rem;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import PopperJS from '@popperjs/core';
import type { Placement } from '@popperjs/core';

import type { PopoverPlacement } from '../type';

export const ESCAPE_KEYCODE = 27;

export const getPlacement = (placement: PopoverPlacement) => {
return `${placement}-start` as PopperJS.Placement;
return `${placement}-start` as Placement;
};

export const getAutoPlacements = (placements?: PopoverPlacement[]) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { popoverConfig } from '../../../../components/Popover';
import { component, mergeConfig } from '../../../../engines';

export type { PopoverPlacement, PopoverTrigger } from '../../../../components/Popover';
export type { PopoverProps, PopoverPlacement, PopoverTrigger } from '../../../../components/Popover';

const mergedConfig = mergeConfig(popoverConfig);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const NoAnimationStyle = createGlobalStyle`

const text = `Если после применения правила Лопиталя неопределённость типа 0 / 0 осталась, мнимая единица традиционно
развивает Наибольший Общий Делитель (НОД).`;
const heading = 'Голосовая викторина Валдисом Пельшем';
const heading = 'Голосовая викторина с Валдисом Пельшем';

describe('plasma-web: Modal', () => {
const ModalsProvider = getComponent('ModalsProvider');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { mount, CypressTestDecorator, getComponent } from '@salutejs/plasma-cy-u

import type { PopoverTrigger } from './Popover';

const text = 'Голосовая викторина Валдисом Пельшем';
const text = 'Голосовая викторина с Валдисом Пельшем';

describe('plasma-web: Popover', () => {
const Popover = getComponent('Popover');
Expand Down
2 changes: 0 additions & 2 deletions packages/plasma-web/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { popoverConfig, component, mergeConfig } from '@salutejs/plasma-new-hope/styled-components';

export type { PopoverPlacement, PopoverTrigger } from '@salutejs/plasma-new-hope/types';

const mergedConfig = mergeConfig(popoverConfig);
const PopoverComponent = component(mergedConfig);

Expand Down
2 changes: 1 addition & 1 deletion packages/plasma-web/src/components/Popover/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { Popover } from './Popover';
export type { PopoverPlacement, PopoverTrigger } from './Popover';
export type { PopoverProps, PopoverPlacement, PopoverTrigger } from '@salutejs/plasma-new-hope/types';
4 changes: 3 additions & 1 deletion website/plasma-web-docs/docs/components/Popover.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { PropsTable, Description, StorybookLink } from '@site/src/components';

```tsx live
import React from 'react';
import styled from "styled-components";
import { surfaceSolid03 } from "@salutejs/plasma-tokens-web";
import { Popover, Button } from '@salutejs/plasma-web';

export function App() {
Expand All @@ -36,7 +38,7 @@ export function App() {
`;

const StyledContent = styled.div`
background: var(--plasma-colors-surface-solid03);
background: ${surfaceSolid03};
padding: 1rem;
display: flex;
Expand Down

0 comments on commit e253f74

Please sign in to comment.