@instructure/ui-tooltip 11.7.3-snapshot-25 → 11.7.3-snapshot-27

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.
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = exports.Tooltip = void 0;
8
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
8
  var _react = require("react");
10
9
  var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
11
10
  var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
@@ -18,8 +17,7 @@ var _emotion = require("@instructure/emotion");
18
17
  var _styles = _interopRequireDefault(require("./styles"));
19
18
  var _props = require("./props");
20
19
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
21
- const _excluded = ["renderTip", "isShowingContent", "defaultIsShowingContent", "on", "color", "placement", "mountNode", "constrain", "offsetX", "offsetY", "positionTarget", "onShowContent", "onHideContent", "preventTooltip", "styles"];
22
- var _dec, _dec2, _class, _Tooltip;
20
+ var _dec, _dec2, _class;
23
21
  /*
24
22
  * The MIT License (MIT)
25
23
  *
@@ -48,45 +46,58 @@ var _dec, _dec2, _class, _Tooltip;
48
46
  category: components
49
47
  ---
50
48
  **/
51
- let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default), _dec(_class = _dec2(_class = (_Tooltip = class Tooltip extends _react.Component {
49
+ let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default), _dec(_class = _dec2(_class = class Tooltip extends _react.Component {
50
+ static displayName = "Tooltip";
51
+ static componentId = 'Tooltip';
52
+ static allowedProps = _props.allowedProps;
53
+ static defaultProps = {
54
+ defaultIsShowingContent: false,
55
+ color: 'primary',
56
+ placement: 'top',
57
+ constrain: 'window',
58
+ offsetX: 0,
59
+ offsetY: 0,
60
+ preventTooltip: false
61
+ };
62
+ _id;
63
+ ref = null;
64
+ handleRef = el => {
65
+ this.ref = el;
66
+ if (typeof this.props.elementRef === 'function') {
67
+ this.props.elementRef(el);
68
+ }
69
+ };
52
70
  constructor(props) {
53
71
  super(props);
54
- this._id = void 0;
55
- this.ref = null;
56
- this.handleRef = el => {
57
- this.ref = el;
58
- if (typeof this.props.elementRef === 'function') {
59
- this.props.elementRef(el);
60
- }
61
- };
62
- this.handleFocus = () => {
63
- this.setState({
64
- hasFocus: true
65
- });
66
- };
67
- this.handleBlur = () => {
68
- this.setState({
69
- hasFocus: false
70
- });
71
- };
72
72
  this._id = props.deterministicId();
73
73
  this.state = {
74
74
  hasFocus: false
75
75
  };
76
76
  }
77
77
  componentDidMount() {
78
- var _this$props$makeStyle, _this$props;
79
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
78
+ this.props.makeStyles?.();
80
79
  }
81
80
  componentDidUpdate() {
82
- var _this$props$makeStyle2, _this$props2;
83
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
81
+ this.props.makeStyles?.();
84
82
  }
83
+ handleFocus = () => {
84
+ this.setState({
85
+ hasFocus: true
86
+ });
87
+ };
88
+ handleBlur = () => {
89
+ this.setState({
90
+ hasFocus: false
91
+ });
92
+ };
85
93
  renderTrigger() {
86
- const _ref = this.props,
87
- children = _ref.children,
88
- as = _ref.as;
89
- const hasFocus = this.state.hasFocus;
94
+ const {
95
+ children,
96
+ as
97
+ } = this.props;
98
+ const {
99
+ hasFocus
100
+ } = this.state;
90
101
  const triggerProps = {
91
102
  'aria-describedby': this._id
92
103
  };
@@ -111,23 +122,24 @@ let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterminist
111
122
  }
112
123
  }
113
124
  render() {
114
- const _this$props3 = this.props,
115
- renderTip = _this$props3.renderTip,
116
- isShowingContent = _this$props3.isShowingContent,
117
- defaultIsShowingContent = _this$props3.defaultIsShowingContent,
118
- on = _this$props3.on,
119
- color = _this$props3.color,
120
- placement = _this$props3.placement,
121
- mountNode = _this$props3.mountNode,
122
- constrain = _this$props3.constrain,
123
- offsetX = _this$props3.offsetX,
124
- offsetY = _this$props3.offsetY,
125
- positionTarget = _this$props3.positionTarget,
126
- onShowContent = _this$props3.onShowContent,
127
- onHideContent = _this$props3.onHideContent,
128
- preventTooltip = _this$props3.preventTooltip,
129
- styles = _this$props3.styles,
130
- rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
125
+ const {
126
+ renderTip,
127
+ isShowingContent,
128
+ defaultIsShowingContent,
129
+ on,
130
+ color,
131
+ placement,
132
+ mountNode,
133
+ constrain,
134
+ offsetX,
135
+ offsetY,
136
+ positionTarget,
137
+ onShowContent,
138
+ onHideContent,
139
+ preventTooltip,
140
+ styles,
141
+ ...rest
142
+ } = this.props;
131
143
  return (0, _jsxRuntime.jsx)(_latest.Popover, {
132
144
  ...(0, _passthroughProps.passthroughProps)(rest),
133
145
  isShowingContent: !preventTooltip && isShowingContent,
@@ -155,19 +167,11 @@ let Tooltip = exports.Tooltip = (_dec = (0, _withDeterministicId.withDeterminist
155
167
  "data-cid": "Tooltip",
156
168
  children: !preventTooltip ? (0, _jsxRuntime.jsx)("span", {
157
169
  id: this._id,
158
- css: styles === null || styles === void 0 ? void 0 : styles.tooltip,
170
+ css: styles?.tooltip,
159
171
  role: "tooltip",
160
172
  children: (0, _callRenderProp.callRenderProp)(renderTip)
161
173
  }) : null
162
174
  });
163
175
  }
164
- }, _Tooltip.displayName = "Tooltip", _Tooltip.componentId = 'Tooltip', _Tooltip.allowedProps = _props.allowedProps, _Tooltip.defaultProps = {
165
- defaultIsShowingContent: false,
166
- color: 'primary',
167
- placement: 'top',
168
- constrain: 'window',
169
- offsetX: 0,
170
- offsetY: 0,
171
- preventTooltip: false
172
- }, _Tooltip)) || _class) || _class);
176
+ }) || _class) || _class);
173
177
  var _default = exports.default = Tooltip;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-tooltip",
3
- "version": "11.7.3-snapshot-25",
3
+ "version": "11.7.3-snapshot-27",
4
4
  "description": "A component for showing small text-only overlays on hover/focus.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -14,23 +14,23 @@
14
14
  "bugs": "https://github.com/instructure/instructure-ui/issues",
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
- "@babel/runtime": "^7.27.6",
18
- "@instructure/emotion": "11.7.3-snapshot-25",
19
- "@instructure/ui-popover": "11.7.3-snapshot-25",
20
- "@instructure/shared-types": "11.7.3-snapshot-25",
21
- "@instructure/ui-position": "11.7.3-snapshot-25",
22
- "@instructure/ui-react-utils": "11.7.3-snapshot-25",
23
- "@instructure/ui-themes": "11.7.3-snapshot-25",
24
- "@instructure/ui-utils": "11.7.3-snapshot-25"
17
+ "@babel/runtime": "^7.29.2",
18
+ "@instructure/emotion": "11.7.3-snapshot-27",
19
+ "@instructure/shared-types": "11.7.3-snapshot-27",
20
+ "@instructure/ui-popover": "11.7.3-snapshot-27",
21
+ "@instructure/ui-react-utils": "11.7.3-snapshot-27",
22
+ "@instructure/ui-position": "11.7.3-snapshot-27",
23
+ "@instructure/ui-utils": "11.7.3-snapshot-27",
24
+ "@instructure/ui-themes": "11.7.3-snapshot-27"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@testing-library/jest-dom": "^6.6.3",
28
28
  "@testing-library/react": "15.0.7",
29
29
  "@testing-library/user-event": "^14.6.1",
30
30
  "vitest": "^3.2.2",
31
- "@instructure/ui-babel-preset": "11.7.3-snapshot-25",
32
- "@instructure/ui-scripts": "11.7.3-snapshot-25",
33
- "@instructure/ui-color-utils": "11.7.3-snapshot-25"
31
+ "@instructure/ui-scripts": "11.7.3-snapshot-27",
32
+ "@instructure/ui-babel-preset": "11.7.3-snapshot-27",
33
+ "@instructure/ui-color-utils": "11.7.3-snapshot-27"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": ">=18 <=19"