{
 "id": "detail-drawer",
 "name": "Detail drawer",
 "purpose": "A side sheet for one record shown open: name, status, previous and next, the key fields, an attachment and a sticky footer with the two decisions. Where it slides in from is the project's.",
 "use_when": [
  "to open one record from a list without leaving the list",
  "stepping through a queue of records one by one, with previous and next, while the list stays in view"
 ],
 "avoid_when": [
  "a short yes-or-no question with no record behind it: use confirm-dialog",
  "the decision needs the approval steps and the balance effect laid out: use approval-panel",
  "a cart or checkout side sheet: use cart-drawer"
 ],
 "type": "overlay",
 "style": "quiet",
 "width": "narrow",
 "tags": {
  "audience": "work",
  "industries": [
   "finance",
   "saas",
   "crm"
  ],
  "keywords": [
   "drawer",
   "side sheet",
   "panel",
   "details",
   "record"
  ]
 },
 "root": ".odl-detail-drawer",
 "parts": [
  {
   "name": "title",
   "selector": "h2",
   "what": "the record's name, on one line",
   "slot": "text"
  },
  {
   "name": "position",
   "selector": ".odl-pos",
   "what": "where this record sits in the list, such as '5 of 14'",
   "slot": "text"
  },
  {
   "name": "nav",
   "selector": ".odl-nav .odl-icon-btn",
   "what": "previous, next and close icon buttons",
   "slot": "action"
  },
  {
   "name": "status",
   "selector": ".odl-pill",
   "what": "the record's status chip",
   "slot": "text"
  },
  {
   "name": "amount",
   "selector": ".odl-amount",
   "what": "the headline amount, with cents and currency set smaller",
   "slot": "number"
  },
  {
   "name": "subtitle",
   "selector": ".odl-sub",
   "what": "one or two short lines under the amount: due date, what happens next",
   "slot": "list"
  },
  {
   "name": "fields",
   "selector": "dl > div",
   "what": "one label and value pair",
   "slot": "list"
  },
  {
   "name": "person",
   "selector": ".odl-person img",
   "what": "a small round photo beside a person's name in a field",
   "slot": "media"
  },
  {
   "name": "file",
   "selector": ".odl-file",
   "what": "the attachment: name, type and size, and an open button",
   "slot": "rich"
  },
  {
   "name": "reject",
   "selector": ".odl-secondary",
   "what": "the secondary, danger-coloured decision",
   "slot": "action"
  },
  {
   "name": "approve",
   "selector": ".odl-primary",
   "what": "the main decision",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "title",
   "fields"
  ],
  "properties": {
   "title": {
    "type": "string",
    "maxLength": 32,
    "part": "title"
   },
   "position": {
    "type": "string",
    "maxLength": 12,
    "part": "position"
   },
   "status": {
    "type": "string",
    "maxLength": 24,
    "part": "status"
   },
   "amount": {
    "type": "number",
    "part": "amount"
   },
   "currency": {
    "type": "string",
    "maxLength": 3,
    "part": "amount"
   },
   "subtitle": {
    "type": "array",
    "minItems": 0,
    "maxItems": 2,
    "part": "subtitle",
    "items": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "maxLength": 60
      }
     }
    }
   },
   "fields": {
    "type": "array",
    "minItems": 2,
    "maxItems": 10,
    "part": "fields",
    "items": {
     "type": "object",
     "required": [
      "label",
      "value"
     ],
     "properties": {
      "label": {
       "type": "string",
       "maxLength": 16
      },
      "value": {
       "type": "string",
       "maxLength": 48
      },
      "note": {
       "type": "string",
       "maxLength": 20
      },
      "photo": {
       "type": "string",
       "maxLength": 300
      }
     }
    }
   },
   "file": {
    "type": "object",
    "part": "file",
    "required": [
     "name"
    ],
    "properties": {
     "name": {
      "type": "string",
      "maxLength": 60
     },
     "meta": {
      "type": "string",
      "maxLength": 36
     }
    }
   },
   "actions": {
    "type": "object",
    "properties": {
     "approve": {
      "type": "string",
      "maxLength": 14,
      "part": "approve"
     },
     "reject": {
      "type": "string",
      "maxLength": 14,
      "part": "reject"
     }
    }
   },
   "file_name": {
    "type": "string",
    "maxLength": 80
   },
   "file_meta": {
    "type": "string",
    "maxLength": 80
   }
  }
 },
 "states": {
  "shown": [
   "open",
   "hover",
   "pressed",
   "focus"
  ],
  "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 the record fails to load or a decision fails, put an alert-banners line at the top of the body and keep the footer"
   },
   "disabled": {
    "status": "not_built",
    "how": "on the first or last record, set disabled on the previous or next button; after a decision, disable both footer buttons"
   },
   "overflow": {
    "status": "handled",
    "how": "the body scrolls on its own between the fixed header and the sticky footer",
    "evidence": "flex: 1 1 auto; overflow: auto"
   },
   "long_text": {
    "status": "handled",
    "how": "the title and file name are cut with an ellipsis; field values break anywhere rather than overflow",
    "evidence": "overflow-wrap: anywhere"
   },
   "missing_image": {
    "status": "not_built",
    "how": "a photo that fails to load shows the browser's broken image"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--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-warning-subtle",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-subtle",
  "--ds-color-icon-default",
  "--ds-color-surface-overlay",
  "--ds-color-surface-raised",
  "--ds-color-text-danger",
  "--ds-color-text-on-action",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-color-text-warning",
  "--ds-elevation-overlay",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-font-weight-heading",
  "--ds-font-weight-label",
  "--ds-icon-stroke-md",
  "--ds-motion-duration-short",
  "--ds-motion-easing-hover",
  "--ds-radius-control",
  "--ds-radius-control-sm",
  "--ds-radius-full",
  "--ds-radius-nested",
  "--ds-radius-overlay",
  "--ds-size-control-md",
  "--ds-size-control-sm",
  "--ds-size-icon-lg",
  "--ds-size-icon-md",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-2",
  "--ds-space-6",
  "--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-inset-xs",
  "--ds-space-stack-lg",
  "--ds-space-stack-sm",
  "--ds-space-stack-xl",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-code-md",
  "--ds-text-headline-sm",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "A labelled dialog region; every icon button (previous, next, close, open file) has an accessible name, fields are a description list, and the footer actions are real buttons.",
  "roles": [
   "banner",
   "complementary",
   "contentinfo",
   "dialog"
  ],
  "keyboard": [
   "Tab moves through Previous, Next and Close, the open-file button, then Reject and Approve",
   "Enter or Space presses the focused button",
   "The file has no script: Esc does not close it and Previous and Next do nothing until wired"
  ],
  "controls": {
   "button": 6,
   "input": 0,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/detail-drawer/component.html",
  "bytes": 13847,
  "script": false
 },
 "source": "brand/showcase/product/02-fennick-approvals",
 "photos": 1,
 "urls": {
  "html": "https://opendesigner.dev/library/detail-drawer.html",
  "json": "https://opendesigner.dev/library/detail-drawer.json",
  "page": "https://opendesigner.dev/library/detail-drawer/"
 },
 "get": {
  "curl": "curl -fsSLo detail-drawer.html https://opendesigner.dev/library/detail-drawer.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add detail-drawer --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component detail-drawer to this project: https://opendesigner.dev/library/detail-drawer.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
