{
  "$schema": "https://design.senvenli.com/schema/component.full.json",
  "kind": "component",
  "family": "selection",
  "status": "alpha",
  "import": "@senvenli/react/selection",
  "name": "list-box",
  "title": "List box",
  "exports": [
    "ListBox"
  ],
  "description": "A list of options shown in place, not in a dropdown: pick one or several.",
  "keywords": [
    "listbox",
    "options",
    "choice list",
    "picker",
    "selectable list"
  ],
  "usage": {
    "when": [
      "A short set of options that should stay visible: a settings choice, a filter list."
    ],
    "instead": [
      {
        "use": "select",
        "when": "The choice can live in a dropdown."
      },
      {
        "use": "grid-list",
        "when": "Rows of content with their own actions."
      },
      {
        "use": "radio",
        "when": "Two to five options with a line of detail."
      }
    ]
  },
  "guidance": [
    {
      "rule": "Label it; keep options short."
    }
  ],
  "a11y": {
    "builtIn": [
      "Arrows move, typing jumps to an option, Space selects; selected options are marked and say so."
    ],
    "youProvide": [
      "A label (or aria-label)."
    ]
  },
  "related": [
    "select",
    "grid-list",
    "radio"
  ],
  "genui": {
    "expose": false
  },
  "source": [
    "src/selection/list-box.tsx"
  ],
  "props": {
    "ListBox": [
      {
        "name": "label",
        "type": "React.ReactNode",
        "required": false,
        "origin": "own",
        "description": "The visible name of the list. Leave it out only with an `aria-label`."
      },
      {
        "name": "aria-label",
        "type": "string",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "items",
        "type": "readonly ListBoxOption[]",
        "required": true,
        "origin": "own",
        "schema": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "icon": {
                "type": "string",
                "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
              },
              "isDisabled": {
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "label"
            ]
          }
        }
      },
      {
        "name": "selectionMode",
        "type": "\"none\" | \"single\" | \"multiple\"",
        "required": false,
        "origin": "own",
        "default": "\"single\"",
        "description": "`single` (default), `multiple` or `none` (a list of actions with `onAction`).",
        "schema": {
          "type": "string",
          "enum": [
            "none",
            "single",
            "multiple"
          ]
        }
      },
      {
        "name": "selectedKeys",
        "type": "Iterable<Key>",
        "required": false,
        "origin": "own"
      },
      {
        "name": "defaultSelectedKeys",
        "type": "Iterable<Key>",
        "required": false,
        "origin": "own"
      },
      {
        "name": "onSelectionChange",
        "type": "(keys: Selection) => void",
        "required": false,
        "origin": "own"
      },
      {
        "name": "onAction",
        "type": "(key: Key) => void",
        "required": false,
        "origin": "own",
        "description": "With `selectionMode=\"none\"`: what pressing an option does."
      },
      {
        "name": "emptyState",
        "type": "React.ReactNode",
        "required": false,
        "origin": "own",
        "description": "Shown inside the list when it has no options: a sentence or an `EmptyState`."
      }
    ]
  },
  "tokens": [
    "ds-background-brand-bold",
    "ds-background-disabled",
    "ds-background-input",
    "ds-background-neutral-pressed",
    "ds-background-neutral-subtle-hovered",
    "ds-background-selected",
    "ds-background-selected-hovered",
    "ds-border",
    "ds-border-bold",
    "ds-border-danger",
    "ds-border-focused",
    "ds-border-selected",
    "ds-easing-standard",
    "ds-radius-full",
    "ds-radius-large",
    "ds-radius-small",
    "ds-radius-xsmall",
    "ds-shadow-overlay",
    "ds-shadow-raised",
    "ds-space-025",
    "ds-space-050",
    "ds-space-075",
    "ds-space-100",
    "ds-space-150",
    "ds-space-200",
    "ds-surface-overlay",
    "ds-surface-raised",
    "ds-text",
    "ds-text-disabled",
    "ds-text-on-brand",
    "ds-text-subtle",
    "ds-text-subtlest"
  ],
  "strings": [
    "optional"
  ],
  "quality": {
    "tests": true,
    "a11y": false,
    "docs": false,
    "visual": false,
    "dark": false,
    "rtl": false,
    "mcp": true,
    "generic": true
  }
}
