From 71cecb80edeaaf157305a56683db117288f48f6c Mon Sep 17 00:00:00 2001 From: Neretin Artem Date: Wed, 13 Sep 2023 21:55:09 +0600 Subject: [PATCH] feat(plasma-hope): Remove `Link` component --- packages/plasma-hope/api/plasma-hope.api.md | 9 -- .../plasma-hope/src/components/Link/Link.tsx | 85 ------------------- .../plasma-hope/src/components/Link/index.ts | 1 - packages/plasma-hope/src/index.ts | 1 - 4 files changed, 96 deletions(-) delete mode 100644 packages/plasma-hope/src/components/Link/Link.tsx delete mode 100644 packages/plasma-hope/src/components/Link/index.ts diff --git a/packages/plasma-hope/api/plasma-hope.api.md b/packages/plasma-hope/api/plasma-hope.api.md index f1a158b7ed..4ad150cb68 100644 --- a/packages/plasma-hope/api/plasma-hope.api.md +++ b/packages/plasma-hope/api/plasma-hope.api.md @@ -862,15 +862,6 @@ export { LineSkeleton } export { LineSkeletonProps } -// Warning: (ae-forgotten-export) The symbol "LinkProps" needs to be exported by the entry point index.d.ts -// -// @public -export const Link: StyledComponent<"a", any, LinkProps & { -$isHover?: boolean | undefined; -$isPressed?: boolean | undefined; -$isVisited?: boolean | undefined; -}, never>; - // @public (undocumented) export const link = "var(--plasma-colors-link)"; diff --git a/packages/plasma-hope/src/components/Link/Link.tsx b/packages/plasma-hope/src/components/Link/Link.tsx deleted file mode 100644 index 014b101455..0000000000 --- a/packages/plasma-hope/src/components/Link/Link.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import styled, { css } from 'styled-components'; - -import { link, linkHover, linkActive, linkVisited, linkVisitedHover, linkVisitedActive } from '../../tokens'; - -const views = { - primary: { - default: link, - hover: linkHover, - active: linkActive, - visited: linkVisited, - visitedHover: linkVisitedHover, - visitedActive: linkVisitedActive, - }, -}; - -export interface LinkProps { - /** - * Вид компонента. - */ - view?: keyof typeof views; -} - -const interactionCss = (color: string) => css` - color: ${color}; - - &::before { - opacity: 1; - } -`; - -/** - * Ссылка. - */ -export const Link = styled.a` - position: relative; - text-decoration: none; - transition: color 0.15s ease-in; - - &::before { - content: ''; - - position: absolute; - left: 0; - right: 0; - bottom: 0; - - border-bottom: 1px solid; - - opacity: 0.4; - transition: opacity 0.15s ease-in; - } - - ${({ view = 'primary', $isHover, $isPressed, $isVisited }) => css` - color: ${views[view].default}; - - &:hover { - ${interactionCss(views[view].hover)} - } - &:active { - ${interactionCss(views[view].active)} - } - - &:visited { - color: ${views[view].visited}; - } - &:visited:hover { - ${interactionCss(views[view].visitedHover)} - } - &:visited:active { - ${interactionCss(views[view].visitedActive)} - } - - ${$isHover && interactionCss(views[view].hover)} - ${$isPressed && interactionCss(views[view].active)} - - ${ - $isVisited && - css` - color: ${views[view].visited}; - ` - } - ${$isVisited && $isHover && interactionCss(views[view].visitedHover)} - ${$isVisited && $isPressed && interactionCss(views[view].visitedActive)} - `}; -`; diff --git a/packages/plasma-hope/src/components/Link/index.ts b/packages/plasma-hope/src/components/Link/index.ts deleted file mode 100644 index 61fe08c6f4..0000000000 --- a/packages/plasma-hope/src/components/Link/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Link } from './Link'; diff --git a/packages/plasma-hope/src/index.ts b/packages/plasma-hope/src/index.ts index b5cafe8169..10ee097d4e 100644 --- a/packages/plasma-hope/src/index.ts +++ b/packages/plasma-hope/src/index.ts @@ -11,7 +11,6 @@ export * from './components/ElasticGrid'; export * from './components/Dropdown'; export * from './components/Grid'; export * from './components/Image'; -export * from './components/Link'; export * from './components/List'; export * from './components/Modal'; export * from './components/Notification';