@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.
@@ -39,9 +39,9 @@ const generateComponentTheme = theme => {
39
39
  spacing = theme.spacing,
40
40
  borders = theme.borders;
41
41
  const componentVariables = {
42
- background: colors?.backgroundMedium,
43
- height: borders?.widthSmall,
44
- margin: `0 ${spacing?.small}`
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
- this.props.makeStyles?.();
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
- this.props.makeStyles?.();
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
- (0, _console.logError)(!!this._menu?.focus, '[Menu] Could not focus the menu.');
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
- (0, _console.logError)(!!this._trigger?.focus, '[Menu] Could not focus the trigger.');
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$props = this.props,
284
- children = _this$props.children,
285
- disabled = _this$props.disabled;
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
- const _this$props2 = this.props,
366
- disabled = _this$props2.disabled,
367
- label = _this$props2.label,
368
- trigger = _this$props2.trigger,
369
- onKeyUp = _this$props2.onKeyUp;
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?.menu,
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$props3 = this.props,
393
- show = _this$props3.show,
394
- defaultShow = _this$props3.defaultShow,
395
- placement = _this$props3.placement,
396
- withArrow = _this$props3.withArrow,
397
- trigger = _this$props3.trigger,
398
- mountNode = _this$props3.mountNode,
399
- popoverRef = _this$props3.popoverRef,
400
- disabled = _this$props3.disabled,
401
- onDismiss = _this$props3.onDismiss,
402
- onFocus = _this$props3.onFocus,
403
- onMouseOver = _this$props3.onMouseOver,
404
- offsetX = _this$props3.offsetX,
405
- offsetY = _this$props3.offsetY;
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?.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?.xxSmall,
43
- maxWidth: breakpoints?.xSmall,
44
- background: colors?.backgroundLightest,
45
- focusBorderStyle: borders?.style,
46
- focusBorderWidth: borders?.widthMedium,
47
- focusBorderColor: colors?.borderBrand,
48
- focusBorderRadius: borders?.radiusMedium
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.0",
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.0",
27
- "@instructure/ui-color-utils": "8.18.0",
28
- "@instructure/ui-test-locator": "8.18.0",
29
- "@instructure/ui-test-queries": "8.18.0",
30
- "@instructure/ui-test-utils": "8.18.0",
31
- "@instructure/ui-themes": "8.18.0"
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.0",
36
- "@instructure/emotion": "8.18.0",
37
- "@instructure/shared-types": "8.18.0",
38
- "@instructure/ui-a11y-utils": "8.18.0",
39
- "@instructure/ui-dom-utils": "8.18.0",
40
- "@instructure/ui-icons": "8.18.0",
41
- "@instructure/ui-popover": "8.18.0",
42
- "@instructure/ui-position": "8.18.0",
43
- "@instructure/ui-prop-types": "8.18.0",
44
- "@instructure/ui-react-utils": "8.18.0",
45
- "@instructure/ui-testable": "8.18.0",
46
- "@instructure/ui-utils": "8.18.0",
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
  }