UNPKG

@navinc/base-react-components

Version:
36 lines 1.89 kB
var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import { jsx as _jsx } from "react/jsx-runtime"; import { forwardRef } from 'react'; import { addClassNameTo } from '../../add-classname-to.js'; import { styledBackwardsCompatibility } from '../../styled-backwards-compatibility.js'; import { cn } from '../../cn.js'; // right here const CardInternal = { Root: addClassNameTo('div', /* cn */ 'py-0 px-200 flex flex-col items-stretch bg-surfaceContainer rounded-300 shadow-elevation1', { 'data-testid': 'card:root' }), Header: styledBackwardsCompatibility(forwardRef((_a, ref) => { var { hideDivider = false } = _a, props = __rest(_a, ["hideDivider"]); return (_jsx("div", Object.assign({ ref: ref, "data-testid": "card:header" }, props, { className: cn('px-0 py-200 border-0 border-b border-solid', hideDivider ? 'border-b-transparent' : 'border-b-outlineVariant', props.className) }))); })), Content: addClassNameTo('div', /* cn */ 'py-100 px-0 ', { 'data-testid': 'card:content' }), Footer: addClassNameTo('div', /* cn */ 'py-150 px-0 ', { 'data-testid': 'card:footer' }), }; export const Card = CardInternal.Root; Card.Header = CardInternal.Header; Card.Content = CardInternal.Content; Card.Footer = CardInternal.Footer; Card.displayName = 'Card'; Card.Header.displayName = 'Card.Header'; Card.Content.displayName = 'Card.Content'; Card.Footer.displayName = 'Card.Footer'; //# sourceMappingURL=card.js.map