{
  "version": "0.2.0-preview.1",
  "content_digest": "70ac710f4d22dce040e7ac593379ba8aca9dcb59a0b9c0f839819cae0e2bb721",
  "status": "preview",
  "authority": {
    "repository": "cloakedinc/design",
    "path": "packages/design-system",
    "catalog": "packages/design-system/catalog.json",
    "status": "preview"
  },
  "provenance": {
    "repo": "cloakedinc/automation",
    "commit": "f96f416e1c3bfbfaffcd155a88b87b18b8bb25f1",
    "path": "packages/design-system",
    "imported_spec_status": "approved"
  },
  "adaptations": [
    {
      "id": "button-content-gap",
      "status": "preview",
      "description": "Use the specification's 4px content gap instead of the inherited 8px implementation gap."
    },
    {
      "id": "keyboard-focus",
      "status": "preview",
      "description": "Add visible Button and Input keyboard focus and an overridable inset focus default for shared button resets, including FAQ cards and ListItem rows."
    },
    {
      "id": "supporting-text-contrast",
      "status": "preview",
      "description": "Map light secondary text to the existing grey-04-strong primitive for readable helper text on white and cream."
    },
    {
      "id": "danger-text-contrast",
      "status": "preview",
      "description": "Separate readable danger text/borders from destructive fills; preserve the primary danger-button fill and label pair."
    },
    {
      "id": "preview-status",
      "status": "preview",
      "description": "Local components, specs and token adaptations await human sign-off; upstream approved status is provenance only."
    },
    {
      "id": "motion-comparison-accessibility",
      "status": "preview",
      "description": "Preserve the original MotionShowcase comparisons while requiring explicit replay, responding to live reduced-motion changes, and keeping duration tracks usable on small screens."
    },
    {
      "id": "list-item-ownership",
      "status": "preview",
      "description": "List owns listitem wrappers for its content rows, while section labels stay outside the row count and standalone rows retain their existing semantics."
    },
    {
      "id": "card-delta-text-contrast",
      "status": "preview",
      "description": "Mix Card.Delta foregrounds from 60% existing tone solid and 40% primary text for readable contrast in both themes; preserve the four original tone fills."
    },
    {
      "id": "carousel-keyboard-access",
      "status": "preview",
      "description": "Keep all native-scrolling carousel slide controls exposed to assistive technology and keyboard navigation; pause autoplay while focus is inside the carousel."
    }
  ],
  "id": "metriclinechartcard",
  "name": "MetricLineChartCard",
  "category": "Visualizations",
  "summary": "A dashboard KPI tile that pairs a headline value and optional stat delta with an inline LineChart inside a Card, falling back to placeholder copy when no series can render.",
  "documentation": {
    "summary": "A dashboard KPI tile that pairs a headline value and optional stat delta with an inline LineChart inside a Card, falling back to placeholder copy when no series can render.",
    "guidance": [
      {
        "heading": "Overview",
        "body": "A dashboard KPI tile: a `LineChart` packaged in a Card with a headline value, an optional stat\ndelta, title, and description."
      },
      {
        "heading": "When to use",
        "body": "Use MetricLineChartCard as the standard metric card on a home or overview surface — it is the\npre-composed wrapper around `LineChart`, so drop to a bare `LineChart` when you only need the\nsparkline without the value chrome. `statTone` colors the delta green (`up`) or red (`down`).\n`series`, `ghostSeries`, tone, and smoothing behave exactly as in `LineChart`.\n\nWhen no `series` can render it shows `placeholder` copy instead of an empty chart, so always\nsupply one for the zero-data case.\n\nNot currently used in the app."
      },
      {
        "heading": "Empty state",
        "body": "With no series, `placeholder` copy replaces the chart entirely."
      }
    ],
    "usage": [],
    "examples": [],
    "source": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.mdx",
    "status": "local-preview",
    "note": "Guidance is read from local documentation, originally imported from the frozen source. Platform assertions in guidance are not parity verification."
  },
  "source": {
    "path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.tsx",
    "code": "import React from 'react';\nimport { Card } from '../../cards/Card/Card';\nimport { Text } from '../../primitives/Text/Text';\nimport { LineChart } from '../LineChart/LineChart';\nimport type { MetricLineChartCardProps } from '../types';\nimport styles from './MetricLineChartCard.module.scss';\n\n/**\n * The pre-composed metric tile: a `LineChart` inside a Card beneath a headline value and optional\n * delta. Drop to a bare `LineChart` when the sparkline is wanted without the value chrome.\n */\nexport function MetricLineChartCard({\n    title,\n    value,\n    statLabel,\n    statTone = 'up',\n    description,\n    placeholder,\n    series,\n    ghostSeries,\n    ariaLabel,\n    testId,\n}: MetricLineChartCardProps) {\n    // Mirrors buildLinePaths, which drops any series under two points: without the same threshold\n    // a one-point series would render an empty chart instead of the placeholder.\n    const hasSeries = series.some(item => item.values.length > 1);\n    const hasGhost = ghostSeries?.some(item => item.values.length > 1) ?? false;\n\n    return (\n        <Card testId={testId}>\n            <Card.Header>\n                <Card.Title>{title}</Card.Title>\n                <div className={styles.metricRow}>\n                    <Text variant='display-2' color='primary'>\n                        {value}\n                    </Text>\n                    {statLabel != null && <Card.Delta direction={statTone} value={statLabel} />}\n                </div>\n                {description && (\n                    <Text variant='body' color='secondary'>\n                        {description}\n                    </Text>\n                )}\n            </Card.Header>\n            {placeholder && !hasSeries && !hasGhost ? (\n                <Card.Body>\n                    <Text variant='body' color='secondary'>\n                        {placeholder}\n                    </Text>\n                </Card.Body>\n            ) : (\n                <Card.Body padding='none'>\n                    <LineChart series={series} ghostSeries={ghostSeries} ariaLabel={ariaLabel} />\n                </Card.Body>\n            )}\n        </Card>\n    );\n}\n"
  },
  "spec": {
    "$schema": "../../../specs/component-spec.schema.json",
    "identity": {
      "name": "MetricLineChartCard",
      "status": "preview",
      "version": "1.0.0",
      "summary": "A dashboard KPI tile that pairs a headline value and optional stat delta with an inline LineChart inside a Card, falling back to placeholder copy when no series can render."
    },
    "parts": [
      {
        "id": "card",
        "label": "Card",
        "description": "The surface shell that frames the metric and chart.",
        "required": true
      },
      {
        "id": "value",
        "label": "Value",
        "description": "The headline metric rendered in the display ramp."
      },
      {
        "id": "stat",
        "label": "Stat delta",
        "description": "The optional trend tag shown beside the value."
      },
      {
        "id": "chart",
        "label": "Chart",
        "description": "The inline LineChart, or placeholder copy when no series can render."
      }
    ],
    "allowedDesignChoices": {
      "variants": {
        "base": {
          "label": "Base",
          "description": "Content and the stat direction change the reading without changing the tile treatment."
        }
      },
      "sizes": {},
      "statTones": {
        "up": {
          "label": "Up",
          "description": "The delta reads as a positive movement (green)."
        },
        "down": {
          "label": "Down",
          "description": "The delta reads as a negative movement (red)."
        }
      }
    },
    "variants": [
      {
        "id": "base",
        "label": "Base",
        "description": "A Card with a headline value, optional delta, and an inline chart.",
        "platforms": [
          "ios",
          "android",
          "web"
        ]
      }
    ],
    "sizes": [],
    "measurements": [
      {
        "id": "metric-row-gap",
        "label": "Value-to-stat gap",
        "kind": "exact",
        "token": "--cds-space-12",
        "value": 12,
        "unit": "px",
        "appliesTo": [
          "value",
          "stat"
        ]
      },
      {
        "id": "card-radius",
        "label": "Card corner radius",
        "kind": "exact",
        "token": "--cds-radius-lg",
        "value": 20,
        "unit": "px",
        "appliesTo": [
          "card"
        ],
        "notes": "Inherited from the default Card radius; MetricLineChartCard does not override it."
      },
      {
        "id": "card-padding",
        "label": "Card slot padding",
        "kind": "example-only",
        "token": "--cds-space-16",
        "value": 16,
        "unit": "px",
        "appliesTo": [
          "card",
          "chart"
        ],
        "notes": "The header and text slots carry the default Card padding; the chart body uses padding none so the LineChart spans edge to edge."
      }
    ],
    "layout": {
      "alignment": "Header content is left-aligned in a column; the value and delta share a centered row.",
      "flow": "Header (title, value row, description) stacks above the chart body.",
      "notes": [
        "The chart body drops its padding so the LineChart reaches the card edges."
      ]
    },
    "typographyAndColor": {
      "typography": [
        {
          "label": "Headline value",
          "description": "The metric value uses the display-2 ramp.",
          "token": "--cds-type-display-2-size"
        },
        {
          "label": "Supporting copy",
          "description": "The optional description uses the body ramp.",
          "token": "--cds-type-body-size"
        }
      ],
      "colors": [
        {
          "label": "Value",
          "description": "The headline value uses primary text.",
          "token": "--cds-text-primary"
        },
        {
          "label": "Description",
          "description": "Supporting copy uses secondary text.",
          "token": "--cds-text-secondary"
        },
        {
          "label": "Card surface",
          "description": "The tile sits on the card surface.",
          "token": "--cds-bg-surface"
        }
      ]
    },
    "states": [
      {
        "id": "populated",
        "label": "Populated",
        "description": "At least one series with two or more points renders the inline chart."
      },
      {
        "id": "empty",
        "label": "Empty",
        "description": "No renderable series but a ghost projection still draws the will-grow chart."
      },
      {
        "id": "placeholder",
        "label": "Placeholder",
        "description": "No series and no ghost, so placeholder copy replaces the chart entirely."
      }
    ],
    "behavior": [
      {
        "label": "Placeholder fallback",
        "description": "When no series can render, show placeholder copy instead of an empty chart, so always supply one."
      },
      {
        "label": "Delegated chart",
        "description": "Series, ghost series, tone, and smoothing behave exactly as in LineChart."
      },
      {
        "label": "Stat direction",
        "description": "statTone colors the delta up (positive) or down (negative)."
      }
    ],
    "accessibility": [
      {
        "label": "Chart label",
        "description": "Pass an accessible label so the inline chart is announced as a meaningful image."
      },
      {
        "label": "Readable delta",
        "description": "State direction in the stat text, not color alone, so the trend reads without hue."
      }
    ],
    "contentAdaptation": [
      {
        "label": "When to wrap",
        "description": "Use this tile when a metric needs value chrome; drop to a bare LineChart for a plain sparkline."
      },
      {
        "label": "Zero-data copy",
        "description": "Provide placeholder copy for the zero-data case so the tile never shows an empty plot."
      }
    ],
    "motionHaptics": {
      "motion": [
        {
          "label": "Inline chart motion",
          "description": "Motion comes from the inline LineChart; the card itself does not animate on mount."
        }
      ],
      "haptics": [
        {
          "label": "No feedback",
          "description": "The tile is a display and requests no haptic feedback."
        }
      ]
    },
    "platformDifferences": []
  },
  "spec_source": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.spec.json",
  "guidance_source": {
    "path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.mdx",
    "code": "import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks';\nimport { ComponentSpec } from '../../../../.storybook/blocks';\nimport * as Stories from './MetricLineChartCard.stories';\nimport metricLineChartCardSpec from './MetricLineChartCard.spec.json';\n\n<Meta of={Stories} />\n\n# MetricLineChartCard\n\nA dashboard KPI tile: a `LineChart` packaged in a Card with a headline value, an optional stat\ndelta, title, and description.\n\n<Canvas of={Stories.Default} />\n\n## When to use\n\nUse MetricLineChartCard as the standard metric card on a home or overview surface — it is the\npre-composed wrapper around `LineChart`, so drop to a bare `LineChart` when you only need the\nsparkline without the value chrome. `statTone` colors the delta green (`up`) or red (`down`).\n`series`, `ghostSeries`, tone, and smoothing behave exactly as in `LineChart`.\n\nWhen no `series` can render it shows `placeholder` copy instead of an empty chart, so always\nsupply one for the zero-data case.\n\nNot currently used in the app.\n\n## Empty state\n\nWith no series, `placeholder` copy replaces the chart entirely.\n\n<Canvas of={Stories.PlaceholderOnly} />\n\n## Design Guidelines\n\n<ComponentSpec spec={metricLineChartCardSpec} />\n\n## Props\n\n<Controls of={Stories.Default} />\n"
  },
  "props": [
    {
      "name": "title",
      "type": "React.ReactNode",
      "declared_type": "React.ReactNode",
      "required": true,
      "description": "Card heading above the metric.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 159
      }
    },
    {
      "name": "value",
      "type": "React.ReactNode",
      "declared_type": "React.ReactNode",
      "required": true,
      "description": "The headline metric itself, rendered at display size.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 161
      }
    },
    {
      "name": "statLabel",
      "type": "React.ReactNode",
      "declared_type": "React.ReactNode",
      "required": false,
      "description": "Optional stat label beside the value.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 163
      }
    },
    {
      "name": "statTone",
      "type": "\"up\" | \"down\" | undefined",
      "declared_type": "'up' | 'down'",
      "required": false,
      "description": "Directional treatment for the stat label.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 165
      },
      "values": [
        "down",
        "up"
      ],
      "values_complete": true,
      "default": "'up'",
      "default_kind": "source-expression"
    },
    {
      "name": "description",
      "type": "React.ReactNode",
      "declared_type": "React.ReactNode",
      "required": false,
      "description": "Secondary copy under the metric; the line is omitted entirely when unset.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 167
      }
    },
    {
      "name": "placeholder",
      "type": "React.ReactNode",
      "declared_type": "React.ReactNode",
      "required": false,
      "description": "Empty-state copy shown when no series can render.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 169
      }
    },
    {
      "name": "series",
      "type": "DataVisualizationSeries[]",
      "declared_type": "DataVisualizationSeries[]",
      "required": true,
      "description": "Primary series rendered in the card chart.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 171
      }
    },
    {
      "name": "ghostSeries",
      "type": "DataVisualizationSeries[] | undefined",
      "declared_type": "DataVisualizationSeries[]",
      "required": false,
      "description": "Optional ghosted comparison series.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 173
      }
    },
    {
      "name": "ariaLabel",
      "type": "string | undefined",
      "declared_type": "string",
      "required": false,
      "description": "Accessible label for the chart.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 175
      }
    },
    {
      "name": "testId",
      "type": "string | undefined",
      "declared_type": "string",
      "required": false,
      "description": "Optional test selector, applied to the card root.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 177
      }
    }
  ],
  "prop_shapes": {},
  "examples": [],
  "tokens": [
    {
      "name": "--cds-space-12",
      "light": "12px",
      "dark": "12px"
    },
    {
      "name": "--cds-radius-lg",
      "light": "20px",
      "dark": "20px"
    },
    {
      "name": "--cds-space-16",
      "light": "16px",
      "dark": "16px"
    },
    {
      "name": "--cds-type-display-2-size",
      "light": "3rem",
      "dark": "3rem"
    },
    {
      "name": "--cds-type-body-size",
      "light": "1rem",
      "dark": "1rem"
    },
    {
      "name": "--cds-text-primary",
      "light": "#141410",
      "dark": "#f3f1ed"
    },
    {
      "name": "--cds-text-secondary",
      "light": "#646260",
      "dark": "#ffffff99"
    },
    {
      "name": "--cds-bg-surface",
      "light": "#ffffff",
      "dark": "#1b1b18"
    }
  ],
  "visual_reference": {
    "stories": [
      {
        "id": "cloaked-design-system-visualizations-metriclinechartcard--default",
        "name": "Default",
        "title": "Cloaked Design System/Visualizations/MetricLineChartCard",
        "exportName": "Default",
        "source_path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
        "source_digest": "dbc75601d792903504f540d106d35876fdd50c66d2ce8a3d086d3a5074c7b10c",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-visualizations-metriclinechartcard--default&viewMode=story"
      },
      {
        "id": "cloaked-design-system-visualizations-metriclinechartcard--empty",
        "name": "Empty",
        "title": "Cloaked Design System/Visualizations/MetricLineChartCard",
        "exportName": "Empty",
        "source_path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
        "source_digest": "dbc75601d792903504f540d106d35876fdd50c66d2ce8a3d086d3a5074c7b10c",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-visualizations-metriclinechartcard--empty&viewMode=story"
      },
      {
        "id": "cloaked-design-system-visualizations-metriclinechartcard--placeholder-only",
        "name": "Placeholder Only",
        "title": "Cloaked Design System/Visualizations/MetricLineChartCard",
        "exportName": "PlaceholderOnly",
        "source_path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
        "source_digest": "dbc75601d792903504f540d106d35876fdd50c66d2ce8a3d086d3a5074c7b10c",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-visualizations-metriclinechartcard--placeholder-only&viewMode=story"
      },
      {
        "id": "cloaked-design-system-visualizations-metriclinechartcard--single-series",
        "name": "Single Series",
        "title": "Cloaked Design System/Visualizations/MetricLineChartCard",
        "exportName": "SingleSeries",
        "source_path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
        "source_digest": "dbc75601d792903504f540d106d35876fdd50c66d2ce8a3d086d3a5074c7b10c",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-visualizations-metriclinechartcard--single-series&viewMode=story"
      },
      {
        "id": "cloaked-design-system-visualizations-metriclinechartcard--many-series",
        "name": "Many Series",
        "title": "Cloaked Design System/Visualizations/MetricLineChartCard",
        "exportName": "ManySeries",
        "source_path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
        "source_digest": "dbc75601d792903504f540d106d35876fdd50c66d2ce8a3d086d3a5074c7b10c",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-visualizations-metriclinechartcard--many-series&viewMode=story"
      },
      {
        "id": "cloaked-design-system-visualizations-metriclinechartcard--dark-theme",
        "name": "Dark Theme",
        "title": "Cloaked Design System/Visualizations/MetricLineChartCard",
        "exportName": "DarkTheme",
        "source_path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
        "source_digest": "dbc75601d792903504f540d106d35876fdd50c66d2ce8a3d086d3a5074c7b10c",
        "status": "preview",
        "local_url": "/storybook/iframe.html?id=cloaked-design-system-visualizations-metriclinechartcard--dark-theme&viewMode=story"
      }
    ],
    "name": "MetricLineChartCard",
    "id": "metriclinechartcard",
    "category": "Visualizations"
  },
  "stories": [
    {
      "id": "cloaked-design-system-visualizations-metriclinechartcard--default",
      "name": "Default",
      "title": "Cloaked Design System/Visualizations/MetricLineChartCard",
      "exportName": "Default",
      "source_path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
      "source_digest": "dbc75601d792903504f540d106d35876fdd50c66d2ce8a3d086d3a5074c7b10c",
      "status": "preview",
      "local_url": "/storybook/iframe.html?id=cloaked-design-system-visualizations-metriclinechartcard--default&viewMode=story"
    },
    {
      "id": "cloaked-design-system-visualizations-metriclinechartcard--empty",
      "name": "Empty",
      "title": "Cloaked Design System/Visualizations/MetricLineChartCard",
      "exportName": "Empty",
      "source_path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
      "source_digest": "dbc75601d792903504f540d106d35876fdd50c66d2ce8a3d086d3a5074c7b10c",
      "status": "preview",
      "local_url": "/storybook/iframe.html?id=cloaked-design-system-visualizations-metriclinechartcard--empty&viewMode=story"
    },
    {
      "id": "cloaked-design-system-visualizations-metriclinechartcard--placeholder-only",
      "name": "Placeholder Only",
      "title": "Cloaked Design System/Visualizations/MetricLineChartCard",
      "exportName": "PlaceholderOnly",
      "source_path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
      "source_digest": "dbc75601d792903504f540d106d35876fdd50c66d2ce8a3d086d3a5074c7b10c",
      "status": "preview",
      "local_url": "/storybook/iframe.html?id=cloaked-design-system-visualizations-metriclinechartcard--placeholder-only&viewMode=story"
    },
    {
      "id": "cloaked-design-system-visualizations-metriclinechartcard--single-series",
      "name": "Single Series",
      "title": "Cloaked Design System/Visualizations/MetricLineChartCard",
      "exportName": "SingleSeries",
      "source_path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
      "source_digest": "dbc75601d792903504f540d106d35876fdd50c66d2ce8a3d086d3a5074c7b10c",
      "status": "preview",
      "local_url": "/storybook/iframe.html?id=cloaked-design-system-visualizations-metriclinechartcard--single-series&viewMode=story"
    },
    {
      "id": "cloaked-design-system-visualizations-metriclinechartcard--many-series",
      "name": "Many Series",
      "title": "Cloaked Design System/Visualizations/MetricLineChartCard",
      "exportName": "ManySeries",
      "source_path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
      "source_digest": "dbc75601d792903504f540d106d35876fdd50c66d2ce8a3d086d3a5074c7b10c",
      "status": "preview",
      "local_url": "/storybook/iframe.html?id=cloaked-design-system-visualizations-metriclinechartcard--many-series&viewMode=story"
    },
    {
      "id": "cloaked-design-system-visualizations-metriclinechartcard--dark-theme",
      "name": "Dark Theme",
      "title": "Cloaked Design System/Visualizations/MetricLineChartCard",
      "exportName": "DarkTheme",
      "source_path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
      "source_digest": "dbc75601d792903504f540d106d35876fdd50c66d2ce8a3d086d3a5074c7b10c",
      "status": "preview",
      "local_url": "/storybook/iframe.html?id=cloaked-design-system-visualizations-metriclinechartcard--dark-theme&viewMode=story"
    }
  ],
  "stories_source": {
    "path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.stories.tsx",
    "code": "import type { Meta, StoryObj } from '@storybook/react-vite';\nimport { buildRadioArgType, disabledControl } from '../../../storybook/controlOptions';\nimport { MetricLineChartCard } from './MetricLineChartCard';\nimport type { DataVisualizationSeries } from '../types';\n\nconst STAT_TONES = ['up', 'down'] as const;\n\nconst series: DataVisualizationSeries[] = [\n    { id: 'full_name', tone: 'good', values: [4, 10, 18, 28, 41, 58, 76, 96, 118, 140, 164, 190] },\n    { id: 'email_addresses', tone: 'brand', values: [2, 6, 14, 25, 38, 52, 68, 85, 104, 126, 142, 168] },\n    { id: 'addresses', tone: 'excellent', values: [1, 4, 10, 18, 30, 42, 58, 72, 86, 98, 110, 128] },\n];\n\nconst manySeries: DataVisualizationSeries[] = [\n    ...series,\n    { id: 'phone_numbers', tone: 'fair', values: [0, 3, 7, 13, 22, 30, 39, 48, 56, 63, 71, 80] },\n    { id: 'relatives', tone: 'high', values: [0, 1, 4, 9, 14, 20, 27, 34, 42, 50, 58, 68] },\n];\n\nconst ghostSeries: DataVisualizationSeries[] = [\n    { id: 'ghost-primary', tone: 'good', values: [8, 12, 18, 28, 40, 52, 63, 72], dashed: true },\n    { id: 'ghost-secondary', tone: 'brand', values: [4, 8, 14, 22, 31, 41, 50, 59], dashed: true },\n];\n\nconst meta: Meta<typeof MetricLineChartCard> = {\n    title: 'Cloaked Design System/Visualizations/MetricLineChartCard',\n    component: MetricLineChartCard,\n    parameters: {\n        a11y: { test: 'error' },\n        docs: {\n            description: {\n                component:\n                    'A dashboard KPI tile: a `LineChart` packaged in a Card with a headline `value`, an ' +\n                    'optional `statLabel` delta, `title`, and `description`. Use it as the standard ' +\n                    'metric card on a home/overview surface; drop to a bare `LineChart` when you only ' +\n                    'need the sparkline without the value chrome. `statTone` colors the delta green ' +\n                    '(`up`) or red (`down`). When no `series` can render, it shows `placeholder` copy ' +\n                    'instead of an empty chart, so always supply one for the zero-data case. `series`, ' +\n                    '`ghostSeries`, `tone`, and smoothing behave exactly as in `LineChart`.',\n            },\n        },\n    },\n    argTypes: {\n        title: { control: 'text', description: 'Card heading above the value.' },\n        value: { control: 'text', description: 'Headline metric value.' },\n        statLabel: { control: 'text', description: 'Optional delta shown beside the value (e.g. \"+24 today\").' },\n        statTone: {\n            ...buildRadioArgType(STAT_TONES),\n            description: 'Colors the `statLabel`: `up` reads positive (green), `down` negative (red).',\n        },\n        description: { control: 'text', description: 'Optional supporting copy under the value.' },\n        placeholder: {\n            control: 'text',\n            description: 'Empty-state copy shown in place of the chart when no series can render.',\n        },\n        series: { ...disabledControl, description: 'Primary lines rendered in the card chart (see `LineChart`).' },\n        ghostSeries: { ...disabledControl, description: 'Dashed comparison/projection lines behind `series`.' },\n        ariaLabel: { control: 'text', description: 'Accessible label for the chart; sets `role=\"img\"`.' },\n        testId: { control: 'text', description: 'Test selector on the card root.' },\n    },\n};\nexport default meta;\ntype Story = StoryObj<typeof MetricLineChartCard>;\n\nexport const Default: Story = {\n    args: {\n        title: 'Metric trend',\n        value: '2,498',\n        statLabel: '+24 today',\n        series,\n        ariaLabel: 'Metric totals over time',\n    },\n};\n\nexport const Empty: Story = {\n    parameters: {\n        docs: {\n            description: {\n                story: 'Zero value with a `ghostSeries` projection and `description` — the \"will grow\" empty state.',\n            },\n        },\n    },\n    args: {\n        title: 'Metric trend',\n        value: '0',\n        description: 'This count will grow as new data is added.',\n        series: [],\n        ghostSeries,\n        ariaLabel: 'Projected metric trend',\n    },\n};\n\nexport const PlaceholderOnly: Story = {\n    parameters: {\n        docs: { description: { story: 'No series and no ghost — `placeholder` copy replaces the chart entirely.' } },\n    },\n    args: {\n        title: 'Metric trend',\n        value: '0',\n        placeholder: 'No trend is available yet.',\n        series: [],\n        ariaLabel: 'Empty metric trend',\n    },\n};\n\nexport const SingleSeries: Story = {\n    parameters: {\n        docs: { description: { story: '`statTone=\"down\"` colors the negative delta red over a single line.' } },\n    },\n    args: {\n        title: 'Metric trend',\n        value: '164',\n        statTone: 'down',\n        statLabel: '-8 today',\n        series: [series[0]],\n        ariaLabel: 'Single metric trend',\n    },\n};\n\nexport const ManySeries: Story = {\n    parameters: { docs: { description: { story: 'Five overlaid series inside the card chart.' } } },\n    args: {\n        title: 'Metric trend',\n        value: '4,512',\n        statLabel: '+86 today',\n        series: manySeries,\n        ariaLabel: 'Many metric trends',\n    },\n};\n\nexport const DarkTheme: Story = {\n    args: {\n        title: 'Metric trend',\n        value: '2,498',\n        statLabel: '+24 today',\n        series,\n        ariaLabel: 'Metric totals over time',\n    },\n    globals: { theme: 'dark' },\n};\n"
  },
  "links": {
    "human": "/component-metriclinechartcard",
    "json": "/data/components/metriclinechartcard.json",
    "markdown": "/data/components/metriclinechartcard.md",
    "storybook": "/storybook/?path=/story/cloaked-design-system-visualizations-metriclinechartcard--default"
  },
  "contract_status": "preview",
  "contract_kind": "source-derived",
  "approval": "required",
  "api": {
    "method": "typescript-type-checker",
    "typescript_version": "5.9.3",
    "public_export": "MetricLineChartCard",
    "public_path": "MetricLineChartCard",
    "import_path": "@cloakedinc/design-system",
    "root_kind": "component",
    "entrypoints": [
      {
        "name": "MetricLineChartCard",
        "signature": 1,
        "visibility": "public",
        "source": {
          "path": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.tsx",
          "line": 12
        },
        "props_type": "MetricLineChartCardProps",
        "props": [
          {
            "name": "title",
            "type": "React.ReactNode",
            "declared_type": "React.ReactNode",
            "required": true,
            "description": "Card heading above the metric.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 159
            }
          },
          {
            "name": "value",
            "type": "React.ReactNode",
            "declared_type": "React.ReactNode",
            "required": true,
            "description": "The headline metric itself, rendered at display size.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 161
            }
          },
          {
            "name": "statLabel",
            "type": "React.ReactNode",
            "declared_type": "React.ReactNode",
            "required": false,
            "description": "Optional stat label beside the value.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 163
            }
          },
          {
            "name": "statTone",
            "type": "\"up\" | \"down\" | undefined",
            "declared_type": "'up' | 'down'",
            "required": false,
            "description": "Directional treatment for the stat label.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 165
            },
            "values": [
              "down",
              "up"
            ],
            "values_complete": true,
            "default": "'up'",
            "default_kind": "source-expression"
          },
          {
            "name": "description",
            "type": "React.ReactNode",
            "declared_type": "React.ReactNode",
            "required": false,
            "description": "Secondary copy under the metric; the line is omitted entirely when unset.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 167
            }
          },
          {
            "name": "placeholder",
            "type": "React.ReactNode",
            "declared_type": "React.ReactNode",
            "required": false,
            "description": "Empty-state copy shown when no series can render.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 169
            }
          },
          {
            "name": "series",
            "type": "DataVisualizationSeries[]",
            "declared_type": "DataVisualizationSeries[]",
            "required": true,
            "description": "Primary series rendered in the card chart.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 171
            }
          },
          {
            "name": "ghostSeries",
            "type": "DataVisualizationSeries[] | undefined",
            "declared_type": "DataVisualizationSeries[]",
            "required": false,
            "description": "Optional ghosted comparison series.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 173
            }
          },
          {
            "name": "ariaLabel",
            "type": "string | undefined",
            "declared_type": "string",
            "required": false,
            "description": "Accessible label for the chart.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 175
            }
          },
          {
            "name": "testId",
            "type": "string | undefined",
            "declared_type": "string",
            "required": false,
            "description": "Optional test selector, applied to the card root.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 177
            }
          }
        ],
        "branches": [],
        "constraints": [],
        "extraction_status": "extracted"
      }
    ],
    "type_sources": [
      {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 10,
        "name": "DataVisualizationTone",
        "code": "export type DataVisualizationTone = SeriesTone | RiskTone;"
      },
      {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 12,
        "name": "DataVisualizationSeries",
        "code": "export interface DataVisualizationSeries {\n    id: string;\n    values: number[];\n    tone?: DataVisualizationTone;\n    /**\n     * Explicit stroke color (any CSS color). Overrides `tone` when set — use it for\n     * product-specific palettes the design-system tones intentionally do not cover.\n     */\n    color?: string;\n    dashed?: boolean;\n}"
      },
      {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 157,
        "name": "MetricLineChartCardProps",
        "code": "export interface MetricLineChartCardProps {\n    /** Card heading above the metric. */\n    title: React.ReactNode;\n    /** The headline metric itself, rendered at display size. */\n    value: React.ReactNode;\n    /** Optional stat label beside the value. */\n    statLabel?: React.ReactNode;\n    /** Directional treatment for the stat label. */\n    statTone?: 'up' | 'down';\n    /** Secondary copy under the metric; the line is omitted entirely when unset. */\n    description?: React.ReactNode;\n    /** Empty-state copy shown when no series can render. */\n    placeholder?: React.ReactNode;\n    /** Primary series rendered in the card chart. */\n    series: DataVisualizationSeries[];\n    /** Optional ghosted comparison series. */\n    ghostSeries?: DataVisualizationSeries[];\n    /** Accessible label for the chart. */\n    ariaLabel?: string;\n    /** Optional test selector, applied to the card root. */\n    testId?: string;\n}"
      },
      {
        "path": "packages/design-system/src/styles/riskTone.ts",
        "line": 9,
        "name": "RISK_TONES",
        "code": "RISK_TONES = ['excellent', 'good', 'fair', 'high', 'critical'] as const"
      },
      {
        "path": "packages/design-system/src/styles/riskTone.ts",
        "line": 11,
        "name": "RiskTone",
        "code": "export type RiskTone = (typeof RISK_TONES)[number];"
      },
      {
        "path": "packages/design-system/src/styles/seriesTone.ts",
        "line": 8,
        "name": "SERIES_TONES",
        "code": "SERIES_TONES = ['brand', 'primary', 'secondary'] as const"
      },
      {
        "path": "packages/design-system/src/styles/seriesTone.ts",
        "line": 10,
        "name": "SeriesTone",
        "code": "export type SeriesTone = (typeof SERIES_TONES)[number];"
      }
    ],
    "defaults_policy": "Only explicit destructured parameter initializers are extracted. Other runtime defaults remain in implementation source."
  },
  "platforms": {
    "implemented": [
      "web"
    ],
    "native": "Imported design guidance only; no native implementation or parity verification in this preview.",
    "react": {
      "implementation": "local",
      "status": "preview",
      "parity": "web-reference"
    },
    "vue": {
      "implementation": "absent",
      "parity": "not-verified",
      "status": "reference-only"
    },
    "swift": {
      "implementation": "absent",
      "parity": "not-verified",
      "status": "reference-only"
    },
    "kotlin": {
      "implementation": "absent",
      "parity": "not-verified",
      "status": "reference-only"
    }
  },
  "missing_facts": [
    {
      "code": "human-review-pending",
      "detail": "This local preview has no recorded human design or engineering sign-off."
    },
    {
      "code": "platform-parity-unverified",
      "detail": "Vue, Swift and Kotlin implementations are absent from this package; platform parity has not been verified."
    },
    {
      "code": "figma-mapping-unverified",
      "detail": "No current component-level Figma node and immutable revision have been verified for this contract."
    }
  ],
  "review": {
    "local_status": "not-reviewed",
    "source_approval": null,
    "imported_spec_status": "approved",
    "spec_origin": "imported-adapted",
    "local_spec_source_status": "approved",
    "imported_source_revision": "f96f416e1c3bfbfaffcd155a88b87b18b8bb25f1",
    "note": "Inherited specification status is provenance, not approval of the current local implementation or extracted contract."
  }
}
