{
 "id": "budget-meters",
 "name": "Usage meters",
 "purpose": "Budget, seats and credit as three meters, with the forecast hatched past what is used and alert thresholds marked on the bar.",
 "use_when": [
  "on a billing or usage page, for limits that can run out",
  "a plan or account summary where two to three limits sit side by side and one may run out before the period ends"
 ],
 "avoid_when": [
  "a trend over time rather than a share of a limit: use bar-chart",
  "headline numbers with no limit to run out: use kpi-strip",
  "more than three limits: the wide layout holds three columns"
 ],
 "type": "chart",
 "style": "quiet",
 "width": "wide",
 "tags": {
  "audience": "work",
  "industries": [
   "saas",
   "devtools",
   "finance"
  ],
  "keywords": [
   "billing",
   "usage",
   "budget",
   "meter",
   "forecast"
  ]
 },
 "root": ".odl-budget-meters",
 "parts": [
  {
   "name": "meters",
   "selector": ".odl-budget-meters section",
   "what": "one limit: its label and status, the used amount, the bar and a note",
   "slot": "list"
  },
  {
   "name": "label",
   "selector": ".odl-top span",
   "what": "what the limit is, and a short status such as '80% used'",
   "slot": "text"
  },
  {
   "name": "alert",
   "selector": ".odl-top b",
   "what": "a warning chip, for example the forecast going over budget",
   "slot": "text"
  },
  {
   "name": "amount",
   "selector": "h4 strong",
   "what": "the used amount, large, followed by 'of' the limit",
   "slot": "number"
  },
  {
   "name": "bar",
   "selector": ".odl-bar",
   "what": "the meter: used fill, optional lighter forecast run and threshold ticks",
   "slot": "none"
  },
  {
   "name": "note",
   "selector": ".odl-budget-meters p",
   "what": "one line on alerts, prices or when it resets",
   "slot": "text"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "meters"
  ],
  "properties": {
   "label": {
    "type": "string",
    "maxLength": 40
   },
   "meters": {
    "type": "array",
    "minItems": 1,
    "maxItems": 3,
    "part": "meters",
    "items": {
     "type": "object",
     "required": [
      "label",
      "used",
      "limit"
     ],
     "properties": {
      "label": {
       "type": "string",
       "maxLength": 24
      },
      "status": {
       "type": "string",
       "maxLength": 16
      },
      "alert": {
       "type": "string",
       "maxLength": 28
      },
      "used": {
       "type": "number"
      },
      "limit": {
       "type": "number"
      },
      "display": {
       "type": "string",
       "maxLength": 28
      },
      "forecast_percent": {
       "type": "number",
       "minimum": 0,
       "maximum": 100
      },
      "thresholds": {
       "type": "array",
       "minItems": 0,
       "maxItems": 3,
       "items": {
        "type": "object",
        "properties": {
         "at": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
         }
        }
       }
      },
      "high": {
       "type": "boolean"
      },
      "note": {
       "type": "string",
       "maxLength": 80
      },
      "limit_display": {
       "type": "string",
       "maxLength": 80
      },
      "share": {
       "type": "number"
      }
     }
    }
   }
  }
 },
 "states": {
  "shown": [
   "under budget",
   "forecast over budget",
   "full"
  ],
  "edge": {
   "empty": {
    "status": "handled",
    "evidence": "data-od-list",
    "how": "the Smart UI renderer puts one plain 'Nothing to show yet.' line in an empty list"
   },
   "loading": {
    "status": "handled",
    "evidence": "data-od-slot",
    "how": "the Smart UI renderer draws each marked slot as a quiet block of its size while the data arrives; the static file shows the filled part"
   },
   "error": {
    "status": "not_built",
    "how": "if usage cannot be read, replace the bar with the note 'Usage not available' and put an alert-banners line above the card"
   },
   "disabled": {
    "status": "not_built",
    "how": "for a limit that does not apply on this plan, grey the label and leave the track empty with a note"
   },
   "overflow": {
    "status": "handled",
    "how": "the three meters sit in columns on a wide screen and stack in one column below that",
    "evidence": "@container (min-width: 56rem)"
   },
   "long_text": {
    "status": "handled",
    "how": "the label row wraps the alert chip under the label; the chip itself never wraps",
    "evidence": "flex-wrap: wrap; justify-content: space-between"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-border-width-emphasis",
  "--ds-color-bg-inverse",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-bg-warning-bold",
  "--ds-color-bg-warning-subtle",
  "--ds-color-border-default",
  "--ds-color-border-subtle",
  "--ds-color-surface-raised",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-warning",
  "--ds-elevation-raised",
  "--ds-font-weight-label",
  "--ds-radius-container",
  "--ds-radius-control-sm",
  "--ds-radius-full",
  "--ds-size-control-sm",
  "--ds-space-2",
  "--ds-space-4",
  "--ds-space-8",
  "--ds-space-inline-sm",
  "--ds-space-inset-lg",
  "--ds-space-inset-sm",
  "--ds-space-inset-xl",
  "--ds-space-stack-lg",
  "--ds-space-stack-sm",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "Each bar has role meter with its value and label; the forecast and thresholds are also said in the text under it.",
  "roles": [
   "group",
   "meter"
  ],
  "keyboard": [],
  "controls": {
   "button": 0,
   "input": 0,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": false,
  "reduced_motion": false,
  "min_target": false
 },
 "files": {
  "html": "components/budget-meters/component.html",
  "bytes": 6466,
  "script": false
 },
 "source": "brand/showcase/product/05-kilnworks-billing",
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/budget-meters.html",
  "json": "https://opendesigner.dev/library/budget-meters.json",
  "page": "https://opendesigner.dev/library/budget-meters/"
 },
 "get": {
  "curl": "curl -fsSLo budget-meters.html https://opendesigner.dev/library/budget-meters.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add budget-meters --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component budget-meters to this project: https://opendesigner.dev/library/budget-meters.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
