@instructure/ui-buttons 10.26.1 → 11.0.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.
Files changed (64) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/es/BaseButton/index.js +9 -6
  3. package/es/BaseButton/props.js +1 -26
  4. package/es/Button/index.js +6 -6
  5. package/es/Button/props.js +1 -20
  6. package/es/CloseButton/index.js +12 -8
  7. package/es/CloseButton/props.js +1 -18
  8. package/es/CondensedButton/index.js +6 -6
  9. package/es/CondensedButton/props.js +1 -17
  10. package/es/IconButton/index.js +7 -6
  11. package/es/IconButton/props.js +1 -21
  12. package/es/ToggleButton/index.js +10 -6
  13. package/es/ToggleButton/props.js +1 -19
  14. package/lib/BaseButton/index.js +8 -5
  15. package/lib/BaseButton/props.js +1 -27
  16. package/lib/Button/index.js +5 -5
  17. package/lib/Button/props.js +1 -21
  18. package/lib/CloseButton/index.js +11 -7
  19. package/lib/CloseButton/props.js +1 -19
  20. package/lib/CondensedButton/index.js +5 -5
  21. package/lib/CondensedButton/props.js +1 -18
  22. package/lib/IconButton/index.js +6 -5
  23. package/lib/IconButton/props.js +1 -22
  24. package/lib/ToggleButton/index.js +10 -5
  25. package/lib/ToggleButton/props.js +1 -20
  26. package/package.json +20 -23
  27. package/src/BaseButton/index.tsx +7 -4
  28. package/src/BaseButton/props.ts +3 -40
  29. package/src/Button/index.tsx +6 -5
  30. package/src/Button/props.ts +2 -33
  31. package/src/CloseButton/index.tsx +6 -6
  32. package/src/CloseButton/props.ts +3 -25
  33. package/src/CondensedButton/index.tsx +2 -4
  34. package/src/CondensedButton/props.ts +3 -22
  35. package/src/IconButton/index.tsx +3 -4
  36. package/src/IconButton/props.ts +2 -33
  37. package/src/ToggleButton/index.tsx +2 -5
  38. package/src/ToggleButton/props.ts +2 -31
  39. package/tsconfig.build.json +0 -2
  40. package/tsconfig.build.tsbuildinfo +1 -1
  41. package/types/BaseButton/index.d.ts +1 -2
  42. package/types/BaseButton/index.d.ts.map +1 -1
  43. package/types/BaseButton/props.d.ts +3 -4
  44. package/types/BaseButton/props.d.ts.map +1 -1
  45. package/types/Button/index.d.ts +1 -19
  46. package/types/Button/index.d.ts.map +1 -1
  47. package/types/Button/props.d.ts +3 -4
  48. package/types/Button/props.d.ts.map +1 -1
  49. package/types/CloseButton/index.d.ts +1 -17
  50. package/types/CloseButton/index.d.ts.map +1 -1
  51. package/types/CloseButton/props.d.ts +3 -4
  52. package/types/CloseButton/props.d.ts.map +1 -1
  53. package/types/CondensedButton/index.d.ts +1 -16
  54. package/types/CondensedButton/index.d.ts.map +1 -1
  55. package/types/CondensedButton/props.d.ts +3 -4
  56. package/types/CondensedButton/props.d.ts.map +1 -1
  57. package/types/IconButton/index.d.ts +1 -20
  58. package/types/IconButton/index.d.ts.map +1 -1
  59. package/types/IconButton/props.d.ts +3 -4
  60. package/types/IconButton/props.d.ts.map +1 -1
  61. package/types/ToggleButton/index.d.ts +0 -16
  62. package/types/ToggleButton/index.d.ts.map +1 -1
  63. package/types/ToggleButton/props.d.ts +2 -3
  64. package/types/ToggleButton/props.d.ts.map +1 -1
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
- ## [10.26.1](https://github.com/instructure/instructure-ui/compare/v10.26.0...v10.26.1) (2025-10-06)
6
+ # [11.0.0](https://github.com/instructure/instructure-ui/compare/v10.26.0...v11.0.0) (2025-10-06)
7
7
 
8
8
 
9
9
  ### Bug Fixes
@@ -11,6 +11,29 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
  * **ui-buttons:** fix focus ring distortion on circle shape buttons ([04e93c8](https://github.com/instructure/instructure-ui/commit/04e93c82d4c58b1d8b783933dfdeeb183f2c1335))
12
12
 
13
13
 
14
+ ### Features
15
+
16
+ * **many:** instUI v11 release ([36f5438](https://github.com/instructure/instructure-ui/commit/36f54382669186227ba24798bbf7201ef2f5cd4c))
17
+
18
+
19
+ ### BREAKING CHANGES
20
+
21
+ * **many:** InstUI v11 contains the following breaking changes:
22
+ - React 16 and 17 are no longer supported
23
+ - remove `PropTypes` from all packages
24
+ - remove `CodeEditor` component
25
+ - remove `@instui/theme-registry` package
26
+ - remove `@testable`, `@experimental`, `@hack` decorators
27
+ - InstUISettingsProvider's `as` prop is removed
28
+ - `canvas.use()`, `canvasHighContrast.use()` functions are removed
29
+ - `canvasThemeLocal`, `canvasHighContrastThemeLocal` are removed
30
+ - `variables` field on theme objects are removed
31
+ - remove deprecated props from Table: Row's `isStacked`, Body's
32
+ `isStacked`, `hover`, and `headers`
33
+ - `Table`'s `caption` prop is now required
34
+ - `ui-dom-utils`'s `getComputedStyle` can now return `undefined`
35
+
36
+
14
37
 
15
38
 
16
39
 
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  const _excluded = ["type", "size", "elementRef", "as", "href", "color", "focusColor", "textAlign", "shape", "display", "withBackground", "withBorder", "isCondensed", "margin", "cursor", "onClick", "renderIcon", "tabIndex", "styles", "makeStyles", "withFocusOutline"];
3
- var _dec, _dec2, _class, _BaseButton;
3
+ var _dec, _class, _BaseButton;
4
4
  /*
5
5
  * The MIT License (MIT)
6
6
  *
@@ -27,23 +27,25 @@ var _dec, _dec2, _class, _BaseButton;
27
27
 
28
28
  import { Component } from 'react';
29
29
  import keycode from 'keycode';
30
- import { testable } from '@instructure/ui-testable';
31
30
  import { getElementType, getInteraction, passthroughProps, callRenderProp } from '@instructure/ui-react-utils';
32
31
  import { isActiveElement } from '@instructure/ui-dom-utils';
33
32
  import { hasVisibleChildren } from '@instructure/ui-a11y-utils';
34
33
  import { View } from '@instructure/ui-view';
34
+ // TODO these have to be imported in separate lines because otherwise `isSafari` will be missing from the babel build
35
+ // this bug is very likely caused by `babel-plugin-transform-imports` and can be reverted once it is removed from the codebase
35
36
  import { isSafari } from '@instructure/ui-utils';
37
+ import { combineDataCid } from '@instructure/ui-utils';
36
38
  import { withStyle } from '@instructure/emotion';
37
39
  import generateStyles from './styles';
38
40
  import generateComponentTheme from './theme';
39
- import { propTypes, allowedProps } from './props';
41
+ import { allowedProps } from './props';
40
42
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
41
43
  /**
42
44
  ---
43
45
  category: components/utilities
44
46
  ---
45
47
  **/
46
- let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_BaseButton = class BaseButton extends Component {
48
+ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec(_class = (_BaseButton = class BaseButton extends Component {
47
49
  constructor(...args) {
48
50
  super(...args);
49
51
  this.ref = null;
@@ -254,13 +256,14 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
254
256
  disabled: isDisabled || isReadOnly,
255
257
  css: styles === null || styles === void 0 ? void 0 : styles.baseButton,
256
258
  withFocusOutline: withFocusOutline,
259
+ "data-cid": combineDataCid('BaseButton', this.props),
257
260
  children: _jsx("span", {
258
261
  css: styles === null || styles === void 0 ? void 0 : styles.content,
259
262
  children: this.renderChildren()
260
263
  })
261
264
  });
262
265
  }
263
- }, _BaseButton.displayName = "BaseButton", _BaseButton.componentId = 'BaseButton', _BaseButton.propTypes = propTypes, _BaseButton.allowedProps = allowedProps, _BaseButton.defaultProps = {
266
+ }, _BaseButton.displayName = "BaseButton", _BaseButton.componentId = 'BaseButton', _BaseButton.allowedProps = allowedProps, _BaseButton.defaultProps = {
264
267
  type: 'button',
265
268
  size: 'medium',
266
269
  as: 'button',
@@ -275,6 +278,6 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
275
278
  isCondensed: false,
276
279
  margin: '0',
277
280
  cursor: 'pointer'
278
- }, _BaseButton)) || _class) || _class);
281
+ }, _BaseButton)) || _class);
279
282
  export { BaseButton };
280
283
  export default BaseButton;
@@ -22,30 +22,5 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import PropTypes from 'prop-types';
26
- const propTypes = {
27
- children: PropTypes.node,
28
- type: PropTypes.oneOf(['button', 'submit', 'reset']),
29
- size: PropTypes.oneOf(['small', 'medium', 'large']),
30
- elementRef: PropTypes.func,
31
- as: PropTypes.elementType,
32
- interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
33
- color: PropTypes.oneOf(['primary', 'primary-inverse', 'secondary', 'success', 'danger', 'ai-primary', 'ai-secondary']),
34
- focusColor: PropTypes.oneOf(['info', 'inverse']),
35
- display: PropTypes.oneOf(['inline-block', 'block']),
36
- textAlign: PropTypes.oneOf(['start', 'center']),
37
- shape: PropTypes.oneOf(['rectangle', 'circle']),
38
- withBackground: PropTypes.bool,
39
- withBorder: PropTypes.bool,
40
- isCondensed: PropTypes.bool,
41
- margin: PropTypes.string,
42
- cursor: PropTypes.string,
43
- href: PropTypes.string,
44
- onClick: PropTypes.func,
45
- onKeyDown: PropTypes.func,
46
- renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
47
- tabIndex: PropTypes.number,
48
- withFocusOutline: PropTypes.bool
49
- };
50
25
  const allowedProps = ['as', 'children', 'color', 'cursor', 'display', 'elementRef', 'focusColor', 'href', 'interaction', 'isCondensed', 'margin', 'onClick', 'onKeyDown', 'renderIcon', 'shape', 'size', 'tabIndex', 'textAlign', 'type', 'withBackground', 'withBorder'];
51
- export { propTypes, allowedProps };
26
+ export { allowedProps };
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  const _excluded = ["children", "type", "size", "as", "color", "focusColor", "display", "textAlign", "withBackground", "margin", "cursor", "href", "renderIcon"];
3
- var _dec, _dec2, _class, _Button;
3
+ var _dec, _class, _Button;
4
4
  /*
5
5
  * The MIT License (MIT)
6
6
  *
@@ -26,12 +26,11 @@ var _dec, _dec2, _class, _Button;
26
26
  */
27
27
 
28
28
  import { Component } from 'react';
29
- import { testable } from '@instructure/ui-testable';
30
29
  import { getInteraction, passthroughProps } from '@instructure/ui-react-utils';
31
30
  import { withStyle } from '@instructure/emotion';
32
31
  import generateComponentTheme from './theme';
33
32
  import { BaseButton } from '../BaseButton';
34
- import { propTypes, allowedProps } from './props';
33
+ import { allowedProps } from './props';
35
34
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
36
35
  /**
37
36
  ---
@@ -39,7 +38,7 @@ category: components
39
38
  ---
40
39
  **/
41
40
  // needed for listing the available theme variables on docs page
42
- let Button = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_Button = class Button extends Component {
41
+ let Button = (_dec = withStyle(null, generateComponentTheme), _dec(_class = (_Button = class Button extends Component {
43
42
  constructor(...args) {
44
43
  super(...args);
45
44
  this._buttonComponent = null;
@@ -102,10 +101,11 @@ let Button = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable()
102
101
  };
103
102
  return _jsx(BaseButton, {
104
103
  ...buttonProps,
104
+ "data-cid": "Button",
105
105
  children: children
106
106
  });
107
107
  }
108
- }, _Button.displayName = "Button", _Button.componentId = 'Button', _Button.propTypes = propTypes, _Button.allowedProps = allowedProps, _Button.defaultProps = {
108
+ }, _Button.displayName = "Button", _Button.componentId = 'Button', _Button.allowedProps = allowedProps, _Button.defaultProps = {
109
109
  type: 'button',
110
110
  size: 'medium',
111
111
  as: 'button',
@@ -117,6 +117,6 @@ let Button = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable()
117
117
  withBackground: true,
118
118
  margin: '0',
119
119
  cursor: 'pointer'
120
- }, _Button)) || _class) || _class);
120
+ }, _Button)) || _class);
121
121
  export default Button;
122
122
  export { Button };
@@ -22,24 +22,5 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import PropTypes from 'prop-types';
26
- const propTypes = {
27
- children: PropTypes.node,
28
- type: PropTypes.oneOf(['button', 'submit', 'reset']),
29
- size: PropTypes.oneOf(['small', 'medium', 'large']),
30
- elementRef: PropTypes.func,
31
- as: PropTypes.elementType,
32
- interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
33
- color: PropTypes.oneOf(['primary', 'primary-inverse', 'secondary', 'success', 'danger', 'ai-primary', 'ai-secondary']),
34
- focusColor: PropTypes.oneOf(['info', 'inverse']),
35
- display: PropTypes.oneOf(['inline-block', 'block']),
36
- textAlign: PropTypes.oneOf(['start', 'center']),
37
- withBackground: PropTypes.bool,
38
- margin: PropTypes.string,
39
- cursor: PropTypes.string,
40
- href: PropTypes.string,
41
- renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
42
- onClick: PropTypes.func
43
- };
44
25
  const allowedProps = ['as', 'children', 'color', 'cursor', 'display', 'elementRef', 'focusColor', 'href', 'interaction', 'margin', 'renderIcon', 'size', 'textAlign', 'type', 'withBackground', 'onClick'];
45
- export { propTypes, allowedProps };
26
+ export { allowedProps };
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  const _excluded = ["screenReaderLabel", "elementRef", "size", "onClick", "margin", "placement", "offset", "type", "as", "href", "cursor", "tabIndex", "styles"];
3
- var _dec, _dec2, _class, _CloseButton;
3
+ var _dec, _class, _CloseButton;
4
4
  /*
5
5
  * The MIT License (MIT)
6
6
  *
@@ -28,20 +28,19 @@ var _dec, _dec2, _class, _CloseButton;
28
28
  import { Component } from 'react';
29
29
  import { IconXSolid } from '@instructure/ui-icons';
30
30
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
31
- import { testable } from '@instructure/ui-testable';
32
31
  import { getInteraction, passthroughProps } from '@instructure/ui-react-utils';
33
32
  import { withStyle } from '@instructure/emotion';
34
33
  import generateStyle from './styles';
35
34
  import generateComponentTheme from './theme';
36
35
  import { BaseButton } from '../BaseButton';
37
- import { propTypes, allowedProps } from './props';
36
+ import { allowedProps } from './props';
38
37
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
39
38
  /**
40
39
  ---
41
40
  category: components
42
41
  ---
43
42
  **/
44
- let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_CloseButton = class CloseButton extends Component {
43
+ let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_CloseButton = class CloseButton extends Component {
45
44
  constructor(...args) {
46
45
  super(...args);
47
46
  this.ref = null;
@@ -88,13 +87,17 @@ let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
88
87
  return _jsx("span", {
89
88
  ...passthroughProps(props),
90
89
  css: styles === null || styles === void 0 ? void 0 : styles.closeButton,
91
- ref: el => this.ref = el,
90
+ ref: el => {
91
+ this.ref = el;
92
+ },
92
93
  children: _jsx(BaseButton, {
93
94
  renderIcon: IconXSolid,
94
95
  elementRef: this.handleRef,
95
96
  interaction: this.interaction,
96
97
  type: type,
97
- color: this.color,
98
+ ...(this.color ? {
99
+ color: this.color
100
+ } : {}),
98
101
  size: size,
99
102
  onClick: onClick,
100
103
  margin: margin,
@@ -104,13 +107,14 @@ let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
104
107
  href: href,
105
108
  cursor: cursor,
106
109
  tabIndex: tabIndex,
110
+ "data-cid": "CloseButton",
107
111
  children: _jsx(ScreenReaderContent, {
108
112
  children: screenReaderLabel
109
113
  })
110
114
  })
111
115
  });
112
116
  }
113
- }, _CloseButton.displayName = "CloseButton", _CloseButton.componentId = 'CloseButton', _CloseButton.propTypes = propTypes, _CloseButton.allowedProps = allowedProps, _CloseButton.defaultProps = {
117
+ }, _CloseButton.displayName = "CloseButton", _CloseButton.componentId = 'CloseButton', _CloseButton.allowedProps = allowedProps, _CloseButton.defaultProps = {
114
118
  // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
115
119
  interaction: void 0,
116
120
  type: 'button',
@@ -120,6 +124,6 @@ let CloseButton = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
120
124
  margin: '0',
121
125
  as: 'button',
122
126
  cursor: 'pointer'
123
- }, _CloseButton)) || _class) || _class);
127
+ }, _CloseButton)) || _class);
124
128
  export default CloseButton;
125
129
  export { CloseButton };
@@ -22,22 +22,5 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import PropTypes from 'prop-types';
26
- const propTypes = {
27
- screenReaderLabel: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
28
- color: PropTypes.oneOf(['primary', 'primary-inverse']),
29
- interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
30
- elementRef: PropTypes.func,
31
- size: PropTypes.oneOf(['small', 'medium', 'large']),
32
- onClick: PropTypes.func,
33
- margin: PropTypes.string,
34
- placement: PropTypes.oneOf(['start', 'end', 'static']),
35
- offset: PropTypes.oneOf(['none', 'x-small', 'small', 'medium']),
36
- type: PropTypes.oneOf(['button', 'submit', 'reset']),
37
- as: PropTypes.elementType,
38
- href: PropTypes.string,
39
- cursor: PropTypes.string,
40
- tabIndex: PropTypes.number
41
- };
42
25
  const allowedProps = ['as', 'color', 'cursor', 'elementRef', 'href', 'interaction', 'margin', 'offset', 'onClick', 'placement', 'screenReaderLabel', 'size', 'tabIndex', 'type'];
43
- export { propTypes, allowedProps };
26
+ export { allowedProps };
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  const _excluded = ["children", "type", "size", "elementRef", "as", "interaction", "color", "margin", "cursor", "href", "renderIcon", "display"];
3
- var _dec, _dec2, _class, _CondensedButton;
3
+ var _dec, _class, _CondensedButton;
4
4
  /*
5
5
  * The MIT License (MIT)
6
6
  *
@@ -26,12 +26,11 @@ var _dec, _dec2, _class, _CondensedButton;
26
26
  */
27
27
 
28
28
  import { Component } from 'react';
29
- import { testable } from '@instructure/ui-testable';
30
29
  import { passthroughProps } from '@instructure/ui-react-utils';
31
30
  import { withStyle } from '@instructure/emotion';
32
31
  import generateComponentTheme from './theme';
33
32
  import { BaseButton } from '../BaseButton';
34
- import { propTypes, allowedProps } from './props';
33
+ import { allowedProps } from './props';
35
34
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
36
35
  /**
37
36
  ---
@@ -39,7 +38,7 @@ category: components
39
38
  ---
40
39
  **/
41
40
  // needed for listing the available theme variables on docs page
42
- let CondensedButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_CondensedButton = class CondensedButton extends Component {
41
+ let CondensedButton = (_dec = withStyle(null, generateComponentTheme), _dec(_class = (_CondensedButton = class CondensedButton extends Component {
43
42
  constructor(...args) {
44
43
  super(...args);
45
44
  this._baseButton = null;
@@ -94,10 +93,11 @@ let CondensedButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = t
94
93
  ref: component => {
95
94
  this._baseButton = component;
96
95
  },
96
+ "data-cid": "CondensedButton",
97
97
  children: children
98
98
  });
99
99
  }
100
- }, _CondensedButton.displayName = "CondensedButton", _CondensedButton.componentId = 'CondensedButton', _CondensedButton.propTypes = propTypes, _CondensedButton.allowedProps = allowedProps, _CondensedButton.defaultProps = {
100
+ }, _CondensedButton.displayName = "CondensedButton", _CondensedButton.componentId = 'CondensedButton', _CondensedButton.allowedProps = allowedProps, _CondensedButton.defaultProps = {
101
101
  type: 'button',
102
102
  size: 'medium',
103
103
  as: 'button',
@@ -107,6 +107,6 @@ let CondensedButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = t
107
107
  margin: '0',
108
108
  cursor: 'pointer',
109
109
  display: 'inline-block'
110
- }, _CondensedButton)) || _class) || _class);
110
+ }, _CondensedButton)) || _class);
111
111
  export default CondensedButton;
112
112
  export { CondensedButton };
@@ -22,21 +22,5 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import PropTypes from 'prop-types';
26
- const propTypes = {
27
- children: PropTypes.node,
28
- type: PropTypes.oneOf(['button', 'submit', 'reset']),
29
- size: PropTypes.oneOf(['small', 'medium', 'large']),
30
- elementRef: PropTypes.func,
31
- as: PropTypes.elementType,
32
- interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
33
- color: PropTypes.oneOf(['primary', 'primary-inverse', 'secondary']),
34
- margin: PropTypes.string,
35
- cursor: PropTypes.string,
36
- href: PropTypes.string,
37
- renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
38
- onClick: PropTypes.func,
39
- display: PropTypes.oneOf(['inline-block', 'block'])
40
- };
41
25
  const allowedProps = ['as', 'children', 'color', 'cursor', 'elementRef', 'href', 'interaction', 'margin', 'renderIcon', 'size', 'type', 'onClick', 'display'];
42
- export { propTypes, allowedProps };
26
+ export { allowedProps };
@@ -1,6 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  const _excluded = ["children", "renderIcon", "screenReaderLabel", "type", "size", "elementRef", "as", "interaction", "color", "focusColor", "shape", "withBackground", "withBorder", "margin", "cursor", "href"];
3
- var _dec, _dec2, _class, _IconButton;
3
+ var _dec, _class, _IconButton;
4
4
  /*
5
5
  * The MIT License (MIT)
6
6
  *
@@ -26,13 +26,13 @@ var _dec, _dec2, _class, _IconButton;
26
26
  */
27
27
 
28
28
  import { Component } from 'react';
29
- import { testable } from '@instructure/ui-testable';
30
29
  import { passthroughProps } from '@instructure/ui-react-utils';
31
30
  import { ScreenReaderContent } from '@instructure/ui-a11y-content';
31
+ import { combineDataCid } from '@instructure/ui-utils';
32
32
  import { withStyle } from '@instructure/emotion';
33
33
  import generateComponentTheme from './theme';
34
34
  import { BaseButton } from '../BaseButton';
35
- import { propTypes, allowedProps } from './props';
35
+ import { allowedProps } from './props';
36
36
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
37
37
  /**
38
38
  ---
@@ -40,7 +40,7 @@ category: components
40
40
  ---
41
41
  **/
42
42
  // needed for listing the available theme variables on docs page
43
- let IconButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_IconButton = class IconButton extends Component {
43
+ let IconButton = (_dec = withStyle(null, generateComponentTheme), _dec(_class = (_IconButton = class IconButton extends Component {
44
44
  constructor(...args) {
45
45
  super(...args);
46
46
  this._baseButton = null;
@@ -99,12 +99,13 @@ let IconButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testab
99
99
  ref: component => {
100
100
  this._baseButton = component;
101
101
  },
102
+ "data-cid": combineDataCid('IconButton', this.props),
102
103
  children: _jsx(ScreenReaderContent, {
103
104
  children: screenReaderLabel
104
105
  })
105
106
  });
106
107
  }
107
- }, _IconButton.displayName = "IconButton", _IconButton.componentId = 'IconButton', _IconButton.propTypes = propTypes, _IconButton.allowedProps = allowedProps, _IconButton.defaultProps = {
108
+ }, _IconButton.displayName = "IconButton", _IconButton.componentId = 'IconButton', _IconButton.allowedProps = allowedProps, _IconButton.defaultProps = {
108
109
  type: 'button',
109
110
  size: 'medium',
110
111
  as: 'button',
@@ -116,6 +117,6 @@ let IconButton = (_dec = withStyle(null, generateComponentTheme), _dec2 = testab
116
117
  withBorder: true,
117
118
  margin: '0',
118
119
  cursor: 'pointer'
119
- }, _IconButton)) || _class) || _class);
120
+ }, _IconButton)) || _class);
120
121
  export default IconButton;
121
122
  export { IconButton };
@@ -22,25 +22,5 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import PropTypes from 'prop-types';
26
- const propTypes = {
27
- children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
28
- renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
29
- screenReaderLabel: PropTypes.string.isRequired,
30
- type: PropTypes.oneOf(['button', 'submit', 'reset']),
31
- size: PropTypes.oneOf(['small', 'medium', 'large']),
32
- elementRef: PropTypes.func,
33
- as: PropTypes.elementType,
34
- interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
35
- color: PropTypes.oneOf(['primary', 'primary-inverse', 'secondary', 'success', 'danger', 'ai-primary', 'ai-secondary']),
36
- focusColor: PropTypes.oneOf(['info', 'inverse']),
37
- shape: PropTypes.oneOf(['rectangle', 'circle']),
38
- withBackground: PropTypes.bool,
39
- withBorder: PropTypes.bool,
40
- margin: PropTypes.string,
41
- cursor: PropTypes.string,
42
- href: PropTypes.string,
43
- onClick: PropTypes.func
44
- };
45
25
  const allowedProps = ['as', 'children', 'color', 'cursor', 'elementRef', 'focusColor', 'href', 'interaction', 'margin', 'renderIcon', 'screenReaderLabel', 'shape', 'size', 'type', 'withBackground', 'withBorder', 'onClick'];
46
- export { propTypes, allowedProps };
26
+ export { allowedProps };
@@ -1,6 +1,5 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  const _excluded = ["as", "color", "elementRef", "size", "interaction", "mountNode", "renderIcon", "renderTooltipContent", "screenReaderLabel", "status", "placement", "onClick"];
3
- var _dec, _class, _ToggleButton;
4
3
  /*
5
4
  * The MIT License (MIT)
6
5
  *
@@ -26,18 +25,18 @@ var _dec, _class, _ToggleButton;
26
25
  */
27
26
 
28
27
  import { Component } from 'react';
29
- import { testable } from '@instructure/ui-testable';
30
28
  import { callRenderProp, passthroughProps } from '@instructure/ui-react-utils';
31
29
  import { Tooltip } from '@instructure/ui-tooltip';
32
30
  import { IconButton } from '../IconButton';
33
- import { propTypes, allowedProps } from './props';
31
+ import { allowedProps } from './props';
34
32
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
35
33
  /**
36
34
  ---
37
35
  category: components
38
36
  ---
39
37
  **/
40
- let ToggleButton = (_dec = testable(), _dec(_class = (_ToggleButton = class ToggleButton extends Component {
38
+
39
+ class ToggleButton extends Component {
41
40
  constructor(props) {
42
41
  super(props);
43
42
  this.ref = null;
@@ -99,11 +98,16 @@ let ToggleButton = (_dec = testable(), _dec(_class = (_ToggleButton = class Togg
99
98
  onClick: onClick,
100
99
  interaction: interaction,
101
100
  "aria-pressed": status === 'pressed',
101
+ "data-cid": "ToggleButton",
102
102
  children: callRenderProp(renderIcon)
103
103
  })
104
104
  });
105
105
  }
106
- }, _ToggleButton.displayName = "ToggleButton", _ToggleButton.componentId = 'ToggleButton', _ToggleButton.propTypes = propTypes, _ToggleButton.allowedProps = allowedProps, _ToggleButton.defaultProps = {
106
+ }
107
+ ToggleButton.displayName = "ToggleButton";
108
+ ToggleButton.componentId = 'ToggleButton';
109
+ ToggleButton.allowedProps = allowedProps;
110
+ ToggleButton.defaultProps = {
107
111
  size: 'medium',
108
112
  as: 'button',
109
113
  // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
@@ -112,6 +116,6 @@ let ToggleButton = (_dec = testable(), _dec(_class = (_ToggleButton = class Togg
112
116
  color: 'secondary',
113
117
  placement: 'top center',
114
118
  constrain: 'window'
115
- }, _ToggleButton)) || _class);
119
+ };
116
120
  export { ToggleButton };
117
121
  export default ToggleButton;
@@ -22,23 +22,5 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import PropTypes from 'prop-types';
26
- import { PositionPropTypes } from '@instructure/ui-position';
27
- const propTypes = {
28
- screenReaderLabel: PropTypes.string.isRequired,
29
- renderTooltipContent: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
30
- renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
31
- status: PropTypes.oneOf(['pressed', 'unpressed']).isRequired,
32
- as: PropTypes.elementType,
33
- interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
34
- size: PropTypes.oneOf(['small', 'medium', 'large']),
35
- elementRef: PropTypes.func,
36
- onClick: PropTypes.func,
37
- color: PropTypes.oneOf(['primary', 'primary-inverse', 'secondary', 'success', 'danger']),
38
- isShowingTooltip: PropTypes.bool,
39
- mountNode: PositionPropTypes.mountNode,
40
- placement: PositionPropTypes.placement,
41
- constrain: PositionPropTypes.constrain
42
- };
43
25
  const allowedProps = ['as', 'color', 'constrain', 'elementRef', 'interaction', 'isShowingTooltip', 'mountNode', 'onClick', 'placement', 'renderIcon', 'renderTooltipContent', 'screenReaderLabel', 'size', 'status'];
44
- export { propTypes, allowedProps };
26
+ export { allowedProps };
@@ -8,7 +8,6 @@ exports.default = exports.BaseButton = void 0;
8
8
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
9
  var _react = require("react");
10
10
  var _keycode = _interopRequireDefault(require("keycode"));
11
- var _testable = require("@instructure/ui-testable/lib/testable.js");
12
11
  var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
13
12
  var _getInteraction = require("@instructure/ui-react-utils/lib/getInteraction.js");
14
13
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
@@ -17,13 +16,14 @@ var _isActiveElement = require("@instructure/ui-dom-utils/lib/isActiveElement.js
17
16
  var _hasVisibleChildren = require("@instructure/ui-a11y-utils/lib/hasVisibleChildren.js");
18
17
  var _View = require("@instructure/ui-view/lib/View");
19
18
  var _uiUtils = require("@instructure/ui-utils");
19
+ var _combineDataCid = require("@instructure/ui-utils/lib/combineDataCid.js");
20
20
  var _emotion = require("@instructure/emotion");
21
21
  var _styles = _interopRequireDefault(require("./styles"));
22
22
  var _theme = _interopRequireDefault(require("./theme"));
23
23
  var _props = require("./props");
24
24
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
25
25
  const _excluded = ["type", "size", "elementRef", "as", "href", "color", "focusColor", "textAlign", "shape", "display", "withBackground", "withBorder", "isCondensed", "margin", "cursor", "onClick", "renderIcon", "tabIndex", "styles", "makeStyles", "withFocusOutline"];
26
- var _dec, _dec2, _class, _BaseButton;
26
+ var _dec, _class, _BaseButton;
27
27
  /*
28
28
  * The MIT License (MIT)
29
29
  *
@@ -47,12 +47,14 @@ var _dec, _dec2, _class, _BaseButton;
47
47
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48
48
  * SOFTWARE.
49
49
  */
50
+ // TODO these have to be imported in separate lines because otherwise `isSafari` will be missing from the babel build
51
+ // this bug is very likely caused by `babel-plugin-transform-imports` and can be reverted once it is removed from the codebase
50
52
  /**
51
53
  ---
52
54
  category: components/utilities
53
55
  ---
54
56
  **/
55
- let BaseButton = exports.BaseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_BaseButton = class BaseButton extends _react.Component {
57
+ let BaseButton = exports.BaseButton = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec(_class = (_BaseButton = class BaseButton extends _react.Component {
56
58
  constructor(...args) {
57
59
  super(...args);
58
60
  this.ref = null;
@@ -263,13 +265,14 @@ let BaseButton = exports.BaseButton = (_dec = (0, _emotion.withStyle)(_styles.de
263
265
  disabled: isDisabled || isReadOnly,
264
266
  css: styles === null || styles === void 0 ? void 0 : styles.baseButton,
265
267
  withFocusOutline: withFocusOutline,
268
+ "data-cid": (0, _combineDataCid.combineDataCid)('BaseButton', this.props),
266
269
  children: (0, _jsxRuntime.jsx)("span", {
267
270
  css: styles === null || styles === void 0 ? void 0 : styles.content,
268
271
  children: this.renderChildren()
269
272
  })
270
273
  });
271
274
  }
272
- }, _BaseButton.displayName = "BaseButton", _BaseButton.componentId = 'BaseButton', _BaseButton.propTypes = _props.propTypes, _BaseButton.allowedProps = _props.allowedProps, _BaseButton.defaultProps = {
275
+ }, _BaseButton.displayName = "BaseButton", _BaseButton.componentId = 'BaseButton', _BaseButton.allowedProps = _props.allowedProps, _BaseButton.defaultProps = {
273
276
  type: 'button',
274
277
  size: 'medium',
275
278
  as: 'button',
@@ -284,5 +287,5 @@ let BaseButton = exports.BaseButton = (_dec = (0, _emotion.withStyle)(_styles.de
284
287
  isCondensed: false,
285
288
  margin: '0',
286
289
  cursor: 'pointer'
287
- }, _BaseButton)) || _class) || _class);
290
+ }, _BaseButton)) || _class);
288
291
  var _default = exports.default = BaseButton;
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports.propTypes = exports.allowedProps = void 0;
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
6
+ exports.allowedProps = void 0;
9
7
  /*
10
8
  * The MIT License (MIT)
11
9
  *
@@ -30,28 +28,4 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
30
28
  * SOFTWARE.
31
29
  */
32
30
 
33
- const propTypes = exports.propTypes = {
34
- children: _propTypes.default.node,
35
- type: _propTypes.default.oneOf(['button', 'submit', 'reset']),
36
- size: _propTypes.default.oneOf(['small', 'medium', 'large']),
37
- elementRef: _propTypes.default.func,
38
- as: _propTypes.default.elementType,
39
- interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
40
- color: _propTypes.default.oneOf(['primary', 'primary-inverse', 'secondary', 'success', 'danger', 'ai-primary', 'ai-secondary']),
41
- focusColor: _propTypes.default.oneOf(['info', 'inverse']),
42
- display: _propTypes.default.oneOf(['inline-block', 'block']),
43
- textAlign: _propTypes.default.oneOf(['start', 'center']),
44
- shape: _propTypes.default.oneOf(['rectangle', 'circle']),
45
- withBackground: _propTypes.default.bool,
46
- withBorder: _propTypes.default.bool,
47
- isCondensed: _propTypes.default.bool,
48
- margin: _propTypes.default.string,
49
- cursor: _propTypes.default.string,
50
- href: _propTypes.default.string,
51
- onClick: _propTypes.default.func,
52
- onKeyDown: _propTypes.default.func,
53
- renderIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
54
- tabIndex: _propTypes.default.number,
55
- withFocusOutline: _propTypes.default.bool
56
- };
57
31
  const allowedProps = exports.allowedProps = ['as', 'children', 'color', 'cursor', 'display', 'elementRef', 'focusColor', 'href', 'interaction', 'isCondensed', 'margin', 'onClick', 'onKeyDown', 'renderIcon', 'shape', 'size', 'tabIndex', 'textAlign', 'type', 'withBackground', 'withBorder'];