@algolia/satellite 1.0.0-beta.160 → 1.0.0-beta.162

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 (230) hide show
  1. package/cjs/AnnouncementBadge/AnnouncementBadge.d.ts +2 -2
  2. package/cjs/AutoComplete/AutoComplete.tailwind.js +4 -1
  3. package/cjs/AutoComplete/components/AutoCompleteEmptyState.d.ts +2 -2
  4. package/cjs/AutoComplete/components/DefaultOptionItem.d.ts +2 -2
  5. package/cjs/Avatars/ApplicationAvatar.d.ts +2 -2
  6. package/cjs/Avatars/UserAvatar.d.ts +2 -2
  7. package/cjs/Badge/Badge.d.ts +3 -3
  8. package/cjs/Badge/Badge.js +6 -3
  9. package/cjs/Banners/Alert/Alert.d.ts +2 -2
  10. package/cjs/Banners/BigBertha/BigBertha.d.ts +2 -2
  11. package/cjs/Banners/Promote/Promote.d.ts +2 -2
  12. package/cjs/Button/ButtonGroup.d.ts +2 -2
  13. package/cjs/Button/PolymorphicIconButton.d.ts +1 -1
  14. package/cjs/Button/PolymorphicIconButton.js +4 -4
  15. package/cjs/Card/components/CardHeader.d.ts +2 -2
  16. package/cjs/Card/components/CardTitle.d.ts +2 -2
  17. package/cjs/Checkbox/Checkbox.js +3 -3
  18. package/cjs/Checkbox/Checkbox.tailwind.js +1 -1
  19. package/cjs/ClickAwayContainer/ClickAwayContainer.d.ts +2 -2
  20. package/cjs/DatePicker/DatePicker/DatePicker.d.ts +2 -2
  21. package/cjs/DatePicker/DateRangePicker/DateRangePicker.d.ts +2 -2
  22. package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +2 -2
  23. package/cjs/DatePicker/components/Calendar.d.ts +2 -2
  24. package/cjs/DatePicker/components/Display.d.ts +2 -2
  25. package/cjs/DatePicker/components/Footer.d.ts +2 -2
  26. package/cjs/DatePicker/components/FooterActions.d.ts +2 -2
  27. package/cjs/DatePicker/components/Modal.d.ts +2 -2
  28. package/cjs/DatePicker/components/NavBar.d.ts +2 -2
  29. package/cjs/DatePicker/components/SidePanel.d.ts +2 -2
  30. package/cjs/Dropdown/Dropdown.d.ts +20 -34
  31. package/cjs/Dropdown/components/DropdownButtonItem.d.ts +2 -7
  32. package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.d.ts +2 -2
  33. package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.d.ts +2 -2
  34. package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.d.ts +2 -1
  35. package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.d.ts +2 -1
  36. package/cjs/Dropdown/components/DropdownFooterItem.d.ts +2 -2
  37. package/cjs/Dropdown/components/DropdownLinkItem.d.ts +2 -7
  38. package/cjs/Dropdown/components/DropdownRadioItem.d.ts +2 -7
  39. package/cjs/Dropdown/components/DropdownTitle.d.ts +2 -2
  40. package/cjs/Dropdown/components/DropdownToggleItem.d.ts +2 -7
  41. package/cjs/Dropzone/Dropzone.d.ts +2 -2
  42. package/cjs/EmptyState/EmptyState.d.ts +2 -2
  43. package/cjs/Field/Field.d.ts +2 -2
  44. package/cjs/Flag/Flag.d.ts +2 -2
  45. package/cjs/Flag/Flags.d.ts +2 -2
  46. package/cjs/FlexGrid/FlexGrid.d.ts +2 -2
  47. package/cjs/HelpUnderline/HelpUnderline.d.ts +5 -6
  48. package/cjs/HelpUnderline/HelpUnderline.js +13 -10
  49. package/cjs/Input/Input.tailwind.js +28 -4
  50. package/cjs/Insert/Insert.d.ts +2 -2
  51. package/cjs/KeyboardKey/KeyboardKey.d.ts +2 -2
  52. package/cjs/Medallion/Medallion.d.ts +2 -2
  53. package/cjs/Modal/Modal.d.ts +7 -5
  54. package/cjs/Modal/components/ModalFooter.d.ts +2 -2
  55. package/cjs/Modal/components/ModalSection.d.ts +2 -2
  56. package/cjs/Pagination/CompactPagination/CompactPagination.d.ts +2 -2
  57. package/cjs/Pagination/Pagination/Pagination.d.ts +2 -2
  58. package/cjs/ProgressBar/ProgressBar.d.ts +2 -2
  59. package/cjs/ProgressSpinner/ProgressSpinner.d.ts +2 -2
  60. package/cjs/RadioGroup/RadioButton.tailwind.js +4 -1
  61. package/cjs/RadioGroup/RadioGroup.d.ts +6 -6
  62. package/cjs/RangeSlider/RangeSlider.js +2 -2
  63. package/cjs/Satellite/Satellite.d.ts +2 -3
  64. package/cjs/Satellite/Satellite.js +27 -16
  65. package/cjs/Satellite/SatelliteContext.d.ts +1 -1
  66. package/cjs/Satellite/SatelliteContext.js +2 -1
  67. package/cjs/ScrollIndicator/ScrollIndicator.d.ts +2 -2
  68. package/cjs/Select/Select.tailwind.js +2 -2
  69. package/cjs/Separator/Separator.d.ts +8 -0
  70. package/cjs/Separator/Separator.js +29 -0
  71. package/cjs/Separator/Separator.tailwind.d.ts +5 -0
  72. package/cjs/Separator/Separator.tailwind.js +25 -0
  73. package/cjs/Separator/index.d.ts +2 -0
  74. package/cjs/Separator/index.js +27 -0
  75. package/cjs/Sidebar/Sidebar.d.ts +2 -2
  76. package/cjs/Sidebar/SidebarButtonLink.d.ts +2 -2
  77. package/cjs/Sidebar/SidebarButtonLink.js +8 -14
  78. package/cjs/Sidebar/SidebarHeader.d.ts +2 -2
  79. package/cjs/Sidebar/SidebarHeading.d.ts +2 -2
  80. package/cjs/Sidebar/SidebarLink.d.ts +2 -2
  81. package/cjs/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.d.ts +2 -2
  82. package/cjs/Sidebar/SidebarLinksGroup/SidebarGroupLink.d.ts +2 -2
  83. package/cjs/Sidebar/SidebarLinksGroup/SidebarLinksGroup.d.ts +2 -2
  84. package/cjs/Sidebar/SidebarNav.d.ts +2 -2
  85. package/cjs/Switch/Switch.d.ts +2 -2
  86. package/cjs/Switch/SwitchOption.d.ts +2 -2
  87. package/cjs/Tables/DataTable/DataTable.d.ts +4 -2
  88. package/cjs/Tables/DataTable/DataTable.js +9 -4
  89. package/cjs/Tables/DataTable/components/Footer.d.ts +2 -2
  90. package/cjs/Tables/DataTable/components/Loader.d.ts +2 -2
  91. package/cjs/Tables/Table/Table.d.ts +2 -2
  92. package/cjs/Tables/Table/components/TableFooter.d.ts +2 -2
  93. package/cjs/Tabs/ContentTabs.d.ts +2 -2
  94. package/cjs/Tabs/LinkTabs.d.ts +2 -2
  95. package/cjs/Tabs/components/LinkTab.d.ts +2 -2
  96. package/cjs/Tag/Tag.js +7 -7
  97. package/cjs/TextWrap/TextWrap.d.ts +2 -2
  98. package/cjs/Toggle/Toggle.js +3 -13
  99. package/cjs/Toggle/Toggle.tailwind.js +8 -2
  100. package/cjs/Tooltip/OverflowTooltipWrapper.d.ts +2 -5
  101. package/cjs/Tooltip/OverflowTooltipWrapper.js +20 -78
  102. package/cjs/Tooltip/Tooltip.d.ts +6 -6
  103. package/cjs/Tooltip/Tooltip.js +6 -6
  104. package/cjs/Tooltip/Tooltip.tailwind.js +85 -62
  105. package/cjs/Tooltip/TooltipWrapper.d.ts +8 -21
  106. package/cjs/Tooltip/TooltipWrapper.js +49 -158
  107. package/cjs/Tooltip/types.d.ts +57 -6
  108. package/cjs/Tooltip/utils.d.ts +1 -0
  109. package/cjs/Tooltip/utils.js +10 -0
  110. package/cjs/UserContent/UserContent.d.ts +2 -2
  111. package/cjs/index.d.ts +2 -1
  112. package/cjs/index.js +20 -8
  113. package/cjs/styles/tailwind.config.js +1 -1
  114. package/cjs/types.d.ts +6 -6
  115. package/esm/AnnouncementBadge/AnnouncementBadge.d.ts +2 -2
  116. package/esm/AutoComplete/AutoComplete.tailwind.js +4 -1
  117. package/esm/AutoComplete/components/AutoCompleteEmptyState.d.ts +2 -2
  118. package/esm/AutoComplete/components/DefaultOptionItem.d.ts +2 -2
  119. package/esm/Avatars/ApplicationAvatar.d.ts +2 -2
  120. package/esm/Avatars/UserAvatar.d.ts +2 -2
  121. package/esm/Badge/Badge.d.ts +3 -3
  122. package/esm/Badge/Badge.js +6 -3
  123. package/esm/Banners/Alert/Alert.d.ts +2 -2
  124. package/esm/Banners/BigBertha/BigBertha.d.ts +2 -2
  125. package/esm/Banners/Promote/Promote.d.ts +2 -2
  126. package/esm/Button/ButtonGroup.d.ts +2 -2
  127. package/esm/Button/PolymorphicIconButton.d.ts +1 -1
  128. package/esm/Button/PolymorphicIconButton.js +4 -4
  129. package/esm/Card/components/CardHeader.d.ts +2 -2
  130. package/esm/Card/components/CardTitle.d.ts +2 -2
  131. package/esm/Checkbox/Checkbox.js +3 -3
  132. package/esm/Checkbox/Checkbox.tailwind.js +1 -1
  133. package/esm/ClickAwayContainer/ClickAwayContainer.d.ts +2 -2
  134. package/esm/DatePicker/DatePicker/DatePicker.d.ts +2 -2
  135. package/esm/DatePicker/DateRangePicker/DateRangePicker.d.ts +2 -2
  136. package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +2 -2
  137. package/esm/DatePicker/components/Calendar.d.ts +2 -2
  138. package/esm/DatePicker/components/Display.d.ts +2 -2
  139. package/esm/DatePicker/components/Footer.d.ts +2 -2
  140. package/esm/DatePicker/components/FooterActions.d.ts +2 -2
  141. package/esm/DatePicker/components/Modal.d.ts +2 -2
  142. package/esm/DatePicker/components/NavBar.d.ts +2 -2
  143. package/esm/DatePicker/components/SidePanel.d.ts +2 -2
  144. package/esm/Dropdown/Dropdown.d.ts +20 -34
  145. package/esm/Dropdown/components/DropdownButtonItem.d.ts +2 -7
  146. package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.d.ts +2 -2
  147. package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.d.ts +2 -2
  148. package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.d.ts +2 -1
  149. package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.d.ts +2 -1
  150. package/esm/Dropdown/components/DropdownFooterItem.d.ts +2 -2
  151. package/esm/Dropdown/components/DropdownLinkItem.d.ts +2 -7
  152. package/esm/Dropdown/components/DropdownRadioItem.d.ts +2 -7
  153. package/esm/Dropdown/components/DropdownTitle.d.ts +2 -2
  154. package/esm/Dropdown/components/DropdownToggleItem.d.ts +2 -7
  155. package/esm/Dropzone/Dropzone.d.ts +2 -2
  156. package/esm/EmptyState/EmptyState.d.ts +2 -2
  157. package/esm/Field/Field.d.ts +2 -2
  158. package/esm/Flag/Flag.d.ts +2 -2
  159. package/esm/Flag/Flags.d.ts +2 -2
  160. package/esm/FlexGrid/FlexGrid.d.ts +2 -2
  161. package/esm/HelpUnderline/HelpUnderline.d.ts +5 -6
  162. package/esm/HelpUnderline/HelpUnderline.js +13 -10
  163. package/esm/Input/Input.tailwind.js +28 -4
  164. package/esm/Insert/Insert.d.ts +2 -2
  165. package/esm/KeyboardKey/KeyboardKey.d.ts +2 -2
  166. package/esm/Medallion/Medallion.d.ts +2 -2
  167. package/esm/Modal/Modal.d.ts +7 -5
  168. package/esm/Modal/components/ModalFooter.d.ts +2 -2
  169. package/esm/Modal/components/ModalSection.d.ts +2 -2
  170. package/esm/Pagination/CompactPagination/CompactPagination.d.ts +2 -2
  171. package/esm/Pagination/Pagination/Pagination.d.ts +2 -2
  172. package/esm/ProgressBar/ProgressBar.d.ts +2 -2
  173. package/esm/ProgressSpinner/ProgressSpinner.d.ts +2 -2
  174. package/esm/RadioGroup/RadioButton.tailwind.js +4 -1
  175. package/esm/RadioGroup/RadioGroup.d.ts +6 -6
  176. package/esm/RangeSlider/RangeSlider.js +2 -2
  177. package/esm/Satellite/Satellite.d.ts +2 -3
  178. package/esm/Satellite/Satellite.js +26 -14
  179. package/esm/Satellite/SatelliteContext.d.ts +1 -1
  180. package/esm/Satellite/SatelliteContext.js +2 -1
  181. package/esm/ScrollIndicator/ScrollIndicator.d.ts +2 -2
  182. package/esm/Select/Select.tailwind.js +2 -2
  183. package/esm/Separator/Separator.d.ts +8 -0
  184. package/esm/Separator/Separator.js +17 -0
  185. package/esm/Separator/Separator.tailwind.d.ts +5 -0
  186. package/esm/Separator/Separator.tailwind.js +24 -0
  187. package/esm/Separator/index.d.ts +2 -0
  188. package/esm/Separator/index.js +2 -0
  189. package/esm/Sidebar/Sidebar.d.ts +2 -2
  190. package/esm/Sidebar/SidebarButtonLink.d.ts +2 -2
  191. package/esm/Sidebar/SidebarButtonLink.js +8 -14
  192. package/esm/Sidebar/SidebarHeader.d.ts +2 -2
  193. package/esm/Sidebar/SidebarHeading.d.ts +2 -2
  194. package/esm/Sidebar/SidebarLink.d.ts +2 -2
  195. package/esm/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.d.ts +2 -2
  196. package/esm/Sidebar/SidebarLinksGroup/SidebarGroupLink.d.ts +2 -2
  197. package/esm/Sidebar/SidebarLinksGroup/SidebarLinksGroup.d.ts +2 -2
  198. package/esm/Sidebar/SidebarNav.d.ts +2 -2
  199. package/esm/Switch/Switch.d.ts +2 -2
  200. package/esm/Switch/SwitchOption.d.ts +2 -2
  201. package/esm/Tables/DataTable/DataTable.d.ts +4 -2
  202. package/esm/Tables/DataTable/DataTable.js +9 -4
  203. package/esm/Tables/DataTable/components/Footer.d.ts +2 -2
  204. package/esm/Tables/DataTable/components/Loader.d.ts +2 -2
  205. package/esm/Tables/Table/Table.d.ts +2 -2
  206. package/esm/Tables/Table/components/TableFooter.d.ts +2 -2
  207. package/esm/Tabs/ContentTabs.d.ts +2 -2
  208. package/esm/Tabs/LinkTabs.d.ts +2 -2
  209. package/esm/Tabs/components/LinkTab.d.ts +2 -2
  210. package/esm/Tag/Tag.js +7 -7
  211. package/esm/TextWrap/TextWrap.d.ts +2 -2
  212. package/esm/Toggle/Toggle.js +3 -13
  213. package/esm/Toggle/Toggle.tailwind.js +8 -2
  214. package/esm/Tooltip/OverflowTooltipWrapper.d.ts +2 -5
  215. package/esm/Tooltip/OverflowTooltipWrapper.js +20 -78
  216. package/esm/Tooltip/Tooltip.d.ts +6 -6
  217. package/esm/Tooltip/Tooltip.js +6 -6
  218. package/esm/Tooltip/Tooltip.tailwind.js +84 -62
  219. package/esm/Tooltip/TooltipWrapper.d.ts +8 -21
  220. package/esm/Tooltip/TooltipWrapper.js +47 -157
  221. package/esm/Tooltip/types.d.ts +57 -6
  222. package/esm/Tooltip/utils.d.ts +1 -0
  223. package/esm/Tooltip/utils.js +3 -0
  224. package/esm/UserContent/UserContent.d.ts +2 -2
  225. package/esm/index.d.ts +2 -1
  226. package/esm/index.js +2 -1
  227. package/esm/styles/tailwind.config.js +1 -1
  228. package/esm/types.d.ts +6 -6
  229. package/package.json +3 -1
  230. package/satellite.min.css +1 -1
@@ -4,99 +4,41 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.isOverflowing = exports["default"] = exports.OverflowTooltipWrapper = void 0;
7
+ exports.OverflowTooltipWrapper = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
- var _clsx = _interopRequireDefault(require("clsx"));
11
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
12
  var _react = require("react");
14
- var _reactPopper = require("react-popper");
15
- var _Satellite = require("../Satellite");
16
13
  var _satellitePrefixer = _interopRequireDefault(require("../styles/helpers/satellitePrefixer"));
17
14
  var _TextWrap = _interopRequireDefault(require("../TextWrap"));
18
- var _Tooltip = _interopRequireDefault(require("./Tooltip"));
19
15
  var _TooltipWrapper = require("./TooltipWrapper");
16
+ var _utils = require("./utils");
20
17
  var _jsxRuntime = require("react/jsx-runtime");
21
- var _templateObject, _templateObject2, _templateObject3;
18
+ var _templateObject;
19
+ var _excluded = ["children"];
22
20
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
21
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
24
- /** @ignore */
25
- var isOverflowing = function isOverflowing(element) {
26
- return element.scrollHeight > element.clientHeight || element.scrollWidth > element.clientWidth;
27
- };
28
- exports.isOverflowing = isOverflowing;
29
22
  var OverflowTooltipWrapper = function OverflowTooltipWrapper(_ref) {
30
- var _ref$placement = _ref.placement,
31
- placement = _ref$placement === void 0 ? "bottom" : _ref$placement,
32
- _ref$tooltipVariant = _ref.tooltipVariant,
33
- tooltipVariant = _ref$tooltipVariant === void 0 ? "dark" : _ref$tooltipVariant,
34
- wrapperClassName = _ref.wrapperClassName,
35
- tooltipClassName = _ref.tooltipClassName,
36
- children = _ref.children,
37
- _ref$modifiers = _ref.modifiers,
38
- modifiers = _ref$modifiers === void 0 ? [] : _ref$modifiers,
39
- _ref$noArrow = _ref.noArrow,
40
- noArrow = _ref$noArrow === void 0 ? false : _ref$noArrow;
41
- var createPortal = (0, _Satellite.useCreatePortal)();
23
+ var children = _ref.children,
24
+ props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
42
25
  var _useState = (0, _react.useState)(null),
43
26
  _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
44
- targetEl = _useState2[0],
45
- setTargetEl = _useState2[1];
46
- var _useState3 = (0, _react.useState)(null),
47
- _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
48
- popperEl = _useState4[0],
49
- setPopperEl = _useState4[1];
50
- var _useState5 = (0, _react.useState)(null),
51
- _useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
52
- arrowEl = _useState6[0],
53
- setArrowEl = _useState6[1];
54
- var _useState7 = (0, _react.useState)(null),
55
- _useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
56
- tooltipText = _useState8[0],
57
- setTooltipText = _useState8[1];
58
- var _usePopper = (0, _reactPopper.usePopper)(targetEl, popperEl, {
59
- placement: placement,
60
- strategy: "fixed",
61
- modifiers: [].concat((0, _toConsumableArray2["default"])(_TooltipWrapper.DEFAULT_TOOLTIP_POPPER_MODIFIERS), [{
62
- name: "arrow",
63
- options: {
64
- element: arrowEl
65
- }
66
- }], (0, _toConsumableArray2["default"])(modifiers))
67
- }),
68
- styles = _usePopper.styles,
69
- attributes = _usePopper.attributes;
27
+ content = _useState2[0],
28
+ setContent = _useState2[1];
70
29
  var onMouseEnter = function onMouseEnter(evt) {
71
- return setTooltipText(isOverflowing(evt.currentTarget) ? evt.currentTarget.textContent : null);
72
- };
73
- var onMouseLeave = function onMouseLeave() {
74
- return setTooltipText(null);
30
+ setContent((0, _utils.isOverflowing)(evt.currentTarget) ? evt.currentTarget.textContent : null);
75
31
  };
76
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
77
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
78
- ref: setTargetEl,
79
- className: (0, _clsx["default"])(wrapperClassName, (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["truncate"])))),
32
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TooltipWrapper.TooltipWrapper, _objectSpread(_objectSpread({
33
+ content: content && /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextWrap["default"], {
34
+ children: content
35
+ })
36
+ }, props), {}, {
37
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
38
+ className: (0, _satellitePrefixer["default"])(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["truncate"]))),
80
39
  onMouseEnter: onMouseEnter,
81
- onMouseLeave: onMouseLeave,
82
40
  children: children
83
- }), !!tooltipText && createPortal( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, attributes.popper), {}, {
84
- style: styles.popper,
85
- className: (0, _clsx["default"])((0, _satellitePrefixer["default"])(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["tooltip-wrapper-popper"]))), tooltipClassName),
86
- ref: setPopperEl,
87
- children: [!noArrow && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
88
- ref: setArrowEl,
89
- style: styles.arrow,
90
- className: (0, _satellitePrefixer["default"])(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["tooltip-wrapper-arrow ", ""])), tooltipVariant === "light" && "tooltip-wrapper-arrow-light")
91
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip["default"], {
92
- variant: tooltipVariant,
93
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextWrap["default"], {
94
- children: tooltipText
95
- })
96
- })]
97
- })))]
98
- });
41
+ })
42
+ }));
99
43
  };
100
- exports.OverflowTooltipWrapper = OverflowTooltipWrapper;
101
- var _default = OverflowTooltipWrapper;
102
- exports["default"] = _default;
44
+ exports.OverflowTooltipWrapper = OverflowTooltipWrapper;
@@ -7,18 +7,18 @@ export interface TooltipProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivEl
7
7
  * Tooltips are floating labels that briefly explain the function of a user interface element. They can be triggered when merchants hover, focus, tap, or click.
8
8
  *
9
9
  * Use tooltips to identify or add a small amount of information to an element. Typically, tooltips are used to help users understand the meaning or purpose of icons, showing the full version of truncated text, or displaying the alt text for an image. Tooltips do not receive input focus.
10
- * When writing tooltips, be short and concise.. When you need to add more than a single line of extra information, consider using inline dialogs instead.
10
+ * When writing tooltips, be short and concise. When you need to add more than a single line of extra information, consider using inline dialogs instead.
11
11
  *
12
12
  * The position of tooltips is flexible and will change depending on how close the element is to the edge of the screen.
13
13
  *
14
14
  * ## Best practices
15
15
  * Tooltips should:
16
16
  *
17
- * - Provide useful, additional information or clarification
18
- * - Succinctly describe or expand on the element they point to
19
- * - Not be used to communicate critical information, including errors in forms or other interaction feedback
20
- * - Not contain any links or buttons
21
- * - Be used sparingly. If you're building something that requires a lot of tooltips, work on clarifying the design and the language in the experience
17
+ * - Provide useful, additional information or clarification.
18
+ * - Succinctly describe or expand on the element they point to.
19
+ * - Not be used to communicate critical information, including errors in forms or other interaction feedback.
20
+ * - Not contain any links, inputs, or buttons.
21
+ * - Be used sparingly. If you're building something that requires a lot of tooltips, work on clarifying the design and the language in the experience.
22
22
  */
23
23
  export declare const Tooltip: import("react").ForwardRefExoticComponent<Pick<TooltipProps, "key" | "id" | "color" | "translate" | "hidden" | "dir" | "slot" | "style" | "title" | "accessKey" | "draggable" | "lang" | "className" | "prefix" | "children" | "contentEditable" | "inputMode" | "tabIndex" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "contextMenu" | "placeholder" | "spellCheck" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "variant"> & import("react").RefAttributes<HTMLDivElement>>;
24
24
  export default Tooltip;
@@ -25,18 +25,18 @@ var VARIANT_CLASSNAMES = {
25
25
  * Tooltips are floating labels that briefly explain the function of a user interface element. They can be triggered when merchants hover, focus, tap, or click.
26
26
  *
27
27
  * Use tooltips to identify or add a small amount of information to an element. Typically, tooltips are used to help users understand the meaning or purpose of icons, showing the full version of truncated text, or displaying the alt text for an image. Tooltips do not receive input focus.
28
- * When writing tooltips, be short and concise.. When you need to add more than a single line of extra information, consider using inline dialogs instead.
28
+ * When writing tooltips, be short and concise. When you need to add more than a single line of extra information, consider using inline dialogs instead.
29
29
  *
30
30
  * The position of tooltips is flexible and will change depending on how close the element is to the edge of the screen.
31
31
  *
32
32
  * ## Best practices
33
33
  * Tooltips should:
34
34
  *
35
- * - Provide useful, additional information or clarification
36
- * - Succinctly describe or expand on the element they point to
37
- * - Not be used to communicate critical information, including errors in forms or other interaction feedback
38
- * - Not contain any links or buttons
39
- * - Be used sparingly. If you're building something that requires a lot of tooltips, work on clarifying the design and the language in the experience
35
+ * - Provide useful, additional information or clarification.
36
+ * - Succinctly describe or expand on the element they point to.
37
+ * - Not be used to communicate critical information, including errors in forms or other interaction feedback.
38
+ * - Not contain any links, inputs, or buttons.
39
+ * - Be used sparingly. If you're building something that requires a lot of tooltips, work on clarifying the design and the language in the experience.
40
40
  */
41
41
  var Tooltip = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
42
42
  var className = _ref.className,
@@ -5,12 +5,12 @@ var plugin = require("tailwindcss/plugin");
5
5
  var tooltipPlugin = plugin(function (_ref) {
6
6
  var addComponents = _ref.addComponents,
7
7
  theme = _ref.theme;
8
- var arrowSize = 4;
9
-
10
8
  /** @type {string} */
11
9
  var tooltipDarkBackground = theme("colors.grey.900");
12
10
  /** @type {string} */
13
11
  var tooltipLightBackground = theme("colors.white");
12
+ var animationDuration = "100ms";
13
+ var animationEasing = "cubic-bezier(.17,.61,.4,.95)";
14
14
  addComponents({
15
15
  ".tooltip": {
16
16
  padding: "".concat(theme("spacing.1"), " ").concat(theme("spacing.2")),
@@ -39,76 +39,99 @@ var tooltipPlugin = plugin(function (_ref) {
39
39
  }
40
40
  });
41
41
  addComponents({
42
- ".tooltip-wrapper": {
43
- display: "inline-block",
44
- lineHeight: "0",
45
- outline: "0px"
46
- },
47
- ".tooltip-wrapper-popper": {
48
- zIndex: theme("zIndex.tooltip"),
49
- userSelect: "none",
50
- maxWidth: theme("spacing.64")
51
- },
52
- ".tooltip-wrapper-arrow": {
53
- position: "absolute",
54
- display: "block",
55
- width: "".concat(arrowSize, "px"),
56
- height: "".concat(arrowSize, "px"),
57
- border: "".concat(arrowSize, "px solid transparent"),
58
- color: tooltipDarkBackground,
59
- '[data-popper-placement^="right"] > &': {
60
- left: "".concat(-arrowSize, "px"),
61
- borderLeft: "none",
62
- borderRightColor: "currentColor"
42
+ /* eslint-disable @algolia/satellite/prefer-stl-helper */
43
+ "@keyframes stl-tooltip-slide-down-and-fade": {
44
+ from: {
45
+ opacity: "0",
46
+ transform: "translateY(-2px)"
63
47
  },
64
- '[data-popper-placement^="left"] > &': {
65
- right: "".concat(-arrowSize, "px"),
66
- borderRight: "none",
67
- borderLeftColor: "currentColor"
68
- },
69
- '[data-popper-placement^="top"] > &': {
70
- top: "100%",
71
- borderBottom: "none",
72
- borderTopColor: "currentColor"
48
+ to: {
49
+ opacity: "1",
50
+ transform: "translateY(0)"
51
+ }
52
+ },
53
+ "@keyframes stl-tooltip-slide-left-and-fade": {
54
+ from: {
55
+ opacity: "0",
56
+ transform: "translateX(2px)"
73
57
  },
74
- '[data-popper-placement^="bottom"] > &': {
75
- top: "".concat(-arrowSize, "px"),
76
- borderTop: "none",
77
- borderBottomColor: "currentColor"
58
+ to: {
59
+ opacity: "1",
60
+ transform: "translateX(0)"
78
61
  }
79
62
  },
80
- ".tooltip-wrapper-arrow-light": {
81
- color: theme("colors.shadow.10"),
82
- "&::after": {
83
- position: "absolute",
84
- content: '" "',
85
- border: "".concat(arrowSize - 1, "px solid transparent")
63
+ "@keyframes stl-tooltip-slide-up-and-fade": {
64
+ from: {
65
+ opacity: "0",
66
+ transform: "translateY(2px)"
86
67
  },
87
- '[data-popper-placement^="left"] > &::after': {
88
- right: "1px",
89
- transform: "translate(0, -50%)",
90
- borderRight: "none",
91
- borderLeftColor: tooltipLightBackground
68
+ to: {
69
+ opacity: "1",
70
+ transform: "translateY(0)"
71
+ }
72
+ },
73
+ "@keyframes stl-tooltip-slide-right-and-fade": {
74
+ from: {
75
+ opacity: "0",
76
+ transform: "translateX(-2px)"
92
77
  },
93
- '[data-popper-placement^="right"] > &::after': {
94
- left: "1px",
95
- transform: "translate(0, -50%)",
96
- borderLeft: "none",
97
- borderRightColor: tooltipLightBackground
78
+ to: {
79
+ opacity: "1",
80
+ transform: "translateX(0)"
81
+ }
82
+ },
83
+ "@keyframes stl-tooltip-fade-out": {
84
+ from: {
85
+ opacity: "1"
98
86
  },
99
- '[data-popper-placement^="top"] > &::after': {
100
- bottom: "1px",
101
- transform: "translate(-50%, 0)",
102
- borderBottom: "none",
103
- borderTopColor: tooltipLightBackground
87
+ to: {
88
+ opacity: "0"
89
+ }
90
+ },
91
+ ".tooltip-content": {
92
+ zIndex: theme("zIndex.tooltip"),
93
+ userSelect: "none",
94
+ maxWidth: theme("spacing.64"),
95
+ // Even if the user has enabled reduced motion or animate is `false`,
96
+ // we still need to keep this animation to handle the hide delay
97
+ '&[data-state="closed"]': {
98
+ animation: "stl-tooltip-fade-out 0ms linear var(--tooltip-hide-delay)"
104
99
  },
105
- '[data-popper-placement^="bottom"] > &::after': {
106
- top: "1px",
107
- transform: "translate(-50%, 0)",
108
- borderTop: "none",
109
- borderBottomColor: tooltipLightBackground
100
+ "@media (prefers-reduced-motion: no-preference)": {
101
+ willChange: "transform, opacity",
102
+ '&[data-state="delayed-open"]': {
103
+ '&[data-side="top"]': {
104
+ animation: "stl-tooltip-slide-down-and-fade ".concat(animationDuration, " ").concat(animationEasing)
105
+ },
106
+ '&[data-side="right"]': {
107
+ animation: "stl-tooltip-slide-left-and-fade ".concat(animationDuration, " ").concat(animationEasing)
108
+ },
109
+ '&[data-side="left"]': {
110
+ animation: "stl-tooltip-slide-right-and-fade ".concat(animationDuration, " ").concat(animationEasing)
111
+ },
112
+ '&[data-side="bottom"]': {
113
+ animation: "stl-tooltip-slide-up-and-fade ".concat(animationDuration, " ").concat(animationEasing)
114
+ }
115
+ },
116
+ '&[data-state="closed"]': {
117
+ animation: "stl-tooltip-fade-out ".concat(animationDuration, " ").concat(animationEasing, " var(--tooltip-hide-delay)")
118
+ }
110
119
  }
120
+ },
121
+ ".tooltip-arrow-dark": {
122
+ fill: tooltipDarkBackground
123
+ },
124
+ // Since Radix relies on a SVG for the arrow, we use the stroke property
125
+ // with a dash array/offset to create a border around the arrow.
126
+ ".tooltip-arrow-light": {
127
+ fill: tooltipLightBackground,
128
+ stroke: theme("colors.shadow.10"),
129
+ strokeWidth: "3px",
130
+ strokeDasharray: "36",
131
+ strokeDashoffset: "-30"
111
132
  }
133
+ /* eslint-enable @algolia/satellite/prefer-stl-helper */
112
134
  });
113
135
  });
136
+
114
137
  module.exports = tooltipPlugin;
@@ -1,28 +1,15 @@
1
- import type { FunctionComponent, ReactNode } from "react";
2
- import { StrictModifier } from "react-popper";
1
+ import { ReactElement, ReactNode, ReactText, VFC } from "react";
3
2
  import type { TooltipWrapperBaseProps } from "./types";
4
- export declare const DEFAULT_TOOLTIP_POPPER_MODIFIERS: StrictModifier[];
5
3
  export interface TooltipWrapperProps extends TooltipWrapperBaseProps {
6
- show?: boolean;
7
- /**
8
- * Controls how long you should hover the wrapped element before displaying the tooltip (in ms)
9
- * @default 0
10
- * */
11
- delay?: number;
12
4
  /**
13
- * Controls how long the tooltip should stay displayed when leaving the wrapped element (in ms)
14
- * @default 500
15
- * */
16
- hideDelay?: number;
5
+ * Defines whether the tooltip should be displayed or not.
6
+ * @default undefined
7
+ */
8
+ show?: boolean;
17
9
  /**
18
- * Indicates whether the tooltip itself should be considered when computing the tooltip target.
19
- * Useful when the tooltip itself contains selectable text or interactive elements, and thus
20
- * shouldn't be dismissed when the mouse hovers it
21
- * @default true
10
+ * Defines the content of the tooltip.
22
11
  */
23
- interactive?: boolean;
24
12
  content: ReactNode;
25
- children: ReactNode;
13
+ children: ReactElement | ReactText;
26
14
  }
27
- export declare const TooltipWrapper: FunctionComponent<TooltipWrapperProps>;
28
- export default TooltipWrapper;
15
+ export declare const TooltipWrapper: VFC<TooltipWrapperProps>;