diff --git a/easy-ui-react/src/VerticalNav/SupplementaryAction.tsx b/easy-ui-react/src/VerticalNav/SupplementaryAction.tsx index 9e46c98d..2124d06c 100644 --- a/easy-ui-react/src/VerticalNav/SupplementaryAction.tsx +++ b/easy-ui-react/src/VerticalNav/SupplementaryAction.tsx @@ -1,5 +1,12 @@ import ArrowForwardIosIcon from "@easypost/easy-ui-icons/ArrowForwardIos"; -import React, { ComponentProps, ElementType, ReactNode } from "react"; +import { DOMRef } from "@react-types/shared"; +import React, { + ComponentProps, + ElementType, + ReactElement, + ReactNode, + forwardRef, +} from "react"; import { Icon } from "../Icon"; import { Text } from "../Text"; @@ -11,12 +18,23 @@ export type SupplementaryActionProps = children: ReactNode; }; -export function SupplementaryAction(props: SupplementaryActionProps) { - const { as: As = "button", children, ...elementProps } = props; - return ( - - {children} - - - ); -} +type SupplementaryActionWithForwardRef = { + ( + props: SupplementaryActionProps & { ref?: DOMRef }, + ): ReactElement; + displayName?: string; +}; + +export const SupplementaryAction = forwardRef( + (props, ref) => { + const { as: As = "button", children, ...elementProps } = props; + return ( + + {children} + + + ); + }, +) as SupplementaryActionWithForwardRef; + +SupplementaryAction.displayName = "SupplementaryAction"; diff --git a/easy-ui-react/src/VerticalNav/VerticalNav.stories.tsx b/easy-ui-react/src/VerticalNav/VerticalNav.stories.tsx index cf97dfb6..b5813e4d 100644 --- a/easy-ui-react/src/VerticalNav/VerticalNav.stories.tsx +++ b/easy-ui-react/src/VerticalNav/VerticalNav.stories.tsx @@ -12,6 +12,8 @@ import { import { ExpandableVerticalNav, VerticalNav } from "./VerticalNav"; import { Icon } from "../Icon"; import { Text } from "../Text"; +import { Menu } from "../Menu"; +import { UnstyledButton } from "../UnstyledButton"; type Story = StoryObj; @@ -308,11 +310,21 @@ export const SupplementaryAction: Story = { aria-label="Sidebar" renderLogo={() => } supplementaryAction={ - - Optional Bottom - + + + + Optional Bottom + + + + Copy + Cut + Paste + + } selectedKeys={[page.substring(0, 1)]} >