@instructure/ui-tray 8.25.1-snapshot-10 → 8.25.1-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 +1 -1
- package/es/Tray/TrayLocator.js +2 -1
- package/es/Tray/index.js +34 -52
- package/es/Tray/props.js +0 -95
- package/lib/Tray/TrayLocator.js +1 -0
- package/lib/Tray/index.js +34 -52
- package/lib/Tray/props.js +0 -95
- package/package.json +17 -17
- package/src/Tray/index.tsx +8 -33
- package/src/Tray/props.ts +80 -87
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Tray/index.d.ts +24 -39
- package/types/Tray/index.d.ts.map +1 -1
- package/types/Tray/props.d.ts +87 -12
- package/types/Tray/props.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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.25.1-snapshot-
|
|
6
|
+
## [8.25.1-snapshot-15](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-15) (2022-06-23)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-tray
|
|
9
9
|
|
package/es/Tray/TrayLocator.js
CHANGED
|
@@ -22,5 +22,6 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
import { locator } from '@instructure/ui-test-locator';
|
|
25
|
-
import { Tray } from './index';
|
|
25
|
+
import { Tray } from './index'; // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
26
|
+
|
|
26
27
|
export const TrayLocator = locator(Tray.selector);
|
package/es/Tray/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
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", "border", "shadow"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _dec3, _class;
|
|
4
|
+
var _dec, _dec2, _dec3, _class, _class2;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -46,41 +46,26 @@ import { propTypes, allowedProps } from './props';
|
|
|
46
46
|
---
|
|
47
47
|
category: components
|
|
48
48
|
---
|
|
49
|
+
@tsProps
|
|
49
50
|
**/
|
|
50
|
-
let Tray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = textDirectionContextConsumer(), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = class Tray extends Component {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
liveRegion: null,
|
|
69
|
-
contentRef: el => {},
|
|
70
|
-
shouldCloseOnDocumentClick: false,
|
|
71
|
-
shouldContainFocus: true,
|
|
72
|
-
shouldReturnFocus: true,
|
|
73
|
-
defaultFocusElement: null,
|
|
74
|
-
size: 'small',
|
|
75
|
-
placement: 'start',
|
|
76
|
-
shadow: true,
|
|
77
|
-
border: false,
|
|
78
|
-
children: null
|
|
79
|
-
};
|
|
80
|
-
state = {
|
|
81
|
-
transitioning: false
|
|
82
|
-
};
|
|
83
|
-
ref = null;
|
|
51
|
+
let Tray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = textDirectionContextConsumer(), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Tray extends Component {
|
|
52
|
+
constructor() {
|
|
53
|
+
super(...arguments);
|
|
54
|
+
this.state = {
|
|
55
|
+
transitioning: false
|
|
56
|
+
};
|
|
57
|
+
this.ref = null;
|
|
58
|
+
|
|
59
|
+
this.handleTransitionComplete = _type => {
|
|
60
|
+
this.setState({
|
|
61
|
+
transitioning: false
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
this.handlePortalOpen = DOMNode => {
|
|
66
|
+
this.DOMNode = DOMNode;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
84
69
|
|
|
85
70
|
componentDidMount() {
|
|
86
71
|
var _this$props$makeStyle, _this$props;
|
|
@@ -88,7 +73,7 @@ let Tray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
|
|
|
88
73
|
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
89
74
|
}
|
|
90
75
|
|
|
91
|
-
componentDidUpdate(prevProps,
|
|
76
|
+
componentDidUpdate(prevProps, _prevState) {
|
|
92
77
|
var _this$props$makeStyle2, _this$props2;
|
|
93
78
|
|
|
94
79
|
if (this.props.open !== prevProps.open) {
|
|
@@ -129,16 +114,6 @@ let Tray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
|
|
|
129
114
|
return `slide-${this.direction}`;
|
|
130
115
|
}
|
|
131
116
|
|
|
132
|
-
get defaultFocusElement() {
|
|
133
|
-
return this.props.defaultFocusElement || (() => this._closeButton);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
handleTransitionComplete = _type => {
|
|
137
|
-
this.setState({
|
|
138
|
-
transitioning: false
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
|
|
142
117
|
get DOMNode() {
|
|
143
118
|
return this.ref;
|
|
144
119
|
}
|
|
@@ -147,10 +122,6 @@ let Tray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
|
|
|
147
122
|
this.ref = el ? el : null;
|
|
148
123
|
}
|
|
149
124
|
|
|
150
|
-
handlePortalOpen = DOMNode => {
|
|
151
|
-
this.DOMNode = DOMNode;
|
|
152
|
-
};
|
|
153
|
-
|
|
154
125
|
render() {
|
|
155
126
|
var _this$props$styles, _this$props$styles2;
|
|
156
127
|
|
|
@@ -207,7 +178,7 @@ let Tray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
|
|
|
207
178
|
}), this.state.transitioning ? children : jsx(Dialog, {
|
|
208
179
|
as: "div",
|
|
209
180
|
label: label,
|
|
210
|
-
defaultFocusElement:
|
|
181
|
+
defaultFocusElement: defaultFocusElement,
|
|
211
182
|
open: true,
|
|
212
183
|
shouldContainFocus: shouldContainFocus,
|
|
213
184
|
shouldReturnFocus: shouldReturnFocus,
|
|
@@ -220,6 +191,17 @@ let Tray = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = tex
|
|
|
220
191
|
}, children)))));
|
|
221
192
|
}
|
|
222
193
|
|
|
223
|
-
}
|
|
194
|
+
}, _class2.displayName = "Tray", _class2.componentId = 'Tray', _class2.allowedProps = allowedProps, _class2.propTypes = propTypes, _class2.defaultProps = {
|
|
195
|
+
defaultFocusElement: null,
|
|
196
|
+
open: false,
|
|
197
|
+
insertAt: 'bottom',
|
|
198
|
+
shouldCloseOnDocumentClick: false,
|
|
199
|
+
shouldContainFocus: true,
|
|
200
|
+
shouldReturnFocus: true,
|
|
201
|
+
size: 'small',
|
|
202
|
+
placement: 'start',
|
|
203
|
+
shadow: true,
|
|
204
|
+
border: false
|
|
205
|
+
}, _class2)) || _class) || _class) || _class);
|
|
224
206
|
export default Tray;
|
|
225
207
|
export { Tray };
|
package/es/Tray/props.js
CHANGED
|
@@ -26,123 +26,28 @@ import { element } from '@instructure/ui-prop-types';
|
|
|
26
26
|
const propTypes = {
|
|
27
27
|
label: PropTypes.string.isRequired,
|
|
28
28
|
children: PropTypes.node,
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* The size (width) of the `<Tray />` when placement is `start` or `end`
|
|
32
|
-
*/
|
|
33
29
|
size: PropTypes.oneOf(['x-small', 'small', 'regular', 'medium', 'large']),
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Placement to determine where the `<Tray />` should display in the viewport
|
|
37
|
-
*/
|
|
38
30
|
placement: PropTypes.oneOf(['top', 'bottom', 'start', 'end', 'center']),
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Whether or not the `<Tray />` is open
|
|
42
|
-
*/
|
|
43
31
|
open: PropTypes.bool,
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* An element or a function returning an element to focus by default
|
|
47
|
-
*/
|
|
48
32
|
defaultFocusElement: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
*
|
|
52
|
-
* A function that returns a reference to the content element
|
|
53
|
-
*/
|
|
54
33
|
contentRef: PropTypes.func,
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Whether focus should be contained within the `<Tray/>` when it is open
|
|
58
|
-
*/
|
|
59
34
|
shouldContainFocus: PropTypes.bool,
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Whether focus should be restored when the `<Tray/>` is closed
|
|
63
|
-
*/
|
|
64
35
|
shouldReturnFocus: PropTypes.bool,
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Should the `<Tray />` hide when clicks occur outside the content
|
|
68
|
-
*/
|
|
69
36
|
shouldCloseOnDocumentClick: PropTypes.bool,
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Callback fired when `<Tray />` content has been mounted in the DOM
|
|
73
|
-
*/
|
|
74
37
|
onOpen: PropTypes.func,
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Callback fired when `<Tray />` has been unmounted from the DOM
|
|
78
|
-
*/
|
|
79
38
|
onClose: PropTypes.func,
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Callback fired when the `<Tray />` is requesting to be closed
|
|
83
|
-
*/
|
|
84
39
|
onDismiss: PropTypes.func,
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* An element or a function returning an element to use as the mount node
|
|
88
|
-
* for the `<Tray />` (defaults to `document.body`)
|
|
89
|
-
*/
|
|
90
40
|
mountNode: PropTypes.oneOfType([element, PropTypes.func]),
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Insert the element at the 'top' of the mountNode or at the 'bottom'
|
|
94
|
-
*/
|
|
95
41
|
insertAt: PropTypes.oneOf(['bottom', 'top']),
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* An element, function returning an element, or array of elements that will not be hidden from
|
|
99
|
-
* the screen reader when the `<Tray />` is open
|
|
100
|
-
*/
|
|
101
42
|
liveRegion: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element, PropTypes.func]),
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Callback fired when the <Tray /> transitions in/out
|
|
105
|
-
*/
|
|
106
43
|
onTransition: PropTypes.func,
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Callback fired before the <Tray /> transitions in
|
|
110
|
-
*/
|
|
111
44
|
onEnter: PropTypes.func,
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Callback fired as the <Tray /> begins to transition in
|
|
115
|
-
*/
|
|
116
45
|
onEntering: PropTypes.func,
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Callback fired after the <Tray /> finishes transitioning in
|
|
120
|
-
*/
|
|
121
46
|
onEntered: PropTypes.func,
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Callback fired right before the <Tray /> transitions out
|
|
125
|
-
*/
|
|
126
47
|
onExit: PropTypes.func,
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Callback fired as the <Tray /> begins to transition out
|
|
130
|
-
*/
|
|
131
48
|
onExiting: PropTypes.func,
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Callback fired after the <Tray /> finishes transitioning out
|
|
135
|
-
*/
|
|
136
49
|
onExited: PropTypes.func,
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Should the `<Tray />` have a border
|
|
140
|
-
*/
|
|
141
50
|
border: PropTypes.bool,
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Should the `<Tray />` have a box shadow
|
|
145
|
-
*/
|
|
146
51
|
shadow: PropTypes.bool
|
|
147
52
|
};
|
|
148
53
|
const allowedProps = ['label', 'children', 'size', 'placement', 'open', 'defaultFocusElement', 'contentRef', 'shouldContainFocus', 'shouldReturnFocus', 'shouldCloseOnDocumentClick', 'onOpen', 'onClose', 'onDismiss', 'mountNode', 'insertAt', 'liveRegion', 'onTransition', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited', 'border', 'shadow'];
|
package/lib/Tray/TrayLocator.js
CHANGED
|
@@ -32,5 +32,6 @@ var _index = require("./index");
|
|
|
32
32
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
33
|
* SOFTWARE.
|
|
34
34
|
*/
|
|
35
|
+
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
35
36
|
const TrayLocator = (0, _locator.locator)(_index.Tray.selector);
|
|
36
37
|
exports.TrayLocator = TrayLocator;
|
package/lib/Tray/index.js
CHANGED
|
@@ -37,47 +37,32 @@ var _props = require("./props");
|
|
|
37
37
|
|
|
38
38
|
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", "border", "shadow"];
|
|
39
39
|
|
|
40
|
-
var _dec, _dec2, _dec3, _class;
|
|
40
|
+
var _dec, _dec2, _dec3, _class, _class2;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
---
|
|
44
44
|
category: components
|
|
45
45
|
---
|
|
46
|
+
@tsProps
|
|
46
47
|
**/
|
|
47
|
-
let Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _textDirectionContextConsumer.textDirectionContextConsumer)(), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = class Tray extends _react.Component {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
liveRegion: null,
|
|
66
|
-
contentRef: el => {},
|
|
67
|
-
shouldCloseOnDocumentClick: false,
|
|
68
|
-
shouldContainFocus: true,
|
|
69
|
-
shouldReturnFocus: true,
|
|
70
|
-
defaultFocusElement: null,
|
|
71
|
-
size: 'small',
|
|
72
|
-
placement: 'start',
|
|
73
|
-
shadow: true,
|
|
74
|
-
border: false,
|
|
75
|
-
children: null
|
|
76
|
-
};
|
|
77
|
-
state = {
|
|
78
|
-
transitioning: false
|
|
79
|
-
};
|
|
80
|
-
ref = null;
|
|
48
|
+
let Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _textDirectionContextConsumer.textDirectionContextConsumer)(), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_class2 = class Tray extends _react.Component {
|
|
49
|
+
constructor() {
|
|
50
|
+
super(...arguments);
|
|
51
|
+
this.state = {
|
|
52
|
+
transitioning: false
|
|
53
|
+
};
|
|
54
|
+
this.ref = null;
|
|
55
|
+
|
|
56
|
+
this.handleTransitionComplete = _type => {
|
|
57
|
+
this.setState({
|
|
58
|
+
transitioning: false
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
this.handlePortalOpen = DOMNode => {
|
|
63
|
+
this.DOMNode = DOMNode;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
81
66
|
|
|
82
67
|
componentDidMount() {
|
|
83
68
|
var _this$props$makeStyle, _this$props;
|
|
@@ -85,7 +70,7 @@ let Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
85
70
|
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
86
71
|
}
|
|
87
72
|
|
|
88
|
-
componentDidUpdate(prevProps,
|
|
73
|
+
componentDidUpdate(prevProps, _prevState) {
|
|
89
74
|
var _this$props$makeStyle2, _this$props2;
|
|
90
75
|
|
|
91
76
|
if (this.props.open !== prevProps.open) {
|
|
@@ -126,16 +111,6 @@ let Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
126
111
|
return `slide-${this.direction}`;
|
|
127
112
|
}
|
|
128
113
|
|
|
129
|
-
get defaultFocusElement() {
|
|
130
|
-
return this.props.defaultFocusElement || (() => this._closeButton);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
handleTransitionComplete = _type => {
|
|
134
|
-
this.setState({
|
|
135
|
-
transitioning: false
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
|
-
|
|
139
114
|
get DOMNode() {
|
|
140
115
|
return this.ref;
|
|
141
116
|
}
|
|
@@ -144,10 +119,6 @@ let Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
144
119
|
this.ref = el ? el : null;
|
|
145
120
|
}
|
|
146
121
|
|
|
147
|
-
handlePortalOpen = DOMNode => {
|
|
148
|
-
this.DOMNode = DOMNode;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
122
|
render() {
|
|
152
123
|
var _this$props$styles, _this$props$styles2;
|
|
153
124
|
|
|
@@ -203,7 +174,7 @@ let Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
203
174
|
}), this.state.transitioning ? children : (0, _emotion.jsx)(_Dialog.Dialog, {
|
|
204
175
|
as: "div",
|
|
205
176
|
label: label,
|
|
206
|
-
defaultFocusElement:
|
|
177
|
+
defaultFocusElement: defaultFocusElement,
|
|
207
178
|
open: true,
|
|
208
179
|
shouldContainFocus: shouldContainFocus,
|
|
209
180
|
shouldReturnFocus: shouldReturnFocus,
|
|
@@ -216,7 +187,18 @@ let Tray = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _de
|
|
|
216
187
|
}, children)))));
|
|
217
188
|
}
|
|
218
189
|
|
|
219
|
-
}
|
|
190
|
+
}, _class2.displayName = "Tray", _class2.componentId = 'Tray', _class2.allowedProps = _props.allowedProps, _class2.propTypes = _props.propTypes, _class2.defaultProps = {
|
|
191
|
+
defaultFocusElement: null,
|
|
192
|
+
open: false,
|
|
193
|
+
insertAt: 'bottom',
|
|
194
|
+
shouldCloseOnDocumentClick: false,
|
|
195
|
+
shouldContainFocus: true,
|
|
196
|
+
shouldReturnFocus: true,
|
|
197
|
+
size: 'small',
|
|
198
|
+
placement: 'start',
|
|
199
|
+
shadow: true,
|
|
200
|
+
border: false
|
|
201
|
+
}, _class2)) || _class) || _class) || _class);
|
|
220
202
|
exports.Tray = Tray;
|
|
221
203
|
var _default = Tray;
|
|
222
204
|
exports.default = _default;
|
package/lib/Tray/props.js
CHANGED
|
@@ -37,123 +37,28 @@ var _element = require("@instructure/ui-prop-types/lib/element.js");
|
|
|
37
37
|
const propTypes = {
|
|
38
38
|
label: _propTypes.default.string.isRequired,
|
|
39
39
|
children: _propTypes.default.node,
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The size (width) of the `<Tray />` when placement is `start` or `end`
|
|
43
|
-
*/
|
|
44
40
|
size: _propTypes.default.oneOf(['x-small', 'small', 'regular', 'medium', 'large']),
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Placement to determine where the `<Tray />` should display in the viewport
|
|
48
|
-
*/
|
|
49
41
|
placement: _propTypes.default.oneOf(['top', 'bottom', 'start', 'end', 'center']),
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Whether or not the `<Tray />` is open
|
|
53
|
-
*/
|
|
54
42
|
open: _propTypes.default.bool,
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* An element or a function returning an element to focus by default
|
|
58
|
-
*/
|
|
59
43
|
defaultFocusElement: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.func]),
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* A function that returns a reference to the content element
|
|
64
|
-
*/
|
|
65
44
|
contentRef: _propTypes.default.func,
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Whether focus should be contained within the `<Tray/>` when it is open
|
|
69
|
-
*/
|
|
70
45
|
shouldContainFocus: _propTypes.default.bool,
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Whether focus should be restored when the `<Tray/>` is closed
|
|
74
|
-
*/
|
|
75
46
|
shouldReturnFocus: _propTypes.default.bool,
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Should the `<Tray />` hide when clicks occur outside the content
|
|
79
|
-
*/
|
|
80
47
|
shouldCloseOnDocumentClick: _propTypes.default.bool,
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Callback fired when `<Tray />` content has been mounted in the DOM
|
|
84
|
-
*/
|
|
85
48
|
onOpen: _propTypes.default.func,
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Callback fired when `<Tray />` has been unmounted from the DOM
|
|
89
|
-
*/
|
|
90
49
|
onClose: _propTypes.default.func,
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Callback fired when the `<Tray />` is requesting to be closed
|
|
94
|
-
*/
|
|
95
50
|
onDismiss: _propTypes.default.func,
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* An element or a function returning an element to use as the mount node
|
|
99
|
-
* for the `<Tray />` (defaults to `document.body`)
|
|
100
|
-
*/
|
|
101
51
|
mountNode: _propTypes.default.oneOfType([_element.element, _propTypes.default.func]),
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Insert the element at the 'top' of the mountNode or at the 'bottom'
|
|
105
|
-
*/
|
|
106
52
|
insertAt: _propTypes.default.oneOf(['bottom', 'top']),
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* An element, function returning an element, or array of elements that will not be hidden from
|
|
110
|
-
* the screen reader when the `<Tray />` is open
|
|
111
|
-
*/
|
|
112
53
|
liveRegion: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.element), _propTypes.default.element, _propTypes.default.func]),
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Callback fired when the <Tray /> transitions in/out
|
|
116
|
-
*/
|
|
117
54
|
onTransition: _propTypes.default.func,
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Callback fired before the <Tray /> transitions in
|
|
121
|
-
*/
|
|
122
55
|
onEnter: _propTypes.default.func,
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Callback fired as the <Tray /> begins to transition in
|
|
126
|
-
*/
|
|
127
56
|
onEntering: _propTypes.default.func,
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Callback fired after the <Tray /> finishes transitioning in
|
|
131
|
-
*/
|
|
132
57
|
onEntered: _propTypes.default.func,
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* Callback fired right before the <Tray /> transitions out
|
|
136
|
-
*/
|
|
137
58
|
onExit: _propTypes.default.func,
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Callback fired as the <Tray /> begins to transition out
|
|
141
|
-
*/
|
|
142
59
|
onExiting: _propTypes.default.func,
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Callback fired after the <Tray /> finishes transitioning out
|
|
146
|
-
*/
|
|
147
60
|
onExited: _propTypes.default.func,
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Should the `<Tray />` have a border
|
|
151
|
-
*/
|
|
152
61
|
border: _propTypes.default.bool,
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Should the `<Tray />` have a box shadow
|
|
156
|
-
*/
|
|
157
62
|
shadow: _propTypes.default.bool
|
|
158
63
|
};
|
|
159
64
|
exports.propTypes = propTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-tray",
|
|
3
|
-
"version": "8.25.1-snapshot-
|
|
3
|
+
"version": "8.25.1-snapshot-15",
|
|
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.13.10",
|
|
27
|
-
"@instructure/console": "8.25.1-snapshot-
|
|
28
|
-
"@instructure/emotion": "8.25.1-snapshot-
|
|
29
|
-
"@instructure/shared-types": "8.25.1-snapshot-
|
|
30
|
-
"@instructure/ui-dialog": "8.25.1-snapshot-
|
|
31
|
-
"@instructure/ui-i18n": "8.25.1-snapshot-
|
|
32
|
-
"@instructure/ui-motion": "8.25.1-snapshot-
|
|
33
|
-
"@instructure/ui-portal": "8.25.1-snapshot-
|
|
34
|
-
"@instructure/ui-position": "8.25.1-snapshot-
|
|
35
|
-
"@instructure/ui-prop-types": "8.25.1-snapshot-
|
|
36
|
-
"@instructure/ui-react-utils": "8.25.1-snapshot-
|
|
37
|
-
"@instructure/ui-testable": "8.25.1-snapshot-
|
|
38
|
-
"@instructure/ui-utils": "8.25.1-snapshot-
|
|
27
|
+
"@instructure/console": "8.25.1-snapshot-15",
|
|
28
|
+
"@instructure/emotion": "8.25.1-snapshot-15",
|
|
29
|
+
"@instructure/shared-types": "8.25.1-snapshot-15",
|
|
30
|
+
"@instructure/ui-dialog": "8.25.1-snapshot-15",
|
|
31
|
+
"@instructure/ui-i18n": "8.25.1-snapshot-15",
|
|
32
|
+
"@instructure/ui-motion": "8.25.1-snapshot-15",
|
|
33
|
+
"@instructure/ui-portal": "8.25.1-snapshot-15",
|
|
34
|
+
"@instructure/ui-position": "8.25.1-snapshot-15",
|
|
35
|
+
"@instructure/ui-prop-types": "8.25.1-snapshot-15",
|
|
36
|
+
"@instructure/ui-react-utils": "8.25.1-snapshot-15",
|
|
37
|
+
"@instructure/ui-testable": "8.25.1-snapshot-15",
|
|
38
|
+
"@instructure/ui-utils": "8.25.1-snapshot-15",
|
|
39
39
|
"prop-types": "^15"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@instructure/ui-babel-preset": "8.25.1-snapshot-
|
|
43
|
-
"@instructure/ui-test-locator": "8.25.1-snapshot-
|
|
44
|
-
"@instructure/ui-test-utils": "8.25.1-snapshot-
|
|
45
|
-
"@instructure/ui-themes": "8.25.1-snapshot-
|
|
42
|
+
"@instructure/ui-babel-preset": "8.25.1-snapshot-15",
|
|
43
|
+
"@instructure/ui-test-locator": "8.25.1-snapshot-15",
|
|
44
|
+
"@instructure/ui-test-utils": "8.25.1-snapshot-15",
|
|
45
|
+
"@instructure/ui-themes": "8.25.1-snapshot-15"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=16.8 <=17"
|