import React__default,{useContext}from"react";import PropTypes from"prop-types";import{k as knownIcons,I as Icon}from"./Icon.component-BVkaZqpA.js";import{a as MenuContext}from"./Menu.component-Dw3i5vRh.js";import{q as qe}from"./menu-DiwXZMR-.js";const itemStyles=`
	jn-text-theme-default
	jn-flex
	jn-items-center
	jn-w-full
	cursor-pointer
	bg-clip-padding
	jn-truncate
	jn-text-left
	jn-bg-theme-background-lvl-1
	disabled:jn-cursor-not-allowed
	data-[headlessui-state="disabled"]:jn-cursor-not-allowed
`,smallStyles=`
	jn-text-sm
	jn-p-2
`,normalStyles=`
	jn-text-base
	jn-pt-[0.6875rem]
	jn-pb-[0.5rem]
	jn-px-[0.875rem]
`,actionableItemStyles=`
	hover:jn-bg-theme-background-lvl-3
	data-[headlessui-state="disabled"]:jn-bg-theme-background-lvl-3
`,MenuItem=a=>{let{label:d="",icon:e=null,disabled:f=!1,children:g=null,onClick:b,href:c,className:h=""}=a;const i=useContext(MenuContext),{variant:j}=i||{};return React__default.createElement(qe.Item,{disabled:f,as:c?"a":g?"div":"button",href:f?void 0:c,onClick:a=>{b&&b(a)},className:`
						juno-menu-item 
						${c?"juno-menu-item-anchor":"juno-menu-item-button"} 
						${itemStyles} 
						${g?"":actionableItemStyles}
						${"small"===j?smallStyles:normalStyles}
						${f&&c?"jn-cursor-not-allowed":""}
						${h}
					`},React__default.createElement("span",{className:`${f?"jn-opacity-50":""}`},e?React__default.createElement(Icon,{icon:e,size:"18",className:"jn-inline-block jn-mr-2"}):"",g||d))};MenuItem.propTypes={label:PropTypes.string,disabled:PropTypes.bool,icon:PropTypes.oneOf(knownIcons),className:PropTypes.string,children:PropTypes.node,href:PropTypes.string,onClick:PropTypes.func};export{MenuItem as M};