@teamturing/react-kit 2.7.2 → 2.8.1

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.
@@ -0,0 +1,11 @@
1
+ type Options = {
2
+ behavior?: ScrollBehavior;
3
+ direction?: 'horizontal' | 'vertical';
4
+ offset?: number;
5
+ };
6
+ export declare const scrollIntoView: ({ childrenRef, scrollContainerRef, options, }: {
7
+ childrenRef: HTMLElement;
8
+ scrollContainerRef?: HTMLElement | undefined;
9
+ options: Options;
10
+ }) => void;
11
+ export {};
@@ -0,0 +1,217 @@
1
+ import typography from '../../packages/token-studio/esm/token/typography/index.js';
2
+ import { useRef, useContext } from 'react';
3
+ import styled from 'styled-components';
4
+ import '../../node_modules/styled-system/dist/index.esm.js';
5
+ import { scrollIntoView } from '../../utils/scrollIntoView.js';
6
+ import View from '../View/index.js';
7
+ import UnstyledButton from '../_UnstyledButton.js';
8
+ import { TabContext } from './index.js';
9
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
10
+ import { variant } from '../../node_modules/@styled-system/variant/dist/index.esm.js';
11
+
12
+ const TabItem = ({
13
+ children,
14
+ leadingIcon: LeadingIcon,
15
+ selected = false,
16
+ onClick,
17
+ size: propSize,
18
+ variant: propVariant
19
+ }) => {
20
+ const ref = useRef(null);
21
+ const {
22
+ size: contextSize,
23
+ variant: contextVariant,
24
+ containerRef
25
+ } = useContext(TabContext);
26
+ const size = propSize ?? contextSize;
27
+ const variant = propVariant ?? contextVariant;
28
+ const handleClick = e => {
29
+ if (containerRef && containerRef.current && ref.current) {
30
+ scrollIntoView({
31
+ scrollContainerRef: containerRef.current,
32
+ childrenRef: ref.current,
33
+ options: {
34
+ behavior: 'smooth',
35
+ offset: 72
36
+ }
37
+ });
38
+ }
39
+ onClick?.(e);
40
+ };
41
+ return /*#__PURE__*/jsxRuntimeExports.jsx(BaseTabItem, {
42
+ role: 'tab',
43
+ ref: ref,
44
+ variant: variant,
45
+ size: size,
46
+ leadingIcon: LeadingIcon,
47
+ selected: selected,
48
+ onClick: handleClick,
49
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(View, {
50
+ sx: {
51
+ display: 'flex',
52
+ flexDirection: 'row',
53
+ alignItems: 'center',
54
+ justifyContent: 'center',
55
+ columnGap: 1
56
+ },
57
+ children: [LeadingIcon ? /*#__PURE__*/jsxRuntimeExports.jsx(LeadingIcon, {}) : null, /*#__PURE__*/jsxRuntimeExports.jsx(View, {
58
+ children: children
59
+ })]
60
+ })
61
+ });
62
+ };
63
+ const BaseTabItem = styled(UnstyledButton)(({
64
+ theme
65
+ }) => ({
66
+ 'width': 'initial',
67
+ 'position': 'relative',
68
+ 'transition': 'background-color 100ms, color 100ms',
69
+ 'whiteSpace': 'nowrap',
70
+ '& svg': {
71
+ transition: 'color 100ms'
72
+ },
73
+ '&:focus-visible': {
74
+ outlineColor: theme.colors['border/focused'],
75
+ outlineStyle: 'solid',
76
+ outlineWidth: 2,
77
+ outlineOffset: 2
78
+ }
79
+ }), () => variant({
80
+ prop: 'size',
81
+ variants: {
82
+ l: {
83
+ 'px': 4,
84
+ 'py': 2,
85
+ 'fontSize': typography['s'].fontSize,
86
+ 'fontWeight': typography['s'].fontWeight,
87
+ 'lineHeight': typography['s'].lineHeight,
88
+ '& svg': {
89
+ width: 20,
90
+ height: 20
91
+ }
92
+ },
93
+ m: {
94
+ 'px': 4,
95
+ 'py': 2,
96
+ 'fontSize': typography['xs'].fontSize,
97
+ 'fontWeight': typography['xs'].fontWeight,
98
+ 'lineHeight': typography['xs'].lineHeight,
99
+ '& svg': {
100
+ width: 20,
101
+ height: 20
102
+ }
103
+ },
104
+ s: {
105
+ 'px': 3,
106
+ 'py': 2,
107
+ 'fontSize': typography['xxs'].fontSize,
108
+ 'fontWeight': typography['xxs'].fontWeight,
109
+ 'lineHeight': typography['xxs'].lineHeight,
110
+ '& svg': {
111
+ width: 16,
112
+ height: 16
113
+ }
114
+ }
115
+ }
116
+ }), ({
117
+ theme,
118
+ selected
119
+ }) => variant({
120
+ prop: 'variant',
121
+ variants: {
122
+ plain: {
123
+ borderRadius: theme.radii.full,
124
+ ...(selected ? {
125
+ 'color': theme.colors['text/neutral'],
126
+ 'backgroundColor': theme.colors['bg/selected/subtle'],
127
+ '& svg': {
128
+ color: theme.colors['icon/selected']
129
+ }
130
+ } : {
131
+ 'color': theme.colors['text/neutral/subtler'],
132
+ 'backgroundColor': theme.colors['bg/neutral/subtler'],
133
+ '& svg': {
134
+ color: theme.colors['icon/neutral']
135
+ },
136
+ '&:hover, &:active': {
137
+ 'color': theme.colors['text/neutral/subtle'],
138
+ '& svg': {
139
+ color: theme.colors['icon/neutral/bolder']
140
+ }
141
+ }
142
+ })
143
+ },
144
+ outlined: {
145
+ borderRadius: theme.radii.full,
146
+ ...(selected ? {
147
+ 'color': theme.colors['text/inverse'],
148
+ 'backgroundColor': theme.colors['bg/selected'],
149
+ '& svg': {
150
+ color: theme.colors['icon/inverse']
151
+ }
152
+ } : {
153
+ 'color': theme.colors['text/neutral/subtler'],
154
+ 'backgroundColor': theme.colors['bg/neutral/subtler'],
155
+ '& svg': {
156
+ color: theme.colors['icon/neutral']
157
+ },
158
+ '&:after': {
159
+ content: '""',
160
+ position: 'absolute',
161
+ top: 0,
162
+ right: 0,
163
+ bottom: 0,
164
+ left: 0,
165
+ borderWidth: 1,
166
+ borderStyle: 'solid',
167
+ borderColor: theme.colors['border/neutral/bolder'],
168
+ borderRadius: theme.radii.full,
169
+ boxSizing: 'border-box'
170
+ },
171
+ '&:hover': {
172
+ backgroundColor: theme.colors['bg/neutral/subtler/hovered']
173
+ },
174
+ '&:active': {
175
+ backgroundColor: theme.colors['bg/neutral/subtler/pressed']
176
+ }
177
+ })
178
+ },
179
+ underline: {
180
+ borderRadius: theme.radii.xxs,
181
+ ...(selected ? {
182
+ 'color': theme.colors['text/selected'],
183
+ 'backgroundColor': theme.colors['bg/neutral/subtler'],
184
+ '& svg': {
185
+ color: theme.colors['icon/selected']
186
+ },
187
+ ':after': {
188
+ content: '""',
189
+ position: 'absolute',
190
+ top: 0,
191
+ right: 0,
192
+ bottom: 0,
193
+ left: 0,
194
+ borderBottomWidth: 2,
195
+ borderBottomStyle: 'solid',
196
+ borderBottomColor: theme.colors['border/selected'],
197
+ borderRadius: theme.radii.none,
198
+ boxSizing: 'border-box'
199
+ }
200
+ } : {
201
+ 'color': theme.colors['text/neutral/subtler'],
202
+ 'backgroundColor': theme.colors['bg/neutral/subtler'],
203
+ '& svg': {
204
+ color: theme.colors['icon/neutral']
205
+ },
206
+ ':hover, :active': {
207
+ 'color': theme.colors['text/neutral/subtle'],
208
+ '& svg': {
209
+ color: theme.colors['icon/neutral/bolder']
210
+ }
211
+ }
212
+ })
213
+ }
214
+ }
215
+ }));
216
+
217
+ export { TabItem as default };
@@ -0,0 +1,147 @@
1
+ import { createContext, useRef, useState, useEffect } from 'react';
2
+ import SvgChevronLeft from '../../packages/icons/esm/ChevronLeft.js';
3
+ import SvgChevronRight from '../../packages/icons/esm/ChevronRight.js';
4
+ import elevation from '../../packages/token-studio/esm/token/elevation/index.js';
5
+ import gradient from '../../packages/token-studio/esm/token/gradient/index.js';
6
+ import '../../packages/token-studio/esm/token/typography/index.js';
7
+ import throttle from '../../node_modules/lodash.throttle/index.js';
8
+ import useResize from '../../hook/useResize.js';
9
+ import { forcePixelValue } from '../../utils/forcePixelValue.js';
10
+ import IconButton from '../IconButton/index.js';
11
+ import View from '../View/index.js';
12
+ import TabItem from './TabItem.js';
13
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
14
+
15
+ const TabContext = /*#__PURE__*/createContext({});
16
+ const Tab = ({
17
+ variant = 'plain',
18
+ size = 'm',
19
+ gap = 2,
20
+ children
21
+ }) => {
22
+ const rootRef = useRef(null);
23
+ const [isLeftButtonVisible, setIsLeftButtonVisible] = useState(rootRef.current ? rootRef.current.scrollLeft > 0 : false);
24
+ const [isRightButtonVisible, setIsRightButtonVisible] = useState(rootRef.current ? rootRef.current.clientWidth + rootRef.current.scrollLeft < rootRef.current.scrollWidth : false);
25
+ const handleScrollButtonVisibility = () => {
26
+ if (rootRef.current) {
27
+ setIsLeftButtonVisible(rootRef.current ? rootRef.current.scrollLeft > 0 : false);
28
+ setIsRightButtonVisible(rootRef.current ? rootRef.current.clientWidth + Math.ceil(rootRef.current.scrollLeft) < rootRef.current.scrollWidth : false);
29
+ }
30
+ };
31
+ const buttonWidth = 32;
32
+ const gradientWidth = 40;
33
+ const handleLeftButtonClick = () => {
34
+ if (rootRef.current) {
35
+ rootRef.current.scrollTo({
36
+ left: rootRef.current.scrollLeft - rootRef.current.clientWidth + buttonWidth + gradientWidth,
37
+ behavior: 'smooth'
38
+ });
39
+ }
40
+ };
41
+ const handleRightButtonClick = () => {
42
+ if (rootRef.current) {
43
+ rootRef.current.scrollTo({
44
+ left: rootRef.current.scrollLeft + rootRef.current.clientWidth - (buttonWidth + gradientWidth),
45
+ behavior: 'smooth'
46
+ });
47
+ }
48
+ };
49
+ useEffect(() => {
50
+ handleScrollButtonVisibility();
51
+ }, []);
52
+ useResize(handleScrollButtonVisibility);
53
+ return /*#__PURE__*/jsxRuntimeExports.jsx(TabContext.Provider, {
54
+ value: {
55
+ variant,
56
+ size,
57
+ containerRef: rootRef
58
+ },
59
+ children: /*#__PURE__*/jsxRuntimeExports.jsxs(View, {
60
+ position: 'relative',
61
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(View, {
62
+ ref: rootRef,
63
+ role: 'tablist',
64
+ sx: {
65
+ 'width': 'auto',
66
+ 'display': 'flex',
67
+ 'flexDirection': 'row',
68
+ 'alignItems': 'center',
69
+ 'columnGap': gap,
70
+ 'overflowX': 'auto',
71
+ 'msOverflowStyle': 'none',
72
+ '::-webkit-scrollbar': {
73
+ display: 'none'
74
+ }
75
+ },
76
+ onScroll: throttle(handleScrollButtonVisibility, 150),
77
+ children: children
78
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs(View, {
79
+ display: ['none', 'initial', 'initial'],
80
+ children: [isLeftButtonVisible ? /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
81
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(View, {
82
+ sx: {
83
+ position: 'absolute',
84
+ top: 0,
85
+ left: forcePixelValue(buttonWidth),
86
+ bottom: 0,
87
+ width: forcePixelValue(gradientWidth),
88
+ height: '100%',
89
+ background: `linear-gradient(${gradient['overlay/floating/toright']})`,
90
+ pointerEvents: 'none'
91
+ }
92
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(View, {
93
+ sx: {
94
+ position: 'absolute',
95
+ display: 'flex',
96
+ alignItems: 'center',
97
+ top: 0,
98
+ left: 0,
99
+ bottom: 0,
100
+ backgroundColor: elevation.surface
101
+ },
102
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(IconButton, {
103
+ size: 's',
104
+ variant: 'plain-bold',
105
+ icon: SvgChevronLeft,
106
+ onClick: handleLeftButtonClick
107
+ })
108
+ })]
109
+ }) : null, isRightButtonVisible ? /*#__PURE__*/jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
110
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(View, {
111
+ sx: {
112
+ position: 'absolute',
113
+ top: 0,
114
+ right: forcePixelValue(buttonWidth),
115
+ bottom: 0,
116
+ width: forcePixelValue(gradientWidth),
117
+ height: '100%',
118
+ background: `linear-gradient(${gradient['overlay/floating/toleft']})`,
119
+ pointerEvents: 'none'
120
+ }
121
+ }), /*#__PURE__*/jsxRuntimeExports.jsx(View, {
122
+ sx: {
123
+ position: 'absolute',
124
+ display: 'flex',
125
+ alignItems: 'center',
126
+ top: 0,
127
+ right: 0,
128
+ bottom: 0,
129
+ backgroundColor: elevation.surface
130
+ },
131
+ children: /*#__PURE__*/jsxRuntimeExports.jsx(IconButton, {
132
+ size: 's',
133
+ variant: 'plain-bold',
134
+ icon: SvgChevronRight,
135
+ onClick: handleRightButtonClick
136
+ })
137
+ })]
138
+ }) : null]
139
+ })]
140
+ })
141
+ });
142
+ };
143
+ var index = Object.assign(Tab, {
144
+ Item: TabItem
145
+ });
146
+
147
+ export { TabContext, index as default };
@@ -0,0 +1,76 @@
1
+ import 'react';
2
+ import SvgCheckInCircle from '../../packages/icons/esm/CheckInCircle.js';
3
+ import SvgExclamationPointInCircle from '../../packages/icons/esm/ExclamationPointInCircle.js';
4
+ import styled from 'styled-components';
5
+ import '../../node_modules/styled-system/dist/index.esm.js';
6
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
7
+ import { variant } from '../../node_modules/@styled-system/variant/dist/index.esm.js';
8
+
9
+ const Toast = ({
10
+ variant = 'success',
11
+ resizing = 'hug',
12
+ children
13
+ }) => {
14
+ const IconByVariant = {
15
+ success: SvgCheckInCircle,
16
+ warning: SvgExclamationPointInCircle
17
+ }[variant];
18
+ return /*#__PURE__*/jsxRuntimeExports.jsxs(BaseToast, {
19
+ variant: variant,
20
+ resizing: resizing,
21
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx(IconByVariant, {}), children]
22
+ });
23
+ };
24
+ const BaseToast = styled.div(({
25
+ theme
26
+ }) => ({
27
+ 'display': 'flex',
28
+ 'flexDirection': 'row',
29
+ 'alignItems': 'center',
30
+ 'columnGap': theme.space[3],
31
+ 'backgroundColor': theme.colors['bg/neutral/bold'],
32
+ 'color': theme.colors['text/inverse'],
33
+ 'borderRadius': theme.radii.m,
34
+ 'padding': theme.space[4],
35
+ 'fontSize': theme.fontSizes.s,
36
+ 'fontWeight': theme.fontWeights.medium,
37
+ 'lineHeight': theme.lineHeights[2],
38
+ '& div': {
39
+ margin: 0,
40
+ display: 'inline-block'
41
+ },
42
+ '& svg': {
43
+ width: 24,
44
+ minWidth: 24,
45
+ height: 24,
46
+ minHeight: 24
47
+ }
48
+ }), ({
49
+ theme
50
+ }) => variant({
51
+ prop: 'variant',
52
+ variants: {
53
+ success: {
54
+ '& svg': {
55
+ color: theme.colors['icon/success']
56
+ }
57
+ },
58
+ warning: {
59
+ '& svg': {
60
+ color: theme.colors['icon/warning']
61
+ }
62
+ }
63
+ }
64
+ }), () => variant({
65
+ prop: 'resizing',
66
+ variants: {
67
+ fill: {
68
+ width: '100%'
69
+ },
70
+ hug: {
71
+ width: 'fit-content'
72
+ }
73
+ }
74
+ }));
75
+
76
+ export { Toast as default };
@@ -0,0 +1,261 @@
1
+ import styled, { keyframes } from 'styled-components';
2
+ import { forcePixelValue } from '../../utils/forcePixelValue.js';
3
+ import { sx } from '../../utils/styled-system/index.js';
4
+ import { j as jsxRuntimeExports } from '../../node_modules/react/jsx-runtime.js';
5
+
6
+ const Tooltip = ({
7
+ children,
8
+ direction = 'top-center',
9
+ text,
10
+ className: propClassName,
11
+ sx
12
+ }) => {
13
+ const className = [propClassName, `tooltip-direction-${direction}`].join(' ');
14
+ return /*#__PURE__*/jsxRuntimeExports.jsx(BaseTooltip, {
15
+ role: 'tooltip',
16
+ "aria-label": text,
17
+ className: className,
18
+ sx: sx,
19
+ children: children
20
+ });
21
+ };
22
+ const tooltipAppear = keyframes`
23
+ from {
24
+ opacity: 0;
25
+ }
26
+
27
+ to {
28
+ opacity: 1;
29
+ }
30
+ `;
31
+ const BaseTooltip = styled.span`
32
+ display: inline-block;
33
+ position: relative;
34
+
35
+ &::before {
36
+ position: absolute;
37
+ z-index: 1000001;
38
+ display: none;
39
+ width: 0px;
40
+ height: 0px;
41
+ color: ${({
42
+ theme
43
+ }) => theme.colors['bg/neutral/bolder']};
44
+ pointer-events: none;
45
+ content: '';
46
+ border: 6px solid transparent;
47
+ opacity: 0;
48
+ }
49
+
50
+ &::after {
51
+ position: absolute;
52
+ z-index: 1000000;
53
+ display: none;
54
+ padding: ${({
55
+ theme
56
+ }) => `${forcePixelValue(theme.space[2])} ${forcePixelValue(theme.space[3])}`};
57
+ font-size: ${({
58
+ theme
59
+ }) => forcePixelValue(theme.fontSizes.xxs)};
60
+ font-weight: ${({
61
+ theme
62
+ }) => theme.fontWeights.medium};
63
+ line-height: ${({
64
+ theme
65
+ }) => theme.lineHeights[2]};
66
+ -webkit-font-smoothing: subpixel-antialiased;
67
+ color: ${({
68
+ theme
69
+ }) => theme.colors['text/inverse']};
70
+ text-align: center;
71
+ text-decoration: none;
72
+ text-shadow: none;
73
+ text-transform: none;
74
+ letter-spacing: normal;
75
+ word-wrap: break-word;
76
+ white-space: pre;
77
+ pointer-events: none;
78
+ content: attr(aria-label);
79
+ background: ${({
80
+ theme
81
+ }) => theme.colors['bg/neutral/bolder']};
82
+ border-radius: ${({
83
+ theme
84
+ }) => forcePixelValue(theme.radii.xs)};
85
+ box-shadow: ${({
86
+ theme
87
+ }) => theme.shadows['shadow/overlay']};
88
+ opacity: 0;
89
+ }
90
+
91
+ &:hover,
92
+ &:active,
93
+ &:focus {
94
+ &::before,
95
+ &::after {
96
+ display: table-cell;
97
+ text-decoration: none;
98
+ animation-name: ${tooltipAppear};
99
+ animation-duration: 100ms;
100
+ animation-fill-mode: forwards;
101
+ animation-timing-function: ease-in;
102
+ animation-delay: 300ms;
103
+ }
104
+ }
105
+
106
+ &.tooltip-direction-bottom-center,
107
+ &.tooltip-direction-bottom-right,
108
+ &.tooltip-direction-bottom-left {
109
+ &::after {
110
+ top: 100%;
111
+ right: 50%;
112
+ margin-top: ${({
113
+ theme
114
+ }) => forcePixelValue(theme.space[2])};
115
+ }
116
+
117
+ &::before {
118
+ top: auto;
119
+ right: 50%;
120
+ bottom: ${({
121
+ theme
122
+ }) => forcePixelValue(theme.space[-2] + theme.space['-0.25'])};
123
+ margin-right: -6px;
124
+ border-bottom-color: ${({
125
+ theme
126
+ }) => theme.colors['bg/neutral/bolder']};
127
+ }
128
+ }
129
+
130
+ &.tooltip-direction-bottom-right {
131
+ &::after {
132
+ right: auto;
133
+ left: 50%;
134
+ margin-left: -${({
135
+ theme
136
+ }) => forcePixelValue(theme.space[4])};
137
+ }
138
+ }
139
+
140
+ &.tooltip-direction-bottom-left::after {
141
+ margin-right: -${({
142
+ theme
143
+ }) => forcePixelValue(theme.space[4])};
144
+ }
145
+
146
+ // Tooltips above the object
147
+ &.tooltip-direction-top-center,
148
+ &.tooltip-direction-top-right,
149
+ &.tooltip-direction-top-left {
150
+ &::after {
151
+ right: 50%;
152
+ bottom: 100%;
153
+ margin-bottom: ${({
154
+ theme
155
+ }) => forcePixelValue(theme.space[2])};
156
+ }
157
+
158
+ &::before {
159
+ top: ${({
160
+ theme
161
+ }) => forcePixelValue(theme.space[-2] + theme.space['-0.25'])};
162
+ right: 50%;
163
+ bottom: auto;
164
+ margin-right: -6px;
165
+ border-top-color: ${({
166
+ theme
167
+ }) => theme.colors['bg/neutral/bolder']};
168
+ }
169
+ }
170
+
171
+ &.tooltip-direction-top-right {
172
+ &::after {
173
+ right: auto;
174
+ left: 50%;
175
+ margin-left: -${({
176
+ theme
177
+ }) => forcePixelValue(theme.space[4])};
178
+ }
179
+ }
180
+
181
+ &.tooltip-direction-top-left::after {
182
+ margin-right: -${({
183
+ theme
184
+ }) => forcePixelValue(theme.space[4])};
185
+ }
186
+
187
+ &.tooltip-direction-top-center::after,
188
+ &.tooltip-direction-bottom-center::after {
189
+ transform: translateX(50%);
190
+ }
191
+
192
+ &.tooltip-direction-left {
193
+ &::after {
194
+ right: 100%;
195
+ bottom: 50%;
196
+ margin-right: ${({
197
+ theme
198
+ }) => forcePixelValue(theme.space[2])};
199
+ transform: translateY(50%);
200
+ }
201
+
202
+ &::before {
203
+ top: 50%;
204
+ bottom: 50%;
205
+ left: ${({
206
+ theme
207
+ }) => forcePixelValue(theme.space[-2] + theme.space['-0.25'])};
208
+ margin-top: -6px;
209
+ border-left-color: ${({
210
+ theme
211
+ }) => theme.colors['bg/neutral/bolder']};
212
+ }
213
+ }
214
+
215
+ &.tooltip-direction-right {
216
+ &::after {
217
+ bottom: 50%;
218
+ left: 100%;
219
+ margin-left: ${({
220
+ theme
221
+ }) => forcePixelValue(theme.space[2])};
222
+ transform: translateY(50%);
223
+ }
224
+
225
+ &::before {
226
+ top: 50%;
227
+ right: ${({
228
+ theme
229
+ }) => forcePixelValue(theme.space[-2] + theme.space['-0.25'])};
230
+ bottom: 50%;
231
+ margin-top: -6px;
232
+ border-right-color: ${({
233
+ theme
234
+ }) => theme.colors['bg/neutral/bolder']};
235
+ }
236
+ }
237
+
238
+ &::after {
239
+ width: max-content;
240
+ max-width: 240px;
241
+ word-wrap: break-word;
242
+ white-space: pre-line;
243
+ border-collapse: separate;
244
+ }
245
+
246
+ &.tooltip-direction-bottom-center::after,
247
+ &.tooltip-direction-top-center::after {
248
+ right: auto;
249
+ left: 50%;
250
+ transform: translateX(-50%);
251
+ }
252
+
253
+ &.tooltip-direction-left::after,
254
+ &.tooltip-direction-right::after {
255
+ right: 100%;
256
+ }
257
+
258
+ ${sx}
259
+ `;
260
+
261
+ export { Tooltip as default };