/** @jsx jsx */ import * as React from "react"; import css from '@styled-system/css' import { jsx } from '@emotion/core' import { variant } from "styled-system"; import styled from "@emotion/styled"; import { GapSizes } from "../utils/System"; //GridCol export type GridColProps = { children: React.ReactNode; columnCount?: number; variant?: GapSizes // this is cool pattern of passing in a variant gap?: GapSizes; pad?: GapSizes; stretch?: boolean; }; type StyledProps = { variant?: GapSizes; children: React.ReactNode; }; export const getGapValue = (gap: GapSizes): number => { switch (gap) { case 'small': return 2 case 'medium': return 4 case 'large': return 5 default: break; } return 0 } const StyledGridCol = styled("div")( variant({ variants: { small: { gap: 2 }, medium: { gap: 3 }, large: { gap: 4 } } }) ); const GridCol: React.FC = ( ({ children, columnCount = 4 , variant, gap, pad, stretch}) => { return ( { children } ); } ); export default GridCol;