@adaptabletools/adaptable-cjs
Version:
Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
50 lines (49 loc) • 2.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Card = Card;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const twMerge_1 = require("../../twMerge");
const clsx_1 = tslib_1.__importDefault(require("clsx"));
const Flex_1 = require("../Flex");
function Card(props) {
const { shadow = true, children, className, style, gap = 2 } = props;
return (React.createElement(Flex_1.Box, { className: (0, clsx_1.default)('twa:bg-defaultbackground twa:text-text-on-defaultbackground', 'ab-Card', 'twa:text-3', 'twa:rounded-standard twa:p-2', 'twa:flex twa:flex-col', {
'twa:shadow-sm': shadow,
'twa:gap-0': gap === 0,
'twa:gap-1': gap === 1,
'twa:gap-2': gap === 2,
'twa:gap-3': gap === 3,
'twa:gap-4': gap === 4,
'twa:gap-8': gap === 8,
}, className), style: style }, children));
}
const CardTitle = (props) => {
const { children, className, gap = 2, border = true } = props;
return (React.createElement("div", { className: (0, twMerge_1.twMerge)((0, clsx_1.default)('ab-Card__title', {
'twa:flex twa:flex-row': true,
'twa:items-center': true,
'twa:text-4 twa:px-2': true,
'twa:pb-2 twa:border-b': border,
'twa:border-b-text-on-defaultbackground/20': true,
'twa:gap-0': gap === 0,
'twa:gap-1': gap === 1,
'twa:gap-2': gap === 2,
'twa:gap-3': gap === 3,
'twa:gap-4': gap === 4,
'twa:gap-8': gap === 8,
}, className)) }, children));
};
const CardBody = (props) => {
const { children, gap, className } = props;
return (React.createElement("div", { className: (0, clsx_1.default)('ab-Card__body', 'twa:overflow-auto twa:min-h-0', 'twa:flex-1 twa:flex twa:flex-col', {
'twa:gap-0': gap === 0,
'twa:gap-1': gap === 1,
'twa:gap-2': gap === 2,
'twa:gap-3': gap === 3,
'twa:gap-4': gap === 4,
'twa:gap-8': gap === 8,
}, className) }, children));
};
Card.Title = CardTitle;
Card.Body = CardBody;