{
  "accessibility" : [
    "A loaded card is one element: title aside, VoiceOver reads the value, the unit and \"Up 4.2 %, vs last month\".",
    "The direction is carried by the symbol's shape and by a word; colour (`tone`) is an addition, never the only signal.",
    "Loading and missing states have explicit labels instead of a silent placeholder.",
    "Text follows Dynamic Type and wraps; the value uses monospaced digits.",
    "Values and percentages are formatted with `FormatStyle` in the environment's locale."
  ],
  "category" : "data",
  "changelog" : [
    {
      "changes" : [
        "Release 1.1.0: see the project changelog."
      ],
      "date" : "2026-12-03",
      "version" : "1.1.0"
    },
    {
      "changes" : [
        "Initial release."
      ],
      "date" : "2026-12-02",
      "version" : "1.0.0"
    }
  ],
  "dependencies" : [
    {
      "id" : "glass-button",
      "version" : "1.1.0"
    },
    {
      "id" : "glass-components-support",
      "version" : "1.1.0"
    },
    {
      "id" : "glass-data-support",
      "version" : "1.1.0"
    },
    {
      "id" : "glass-foundation",
      "version" : "1.1.0"
    }
  ],
  "description" : "A value with unit, change and period, and states for missing, loading and failed data.",
  "examples" : [
    {
      "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassMetricCardExample: GlassExample {\n    public static let componentID = \"glass-metric-card\"\n\n    // Fictitious figures.\n    @State private var latency: GlassLoadState<GlassMetric> = .loaded(\n        GlassMetric(value: 182, unit: \"ms\", change: -0.062, period: \"vs last week\", tone: .negativeIsGood)\n    )\n\n    public init() {}\n\n    public var body: some View {\n        ScrollView {\n            LazyVGrid(columns: [GridItem(.adaptive(minimum: 220), spacing: 12)], spacing: 12) {\n                GlassMetricCard(\"Response time\", state: latency) {\n                    latency = .loaded(GlassMetric(value: 175, unit: \"ms\", change: -0.098, period: \"vs last week\", tone: .negativeIsGood))\n                }\n                GlassMetricCard(\"Monthly revenue\", state: .loaded(\n                    GlassMetric(value: 48_250.5, unit: \"$\", change: 0.042, period: \"vs last month\", fractionDigits: 2...2, tone: .positiveIsGood)\n                ))\n                GlassMetricCard(\"Bookings\", systemImage: \"calendar\", state: .loaded(\n                    GlassMetric(value: 1284, change: 0.082, period: \"vs last week\", tone: .positiveIsGood, sparkline: [31, 34, 33, 38, 41, 40, 46])\n                ))\n                GlassMetricCard(\"Open tickets\", state: .loaded(GlassMetric(value: 37, change: 0, period: \"since yesterday\")))\n                GlassMetricCard(\"Active sessions\", state: .loading)\n                GlassMetricCard(\"Conversion\", state: .empty)\n                GlassMetricCard(\"Forecast\", state: .idle)\n                GlassMetricCard(\"Churn\", state: .failed(message: \"The report could not be loaded.\")) {}\n            }\n            .padding()\n\n            HStack {\n                GlassButton(\"Simulate a failure\", size: .small) { latency = .failed(message: \"The probe did not answer.\") }\n                GlassButton(\"Reload\", size: .small) { latency = .loading }\n            }\n            .padding(.bottom)\n        }\n    }\n}\n\n#Preview(\"GlassMetricCard\") { GlassMetricCardExample().glassTheme(.emerald) }\n",
      "title" : "GlassMetricCard example"
    }
  ],
  "files" : [
    {
      "bytes" : 16812,
      "path" : "Data/Data/GlassMetricCard.swift",
      "sha256" : "0f475f61957aba25b903318e1fd2d85163960c5675dadc95303f0bfac66ae39d"
    }
  ],
  "frameworks" : [

  ],
  "id" : "glass-metric-card",
  "kind" : "content-component",
  "license" : "MIT",
  "minimumOS" : {
    "iOS" : "26.0",
    "iPadOS" : "26.0",
    "macOS" : "26.0"
  },
  "name" : "GlassMetricCard",
  "platforms" : [
    "iOS",
    "iPadOS",
    "macOS"
  ],
  "schemaVersion" : 1,
  "sha256" : "108e06a83542232d184e332f077fa42d4755545851d172ccf1d683e6d27e0cb8",
  "symbols" : [
    "GlassMetric",
    "GlassMetricTone",
    "GlassMetricFormatter",
    "GlassMetricCard"
  ],
  "version" : "1.1.0"
}
