@instructure/ui-toggle-details 8.38.2-snapshot-5 → 8.38.2-snapshot-7

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,7 +3,7 @@
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.38.2-snapshot-5](https://github.com/instructure/instructure-ui/compare/v8.38.1...v8.38.2-snapshot-5) (2023-07-14)
6
+ ## [8.38.2-snapshot-7](https://github.com/instructure/instructure-ui/compare/v8.38.1...v8.38.2-snapshot-7) (2023-07-21)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-toggle-details
9
9
 
@@ -25,24 +25,11 @@ 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 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
- return (await ToggleLocator.find(element)).click(...args);
33
- },
34
- findToggle: function (element) {
35
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
36
- args[_key2 - 1] = arguments[_key2];
37
- }
38
- return ToggleLocator.find(element, ...args);
39
- },
40
- findContent: async function (element) {
28
+ clickToggle: async (element, ...args) => (await ToggleLocator.find(element)).click(...args),
29
+ findToggle: (element, ...args) => ToggleLocator.find(element, ...args),
30
+ findContent: async (element, ...args) => {
41
31
  const toggle = await ToggleLocator.find(element);
42
32
  if (toggle) {
43
- for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
44
- args[_key3 - 1] = arguments[_key3];
45
- }
46
33
  return locator(`#${toggle.getAttribute('aria-controls')}`).find(...args);
47
34
  } else {
48
35
  return null;
@@ -41,8 +41,8 @@ category: components
41
41
  @tsProps
42
42
  **/
43
43
  let ToggleDetails = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class ToggleDetails extends Component {
44
- constructor() {
45
- super(...arguments);
44
+ constructor(...args) {
45
+ super(...args);
46
46
  this.ref = null;
47
47
  this._button = null;
48
48
  this.getButtonRef = el => this._button = el;
@@ -145,11 +145,12 @@ let ToggleDetails = (_dec = withStyle(generateStyle, generateComponentTheme), _d
145
145
  render() {
146
146
  return jsx(Expandable, Object.assign({}, pickProps(this.props, Expandable.allowedProps), {
147
147
  onToggle: this.handleToggle
148
- }), _ref => {
148
+ }), ({
149
+ expanded,
150
+ getToggleProps,
151
+ getDetailsProps
152
+ }) => {
149
153
  var _this$props$styles8;
150
- let expanded = _ref.expanded,
151
- getToggleProps = _ref.getToggleProps,
152
- getDetailsProps = _ref.getDetailsProps;
153
154
  return jsx("div", {
154
155
  css: (_this$props$styles8 = this.props.styles) === null || _this$props$styles8 === void 0 ? void 0 : _this$props$styles8.toggleDetails,
155
156
  ref: el => {
@@ -25,21 +25,15 @@ 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 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
- }
28
+ clickToggle: async (element, ...args) => {
32
29
  return (await ToggleLocator.find(element)).click(...args);
33
30
  },
34
- findToggle: async function () {
35
- return ToggleLocator.find(...arguments);
31
+ findToggle: async (...args) => {
32
+ return ToggleLocator.find(...args);
36
33
  },
37
- findContent: async function (element) {
34
+ findContent: async (element, ...args) => {
38
35
  const toggle = await ToggleLocator.find(element);
39
36
  if (toggle) {
40
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
41
- args[_key2 - 1] = arguments[_key2];
42
- }
43
37
  return locator(`#${toggle.getAttribute('aria-controls')}`).find(...args);
44
38
  } else {
45
39
  return null;
@@ -42,8 +42,8 @@ category: components
42
42
  @tsProps
43
43
  **/
44
44
  let ToggleGroup = (_dec = testable(), _dec(_class = (_class2 = class ToggleGroup extends Component {
45
- constructor() {
46
- super(...arguments);
45
+ constructor(...args) {
46
+ super(...args);
47
47
  this.ref = null;
48
48
  this._button = null;
49
49
  this._shouldTransition = false;
@@ -105,10 +105,11 @@ let ToggleGroup = (_dec = testable(), _dec(_class = (_class2 = class ToggleGroup
105
105
  }
106
106
  render() {
107
107
  const Element = getElementType(ToggleGroup, this.props);
108
- return /*#__PURE__*/React.createElement(Expandable, pickProps(this.props, Expandable.allowedProps), _ref => {
109
- let expanded = _ref.expanded,
110
- getToggleProps = _ref.getToggleProps,
111
- getDetailsProps = _ref.getDetailsProps;
108
+ return /*#__PURE__*/React.createElement(Expandable, pickProps(this.props, Expandable.allowedProps), ({
109
+ expanded,
110
+ getToggleProps,
111
+ getDetailsProps
112
+ }) => {
112
113
  return /*#__PURE__*/React.createElement(View, Object.assign({}, omitProps(this.props, ToggleGroup.allowedProps), {
113
114
  borderWidth: this.props.border ? 'small' : 'none',
114
115
  as: Element,
@@ -32,24 +32,11 @@ var _index = require("./index");
32
32
 
33
33
  const ToggleLocator = (0, _locator.locator)('[aria-expanded][aria-controls]');
34
34
  const customMethods = {
35
- clickToggle: async function (element) {
36
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
37
- args[_key - 1] = arguments[_key];
38
- }
39
- return (await ToggleLocator.find(element)).click(...args);
40
- },
41
- findToggle: function (element) {
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
- return ToggleLocator.find(element, ...args);
46
- },
47
- findContent: async function (element) {
35
+ clickToggle: async (element, ...args) => (await ToggleLocator.find(element)).click(...args),
36
+ findToggle: (element, ...args) => ToggleLocator.find(element, ...args),
37
+ findContent: async (element, ...args) => {
48
38
  const toggle = await ToggleLocator.find(element);
49
39
  if (toggle) {
50
- for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
51
- args[_key3 - 1] = arguments[_key3];
52
- }
53
40
  return (0, _locator.locator)(`#${toggle.getAttribute('aria-controls')}`).find(...args);
54
41
  } else {
55
42
  return null;
@@ -51,8 +51,8 @@ category: components
51
51
  @tsProps
52
52
  **/
53
53
  let ToggleDetails = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class ToggleDetails extends _react.Component {
54
- constructor() {
55
- super(...arguments);
54
+ constructor(...args) {
55
+ super(...args);
56
56
  this.ref = null;
57
57
  this._button = null;
58
58
  this.getButtonRef = el => this._button = el;
@@ -155,11 +155,12 @@ let ToggleDetails = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defa
155
155
  render() {
156
156
  return (0, _emotion.jsx)(_Expandable.Expandable, Object.assign({}, (0, _pickProps.pickProps)(this.props, _Expandable.Expandable.allowedProps), {
157
157
  onToggle: this.handleToggle
158
- }), _ref => {
158
+ }), ({
159
+ expanded,
160
+ getToggleProps,
161
+ getDetailsProps
162
+ }) => {
159
163
  var _this$props$styles8;
160
- let expanded = _ref.expanded,
161
- getToggleProps = _ref.getToggleProps,
162
- getDetailsProps = _ref.getDetailsProps;
163
164
  return (0, _emotion.jsx)("div", {
164
165
  css: (_this$props$styles8 = this.props.styles) === null || _this$props$styles8 === void 0 ? void 0 : _this$props$styles8.toggleDetails,
165
166
  ref: el => {
@@ -32,21 +32,15 @@ var _index = require("./index");
32
32
 
33
33
  const ToggleLocator = (0, _locator.locator)('[aria-expanded][aria-controls]');
34
34
  const customMethods = {
35
- clickToggle: async function (element) {
36
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
37
- args[_key - 1] = arguments[_key];
38
- }
35
+ clickToggle: async (element, ...args) => {
39
36
  return (await ToggleLocator.find(element)).click(...args);
40
37
  },
41
- findToggle: async function () {
42
- return ToggleLocator.find(...arguments);
38
+ findToggle: async (...args) => {
39
+ return ToggleLocator.find(...args);
43
40
  },
44
- findContent: async function (element) {
41
+ findContent: async (element, ...args) => {
45
42
  const toggle = await ToggleLocator.find(element);
46
43
  if (toggle) {
47
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
48
- args[_key2 - 1] = arguments[_key2];
49
- }
50
44
  return (0, _locator.locator)(`#${toggle.getAttribute('aria-controls')}`).find(...args);
51
45
  } else {
52
46
  return null;
@@ -51,8 +51,8 @@ category: components
51
51
  @tsProps
52
52
  **/
53
53
  let ToggleGroup = (_dec = (0, _testable.testable)(), _dec(_class = (_class2 = class ToggleGroup extends _react.Component {
54
- constructor() {
55
- super(...arguments);
54
+ constructor(...args) {
55
+ super(...args);
56
56
  this.ref = null;
57
57
  this._button = null;
58
58
  this._shouldTransition = false;
@@ -114,10 +114,11 @@ let ToggleGroup = (_dec = (0, _testable.testable)(), _dec(_class = (_class2 = cl
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), _ref => {
118
- let expanded = _ref.expanded,
119
- getToggleProps = _ref.getToggleProps,
120
- getDetailsProps = _ref.getDetailsProps;
117
+ return /*#__PURE__*/_react.default.createElement(_Expandable.Expandable, (0, _pickProps.pickProps)(this.props, _Expandable.Expandable.allowedProps), ({
118
+ expanded,
119
+ getToggleProps,
120
+ getDetailsProps
121
+ }) => {
121
122
  return /*#__PURE__*/_react.default.createElement(_View.View, Object.assign({}, (0, _omitProps.omitProps)(this.props, ToggleGroup.allowedProps), {
122
123
  borderWidth: this.props.border ? 'small' : 'none',
123
124
  as: Element,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-toggle-details",
3
- "version": "8.38.2-snapshot-5",
3
+ "version": "8.38.2-snapshot-7",
4
4
  "description": "A styled toggleable, accordion-like component.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,29 +23,29 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "8.38.2-snapshot-5",
27
- "@instructure/ui-test-locator": "8.38.2-snapshot-5",
28
- "@instructure/ui-test-queries": "8.38.2-snapshot-5",
29
- "@instructure/ui-test-utils": "8.38.2-snapshot-5",
30
- "@instructure/ui-themes": "8.38.2-snapshot-5"
26
+ "@instructure/ui-babel-preset": "8.38.2-snapshot-7",
27
+ "@instructure/ui-test-locator": "8.38.2-snapshot-7",
28
+ "@instructure/ui-test-queries": "8.38.2-snapshot-7",
29
+ "@instructure/ui-test-utils": "8.38.2-snapshot-7",
30
+ "@instructure/ui-themes": "8.38.2-snapshot-7"
31
31
  },
32
32
  "dependencies": {
33
- "@babel/runtime": "^7.22.5",
34
- "@instructure/emotion": "8.38.2-snapshot-5",
35
- "@instructure/shared-types": "8.38.2-snapshot-5",
36
- "@instructure/ui-buttons": "8.38.2-snapshot-5",
37
- "@instructure/ui-dom-utils": "8.38.2-snapshot-5",
38
- "@instructure/ui-expandable": "8.38.2-snapshot-5",
39
- "@instructure/ui-flex": "8.38.2-snapshot-5",
40
- "@instructure/ui-icons": "8.38.2-snapshot-5",
41
- "@instructure/ui-menu": "8.38.2-snapshot-5",
42
- "@instructure/ui-motion": "8.38.2-snapshot-5",
43
- "@instructure/ui-prop-types": "8.38.2-snapshot-5",
44
- "@instructure/ui-react-utils": "8.38.2-snapshot-5",
45
- "@instructure/ui-testable": "8.38.2-snapshot-5",
46
- "@instructure/ui-utils": "8.38.2-snapshot-5",
47
- "@instructure/ui-view": "8.38.2-snapshot-5",
48
- "@instructure/uid": "8.38.2-snapshot-5",
33
+ "@babel/runtime": "^7.22.6",
34
+ "@instructure/emotion": "8.38.2-snapshot-7",
35
+ "@instructure/shared-types": "8.38.2-snapshot-7",
36
+ "@instructure/ui-buttons": "8.38.2-snapshot-7",
37
+ "@instructure/ui-dom-utils": "8.38.2-snapshot-7",
38
+ "@instructure/ui-expandable": "8.38.2-snapshot-7",
39
+ "@instructure/ui-flex": "8.38.2-snapshot-7",
40
+ "@instructure/ui-icons": "8.38.2-snapshot-7",
41
+ "@instructure/ui-menu": "8.38.2-snapshot-7",
42
+ "@instructure/ui-motion": "8.38.2-snapshot-7",
43
+ "@instructure/ui-prop-types": "8.38.2-snapshot-7",
44
+ "@instructure/ui-react-utils": "8.38.2-snapshot-7",
45
+ "@instructure/ui-testable": "8.38.2-snapshot-7",
46
+ "@instructure/ui-utils": "8.38.2-snapshot-7",
47
+ "@instructure/ui-view": "8.38.2-snapshot-7",
48
+ "@instructure/uid": "8.38.2-snapshot-7",
49
49
  "prop-types": "^15.8.1"
50
50
  },
51
51
  "peerDependencies": {