forstok-ui-lib 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "forstok-ui-lib",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Forstok UI Components Library",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -1,4 +1,3 @@
1
- import { Link } from 'react-router-dom';
2
1
  import styled, { css } from 'styled-components';
3
2
  import { multiElipsis } from '../../assets/stylesheets/bases.styles';
4
3
 
@@ -145,14 +144,6 @@ const getLinkModifiedStyled = ({ mode, $elipsis, $activated, $shadow, disabled }
145
144
  return style;
146
145
  }
147
146
 
148
- export const LinkContainer = styled(Link)<{ mode?: string, $elipsis: boolean, $activated: boolean, $shadow: boolean, disabled: boolean }>`
149
- &._refHoverLink {
150
- padding: 3px 0px 0px 6px;
151
- position: relative;
152
- top: -3px;
153
- }
154
- ${getLinkModifiedStyled}
155
- `
156
147
  export const AnchorLinkContainer = styled.a<{ mode?: string, $elipsis: boolean, $activated: boolean, $shadow: boolean, disabled: boolean }>`
157
148
  ${getLinkModifiedStyled}
158
149
  `
@@ -1,7 +1,5 @@
1
1
  import type { AnchorHTMLAttributes, ReactNode, MouseEvent, HTMLAttributes } from 'react';
2
2
  import { AnchorLinkContainer, ElLinkContainer } from './link.styles';
3
- import LinkRouteComponent from './link_route';
4
- import type { Path } from 'react-router-dom';
5
3
 
6
4
  type TLinkBase = {
7
5
  children: ReactNode
@@ -13,25 +11,18 @@ type TLinkBase = {
13
11
  } & (
14
12
  (AnchorHTMLAttributes<HTMLAnchorElement> & {
15
13
  href?: string
16
- to?: undefined
17
- onClick?: (e: MouseEvent<HTMLAnchorElement>) => void
18
- }) |
19
- (AnchorHTMLAttributes<HTMLAnchorElement> & {
20
- href?: undefined
21
- to: string | Partial<Path>
22
14
  onClick?: (e: MouseEvent<HTMLAnchorElement>) => void
23
15
  }) |
24
16
  (HTMLAttributes<HTMLSpanElement> & {
25
17
  href?: undefined
26
- to?: undefined
27
18
  onClick?: (e: MouseEvent<HTMLSpanElement>) => void
28
19
  })
29
20
  );
30
21
 
31
- const LinkComponent = ({ children, mode, $activated=false, href, to, $elipsis=false, $shadow=false, disabled=false, ...props }: TLinkBase) => {
22
+ const LinkComponent = ({ children, mode, $activated=false, href, $elipsis=false, $shadow=false, disabled=false, ...props }: TLinkBase) => {
32
23
  const { onClick } = props
33
24
  return (
34
- href ? <AnchorLinkContainer className='_refLink' mode={mode} $activated={$activated ? true : false} $elipsis={$elipsis ? true : false} $shadow={$shadow ? true : false} disabled={disabled ? true : false} href={href} {...props}>{children}</AnchorLinkContainer> : (to ? <LinkRouteComponent to={to} className='_refLink' mode={mode} $activated={$activated && true} $elipsis={$elipsis ? true : false} $shadow={$shadow ? true : false} disabled={disabled ? true : false} {...props}>{children}</LinkRouteComponent> : <ElLinkContainer className='_refLink' mode={mode} $activated={$activated ? true : false} $elipsis={$elipsis ? true : false} $shadow={$shadow ? true : false} disabled={disabled ? true : false} onClick={onClick} {...props}>{children}</ElLinkContainer>)
25
+ href ? <AnchorLinkContainer className='_refLink' mode={mode} $activated={$activated ? true : false} $elipsis={$elipsis ? true : false} $shadow={$shadow ? true : false} disabled={disabled ? true : false} href={href} {...props}>{children}</AnchorLinkContainer> : <ElLinkContainer className='_refLink' mode={mode} $activated={$activated ? true : false} $elipsis={$elipsis ? true : false} $shadow={$shadow ? true : false} disabled={disabled ? true : false} onClick={onClick} {...props}>{children}</ElLinkContainer>)
35
26
  );
36
27
  };
37
28
 
@@ -1,22 +0,0 @@
1
- import type { ReactNode, AnchorHTMLAttributes } from 'react';
2
- import { BrowserRouter as Router } from 'react-router-dom';
3
- import type { LinkProps, Path } from 'react-router-dom';
4
- import { LinkContainer } from './link.styles';
5
-
6
- type TLinkBase = {
7
- children: ReactNode
8
- mode?: string
9
- $activated: boolean
10
- $elipsis: boolean
11
- $shadow: boolean
12
- disabled: boolean
13
- to: string | Partial<Path>
14
- };
15
-
16
- type TLink = LinkProps & AnchorHTMLAttributes<HTMLAnchorElement> & TLinkBase;
17
-
18
- const LinkRouteComponent = ({ children, mode, $activated, $elipsis, to, $shadow, disabled, ...props }: TLink) => {
19
- return <Router><LinkContainer className='_refLink' to={to} mode={mode} $activated={$activated ? true : false} $elipsis={$elipsis ? true : false} $shadow={$shadow ? true : false} disabled={disabled ? true : false} {...props}>{children}</LinkContainer></Router>;
20
- };
21
-
22
- export default LinkRouteComponent;