@instructure/ui-tray 10.13.0 → 10.13.1-pr-snapshot-1741357986437
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 +8 -0
- package/lib/Tray/index.js +19 -19
- package/lib/Tray/props.js +3 -3
- package/package.json +16 -16
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
|
+
## [10.13.1-pr-snapshot-1741357986437](https://github.com/instructure/instructure-ui/compare/v10.13.0...v10.13.1-pr-snapshot-1741357986437) (2025-03-07)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-tray
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [10.13.0](https://github.com/instructure/instructure-ui/compare/v10.12.0...v10.13.0) (2025-03-06)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @instructure/ui-tray
|
package/lib/Tray/index.js
CHANGED
|
@@ -7,19 +7,19 @@ 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"));
|
|
21
21
|
var _props = require("./props");
|
|
22
|
-
var
|
|
22
|
+
var _uiOverlays = require("@instructure/ui-overlays");
|
|
23
23
|
const _excluded = ["label", "children", "size", "placement", "open", "defaultFocusElement", "contentRef", "shouldContainFocus", "shouldReturnFocus", "shouldCloseOnDocumentClick", "onOpen", "onClose", "onDismiss", "mountNode", "insertAt", "liveRegion", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "onTransition", "transitionOnMount", "transitionEnter", "transitionExit", "border", "shadow", "role", "enableMask"];
|
|
24
24
|
var _dec, _dec2, _dec3, _class, _Tray;
|
|
25
25
|
/*
|
|
@@ -51,7 +51,7 @@ var _dec, _dec2, _dec3, _class, _Tray;
|
|
|
51
51
|
category: components
|
|
52
52
|
---
|
|
53
53
|
**/
|
|
54
|
-
let Tray = exports.Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0,
|
|
54
|
+
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 = (_Tray = class Tray extends _react.Component {
|
|
55
55
|
constructor(props) {
|
|
56
56
|
var _props$open;
|
|
57
57
|
super(props);
|
|
@@ -97,8 +97,8 @@ let Tray = exports.Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
97
97
|
const _this$props3 = this.props,
|
|
98
98
|
placement = _this$props3.placement,
|
|
99
99
|
dir = _this$props3.dir;
|
|
100
|
-
const isRtl = dir ===
|
|
101
|
-
return isRtl ? (0,
|
|
100
|
+
const isRtl = dir === _uiI18n.textDirectionContextConsumer.DIRECTION.rtl;
|
|
101
|
+
return isRtl ? (0, _uiPosition.mirrorHorizontalPlacement)(placement, ' ') : placement;
|
|
102
102
|
}
|
|
103
103
|
get direction() {
|
|
104
104
|
switch (this.placement) {
|
|
@@ -158,23 +158,23 @@ let Tray = exports.Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
158
158
|
enableMask = _this$props4.enableMask,
|
|
159
159
|
props = (0, _objectWithoutProperties2.default)(_this$props4, _excluded);
|
|
160
160
|
const portalIsOpen = this.state.open || this.state.transitioning;
|
|
161
|
-
const content = (0, _emotion.jsx)(
|
|
161
|
+
const content = (0, _emotion.jsx)(_uiMotion.Transition, {
|
|
162
162
|
in: open,
|
|
163
163
|
type: this.transition,
|
|
164
164
|
onTransition: onTransition,
|
|
165
165
|
onEnter: onEnter,
|
|
166
166
|
onEntering: onEntering,
|
|
167
|
-
onEntered: (0,
|
|
167
|
+
onEntered: (0, _uiUtils.createChainedFunction)(this.handleTransitionComplete, onEntered, onOpen),
|
|
168
168
|
onExit: onExit,
|
|
169
169
|
onExiting: onExiting,
|
|
170
|
-
onExited: (0,
|
|
170
|
+
onExited: (0, _uiUtils.createChainedFunction)(this.handleTransitionComplete, onExited, onClose),
|
|
171
171
|
transitionOnMount: transitionOnMount,
|
|
172
172
|
transitionEnter: transitionEnter,
|
|
173
173
|
transitionExit: transitionExit
|
|
174
|
-
}, (0, _emotion.jsx)("span", Object.assign({}, (0,
|
|
174
|
+
}, (0, _emotion.jsx)("span", Object.assign({}, (0, _uiReactUtils.omitProps)(props, Tray.allowedProps), {
|
|
175
175
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.tray,
|
|
176
176
|
ref: contentRef
|
|
177
|
-
}), (0, _emotion.jsx)(
|
|
177
|
+
}), (0, _emotion.jsx)(_uiDialog.Dialog, {
|
|
178
178
|
ref: element => this.dialogRef = element,
|
|
179
179
|
as: "div",
|
|
180
180
|
label: label,
|
|
@@ -190,12 +190,12 @@ let Tray = exports.Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _them
|
|
|
190
190
|
}, (0, _emotion.jsx)("div", {
|
|
191
191
|
css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.content
|
|
192
192
|
}, children))));
|
|
193
|
-
return (0, _emotion.jsx)(
|
|
193
|
+
return (0, _emotion.jsx)(_uiPortal.Portal, {
|
|
194
194
|
open: portalIsOpen,
|
|
195
195
|
onOpen: this.handlePortalOpen,
|
|
196
196
|
insertAt: insertAt,
|
|
197
197
|
mountNode: mountNode
|
|
198
|
-
}, enableMask ? (0, _emotion.jsx)(
|
|
198
|
+
}, enableMask ? (0, _emotion.jsx)(_uiOverlays.Mask, {
|
|
199
199
|
placement: 'center',
|
|
200
200
|
fullscreen: true
|
|
201
201
|
}, content) : content);
|
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": "10.13.
|
|
3
|
+
"version": "10.13.1-pr-snapshot-1741357986437",
|
|
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,24 +24,24 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.26.0",
|
|
27
|
-
"@instructure/console": "10.13.
|
|
28
|
-
"@instructure/emotion": "10.13.
|
|
29
|
-
"@instructure/shared-types": "10.13.
|
|
30
|
-
"@instructure/ui-dialog": "10.13.
|
|
31
|
-
"@instructure/ui-i18n": "10.13.
|
|
32
|
-
"@instructure/ui-motion": "10.13.
|
|
33
|
-
"@instructure/ui-overlays": "10.13.
|
|
34
|
-
"@instructure/ui-portal": "10.13.
|
|
35
|
-
"@instructure/ui-position": "10.13.
|
|
36
|
-
"@instructure/ui-prop-types": "10.13.
|
|
37
|
-
"@instructure/ui-react-utils": "10.13.
|
|
38
|
-
"@instructure/ui-testable": "10.13.
|
|
39
|
-
"@instructure/ui-utils": "10.13.
|
|
27
|
+
"@instructure/console": "10.13.1-pr-snapshot-1741357986437",
|
|
28
|
+
"@instructure/emotion": "10.13.1-pr-snapshot-1741357986437",
|
|
29
|
+
"@instructure/shared-types": "10.13.1-pr-snapshot-1741357986437",
|
|
30
|
+
"@instructure/ui-dialog": "10.13.1-pr-snapshot-1741357986437",
|
|
31
|
+
"@instructure/ui-i18n": "10.13.1-pr-snapshot-1741357986437",
|
|
32
|
+
"@instructure/ui-motion": "10.13.1-pr-snapshot-1741357986437",
|
|
33
|
+
"@instructure/ui-overlays": "10.13.1-pr-snapshot-1741357986437",
|
|
34
|
+
"@instructure/ui-portal": "10.13.1-pr-snapshot-1741357986437",
|
|
35
|
+
"@instructure/ui-position": "10.13.1-pr-snapshot-1741357986437",
|
|
36
|
+
"@instructure/ui-prop-types": "10.13.1-pr-snapshot-1741357986437",
|
|
37
|
+
"@instructure/ui-react-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
38
|
+
"@instructure/ui-testable": "10.13.1-pr-snapshot-1741357986437",
|
|
39
|
+
"@instructure/ui-utils": "10.13.1-pr-snapshot-1741357986437",
|
|
40
40
|
"prop-types": "^15.8.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@instructure/ui-babel-preset": "10.13.
|
|
44
|
-
"@instructure/ui-themes": "10.13.
|
|
43
|
+
"@instructure/ui-babel-preset": "10.13.1-pr-snapshot-1741357986437",
|
|
44
|
+
"@instructure/ui-themes": "10.13.1-pr-snapshot-1741357986437",
|
|
45
45
|
"@testing-library/jest-dom": "^6.6.3",
|
|
46
46
|
"@testing-library/react": "^16.0.1",
|
|
47
47
|
"@testing-library/user-event": "^14.5.2",
|