import React from "react"; import { utils } from "../../main"; import styles from "./Flex.module.scss"; interface Props { /** * Flex children */ children: JSX.Element | JSX.Element[]; /** * The CSS gap spacing between all elements */ gap?: string; /** * The CSS inner padding */ padding?: string; /** * The CSS outer margin */ margin?: string; /** * Flex direction */ direction?: "row" | "column"; /** * Contents alignment */ align?: { /** * Vertical alignment */ vertical?: "center" | "flex-start" | "flex-end"; /** * Horizontal alignment */ horizontal?: "center" | "flex-start" | "flex-end"; }; } export interface RefInstance {} const Flex = React.forwardRef((props, ref) => { props = utils.mergeObject( { children: <>, gap: "0px", padding: "0px", margin: "0px", direction: "row", align: { vertical: "flex-start", horizontal: "flex-start", }, }, props ); return (
{props.children}
); }); export default Flex;