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