@instructure/ui-dialog 7.10.0 → 7.14.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
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
+ # [7.14.0](https://github.com/instructure/instructure-ui/compare/v7.13.0...v7.14.0) (2021-12-01)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-dialog
9
+
10
+ # [7.13.0](https://github.com/instructure/instructure-ui/compare/v7.12.0...v7.13.0) (2021-11-18)
11
+
12
+ ### Bug Fixes
13
+
14
+ - **ui-dialog,ui-drawer-layout:** fix Dialog role attribute ([f568377](https://github.com/instructure/instructure-ui/commit/f568377)), backports [#765](https://github.com/instructure/instructure-ui/issues/765)
15
+
16
+ # [7.12.0](https://github.com/instructure/instructure-ui/compare/v7.11.0...v7.12.0) (2021-10-15)
17
+
18
+ **Note:** Version bump only for package @instructure/ui-dialog
19
+
20
+ # [7.11.0](https://github.com/instructure/instructure-ui/compare/v7.10.0...v7.11.0) (2021-09-17)
21
+
22
+ **Note:** Version bump only for package @instructure/ui-dialog
23
+
6
24
  # [7.10.0](https://github.com/instructure/instructure-ui/compare/v7.9.0...v7.10.0) (2021-08-27)
7
25
 
8
26
  **Note:** Version bump only for package @instructure/ui-dialog
@@ -162,10 +162,13 @@ var Dialog = /*#__PURE__*/function (_Component) {
162
162
  }, {
163
163
  key: "render",
164
164
  value: function render() {
165
- var ElementType = getElementType(Dialog, this.props);
165
+ var ElementType = getElementType(Dialog, this.props); // In case the HTML role attribute is explicitly passed, use props.role
166
+
167
+ var role = this.props.role || (this.props.label ? 'dialog' : void 0); // eslint-disable-line react/prop-types
168
+
166
169
  return this.props.open ? /*#__PURE__*/React.createElement(ElementType, Object.assign({}, omitProps(this.props, Dialog.propTypes), {
167
170
  ref: this.getRef,
168
- role: this.props.label ? 'dialog' : null,
171
+ role: role,
169
172
  "aria-label": this.props.label,
170
173
  className: this.props.className // eslint-disable-line react/prop-types
171
174
 
@@ -182,10 +182,13 @@ var Dialog = /*#__PURE__*/function (_Component) {
182
182
  }, {
183
183
  key: "render",
184
184
  value: function render() {
185
- var ElementType = (0, _getElementType.getElementType)(Dialog, this.props);
185
+ var ElementType = (0, _getElementType.getElementType)(Dialog, this.props); // In case the HTML role attribute is explicitly passed, use props.role
186
+
187
+ var role = this.props.role || (this.props.label ? 'dialog' : void 0); // eslint-disable-line react/prop-types
188
+
186
189
  return this.props.open ? /*#__PURE__*/_react.default.createElement(ElementType, Object.assign({}, (0, _omitProps.omitProps)(this.props, Dialog.propTypes), {
187
190
  ref: this.getRef,
188
- role: this.props.label ? 'dialog' : null,
191
+ role: role,
189
192
  "aria-label": this.props.label,
190
193
  className: this.props.className // eslint-disable-line react/prop-types
191
194
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-dialog",
3
- "version": "7.10.0",
3
+ "version": "7.14.0",
4
4
  "description": "A utility component for managing keyboard accessibility and screen reader behavior",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -23,17 +23,17 @@
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
25
  "@babel/runtime": "^7.9.2",
26
- "@instructure/ui-a11y-utils": "^7.10.0",
27
- "@instructure/ui-dom-utils": "^7.10.0",
28
- "@instructure/ui-react-utils": "^7.10.0",
29
- "@instructure/ui-testable": "^7.10.0",
30
- "@instructure/ui-themeable": "^7.10.0",
26
+ "@instructure/ui-a11y-utils": "^7.14.0",
27
+ "@instructure/ui-dom-utils": "^7.14.0",
28
+ "@instructure/ui-react-utils": "^7.14.0",
29
+ "@instructure/ui-testable": "^7.14.0",
30
+ "@instructure/ui-themeable": "^7.14.0",
31
31
  "prop-types": "^15"
32
32
  },
33
33
  "devDependencies": {
34
- "@instructure/console": "^7.10.0",
35
- "@instructure/ui-babel-preset": "^7.10.0",
36
- "@instructure/ui-test-utils": "^7.10.0"
34
+ "@instructure/console": "^7.14.0",
35
+ "@instructure/ui-babel-preset": "^7.14.0",
36
+ "@instructure/ui-test-utils": "^7.14.0"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": "^16.8"
@@ -220,11 +220,15 @@ class Dialog extends Component {
220
220
 
221
221
  render() {
222
222
  const ElementType = getElementType(Dialog, this.props)
223
+
224
+ // In case the HTML role attribute is explicitly passed, use props.role
225
+ const role = this.props.role || (this.props.label ? 'dialog' : undefined) // eslint-disable-line react/prop-types
226
+
223
227
  return this.props.open ? (
224
228
  <ElementType
225
229
  {...omitProps(this.props, Dialog.propTypes)}
226
230
  ref={this.getRef}
227
- role={this.props.label ? 'dialog' : null}
231
+ role={role}
228
232
  aria-label={this.props.label}
229
233
  className={this.props.className} // eslint-disable-line react/prop-types
230
234
  >