@instructure/ui-toggle-details 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-toggle-details
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-toggle-details
@@ -25,12 +25,28 @@ import { locator } from '@instructure/ui-test-locator';
25
25
  import { ToggleDetails } from './index';
26
26
  const ToggleLocator = locator('[aria-expanded][aria-controls]');
27
27
  export const customMethods = {
28
- clickToggle: async (element, ...args) => (await ToggleLocator.find(element)).click(...args),
29
- findToggle: (element, ...args) => ToggleLocator.find(element, ...args),
30
- findContent: async (element, ...args) => {
28
+ clickToggle: async function (element) {
29
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
30
+ args[_key - 1] = arguments[_key];
31
+ }
32
+
33
+ return (await ToggleLocator.find(element)).click(...args);
34
+ },
35
+ findToggle: function (element) {
36
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
37
+ args[_key2 - 1] = arguments[_key2];
38
+ }
39
+
40
+ return ToggleLocator.find(element, ...args);
41
+ },
42
+ findContent: async function (element) {
31
43
  const toggle = await ToggleLocator.find(element);
32
44
 
33
45
  if (toggle) {
46
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
47
+ args[_key3 - 1] = arguments[_key3];
48
+ }
49
+
34
50
  return locator(`#${toggle.getAttribute('aria-controls')}`).find(...args);
35
51
  } else {
36
52
  return null;
@@ -43,8 +43,8 @@ category: components
43
43
  **/
44
44
 
45
45
  let ToggleDetails = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class ToggleDetails extends Component {
46
- constructor(...args) {
47
- super(...args);
46
+ constructor() {
47
+ super(...arguments);
48
48
  this.ref = null;
49
49
 
50
50
  this.getButtonRef = el => this._button = el;
@@ -162,13 +162,12 @@ let ToggleDetails = (_dec = withStyle(generateStyle, generateComponentTheme), _d
162
162
  render() {
163
163
  return jsx(Expandable, Object.assign({}, pickProps(this.props, Expandable.allowedProps), {
164
164
  onToggle: this.handleToggle
165
- }), ({
166
- expanded,
167
- getToggleProps,
168
- getDetailsProps
169
- }) => {
165
+ }), _ref => {
170
166
  var _this$props$styles8;
171
167
 
168
+ let expanded = _ref.expanded,
169
+ getToggleProps = _ref.getToggleProps,
170
+ getDetailsProps = _ref.getDetailsProps;
172
171
  return jsx("div", {
173
172
  css: (_this$props$styles8 = this.props.styles) === null || _this$props$styles8 === void 0 ? void 0 : _this$props$styles8.toggleDetails,
174
173
  ref: el => {
@@ -25,16 +25,24 @@ import { locator } from '@instructure/ui-test-locator';
25
25
  import { ToggleGroup } from './index';
26
26
  const ToggleLocator = locator('[aria-expanded][aria-controls]');
27
27
  export const customMethods = {
28
- clickToggle: async (element, ...args) => {
28
+ clickToggle: async function (element) {
29
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
30
+ args[_key - 1] = arguments[_key];
31
+ }
32
+
29
33
  return (await ToggleLocator.find(element)).click(...args);
30
34
  },
31
- findToggle: async (...args) => {
32
- return ToggleLocator.find(...args);
35
+ findToggle: async function () {
36
+ return ToggleLocator.find(...arguments);
33
37
  },
34
- findContent: async (element, ...args) => {
38
+ findContent: async function (element) {
35
39
  const toggle = await ToggleLocator.find(element);
36
40
 
37
41
  if (toggle) {
42
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
43
+ args[_key2 - 1] = arguments[_key2];
44
+ }
45
+
38
46
  return locator(`#${toggle.getAttribute('aria-controls')}`).find(...args);
39
47
  } else {
40
48
  return null;
@@ -41,8 +41,8 @@ category: components
41
41
  **/
42
42
 
43
43
  let ToggleGroup = (_dec = testable(), _dec(_class = (_temp = _class2 = class ToggleGroup extends Component {
44
- constructor(...args) {
45
- super(...args);
44
+ constructor() {
45
+ super(...arguments);
46
46
  this.ref = null;
47
47
  this._button = null;
48
48
  this._shouldTransition = false;
@@ -112,11 +112,10 @@ let ToggleGroup = (_dec = testable(), _dec(_class = (_temp = _class2 = class Tog
112
112
 
113
113
  render() {
114
114
  const Element = getElementType(ToggleGroup, this.props);
115
- return /*#__PURE__*/React.createElement(Expandable, pickProps(this.props, Expandable.allowedProps), ({
116
- expanded,
117
- getToggleProps,
118
- getDetailsProps
119
- }) => {
115
+ return /*#__PURE__*/React.createElement(Expandable, pickProps(this.props, Expandable.allowedProps), _ref => {
116
+ let expanded = _ref.expanded,
117
+ getToggleProps = _ref.getToggleProps,
118
+ getDetailsProps = _ref.getDetailsProps;
120
119
  return /*#__PURE__*/React.createElement(View, Object.assign({}, omitProps(this.props, ToggleGroup.allowedProps), {
121
120
  borderWidth: this.props.border ? 'small' : 'none',
122
121
  as: Element,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ToggleDetailsLocator = exports.customMethods = void 0;
6
+ exports.customMethods = exports.ToggleDetailsLocator = void 0;
7
7
 
8
8
  var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
9
9
 
@@ -34,12 +34,28 @@ var _index = require("./index");
34
34
  */
35
35
  const ToggleLocator = (0, _locator.locator)('[aria-expanded][aria-controls]');
36
36
  const customMethods = {
37
- clickToggle: async (element, ...args) => (await ToggleLocator.find(element)).click(...args),
38
- findToggle: (element, ...args) => ToggleLocator.find(element, ...args),
39
- findContent: async (element, ...args) => {
37
+ clickToggle: async function (element) {
38
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
39
+ args[_key - 1] = arguments[_key];
40
+ }
41
+
42
+ return (await ToggleLocator.find(element)).click(...args);
43
+ },
44
+ findToggle: function (element) {
45
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
46
+ args[_key2 - 1] = arguments[_key2];
47
+ }
48
+
49
+ return ToggleLocator.find(element, ...args);
50
+ },
51
+ findContent: async function (element) {
40
52
  const toggle = await ToggleLocator.find(element);
41
53
 
42
54
  if (toggle) {
55
+ for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
56
+ args[_key3 - 1] = arguments[_key3];
57
+ }
58
+
43
59
  return (0, _locator.locator)(`#${toggle.getAttribute('aria-controls')}`).find(...args);
44
60
  } else {
45
61
  return null;
@@ -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.ToggleDetails = exports.default = void 0;
8
+ exports.default = exports.ToggleDetails = void 0;
9
9
 
10
10
  var _react = require("react");
11
11
 
@@ -41,8 +41,8 @@ category: components
41
41
  ---
42
42
  **/
43
43
  let ToggleDetails = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class ToggleDetails extends _react.Component {
44
- constructor(...args) {
45
- super(...args);
44
+ constructor() {
45
+ super(...arguments);
46
46
  this.ref = null;
47
47
 
48
48
  this.getButtonRef = el => this._button = el;
@@ -160,13 +160,12 @@ let ToggleDetails = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defa
160
160
  render() {
161
161
  return (0, _emotion.jsx)(_Expandable.Expandable, Object.assign({}, (0, _pickProps.pickProps)(this.props, _Expandable.Expandable.allowedProps), {
162
162
  onToggle: this.handleToggle
163
- }), ({
164
- expanded,
165
- getToggleProps,
166
- getDetailsProps
167
- }) => {
163
+ }), _ref => {
168
164
  var _this$props$styles8;
169
165
 
166
+ let expanded = _ref.expanded,
167
+ getToggleProps = _ref.getToggleProps,
168
+ getDetailsProps = _ref.getDetailsProps;
170
169
  return (0, _emotion.jsx)("div", {
171
170
  css: (_this$props$styles8 = this.props.styles) === null || _this$props$styles8 === void 0 ? void 0 : _this$props$styles8.toggleDetails,
172
171
  ref: el => {
@@ -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
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ToggleGroupLocator = exports.customMethods = void 0;
6
+ exports.customMethods = exports.ToggleGroupLocator = void 0;
7
7
 
8
8
  var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
9
9
 
@@ -34,16 +34,24 @@ var _index = require("./index");
34
34
  */
35
35
  const ToggleLocator = (0, _locator.locator)('[aria-expanded][aria-controls]');
36
36
  const customMethods = {
37
- clickToggle: async (element, ...args) => {
37
+ clickToggle: async function (element) {
38
+ for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
39
+ args[_key - 1] = arguments[_key];
40
+ }
41
+
38
42
  return (await ToggleLocator.find(element)).click(...args);
39
43
  },
40
- findToggle: async (...args) => {
41
- return ToggleLocator.find(...args);
44
+ findToggle: async function () {
45
+ return ToggleLocator.find(...arguments);
42
46
  },
43
- findContent: async (element, ...args) => {
47
+ findContent: async function (element) {
44
48
  const toggle = await ToggleLocator.find(element);
45
49
 
46
50
  if (toggle) {
51
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
52
+ args[_key2 - 1] = arguments[_key2];
53
+ }
54
+
47
55
  return (0, _locator.locator)(`#${toggle.getAttribute('aria-controls')}`).find(...args);
48
56
  } else {
49
57
  return null;
@@ -5,7 +5,7 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.ToggleGroup = exports.default = void 0;
8
+ exports.default = exports.ToggleGroup = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
@@ -43,8 +43,8 @@ category: components
43
43
  ---
44
44
  **/
45
45
  let ToggleGroup = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _class2 = class ToggleGroup extends _react.Component {
46
- constructor(...args) {
47
- super(...args);
46
+ constructor() {
47
+ super(...arguments);
48
48
  this.ref = null;
49
49
  this._button = null;
50
50
  this._shouldTransition = false;
@@ -114,11 +114,10 @@ let ToggleGroup = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _cla
114
114
 
115
115
  render() {
116
116
  const Element = (0, _getElementType.getElementType)(ToggleGroup, this.props);
117
- return /*#__PURE__*/_react.default.createElement(_Expandable.Expandable, (0, _pickProps.pickProps)(this.props, _Expandable.Expandable.allowedProps), ({
118
- expanded,
119
- getToggleProps,
120
- getDetailsProps
121
- }) => {
117
+ return /*#__PURE__*/_react.default.createElement(_Expandable.Expandable, (0, _pickProps.pickProps)(this.props, _Expandable.Expandable.allowedProps), _ref => {
118
+ let expanded = _ref.expanded,
119
+ getToggleProps = _ref.getToggleProps,
120
+ getDetailsProps = _ref.getDetailsProps;
122
121
  return /*#__PURE__*/_react.default.createElement(_View.View, Object.assign({}, (0, _omitProps.omitProps)(this.props, ToggleGroup.allowedProps), {
123
122
  borderWidth: this.props.border ? 'small' : 'none',
124
123
  as: Element,
@@ -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-toggle-details",
3
- "version": "8.12.1-snapshot.7+1e7ac8219",
3
+ "version": "8.13.0",
4
4
  "description": "A styled toggleable, accordion-like component.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -24,29 +24,29 @@
24
24
  },
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@instructure/ui-babel-preset": "8.12.1-snapshot.7+1e7ac8219",
28
- "@instructure/ui-test-locator": "8.12.1-snapshot.7+1e7ac8219",
29
- "@instructure/ui-test-queries": "8.12.1-snapshot.7+1e7ac8219",
30
- "@instructure/ui-test-utils": "8.12.1-snapshot.7+1e7ac8219",
31
- "@instructure/ui-themes": "8.12.1-snapshot.7+1e7ac8219"
27
+ "@instructure/ui-babel-preset": "8.13.0",
28
+ "@instructure/ui-test-locator": "8.13.0",
29
+ "@instructure/ui-test-queries": "8.13.0",
30
+ "@instructure/ui-test-utils": "8.13.0",
31
+ "@instructure/ui-themes": "8.13.0"
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.13.10",
35
- "@instructure/emotion": "8.12.1-snapshot.7+1e7ac8219",
36
- "@instructure/shared-types": "8.12.1-snapshot.7+1e7ac8219",
37
- "@instructure/ui-buttons": "8.12.1-snapshot.7+1e7ac8219",
38
- "@instructure/ui-dom-utils": "8.12.1-snapshot.7+1e7ac8219",
39
- "@instructure/ui-expandable": "8.12.1-snapshot.7+1e7ac8219",
40
- "@instructure/ui-flex": "8.12.1-snapshot.7+1e7ac8219",
41
- "@instructure/ui-icons": "8.12.1-snapshot.7+1e7ac8219",
42
- "@instructure/ui-menu": "8.12.1-snapshot.7+1e7ac8219",
43
- "@instructure/ui-motion": "8.12.1-snapshot.7+1e7ac8219",
44
- "@instructure/ui-prop-types": "8.12.1-snapshot.7+1e7ac8219",
45
- "@instructure/ui-react-utils": "8.12.1-snapshot.7+1e7ac8219",
46
- "@instructure/ui-testable": "8.12.1-snapshot.7+1e7ac8219",
47
- "@instructure/ui-utils": "8.12.1-snapshot.7+1e7ac8219",
48
- "@instructure/ui-view": "8.12.1-snapshot.7+1e7ac8219",
49
- "@instructure/uid": "8.12.1-snapshot.7+1e7ac8219",
35
+ "@instructure/emotion": "8.13.0",
36
+ "@instructure/shared-types": "8.13.0",
37
+ "@instructure/ui-buttons": "8.13.0",
38
+ "@instructure/ui-dom-utils": "8.13.0",
39
+ "@instructure/ui-expandable": "8.13.0",
40
+ "@instructure/ui-flex": "8.13.0",
41
+ "@instructure/ui-icons": "8.13.0",
42
+ "@instructure/ui-menu": "8.13.0",
43
+ "@instructure/ui-motion": "8.13.0",
44
+ "@instructure/ui-prop-types": "8.13.0",
45
+ "@instructure/ui-react-utils": "8.13.0",
46
+ "@instructure/ui-testable": "8.13.0",
47
+ "@instructure/ui-utils": "8.13.0",
48
+ "@instructure/ui-view": "8.13.0",
49
+ "@instructure/uid": "8.13.0",
50
50
  "prop-types": "^15"
51
51
  },
52
52
  "peerDependencies": {
@@ -55,6 +55,5 @@
55
55
  "publishConfig": {
56
56
  "access": "public"
57
57
  },
58
- "sideEffects": false,
59
- "gitHead": "1e7ac821932a91fe9ef761c96f747c7ea1f3925a"
58
+ "sideEffects": false
60
59
  }
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.