import{defineProperty as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import o,{forwardRef as a,useRef as s}from"react";import{noop as t}from"lodash-es";import i from"classnames";import r from"../../hooks/useMergeRefs.js";import{BEMClass as l}from"../../helpers/bem-helper.js";import{useKeyboardButtonPressedFunc as d}from"../../hooks/useKeyboardButtonPressedFunc.js";import{getTestId as n}from"../../tests/testIds.js";import{ComponentDefaultTestId as m}from"../../tests/constants.js";import"./Clickable.scss.js";var p=l("l3-style-clickable"),c=a((function(a,l){var c=a.elementType,u=void 0===c?"div":c,b=a.className,f=void 0===b?"":b,v=a.id,h=a.children,j=a.role,y=void 0===j?"button":j,k=a.onClick,x=void 0===k?t:k,C=a.enableTextSelection,I=void 0!==C&&C,L=a.onMouseDown,B=void 0===L?t:L,E=a.ariaLabel,K=a.ariaHidden,P=a.ariaHasPopup,T=a.ariaExpanded,g=a.tabIndex,w=void 0===g?"0":g,D=a.disabled,H=void 0!==D&&D,M=a.style,A=a.dataTestId,N=s(null),_=r({refs:[l,N]}),F=d(x);return o.createElement(u,{ref:_,className:i("l3-style-clickable",f,e({disabled:H},p({state:"disable-text-selection"}),!I)),"data-testid":A||n(m.CLICKABLE,v),role:y,onClick:H?void 0:x,id:v,onKeyDown:H?void 0:F,tabIndex:H?-1:w,"aria-label":E,"aria-hidden":K,"aria-haspopup":P,"aria-expanded":T,onMouseDown:B,style:M},h)}));Object.assign(c,{defaultTestId:m.CLICKABLE});var u=c;export{u as default};
