@instructure/ui-buttons 10.18.1 → 10.18.2-snapshot-1
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 +11 -0
- package/es/BaseButton/index.js +3 -1
- package/es/BaseButton/props.js +2 -1
- package/lib/BaseButton/index.js +3 -1
- package/lib/BaseButton/props.js +2 -1
- package/package.json +20 -20
- package/src/BaseButton/index.tsx +2 -0
- package/src/BaseButton/props.ts +10 -2
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/BaseButton/index.d.ts.map +1 -1
- package/types/BaseButton/props.d.ts +7 -1
- package/types/BaseButton/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.18.2-snapshot-1](https://github.com/instructure/instructure-ui/compare/v10.18.1...v10.18.2-snapshot-1) (2025-06-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **ui-top-nav-bar,ui-buttons:** display a focus ring in TopNavBar if a button has a Popover open ([1a03763](https://github.com/instructure/instructure-ui/commit/1a03763f99db390ec6cea58a71ef118930be64d8))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [10.18.1](https://github.com/instructure/instructure-ui/compare/v10.18.0...v10.18.1) (2025-05-29)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @instructure/ui-buttons
|
package/es/BaseButton/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
const _excluded = ["type", "size", "elementRef", "as", "href", "color", "focusColor", "textAlign", "shape", "display", "withBackground", "withBorder", "isCondensed", "margin", "cursor", "onClick", "renderIcon", "tabIndex", "styles", "makeStyles"];
|
|
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
3
|
var _dec, _dec2, _class, _BaseButton;
|
|
4
4
|
/*
|
|
5
5
|
* The MIT License (MIT)
|
|
@@ -209,6 +209,7 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
|
|
|
209
209
|
tabIndex = _this$props7.tabIndex,
|
|
210
210
|
styles = _this$props7.styles,
|
|
211
211
|
makeStyles = _this$props7.makeStyles,
|
|
212
|
+
withFocusOutline = _this$props7.withFocusOutline,
|
|
212
213
|
props = _objectWithoutProperties(_this$props7, _excluded);
|
|
213
214
|
const isDisabled = this.isDisabled,
|
|
214
215
|
isEnabled = this.isEnabled,
|
|
@@ -252,6 +253,7 @@ let BaseButton = (_dec = withStyle(generateStyles, generateComponentTheme), _dec
|
|
|
252
253
|
disabled: isDisabled || isReadOnly,
|
|
253
254
|
css: isEnabled ? styles === null || styles === void 0 ? void 0 : styles.baseButton : null,
|
|
254
255
|
focusRingBorderRadius: String(styles === null || styles === void 0 ? void 0 : (_styles$content = styles.content) === null || _styles$content === void 0 ? void 0 : _styles$content.borderRadius),
|
|
256
|
+
withFocusOutline: withFocusOutline,
|
|
255
257
|
children: _jsx("span", {
|
|
256
258
|
css: styles === null || styles === void 0 ? void 0 : styles.content,
|
|
257
259
|
children: this.renderChildren()
|
package/es/BaseButton/props.js
CHANGED
|
@@ -44,7 +44,8 @@ const propTypes = {
|
|
|
44
44
|
onClick: PropTypes.func,
|
|
45
45
|
onKeyDown: PropTypes.func,
|
|
46
46
|
renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
47
|
-
tabIndex: PropTypes.number
|
|
47
|
+
tabIndex: PropTypes.number,
|
|
48
|
+
withFocusOutline: PropTypes.bool
|
|
48
49
|
};
|
|
49
50
|
const allowedProps = ['as', 'children', 'color', 'cursor', 'display', 'elementRef', 'focusColor', 'href', 'interaction', 'isCondensed', 'margin', 'onClick', 'onKeyDown', 'renderIcon', 'shape', 'size', 'tabIndex', 'textAlign', 'type', 'withBackground', 'withBorder'];
|
|
50
51
|
export { propTypes, allowedProps };
|
package/lib/BaseButton/index.js
CHANGED
|
@@ -21,7 +21,7 @@ var _styles = _interopRequireDefault(require("./styles"));
|
|
|
21
21
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
22
22
|
var _props = require("./props");
|
|
23
23
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
24
|
-
const _excluded = ["type", "size", "elementRef", "as", "href", "color", "focusColor", "textAlign", "shape", "display", "withBackground", "withBorder", "isCondensed", "margin", "cursor", "onClick", "renderIcon", "tabIndex", "styles", "makeStyles"];
|
|
24
|
+
const _excluded = ["type", "size", "elementRef", "as", "href", "color", "focusColor", "textAlign", "shape", "display", "withBackground", "withBorder", "isCondensed", "margin", "cursor", "onClick", "renderIcon", "tabIndex", "styles", "makeStyles", "withFocusOutline"];
|
|
25
25
|
var _dec, _dec2, _class, _BaseButton;
|
|
26
26
|
/*
|
|
27
27
|
* The MIT License (MIT)
|
|
@@ -218,6 +218,7 @@ let BaseButton = exports.BaseButton = (_dec = (0, _emotion.withStyle)(_styles.de
|
|
|
218
218
|
tabIndex = _this$props7.tabIndex,
|
|
219
219
|
styles = _this$props7.styles,
|
|
220
220
|
makeStyles = _this$props7.makeStyles,
|
|
221
|
+
withFocusOutline = _this$props7.withFocusOutline,
|
|
221
222
|
props = (0, _objectWithoutProperties2.default)(_this$props7, _excluded);
|
|
222
223
|
const isDisabled = this.isDisabled,
|
|
223
224
|
isEnabled = this.isEnabled,
|
|
@@ -261,6 +262,7 @@ let BaseButton = exports.BaseButton = (_dec = (0, _emotion.withStyle)(_styles.de
|
|
|
261
262
|
disabled: isDisabled || isReadOnly,
|
|
262
263
|
css: isEnabled ? styles === null || styles === void 0 ? void 0 : styles.baseButton : null,
|
|
263
264
|
focusRingBorderRadius: String(styles === null || styles === void 0 ? void 0 : (_styles$content = styles.content) === null || _styles$content === void 0 ? void 0 : _styles$content.borderRadius),
|
|
265
|
+
withFocusOutline: withFocusOutline,
|
|
264
266
|
children: (0, _jsxRuntime.jsx)("span", {
|
|
265
267
|
css: styles === null || styles === void 0 ? void 0 : styles.content,
|
|
266
268
|
children: this.renderChildren()
|
package/lib/BaseButton/props.js
CHANGED
|
@@ -51,6 +51,7 @@ const propTypes = exports.propTypes = {
|
|
|
51
51
|
onClick: _propTypes.default.func,
|
|
52
52
|
onKeyDown: _propTypes.default.func,
|
|
53
53
|
renderIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
54
|
-
tabIndex: _propTypes.default.number
|
|
54
|
+
tabIndex: _propTypes.default.number,
|
|
55
|
+
withFocusOutline: _propTypes.default.bool
|
|
55
56
|
};
|
|
56
57
|
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'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-buttons",
|
|
3
|
-
"version": "10.18.1",
|
|
3
|
+
"version": "10.18.2-snapshot-1",
|
|
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.18.1",
|
|
27
|
-
"@instructure/ui-babel-preset": "10.18.1",
|
|
28
|
-
"@instructure/ui-test-utils": "10.18.1",
|
|
29
|
-
"@instructure/ui-themes": "10.18.1",
|
|
26
|
+
"@instructure/ui-axe-check": "10.18.2-snapshot-1",
|
|
27
|
+
"@instructure/ui-babel-preset": "10.18.2-snapshot-1",
|
|
28
|
+
"@instructure/ui-test-utils": "10.18.2-snapshot-1",
|
|
29
|
+
"@instructure/ui-themes": "10.18.2-snapshot-1",
|
|
30
30
|
"@testing-library/jest-dom": "^6.6.3",
|
|
31
31
|
"@testing-library/react": "^16.0.1",
|
|
32
32
|
"@testing-library/user-event": "^14.5.2",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/runtime": "^7.26.0",
|
|
37
|
-
"@instructure/console": "10.18.1",
|
|
38
|
-
"@instructure/emotion": "10.18.1",
|
|
39
|
-
"@instructure/shared-types": "10.18.1",
|
|
40
|
-
"@instructure/ui-a11y-content": "10.18.1",
|
|
41
|
-
"@instructure/ui-a11y-utils": "10.18.1",
|
|
42
|
-
"@instructure/ui-color-utils": "10.18.1",
|
|
43
|
-
"@instructure/ui-dom-utils": "10.18.1",
|
|
44
|
-
"@instructure/ui-icons": "10.18.1",
|
|
45
|
-
"@instructure/ui-position": "10.18.1",
|
|
46
|
-
"@instructure/ui-prop-types": "10.18.1",
|
|
47
|
-
"@instructure/ui-react-utils": "10.18.1",
|
|
48
|
-
"@instructure/ui-testable": "10.18.1",
|
|
49
|
-
"@instructure/ui-tooltip": "10.18.1",
|
|
50
|
-
"@instructure/ui-utils": "10.18.1",
|
|
51
|
-
"@instructure/ui-view": "10.18.1",
|
|
37
|
+
"@instructure/console": "10.18.2-snapshot-1",
|
|
38
|
+
"@instructure/emotion": "10.18.2-snapshot-1",
|
|
39
|
+
"@instructure/shared-types": "10.18.2-snapshot-1",
|
|
40
|
+
"@instructure/ui-a11y-content": "10.18.2-snapshot-1",
|
|
41
|
+
"@instructure/ui-a11y-utils": "10.18.2-snapshot-1",
|
|
42
|
+
"@instructure/ui-color-utils": "10.18.2-snapshot-1",
|
|
43
|
+
"@instructure/ui-dom-utils": "10.18.2-snapshot-1",
|
|
44
|
+
"@instructure/ui-icons": "10.18.2-snapshot-1",
|
|
45
|
+
"@instructure/ui-position": "10.18.2-snapshot-1",
|
|
46
|
+
"@instructure/ui-prop-types": "10.18.2-snapshot-1",
|
|
47
|
+
"@instructure/ui-react-utils": "10.18.2-snapshot-1",
|
|
48
|
+
"@instructure/ui-testable": "10.18.2-snapshot-1",
|
|
49
|
+
"@instructure/ui-tooltip": "10.18.2-snapshot-1",
|
|
50
|
+
"@instructure/ui-utils": "10.18.2-snapshot-1",
|
|
51
|
+
"@instructure/ui-view": "10.18.2-snapshot-1",
|
|
52
52
|
"keycode": "^2",
|
|
53
53
|
"prop-types": "^15.8.1"
|
|
54
54
|
},
|
package/src/BaseButton/index.tsx
CHANGED
|
@@ -251,6 +251,7 @@ class BaseButton extends Component<BaseButtonProps> {
|
|
|
251
251
|
tabIndex,
|
|
252
252
|
styles,
|
|
253
253
|
makeStyles,
|
|
254
|
+
withFocusOutline,
|
|
254
255
|
...props
|
|
255
256
|
} = this.props
|
|
256
257
|
|
|
@@ -307,6 +308,7 @@ class BaseButton extends Component<BaseButtonProps> {
|
|
|
307
308
|
focusRingBorderRadius={String(
|
|
308
309
|
(styles?.content as { borderRadius?: string | number })?.borderRadius
|
|
309
310
|
)}
|
|
311
|
+
withFocusOutline={withFocusOutline}
|
|
310
312
|
>
|
|
311
313
|
<span css={styles?.content}>{this.renderChildren()}</span>
|
|
312
314
|
</View>
|
package/src/BaseButton/props.ts
CHANGED
|
@@ -159,9 +159,16 @@ type BaseButtonOwnProps = {
|
|
|
159
159
|
|
|
160
160
|
/**
|
|
161
161
|
* Specifies the tabindex of the `Button`.
|
|
162
|
-
*
|
|
163
162
|
*/
|
|
164
163
|
tabIndex?: number
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Manually control if the `Button` should display a focus outline.
|
|
167
|
+
*
|
|
168
|
+
* When left `undefined` (which is the default) the focus outline will display
|
|
169
|
+
* if this component is focusable and receives focus.
|
|
170
|
+
*/
|
|
171
|
+
withFocusOutline?: boolean
|
|
165
172
|
}
|
|
166
173
|
|
|
167
174
|
type BaseButtonStyleProps = {
|
|
@@ -218,7 +225,8 @@ const propTypes: PropValidators<PropKeys> = {
|
|
|
218
225
|
onClick: PropTypes.func,
|
|
219
226
|
onKeyDown: PropTypes.func,
|
|
220
227
|
renderIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
221
|
-
tabIndex: PropTypes.number
|
|
228
|
+
tabIndex: PropTypes.number,
|
|
229
|
+
withFocusOutline: PropTypes.bool
|
|
222
230
|
}
|
|
223
231
|
|
|
224
232
|
const allowedProps: AllowedPropKeys = [
|