@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.
- package/cjs/AnnouncementBadge/AnnouncementBadge.d.ts +2 -2
- package/cjs/AutoComplete/AutoComplete.tailwind.js +4 -1
- package/cjs/AutoComplete/components/AutoCompleteEmptyState.d.ts +2 -2
- package/cjs/AutoComplete/components/DefaultOptionItem.d.ts +2 -2
- package/cjs/Avatars/ApplicationAvatar.d.ts +2 -2
- package/cjs/Avatars/UserAvatar.d.ts +2 -2
- package/cjs/Badge/Badge.d.ts +3 -3
- package/cjs/Badge/Badge.js +6 -3
- package/cjs/Banners/Alert/Alert.d.ts +2 -2
- package/cjs/Banners/BigBertha/BigBertha.d.ts +2 -2
- package/cjs/Banners/Promote/Promote.d.ts +2 -2
- package/cjs/Button/ButtonGroup.d.ts +2 -2
- package/cjs/Button/PolymorphicIconButton.d.ts +1 -1
- package/cjs/Button/PolymorphicIconButton.js +4 -4
- package/cjs/Card/components/CardHeader.d.ts +2 -2
- package/cjs/Card/components/CardTitle.d.ts +2 -2
- package/cjs/Checkbox/Checkbox.js +3 -3
- package/cjs/Checkbox/Checkbox.tailwind.js +1 -1
- package/cjs/ClickAwayContainer/ClickAwayContainer.d.ts +2 -2
- package/cjs/DatePicker/DatePicker/DatePicker.d.ts +2 -2
- package/cjs/DatePicker/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/cjs/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +2 -2
- package/cjs/DatePicker/components/Calendar.d.ts +2 -2
- package/cjs/DatePicker/components/Display.d.ts +2 -2
- package/cjs/DatePicker/components/Footer.d.ts +2 -2
- package/cjs/DatePicker/components/FooterActions.d.ts +2 -2
- package/cjs/DatePicker/components/Modal.d.ts +2 -2
- package/cjs/DatePicker/components/NavBar.d.ts +2 -2
- package/cjs/DatePicker/components/SidePanel.d.ts +2 -2
- package/cjs/Dropdown/Dropdown.d.ts +20 -34
- package/cjs/Dropdown/components/DropdownButtonItem.d.ts +2 -7
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.d.ts +2 -2
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.d.ts +2 -2
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.d.ts +2 -1
- package/cjs/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.d.ts +2 -1
- package/cjs/Dropdown/components/DropdownFooterItem.d.ts +2 -2
- package/cjs/Dropdown/components/DropdownLinkItem.d.ts +2 -7
- package/cjs/Dropdown/components/DropdownRadioItem.d.ts +2 -7
- package/cjs/Dropdown/components/DropdownTitle.d.ts +2 -2
- package/cjs/Dropdown/components/DropdownToggleItem.d.ts +2 -7
- package/cjs/Dropzone/Dropzone.d.ts +2 -2
- package/cjs/EmptyState/EmptyState.d.ts +2 -2
- package/cjs/Field/Field.d.ts +2 -2
- package/cjs/Flag/Flag.d.ts +2 -2
- package/cjs/Flag/Flags.d.ts +2 -2
- package/cjs/FlexGrid/FlexGrid.d.ts +2 -2
- package/cjs/HelpUnderline/HelpUnderline.d.ts +5 -6
- package/cjs/HelpUnderline/HelpUnderline.js +13 -10
- package/cjs/Input/Input.tailwind.js +28 -4
- package/cjs/Insert/Insert.d.ts +2 -2
- package/cjs/KeyboardKey/KeyboardKey.d.ts +2 -2
- package/cjs/Medallion/Medallion.d.ts +2 -2
- package/cjs/Modal/Modal.d.ts +7 -5
- package/cjs/Modal/components/ModalFooter.d.ts +2 -2
- package/cjs/Modal/components/ModalSection.d.ts +2 -2
- package/cjs/Pagination/CompactPagination/CompactPagination.d.ts +2 -2
- package/cjs/Pagination/Pagination/Pagination.d.ts +2 -2
- package/cjs/ProgressBar/ProgressBar.d.ts +2 -2
- package/cjs/ProgressSpinner/ProgressSpinner.d.ts +2 -2
- package/cjs/RadioGroup/RadioButton.tailwind.js +4 -1
- package/cjs/RadioGroup/RadioGroup.d.ts +6 -6
- package/cjs/RangeSlider/RangeSlider.js +2 -2
- package/cjs/Satellite/Satellite.d.ts +2 -3
- package/cjs/Satellite/Satellite.js +27 -16
- package/cjs/Satellite/SatelliteContext.d.ts +1 -1
- package/cjs/Satellite/SatelliteContext.js +2 -1
- package/cjs/ScrollIndicator/ScrollIndicator.d.ts +2 -2
- package/cjs/Select/Select.tailwind.js +2 -2
- package/cjs/Separator/Separator.d.ts +8 -0
- package/cjs/Separator/Separator.js +29 -0
- package/cjs/Separator/Separator.tailwind.d.ts +5 -0
- package/cjs/Separator/Separator.tailwind.js +25 -0
- package/cjs/Separator/index.d.ts +2 -0
- package/cjs/Separator/index.js +27 -0
- package/cjs/Sidebar/Sidebar.d.ts +2 -2
- package/cjs/Sidebar/SidebarButtonLink.d.ts +2 -2
- package/cjs/Sidebar/SidebarButtonLink.js +8 -14
- package/cjs/Sidebar/SidebarHeader.d.ts +2 -2
- package/cjs/Sidebar/SidebarHeading.d.ts +2 -2
- package/cjs/Sidebar/SidebarLink.d.ts +2 -2
- package/cjs/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.d.ts +2 -2
- package/cjs/Sidebar/SidebarLinksGroup/SidebarGroupLink.d.ts +2 -2
- package/cjs/Sidebar/SidebarLinksGroup/SidebarLinksGroup.d.ts +2 -2
- package/cjs/Sidebar/SidebarNav.d.ts +2 -2
- package/cjs/Switch/Switch.d.ts +2 -2
- package/cjs/Switch/SwitchOption.d.ts +2 -2
- package/cjs/Tables/DataTable/DataTable.d.ts +4 -2
- package/cjs/Tables/DataTable/DataTable.js +9 -4
- package/cjs/Tables/DataTable/components/Footer.d.ts +2 -2
- package/cjs/Tables/DataTable/components/Loader.d.ts +2 -2
- package/cjs/Tables/Table/Table.d.ts +2 -2
- package/cjs/Tables/Table/components/TableFooter.d.ts +2 -2
- package/cjs/Tabs/ContentTabs.d.ts +2 -2
- package/cjs/Tabs/LinkTabs.d.ts +2 -2
- package/cjs/Tabs/components/LinkTab.d.ts +2 -2
- package/cjs/Tag/Tag.js +7 -7
- package/cjs/TextWrap/TextWrap.d.ts +2 -2
- package/cjs/Toggle/Toggle.js +3 -13
- package/cjs/Toggle/Toggle.tailwind.js +8 -2
- package/cjs/Tooltip/OverflowTooltipWrapper.d.ts +2 -5
- package/cjs/Tooltip/OverflowTooltipWrapper.js +20 -78
- package/cjs/Tooltip/Tooltip.d.ts +6 -6
- package/cjs/Tooltip/Tooltip.js +6 -6
- package/cjs/Tooltip/Tooltip.tailwind.js +85 -62
- package/cjs/Tooltip/TooltipWrapper.d.ts +8 -21
- package/cjs/Tooltip/TooltipWrapper.js +49 -158
- package/cjs/Tooltip/types.d.ts +57 -6
- package/cjs/Tooltip/utils.d.ts +1 -0
- package/cjs/Tooltip/utils.js +10 -0
- package/cjs/UserContent/UserContent.d.ts +2 -2
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +20 -8
- package/cjs/styles/tailwind.config.js +1 -1
- package/cjs/types.d.ts +6 -6
- package/esm/AnnouncementBadge/AnnouncementBadge.d.ts +2 -2
- package/esm/AutoComplete/AutoComplete.tailwind.js +4 -1
- package/esm/AutoComplete/components/AutoCompleteEmptyState.d.ts +2 -2
- package/esm/AutoComplete/components/DefaultOptionItem.d.ts +2 -2
- package/esm/Avatars/ApplicationAvatar.d.ts +2 -2
- package/esm/Avatars/UserAvatar.d.ts +2 -2
- package/esm/Badge/Badge.d.ts +3 -3
- package/esm/Badge/Badge.js +6 -3
- package/esm/Banners/Alert/Alert.d.ts +2 -2
- package/esm/Banners/BigBertha/BigBertha.d.ts +2 -2
- package/esm/Banners/Promote/Promote.d.ts +2 -2
- package/esm/Button/ButtonGroup.d.ts +2 -2
- package/esm/Button/PolymorphicIconButton.d.ts +1 -1
- package/esm/Button/PolymorphicIconButton.js +4 -4
- package/esm/Card/components/CardHeader.d.ts +2 -2
- package/esm/Card/components/CardTitle.d.ts +2 -2
- package/esm/Checkbox/Checkbox.js +3 -3
- package/esm/Checkbox/Checkbox.tailwind.js +1 -1
- package/esm/ClickAwayContainer/ClickAwayContainer.d.ts +2 -2
- package/esm/DatePicker/DatePicker/DatePicker.d.ts +2 -2
- package/esm/DatePicker/DateRangePicker/DateRangePicker.d.ts +2 -2
- package/esm/DatePicker/DateRangePicker/DateRangePickerDisplay.d.ts +2 -2
- package/esm/DatePicker/components/Calendar.d.ts +2 -2
- package/esm/DatePicker/components/Display.d.ts +2 -2
- package/esm/DatePicker/components/Footer.d.ts +2 -2
- package/esm/DatePicker/components/FooterActions.d.ts +2 -2
- package/esm/DatePicker/components/Modal.d.ts +2 -2
- package/esm/DatePicker/components/NavBar.d.ts +2 -2
- package/esm/DatePicker/components/SidePanel.d.ts +2 -2
- package/esm/Dropdown/Dropdown.d.ts +20 -34
- package/esm/Dropdown/components/DropdownButtonItem.d.ts +2 -7
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItem.d.ts +2 -2
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsGroup.d.ts +2 -2
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsMultiGroup.d.ts +2 -1
- package/esm/Dropdown/components/DropdownCollapsibleItem/DropdownCollapsibleItemsSingleGroup.d.ts +2 -1
- package/esm/Dropdown/components/DropdownFooterItem.d.ts +2 -2
- package/esm/Dropdown/components/DropdownLinkItem.d.ts +2 -7
- package/esm/Dropdown/components/DropdownRadioItem.d.ts +2 -7
- package/esm/Dropdown/components/DropdownTitle.d.ts +2 -2
- package/esm/Dropdown/components/DropdownToggleItem.d.ts +2 -7
- package/esm/Dropzone/Dropzone.d.ts +2 -2
- package/esm/EmptyState/EmptyState.d.ts +2 -2
- package/esm/Field/Field.d.ts +2 -2
- package/esm/Flag/Flag.d.ts +2 -2
- package/esm/Flag/Flags.d.ts +2 -2
- package/esm/FlexGrid/FlexGrid.d.ts +2 -2
- package/esm/HelpUnderline/HelpUnderline.d.ts +5 -6
- package/esm/HelpUnderline/HelpUnderline.js +13 -10
- package/esm/Input/Input.tailwind.js +28 -4
- package/esm/Insert/Insert.d.ts +2 -2
- package/esm/KeyboardKey/KeyboardKey.d.ts +2 -2
- package/esm/Medallion/Medallion.d.ts +2 -2
- package/esm/Modal/Modal.d.ts +7 -5
- package/esm/Modal/components/ModalFooter.d.ts +2 -2
- package/esm/Modal/components/ModalSection.d.ts +2 -2
- package/esm/Pagination/CompactPagination/CompactPagination.d.ts +2 -2
- package/esm/Pagination/Pagination/Pagination.d.ts +2 -2
- package/esm/ProgressBar/ProgressBar.d.ts +2 -2
- package/esm/ProgressSpinner/ProgressSpinner.d.ts +2 -2
- package/esm/RadioGroup/RadioButton.tailwind.js +4 -1
- package/esm/RadioGroup/RadioGroup.d.ts +6 -6
- package/esm/RangeSlider/RangeSlider.js +2 -2
- package/esm/Satellite/Satellite.d.ts +2 -3
- package/esm/Satellite/Satellite.js +26 -14
- package/esm/Satellite/SatelliteContext.d.ts +1 -1
- package/esm/Satellite/SatelliteContext.js +2 -1
- package/esm/ScrollIndicator/ScrollIndicator.d.ts +2 -2
- package/esm/Select/Select.tailwind.js +2 -2
- package/esm/Separator/Separator.d.ts +8 -0
- package/esm/Separator/Separator.js +17 -0
- package/esm/Separator/Separator.tailwind.d.ts +5 -0
- package/esm/Separator/Separator.tailwind.js +24 -0
- package/esm/Separator/index.d.ts +2 -0
- package/esm/Separator/index.js +2 -0
- package/esm/Sidebar/Sidebar.d.ts +2 -2
- package/esm/Sidebar/SidebarButtonLink.d.ts +2 -2
- package/esm/Sidebar/SidebarButtonLink.js +8 -14
- package/esm/Sidebar/SidebarHeader.d.ts +2 -2
- package/esm/Sidebar/SidebarHeading.d.ts +2 -2
- package/esm/Sidebar/SidebarLink.d.ts +2 -2
- package/esm/Sidebar/SidebarLinksGroup/ActiveLinkIndicator.d.ts +2 -2
- package/esm/Sidebar/SidebarLinksGroup/SidebarGroupLink.d.ts +2 -2
- package/esm/Sidebar/SidebarLinksGroup/SidebarLinksGroup.d.ts +2 -2
- package/esm/Sidebar/SidebarNav.d.ts +2 -2
- package/esm/Switch/Switch.d.ts +2 -2
- package/esm/Switch/SwitchOption.d.ts +2 -2
- package/esm/Tables/DataTable/DataTable.d.ts +4 -2
- package/esm/Tables/DataTable/DataTable.js +9 -4
- package/esm/Tables/DataTable/components/Footer.d.ts +2 -2
- package/esm/Tables/DataTable/components/Loader.d.ts +2 -2
- package/esm/Tables/Table/Table.d.ts +2 -2
- package/esm/Tables/Table/components/TableFooter.d.ts +2 -2
- package/esm/Tabs/ContentTabs.d.ts +2 -2
- package/esm/Tabs/LinkTabs.d.ts +2 -2
- package/esm/Tabs/components/LinkTab.d.ts +2 -2
- package/esm/Tag/Tag.js +7 -7
- package/esm/TextWrap/TextWrap.d.ts +2 -2
- package/esm/Toggle/Toggle.js +3 -13
- package/esm/Toggle/Toggle.tailwind.js +8 -2
- package/esm/Tooltip/OverflowTooltipWrapper.d.ts +2 -5
- package/esm/Tooltip/OverflowTooltipWrapper.js +20 -78
- package/esm/Tooltip/Tooltip.d.ts +6 -6
- package/esm/Tooltip/Tooltip.js +6 -6
- package/esm/Tooltip/Tooltip.tailwind.js +84 -62
- package/esm/Tooltip/TooltipWrapper.d.ts +8 -21
- package/esm/Tooltip/TooltipWrapper.js +47 -157
- package/esm/Tooltip/types.d.ts +57 -6
- package/esm/Tooltip/utils.d.ts +1 -0
- package/esm/Tooltip/utils.js +3 -0
- package/esm/UserContent/UserContent.d.ts +2 -2
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/styles/tailwind.config.js +1 -1
- package/esm/types.d.ts +6 -6
- package/package.json +3 -1
- 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.
|
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
|
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
|
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
|
31
|
-
|
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
|
-
|
45
|
-
|
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
|
-
|
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.
|
77
|
-
|
78
|
-
|
79
|
-
|
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
|
-
})
|
84
|
-
|
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;
|
package/cjs/Tooltip/Tooltip.d.ts
CHANGED
@@ -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
|
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;
|
package/cjs/Tooltip/Tooltip.js
CHANGED
@@ -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
|
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
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
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
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
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
|
-
|
75
|
-
|
76
|
-
|
77
|
-
borderBottomColor: "currentColor"
|
58
|
+
to: {
|
59
|
+
opacity: "1",
|
60
|
+
transform: "translateX(0)"
|
78
61
|
}
|
79
62
|
},
|
80
|
-
"
|
81
|
-
|
82
|
-
|
83
|
-
|
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
|
-
|
88
|
-
|
89
|
-
transform: "
|
90
|
-
|
91
|
-
|
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
|
-
|
94
|
-
|
95
|
-
transform: "
|
96
|
-
|
97
|
-
|
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
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
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
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
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
|
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
|
-
*
|
14
|
-
* @default
|
15
|
-
|
16
|
-
|
5
|
+
* Defines whether the tooltip should be displayed or not.
|
6
|
+
* @default undefined
|
7
|
+
*/
|
8
|
+
show?: boolean;
|
17
9
|
/**
|
18
|
-
*
|
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:
|
13
|
+
children: ReactElement | ReactText;
|
26
14
|
}
|
27
|
-
export declare const TooltipWrapper:
|
28
|
-
export default TooltipWrapper;
|
15
|
+
export declare const TooltipWrapper: VFC<TooltipWrapperProps>;
|