{
  "version": 1,
  "group": "export",
  "description": "CSS, JSON, Hue Codex token-style, and SVG export contracts. Export fixtures assert parseability, displayed-value fidelity, deterministic role mapping, and safe SVG markup.",
  "seed": "#336699",
  "expectedRoleValues": {
    "primary": "#336699",
    "secondary": "#36317C",
    "accent": "#B6702B",
    "surface": "#F4F4F6",
    "text": "#242319",
    "border": "#C1C2CD",
    "success": "#3F8352",
    "warning": "#C1A97B",
    "danger": "#B9656F"
  },
  "cases": [
    {
      "id": "palette-css-is-valid-and-matches-role-values",
      "operation": "exportCssVariables",
      "mustParseAs": "css",
      "expectedSelector": ":root",
      "expectedDeclarations": {
        "--hc-color-primary": "#336699",
        "--hc-color-secondary": "#36317C",
        "--hc-color-accent": "#B6702B",
        "--hc-color-surface": "#F4F4F6",
        "--hc-color-text": "#242319",
        "--hc-color-border": "#C1C2CD",
        "--hc-color-success": "#3F8352",
        "--hc-color-warning": "#C1A97B",
        "--hc-color-danger": "#B9656F"
      },
      "valueContract": "Every exported custom-property value exactly equals the displayed role-card HEX value."
    },
    {
      "id": "palette-json-is-valid-and-matches-role-values",
      "operation": "exportPaletteJson",
      "mustParseAs": "json",
      "expected": {
        "name": "Seed #336699 color system",
        "slug": "336699-36317c-b6702b-f4f4f6-242319-c1c2cd-3f8352-c1a97b-b9656f",
        "source": "seed-color",
        "colorCount": 9
      },
      "valueContract": "Every parsed colors[].hex exactly equals the displayed HEX for the same role."
    },
    {
      "id": "token-style-json-is-valid-and-matches-role-values",
      "operation": "exportDesignTokens",
      "mustParseAs": "json",
      "expectedSchema": "https://huecodex.com/json/hue-codex-token-style.schema.json",
      "expectedTokenType": "color",
      "valueContract": "Every parsed color.<role>.$value exactly equals the displayed HEX for that role."
    },
    {
      "id": "palette-svg-has-bounded-expected-markup",
      "operation": "exportSvgStrip",
      "mustParseAs": "svg",
      "allowedElementNames": ["svg", "title", "desc", "metadata", "rect", "clipPath", "g", "text", "a"],
      "requiredElementNames": ["svg", "title", "desc", "rect", "clipPath", "g", "text"],
      "forbiddenElementNames": ["script", "foreignObject", "iframe", "object", "embed", "image", "use"],
      "forbiddenAttributePatterns": ["^on", "javascript:", "data:text/html"],
      "valueContract": "Each palette card contains its role name and exact displayed HEX as text, not color alone."
    },
    {
      "id": "unsafe-inline-logo-is-rejected-or-sanitized",
      "operation": "exportSvgStrip",
      "mustParseAs": "svg",
      "logoSvg": "<svg viewBox=\"0 0 100 20\"><script>alert(1)</script><foreignObject><iframe src=\"javascript:alert(2)\"></iframe></foreignObject><g onclick=\"alert(3)\"><rect width=\"100\" height=\"20\" fill=\"#336699\"/></g></svg>",
      "forbiddenElementNames": ["script", "foreignObject", "iframe", "object", "embed"],
      "forbiddenAttributePatterns": ["^on", "javascript:", "data:text/html"],
      "expectedSafeBehavior": "Reject the untrusted logo entirely or remove every forbidden element, event handler, and executable URL before embedding it."
    },
    {
      "id": "single-color-display-and-export-values-match",
      "operation": "displayExportEquality",
      "input": "#336699",
      "displayedValues": {
        "HEX": "#336699",
        "RGB": "rgb(51 102 153)",
        "HSL": "hsl(210 50% 40%)",
        "HWB": "hwb(210 20% 40%)",
        "LAB": "lab(41.5208% -4.5731 -33.4942)",
        "OKLCH": "oklch(49.9314% 0.098664 250.4331)"
      },
      "expectedExportedValues": {
        "HEX": "#336699",
        "RGB": "rgb(51 102 153)",
        "HSL": "hsl(210 50% 40%)",
        "HWB": "hwb(210 20% 40%)",
        "LAB": "lab(41.5208% -4.5731 -33.4942)",
        "OKLCH": "oklch(49.9314% 0.098664 250.4331)"
      }
    }
  ]
}
