'use client';
"use strict";var e=require("tslib"),t=require("react"),l=require("tailwind-merge");require("../../../contexts/BaseColorContext.cjs");var r=require("../../../contexts/HoveredValueContext.cjs");require("../../../contexts/RootStylesContext.cjs");var a=require("../../../contexts/SelectedValueContext.cjs"),o=require("../../../lib/font.cjs"),s=require("../../../lib/sizing.cjs"),n=require("../../../lib/spacing.cjs"),i=require("../../../lib/theme.cjs"),c=require("../../../lib/utils.cjs");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=u(t);const C=c.makeClassName("DropdownItem"),d=g.default.forwardRef(((u,d)=>{const{value:m,text:x,icon:f,className:p}=u,h=e.__rest(u,["value","text","icon","className"]),{selectedValue:N,handleValueChange:O}=t.useContext(a),{hoveredValue:b}=t.useContext(r),j=N===m,q=b===m,v=j?c.getColorClassNames(i.DEFAULT_COLOR,i.colorPalette.lightBackground).bgColor:q?c.getColorClassNames(i.DEFAULT_COLOR,i.colorPalette.canvasBackground).bgColor:c.getColorClassNames(i.DEFAULT_COLOR,i.colorPalette.canvasBackground).hoverBgColor,w=j?c.getColorClassNames(i.DEFAULT_COLOR,i.colorPalette.darkestText).textColor:c.getColorClassNames(i.DEFAULT_COLOR,i.colorPalette.darkText).textColor,L=f||null;return g.default.createElement("button",Object.assign({ref:d,type:"button",onClick:()=>null==O?void 0:O(m),className:l.twMerge(C("root"),"flex items-center justify-start w-full truncate",n.spacing.twoXl.paddingX,n.spacing.md.paddingY,o.fontSize.sm,v,w,p)},h),L?g.default.createElement(L,{className:l.twMerge(C("icon"),"flex-none",s.sizing.lg.height,s.sizing.lg.width,n.spacing.lg.marginRight,c.getColorClassNames(i.DEFAULT_COLOR,i.colorPalette.lightText).textColor),"aria-hidden":"true"}):null,g.default.createElement("p",{className:l.twMerge(C("text"),"text-sm whitespace-nowrap truncate")},null!=x?x:m))}));d.displayName="DropdownItem",module.exports=d;
