@instructure/ui-buttons 8.38.2-snapshot-5 → 8.38.2-snapshot-6

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-6](https://github.com/instructure/instructure-ui/compare/v8.38.1...v8.38.2-snapshot-6) (2023-07-17)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-buttons
9
9
 
@@ -28,10 +28,7 @@ import { BaseButton } from './index';
28
28
 
29
29
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
30
30
  export const BaseButtonLocator = locator(BaseButton.selector, {
31
- click: async function (element) {
32
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
33
- args[_key - 1] = arguments[_key];
34
- }
31
+ click: async (element, ...args) => {
35
32
  return (await find(element, 'a,button,[role="button"]')).click(...args);
36
33
  }
37
34
  });
@@ -45,8 +45,8 @@ category: components/utilities
45
45
  @tsProps
46
46
  **/
47
47
  let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class BaseButton extends Component {
48
- constructor() {
49
- super(...arguments);
48
+ constructor(...args) {
49
+ super(...args);
50
50
  this.ref = null;
51
51
  this.handleElementRef = el => {
52
52
  const elementRef = this.props.elementRef;
@@ -24,29 +24,27 @@
24
24
 
25
25
  import { alpha, darken } from '@instructure/ui-color-utils';
26
26
  const activeShadow = 'inset 0 0 0.1875rem 0.0625rem';
27
- const generateButtonThemeVars = _ref => {
28
- let style = _ref.style,
29
- textColor = _ref.textColor,
30
- ghostTextColor = _ref.ghostTextColor,
31
- backgroundColor = _ref.backgroundColor,
32
- borderColor = _ref.borderColor,
33
- _ref$ghostBorderColor = _ref.ghostBorderColor,
34
- ghostBorderColor = _ref$ghostBorderColor === void 0 ? borderColor : _ref$ghostBorderColor;
35
- return {
36
- [`${style}Color`]: textColor,
37
- [`${style}BorderColor`]: darken(borderColor, 10),
38
- [`${style}Background`]: backgroundColor,
39
- [`${style}HoverBackground`]: darken(backgroundColor, 10),
40
- [`${style}ActiveBackground`]: darken(backgroundColor, 10),
41
- [`${style}ActiveBoxShadow`]: `${activeShadow} ${darken(borderColor, 20)}`,
42
- [`${style}GhostColor`]: ghostTextColor,
43
- [`${style}GhostBorderColor`]: ghostBorderColor,
44
- [`${style}GhostBackground`]: 'transparent',
45
- [`${style}GhostHoverBackground`]: alpha(ghostTextColor, 10),
46
- [`${style}GhostActiveBackground`]: 'transparent',
47
- [`${style}GhostActiveBoxShadow`]: `${activeShadow} ${alpha(ghostBorderColor, 28)}`
48
- };
49
- };
27
+ const generateButtonThemeVars = ({
28
+ style,
29
+ textColor,
30
+ ghostTextColor,
31
+ backgroundColor,
32
+ borderColor,
33
+ ghostBorderColor = borderColor
34
+ }) => ({
35
+ [`${style}Color`]: textColor,
36
+ [`${style}BorderColor`]: darken(borderColor, 10),
37
+ [`${style}Background`]: backgroundColor,
38
+ [`${style}HoverBackground`]: darken(backgroundColor, 10),
39
+ [`${style}ActiveBackground`]: darken(backgroundColor, 10),
40
+ [`${style}ActiveBoxShadow`]: `${activeShadow} ${darken(borderColor, 20)}`,
41
+ [`${style}GhostColor`]: ghostTextColor,
42
+ [`${style}GhostBorderColor`]: ghostBorderColor,
43
+ [`${style}GhostBackground`]: 'transparent',
44
+ [`${style}GhostHoverBackground`]: alpha(ghostTextColor, 10),
45
+ [`${style}GhostActiveBackground`]: 'transparent',
46
+ [`${style}GhostActiveBoxShadow`]: `${activeShadow} ${alpha(ghostBorderColor, 28)}`
47
+ });
50
48
 
51
49
  /**
52
50
  * Generates the theme object for the component from the theme and provided additional information
@@ -27,10 +27,7 @@ import { Button } from './index';
27
27
 
28
28
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
29
29
  export const ButtonLocator = locator(Button.selector, {
30
- click: async function (element) {
31
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
32
- args[_key - 1] = arguments[_key];
33
- }
30
+ click: async (element, ...args) => {
34
31
  return (await find(element, 'a,button,[role="button"]')).click(...args);
35
32
  }
36
33
  });
@@ -40,8 +40,8 @@ category: components
40
40
  **/
41
41
  // needed for listing the available theme variables on docs page
42
42
  let Button = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class Button extends Component {
43
- constructor() {
44
- super(...arguments);
43
+ constructor(...args) {
44
+ super(...args);
45
45
  this._buttonComponent = null;
46
46
  this.ref = null;
47
47
  this.handleElementRef = el => {
@@ -43,8 +43,8 @@ category: components
43
43
  @tsProps
44
44
  **/
45
45
  let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class CloseButton extends Component {
46
- constructor() {
47
- super(...arguments);
46
+ constructor(...args) {
47
+ super(...args);
48
48
  this.ref = null;
49
49
  this.handleRef = el => {
50
50
  const elementRef = this.props.elementRef;
@@ -27,10 +27,7 @@ import { CondensedButton } from './index';
27
27
 
28
28
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
29
29
  export const CondensedButtonLocator = locator(CondensedButton.selector, {
30
- click: async function (element) {
31
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
32
- args[_key - 1] = arguments[_key];
33
- }
30
+ click: async (element, ...args) => {
34
31
  return (await find(element, 'a,button,[role="button"]')).click(...args);
35
32
  }
36
33
  });
@@ -40,8 +40,8 @@ category: components
40
40
  **/
41
41
  // needed for listing the available theme variables on docs page
42
42
  let CondensedButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class CondensedButton extends Component {
43
- constructor() {
44
- super(...arguments);
43
+ constructor(...args) {
44
+ super(...args);
45
45
  this._baseButton = null;
46
46
  this.ref = null;
47
47
  this.handleRef = el => {
@@ -27,10 +27,7 @@ import { IconButton } from './index';
27
27
 
28
28
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
29
29
  export const IconButtonLocator = locator(IconButton.selector, {
30
- click: async function (element) {
31
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
32
- args[_key - 1] = arguments[_key];
33
- }
30
+ click: async (element, ...args) => {
34
31
  return (await find(element, 'a,button,[role="button"]')).click(...args);
35
32
  }
36
33
  });
@@ -41,8 +41,8 @@ category: components
41
41
  **/
42
42
  // needed for listing the available theme variables on docs page
43
43
  let IconButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class IconButton extends Component {
44
- constructor() {
45
- super(...arguments);
44
+ constructor(...args) {
45
+ super(...args);
46
46
  this._baseButton = null;
47
47
  this.ref = null;
48
48
  this.handleRef = el => {
@@ -32,18 +32,15 @@ import { ToggleButton } from './index';
32
32
 
33
33
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
34
34
  export const ToggleButtonLocator = locator(ToggleButton.selector, {
35
- findTooltipContent: async function () {
36
- const _parseQueryArguments = parseQueryArguments(...arguments),
35
+ findTooltipContent: async (...args) => {
36
+ const _parseQueryArguments = parseQueryArguments(...args),
37
37
  element = _parseQueryArguments.element,
38
38
  selector = _parseQueryArguments.selector,
39
39
  options = _parseQueryArguments.options;
40
40
  const tooltip = await TooltipLocator.find(element, options);
41
41
  return tooltip ? tooltip.findContent(selector, options) : null;
42
42
  },
43
- click: async function (element) {
44
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
45
- args[_key - 1] = arguments[_key];
46
- }
43
+ click: async (element, ...args) => {
47
44
  return (await find(element, 'a,button,[role="button"]')).click(...args);
48
45
  }
49
46
  });
@@ -33,10 +33,7 @@ var _index = require("./index");
33
33
 
34
34
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
35
35
  const BaseButtonLocator = (0, _locator.locator)(_index.BaseButton.selector, {
36
- click: async function (element) {
37
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
38
- args[_key - 1] = arguments[_key];
39
- }
36
+ click: async (element, ...args) => {
40
37
  return (await (0, _uiTestQueries.find)(element, 'a,button,[role="button"]')).click(...args);
41
38
  }
42
39
  });
@@ -55,8 +55,8 @@ category: components/utilities
55
55
  @tsProps
56
56
  **/
57
57
  let BaseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class BaseButton extends _react.Component {
58
- constructor() {
59
- super(...arguments);
58
+ constructor(...args) {
59
+ super(...args);
60
60
  this.ref = null;
61
61
  this.handleElementRef = el => {
62
62
  const elementRef = this.props.elementRef;
@@ -31,29 +31,27 @@ var _darken = require("@instructure/ui-color-utils/lib/darken.js");
31
31
  */
32
32
 
33
33
  const activeShadow = 'inset 0 0 0.1875rem 0.0625rem';
34
- const generateButtonThemeVars = _ref => {
35
- let style = _ref.style,
36
- textColor = _ref.textColor,
37
- ghostTextColor = _ref.ghostTextColor,
38
- backgroundColor = _ref.backgroundColor,
39
- borderColor = _ref.borderColor,
40
- _ref$ghostBorderColor = _ref.ghostBorderColor,
41
- ghostBorderColor = _ref$ghostBorderColor === void 0 ? borderColor : _ref$ghostBorderColor;
42
- return {
43
- [`${style}Color`]: textColor,
44
- [`${style}BorderColor`]: (0, _darken.darken)(borderColor, 10),
45
- [`${style}Background`]: backgroundColor,
46
- [`${style}HoverBackground`]: (0, _darken.darken)(backgroundColor, 10),
47
- [`${style}ActiveBackground`]: (0, _darken.darken)(backgroundColor, 10),
48
- [`${style}ActiveBoxShadow`]: `${activeShadow} ${(0, _darken.darken)(borderColor, 20)}`,
49
- [`${style}GhostColor`]: ghostTextColor,
50
- [`${style}GhostBorderColor`]: ghostBorderColor,
51
- [`${style}GhostBackground`]: 'transparent',
52
- [`${style}GhostHoverBackground`]: (0, _alpha.alpha)(ghostTextColor, 10),
53
- [`${style}GhostActiveBackground`]: 'transparent',
54
- [`${style}GhostActiveBoxShadow`]: `${activeShadow} ${(0, _alpha.alpha)(ghostBorderColor, 28)}`
55
- };
56
- };
34
+ const generateButtonThemeVars = ({
35
+ style,
36
+ textColor,
37
+ ghostTextColor,
38
+ backgroundColor,
39
+ borderColor,
40
+ ghostBorderColor = borderColor
41
+ }) => ({
42
+ [`${style}Color`]: textColor,
43
+ [`${style}BorderColor`]: (0, _darken.darken)(borderColor, 10),
44
+ [`${style}Background`]: backgroundColor,
45
+ [`${style}HoverBackground`]: (0, _darken.darken)(backgroundColor, 10),
46
+ [`${style}ActiveBackground`]: (0, _darken.darken)(backgroundColor, 10),
47
+ [`${style}ActiveBoxShadow`]: `${activeShadow} ${(0, _darken.darken)(borderColor, 20)}`,
48
+ [`${style}GhostColor`]: ghostTextColor,
49
+ [`${style}GhostBorderColor`]: ghostBorderColor,
50
+ [`${style}GhostBackground`]: 'transparent',
51
+ [`${style}GhostHoverBackground`]: (0, _alpha.alpha)(ghostTextColor, 10),
52
+ [`${style}GhostActiveBackground`]: 'transparent',
53
+ [`${style}GhostActiveBoxShadow`]: `${activeShadow} ${(0, _alpha.alpha)(ghostBorderColor, 28)}`
54
+ });
57
55
 
58
56
  /**
59
57
  * Generates the theme object for the component from the theme and provided additional information
@@ -33,10 +33,7 @@ var _index = require("./index");
33
33
 
34
34
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
35
35
  const ButtonLocator = (0, _locator.locator)(_index.Button.selector, {
36
- click: async function (element) {
37
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
38
- args[_key - 1] = arguments[_key];
39
- }
36
+ click: async (element, ...args) => {
40
37
  return (await (0, _uiTestQueries.find)(element, 'a,button,[role="button"]')).click(...args);
41
38
  }
42
39
  });
@@ -48,8 +48,8 @@ category: components
48
48
  **/
49
49
  // needed for listing the available theme variables on docs page
50
50
  let Button = (_dec = (0, _emotion.withStyle)(null, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class Button extends _react.Component {
51
- constructor() {
52
- super(...arguments);
51
+ constructor(...args) {
52
+ super(...args);
53
53
  this._buttonComponent = null;
54
54
  this.ref = null;
55
55
  this.handleElementRef = el => {
@@ -50,8 +50,8 @@ category: components
50
50
  @tsProps
51
51
  **/
52
52
  let CloseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class CloseButton extends _react.Component {
53
- constructor() {
54
- super(...arguments);
53
+ constructor(...args) {
54
+ super(...args);
55
55
  this.ref = null;
56
56
  this.handleRef = el => {
57
57
  const elementRef = this.props.elementRef;
@@ -33,10 +33,7 @@ var _index = require("./index");
33
33
 
34
34
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
35
35
  const CondensedButtonLocator = (0, _locator.locator)(_index.CondensedButton.selector, {
36
- click: async function (element) {
37
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
38
- args[_key - 1] = arguments[_key];
39
- }
36
+ click: async (element, ...args) => {
40
37
  return (await (0, _uiTestQueries.find)(element, 'a,button,[role="button"]')).click(...args);
41
38
  }
42
39
  });
@@ -47,8 +47,8 @@ category: components
47
47
  **/
48
48
  // needed for listing the available theme variables on docs page
49
49
  let CondensedButton = (_dec = (0, _emotion.withStyle)(null, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class CondensedButton extends _react.Component {
50
- constructor() {
51
- super(...arguments);
50
+ constructor(...args) {
51
+ super(...args);
52
52
  this._baseButton = null;
53
53
  this.ref = null;
54
54
  this.handleRef = el => {
@@ -33,10 +33,7 @@ var _index = require("./index");
33
33
 
34
34
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
35
35
  const IconButtonLocator = (0, _locator.locator)(_index.IconButton.selector, {
36
- click: async function (element) {
37
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
38
- args[_key - 1] = arguments[_key];
39
- }
36
+ click: async (element, ...args) => {
40
37
  return (await (0, _uiTestQueries.find)(element, 'a,button,[role="button"]')).click(...args);
41
38
  }
42
39
  });
@@ -48,8 +48,8 @@ category: components
48
48
  **/
49
49
  // needed for listing the available theme variables on docs page
50
50
  let IconButton = (_dec = (0, _emotion.withStyle)(null, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class IconButton extends _react.Component {
51
- constructor() {
52
- super(...arguments);
51
+ constructor(...args) {
52
+ super(...args);
53
53
  this._baseButton = null;
54
54
  this.ref = null;
55
55
  this.handleRef = el => {
@@ -37,18 +37,15 @@ var _index = require("./index");
37
37
 
38
38
  // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
39
39
  const ToggleButtonLocator = (0, _locator.locator)(_index.ToggleButton.selector, {
40
- findTooltipContent: async function () {
41
- const _parseQueryArguments = (0, _uiTestQueries.parseQueryArguments)(...arguments),
40
+ findTooltipContent: async (...args) => {
41
+ const _parseQueryArguments = (0, _uiTestQueries.parseQueryArguments)(...args),
42
42
  element = _parseQueryArguments.element,
43
43
  selector = _parseQueryArguments.selector,
44
44
  options = _parseQueryArguments.options;
45
45
  const tooltip = await _TooltipLocator.TooltipLocator.find(element, options);
46
46
  return tooltip ? tooltip.findContent(selector, options) : null;
47
47
  },
48
- click: async function (element) {
49
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
50
- args[_key - 1] = arguments[_key];
51
- }
48
+ click: async (element, ...args) => {
52
49
  return (await (0, _uiTestQueries.find)(element, 'a,button,[role="button"]')).click(...args);
53
50
  }
54
51
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-buttons",
3
- "version": "8.38.2-snapshot-5",
3
+ "version": "8.38.2-snapshot-6",
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.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-6",
27
+ "@instructure/ui-test-locator": "8.38.2-snapshot-6",
28
+ "@instructure/ui-test-queries": "8.38.2-snapshot-6",
29
+ "@instructure/ui-test-utils": "8.38.2-snapshot-6",
30
+ "@instructure/ui-themes": "8.38.2-snapshot-6"
31
31
  },
32
32
  "dependencies": {
33
- "@babel/runtime": "^7.22.5",
34
- "@instructure/console": "8.38.2-snapshot-5",
35
- "@instructure/emotion": "8.38.2-snapshot-5",
36
- "@instructure/shared-types": "8.38.2-snapshot-5",
37
- "@instructure/ui-a11y-content": "8.38.2-snapshot-5",
38
- "@instructure/ui-a11y-utils": "8.38.2-snapshot-5",
39
- "@instructure/ui-color-utils": "8.38.2-snapshot-5",
40
- "@instructure/ui-dom-utils": "8.38.2-snapshot-5",
41
- "@instructure/ui-icons": "8.38.2-snapshot-5",
42
- "@instructure/ui-position": "8.38.2-snapshot-5",
43
- "@instructure/ui-react-utils": "8.38.2-snapshot-5",
44
- "@instructure/ui-testable": "8.38.2-snapshot-5",
45
- "@instructure/ui-tooltip": "8.38.2-snapshot-5",
46
- "@instructure/ui-utils": "8.38.2-snapshot-5",
47
- "@instructure/ui-view": "8.38.2-snapshot-5",
33
+ "@babel/runtime": "^7.22.6",
34
+ "@instructure/console": "8.38.2-snapshot-6",
35
+ "@instructure/emotion": "8.38.2-snapshot-6",
36
+ "@instructure/shared-types": "8.38.2-snapshot-6",
37
+ "@instructure/ui-a11y-content": "8.38.2-snapshot-6",
38
+ "@instructure/ui-a11y-utils": "8.38.2-snapshot-6",
39
+ "@instructure/ui-color-utils": "8.38.2-snapshot-6",
40
+ "@instructure/ui-dom-utils": "8.38.2-snapshot-6",
41
+ "@instructure/ui-icons": "8.38.2-snapshot-6",
42
+ "@instructure/ui-position": "8.38.2-snapshot-6",
43
+ "@instructure/ui-react-utils": "8.38.2-snapshot-6",
44
+ "@instructure/ui-testable": "8.38.2-snapshot-6",
45
+ "@instructure/ui-tooltip": "8.38.2-snapshot-6",
46
+ "@instructure/ui-utils": "8.38.2-snapshot-6",
47
+ "@instructure/ui-view": "8.38.2-snapshot-6",
48
48
  "keycode": "^2.2.1",
49
49
  "prop-types": "^15.8.1"
50
50
  },