import{r as c,X as S,Z as s,f as d,a9 as P}from"./index-4e7882bc.js";import{u}from"./useSlot-175c596f.js";import{g as R,a as H,s as F,u as W}from"./useThemeProps-f08c4918.js";import{F as _}from"./Input-c805519f.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,f){var a,l;const t=W({props:e,name:"JoyFormLabel"}),{children:b,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,x]=u("root",{additionalProps:{htmlFor:r==null?void 0:r.htmlFor,id:r==null?void 0:r.labelId},ref:f,className:m.root,elementType:z,externalForwardedProps:p,ownerState:i}),[k,C]=u("asterisk",{additionalProps:{"aria-hidden":!0},className:m.asterisk,elementType:T,externalForwardedProps:p,ownerState:i});return d(h,s({},x,{children:[b,n&&d(k,s({},C,{children:[" ","*"]}))]}))}),M=U;export{M as F};
