{
 "id": "approval-panel",
 "name": "Approval panel",
 "purpose": "One bill waiting for approval: the amount, the policy that applies, who has approved so far, and what the balance will be after paying.",
 "use_when": [
  "in finance and procurement tools, where one person approves a bill or request",
  "one request at a time, where the approver needs the policy and the cash effect before deciding"
 ],
 "avoid_when": [
  "several bills to approve in one go: use receipts-table with a bulk action",
  "a request with no money or balance effect: confirm-dialog says enough"
 ],
 "type": "data",
 "style": "quiet",
 "width": "narrow",
 "tags": {
  "audience": "work",
  "industries": [
   "finance",
   "saas"
  ],
  "keywords": [
   "approval",
   "timeline",
   "ledger",
   "invoice",
   "side panel"
  ]
 },
 "root": ".odl-approval-panel",
 "parts": [
  {
   "name": "vendor",
   "selector": ".odl-vendor",
   "what": "who the bill is from, the panel's one heading",
   "slot": "text"
  },
  {
   "name": "status",
   "selector": ".odl-badge",
   "what": "how many approvals are in",
   "slot": "text"
  },
  {
   "name": "amount",
   "selector": ".odl-amount",
   "what": "the bill amount, with cents and currency set smaller",
   "slot": "number"
  },
  {
   "name": "due",
   "selector": ".odl-due",
   "what": "due date, days left and payment terms",
   "slot": "text"
  },
  {
   "name": "policy",
   "selector": ".odl-policy",
   "what": "the rule that applies, after a warning icon",
   "slot": "rich"
  },
  {
   "name": "steps",
   "selector": "ol > li",
   "what": "one approval step: done, now or next",
   "slot": "list"
  },
  {
   "name": "effect",
   "selector": "dl > div",
   "what": "one line of the balance after paying; the last is the total",
   "slot": "list"
  },
  {
   "name": "reject",
   "selector": ".odl-reject",
   "what": "the secondary action",
   "slot": "action"
  },
  {
   "name": "approve",
   "selector": ".odl-approve",
   "what": "the main action",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "vendor",
   "amount",
   "currency",
   "steps",
   "actions"
  ],
  "properties": {
   "vendor": {
    "type": "string",
    "maxLength": 40,
    "part": "vendor"
   },
   "status": {
    "type": "string",
    "maxLength": 20,
    "part": "status"
   },
   "amount": {
    "type": "number",
    "part": "amount"
   },
   "currency": {
    "type": "string",
    "maxLength": 3,
    "part": "amount"
   },
   "due": {
    "type": "string",
    "maxLength": 40,
    "part": "due"
   },
   "policy": {
    "type": "string",
    "maxLength": 140,
    "part": "policy"
   },
   "steps": {
    "type": "array",
    "minItems": 2,
    "maxItems": 6,
    "part": "steps",
    "items": {
     "type": "object",
     "required": [
      "label",
      "state"
     ],
     "properties": {
      "label": {
       "type": "string",
       "maxLength": 48
      },
      "when": {
       "type": "string",
       "maxLength": 16
      },
      "state": {
       "enum": [
        "done",
        "now",
        "next"
       ]
      }
     }
    }
   },
   "effect": {
    "type": "array",
    "minItems": 2,
    "maxItems": 5,
    "part": "effect",
    "items": {
     "type": "object",
     "required": [
      "label",
      "value"
     ],
     "properties": {
      "label": {
       "type": "string",
       "maxLength": 28
      },
      "value": {
       "type": "string",
       "maxLength": 16
      }
     }
    }
   },
   "actions": {
    "type": "object",
    "required": [
     "approve"
    ],
    "properties": {
     "approve": {
      "type": "string",
      "maxLength": 16,
      "part": "approve"
     },
     "reject": {
      "type": "string",
      "maxLength": 16,
      "part": "reject"
     }
    }
   }
  }
 },
 "states": {
  "shown": [
   "hover",
   "pressed",
   "focus",
   "step done",
   "current step",
   "next step"
  ],
  "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 approving fails, keep the panel, re-enable the buttons and put an alert-banners line above the actions"
   },
   "disabled": {
    "status": "not_built",
    "how": "after the person approves, set disabled on both buttons and mark the current step done"
   },
   "overflow": {
    "status": "handled",
    "how": "in a narrow box the side column moves under the main one",
    "evidence": "@container (max-width: 30rem)"
   },
   "long_text": {
    "status": "handled",
    "how": "vendor and step labels wrap; dates, amounts and the badge never wrap",
    "evidence": "white-space: nowrap"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-border-width-emphasis",
  "--ds-color-bg-action-primary",
  "--ds-color-bg-action-primary-hover",
  "--ds-color-bg-action-primary-pressed",
  "--ds-color-bg-danger-subtle",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-bg-success-bold",
  "--ds-color-bg-warning-subtle",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-subtle",
  "--ds-color-icon-on-accent",
  "--ds-color-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-danger",
  "--ds-color-text-on-action",
  "--ds-color-text-on-success",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-color-text-warning",
  "--ds-elevation-raised",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-font-weight-heading",
  "--ds-font-weight-label",
  "--ds-icon-stroke-lg",
  "--ds-icon-stroke-md",
  "--ds-motion-duration-short",
  "--ds-motion-easing-standard",
  "--ds-radius-container",
  "--ds-radius-control",
  "--ds-radius-full",
  "--ds-radius-nested",
  "--ds-size-control-md",
  "--ds-size-icon-md",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-2",
  "--ds-space-inline-md",
  "--ds-space-inline-sm",
  "--ds-space-inline-xs",
  "--ds-space-inset-lg",
  "--ds-space-inset-md",
  "--ds-space-inset-sm",
  "--ds-space-inset-xl",
  "--ds-space-stack-lg",
  "--ds-space-stack-md",
  "--ds-space-stack-sm",
  "--ds-space-stack-xl",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-body-sm",
  "--ds-text-headline-sm",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-label-md-tracking",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "The steps are an ordered list with the current one marked aria-current; both actions are real buttons with visible focus.",
  "roles": [
   "list",
   "region"
  ],
  "keyboard": [
   "Tab reaches Reject, then Approve",
   "Enter or Space presses the focused button"
  ],
  "controls": {
   "button": 2,
   "input": 0,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/approval-panel/component.html",
  "bytes": 12474,
  "script": false
 },
 "source": "brand/showcase/product/02-fennick-approvals",
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/approval-panel.html",
  "json": "https://opendesigner.dev/library/approval-panel.json",
  "page": "https://opendesigner.dev/library/approval-panel/"
 },
 "get": {
  "curl": "curl -fsSLo approval-panel.html https://opendesigner.dev/library/approval-panel.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add approval-panel --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component approval-panel to this project: https://opendesigner.dev/library/approval-panel.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
