UNPKG

@hypothesis/frontend-shared

Version:

Shared components, styles and utilities for Hypothesis projects

21 lines (20 loc) 864 B
import type { JSX } from 'preact'; import type { PresentationalProps } from '../../types'; type ComponentProps = { /** When true, the Card will be styled to appear as if hovered ("active") */ active?: boolean; /** * The "raised" default variant adds dimensionality with shadows; those * shadows intensify on hover. "Flat" variant does not have any dimensionality * or hover. */ variant?: 'raised' | 'flat'; /** When `custom`, user should set desired width using `classes` prop */ width?: 'full' | 'auto' | 'custom'; }; export type CardProps = PresentationalProps & ComponentProps & Omit<JSX.HTMLAttributes<HTMLElement>, 'width'>; /** * Render content in a card-like frame */ export default function Card({ children, classes, elementRef, active, variant, width, ...htmlAttributes }: CardProps): JSX.Element; export {};