{
 "id": "file-card",
 "name": "File card",
 "purpose": "One file to download: an icon for its kind, the file name, its type and size, an optional date, Download and an optional Preview.",
 "use_when": [
  "when an answer hands over a file: a statement, an export, a signed contract or an image",
  "the assistant made or found one file the person can download, such as an export or a statement"
 ],
 "avoid_when": [
  "several files to pick from: use data-table",
  "the person must upload a file: use file-dropzone",
  "the content itself should be read here: use summary-card or code-block"
 ],
 "type": "content",
 "style": "quiet",
 "width": "medium",
 "tags": {
  "audience": "consumer",
  "industries": [
   "any"
  ],
  "keywords": [
   "file",
   "download",
   "attachment",
   "document",
   "export"
  ]
 },
 "root": ".odl-file-card",
 "parts": [
  {
   "name": "kind",
   "selector": ".odl-icon",
   "what": "an icon for the kind of file (pdf, sheet, image, doc, other)",
   "slot": "none"
  },
  {
   "name": "name",
   "selector": ".odl-file-card h3",
   "what": "the file name",
   "slot": "text"
  },
  {
   "name": "meta",
   "selector": ".odl-meta",
   "what": "type label, size and an optional date, separated by dots",
   "slot": "text"
  },
  {
   "name": "preview",
   "selector": ".odl-preview",
   "what": "an optional quiet Preview button",
   "slot": "action"
  },
  {
   "name": "download",
   "selector": ".odl-download",
   "what": "the primary Download button",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "name",
   "kind_label",
   "size",
   "download"
  ],
  "properties": {
   "kind": {
    "type": "string",
    "enum": [
     "pdf",
     "sheet",
     "image",
     "doc",
     "other"
    ],
    "part": "kind"
   },
   "name": {
    "type": "string",
    "maxLength": 80,
    "part": "name"
   },
   "kind_label": {
    "type": "string",
    "maxLength": 8,
    "part": "meta"
   },
   "size": {
    "type": "string",
    "maxLength": 12,
    "part": "meta"
   },
   "date": {
    "type": "string",
    "maxLength": 28,
    "part": "meta"
   },
   "preview": {
    "type": "object",
    "part": "preview",
    "properties": {
     "label": {
      "type": "string",
      "maxLength": 40
     },
     "event": {
      "type": "object"
     }
    },
    "required": [
     "label",
     "event"
    ]
   },
   "download": {
    "type": "object",
    "part": "download",
    "properties": {
     "label": {
      "type": "string",
      "maxLength": 40
     },
     "event": {
      "type": "object"
     }
    },
    "required": [
     "label",
     "event"
    ]
   }
  }
 },
 "states": {
  "shown": [
   "pdf",
   "sheet",
   "image",
   "doc",
   "other",
   "hover",
   "focus",
   "disabled"
  ],
  "edge": {
   "empty": {
    "status": "not_built",
    "how": "with no file to give, answer in text"
   },
   "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 file could not be made, use error-retry"
   },
   "disabled": {
    "status": "shown",
    "how": "a disabled or still-loading button turns quiet neutral (secondary text on a subtle fill), still readable at AA",
    "evidence": "button:disabled { cursor: not-allowed;"
   },
   "overflow": {
    "status": "handled",
    "how": "in a narrower box the buttons drop under the name and share the row",
    "evidence": "@container (max-width: 34rem)"
   },
   "long_text": {
    "status": "handled",
    "how": "long file names wrap anywhere, also names with no spaces",
    "evidence": "overflow-wrap: anywhere"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-color-bg-action-primary",
  "--ds-color-bg-action-primary-hover",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-subtle",
  "--ds-color-icon-default",
  "--ds-color-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-on-action",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-elevation-raised",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-font-weight-label",
  "--ds-icon-stroke-md",
  "--ds-motion-duration-short",
  "--ds-motion-easing-standard",
  "--ds-radius-container",
  "--ds-radius-control",
  "--ds-radius-nested",
  "--ds-size-control-lg",
  "--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-inset-lg",
  "--ds-space-inset-xl",
  "--ds-space-inset-xs",
  "--ds-space-stack-md",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-label-md-tracking",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "An article named by the file name; the kind icon is decorative because the type is also written, and Download and Preview are real buttons.",
  "roles": [
   "article"
  ],
  "keyboard": [
   "Tab reaches Preview, then Download",
   "Enter or Space presses either"
  ],
  "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/file-card/component.html",
  "bytes": 7353,
  "script": false
 },
 "source": null,
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/file-card.html",
  "json": "https://opendesigner.dev/library/file-card.json",
  "page": "https://opendesigner.dev/library/file-card/"
 },
 "get": {
  "curl": "curl -fsSLo file-card.html https://opendesigner.dev/library/file-card.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add file-card --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component file-card to this project: https://opendesigner.dev/library/file-card.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
