@instructure/ui-menu 11.7.3-snapshot-7 → 11.7.3-snapshot-26

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 CHANGED
@@ -3,9 +3,12 @@
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
- ## [11.7.3-snapshot-7](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-7) (2026-04-29)
6
+ ## [11.7.3-snapshot-26](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-26) (2026-05-05)
7
7
 
8
- **Note:** Version bump only for package @instructure/ui-menu
8
+
9
+ ### Bug Fixes
10
+
11
+ * **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
9
12
 
10
13
 
11
14
 
@@ -1,4 +1,4 @@
1
- var _dec, _dec2, _class, _MenuItem, _IconCheckSolid, _IconArrowOpenEndSoli;
1
+ var _dec, _dec2, _class;
2
2
  /*
3
3
  * The MIT License (MIT)
4
4
  *
@@ -41,71 +41,17 @@ parent: Menu
41
41
  id: Menu.Item
42
42
  ---
43
43
  **/
44
- let MenuItem = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_MenuItem = class MenuItem extends Component {
44
+ let MenuItem = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = class MenuItem extends Component {
45
+ static displayName = "MenuItem";
46
+ static componentId = 'Menu.Item';
47
+ static allowedProps = allowedProps;
48
+ static defaultProps = {
49
+ type: 'button',
50
+ disabled: false
51
+ };
52
+ static contextType = MenuContext;
45
53
  constructor(props) {
46
54
  super(props);
47
- this.labelId = void 0;
48
- this.ref = null;
49
- this.handleRef = el => {
50
- this.ref = el;
51
- };
52
- this.handleClick = e => {
53
- const _this$props = this.props,
54
- onSelect = _this$props.onSelect,
55
- onClick = _this$props.onClick,
56
- disabled = _this$props.disabled,
57
- value = _this$props.value;
58
- const selected = !this.selected;
59
- if (disabled) {
60
- e.preventDefault();
61
- return;
62
- }
63
- if (typeof this.props.selected === 'undefined') {
64
- this.setState({
65
- selected
66
- });
67
- }
68
- if (typeof onSelect === 'function') {
69
- e.persist();
70
- onSelect(e, value, selected, this);
71
- }
72
- if (typeof onClick === 'function') {
73
- onClick(e);
74
- }
75
- };
76
- this.handleKeyDown = e => {
77
- const spaceKey = e.keyCode === keycode.codes.space;
78
- const enterKey = e.keyCode === keycode.codes.enter;
79
- if (spaceKey || enterKey) {
80
- e.preventDefault();
81
- e.stopPropagation();
82
- if (enterKey) {
83
- // handle space key on keyUp for FF
84
- const refNode = findDOMNode(this.ref);
85
- refNode.click();
86
- }
87
- }
88
- };
89
- this.handleKeyUp = e => {
90
- const spaceKey = e.keyCode === keycode.codes.space;
91
- const enterKey = e.keyCode === keycode.codes.enter;
92
- if (spaceKey || enterKey) {
93
- e.preventDefault();
94
- e.stopPropagation();
95
- if (spaceKey) {
96
- const refNode = findDOMNode(this.ref);
97
- refNode.click();
98
- }
99
- }
100
- };
101
- this.handleMouseOver = event => {
102
- if (!this.focused) {
103
- this.focus();
104
- }
105
- if (typeof this.props.onMouseOver === 'function') {
106
- this.props.onMouseOver(event, this);
107
- }
108
- };
109
55
  if (typeof props.selected === 'undefined') {
110
56
  this.state = {
111
57
  selected: !!props.defaultSelected
@@ -116,17 +62,20 @@ let MenuItem = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, g
116
62
  get _node() {
117
63
  return this.ref;
118
64
  }
65
+ labelId;
66
+ ref = null;
67
+ handleRef = el => {
68
+ this.ref = el;
69
+ };
119
70
  componentDidMount() {
120
- var _this$props$makeStyle, _this$props2;
121
- (_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
71
+ this.props.makeStyles?.();
122
72
  const context = this.context;
123
73
  if (context && context.registerMenuItem) {
124
74
  context.registerMenuItem(this);
125
75
  }
126
76
  }
127
77
  componentDidUpdate() {
128
- var _this$props$makeStyle2, _this$props3;
129
- (_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
78
+ this.props.makeStyles?.();
130
79
  }
131
80
  componentWillUnmount() {
132
81
  const context = this.context;
@@ -134,6 +83,64 @@ let MenuItem = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, g
134
83
  context.removeMenuItem(this);
135
84
  }
136
85
  }
86
+ handleClick = e => {
87
+ const {
88
+ onSelect,
89
+ onClick,
90
+ disabled,
91
+ value
92
+ } = this.props;
93
+ const selected = !this.selected;
94
+ if (disabled) {
95
+ e.preventDefault();
96
+ return;
97
+ }
98
+ if (typeof this.props.selected === 'undefined') {
99
+ this.setState({
100
+ selected
101
+ });
102
+ }
103
+ if (typeof onSelect === 'function') {
104
+ e.persist();
105
+ onSelect(e, value, selected, this);
106
+ }
107
+ if (typeof onClick === 'function') {
108
+ onClick(e);
109
+ }
110
+ };
111
+ handleKeyDown = e => {
112
+ const spaceKey = e.keyCode === keycode.codes.space;
113
+ const enterKey = e.keyCode === keycode.codes.enter;
114
+ if (spaceKey || enterKey) {
115
+ e.preventDefault();
116
+ e.stopPropagation();
117
+ if (enterKey) {
118
+ // handle space key on keyUp for FF
119
+ const refNode = findDOMNode(this.ref);
120
+ refNode.click();
121
+ }
122
+ }
123
+ };
124
+ handleKeyUp = e => {
125
+ const spaceKey = e.keyCode === keycode.codes.space;
126
+ const enterKey = e.keyCode === keycode.codes.enter;
127
+ if (spaceKey || enterKey) {
128
+ e.preventDefault();
129
+ e.stopPropagation();
130
+ if (spaceKey) {
131
+ const refNode = findDOMNode(this.ref);
132
+ refNode.click();
133
+ }
134
+ }
135
+ };
136
+ handleMouseOver = event => {
137
+ if (!this.focused) {
138
+ this.focus();
139
+ }
140
+ if (typeof this.props.onMouseOver === 'function') {
141
+ this.props.onMouseOver(event, this);
142
+ }
143
+ };
137
144
  get elementType() {
138
145
  return getElementType(MenuItem, this.props);
139
146
  }
@@ -158,38 +165,38 @@ let MenuItem = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, g
158
165
  refNode.focus();
159
166
  }
160
167
  renderContent() {
161
- var _this$props$styles, _this$props$styles2, _this$props$styles3, _this$props$styles4;
162
- const _this$props4 = this.props,
163
- children = _this$props4.children,
164
- type = _this$props4.type,
165
- renderLabelInfo = _this$props4.renderLabelInfo;
168
+ const {
169
+ children,
170
+ type,
171
+ renderLabelInfo
172
+ } = this.props;
166
173
  return _jsxs("span", {
167
174
  children: [(type === 'checkbox' || type === 'radio') && _jsx("span", {
168
- css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.icon,
169
- children: this.selected && (_IconCheckSolid || (_IconCheckSolid = _jsx(IconCheckSolid, {})))
175
+ css: this.props.styles?.icon,
176
+ children: this.selected && _jsx(IconCheckSolid, {})
170
177
  }), _jsx("span", {
171
- css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.label,
178
+ css: this.props.styles?.label,
172
179
  id: this.labelId,
173
180
  children: children
174
181
  }), type === 'flyout' && _jsx("span", {
175
- css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.icon,
176
- children: _IconArrowOpenEndSoli || (_IconArrowOpenEndSoli = _jsx(IconArrowOpenEndSolid, {}))
182
+ css: this.props.styles?.icon,
183
+ children: _jsx(IconArrowOpenEndSolid, {})
177
184
  }), renderLabelInfo && _jsx("span", {
178
- css: (_this$props$styles4 = this.props.styles) === null || _this$props$styles4 === void 0 ? void 0 : _this$props$styles4.labelInfo,
185
+ css: this.props.styles?.labelInfo,
179
186
  children: callRenderProp(renderLabelInfo)
180
187
  })]
181
188
  });
182
189
  }
183
190
  render() {
184
- var _this$props$styles5;
185
- const _this$props5 = this.props,
186
- disabled = _this$props5.disabled,
187
- controls = _this$props5.controls,
188
- onKeyDown = _this$props5.onKeyDown,
189
- onKeyUp = _this$props5.onKeyUp,
190
- type = _this$props5.type,
191
- href = _this$props5.href,
192
- target = _this$props5.target;
191
+ const {
192
+ disabled,
193
+ controls,
194
+ onKeyDown,
195
+ onKeyUp,
196
+ type,
197
+ href,
198
+ target
199
+ } = this.props;
193
200
  const props = omitProps(this.props, MenuItem.allowedProps);
194
201
  const ElementType = this.elementType;
195
202
  return _jsx(ElementType, {
@@ -200,22 +207,19 @@ let MenuItem = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, g
200
207
  target: target,
201
208
  role: this.role,
202
209
  "aria-labelledby": this.labelId,
203
- "aria-disabled": disabled ? 'true' : void 0,
210
+ "aria-disabled": disabled ? 'true' : undefined,
204
211
  "aria-controls": controls,
205
- "aria-checked": type === 'checkbox' || type === 'radio' ? this.selected ? 'true' : 'false' : void 0,
212
+ "aria-checked": type === 'checkbox' || type === 'radio' ? this.selected ? 'true' : 'false' : undefined,
206
213
  onClick: this.handleClick,
207
214
  onKeyUp: createChainedFunction(onKeyUp, this.handleKeyUp),
208
215
  onKeyDown: createChainedFunction(onKeyDown, this.handleKeyDown),
209
216
  ref: this.handleRef,
210
- css: (_this$props$styles5 = this.props.styles) === null || _this$props$styles5 === void 0 ? void 0 : _this$props$styles5.menuItem,
217
+ css: this.props.styles?.menuItem,
211
218
  onMouseOver: this.handleMouseOver,
212
219
  "data-cid": "MenuItem",
213
220
  children: this.renderContent()
214
221
  });
215
222
  }
216
- }, _MenuItem.displayName = "MenuItem", _MenuItem.componentId = 'Menu.Item', _MenuItem.allowedProps = allowedProps, _MenuItem.defaultProps = {
217
- type: 'button',
218
- disabled: false
219
- }, _MenuItem.contextType = MenuContext, _MenuItem)) || _class) || _class);
223
+ }) || _class) || _class);
220
224
  export default MenuItem;
221
225
  export { MenuItem };
@@ -33,8 +33,10 @@
33
33
  * @return {Object} The final style object, which will be used in the component
34
34
  */
35
35
  const generateStyle = (componentTheme, props) => {
36
- const type = props.type,
37
- disabled = props.disabled;
36
+ const {
37
+ type,
38
+ disabled
39
+ } = props;
38
40
  const isRadioOrCheckbox = type === 'checkbox' || type === 'radio';
39
41
  const flyoutIconStyles = type === 'flyout' ? {
40
42
  insetInlineStart: 'auto',
@@ -28,11 +28,12 @@
28
28
  * @return {Object} The final theme object with the overrides and component variables
29
29
  */
30
30
  const generateComponentTheme = theme => {
31
- var _colors$contrasts, _colors$contrasts2, _colors$contrasts3, _colors$contrasts4, _colors$contrasts5, _colors$contrasts6, _colors$contrasts7;
32
- const colors = theme.colors,
33
- typography = theme.typography,
34
- spacing = theme.spacing,
35
- themeName = theme.key;
31
+ const {
32
+ colors,
33
+ typography,
34
+ spacing,
35
+ key: themeName
36
+ } = theme;
36
37
  const themeSpecificStyle = {
37
38
  canvas: {
38
39
  labelColor: theme['ic-brand-font-color-dark'],
@@ -41,20 +42,20 @@ const generateComponentTheme = theme => {
41
42
  }
42
43
  };
43
44
  const componentVariables = {
44
- padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`,
45
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
46
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightNormal,
47
- lineHeight: typography === null || typography === void 0 ? void 0 : typography.lineHeightCondensed,
48
- fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
49
- labelPadding: spacing === null || spacing === void 0 ? void 0 : spacing.large,
50
- labelColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
51
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010,
52
- iconColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts3 = colors.contrasts) === null || _colors$contrasts3 === void 0 ? void 0 : _colors$contrasts3.grey125125,
53
- iconPadding: spacing === null || spacing === void 0 ? void 0 : spacing.small,
54
- activeBackground: colors === null || colors === void 0 ? void 0 : (_colors$contrasts4 = colors.contrasts) === null || _colors$contrasts4 === void 0 ? void 0 : _colors$contrasts4.blue4570,
55
- activeLabelColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts5 = colors.contrasts) === null || _colors$contrasts5 === void 0 ? void 0 : _colors$contrasts5.white1010,
56
- activeIconColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts6 = colors.contrasts) === null || _colors$contrasts6 === void 0 ? void 0 : _colors$contrasts6.white1010,
57
- labelInfoColor: colors === null || colors === void 0 ? void 0 : (_colors$contrasts7 = colors.contrasts) === null || _colors$contrasts7 === void 0 ? void 0 : _colors$contrasts7.grey5782
45
+ padding: `${spacing?.xSmall} ${spacing?.small}`,
46
+ fontFamily: typography?.fontFamily,
47
+ fontWeight: typography?.fontWeightNormal,
48
+ lineHeight: typography?.lineHeightCondensed,
49
+ fontSize: typography?.fontSizeMedium,
50
+ labelPadding: spacing?.large,
51
+ labelColor: colors?.contrasts?.grey125125,
52
+ background: colors?.contrasts?.white1010,
53
+ iconColor: colors?.contrasts?.grey125125,
54
+ iconPadding: spacing?.small,
55
+ activeBackground: colors?.contrasts?.blue4570,
56
+ activeLabelColor: colors?.contrasts?.white1010,
57
+ activeIconColor: colors?.contrasts?.white1010,
58
+ labelInfoColor: colors?.contrasts?.grey5782
58
59
  };
59
60
  return {
60
61
  ...componentVariables,
@@ -1,4 +1,4 @@
1
- var _dec, _dec2, _class, _MenuItemGroup;
1
+ var _dec, _dec2, _class;
2
2
  /*
3
3
  * The MIT License (MIT)
4
4
  *
@@ -38,62 +38,74 @@ parent: Menu
38
38
  id: Menu.Group
39
39
  ---
40
40
  **/
41
- let MenuItemGroup = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = (_MenuItemGroup = class MenuItemGroup extends Component {
41
+ let MenuItemGroup = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec(_class = _dec2(_class = class MenuItemGroup extends Component {
42
+ static displayName = "MenuItemGroup";
43
+ static componentId = 'Menu.Group';
44
+ static allowedProps = allowedProps;
45
+ static defaultProps = {
46
+ disabled: false,
47
+ children: null,
48
+ isTabbable: false,
49
+ allowMultiple: false,
50
+ defaultSelected: []
51
+ };
42
52
  constructor(props) {
43
53
  super(props);
44
- this.ref = null;
45
- this.handleRef = el => {
46
- this.ref = el;
47
- };
48
- this.handleSelect = (e, value, selected, item) => {
49
- if (this.props.disabled) {
50
- e.preventDefault();
51
- return;
52
- }
53
- if (this.props.selected) {
54
- this.updateSelected(e, value, this.props.selected, selected, item);
55
- } else {
56
- this.setState(state => {
57
- return {
58
- selected: this.updateSelected(e, value, state.selected, selected, item)
59
- };
60
- });
61
- }
62
- };
63
- this.updateSelected = (e, value, items, selected, item) => {
64
- const allowMultiple = this.props.allowMultiple;
65
- let updated = allowMultiple ? [...items] : [];
66
- const location = updated.indexOf(value);
67
- if (selected === true && location < 0) {
68
- updated.push(value);
69
- } else if (selected === false && location !== -1) {
70
- updated.splice(location, 1);
71
- } else if (!allowMultiple && updated.length < 1) {
72
- // don't allow nothing selected if it's not allowMultiple/checkbox
73
- updated = [...items];
74
- }
75
- if (typeof this.props.onSelect === 'function') {
76
- this.props.onSelect(e, updated, selected, item);
77
- }
78
- return updated;
79
- };
80
54
  if (typeof props.selected === 'undefined') {
81
55
  this.state = {
82
56
  selected: this.selectedFromChildren(props) || props.defaultSelected
83
57
  };
84
58
  }
85
59
  }
60
+ ref = null;
61
+ handleRef = el => {
62
+ this.ref = el;
63
+ };
86
64
  componentDidMount() {
87
- var _this$props$makeStyle, _this$props;
88
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
65
+ this.props.makeStyles?.();
89
66
  }
90
67
  componentDidUpdate() {
91
- var _this$props$makeStyle2, _this$props2;
92
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
68
+ this.props.makeStyles?.();
93
69
  }
70
+ handleSelect = (e, value, selected, item) => {
71
+ if (this.props.disabled) {
72
+ e.preventDefault();
73
+ return;
74
+ }
75
+ if (this.props.selected) {
76
+ this.updateSelected(e, value, this.props.selected, selected, item);
77
+ } else {
78
+ this.setState(state => {
79
+ return {
80
+ selected: this.updateSelected(e, value, state.selected, selected, item)
81
+ };
82
+ });
83
+ }
84
+ };
85
+ updateSelected = (e, value, items, selected, item) => {
86
+ const {
87
+ allowMultiple
88
+ } = this.props;
89
+ let updated = allowMultiple ? [...items] : [];
90
+ const location = updated.indexOf(value);
91
+ if (selected === true && location < 0) {
92
+ updated.push(value);
93
+ } else if (selected === false && location !== -1) {
94
+ updated.splice(location, 1);
95
+ } else if (!allowMultiple && updated.length < 1) {
96
+ // don't allow nothing selected if it's not allowMultiple/checkbox
97
+ updated = [...items];
98
+ }
99
+ if (typeof this.props.onSelect === 'function') {
100
+ this.props.onSelect(e, updated, selected, item);
101
+ }
102
+ return updated;
103
+ };
94
104
  selectedFromChildren(props) {
95
- const children = props.children,
96
- allowMultiple = props.allowMultiple;
105
+ const {
106
+ children,
107
+ allowMultiple
108
+ } = props;
97
109
  const selected = [];
98
110
  const items = Children.toArray(children).filter(child => {
99
111
  return matchComponentTypes(child, [MenuItem]);
@@ -113,20 +125,22 @@ let MenuItemGroup = (_dec = withDeterministicId(), _dec2 = withStyle(generateSty
113
125
  }
114
126
  }
115
127
  renderLabel() {
116
- var _this$props$styles;
117
- const label = this.props.label;
128
+ const {
129
+ label
130
+ } = this.props;
118
131
  return hasVisibleChildren(label) ? _jsx("span", {
119
- css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.label,
132
+ css: this.props.styles?.label,
120
133
  children: label
121
134
  }) : label;
122
135
  }
123
136
  renderChildren() {
124
- const _this$props3 = this.props,
125
- disabled = _this$props3.disabled,
126
- controls = _this$props3.controls,
127
- allowMultiple = _this$props3.allowMultiple,
128
- isTabbable = _this$props3.isTabbable,
129
- onMouseOver = _this$props3.onMouseOver;
137
+ const {
138
+ disabled,
139
+ controls,
140
+ allowMultiple,
141
+ isTabbable,
142
+ onMouseOver
143
+ } = this.props;
130
144
  const children = this.props.children;
131
145
  let index = -1;
132
146
  return Children.map(children, child => {
@@ -151,26 +165,19 @@ let MenuItemGroup = (_dec = withDeterministicId(), _dec2 = withStyle(generateSty
151
165
  });
152
166
  }
153
167
  render() {
154
- var _this$props$styles2, _this$props$styles3;
155
168
  const props = omitProps(this.props, MenuItemGroup.allowedProps);
156
169
  return _jsxs("span", {
157
170
  ...props,
158
- css: (_this$props$styles2 = this.props.styles) === null || _this$props$styles2 === void 0 ? void 0 : _this$props$styles2.menuItemGroup,
171
+ css: this.props.styles?.menuItemGroup,
159
172
  ref: this.handleRef,
160
173
  "data-cid": "MenuItemGroup",
161
174
  children: [this.renderLabel(), _jsx("div", {
162
- css: (_this$props$styles3 = this.props.styles) === null || _this$props$styles3 === void 0 ? void 0 : _this$props$styles3.items,
163
- "aria-disabled": this.props.disabled ? 'true' : void 0,
175
+ css: this.props.styles?.items,
176
+ "aria-disabled": this.props.disabled ? 'true' : undefined,
164
177
  children: this.renderChildren()
165
178
  })]
166
179
  });
167
180
  }
168
- }, _MenuItemGroup.displayName = "MenuItemGroup", _MenuItemGroup.componentId = 'Menu.Group', _MenuItemGroup.allowedProps = allowedProps, _MenuItemGroup.defaultProps = {
169
- disabled: false,
170
- children: null,
171
- isTabbable: false,
172
- allowMultiple: false,
173
- defaultSelected: []
174
- }, _MenuItemGroup)) || _class) || _class);
181
+ }) || _class) || _class);
175
182
  export default MenuItemGroup;
176
183
  export { MenuItemGroup };
@@ -28,23 +28,24 @@
28
28
  * @return {Object} The final theme object with the overrides and component variables
29
29
  */
30
30
  const generateComponentTheme = theme => {
31
- var _colors$contrasts, _colors$contrasts2;
32
- const colors = theme.colors,
33
- spacing = theme.spacing,
34
- typography = theme.typography,
35
- themeName = theme.key;
31
+ const {
32
+ colors,
33
+ spacing,
34
+ typography,
35
+ key: themeName
36
+ } = theme;
36
37
  const themeSpecificStyle = {
37
38
  canvas: {
38
39
  color: theme['ic-brand-font-color-dark']
39
40
  }
40
41
  };
41
42
  const componentVariables = {
42
- fontSize: typography === null || typography === void 0 ? void 0 : typography.fontSizeMedium,
43
- fontFamily: typography === null || typography === void 0 ? void 0 : typography.fontFamily,
44
- fontWeight: typography === null || typography === void 0 ? void 0 : typography.fontWeightBold,
45
- padding: `${spacing === null || spacing === void 0 ? void 0 : spacing.xSmall} ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`,
46
- color: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey125125,
47
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts2 = colors.contrasts) === null || _colors$contrasts2 === void 0 ? void 0 : _colors$contrasts2.white1010
43
+ fontSize: typography?.fontSizeMedium,
44
+ fontFamily: typography?.fontFamily,
45
+ fontWeight: typography?.fontWeightBold,
46
+ padding: `${spacing?.xSmall} ${spacing?.small}`,
47
+ color: colors?.contrasts?.grey125125,
48
+ background: colors?.contrasts?.white1010
48
49
  };
49
50
  return {
50
51
  ...componentVariables,
@@ -1,4 +1,4 @@
1
- var _dec, _class, _MenuItemSeparator;
1
+ var _dec, _class;
2
2
  /*
3
3
  * The MIT License (MIT)
4
4
  *
@@ -37,35 +37,32 @@ id: Menu.Separator
37
37
  ---
38
38
  @module MenuItemSeparator
39
39
  **/
40
- let MenuItemSeparator = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_MenuItemSeparator = class MenuItemSeparator extends Component {
41
- constructor(...args) {
42
- super(...args);
43
- this.ref = null;
44
- this.handleRef = el => {
45
- this.ref = el;
46
- };
47
- }
40
+ let MenuItemSeparator = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = class MenuItemSeparator extends Component {
41
+ static displayName = "MenuItemSeparator";
42
+ static componentId = 'Menu.Separator';
43
+ static allowedProps = allowedProps;
44
+ ref = null;
45
+ handleRef = el => {
46
+ this.ref = el;
47
+ };
48
48
  componentDidMount() {
49
- var _this$props$makeStyle, _this$props;
50
- (_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
49
+ this.props.makeStyles?.();
51
50
  }
52
51
  componentDidUpdate() {
53
- var _this$props$makeStyle2, _this$props2;
54
- (_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
52
+ this.props.makeStyles?.();
55
53
  }
56
54
  render() {
57
- var _this$props$styles;
58
55
  const props = omitProps(this.props, MenuItemSeparator.allowedProps);
59
56
  // role="separator" would fit better here, but it causes NVDA to stop the
60
57
  // MenuItem count after it
61
58
  return _jsx("div", {
62
59
  ...props,
63
60
  role: "presentation",
64
- css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.menuItemSeparator,
61
+ css: this.props.styles?.menuItemSeparator,
65
62
  ref: this.handleRef,
66
63
  "data-cid": "MenuItemSeparator"
67
64
  });
68
65
  }
69
- }, _MenuItemSeparator.displayName = "MenuItemSeparator", _MenuItemSeparator.componentId = 'Menu.Separator', _MenuItemSeparator.allowedProps = allowedProps, _MenuItemSeparator)) || _class);
66
+ }) || _class);
70
67
  export default MenuItemSeparator;
71
68
  export { MenuItemSeparator };
@@ -28,14 +28,15 @@
28
28
  * @return {Object} The final theme object with the overrides and component variables
29
29
  */
30
30
  const generateComponentTheme = theme => {
31
- var _colors$contrasts;
32
- const colors = theme.colors,
33
- spacing = theme.spacing,
34
- borders = theme.borders;
31
+ const {
32
+ colors,
33
+ spacing,
34
+ borders
35
+ } = theme;
35
36
  const componentVariables = {
36
- background: colors === null || colors === void 0 ? void 0 : (_colors$contrasts = colors.contrasts) === null || _colors$contrasts === void 0 ? void 0 : _colors$contrasts.grey3045,
37
- height: borders === null || borders === void 0 ? void 0 : borders.widthSmall,
38
- margin: `0 ${spacing === null || spacing === void 0 ? void 0 : spacing.small}`
37
+ background: colors?.contrasts?.grey3045,
38
+ height: borders?.widthSmall,
39
+ margin: `0 ${spacing?.small}`
39
40
  };
40
41
  return {
41
42
  ...componentVariables