import { ComponentPropsWithRef, forwardRef, Ref } from 'react'; import { gapLookup, gapMdLookup, gapLgLookup, directionLookup, directionMdLookup, directionLgLookup, justifyLookup, justifyMdLookup, justifyLgLookup, alignLookup, alignMdLookup, alignLgLookup, widthLookup, widthMdLookup, widthLgLookup, gapXlLookup, directionXlLookup, justifyXlLookup, alignXlLookup, widthXlLookup, gap2XlLookup, width2XlLookup, } from '../theme'; import { cn } from '../libs'; import { getClassName, memo } from '../utils'; import { Responsive } from '../types/ui'; export type Gap = keyof typeof gapLookup; export type Direction = keyof typeof directionLookup; export type Justify = keyof typeof justifyLookup; export type Align = keyof typeof alignLookup; export type Width = keyof typeof widthLookup; export interface FlexProps extends ComponentPropsWithRef<'div'> { grow?: boolean | Responsive; gap?: Gap | Responsive; direction?: Direction | Responsive; justify?: Justify | Responsive; align?: Align | Responsive; width?: Width | Responsive; } const Component = ({ grow, gap, direction, justify, align, width, className, ...rest }: FlexProps, ref: Ref) => { const g = grow as any; const gp = gap as any; const d = direction as any; const j = justify as any; const a = align as any; const w = width as any; return (
); }; export const Flex = memo(forwardRef(Component));