UNPKG

@hypothesis/frontend-shared

Version:

Shared components, styles and utilities for Hypothesis projects

41 lines (39 loc) 1.71 kB
/** * @typedef {import('../../types').CompositeProps} CompositeProps * @typedef {import('preact').JSX.HTMLAttributes<HTMLElement>} HTMLAttributes * @typedef {import('../../types').IconComponent} IconComponent * * @typedef PanelProps * @prop {import('preact').ComponentChildren} [buttons] - content to render as * actions for the panel * @prop {IconComponent} [icon] - Name of optional icon to render in header * @prop {() => void} [onClose] - handler for closing the panel; if provided, * will render a close button that invokes this onClick * @prop {string} title */ /** * Render a composed set of Card components in a panel-like interface * * @param {CompositeProps & PanelProps & Omit<HTMLAttributes, 'icon'|'size'|'width'>} props */ export default function Panel({ children, elementRef, buttons, icon: Icon, onClose, title, ...htmlAttributes }: CompositeProps & PanelProps & Omit<HTMLAttributes, 'icon' | 'size' | 'width'>): import("preact").JSX.Element; export type CompositeProps = import('../../types').CompositeProps; export type HTMLAttributes = import('preact').JSX.HTMLAttributes<HTMLElement>; export type IconComponent = import('../../types').IconComponent; export type PanelProps = { /** * - content to render as * actions for the panel */ buttons?: import('preact').ComponentChildren; /** * - Name of optional icon to render in header */ icon?: import("preact").FunctionComponent<import("preact").JSX.SVGAttributes<SVGSVGElement>> | undefined; /** * - handler for closing the panel; if provided, * will render a close button that invokes this onClick */ onClose?: (() => void) | undefined; title: string; };