@hypothesis/frontend-shared
Version:
Shared components, styles and utilities for Hypothesis projects
38 lines • 1.06 kB
JavaScript
var _jsxFileName = "/home/runner/work/frontend-shared/frontend-shared/src/components/layout/Card.tsx";
import classnames from 'classnames';
import { downcastRef } from '../../util/typing';
import { jsxDEV as _jsxDEV } from "preact/jsx-dev-runtime";
/**
* Render content in a card-like frame
*/
export default function Card({
children,
classes,
elementRef,
active = false,
variant = 'raised',
width = 'full',
...htmlAttributes
}) {
return _jsxDEV("div", {
"data-component": "Card",
...htmlAttributes,
ref: downcastRef(elementRef),
className: classnames('rounded-lg border bg-white', {
'shadow hover:shadow-md': variant === 'raised',
// default
'shadow-md': active && variant === 'raised'
}, {
'w-full': width === 'full',
// default
'w-auto': width === 'auto'
// No width is set if `width === 'custom'`
}, classes),
children: children
}, void 0, false, {
fileName: _jsxFileName,
lineNumber: 40,
columnNumber: 5
}, this);
}
//# sourceMappingURL=Card.js.map