@instructure/ui-menu 8.18.0 → 8.18.1-snapshot.12
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/LICENSE.md +27 -0
- package/es/Menu/MenuItem/index.js +24 -16
- package/es/Menu/MenuItem/theme.js +13 -13
- package/es/Menu/MenuItemGroup/index.js +19 -11
- package/es/Menu/MenuItemGroup/theme.js +6 -6
- package/es/Menu/MenuItemSeparator/index.js +9 -3
- package/es/Menu/MenuItemSeparator/theme.js +3 -3
- package/es/Menu/index.js +38 -28
- package/es/Menu/theme.js +7 -7
- package/lib/Menu/MenuItem/index.js +24 -16
- package/lib/Menu/MenuItem/theme.js +13 -13
- package/lib/Menu/MenuItemGroup/index.js +19 -11
- package/lib/Menu/MenuItemGroup/theme.js +6 -6
- package/lib/Menu/MenuItemSeparator/index.js +9 -3
- package/lib/Menu/MenuItemSeparator/theme.js +3 -3
- package/lib/Menu/index.js +38 -28
- package/lib/Menu/theme.js +7 -7
- package/package.json +21 -20
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -39,9 +39,9 @@ const generateComponentTheme = theme => {
|
|
|
39
39
|
spacing = theme.spacing,
|
|
40
40
|
borders = theme.borders;
|
|
41
41
|
const componentVariables = {
|
|
42
|
-
background: colors
|
|
43
|
-
height: borders
|
|
44
|
-
margin: `0 ${spacing
|
|
42
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundMedium,
|
|
43
|
+
height: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
|
|
44
|
+
margin: `0 ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`
|
|
45
45
|
};
|
|
46
46
|
return { ...componentVariables
|
|
47
47
|
};
|
package/lib/Menu/index.js
CHANGED
|
@@ -225,11 +225,15 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
componentDidMount() {
|
|
228
|
-
|
|
228
|
+
var _this$props$makeStyle, _this$props;
|
|
229
|
+
|
|
230
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
229
231
|
}
|
|
230
232
|
|
|
231
233
|
componentDidUpdate() {
|
|
232
|
-
|
|
234
|
+
var _this$props$makeStyle2, _this$props2;
|
|
235
|
+
|
|
236
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
233
237
|
}
|
|
234
238
|
|
|
235
239
|
get menuItems() {
|
|
@@ -238,11 +242,15 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
238
242
|
|
|
239
243
|
focus() {
|
|
240
244
|
if (this.shown) {
|
|
241
|
-
|
|
245
|
+
var _this$_menu;
|
|
246
|
+
|
|
247
|
+
(0, _console.logError)(!!((_this$_menu = this._menu) !== null && _this$_menu !== void 0 && _this$_menu.focus), '[Menu] Could not focus the menu.');
|
|
242
248
|
|
|
243
249
|
this._menu.focus();
|
|
244
250
|
} else {
|
|
245
|
-
|
|
251
|
+
var _this$_trigger;
|
|
252
|
+
|
|
253
|
+
(0, _console.logError)(!!((_this$_trigger = this._trigger) !== null && _this$_trigger !== void 0 && _this$_trigger.focus), '[Menu] Could not focus the trigger.');
|
|
246
254
|
|
|
247
255
|
this._trigger.focus();
|
|
248
256
|
}
|
|
@@ -280,9 +288,9 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
280
288
|
}
|
|
281
289
|
|
|
282
290
|
renderChildren() {
|
|
283
|
-
const _this$
|
|
284
|
-
children = _this$
|
|
285
|
-
disabled = _this$
|
|
291
|
+
const _this$props3 = this.props,
|
|
292
|
+
children = _this$props3.children,
|
|
293
|
+
disabled = _this$props3.disabled;
|
|
286
294
|
let count = 0;
|
|
287
295
|
return _react.Children.map(children, child => {
|
|
288
296
|
if (!(0, _matchComponentTypes.matchComponentTypes)(child, ['MenuItemSeparator', 'MenuItem', 'MenuItemGroup', 'Menu'])) {
|
|
@@ -362,11 +370,13 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
362
370
|
}
|
|
363
371
|
|
|
364
372
|
renderMenu() {
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
373
|
+
var _this$props$styles;
|
|
374
|
+
|
|
375
|
+
const _this$props4 = this.props,
|
|
376
|
+
disabled = _this$props4.disabled,
|
|
377
|
+
label = _this$props4.label,
|
|
378
|
+
trigger = _this$props4.trigger,
|
|
379
|
+
onKeyUp = _this$props4.onKeyUp;
|
|
370
380
|
const labelledBy = this.props['aria-labelledby'];
|
|
371
381
|
const controls = this.props['aria-controls'];
|
|
372
382
|
return (0, _emotion.jsx)(_MenuContext.MenuContext.Provider, {
|
|
@@ -378,7 +388,7 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
378
388
|
role: "menu",
|
|
379
389
|
"aria-label": label,
|
|
380
390
|
tabIndex: 0,
|
|
381
|
-
css: this.props.styles
|
|
391
|
+
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.menu,
|
|
382
392
|
"aria-labelledby": labelledBy || (trigger ? this._labelId : void 0),
|
|
383
393
|
"aria-controls": controls,
|
|
384
394
|
"aria-disabled": disabled ? 'true' : void 0,
|
|
@@ -389,20 +399,20 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
389
399
|
}
|
|
390
400
|
|
|
391
401
|
render() {
|
|
392
|
-
const _this$
|
|
393
|
-
show = _this$
|
|
394
|
-
defaultShow = _this$
|
|
395
|
-
placement = _this$
|
|
396
|
-
withArrow = _this$
|
|
397
|
-
trigger = _this$
|
|
398
|
-
mountNode = _this$
|
|
399
|
-
popoverRef = _this$
|
|
400
|
-
disabled = _this$
|
|
401
|
-
onDismiss = _this$
|
|
402
|
-
onFocus = _this$
|
|
403
|
-
onMouseOver = _this$
|
|
404
|
-
offsetX = _this$
|
|
405
|
-
offsetY = _this$
|
|
402
|
+
const _this$props5 = this.props,
|
|
403
|
+
show = _this$props5.show,
|
|
404
|
+
defaultShow = _this$props5.defaultShow,
|
|
405
|
+
placement = _this$props5.placement,
|
|
406
|
+
withArrow = _this$props5.withArrow,
|
|
407
|
+
trigger = _this$props5.trigger,
|
|
408
|
+
mountNode = _this$props5.mountNode,
|
|
409
|
+
popoverRef = _this$props5.popoverRef,
|
|
410
|
+
disabled = _this$props5.disabled,
|
|
411
|
+
onDismiss = _this$props5.onDismiss,
|
|
412
|
+
onFocus = _this$props5.onFocus,
|
|
413
|
+
onMouseOver = _this$props5.onMouseOver,
|
|
414
|
+
offsetX = _this$props5.offsetX,
|
|
415
|
+
offsetY = _this$props5.offsetY;
|
|
406
416
|
return trigger ? (0, _emotion.jsx)(_Popover.Popover, {
|
|
407
417
|
isShowingContent: show,
|
|
408
418
|
defaultIsShowingContent: defaultShow,
|
|
@@ -437,7 +447,7 @@ let Menu = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0,
|
|
|
437
447
|
renderTrigger: (0, _safeCloneElement.safeCloneElement)(trigger, {
|
|
438
448
|
ref: el => {
|
|
439
449
|
this._trigger = el;
|
|
440
|
-
this.ref = el
|
|
450
|
+
this.ref = (el === null || el === void 0 ? void 0 : el.ref) || el;
|
|
441
451
|
},
|
|
442
452
|
'aria-haspopup': true,
|
|
443
453
|
id: this._labelId,
|
package/lib/Menu/theme.js
CHANGED
|
@@ -39,13 +39,13 @@ const generateComponentTheme = theme => {
|
|
|
39
39
|
breakpoints = theme.breakpoints,
|
|
40
40
|
borders = theme.borders;
|
|
41
41
|
const componentVariables = {
|
|
42
|
-
minWidth: breakpoints
|
|
43
|
-
maxWidth: breakpoints
|
|
44
|
-
background: colors
|
|
45
|
-
focusBorderStyle: borders
|
|
46
|
-
focusBorderWidth: borders
|
|
47
|
-
focusBorderColor: colors
|
|
48
|
-
focusBorderRadius: borders
|
|
42
|
+
minWidth: breakpoints === null || breakpoints === void 0 ? void 0 : breakpoints.xxSmall,
|
|
43
|
+
maxWidth: breakpoints === null || breakpoints === void 0 ? void 0 : breakpoints.xSmall,
|
|
44
|
+
background: colors === null || colors === void 0 ? void 0 : colors.backgroundLightest,
|
|
45
|
+
focusBorderStyle: borders === null || borders === void 0 ? void 0 : borders.style,
|
|
46
|
+
focusBorderWidth: borders === null || borders === void 0 ? void 0 : borders.widthMedium,
|
|
47
|
+
focusBorderColor: colors === null || colors === void 0 ? void 0 : colors.borderBrand,
|
|
48
|
+
focusBorderRadius: borders === null || borders === void 0 ? void 0 : borders.radiusMedium
|
|
49
49
|
};
|
|
50
50
|
return { ...componentVariables
|
|
51
51
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-menu",
|
|
3
|
-
"version": "8.18.
|
|
3
|
+
"version": "8.18.1-snapshot.12+ca14b3dc8",
|
|
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.18.
|
|
27
|
-
"@instructure/ui-color-utils": "8.18.
|
|
28
|
-
"@instructure/ui-test-locator": "8.18.
|
|
29
|
-
"@instructure/ui-test-queries": "8.18.
|
|
30
|
-
"@instructure/ui-test-utils": "8.18.
|
|
31
|
-
"@instructure/ui-themes": "8.18.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.18.1-snapshot.12+ca14b3dc8",
|
|
27
|
+
"@instructure/ui-color-utils": "8.18.1-snapshot.12+ca14b3dc8",
|
|
28
|
+
"@instructure/ui-test-locator": "8.18.1-snapshot.12+ca14b3dc8",
|
|
29
|
+
"@instructure/ui-test-queries": "8.18.1-snapshot.12+ca14b3dc8",
|
|
30
|
+
"@instructure/ui-test-utils": "8.18.1-snapshot.12+ca14b3dc8",
|
|
31
|
+
"@instructure/ui-themes": "8.18.1-snapshot.12+ca14b3dc8"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/runtime": "^7.13.10",
|
|
35
|
-
"@instructure/console": "8.18.
|
|
36
|
-
"@instructure/emotion": "8.18.
|
|
37
|
-
"@instructure/shared-types": "8.18.
|
|
38
|
-
"@instructure/ui-a11y-utils": "8.18.
|
|
39
|
-
"@instructure/ui-dom-utils": "8.18.
|
|
40
|
-
"@instructure/ui-icons": "8.18.
|
|
41
|
-
"@instructure/ui-popover": "8.18.
|
|
42
|
-
"@instructure/ui-position": "8.18.
|
|
43
|
-
"@instructure/ui-prop-types": "8.18.
|
|
44
|
-
"@instructure/ui-react-utils": "8.18.
|
|
45
|
-
"@instructure/ui-testable": "8.18.
|
|
46
|
-
"@instructure/ui-utils": "8.18.
|
|
35
|
+
"@instructure/console": "8.18.1-snapshot.12+ca14b3dc8",
|
|
36
|
+
"@instructure/emotion": "8.18.1-snapshot.12+ca14b3dc8",
|
|
37
|
+
"@instructure/shared-types": "8.18.1-snapshot.12+ca14b3dc8",
|
|
38
|
+
"@instructure/ui-a11y-utils": "8.18.1-snapshot.12+ca14b3dc8",
|
|
39
|
+
"@instructure/ui-dom-utils": "8.18.1-snapshot.12+ca14b3dc8",
|
|
40
|
+
"@instructure/ui-icons": "8.18.1-snapshot.12+ca14b3dc8",
|
|
41
|
+
"@instructure/ui-popover": "8.18.1-snapshot.12+ca14b3dc8",
|
|
42
|
+
"@instructure/ui-position": "8.18.1-snapshot.12+ca14b3dc8",
|
|
43
|
+
"@instructure/ui-prop-types": "8.18.1-snapshot.12+ca14b3dc8",
|
|
44
|
+
"@instructure/ui-react-utils": "8.18.1-snapshot.12+ca14b3dc8",
|
|
45
|
+
"@instructure/ui-testable": "8.18.1-snapshot.12+ca14b3dc8",
|
|
46
|
+
"@instructure/ui-utils": "8.18.1-snapshot.12+ca14b3dc8",
|
|
47
47
|
"keycode": "^2",
|
|
48
48
|
"prop-types": "^15"
|
|
49
49
|
},
|
|
@@ -53,5 +53,6 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"sideEffects": false
|
|
56
|
+
"sideEffects": false,
|
|
57
|
+
"gitHead": "ca14b3dc8f0315daef7b86aa05f711e6d6684c58"
|
|
57
58
|
}
|