{
  "$schema": "https://next.0build.dev/schema/component.v1.json",
  "accessibility": {
    "aria": [
      {
        "attributes": [],
        "description": "Visually hidden group description.",
        "part": "description"
      },
      {
        "attributes": [
          {
            "name": "aria-labelledby",
            "value": "${this.groupId}-label ${this.groupId}-desc"
          },
          {
            "name": "role",
            "value": "group"
          }
        ],
        "description": "Group container: `role=\"group\"` labeled by the label and description.",
        "part": "host-inner"
      },
      {
        "attributes": [
          {
            "name": "aria-label",
            "value": "dynamic"
          }
        ],
        "description": "Single-character field with a per-digit `aria-label`.",
        "part": "input"
      },
      {
        "attributes": [],
        "description": "Visually hidden group label.",
        "part": "label"
      },
      {
        "attributes": [
          {
            "name": "role",
            "value": "presentation"
          }
        ],
        "description": "Fields wrapper: `role=\"presentation\"`.",
        "part": "wrapper"
      }
    ],
    "notes": [
      "The group is labeled and described; each field announces its digit position, and completion is announced politely.",
      "Pasted codes are distributed across the fields."
    ]
  },
  "attributes": [
    {
      "default": "false",
      "description": "Focuses the first field on mount.",
      "from": null,
      "name": "autofocus",
      "property": "autofocus",
      "reflect": false,
      "tokens": null,
      "type": "boolean",
      "values": null
    },
    {
      "default": "6",
      "description": "Number of digit fields (default 6).",
      "from": null,
      "name": "length",
      "property": "length",
      "reflect": false,
      "tokens": null,
      "type": "number",
      "values": null
    },
    {
      "default": "'numeric'",
      "description": "Virtual keyboard mode: `numeric` (default) or `text`.",
      "from": null,
      "name": "input-mode",
      "property": "input-mode",
      "reflect": false,
      "tokens": null,
      "type": "'numeric' | 'text'",
      "values": [
        "numeric",
        "text"
      ]
    },
    {
      "default": "false",
      "description": "Disables the control so it cannot be interacted with.",
      "from": "InputMixin",
      "name": "disabled",
      "property": "disabled",
      "reflect": false,
      "tokens": null,
      "type": "boolean",
      "values": null
    },
    {
      "default": "''",
      "description": "Associates the hidden form input with a form by id, even when the component sits outside that form.",
      "from": "InputMixin",
      "name": "form",
      "property": "form",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Field name for the hidden form input; array values submit as `name[]`.",
      "from": "InputMixin",
      "name": "name",
      "property": "name",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Placeholder text for the control's empty state.",
      "from": "InputMixin",
      "name": "placeholder",
      "property": "placeholder",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "false",
      "description": "Marks the control as required.",
      "from": "InputMixin",
      "name": "required",
      "property": "required",
      "reflect": false,
      "tokens": null,
      "type": "boolean",
      "values": null
    },
    {
      "default": "''",
      "description": "Initial value of the control, synchronized with the hidden form input.",
      "from": "InputMixin",
      "name": "value",
      "property": "value",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Per-instance text overrides as `key: text` pairs, merged over the global `z-i18n` script and the built-in defaults.",
      "from": "Hwc",
      "name": "i18n",
      "property": "i18n",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Floating UI placement options (for example `offset` and `shiftPadding`) parsed as `key: value` pairs.",
      "from": "Hwc",
      "name": "floating",
      "property": "floating",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "false",
      "description": "Skips re-rendering after the first render; an existing `data-host-inner` child is adopted as the rendered DOM.",
      "from": "Hwc",
      "name": "force-prevent-rerender",
      "property": "force-prevent-rerender",
      "reflect": false,
      "tokens": null,
      "type": "boolean",
      "values": null
    },
    {
      "default": "''",
      "description": "Selector or id of an external element or `<template>` whose inner content is cloned in place of an inline `template[data-fn=\"template\"]` child.",
      "from": "Hwc",
      "name": "template",
      "property": "template",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Adds classes to named parts as `key: classes` pairs; a plain string targets the default part.",
      "from": "Base",
      "name": "cls",
      "property": "cls",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "''",
      "description": "Adds inline styles to named parts as `key: styles` pairs; a plain string targets the default part.",
      "from": "Base",
      "name": "stl",
      "property": "stl",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    }
  ],
  "category": "inputs",
  "children": [
    {
      "attributes": [
        {
          "description": "Marks the script as configuration (value: `config`).",
          "name": "data-fn",
          "required": true,
          "values": [
            "config"
          ]
        },
        {
          "description": "Re-parses the configuration when the script mutates.",
          "name": "data-reactive",
          "required": false,
          "type": "boolean"
        }
      ],
      "description": "JSON configuration script parsed by the base class (i18n, cls, stl, floating).",
      "element": "script",
      "id": "config",
      "required": false,
      "selector": "script[data-fn=\"config\"][type=\"application/json\"]"
    },
    {
      "attributes": [
        {
          "description": "Marks the select as the data source (value: `data-source`).",
          "name": "data-fn",
          "required": true,
          "values": [
            "data-source"
          ]
        },
        {
          "description": "Re-parses the options when the select mutates.",
          "name": "data-reactive",
          "required": false,
          "type": "boolean"
        }
      ],
      "children": [
        {
          "attributes": [
            {
              "description": "Group header text; also the default group key.",
              "name": "label",
              "required": true,
              "type": "string"
            },
            {
              "description": "Disables every option in the group.",
              "name": "disabled",
              "required": false,
              "type": "boolean"
            },
            {
              "description": "Overrides the group key used in the parsed data.",
              "name": "data-key",
              "required": false,
              "type": "string"
            },
            {
              "description": "Comma-separated keywords stored with the group's data.",
              "name": "data-keywords",
              "required": false,
              "type": "comma-separated string"
            }
          ],
          "children": [
            {
              "attributes": [
                {
                  "description": "Value carried by this option in the parsed data.",
                  "name": "value",
                  "required": false,
                  "type": "string"
                },
                {
                  "description": "Makes the option non-selectable.",
                  "name": "disabled",
                  "required": false,
                  "type": "boolean"
                },
                {
                  "description": "Marks the option as initially selected.",
                  "name": "selected",
                  "required": false,
                  "type": "boolean"
                },
                {
                  "description": "Extra search terms, comma-separated; searched alongside the label and value.",
                  "name": "data-keywords",
                  "required": false,
                  "type": "comma-separated string"
                }
              ],
              "description": "One option entry within the group.",
              "element": "option",
              "repeatable": true
            }
          ],
          "description": "Groups options under a label.",
          "element": "optgroup",
          "repeatable": true
        },
        {
          "attributes": [
            {
              "description": "Value carried by this option in the parsed data.",
              "name": "value",
              "required": false,
              "type": "string"
            },
            {
              "description": "Makes the option non-selectable.",
              "name": "disabled",
              "required": false,
              "type": "boolean"
            },
            {
              "description": "Marks the option as initially selected.",
              "name": "selected",
              "required": false,
              "type": "boolean"
            },
            {
              "description": "Extra search terms, comma-separated.",
              "name": "data-keywords",
              "required": false,
              "type": "comma-separated string"
            }
          ],
          "description": "One ungrouped option entry.",
          "element": "option",
          "repeatable": true
        }
      ],
      "description": "Hidden select parsed into grouped option data by the base class.",
      "element": "select",
      "id": "data-source",
      "required": false,
      "selector": "select[data-fn=\"data-source\"]"
    },
    {
      "attributes": [
        {
          "description": "Marks the template as an icon source (value: `icons`).",
          "name": "data-fn",
          "required": true,
          "values": [
            "icons"
          ]
        },
        {
          "description": "Re-parses the icons when the template mutates.",
          "name": "data-reactive",
          "required": false,
          "type": "boolean"
        }
      ],
      "children": [
        {
          "attributes": [
            {
              "description": "Icon key referenced by `$icons`.",
              "name": "data-key",
              "required": true,
              "type": "string"
            }
          ],
          "description": "One icon element.",
          "element": "*",
          "repeatable": true
        }
      ],
      "description": "Instance-level icon repository.",
      "element": "template",
      "id": "icons",
      "required": false,
      "selector": "template[data-fn=\"icons\"]"
    },
    {
      "attributes": [
        {
          "description": "Marks the template for deferred mounting (value: `template`).",
          "name": "data-fn",
          "required": true,
          "values": [
            "template"
          ]
        },
        {
          "description": "Re-parses the template when it mutates.",
          "name": "data-reactive",
          "required": false,
          "type": "boolean"
        }
      ],
      "description": "Deferred content template mounted by the base class.",
      "element": "template",
      "id": "template",
      "required": false,
      "selector": "template[data-fn=\"template\"]"
    }
  ],
  "cssClasses": [
    {
      "appliesTo": "z-input-pin",
      "class": ".z-input-pin",
      "description": "Root class of the fields wrapper.",
      "role": "root"
    },
    {
      "appliesTo": ".z-input-pin",
      "class": ".z-input-pin-separated",
      "description": "Separated presentation: individual boxed fields with a gap.",
      "role": "modifier"
    }
  ],
  "cssVars": [
    {
      "affects": [
        "outline-color"
      ],
      "default": "var(--z-focus)",
      "description": "Focus ring base color, mixed with transparency using `--z-input-pin-focus-ring-color-o`.",
      "file": "src/css/kit-components/input-pin.css",
      "kind": "base",
      "name": "--z-input-pin-focus-ring-color",
      "scope": ".z-input-pin",
      "syntax": "<color>"
    },
    {
      "affects": [
        "outline-color"
      ],
      "default": "100%",
      "description": "Focus ring opacity percentage used in the mix.",
      "file": "src/css/kit-components/input-pin.css",
      "kind": "base",
      "name": "--z-input-pin-focus-ring-color-o",
      "scope": ".z-input-pin",
      "syntax": "<percentage>"
    },
    {
      "affects": [
        "border-color"
      ],
      "default": "var(--z-input)",
      "description": "Field border base color, mixed with transparency using `--z-input-pin-input-border-color-o`.",
      "file": "src/css/kit-components/input-pin.css",
      "kind": "base",
      "name": "--z-input-pin-input-border-color",
      "scope": ".z-input-pin input",
      "syntax": "<color>"
    },
    {
      "affects": [
        "border-color"
      ],
      "default": "var(--z-input-o)",
      "description": "Field border opacity percentage used in the mix.",
      "file": "src/css/kit-components/input-pin.css",
      "kind": "base",
      "name": "--z-input-pin-input-border-color-o",
      "scope": ".z-input-pin input",
      "syntax": "<percentage>"
    },
    {
      "affects": [
        "border-end-end-radius",
        "border-end-start-radius",
        "border-radius",
        "border-start-end-radius",
        "border-start-start-radius"
      ],
      "default": "var(--z-form-input-radius)",
      "description": "Corner radius of the fields.",
      "file": "src/css/kit-components/input-pin.css",
      "kind": "base",
      "name": "--z-input-pin-radius",
      "scope": ".z-input-pin",
      "syntax": "<length>"
    },
    {
      "affects": [
        "gap"
      ],
      "default": "0.5rem",
      "description": "Gap between separated fields.",
      "file": "src/css/kit-components/input-pin.css",
      "kind": "base",
      "name": "--z-input-pin-separated-gap",
      "scope": ".z-input-pin.z-input-pin-separated",
      "syntax": "<length>"
    },
    {
      "affects": [
        "box-shadow"
      ],
      "default": "var(--z-form-input-shadow)",
      "description": "Box shadow of each separated field.",
      "file": "src/css/kit-components/input-pin.css",
      "kind": "base",
      "name": "--z-input-pin-separated-input-shadow",
      "scope": ".z-input-pin.z-input-pin-separated",
      "syntax": ""
    },
    {
      "affects": [
        "box-shadow"
      ],
      "default": "var(--z-form-input-shadow)",
      "description": "Box shadow of the joined field.",
      "file": "src/css/kit-components/input-pin.css",
      "kind": "base",
      "name": "--z-input-pin-shadow",
      "scope": ".z-input-pin",
      "syntax": ""
    }
  ],
  "dataHooks": [
    {
      "appliesTo": "descendant",
      "attribute": "data-host-inner",
      "description": "Marks the rendered inner wrapper so `force-prevent-rerender` can adopt server-rendered DOM without re-rendering.",
      "from": "Hwc",
      "role": "config",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-pin-input",
      "description": "Marks each single-character field.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-reactive",
      "description": "Opts the marked child (config script, data source, icons, or template) into live re-parsing when its DOM mutates.",
      "from": "Hwc",
      "role": "config",
      "values": []
    }
  ],
  "events": [
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires when the committed code changes; `detail.value` carries the joined code.",
      "detail": {
        "fields": [
          {
            "name": "value",
            "type": "string | string[]"
          }
        ],
        "type": "{ value: string | string[] }"
      },
      "from": "InputMixin",
      "name": "z-input-pin:change"
    },
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires when every field is filled; `detail.value` carries the joined code.",
      "detail": {
        "fields": [
          {
            "name": "value",
            "type": "string"
          }
        ],
        "type": "{ value: string }"
      },
      "name": "z-input-pin:complete"
    }
  ],
  "i18n": [
    {
      "default": "PIN entry complete",
      "description": "Announcement when all fields are filled.",
      "key": "complete",
      "placeholders": [],
      "usedIn": []
    },
    {
      "default": "Enter {length}-digit code",
      "description": "Group description template with `{length}`.",
      "key": "description",
      "placeholders": [
        "length"
      ],
      "usedIn": []
    },
    {
      "default": "Field {n} filled",
      "description": "Announcement template when a field is filled, with `{n}`.",
      "key": "field-filled",
      "placeholders": [
        "n"
      ],
      "usedIn": []
    },
    {
      "default": "Digit {n} of {total}",
      "description": "Per-field label template with `{n}` and `{total}`.",
      "key": "field-label",
      "placeholders": [
        "n",
        "total"
      ],
      "usedIn": []
    },
    {
      "default": "PIN Code",
      "description": "Accessible group label.",
      "key": "label",
      "placeholders": [],
      "usedIn": []
    },
    {
      "default": "PIN input ready",
      "description": "Announcement when the input is ready.",
      "key": "loaded",
      "placeholders": [],
      "usedIn": []
    }
  ],
  "icons": [],
  "id": "input-pin",
  "inherits": [
    "InputMixin",
    "Hwc",
    "Base"
  ],
  "keyboard": [
    {
      "action": "Move between fields.",
      "keys": [
        "ArrowLeft",
        "ArrowRight"
      ]
    },
    {
      "action": "Clears the current field and steps back.",
      "keys": [
        "Backspace"
      ]
    }
  ],
  "kind": "hwc",
  "methods": [],
  "notes": [
    "Typing auto-advances to the next field; the joined value submits through the hidden form input and fires `change` plus `complete`.",
    "Add `.z-input-pin-separated` for boxed, spaced fields."
  ],
  "parts": {
    "defaultClsTarget": "wrapper",
    "defaultStlTarget": "wrapper",
    "items": [
      {
        "defaultCls": "sr-only",
        "description": "Group description (default `sr-only`).",
        "foundIn": [
          "$cls",
          "render"
        ],
        "key": "description",
        "supportsCls": true,
        "supportsStl": true
      },
      {
        "defaultCls": "",
        "description": "Rendered root wrapper.",
        "foundIn": [
          "render"
        ],
        "key": "host-inner",
        "supportsCls": true,
        "supportsStl": true
      },
      {
        "defaultCls": "",
        "description": "One single-character field.",
        "foundIn": [
          "render"
        ],
        "key": "input",
        "supportsCls": true,
        "supportsStl": true
      },
      {
        "defaultCls": "sr-only",
        "description": "Group label (default `sr-only`).",
        "foundIn": [
          "$cls",
          "render"
        ],
        "key": "label",
        "supportsCls": true,
        "supportsStl": true
      },
      {
        "defaultCls": "z-input-pin",
        "description": "The fields wrapper (default `z-input-pin`); the default `cls`/`stl` target.",
        "foundIn": [
          "$cls",
          "render"
        ],
        "key": "wrapper",
        "supportsCls": true,
        "supportsStl": true
      }
    ]
  },
  "recipes": [],
  "related": [
    "input-tag",
    "input-time"
  ],
  "schemaVersion": 1,
  "sources": {
    "css": [
      "src/css/kit-components/input-pin.css"
    ],
    "cssSelectors": [
      ".z-input-pin",
      ".z-input-pin-*"
    ],
    "ts": "src/js/hwc/components/input-pin.ts"
  },
  "summary": "Segmented one-character fields for verification codes, with auto-advance, paste distribution, and completion events.",
  "tag": "z-input-pin",
  "title": "PIN Input"
}
