@instructure/ui-tray 8.56.0 → 8.56.2-pr-snapshot-1721749364069
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 +16 -0
- package/lib/Tray/TrayLocator.js +2 -2
- package/lib/Tray/index.js +17 -17
- package/lib/Tray/props.js +3 -3
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.56.2-pr-snapshot-1721749364069](https://github.com/instructure/instructure-ui/compare/v8.56.1...v8.56.2-pr-snapshot-1721749364069) (2024-07-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-tray
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [8.56.1](https://github.com/instructure/instructure-ui/compare/v8.56.0...v8.56.1) (2024-06-13)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @instructure/ui-tray
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [8.56.0](https://github.com/instructure/instructure-ui/compare/v8.55.1...v8.56.0) (2024-05-06)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @instructure/ui-tray
|
package/lib/Tray/TrayLocator.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TrayLocator = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _uiTestLocator = require("@instructure/ui-test-locator");
|
|
8
8
|
var _index = require("./index");
|
|
9
9
|
/*
|
|
10
10
|
* The MIT License (MIT)
|
|
@@ -31,4 +31,4 @@ var _index = require("./index");
|
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
34
|
-
const TrayLocator = exports.TrayLocator = (0,
|
|
34
|
+
const TrayLocator = exports.TrayLocator = (0, _uiTestLocator.locator)(_index.Tray.selector);
|
package/lib/Tray/index.js
CHANGED
|
@@ -7,14 +7,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = exports.Tray = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
9
|
var _react = require("react");
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
10
|
+
var _uiDialog = require("@instructure/ui-dialog");
|
|
11
|
+
var _uiReactUtils = require("@instructure/ui-react-utils");
|
|
12
|
+
var _uiUtils = require("@instructure/ui-utils");
|
|
13
|
+
var _uiI18n = require("@instructure/ui-i18n");
|
|
14
|
+
var _uiTestable = require("@instructure/ui-testable");
|
|
15
|
+
var _uiPortal = require("@instructure/ui-portal");
|
|
16
|
+
var _uiPosition = require("@instructure/ui-position");
|
|
17
|
+
var _uiMotion = require("@instructure/ui-motion");
|
|
18
18
|
var _emotion = require("@instructure/emotion");
|
|
19
19
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
20
20
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
@@ -50,7 +50,7 @@ var _dec, _dec2, _dec3, _class, _class2;
|
|
|
50
50
|
category: components
|
|
51
51
|
---
|
|
52
52
|
**/
|
|
53
|
-
let Tray = exports.Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0,
|
|
53
|
+
let Tray = exports.Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _uiI18n.textDirectionContextConsumer)(), _dec3 = (0, _uiTestable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Tray extends _react.Component {
|
|
54
54
|
constructor(props) {
|
|
55
55
|
var _props$open;
|
|
56
56
|
super(props);
|
|
@@ -96,8 +96,8 @@ let Tray = exports.Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
96
96
|
const _this$props3 = this.props,
|
|
97
97
|
placement = _this$props3.placement,
|
|
98
98
|
dir = _this$props3.dir;
|
|
99
|
-
const isRtl = dir ===
|
|
100
|
-
return isRtl ? (0,
|
|
99
|
+
const isRtl = dir === _uiI18n.textDirectionContextConsumer.DIRECTION.rtl;
|
|
100
|
+
return isRtl ? (0, _uiPosition.mirrorHorizontalPlacement)(placement, ' ') : placement;
|
|
101
101
|
}
|
|
102
102
|
get direction() {
|
|
103
103
|
switch (this.placement) {
|
|
@@ -156,28 +156,28 @@ let Tray = exports.Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
156
156
|
role = _this$props4.role,
|
|
157
157
|
props = (0, _objectWithoutProperties2.default)(_this$props4, _excluded);
|
|
158
158
|
const portalIsOpen = this.state.open || this.state.transitioning;
|
|
159
|
-
return (0, _emotion.jsx)(
|
|
159
|
+
return (0, _emotion.jsx)(_uiPortal.Portal, {
|
|
160
160
|
open: portalIsOpen,
|
|
161
161
|
onOpen: this.handlePortalOpen,
|
|
162
162
|
insertAt: insertAt,
|
|
163
163
|
mountNode: mountNode
|
|
164
|
-
}, (0, _emotion.jsx)(
|
|
164
|
+
}, (0, _emotion.jsx)(_uiMotion.Transition, {
|
|
165
165
|
in: open,
|
|
166
166
|
type: this.transition,
|
|
167
167
|
onTransition: onTransition,
|
|
168
168
|
onEnter: onEnter,
|
|
169
169
|
onEntering: onEntering,
|
|
170
|
-
onEntered: (0,
|
|
170
|
+
onEntered: (0, _uiUtils.createChainedFunction)(this.handleTransitionComplete, onEntered, onOpen),
|
|
171
171
|
onExit: onExit,
|
|
172
172
|
onExiting: onExiting,
|
|
173
|
-
onExited: (0,
|
|
173
|
+
onExited: (0, _uiUtils.createChainedFunction)(this.handleTransitionComplete, onExited, onClose),
|
|
174
174
|
transitionOnMount: transitionOnMount,
|
|
175
175
|
transitionEnter: transitionEnter,
|
|
176
176
|
transitionExit: transitionExit
|
|
177
|
-
}, (0, _emotion.jsx)("span", Object.assign({}, (0,
|
|
177
|
+
}, (0, _emotion.jsx)("span", Object.assign({}, (0, _uiReactUtils.omitProps)(props, Tray.allowedProps), {
|
|
178
178
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.tray,
|
|
179
179
|
ref: contentRef
|
|
180
|
-
}), (0, _emotion.jsx)(
|
|
180
|
+
}), (0, _emotion.jsx)(_uiDialog.Dialog, {
|
|
181
181
|
ref: element => this.dialogRef = element,
|
|
182
182
|
as: "div",
|
|
183
183
|
label: label,
|
package/lib/Tray/props.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.propTypes = exports.allowedProps = void 0;
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var
|
|
9
|
+
var _uiPropTypes = require("@instructure/ui-prop-types");
|
|
10
10
|
/*
|
|
11
11
|
* The MIT License (MIT)
|
|
12
12
|
*
|
|
@@ -45,9 +45,9 @@ const propTypes = exports.propTypes = {
|
|
|
45
45
|
onOpen: _propTypes.default.func,
|
|
46
46
|
onClose: _propTypes.default.func,
|
|
47
47
|
onDismiss: _propTypes.default.func,
|
|
48
|
-
mountNode: _propTypes.default.oneOfType([
|
|
48
|
+
mountNode: _propTypes.default.oneOfType([_uiPropTypes.element, _propTypes.default.func]),
|
|
49
49
|
insertAt: _propTypes.default.oneOf(['bottom', 'top']),
|
|
50
|
-
liveRegion: _propTypes.default.oneOfType([
|
|
50
|
+
liveRegion: _propTypes.default.oneOfType([_uiPropTypes.element, _propTypes.default.arrayOf(_uiPropTypes.element), _propTypes.default.func]),
|
|
51
51
|
onTransition: _propTypes.default.func,
|
|
52
52
|
onEnter: _propTypes.default.func,
|
|
53
53
|
onEntering: _propTypes.default.func,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tray",
|
|
3
|
-
"version": "8.56.
|
|
3
|
+
"version": "8.56.2-pr-snapshot-1721749364069",
|
|
4
4
|
"description": "Tray component for secondary/menu content",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,25 +24,25 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.23.2",
|
|
27
|
-
"@instructure/console": "8.56.
|
|
28
|
-
"@instructure/emotion": "8.56.
|
|
29
|
-
"@instructure/shared-types": "8.56.
|
|
30
|
-
"@instructure/ui-dialog": "8.56.
|
|
31
|
-
"@instructure/ui-i18n": "8.56.
|
|
32
|
-
"@instructure/ui-motion": "8.56.
|
|
33
|
-
"@instructure/ui-portal": "8.56.
|
|
34
|
-
"@instructure/ui-position": "8.56.
|
|
35
|
-
"@instructure/ui-prop-types": "8.56.
|
|
36
|
-
"@instructure/ui-react-utils": "8.56.
|
|
37
|
-
"@instructure/ui-testable": "8.56.
|
|
38
|
-
"@instructure/ui-utils": "8.56.
|
|
27
|
+
"@instructure/console": "8.56.2-pr-snapshot-1721749364069",
|
|
28
|
+
"@instructure/emotion": "8.56.2-pr-snapshot-1721749364069",
|
|
29
|
+
"@instructure/shared-types": "8.56.2-pr-snapshot-1721749364069",
|
|
30
|
+
"@instructure/ui-dialog": "8.56.2-pr-snapshot-1721749364069",
|
|
31
|
+
"@instructure/ui-i18n": "8.56.2-pr-snapshot-1721749364069",
|
|
32
|
+
"@instructure/ui-motion": "8.56.2-pr-snapshot-1721749364069",
|
|
33
|
+
"@instructure/ui-portal": "8.56.2-pr-snapshot-1721749364069",
|
|
34
|
+
"@instructure/ui-position": "8.56.2-pr-snapshot-1721749364069",
|
|
35
|
+
"@instructure/ui-prop-types": "8.56.2-pr-snapshot-1721749364069",
|
|
36
|
+
"@instructure/ui-react-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
37
|
+
"@instructure/ui-testable": "8.56.2-pr-snapshot-1721749364069",
|
|
38
|
+
"@instructure/ui-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
39
39
|
"prop-types": "^15.8.1"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@instructure/ui-babel-preset": "8.56.
|
|
43
|
-
"@instructure/ui-test-locator": "8.56.
|
|
44
|
-
"@instructure/ui-test-utils": "8.56.
|
|
45
|
-
"@instructure/ui-themes": "8.56.
|
|
42
|
+
"@instructure/ui-babel-preset": "8.56.2-pr-snapshot-1721749364069",
|
|
43
|
+
"@instructure/ui-test-locator": "8.56.2-pr-snapshot-1721749364069",
|
|
44
|
+
"@instructure/ui-test-utils": "8.56.2-pr-snapshot-1721749364069",
|
|
45
|
+
"@instructure/ui-themes": "8.56.2-pr-snapshot-1721749364069"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=16.8 <=18"
|