@sproutsocial/seeds-react-menu 1.12.2 → 1.13.0
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/.turbo/turbo-build.log +13 -13
- package/CHANGELOG.md +16 -0
- package/dist/esm/v3/index.js +517 -58
- package/dist/esm/v3/index.js.map +1 -1
- package/dist/index.d.mts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/v3/index.d.mts +160 -50
- package/dist/v3/index.d.ts +160 -50
- package/dist/v3/index.js +522 -57
- package/dist/v3/index.js.map +1 -1
- package/package.json +1 -1
- package/src/v3/ActionMenu.stories.tsx +260 -0
- package/src/v3/ActionMenu.tsx +345 -0
- package/src/v3/ActionMenuStyles.tsx +153 -0
- package/src/v3/Common/SelectStyles.tsx +4 -3
- package/src/v3/ModalStories.stories.tsx +159 -0
- package/src/v3/MultiCombobox.stories.tsx +17 -0
- package/src/v3/MultiCombobox.tsx +24 -13
- package/src/v3/MultiSearchableSelect.stories.tsx +18 -0
- package/src/v3/MultiSearchableSelect.tsx +214 -55
- package/src/v3/MultiSelect.stories.tsx +17 -0
- package/src/v3/MultiSelect.tsx +3 -2
- package/src/v3/SingleCombobox.stories.tsx +17 -0
- package/src/v3/SingleCombobox.tsx +3 -1
- package/src/v3/SingleSearchableSelect.stories.tsx +18 -0
- package/src/v3/SingleSearchableSelect.tsx +3 -1
- package/src/v3/SingleSelect.stories.tsx +17 -0
- package/src/v3/SingleSelect.tsx +3 -2
- package/src/v3/index.ts +1 -0
package/dist/index.d.mts
CHANGED
|
@@ -5,8 +5,8 @@ import * as styled_components from 'styled-components';
|
|
|
5
5
|
import * as _sproutsocial_seeds_react_box from '@sproutsocial/seeds-react-box';
|
|
6
6
|
import { TypeBoxProps } from '@sproutsocial/seeds-react-box';
|
|
7
7
|
export { TypeBoxProps as TypeMenuFooterProps } from '@sproutsocial/seeds-react-box';
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
8
|
+
import * as React$1 from 'react';
|
|
9
|
+
import React__default from 'react';
|
|
10
10
|
import { TypePopoutProps, EnumPlacements } from '@sproutsocial/seeds-react-popout';
|
|
11
11
|
import { TypeTokenInputProps, TypeTokenSpec } from '@sproutsocial/seeds-react-token-input';
|
|
12
12
|
import * as _sproutsocial_seeds_react_text from '@sproutsocial/seeds-react-text';
|
|
@@ -59,7 +59,7 @@ declare const MenuGroup: {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
declare const StyledMenuGroup: styled_components.StyledComponent<"li", styled_components.DefaultTheme, TypeMenuGroupBaseProps, never>;
|
|
62
|
-
declare const StyledTitle: styled_components.StyledComponent<
|
|
62
|
+
declare const StyledTitle: styled_components.StyledComponent<React$1.FC<_sproutsocial_seeds_react_text.TypeTextProps>, styled_components.DefaultTheme, {}, never>;
|
|
63
63
|
declare const StyledMenuGroupUl: styled_components.StyledComponent<"ul", styled_components.DefaultTheme, {}, never>;
|
|
64
64
|
|
|
65
65
|
interface TypeDownshiftComboboxProps extends Partial<UseComboboxProps<TypeInternalItemProps>> {
|
|
@@ -89,10 +89,10 @@ interface TypeMenuContextBaseProps {
|
|
|
89
89
|
isListbox?: boolean;
|
|
90
90
|
hiddenItemsMap?: Record<string, boolean>;
|
|
91
91
|
hiddenItemsCount?: number;
|
|
92
|
-
setHiddenItemsMap?:
|
|
92
|
+
setHiddenItemsMap?: React__default.Dispatch<React__default.SetStateAction<Record<string, boolean>>>;
|
|
93
93
|
subMenuId?: string;
|
|
94
94
|
setSubMenuId?: (id: string) => void;
|
|
95
|
-
contentRef?:
|
|
95
|
+
contentRef?: React__default.RefObject<HTMLUListElement>;
|
|
96
96
|
}
|
|
97
97
|
interface TypeAllDownshiftProps extends Omit<TypeDownshiftComboboxReturnValue, TypeDonwshiftSharedReturnValue>, Omit<TypeDownshiftComboboxProps, TypeDonwshiftSharedProps>, Omit<TypeDownshiftSelectReturnValue, TypeDonwshiftSharedReturnValue>, Omit<TypeDownshiftSelectProps, TypeDonwshiftSharedProps>, TypeDownshiftMultiSelectReturnValue, TypeDownshiftMultiSelectProps {
|
|
98
98
|
onHighlightedIndexChange?: TypeDownshiftComboboxProps["onHighlightedIndexChange"] | TypeDownshiftSelectProps["onHighlightedIndexChange"];
|
|
@@ -129,7 +129,7 @@ interface TypeMenuProviderProps {
|
|
|
129
129
|
menuContext: TypeMenuContext;
|
|
130
130
|
}
|
|
131
131
|
interface TypeMenuToggleContext extends TypeMenuContext {
|
|
132
|
-
ref?:
|
|
132
|
+
ref?: React__default.RefObject<any> | ((arg0: React__default.ElementRef<any> | HTMLElement) => void);
|
|
133
133
|
toggle?: () => void;
|
|
134
134
|
show?: () => void;
|
|
135
135
|
hide?: () => void;
|
|
@@ -156,7 +156,7 @@ declare const useMenu: ({ items, isListbox, isOpen, itemsMap: itemsMapFromProps,
|
|
|
156
156
|
* MenuToggleContext factory, sets the type and the initial object
|
|
157
157
|
* @description Context for the Menu Toggle
|
|
158
158
|
*/
|
|
159
|
-
declare const MenuToggleContext:
|
|
159
|
+
declare const MenuToggleContext: React__default.Context<TypeMenuToggleContext>;
|
|
160
160
|
/**
|
|
161
161
|
* MenuToggleProvider Component sets the context values into the provider
|
|
162
162
|
* @description Context Provider for the Menu Toggle
|
|
@@ -170,7 +170,7 @@ declare const useMenuToggleContext: () => TypeMenuToggleContext;
|
|
|
170
170
|
* MenuContentContext factory, sets the type and the initial object
|
|
171
171
|
* @description Context for the Menu Content
|
|
172
172
|
*/
|
|
173
|
-
declare const MenuContentContext:
|
|
173
|
+
declare const MenuContentContext: React__default.Context<TypeMenuContext>;
|
|
174
174
|
/**
|
|
175
175
|
* MenuContentProvider Component sets the context values into the provider
|
|
176
176
|
* @description Context Provider for the Menu Content
|
|
@@ -184,7 +184,7 @@ declare const useMenuContentContext: () => TypeMenuContext;
|
|
|
184
184
|
interface TypeMenuRootOwnProps {
|
|
185
185
|
/** The element that is or contains an element that will toggle the menu when clicked.
|
|
186
186
|
* May contain labels, buttons, inputs or other content as needed. */
|
|
187
|
-
menuToggleElement:
|
|
187
|
+
menuToggleElement: React__default.ReactElement<any>;
|
|
188
188
|
/** Props to pass through to the underlying Popout.
|
|
189
189
|
* Any Popout prop is valid except those explicitly omitted. */
|
|
190
190
|
popoutProps?: Partial<Omit<TypePopoutProps, "isOpen" | "setIsOpen" | "content" | "children">>;
|
|
@@ -320,10 +320,10 @@ declare const MenuItemActionLeft: styled_components.StyledComponent<"div", style
|
|
|
320
320
|
declare const MenuItemActionRight: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {}, never>;
|
|
321
321
|
declare const MenuItemText: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {}, never>;
|
|
322
322
|
|
|
323
|
-
interface TypeMenuHeaderProps extends Omit<
|
|
323
|
+
interface TypeMenuHeaderProps extends Omit<React$1.ComponentPropsWithoutRef<"div">, "color">, TypeStyledComponentsCommonProps, TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypeSpaceSystemProps, TypePositionSystemProps {
|
|
324
324
|
title?: string;
|
|
325
|
-
leftAction?:
|
|
326
|
-
rightAction?:
|
|
325
|
+
leftAction?: React$1.ReactNode;
|
|
326
|
+
rightAction?: React$1.ReactNode;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
/**
|
|
@@ -367,7 +367,7 @@ type TypeMenuContentProps<I extends TypeMenuItemProps = TypeMenuItemProps> = Typ
|
|
|
367
367
|
* @see {@link https://seeds.sproutsocial.com/components/seeds-react-menu/#menugroup MenuGroup}
|
|
368
368
|
*/
|
|
369
369
|
declare const MenuContent: {
|
|
370
|
-
<I extends TypeMenuItemProps = TypeMenuItemProps>({ id, children: childrenProp, menuItems, MenuItemComponent, onKeyDown, innerRef, emptyStateElement, ...rest }: TypeMenuContentProps<I>): string | number | boolean | Iterable<
|
|
370
|
+
<I extends TypeMenuItemProps = TypeMenuItemProps>({ id, children: childrenProp, menuItems, MenuItemComponent, onKeyDown, innerRef, emptyStateElement, ...rest }: TypeMenuContentProps<I>): string | number | boolean | Iterable<React$1.ReactNode> | react_jsx_runtime.JSX.Element | null;
|
|
371
371
|
__MENU_PRIMITIVE_TYPE: string;
|
|
372
372
|
};
|
|
373
373
|
|
|
@@ -386,7 +386,7 @@ declare const DefaultMenuEmptyState: ({ children, ...props }: TypeDefaultMenuEmp
|
|
|
386
386
|
declare const MenuFooter: ({ children, ...rest }: TypeBoxProps) => react_jsx_runtime.JSX.Element;
|
|
387
387
|
|
|
388
388
|
interface TypeMenuLabelProps extends Omit<TypeLabelProps, "htmlFor"> {
|
|
389
|
-
children:
|
|
389
|
+
children: React__default.ReactNode;
|
|
390
390
|
/** Whether making a selection in the associated menu is required. */
|
|
391
391
|
required?: boolean;
|
|
392
392
|
/** ID of the associated form element. This prop is never valid to pass into MenuLabel
|
|
@@ -628,7 +628,7 @@ interface TypeNestedMenuProviderProps extends TypeNestedMenuContext {
|
|
|
628
628
|
/**
|
|
629
629
|
* NestedMenuContext factory, sets the type and the initial object
|
|
630
630
|
*/
|
|
631
|
-
declare const NestedMenuContext:
|
|
631
|
+
declare const NestedMenuContext: React__default.Context<TypeNestedMenuContext>;
|
|
632
632
|
/**
|
|
633
633
|
* Provider Component sets the context values in the provider
|
|
634
634
|
*/
|
|
@@ -640,11 +640,11 @@ declare const useNestedMenuContext: () => TypeNestedMenuContext;
|
|
|
640
640
|
|
|
641
641
|
interface TypeMapMenuItemsProps<I extends TypeMenuItemProps = TypeMenuItemProps> {
|
|
642
642
|
menuItems: I[];
|
|
643
|
-
MenuItemComponent?:
|
|
643
|
+
MenuItemComponent?: React__default.ComponentType<I>;
|
|
644
644
|
}
|
|
645
|
-
type TypeItemElement<I extends TypeMenuItemProps = TypeMenuItemProps> =
|
|
646
|
-
type TypeMenuGroupElement<I extends TypeMenuItemProps = TypeMenuItemProps> =
|
|
647
|
-
type TypeMenuContentElement<I extends TypeMenuItemProps = TypeMenuItemProps> =
|
|
645
|
+
type TypeItemElement<I extends TypeMenuItemProps = TypeMenuItemProps> = React__default.ReactElement<TypeMenuItemProps | TypeSubmenuItemProps<I, TypeSubmenuValidMenuComponentProps<I>>>;
|
|
646
|
+
type TypeMenuGroupElement<I extends TypeMenuItemProps = TypeMenuItemProps> = React__default.ReactElement<TypeMenuGroupProps<I>>;
|
|
647
|
+
type TypeMenuContentElement<I extends TypeMenuItemProps = TypeMenuItemProps> = React__default.ReactElement<TypeMenuContentProps<I>>;
|
|
648
648
|
interface TypeMenuChildren {
|
|
649
649
|
type: "item" | "group" | "content";
|
|
650
650
|
element: TypeItemElement | TypeMenuGroupElement | TypeMenuContentElement;
|
|
@@ -653,18 +653,18 @@ declare const mapMenuItems: <I extends TypeMenuItemProps = TypeMenuItemProps>({
|
|
|
653
653
|
type TypeUseMenuChildrenProps<I extends TypeMenuItemProps = TypeMenuItemProps> = {
|
|
654
654
|
children?: TypeMenuRootProps["children"];
|
|
655
655
|
menuItems?: I[];
|
|
656
|
-
MenuItemComponent?:
|
|
656
|
+
MenuItemComponent?: React__default.ComponentType<I>;
|
|
657
657
|
};
|
|
658
658
|
declare const getChildrenFromMenuItems: <I extends TypeMenuItemProps = TypeMenuItemProps>({ menuItems, MenuItemComponent, }: {
|
|
659
659
|
menuItems: I[];
|
|
660
|
-
MenuItemComponent?:
|
|
660
|
+
MenuItemComponent?: React__default.ComponentType<I>;
|
|
661
661
|
}) => react_jsx_runtime.JSX.Element;
|
|
662
662
|
declare const useMenuChildren: <I extends TypeMenuItemProps = TypeMenuItemProps>({ children: childrenProp, menuItems, MenuItemComponent, }: TypeUseMenuChildrenProps<I>) => {
|
|
663
663
|
allMenuItems: TypeInternalItemProps<TypeMenuItemProps>[];
|
|
664
664
|
menuItemsMap: {
|
|
665
665
|
[key: string]: TypeInternalItemProps<TypeMenuItemProps>;
|
|
666
666
|
};
|
|
667
|
-
children: string | number | true |
|
|
667
|
+
children: string | number | true | React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | React__default.ReactPortal;
|
|
668
668
|
};
|
|
669
669
|
|
|
670
670
|
declare const useSelectStateReducer: Required<UseSelectProps<TypeInternalItemProps>>["stateReducer"];
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import * as styled_components from 'styled-components';
|
|
|
5
5
|
import * as _sproutsocial_seeds_react_box from '@sproutsocial/seeds-react-box';
|
|
6
6
|
import { TypeBoxProps } from '@sproutsocial/seeds-react-box';
|
|
7
7
|
export { TypeBoxProps as TypeMenuFooterProps } from '@sproutsocial/seeds-react-box';
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
8
|
+
import * as React$1 from 'react';
|
|
9
|
+
import React__default from 'react';
|
|
10
10
|
import { TypePopoutProps, EnumPlacements } from '@sproutsocial/seeds-react-popout';
|
|
11
11
|
import { TypeTokenInputProps, TypeTokenSpec } from '@sproutsocial/seeds-react-token-input';
|
|
12
12
|
import * as _sproutsocial_seeds_react_text from '@sproutsocial/seeds-react-text';
|
|
@@ -59,7 +59,7 @@ declare const MenuGroup: {
|
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
declare const StyledMenuGroup: styled_components.StyledComponent<"li", styled_components.DefaultTheme, TypeMenuGroupBaseProps, never>;
|
|
62
|
-
declare const StyledTitle: styled_components.StyledComponent<
|
|
62
|
+
declare const StyledTitle: styled_components.StyledComponent<React$1.FC<_sproutsocial_seeds_react_text.TypeTextProps>, styled_components.DefaultTheme, {}, never>;
|
|
63
63
|
declare const StyledMenuGroupUl: styled_components.StyledComponent<"ul", styled_components.DefaultTheme, {}, never>;
|
|
64
64
|
|
|
65
65
|
interface TypeDownshiftComboboxProps extends Partial<UseComboboxProps<TypeInternalItemProps>> {
|
|
@@ -89,10 +89,10 @@ interface TypeMenuContextBaseProps {
|
|
|
89
89
|
isListbox?: boolean;
|
|
90
90
|
hiddenItemsMap?: Record<string, boolean>;
|
|
91
91
|
hiddenItemsCount?: number;
|
|
92
|
-
setHiddenItemsMap?:
|
|
92
|
+
setHiddenItemsMap?: React__default.Dispatch<React__default.SetStateAction<Record<string, boolean>>>;
|
|
93
93
|
subMenuId?: string;
|
|
94
94
|
setSubMenuId?: (id: string) => void;
|
|
95
|
-
contentRef?:
|
|
95
|
+
contentRef?: React__default.RefObject<HTMLUListElement>;
|
|
96
96
|
}
|
|
97
97
|
interface TypeAllDownshiftProps extends Omit<TypeDownshiftComboboxReturnValue, TypeDonwshiftSharedReturnValue>, Omit<TypeDownshiftComboboxProps, TypeDonwshiftSharedProps>, Omit<TypeDownshiftSelectReturnValue, TypeDonwshiftSharedReturnValue>, Omit<TypeDownshiftSelectProps, TypeDonwshiftSharedProps>, TypeDownshiftMultiSelectReturnValue, TypeDownshiftMultiSelectProps {
|
|
98
98
|
onHighlightedIndexChange?: TypeDownshiftComboboxProps["onHighlightedIndexChange"] | TypeDownshiftSelectProps["onHighlightedIndexChange"];
|
|
@@ -129,7 +129,7 @@ interface TypeMenuProviderProps {
|
|
|
129
129
|
menuContext: TypeMenuContext;
|
|
130
130
|
}
|
|
131
131
|
interface TypeMenuToggleContext extends TypeMenuContext {
|
|
132
|
-
ref?:
|
|
132
|
+
ref?: React__default.RefObject<any> | ((arg0: React__default.ElementRef<any> | HTMLElement) => void);
|
|
133
133
|
toggle?: () => void;
|
|
134
134
|
show?: () => void;
|
|
135
135
|
hide?: () => void;
|
|
@@ -156,7 +156,7 @@ declare const useMenu: ({ items, isListbox, isOpen, itemsMap: itemsMapFromProps,
|
|
|
156
156
|
* MenuToggleContext factory, sets the type and the initial object
|
|
157
157
|
* @description Context for the Menu Toggle
|
|
158
158
|
*/
|
|
159
|
-
declare const MenuToggleContext:
|
|
159
|
+
declare const MenuToggleContext: React__default.Context<TypeMenuToggleContext>;
|
|
160
160
|
/**
|
|
161
161
|
* MenuToggleProvider Component sets the context values into the provider
|
|
162
162
|
* @description Context Provider for the Menu Toggle
|
|
@@ -170,7 +170,7 @@ declare const useMenuToggleContext: () => TypeMenuToggleContext;
|
|
|
170
170
|
* MenuContentContext factory, sets the type and the initial object
|
|
171
171
|
* @description Context for the Menu Content
|
|
172
172
|
*/
|
|
173
|
-
declare const MenuContentContext:
|
|
173
|
+
declare const MenuContentContext: React__default.Context<TypeMenuContext>;
|
|
174
174
|
/**
|
|
175
175
|
* MenuContentProvider Component sets the context values into the provider
|
|
176
176
|
* @description Context Provider for the Menu Content
|
|
@@ -184,7 +184,7 @@ declare const useMenuContentContext: () => TypeMenuContext;
|
|
|
184
184
|
interface TypeMenuRootOwnProps {
|
|
185
185
|
/** The element that is or contains an element that will toggle the menu when clicked.
|
|
186
186
|
* May contain labels, buttons, inputs or other content as needed. */
|
|
187
|
-
menuToggleElement:
|
|
187
|
+
menuToggleElement: React__default.ReactElement<any>;
|
|
188
188
|
/** Props to pass through to the underlying Popout.
|
|
189
189
|
* Any Popout prop is valid except those explicitly omitted. */
|
|
190
190
|
popoutProps?: Partial<Omit<TypePopoutProps, "isOpen" | "setIsOpen" | "content" | "children">>;
|
|
@@ -320,10 +320,10 @@ declare const MenuItemActionLeft: styled_components.StyledComponent<"div", style
|
|
|
320
320
|
declare const MenuItemActionRight: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {}, never>;
|
|
321
321
|
declare const MenuItemText: styled_components.StyledComponent<"div", styled_components.DefaultTheme, {}, never>;
|
|
322
322
|
|
|
323
|
-
interface TypeMenuHeaderProps extends Omit<
|
|
323
|
+
interface TypeMenuHeaderProps extends Omit<React$1.ComponentPropsWithoutRef<"div">, "color">, TypeStyledComponentsCommonProps, TypeBorderSystemProps, TypeColorSystemProps, TypeFlexboxSystemProps, TypeGridSystemProps, TypeLayoutSystemProps, TypeSpaceSystemProps, TypePositionSystemProps {
|
|
324
324
|
title?: string;
|
|
325
|
-
leftAction?:
|
|
326
|
-
rightAction?:
|
|
325
|
+
leftAction?: React$1.ReactNode;
|
|
326
|
+
rightAction?: React$1.ReactNode;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
/**
|
|
@@ -367,7 +367,7 @@ type TypeMenuContentProps<I extends TypeMenuItemProps = TypeMenuItemProps> = Typ
|
|
|
367
367
|
* @see {@link https://seeds.sproutsocial.com/components/seeds-react-menu/#menugroup MenuGroup}
|
|
368
368
|
*/
|
|
369
369
|
declare const MenuContent: {
|
|
370
|
-
<I extends TypeMenuItemProps = TypeMenuItemProps>({ id, children: childrenProp, menuItems, MenuItemComponent, onKeyDown, innerRef, emptyStateElement, ...rest }: TypeMenuContentProps<I>): string | number | boolean | Iterable<
|
|
370
|
+
<I extends TypeMenuItemProps = TypeMenuItemProps>({ id, children: childrenProp, menuItems, MenuItemComponent, onKeyDown, innerRef, emptyStateElement, ...rest }: TypeMenuContentProps<I>): string | number | boolean | Iterable<React$1.ReactNode> | react_jsx_runtime.JSX.Element | null;
|
|
371
371
|
__MENU_PRIMITIVE_TYPE: string;
|
|
372
372
|
};
|
|
373
373
|
|
|
@@ -386,7 +386,7 @@ declare const DefaultMenuEmptyState: ({ children, ...props }: TypeDefaultMenuEmp
|
|
|
386
386
|
declare const MenuFooter: ({ children, ...rest }: TypeBoxProps) => react_jsx_runtime.JSX.Element;
|
|
387
387
|
|
|
388
388
|
interface TypeMenuLabelProps extends Omit<TypeLabelProps, "htmlFor"> {
|
|
389
|
-
children:
|
|
389
|
+
children: React__default.ReactNode;
|
|
390
390
|
/** Whether making a selection in the associated menu is required. */
|
|
391
391
|
required?: boolean;
|
|
392
392
|
/** ID of the associated form element. This prop is never valid to pass into MenuLabel
|
|
@@ -628,7 +628,7 @@ interface TypeNestedMenuProviderProps extends TypeNestedMenuContext {
|
|
|
628
628
|
/**
|
|
629
629
|
* NestedMenuContext factory, sets the type and the initial object
|
|
630
630
|
*/
|
|
631
|
-
declare const NestedMenuContext:
|
|
631
|
+
declare const NestedMenuContext: React__default.Context<TypeNestedMenuContext>;
|
|
632
632
|
/**
|
|
633
633
|
* Provider Component sets the context values in the provider
|
|
634
634
|
*/
|
|
@@ -640,11 +640,11 @@ declare const useNestedMenuContext: () => TypeNestedMenuContext;
|
|
|
640
640
|
|
|
641
641
|
interface TypeMapMenuItemsProps<I extends TypeMenuItemProps = TypeMenuItemProps> {
|
|
642
642
|
menuItems: I[];
|
|
643
|
-
MenuItemComponent?:
|
|
643
|
+
MenuItemComponent?: React__default.ComponentType<I>;
|
|
644
644
|
}
|
|
645
|
-
type TypeItemElement<I extends TypeMenuItemProps = TypeMenuItemProps> =
|
|
646
|
-
type TypeMenuGroupElement<I extends TypeMenuItemProps = TypeMenuItemProps> =
|
|
647
|
-
type TypeMenuContentElement<I extends TypeMenuItemProps = TypeMenuItemProps> =
|
|
645
|
+
type TypeItemElement<I extends TypeMenuItemProps = TypeMenuItemProps> = React__default.ReactElement<TypeMenuItemProps | TypeSubmenuItemProps<I, TypeSubmenuValidMenuComponentProps<I>>>;
|
|
646
|
+
type TypeMenuGroupElement<I extends TypeMenuItemProps = TypeMenuItemProps> = React__default.ReactElement<TypeMenuGroupProps<I>>;
|
|
647
|
+
type TypeMenuContentElement<I extends TypeMenuItemProps = TypeMenuItemProps> = React__default.ReactElement<TypeMenuContentProps<I>>;
|
|
648
648
|
interface TypeMenuChildren {
|
|
649
649
|
type: "item" | "group" | "content";
|
|
650
650
|
element: TypeItemElement | TypeMenuGroupElement | TypeMenuContentElement;
|
|
@@ -653,18 +653,18 @@ declare const mapMenuItems: <I extends TypeMenuItemProps = TypeMenuItemProps>({
|
|
|
653
653
|
type TypeUseMenuChildrenProps<I extends TypeMenuItemProps = TypeMenuItemProps> = {
|
|
654
654
|
children?: TypeMenuRootProps["children"];
|
|
655
655
|
menuItems?: I[];
|
|
656
|
-
MenuItemComponent?:
|
|
656
|
+
MenuItemComponent?: React__default.ComponentType<I>;
|
|
657
657
|
};
|
|
658
658
|
declare const getChildrenFromMenuItems: <I extends TypeMenuItemProps = TypeMenuItemProps>({ menuItems, MenuItemComponent, }: {
|
|
659
659
|
menuItems: I[];
|
|
660
|
-
MenuItemComponent?:
|
|
660
|
+
MenuItemComponent?: React__default.ComponentType<I>;
|
|
661
661
|
}) => react_jsx_runtime.JSX.Element;
|
|
662
662
|
declare const useMenuChildren: <I extends TypeMenuItemProps = TypeMenuItemProps>({ children: childrenProp, menuItems, MenuItemComponent, }: TypeUseMenuChildrenProps<I>) => {
|
|
663
663
|
allMenuItems: TypeInternalItemProps<TypeMenuItemProps>[];
|
|
664
664
|
menuItemsMap: {
|
|
665
665
|
[key: string]: TypeInternalItemProps<TypeMenuItemProps>;
|
|
666
666
|
};
|
|
667
|
-
children: string | number | true |
|
|
667
|
+
children: string | number | true | React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | React__default.ReactPortal;
|
|
668
668
|
};
|
|
669
669
|
|
|
670
670
|
declare const useSelectStateReducer: Required<UseSelectProps<TypeInternalItemProps>>["stateReducer"];
|