{"version":3,"file":"types.cjs","sources":["../../../../src/components/flex/types.ts"],"sourcesContent":["import React from \"react\";\nimport type { AsChildProps } from \"../../utilities/polymorphism/as-child.js\";\nimport type { PolymorphicPropsWithRef } from \"../../utilities/polymorphism/polymorphism.js\";\n\nexport const SEMANTIC_SPACING = [\n    \"none\",\n    \"2xs\",\n    \"xs\",\n    \"s\",\n    \"m\",\n    \"l\",\n    \"xl\",\n    \"2xl\",\n] as const;\n\nexport const STATIC_SPACING = [\n    \"0\",\n    \"2\",\n    \"4\",\n    \"8\",\n    \"12\",\n    \"16\",\n    \"20\",\n    \"24\",\n    \"28\",\n    \"32\",\n    \"40\",\n    \"48\",\n    \"56\",\n    \"64\",\n    \"72\",\n    \"80\",\n    \"104\",\n    \"168\",\n] as const;\n\nconst BREAKPOINTS = [\"small\", \"medium\", \"large\", \"xl\"] as const;\n\nexport type SemanticSpacing = (typeof SEMANTIC_SPACING)[number];\nexport type StaticSpacing = (typeof STATIC_SPACING)[number];\nexport type Breakpoint = (typeof BREAKPOINTS)[number];\n\nexport type Responsive<T> = Partial<Record<Breakpoint, T>>;\nexport function isResponsive<T>(value: unknown): value is Responsive<T> {\n    return BREAKPOINTS.includes(\n        Object.keys(value as Responsive<T>)[0] as Breakpoint,\n    );\n}\n\nexport const LAYOUTS = [\n    \"auto\",\n    \"1\",\n    \"2\",\n    \"3\",\n    \"4\",\n    \"6\",\n    \"4.8\",\n    \"8.4\",\n    \"2.10\",\n    \"10.2\",\n    \"3.9\",\n    \"9.3\",\n    \"5.7\",\n    \"7.5\",\n] as const;\n\nexport type Layout = (typeof LAYOUTS)[number];\nexport type Center = \"m\" | \"l\" | \"xl\" | \"2xl\" | boolean;\n\nexport type DynamicGap =\n    | `${SemanticSpacing}`\n    | `${SemanticSpacing} ${SemanticSpacing}`;\nexport type StaticGap =\n    | `${StaticSpacing}`\n    | `${StaticSpacing} ${StaticSpacing}`;\nexport type Gap = DynamicGap | StaticGap;\n\ntype FlexBaseProps = {\n    alignItems?: \"normal\" | \"start\" | \"center\" | \"end\" | \"baseline\" | \"stretch\";\n    alignContent?:\n        | \"normal\"\n        | \"start\"\n        | \"center\"\n        | \"end\"\n        | \"stretch\"\n        | \"baseline\"\n        | \"space-between\"\n        | \"space-around\"\n        | \"space-evenly\";\n    center?: Center;\n    direction?: \"row\" | \"column\" | \"row-reverse\" | \"column-reverse\";\n    fill?: boolean;\n    gap?: Gap | Responsive<Gap>;\n    inline?: boolean;\n    textAlign?: \"left\" | \"right\" | \"center\";\n    justifyContent?:\n        | \"normal\"\n        | \"start\"\n        | \"center\"\n        | \"end\"\n        | \"space-between\"\n        | \"space-around\"\n        | \"space-evenly\";\n    layout?: Layout | Responsive<Layout>;\n    wrap?: \"wrap\" | \"nowrap\" | \"reverse\";\n};\n\nexport type FlexProps<As extends React.ElementType = \"div\"> =\n    PolymorphicPropsWithRef<As, FlexBaseProps>;\n\nexport type FlexComponent = <ElementType extends React.ElementType = \"div\">(\n    props: FlexProps<ElementType> & AsChildProps,\n) => React.ReactElement | null;\n"],"names":["BREAKPOINTS","value","includes","Object","keys"],"mappings":"iGAIO,MAgCDA,EAAc,CAAC,QAAS,SAAU,QAAS,sBAa1B,CACnB,OACA,IACA,IACA,IACA,IACA,IACA,MACA,MACA,OACA,OACA,MACA,MACA,MACA,gCA3D4B,CAC5B,OACA,MACA,KACA,IACA,IACA,IACA,KACA,8BAG0B,CAC1B,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,4BAUG,SAAyBC,GAC5B,OAAOD,EAAYE,SACfC,OAAOC,KAAKH,GAAwB,GAE5C"}