{
  "$schema": "https://design.senvenli.com/schema/component.full.json",
  "kind": "component",
  "family": "color",
  "status": "alpha",
  "import": "@senvenli/react/color",
  "name": "color-picker",
  "title": "Color picker",
  "exports": [
    "ColorPicker"
  ],
  "description": "A saturation-brightness area, hue (and alpha) sliders, a hex field and a two-theme preview of the primary button with its contrast.",
  "keywords": [
    "color",
    "brand",
    "theme",
    "contrast",
    "picker"
  ],
  "usage": {
    "when": [
      "Choosing a brand or theme color, where contrast in both themes matters."
    ],
    "instead": [
      {
        "use": "color-swatch-picker",
        "when": "Presets cover the choice."
      },
      {
        "use": "color-field",
        "when": "Space is tight and people know the hex."
      }
    ]
  },
  "a11y": {
    "keyboard": [
      {
        "keys": "Arrow keys",
        "does": "Move the area thumb or a slider by one step."
      },
      {
        "keys": "Page up / down",
        "does": "Move by a larger step."
      }
    ],
    "builtIn": [
      "The label names the area, each slider and the hex field.",
      "The preview announces the contrast ratio and what the theme uses when a tone fails."
    ],
    "youProvide": [
      "A label."
    ]
  },
  "related": [
    "color-field",
    "color-swatch-picker"
  ],
  "genui": {
    "expose": false
  },
  "source": [
    "src/color/color.tsx"
  ],
  "props": {
    "ColorPicker": [
      {
        "name": "label",
        "type": "React.ReactNode",
        "required": true,
        "origin": "own",
        "description": "\"Brand color\"; names the area, the sliders and the hex field for screen readers."
      },
      {
        "name": "value",
        "type": "string",
        "required": false,
        "origin": "own",
        "description": "The hex (\"#1E63D0\"); \"#1E63D0CC\" with an alpha channel.",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "defaultValue",
        "type": "string",
        "required": false,
        "origin": "own",
        "default": "DEFAULT_PRIMARY",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "onChange",
        "type": "(value: string) => void",
        "required": false,
        "origin": "own",
        "description": "While dragging and typing: the preview and its contrast check follow every move."
      },
      {
        "name": "onChangeEnd",
        "type": "(value: string) => void",
        "required": false,
        "origin": "own",
        "description": "On release (and when the hex field commits): save here, not on every move."
      },
      {
        "name": "channels",
        "type": "readonly (\"hue\" | \"alpha\")[]",
        "required": false,
        "origin": "own",
        "default": "[\"hue\"]",
        "description": "The sliders under the area: hue always, alpha when the color may be translucent.",
        "schema": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "hue",
              "alpha"
            ]
          }
        }
      }
    ]
  },
  "tokens": [
    "ds-background-neutral-pressed",
    "ds-border",
    "ds-border-focused",
    "ds-radius-full",
    "ds-radius-large",
    "ds-radius-medium",
    "ds-radius-small",
    "ds-shadow-raised",
    "ds-space-050",
    "ds-space-100",
    "ds-space-150",
    "ds-space-200",
    "ds-space-400",
    "ds-surface-raised",
    "font-ds-mono"
  ],
  "strings": [
    "customColor",
    "hexExpected",
    "nameSelected",
    "optional",
    "required"
  ],
  "quality": {
    "tests": true,
    "a11y": false,
    "docs": false,
    "visual": false,
    "dark": false,
    "rtl": false,
    "mcp": true,
    "generic": true
  }
}
