import clsx from 'clsx' import React from 'react' import { Box } from '../Box/Box' import { sprinkles } from '../../css/sprinkles.css' import { negativeMargin } from './utils' import * as styles from './styles.css' import { spaces } from '../../css/spaces' type Gap = keyof typeof spaces const ColumnsContext = React.createContext<{ gap: Gap }>({ gap: '0', }) type ColumnsProps = React.PropsWithChildren & { gap?: Gap } const Columns: React.FC = ({ children, gap }) => ( {children} ) type ColumnProps = React.PropsWithChildren & { span?: styles.ColumnSprinkles['flex'] } type ColumnComponent = React.FC & { Container: typeof Columns } export const Column: ColumnComponent = ({ children, span = 'auto', }: ColumnProps) => { const { gap } = React.useContext(ColumnsContext) return ( {children} ) } Column.Container = Columns