@sproutsocial/seeds-react-menu 1.3.1 → 1.3.2

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/dist/index.js CHANGED
@@ -2809,20 +2809,29 @@ var import_seeds_react_button = require("@sproutsocial/seeds-react-button");
2809
2809
  var import_jsx_runtime13 = require("react/jsx-runtime");
2810
2810
  var MenuToggleButton = (props) => {
2811
2811
  const { getToggleButtonProps, isListbox, getDropdownProps, ref, ariaProps } = useMenuToggleContext();
2812
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2813
- import_seeds_react_button.Button,
2814
- {
2815
- appearance: "secondary",
2816
- ...getToggleButtonProps?.({
2817
- // Decide if we want the preventKeyAction stuff. Maybe create a prop to allow for this to be overriden.
2818
- ...getDropdownProps?.({ ref, preventKeyAction: true }) || { ref },
2819
- refKey: "innerRef",
2820
- ...ariaProps,
2821
- ...isListbox ? {} : { role: "button", "aria-haspopup": "menu" }
2822
- }),
2823
- ...props
2824
- }
2825
- );
2812
+ const {
2813
+ onClick: userOnClick,
2814
+ onKeyDown: userOnKeyDown,
2815
+ onBlur: userOnBlur,
2816
+ ...restProps
2817
+ } = props;
2818
+ const defaultDropdownProps = {
2819
+ ref,
2820
+ onClick: userOnClick,
2821
+ onKeyDown: userOnKeyDown,
2822
+ onBlur: userOnBlur
2823
+ };
2824
+ const dropdownProps = getDropdownProps?.({
2825
+ ...defaultDropdownProps,
2826
+ preventKeyAction: true
2827
+ }) ?? defaultDropdownProps;
2828
+ const toggleButtonProps = getToggleButtonProps?.({
2829
+ ...dropdownProps,
2830
+ refKey: "innerRef",
2831
+ ...ariaProps,
2832
+ ...isListbox ? {} : { role: "button", "aria-haspopup": "menu" }
2833
+ });
2834
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_seeds_react_button.Button, { appearance: "secondary", ...toggleButtonProps, ...restProps });
2826
2835
  };
2827
2836
 
2828
2837
  // src/MenuSearchInput/MenuSearchInput.tsx