@instructure/ui-dialog 7.12.0 → 7.15.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 +18 -0
- package/es/Dialog/index.js +5 -2
- package/lib/Dialog/index.js +5 -2
- package/package.json +9 -9
- package/src/Dialog/index.js +5 -1
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.15.0](https://github.com/instructure/instructure-ui/compare/v7.14.1...v7.15.0) (2022-02-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-dialog
|
|
9
|
+
|
|
10
|
+
## [7.14.1](https://github.com/instructure/instructure-ui/compare/v7.14.0...v7.14.1) (2021-12-06)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @instructure/ui-dialog
|
|
13
|
+
|
|
14
|
+
# [7.14.0](https://github.com/instructure/instructure-ui/compare/v7.13.0...v7.14.0) (2021-12-01)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @instructure/ui-dialog
|
|
17
|
+
|
|
18
|
+
# [7.13.0](https://github.com/instructure/instructure-ui/compare/v7.12.0...v7.13.0) (2021-11-18)
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
- **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)
|
|
23
|
+
|
|
6
24
|
# [7.12.0](https://github.com/instructure/instructure-ui/compare/v7.11.0...v7.12.0) (2021-10-15)
|
|
7
25
|
|
|
8
26
|
**Note:** Version bump only for package @instructure/ui-dialog
|
package/es/Dialog/index.js
CHANGED
|
@@ -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:
|
|
171
|
+
role: role,
|
|
169
172
|
"aria-label": this.props.label,
|
|
170
173
|
className: this.props.className // eslint-disable-line react/prop-types
|
|
171
174
|
|
package/lib/Dialog/index.js
CHANGED
|
@@ -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:
|
|
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.
|
|
3
|
+
"version": "7.15.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.
|
|
27
|
-
"@instructure/ui-dom-utils": "^7.
|
|
28
|
-
"@instructure/ui-react-utils": "^7.
|
|
29
|
-
"@instructure/ui-testable": "^7.
|
|
30
|
-
"@instructure/ui-themeable": "^7.
|
|
26
|
+
"@instructure/ui-a11y-utils": "^7.15.0",
|
|
27
|
+
"@instructure/ui-dom-utils": "^7.15.0",
|
|
28
|
+
"@instructure/ui-react-utils": "^7.15.0",
|
|
29
|
+
"@instructure/ui-testable": "^7.15.0",
|
|
30
|
+
"@instructure/ui-themeable": "^7.15.0",
|
|
31
31
|
"prop-types": "^15"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@instructure/console": "^7.
|
|
35
|
-
"@instructure/ui-babel-preset": "^7.
|
|
36
|
-
"@instructure/ui-test-utils": "^7.
|
|
34
|
+
"@instructure/console": "^7.15.0",
|
|
35
|
+
"@instructure/ui-babel-preset": "^7.15.0",
|
|
36
|
+
"@instructure/ui-test-utils": "^7.15.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": "^16.8"
|
package/src/Dialog/index.js
CHANGED
|
@@ -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={
|
|
231
|
+
role={role}
|
|
228
232
|
aria-label={this.props.label}
|
|
229
233
|
className={this.props.className} // eslint-disable-line react/prop-types
|
|
230
234
|
>
|