import{r as c,a7 as S,a9 as s,l as d,ak as P}from"./index-57016b76.js";import{u}from"./useSlot-7545b28c.js";import{g as R,a as H,s as F,u as W}from"./useThemeProps-dc4c84f8.js";import{F as _}from"./Input-16c32ed1.js";function $(o){return R("MuiFormLabel",o)}H("MuiFormLabel",["root","asterisk"]);const q=["children","component","slots","slotProps"],w=()=>P({root:["root"],asterisk:["asterisk"]},$,{}),z=F("label",{name:"JoyFormLabel",slot:"Root",overridesResolver:(o,e)=>e.root})(({theme:o})=>({"--Icon-fontSize":"calc(var(--FormLabel-lineHeight) * 1em)",WebkitTapHighlightColor:"transparent",alignSelf:"var(--FormLabel-alignSelf)",display:"flex",gap:"2px",alignItems:"center",flexWrap:"wrap",userSelect:"none",fontFamily:o.vars.fontFamily.body,fontSize:`var(--FormLabel-fontSize, ${o.vars.fontSize.sm})`,fontWeight:o.vars.fontWeight.md,lineHeight:`var(--FormLabel-lineHeight, ${o.vars.lineHeight.sm})`,color:`var(--FormLabel-color, ${o.vars.palette.text.primary})`,margin:"var(--FormLabel-margin, 0px)"})),T=F("span",{name:"JoyFormLabel",slot:"Asterisk",overridesResolver:(o,e)=>e.asterisk})({color:"var(--FormLabel-asteriskColor)"}),U=c.forwardRef(function(e,b){var a,l;const t=W({props:e,name:"JoyFormLabel"}),{children:f,component:v="label",slots:g={},slotProps:L={}}=t,y=S(t,q),r=c.useContext(_),n=(a=(l=e.required)!=null?l:r==null?void 0:r.required)!=null?a:!1,i=s({},t,{required:n}),m=w(),p=s({},y,{component:v,slots:g,slotProps:L}),[h,k]=u("root",{additionalProps:{htmlFor:r==null?void 0:r.htmlFor,id:r==null?void 0:r.labelId},ref:b,className:m.root,elementType:z,externalForwardedProps:p,ownerState:i}),[x,C]=u("asterisk",{additionalProps:{"aria-hidden":!0},className:m.asterisk,elementType:T,externalForwardedProps:p,ownerState:i});return d(h,s({},k,{children:[f,n&&d(x,s({},C,{children:[" ","*"]}))]}))}),M=U;export{M as F};
