import{a_ as R,a$ as _,aZ as f,r as u,b0 as $,ae as q,ag as s,b1 as F,o as b,aq as H}from"./index-62412d73.js";import{F as W}from"./FormControlContext-bf06479f.js";function w(o){return R("MuiFormLabel",o)}_("MuiFormLabel",["root","asterisk"]);const z=["children","component","htmlFor","id","slots","slotProps"],T=()=>H({root:["root"],asterisk:["asterisk"]},w,{}),U=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)"})),A=f("span",{name:"JoyFormLabel",slot:"Asterisk",overridesResolver:(o,e)=>e.asterisk})({color:"var(--FormLabel-asteriskColor)"}),I=u.forwardRef(function(e,v){var a,l;const t=$({props:e,name:"JoyFormLabel"}),{children:g,component:L="label",htmlFor:n,id:i,slots:h={},slotProps:y={}}=t,x=q(t,z),r=u.useContext(W),m=(a=(l=e.required)!=null?l:r==null?void 0:r.required)!=null?a:!1,c=s({},t,{required:m}),p=T(),d=s({},x,{component:L,slots:h,slotProps:y}),[k,C]=F("root",{additionalProps:{htmlFor:n??(r==null?void 0:r.htmlFor),id:i??(r==null?void 0:r.labelId)},ref:v,className:p.root,elementType:U,externalForwardedProps:d,ownerState:c}),[S,P]=F("asterisk",{additionalProps:{"aria-hidden":!0},className:p.asterisk,elementType:A,externalForwardedProps:d,ownerState:c});return b(k,s({},C,{children:[g,m&&b(S,s({},P,{children:[" ","*"]}))]}))}),M=I;export{M as F};
