UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

51 lines (50 loc) 1.4 kB
import React from "react"; import type { TimelineComponentTypes } from "../utils/types.internal"; export interface TimelinePeriodProps extends React.HTMLAttributes<HTMLDivElement> { /** * Period start date. */ start: Date; /** * Period end date. */ end: Date; /** * Icon for easier visual identification. */ icon?: React.ReactNode; /** * Period status. * @default "neutral" */ status?: "success" | "warning" | "danger" | "info" | "neutral"; /** * Status label for screen-readers * e.g "Sykemeldt", "foreldrepermisjon" */ statusLabel?: string; /** * Callback when selecting a period. */ onSelectPeriod?: (event: React.MouseEvent<Element> | React.KeyboardEvent<Element>) => void; /** * Content displayed in Popover on click. */ children?: React.ReactNode; /** * Visual active inidcation on period. * * Make sure only one period is active at a time. */ isActive?: boolean; /** * Default orientation of popover * @default "top" */ placement?: "top" | "bottom"; } export interface PeriodType extends React.ForwardRefExoticComponent<TimelinePeriodProps & React.RefAttributes<HTMLDivElement | HTMLButtonElement>> { componentType: TimelineComponentTypes; } export declare const Period: PeriodType; export default Period;