From 3b884e2fe37a8ca6d0fb0d97716778f766c16cc0 Mon Sep 17 00:00:00 2001 From: Rupert Dunk Date: Mon, 6 Jan 2025 07:58:56 +0000 Subject: [PATCH] feat(menu): allow passing props to menu group child menu (#1454) --- src/core/components/menu/menuGroup.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/components/menu/menuGroup.tsx b/src/core/components/menu/menuGroup.tsx index f49d0aa10..cc5cf0fe5 100644 --- a/src/core/components/menu/menuGroup.tsx +++ b/src/core/components/menu/menuGroup.tsx @@ -6,7 +6,7 @@ import {Box, Flex, Popover, PopoverProps, Text} from '../../primitives' import {Selectable} from '../../primitives/_selectable' import {useRootTheme} from '../../theme' import {Radius, SelectableTone} from '../../types' -import {Menu} from './menu' +import {Menu, MenuProps} from './menu' import {useMenu} from './useMenu' /** @@ -16,6 +16,7 @@ export interface MenuGroupProps { as?: React.ElementType | keyof React.JSX.IntrinsicElements fontSize?: number | number[] icon?: React.ElementType | React.ReactNode + menu?: MenuProps padding?: number | number[] popover?: Omit radius?: Radius | Radius[] @@ -36,6 +37,7 @@ export function MenuGroup( children, fontSize = 1, icon: IconComponent, + menu: menuProps, onClick, padding = 3, popover, @@ -136,6 +138,7 @@ export function MenuGroup( onMouseEnter={handleMenuMouseEnter} registerElement={registerElement} shouldFocus={shouldFocus} + {...menuProps} > {children}