@instructure/ui-menu 8.8.1-snapshot.3 → 8.8.1-snapshot.63

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.
Files changed (61) hide show
  1. package/es/Menu/MenuItem/index.js +14 -60
  2. package/es/Menu/MenuItem/props.js +67 -0
  3. package/es/Menu/MenuItemGroup/index.js +10 -57
  4. package/es/Menu/MenuItemGroup/props.js +71 -0
  5. package/es/Menu/MenuItemSeparator/index.js +5 -8
  6. package/{src/Menu/MenuItemSeparator/types.ts → es/Menu/MenuItemSeparator/props.js} +5 -5
  7. package/es/Menu/index.js +5 -151
  8. package/es/Menu/props.js +167 -0
  9. package/lib/Menu/MenuItem/index.js +15 -62
  10. package/lib/Menu/MenuItem/props.js +79 -0
  11. package/lib/Menu/MenuItemGroup/index.js +11 -62
  12. package/lib/Menu/MenuItemGroup/props.js +87 -0
  13. package/lib/Menu/MenuItemSeparator/index.js +6 -9
  14. package/{src/Menu/MenuItemGroup/types.ts → lib/Menu/MenuItemSeparator/props.js} +13 -16
  15. package/lib/Menu/index.js +6 -156
  16. package/lib/Menu/props.js +182 -0
  17. package/package.json +21 -21
  18. package/src/Menu/MenuItem/index.tsx +14 -56
  19. package/src/Menu/MenuItem/props.ts +109 -0
  20. package/src/Menu/MenuItem/styles.ts +1 -1
  21. package/src/Menu/MenuItemGroup/index.tsx +9 -56
  22. package/src/Menu/MenuItemGroup/props.ts +110 -0
  23. package/src/Menu/MenuItemSeparator/index.tsx +6 -9
  24. package/src/Menu/{MenuItem/types.ts → MenuItemSeparator/props.ts} +19 -19
  25. package/src/Menu/index.tsx +6 -139
  26. package/src/Menu/props.ts +235 -0
  27. package/src/index.ts +4 -4
  28. package/types/Menu/MenuItem/index.d.ts +37 -45
  29. package/types/Menu/MenuItem/index.d.ts.map +1 -1
  30. package/types/Menu/MenuItem/props.d.ts +27 -0
  31. package/types/Menu/MenuItem/props.d.ts.map +1 -0
  32. package/types/Menu/MenuItem/styles.d.ts +1 -1
  33. package/types/Menu/MenuItemGroup/index.d.ts +29 -46
  34. package/types/Menu/MenuItemGroup/index.d.ts.map +1 -1
  35. package/types/Menu/MenuItemGroup/props.d.ts +25 -0
  36. package/types/Menu/MenuItemGroup/props.d.ts.map +1 -0
  37. package/types/Menu/MenuItemSeparator/index.d.ts +3 -6
  38. package/types/Menu/MenuItemSeparator/index.d.ts.map +1 -1
  39. package/types/Menu/MenuItemSeparator/props.d.ts +11 -0
  40. package/types/Menu/MenuItemSeparator/props.d.ts.map +1 -0
  41. package/types/Menu/index.d.ts +60 -122
  42. package/types/Menu/index.d.ts.map +1 -1
  43. package/types/Menu/{types.d.ts → props.d.ts} +12 -4
  44. package/types/Menu/props.d.ts.map +1 -0
  45. package/types/index.d.ts +4 -4
  46. package/es/Menu/MenuItem/types.js +0 -1
  47. package/es/Menu/MenuItemGroup/types.js +0 -1
  48. package/es/Menu/MenuItemSeparator/types.js +0 -1
  49. package/es/Menu/types.js +0 -1
  50. package/lib/Menu/MenuItem/types.js +0 -1
  51. package/lib/Menu/MenuItemGroup/types.js +0 -1
  52. package/lib/Menu/MenuItemSeparator/types.js +0 -1
  53. package/lib/Menu/types.js +0 -1
  54. package/src/Menu/types.ts +0 -63
  55. package/types/Menu/MenuItem/types.d.ts +0 -19
  56. package/types/Menu/MenuItem/types.d.ts.map +0 -1
  57. package/types/Menu/MenuItemGroup/types.d.ts +0 -17
  58. package/types/Menu/MenuItemGroup/types.d.ts.map +0 -1
  59. package/types/Menu/MenuItemSeparator/types.d.ts +0 -5
  60. package/types/Menu/MenuItemSeparator/types.d.ts.map +0 -1
  61. package/types/Menu/types.d.ts.map +0 -1
@@ -0,0 +1,167 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ import PropTypes from 'prop-types';
25
+ import { PositionPropTypes } from '@instructure/ui-position';
26
+ import { controllable, Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
27
+ const propTypes = {
28
+ /**
29
+ * Children of type `Menu.Item`, `Menu.Group`, `Menu.Separator`, or `Menu`
30
+ */
31
+ children: ChildrenPropTypes.oneOf(['MenuItem', 'MenuItemGroup', 'MenuItemSeparator', 'Menu']),
32
+
33
+ /**
34
+ * Description of the `<Menu />`
35
+ */
36
+ label: PropTypes.string,
37
+
38
+ /**
39
+ * Is the `<Menu />` disabled
40
+ */
41
+ disabled: PropTypes.bool,
42
+
43
+ /**
44
+ * The trigger element, if the `<Menu />` is to render as a popover
45
+ */
46
+ trigger: PropTypes.node,
47
+
48
+ /**
49
+ * If a trigger is supplied, where should the `<Menu />` be placed (relative to the trigger)
50
+ */
51
+ placement: PositionPropTypes.placement,
52
+
53
+ /**
54
+ * Should the `<Menu />` be open for the initial render
55
+ */
56
+ defaultShow: PropTypes.bool,
57
+
58
+ /**
59
+ * Is the `<Menu />` open (should be accompanied by `onToggle`)
60
+ */
61
+ show: controllable(PropTypes.bool, 'onToggle', 'defaultShow'),
62
+
63
+ /**
64
+ * Callback fired when the `<Menu />` is toggled open/closed. When used with `show`,
65
+ * the component will not control its own state.
66
+ */
67
+ onToggle: PropTypes.func,
68
+
69
+ /**
70
+ * Callback fired when an item within the `<Menu />` is selected
71
+ */
72
+ onSelect: PropTypes.func,
73
+
74
+ /**
75
+ * If a trigger is supplied, callback fired when the `<Menu />` is closed
76
+ */
77
+ onDismiss: PropTypes.func,
78
+
79
+ /**
80
+ * If a trigger is supplied, callback fired when the `<Menu />` trigger is blurred
81
+ */
82
+ onBlur: PropTypes.func,
83
+
84
+ /**
85
+ * If a trigger is supplied, callback fired when the `<Menu />` trigger is focused
86
+ */
87
+ onFocus: PropTypes.func,
88
+
89
+ /**
90
+ * If a trigger is supplied, callback fired onMouseOver for the `<Menu />` trigger
91
+ */
92
+ onMouseOver: PropTypes.func,
93
+
94
+ /**
95
+ * Callback fired on the onKeyDown of the `<Menu />`
96
+ */
97
+ onKeyDown: PropTypes.func,
98
+
99
+ /**
100
+ * Callback fired on the onKeyUp of the `<Menu />`
101
+ */
102
+ onKeyUp: PropTypes.func,
103
+
104
+ /**
105
+ * A function that returns a reference to the `<Menu />`
106
+ */
107
+ menuRef: PropTypes.func,
108
+
109
+ /**
110
+ * A function that returns a reference to the `<Popover />`
111
+ */
112
+ popoverRef: PropTypes.func,
113
+
114
+ /**
115
+ * If a trigger is supplied, an element or a function returning an element to use as the mount node
116
+ * for the `<Menu />` (defaults to `document.body`)
117
+ */
118
+ mountNode: PositionPropTypes.mountNode,
119
+
120
+ /**
121
+ * The parent in which to constrain the menu.
122
+ * One of: 'window', 'scroll-parent', 'parent', 'none', an element,
123
+ * or a function returning an element
124
+ */
125
+ constrain: PositionPropTypes.constrain,
126
+
127
+ /**
128
+ * If a trigger is supplied, an element, function returning an element, or array of elements that will not
129
+ * be hidden from the screen reader when the `<Menu />` is open
130
+ */
131
+ liveRegion: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element, PropTypes.func]),
132
+
133
+ /**
134
+ * If a trigger is supplied, should the `<Menu />` hide when an item is selected
135
+ */
136
+ shouldHideOnSelect: PropTypes.bool,
137
+
138
+ /**
139
+ * If a trigger is supplied, should the `<Menu />` focus the trigger on after closing
140
+ */
141
+ shouldFocusTriggerOnClose: PropTypes.bool,
142
+
143
+ /**
144
+ * The type of `<Menu />`
145
+ */
146
+ type: PropTypes.oneOf(['flyout']),
147
+ id: PropTypes.string,
148
+
149
+ /**
150
+ * Whether or not an arrow pointing to the trigger should be rendered
151
+ */
152
+ withArrow: PropTypes.bool,
153
+
154
+ /**
155
+ * The horizontal offset for the positioned content.
156
+ * Works only if `trigger` is provided.
157
+ */
158
+ offsetX: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
159
+
160
+ /**
161
+ * The vertical offset for the positioned content.
162
+ * Works only if `trigger` is provided.
163
+ */
164
+ offsetY: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
165
+ };
166
+ const allowedProps = ['children', 'label', 'disabled', 'trigger', 'placement', 'defaultShow', 'show', 'onToggle', 'onSelect', 'onDismiss', 'onBlur', 'onFocus', 'onMouseOver', 'onKeyDown', 'onKeyUp', 'menuRef', 'popoverRef', 'mountNode', 'constrain', 'liveRegion', 'shouldHideOnSelect', 'shouldFocusTriggerOnClose', 'type', 'id', 'withArrow', 'offsetX', 'offsetY'];
167
+ export { propTypes, allowedProps };
@@ -9,8 +9,6 @@ exports.MenuItem = exports.default = void 0;
9
9
 
10
10
  var _react = require("react");
11
11
 
12
- var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
12
  var _keycode = _interopRequireDefault(require("keycode"));
15
13
 
16
14
  var _IconCheckSolid2 = require("@instructure/ui-icons/lib/IconCheckSolid.js");
@@ -19,8 +17,6 @@ var _IconArrowOpenEndSolid = require("@instructure/ui-icons/lib/IconArrowOpenEnd
19
17
 
20
18
  var _uid = require("@instructure/uid");
21
19
 
22
- var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
23
-
24
20
  var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
25
21
 
26
22
  var _getElementType = require("@instructure/ui-react-utils/lib/getElementType.js");
@@ -41,6 +37,8 @@ var _styles = _interopRequireDefault(require("./styles"));
41
37
 
42
38
  var _theme = _interopRequireDefault(require("./theme"));
43
39
 
40
+ var _props = require("./props");
41
+
44
42
  var _dec, _dec2, _class, _class2, _temp, _IconCheckSolid, _IconArrowOpenEndSoli;
45
43
 
46
44
  /**
@@ -182,20 +180,24 @@ let MenuItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
182
180
  }
183
181
 
184
182
  renderContent() {
183
+ var _this$props$styles, _this$props$styles2, _this$props$styles3;
184
+
185
185
  const _this$props2 = this.props,
186
186
  children = _this$props2.children,
187
187
  type = _this$props2.type;
188
188
  return (0, _emotion.jsx)("span", null, (type === 'checkbox' || type === 'radio') && (0, _emotion.jsx)("span", {
189
- css: this.props.styles.icon
189
+ css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.icon
190
190
  }, this.selected && (_IconCheckSolid || (_IconCheckSolid = (0, _emotion.jsx)(_IconCheckSolid2.IconCheckSolid, null)))), (0, _emotion.jsx)("span", {
191
- css: this.props.styles.label,
191
+ css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.label,
192
192
  id: this.labelId
193
193
  }, children), type === 'flyout' && (0, _emotion.jsx)("span", {
194
- css: this.props.styles.icon
194
+ css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.icon
195
195
  }, _IconArrowOpenEndSoli || (_IconArrowOpenEndSoli = (0, _emotion.jsx)(_IconArrowOpenEndSolid.IconArrowOpenEndSolid, null))));
196
196
  }
197
197
 
198
198
  render() {
199
+ var _this$props$styles4;
200
+
199
201
  const _this$props3 = this.props,
200
202
  disabled = _this$props3.disabled,
201
203
  controls = _this$props3.controls,
@@ -207,79 +209,30 @@ let MenuItem = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default),
207
209
  const ElementType = this.elementType;
208
210
  return (0, _emotion.jsx)(ElementType // eslint-disable-line jsx-a11y/mouse-events-have-key-events
209
211
  , Object.assign({
210
- tabIndex: "-1" // note: tabIndex can be overridden by Menu or MenuItemGroup components
212
+ tabIndex: -1 // note: tabIndex can be overridden by Menu or MenuItemGroup components
211
213
 
212
214
  }, props, {
213
215
  href: href,
214
216
  role: this.role,
215
217
  "aria-labelledby": this.labelId,
216
- "aria-disabled": disabled ? 'true' : null,
218
+ "aria-disabled": disabled ? 'true' : void 0,
217
219
  "aria-controls": controls,
218
- "aria-checked": type === 'checkbox' || type === 'radio' ? this.selected ? 'true' : 'false' : null,
220
+ "aria-checked": type === 'checkbox' || type === 'radio' ? this.selected ? 'true' : 'false' : void 0,
219
221
  onClick: this.handleClick,
220
222
  onKeyUp: (0, _createChainedFunction.createChainedFunction)(onKeyUp, this.handleKeyUp),
221
223
  onKeyDown: (0, _createChainedFunction.createChainedFunction)(onKeyDown, this.handleKeyDown),
222
224
  ref: c => {
223
225
  this._node = c;
224
226
  },
225
- css: this.props.styles.menuItem,
227
+ css: (_this$props$styles4 = this.props.styles) === null || _this$props$styles4 === void 0 ? void 0 : _this$props$styles4.menuItem,
226
228
  onMouseOver: this.handleMouseOver
227
229
  }), this.renderContent());
228
230
  }
229
231
 
230
- }, _class2.displayName = "MenuItem", _class2.componentId = 'Menu.Item', _class2.propTypes = {
231
- // eslint-disable-next-line react/require-default-props
232
- makeStyles: _propTypes.default.func,
233
- // eslint-disable-next-line react/require-default-props
234
- styles: _propTypes.default.object,
235
-
236
- /* the menu item label */
237
- children: _propTypes.default.node.isRequired,
238
-
239
- /* whether to set the menu item state to selected or not on initial render */
240
- defaultSelected: _propTypes.default.bool,
241
-
242
- /**
243
- * whether the menu item is selected or not (must be accompanied by an `onSelect` prop)
244
- */
245
- selected: (0, _controllable.controllable)(_propTypes.default.bool, 'onSelect', 'defaultSelected'),
246
-
247
- /**
248
- * when used with the `selected` prop, the component will not control its own state
249
- */
250
- onSelect: _propTypes.default.func,
251
- onClick: _propTypes.default.func,
252
- onKeyDown: _propTypes.default.func,
253
- onKeyUp: _propTypes.default.func,
254
- onMouseOver: _propTypes.default.func,
255
-
256
- /**
257
- * the id of the element that the menu item will act upon
258
- */
259
- controls: _propTypes.default.string,
260
- disabled: _propTypes.default.bool,
261
-
262
- /**
263
- * the element type to render as (will default to `<a>` if href is provided)
264
- */
265
- as: _propTypes.default.elementType,
266
- // eslint-disable-line react/require-default-props
267
- type: _propTypes.default.oneOf(['button', 'checkbox', 'radio', 'flyout']),
268
- value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
269
- href: _propTypes.default.string
270
- }, _class2.defaultProps = {
232
+ }, _class2.displayName = "MenuItem", _class2.componentId = 'Menu.Item', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
271
233
  type: 'button',
272
234
  disabled: false,
273
- onSelect: function (e, value, selected, item) {},
274
- defaultSelected: void 0,
275
- selected: void 0,
276
- onClick: void 0,
277
- onKeyDown: void 0,
278
- onKeyUp: void 0,
279
- onMouseOver: void 0,
280
- controls: void 0,
281
- value: void 0,
282
- href: void 0
235
+ onSelect: function (e, value, selected, item) {}
283
236
  }, _class2.contextType = _MenuContext.MenuContext, _temp)) || _class) || _class);
284
237
  exports.MenuItem = MenuItem;
285
238
  var _default = MenuItem;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.allowedProps = exports.propTypes = void 0;
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
13
+
14
+ /*
15
+ * The MIT License (MIT)
16
+ *
17
+ * Copyright (c) 2015 - present Instructure, Inc.
18
+ *
19
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
20
+ * of this software and associated documentation files (the "Software"), to deal
21
+ * in the Software without restriction, including without limitation the rights
22
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23
+ * copies of the Software, and to permit persons to whom the Software is
24
+ * furnished to do so, subject to the following conditions:
25
+ *
26
+ * The above copyright notice and this permission notice shall be included in all
27
+ * copies or substantial portions of the Software.
28
+ *
29
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
+ * SOFTWARE.
36
+ */
37
+ const propTypes = {
38
+ /**
39
+ * the menu item label
40
+ */
41
+ children: _propTypes.default.node.isRequired,
42
+
43
+ /**
44
+ * whether to set the menu item state to selected or not on initial render
45
+ */
46
+ defaultSelected: _propTypes.default.bool,
47
+
48
+ /**
49
+ * whether the menu item is selected or not (must be accompanied by an `onSelect` prop)
50
+ */
51
+ selected: (0, _controllable.controllable)(_propTypes.default.bool, 'onSelect', 'defaultSelected'),
52
+
53
+ /**
54
+ * when used with the `selected` prop, the component will not control its own state
55
+ */
56
+ onSelect: _propTypes.default.func,
57
+ onClick: _propTypes.default.func,
58
+ onKeyDown: _propTypes.default.func,
59
+ onKeyUp: _propTypes.default.func,
60
+ onMouseOver: _propTypes.default.func,
61
+
62
+ /**
63
+ * the id of the element that the menu item will act upon
64
+ */
65
+ controls: _propTypes.default.string,
66
+ disabled: _propTypes.default.bool,
67
+
68
+ /**
69
+ * the element type to render as (will default to `<a>` if href is provided)
70
+ */
71
+ as: _propTypes.default.elementType,
72
+ // eslint-disable-line react/require-default-props
73
+ type: _propTypes.default.oneOf(['button', 'checkbox', 'radio', 'flyout']),
74
+ value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
75
+ href: _propTypes.default.string
76
+ };
77
+ exports.propTypes = propTypes;
78
+ const allowedProps = ['children', 'defaultSelected', 'selected', 'onSelect', 'onClick', 'onKeyDown', 'onKeyUp', 'onMouseOver', 'controls', 'disabled', 'as', 'type', 'value', 'href'];
79
+ exports.allowedProps = allowedProps;
@@ -9,14 +9,8 @@ exports.MenuItemGroup = exports.default = void 0;
9
9
 
10
10
  var _react = require("react");
11
11
 
12
- var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
12
  var _emotion = require("@instructure/emotion");
15
13
 
16
- var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
17
-
18
- var _Children = require("@instructure/ui-prop-types/lib/Children.js");
19
-
20
14
  var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
21
15
 
22
16
  var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
@@ -31,12 +25,12 @@ var _testable = require("@instructure/ui-testable/lib/testable.js");
31
25
 
32
26
  var _MenuItem = require("../MenuItem");
33
27
 
34
- var _MenuItemSeparator = require("../MenuItemSeparator");
35
-
36
28
  var _styles = _interopRequireDefault(require("./styles"));
37
29
 
38
30
  var _theme = _interopRequireDefault(require("./theme"));
39
31
 
32
+ var _props = require("./props");
33
+
40
34
  var _dec, _dec2, _class, _class2, _temp;
41
35
 
42
36
  /**
@@ -130,9 +124,11 @@ let MenuItemGroup = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defa
130
124
  }
131
125
 
132
126
  renderLabel() {
127
+ var _this$props$styles;
128
+
133
129
  const label = this.props.label;
134
130
  return (0, _hasVisibleChildren.hasVisibleChildren)(label) ? (0, _emotion.jsx)("span", {
135
- css: this.props.styles.label
131
+ css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.label
136
132
  }, label) : label;
137
133
  }
138
134
 
@@ -169,71 +165,24 @@ let MenuItemGroup = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defa
169
165
  }
170
166
 
171
167
  render() {
168
+ var _this$props$styles2, _this$props$styles3;
169
+
172
170
  const props = (0, _omitProps.omitProps)(this.props, MenuItemGroup.propTypes);
173
171
  return (0, _emotion.jsx)("span", Object.assign({}, props, {
174
- css: this.props.styles.menuItemGroup,
172
+ css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.menuItemGroup,
175
173
  role: "presentation"
176
174
  }), (0, _emotion.jsx)("span", {
177
175
  id: this._labelId
178
176
  }, this.renderLabel()), (0, _emotion.jsx)("ul", {
179
177
  role: "menu",
180
- css: this.props.styles.items,
181
- "aria-disabled": this.props.disabled ? 'true' : null,
178
+ css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.items,
179
+ "aria-disabled": this.props.disabled ? 'true' : void 0,
182
180
  "aria-labelledby": this._labelId
183
181
  }, this.renderChildren()));
184
182
  }
185
183
 
186
- }, _class2.displayName = "MenuItemGroup", _class2.componentId = 'Menu.Group', _class2.propTypes = {
187
- // eslint-disable-next-line react/require-default-props
188
- makeStyles: _propTypes.default.func,
189
- // eslint-disable-next-line react/require-default-props
190
- styles: _propTypes.default.object,
191
- label: _propTypes.default.node.isRequired,
192
- allowMultiple: _propTypes.default.bool,
193
-
194
- /**
195
- * children of type `Menu.Item`, `Menu.Separator`
196
- */
197
- children: _Children.Children.oneOf([_MenuItem.MenuItem, _MenuItemSeparator.MenuItemSeparator]),
198
-
199
- /**
200
- * an array of the values (or indices by default) for the selected items
201
- */
202
- selected: (0, _controllable.controllable)(_propTypes.default.array, 'onSelect', 'defaultSelected'),
203
-
204
- /**
205
- * an array of the values (or indices by default) for the selected items on initial render
206
- */
207
- defaultSelected: _propTypes.default.array,
208
-
209
- /**
210
- * call this function when a menu item is selected
211
- */
212
- onSelect: _propTypes.default.func,
213
- onMouseOver: _propTypes.default.func,
214
- onKeyDown: _propTypes.default.func,
215
-
216
- /**
217
- * the id of the element that the menu items will act upon
218
- */
219
- controls: _propTypes.default.string,
220
-
221
- /**
222
- * returns a reference to the `MenuItem`
223
- */
224
- itemRef: _propTypes.default.func,
225
- disabled: _propTypes.default.bool,
226
-
227
- /**
228
- * should the group appear in the tab order (the first item will have a tabIndex of 0)
229
- */
230
- isTabbable: _propTypes.default.bool
231
- }, _class2.defaultProps = {
232
- onMouseOver: void 0,
184
+ }, _class2.displayName = "MenuItemGroup", _class2.componentId = 'Menu.Group', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
233
185
  disabled: false,
234
- controls: void 0,
235
- onKeyDown: void 0,
236
- selected: void 0,
237
186
  children: null,
238
187
  isTabbable: false,
239
188
  allowMultiple: false,