{"version":3,"sources":["Splitter.tsx"],"sourcesContent":["export type SplitterOptions = {\n\treverse?: boolean;\n\thorizontal?: boolean;\n\tvertical?: boolean;\n\talign?: \"start\" | \"center\" | \"end\";\n\tstyle?: Record<string, string | number>;\n\tgap?: number | string | [number | string, number | string],\n}\nexport const Splitter = blankTemplate<SplitterOptions & { children?: any }>(({gap, align, reverse, children, horizontal, vertical, style, ...props}) => {\n\tconst direction = horizontal ? \"row\" : vertical ? \"column\" : \"row\";\n\t(children as HTMLElement[]).forEach(child => {\n\t\tif (child && child.style && child.dataset)\n\t\t\tchild.style.flex = child.dataset.size ?? \"1\";\n\t});\n\tconst alignment = align === \"center\" ? \"center\" : align === \"end\" ? \"flex-end\" : \"flex-start\";\n\treturn <div stylesheet={\"./Splitter.css?\"}\n\t\tstyle={{\n\t\t\t\"flex-wrap\": (horizontal || vertical) ? \"nowrap\" : \"wrap\",\n\t\t\t\"flex-direction\": direction + (reverse ? \"-reverse\" : \"\"),\n\t\t\t\"align-items\": alignment,\n\t\t\t\"--gap-x\": typeof gap === \"number\" ? gap : gap?.[0] ?? \"40px\",\n\t\t\t\"--gap-y\": typeof gap === \"number\" ? gap : gap?.[1] ?? \"100px\",\n\t\t\t...((style ?? {}) as Record<string, string>),\n\t\t}}\n\t\t{...props}\n\t\tclass={[\"unyt-splitter\", ...(props.class ? [props.class] : [])].join(\" \")}>\n\t\t{children}\n\t</div>\n});"],"names":["Splitter","blankTemplate","gap","align","reverse","children","horizontal","vertical","style","props","forEach","child","dataset","flex","size","div","stylesheet","direction","class","join"],"mappings":";AAQA,OAAO,MAAMA,WAAWC,cAAoD,CAAC,EAACC,GAAG,EAAEC,KAAK,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGC,OAAM,IAElJ,AAACJ,SAA2BK,OAAO,CAACC,CAAAA;QAC/BA,SAASA,MAAMH,KAAK,IAAIG,MAAMC,OAAO,IACxCD,CAAAA,MAAMH,KAAK,CAACK,IAAI,GAAGF,MAAMC,OAAO,CAACE,IAAI,IAAI,GAAE;IAC7C,kBAEO,KAACC;QAAIC,YAAY;QACvBR,OAAO;YACN,aAAa,AAACF,cAAcC,WAAY,WAAW;YACnD,kBAAkBU,AATFX,CAAAA,aAAa,QAAQC,WAAW,WAAW,KAAI,IAShCH,CAAAA,UAAU,aAAa,EAAC;YACvD,eALgBD,AAAU,aAAVA,QAAqB,WAAWA,AAAU,UAAVA,QAAkB,aAAa;YAM/E,WAAW,AAAe,YAAf,OAAOD,MAAmBA,MAAMA,KAAK,CAAC,EAAE,IAAI;YACvD,WAAW,AAAe,YAAf,OAAOA,MAAmBA,MAAMA,KAAK,CAAC,EAAE,IAAI;YACvD,GAAKM,SAAS,CAAC,CAAC;QACjB;QACC,GAAGC,KAAK;QACTS,OAAO;YAAC;eAAqBT,MAAMS,KAAK,GAAG;gBAACT,MAAMS,KAAK;aAAC,GAAG,EAAE;SAAE,CAACC,IAAI,CAAC;kBACpEd;SAEA","sourceRoot":"/lib/unyt-components-0.0.17/components/splitter/","file":"Splitter.tsx"}