carbon-react 127.0.4 → 127.1.1

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 (37) hide show
  1. package/esm/components/action-popover/action-popover-item/action-popover-item.component.js +2 -6
  2. package/esm/components/action-popover/action-popover-menu/action-popover-menu.component.d.ts +2 -2
  3. package/esm/components/action-popover/action-popover-menu/action-popover-menu.component.js +2 -2
  4. package/esm/components/action-popover/action-popover.component.d.ts +3 -1
  5. package/esm/components/action-popover/action-popover.component.js +3 -3
  6. package/esm/components/action-popover/action-popover.style.d.ts +3 -3
  7. package/esm/components/action-popover/action-popover.style.js +4 -3
  8. package/esm/components/button/button.component.js +0 -1
  9. package/esm/components/multi-action-button/multi-action-button.component.js +1 -2
  10. package/esm/components/multi-action-button/multi-action-button.style.d.ts +1 -1
  11. package/esm/components/multi-action-button/multi-action-button.style.js +4 -1
  12. package/esm/components/select/filterable-select/filterable-select.component.js +14 -12
  13. package/esm/components/select/multi-select/multi-select.component.js +1 -1
  14. package/esm/components/split-button/split-button-children.style.d.ts +2 -2
  15. package/esm/components/split-button/split-button-children.style.js +8 -5
  16. package/esm/components/split-button/split-button.component.js +1 -2
  17. package/esm/hooks/__internal__/useChildButtons/useChildButtons.d.ts +2 -2
  18. package/esm/hooks/__internal__/useChildButtons/useChildButtons.js +1 -1
  19. package/lib/components/action-popover/action-popover-item/action-popover-item.component.js +2 -6
  20. package/lib/components/action-popover/action-popover-menu/action-popover-menu.component.d.ts +2 -2
  21. package/lib/components/action-popover/action-popover-menu/action-popover-menu.component.js +2 -2
  22. package/lib/components/action-popover/action-popover.component.d.ts +3 -1
  23. package/lib/components/action-popover/action-popover.component.js +3 -3
  24. package/lib/components/action-popover/action-popover.style.d.ts +3 -3
  25. package/lib/components/action-popover/action-popover.style.js +4 -3
  26. package/lib/components/button/button.component.js +0 -1
  27. package/lib/components/multi-action-button/multi-action-button.component.js +1 -2
  28. package/lib/components/multi-action-button/multi-action-button.style.d.ts +1 -1
  29. package/lib/components/multi-action-button/multi-action-button.style.js +4 -1
  30. package/lib/components/select/filterable-select/filterable-select.component.js +14 -12
  31. package/lib/components/select/multi-select/multi-select.component.js +1 -1
  32. package/lib/components/split-button/split-button-children.style.d.ts +2 -2
  33. package/lib/components/split-button/split-button-children.style.js +8 -5
  34. package/lib/components/split-button/split-button.component.js +1 -2
  35. package/lib/hooks/__internal__/useChildButtons/useChildButtons.d.ts +2 -2
  36. package/lib/hooks/__internal__/useChildButtons/useChildButtons.js +1 -1
  37. package/package.json +1 -1
@@ -6,7 +6,6 @@ import { MenuItemIcon, SubMenuItemIcon, StyledMenuItem, StyledMenuItemInnerText,
6
6
  import Events from "../../../__internal__/utils/helpers/events";
7
7
  import createGuid from "../../../__internal__/utils/helpers/guid";
8
8
  import ActionPopoverContext from "../action-popover-context";
9
- import useLocale from "../../../hooks/__internal__/useLocale";
10
9
  import ActionPopoverMenu from "../action-popover-menu/action-popover-menu.component";
11
10
  const INTERVAL = 150;
12
11
  function checkRef(ref) {
@@ -49,7 +48,6 @@ export const ActionPopoverItem = ({
49
48
  isASubmenu = false,
50
49
  ...rest
51
50
  }) => {
52
- const l = useLocale();
53
51
  const context = useContext(ActionPopoverContext);
54
52
  !context ? process.env.NODE_ENV !== "production" ? invariant(false, "ActionPopoverItem must be used within an ActionPopover component") : invariant(false) : void 0;
55
53
  !( /*#__PURE__*/React.isValidElement(submenu) ? submenu.type === ActionPopoverMenu : true) ? process.env.NODE_ENV !== "production" ? invariant(false, "ActionPopoverItem only accepts submenu of type `ActionPopoverMenu`") : invariant(false) : void 0;
@@ -198,11 +196,10 @@ export const ActionPopoverItem = ({
198
196
  }
199
197
  }),
200
198
  "aria-haspopup": "true",
201
- "aria-label": l.actionPopover.ariaLabel(),
202
199
  "aria-controls": `ActionPopoverMenu_${guid}`,
203
200
  "aria-expanded": isOpen
204
201
  };
205
- const wrapperDivProps = {
202
+ const wrapperProps = {
206
203
  ...(!disabled && {
207
204
  onMouseEnter: e => {
208
205
  if (mouseEnterTimer.current) clearTimeout(mouseEnterTimer.current);
@@ -234,14 +231,13 @@ export const ActionPopoverItem = ({
234
231
  isASubmenu: isASubmenu
235
232
  });
236
233
  };
237
- return /*#__PURE__*/React.createElement(StyledMenuItemWrapper, submenu && wrapperDivProps, /*#__PURE__*/React.createElement("div", {
234
+ return /*#__PURE__*/React.createElement(StyledMenuItemWrapper, submenu && wrapperProps, /*#__PURE__*/React.createElement("div", {
238
235
  onKeyDown: onKeyDown,
239
236
  role: "presentation"
240
237
  }, /*#__PURE__*/React.createElement(StyledMenuItem, _extends({}, rest, {
241
238
  ref: ref,
242
239
  onClick: onClick,
243
240
  type: "button",
244
- role: "menuitem",
245
241
  tabIndex: 0,
246
242
  isDisabled: disabled,
247
243
  horizontalAlignment: horizontalAlignment,
@@ -33,7 +33,7 @@ export interface ActionPopoverMenuBaseProps {
33
33
  right: string | number;
34
34
  };
35
35
  }
36
- export interface ActionPopoverMenuProps extends ActionPopoverMenuBaseProps, React.RefAttributes<HTMLDivElement> {
36
+ export interface ActionPopoverMenuProps extends ActionPopoverMenuBaseProps, React.RefAttributes<HTMLUListElement> {
37
37
  }
38
- declare const ActionPopoverMenu: React.ForwardRefExoticComponent<ActionPopoverMenuBaseProps & React.RefAttributes<HTMLDivElement>>;
38
+ declare const ActionPopoverMenu: React.ForwardRefExoticComponent<ActionPopoverMenuBaseProps & React.RefAttributes<HTMLUListElement>>;
39
39
  export default ActionPopoverMenu;
@@ -163,8 +163,8 @@ const ActionPopoverMenu = /*#__PURE__*/React.forwardRef(({
163
163
  onKeyDown: onKeyDown,
164
164
  id: menuID,
165
165
  "aria-labelledby": parentID,
166
- role: "menu",
167
- ref: ref
166
+ ref: ref,
167
+ role: "list"
168
168
  }, rest), clonedChildren);
169
169
  });
170
170
  if (process.env.NODE_ENV !== "production") {
@@ -30,6 +30,8 @@ export interface ActionPopoverProps extends MarginProps {
30
30
  renderButton?: (buttonProps: RenderButtonProps) => React.ReactNode;
31
31
  /** Boolean to control whether menu should align to right */
32
32
  rightAlignMenu?: boolean;
33
+ /** Prop to specify an aria-label for the component */
34
+ "aria-label"?: string;
33
35
  }
34
- export declare const ActionPopover: ({ children, id, onOpen, onClose, rightAlignMenu, renderButton, placement, horizontalAlignment, submenuPosition, ...rest }: ActionPopoverProps) => React.JSX.Element;
36
+ export declare const ActionPopover: ({ children, id, onOpen, onClose, rightAlignMenu, renderButton, placement, horizontalAlignment, submenuPosition, "aria-label": ariaLabel, ...rest }: ActionPopoverProps) => React.JSX.Element;
35
37
  export default ActionPopover;
@@ -24,6 +24,7 @@ export const ActionPopover = ({
24
24
  placement = "bottom",
25
25
  horizontalAlignment = "left",
26
26
  submenuPosition = "left",
27
+ "aria-label": ariaLabel,
27
28
  ...rest
28
29
  }) => {
29
30
  const l = useLocale();
@@ -141,7 +142,7 @@ export const ActionPopover = ({
141
142
  "data-element": "action-popover-button",
142
143
  ariaAttributes: {
143
144
  "aria-haspopup": "true",
144
- "aria-label": l.actionPopover.ariaLabel(),
145
+ "aria-label": ariaLabel || l.actionPopover.ariaLabel(),
145
146
  "aria-controls": menuID,
146
147
  "aria-expanded": `${isOpen}`
147
148
  }
@@ -150,7 +151,7 @@ export const ActionPopover = ({
150
151
  return /*#__PURE__*/React.createElement(StyledButtonIcon, {
151
152
  role: "button",
152
153
  "aria-haspopup": "true",
153
- "aria-label": l.actionPopover.ariaLabel(),
154
+ "aria-label": ariaLabel || l.actionPopover.ariaLabel(),
154
155
  "aria-controls": menuID,
155
156
  "aria-expanded": isOpen,
156
157
  tabIndex: isOpen ? -1 : 0,
@@ -192,7 +193,6 @@ export const ActionPopover = ({
192
193
  reference: buttonRef
193
194
  }, /*#__PURE__*/React.createElement(ActionPopoverMenu, _extends({
194
195
  "data-component": "action-popover",
195
- role: "menu",
196
196
  ref: menu
197
197
  }, menuProps), children))));
198
198
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare const Menu: import("styled-components").StyledComponent<"div", any, {
2
+ declare const Menu: import("styled-components").StyledComponent<"ul", any, {
3
3
  isOpen?: boolean | undefined;
4
4
  }, never>;
5
5
  declare type StyledMenuItemProps = {
@@ -15,8 +15,8 @@ declare type StyledMenuItemProps = {
15
15
  declare const StyledMenuItemInnerText: import("styled-components").StyledComponent<"div", any, Omit<StyledMenuItemProps, "isDisabled">, never>;
16
16
  declare const StyledMenuItemOuterContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
17
17
  declare const StyledMenuItem: import("styled-components").StyledComponent<"button", any, Omit<StyledMenuItemProps, "variant">, never>;
18
- declare const StyledMenuItemWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
19
- declare const MenuItemDivider: import("styled-components").StyledComponent<"div", any, {
18
+ declare const StyledMenuItemWrapper: import("styled-components").StyledComponent<"li", any, {}, never>;
19
+ declare const MenuItemDivider: import("styled-components").StyledComponent<"li", any, {
20
20
  "data-element": string;
21
21
  }, "data-element">;
22
22
  declare const MenuButton: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -9,11 +9,12 @@ import baseTheme from "../../style/themes/base";
9
9
  const oldFocusStyling = `
10
10
  outline: solid 3px var(--colorsSemanticFocus500);
11
11
  `;
12
- const Menu = styled.div`
12
+ const Menu = styled.ul`
13
13
  ${({
14
14
  isOpen
15
15
  }) => isOpen ? "display: block;" : "visibility: hidden;"}
16
16
  margin: 0;
17
+ list-style: none;
17
18
  padding: var(--spacing100) 0;
18
19
  box-shadow: var(--boxShadow100);
19
20
  position: absolute;
@@ -156,10 +157,10 @@ const StyledMenuItem = styled.button`
156
157
  StyledMenuItem.defaultProps = {
157
158
  theme: baseTheme
158
159
  };
159
- const StyledMenuItemWrapper = styled.div`
160
+ const StyledMenuItemWrapper = styled.li`
160
161
  position: relative;
161
162
  `;
162
- const MenuItemDivider = styled.div.attrs({
163
+ const MenuItemDivider = styled.li.attrs({
163
164
  "data-element": "action-popover-divider"
164
165
  })`
165
166
  background-color: var(--colorsUtilityMajor050);
@@ -148,7 +148,6 @@ const Button = /*#__PURE__*/React.forwardRef(({
148
148
  buttonType: buttonType,
149
149
  disabled: disabled,
150
150
  destructive: destructive,
151
- role: inSplitButton ? "menuitem" : "button",
152
151
  type: href ? undefined : "button",
153
152
  iconType: iconType,
154
153
  size: size,
@@ -59,11 +59,10 @@ export const MultiActionButton = ({
59
59
  placement: "bottom-end",
60
60
  reference: buttonNode
61
61
  }, /*#__PURE__*/React.createElement(StyledButtonChildrenContainer, _extends({}, wrapperProps, {
62
- "aria-label": text,
63
62
  align: align
64
63
  }), /*#__PURE__*/React.createElement(SplitButtonContext.Provider, {
65
64
  value: contextValue
66
- }, children)));
65
+ }, React.Children.map(children, child => /*#__PURE__*/React.createElement("li", null, child)))));
67
66
  const marginProps = filterStyledSystemMarginProps(rest);
68
67
  return /*#__PURE__*/React.createElement(StyledMultiActionButton, _extends({
69
68
  onMouseLeave: hideButtonsIfTriggerNotFocused,
@@ -6,5 +6,5 @@ declare type StyledButtonChildrenContainerProps = {
6
6
  align: "left" | "right";
7
7
  minWidth: number;
8
8
  };
9
- declare const StyledButtonChildrenContainer: import("styled-components").StyledComponent<"div", any, StyledButtonChildrenContainerProps, never>;
9
+ declare const StyledButtonChildrenContainer: import("styled-components").StyledComponent<"ul", any, StyledButtonChildrenContainerProps, never>;
10
10
  export { StyledButtonChildrenContainer, StyledMultiActionButton };
@@ -69,7 +69,7 @@ theme.focusRedesignOptOut && css`
69
69
  `}
70
70
  }
71
71
  `;
72
- const StyledButtonChildrenContainer = styled.div`
72
+ const StyledButtonChildrenContainer = styled.ul`
73
73
  ${({
74
74
  theme,
75
75
  align,
@@ -81,6 +81,9 @@ const StyledButtonChildrenContainer = styled.div`
81
81
  z-index: ${theme.zIndex.popover};
82
82
  box-shadow: var(--boxShadow100);
83
83
  border-radius: var(--borderRadius100);
84
+ list-style: none;
85
+ padding: 0;
86
+ margin: 0;
84
87
 
85
88
  ${borderRadiusStyling}
86
89
 
@@ -119,19 +119,22 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
119
119
  }
120
120
  const updateValues = useCallback((newFilterText, isDeleteEvent) => {
121
121
  setSelectedValue(previousValue => {
122
- const match = findElementWithMatchingText(newFilterText, children);
123
- const isFilterCleared = isDeleteEvent && newFilterText === "";
122
+ const trimmed = newFilterText.trimStart();
123
+ const match = findElementWithMatchingText(trimmed, children);
124
+ const isFilterCleared = isDeleteEvent && !newFilterText.length;
124
125
  if (!match || isFilterCleared || match.props.disabled) {
125
126
  setTextValue(newFilterText);
126
127
  triggerChange("", false);
127
128
  return "";
128
129
  }
129
- triggerChange(match.props.value, false);
130
+ if (trimmed.length) {
131
+ triggerChange(match.props.value, false);
132
+ }
130
133
  if (isDeleteEvent) {
131
134
  setTextValue(newFilterText);
132
135
  return match.props.value;
133
136
  }
134
- if (match.props.text?.toLowerCase().startsWith(newFilterText.toLowerCase())) {
137
+ if (trimmed.length && match.props.text?.toLowerCase().startsWith(trimmed.toLowerCase())) {
135
138
  setTextValue(match.props.text);
136
139
  } else {
137
140
  setTextValue(newFilterText);
@@ -147,7 +150,7 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
147
150
  const matchingOption = React.Children.toArray(children).find(child => /*#__PURE__*/React.isValidElement(child) && isExpectedOption(child, newValue));
148
151
  if (!matchingOption || matchingOption.props.text === undefined) {
149
152
  setTextValue(filterText || "");
150
- } else if (isClosing || matchingOption.props.text?.toLowerCase().startsWith(filterText?.toLowerCase())) {
153
+ } else if (isClosing || matchingOption.props.text?.toLowerCase().startsWith(filterText?.toLowerCase().trim())) {
151
154
  setTextValue(matchingOption.props.text);
152
155
  }
153
156
  }, [children, filterText]);
@@ -255,10 +258,11 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
255
258
  };
256
259
  }, [handleGlobalClick]);
257
260
  useEffect(() => {
258
- const textStartsWithFilter = textValue?.toLowerCase().startsWith(filterText?.toLowerCase());
261
+ const trimmed = filterText?.trimStart();
262
+ const textStartsWithFilter = textValue?.toLowerCase().startsWith(trimmed.toLowerCase());
259
263
  const isTextboxActive = !disabled && !readOnly;
260
- if (isTextboxActive && textboxRef && filterText?.length && textValue?.length > filterText?.length && textStartsWithFilter) {
261
- textboxRef.selectionStart = filterText.length;
264
+ if (isTextboxActive && textboxRef && trimmed.length && textValue?.length > trimmed.length && textStartsWithFilter) {
265
+ textboxRef.selectionStart = trimmed.length;
262
266
  }
263
267
  }, [textValue, filterText, textboxRef, disabled, readOnly]);
264
268
  const onSelectOption = useCallback(optionData => {
@@ -405,7 +409,7 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
405
409
  onSelect: onSelectOption,
406
410
  onSelectListClose,
407
411
  onMouseDown: handleListMouseDown,
408
- filterText,
412
+ filterText: filterText.trim(),
409
413
  highlightedValue,
410
414
  noResultsMessage,
411
415
  disablePortal,
@@ -423,9 +427,7 @@ const FilterableSelect = /*#__PURE__*/React.forwardRef(({
423
427
  enableVirtualScroll,
424
428
  virtualScrollOverscan
425
429
  };
426
- const selectList = disableDefaultFiltering ? /*#__PURE__*/React.createElement(SelectList, selectListProps, children) : /*#__PURE__*/React.createElement(FilterableSelectList, _extends({}, selectListProps, {
427
- filterText: filterText
428
- }), children);
430
+ const selectList = disableDefaultFiltering ? /*#__PURE__*/React.createElement(SelectList, selectListProps, children) : /*#__PURE__*/React.createElement(FilterableSelectList, selectListProps, children);
429
431
  const marginProps = useFormSpacing(textboxProps);
430
432
  return /*#__PURE__*/React.createElement(StyledSelect, _extends({
431
433
  hasTextCursor: true,
@@ -417,7 +417,7 @@ const MultiSelect = /*#__PURE__*/React.forwardRef(({
417
417
  onSelect: onSelectOption,
418
418
  onSelectListClose: onSelectListClose,
419
419
  onMouseDown: handleListMouseDown,
420
- filterText: filterText,
420
+ filterText: filterText.trim(),
421
421
  highlightedValue: highlightedValue,
422
422
  noResultsMessage: noResultsMessage,
423
423
  disablePortal: disablePortal,
@@ -1,9 +1,9 @@
1
1
  import { ThemeObject } from "../../style/themes/base";
2
- export declare const borderRadiusStyling = "\n > {\n &:first-child:last-child {\n border-radius: var(--borderRadius100);\n }\n\n &:first-child:not(:last-child) {\n border-top-left-radius: var(--borderRadius100);\n border-top-right-radius: var(--borderRadius100);\n border-bottom-right-radius: var(--borderRadius000);\n border-bottom-left-radius: var(--borderRadius000);\n }\n\n &:not(:first-child):not(:last-child) {\n border-radius: var(--borderRadius000);\n }\n\n &:last-child:not(:first-child) {\n border-top-right-radius: var(--borderRadius000);\n border-top-left-radius: var(--borderRadius000);\n border-bottom-left-radius: var(--borderRadius100);\n border-bottom-right-radius: var(--borderRadius100);\n }\n }\n";
2
+ export declare const borderRadiusStyling = "\n > {\n &:first-child:last-child > * {\n border-radius: var(--borderRadius100);\n }\n\n &:first-child:not(:last-child) > * {\n border-top-left-radius: var(--borderRadius100);\n border-top-right-radius: var(--borderRadius100);\n border-bottom-right-radius: var(--borderRadius000);\n border-bottom-left-radius: var(--borderRadius000);\n }\n\n &:not(:first-child):not(:last-child) > * {\n border-radius: var(--borderRadius000);\n }\n\n &:last-child:not(:first-child) > * {\n border-top-right-radius: var(--borderRadius000);\n border-top-left-radius: var(--borderRadius000);\n border-bottom-left-radius: var(--borderRadius100);\n border-bottom-right-radius: var(--borderRadius100);\n }\n }\n";
3
3
  declare type StyledSplitButtonChildrenContainerProps = {
4
4
  theme: ThemeObject;
5
5
  align: "left" | "right";
6
6
  minWidth: number;
7
7
  };
8
- declare const StyledSplitButtonChildrenContainer: import("styled-components").StyledComponent<"div", any, StyledSplitButtonChildrenContainerProps, never>;
8
+ declare const StyledSplitButtonChildrenContainer: import("styled-components").StyledComponent<"ul", any, StyledSplitButtonChildrenContainerProps, never>;
9
9
  export default StyledSplitButtonChildrenContainer;
@@ -3,22 +3,22 @@ import BaseTheme from "../../style/themes/base";
3
3
  import StyledButton from "../button/button.style";
4
4
  export const borderRadiusStyling = `
5
5
  > {
6
- &:first-child:last-child {
6
+ &:first-child:last-child > * {
7
7
  border-radius: var(--borderRadius100);
8
8
  }
9
9
 
10
- &:first-child:not(:last-child) {
10
+ &:first-child:not(:last-child) > * {
11
11
  border-top-left-radius: var(--borderRadius100);
12
12
  border-top-right-radius: var(--borderRadius100);
13
13
  border-bottom-right-radius: var(--borderRadius000);
14
14
  border-bottom-left-radius: var(--borderRadius000);
15
15
  }
16
16
 
17
- &:not(:first-child):not(:last-child) {
17
+ &:not(:first-child):not(:last-child) > * {
18
18
  border-radius: var(--borderRadius000);
19
19
  }
20
20
 
21
- &:last-child:not(:first-child) {
21
+ &:last-child:not(:first-child) > * {
22
22
  border-top-right-radius: var(--borderRadius000);
23
23
  border-top-left-radius: var(--borderRadius000);
24
24
  border-bottom-left-radius: var(--borderRadius100);
@@ -26,7 +26,7 @@ export const borderRadiusStyling = `
26
26
  }
27
27
  }
28
28
  `;
29
- const StyledSplitButtonChildrenContainer = styled.div`
29
+ const StyledSplitButtonChildrenContainer = styled.ul`
30
30
  border-radius: var(--borderRadius100);
31
31
  ${({
32
32
  theme,
@@ -38,6 +38,9 @@ const StyledSplitButtonChildrenContainer = styled.div`
38
38
  white-space: nowrap;
39
39
  z-index: ${theme.zIndex.popover};
40
40
  box-shadow: var(--boxShadow100);
41
+ list-style: none;
42
+ padding: 0;
43
+ margin: 0;
41
44
 
42
45
  ${borderRadiusStyling}
43
46
 
@@ -111,11 +111,10 @@ export const SplitButton = ({
111
111
  placement: "bottom-end",
112
112
  reference: buttonNode
113
113
  }, /*#__PURE__*/React.createElement(StyledSplitButtonChildrenContainer, _extends({}, wrapperProps, {
114
- "aria-label": text,
115
114
  align: align
116
115
  }), /*#__PURE__*/React.createElement(SplitButtonContext.Provider, {
117
116
  value: contextValue
118
- }, children)));
117
+ }, React.Children.map(children, child => /*#__PURE__*/React.createElement("li", null, child)))));
119
118
  }
120
119
  const handleClick = useClickAwayListener(hideButtons);
121
120
  const marginProps = filterStyledSystemMarginProps(rest);
@@ -7,11 +7,11 @@ declare const useChildButtons: (toggleButtonRef: React.RefObject<HTMLButtonEleme
7
7
  hideButtonsIfTriggerNotFocused: () => void;
8
8
  handleToggleButtonKeyDown: (ev: React.KeyboardEvent<HTMLButtonElement>) => void;
9
9
  wrapperProps: {
10
- role: string;
11
10
  "data-element": string;
11
+ role: string;
12
12
  onKeyDown: (ev: any) => void;
13
13
  minWidth: number;
14
- ref: import("react").RefObject<HTMLDivElement>;
14
+ ref: import("react").RefObject<HTMLUListElement>;
15
15
  };
16
16
  contextValue: {
17
17
  inSplitButton: boolean;
@@ -46,8 +46,8 @@ const useChildButtons = (toggleButtonRef, widthRatio = 1) => {
46
46
  setShowAdditionalButtons(false);
47
47
  }, [toggleButtonRef]);
48
48
  const wrapperProps = {
49
- role: "menu",
50
49
  "data-element": "additional-buttons",
50
+ role: "list",
51
51
  onKeyDown: handleKeyDown,
52
52
  minWidth,
53
53
  ref: childrenContainer
@@ -11,7 +11,6 @@ var _actionPopover = require("../action-popover.style");
11
11
  var _events = _interopRequireDefault(require("../../../__internal__/utils/helpers/events"));
12
12
  var _guid = _interopRequireDefault(require("../../../__internal__/utils/helpers/guid"));
13
13
  var _actionPopoverContext = _interopRequireDefault(require("../action-popover-context"));
14
- var _useLocale = _interopRequireDefault(require("../../../hooks/__internal__/useLocale"));
15
14
  var _actionPopoverMenu = _interopRequireDefault(require("../action-popover-menu/action-popover-menu.component"));
16
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
16
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
@@ -58,7 +57,6 @@ const ActionPopoverItem = ({
58
57
  isASubmenu = false,
59
58
  ...rest
60
59
  }) => {
61
- const l = (0, _useLocale.default)();
62
60
  const context = (0, _react.useContext)(_actionPopoverContext.default);
63
61
  !context ? process.env.NODE_ENV !== "production" ? (0, _invariant.default)(false, "ActionPopoverItem must be used within an ActionPopover component") : (0, _invariant.default)(false) : void 0;
64
62
  !( /*#__PURE__*/_react.default.isValidElement(submenu) ? submenu.type === _actionPopoverMenu.default : true) ? process.env.NODE_ENV !== "production" ? (0, _invariant.default)(false, "ActionPopoverItem only accepts submenu of type `ActionPopoverMenu`") : (0, _invariant.default)(false) : void 0;
@@ -207,11 +205,10 @@ const ActionPopoverItem = ({
207
205
  }
208
206
  }),
209
207
  "aria-haspopup": "true",
210
- "aria-label": l.actionPopover.ariaLabel(),
211
208
  "aria-controls": `ActionPopoverMenu_${guid}`,
212
209
  "aria-expanded": isOpen
213
210
  };
214
- const wrapperDivProps = {
211
+ const wrapperProps = {
215
212
  ...(!disabled && {
216
213
  onMouseEnter: e => {
217
214
  if (mouseEnterTimer.current) clearTimeout(mouseEnterTimer.current);
@@ -243,14 +240,13 @@ const ActionPopoverItem = ({
243
240
  isASubmenu: isASubmenu
244
241
  });
245
242
  };
246
- return /*#__PURE__*/_react.default.createElement(_actionPopover.StyledMenuItemWrapper, submenu && wrapperDivProps, /*#__PURE__*/_react.default.createElement("div", {
243
+ return /*#__PURE__*/_react.default.createElement(_actionPopover.StyledMenuItemWrapper, submenu && wrapperProps, /*#__PURE__*/_react.default.createElement("div", {
247
244
  onKeyDown: onKeyDown,
248
245
  role: "presentation"
249
246
  }, /*#__PURE__*/_react.default.createElement(_actionPopover.StyledMenuItem, _extends({}, rest, {
250
247
  ref: ref,
251
248
  onClick: onClick,
252
249
  type: "button",
253
- role: "menuitem",
254
250
  tabIndex: 0,
255
251
  isDisabled: disabled,
256
252
  horizontalAlignment: horizontalAlignment,
@@ -33,7 +33,7 @@ export interface ActionPopoverMenuBaseProps {
33
33
  right: string | number;
34
34
  };
35
35
  }
36
- export interface ActionPopoverMenuProps extends ActionPopoverMenuBaseProps, React.RefAttributes<HTMLDivElement> {
36
+ export interface ActionPopoverMenuProps extends ActionPopoverMenuBaseProps, React.RefAttributes<HTMLUListElement> {
37
37
  }
38
- declare const ActionPopoverMenu: React.ForwardRefExoticComponent<ActionPopoverMenuBaseProps & React.RefAttributes<HTMLDivElement>>;
38
+ declare const ActionPopoverMenu: React.ForwardRefExoticComponent<ActionPopoverMenuBaseProps & React.RefAttributes<HTMLUListElement>>;
39
39
  export default ActionPopoverMenu;
@@ -172,8 +172,8 @@ const ActionPopoverMenu = /*#__PURE__*/_react.default.forwardRef(({
172
172
  onKeyDown: onKeyDown,
173
173
  id: menuID,
174
174
  "aria-labelledby": parentID,
175
- role: "menu",
176
- ref: ref
175
+ ref: ref,
176
+ role: "list"
177
177
  }, rest), clonedChildren);
178
178
  });
179
179
  if (process.env.NODE_ENV !== "production") {
@@ -30,6 +30,8 @@ export interface ActionPopoverProps extends MarginProps {
30
30
  renderButton?: (buttonProps: RenderButtonProps) => React.ReactNode;
31
31
  /** Boolean to control whether menu should align to right */
32
32
  rightAlignMenu?: boolean;
33
+ /** Prop to specify an aria-label for the component */
34
+ "aria-label"?: string;
33
35
  }
34
- export declare const ActionPopover: ({ children, id, onOpen, onClose, rightAlignMenu, renderButton, placement, horizontalAlignment, submenuPosition, ...rest }: ActionPopoverProps) => React.JSX.Element;
36
+ export declare const ActionPopover: ({ children, id, onOpen, onClose, rightAlignMenu, renderButton, placement, horizontalAlignment, submenuPosition, "aria-label": ariaLabel, ...rest }: ActionPopoverProps) => React.JSX.Element;
35
37
  export default ActionPopover;
@@ -33,6 +33,7 @@ const ActionPopover = ({
33
33
  placement = "bottom",
34
34
  horizontalAlignment = "left",
35
35
  submenuPosition = "left",
36
+ "aria-label": ariaLabel,
36
37
  ...rest
37
38
  }) => {
38
39
  const l = (0, _useLocale.default)();
@@ -150,7 +151,7 @@ const ActionPopover = ({
150
151
  "data-element": "action-popover-button",
151
152
  ariaAttributes: {
152
153
  "aria-haspopup": "true",
153
- "aria-label": l.actionPopover.ariaLabel(),
154
+ "aria-label": ariaLabel || l.actionPopover.ariaLabel(),
154
155
  "aria-controls": menuID,
155
156
  "aria-expanded": `${isOpen}`
156
157
  }
@@ -159,7 +160,7 @@ const ActionPopover = ({
159
160
  return /*#__PURE__*/_react.default.createElement(_actionPopover.StyledButtonIcon, {
160
161
  role: "button",
161
162
  "aria-haspopup": "true",
162
- "aria-label": l.actionPopover.ariaLabel(),
163
+ "aria-label": ariaLabel || l.actionPopover.ariaLabel(),
163
164
  "aria-controls": menuID,
164
165
  "aria-expanded": isOpen,
165
166
  tabIndex: isOpen ? -1 : 0,
@@ -201,7 +202,6 @@ const ActionPopover = ({
201
202
  reference: buttonRef
202
203
  }, /*#__PURE__*/_react.default.createElement(_actionPopoverMenu.default, _extends({
203
204
  "data-component": "action-popover",
204
- role: "menu",
205
205
  ref: menu
206
206
  }, menuProps), children))));
207
207
  };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- declare const Menu: import("styled-components").StyledComponent<"div", any, {
2
+ declare const Menu: import("styled-components").StyledComponent<"ul", any, {
3
3
  isOpen?: boolean | undefined;
4
4
  }, never>;
5
5
  declare type StyledMenuItemProps = {
@@ -15,8 +15,8 @@ declare type StyledMenuItemProps = {
15
15
  declare const StyledMenuItemInnerText: import("styled-components").StyledComponent<"div", any, Omit<StyledMenuItemProps, "isDisabled">, never>;
16
16
  declare const StyledMenuItemOuterContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
17
17
  declare const StyledMenuItem: import("styled-components").StyledComponent<"button", any, Omit<StyledMenuItemProps, "variant">, never>;
18
- declare const StyledMenuItemWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
19
- declare const MenuItemDivider: import("styled-components").StyledComponent<"div", any, {
18
+ declare const StyledMenuItemWrapper: import("styled-components").StyledComponent<"li", any, {}, never>;
19
+ declare const MenuItemDivider: import("styled-components").StyledComponent<"li", any, {
20
20
  "data-element": string;
21
21
  }, "data-element">;
22
22
  declare const MenuButton: import("styled-components").StyledComponent<"div", any, {}, never>;
@@ -18,11 +18,12 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
18
18
  const oldFocusStyling = `
19
19
  outline: solid 3px var(--colorsSemanticFocus500);
20
20
  `;
21
- const Menu = exports.Menu = _styledComponents.default.div`
21
+ const Menu = exports.Menu = _styledComponents.default.ul`
22
22
  ${({
23
23
  isOpen
24
24
  }) => isOpen ? "display: block;" : "visibility: hidden;"}
25
25
  margin: 0;
26
+ list-style: none;
26
27
  padding: var(--spacing100) 0;
27
28
  box-shadow: var(--boxShadow100);
28
29
  position: absolute;
@@ -165,10 +166,10 @@ const StyledMenuItem = exports.StyledMenuItem = _styledComponents.default.button
165
166
  StyledMenuItem.defaultProps = {
166
167
  theme: _base.default
167
168
  };
168
- const StyledMenuItemWrapper = exports.StyledMenuItemWrapper = _styledComponents.default.div`
169
+ const StyledMenuItemWrapper = exports.StyledMenuItemWrapper = _styledComponents.default.li`
169
170
  position: relative;
170
171
  `;
171
- const MenuItemDivider = exports.MenuItemDivider = _styledComponents.default.div.attrs({
172
+ const MenuItemDivider = exports.MenuItemDivider = _styledComponents.default.li.attrs({
172
173
  "data-element": "action-popover-divider"
173
174
  })`
174
175
  background-color: var(--colorsUtilityMajor050);
@@ -157,7 +157,6 @@ const Button = /*#__PURE__*/_react.default.forwardRef(({
157
157
  buttonType: buttonType,
158
158
  disabled: disabled,
159
159
  destructive: destructive,
160
- role: inSplitButton ? "menuitem" : "button",
161
160
  type: href ? undefined : "button",
162
161
  iconType: iconType,
163
162
  size: size,
@@ -68,11 +68,10 @@ const MultiActionButton = ({
68
68
  placement: "bottom-end",
69
69
  reference: buttonNode
70
70
  }, /*#__PURE__*/_react.default.createElement(_multiActionButton.StyledButtonChildrenContainer, _extends({}, wrapperProps, {
71
- "aria-label": text,
72
71
  align: align
73
72
  }), /*#__PURE__*/_react.default.createElement(_splitButton.default.Provider, {
74
73
  value: contextValue
75
- }, children)));
74
+ }, _react.default.Children.map(children, child => /*#__PURE__*/_react.default.createElement("li", null, child)))));
76
75
  const marginProps = (0, _utils.filterStyledSystemMarginProps)(rest);
77
76
  return /*#__PURE__*/_react.default.createElement(_multiActionButton.StyledMultiActionButton, _extends({
78
77
  onMouseLeave: hideButtonsIfTriggerNotFocused,
@@ -6,5 +6,5 @@ declare type StyledButtonChildrenContainerProps = {
6
6
  align: "left" | "right";
7
7
  minWidth: number;
8
8
  };
9
- declare const StyledButtonChildrenContainer: import("styled-components").StyledComponent<"div", any, StyledButtonChildrenContainerProps, never>;
9
+ declare const StyledButtonChildrenContainer: import("styled-components").StyledComponent<"ul", any, StyledButtonChildrenContainerProps, never>;
10
10
  export { StyledButtonChildrenContainer, StyledMultiActionButton };
@@ -78,7 +78,7 @@ theme.focusRedesignOptOut && (0, _styledComponents.css)`
78
78
  `}
79
79
  }
80
80
  `;
81
- const StyledButtonChildrenContainer = exports.StyledButtonChildrenContainer = _styledComponents.default.div`
81
+ const StyledButtonChildrenContainer = exports.StyledButtonChildrenContainer = _styledComponents.default.ul`
82
82
  ${({
83
83
  theme,
84
84
  align,
@@ -90,6 +90,9 @@ const StyledButtonChildrenContainer = exports.StyledButtonChildrenContainer = _s
90
90
  z-index: ${theme.zIndex.popover};
91
91
  box-shadow: var(--boxShadow100);
92
92
  border-radius: var(--borderRadius100);
93
+ list-style: none;
94
+ padding: 0;
95
+ margin: 0;
93
96
 
94
97
  ${_splitButtonChildren.borderRadiusStyling}
95
98
 
@@ -128,19 +128,22 @@ const FilterableSelect = exports.FilterableSelect = /*#__PURE__*/_react.default.
128
128
  }
129
129
  const updateValues = (0, _react.useCallback)((newFilterText, isDeleteEvent) => {
130
130
  setSelectedValue(previousValue => {
131
- const match = findElementWithMatchingText(newFilterText, children);
132
- const isFilterCleared = isDeleteEvent && newFilterText === "";
131
+ const trimmed = newFilterText.trimStart();
132
+ const match = findElementWithMatchingText(trimmed, children);
133
+ const isFilterCleared = isDeleteEvent && !newFilterText.length;
133
134
  if (!match || isFilterCleared || match.props.disabled) {
134
135
  setTextValue(newFilterText);
135
136
  triggerChange("", false);
136
137
  return "";
137
138
  }
138
- triggerChange(match.props.value, false);
139
+ if (trimmed.length) {
140
+ triggerChange(match.props.value, false);
141
+ }
139
142
  if (isDeleteEvent) {
140
143
  setTextValue(newFilterText);
141
144
  return match.props.value;
142
145
  }
143
- if (match.props.text?.toLowerCase().startsWith(newFilterText.toLowerCase())) {
146
+ if (trimmed.length && match.props.text?.toLowerCase().startsWith(trimmed.toLowerCase())) {
144
147
  setTextValue(match.props.text);
145
148
  } else {
146
149
  setTextValue(newFilterText);
@@ -156,7 +159,7 @@ const FilterableSelect = exports.FilterableSelect = /*#__PURE__*/_react.default.
156
159
  const matchingOption = _react.default.Children.toArray(children).find(child => /*#__PURE__*/_react.default.isValidElement(child) && (0, _isExpectedOption.default)(child, newValue));
157
160
  if (!matchingOption || matchingOption.props.text === undefined) {
158
161
  setTextValue(filterText || "");
159
- } else if (isClosing || matchingOption.props.text?.toLowerCase().startsWith(filterText?.toLowerCase())) {
162
+ } else if (isClosing || matchingOption.props.text?.toLowerCase().startsWith(filterText?.toLowerCase().trim())) {
160
163
  setTextValue(matchingOption.props.text);
161
164
  }
162
165
  }, [children, filterText]);
@@ -264,10 +267,11 @@ const FilterableSelect = exports.FilterableSelect = /*#__PURE__*/_react.default.
264
267
  };
265
268
  }, [handleGlobalClick]);
266
269
  (0, _react.useEffect)(() => {
267
- const textStartsWithFilter = textValue?.toLowerCase().startsWith(filterText?.toLowerCase());
270
+ const trimmed = filterText?.trimStart();
271
+ const textStartsWithFilter = textValue?.toLowerCase().startsWith(trimmed.toLowerCase());
268
272
  const isTextboxActive = !disabled && !readOnly;
269
- if (isTextboxActive && textboxRef && filterText?.length && textValue?.length > filterText?.length && textStartsWithFilter) {
270
- textboxRef.selectionStart = filterText.length;
273
+ if (isTextboxActive && textboxRef && trimmed.length && textValue?.length > trimmed.length && textStartsWithFilter) {
274
+ textboxRef.selectionStart = trimmed.length;
271
275
  }
272
276
  }, [textValue, filterText, textboxRef, disabled, readOnly]);
273
277
  const onSelectOption = (0, _react.useCallback)(optionData => {
@@ -414,7 +418,7 @@ const FilterableSelect = exports.FilterableSelect = /*#__PURE__*/_react.default.
414
418
  onSelect: onSelectOption,
415
419
  onSelectListClose,
416
420
  onMouseDown: handleListMouseDown,
417
- filterText,
421
+ filterText: filterText.trim(),
418
422
  highlightedValue,
419
423
  noResultsMessage,
420
424
  disablePortal,
@@ -432,9 +436,7 @@ const FilterableSelect = exports.FilterableSelect = /*#__PURE__*/_react.default.
432
436
  enableVirtualScroll,
433
437
  virtualScrollOverscan
434
438
  };
435
- const selectList = disableDefaultFiltering ? /*#__PURE__*/_react.default.createElement(_selectList.default, selectListProps, children) : /*#__PURE__*/_react.default.createElement(FilterableSelectList, _extends({}, selectListProps, {
436
- filterText: filterText
437
- }), children);
439
+ const selectList = disableDefaultFiltering ? /*#__PURE__*/_react.default.createElement(_selectList.default, selectListProps, children) : /*#__PURE__*/_react.default.createElement(FilterableSelectList, selectListProps, children);
438
440
  const marginProps = (0, _useFormSpacing.default)(textboxProps);
439
441
  return /*#__PURE__*/_react.default.createElement(_select.default, _extends({
440
442
  hasTextCursor: true,
@@ -426,7 +426,7 @@ const MultiSelect = exports.MultiSelect = /*#__PURE__*/_react.default.forwardRef
426
426
  onSelect: onSelectOption,
427
427
  onSelectListClose: onSelectListClose,
428
428
  onMouseDown: handleListMouseDown,
429
- filterText: filterText,
429
+ filterText: filterText.trim(),
430
430
  highlightedValue: highlightedValue,
431
431
  noResultsMessage: noResultsMessage,
432
432
  disablePortal: disablePortal,
@@ -1,9 +1,9 @@
1
1
  import { ThemeObject } from "../../style/themes/base";
2
- export declare const borderRadiusStyling = "\n > {\n &:first-child:last-child {\n border-radius: var(--borderRadius100);\n }\n\n &:first-child:not(:last-child) {\n border-top-left-radius: var(--borderRadius100);\n border-top-right-radius: var(--borderRadius100);\n border-bottom-right-radius: var(--borderRadius000);\n border-bottom-left-radius: var(--borderRadius000);\n }\n\n &:not(:first-child):not(:last-child) {\n border-radius: var(--borderRadius000);\n }\n\n &:last-child:not(:first-child) {\n border-top-right-radius: var(--borderRadius000);\n border-top-left-radius: var(--borderRadius000);\n border-bottom-left-radius: var(--borderRadius100);\n border-bottom-right-radius: var(--borderRadius100);\n }\n }\n";
2
+ export declare const borderRadiusStyling = "\n > {\n &:first-child:last-child > * {\n border-radius: var(--borderRadius100);\n }\n\n &:first-child:not(:last-child) > * {\n border-top-left-radius: var(--borderRadius100);\n border-top-right-radius: var(--borderRadius100);\n border-bottom-right-radius: var(--borderRadius000);\n border-bottom-left-radius: var(--borderRadius000);\n }\n\n &:not(:first-child):not(:last-child) > * {\n border-radius: var(--borderRadius000);\n }\n\n &:last-child:not(:first-child) > * {\n border-top-right-radius: var(--borderRadius000);\n border-top-left-radius: var(--borderRadius000);\n border-bottom-left-radius: var(--borderRadius100);\n border-bottom-right-radius: var(--borderRadius100);\n }\n }\n";
3
3
  declare type StyledSplitButtonChildrenContainerProps = {
4
4
  theme: ThemeObject;
5
5
  align: "left" | "right";
6
6
  minWidth: number;
7
7
  };
8
- declare const StyledSplitButtonChildrenContainer: import("styled-components").StyledComponent<"div", any, StyledSplitButtonChildrenContainerProps, never>;
8
+ declare const StyledSplitButtonChildrenContainer: import("styled-components").StyledComponent<"ul", any, StyledSplitButtonChildrenContainerProps, never>;
9
9
  export default StyledSplitButtonChildrenContainer;
@@ -12,22 +12,22 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
12
12
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
13
  const borderRadiusStyling = exports.borderRadiusStyling = `
14
14
  > {
15
- &:first-child:last-child {
15
+ &:first-child:last-child > * {
16
16
  border-radius: var(--borderRadius100);
17
17
  }
18
18
 
19
- &:first-child:not(:last-child) {
19
+ &:first-child:not(:last-child) > * {
20
20
  border-top-left-radius: var(--borderRadius100);
21
21
  border-top-right-radius: var(--borderRadius100);
22
22
  border-bottom-right-radius: var(--borderRadius000);
23
23
  border-bottom-left-radius: var(--borderRadius000);
24
24
  }
25
25
 
26
- &:not(:first-child):not(:last-child) {
26
+ &:not(:first-child):not(:last-child) > * {
27
27
  border-radius: var(--borderRadius000);
28
28
  }
29
29
 
30
- &:last-child:not(:first-child) {
30
+ &:last-child:not(:first-child) > * {
31
31
  border-top-right-radius: var(--borderRadius000);
32
32
  border-top-left-radius: var(--borderRadius000);
33
33
  border-bottom-left-radius: var(--borderRadius100);
@@ -35,7 +35,7 @@ const borderRadiusStyling = exports.borderRadiusStyling = `
35
35
  }
36
36
  }
37
37
  `;
38
- const StyledSplitButtonChildrenContainer = _styledComponents.default.div`
38
+ const StyledSplitButtonChildrenContainer = _styledComponents.default.ul`
39
39
  border-radius: var(--borderRadius100);
40
40
  ${({
41
41
  theme,
@@ -47,6 +47,9 @@ const StyledSplitButtonChildrenContainer = _styledComponents.default.div`
47
47
  white-space: nowrap;
48
48
  z-index: ${theme.zIndex.popover};
49
49
  box-shadow: var(--boxShadow100);
50
+ list-style: none;
51
+ padding: 0;
52
+ margin: 0;
50
53
 
51
54
  ${borderRadiusStyling}
52
55
 
@@ -120,11 +120,10 @@ const SplitButton = ({
120
120
  placement: "bottom-end",
121
121
  reference: buttonNode
122
122
  }, /*#__PURE__*/_react.default.createElement(_splitButtonChildren.default, _extends({}, wrapperProps, {
123
- "aria-label": text,
124
123
  align: align
125
124
  }), /*#__PURE__*/_react.default.createElement(_splitButton2.default.Provider, {
126
125
  value: contextValue
127
- }, children)));
126
+ }, _react.default.Children.map(children, child => /*#__PURE__*/_react.default.createElement("li", null, child)))));
128
127
  }
129
128
  const handleClick = (0, _useClickAwayListener.default)(hideButtons);
130
129
  const marginProps = (0, _utils.filterStyledSystemMarginProps)(rest);
@@ -7,11 +7,11 @@ declare const useChildButtons: (toggleButtonRef: React.RefObject<HTMLButtonEleme
7
7
  hideButtonsIfTriggerNotFocused: () => void;
8
8
  handleToggleButtonKeyDown: (ev: React.KeyboardEvent<HTMLButtonElement>) => void;
9
9
  wrapperProps: {
10
- role: string;
11
10
  "data-element": string;
11
+ role: string;
12
12
  onKeyDown: (ev: any) => void;
13
13
  minWidth: number;
14
- ref: import("react").RefObject<HTMLDivElement>;
14
+ ref: import("react").RefObject<HTMLUListElement>;
15
15
  };
16
16
  contextValue: {
17
17
  inSplitButton: boolean;
@@ -53,8 +53,8 @@ const useChildButtons = (toggleButtonRef, widthRatio = 1) => {
53
53
  setShowAdditionalButtons(false);
54
54
  }, [toggleButtonRef]);
55
55
  const wrapperProps = {
56
- role: "menu",
57
56
  "data-element": "additional-buttons",
57
+ role: "list",
58
58
  onKeyDown: handleKeyDown,
59
59
  minWidth,
60
60
  ref: childrenContainer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "127.0.4",
3
+ "version": "127.1.1",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",