UNPKG

@atlaskit/atlassian-navigation

Version:

A horizontal navigation component for Atlassian apps.

38 lines (37 loc) 1.52 kB
import React, { type ReactNode } from 'react'; import type { DebouncedFuncLeading } from 'lodash'; import { type OverflowProviderProps } from './types'; interface OverflowContext { /** * Returns `true` when the navigation item is visible, * and `false` when the navigation item has been pushed into the overflow menu. */ isVisible: boolean; /** * Method that can be used to programmatically open the overflow menu */ openOverflowMenu: () => void; /** * Method that can be used to programmatically close the overflow menu */ closeOverflowMenu: () => void; } declare const OverflowContext: React.Context<OverflowContext>; export declare const OverflowProvider: ({ children, isVisible, openOverflowMenu, closeOverflowMenu, }: OverflowProviderProps) => React.JSX.Element; /** * __useOverFlowStatus__ * * Returns the current context value for the nearest OverflowProvider. * * - [Example](https://atlassian.design/components/atlassian-navigation/examples#responsive) * * @deprecated `@atlaskit/atlassian-navigation` is deprecated. Use `@atlaskit/navigation-system` instead. */ export declare const useOverflowStatus: () => OverflowContext; export declare const useOverflowController: (nodes: ReactNode | ReactNode[]) => { visibleItems: ReactNode[]; overflowItems: ReactNode[]; updateWidth: DebouncedFuncLeading<React.Dispatch<React.SetStateAction<number>>>; }; declare const _default: (_props: OverflowContext) => void; export default _default;