import React from 'react' import styled from 'styled-components' import { Box, Card } from '../' import { SPACE, Story } from '../helpers/storybook' export default { title: 'Card', component: Card, } as const interface Content { title: string subtitle: string totalAmount: string date: number minAmount: string } const Table = styled.table` width: 100%; font-size: 12px; border-collapse: collapse; th { text-align: left; font-weight: 400; } th.total { padding-right: 55px; font-weight: 600; } td { text-align: right; font-weight: 600; } td.total { font-size: 25.92px; } ` const BaseComponent: Story = ({ title, subtitle, totalAmount, date, minAmount, ...args }) => { return ( {title} {subtitle}
Total Amount Due {totalAmount}
Due Date {new Date(date).toLocaleDateString()}
Minimum Amount Due {minAmount}
) } interface BasicArgs extends Omit { withShadow: string noShadow: string } export const BasicUsage: Story = ({ withShadow, noShadow, ...args }) => (
) BasicUsage.argTypes = { margin: SPACE, padding: SPACE, paddingX: SPACE, paddingY: SPACE, withShadow: { name: 'shadow card title' }, noShadow: { name: 'shadowless card title' }, date: { control: 'date' }, } BasicUsage.args = { withShadow: 'With Shadows on', noShadow: 'With Shadows off', subtitle: 'Subtitle', totalAmount: '$350.20', date: new Date(2020, 9, 5).valueOf(), minAmount: '$127.00', useBoxShadow: false, margin: '30px', maxWidth: '500px', } export const NestedCards: Story = (args) => ( Card 1 Card 2Card 3 )