import { layout, LayoutProps } from 'styled-system' import { styled } from '@styled-components' import { cssClass } from '../../utils/css-class.js' /** * @classdesc * * * * Main Table wrapper. Along with _TableRow_, _TableCell_, _TableCaption_, * _TableHead_ and _TableBody_ gives you the powerful tool for building tables. * * ### Related Components * * - _Table_: {@link LayoutProps} & standard table html props * - _TableBody_: standard tbody html props * - _TableCell_: {@link SpaceProps} & {@link ColorProps} & standard td html props * - _TableHead_: standard thead html props * - _TableRow_: standard tr html props * * ### Usage * * ```javascript * import { * Table, * TableRow, * TableCell, * TableCaption, * TableHead, * TableBody, * } from '@adminjs/design-system' * ``` * * @component * @hideconstructor * @subcategory Atoms * @see {@link https://storybook.adminjs.co/?path=/story/designsystem-atoms-table--default Storybook} * @example * return ( * * * * Monthly savings * * * * * * * * Name * * * * * * Last * * * * Surname * Gender * Age * * * * * * Value 1 * Value 2 * Value 2 * Value 2 * Value 2 * * * * Value 1 * Value 2 * Value 2 * Value 2 * Value 2 * * *
*
* ) * @section design-system */ const Table = styled.table` position: relative; font-family: ${({ theme }) => theme.font}; color: ${({ theme }) => theme.colors.text}; border-left: 1px solid ${({ theme }) => theme.colors.border}; border-right: 1px solid ${({ theme }) => theme.colors.border}; ${layout}; ` Table.displayName = 'Table' Table.defaultProps = { width: 1, className: cssClass('Table'), } export default Table