{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "option_picker",
  "description": "Seçenek seçici (beden, renk, ek hizmet). `kind:\"swatches\"` renk örneği; `swatch` ÜRÜN VERİSİ (kumaş/ürün rengi), tema rengi DEĞİL — tek sanctioned istisna.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "type",
    "version",
    "groups"
  ],
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "option_picker"
      ]
    },
    "version": {
      "type": "integer",
      "enum": [
        1
      ]
    },
    "tone": {
      "type": "string",
      "enum": [
        "neutral",
        "success",
        "warning",
        "danger",
        "brand"
      ]
    },
    "brand_color": {
      "type": "string",
      "enum": [
        "mavi",
        "turuncu",
        "mor",
        "pembe",
        "altin",
        "yesil",
        "turkuaz"
      ]
    },
    "title": {
      "type": "string",
      "maxLength": 80
    },
    "groups": {
      "type": "array",
      "minItems": 1,
      "maxItems": 6,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,31}$",
            "description": "form alanı/grup kimliği; `values` anahtarı"
          },
          "label": {
            "type": "string",
            "maxLength": 60,
            "minLength": 1
          },
          "kind": {
            "type": "string",
            "enum": [
              "chips",
              "swatches",
              "checklist"
            ]
          },
          "multiple": {
            "type": "boolean"
          },
          "options": {
            "type": "array",
            "minItems": 1,
            "maxItems": 30,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "value": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
                  "description": "seçenek/öğe değeri; istemci bunu `inki_component_action.values` içinde geri gönderir"
                },
                "label": {
                  "type": "string",
                  "maxLength": 40,
                  "minLength": 1
                },
                "swatch": {
                  "type": "string",
                  "pattern": "^#[0-9A-Fa-f]{6}$",
                  "description": "ürün rengi (#RRGGBB)"
                },
                "detail": {
                  "type": "string",
                  "maxLength": 60,
                  "description": "ör. +₺150"
                },
                "unavailable": {
                  "type": "boolean"
                }
              },
              "required": [
                "value",
                "label"
              ]
            }
          },
          "selected": {
            "type": "array",
            "minItems": 0,
            "maxItems": 30,
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:-]{1,64}$",
              "description": "seçenek/öğe değeri; istemci bunu `inki_component_action.values` içinde geri gönderir"
            }
          }
        },
        "required": [
          "id",
          "label",
          "options"
        ]
      }
    },
    "actions": {
      "type": "array",
      "minItems": 1,
      "maxItems": 3,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "action_id": {
            "type": "string",
            "pattern": "^[a-z0-9_-]{1,64}$",
            "description": "düğme eylem kimliği; `values.action_id` olarak geri gelir"
          },
          "label": {
            "type": "string",
            "maxLength": 40,
            "minLength": 1
          },
          "style": {
            "type": "string",
            "enum": [
              "primary",
              "secondary",
              "danger"
            ]
          },
          "disabled": {
            "type": "boolean"
          }
        },
        "required": [
          "action_id",
          "label"
        ],
        "description": "basılınca `inki_component_action{action:\"submit\", values:{action_id}}`"
      }
    }
  },
  "x-inki-eylem": [
    {
      "action": "change",
      "values": {
        "groups[].id": "seçili değer (multiple:true ise değer dizisi)"
      }
    },
    {
      "action": "submit",
      "values": {
        "action_id": "actions[].action_id"
      }
    }
  ]
}
