@instructure/ui-menu 8.33.1 → 8.33.2
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 +4 -0
- package/es/Menu/MenuItem/MenuItemLocator.js +2 -1
- package/es/Menu/MenuItem/index.js +12 -53
- package/es/Menu/MenuItem/locator.js +1 -0
- package/es/Menu/MenuItem/props.js +1 -0
- package/es/Menu/MenuItem/styles.js +1 -2
- package/es/Menu/MenuItem/theme.js +5 -5
- package/es/Menu/MenuItemGroup/MenuItemGroupLocator.js +2 -1
- package/es/Menu/MenuItemGroup/index.js +6 -29
- package/es/Menu/MenuItemGroup/props.js +1 -0
- package/es/Menu/MenuItemGroup/styles.js +0 -1
- package/es/Menu/MenuItemGroup/theme.js +5 -5
- package/es/Menu/MenuItemSeparator/index.js +0 -10
- package/es/Menu/MenuItemSeparator/props.js +2 -0
- package/es/Menu/MenuItemSeparator/styles.js +0 -1
- package/es/Menu/MenuItemSeparator/theme.js +4 -4
- package/es/Menu/MenuLocator.js +12 -9
- package/es/Menu/index.js +26 -85
- package/es/Menu/locator.js +1 -0
- package/es/Menu/props.js +1 -0
- package/es/Menu/styles.js +0 -1
- package/es/Menu/theme.js +4 -4
- package/es/MenuContext.js +1 -1
- package/lib/Menu/MenuItem/MenuItemLocator.js +1 -3
- package/lib/Menu/MenuItem/index.js +12 -70
- package/lib/Menu/MenuItem/locator.js +0 -2
- package/lib/Menu/MenuItem/props.js +1 -4
- package/lib/Menu/MenuItem/styles.js +1 -3
- package/lib/Menu/MenuItem/theme.js +5 -6
- package/lib/Menu/MenuItemGroup/MenuItemGroupLocator.js +1 -4
- package/lib/Menu/MenuItemGroup/index.js +6 -45
- package/lib/Menu/MenuItemGroup/locator.js +0 -2
- package/lib/Menu/MenuItemGroup/props.js +1 -7
- package/lib/Menu/MenuItemGroup/styles.js +0 -2
- package/lib/Menu/MenuItemGroup/theme.js +5 -6
- package/lib/Menu/MenuItemSeparator/index.js +0 -18
- package/lib/Menu/MenuItemSeparator/props.js +2 -1
- package/lib/Menu/MenuItemSeparator/styles.js +0 -2
- package/lib/Menu/MenuItemSeparator/theme.js +4 -5
- package/lib/Menu/MenuLocator.js +11 -14
- package/lib/Menu/index.js +26 -103
- package/lib/Menu/locator.js +0 -2
- package/lib/Menu/props.js +1 -6
- package/lib/Menu/styles.js +0 -2
- package/lib/Menu/theme.js +4 -5
- package/lib/MenuContext.js +0 -2
- package/lib/index.js +0 -1
- package/package.json +19 -19
- package/tsconfig.build.tsbuildinfo +1 -1
package/lib/Menu/index.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -27,43 +25,24 @@ Object.defineProperty(exports, "MenuItemSeparator", {
|
|
|
27
25
|
}
|
|
28
26
|
});
|
|
29
27
|
exports.default = void 0;
|
|
30
|
-
|
|
31
28
|
var _react = _interopRequireWildcard(require("react"));
|
|
32
|
-
|
|
33
29
|
var _keycode = _interopRequireDefault(require("keycode"));
|
|
34
|
-
|
|
35
30
|
var _Popover = require("@instructure/ui-popover/lib/Popover");
|
|
36
|
-
|
|
37
31
|
var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
|
|
38
|
-
|
|
39
32
|
var _matchComponentTypes = require("@instructure/ui-react-utils/lib/matchComponentTypes.js");
|
|
40
|
-
|
|
41
33
|
var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
|
|
42
|
-
|
|
43
34
|
var _console = require("@instructure/console");
|
|
44
|
-
|
|
45
35
|
var _containsActiveElement = require("@instructure/ui-dom-utils/lib/containsActiveElement.js");
|
|
46
|
-
|
|
47
36
|
var _testable = require("@instructure/ui-testable/lib/testable.js");
|
|
48
|
-
|
|
49
37
|
var _MenuContext = require("../MenuContext");
|
|
50
|
-
|
|
51
38
|
var _MenuItem = require("./MenuItem");
|
|
52
|
-
|
|
53
39
|
var _MenuItemGroup = require("./MenuItemGroup");
|
|
54
|
-
|
|
55
40
|
var _MenuItemSeparator = require("./MenuItemSeparator");
|
|
56
|
-
|
|
57
41
|
var _emotion = require("@instructure/emotion");
|
|
58
|
-
|
|
59
42
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
60
|
-
|
|
61
43
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
62
|
-
|
|
63
44
|
var _props = require("./props");
|
|
64
|
-
|
|
65
45
|
var _dec, _dec2, _dec3, _class, _class2;
|
|
66
|
-
|
|
67
46
|
/**
|
|
68
47
|
---
|
|
69
48
|
category: components
|
|
@@ -85,67 +64,55 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
85
64
|
this._activeSubMenu = void 0;
|
|
86
65
|
this._id = void 0;
|
|
87
66
|
this.ref = null;
|
|
88
|
-
|
|
89
67
|
this.handleRef = el => {
|
|
90
68
|
const menuRef = this.props.menuRef;
|
|
91
69
|
this._menu = el;
|
|
92
|
-
|
|
93
70
|
if (typeof menuRef === 'function') {
|
|
94
71
|
menuRef(el);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
72
|
+
}
|
|
73
|
+
// If there is no trigger `<ul>` is the ref, otherwise the trigger
|
|
98
74
|
if (!this.props.trigger) {
|
|
99
75
|
this.ref = el;
|
|
100
76
|
}
|
|
101
77
|
};
|
|
102
|
-
|
|
103
78
|
this.registerMenuItem = item => {
|
|
104
79
|
this._menuItems.push(item);
|
|
105
80
|
};
|
|
106
|
-
|
|
107
81
|
this.removeMenuItem = item => {
|
|
108
82
|
const index = this.getMenuItemIndex(item);
|
|
109
83
|
(0, _console.logError)(index >= 0, '[Menu] Could not find registered menu item.');
|
|
110
|
-
|
|
111
84
|
if (index >= 0) {
|
|
112
85
|
this._menuItems.splice(index, 1);
|
|
113
86
|
}
|
|
114
87
|
};
|
|
115
|
-
|
|
116
88
|
this.getMenuItemIndex = item => {
|
|
117
89
|
return this._menuItems.findIndex(i => i === item);
|
|
118
90
|
};
|
|
119
|
-
|
|
120
91
|
this.handleTriggerKeyDown = event => {
|
|
121
92
|
if (this.props.type === 'flyout' && event.keyCode === _keycode.default.codes.right) {
|
|
122
93
|
event.persist();
|
|
123
94
|
this.show(event);
|
|
124
95
|
}
|
|
125
96
|
};
|
|
126
|
-
|
|
127
97
|
this.handleTriggerMouseOver = event => {
|
|
128
98
|
if (this.props.type === 'flyout') {
|
|
129
99
|
this.show(event);
|
|
130
100
|
}
|
|
131
101
|
};
|
|
132
|
-
|
|
133
102
|
this.handleToggle = shown => {
|
|
134
103
|
if (typeof this.props.onToggle === 'function') {
|
|
135
104
|
this.props.onToggle(shown, this);
|
|
136
105
|
}
|
|
137
106
|
};
|
|
138
|
-
|
|
139
107
|
this.handleMenuKeyDown = event => {
|
|
140
108
|
const key = event && event.keyCode;
|
|
141
109
|
const _keycode$codes = _keycode.default.codes,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
110
|
+
down = _keycode$codes.down,
|
|
111
|
+
up = _keycode$codes.up,
|
|
112
|
+
tab = _keycode$codes.tab,
|
|
113
|
+
left = _keycode$codes.left;
|
|
146
114
|
const pgdn = _keycode.default.codes['page down'];
|
|
147
115
|
const pgup = _keycode.default.codes['page up'];
|
|
148
|
-
|
|
149
116
|
if (key === down || key === pgdn) {
|
|
150
117
|
event.preventDefault();
|
|
151
118
|
event.stopPropagation();
|
|
@@ -160,107 +127,83 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
160
127
|
event.persist();
|
|
161
128
|
this.hide(event);
|
|
162
129
|
}
|
|
163
|
-
|
|
164
130
|
if (typeof this.props.onKeyDown === 'function') {
|
|
165
131
|
this.props.onKeyDown(event);
|
|
166
132
|
}
|
|
167
133
|
};
|
|
168
|
-
|
|
169
134
|
this.handleMenuItemSelect = (event, value, selected, item) => {
|
|
170
135
|
if (this.props.shouldHideOnSelect) {
|
|
171
136
|
this.hide(event);
|
|
172
137
|
}
|
|
173
|
-
|
|
174
138
|
if (typeof this.props.onSelect === 'function') {
|
|
175
139
|
this.props.onSelect(event, value, selected, item);
|
|
176
140
|
}
|
|
177
141
|
};
|
|
178
|
-
|
|
179
142
|
this.handleMenuItemFocus = () => {
|
|
180
143
|
this.setState({
|
|
181
144
|
hasFocus: true
|
|
182
145
|
});
|
|
183
146
|
};
|
|
184
|
-
|
|
185
147
|
this.handleMenuItemBlur = () => {
|
|
186
148
|
this.setState({
|
|
187
149
|
hasFocus: this.focusedIndex >= 0
|
|
188
150
|
});
|
|
189
151
|
};
|
|
190
|
-
|
|
191
152
|
this.handleMenuItemMouseOver = (event, menuItem) => {
|
|
192
153
|
if (this._activeSubMenu && menuItem !== this._activeSubMenu._trigger) {
|
|
193
154
|
this.hideActiveSubMenu(event);
|
|
194
155
|
}
|
|
195
156
|
};
|
|
196
|
-
|
|
197
157
|
this.hideActiveSubMenu = event => {
|
|
198
158
|
if (this._activeSubMenu) {
|
|
199
159
|
this._activeSubMenu.hide(event);
|
|
200
|
-
|
|
201
160
|
this._activeSubMenu = null;
|
|
202
161
|
}
|
|
203
162
|
};
|
|
204
|
-
|
|
205
163
|
this.handleSubMenuToggle = (shown, subMenu) => {
|
|
206
164
|
if (shown) {
|
|
207
165
|
this._activeSubMenu = subMenu;
|
|
208
166
|
}
|
|
209
167
|
};
|
|
210
|
-
|
|
211
168
|
this.handleSubMenuDismiss = (event, documentClick) => {
|
|
212
169
|
if (event && event.keyCode === _keycode.default.codes.tab || documentClick) {
|
|
213
170
|
this.hide(event);
|
|
214
171
|
}
|
|
215
172
|
};
|
|
216
|
-
|
|
217
173
|
this.hide = event => {
|
|
218
174
|
if (this._popover) {
|
|
219
175
|
this._popover.hide(event);
|
|
220
176
|
}
|
|
221
177
|
};
|
|
222
|
-
|
|
223
178
|
this.show = event => {
|
|
224
179
|
if (this._popover) {
|
|
225
180
|
this._popover.show(event);
|
|
226
181
|
}
|
|
227
182
|
};
|
|
228
|
-
|
|
229
183
|
this._id = this.props.id || props.deterministicId();
|
|
230
184
|
}
|
|
231
|
-
|
|
232
185
|
componentDidMount() {
|
|
233
186
|
var _this$props$makeStyle, _this$props;
|
|
234
|
-
|
|
235
187
|
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
236
188
|
}
|
|
237
|
-
|
|
238
189
|
componentDidUpdate() {
|
|
239
190
|
var _this$props$makeStyle2, _this$props2;
|
|
240
|
-
|
|
241
191
|
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
242
192
|
}
|
|
243
|
-
|
|
244
193
|
get menuItems() {
|
|
245
194
|
return this._menuItems;
|
|
246
195
|
}
|
|
247
|
-
|
|
248
196
|
focus() {
|
|
249
197
|
if (this.shown) {
|
|
250
198
|
var _this$_menu;
|
|
251
|
-
|
|
252
199
|
(0, _console.logError)(!!((_this$_menu = this._menu) !== null && _this$_menu !== void 0 && _this$_menu.focus), '[Menu] Could not focus the menu.');
|
|
253
|
-
|
|
254
200
|
this._menu.focus();
|
|
255
201
|
} else {
|
|
256
202
|
var _this$_trigger;
|
|
257
|
-
|
|
258
203
|
(0, _console.logError)(!!((_this$_trigger = this._trigger) !== null && _this$_trigger !== void 0 && _this$_trigger.focus), '[Menu] Could not focus the trigger.');
|
|
259
|
-
|
|
260
204
|
this._trigger.focus();
|
|
261
205
|
}
|
|
262
206
|
}
|
|
263
|
-
|
|
264
207
|
focused() {
|
|
265
208
|
if (this.shown) {
|
|
266
209
|
return (0, _containsActiveElement.containsActiveElement)(this._menu) || this.state.hasFocus;
|
|
@@ -268,52 +211,42 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
268
211
|
return (0, _containsActiveElement.containsActiveElement)(this._trigger);
|
|
269
212
|
}
|
|
270
213
|
}
|
|
271
|
-
|
|
272
214
|
get focusedIndex() {
|
|
273
215
|
return this.menuItems.findIndex(item => {
|
|
274
216
|
return item && item.focused === true;
|
|
275
217
|
});
|
|
276
218
|
}
|
|
277
|
-
|
|
278
219
|
moveFocus(step) {
|
|
279
220
|
const count = this.menuItems ? this.menuItems.length : 0;
|
|
280
|
-
|
|
281
221
|
if (count <= 0) {
|
|
282
222
|
return;
|
|
283
223
|
}
|
|
284
|
-
|
|
285
224
|
const current = this.focusedIndex < 0 && step < 0 ? 0 : this.focusedIndex;
|
|
286
225
|
const nextItem = this.menuItems[(current + count + step) % count];
|
|
287
226
|
(0, _console.logError)(typeof nextItem !== 'undefined' && typeof nextItem.focus !== 'undefined', '[Menu] Could not focus next menu item.');
|
|
288
227
|
nextItem.focus();
|
|
289
228
|
}
|
|
290
|
-
|
|
291
229
|
get shown() {
|
|
292
230
|
return this._popover ? this._popover.shown : true;
|
|
293
231
|
}
|
|
294
|
-
|
|
295
232
|
renderChildren() {
|
|
296
233
|
const _this$props3 = this.props,
|
|
297
|
-
|
|
298
|
-
|
|
234
|
+
children = _this$props3.children,
|
|
235
|
+
disabled = _this$props3.disabled;
|
|
299
236
|
let count = 0;
|
|
300
237
|
return _react.Children.map(children, child => {
|
|
301
238
|
if (!(0, _matchComponentTypes.matchComponentTypes)(child, ['MenuItemSeparator', 'MenuItem', 'MenuItemGroup', 'Menu'])) {
|
|
302
239
|
return;
|
|
303
240
|
}
|
|
304
|
-
|
|
305
241
|
count += 1;
|
|
306
242
|
const isTabbable = !this.state.hasFocus && count === 1;
|
|
307
|
-
|
|
308
243
|
if ((0, _matchComponentTypes.matchComponentTypes)(child, ['MenuItemSeparator'])) {
|
|
309
244
|
return (0, _emotion.jsx)("li", {
|
|
310
245
|
role: "none"
|
|
311
246
|
}, child);
|
|
312
247
|
}
|
|
313
|
-
|
|
314
248
|
const menuItemChild = child;
|
|
315
249
|
const controls = menuItemChild.props['aria-controls'] || menuItemChild.props.controls || this.props['aria-controls'] || this.props.controls;
|
|
316
|
-
|
|
317
250
|
if ((0, _matchComponentTypes.matchComponentTypes)(child, ['MenuItem'])) {
|
|
318
251
|
return (0, _emotion.jsx)("li", {
|
|
319
252
|
role: "none"
|
|
@@ -328,7 +261,6 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
328
261
|
tabIndex: isTabbable ? 0 : -1
|
|
329
262
|
}));
|
|
330
263
|
}
|
|
331
|
-
|
|
332
264
|
if ((0, _matchComponentTypes.matchComponentTypes)(child, ['MenuItemGroup'])) {
|
|
333
265
|
return (0, _emotion.jsx)("li", {
|
|
334
266
|
role: "none"
|
|
@@ -343,7 +275,6 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
343
275
|
isTabbable
|
|
344
276
|
}));
|
|
345
277
|
}
|
|
346
|
-
|
|
347
278
|
if ((0, _matchComponentTypes.matchComponentTypes)(child, ['Menu'])) {
|
|
348
279
|
const submenuDisabled = disabled || child.props.disabled;
|
|
349
280
|
return (0, _emotion.jsx)("li", {
|
|
@@ -369,19 +300,16 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
369
300
|
}, child.props.title || child.props.label)
|
|
370
301
|
}));
|
|
371
302
|
}
|
|
372
|
-
|
|
373
303
|
return;
|
|
374
304
|
});
|
|
375
305
|
}
|
|
376
|
-
|
|
377
306
|
renderMenu() {
|
|
378
307
|
var _this$props$styles;
|
|
379
|
-
|
|
380
308
|
const _this$props4 = this.props,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
309
|
+
disabled = _this$props4.disabled,
|
|
310
|
+
label = _this$props4.label,
|
|
311
|
+
trigger = _this$props4.trigger,
|
|
312
|
+
onKeyUp = _this$props4.onKeyUp;
|
|
385
313
|
const labelledBy = this.props['aria-labelledby'];
|
|
386
314
|
const controls = this.props['aria-controls'];
|
|
387
315
|
return (0, _emotion.jsx)(_MenuContext.MenuContext.Provider, {
|
|
@@ -402,33 +330,30 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
402
330
|
ref: this.handleRef
|
|
403
331
|
}, this.renderChildren()));
|
|
404
332
|
}
|
|
405
|
-
|
|
406
333
|
render() {
|
|
407
334
|
const _this$props5 = this.props,
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
335
|
+
show = _this$props5.show,
|
|
336
|
+
defaultShow = _this$props5.defaultShow,
|
|
337
|
+
placement = _this$props5.placement,
|
|
338
|
+
withArrow = _this$props5.withArrow,
|
|
339
|
+
trigger = _this$props5.trigger,
|
|
340
|
+
mountNode = _this$props5.mountNode,
|
|
341
|
+
popoverRef = _this$props5.popoverRef,
|
|
342
|
+
disabled = _this$props5.disabled,
|
|
343
|
+
onDismiss = _this$props5.onDismiss,
|
|
344
|
+
onFocus = _this$props5.onFocus,
|
|
345
|
+
onMouseOver = _this$props5.onMouseOver,
|
|
346
|
+
positionContainerDisplay = _this$props5.positionContainerDisplay,
|
|
347
|
+
offsetX = _this$props5.offsetX,
|
|
348
|
+
offsetY = _this$props5.offsetY;
|
|
422
349
|
return trigger ? (0, _emotion.jsx)(_Popover.Popover, {
|
|
423
350
|
isShowingContent: show,
|
|
424
351
|
defaultIsShowingContent: defaultShow,
|
|
425
352
|
onHideContent: (event, _ref) => {
|
|
426
353
|
let documentClick = _ref.documentClick;
|
|
427
|
-
|
|
428
354
|
if (typeof onDismiss === 'function') {
|
|
429
355
|
onDismiss(event, documentClick);
|
|
430
356
|
}
|
|
431
|
-
|
|
432
357
|
this.handleToggle(false);
|
|
433
358
|
},
|
|
434
359
|
onShowContent: () => this.handleToggle(true),
|
|
@@ -449,7 +374,6 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
449
374
|
},
|
|
450
375
|
ref: el => {
|
|
451
376
|
this._popover = el;
|
|
452
|
-
|
|
453
377
|
if (typeof popoverRef === 'function') {
|
|
454
378
|
popoverRef(el);
|
|
455
379
|
}
|
|
@@ -466,7 +390,6 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
466
390
|
})
|
|
467
391
|
}, this.renderMenu()) : this.renderMenu();
|
|
468
392
|
}
|
|
469
|
-
|
|
470
393
|
}, _class2.displayName = "Menu", _class2.componentId = 'Menu', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
471
394
|
label: null,
|
|
472
395
|
disabled: false,
|
package/lib/Menu/locator.js
CHANGED
package/lib/Menu/props.js
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.propTypes = exports.allowedProps = void 0;
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _PositionPropTypes = require("@instructure/ui-position/lib/PositionPropTypes.js");
|
|
13
|
-
|
|
14
10
|
var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
|
|
15
|
-
|
|
16
11
|
var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
17
|
-
|
|
18
12
|
/*
|
|
19
13
|
* The MIT License (MIT)
|
|
20
14
|
*
|
|
@@ -38,6 +32,7 @@ var _Children = require("@instructure/ui-prop-types/lib/Children.js");
|
|
|
38
32
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
39
33
|
* SOFTWARE.
|
|
40
34
|
*/
|
|
35
|
+
|
|
41
36
|
const propTypes = {
|
|
42
37
|
children: _Children.Children.oneOf(['MenuItem', 'MenuItemGroup', 'MenuItemSeparator', 'Menu']),
|
|
43
38
|
label: _propTypes.default.string,
|
package/lib/Menu/styles.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
/*
|
|
9
8
|
* The MIT License (MIT)
|
|
10
9
|
*
|
|
@@ -74,6 +73,5 @@ const generateStyle = componentTheme => {
|
|
|
74
73
|
}
|
|
75
74
|
};
|
|
76
75
|
};
|
|
77
|
-
|
|
78
76
|
var _default = generateStyle;
|
|
79
77
|
exports.default = _default;
|
package/lib/Menu/theme.js
CHANGED
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
/*
|
|
9
8
|
* The MIT License (MIT)
|
|
10
9
|
*
|
|
@@ -36,8 +35,8 @@ exports.default = void 0;
|
|
|
36
35
|
*/
|
|
37
36
|
const generateComponentTheme = theme => {
|
|
38
37
|
const colors = theme.colors,
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
breakpoints = theme.breakpoints,
|
|
39
|
+
borders = theme.borders;
|
|
41
40
|
const componentVariables = {
|
|
42
41
|
minWidth: breakpoints === null || breakpoints === void 0 ? void 0 : breakpoints.xxSmall,
|
|
43
42
|
maxWidth: breakpoints === null || breakpoints === void 0 ? void 0 : breakpoints.xSmall,
|
|
@@ -47,9 +46,9 @@ const generateComponentTheme = theme => {
|
|
|
47
46
|
focusBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
|
|
48
47
|
focusBorderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium
|
|
49
48
|
};
|
|
50
|
-
return {
|
|
49
|
+
return {
|
|
50
|
+
...componentVariables
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
|
|
54
53
|
var _default = generateComponentTheme;
|
|
55
54
|
exports.default = _default;
|
package/lib/MenuContext.js
CHANGED
package/lib/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-menu",
|
|
3
|
-
"version": "8.33.
|
|
3
|
+
"version": "8.33.2",
|
|
4
4
|
"description": "A dropdown menu component",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -23,27 +23,27 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.33.
|
|
27
|
-
"@instructure/ui-color-utils": "8.33.
|
|
28
|
-
"@instructure/ui-test-locator": "8.33.
|
|
29
|
-
"@instructure/ui-test-queries": "8.33.
|
|
30
|
-
"@instructure/ui-test-utils": "8.33.
|
|
31
|
-
"@instructure/ui-themes": "8.33.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.33.2",
|
|
27
|
+
"@instructure/ui-color-utils": "8.33.2",
|
|
28
|
+
"@instructure/ui-test-locator": "8.33.2",
|
|
29
|
+
"@instructure/ui-test-queries": "8.33.2",
|
|
30
|
+
"@instructure/ui-test-utils": "8.33.2",
|
|
31
|
+
"@instructure/ui-themes": "8.33.2"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.13.10",
|
|
35
|
-
"@instructure/console": "8.33.
|
|
36
|
-
"@instructure/emotion": "8.33.
|
|
37
|
-
"@instructure/shared-types": "8.33.
|
|
38
|
-
"@instructure/ui-a11y-utils": "8.33.
|
|
39
|
-
"@instructure/ui-dom-utils": "8.33.
|
|
40
|
-
"@instructure/ui-icons": "8.33.
|
|
41
|
-
"@instructure/ui-popover": "8.33.
|
|
42
|
-
"@instructure/ui-position": "8.33.
|
|
43
|
-
"@instructure/ui-prop-types": "8.33.
|
|
44
|
-
"@instructure/ui-react-utils": "8.33.
|
|
45
|
-
"@instructure/ui-testable": "8.33.
|
|
46
|
-
"@instructure/ui-utils": "8.33.
|
|
35
|
+
"@instructure/console": "8.33.2",
|
|
36
|
+
"@instructure/emotion": "8.33.2",
|
|
37
|
+
"@instructure/shared-types": "8.33.2",
|
|
38
|
+
"@instructure/ui-a11y-utils": "8.33.2",
|
|
39
|
+
"@instructure/ui-dom-utils": "8.33.2",
|
|
40
|
+
"@instructure/ui-icons": "8.33.2",
|
|
41
|
+
"@instructure/ui-popover": "8.33.2",
|
|
42
|
+
"@instructure/ui-position": "8.33.2",
|
|
43
|
+
"@instructure/ui-prop-types": "8.33.2",
|
|
44
|
+
"@instructure/ui-react-utils": "8.33.2",
|
|
45
|
+
"@instructure/ui-testable": "8.33.2",
|
|
46
|
+
"@instructure/ui-utils": "8.33.2",
|
|
47
47
|
"keycode": "^2",
|
|
48
48
|
"prop-types": "^15"
|
|
49
49
|
},
|