@instructure/ui-dialog 8.11.1-snapshot.0 → 8.11.2-snapshot.15

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,10 @@
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
+ ## [8.11.1](https://github.com/instructure/instructure-ui/compare/v8.11.0...v8.11.1) (2021-10-19)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-dialog
9
+
6
10
  # [8.11.0](https://github.com/instructure/instructure-ui/compare/v8.10.2...v8.11.0) (2021-10-15)
7
11
 
8
12
  **Note:** Version bump only for package @instructure/ui-dialog
@@ -152,9 +152,11 @@ class Dialog extends Component {
152
152
  }
153
153
 
154
154
  render() {
155
- const ElementType = getElementType(Dialog, this.props);
155
+ const ElementType = getElementType(Dialog, this.props); // In case the HTML role attribute is explicitly passed, use props.role
156
+
157
+ const role = this.props.role || (this.props.label ? 'dialog' : void 0);
156
158
  return this.props.open ? /*#__PURE__*/React.createElement(ElementType, Object.assign({}, omitProps(this.props, Dialog.allowedProps), {
157
- role: this.props.label ? 'dialog' : void 0,
159
+ role: role,
158
160
  "aria-label": this.props.label,
159
161
  className: this.props.className // eslint-disable-line react/prop-types
160
162
  ,
@@ -150,9 +150,11 @@ class Dialog extends _react.Component {
150
150
  }
151
151
 
152
152
  render() {
153
- const ElementType = (0, _getElementType.getElementType)(Dialog, this.props);
153
+ const ElementType = (0, _getElementType.getElementType)(Dialog, this.props); // In case the HTML role attribute is explicitly passed, use props.role
154
+
155
+ const role = this.props.role || (this.props.label ? 'dialog' : void 0);
154
156
  return this.props.open ? /*#__PURE__*/_react.default.createElement(ElementType, Object.assign({}, (0, _omitProps.omitProps)(this.props, Dialog.allowedProps), {
155
- role: this.props.label ? 'dialog' : void 0,
157
+ role: role,
156
158
  "aria-label": this.props.label,
157
159
  className: this.props.className // eslint-disable-line react/prop-types
158
160
  ,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-dialog",
3
- "version": "8.11.1-snapshot.0+8536a1c9b",
3
+ "version": "8.11.2-snapshot.15+4f855a7cf",
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",
@@ -25,18 +25,18 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/shared-types": "8.11.1-snapshot.0+8536a1c9b",
29
- "@instructure/ui-a11y-utils": "8.11.1-snapshot.0+8536a1c9b",
30
- "@instructure/ui-dom-utils": "8.11.1-snapshot.0+8536a1c9b",
31
- "@instructure/ui-react-utils": "8.11.1-snapshot.0+8536a1c9b",
32
- "@instructure/ui-testable": "8.11.1-snapshot.0+8536a1c9b",
28
+ "@instructure/shared-types": "8.11.2-snapshot.15+4f855a7cf",
29
+ "@instructure/ui-a11y-utils": "8.11.2-snapshot.15+4f855a7cf",
30
+ "@instructure/ui-dom-utils": "8.11.2-snapshot.15+4f855a7cf",
31
+ "@instructure/ui-react-utils": "8.11.2-snapshot.15+4f855a7cf",
32
+ "@instructure/ui-testable": "8.11.2-snapshot.15+4f855a7cf",
33
33
  "prop-types": "^15"
34
34
  },
35
35
  "devDependencies": {
36
- "@instructure/console": "8.11.1-snapshot.0+8536a1c9b",
37
- "@instructure/ui-babel-preset": "8.11.1-snapshot.0+8536a1c9b",
38
- "@instructure/ui-prop-types": "8.11.1-snapshot.0+8536a1c9b",
39
- "@instructure/ui-test-utils": "8.11.1-snapshot.0+8536a1c9b"
36
+ "@instructure/console": "8.11.2-snapshot.15+4f855a7cf",
37
+ "@instructure/ui-babel-preset": "8.11.2-snapshot.15+4f855a7cf",
38
+ "@instructure/ui-prop-types": "8.11.2-snapshot.15+4f855a7cf",
39
+ "@instructure/ui-test-utils": "8.11.2-snapshot.15+4f855a7cf"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=16.8 <=17"
@@ -45,5 +45,5 @@
45
45
  "access": "public"
46
46
  },
47
47
  "sideEffects": false,
48
- "gitHead": "8536a1c9badcd8c1d2ce55dfb462d1899e3ca500"
48
+ "gitHead": "4f855a7cfb0f347bca6a71b18be9504447ba768f"
49
49
  }
@@ -188,11 +188,14 @@ class Dialog extends Component<DialogProps> {
188
188
  render() {
189
189
  const ElementType = getElementType(Dialog, this.props)
190
190
 
191
+ // In case the HTML role attribute is explicitly passed, use props.role
192
+ const role = this.props.role || (this.props.label ? 'dialog' : undefined)
193
+
191
194
  return this.props.open ? (
192
195
  <ElementType
193
196
  // @ts-expect-error TODO: `ref` prop causes: "Expression produces a union type that is too complex to represent.ts(2590)"
194
197
  {...omitProps(this.props, Dialog.allowedProps)}
195
- role={this.props.label ? 'dialog' : undefined}
198
+ role={role}
196
199
  aria-label={this.props.label}
197
200
  className={this.props.className} // eslint-disable-line react/prop-types
198
201
  ref={this.getRef}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Dialog/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIxC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAK1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;GAKG;AAEH,cAAM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;;;;;MAeT;IAEV,SAAS,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,EAAE,CAAK;IAC/C,IAAI,EAAE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