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