@luminati-io/uikit 1.2.2 → 1.4.0

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.
Files changed (94) hide show
  1. package/assets/icons/account.svg +8 -0
  2. package/assets/icons/adapt.svg +4 -0
  3. package/assets/icons/add.svg +3 -0
  4. package/assets/icons/add_circle.svg +5 -0
  5. package/assets/icons/add_funds.svg +7 -0
  6. package/assets/icons/attach.svg +3 -0
  7. package/assets/icons/book_help.svg +4 -0
  8. package/assets/icons/building.svg +3 -0
  9. package/assets/icons/calendar.svg +13 -0
  10. package/assets/icons/calendar_graph.svg +14 -0
  11. package/assets/icons/call.svg +5 -0
  12. package/assets/icons/camera.svg +5 -0
  13. package/assets/icons/cart.svg +3 -0
  14. package/assets/icons/close.svg +3 -0
  15. package/assets/icons/close_circle.svg +3 -0
  16. package/assets/icons/close_small.svg +5 -0
  17. package/assets/icons/collapse.svg +4 -0
  18. package/assets/icons/column.svg +22 -0
  19. package/assets/icons/columns.svg +10 -0
  20. package/assets/icons/connect.svg +3 -0
  21. package/assets/icons/contact_support.svg +3 -0
  22. package/assets/icons/copy.svg +3 -0
  23. package/assets/icons/copy_small.svg +3 -0
  24. package/assets/icons/customize.svg +6 -0
  25. package/assets/icons/dataset.svg +3 -0
  26. package/assets/icons/delete.svg +4 -4
  27. package/assets/icons/desktop.svg +3 -0
  28. package/assets/icons/dislike.svg +3 -0
  29. package/assets/icons/doc_new.svg +8 -0
  30. package/assets/icons/document.svg +3 -0
  31. package/assets/icons/dots_horizontal.svg +3 -0
  32. package/assets/icons/dots_vertical.svg +3 -0
  33. package/assets/icons/download.svg +3 -0
  34. package/assets/icons/drag_and_drop.svg +3 -0
  35. package/assets/icons/edit.svg +3 -0
  36. package/assets/icons/edit_small.svg +3 -0
  37. package/assets/icons/envelope.svg +4 -0
  38. package/assets/icons/file_csv.svg +7 -0
  39. package/assets/icons/file_json.svg +8 -0
  40. package/assets/icons/filter.svg +3 -0
  41. package/assets/icons/folder.svg +3 -0
  42. package/assets/icons/forward.svg +3 -0
  43. package/assets/icons/index.js +162 -4
  44. package/assets/icons/info.svg +3 -0
  45. package/assets/icons/invite.svg +3 -0
  46. package/assets/icons/lightning.svg +3 -0
  47. package/assets/icons/like.svg +3 -0
  48. package/assets/icons/link_ext.svg +4 -0
  49. package/assets/icons/lock.svg +4 -0
  50. package/assets/icons/login.svg +12 -0
  51. package/assets/icons/logout.svg +4 -0
  52. package/assets/icons/maximize.svg +4 -0
  53. package/assets/icons/mention.svg +3 -0
  54. package/assets/icons/menu_close.svg +3 -0
  55. package/assets/icons/menu_expand.svg +3 -0
  56. package/assets/icons/message.svg +3 -0
  57. package/assets/icons/minimize.svg +4 -0
  58. package/assets/icons/minus.svg +3 -0
  59. package/assets/icons/monitor.svg +3 -0
  60. package/assets/icons/on_off.svg +8 -0
  61. package/assets/icons/pause.svg +3 -0
  62. package/assets/icons/pin.svg +3 -0
  63. package/assets/icons/play.svg +3 -0
  64. package/assets/icons/publish.svg +9 -0
  65. package/assets/icons/question.svg +3 -0
  66. package/assets/icons/queue.svg +8 -0
  67. package/assets/icons/referal.svg +4 -0
  68. package/assets/icons/refresh.svg +3 -0
  69. package/assets/icons/reset.svg +4 -0
  70. package/assets/icons/search.svg +10 -0
  71. package/assets/icons/seo.svg +17 -0
  72. package/assets/icons/settings.svg +3 -0
  73. package/assets/icons/smartphone.svg +4 -0
  74. package/assets/icons/sort.svg +4 -0
  75. package/assets/icons/sum.svg +3 -0
  76. package/assets/icons/trash.svg +3 -0
  77. package/assets/icons/unpin.svg +4 -0
  78. package/assets/icons/upgrade.svg +11 -0
  79. package/assets/icons/upload.svg +4 -0
  80. package/assets/icons/upload_cloud.svg +4 -0
  81. package/assets/icons/verify.svg +4 -0
  82. package/dist/uikit.umd.js +1 -1
  83. package/package.json +6 -3
  84. package/src/button/button.js +121 -0
  85. package/src/button/index.js +6 -0
  86. package/src/button/loading_icon.js +46 -0
  87. package/src/icon.js +16 -24
  88. package/src/icon_button.js +75 -0
  89. package/src/index.js +27 -10
  90. package/src/infochip.js +8 -6
  91. package/src/progress/index.js +1 -1
  92. package/src/tooltip.js +96 -0
  93. package/src/utils.js +136 -1
  94. package/src/button.js +0 -180
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luminati-io/uikit",
3
- "version": "1.2.2",
3
+ "version": "1.4.0",
4
4
  "author": "Bright Data (http://brightdata.com)",
5
5
  "license": "ISC",
6
6
  "description": "brightdata's design system",
@@ -12,9 +12,11 @@
12
12
  "webpack.*.js"
13
13
  ],
14
14
  "dependencies": {
15
- "styled-components": "^5.3.6",
15
+ "@popperjs/core": "^2.11.6",
16
+ "lodash": "^4.17.21",
16
17
  "prop-types": "^15.8.1",
17
- "lodash": "^4.17.21"
18
+ "react-popper": "^2.3.0",
19
+ "styled-components": "^5.3.6"
18
20
  },
19
21
  "peerDependencies": {
20
22
  "react": ">=16.9.0",
@@ -30,6 +32,7 @@
30
32
  "@storybook/addon-links": "^6.5.15",
31
33
  "@storybook/builder-webpack4": "^6.5.15",
32
34
  "@storybook/builder-webpack5": "^6.5.15",
35
+ "@storybook/jest": "0.0.10",
33
36
  "@storybook/manager-webpack4": "^6.5.15",
34
37
  "@storybook/manager-webpack5": "^6.5.15",
35
38
  "@storybook/react": "^6.5.15",
@@ -0,0 +1,121 @@
1
+ // LICENSE_CODE ZON
2
+ 'use strict'; /*jslint react:true*/
3
+
4
+ import React from 'react';
5
+ import styled, {css} from 'styled-components';
6
+ import PT from 'prop-types';
7
+ import {
8
+ iconNames,
9
+ toPixel,
10
+ toButtonSize,
11
+ getCommonProps,
12
+ getButtonColors,
13
+ getIconProps,
14
+ } from '../utils';
15
+ import typography from '../Typography';
16
+ import Icon from '../icon';
17
+ import LoadingIcon from './loading_icon';
18
+
19
+ const {Typography, Label} = typography;
20
+
21
+ const Button = React.forwardRef((props, ref)=>{
22
+ const {
23
+ text,
24
+ variant,
25
+ size,
26
+ disabled,
27
+ loading,
28
+ loadingText,
29
+ } = props;
30
+ const {isLeft, isRight, ...iconProps} = getIconProps('Button', props);
31
+ return <StyledButton
32
+ ref={ref}
33
+ type="button"
34
+ {...getCommonProps(props)}
35
+ variant={variant}
36
+ size={size}
37
+ disabled={loading||disabled}
38
+ iconPlacement={isLeft||loading?'left':isRight?'right':''}
39
+ >
40
+ {loading&&<LoadingIcon size={iconProps.size}/>}
41
+ {isLeft&&!loading&&<Icon {...iconProps}/>}
42
+ <Label variant={size=='xs'?'sm':'lg'} no_wrap>
43
+ {loading?loadingText:text}
44
+ </Label>
45
+ {isRight&&!loading&&<Icon {...iconProps}/>}
46
+ </StyledButton>;
47
+ });
48
+ Button.displayName = 'Button';
49
+ Button.defaultProps = {
50
+ variant: 'primary',
51
+ size: 'md',
52
+ iconPlacement: 'left',
53
+ loadingText: 'Loading...',
54
+ };
55
+ Button.propTypes = {
56
+ text: PT.string.isRequired,
57
+ variant: PT.oneOf(['primary', 'secondary', 'negative',
58
+ 'negative_secondary', 'positive', 'white']),
59
+ size: PT.oneOf(['xs', 'sm', 'md', 'lg']),
60
+ icon: PT.oneOf(iconNames),
61
+ iconPlacement: PT.oneOf(['left', 'right']),
62
+ disabled: PT.bool,
63
+ loading: PT.bool,
64
+ loadingText: PT.string,
65
+ };
66
+
67
+ const StyledButton = styled.button`
68
+ display: inline-flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ border-radius: 4px;
72
+ cursor: pointer;
73
+ &:disabled { cursor: not-allowed; }
74
+ text-decoration: none;
75
+ &:hover, &:visited, :focus { text-decoration: none; }
76
+ ${props=>{
77
+ let gap = 4;
78
+ let paddingLeft = 16;
79
+ let paddingRight = 16;
80
+ if (props.iconPlacement=='left')
81
+ paddingLeft = 12;
82
+ else if (props.iconPlacement=='right')
83
+ paddingRight = 12;
84
+ if (props.size=='xs')
85
+ {
86
+ gap = 2;
87
+ paddingLeft = paddingRight = 8;
88
+ }
89
+ return css`
90
+ gap: ${toPixel(gap)};
91
+ padding-left: ${toPixel(paddingLeft)};
92
+ padding-right: ${toPixel(paddingRight)};
93
+ `;
94
+ }}
95
+ ${props=>{
96
+ const colors = getButtonColors(props);
97
+ return css`
98
+ background-color: ${colors.backColor};
99
+ border: ${colors.border||'0 none'};
100
+ ${Typography} { color: ${colors.color}; }
101
+ [data-icon] {
102
+ color: ${colors.iconColor||colors.color};
103
+ }
104
+ ${colors.hover&&`&:hover {
105
+ background-color: ${colors.hover.backColor};
106
+ }`}
107
+ ${colors.active&&`&:active {
108
+ background-color: ${colors.active.backColor};
109
+ border: ${colors.active.border};
110
+ box-shadow: ${colors.active.boxShadow};
111
+ ${colors.active.iconColor&&`[data-icon] {
112
+ color: ${colors.active.iconColor};
113
+ }`}
114
+ }`}
115
+ `;
116
+ }}
117
+ ${props=>toButtonSize(props.size)}
118
+ `;
119
+ StyledButton.displayName = 'StyledButton';
120
+
121
+ export default Button;
@@ -0,0 +1,6 @@
1
+ // LICENSE_CODE ZON
2
+ 'use strict'; /*jslint react:true*/
3
+
4
+ import Button from './button';
5
+
6
+ export {Button};
@@ -0,0 +1,46 @@
1
+ // LICENSE_CODE ZON
2
+ 'use strict'; /*jslint react:true*/
3
+
4
+ import React from 'react';
5
+ import styled from 'styled-components';
6
+ import {toIconSize} from '../utils';
7
+
8
+ const LoadingIcon = props=>
9
+ <Spinner stroke="rgba(0,106,220,1)" viewBox="0 0 24 24" {...props}>
10
+ <g className="spinner_V8m1">
11
+ <circle cx="12" cy="12" r="9.5" fill="none" strokeWidth="3"/>
12
+ </g>
13
+ </Spinner>;
14
+
15
+ const Spinner = styled.svg`
16
+ ${props=>toIconSize(props.size)}
17
+ .spinner_V8m1 {
18
+ transform-origin: center;
19
+ animation: spinner_zKoa 2s linear infinite
20
+ }
21
+ .spinner_V8m1 circle {
22
+ stroke-linecap: round;
23
+ animation: spinner_YpZS 1.5s ease-in-out infinite
24
+ }
25
+ @keyframes spinner_zKoa {
26
+ 100% {
27
+ transform: rotate(360deg)
28
+ }
29
+ }
30
+ @keyframes spinner_YpZS {
31
+ 0% {
32
+ stroke-dasharray: 0 150;
33
+ stroke-dashoffset: 0
34
+ }
35
+ 47.5% {
36
+ stroke-dasharray: 42 150;
37
+ stroke-dashoffset: -16
38
+ }
39
+ 95%, 100% {
40
+ stroke-dasharray: 42 150;
41
+ stroke-dashoffset: -59
42
+ }
43
+ }
44
+ `;
45
+
46
+ export default LoadingIcon;
package/src/icon.js CHANGED
@@ -5,7 +5,7 @@ import React from 'react';
5
5
  import styled, {css} from 'styled-components';
6
6
  import PT from 'prop-types';
7
7
 
8
- import {theme, toPixel} from './utils';
8
+ import {theme, toPixel, colorNames, iconNames} from './utils';
9
9
  import icons from '@icons';
10
10
 
11
11
  const toIconSize = size=>{
@@ -27,40 +27,32 @@ const toIconSize = size=>{
27
27
  };
28
28
 
29
29
  const Icon = React.forwardRef((props, ref)=>{
30
- const {name, size, color, no_mask} = props;
30
+ const {name, size, color} = props;
31
31
  const ic = icons[name];
32
32
  if (!ic)
33
33
  return null;
34
- const maskId = 'svgmask';
35
- if (no_mask)
36
- {
37
- return <IconContainer ref={ref} size={size}>
38
- <svg viewBox={ic.viewBox}>
39
- <use href={`#${ic.id}`}/>
40
- </svg>
41
- </IconContainer>;
42
- }
43
- return <IconContainer ref={ref} size={size}>
44
- <svg viewBox={ic.viewBox}>
45
- <mask id={maskId}><use href={`#${ic.id}`}/></mask>
46
- <rect fill={theme.color[color]} width="100%" height="100%"
47
- mask={`url(#${maskId})`}/>
48
- </svg>
49
- </IconContainer>;
34
+ return <StyledSvg
35
+ ref={ref}
36
+ size={size}
37
+ viewBox={ic.viewBox}
38
+ color={theme.color[color]}
39
+ data-icon={name}
40
+ >
41
+ <use href={`#${ic.id}`}/>
42
+ </StyledSvg>;
50
43
  });
51
44
  Icon.displayName = 'Icon';
52
45
  Icon.defaultProps = {size: 'md'};
53
46
  Icon.propTypes = {
54
- name: PT.string.isRequired,
55
- color: PT.string,
47
+ name: PT.oneOf(iconNames).isRequired,
48
+ color: PT.oneOf(colorNames),
56
49
  size: PT.oneOf(['xxs', 'xs', 'sm', 'md', 'lg', 'xl']),
57
- no_mask: PT.oneOfType([PT.bool, PT.number]),
58
50
  };
59
51
 
60
- const IconContainer = styled.span`
61
- display: inline-block;
52
+ export const StyledSvg = styled.svg`
53
+ color: ${props=>props.color};
62
54
  ${props=>toIconSize(props.size)}
63
55
  `;
64
- IconContainer.displayName = 'IconContainer';
56
+ StyledSvg.displayName = 'StyledSvg';
65
57
 
66
58
  export default Icon;
@@ -0,0 +1,75 @@
1
+ // LICENSE_CODE ZON
2
+ 'use strict'; /*jslint react:true*/
3
+
4
+ import React from 'react';
5
+ import styled, {css} from 'styled-components';
6
+ import PT from 'prop-types';
7
+ import utils from './utils';
8
+ import Icon, {StyledSvg as IconSvg} from './icon';
9
+
10
+ const {theme, toPixel, getCommonProps, iconNames} = utils;
11
+
12
+ const IconButton = React.forwardRef((props, ref)=>{
13
+ const {variant: $variant, disabled, icon} = props;
14
+ const p = {...getCommonProps(props), disabled, $variant};
15
+ return <StyledIconButton ref={ref} {...p} data-testid="icon_button">
16
+ <Icon name={icon} size="sm" />
17
+ </StyledIconButton>;
18
+ });
19
+ IconButton.displayName = 'IconButton';
20
+ IconButton.defaultProps = {variant: 'icon-button'};
21
+ IconButton.propTypes = {
22
+ variant: PT.oneOf(['icon', 'icon-button']),
23
+ icon: PT.oneOf(iconNames).isRequired,
24
+ disabled: PT.bool,
25
+ };
26
+
27
+ const StyledIconButton = styled.button`
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ border-radius: 4px;
32
+ padding: 0;
33
+ cursor: pointer;
34
+ ${props=>{
35
+ return css`
36
+ background-color: ${theme.color.white};
37
+ border: ${props.$variant=='icon'?'0 none;':
38
+ `1px solid ${theme.color.gray_6}`};
39
+ ${IconSvg} {
40
+ color: ${theme.color.gray_9};
41
+ }
42
+ `;
43
+ }}
44
+ &:hover:not(:disabled) {
45
+ background-color: ${theme.color.gray_2};
46
+ border: ${props=>props.$variant=='icon'?'0 none;':
47
+ `1px solid ${theme.color.gray_8}`};
48
+ }
49
+ &:active:not(:disabled) {
50
+ background-color: ${theme.color.blue_4};
51
+ border: ${props=>props.$variant=='icon'?'0 none;':
52
+ `1px solid ${theme.color.blue_4}`};
53
+ ${IconSvg} {
54
+ color: ${theme.color.blue_11};
55
+ }
56
+ }
57
+ &:disabled {
58
+ border: ${props=>props.$variant=='icon'?'0 none;':
59
+ `1px solid ${theme.color.gray_7}`};
60
+ ${IconSvg} {
61
+ color: ${theme.color.gray_7};
62
+ }
63
+ cursor: not-allowed;
64
+ }
65
+ ${props=>{
66
+ let w = props.$variant=='icon'?24:36;
67
+ return css`
68
+ width: ${toPixel(w)};
69
+ height: ${toPixel(w)};
70
+ `;
71
+ }}
72
+ `;
73
+ StyledIconButton.displayName = 'StyledIconButton';
74
+
75
+ export default IconButton;
package/src/index.js CHANGED
@@ -1,21 +1,38 @@
1
1
  // LICENSE_CODE ZON
2
2
  'use strict'; /*jslint react:true*/
3
- import Button from './button';
4
- import typography from './Typography';
3
+ import {Button} from './button';
4
+ import Typography from './Typography';
5
5
  import InfoChip from './infochip';
6
- import layout from './layout';
7
- import progress from './progress';
6
+ import Layout from './layout';
7
+ import {Progress, ProgressBar} from './progress';
8
8
  import Icon from './icon';
9
+ import IconButton from './icon_button';
10
+ import Tooltip, {withTooltip} from './tooltip';
9
11
 
10
- const {Header, Label, Hyperlink, Paragraph} = typography;
11
- const {Box, Flex} = layout;
12
- const {Progress, ProgressBar} = progress;
12
+ export {
13
+ Layout,
14
+ Typography,
15
+ Button,
16
+ InfoChip,
17
+ Progress,
18
+ ProgressBar,
19
+ Icon,
20
+ IconButton,
21
+ Tooltip,
22
+ withTooltip,
23
+ };
13
24
 
14
- export const Layout = {Box, Flex};
15
- export const Typography = {Header, Label, Hyperlink, Paragraph};
16
25
  const UIKit = {
17
26
  Layout,
18
27
  Typography,
19
- Button, InfoChip, Progress, ProgressBar, Icon,
28
+ Button,
29
+ InfoChip,
30
+ Progress,
31
+ ProgressBar,
32
+ Icon,
33
+ IconButton,
34
+ Tooltip,
35
+ withTooltip,
20
36
  };
37
+
21
38
  export default UIKit;
package/src/infochip.js CHANGED
@@ -5,9 +5,10 @@ import React from 'react';
5
5
  import styled from 'styled-components';
6
6
  import PT from 'prop-types';
7
7
 
8
- import {theme} from './utils';
8
+ import {theme, iconNames, getCommonProps} from './utils';
9
9
  import Flex from './layout/flex';
10
10
  import typography from './Typography';
11
+ import Icon from './icon';
11
12
 
12
13
  const {Label} = typography;
13
14
 
@@ -23,14 +24,14 @@ const InfoChipWrapper = styled(Flex).attrs({
23
24
 
24
25
  const InfoChip = props=>{
25
26
  const {variant, text, icon} = props;
26
- const bg_colors = {
27
+ const bgColors = {
27
28
  default: 'gray_3',
28
29
  success: 'green_3',
29
30
  alert: 'red_3',
30
31
  warning: 'yellow_3',
31
32
  info: 'blue_3',
32
33
  };
33
- const bg_color = bg_colors[variant] || bg_colors.default;
34
+ const bgColor = bgColors[variant] || bgColors.default;
34
35
  const colors = {
35
36
  default: 'gray_11_50',
36
37
  success: 'green_11',
@@ -39,8 +40,9 @@ const InfoChip = props=>{
39
40
  info: 'blue_11',
40
41
  };
41
42
  const color = colors[variant] || colors.default;
42
- return <InfoChipWrapper color={bg_color}>
43
- {/* {icon && <Icon size="xxs" color={color} name={icon}/>} */}
43
+ const commonProps = getCommonProps(props);
44
+ return <InfoChipWrapper color={bgColor} {...commonProps}>
45
+ {icon && <Icon size="xxs" color={color} name={icon}/>}
44
46
  <Label variant="xs" color={color}>{text}</Label>
45
47
  </InfoChipWrapper>;
46
48
  };
@@ -49,7 +51,7 @@ InfoChip.defaultProps = {variant: 'default'};
49
51
  InfoChip.propTypes = {
50
52
  variant: PT.oneOf(['default', 'success', 'alert', 'warning', 'info']),
51
53
  text: PT.string,
52
- icon: PT.string,
54
+ icon: PT.oneOf(iconNames),
53
55
  };
54
56
 
55
57
  export default InfoChip;
@@ -4,4 +4,4 @@
4
4
  import Progress from './progess';
5
5
  import ProgressBar from './progress_bar';
6
6
 
7
- export default {Progress, ProgressBar};
7
+ export {Progress, ProgressBar};
package/src/tooltip.js ADDED
@@ -0,0 +1,96 @@
1
+ // LICENSE_CODE ZON
2
+ 'use strict'; /*jslint react:true*/
3
+
4
+ import React, {useCallback, useState} from 'react';
5
+ import {usePopper} from 'react-popper';
6
+ import styled from 'styled-components';
7
+ import PT from 'prop-types';
8
+ import {theme} from './utils';
9
+ import typography from './Typography';
10
+
11
+ const {Label} = typography;
12
+
13
+ const Tooltip = props=>{
14
+ const {children, tooltip, placement} = props;
15
+ const [referenceElement, setReferenceElement] = useState(null);
16
+ const [popperElement, setPopperElement] = useState(null);
17
+ const [arrowElement, setArrowElement] = useState(null);
18
+ const [visible, setVisible] = useState(false);
19
+ const show = useCallback(()=>setVisible(true), []);
20
+ const hide = useCallback(()=>setVisible(false), []);
21
+ const {styles, attributes} = usePopper(referenceElement,
22
+ popperElement, {
23
+ placement,
24
+ modifiers: [
25
+ {name: 'arrow', options: {element: arrowElement}},
26
+ {name: 'offset', options: {offset: [0, 8]}},
27
+ ],
28
+ });
29
+ return <>
30
+ <StyledTooltipReference ref={setReferenceElement}
31
+ onMouseEnter={show} onMouseLeave={hide}>
32
+ {children}
33
+ </StyledTooltipReference>
34
+ <StyledTooltipBody ref={setPopperElement} style={styles.popper}
35
+ {...attributes.popper} visible={visible}>
36
+ <Label variant="sm" color="white">{tooltip}</Label>
37
+ <StyledTooltipArrow ref={setArrowElement} style={styles.arrow}
38
+ {...attributes.arrow} visible={visible}/>
39
+ </StyledTooltipBody>
40
+ </>;
41
+ };
42
+ Tooltip.propTypes = {
43
+ tooltip: PT.node,
44
+ placement: PT.oneOf(['auto', 'top', 'right', 'bottom', 'left']),
45
+ };
46
+
47
+ export const withTooltip = (Comp, tooltipProps)=>function WithTooltip(props){
48
+ return <Tooltip {...tooltipProps}>
49
+ <Comp {...props}/>
50
+ </Tooltip>;
51
+ };
52
+
53
+ const StyledTooltipBody = styled.div`
54
+ background-color: ${theme.color.gray_11_50};
55
+ padding: ${theme.spacing['03']};
56
+ width: fit-content;
57
+ max-width: 500px;
58
+ border-radius: ${theme.spacing['02']};
59
+ visibility: ${props=>props.visible ? 'visible': 'hidden'};
60
+ opacity: ${props=>props.visible ? 1 : 0};
61
+ transition: opacity 200ms;
62
+ `;
63
+
64
+ const StyledTooltipArrow = styled.div`
65
+ &, &::before {
66
+ position: absolute;
67
+ width: ${theme.spacing['04']};
68
+ height: ${theme.spacing['04']};
69
+ background: inherit;
70
+ border-radius: ${theme.spacing['01']};
71
+ }
72
+ visibility: hidden;
73
+ &::before {
74
+ visibility: ${props=>props.visible ? 'visible': 'hidden'};
75
+ content: '';
76
+ transform: rotate(45deg);
77
+ }
78
+ [data-popper-placement^='top'] > & {
79
+ bottom: -${theme.spacing['02']};
80
+ }
81
+ [data-popper-placement^='right'] > & {
82
+ left: -${theme.spacing['02']};
83
+ }
84
+ [data-popper-placement^='bottom'] > & {
85
+ top: -${theme.spacing['02']};
86
+ }
87
+ [data-popper-placement^='left'] > & {
88
+ right: -${theme.spacing['02']};
89
+ }
90
+ `;
91
+
92
+ const StyledTooltipReference = styled.div`
93
+ width: fit-content;
94
+ `;
95
+
96
+ export default Tooltip;