import{r as c,W as S,Y as s,f as d,a8 as P}from"./index-ca24af84.js";import{u}from"./useSlot-32c61900.js";import{g as R,a as W,s as F,u as H}from"./useThemeProps-95e03d4e.js";import{F as _}from"./Input-1c187977.js";function $(o){return R("MuiFormLabel",o)}W("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=H({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};
