import{defineProperty as t}from"../../../_virtual/_rollupPluginBabelHelpers.js";import e from"classnames";import o,{forwardRef as s,useContext as i,useRef as r,useEffect as n,useCallback as a}from"react";import{camelCase as m}from"es-toolkit";import{getStyle as l}from"../../helpers/typesciptCssModulesHelper.js";import p from"../Text/Text.js";import{SELECTION_KEYS as d}from"../../constants/keyCodes.js";import{SIZES as c}from"../../constants/sizes.js";import{NOOP as u}from"../../utils/function-utils.js";import{withStaticProps as f}from"../../types/withStaticProps.js";import"../../utils/colors-vars-map.js";import j from"../../hooks/useKeyEvent/index.js";import"../Menu/Menu/hooks/useLastNavigationDirection.js";import"../../hooks/useFullKeyboardListeners.js";import"../../hooks/useActiveDescendantListFocus/index.js";import"../../hooks/useVibeMediaQuery/index.js";import v from"../../hooks/useMergeRef.js";import"../../tests/constants.js";import"../../hooks/useSwitch/index.js";import{ListContext as k}from"../List/utils/ListContext.js";import{ListItemComponentType as h}from"./ListItemConstants.js";import x from"./ListItem.module.scss.js";var b=s((function(s,f){var h=s.className,b=s.id,y=s.component,L=void 0===y?"div":y,I=s.onClick,M=void 0===I?u:I,C=s.onHover,P=void 0===C?u:C,g=s.selected,F=s.disabled,N=void 0!==F&&F,z=s.size,E=void 0===z?c.SMALL:z,H=s.tabIndex,S=void 0===H?0:H,w=s.children,A=s["aria-current"],D=s["data-testid"],K=s.role,T=void 0===K?"option":K,_=s.tooltipProps,B=i(k).updateFocusedItem,O=r(null),Q=v(f,O);n((function(){g&&(null==B||B(b))}),[g,b,B]);var R=a((function(t){N||M(t,b)}),[N,M,b]);j({keys:d,ref:O,callback:R});var V=a((function(t){N||P(t,b)}),[N,P,b]);return o.createElement(p,{element:L,"data-testid":D||b,ref:Q,className:e(x.listItem,h,l(x,m(E)),t(t({},x.selected,g&&!N),x.disabled,N)),id:b,type:"text2","aria-disabled":N,"aria-selected":g,onClick:R,onMouseEnter:V,onFocus:V,role:T,tabIndex:S,"aria-current":A,tooltipProps:_},w)}));Object.assign(b,{displayName:"ListItem"});var y=f(b,{sizes:c,components:h});export{y as default};
//# sourceMappingURL=ListItem.js.map
