import{h}from"@stencil/core";import{isRtl}from"../../../functions/page-align";import{__}from"@wordpress/i18n";export class ScFormControl{constructor(){this.size="medium",this.name=void 0,this.showLabel=!0,this.label=void 0,this.labelId=void 0,this.inputId=void 0,this.required=!1,this.help=void 0,this.helpId=void 0}render(){return h("div",{key:"7cc653d32ae4b95fad41f6e0fe8d3e51bf2991a6",part:"form-control",class:{"form-control":!0,"form-control--small":"small"===this.size,"form-control--medium":"medium"===this.size,"form-control--large":"large"===this.size,"form-control--has-label":!!this.label&&this.showLabel,"form-control--has-help-text":!!this.help,"form-control--is-required":!!this.required,"form-control--is-rtl":isRtl()}},h("label",{key:"5cfb4310d3bf9dc0e9951e0b9f796d4359292234",part:"label",id:this.labelId,class:"form-control__label",htmlFor:this.inputId,"aria-hidden":this.label?"false":"true"},h("slot",{key:"8d419e0fa37a30887b650bf76a78d7720711e5fe",name:"label"},this.label),h("slot",{key:"a9603557631f9f99f858bffe1464f6955f8b454a",name:"label-end"}),!!this.required&&h("span",{key:"b27a00aee94c00e953bae7634619fe9765928396","aria-hidden":"true",class:"required"}," ","*"),h("sc-visually-hidden",{key:"4a8d0f9297a738e95788e8be9dc03a565e9b6997"},this.required?__("required","surecart"):"")),h("div",{key:"93e0e991da63e52a9079ff076a75c18cf5ecbde7",part:"input",class:"form-control__input"},h("slot",{key:"f737923462655a830b10254446e6ac26fe5d17e1"})),this.help&&h("div",{key:"397a92ad1f6fe067ef6552c81cd954d27e122488",part:"help-text",id:this.helpId,class:"form-control__help-text"},h("slot",{key:"c7778d7f76a5e9126d747b342ec03b55130509e1",name:"help-text"},this.help)))}static get is(){return"sc-form-control"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-form-control.scss"]}}static get styleUrls(){return{$:["sc-form-control.css"]}}static get properties(){return{size:{type:"string",mutable:!1,complexType:{original:"'small' | 'medium' | 'large'",resolved:'"large" | "medium" | "small"',references:{}},required:!1,optional:!1,docs:{tags:[],text:"Size of the label"},attribute:"size",reflect:!0,defaultValue:"'medium'"},name:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Name for the input. Used for validation errors."},attribute:"name",reflect:!1},showLabel:{type:"boolean",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Show the label."},attribute:"show-label",reflect:!1,defaultValue:"true"},label:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Input label."},attribute:"label",reflect:!1},labelId:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Input label id."},attribute:"label-id",reflect:!1},inputId:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Input id."},attribute:"input-id",reflect:!1},required:{type:"boolean",mutable:!1,complexType:{original:"boolean",resolved:"boolean",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Whether the input is required."},attribute:"required",reflect:!1,defaultValue:"false"},help:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Help text"},attribute:"help",reflect:!1},helpId:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:"Help id"},attribute:"help-id",reflect:!1}}}static get elementRef(){return"el"}}