import{toConsumableArray as i}from"../../../_virtual/_rollupPluginBabelHelpers.js";import{jsx as e}from"react/jsx-runtime";import{forwardRef as a,useRef as o}from"react";import{noop as r}from"lodash-es";import s from"classnames";import c from"../../../hooks/useMergeRefs.js";import n from"../../Icon/Icon.js";import"./Tab.scss.js";var t=a((function(a,t){var l=a.className,d=a.id,m=a.value,f=void 0===m?0:m,u=a.disabled,b=void 0!==u&&u,p=a.active,v=void 0!==p&&p,j=a.focus,g=void 0!==j&&j,h=a.onClick,k=void 0===h?r:h,y=a.icon,N=a.iconType,z=a.iconSide,C=void 0===z?"left":z,S=a.children,T=a.size,x=o(null),H=c({refs:[t,x]});return e("li",Object.assign({ref:H,className:s("tab--wrapper",l,{active:v,disabled:b,"tab-focus-visible-inset":g}),id:d,role:"tab","aria-selected":v,"aria-disabled":b},{children:e("a",Object.assign({className:s("tab-inner","tab-inner--size-".concat(T)),onClick:function(){return!b&&k(f)}},{children:function(){if(!y)return S;var a=e(n,{clickable:!1,ariaHidden:!0,iconType:N,icon:y,className:s("tab-icon",C),iconSize:18,ignoreFocusStyle:!0});return"left"===C?[a].concat(i(S)):[].concat(i(S),[a])}()}))}),d)}));export{t as default};
