import { type ComponentPropsWithoutRef, type ElementType, type ReactElement, type ReactNode } from 'react'; import { type BaseMainNavigationSlotRecipeVariant } from '../../styled-system/recipes'; /** * The basic menu item type. * This is used for the menu item with no children, or the children of the nested menu item. */ type BasicNavigationItem = { /** * The label of the navigation item. */ label: string; /** * The URL of the navigation item. */ href: string; /** * The icon of the navigation item. */ icon?: ReactElement; /** * Whether the navigation item is the current page. * * If this property is set to true, the navigation item is highlighted as the current page. * When the navigation item is the nested navigation item, the parent navigation is opened by default. */ isCurrent?: boolean; /** * Nested navigation items. * * This property is not allowed for the non-nested navigation items. */ children?: undefined; /** * Whether the navigation item is an external link. */ isExternal?: boolean; /** * For a status icon or badge that is displayed on the right side when navigation is expanded. * This slot is only visible in the expanded state, not when collapsed. * If `locked` prop is true, any indicators in this slot will be ignored. * * **EXPERIMENTAL**: This property is experimental and may be changed or removed in the future. */ statusSlot?: ReactNode; /** * Display a lock icon on the right side to indicate the navigation item is locked by permission. * This option does not actually disable the link. * This option is allowed only for the basic navigation items, not for the parent navigation items or children navigation items. * * @default false */ locked?: boolean; /** * The properties for the lock icon. * * @property aria-label - The alternative text for the lock icon. It's set "ロックされています" by default. */ lockIconProps?: Pick, 'aria-label'>; }; /** * The nested navigation parent item type. */ type ParentNavigationItem = { /** * The label of the navigation item. */ label: string; /** * The URL of the navigation item. * * This property is not allowed for the parent navigation items. */ href?: undefined; /** * The icon of the navigation item. */ icon?: ReactElement; /** * Whether the navigation item is the current page. * * This property is not allowed for the parent navigation items. */ isCurrent?: undefined; /** * Whether the nested navigation is open by default. * When set to true, the parent navigation item is expanded on initial render, * regardless of whether any child has `isCurrent: true`. * * @default false */ isOpenByDefault?: boolean; /** * Nested navigation items. * * If this property is set, the navigation item is displayed as a summary element and the nested navigation items are displayed when the summary element is clicked. * The nested depth is limited to one level and the icon is only allowed for the first level navigation item. */ children: Omit[]; /** * Whether this navigation item is a group label. * * This property is not allowed for the parent navigation items. */ isGroupLabel?: undefined; /** * Whether this navigation item belongs to the group menu section. * * When set to `true`, this item is rendered in a separate `