@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
45 lines (44 loc) • 1.86 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { cn } from '../../lib/utils';
import { Box } from '../Flex';
export function Card(props) {
const { shadow = true, children, className, style, gap = 2 } = props;
return (_jsx(Box, { className: cn('twa:bg-background twa:text-foreground', '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: children }));
}
const CardTitle = (props) => {
const { children, className, gap = 2, border = true } = props;
return (_jsx("div", { className: cn('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-foreground/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: children }));
};
const CardBody = (props) => {
const { children, gap, className } = props;
return (_jsx("div", { className: cn('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: children }));
};
Card.Title = CardTitle;
Card.Body = CardBody;