import{r as e,h as t,H as i}from"./p-21516f8c.js";import{c as l}from"./p-86bff9b3.js";const s=":host{--lu-label-padding-bottom:0}:host(.lu-color) .label-helper-text-container>label{color:var(--lu-color-base)}.container{display:flex;flex-flow:column}.label-helper-text-container{padding-bottom:var(--lu-label-padding-bottom);display:flex;flex-flow:row;align-items:center;justify-content:space-between}.label-helper-text-container>label{font-size:16px;line-height:26px}.label-helper-text-container>label>span.required{color:#E4002B}.helper-text{color:#686A6F;font-size:12px;font-style:italic;line-height:15px}.helper-text-notification{color:#256EC1;font-size:14px;font-style:inherit;line-height:26px}.error{padding-top:4px;color:#E4002B;font-size:14px;line-height:22px}.is-invalid{padding-left:9px;border-left:#E4002B solid 2px}";const r=class{constructor(t){e(this,t);this.labelText="";this.required=false;this.optional=false;this.invalid=false;this.useAsteriskAsRequiredIndicator=false}watchHandler(e){this.useId=e+"-label"}clueText(){if(this.helperText)return this.helperText;if(this.required&&!this.useAsteriskAsRequiredIndicator)return"Required";if(this.optional&&!this.useAsteriskAsRequiredIndicator)return"Optional";return null}showErrorMessage(){return this.invalid}errorMessageText(){let e="Field invalid";if(this.errorMessage)e=this.errorMessage;return e}helperTextClasses(){let e="helper-text";if(this.helperText&&this.helperText!=="")e+=" helper-text-notification";return e}containerClasses(){let e="container";if(this.invalid)e+=" is-invalid";return e}hostData(){return{class:Object.assign({},l(this.color))}}__stencil_render(){return t("div",{class:this.containerClasses()},t("div",{class:"label-helper-text-container"},t("label",{id:this.useId,htmlFor:this.forId},this.labelText,this.useAsteriskAsRequiredIndicator&&this.required&&t("span",{class:"required"}," *")),t("div",{class:this.helperTextClasses()},this.clueText())),t("slot",null),this.showErrorMessage()?t("div",{class:"error"},this.errorMessageText()):null)}static get watchers(){return{forId:["watchHandler"]}}render(){return t(i,this.hostData(),this.__stencil_render())}};r.style=s;export{r as lu_label};
//# sourceMappingURL=p-0cf54f9e.entry.js.map