# hb-input-text

## Description

Single-line text field driven by a JSON `schemaentry` (id, value, placeholder, readonly, required, optional `validationRegex`, and `params` min/max length). With `show_validation`, uses Bulma `input.is-success` / `is-danger` and `help is-danger` for tips. Theme via inherited `--bulma-*` on `:host`. Dispatches `setVal` whenever the value or validity changes, and `clickEnter` on Enter.

## Styling (Bulma)

Bundles **Bulma 1.x** `form/shared`, `form/input-textarea`, and `form/tools` in the shadow root; theme defaults on `:host` (`--bulma-hb-def-*`). Override public **`--bulma-*`** from `body` / `:root`.

## Types

```typescript
export type FormSchemaEntry = {
  /**
   * This will be both the key of the object when submitting the form's data,
   * and also the id in the DOM.
   */
  id: string;

  /**
   * Optional default value.
   */
  value?: string | number | boolean;

  readonly?: boolean;

  /**
   * This doesn't matter if the dependencies requirements aren't met.
   */
  required?: boolean;

  validationRegex?: string;
  /**
   * Shows if value is not valid.
   */
  validationTip?: string;

  placeholder?: string;

  /**
   * Other parameters that may be specific to a certain kind of form control.
   */
  params?: Record<string, any>;
};

export type Component = {
  id?: string;
  style?: string;

  show_validation?: "yes" | "no";
  schemaentry: FormSchemaEntry;
};

export type Events = {
  setVal: { value: string, valid: boolean, id: string };
};
```
