UNPKG

@oslokommune/punkt-react

Version:

React komponentbibliotek til Punkt, et designsystem laget av Oslo Origo

25 lines (24 loc) 1.43 kB
import { HTMLAttributes, Ref } from 'react'; import { IHeaderMenuButton, IHeaderMenuLink, IHeaderMenuSection, IHeaderMenuServices, IPktHeaderMenu as ISharedPktHeaderMenu, THeaderFooterApi, THeaderMenuLocale } from '../../shared-types'; export type { THeaderFooterApi, THeaderMenuLocale, IHeaderMenuLink, IHeaderMenuButton, IHeaderMenuSection, IHeaderMenuServices, }; export interface IPktHeaderMenu extends Omit<HTMLAttributes<HTMLElement>, 'onError'>, ISharedPktHeaderMenu { /** Forwarded to the host element. */ ref?: Ref<HTMLElement>; /** Fired when the payload has been fetched (or `data` was supplied). */ onDataLoaded?: (data: THeaderFooterApi) => void; /** Fired when the fetch fails. */ onDataError?: (error: Error) => void; } /** * `<PktHeaderMenu>` — global mega menu for Oslo kommune. * * Fetches the live header/footer payload on mount and renders the * `megamenu` slice for the current locale. Mirrors `pkt-header-menu` * (Punkt Elements) — both implementations share types and data * helpers from `shared-utils/header-footer`. * * This component is purely presentational with respect to focus/scroll-lock; * the parent header is expected to control `open` and own focus * management. */ export declare const PktHeaderMenu: ({ dataUrl, data, locale, open, mobileBreakpoint, className, onDataLoaded, onDataError, ref, ...rest }: IPktHeaderMenu) => import("react").JSX.Element;