@hypothesis/frontend-shared
Version:
Shared components, styles and utilities for Hypothesis projects
39 lines • 1.12 kB
JavaScript
var _jsxFileName = "/home/runner/work/frontend-shared/frontend-shared/src/components/layout/CardTitle.tsx";
import classnames from 'classnames';
import { downcastRef } from '../../util/typing';
import { jsxDEV as _jsxDEV } from "preact/jsx-dev-runtime";
/**
* Style a title for a Card
*/
export default function CardTitle({
children,
classes,
elementRef,
tagName = 'h1',
variant = 'primary',
...htmlAttributes
}) {
const WrapperElement = tagName;
return _jsxDEV("div", {
"data-component": "CardTitle",
...htmlAttributes,
className: classnames({
'text-lg text-brand font-semibold': variant === 'primary',
'text-xl text-slate-7 font-normal': variant === 'secondary'
}, classes),
ref: downcastRef(elementRef),
children: _jsxDEV(WrapperElement, {
"data-testid": "card-title-heading",
children: children
}, void 0, false, {
fileName: _jsxFileName,
lineNumber: 45,
columnNumber: 7
}, this)
}, void 0, false, {
fileName: _jsxFileName,
lineNumber: 33,
columnNumber: 5
}, this);
}
//# sourceMappingURL=CardTitle.js.map