import '@reddit/faceplate-ui/components/faceplate-text-input.js';
import { FieldConfig_String } from '@devvit/protos/types/devvit/ui/form_builder/v1alpha/field.js';
import { html, ifDefined } from '@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js';
export const renderStringField = (field) => {
    const { minLength, maxLength, placeholder } = field.fieldConfig?.stringConfig ?? FieldConfig_String.fromPartial({});
    return html `
    <faceplate-text-input
      id="${field.fieldId}"
      name="${field.fieldId}"
      class="py-xs border-0"
      type="text"
      value="${ifDefined(field.defaultValue?.stringValue)}"
      placeholder="${ifDefined(placeholder)}"
      helper-text-placeholder="${ifDefined(field.helpText)}"
      minlength="${ifDefined(minLength)}"
      maxlength="${ifDefined(maxLength)}"
      ?disabled="${field.disabled}"
      ?required="${field.required}"
      innerLabel
    >
      <span slot="label">${field.label}</span>
    </faceplate-text-input>
  `;
};
//# sourceMappingURL=renderStringField.js.map