analytica-frontend-lib 1.1.78 → 1.1.80

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.
@@ -622,9 +622,23 @@ var injectStore = (children, store) => {
622
622
  return Children.map(children, (child) => {
623
623
  if (isValidElement(child)) {
624
624
  const typedChild = child;
625
- const newProps = {
626
- store
627
- };
625
+ const displayName = typedChild.type.displayName;
626
+ const allowed = [
627
+ "DropdownMenuTrigger",
628
+ "DropdownContent",
629
+ "DropdownMenuContent",
630
+ "DropdownMenuSeparator",
631
+ "DropdownMenuItem",
632
+ "MenuLabel",
633
+ "ProfileMenuTrigger",
634
+ "ProfileMenuHeader",
635
+ "ProfileMenuFooter",
636
+ "ProfileToggleTheme"
637
+ ];
638
+ let newProps = {};
639
+ if (allowed.includes(displayName)) {
640
+ newProps.store = store;
641
+ }
628
642
  if (typedChild.props.children) {
629
643
  newProps.children = injectStore(typedChild.props.children, store);
630
644
  }
@@ -710,13 +724,22 @@ var DropdownMenuTrigger = ({
710
724
  const open = useStore(store, (s) => s.open);
711
725
  const toggleOpen = () => store.setState({ open: !open });
712
726
  return /* @__PURE__ */ jsx6(
713
- "button",
727
+ "div",
714
728
  {
715
729
  onClick: (e) => {
716
730
  e.stopPropagation();
717
731
  toggleOpen();
718
732
  if (onClick) onClick(e);
719
733
  },
734
+ role: "button",
735
+ onKeyDown: (e) => {
736
+ if (e.key === "Enter" || e.key === " ") {
737
+ e.preventDefault();
738
+ toggleOpen();
739
+ if (onClick) onClick(e);
740
+ }
741
+ },
742
+ tabIndex: 0,
720
743
  "aria-expanded": open,
721
744
  className: cn(className),
722
745
  ...props,