carbon-react 114.17.2 → 114.17.3

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.
@@ -1,4 +1,4 @@
1
- import { ButtonTypes } from "./button.component";
1
+ import { ButtonTypes, ButtonIconPosition, SizeOptions } from "./button.component";
2
2
  export declare const BUTTON_VARIANTS: ButtonTypes[];
3
- export declare const BUTTON_SIZES: string[];
4
- export declare const BUTTON_ICON_POSITIONS: string[];
3
+ export declare const BUTTON_SIZES: SizeOptions[];
4
+ export declare const BUTTON_ICON_POSITIONS: ButtonIconPosition[];
@@ -103,7 +103,7 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
103
103
  }, [openSubmenuId, closeSubmenu]);
104
104
  const findCurrentIndex = useCallback(id => {
105
105
  const index = submenuItemIds.findIndex(itemId => itemId === id);
106
- return index === -1 ? 0 : index;
106
+ return index;
107
107
  }, [submenuItemIds]);
108
108
  const handleKeyDown = useCallback(event => {
109
109
  if (!submenuOpen) {
@@ -137,7 +137,7 @@ const Submenu = /*#__PURE__*/React.forwardRef(({
137
137
  }
138
138
 
139
139
  if (Events.isTabKey(event) && Events.isShiftKey(event)) {
140
- if (nextIndex === 0) {
140
+ if (nextIndex <= 0) {
141
141
  closeSubmenu();
142
142
  return;
143
143
  }
@@ -1,4 +1,4 @@
1
- import { ButtonTypes } from "./button.component";
1
+ import { ButtonTypes, ButtonIconPosition, SizeOptions } from "./button.component";
2
2
  export declare const BUTTON_VARIANTS: ButtonTypes[];
3
- export declare const BUTTON_SIZES: string[];
4
- export declare const BUTTON_ICON_POSITIONS: string[];
3
+ export declare const BUTTON_SIZES: SizeOptions[];
4
+ export declare const BUTTON_ICON_POSITIONS: ButtonIconPosition[];
@@ -128,7 +128,7 @@ const Submenu = /*#__PURE__*/_react.default.forwardRef(({
128
128
  }, [openSubmenuId, closeSubmenu]);
129
129
  const findCurrentIndex = (0, _react.useCallback)(id => {
130
130
  const index = submenuItemIds.findIndex(itemId => itemId === id);
131
- return index === -1 ? 0 : index;
131
+ return index;
132
132
  }, [submenuItemIds]);
133
133
  const handleKeyDown = (0, _react.useCallback)(event => {
134
134
  if (!submenuOpen) {
@@ -162,7 +162,7 @@ const Submenu = /*#__PURE__*/_react.default.forwardRef(({
162
162
  }
163
163
 
164
164
  if (_events.default.isTabKey(event) && _events.default.isShiftKey(event)) {
165
- if (nextIndex === 0) {
165
+ if (nextIndex <= 0) {
166
166
  closeSubmenu();
167
167
  return;
168
168
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "114.17.2",
3
+ "version": "114.17.3",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",