{
  "$schema": "https://design.senvenli.com/schema/component.full.json",
  "kind": "component",
  "family": "selection",
  "status": "alpha",
  "import": "@senvenli/react/selection",
  "name": "select",
  "title": "Select",
  "exports": [
    "Select"
  ],
  "description": "Pick one option from a short list in a dropdown, with groups, descriptions and icons.",
  "keywords": [
    "select",
    "dropdown",
    "picker",
    "options",
    "choose",
    "multiselect",
    "tags",
    "multiple",
    "filter"
  ],
  "usage": {
    "when": [
      "One choice from about 5 to 15 options.",
      "Several choices from a medium list."
    ],
    "instead": [
      {
        "use": "radio",
        "when": "Fewer than 5 options should all stay visible."
      },
      {
        "use": "combobox",
        "when": "The list is long and people type to find."
      },
      {
        "use": "checkbox",
        "when": "A few options should all stay visible."
      },
      {
        "use": "list-box",
        "when": "The options should stay visible on the page, not in a dropdown."
      }
    ]
  },
  "a11y": {
    "keyboard": [
      {
        "keys": "Space, Enter, Arrow down",
        "does": "Opens the list."
      },
      {
        "keys": "Arrow keys, typing",
        "does": "Moves to an option."
      }
    ],
    "builtIn": [
      "Announced as a button that opens a listbox.",
      "Required fields show \"Fill in this field.\" after a blur or a submit; your own `errorMessage` replaces it.",
      "Each tag has a remove button named after its option."
    ],
    "youProvide": [
      "A visible label."
    ]
  },
  "related": [
    "combobox",
    "radio",
    "tag-group"
  ],
  "genui": {
    "expose": true,
    "description": "A dropdown for one choice. items are {id, label} options; use radio when there are fewer than 5. Emits change.",
    "props": [
      "label",
      "items",
      "placeholder",
      "description",
      "isRequired"
    ],
    "children": "none",
    "events": [
      "change"
    ],
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "label": {
          "type": "string",
          "description": "The label sits above the field."
        },
        "items": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "meta": {
                "type": "string"
              },
              "group": {
                "type": "string"
              },
              "isDisabled": {
                "type": "boolean"
              },
              "icon": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "label"
            ]
          },
          "description": "Up to ~15 options; more, or options people know by name → ComboBox."
        },
        "placeholder": {
          "type": "string",
          "description": "Defaults to \"Select\" in the provider locale."
        },
        "description": {
          "type": "string"
        },
        "isRequired": {
          "type": "boolean"
        }
      },
      "required": [
        "items"
      ]
    }
  },
  "source": [
    "src/selection/select-public.tsx"
  ],
  "props": {
    "Select": [
      {
        "name": "label",
        "type": "React.ReactNode",
        "required": false,
        "origin": "own",
        "description": "The label sits above the field."
      },
      {
        "name": "items",
        "type": "readonly SelectItem[]",
        "required": true,
        "origin": "own",
        "description": "Up to ~15 options; more, or options people know by name → ComboBox.",
        "schema": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "description": {
                "type": "string"
              },
              "meta": {
                "type": "string"
              },
              "group": {
                "type": "string"
              },
              "isDisabled": {
                "type": "boolean"
              },
              "icon": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "label"
            ]
          }
        }
      },
      {
        "name": "selectedKey",
        "type": "Key",
        "required": false,
        "origin": "own",
        "description": "Controlled value; `null` is \"nothing chosen\". It may start undefined and become set later.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "defaultSelectedKey",
        "type": "Key",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "onSelectionChange",
        "type": "(key: Key | null) => void | (keys: Key[]) => void",
        "required": false,
        "origin": "own"
      },
      {
        "name": "placeholder",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "Defaults to \"Select\" in the provider locale.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "description",
        "type": "React.ReactNode",
        "required": false,
        "origin": "own"
      },
      {
        "name": "errorMessage",
        "type": "React.ReactNode",
        "required": false,
        "origin": "own"
      },
      {
        "name": "isInvalid",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "aria-invalid",
        "type": "boolean | \"true\" | \"false\"",
        "required": false,
        "origin": "own",
        "description": "Set by a form row that owns the error text (the shared `Field` hands its control `aria-invalid`): the field\nshows its invalid state as with `isInvalid`, and without an `errorMessage` of its own draws no error row,\nso the row's message is the only one. The trigger is a button, on which React Aria sets no\n`aria-invalid`: the forwarded invalid state shows as `data-invalid` on the field (its danger border) and\nthrough the row's own error text, not as `aria-invalid` on the trigger. It marks the field invalid for styling and\nassistive tech only: unlike `isInvalid` it never becomes the field's native validity (React Aria's default\noutside a DS Form), so it never blocks a form's submit.",
        "schema": {
          "enum": [
            false,
            true,
            "true",
            "false"
          ]
        }
      },
      {
        "name": "isRequired",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "requiredValidation",
        "type": "RequiredValidation",
        "required": false,
        "origin": "own",
        "description": "Who says an empty required Select is missing: `field` (default)\nshows \"Fill in this field.\" on blur and on a DS Form submit, which it then blocks; `app` only marks the field\n(`*`, `aria-required`) and the app shows its own error. See {@link RequiredValidation}.\nThe app's `isInvalid` (`true` with its `errorMessage`, or `false`) overrides the check, as on TextField. Disabled,\nempty and required, it still blocks a DS Form's submit and cannot take focus (as TextField).",
        "schema": {
          "type": "string",
          "enum": [
            "field",
            "app"
          ]
        }
      },
      {
        "name": "isDisabled",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "boolean"
        }
      },
      {
        "name": "size",
        "type": "FieldSize",
        "required": false,
        "origin": "own",
        "description": "`compact` (32px) for table filters and toolbars.",
        "schema": {
          "type": "string",
          "enum": [
            "small",
            "medium",
            "large"
          ]
        }
      },
      {
        "name": "name",
        "type": "string",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "selectionMode",
        "type": "\"single\" | \"multiple\"",
        "required": false,
        "origin": "own",
        "description": "`single` (default): one choice from a known list.",
        "schema": {
          "type": "string",
          "enum": [
            "single",
            "multiple"
          ]
        }
      },
      {
        "name": "radius",
        "type": "ComponentRadius",
        "required": false,
        "origin": "own",
        "description": "Corner radius: `none`, `small`, `medium` (the design), `large` or `full`. The provider's default otherwise.",
        "schema": {
          "type": "string",
          "enum": [
            "none",
            "small",
            "medium",
            "large",
            "full"
          ]
        }
      },
      {
        "name": "aria-label",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "Names the field for assistive technology when no visible label is shown.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "selectedKeys",
        "type": "readonly Key[]",
        "required": false,
        "origin": "own",
        "description": "Controlled; may start undefined and become set later (never flips control).",
        "schema": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      {
        "name": "defaultSelectedKeys",
        "type": "readonly Key[]",
        "required": false,
        "origin": "own",
        "schema": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      {
        "name": "maxVisibleTags",
        "type": "number",
        "required": false,
        "origin": "own",
        "description": "Tags shown before the rest collapse into \"+3\".",
        "schema": {
          "type": "number"
        }
      },
      {
        "name": "allowsSelectAll",
        "type": "boolean",
        "required": false,
        "origin": "own",
        "description": "Adds the \"Select all\" footer with the selected count.",
        "schema": {
          "type": "boolean"
        }
      }
    ]
  },
  "tokens": [
    "ds-background-brand-bold",
    "ds-background-disabled",
    "ds-background-input",
    "ds-background-input-hovered",
    "ds-background-neutral",
    "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-icon-subtle",
    "ds-link",
    "ds-radius-control-medium",
    "ds-radius-control-small",
    "ds-radius-full",
    "ds-radius-large",
    "ds-radius-medium",
    "ds-radius-small",
    "ds-radius-xsmall",
    "ds-shadow-overlay",
    "ds-shadow-raised",
    "ds-size-control",
    "ds-size-control-compact",
    "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": [
    "moreCount",
    "optional",
    "removeItem",
    "required",
    "selectAll",
    "selectedCount"
  ],
  "quality": {
    "tests": true,
    "a11y": false,
    "docs": false,
    "visual": false,
    "dark": false,
    "rtl": false,
    "mcp": true,
    "generic": true
  }
}
