{
  "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",
  "contract_status": "preview",
  "contract_kind": "source-derived",
  "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."
  },
  "approval": "required",
  "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_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"
  },
  "specification": {
    "$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": []
  },
  "specification_source": "packages/design-system/src/components/visualizations/MetricLineChartCard/MetricLineChartCard.spec.json",
  "guidance": {
    "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."
  },
  "links": {
    "human": "/component-metriclinechartcard",
    "json": "/data/visual/components/metriclinechartcard.json",
    "storybook": "/storybook/?path=/story/cloaked-design-system-visualizations-metriclinechartcard--default"
  }
}
