/** * @flow * Copyright © 2018 Galaxy Software Services https://github.com/GSS-FED/vital-ui-kit-react * MIT license */ import * as React from 'react'; import styled from 'styled-components'; import Header from './Header'; import Container from './Container'; import Footer from './Footer'; import FooterButton from './FooterButton'; const Root = styled.div` position: relative; display: flex; margin: auto; box-sizing: border-box; flex-direction: column; word-break: break-word; border-radius: 0.25rem; overflow: hidden; background-color: ${({ theme }) => theme.card.bg}; box-shadow: ${({ shadow }) => shadow ? '2px 2px 4px 0px #cfd8dc' : 'none'}; width: ${({ width }) => width}; height ${({ height }) => height}; border: ${({ theme }) => theme.border}; `; type Props = { children: React.Node, width?: string, height?: string, shadow?: boolean, }; /** * @render react * @name Card * @description Card Component with header, footer, buttons * @example * * * Lorem ipsum dolor sit amet, sea oblique aliquam oportere ea, id dico interesset eam. Eu eum quem velit verterem, amet dicat quaeque ad est. * * Cancel * Confirm * * */ const Card = ({ children, width, height, shadow, ...props }: Props) => ( {children} ); Card.defaultProps = { width: 'auto', height: 'auto', shadow: false, }; Card.Header = Header; Card.Container = Container; Card.Footer = Footer; Card.FooterButton = FooterButton; export default Card;