@instructure/ui-dialog 11.6.0 → 11.6.1-pr-snapshot-1779894247159

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,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
+ ## [11.6.1-pr-snapshot-1779894247159](https://github.com/instructure/instructure-ui/compare/v11.6.0...v11.6.1-pr-snapshot-1779894247159) (2026-05-27)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-dialog
9
+
10
+
11
+
12
+
13
+
6
14
  # [11.6.0](https://github.com/instructure/instructure-ui/compare/v11.5.0...v11.6.0) (2026-02-18)
7
15
 
8
16
  **Note:** Version bump only for package @instructure/ui-dialog
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.allowedProps = void 0;
7
1
  /*
8
2
  * The MIT License (MIT)
9
3
  *
@@ -28,4 +22,16 @@ exports.allowedProps = void 0;
28
22
  * SOFTWARE.
29
23
  */
30
24
 
31
- const allowedProps = exports.allowedProps = ['children', 'as', 'display', 'label', 'open', 'onBlur', 'onDismiss', 'defaultFocusElement', 'contentElement', 'liveRegion', 'shouldContainFocus', 'shouldReturnFocus', 'shouldCloseOnDocumentClick', 'shouldCloseOnEscape', 'shouldFocusOnOpen', 'elementRef'];
25
+ module.exports = {
26
+ presets: [
27
+ [
28
+ require('@instructure/ui-babel-preset'),
29
+ {
30
+ coverage: Boolean(process.env.COVERAGE),
31
+ esModules: Boolean(process.env.ES_MODULES),
32
+ removeConsole: process.env.NODE_ENV === 'production',
33
+ transformImports: Boolean(process.env.TRANSFORM_IMPORTS)
34
+ }
35
+ ]
36
+ ]
37
+ }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@instructure/ui-dialog",
3
- "version": "11.6.0",
3
+ "version": "11.6.1-pr-snapshot-1779894247159",
4
+ "type": "module",
4
5
  "description": "A utility component for managing keyboard accessibility and screen reader behavior",
5
6
  "author": "Instructure, Inc. Engineering and Product Design",
6
7
  "module": "./es/index.js",
7
- "main": "./lib/index.js",
8
8
  "types": "./types/index.d.ts",
9
9
  "repository": {
10
10
  "type": "git",
@@ -15,18 +15,18 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.27.6",
18
- "@instructure/shared-types": "11.6.0",
19
- "@instructure/ui-a11y-utils": "11.6.0",
20
- "@instructure/ui-dom-utils": "11.6.0",
21
- "@instructure/ui-react-utils": "11.6.0"
18
+ "@instructure/ui-a11y-utils": "11.6.1-pr-snapshot-1779894247159",
19
+ "@instructure/shared-types": "11.6.1-pr-snapshot-1779894247159",
20
+ "@instructure/ui-react-utils": "11.6.1-pr-snapshot-1779894247159",
21
+ "@instructure/ui-dom-utils": "11.6.1-pr-snapshot-1779894247159"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@testing-library/jest-dom": "^6.6.3",
25
25
  "@testing-library/react": "15.0.7",
26
26
  "@testing-library/user-event": "^14.6.1",
27
27
  "vitest": "^3.2.2",
28
- "@instructure/console": "11.6.0",
29
- "@instructure/ui-babel-preset": "11.6.0"
28
+ "@instructure/console": "11.6.1-pr-snapshot-1779894247159",
29
+ "@instructure/ui-babel-preset": "11.6.1-pr-snapshot-1779894247159"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": ">=18 <=19"
@@ -39,10 +39,8 @@
39
39
  ".": {
40
40
  "types": "./types/index.d.ts",
41
41
  "import": "./es/index.js",
42
- "require": "./lib/index.js",
43
42
  "default": "./es/index.js"
44
43
  },
45
- "./lib/*": "./lib/*",
46
44
  "./es/*": "./es/*",
47
45
  "./types/*": "./types/*",
48
46
  "./package.json": "./package.json",
@@ -52,7 +50,7 @@
52
50
  "lint": "ui-scripts lint",
53
51
  "lint:fix": "ui-scripts lint --fix",
54
52
  "clean": "ui-scripts clean",
55
- "build": "ui-scripts build --modules es,cjs",
53
+ "build": "ui-scripts build",
56
54
  "build:watch": "pnpm run ts:check -- --watch & ui-scripts build --watch",
57
55
  "build:types": "tsc -p tsconfig.build.json",
58
56
  "ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
@@ -1,164 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.default = exports.Dialog = void 0;
8
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
- var _react = require("react");
10
- var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
11
- var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
12
- var _findDOMNode = require("@instructure/ui-dom-utils/lib/findDOMNode.js");
13
- var _requestAnimationFrame = require("@instructure/ui-dom-utils/lib/requestAnimationFrame.js");
14
- var _console = require("@instructure/console");
15
- var _FocusRegionManager = require("@instructure/ui-a11y-utils/lib/FocusRegionManager.js");
16
- var _props = require("./props");
17
- var _jsxRuntime = require("@emotion/react/jsx-runtime");
18
- const _excluded = ["open", "contentElement"],
19
- _excluded2 = ["open", "contentElement"];
20
- /*
21
- * The MIT License (MIT)
22
- *
23
- * Copyright (c) 2015 - present Instructure, Inc.
24
- *
25
- * Permission is hereby granted, free of charge, to any person obtaining a copy
26
- * of this software and associated documentation files (the "Software"), to deal
27
- * in the Software without restriction, including without limitation the rights
28
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
29
- * copies of the Software, and to permit persons to whom the Software is
30
- * furnished to do so, subject to the following conditions:
31
- *
32
- * The above copyright notice and this permission notice shall be included in all
33
- * copies or substantial portions of the Software.
34
- *
35
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
41
- * SOFTWARE.
42
- */
43
- /**
44
- ---
45
- category: components/utilities
46
- ---
47
- @module Dialog
48
- **/
49
- class Dialog extends _react.Component {
50
- constructor(...args) {
51
- super(...args);
52
- this._raf = [];
53
- this._focusRegion = null;
54
- this.ref = null;
55
- this.getRef = el => {
56
- const elementRef = this.props.elementRef;
57
- this.ref = el;
58
- if (typeof elementRef === 'function') {
59
- elementRef(el);
60
- }
61
- };
62
- }
63
- get _root() {
64
- return this.ref;
65
- }
66
- componentDidUpdate(prevProps) {
67
- const _this$props = this.props,
68
- open = _this$props.open,
69
- contentElement = _this$props.contentElement,
70
- options = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
71
- if (open && !prevProps.open) {
72
- this.open();
73
- } else if (!open && prevProps.open) {
74
- this.close();
75
- }
76
- if (this._focusRegion) {
77
- this._focusRegion.updateElement(this.contentElement, options);
78
- }
79
- }
80
- componentDidMount() {
81
- if (this.props.open) {
82
- this.open();
83
- }
84
- }
85
- componentWillUnmount() {
86
- if (this.props.open) {
87
- this.close();
88
- }
89
- this._raf.forEach(request => request.cancel());
90
- this._raf = [];
91
- }
92
- open() {
93
- const _this$props2 = this.props,
94
- open = _this$props2.open,
95
- contentElement = _this$props2.contentElement,
96
- options = (0, _objectWithoutProperties2.default)(_this$props2, _excluded2);
97
- this._raf.push((0, _requestAnimationFrame.requestAnimationFrame)(() => {
98
- this._focusRegion = _FocusRegionManager.FocusRegionManager.activateRegion(this.contentElement, {
99
- ...options
100
- });
101
- }));
102
- }
103
- close() {
104
- const _focusRegion = this._focusRegion,
105
- contentElement = this.contentElement;
106
- // setTimeout is used here to delay the blur after the mousedown event in FocusRegion for correct execution order
107
- if (_focusRegion) {
108
- _FocusRegionManager.FocusRegionManager.blurRegion(contentElement, _focusRegion.id);
109
- }
110
- }
111
- focus() {
112
- if (!this.props.open || !this.contentElement) {
113
- (0, _console.logError)(false, "[Dialog] Can't focus a Dialog that isn't open.");
114
- return;
115
- }
116
- if (this._focusRegion) {
117
- _FocusRegionManager.FocusRegionManager.focusRegion(this.contentElement, this._focusRegion.id);
118
- }
119
- }
120
- blur() {
121
- if (!this.props.open || !this.contentElement) {
122
- (0, _console.logError)(false, "[Dialog] Can't blur a Dialog that isn't open.");
123
- return;
124
- }
125
- this.close();
126
- }
127
- get contentElement() {
128
- let contentElement = (0, _findDOMNode.findDOMNode)(this.props.contentElement);
129
- if (!contentElement) {
130
- contentElement = (0, _findDOMNode.findDOMNode)(this.ref);
131
- }
132
- return contentElement;
133
- }
134
- get focused() {
135
- return this.contentElement && this._focusRegion && _FocusRegionManager.FocusRegionManager.isFocused(this.contentElement, this._focusRegion.id);
136
- }
137
- render() {
138
- const ElementType = (0, _getElementType.getElementType)(Dialog, this.props);
139
-
140
- // In case the HTML role attribute is explicitly passed, use props.role
141
- const role = this.props.role || (this.props.label ? 'dialog' : void 0);
142
- return this.props.open ? (0, _jsxRuntime.jsx)(ElementType, {
143
- ...(0, _omitProps.omitProps)(this.props, Dialog.allowedProps),
144
- role: role,
145
- "aria-label": this.props.label,
146
- className: this.props.className,
147
- ref: this.getRef,
148
- children: this.props.children
149
- }) : null;
150
- }
151
- }
152
- exports.Dialog = Dialog;
153
- Dialog.displayName = "Dialog";
154
- Dialog.componentId = 'Dialog';
155
- Dialog.allowedProps = _props.allowedProps;
156
- Dialog.defaultProps = {
157
- open: false,
158
- shouldFocusOnOpen: true,
159
- shouldContainFocus: false,
160
- shouldReturnFocus: false,
161
- shouldCloseOnDocumentClick: true,
162
- shouldCloseOnEscape: true
163
- };
164
- var _default = exports.default = Dialog;
package/lib/index.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "Dialog", {
7
- enumerable: true,
8
- get: function () {
9
- return _Dialog.Dialog;
10
- }
11
- });
12
- var _Dialog = require("./Dialog");
package/lib/package.json DELETED
@@ -1 +0,0 @@
1
- {"type":"commonjs"}