@instructure/ui-buttons 11.7.10 → 11.7.11-pr-snapshot-1793741604126

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 (105) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/es/BaseButton/v1/index.js +209 -285
  3. package/es/BaseButton/v1/props.js +24 -26
  4. package/es/BaseButton/v1/styles.js +399 -450
  5. package/es/BaseButton/v1/theme.js +140 -177
  6. package/es/BaseButton/v2/index.js +223 -302
  7. package/es/BaseButton/v2/props.js +24 -26
  8. package/es/BaseButton/v2/styles.js +550 -604
  9. package/es/Button/v1/index.js +75 -116
  10. package/es/Button/v1/props.js +19 -26
  11. package/es/Button/v1/theme.js +1 -25
  12. package/es/Button/v2/index.js +78 -118
  13. package/es/Button/v2/props.js +19 -26
  14. package/es/CloseButton/v1/index.js +80 -120
  15. package/es/CloseButton/v1/props.js +17 -26
  16. package/es/CloseButton/v1/styles.js +30 -67
  17. package/es/CloseButton/v1/theme.js +12 -44
  18. package/es/CloseButton/v2/index.js +85 -124
  19. package/es/CloseButton/v2/props.js +17 -26
  20. package/es/CloseButton/v2/styles.js +30 -67
  21. package/es/CondensedButton/v1/index.js +67 -106
  22. package/es/CondensedButton/v1/props.js +16 -26
  23. package/es/CondensedButton/v1/theme.js +1 -25
  24. package/es/CondensedButton/v2/index.js +70 -108
  25. package/es/CondensedButton/v2/props.js +16 -26
  26. package/es/IconButton/v1/index.js +71 -114
  27. package/es/IconButton/v1/props.js +20 -26
  28. package/es/IconButton/v1/theme.js +1 -25
  29. package/es/IconButton/v2/index.js +74 -116
  30. package/es/IconButton/v2/props.js +20 -26
  31. package/es/ToggleButton/v1/index.js +74 -112
  32. package/es/ToggleButton/v1/props.js +17 -26
  33. package/es/ToggleButton/v2/index.js +75 -114
  34. package/es/ToggleButton/v2/props.js +18 -26
  35. package/es/exports/a.js +1 -25
  36. package/es/exports/b.js +1 -25
  37. package/package.json +19 -25
  38. package/src/BaseButton/v1/index.tsx +7 -2
  39. package/src/BaseButton/v2/index.tsx +4 -2
  40. package/src/Button/v1/index.tsx +4 -2
  41. package/src/Button/v2/index.tsx +4 -2
  42. package/src/CloseButton/v1/index.tsx +7 -2
  43. package/src/CloseButton/v2/index.tsx +4 -2
  44. package/src/CondensedButton/v1/index.tsx +7 -2
  45. package/src/CondensedButton/v2/index.tsx +4 -2
  46. package/src/IconButton/v1/index.tsx +4 -2
  47. package/src/IconButton/v2/index.tsx +4 -2
  48. package/tsconfig.build.json +0 -1
  49. package/tsconfig.build.tsbuildinfo +1 -1
  50. package/types/BaseButton/v1/index.d.ts +3 -1
  51. package/types/BaseButton/v1/index.d.ts.map +1 -1
  52. package/types/BaseButton/v2/index.d.ts +3 -1
  53. package/types/BaseButton/v2/index.d.ts.map +1 -1
  54. package/types/Button/v1/index.d.ts +3 -1
  55. package/types/Button/v1/index.d.ts.map +1 -1
  56. package/types/Button/v2/index.d.ts +3 -1
  57. package/types/Button/v2/index.d.ts.map +1 -1
  58. package/types/CloseButton/v1/index.d.ts +3 -1
  59. package/types/CloseButton/v1/index.d.ts.map +1 -1
  60. package/types/CloseButton/v2/index.d.ts +3 -1
  61. package/types/CloseButton/v2/index.d.ts.map +1 -1
  62. package/types/CondensedButton/v1/index.d.ts +3 -1
  63. package/types/CondensedButton/v1/index.d.ts.map +1 -1
  64. package/types/CondensedButton/v2/index.d.ts +3 -1
  65. package/types/CondensedButton/v2/index.d.ts.map +1 -1
  66. package/types/IconButton/v1/index.d.ts +3 -1
  67. package/types/IconButton/v1/index.d.ts.map +1 -1
  68. package/types/IconButton/v2/index.d.ts +3 -1
  69. package/types/IconButton/v2/index.d.ts.map +1 -1
  70. package/lib/BaseButton/v1/index.js +0 -312
  71. package/lib/BaseButton/v1/props.js +0 -31
  72. package/lib/BaseButton/v1/styles.js +0 -464
  73. package/lib/BaseButton/v1/theme.js +0 -186
  74. package/lib/BaseButton/v2/index.js +0 -333
  75. package/lib/BaseButton/v2/props.js +0 -31
  76. package/lib/BaseButton/v2/styles.js +0 -625
  77. package/lib/Button/v1/index.js +0 -129
  78. package/lib/Button/v1/props.js +0 -31
  79. package/lib/Button/v1/theme.js +0 -13
  80. package/lib/Button/v2/index.js +0 -129
  81. package/lib/Button/v2/props.js +0 -31
  82. package/lib/CloseButton/v1/index.js +0 -136
  83. package/lib/CloseButton/v1/props.js +0 -31
  84. package/lib/CloseButton/v1/styles.js +0 -76
  85. package/lib/CloseButton/v1/theme.js +0 -51
  86. package/lib/CloseButton/v2/index.js +0 -139
  87. package/lib/CloseButton/v2/props.js +0 -31
  88. package/lib/CloseButton/v2/styles.js +0 -76
  89. package/lib/CondensedButton/v1/index.js +0 -119
  90. package/lib/CondensedButton/v1/props.js +0 -31
  91. package/lib/CondensedButton/v1/theme.js +0 -13
  92. package/lib/CondensedButton/v2/index.js +0 -119
  93. package/lib/CondensedButton/v2/props.js +0 -31
  94. package/lib/IconButton/v1/index.js +0 -129
  95. package/lib/IconButton/v1/props.js +0 -31
  96. package/lib/IconButton/v1/theme.js +0 -13
  97. package/lib/IconButton/v2/index.js +0 -129
  98. package/lib/IconButton/v2/props.js +0 -31
  99. package/lib/ToggleButton/v1/index.js +0 -128
  100. package/lib/ToggleButton/v1/props.js +0 -31
  101. package/lib/ToggleButton/v2/index.js +0 -130
  102. package/lib/ToggleButton/v2/props.js +0 -31
  103. package/lib/exports/a.js +0 -47
  104. package/lib/exports/b.js +0 -47
  105. package/lib/package.json +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
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
+ ## [11.7.11-pr-snapshot-1793741604126](https://github.com/instructure/instructure-ui/compare/v11.7.10...v11.7.11-pr-snapshot-1793741604126) (2026-11-03)
7
+
8
+ ### Build System
9
+
10
+ * **many:** replace babel with swc ([6f90a9e](https://github.com/instructure/instructure-ui/commit/6f90a9e594feaf0eff2602696d22cfafdeb549bc))
11
+
12
+ ### BREAKING CHANGES
13
+
14
+ * **many:** `@instructure/ui-babel-preset` and
15
+ `@instructure/browserslist-config-instui` are removed and will no longer be
16
+ published. Packages depend on `@swc/helpers` instead of `@babel/runtime`.
17
+
18
+
6
19
  ## [11.7.10](https://github.com/instructure/instructure-ui/compare/v11.7.8...v11.7.10) (2026-10-14)
7
20
 
8
21
  **Note:** Version bump only for package @instructure/ui-buttons
@@ -1,28 +1,4 @@
1
- var _dec, _class;
2
- /*
3
- * The MIT License (MIT)
4
- *
5
- * Copyright (c) 2015 - present Instructure, Inc.
6
- *
7
- * Permission is hereby granted, free of charge, to any person obtaining a copy
8
- * of this software and associated documentation files (the "Software"), to deal
9
- * in the Software without restriction, including without limitation the rights
10
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
- * copies of the Software, and to permit persons to whom the Software is
12
- * furnished to do so, subject to the following conditions:
13
- *
14
- * The above copyright notice and this permission notice shall be included in all
15
- * copies or substantial portions of the Software.
16
- *
17
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
- * SOFTWARE.
24
- */
25
-
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
26
2
  import { Component } from 'react';
27
3
  import keycode from 'keycode';
28
4
  import { getElementType, getInteraction, passthroughProps, callRenderProp } from '@instructure/ui-react-utils';
@@ -34,274 +10,222 @@ import { withStyle } from '@instructure/emotion';
34
10
  import generateStyles from './styles.js';
35
11
  import generateComponentTheme from './theme.js';
36
12
  import { allowedProps } from './props.js';
37
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
38
- /**
39
- ---
40
- category: components/Util Components
41
- ---
42
- **/
43
- let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec(_class = class BaseButton extends Component {
44
- static displayName = 'BaseButton';
45
- static componentId = 'BaseButton';
46
- static allowedProps = allowedProps;
47
- static defaultProps = {
48
- type: 'button',
49
- size: 'medium',
50
- as: 'button',
51
- // Leave interaction default undefined so that `disabled` and `readOnly` can also be supplied
52
- interaction: undefined,
53
- color: 'secondary',
54
- shape: 'rectangle',
55
- display: 'inline-block',
56
- textAlign: 'start',
57
- withBackground: true,
58
- withBorder: true,
59
- isCondensed: false,
60
- margin: '0',
61
- cursor: 'pointer'
62
- };
63
- ref = null;
64
- componentDidMount() {
65
- this.props.makeStyles?.(this.makeStylesVariables);
66
- }
67
- componentDidUpdate() {
68
- this.props.makeStyles?.(this.makeStylesVariables);
69
- }
70
- get makeStylesVariables() {
71
- return {
72
- isDisabled: this.isDisabled,
73
- hasOnlyIconVisible: this.hasOnlyIconVisible,
74
- isEnabled: this.isEnabled
75
- };
76
- }
77
- get hasOnlyIconVisible() {
78
- const {
79
- children,
80
- renderIcon
81
- } = this.props;
82
- return !!(renderIcon && !hasVisibleChildren(children));
83
- }
84
- get elementType() {
85
- return getElementType(BaseButton, this.props);
86
- }
87
- get interaction() {
88
- return getInteraction({
89
- props: this.props
90
- });
91
- }
92
- get isDisabled() {
93
- return this.interaction === 'disabled';
94
- }
95
- get isReadOnly() {
96
- return this.interaction === 'readonly';
97
- }
98
- get isEnabled() {
99
- return this.interaction === 'enabled';
100
- }
101
- get focusColor() {
102
- const {
103
- color,
104
- focusColor,
105
- withBackground
106
- } = this.props;
107
-
108
- // Give user specified focusColor preference
109
- if (focusColor) {
110
- return focusColor;
13
+ export class BaseButtonBase extends Component {
14
+ static{
15
+ this.displayName = 'BaseButton';
16
+ }
17
+ static{
18
+ this.componentId = 'BaseButton';
19
+ }
20
+ static{
21
+ this.allowedProps = allowedProps;
22
+ }
23
+ static{
24
+ this.defaultProps = {
25
+ type: 'button',
26
+ size: 'medium',
27
+ as: 'button',
28
+ interaction: undefined,
29
+ color: 'secondary',
30
+ shape: 'rectangle',
31
+ display: 'inline-block',
32
+ textAlign: 'start',
33
+ withBackground: true,
34
+ withBorder: true,
35
+ isCondensed: false,
36
+ margin: '0',
37
+ cursor: 'pointer'
38
+ };
39
+ }
40
+ componentDidMount() {
41
+ this.props.makeStyles?.(this.makeStylesVariables);
42
+ }
43
+ componentDidUpdate() {
44
+ this.props.makeStyles?.(this.makeStylesVariables);
45
+ }
46
+ get makeStylesVariables() {
47
+ return {
48
+ isDisabled: this.isDisabled,
49
+ hasOnlyIconVisible: this.hasOnlyIconVisible,
50
+ isEnabled: this.isEnabled
51
+ };
52
+ }
53
+ get hasOnlyIconVisible() {
54
+ const { children, renderIcon } = this.props;
55
+ return !!(renderIcon && !hasVisibleChildren(children));
56
+ }
57
+ get elementType() {
58
+ return getElementType(BaseButton, this.props);
59
+ }
60
+ get interaction() {
61
+ return getInteraction({
62
+ props: this.props
63
+ });
111
64
  }
112
-
113
- // The `primary-inverse` background has an info focus outline
114
- // by default since it is replacing the `light` button variant.
115
- // Override the focus color with info even though it is
116
- // an inverse color
117
- if (color === 'primary-inverse' && withBackground) {
118
- return 'info';
65
+ get isDisabled() {
66
+ return this.interaction === 'disabled';
119
67
  }
120
- return color.includes('inverse') ? 'inverse' : 'info';
121
- }
122
- get focused() {
123
- return isActiveElement(this.ref);
124
- }
125
- focus() {
126
- this.ref && this.ref.focus();
127
- }
128
- handleElementRef = el => {
129
- const {
130
- elementRef
131
- } = this.props;
132
- this.ref = el;
133
- if (typeof elementRef === 'function') {
134
- elementRef(el);
68
+ get isReadOnly() {
69
+ return this.interaction === 'readonly';
135
70
  }
136
- };
137
- handleClick = event => {
138
- const {
139
- onClick
140
- } = this.props;
141
- const {
142
- interaction
143
- } = this;
144
- if (interaction !== 'enabled') {
145
- event.preventDefault();
146
- event.stopPropagation();
147
- return;
71
+ get isEnabled() {
72
+ return this.interaction === 'enabled';
148
73
  }
149
- if (typeof onClick === 'function') {
150
- onClick(event);
74
+ get focusColor() {
75
+ const { color, focusColor, withBackground } = this.props;
76
+ if (focusColor) {
77
+ return focusColor;
78
+ }
79
+ if (color === 'primary-inverse' && withBackground) {
80
+ return 'info';
81
+ }
82
+ return color.includes('inverse') ? 'inverse' : 'info';
151
83
  }
152
- };
153
- handleKeyDown = event => {
154
- const {
155
- onClick,
156
- onKeyDown,
157
- href
158
- } = this.props;
159
- const {
160
- interaction
161
- } = this;
162
- if (typeof onKeyDown === 'function') {
163
- onKeyDown(event);
84
+ get focused() {
85
+ return isActiveElement(this.ref);
164
86
  }
165
-
166
- // behave like a button when space key is pressed
167
- const {
168
- space,
169
- enter
170
- } = keycode.codes;
171
- if (this.elementType !== 'button' && [space, enter].includes(event.keyCode)) {
172
- event.preventDefault();
173
- event.stopPropagation();
174
- if (typeof onClick === 'function' && interaction === 'enabled') {
175
- onClick(event);
176
- }
177
- if (href) {
178
- this.ref && this.ref.click();
179
- }
87
+ focus() {
88
+ this.ref && this.ref.focus();
180
89
  }
181
- };
182
- renderChildren() {
183
- const {
184
- renderIcon,
185
- children,
186
- styles
187
- } = this.props;
188
- const wrappedChildren = _jsx("span", {
189
- css: styles?.children,
190
- children: children
191
- });
192
- if (!renderIcon) {
193
- return wrappedChildren;
90
+ renderChildren() {
91
+ const { renderIcon, children, styles } = this.props;
92
+ const wrappedChildren = /*#__PURE__*/ _jsx("span", {
93
+ css: styles?.children,
94
+ children: children
95
+ });
96
+ if (!renderIcon) {
97
+ return wrappedChildren;
98
+ }
99
+ const { hasOnlyIconVisible } = this;
100
+ const wrappedIcon = /*#__PURE__*/ _jsx("span", {
101
+ css: styles?.iconSVG,
102
+ children: callRenderProp(renderIcon)
103
+ });
104
+ const flexChildren = hasOnlyIconVisible ? /*#__PURE__*/ _jsxs("span", {
105
+ css: styles?.iconOnly,
106
+ children: [
107
+ wrappedIcon,
108
+ children
109
+ ]
110
+ }) : [
111
+ /*#__PURE__*/ _jsx("span", {
112
+ css: styles?.iconWrapper,
113
+ children: wrappedIcon
114
+ }, "icon"),
115
+ /*#__PURE__*/ _jsx("span", {
116
+ css: styles?.childrenWrapper,
117
+ children: wrappedChildren
118
+ }, "children")
119
+ ];
120
+ return /*#__PURE__*/ _jsx("span", {
121
+ css: styles?.childrenLayout,
122
+ children: flexChildren
123
+ });
194
124
  }
195
- const {
196
- hasOnlyIconVisible
197
- } = this;
198
- const wrappedIcon = _jsx("span", {
199
- css: styles?.iconSVG,
200
- children: callRenderProp(renderIcon)
201
- });
202
- const flexChildren = hasOnlyIconVisible ? _jsxs("span", {
203
- css: styles?.iconOnly,
204
- children: [wrappedIcon, children]
205
- }) : [_jsx("span", {
206
- css: styles?.iconWrapper,
207
- children: wrappedIcon
208
- }, "icon"), _jsx("span", {
209
- css: styles?.childrenWrapper,
210
- children: wrappedChildren
211
- }, "children")];
212
- return _jsx("span", {
213
- css: styles?.childrenLayout,
214
- children: flexChildren
215
- });
216
- }
217
- render() {
218
- const {
219
- type,
220
- size,
221
- elementRef,
222
- as,
223
- href: rawHref,
224
- color,
225
- focusColor,
226
- textAlign,
227
- shape,
228
- display,
229
- withBackground,
230
- withBorder,
231
- isCondensed,
232
- margin,
233
- cursor,
234
- onClick,
235
- renderIcon,
236
- tabIndex,
237
- styles,
238
- makeStyles,
239
- withFocusOutline,
240
- ...props
241
- } = this.props;
242
- const {
243
- isDisabled,
244
- isReadOnly,
245
- elementType
246
- } = this;
247
- const {
248
- href,
249
- rel
250
- } = safeLinkProps({
251
- tag: typeof elementType == 'string' ? elementType : 'button',
252
- attr: 'href',
253
- href: rawHref,
254
- target: props.target,
255
- rel: props.rel
256
- });
257
-
258
- // only add 0 tabIndex value if it doesn't have it by default, see
259
- // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
260
- let needsZeroTabIndex = true;
261
- if (typeof elementType == 'string') {
262
- if (['button', 'frame', 'iframe', 'input', 'object', 'select', 'textarea', 'summary'].includes(elementType)) {
263
- needsZeroTabIndex = false;
264
- }
265
- if (href && (elementType === 'a' || elementType === 'area')) {
266
- needsZeroTabIndex = false;
267
- }
125
+ render() {
126
+ const { type, size, elementRef, as, href: rawHref, color, focusColor, textAlign, shape, display, withBackground, withBorder, isCondensed, margin, cursor, onClick, renderIcon, tabIndex, styles, makeStyles, withFocusOutline, ...props } = this.props;
127
+ const { isDisabled, isReadOnly, elementType } = this;
128
+ const { href, rel } = safeLinkProps({
129
+ tag: typeof elementType == 'string' ? elementType : 'button',
130
+ attr: 'href',
131
+ href: rawHref,
132
+ target: props.target,
133
+ rel: props.rel
134
+ });
135
+ let needsZeroTabIndex = true;
136
+ if (typeof elementType == 'string') {
137
+ if ([
138
+ 'button',
139
+ 'frame',
140
+ 'iframe',
141
+ 'input',
142
+ 'object',
143
+ 'select',
144
+ 'textarea',
145
+ 'summary'
146
+ ].includes(elementType)) {
147
+ needsZeroTabIndex = false;
148
+ }
149
+ if (href && (elementType === 'a' || elementType === 'area')) {
150
+ needsZeroTabIndex = false;
151
+ }
152
+ }
153
+ let tabIndexValue = tabIndex;
154
+ if (onClick && as && needsZeroTabIndex || isSafari() && as) {
155
+ tabIndexValue = tabIndex || 0;
156
+ }
157
+ return /*#__PURE__*/ _jsx(View, {
158
+ ...passthroughProps(props),
159
+ as: elementType,
160
+ focusColor: this.focusColor,
161
+ position: "relative",
162
+ display: display,
163
+ width: display === 'block' ? '100%' : 'auto',
164
+ borderRadius: shape === 'circle' ? 'circle' : 'medium',
165
+ background: "transparent",
166
+ padding: "none",
167
+ borderWidth: "none",
168
+ margin: margin,
169
+ cursor: isDisabled ? 'not-allowed' : cursor,
170
+ href: href,
171
+ rel: rel,
172
+ type: href ? undefined : type,
173
+ elementRef: this.handleElementRef,
174
+ onClick: this.handleClick,
175
+ onKeyDown: this.handleKeyDown,
176
+ role: onClick && as !== 'button' ? 'button' : undefined,
177
+ tabIndex: tabIndexValue,
178
+ disabled: isDisabled || isReadOnly,
179
+ css: styles?.baseButton,
180
+ withFocusOutline: withFocusOutline,
181
+ "data-cid": combineDataCid('BaseButton', this.props),
182
+ children: /*#__PURE__*/ _jsx("span", {
183
+ css: styles?.content,
184
+ children: this.renderChildren()
185
+ })
186
+ });
268
187
  }
269
- let tabIndexValue = tabIndex;
270
- // In Safari, a button cannot get focus unless it has an explicit 0 tabindex
271
- if (onClick && as && needsZeroTabIndex || isSafari() && as) {
272
- tabIndexValue = tabIndex || 0;
188
+ constructor(...args){
189
+ super(...args), this.ref = null, this.handleElementRef = (el)=>{
190
+ const { elementRef } = this.props;
191
+ this.ref = el;
192
+ if (typeof elementRef === 'function') {
193
+ elementRef(el);
194
+ }
195
+ }, this.handleClick = (event)=>{
196
+ const { onClick } = this.props;
197
+ const { interaction } = this;
198
+ if (interaction !== 'enabled') {
199
+ event.preventDefault();
200
+ event.stopPropagation();
201
+ return;
202
+ }
203
+ if (typeof onClick === 'function') {
204
+ onClick(event);
205
+ }
206
+ }, this.handleKeyDown = (event)=>{
207
+ const { onClick, onKeyDown, href } = this.props;
208
+ const { interaction } = this;
209
+ if (typeof onKeyDown === 'function') {
210
+ onKeyDown(event);
211
+ }
212
+ const { space, enter } = keycode.codes;
213
+ if (this.elementType !== 'button' && [
214
+ space,
215
+ enter
216
+ ].includes(event.keyCode)) {
217
+ event.preventDefault();
218
+ event.stopPropagation();
219
+ if (typeof onClick === 'function' && interaction === 'enabled') {
220
+ onClick(event);
221
+ }
222
+ if (href) {
223
+ this.ref && this.ref.click();
224
+ }
225
+ }
226
+ };
273
227
  }
274
- return _jsx(View, {
275
- ...passthroughProps(props),
276
- as: elementType,
277
- focusColor: this.focusColor,
278
- position: "relative",
279
- display: display,
280
- width: display === 'block' ? '100%' : 'auto',
281
- borderRadius: shape === 'circle' ? 'circle' : 'medium',
282
- background: "transparent",
283
- padding: "none",
284
- borderWidth: "none",
285
- margin: margin,
286
- cursor: isDisabled ? 'not-allowed' : cursor,
287
- href: href,
288
- rel: rel,
289
- type: href ? undefined : type,
290
- elementRef: this.handleElementRef,
291
- onClick: this.handleClick,
292
- onKeyDown: this.handleKeyDown,
293
- role: onClick && as !== 'button' ? 'button' : undefined,
294
- tabIndex: tabIndexValue,
295
- disabled: isDisabled || isReadOnly,
296
- css: styles?.baseButton,
297
- withFocusOutline: withFocusOutline,
298
- "data-cid": combineDataCid('BaseButton', this.props),
299
- children: _jsx("span", {
300
- css: styles?.content,
301
- children: this.renderChildren()
302
- })
303
- });
304
- }
305
- }) || _class);
228
+ }
229
+ const BaseButton = withStyle(generateStyles, generateComponentTheme)(BaseButtonBase);
306
230
  export { BaseButton };
307
- export default BaseButton;
231
+ export default BaseButton;
@@ -1,26 +1,24 @@
1
- /*
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2015 - present Instructure, Inc.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- const allowedProps = ['as', 'children', 'color', 'cursor', 'display', 'elementRef', 'focusColor', 'href', 'interaction', 'isCondensed', 'margin', 'onClick', 'onKeyDown', 'renderIcon', 'shape', 'size', 'tabIndex', 'textAlign', 'type', 'withBackground', 'withBorder'];
26
- export { allowedProps };
1
+ const allowedProps = [
2
+ 'as',
3
+ 'children',
4
+ 'color',
5
+ 'cursor',
6
+ 'display',
7
+ 'elementRef',
8
+ 'focusColor',
9
+ 'href',
10
+ 'interaction',
11
+ 'isCondensed',
12
+ 'margin',
13
+ 'onClick',
14
+ 'onKeyDown',
15
+ 'renderIcon',
16
+ 'shape',
17
+ 'size',
18
+ 'tabIndex',
19
+ 'textAlign',
20
+ 'type',
21
+ 'withBackground',
22
+ 'withBorder'
23
+ ];
24
+ export { allowedProps };