| 627 | > {} |
| 628 | |
| 629 | export const SideNavHeader = (props: SideNavHeaderProps): ReactNode => { |
| 630 | let {header} = useContext(SideNavViewTransitionContext); |
| 631 | let id = useId(); |
| 632 | return ( |
| 633 | <NavigationTreeHeader |
| 634 | id={id} |
| 635 | // For some reason I'm unable to use a ViewTransition component directly here. Not sure why |
| 636 | style={header ? {viewTransitionName: `${id}-header`, viewTransitionClass: header} : undefined} |
| 637 | className={style({ |
| 638 | position: 'relative', |
| 639 | // Hidden by the panel rather than by the header itself — see the attribute in SideNavPanel. |
| 640 | display: { |
| 641 | default: 'block', |
| 642 | ':is([data-side-panel-collapsed] *)': 'none' |
| 643 | }, |
| 644 | font: 'ui-sm', |
| 645 | // Component/S/Medium for the font, doesn't appear to match our fonts |
| 646 | fontWeight: 'medium', |
| 647 | color: 'gray-600', |
| 648 | paddingStart: 'edge-to-text', |
| 649 | marginBottom: '[8px]', |
| 650 | height: 16 |
| 651 | })}> |
| 652 | {props.children} |
| 653 | </NavigationTreeHeader> |
| 654 | ); |
| 655 | }; |
| 656 | |
| 657 | export interface SideNavItemLinkProps { |
| 658 | /** Rendered contents of the link. */ |