@instructure/ui-expandable 8.12.1-snapshot.7 → 8.13.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
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.13.0](https://github.com/instructure/instructure-ui/compare/v8.12.0...v8.13.0) (2021-12-01)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-expandable
9
+
6
10
  # [8.12.0](https://github.com/instructure/instructure-ui/compare/v8.11.1...v8.12.0) (2021-11-17)
7
11
 
8
12
  **Note:** Version bump only for package @instructure/ui-expandable
@@ -26,11 +26,12 @@ import { uid } from '@instructure/uid';
26
26
  import { createChainedFunction } from '@instructure/ui-utils';
27
27
  import { propTypes, allowedProps } from './props';
28
28
 
29
- const toggleExpanded = ({
30
- expanded
31
- }) => ({
32
- expanded: !expanded
33
- });
29
+ const toggleExpanded = _ref => {
30
+ let expanded = _ref.expanded;
31
+ return {
32
+ expanded: !expanded
33
+ };
34
+ };
34
35
  /**
35
36
  ---
36
37
  category: components/utilities
@@ -62,7 +63,8 @@ class Expandable extends Component {
62
63
  return this.isControlled() ? this.props.expanded : this.state.expanded;
63
64
  }
64
65
 
65
- isControlled(props = this.props) {
66
+ isControlled() {
67
+ let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props;
66
68
  return typeof props.expanded === 'boolean';
67
69
  }
68
70
 
@@ -79,6 +81,8 @@ class Expandable extends Component {
79
81
  }
80
82
 
81
83
  render() {
84
+ var _this = this;
85
+
82
86
  const _this$props = this.props,
83
87
  children = _this$props.children,
84
88
  _this$props$render = _this$props.render,
@@ -87,11 +91,12 @@ class Expandable extends Component {
87
91
  if (typeof render === 'function') {
88
92
  return render({
89
93
  expanded: this.expanded,
90
- getToggleProps: (props = {}) => {
94
+ getToggleProps: function () {
95
+ let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
91
96
  return {
92
- 'aria-controls': this._contentId,
93
- 'aria-expanded': this.expanded,
94
- onClick: createChainedFunction(this.handleToggle, props.onClick),
97
+ 'aria-controls': _this._contentId,
98
+ 'aria-expanded': _this.expanded,
99
+ onClick: createChainedFunction(_this.handleToggle, props.onClick),
95
100
  ...props
96
101
  };
97
102
  },
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Expandable = exports.default = void 0;
6
+ exports.default = exports.Expandable = void 0;
7
7
 
8
8
  var _react = require("react");
9
9
 
@@ -36,11 +36,12 @@ var _props = require("./props");
36
36
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
37
  * SOFTWARE.
38
38
  */
39
- const toggleExpanded = ({
40
- expanded
41
- }) => ({
42
- expanded: !expanded
43
- });
39
+ const toggleExpanded = _ref => {
40
+ let expanded = _ref.expanded;
41
+ return {
42
+ expanded: !expanded
43
+ };
44
+ };
44
45
  /**
45
46
  ---
46
47
  category: components/utilities
@@ -72,7 +73,8 @@ class Expandable extends _react.Component {
72
73
  return this.isControlled() ? this.props.expanded : this.state.expanded;
73
74
  }
74
75
 
75
- isControlled(props = this.props) {
76
+ isControlled() {
77
+ let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props;
76
78
  return typeof props.expanded === 'boolean';
77
79
  }
78
80
 
@@ -89,6 +91,8 @@ class Expandable extends _react.Component {
89
91
  }
90
92
 
91
93
  render() {
94
+ var _this = this;
95
+
92
96
  const _this$props = this.props,
93
97
  children = _this$props.children,
94
98
  _this$props$render = _this$props.render,
@@ -97,11 +101,12 @@ class Expandable extends _react.Component {
97
101
  if (typeof render === 'function') {
98
102
  return render({
99
103
  expanded: this.expanded,
100
- getToggleProps: (props = {}) => {
104
+ getToggleProps: function () {
105
+ let props = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
101
106
  return {
102
- 'aria-controls': this._contentId,
103
- 'aria-expanded': this.expanded,
104
- onClick: (0, _createChainedFunction.createChainedFunction)(this.handleToggle, props.onClick),
107
+ 'aria-controls': _this._contentId,
108
+ 'aria-expanded': _this.expanded,
109
+ onClick: (0, _createChainedFunction.createChainedFunction)(_this.handleToggle, props.onClick),
105
110
  ...props
106
111
  };
107
112
  },
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.allowedProps = exports.propTypes = void 0;
8
+ exports.propTypes = exports.allowedProps = void 0;
9
9
 
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-expandable",
3
- "version": "8.12.1-snapshot.7+1e7ac8219",
3
+ "version": "8.13.0",
4
4
  "description": "A utility component for show/hide functionality",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -25,16 +25,16 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/ui-prop-types": "8.12.1-snapshot.7+1e7ac8219",
29
- "@instructure/ui-testable": "8.12.1-snapshot.7+1e7ac8219",
30
- "@instructure/ui-utils": "8.12.1-snapshot.7+1e7ac8219",
31
- "@instructure/uid": "8.12.1-snapshot.7+1e7ac8219",
28
+ "@instructure/ui-prop-types": "8.13.0",
29
+ "@instructure/ui-testable": "8.13.0",
30
+ "@instructure/ui-utils": "8.13.0",
31
+ "@instructure/uid": "8.13.0",
32
32
  "prop-types": "^15"
33
33
  },
34
34
  "devDependencies": {
35
- "@instructure/ui-babel-preset": "8.12.1-snapshot.7+1e7ac8219",
36
- "@instructure/ui-color-utils": "8.12.1-snapshot.7+1e7ac8219",
37
- "@instructure/ui-test-utils": "8.12.1-snapshot.7+1e7ac8219"
35
+ "@instructure/ui-babel-preset": "8.13.0",
36
+ "@instructure/ui-color-utils": "8.13.0",
37
+ "@instructure/ui-test-utils": "8.13.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "react": ">=16.8 <=17"
@@ -42,6 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "sideEffects": false,
46
- "gitHead": "1e7ac821932a91fe9ef761c96f747c7ea1f3925a"
45
+ "sideEffects": false
47
46
  }
package/LICENSE.md DELETED
@@ -1,27 +0,0 @@
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.