(props: {children?: React.ReactNode})
| 103 | const RenderLinkContext = React.createContext<LinkProps['render'] | undefined>(undefined); |
| 104 | |
| 105 | export function NavigationTreeItemContent(props: {children?: React.ReactNode}) { |
| 106 | return ( |
| 107 | <AriaNavigationTreeItemContent> |
| 108 | {({level, hasChildItems, isExpanded, isCurrent, isCurrentAncestor}) => { |
| 109 | let indicator: 'current' | 'ancestor' | undefined; |
| 110 | if (isCurrent) { |
| 111 | indicator = 'current'; |
| 112 | } else if (isCurrentAncestor && !isExpanded) { |
| 113 | indicator = 'ancestor'; |
| 114 | } |
| 115 | return ( |
| 116 | <> |
| 117 | {level > 1 && ( |
| 118 | <div |
| 119 | className="shrink-0" |
| 120 | style={{width: `calc((${level} - 1) * calc(var(--spacing) * 4))`}} |
| 121 | /> |
| 122 | )} |
| 123 | <NavTreeLinkContext.Provider value={{indicator}}> |
| 124 | {props.children} |
| 125 | </NavTreeLinkContext.Provider> |
| 126 | <Button |
| 127 | slot="chevron" |
| 128 | isDisabled={!hasChildItems} |
| 129 | className={({isFocusVisible}) => |
| 130 | expandButton({isFocusVisible, className: hasChildItems ? undefined : 'invisible'}) |
| 131 | }> |
| 132 | <ChevronRight aria-hidden className={chevron({isExpanded})} /> |
| 133 | </Button> |
| 134 | </> |
| 135 | ); |
| 136 | }} |
| 137 | </AriaNavigationTreeItemContent> |
| 138 | ); |
| 139 | } |
| 140 | |
| 141 | export function NavigationTreeItem(props: AriaNavigationTreeItemProps) { |
| 142 | return <AriaNavigationTreeItem className={itemStyles} {...props} />; |
nothing calls this directly
no outgoing calls
no test coverage detected