import{typeof as e,defineProperty as i}from"../../../../_virtual/_rollupPluginBabelHelpers.js";import t,{forwardRef as s,useRef as r,useMemo as a}from"react";import o from"classnames";import{FlexJustify as l,FlexAlign as n,FlexGap as c,FlexDirection as d}from"./FlexConstants.js";import p from"./Flex.module.scss.js";import{camelCase as f}from"es-toolkit";import m from"../../../clickable/dist/Clickable/Clickable.js";import{withStaticProps as u}from"../../../../shared/dist/types/withStaticProps.js";import{useMergeRef as b}from"../../../../shared/dist/hooks/useMergeRef.js";import{getStyle as g}from"../../../../shared/dist/utils/typesciptCssModulesHelper.js";var y=u(s((function(s,l){var n=s.className,c=s.id,d=s.elementType,u=void 0===d?"div":d,y=s.direction,j=void 0===y?"row":y,x=s.wrap,v=void 0!==x&&x,k=s.children,h=s.justify,w=void 0===h?"start":h,C=s.align,F=void 0===C?"center":C,M=s.flex,O=s.gap,D=s.onClick,L=s.onMouseDown,P=s.style,B=s.ariaLabelledby,G=s.ariaLabel,H=s.tabIndex,I=s["data-testid"],N=r(null),S=b(l,N),T=a((function(){if(O)return"number"==typeof O?{gap:O+"px"}:{gap:"var(--spacing-".concat(O,")")}}),[O]),_=a((function(){return M?["string","number"].includes(e(M))?{flex:M}:"object"==e(M)?{flexGrow:M.grow,flexShrink:M.shrink,flexBasis:M.basis}:{}:{}}),[M]),A=a((function(){return Object.assign(Object.assign(Object.assign({},P),T),_)}),[P,T,_]),E=a((function(){return D?{elementType:u,ariaLabelledby:B}:{"aria-labelledby":B}}),[D,u,B]);return t.createElement(D?m:u,Object.assign({id:c,"data-testid":I},E,{ref:S,className:o(p.container,g(p,f("direction-"+j)),g(p,f("justify-"+w)),g(p,f("align-"+F)),n,i({},p.wrap,v)),tabIndex:H,onClick:D,onMouseDown:L,style:A,"aria-label":G}),k)})),{justify:l,align:n,gaps:c,directions:d});export{y as default};
//# sourceMappingURL=Flex.js.map
