@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.
@@ -84,14 +84,14 @@ ESM Build start
84
84
  ╵ ~~~~~~~~~
85
85
 
86
86
 
87
- CJS dist/index.js 142.61 KB
88
- CJS dist/index.js.map 368.34 KB
89
- CJS ⚡️ Build success in 596ms
90
- ESM dist/esm/index.js 132.96 KB
91
- ESM dist/esm/index.js.map 367.06 KB
92
- ESM ⚡️ Build success in 595ms
87
+ CJS dist/index.js 142.82 KB
88
+ CJS dist/index.js.map 368.80 KB
89
+ CJS ⚡️ Build success in 602ms
90
+ ESM dist/esm/index.js 133.17 KB
91
+ ESM dist/esm/index.js.map 367.52 KB
92
+ ESM ⚡️ Build success in 605ms
93
93
  DTS Build start
94
- DTS ⚡️ Build success in 16013ms
94
+ DTS ⚡️ Build success in 12162ms
95
95
  DTS dist/index.d.ts 37.08 KB
96
96
  DTS dist/index.d.mts 37.08 KB
97
- Done in 19.00s.
97
+ Done in 15.79s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @sproutsocial/seeds-react-menu
2
2
 
3
+ ## 1.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - a67b345: Users can now add event listeners like onClick, onBlur, and onKeyDown to MenuToggleButton.
8
+
3
9
  ## 1.3.1
4
10
 
5
11
  ### Patch Changes
package/dist/esm/index.js CHANGED
@@ -2758,20 +2758,29 @@ import { Button } from "@sproutsocial/seeds-react-button";
2758
2758
  import { jsx as jsx13 } from "react/jsx-runtime";
2759
2759
  var MenuToggleButton = (props) => {
2760
2760
  const { getToggleButtonProps, isListbox, getDropdownProps, ref, ariaProps } = useMenuToggleContext();
2761
- return /* @__PURE__ */ jsx13(
2762
- Button,
2763
- {
2764
- appearance: "secondary",
2765
- ...getToggleButtonProps?.({
2766
- // Decide if we want the preventKeyAction stuff. Maybe create a prop to allow for this to be overriden.
2767
- ...getDropdownProps?.({ ref, preventKeyAction: true }) || { ref },
2768
- refKey: "innerRef",
2769
- ...ariaProps,
2770
- ...isListbox ? {} : { role: "button", "aria-haspopup": "menu" }
2771
- }),
2772
- ...props
2773
- }
2774
- );
2761
+ const {
2762
+ onClick: userOnClick,
2763
+ onKeyDown: userOnKeyDown,
2764
+ onBlur: userOnBlur,
2765
+ ...restProps
2766
+ } = props;
2767
+ const defaultDropdownProps = {
2768
+ ref,
2769
+ onClick: userOnClick,
2770
+ onKeyDown: userOnKeyDown,
2771
+ onBlur: userOnBlur
2772
+ };
2773
+ const dropdownProps = getDropdownProps?.({
2774
+ ...defaultDropdownProps,
2775
+ preventKeyAction: true
2776
+ }) ?? defaultDropdownProps;
2777
+ const toggleButtonProps = getToggleButtonProps?.({
2778
+ ...dropdownProps,
2779
+ refKey: "innerRef",
2780
+ ...ariaProps,
2781
+ ...isListbox ? {} : { role: "button", "aria-haspopup": "menu" }
2782
+ });
2783
+ return /* @__PURE__ */ jsx13(Button, { appearance: "secondary", ...toggleButtonProps, ...restProps });
2775
2784
  };
2776
2785
 
2777
2786
  // src/MenuSearchInput/MenuSearchInput.tsx