@superdispatch/ui 0.21.8 → 0.21.14

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/dist-src/index.js CHANGED
@@ -16,6 +16,7 @@ export * from "./dropdown-button/DropdownButton.js";
16
16
  export * from "./grid/GridStack.js";
17
17
  export * from "./grid/InlineGrid.js";
18
18
  export * from "./info-card/InfoCard.js";
19
+ export * from "./info-tooltip/InfoTooltip.js";
19
20
  export * from "./inline/Inline.js";
20
21
  export * from "./number-field/NumberField.js";
21
22
  export * from "./overflow-text/OverflowText.js";
@@ -0,0 +1,54 @@
1
+ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["children", "iconButtonProps", "fontSize", "TextProps", "title", "isOpen", "onClick", "onClose"];
4
+ import { IconButton, Tooltip, Typography } from '@material-ui/core';
5
+ import { Info } from '@material-ui/icons';
6
+ import { forwardRef } from 'react';
7
+ import styled from 'styled-components';
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { jsxs as _jsxs } from "react/jsx-runtime";
10
+ var Root = /*#__PURE__*/styled.div.withConfig({
11
+ displayName: "InfoTooltip__Root",
12
+ componentId: "SD__sc-1emqpa9-0"
13
+ })(["display:flex;align-items:center;"]);
14
+ export var InfoTooltip = /*#__PURE__*/forwardRef((_ref, ref) => {
15
+ var {
16
+ children,
17
+ iconButtonProps,
18
+ fontSize = 'small',
19
+ TextProps,
20
+ title,
21
+ isOpen,
22
+ onClick,
23
+ onClose
24
+ } = _ref,
25
+ props = _objectWithoutProperties(_ref, _excluded);
26
+
27
+ var tooltip = /*#__PURE__*/_jsx(Tooltip, _objectSpread(_objectSpread({
28
+ open: isOpen,
29
+ title: title,
30
+ placement: "top",
31
+ onClose: onClose,
32
+ disableFocusListener: true,
33
+ disableTouchListener: true,
34
+ onClick: onClick,
35
+ ref: ref
36
+ }, props), {}, {
37
+ children: /*#__PURE__*/_jsx(IconButton, _objectSpread(_objectSpread({}, iconButtonProps), {}, {
38
+ size: "small",
39
+ onMouseOver: onClick,
40
+ children: /*#__PURE__*/_jsx(Info, {
41
+ color: "action",
42
+ fontSize: fontSize
43
+ })
44
+ }))
45
+ }));
46
+
47
+ if (!children) return tooltip;
48
+ return /*#__PURE__*/_jsxs(Root, {
49
+ children: [/*#__PURE__*/_jsx(Typography, _objectSpread(_objectSpread({}, TextProps), {}, {
50
+ children: children
51
+ })), tooltip]
52
+ });
53
+ });
54
+ if (process.env.NODE_ENV !== "production") InfoTooltip.displayName = "InfoTooltip";