# HalfGauge

A semicircular 0-100 dial for a single neutral progress or score value, with a low-to-high gradient sweep and clamped out-of-range input.

Version: 0.2.0-preview.1 (preview)
Content digest: 70ac710f4d22dce040e7ac593379ba8aca9dcb59a0b9c0f839819cae0e2bb721
Contract kind: source-derived
Source: packages/design-system/src/components/visualizations/HalfGauge/HalfGauge.tsx

## Guidance

{
  "summary": "A semicircular 0-100 dial for a single neutral progress or score value, with a low-to-high gradient sweep and clamped out-of-range input.",
  "guidance": [
    {
      "heading": "Overview",
      "body": "A semicircular 0-100 dial for a single neutral progress or score value — \"how far toward\ncomplete.\""
    },
    {
      "heading": "When to use",
      "body": "Use HalfGauge for one bounded value that reads as a share or completion with no severity\nmeaning; values outside 0-100 are clamped.\n\nReach for `RiskMeter` instead when the value sits on a severity scale — its track carries a\nlow-to-high risk gradient and supports a `thumb` vs `pointer` marker. Use `Progress` for a\nplain linear bar, and `CategoryBars` when you are comparing several values rather than showing\none.\n\nNot currently used in the app."
    }
  ],
  "usage": [],
  "examples": [],
  "source": "packages/design-system/src/components/visualizations/HalfGauge/HalfGauge.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."
}

## Contract and public API

```json
{
  "props": [
    {
      "name": "value",
      "type": "number",
      "declared_type": "number",
      "required": true,
      "description": "Gauge value from 0 to 100.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 241
      }
    },
    {
      "name": "ariaLabel",
      "type": "string | undefined",
      "declared_type": "string",
      "required": false,
      "description": "Accessible label for meaningful gauge values.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 243
      }
    },
    {
      "name": "testId",
      "type": "string | undefined",
      "declared_type": "string",
      "required": false,
      "description": "Optional test selector.",
      "source": {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 245
      }
    }
  ],
  "prop_shapes": {},
  "api": {
    "method": "typescript-type-checker",
    "typescript_version": "5.9.3",
    "public_export": "HalfGauge",
    "public_path": "HalfGauge",
    "import_path": "@cloakedinc/design-system",
    "root_kind": "component",
    "entrypoints": [
      {
        "name": "HalfGauge",
        "signature": 1,
        "visibility": "public",
        "source": {
          "path": "packages/design-system/src/components/visualizations/HalfGauge/HalfGauge.tsx",
          "line": 15
        },
        "props_type": "HalfGaugeProps",
        "props": [
          {
            "name": "value",
            "type": "number",
            "declared_type": "number",
            "required": true,
            "description": "Gauge value from 0 to 100.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 241
            }
          },
          {
            "name": "ariaLabel",
            "type": "string | undefined",
            "declared_type": "string",
            "required": false,
            "description": "Accessible label for meaningful gauge values.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 243
            }
          },
          {
            "name": "testId",
            "type": "string | undefined",
            "declared_type": "string",
            "required": false,
            "description": "Optional test selector.",
            "source": {
              "path": "packages/design-system/src/components/visualizations/types.ts",
              "line": 245
            }
          }
        ],
        "branches": [],
        "constraints": [],
        "extraction_status": "extracted"
      }
    ],
    "type_sources": [
      {
        "path": "packages/design-system/src/components/visualizations/types.ts",
        "line": 239,
        "name": "HalfGaugeProps",
        "code": "export interface HalfGaugeProps {\n    /** Gauge value from 0 to 100. */\n    value: number;\n    /** Accessible label for meaningful gauge values. */\n    ariaLabel?: string;\n    /** Optional test selector. */\n    testId?: string;\n}"
      }
    ],
    "defaults_policy": "Only explicit destructured parameter initializers are extracted. Other runtime defaults remain in implementation source."
  },
  "spec": {
    "$schema": "../../../specs/component-spec.schema.json",
    "identity": {
      "name": "HalfGauge",
      "status": "preview",
      "version": "1.0.0",
      "summary": "A semicircular 0-100 dial for a single neutral progress or score value, with a low-to-high gradient sweep and clamped out-of-range input."
    },
    "parts": [
      {
        "id": "dial",
        "label": "Dial",
        "description": "The semicircular SVG that scales to its container.",
        "required": true
      },
      {
        "id": "track",
        "label": "Track",
        "description": "The unfilled arc behind the value sweep."
      },
      {
        "id": "value-arc",
        "label": "Value arc",
        "description": "The gradient arc swept from empty to the value."
      }
    ],
    "allowedDesignChoices": {
      "variants": {
        "base": {
          "label": "Base",
          "description": "The value changes the sweep without changing the dial treatment."
        }
      },
      "sizes": {}
    },
    "variants": [
      {
        "id": "base",
        "label": "Base",
        "description": "A single gradient semicircle swept to the clamped value.",
        "platforms": [
          "ios",
          "android",
          "web"
        ]
      }
    ],
    "sizes": [],
    "measurements": [
      {
        "id": "max-width",
        "label": "Maximum rendered width",
        "kind": "example-only",
        "token": "--cds-size-120",
        "value": 120,
        "unit": "px",
        "appliesTo": [
          "dial"
        ],
        "notes": "The dial otherwise fills 100% of its container. Its width cap is --cds-size-120 minus --cds-size-8 for optical balance; the arc geometry itself is drawn in SVG view-box units, not tokens, so this is the only token-backed dimension and is example-only."
      }
    ],
    "layout": {
      "alignment": "The dial fills its container width up to the cap and keeps its 112-by-62 aspect.",
      "flow": "A single arc pair (track plus value) sharing one semicircular SVG.",
      "notes": [
        "The arc radius and stroke are SVG view-box units so the dial scales cleanly at any width."
      ]
    },
    "typographyAndColor": {
      "typography": [
        {
          "label": "Adjacent caption",
          "description": "Surrounding value or caption text uses the body-small ramp; the dial draws no text itself.",
          "token": "--cds-type-body-small-size"
        }
      ],
      "colors": [
        {
          "label": "Track",
          "description": "The unfilled arc behind the value.",
          "token": "--cds-graph-bg"
        },
        {
          "label": "Low value",
          "description": "The good end of the gradient sweep.",
          "token": "--cds-risk-good"
        },
        {
          "label": "Mid value",
          "description": "The fair midpoint of the gradient sweep.",
          "token": "--cds-risk-fair"
        },
        {
          "label": "High value",
          "description": "The critical end of the gradient sweep.",
          "token": "--cds-risk-critical"
        }
      ]
    },
    "states": [
      {
        "id": "value",
        "label": "Value shown",
        "description": "The arc sweeps to the clamped 0-100 value and exposes it to assistive technology."
      },
      {
        "id": "empty",
        "label": "Empty",
        "description": "A zero value shows the track with no swept arc."
      },
      {
        "id": "clamped",
        "label": "Clamped",
        "description": "Out-of-range values are pinned to 0 or 100 so the arc never overflows."
      }
    ],
    "behavior": [
      {
        "label": "Clamped value",
        "description": "Values outside 0-100 are clamped so the sweep stays within the arc."
      },
      {
        "label": "Neutral meaning",
        "description": "Use HalfGauge for completion or share values with no severity meaning."
      },
      {
        "label": "Scales to width",
        "description": "The dial fills its container up to its width cap and keeps a fixed aspect."
      }
    ],
    "accessibility": [
      {
        "label": "Meaningful value",
        "description": "Pass an accessible label so the dial exposes a progressbar with min, max, and the value."
      },
      {
        "label": "Decorative dial",
        "description": "Omit the label to hide the dial from assistive technology when nearby text states the value."
      }
    ],
    "contentAdaptation": [
      {
        "label": "Neutral vs severity",
        "description": "Use HalfGauge for neutral completion; use RiskMeter when the value sits on a severity scale."
      },
      {
        "label": "One value only",
        "description": "Use CategoryBars instead when comparing several values rather than showing one."
      }
    ],
    "motionHaptics": {
      "motion": [
        {
          "label": "Sweep transition",
          "description": "The value arc eases to a new sweep; honor reduced-motion by letting the platform shorten it."
        }
      ],
      "haptics": [
        {
          "label": "No feedback",
          "description": "The dial is a display and requests no haptic feedback."
        }
      ]
    },
    "platformDifferences": []
  },
  "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"
    }
  },
  "tokens": [
    {
      "name": "--cds-size-120",
      "light": "120px",
      "dark": "120px"
    },
    {
      "name": "--cds-size-8",
      "light": "8px",
      "dark": "8px"
    },
    {
      "name": "--cds-type-body-small-size",
      "light": "0.875rem",
      "dark": "0.875rem"
    },
    {
      "name": "--cds-graph-bg",
      "light": "#0b0b0a0d",
      "dark": "#ffffff0d"
    },
    {
      "name": "--cds-risk-good",
      "light": "#27ae60",
      "dark": "#27ae60"
    },
    {
      "name": "--cds-risk-fair",
      "light": "#f0923b",
      "dark": "#f0923b"
    },
    {
      "name": "--cds-risk-critical",
      "light": "#c90004",
      "dark": "#c90004"
    }
  ],
  "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."
  },
  "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."
    }
  ]
}
```

## Visual states

- [Default](/storybook/iframe.html?id=cloaked-design-system-visualizations-halfgauge--default&viewMode=story) | export: Default | source: packages/design-system/src/components/visualizations/HalfGauge/HalfGauge.stories.tsx

- [Empty](/storybook/iframe.html?id=cloaked-design-system-visualizations-halfgauge--empty&viewMode=story) | export: Empty | source: packages/design-system/src/components/visualizations/HalfGauge/HalfGauge.stories.tsx

- [Full](/storybook/iframe.html?id=cloaked-design-system-visualizations-halfgauge--full&viewMode=story) | export: Full | source: packages/design-system/src/components/visualizations/HalfGauge/HalfGauge.stories.tsx

- [Clamped Over Max](/storybook/iframe.html?id=cloaked-design-system-visualizations-halfgauge--clamped-over-max&viewMode=story) | export: ClampedOverMax | source: packages/design-system/src/components/visualizations/HalfGauge/HalfGauge.stories.tsx

- [Dark Theme](/storybook/iframe.html?id=cloaked-design-system-visualizations-halfgauge--dark-theme&viewMode=story) | export: DarkTheme | source: packages/design-system/src/components/visualizations/HalfGauge/HalfGauge.stories.tsx

Preview pending human sign-off. Source-derived APIs and successful checks do not certify accessibility, native parity or approval.
