{
  "$schema": "https://next.0build.dev/schema/component.v1.json",
  "accessibility": {
    "aria": [
      {
        "attributes": [
          {
            "name": "aria-live",
            "value": "polite"
          },
          {
            "name": "role",
            "value": "alert"
          }
        ],
        "description": "Validation message: `role=\"alert\"` with `aria-live=\"polite\"`.",
        "part": "error"
      },
      {
        "attributes": [],
        "description": "Root wrapper; no ARIA attributes.",
        "part": "host-inner"
      },
      {
        "attributes": [
          {
            "name": "aria-describedby",
            "value": "${this.$error ? 'tag-error' : ''}"
          },
          {
            "name": "aria-invalid",
            "value": "${!!this.$error}"
          },
          {
            "name": "aria-label",
            "value": "${inputLabel}"
          },
          {
            "name": "role",
            "value": "textbox"
          }
        ],
        "description": "Text input: `role=\"textbox\"` labeled by `input-label`, `aria-invalid` and `aria-describedby` point at the error while invalid.",
        "part": "input"
      },
      {
        "attributes": [
          {
            "name": "role",
            "value": "listitem"
          }
        ],
        "description": "Tag chip: `role=\"listitem\"`.",
        "part": "tag"
      },
      {
        "attributes": [
          {
            "name": "aria-label",
            "value": "${tagListLabel}"
          },
          {
            "name": "role",
            "value": "list"
          }
        ],
        "description": "Tag list: `role=\"list\"` labeled by `tag-list-label`.",
        "part": "tag-list"
      },
      {
        "attributes": [
          {
            "name": "aria-label",
            "value": "${removeLabel}: ${tag}"
          }
        ],
        "description": "Remove button labeled `remove-label: <tag>`.",
        "part": "tag-remove"
      },
      {
        "attributes": [
          {
            "name": "aria-label",
            "value": "${editLabel}: ${tag}"
          },
          {
            "name": "role",
            "value": "button"
          }
        ],
        "description": "Tag label: `role=\"button\"` labeled `edit-label: <tag>`.",
        "part": "tag-text"
      },
      {
        "attributes": [],
        "description": "Tag field wrapper; no ARIA attributes.",
        "part": "wrapper"
      }
    ],
    "notes": [
      "Validation errors are announced through the alert region and linked to the input with `aria-describedby`.",
      "The value submits through hidden inputs named `name[]`."
    ]
  },
  "attributes": [
    {
      "default": "20",
      "description": "Maximum characters per tag (default 20).",
      "from": null,
      "name": "maxlength",
      "property": "maxlength",
      "reflect": false,
      "tokens": null,
      "type": "number",
      "values": null
    },
    {
      "default": "1",
      "description": "Minimum characters per tag (default 1).",
      "from": null,
      "name": "minlength",
      "property": "minlength",
      "reflect": false,
      "tokens": null,
      "type": "number",
      "values": null
    },
    {
      "default": "false",
      "description": "Slugifies tag values (lowercase, hyphenated) before committing.",
      "from": null,
      "name": "slugify",
      "property": "slugify",
      "reflect": false,
      "tokens": null,
      "type": "boolean",
      "values": null
    },
    {
      "default": "''",
      "description": "JSON options passed to the slugify helper (e.g. replacement characters).",
      "from": null,
      "name": "slugify-options",
      "property": "slugify-options",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "','",
      "description": "Characters that commit the current text as a tag (default `,`).",
      "from": null,
      "name": "delimiters",
      "property": "delimiters",
      "reflect": false,
      "tokens": null,
      "type": "string",
      "values": null
    },
    {
      "default": "false",
      "description": "Allows the same tag more than once.",
      "from": null,
      "name": "allow-duplicates",
      "property": "allow-duplicates",
      "reflect": false,
      "tokens": null,
      "type": "boolean",
      "values": null
    },
    {
      "default": "0",
      "description": "Maximum number of tags (0 = unlimited).",
      "from": null,
      "name": "max-tags",
      "property": "max-tags",
      "reflect": false,
      "tokens": null,
      "type": "number",
      "values": null
    },
    {
      "default": "true",
      "description": "Commits the pending text as a tag when the input loses focus (default true).",
      "from": null,
      "name": "add-on-blur",
      "property": "add-on-blur",
      "reflect": false,
      "tokens": null,
      "type": "boolean",
      "values": null
    },
    {
      "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-tag",
      "class": ".z-input-tag",
      "description": "Root class of the tag field.",
      "role": "root"
    },
    {
      "appliesTo": ".z-input-tag",
      "class": ".z-input-tag-list",
      "description": "The flex list of tag chips.",
      "role": "state"
    }
  ],
  "cssVars": [
    {
      "affects": [
        "border-color"
      ],
      "default": "var(--z-input)",
      "description": "Border base color, mixed with transparency using `--z-input-tag-border-color-o`.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-border-color",
      "scope": ".z-input-tag",
      "syntax": "<color>"
    },
    {
      "affects": [
        "border-color"
      ],
      "default": "var(--z-input-o)",
      "description": "Border opacity percentage used in the border color mix.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-border-color-o",
      "scope": ".z-input-tag",
      "syntax": "<percentage>"
    },
    {
      "affects": [
        "border-width"
      ],
      "default": "1px",
      "description": "Border width of the tag field.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-border-width",
      "scope": ".z-input-tag",
      "syntax": "<length>"
    },
    {
      "affects": [
        "outline-color"
      ],
      "default": "var(--z-focus)",
      "description": "Focus ring base color, mixed with transparency using `--z-input-tag-focus-ring-color-o`.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-focus-ring-color",
      "scope": ".z-input-tag",
      "syntax": "<color>"
    },
    {
      "affects": [
        "outline-color"
      ],
      "default": "100%",
      "description": "Focus ring opacity percentage used in the mix.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-focus-ring-color-o",
      "scope": ".z-input-tag",
      "syntax": "<percentage>"
    },
    {
      "affects": [
        "gap"
      ],
      "default": "0.25rem",
      "description": "Gap between the tag list and the input.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-gap",
      "scope": ".z-input-tag",
      "syntax": "<length>"
    },
    {
      "affects": [
        "color"
      ],
      "default": "var(--z-bg-f)",
      "description": "Text base color of the inner input, mixed with transparency using `--z-input-tag-input-color-o`.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-input-color",
      "scope": ".z-input-tag input",
      "syntax": "<color>"
    },
    {
      "affects": [
        "color"
      ],
      "default": "100%",
      "description": "Text opacity percentage used in the input color mix.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-input-color-o",
      "scope": ".z-input-tag input",
      "syntax": "<percentage>"
    },
    {
      "affects": [
        "min-height"
      ],
      "default": "1.75rem",
      "description": "Minimum height of the inner text input.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-input-min-height",
      "scope": ".z-input-tag input",
      "syntax": "<length>"
    },
    {
      "affects": [
        "padding"
      ],
      "default": "0 0.25rem",
      "description": "Padding of the inner text input.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-input-padding",
      "scope": ".z-input-tag input",
      "syntax": "<length>"
    },
    {
      "affects": [
        "gap"
      ],
      "default": "0.25rem",
      "description": "Gap between tag chips.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "hook",
      "name": "--z-input-tag-list-gap",
      "scope": ".z-input-tag-list",
      "syntax": "<length>"
    },
    {
      "affects": [
        "min-height"
      ],
      "default": "2.5rem",
      "description": "Minimum height of the tag field.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-min-height",
      "scope": ".z-input-tag",
      "syntax": "<length>"
    },
    {
      "affects": [
        "padding"
      ],
      "default": "0.5rem",
      "description": "Inner padding of the tag field.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-padding",
      "scope": ".z-input-tag",
      "syntax": "<length>"
    },
    {
      "affects": [
        "border-radius"
      ],
      "default": "var(--z-form-input-radius)",
      "description": "Corner radius of the tag field.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-radius",
      "scope": ".z-input-tag",
      "syntax": "<length>"
    },
    {
      "affects": [
        "box-shadow"
      ],
      "default": "var(--z-form-input-shadow)",
      "description": "Box shadow of the tag field.",
      "file": "src/css/kit-components/input-tag.css",
      "kind": "base",
      "name": "--z-input-tag-shadow",
      "scope": ".z-input-tag",
      "syntax": ""
    }
  ],
  "dataHooks": [
    {
      "appliesTo": "descendant",
      "attribute": "data-disabled",
      "description": "Set on the wrapper while the control is disabled.",
      "role": "marker",
      "values": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-has-error",
      "description": "Set on the wrapper while a validation error is shown.",
      "role": "marker",
      "values": []
    },
    {
      "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-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": []
    },
    {
      "appliesTo": "descendant",
      "attribute": "data-tag-index",
      "description": "Set by the component on each tag to its index.",
      "role": "marker",
      "values": []
    }
  ],
  "events": [
    {
      "bubbles": true,
      "cancelable": false,
      "description": "Fires when the tag list changes; `detail.value` carries the tags as a string array.",
      "detail": {
        "fields": [
          {
            "name": "value",
            "type": "string | string[]"
          }
        ],
        "type": "{ value: string | string[] }"
      },
      "from": "InputMixin",
      "name": "z-input-tag:input"
    }
  ],
  "i18n": [
    {
      "default": "Tag already exists",
      "description": "Error shown for a duplicate tag.",
      "key": "duplicate-error",
      "placeholders": [],
      "usedIn": []
    },
    {
      "default": "Edit tag",
      "description": "Prefix of the edit-tag button label.",
      "key": "edit-label",
      "placeholders": [],
      "usedIn": [
        "tag-text"
      ]
    },
    {
      "default": "Tag input",
      "description": "Accessible label of the tag input.",
      "key": "input-label",
      "placeholders": [],
      "usedIn": [
        "input"
      ]
    },
    {
      "default": "Tag cannot exceed {max} characters",
      "description": "Error template with `{max}` for too-long tags.",
      "key": "max-length-error",
      "placeholders": [
        "max"
      ],
      "usedIn": []
    },
    {
      "default": "Maximum {max} tags allowed",
      "description": "Error template with `{max}` when the tag limit is reached.",
      "key": "max-tags-error",
      "placeholders": [
        "max"
      ],
      "usedIn": []
    },
    {
      "default": "Tag must be at least {min} characters",
      "description": "Error template with `{min}` for too-short tags.",
      "key": "min-length-error",
      "placeholders": [
        "min"
      ],
      "usedIn": []
    },
    {
      "default": "Add a tag...",
      "description": "Placeholder of the tag input.",
      "key": "placeholder",
      "placeholders": [],
      "usedIn": [
        "input"
      ]
    },
    {
      "default": "Remove tag",
      "description": "Prefix of the remove-tag button label.",
      "key": "remove-label",
      "placeholders": [],
      "usedIn": [
        "tag-remove"
      ]
    },
    {
      "default": "Tags",
      "description": "Accessible label of the tag list.",
      "key": "tag-list-label",
      "placeholders": [],
      "usedIn": [
        "tag-list"
      ]
    }
  ],
  "icons": [],
  "id": "input-tag",
  "inherits": [
    "InputMixin",
    "Hwc",
    "Base"
  ],
  "keyboard": [
    {
      "action": "Commits the pending text as a tag.",
      "keys": [
        "Enter"
      ]
    },
    {
      "action": "Removes the last tag when the input is empty.",
      "keys": [
        "Backspace"
      ],
      "when": "The input is empty."
    }
  ],
  "kind": "hwc",
  "methods": [],
  "notes": [
    "Tags are committed on delimiter characters, Enter, or blur (when `add-on-blur`); clicking a tag's text edits it in place.",
    "Length, duplicate, and count violations show the matching i18n error and block the commit."
  ],
  "parts": {
    "defaultClsTarget": "wrapper",
    "defaultStlTarget": "wrapper",
    "items": [
      {
        "defaultCls": "sr-only",
        "description": "Validation message region (default `sr-only`).",
        "foundIn": [
          "$cls",
          "render"
        ],
        "key": "error",
        "supportsCls": true,
        "supportsStl": true
      },
      {
        "defaultCls": "",
        "description": "Rendered root wrapper.",
        "foundIn": [
          "render"
        ],
        "key": "host-inner",
        "supportsCls": true,
        "supportsStl": true
      },
      {
        "defaultCls": "",
        "description": "The text input for new tags.",
        "foundIn": [
          "render"
        ],
        "key": "input",
        "supportsCls": true,
        "supportsStl": true
      },
      {
        "defaultCls": "z-tag z-tag-secondary",
        "description": "One tag chip (default `z-tag z-tag-secondary`).",
        "foundIn": [
          "$cls",
          "render"
        ],
        "key": "tag",
        "supportsCls": true,
        "supportsStl": false
      },
      {
        "defaultCls": "z-input-tag-list",
        "description": "List of committed tags (default `z-input-tag-list`).",
        "foundIn": [
          "$cls",
          "render"
        ],
        "key": "tag-list",
        "supportsCls": true,
        "supportsStl": true
      },
      {
        "defaultCls": "",
        "description": "Tag remove button.",
        "foundIn": [
          "render"
        ],
        "key": "tag-remove",
        "supportsCls": true,
        "supportsStl": false
      },
      {
        "defaultCls": "",
        "description": "Tag label, click to edit (button role).",
        "foundIn": [
          "render"
        ],
        "key": "tag-text",
        "supportsCls": true,
        "supportsStl": false
      },
      {
        "defaultCls": "z-input-tag",
        "description": "The tag field wrapper (default `z-input-tag`); the default `cls`/`stl` target.",
        "foundIn": [
          "$cls",
          "render"
        ],
        "key": "wrapper",
        "supportsCls": true,
        "supportsStl": true
      }
    ]
  },
  "recipes": [],
  "related": [
    "select",
    "input-pin"
  ],
  "schemaVersion": 1,
  "sources": {
    "css": [
      "src/css/kit-components/input-tag.css"
    ],
    "cssSelectors": [
      ".z-input-tag",
      ".z-input-tag-*"
    ],
    "ts": "src/js/hwc/components/input-tag.ts"
  },
  "summary": "Token input that turns typed text into removable, editable tags, with validation, slugify, and duplicate control.",
  "tag": "z-input-tag",
  "title": "Tag Input"
}
