{
 "id": "receipts-table",
 "name": "Selectable table",
 "purpose": "A dense table with row checkboxes, status pills and a bar of bulk actions that appears, with a live count, as soon as a row is picked.",
 "use_when": [
  "for dense lists people review and act on in bulk",
  "matching bank lines, invoices or shipments where each row has a status and several rows get the same action"
 ],
 "avoid_when": [
  "one item that needs a decision with its policy and steps: use approval-panel",
  "a read-only history of changes: use audit-log",
  "a short list with no bulk actions: use activity-list"
 ],
 "type": "data",
 "style": "dense",
 "width": "wide",
 "tags": {
  "audience": "work",
  "industries": [
   "finance",
   "logistics",
   "saas"
  ],
  "keywords": [
   "table",
   "bulk actions",
   "selection",
   "status",
   "reconciliation"
  ]
 },
 "root": ".odl-receipts-table",
 "parts": [
  {
   "name": "title",
   "selector": "h3",
   "what": "the table's heading",
   "slot": "text"
  },
  {
   "name": "summary",
   "selector": ".odl-top p",
   "what": "how many rows, where from, and their total",
   "slot": "text"
  },
  {
   "name": "columns",
   "selector": "th",
   "what": "column headers: select, customer, reference, amount, match",
   "slot": "list"
  },
  {
   "name": "rows",
   "selector": "tbody tr",
   "what": "one row: checkbox, customer, reference, amount and status",
   "slot": "list"
  },
  {
   "name": "select",
   "selector": "tbody input",
   "what": "a checkbox named after its row",
   "slot": "input"
  },
  {
   "name": "reference",
   "selector": ".odl-ref",
   "what": "the other side's reference, in code type; hidden in a narrow box",
   "slot": "text"
  },
  {
   "name": "amount",
   "selector": ".odl-num",
   "what": "the amount, right-aligned, with its currency",
   "slot": "number"
  },
  {
   "name": "status",
   "selector": ".odl-pill",
   "what": "the row's match status as a coloured pill with a word",
   "slot": "text"
  },
  {
   "name": "bulk_count",
   "selector": ".odl-bulk output",
   "what": "how many rows are picked; updates as rows are ticked",
   "slot": "text"
  },
  {
   "name": "bulk_secondary",
   "selector": ".odl-bulk button",
   "what": "the secondary bulk action",
   "slot": "action"
  },
  {
   "name": "bulk_primary",
   "selector": ".odl-go",
   "what": "the main bulk action",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "rows",
   "actions"
  ],
  "properties": {
   "title": {
    "type": "string",
    "maxLength": 40,
    "part": "title"
   },
   "summary": {
    "type": "string",
    "maxLength": 60,
    "part": "summary"
   },
   "rows": {
    "type": "array",
    "minItems": 1,
    "maxItems": 25,
    "part": "rows",
    "items": {
     "type": "object",
     "required": [
      "name",
      "amount",
      "status"
     ],
     "properties": {
      "name": {
       "type": "string",
       "maxLength": 28
      },
      "reference": {
       "type": "string",
       "maxLength": 22,
       "part": "reference"
      },
      "amount": {
       "type": "string",
       "maxLength": 14,
       "part": "amount"
      },
      "currency": {
       "type": "string",
       "maxLength": 3,
       "part": "amount"
      },
      "status": {
       "enum": [
        "matched",
        "suggested",
        "short",
        "none"
       ],
       "part": "status"
      },
      "status_label": {
       "type": "string",
       "maxLength": 14,
       "part": "status"
      },
      "selected": {
       "type": "boolean",
       "part": "select"
      },
      "key": {
       "type": "string",
       "maxLength": 40
      }
     }
    }
   },
   "actions": {
    "type": "object",
    "required": [
     "primary"
    ],
    "properties": {
     "primary": {
      "type": "string",
      "maxLength": 20,
      "part": "bulk_primary"
     },
     "secondary": {
      "type": "string",
      "maxLength": 20,
      "part": "bulk_secondary"
     }
    }
   }
  }
 },
 "states": {
  "shown": [
   "hover",
   "selected",
   "no selection",
   "focus",
   "four statuses"
  ],
  "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 a bulk action fails, keep the rows ticked and show the reason in toast-stack or an alert-banners line above the table"
   },
   "disabled": {
    "status": "not_built",
    "how": "set disabled on the checkbox of a row that cannot be acted on and dim it; set disabled on both bulk buttons while an action runs"
   },
   "overflow": {
    "status": "handled",
    "how": "the table scrolls sideways in its own box when its columns do not fit, and in a narrow box each row becomes a stacked card",
    "evidence": ".odl-receipts-table .odl-scroll { overflow-x: auto;"
   },
   "long_text": {
    "status": "handled",
    "how": "cells never wrap in the table layout; in a narrow box they wrap and the bulk buttons end in an ellipsis",
    "evidence": "white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-border-width-emphasis",
  "--ds-color-bg-accent-subtle",
  "--ds-color-bg-action-primary",
  "--ds-color-bg-danger-subtle",
  "--ds-color-bg-field",
  "--ds-color-bg-inverse",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-bg-success-subtle",
  "--ds-color-bg-warning-subtle",
  "--ds-color-border-focus",
  "--ds-color-border-separator",
  "--ds-color-border-strong",
  "--ds-color-border-subtle",
  "--ds-color-neutral-alpha-dark-3",
  "--ds-color-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-danger",
  "--ds-color-text-inverse",
  "--ds-color-text-on-action",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-success",
  "--ds-color-text-tertiary",
  "--ds-color-text-warning",
  "--ds-elevation-floating",
  "--ds-elevation-raised",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-font-weight-label",
  "--ds-motion-duration-short",
  "--ds-motion-easing-standard",
  "--ds-radius-container",
  "--ds-radius-control-sm",
  "--ds-radius-detail",
  "--ds-radius-full",
  "--ds-radius-nested",
  "--ds-size-control-sm",
  "--ds-size-icon-sm",
  "--ds-size-row-md",
  "--ds-size-row-sm",
  "--ds-size-target-min",
  "--ds-space-2",
  "--ds-space-4",
  "--ds-space-6",
  "--ds-space-8",
  "--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-xs",
  "--ds-text-body-md",
  "--ds-text-code-sm",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-label-sm",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "Each checkbox is named after its row and has a 24 px target; the bulk bar is a labelled toolbar whose count is a polite live region; the table scrolls sideways in its own box on narrow screens.",
  "roles": [
   "table",
   "toolbar"
  ],
  "keyboard": [
   "Tab reaches each row's checkbox in turn, then the bulk buttons once a row is picked",
   "Space ticks or unticks the focused checkbox, and the bulk count updates",
   "Enter or Space presses the focused bulk button"
  ],
  "controls": {
   "button": 2,
   "input": 6,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/receipts-table/component.html",
  "bytes": 13780,
  "script": true
 },
 "source": "brand/showcase/product/01-quoin-payments",
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/receipts-table.html",
  "json": "https://opendesigner.dev/library/receipts-table.json",
  "page": "https://opendesigner.dev/library/receipts-table/"
 },
 "get": {
  "curl": "curl -fsSLo receipts-table.html https://opendesigner.dev/library/receipts-table.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add receipts-table --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component receipts-table to this project: https://opendesigner.dev/library/receipts-table.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
