@terraware/web-components 1.0.43 → 1.0.45

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/IconTooltip/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAkB,YAAY,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA0BzC,oBAAY,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACtC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,QAAiB,EAAE,SAAuB,EAAE,KAAK,EAAE,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAsBxH"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/IconTooltip/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAkB,YAAY,EAAE,MAAM,eAAe,CAAC;AAI7D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAuBzC,oBAAY,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACtC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,QAAiB,EAAE,SAAuB,EAAE,KAAK,EAAE,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CAiCxH"}
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.default = IconTooltip;
9
9
 
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
11
+
10
12
  var _react = _interopRequireDefault(require("react"));
11
13
 
12
14
  var _material = require("@mui/material");
@@ -20,19 +22,16 @@ var _utils = require("../../utils");
20
22
  var useStyles = (0, _styles.makeStyles)(function (theme) {
21
23
  return {
22
24
  arrow: {
23
- color: theme.palette.ClrBaseGray800,
24
- marginLeft: '3px',
25
- marginTop: '-1px'
25
+ color: theme.palette.ClrBaseGray800
26
26
  },
27
27
  icon: {
28
28
  fill: theme.palette.ClrBaseGray800,
29
- paddingLeft: '.5em',
30
- paddingRight: '.5em',
29
+ marginLeft: '.5em',
30
+ marginRight: '.5em',
31
31
  verticalAlign: 'text-top'
32
32
  },
33
33
  tooltip: {
34
34
  backgroundColor: theme.palette.ClrBaseGray800,
35
- borderRadius: '8px',
36
35
  color: theme.palette.ClrBaseWhite,
37
36
  padding: '8px',
38
37
  '& a': {
@@ -49,22 +48,40 @@ function IconTooltip(_ref) {
49
48
  placement = _ref$placement === void 0 ? 'top-start' : _ref$placement,
50
49
  title = _ref.title;
51
50
 
51
+ var _React$useState = _react.default.useState(false),
52
+ _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
53
+ open = _React$useState2[0],
54
+ setOpen = _React$useState2[1];
55
+
52
56
  var _useDeviceInfo = (0, _utils.useDeviceInfo)(),
53
57
  isMobile = _useDeviceInfo.isMobile;
54
58
 
55
59
  var classes = useStyles();
60
+
61
+ var handleTooltipClose = function handleTooltipClose() {
62
+ setOpen(false);
63
+ };
64
+
65
+ var handleTooltipOpen = function handleTooltipOpen() {
66
+ setOpen(true);
67
+ };
68
+
56
69
  return /*#__PURE__*/_react.default.createElement(_material.Tooltip, {
57
70
  arrow: true,
58
71
  classes: {
59
72
  arrow: classes.arrow,
60
73
  tooltip: classes.tooltip
61
74
  },
75
+ onClose: handleTooltipClose,
76
+ open: isMobile ? open : undefined,
62
77
  placement: placement,
63
78
  sx: {
64
79
  maxWidth: isMobile ? '342px' : '464px'
65
80
  },
66
81
  title: title
67
- }, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_Icon.default, {
82
+ }, /*#__PURE__*/_react.default.createElement("span", {
83
+ onClick: handleTooltipOpen
84
+ }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
68
85
  name: iconName,
69
86
  className: classes.icon
70
87
  })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terraware/web-components",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
4
4
  "author": "Terraformation Inc.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {