@cleartrip/ct-design-tooltip 4.0.0 → 5.1.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 (63) hide show
  1. package/README.md +97 -0
  2. package/dist/Tooltip.d.ts +2 -5
  3. package/dist/Tooltip.d.ts.map +1 -1
  4. package/dist/Tooltip.native.d.ts +11 -0
  5. package/dist/Tooltip.native.d.ts.map +1 -0
  6. package/dist/TooltipArrow.d.ts +10 -0
  7. package/dist/TooltipArrow.d.ts.map +1 -0
  8. package/dist/TooltipContainer.d.ts +14 -0
  9. package/dist/TooltipContainer.d.ts.map +1 -0
  10. package/dist/constants.d.ts +19 -0
  11. package/dist/constants.d.ts.map +1 -0
  12. package/dist/ct-design-tooltip.browser.cjs.js +1 -1
  13. package/dist/ct-design-tooltip.browser.cjs.js.map +1 -1
  14. package/dist/ct-design-tooltip.browser.esm.js +1 -1
  15. package/dist/ct-design-tooltip.browser.esm.js.map +1 -1
  16. package/dist/ct-design-tooltip.cjs.js +377 -116
  17. package/dist/ct-design-tooltip.cjs.js.map +1 -1
  18. package/dist/ct-design-tooltip.esm.js +377 -112
  19. package/dist/ct-design-tooltip.esm.js.map +1 -1
  20. package/dist/ct-design-tooltip.umd.js +2020 -149
  21. package/dist/ct-design-tooltip.umd.js.map +1 -1
  22. package/dist/index.d.ts +2 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/style.d.ts +112 -13
  25. package/dist/style.d.ts.map +1 -1
  26. package/dist/type.d.ts +42 -19
  27. package/dist/type.d.ts.map +1 -1
  28. package/dist/webStyle.d.ts +170 -0
  29. package/dist/webStyle.d.ts.map +1 -0
  30. package/package.json +24 -16
  31. package/src/Tooltip.native.tsx +230 -0
  32. package/src/Tooltip.tsx +137 -0
  33. package/src/TooltipArrow.tsx +39 -0
  34. package/src/TooltipContainer.tsx +46 -0
  35. package/src/constants.ts +20 -0
  36. package/src/index.ts +3 -0
  37. package/src/style.ts +370 -0
  38. package/src/type.ts +111 -0
  39. package/src/webStyle.ts +354 -0
  40. package/dist/StyledTooltip/StyledTooltip.d.ts +0 -4
  41. package/dist/StyledTooltip/StyledTooltip.d.ts.map +0 -1
  42. package/dist/StyledTooltip/index.d.ts +0 -2
  43. package/dist/StyledTooltip/index.d.ts.map +0 -1
  44. package/dist/StyledTooltip/style.d.ts +0 -6
  45. package/dist/StyledTooltip/style.d.ts.map +0 -1
  46. package/dist/StyledTooltip/type.d.ts +0 -6
  47. package/dist/StyledTooltip/type.d.ts.map +0 -1
  48. package/dist/TooltipArrow/StyledTooltipArrow/StyledTooltipArrow.d.ts +0 -4
  49. package/dist/TooltipArrow/StyledTooltipArrow/StyledTooltipArrow.d.ts.map +0 -1
  50. package/dist/TooltipArrow/StyledTooltipArrow/index.d.ts +0 -2
  51. package/dist/TooltipArrow/StyledTooltipArrow/index.d.ts.map +0 -1
  52. package/dist/TooltipArrow/StyledTooltipArrow/style.d.ts +0 -7
  53. package/dist/TooltipArrow/StyledTooltipArrow/style.d.ts.map +0 -1
  54. package/dist/TooltipArrow/StyledTooltipArrow/type.d.ts +0 -8
  55. package/dist/TooltipArrow/StyledTooltipArrow/type.d.ts.map +0 -1
  56. package/dist/TooltipArrow/TooltipArrow.d.ts +0 -5
  57. package/dist/TooltipArrow/TooltipArrow.d.ts.map +0 -1
  58. package/dist/TooltipArrow/index.d.ts +0 -2
  59. package/dist/TooltipArrow/index.d.ts.map +0 -1
  60. package/dist/TooltipArrow/style.d.ts +0 -30
  61. package/dist/TooltipArrow/style.d.ts.map +0 -1
  62. package/dist/TooltipArrow/type.d.ts +0 -7
  63. package/dist/TooltipArrow/type.d.ts.map +0 -1
@@ -1,162 +1,423 @@
1
1
  'use strict';
2
2
 
3
- var tslib = require('tslib');
4
3
  var jsxRuntime = require('react/jsx-runtime');
5
- var React = require('react');
4
+ var react = require('react');
6
5
  var ctDesignTheme = require('@cleartrip/ct-design-theme');
7
6
  var ctDesignContainer = require('@cleartrip/ct-design-container');
8
- var styled = require('styled-components');
9
- var ctDesignIcons = require('@cleartrip/ct-design-icons');
10
- var ctDesignPortal = require('@cleartrip/ct-design-portal');
11
- var ConditionalWrap = require('@cleartrip/ct-design-conditional-wrap');
12
- var useMergeRefs = require('@cleartrip/ct-design-use-merge-refs');
13
- var useIsomorphicEffect = require('@cleartrip/ct-design-use-isomorphic-effect');
7
+ var Conditional = require('@cleartrip/ct-design-conditional-wrap');
8
+ var ctDesignStyleManager = require('@cleartrip/ct-design-style-manager');
9
+ var ctDesignCommonUtils = require('@cleartrip/ct-design-common-utils');
10
+ var css = require('@emotion/css');
14
11
  var ctDesignTransition = require('@cleartrip/ct-design-transition');
12
+ var ctDesignIcons = require('@cleartrip/ct-design-icons');
15
13
 
16
14
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
17
15
 
18
- var React__default = /*#__PURE__*/_interopDefault(React);
19
- var styled__default = /*#__PURE__*/_interopDefault(styled);
20
- var ConditionalWrap__default = /*#__PURE__*/_interopDefault(ConditionalWrap);
21
- var useMergeRefs__default = /*#__PURE__*/_interopDefault(useMergeRefs);
22
- var useIsomorphicEffect__default = /*#__PURE__*/_interopDefault(useIsomorphicEffect);
16
+ var Conditional__default = /*#__PURE__*/_interopDefault(Conditional);
23
17
 
24
- exports.ArrowDirection = void 0;
25
- (function (ArrowDirection) {
26
- ArrowDirection["LEFT"] = "left";
27
- ArrowDirection["RIGHT"] = "right";
28
- ArrowDirection["UP"] = "up";
29
- ArrowDirection["DOWN"] = "down";
30
- })(exports.ArrowDirection || (exports.ArrowDirection = {}));
18
+ exports.positions = void 0;
19
+ (function (positions) {
20
+ positions["TOP"] = "top";
21
+ positions["RIGHT"] = "right";
22
+ positions["BOTTOM"] = "bottom";
23
+ positions["LEFT"] = "left";
24
+ positions["AUTO"] = "auto";
25
+ })(exports.positions || (exports.positions = {}));
26
+ exports.overlayBorderRadius = void 0;
27
+ (function (overlayBorderRadius) {
28
+ overlayBorderRadius["XS"] = "xs";
29
+ overlayBorderRadius["SM"] = "sm";
30
+ overlayBorderRadius["MD"] = "md";
31
+ overlayBorderRadius["LG"] = "lg";
32
+ overlayBorderRadius["XL"] = "xl";
33
+ })(exports.overlayBorderRadius || (exports.overlayBorderRadius = {}));
34
+ exports.HOVER_TYPE = void 0;
35
+ (function (HOVER_TYPE) {
36
+ HOVER_TYPE["ENTER"] = "ENTER";
37
+ HOVER_TYPE["LEAVE"] = "LEAVE";
38
+ })(exports.HOVER_TYPE || (exports.HOVER_TYPE = {}));
31
39
 
32
- var getDefaultTooltipStyles = function (theme) {
40
+ const staticTooltipStyles = ctDesignStyleManager.makeStyles((theme) => {
33
41
  return {
34
- backgroundColor: theme.color.tooltip.primaryBg,
35
- borderRadius: theme.border.radius[4],
42
+ root: {
43
+ position: 'relative',
44
+ },
45
+ labelContainerStyles: {
46
+ width: (ctDesignCommonUtils.isMobile() ? 100 : 'fit-content'),
47
+ flexDirection: 'row',
48
+ },
49
+ overlayStyles: {
50
+ flexDirection: 'row',
51
+ position: 'absolute',
52
+ width: theme === null || theme === void 0 ? void 0 : theme.size[50],
53
+ zIndex: theme === null || theme === void 0 ? void 0 : theme.zIndex.tooltip,
54
+ backgroundColor: theme === null || theme === void 0 ? void 0 : theme.color.background.defaultDarkest,
55
+ paddingVertical: theme === null || theme === void 0 ? void 0 : theme.spacing[1],
56
+ paddingHorizontal: theme === null || theme === void 0 ? void 0 : theme.spacing[2],
57
+ borderRadius: theme === null || theme === void 0 ? void 0 : theme.border.radius[8],
58
+ },
59
+ tooltipArrow: {
60
+ display: 'flex',
61
+ position: 'absolute',
62
+ zIndex: theme === null || theme === void 0 ? void 0 : theme.zIndex.tooltip,
63
+ },
36
64
  };
37
- };
38
- var getTooltipStyles = function (_a) {
39
- var theme = _a.theme, width = _a.width;
40
- return tslib.__assign(tslib.__assign({}, getDefaultTooltipStyles(theme)), { width: width });
41
- };
65
+ });
42
66
 
43
- var getStyledTooltipStyles = function (_a) {
44
- var backgroundColor = _a.backgroundColor, width = _a.width, theme = _a.theme, borderRadius = _a.borderRadius;
45
- return styled.css(templateObject_1 || (templateObject_1 = tslib.__makeTemplateObject(["\n background-color: ", ";\n border-radius: ", ";\n display: flex;\n width: ", ";\n align-items: center;\n justify-content: center;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n background-color: ", ";\n border-radius: ", ";\n display: flex;\n width: ", ";\n align-items: center;\n justify-content: center;\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), backgroundColor, borderRadius, width, theme.spacing[1], theme.spacing[1], theme.spacing[2], theme.spacing[2]);
67
+ const staticStyles$1 = ctDesignStyleManager.makeStyles((theme) => ({
68
+ root: {
69
+ backgroundColor: theme.color.background.defaultDarkest,
70
+ position: 'absolute',
71
+ zIndex: theme.zIndex.tooltip,
72
+ },
73
+ }));
74
+ const TooltipContainer = ({ children, visible, width, onMouseLeave, tooltipRef, styleConfig }) => {
75
+ const tooltipClass = react.useMemo(() => css.css({
76
+ width: width !== null && width !== void 0 ? width : 'auto',
77
+ visibility: visible ? 'visible' : 'hidden',
78
+ }), [width, visible]);
79
+ const containerClass = ctDesignStyleManager.useWebMergeStyles([staticStyles$1.root, tooltipClass, ...styleConfig.root], [styleConfig.root, tooltipClass]);
80
+ return (jsxRuntime.jsx("div", { ref: tooltipRef, className: containerClass, onMouseLeave: onMouseLeave, children: children }));
46
81
  };
47
- var templateObject_1;
82
+ TooltipContainer.displayName = 'TooltipContainer';
48
83
 
49
- var StyledTooltip = styled__default.default.div(function (_a) {
50
- var theme = _a.theme, backgroundColor = _a.backgroundColor, width = _a.width, borderRadius = _a.borderRadius;
51
- return getStyledTooltipStyles({
52
- backgroundColor: backgroundColor,
53
- width: width,
54
- theme: theme,
55
- borderRadius: borderRadius,
56
- });
84
+ const staticStyles = ctDesignStyleManager.makeStyles((theme) => ({
85
+ root: {
86
+ zIndex: theme.zIndex.tooltip,
87
+ position: 'absolute',
88
+ display: 'flex',
89
+ },
90
+ }));
91
+ const webStaticStyles = css.css({
92
+ width: 'fit-content',
57
93
  });
94
+ const TooltipArrow = ({ children, visible, styleConfig }) => {
95
+ const tooltipArrowClass = react.useMemo(() => css.css({
96
+ visibility: visible ? 'visible' : 'hidden',
97
+ }), [visible]);
98
+ const arrowClass = ctDesignStyleManager.useWebMergeStyles([staticStyles.root, webStaticStyles, tooltipArrowClass, ...styleConfig.root], [tooltipArrowClass, styleConfig.root]);
99
+ return jsxRuntime.jsx("div", { className: arrowClass, children: children });
100
+ };
58
101
 
59
- var arrowStyle = function (arrowPosition) {
60
- switch (arrowPosition) {
61
- case exports.ArrowDirection.DOWN: {
102
+ const getTooltipBorderSize = (borderSize, theme) => {
103
+ switch (borderSize) {
104
+ case exports.overlayBorderRadius.XS: {
105
+ return {
106
+ borderRadius: theme.border.radius[4],
107
+ };
108
+ }
109
+ case exports.overlayBorderRadius.SM: {
62
110
  return {
63
- transform: 'rotate(0deg)',
111
+ borderRadius: theme.border.radius[6],
64
112
  };
65
113
  }
66
- case exports.ArrowDirection.UP: {
114
+ case exports.overlayBorderRadius.MD: {
67
115
  return {
68
- transform: 'rotate(180deg)',
116
+ borderRadius: theme.border.radius[8],
69
117
  };
70
118
  }
71
- case exports.ArrowDirection.LEFT: {
119
+ case exports.overlayBorderRadius.LG: {
72
120
  return {
73
- marginRight: '-6px',
74
- transform: 'rotate(90deg)',
121
+ borderRadius: theme.border.radius[16],
75
122
  };
76
123
  }
77
- case exports.ArrowDirection.RIGHT: {
124
+ case exports.overlayBorderRadius.XL: {
78
125
  return {
79
- marginLeft: '-6px',
80
- transform: 'rotate(-90deg)',
126
+ borderRadius: theme.border.radius[32],
81
127
  };
82
128
  }
83
129
  default: {
84
130
  return {
85
- transform: 'rotate(0deg)',
131
+ borderRadius: theme.border.radius[8],
86
132
  };
87
133
  }
88
134
  }
89
135
  };
90
- var getTooltipArrowStyles = function (_a) {
91
- var arrowPosition = _a.arrowPosition;
92
- return tslib.__assign({}, arrowStyle(arrowPosition));
136
+ const getTooltipAutoPositionStyle = ({ labelRef, tooltipRef, anchorRef, }) => {
137
+ const anchorElement = (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) || document.body;
138
+ if ((tooltipRef === null || tooltipRef === void 0 ? void 0 : tooltipRef.current) && (labelRef === null || labelRef === void 0 ? void 0 : labelRef.current) && anchorElement) {
139
+ const anchorElementStyleData = anchorElement.getBoundingClientRect();
140
+ const tooltipElementStyleData = tooltipRef.current.getBoundingClientRect();
141
+ const { right: anchorRight, bottom: anchorBottom } = anchorElementStyleData;
142
+ const { right: tooltipRight, bottom: tooltipBottom } = tooltipElementStyleData;
143
+ const tooltipHeight = tooltipRef.current.offsetHeight;
144
+ const tooltipWidth = tooltipRef.current.offsetWidth;
145
+ const labelHeight = labelRef.current.offsetHeight;
146
+ const labelWidth = labelRef.current.offsetWidth;
147
+ if (tooltipRight > anchorRight && tooltipBottom > anchorBottom) {
148
+ return {
149
+ left: tooltipWidth - labelWidth < 0 ? tooltipWidth - labelWidth : -(tooltipWidth - labelWidth),
150
+ top: -(tooltipHeight + 10),
151
+ };
152
+ }
153
+ else if (tooltipBottom > anchorBottom) {
154
+ return {
155
+ top: -(tooltipHeight + 10),
156
+ };
157
+ }
158
+ else if (tooltipRight > anchorRight) {
159
+ return {
160
+ left: tooltipWidth - labelWidth < 0 ? tooltipWidth - labelWidth : -(tooltipWidth - labelWidth),
161
+ top: labelHeight + 10,
162
+ };
163
+ }
164
+ else {
165
+ return {
166
+ top: labelHeight + 10,
167
+ };
168
+ }
169
+ }
170
+ return {};
93
171
  };
94
-
95
- var getStyledTooltipArrowStyles = function (_a) {
96
- _a.theme; var transform = _a.transform, marginLeft = _a.marginLeft, marginRight = _a.marginRight;
97
- return {
98
- display: 'flex',
99
- alignItems: 'center',
100
- transform: transform,
101
- marginLeft: marginLeft,
102
- marginRight: marginRight,
103
- };
172
+ const getTooltipBottomPosition = ({ labelRef, tooltipRef, anchorRef, }) => {
173
+ const anchorElement = (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) || document.body;
174
+ if ((labelRef === null || labelRef === void 0 ? void 0 : labelRef.current) && (tooltipRef === null || tooltipRef === void 0 ? void 0 : tooltipRef.current)) {
175
+ const { right: anchorRight, left: anchorLeft } = anchorElement.getBoundingClientRect();
176
+ const { right: labelRight, left: labelLeft } = labelRef.current.getBoundingClientRect();
177
+ const tooltipWidth = tooltipRef.current.offsetWidth;
178
+ const labelHeight = labelRef.current.offsetHeight;
179
+ const labelWidth = labelRef.current.offsetWidth;
180
+ let leftPosition = tooltipWidth - labelWidth < 0 ? (tooltipWidth - labelWidth) / 2 : -(tooltipWidth - labelWidth) / 2;
181
+ if (tooltipWidth > labelWidth && anchorRight - labelRight < (tooltipWidth - labelWidth) / 2) {
182
+ leftPosition -= (tooltipWidth - labelWidth) / 2 - (anchorRight - labelRight) + 4;
183
+ }
184
+ else if (tooltipWidth > labelWidth && labelLeft - anchorLeft < (tooltipWidth - labelWidth) / 2) {
185
+ leftPosition += (tooltipWidth - labelWidth) / 2 - (labelLeft - anchorLeft) + 4;
186
+ }
187
+ return {
188
+ top: labelHeight + 10,
189
+ left: leftPosition,
190
+ };
191
+ }
192
+ return {};
104
193
  };
105
-
106
- var StyledTooltipArrow = styled__default.default.div(function (_a) {
107
- var theme = _a.theme, transform = _a.transform, marginLeft = _a.marginLeft, marginRight = _a.marginRight;
108
- return getStyledTooltipArrowStyles({
109
- theme: theme,
110
- transform: transform,
111
- marginLeft: marginLeft,
112
- marginRight: marginRight,
113
- });
114
- });
115
-
116
- var TooltipArrow = function (_a) {
117
- var arrowPosition = _a.arrowPosition, _b = _a.styleConfig, styleConfig = _b === void 0 ? {} : _b;
118
- ctDesignTheme.useTheme();
119
- var arrow = styleConfig.arrow, arrowContainer = styleConfig.arrowContainer;
120
- var tooltipArrow = getTooltipArrowStyles({ arrowPosition: arrowPosition });
121
- return (jsxRuntime.jsx(StyledTooltipArrow, tslib.__assign({}, tooltipArrow, arrowContainer, { children: jsxRuntime.jsx(ctDesignIcons.TooltipChevronDown, tslib.__assign({}, arrow)) })));
194
+ const getTooltipTopPosition = ({ labelRef, tooltipRef, anchorRef, }) => {
195
+ const anchorElement = (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) || document.body;
196
+ if ((labelRef === null || labelRef === void 0 ? void 0 : labelRef.current) && (tooltipRef === null || tooltipRef === void 0 ? void 0 : tooltipRef.current)) {
197
+ const { right: anchorRight, left: anchorLeft } = anchorElement.getBoundingClientRect();
198
+ const { right: labelRight, left: labelLeft } = labelRef.current.getBoundingClientRect();
199
+ const tooltipWidth = tooltipRef.current.offsetWidth;
200
+ const tooltipHeight = tooltipRef.current.offsetHeight;
201
+ const labelWidth = labelRef.current.offsetWidth;
202
+ let leftPosition = tooltipWidth - labelWidth < 0 ? (tooltipWidth - labelWidth) / 2 : -(tooltipWidth - labelWidth) / 2;
203
+ if (tooltipWidth > labelWidth && anchorRight - labelRight < (tooltipWidth - labelWidth) / 2) {
204
+ leftPosition -= (tooltipWidth - labelWidth) / 2 - (anchorRight - labelRight) + 4;
205
+ }
206
+ else if (tooltipWidth > labelWidth && labelLeft - anchorLeft < (tooltipWidth - labelWidth) / 2) {
207
+ leftPosition += (tooltipWidth - labelWidth) / 2 - (labelLeft - anchorLeft) + 4;
208
+ }
209
+ return {
210
+ top: -(tooltipHeight + 10),
211
+ left: leftPosition,
212
+ };
213
+ }
214
+ return {};
122
215
  };
123
-
124
- var Tooltip = React.forwardRef(function (_a, forwardedRef) {
125
- var _b = _a.width, width = _b === void 0 ? '' : _b, _c = _a.arrowPosition, arrowPosition = _c === void 0 ? exports.ArrowDirection.UP : _c, _d = _a.children, children = _d === void 0 ? null : _d, container = _a.container, _e = _a.open, open = _e === void 0 ? false : _e, _f = _a.showInPortal, showInPortal = _f === void 0 ? true : _f, _g = _a.as, as = _g === void 0 ? 'div' : _g, _h = _a.layoutDiff, layoutDiff = _h === void 0 ? { left: 0, top: 0 } : _h, _j = _a.styleConfig, styleConfig = _j === void 0 ? {} : _j;
126
- var theme = ctDesignTheme.useTheme();
127
- var arrow = styleConfig.arrow, bodyContainer = styleConfig.bodyContainer, rootContainer = styleConfig.rootContainer;
128
- var ref = React.useRef(null);
129
- var containerRef = React.useRef(null);
130
- var _k = React.useState({ left: 0, top: 0 }), childStyle = _k[0], setChildStyle = _k[1];
131
- var mergedRef = useMergeRefs__default.default(forwardedRef, containerRef);
132
- useIsomorphicEffect__default.default(function () {
133
- if (ref.current && containerRef.current) {
134
- var childMeta = ref.current.getBoundingClientRect();
135
- var containerMeta = containerRef.current.getBoundingClientRect();
136
- var leftDiff = 0;
137
- var topDiff = 0;
138
- if (arrowPosition === 'left' || arrowPosition === 'right') {
139
- leftDiff = arrowPosition === 'right' ? -containerMeta.width : layoutDiff.left + childMeta.width;
140
- topDiff = -4;
216
+ const getTooltipPosition = ({ position, labelRef, tooltipRef, anchorRef, }) => {
217
+ if ((labelRef === null || labelRef === void 0 ? void 0 : labelRef.current) && (tooltipRef === null || tooltipRef === void 0 ? void 0 : tooltipRef.current)) {
218
+ const tooltipHeight = tooltipRef.current.offsetHeight;
219
+ const tooltipWidth = tooltipRef.current.offsetWidth;
220
+ const labelHeight = labelRef.current.offsetHeight;
221
+ const labelWidth = labelRef.current.offsetWidth;
222
+ switch (position) {
223
+ case exports.positions.LEFT: {
224
+ return {
225
+ left: -(tooltipWidth + 10),
226
+ top: -(tooltipHeight / 2 - labelHeight / 2),
227
+ };
141
228
  }
142
- if (arrowPosition === 'up' || arrowPosition === 'down') {
143
- topDiff = arrowPosition === 'down' ? -containerMeta.height : containerMeta.height;
144
- leftDiff = 8;
229
+ case exports.positions.RIGHT: {
230
+ return {
231
+ left: labelWidth + 10,
232
+ top: -(tooltipHeight / 2 - labelHeight / 2),
233
+ };
145
234
  }
146
- var dLeft = Math.abs(childMeta.left + leftDiff);
147
- var dTop = Math.abs(childMeta.top + layoutDiff.top + topDiff);
148
- if (Math.abs(childStyle.left - dLeft) > 1 || Math.abs(childStyle.top - dTop) > 1) {
149
- setChildStyle({ left: dLeft, top: dTop });
235
+ case exports.positions.TOP: {
236
+ return getTooltipTopPosition({
237
+ labelRef,
238
+ tooltipRef,
239
+ anchorRef,
240
+ });
241
+ }
242
+ case exports.positions.BOTTOM: {
243
+ return getTooltipBottomPosition({
244
+ labelRef,
245
+ tooltipRef,
246
+ anchorRef,
247
+ });
248
+ }
249
+ case exports.positions.AUTO: {
250
+ return getTooltipAutoPositionStyle({
251
+ labelRef,
252
+ tooltipRef,
253
+ anchorRef,
254
+ });
255
+ }
256
+ default: {
257
+ return {
258
+ left: labelWidth,
259
+ top: -(tooltipHeight / 2 - labelHeight / 2),
260
+ };
150
261
  }
151
262
  }
152
- }, [arrowPosition, setChildStyle, childStyle, open]);
153
- var tooltipStyles = getTooltipStyles({ theme: theme, width: width });
154
- var tooltipBody = jsxRuntime.jsx(StyledTooltip, tslib.__assign({}, tooltipStyles, { children: children }));
155
- var downRightFlex = arrowPosition === exports.ArrowDirection.DOWN ? 'column' : 'row';
156
- var topLeftFlex = arrowPosition === exports.ArrowDirection.UP ? 'column' : 'row';
157
- var containerProps = tslib.__assign({ ref: ref }, container.props);
158
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [open ? (jsxRuntime.jsx(ConditionalWrap__default.default, tslib.__assign({ condition: showInPortal, wrap: function (children) { return jsxRuntime.jsx(ctDesignPortal.Portal, { children: children }); } }, { children: jsxRuntime.jsx(ctDesignTransition.Transition, tslib.__assign({ type: 'fade', in: open }, { children: jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({ as: as, position: 'absolute', ref: mergedRef, left: childStyle.left, top: childStyle.top, zIndex: theme.zIndex.tooltip }, rootContainer, { children: [(arrowPosition === exports.ArrowDirection.DOWN || arrowPosition === exports.ArrowDirection.RIGHT) && (jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({ display: 'flex', alignItems: 'center', flexDirection: downRightFlex }, bodyContainer, { children: [tooltipBody, jsxRuntime.jsx(TooltipArrow, tslib.__assign({ arrowPosition: arrowPosition }, arrow))] }))), (arrowPosition === exports.ArrowDirection.UP || arrowPosition === exports.ArrowDirection.LEFT) && (jsxRuntime.jsxs(ctDesignContainer.Container, tslib.__assign({ display: 'flex', alignItems: 'center', flexDirection: topLeftFlex }, bodyContainer, { children: [jsxRuntime.jsx(TooltipArrow, tslib.__assign({ arrowPosition: arrowPosition }, arrow)), tooltipBody] })))] })) })) }))) : null, React__default.default.isValidElement(container) ? React__default.default.cloneElement(container, containerProps) : container] }));
159
- });
263
+ }
264
+ };
265
+ const getTooltipAutoArrowStyles = ({ labelRef, tooltipRef, anchorRef, }) => {
266
+ const anchorElement = (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) || document.body;
267
+ if ((tooltipRef === null || tooltipRef === void 0 ? void 0 : tooltipRef.current) && (labelRef === null || labelRef === void 0 ? void 0 : labelRef.current) && anchorElement) {
268
+ const anchorElementStyleData = anchorElement.getBoundingClientRect();
269
+ const tooltipElementStyleData = tooltipRef.current.getBoundingClientRect();
270
+ const { right: anchorRight, bottom: anchorBottom } = anchorElementStyleData;
271
+ const { right: tooltipRight, bottom: tooltipBottom } = tooltipElementStyleData;
272
+ const labelHeight = labelRef.current.offsetHeight;
273
+ const labelWidth = labelRef.current.offsetWidth;
274
+ if (tooltipRight > anchorRight && tooltipBottom > anchorBottom) {
275
+ return {
276
+ top: -11,
277
+ left: labelWidth / 2,
278
+ };
279
+ }
280
+ else if (tooltipBottom > anchorBottom) {
281
+ return {
282
+ top: -11,
283
+ left: labelWidth / 2,
284
+ };
285
+ }
286
+ else if (tooltipRight > anchorRight) {
287
+ return {
288
+ rotate: '180deg',
289
+ left: labelWidth / 2,
290
+ top: labelHeight + 5,
291
+ };
292
+ }
293
+ else {
294
+ return {
295
+ rotate: '180deg',
296
+ left: labelWidth / 2,
297
+ top: labelHeight + 5,
298
+ };
299
+ }
300
+ }
301
+ return {};
302
+ };
303
+ const getTooltipArrowStyles = ({ position, labelRef, tooltipRef, anchorRef, }) => {
304
+ if ((labelRef === null || labelRef === void 0 ? void 0 : labelRef.current) && (tooltipRef === null || tooltipRef === void 0 ? void 0 : tooltipRef.current)) {
305
+ const labelWidth = labelRef.current.offsetWidth;
306
+ const labelHeight = labelRef.current.offsetHeight;
307
+ switch (position) {
308
+ case exports.positions.TOP: {
309
+ return {
310
+ top: -11,
311
+ left: labelWidth / 2,
312
+ };
313
+ }
314
+ case exports.positions.BOTTOM: {
315
+ return {
316
+ rotate: '180deg',
317
+ top: labelHeight + 5,
318
+ left: labelWidth / 2,
319
+ };
320
+ }
321
+ case exports.positions.LEFT: {
322
+ return {
323
+ rotate: '-90deg',
324
+ top: 0,
325
+ left: -16,
326
+ };
327
+ }
328
+ case exports.positions.RIGHT: {
329
+ return {
330
+ rotate: '90deg',
331
+ top: 0,
332
+ left: labelWidth - 1,
333
+ };
334
+ }
335
+ case exports.positions.AUTO: {
336
+ return getTooltipAutoArrowStyles({ labelRef, tooltipRef, anchorRef });
337
+ }
338
+ default: {
339
+ return {
340
+ rotate: '90deg',
341
+ top: 0,
342
+ left: labelWidth,
343
+ };
344
+ }
345
+ }
346
+ }
347
+ return {};
348
+ };
349
+ const getTooltipStyles = ({ borderSize, position, labelRef, tooltipRef, anchorRef, theme, }) => {
350
+ const tooltipPosition = getTooltipPosition({ position, labelRef, tooltipRef, anchorRef, theme }) || {};
351
+ return Object.assign(Object.assign({}, tooltipPosition), getTooltipBorderSize(borderSize, theme));
352
+ };
353
+
354
+ const Tooltip = ({ children, position = exports.positions.RIGHT, labelContainer, tooltipWidth = 150, tooltipBorderRadius = exports.overlayBorderRadius.MD, styleConfig, enableTooltipContainerHovering = false, open = false, animate = true, svgPathProps, anchorRef, }) => {
355
+ const theme = ctDesignTheme.useTheme();
356
+ const { root: customRootStyles = [], labelContainerStyles: customLabelContainerStyles = [], overlayStyles: customOverlayStyles = [], arrowStyles: customArrowStyles = [], } = styleConfig || {};
357
+ const [styles, setStyles] = react.useState({
358
+ tooltipStyles: {},
359
+ tooltipArrowStyles: {},
360
+ });
361
+ const labelRef = react.useRef(null);
362
+ const tooltipRef = react.useRef(null);
363
+ const setTooltipStyles = react.useCallback(() => {
364
+ const tooltipStyle = getTooltipStyles({
365
+ borderSize: tooltipBorderRadius,
366
+ position,
367
+ labelRef,
368
+ tooltipRef,
369
+ anchorRef: anchorRef,
370
+ theme,
371
+ });
372
+ const tooltipArrowStyle = getTooltipArrowStyles({
373
+ position,
374
+ labelRef,
375
+ tooltipRef,
376
+ anchorRef: anchorRef,
377
+ theme,
378
+ });
379
+ setStyles({ tooltipStyles: tooltipStyle, tooltipArrowStyles: tooltipArrowStyle });
380
+ }, [tooltipBorderRadius, position, labelRef, tooltipRef, anchorRef, theme]);
381
+ react.useEffect(() => {
382
+ if (open) {
383
+ setTooltipStyles();
384
+ }
385
+ else {
386
+ setStyles({ tooltipStyles: {}, tooltipArrowStyles: {} });
387
+ }
388
+ }, [open, setTooltipStyles]);
389
+ const canCloseTooltipContainer = (event) => {
390
+ var _a, _b, _c, _d;
391
+ const defaultDimesstions = { right: 0, left: 0, bottom: 0, top: 0 };
392
+ const tooltipDimesntions = (_b = (_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) !== null && _b !== void 0 ? _b : defaultDimesstions;
393
+ const labelDimensions = (_d = (_c = labelRef.current) === null || _c === void 0 ? void 0 : _c.getBoundingClientRect()) !== null && _d !== void 0 ? _d : defaultDimesstions;
394
+ const { r, l, b, t } = {
395
+ r: Math.floor(Math.max(tooltipDimesntions.right, labelDimensions.left)),
396
+ l: Math.floor(Math.min(tooltipDimesntions.left, labelDimensions.right)),
397
+ b: Math.floor(Math.max(tooltipDimesntions.bottom, labelDimensions.top)),
398
+ t: Math.floor(Math.min(tooltipDimesntions.top, labelDimensions.bottom)),
399
+ };
400
+ const currentX = event.clientX + 1;
401
+ const currentY = event.clientY + 1;
402
+ return r >= currentX && l <= currentX && t <= currentY && b >= currentY;
403
+ };
404
+ const handleMouseEnter = () => {
405
+ setTooltipStyles();
406
+ };
407
+ const handleMouseLeave = (event) => {
408
+ if (enableTooltipContainerHovering && canCloseTooltipContainer(event))
409
+ return;
410
+ setStyles({ tooltipStyles: {}, tooltipArrowStyles: {} });
411
+ };
412
+ const labelStyles = ctDesignStyleManager.useWebMergeStyles([...customLabelContainerStyles], [customLabelContainerStyles]);
413
+ const dynamicTooltipStyles = ctDesignStyleManager.useStyles(() => {
414
+ return {
415
+ tooltip: styles.tooltipStyles,
416
+ tooltipArrow: styles.tooltipArrowStyles,
417
+ };
418
+ }, [styles.tooltipStyles, open]);
419
+ return (jsxRuntime.jsxs(ctDesignContainer.Container, { styleConfig: { root: [staticTooltipStyles === null || staticTooltipStyles === void 0 ? void 0 : staticTooltipStyles.root, ...customRootStyles] }, children: [jsxRuntime.jsx("div", { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ref: labelRef, className: labelStyles, children: labelContainer }), !!children && (jsxRuntime.jsx(Conditional__default.default, { condition: animate, wrap: (child) => jsxRuntime.jsx(ctDesignTransition.Transition, { type: 'fade', children: child }), children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TooltipContainer, { visible: !ctDesignCommonUtils.isEmpty(styles.tooltipStyles), width: tooltipWidth, onMouseLeave: handleMouseLeave, styleConfig: { root: [dynamicTooltipStyles.tooltip, ...customOverlayStyles] }, tooltipRef: tooltipRef, children: children }), jsxRuntime.jsx(TooltipArrow, { visible: !ctDesignCommonUtils.isEmpty(styles.tooltipArrowStyles), styleConfig: { root: [dynamicTooltipStyles.tooltipArrow, ...customArrowStyles] }, children: jsxRuntime.jsx(ctDesignIcons.TooltipChevronDown, Object.assign({}, svgPathProps)) })] }) }))] }));
420
+ };
160
421
 
161
422
  exports.Tooltip = Tooltip;
162
423
  //# sourceMappingURL=ct-design-tooltip.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ct-design-tooltip.cjs.js","sources":["../packages/components/Tooltip/src/type.ts","../packages/components/Tooltip/src/style.ts","../packages/components/Tooltip/src/StyledTooltip/style.ts","../packages/components/Tooltip/src/StyledTooltip/StyledTooltip.tsx","../packages/components/Tooltip/src/TooltipArrow/style.ts","../packages/components/Tooltip/src/TooltipArrow/StyledTooltipArrow/style.ts","../packages/components/Tooltip/src/TooltipArrow/StyledTooltipArrow/StyledTooltipArrow.tsx","../packages/components/Tooltip/src/TooltipArrow/TooltipArrow.tsx","../packages/components/Tooltip/src/Tooltip.tsx"],"sourcesContent":[null,null,null,null,null,null,null,null,null],"names":["ArrowDirection","__assign","css","styled","useTheme","_jsx","TooltipChevronDown","forwardRef","useRef","useState","useMergeRefs","useIsomorphicEffect","_jsxs","ConditionalWrap","Portal","Transition","Container","React"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAGYA,gCAKX;AALD,CAAA,UAAY,cAAc,EAAA;AACxB,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,cAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,cAAA,CAAA,IAAA,CAAA,GAAA,IAAS,CAAA;AACT,IAAA,cAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EALWA,sBAAc,KAAdA,sBAAc,GAKzB,EAAA,CAAA,CAAA;;ACLM,IAAM,uBAAuB,GAAG,UAAC,KAAY,EAAA;IAClD,OAAO;AACL,QAAA,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS;QAC9C,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;KACrC,CAAC;AACJ,CAAC,CAAC;AAEK,IAAM,gBAAgB,GAAG,UAAC,EAAiD,EAAA;QAA/C,KAAK,GAAA,EAAA,CAAA,KAAA,EAAE,KAAK,GAAA,EAAA,CAAA,KAAA,CAAA;AAC7C,IAAA,OAAAC,cAAA,CAAAA,cAAA,CAAA,EAAA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AA,CAAA,EAAA,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,aAAa,EAAE,aAAa,IAAM,aAAa,EAAA,EAAA,QAAA,EAAA,CAC1F,WAAW,EACZI,cAAA,CAAC,YAAY,EAACJ,cAAA,CAAA,EAAA,aAAa,EAAE,aAAa,EAAA,EAAM,KAAK,CAAI,CAAA,CAAA,EAAA,CAAA,CAC/C,CACb,EAEA,CAAC,aAAa,KAAKD,sBAAc,CAAC,EAAE,IAAI,aAAa,KAAKA,sBAAc,CAAC,IAAI,MAC5EY,gBAACI,2BAAS,EAAAf,cAAA,CAAA,EAAC,OAAO,EAAC,MAAM,EAAC,UAAU,EAAC,QAAQ,EAAC,aAAa,EAAE,WAAW,EAAM,EAAA,aAAa,eACzFI,cAAC,CAAA,YAAY,mBAAC,aAAa,EAAE,aAAa,EAAM,EAAA,KAAK,EAAI,EACxD,WAAW,KACF,CACb,CAAA,EAAA,CAAA,CACS,IACD,EACG,CAAA,CAAA,IAChB,IAAI,EACPY,sBAAK,CAAC,cAAc,CAAC,SAAS,CAAC,GAAGA,sBAAK,CAAC,YAAY,CAAC,SAAS,EAAE,cAAc,CAAC,GAAG,SAAS,CAC3F,EAAA,CAAA,EACH;AACJ,CAAC;;;;"}
1
+ {"version":3,"file":"ct-design-tooltip.cjs.js","sources":["../packages/components/Tooltip/src/constants.ts","../packages/components/Tooltip/src/style.ts","../packages/components/Tooltip/src/TooltipContainer.tsx","../packages/components/Tooltip/src/TooltipArrow.tsx","../packages/components/Tooltip/src/webStyle.ts","../packages/components/Tooltip/src/Tooltip.tsx"],"sourcesContent":[null,null,null,null,null,null],"names":["positions","overlayBorderRadius","HOVER_TYPE","makeStyles","isMobile","staticStyles","useMemo","css","useWebMergeStyles","_jsx","useTheme","useState","useRef","useCallback","useEffect","useStyles","_jsxs","Container","Conditional","Transition","_Fragment","isEmpty","TooltipChevronDown"],"mappings":";;;;;;;;;;;;;;;;;AAAYA,2BAMX;AAND,CAAA,UA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