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