@instructure/ui-buttons 8.22.0 → 8.22.1-snapshot.23

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/LICENSE.md ADDED
@@ -0,0 +1,27 @@
1
+ ---
2
+ title: The MIT License (MIT)
3
+ category: Getting Started
4
+ order: 9
5
+ ---
6
+
7
+ # The MIT License (MIT)
8
+
9
+ Copyright (c) 2015 Instructure, Inc.
10
+
11
+ **Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions.**
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
@@ -52,7 +52,6 @@ let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
52
52
 
53
53
  this.handleRef = el => {
54
54
  const elementRef = this.props.elementRef;
55
- this.ref = el;
56
55
 
57
56
  if (typeof elementRef === 'function') {
58
57
  elementRef(el);
@@ -101,7 +100,8 @@ let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
101
100
  props = _objectWithoutProperties(_this$props3, _excluded);
102
101
 
103
102
  return jsx("span", Object.assign({}, passthroughProps(props), {
104
- css: styles === null || styles === void 0 ? void 0 : styles.closeButton
103
+ css: styles === null || styles === void 0 ? void 0 : styles.closeButton,
104
+ ref: el => this.ref = el
105
105
  }), jsx(BaseButton, {
106
106
  renderIcon: IconXSolid,
107
107
  elementRef: this.handleRef,
@@ -46,7 +46,6 @@ let ToggleButton = (_dec = testable(), _dec(_class = (_temp = _class2 = class To
46
46
 
47
47
  this.handleRef = el => {
48
48
  const elementRef = this.props.elementRef;
49
- this.ref = el;
50
49
 
51
50
  if (typeof elementRef === 'function') {
52
51
  elementRef(el);
@@ -94,7 +93,8 @@ let ToggleButton = (_dec = testable(), _dec(_class = (_temp = _class2 = class To
94
93
  isShowingTooltip: false
95
94
  });
96
95
  },
97
- mountNode: mountNode
96
+ mountNode: mountNode,
97
+ elementRef: el => this.ref = el
98
98
  }, /*#__PURE__*/React.createElement(IconButton, Object.assign({}, passthroughProps(props), {
99
99
  screenReaderLabel: screenReaderLabel,
100
100
  withBackground: false,
@@ -48,7 +48,6 @@ let CloseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
48
48
 
49
49
  this.handleRef = el => {
50
50
  const elementRef = this.props.elementRef;
51
- this.ref = el;
52
51
 
53
52
  if (typeof elementRef === 'function') {
54
53
  elementRef(el);
@@ -96,7 +95,8 @@ let CloseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
96
95
  styles = _this$props3.styles,
97
96
  props = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
98
97
  return (0, _emotion.jsx)("span", Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
99
- css: styles === null || styles === void 0 ? void 0 : styles.closeButton
98
+ css: styles === null || styles === void 0 ? void 0 : styles.closeButton,
99
+ ref: el => this.ref = el
100
100
  }), (0, _emotion.jsx)(_BaseButton.BaseButton, {
101
101
  renderIcon: _IconXSolid.IconXSolid,
102
102
  elementRef: this.handleRef,
@@ -42,7 +42,6 @@ let ToggleButton = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _cl
42
42
 
43
43
  this.handleRef = el => {
44
44
  const elementRef = this.props.elementRef;
45
- this.ref = el;
46
45
 
47
46
  if (typeof elementRef === 'function') {
48
47
  elementRef(el);
@@ -89,7 +88,8 @@ let ToggleButton = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _cl
89
88
  isShowingTooltip: false
90
89
  });
91
90
  },
92
- mountNode: mountNode
91
+ mountNode: mountNode,
92
+ elementRef: el => this.ref = el
93
93
  }, /*#__PURE__*/_react.default.createElement(_IconButton.IconButton, Object.assign({}, (0, _passthroughProps.passthroughProps)(props), {
94
94
  screenReaderLabel: screenReaderLabel,
95
95
  withBackground: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-buttons",
3
- "version": "8.22.0",
3
+ "version": "8.22.1-snapshot.23+23720451b",
4
4
  "description": "Accessible button components",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,28 +23,28 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.22.0",
27
- "@instructure/ui-test-locator": "8.22.0",
28
- "@instructure/ui-test-queries": "8.22.0",
29
- "@instructure/ui-test-utils": "8.22.0",
30
- "@instructure/ui-themes": "8.22.0"
26
+ "@instructure/ui-babel-preset": "8.22.1-snapshot.23+23720451b",
27
+ "@instructure/ui-test-locator": "8.22.1-snapshot.23+23720451b",
28
+ "@instructure/ui-test-queries": "8.22.1-snapshot.23+23720451b",
29
+ "@instructure/ui-test-utils": "8.22.1-snapshot.23+23720451b",
30
+ "@instructure/ui-themes": "8.22.1-snapshot.23+23720451b"
31
31
  },
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.13.10",
34
- "@instructure/console": "8.22.0",
35
- "@instructure/emotion": "8.22.0",
36
- "@instructure/shared-types": "8.22.0",
37
- "@instructure/ui-a11y-content": "8.22.0",
38
- "@instructure/ui-a11y-utils": "8.22.0",
39
- "@instructure/ui-color-utils": "8.22.0",
40
- "@instructure/ui-dom-utils": "8.22.0",
41
- "@instructure/ui-icons": "8.22.0",
42
- "@instructure/ui-position": "8.22.0",
43
- "@instructure/ui-react-utils": "8.22.0",
44
- "@instructure/ui-testable": "8.22.0",
45
- "@instructure/ui-tooltip": "8.22.0",
46
- "@instructure/ui-utils": "8.22.0",
47
- "@instructure/ui-view": "8.22.0",
34
+ "@instructure/console": "8.22.1-snapshot.23+23720451b",
35
+ "@instructure/emotion": "8.22.1-snapshot.23+23720451b",
36
+ "@instructure/shared-types": "8.22.1-snapshot.23+23720451b",
37
+ "@instructure/ui-a11y-content": "8.22.1-snapshot.23+23720451b",
38
+ "@instructure/ui-a11y-utils": "8.22.1-snapshot.23+23720451b",
39
+ "@instructure/ui-color-utils": "8.22.1-snapshot.23+23720451b",
40
+ "@instructure/ui-dom-utils": "8.22.1-snapshot.23+23720451b",
41
+ "@instructure/ui-icons": "8.22.1-snapshot.23+23720451b",
42
+ "@instructure/ui-position": "8.22.1-snapshot.23+23720451b",
43
+ "@instructure/ui-react-utils": "8.22.1-snapshot.23+23720451b",
44
+ "@instructure/ui-testable": "8.22.1-snapshot.23+23720451b",
45
+ "@instructure/ui-tooltip": "8.22.1-snapshot.23+23720451b",
46
+ "@instructure/ui-utils": "8.22.1-snapshot.23+23720451b",
47
+ "@instructure/ui-view": "8.22.1-snapshot.23+23720451b",
48
48
  "keycode": "^2",
49
49
  "prop-types": "^15"
50
50
  },
@@ -54,5 +54,6 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "sideEffects": false
57
+ "sideEffects": false,
58
+ "gitHead": "23720451b9e91fc1ba0b31b4f22fff32669a4d59"
58
59
  }
@@ -68,9 +68,6 @@ class CloseButton extends Component<CloseButtonProps> {
68
68
 
69
69
  handleRef = (el: Element | null) => {
70
70
  const { elementRef } = this.props
71
-
72
- this.ref = el
73
-
74
71
  if (typeof elementRef === 'function') {
75
72
  elementRef(el)
76
73
  }
@@ -113,7 +110,11 @@ class CloseButton extends Component<CloseButtonProps> {
113
110
  } = this.props
114
111
 
115
112
  return (
116
- <span {...passthroughProps(props)} css={styles?.closeButton}>
113
+ <span
114
+ {...passthroughProps(props)}
115
+ css={styles?.closeButton}
116
+ ref={(el) => (this.ref = el)}
117
+ >
117
118
  <BaseButton
118
119
  renderIcon={IconXSolid}
119
120
  elementRef={this.handleRef}
@@ -70,9 +70,6 @@ class ToggleButton extends Component<ToggleButtonProps, ToggleButtonState> {
70
70
 
71
71
  handleRef = (el: Element | null) => {
72
72
  const { elementRef } = this.props
73
-
74
- this.ref = el
75
-
76
73
  if (typeof elementRef === 'function') {
77
74
  elementRef(el)
78
75
  }
@@ -115,6 +112,7 @@ class ToggleButton extends Component<ToggleButtonProps, ToggleButtonState> {
115
112
  this.setState({ isShowingTooltip: false })
116
113
  }}
117
114
  mountNode={mountNode}
115
+ elementRef={(el) => (this.ref = el)}
118
116
  >
119
117
  <IconButton
120
118
  {...passthroughProps(props)}