import{r as t,h as e,H as s,a as i}from"./p-D0dWnGvB.js";import{g as a}from"./p-DEtoWGOc.js";import{S as h}from"./p-BFEqPAFn.js";const c=class{constructor(e){t(this,e),this.helperText="",this.error=!1}render(){var t;return e("div",{key:"fba2082feeec8236bb4b1c427530200461fde1c7",class:"dga-helper-text "+(this.error?"dga-helper-text--error":"")},e("span",{key:"045252be8c2ad9d9efc620bb08476f62f18d1bc7",class:"dga-helper-text__icon"},this.helperTextIcon&&(null===(t=this.helperTextIcon)||void 0===t?void 0:t.name)&&e("dga-icon",{key:"762ed7b7ff308b0ab447f6f38c7bf421b586e3b4",icon:this.helperTextIcon.name,variant:this.helperTextIcon.variant,type:this.helperTextIcon.type,size:16})),e("span",{key:"45d3cea48852598a25cd3d5798c1b9e099411085",class:"dga-helper-text__desc"},this.helperText))}},d=class{constructor(e){t(this,e),this.label="",this.variant="default",this.size="md",this.disabled=!1,this.required=!1}render(){return e("label",{key:"2664ee2470a12a0a0c4319ace89e7433b9f97fb4",class:`dga-label dga-label--${this.size} ${this.disabled?"disabled":""}`},this.required&&e("span",{key:"a133a41c5a00e5c010485629f3caf56da205d09d",class:"star"},"*"),this.label)}},n={success:e("dga-icon",{icon:"CheckmarkCircle02Icon",variant:"solid"}),error:e("dga-icon",{icon:"AlertCircleIcon",variant:"solid"}),warning:e("dga-icon",{icon:"Alert02Icon",variant:"solid"})},r=class{constructor(e){t(this,e),this.size="lg",this.type="text",this.variant="default",this.error=!1,this.feedbackIcon=!1,this.feedbackIconType="success",this.feedbackIconRing=!1,this.helperText="",this.disabled=!1,this.readonly=!1,this.required=!1,this.fullwidth=!0,this.name=a(),this.value="",this.isActive=!1,this.isFocused=!1,this.componentId=`dga-button-${Math.random().toString(36).substring(2,9)}`,this.rootStyles={}}valueChanged(t,e){t!==e&&(this.textInputEl.value=t)}handleSxChange(){this.processStyling()}componentWillLoad(){this.sxStyleManager=new h(this.componentId,this.el)}componentDidLoad(){this.processStyling()}componentDidUpdate(){this.processStyling()}processStyling(){if(!this.sx)return;const t="string"==typeof this.sx?JSON.parse(this.sx):this.sx;this.rootStyles=this.sxStyleManager.processSxProp(t)}disconnectedCallback(){var t;null===(t=this.sxStyleManager)||void 0===t||t.cleanup()}render(){return e(s,{key:"adabf71d1c87cb0c46329397ad6f0e7c266ea12c",id:this.componentId,style:this.rootStyles},e("div",{key:"fb2980499894e0f74d139c6cdf845b584f0eed45",class:{"dga-form-control":!0,"dga-form-control--fullwidth":this.fullwidth}},this.label&&e("dga-label",{key:"6d55b18ababa9c2889aa812eacb17b766e6fb3d9",label:this.label,size:this.size,required:this.required,disabled:this.disabled}),e("div",{key:"ec180d4b780bfb4d6f0c0ada2c9b9b1c017965ed",class:`input input--${this.size} ${this.error?"input--error":""} ${"default"!==this.variant?`input--${this.variant}`:""} ${this.isActive?"active":""} ${this.isFocused?"focus":""} ${this.disabled?"input--disabled":""} ${this.readonly?"readOnly":""}`,ref:t=>this.inputContainerRef=t},e("slot",{key:"49bf9e9c32ad4d924b83d3c69b501d2cfc29790a",name:"prefix"}),this.icon&&e("span",{key:"cd8b961739982b43da19dc62de08b5c504fb2a0a",class:"input__icon"},e("dga-icon",{key:"59b68d7269ddd1d32a4b1e0becfb43875c64cf54",icon:this.icon.name,variant:this.icon.variant,type:this.icon.type,size:20})),e("input",{key:"dd38bb384e9c8c282d857be74379ec3f55615693",ref:t=>this.textInputEl=t,value:this.value,name:this.name,type:this.type,onFocus:()=>this.isFocused=!0,onBlur:t=>{this.isFocused=!1,this.onBlur(t)},class:"input__field",placeholder:this.placeholder,disabled:this.disabled,readOnly:this.readonly,required:this.required,onMouseDown:()=>this.isActive=!0,onMouseUp:()=>this.isActive=!1,onMouseOut:()=>this.isActive=!1,onChange:this.onChange,onInput:this.onInput}),this.error?e("span",{class:"input__feedback-icon input__feedback-icon--error "+(this.feedbackIconRing?"input__feedback-icon--ring":"")}):this.feedbackIcon?e("span",{class:`input__feedback-icon input__feedback-icon--${this.feedbackIconType} ${this.feedbackIconRing?"input__feedback-icon--ring":""}`},n[this.feedbackIconType]):null,e("slot",{key:"5271bbff657a8a584f03a45d2ee5a8231602e1e3",name:"suffix"})," "),this.helperText&&e("dga-helper-text",{key:"affe6c109ebbab79e4e258fdeedd7ff0777deed7",helperText:this.helperText,helperTextIcon:this.helperTextIcon,error:this.error})))}get el(){return i(this)}static get watchers(){return{value:["valueChanged"],sx:["handleSxChange"]}}};export{c as dga_helper_text,d as dga_label,r as dga_text_input}