@instructure/ui-buttons 10.19.2-snapshot-9 → 10.19.2-snapshot-11

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,13 +3,14 @@
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.19.2-snapshot-9](https://github.com/instructure/instructure-ui/compare/v10.19.1...v10.19.2-snapshot-9) (2025-06-13)
6
+ ## [10.19.2-snapshot-11](https://github.com/instructure/instructure-ui/compare/v10.19.1...v10.19.2-snapshot-11) (2025-06-13)
7
7
 
8
8
 
9
9
  ### Bug Fixes
10
10
 
11
11
  * **many:** update dependencies, browsersdb and moment timezone database ([3813636](https://github.com/instructure/instructure-ui/commit/3813636458c901ad4bc74a4d5ae015cb55defcb2))
12
12
  * **ui-buttons:** make Button have a focus ring in Safari ([54118ac](https://github.com/instructure/instructure-ui/commit/54118ac22f3745c7b34f4da9d1c857951c63f8df))
13
+ * **ui-buttons:** remove underline from disabled Button with href ([90e8ce7](https://github.com/instructure/instructure-ui/commit/90e8ce710faf7d71b0a8cbd28940a89d3aa7f065))
13
14
 
14
15
 
15
16
 
@@ -103,7 +103,8 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
103
103
  get makeStylesVariables() {
104
104
  return {
105
105
  isDisabled: this.isDisabled,
106
- hasOnlyIconVisible: this.hasOnlyIconVisible
106
+ hasOnlyIconVisible: this.hasOnlyIconVisible,
107
+ isEnabled: this.isEnabled
107
108
  };
108
109
  }
109
110
  get hasOnlyIconVisible() {
@@ -213,7 +214,6 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
213
214
  withFocusOutline = _this$props7.withFocusOutline,
214
215
  props = _objectWithoutProperties(_this$props7, _excluded);
215
216
  const isDisabled = this.isDisabled,
216
- isEnabled = this.isEnabled,
217
217
  isReadOnly = this.isReadOnly,
218
218
  elementType = this.elementType;
219
219
  // only add 0 tabIndex value if it doesn't have it by default, see
@@ -253,7 +253,7 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
253
253
  role: onClick && as !== 'button' ? 'button' : void 0,
254
254
  tabIndex: tabIndexValue,
255
255
  disabled: isDisabled || isReadOnly,
256
- css: isEnabled ? styles === null || styles === void 0 ? void 0 : styles.baseButton : null,
256
+ css: styles === null || styles === void 0 ? void 0 : styles.baseButton,
257
257
  focusRingBorderRadius: String(styles === null || styles === void 0 ? void 0 : (_styles$content = styles.content) === null || _styles$content === void 0 ? void 0 : _styles$content.borderRadius),
258
258
  withFocusOutline: withFocusOutline,
259
259
  children: _jsx("span", {
@@ -43,7 +43,8 @@ const generateStyle = (componentTheme, props, state) => {
43
43
  withBorder = props.withBorder,
44
44
  isCondensed = props.isCondensed;
45
45
  const isDisabled = state.isDisabled,
46
- hasOnlyIconVisible = state.hasOnlyIconVisible;
46
+ hasOnlyIconVisible = state.hasOnlyIconVisible,
47
+ isEnabled = state.isEnabled;
47
48
  const shapeVariants = {
48
49
  circle: {
49
50
  borderRadius: '50%'
@@ -320,7 +321,7 @@ const generateStyle = (componentTheme, props, state) => {
320
321
  }
321
322
  };
322
323
  return {
323
- baseButton: {
324
+ baseButton: isEnabled ? {
324
325
  label: 'baseButton',
325
326
  appearance: 'none',
326
327
  textDecoration: 'none' /* for links styled as buttons */,
@@ -336,6 +337,10 @@ const generateStyle = (componentTheme, props, state) => {
336
337
  },
337
338
  '&:active > [class$=-baseButton__content]': colorVariants[color].active,
338
339
  '&:hover > [class$=-baseButton__content]': colorVariants[color].hover
340
+ } : {
341
+ textDecoration: 'none',
342
+ label: 'baseButton',
343
+ appearance: 'none'
339
344
  },
340
345
  content: {
341
346
  label: 'baseButton__content',
@@ -112,7 +112,8 @@ let BaseButton = exports.BaseButton = (_dec = (0, _emotion.withStyle)(_styles.de
112
112
  get makeStylesVariables() {
113
113
  return {
114
114
  isDisabled: this.isDisabled,
115
- hasOnlyIconVisible: this.hasOnlyIconVisible
115
+ hasOnlyIconVisible: this.hasOnlyIconVisible,
116
+ isEnabled: this.isEnabled
116
117
  };
117
118
  }
118
119
  get hasOnlyIconVisible() {
@@ -222,7 +223,6 @@ let BaseButton = exports.BaseButton = (_dec = (0, _emotion.withStyle)(_styles.de
222
223
  withFocusOutline = _this$props7.withFocusOutline,
223
224
  props = (0, _objectWithoutProperties2.default)(_this$props7, _excluded);
224
225
  const isDisabled = this.isDisabled,
225
- isEnabled = this.isEnabled,
226
226
  isReadOnly = this.isReadOnly,
227
227
  elementType = this.elementType;
228
228
  // only add 0 tabIndex value if it doesn't have it by default, see
@@ -262,7 +262,7 @@ let BaseButton = exports.BaseButton = (_dec = (0, _emotion.withStyle)(_styles.de
262
262
  role: onClick && as !== 'button' ? 'button' : void 0,
263
263
  tabIndex: tabIndexValue,
264
264
  disabled: isDisabled || isReadOnly,
265
- css: isEnabled ? styles === null || styles === void 0 ? void 0 : styles.baseButton : null,
265
+ css: styles === null || styles === void 0 ? void 0 : styles.baseButton,
266
266
  focusRingBorderRadius: String(styles === null || styles === void 0 ? void 0 : (_styles$content = styles.content) === null || _styles$content === void 0 ? void 0 : _styles$content.borderRadius),
267
267
  withFocusOutline: withFocusOutline,
268
268
  children: (0, _jsxRuntime.jsx)("span", {
@@ -49,7 +49,8 @@ const generateStyle = (componentTheme, props, state) => {
49
49
  withBorder = props.withBorder,
50
50
  isCondensed = props.isCondensed;
51
51
  const isDisabled = state.isDisabled,
52
- hasOnlyIconVisible = state.hasOnlyIconVisible;
52
+ hasOnlyIconVisible = state.hasOnlyIconVisible,
53
+ isEnabled = state.isEnabled;
53
54
  const shapeVariants = {
54
55
  circle: {
55
56
  borderRadius: '50%'
@@ -326,7 +327,7 @@ const generateStyle = (componentTheme, props, state) => {
326
327
  }
327
328
  };
328
329
  return {
329
- baseButton: {
330
+ baseButton: isEnabled ? {
330
331
  label: 'baseButton',
331
332
  appearance: 'none',
332
333
  textDecoration: 'none' /* for links styled as buttons */,
@@ -342,6 +343,10 @@ const generateStyle = (componentTheme, props, state) => {
342
343
  },
343
344
  '&:active > [class$=-baseButton__content]': colorVariants[color].active,
344
345
  '&:hover > [class$=-baseButton__content]': colorVariants[color].hover
346
+ } : {
347
+ textDecoration: 'none',
348
+ label: 'baseButton',
349
+ appearance: 'none'
345
350
  },
346
351
  content: {
347
352
  label: 'baseButton__content',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-buttons",
3
- "version": "10.19.2-snapshot-9",
3
+ "version": "10.19.2-snapshot-11",
4
4
  "description": "Accessible button components",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,10 +23,10 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-axe-check": "10.19.2-snapshot-9",
27
- "@instructure/ui-babel-preset": "10.19.2-snapshot-9",
28
- "@instructure/ui-test-utils": "10.19.2-snapshot-9",
29
- "@instructure/ui-themes": "10.19.2-snapshot-9",
26
+ "@instructure/ui-axe-check": "10.19.2-snapshot-11",
27
+ "@instructure/ui-babel-preset": "10.19.2-snapshot-11",
28
+ "@instructure/ui-test-utils": "10.19.2-snapshot-11",
29
+ "@instructure/ui-themes": "10.19.2-snapshot-11",
30
30
  "@testing-library/jest-dom": "^6.6.3",
31
31
  "@testing-library/react": "^16.0.1",
32
32
  "@testing-library/user-event": "^14.6.1",
@@ -34,21 +34,21 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@babel/runtime": "^7.27.6",
37
- "@instructure/console": "10.19.2-snapshot-9",
38
- "@instructure/emotion": "10.19.2-snapshot-9",
39
- "@instructure/shared-types": "10.19.2-snapshot-9",
40
- "@instructure/ui-a11y-content": "10.19.2-snapshot-9",
41
- "@instructure/ui-a11y-utils": "10.19.2-snapshot-9",
42
- "@instructure/ui-color-utils": "10.19.2-snapshot-9",
43
- "@instructure/ui-dom-utils": "10.19.2-snapshot-9",
44
- "@instructure/ui-icons": "10.19.2-snapshot-9",
45
- "@instructure/ui-position": "10.19.2-snapshot-9",
46
- "@instructure/ui-prop-types": "10.19.2-snapshot-9",
47
- "@instructure/ui-react-utils": "10.19.2-snapshot-9",
48
- "@instructure/ui-testable": "10.19.2-snapshot-9",
49
- "@instructure/ui-tooltip": "10.19.2-snapshot-9",
50
- "@instructure/ui-utils": "10.19.2-snapshot-9",
51
- "@instructure/ui-view": "10.19.2-snapshot-9",
37
+ "@instructure/console": "10.19.2-snapshot-11",
38
+ "@instructure/emotion": "10.19.2-snapshot-11",
39
+ "@instructure/shared-types": "10.19.2-snapshot-11",
40
+ "@instructure/ui-a11y-content": "10.19.2-snapshot-11",
41
+ "@instructure/ui-a11y-utils": "10.19.2-snapshot-11",
42
+ "@instructure/ui-color-utils": "10.19.2-snapshot-11",
43
+ "@instructure/ui-dom-utils": "10.19.2-snapshot-11",
44
+ "@instructure/ui-icons": "10.19.2-snapshot-11",
45
+ "@instructure/ui-position": "10.19.2-snapshot-11",
46
+ "@instructure/ui-prop-types": "10.19.2-snapshot-11",
47
+ "@instructure/ui-react-utils": "10.19.2-snapshot-11",
48
+ "@instructure/ui-testable": "10.19.2-snapshot-11",
49
+ "@instructure/ui-tooltip": "10.19.2-snapshot-11",
50
+ "@instructure/ui-utils": "10.19.2-snapshot-11",
51
+ "@instructure/ui-view": "10.19.2-snapshot-11",
52
52
  "keycode": "^2",
53
53
  "prop-types": "^15.8.1"
54
54
  },
@@ -89,7 +89,8 @@ class BaseButton extends Component<BaseButtonProps> {
89
89
  get makeStylesVariables(): BaseButtonStyleProps {
90
90
  return {
91
91
  isDisabled: this.isDisabled,
92
- hasOnlyIconVisible: this.hasOnlyIconVisible
92
+ hasOnlyIconVisible: this.hasOnlyIconVisible,
93
+ isEnabled: this.isEnabled
93
94
  }
94
95
  }
95
96
 
@@ -256,7 +257,7 @@ class BaseButton extends Component<BaseButtonProps> {
256
257
  ...props
257
258
  } = this.props
258
259
 
259
- const { isDisabled, isEnabled, isReadOnly, elementType } = this
260
+ const { isDisabled, isReadOnly, elementType } = this
260
261
  // only add 0 tabIndex value if it doesn't have it by default, see
261
262
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex
262
263
  let needsZeroTabIndex = true
@@ -306,7 +307,7 @@ class BaseButton extends Component<BaseButtonProps> {
306
307
  role={onClick && as !== 'button' ? 'button' : undefined}
307
308
  tabIndex={tabIndexValue}
308
309
  disabled={isDisabled || isReadOnly}
309
- css={isEnabled ? styles?.baseButton : null}
310
+ css={styles?.baseButton}
310
311
  focusRingBorderRadius={String(
311
312
  (styles?.content as { borderRadius?: string | number })?.borderRadius
312
313
  )}
@@ -174,6 +174,7 @@ type BaseButtonOwnProps = {
174
174
  type BaseButtonStyleProps = {
175
175
  isDisabled: boolean
176
176
  hasOnlyIconVisible: boolean
177
+ isEnabled: boolean
177
178
  }
178
179
 
179
180
  type PropKeys = keyof BaseButtonOwnProps
@@ -56,7 +56,7 @@ const generateStyle = (
56
56
  isCondensed
57
57
  } = props
58
58
 
59
- const { isDisabled, hasOnlyIconVisible } = state
59
+ const { isDisabled, hasOnlyIconVisible, isEnabled } = state
60
60
 
61
61
  const shapeVariants = {
62
62
  circle: { borderRadius: '50%' },
@@ -401,26 +401,32 @@ const generateStyle = (
401
401
  }
402
402
 
403
403
  return {
404
- baseButton: {
405
- label: 'baseButton',
406
- appearance: 'none',
407
- textDecoration: 'none' /* for links styled as buttons */,
408
- touchAction: 'manipulation',
409
-
410
- '&::-moz-focus-inner': {
411
- border: '0' /* removes default dotted focus outline in Firefox */
412
- },
413
- '*': {
414
- pointerEvents:
415
- 'none' /* Ensures that button or link is always the event target */
416
- },
417
- '&:focus': {
418
- textDecoration: 'none'
419
- },
420
- '&:active > [class$=-baseButton__content]': colorVariants[color!].active,
421
- '&:hover > [class$=-baseButton__content]': colorVariants[color!].hover
422
- },
404
+ baseButton: isEnabled
405
+ ? {
406
+ label: 'baseButton',
407
+ appearance: 'none',
408
+ textDecoration: 'none' /* for links styled as buttons */,
409
+ touchAction: 'manipulation',
423
410
 
411
+ '&::-moz-focus-inner': {
412
+ border: '0' /* removes default dotted focus outline in Firefox */
413
+ },
414
+ '*': {
415
+ pointerEvents:
416
+ 'none' /* Ensures that button or link is always the event target */
417
+ },
418
+ '&:focus': {
419
+ textDecoration: 'none'
420
+ },
421
+ '&:active > [class$=-baseButton__content]':
422
+ colorVariants[color!].active,
423
+ '&:hover > [class$=-baseButton__content]': colorVariants[color!].hover
424
+ }
425
+ : {
426
+ textDecoration: 'none',
427
+ label: 'baseButton',
428
+ appearance: 'none'
429
+ },
424
430
  content: {
425
431
  label: 'baseButton__content',
426
432
  boxSizing: 'border-box',