@instructure/ui-buttons 8.10.1-snapshot.9 → 8.10.3-snapshot.10

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 (57) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/es/BaseButton/index.js +42 -38
  3. package/es/Button/index.js +3 -1
  4. package/es/CloseButton/index.js +28 -16
  5. package/es/CondensedButton/index.js +22 -14
  6. package/es/IconButton/index.js +27 -19
  7. package/es/ToggleButton/index.js +24 -15
  8. package/lib/BaseButton/index.js +42 -38
  9. package/lib/Button/index.js +3 -1
  10. package/lib/CloseButton/index.js +28 -16
  11. package/lib/CondensedButton/index.js +22 -14
  12. package/lib/IconButton/index.js +27 -19
  13. package/lib/ToggleButton/index.js +24 -15
  14. package/package.json +21 -21
  15. package/src/BaseButton/index.tsx +6 -5
  16. package/src/BaseButton/props.ts +1 -1
  17. package/src/Button/index.tsx +5 -5
  18. package/src/Button/props.ts +1 -1
  19. package/src/CloseButton/index.tsx +8 -1
  20. package/src/CloseButton/props.ts +1 -1
  21. package/src/CondensedButton/index.tsx +8 -1
  22. package/src/CondensedButton/props.ts +1 -1
  23. package/src/IconButton/index.tsx +8 -1
  24. package/src/IconButton/props.ts +1 -1
  25. package/src/ToggleButton/index.tsx +8 -1
  26. package/src/ToggleButton/props.ts +1 -1
  27. package/types/BaseButton/BaseButtonLocator.d.ts +64 -64
  28. package/types/BaseButton/index.d.ts +5 -4
  29. package/types/BaseButton/index.d.ts.map +1 -1
  30. package/types/BaseButton/props.d.ts +1 -1
  31. package/types/BaseButton/props.d.ts.map +1 -1
  32. package/types/Button/ButtonLocator.d.ts +64 -64
  33. package/types/Button/index.d.ts +4 -3
  34. package/types/Button/index.d.ts.map +1 -1
  35. package/types/Button/locator.d.ts +64 -64
  36. package/types/Button/props.d.ts +1 -1
  37. package/types/Button/props.d.ts.map +1 -1
  38. package/types/CloseButton/CloseButtonLocator.d.ts +64 -64
  39. package/types/CloseButton/index.d.ts +4 -2
  40. package/types/CloseButton/index.d.ts.map +1 -1
  41. package/types/CloseButton/props.d.ts +1 -1
  42. package/types/CloseButton/props.d.ts.map +1 -1
  43. package/types/CondensedButton/CondensedButtonLocator.d.ts +64 -64
  44. package/types/CondensedButton/index.d.ts +4 -2
  45. package/types/CondensedButton/index.d.ts.map +1 -1
  46. package/types/CondensedButton/props.d.ts +1 -1
  47. package/types/CondensedButton/props.d.ts.map +1 -1
  48. package/types/IconButton/IconButtonLocator.d.ts +64 -64
  49. package/types/IconButton/index.d.ts +4 -2
  50. package/types/IconButton/index.d.ts.map +1 -1
  51. package/types/IconButton/props.d.ts +1 -1
  52. package/types/IconButton/props.d.ts.map +1 -1
  53. package/types/ToggleButton/ToggleButtonLocator.d.ts +64 -64
  54. package/types/ToggleButton/index.d.ts +4 -2
  55. package/types/ToggleButton/index.d.ts.map +1 -1
  56. package/types/ToggleButton/props.d.ts +1 -1
  57. package/types/ToggleButton/props.d.ts.map +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [8.10.2](https://github.com/instructure/instructure-ui/compare/v8.10.1...v8.10.2) (2021-10-01)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-buttons
9
+
10
+ ## [8.10.1](https://github.com/instructure/instructure-ui/compare/v8.10.0...v8.10.1) (2021-10-01)
11
+
12
+ **Note:** Version bump only for package @instructure/ui-buttons
13
+
6
14
  # [8.10.0](https://github.com/instructure/instructure-ui/compare/v8.9.1...v8.10.0) (2021-09-28)
7
15
 
8
16
  **Note:** Version bump only for package @instructure/ui-buttons
@@ -49,10 +49,14 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
49
49
  constructor(...args) {
50
50
  super(...args);
51
51
  this._rootElement = null;
52
+ this.ref = null;
52
53
 
53
54
  this.handleElementRef = el => {
55
+ var _this$props$elementRe, _this$props;
56
+
54
57
  this._rootElement = el;
55
- this.props.elementRef(el);
58
+ this.ref = el;
59
+ (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
56
60
  };
57
61
 
58
62
  this.handleClick = event => {
@@ -71,10 +75,10 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
71
75
  };
72
76
 
73
77
  this.handleKeyDown = event => {
74
- const _this$props = this.props,
75
- onClick = _this$props.onClick,
76
- onKeyDown = _this$props.onKeyDown,
77
- href = _this$props.href;
78
+ const _this$props2 = this.props,
79
+ onClick = _this$props2.onClick,
80
+ onKeyDown = _this$props2.onKeyDown,
81
+ href = _this$props2.href;
78
82
  const interaction = this.interaction;
79
83
  onKeyDown(event); // behave like a button when space key is pressed
80
84
 
@@ -113,9 +117,9 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
113
117
  }
114
118
 
115
119
  get hasOnlyIconVisible() {
116
- const _this$props2 = this.props,
117
- children = _this$props2.children,
118
- renderIcon = _this$props2.renderIcon;
120
+ const _this$props3 = this.props,
121
+ children = _this$props3.children,
122
+ renderIcon = _this$props3.renderIcon;
119
123
  return !!(renderIcon && !hasVisibleChildren(children));
120
124
  }
121
125
 
@@ -142,10 +146,10 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
142
146
  }
143
147
 
144
148
  get focusColor() {
145
- const _this$props3 = this.props,
146
- color = _this$props3.color,
147
- focusColor = _this$props3.focusColor,
148
- withBackground = _this$props3.withBackground; // Give user specified focusColor preference
149
+ const _this$props4 = this.props,
150
+ color = _this$props4.color,
151
+ focusColor = _this$props4.focusColor,
152
+ withBackground = _this$props4.withBackground; // Give user specified focusColor preference
149
153
 
150
154
  if (focusColor) {
151
155
  return focusColor;
@@ -171,10 +175,10 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
171
175
  }
172
176
 
173
177
  renderChildren() {
174
- const _this$props4 = this.props,
175
- renderIcon = _this$props4.renderIcon,
176
- children = _this$props4.children,
177
- styles = _this$props4.styles;
178
+ const _this$props5 = this.props,
179
+ renderIcon = _this$props5.renderIcon,
180
+ children = _this$props5.children,
181
+ styles = _this$props5.styles;
178
182
  const wrappedChildren = jsx("span", {
179
183
  css: styles === null || styles === void 0 ? void 0 : styles.children
180
184
  }, children);
@@ -202,28 +206,28 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
202
206
  }
203
207
 
204
208
  render() {
205
- const _this$props5 = this.props,
206
- type = _this$props5.type,
207
- size = _this$props5.size,
208
- elementRef = _this$props5.elementRef,
209
- as = _this$props5.as,
210
- href = _this$props5.href,
211
- color = _this$props5.color,
212
- focusColor = _this$props5.focusColor,
213
- textAlign = _this$props5.textAlign,
214
- shape = _this$props5.shape,
215
- display = _this$props5.display,
216
- withBackground = _this$props5.withBackground,
217
- withBorder = _this$props5.withBorder,
218
- isCondensed = _this$props5.isCondensed,
219
- margin = _this$props5.margin,
220
- cursor = _this$props5.cursor,
221
- onClick = _this$props5.onClick,
222
- renderIcon = _this$props5.renderIcon,
223
- tabIndex = _this$props5.tabIndex,
224
- styles = _this$props5.styles,
225
- makeStyles = _this$props5.makeStyles,
226
- props = _objectWithoutProperties(_this$props5, _excluded);
209
+ const _this$props6 = this.props,
210
+ type = _this$props6.type,
211
+ size = _this$props6.size,
212
+ elementRef = _this$props6.elementRef,
213
+ as = _this$props6.as,
214
+ href = _this$props6.href,
215
+ color = _this$props6.color,
216
+ focusColor = _this$props6.focusColor,
217
+ textAlign = _this$props6.textAlign,
218
+ shape = _this$props6.shape,
219
+ display = _this$props6.display,
220
+ withBackground = _this$props6.withBackground,
221
+ withBorder = _this$props6.withBorder,
222
+ isCondensed = _this$props6.isCondensed,
223
+ margin = _this$props6.margin,
224
+ cursor = _this$props6.cursor,
225
+ onClick = _this$props6.onClick,
226
+ renderIcon = _this$props6.renderIcon,
227
+ tabIndex = _this$props6.tabIndex,
228
+ styles = _this$props6.styles,
229
+ makeStyles = _this$props6.makeStyles,
230
+ props = _objectWithoutProperties(_this$props6, _excluded);
227
231
 
228
232
  const isDisabled = this.isDisabled,
229
233
  isEnabled = this.isEnabled,
@@ -44,10 +44,12 @@ let Button = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable()
44
44
  constructor(...args) {
45
45
  super(...args);
46
46
  this._buttonComponent = null;
47
+ this.ref = null;
47
48
 
48
49
  this.handleElementRef = el => {
49
50
  const elementRef = this.props.elementRef;
50
- elementRef(el);
51
+ this.ref = el;
52
+ elementRef === null || elementRef === void 0 ? void 0 : elementRef(el);
51
53
  };
52
54
 
53
55
  this.handleButtonRef = component => {
@@ -45,6 +45,18 @@ category: components
45
45
  ---
46
46
  **/
47
47
  let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class CloseButton extends Component {
48
+ constructor(...args) {
49
+ super(...args);
50
+ this.ref = null;
51
+
52
+ this.handleRef = el => {
53
+ var _this$props$elementRe, _this$props;
54
+
55
+ this.ref = el;
56
+ (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
57
+ };
58
+ }
59
+
48
60
  componentDidMount() {
49
61
  this.props.makeStyles();
50
62
  }
@@ -65,27 +77,27 @@ let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
65
77
  }
66
78
 
67
79
  render() {
68
- const _this$props = this.props,
69
- screenReaderLabel = _this$props.screenReaderLabel,
70
- elementRef = _this$props.elementRef,
71
- size = _this$props.size,
72
- onClick = _this$props.onClick,
73
- margin = _this$props.margin,
74
- placement = _this$props.placement,
75
- offset = _this$props.offset,
76
- type = _this$props.type,
77
- as = _this$props.as,
78
- href = _this$props.href,
79
- cursor = _this$props.cursor,
80
- tabIndex = _this$props.tabIndex,
81
- styles = _this$props.styles,
82
- props = _objectWithoutProperties(_this$props, _excluded);
80
+ const _this$props2 = this.props,
81
+ screenReaderLabel = _this$props2.screenReaderLabel,
82
+ elementRef = _this$props2.elementRef,
83
+ size = _this$props2.size,
84
+ onClick = _this$props2.onClick,
85
+ margin = _this$props2.margin,
86
+ placement = _this$props2.placement,
87
+ offset = _this$props2.offset,
88
+ type = _this$props2.type,
89
+ as = _this$props2.as,
90
+ href = _this$props2.href,
91
+ cursor = _this$props2.cursor,
92
+ tabIndex = _this$props2.tabIndex,
93
+ styles = _this$props2.styles,
94
+ props = _objectWithoutProperties(_this$props2, _excluded);
83
95
 
84
96
  return jsx("span", Object.assign({}, passthroughProps(props), {
85
97
  css: styles === null || styles === void 0 ? void 0 : styles.closeButton
86
98
  }), jsx(BaseButton, {
87
99
  renderIcon: IconXSolid,
88
- elementRef: elementRef,
100
+ elementRef: this.handleRef,
89
101
  interaction: this.interaction,
90
102
  type: type,
91
103
  color: this.color,
@@ -44,6 +44,14 @@ let CondensedButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = t
44
44
  constructor(...args) {
45
45
  super(...args);
46
46
  this._baseButton = null;
47
+ this.ref = null;
48
+
49
+ this.handleRef = el => {
50
+ var _this$props$elementRe, _this$props;
51
+
52
+ this.ref = el;
53
+ (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
54
+ };
47
55
  }
48
56
 
49
57
  get focused() {
@@ -55,19 +63,19 @@ let CondensedButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = t
55
63
  }
56
64
 
57
65
  render() {
58
- const _this$props = this.props,
59
- children = _this$props.children,
60
- type = _this$props.type,
61
- size = _this$props.size,
62
- elementRef = _this$props.elementRef,
63
- as = _this$props.as,
64
- interaction = _this$props.interaction,
65
- color = _this$props.color,
66
- margin = _this$props.margin,
67
- cursor = _this$props.cursor,
68
- href = _this$props.href,
69
- renderIcon = _this$props.renderIcon,
70
- props = _objectWithoutProperties(_this$props, _excluded);
66
+ const _this$props2 = this.props,
67
+ children = _this$props2.children,
68
+ type = _this$props2.type,
69
+ size = _this$props2.size,
70
+ elementRef = _this$props2.elementRef,
71
+ as = _this$props2.as,
72
+ interaction = _this$props2.interaction,
73
+ color = _this$props2.color,
74
+ margin = _this$props2.margin,
75
+ cursor = _this$props2.cursor,
76
+ href = _this$props2.href,
77
+ renderIcon = _this$props2.renderIcon,
78
+ props = _objectWithoutProperties(_this$props2, _excluded);
71
79
 
72
80
  const themeOverride = this.props.themeOverride;
73
81
  return /*#__PURE__*/React.createElement(BaseButton, Object.assign({}, passthroughProps(props), {
@@ -76,7 +84,7 @@ let CondensedButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = t
76
84
  withBorder: false,
77
85
  type: type,
78
86
  size: size,
79
- elementRef: elementRef,
87
+ elementRef: this.handleRef,
80
88
  as: as,
81
89
  interaction: interaction,
82
90
  color: color,
@@ -45,6 +45,14 @@ let IconButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testab
45
45
  constructor(...args) {
46
46
  super(...args);
47
47
  this._baseButton = null;
48
+ this.ref = null;
49
+
50
+ this.handleRef = el => {
51
+ var _this$props$elementRe, _this$props;
52
+
53
+ this.ref = el;
54
+ (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
55
+ };
48
56
  }
49
57
 
50
58
  get focused() {
@@ -56,30 +64,30 @@ let IconButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testab
56
64
  }
57
65
 
58
66
  render() {
59
- const _this$props = this.props,
60
- children = _this$props.children,
61
- renderIcon = _this$props.renderIcon,
62
- screenReaderLabel = _this$props.screenReaderLabel,
63
- type = _this$props.type,
64
- size = _this$props.size,
65
- elementRef = _this$props.elementRef,
66
- as = _this$props.as,
67
- interaction = _this$props.interaction,
68
- color = _this$props.color,
69
- focusColor = _this$props.focusColor,
70
- shape = _this$props.shape,
71
- withBackground = _this$props.withBackground,
72
- withBorder = _this$props.withBorder,
73
- margin = _this$props.margin,
74
- cursor = _this$props.cursor,
75
- href = _this$props.href,
76
- props = _objectWithoutProperties(_this$props, _excluded);
67
+ const _this$props2 = this.props,
68
+ children = _this$props2.children,
69
+ renderIcon = _this$props2.renderIcon,
70
+ screenReaderLabel = _this$props2.screenReaderLabel,
71
+ type = _this$props2.type,
72
+ size = _this$props2.size,
73
+ elementRef = _this$props2.elementRef,
74
+ as = _this$props2.as,
75
+ interaction = _this$props2.interaction,
76
+ color = _this$props2.color,
77
+ focusColor = _this$props2.focusColor,
78
+ shape = _this$props2.shape,
79
+ withBackground = _this$props2.withBackground,
80
+ withBorder = _this$props2.withBorder,
81
+ margin = _this$props2.margin,
82
+ cursor = _this$props2.cursor,
83
+ href = _this$props2.href,
84
+ props = _objectWithoutProperties(_this$props2, _excluded);
77
85
 
78
86
  const themeOverride = this.props.themeOverride;
79
87
  return /*#__PURE__*/React.createElement(BaseButton, Object.assign({}, passthroughProps(props), {
80
88
  type: type,
81
89
  size: size,
82
- elementRef: elementRef,
90
+ elementRef: this.handleRef,
83
91
  as: as,
84
92
  interaction: interaction,
85
93
  color: color,
@@ -41,6 +41,15 @@ category: components
41
41
  let ToggleButton = (_dec = testable(), _dec(_class = (_temp = _class2 = class ToggleButton extends Component {
42
42
  constructor(props) {
43
43
  super(props);
44
+ this.ref = null;
45
+
46
+ this.handleRef = el => {
47
+ var _this$props$elementRe, _this$props;
48
+
49
+ this.ref = el;
50
+ (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
51
+ };
52
+
44
53
  this.state = {
45
54
  isShowingTooltip: props.isShowingTooltip || false
46
55
  };
@@ -51,20 +60,20 @@ let ToggleButton = (_dec = testable(), _dec(_class = (_temp = _class2 = class To
51
60
  }
52
61
 
53
62
  render() {
54
- const _this$props = this.props,
55
- as = _this$props.as,
56
- color = _this$props.color,
57
- elementRef = _this$props.elementRef,
58
- size = _this$props.size,
59
- interaction = _this$props.interaction,
60
- mountNode = _this$props.mountNode,
61
- renderIcon = _this$props.renderIcon,
62
- renderTooltipContent = _this$props.renderTooltipContent,
63
- screenReaderLabel = _this$props.screenReaderLabel,
64
- status = _this$props.status,
65
- placement = _this$props.placement,
66
- onClick = _this$props.onClick,
67
- props = _objectWithoutProperties(_this$props, _excluded);
63
+ const _this$props2 = this.props,
64
+ as = _this$props2.as,
65
+ color = _this$props2.color,
66
+ elementRef = _this$props2.elementRef,
67
+ size = _this$props2.size,
68
+ interaction = _this$props2.interaction,
69
+ mountNode = _this$props2.mountNode,
70
+ renderIcon = _this$props2.renderIcon,
71
+ renderTooltipContent = _this$props2.renderTooltipContent,
72
+ screenReaderLabel = _this$props2.screenReaderLabel,
73
+ status = _this$props2.status,
74
+ placement = _this$props2.placement,
75
+ onClick = _this$props2.onClick,
76
+ props = _objectWithoutProperties(_this$props2, _excluded);
68
77
 
69
78
  return /*#__PURE__*/React.createElement(Tooltip, {
70
79
  renderTip: renderTooltipContent,
@@ -89,7 +98,7 @@ let ToggleButton = (_dec = testable(), _dec(_class = (_temp = _class2 = class To
89
98
  withBorder: false,
90
99
  color: color,
91
100
  size: size,
92
- elementRef: elementRef,
101
+ elementRef: this.handleRef,
93
102
  as: as,
94
103
  onClick: onClick,
95
104
  interaction: interaction,
@@ -50,10 +50,14 @@ let BaseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
50
50
  constructor(...args) {
51
51
  super(...args);
52
52
  this._rootElement = null;
53
+ this.ref = null;
53
54
 
54
55
  this.handleElementRef = el => {
56
+ var _this$props$elementRe, _this$props;
57
+
55
58
  this._rootElement = el;
56
- this.props.elementRef(el);
59
+ this.ref = el;
60
+ (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
57
61
  };
58
62
 
59
63
  this.handleClick = event => {
@@ -72,10 +76,10 @@ let BaseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
72
76
  };
73
77
 
74
78
  this.handleKeyDown = event => {
75
- const _this$props = this.props,
76
- onClick = _this$props.onClick,
77
- onKeyDown = _this$props.onKeyDown,
78
- href = _this$props.href;
79
+ const _this$props2 = this.props,
80
+ onClick = _this$props2.onClick,
81
+ onKeyDown = _this$props2.onKeyDown,
82
+ href = _this$props2.href;
79
83
  const interaction = this.interaction;
80
84
  onKeyDown(event); // behave like a button when space key is pressed
81
85
 
@@ -114,9 +118,9 @@ let BaseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
114
118
  }
115
119
 
116
120
  get hasOnlyIconVisible() {
117
- const _this$props2 = this.props,
118
- children = _this$props2.children,
119
- renderIcon = _this$props2.renderIcon;
121
+ const _this$props3 = this.props,
122
+ children = _this$props3.children,
123
+ renderIcon = _this$props3.renderIcon;
120
124
  return !!(renderIcon && !(0, _hasVisibleChildren.hasVisibleChildren)(children));
121
125
  }
122
126
 
@@ -143,10 +147,10 @@ let BaseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
143
147
  }
144
148
 
145
149
  get focusColor() {
146
- const _this$props3 = this.props,
147
- color = _this$props3.color,
148
- focusColor = _this$props3.focusColor,
149
- withBackground = _this$props3.withBackground; // Give user specified focusColor preference
150
+ const _this$props4 = this.props,
151
+ color = _this$props4.color,
152
+ focusColor = _this$props4.focusColor,
153
+ withBackground = _this$props4.withBackground; // Give user specified focusColor preference
150
154
 
151
155
  if (focusColor) {
152
156
  return focusColor;
@@ -172,10 +176,10 @@ let BaseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
172
176
  }
173
177
 
174
178
  renderChildren() {
175
- const _this$props4 = this.props,
176
- renderIcon = _this$props4.renderIcon,
177
- children = _this$props4.children,
178
- styles = _this$props4.styles;
179
+ const _this$props5 = this.props,
180
+ renderIcon = _this$props5.renderIcon,
181
+ children = _this$props5.children,
182
+ styles = _this$props5.styles;
179
183
  const wrappedChildren = (0, _emotion.jsx)("span", {
180
184
  css: styles === null || styles === void 0 ? void 0 : styles.children
181
185
  }, children);
@@ -203,28 +207,28 @@ let BaseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default
203
207
  }
204
208
 
205
209
  render() {
206
- const _this$props5 = this.props,
207
- type = _this$props5.type,
208
- size = _this$props5.size,
209
- elementRef = _this$props5.elementRef,
210
- as = _this$props5.as,
211
- href = _this$props5.href,
212
- color = _this$props5.color,
213
- focusColor = _this$props5.focusColor,
214
- textAlign = _this$props5.textAlign,
215
- shape = _this$props5.shape,
216
- display = _this$props5.display,
217
- withBackground = _this$props5.withBackground,
218
- withBorder = _this$props5.withBorder,
219
- isCondensed = _this$props5.isCondensed,
220
- margin = _this$props5.margin,
221
- cursor = _this$props5.cursor,
222
- onClick = _this$props5.onClick,
223
- renderIcon = _this$props5.renderIcon,
224
- tabIndex = _this$props5.tabIndex,
225
- styles = _this$props5.styles,
226
- makeStyles = _this$props5.makeStyles,
227
- props = (0, _objectWithoutProperties2.default)(_this$props5, _excluded);
210
+ const _this$props6 = this.props,
211
+ type = _this$props6.type,
212
+ size = _this$props6.size,
213
+ elementRef = _this$props6.elementRef,
214
+ as = _this$props6.as,
215
+ href = _this$props6.href,
216
+ color = _this$props6.color,
217
+ focusColor = _this$props6.focusColor,
218
+ textAlign = _this$props6.textAlign,
219
+ shape = _this$props6.shape,
220
+ display = _this$props6.display,
221
+ withBackground = _this$props6.withBackground,
222
+ withBorder = _this$props6.withBorder,
223
+ isCondensed = _this$props6.isCondensed,
224
+ margin = _this$props6.margin,
225
+ cursor = _this$props6.cursor,
226
+ onClick = _this$props6.onClick,
227
+ renderIcon = _this$props6.renderIcon,
228
+ tabIndex = _this$props6.tabIndex,
229
+ styles = _this$props6.styles,
230
+ makeStyles = _this$props6.makeStyles,
231
+ props = (0, _objectWithoutProperties2.default)(_this$props6, _excluded);
228
232
  const isDisabled = this.isDisabled,
229
233
  isEnabled = this.isEnabled,
230
234
  isReadOnly = this.isReadOnly;
@@ -41,10 +41,12 @@ let Button = (_dec = (0, _emotion.withStyle)(null, _theme.default), _dec2 = (0,
41
41
  constructor(...args) {
42
42
  super(...args);
43
43
  this._buttonComponent = null;
44
+ this.ref = null;
44
45
 
45
46
  this.handleElementRef = el => {
46
47
  const elementRef = this.props.elementRef;
47
- elementRef(el);
48
+ this.ref = el;
49
+ elementRef === null || elementRef === void 0 ? void 0 : elementRef(el);
48
50
  };
49
51
 
50
52
  this.handleButtonRef = component => {
@@ -41,6 +41,18 @@ category: components
41
41
  ---
42
42
  **/
43
43
  let CloseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class CloseButton extends _react.Component {
44
+ constructor(...args) {
45
+ super(...args);
46
+ this.ref = null;
47
+
48
+ this.handleRef = el => {
49
+ var _this$props$elementRe, _this$props;
50
+
51
+ this.ref = el;
52
+ (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
53
+ };
54
+ }
55
+
44
56
  componentDidMount() {
45
57
  this.props.makeStyles();
46
58
  }
@@ -61,26 +73,26 @@ let CloseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
61
73
  }
62
74
 
63
75
  render() {
64
- const _this$props = this.props,
65
- screenReaderLabel = _this$props.screenReaderLabel,
66
- elementRef = _this$props.elementRef,
67
- size = _this$props.size,
68
- onClick = _this$props.onClick,
69
- margin = _this$props.margin,
70
- placement = _this$props.placement,
71
- offset = _this$props.offset,
72
- type = _this$props.type,
73
- as = _this$props.as,
74
- href = _this$props.href,
75
- cursor = _this$props.cursor,
76
- tabIndex = _this$props.tabIndex,
77
- styles = _this$props.styles,
78
- props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
76
+ const _this$props2 = this.props,
77
+ screenReaderLabel = _this$props2.screenReaderLabel,
78
+ elementRef = _this$props2.elementRef,
79
+ size = _this$props2.size,
80
+ onClick = _this$props2.onClick,
81
+ margin = _this$props2.margin,
82
+ placement = _this$props2.placement,
83
+ offset = _this$props2.offset,
84
+ type = _this$props2.type,
85
+ as = _this$props2.as,
86
+ href = _this$props2.href,
87
+ cursor = _this$props2.cursor,
88
+ tabIndex = _this$props2.tabIndex,
89
+ styles = _this$props2.styles,
90
+ props = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
79
91
  return (0, _emotion.jsx)("span", Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
80
92
  css: styles === null || styles === void 0 ? void 0 : styles.closeButton
81
93
  }), (0, _emotion.jsx)(_BaseButton.BaseButton, {
82
94
  renderIcon: _IconXSolid.IconXSolid,
83
- elementRef: elementRef,
95
+ elementRef: this.handleRef,
84
96
  interaction: this.interaction,
85
97
  type: type,
86
98
  color: this.color,
@@ -39,6 +39,14 @@ let CondensedButton = (_dec = (0, _emotion.withStyle)(null, _theme.default), _de
39
39
  constructor(...args) {
40
40
  super(...args);
41
41
  this._baseButton = null;
42
+ this.ref = null;
43
+
44
+ this.handleRef = el => {
45
+ var _this$props$elementRe, _this$props;
46
+
47
+ this.ref = el;
48
+ (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
49
+ };
42
50
  }
43
51
 
44
52
  get focused() {
@@ -50,19 +58,19 @@ let CondensedButton = (_dec = (0, _emotion.withStyle)(null, _theme.default), _de
50
58
  }
51
59
 
52
60
  render() {
53
- const _this$props = this.props,
54
- children = _this$props.children,
55
- type = _this$props.type,
56
- size = _this$props.size,
57
- elementRef = _this$props.elementRef,
58
- as = _this$props.as,
59
- interaction = _this$props.interaction,
60
- color = _this$props.color,
61
- margin = _this$props.margin,
62
- cursor = _this$props.cursor,
63
- href = _this$props.href,
64
- renderIcon = _this$props.renderIcon,
65
- props = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
61
+ const _this$props2 = this.props,
62
+ children = _this$props2.children,
63
+ type = _this$props2.type,
64
+ size = _this$props2.size,
65
+ elementRef = _this$props2.elementRef,
66
+ as = _this$props2.as,
67
+ interaction = _this$props2.interaction,
68
+ color = _this$props2.color,
69
+ margin = _this$props2.margin,
70
+ cursor = _this$props2.cursor,
71
+ href = _this$props2.href,
72
+ renderIcon = _this$props2.renderIcon,
73
+ props = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
66
74
  const themeOverride = this.props.themeOverride;
67
75
  return /*#__PURE__*/_react.default.createElement(_BaseButton.BaseButton, Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
68
76
  isCondensed: true,
@@ -70,7 +78,7 @@ let CondensedButton = (_dec = (0, _emotion.withStyle)(null, _theme.default), _de
70
78
  withBorder: false,
71
79
  type: type,
72
80
  size: size,
73
- elementRef: elementRef,
81
+ elementRef: this.handleRef,
74
82
  as: as,
75
83
  interaction: interaction,
76
84
  color: color,