{
 "id": "confirm-dialog",
 "name": "Confirm dialog",
 "purpose": "A destructive confirmation shown open: what will be deleted, what happens next, and a typed workspace name that unlocks the red Delete button. Placement and the backdrop are the project's.",
 "use_when": [
  "before an action that cannot be undone, such as deleting data",
  "deleting several records at once, where listing them lets the person check what goes before they type to confirm"
 ],
 "avoid_when": [
  "a reversible action: act at once and offer Undo in toast-stack",
  "an approval decision with money and policy context: use approval-panel",
  "editing or reading a record beside a list: use detail-drawer"
 ],
 "type": "overlay",
 "style": "quiet",
 "width": "narrow",
 "tags": {
  "audience": "work",
  "industries": [
   "saas",
   "finance",
   "any"
  ],
  "keywords": [
   "dialog",
   "modal",
   "confirm",
   "delete",
   "destructive"
  ]
 },
 "root": ".odl-confirm-dialog",
 "parts": [
  {
   "name": "mark",
   "selector": ".odl-mark",
   "what": "a warning icon in a red circle",
   "slot": "none"
  },
  {
   "name": "title",
   "selector": "h2",
   "what": "the question, naming what will be deleted",
   "slot": "text"
  },
  {
   "name": "lede",
   "selector": ".odl-lede",
   "what": "what happens next and that it cannot be undone",
   "slot": "text"
  },
  {
   "name": "items",
   "selector": "li",
   "what": "one thing to be deleted: name, a small date, and an amount",
   "slot": "list"
  },
  {
   "name": "confirm_label",
   "selector": "label",
   "what": "the instruction, with the exact text to type in code",
   "slot": "rich"
  },
  {
   "name": "confirm_input",
   "selector": "input",
   "what": "where the person types the name",
   "slot": "input"
  },
  {
   "name": "hint",
   "selector": ".odl-hint",
   "what": "where to find the name",
   "slot": "text"
  },
  {
   "name": "cancel",
   "selector": ".odl-cancel",
   "what": "the safe way out",
   "slot": "action"
  },
  {
   "name": "delete",
   "selector": ".odl-delete",
   "what": "the red action, unlocked by a matching name",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "title",
   "lede",
   "confirm_text",
   "delete_label"
  ],
  "properties": {
   "title": {
    "type": "string",
    "maxLength": 48,
    "part": "title"
   },
   "lede": {
    "type": "string",
    "maxLength": 220,
    "part": "lede"
   },
   "items": {
    "type": "array",
    "minItems": 0,
    "maxItems": 5,
    "part": "items",
    "items": {
     "type": "object",
     "required": [
      "name"
     ],
     "properties": {
      "name": {
       "type": "string",
       "maxLength": 40
      },
      "note": {
       "type": "string",
       "maxLength": 12
      },
      "value": {
       "type": "string",
       "maxLength": 14
      }
     }
    }
   },
   "items_label": {
    "type": "string",
    "maxLength": 40,
    "part": "items"
   },
   "confirm_text": {
    "type": "string",
    "maxLength": 40,
    "part": "confirm_label"
   },
   "hint": {
    "type": "string",
    "maxLength": 80,
    "part": "hint"
   },
   "cancel_label": {
    "type": "string",
    "maxLength": 16,
    "part": "cancel"
   },
   "delete_label": {
    "type": "string",
    "maxLength": 24,
    "part": "delete"
   }
  }
 },
 "states": {
  "shown": [
   "open",
   "delete disabled",
   "delete enabled",
   "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 deleting fails, keep the dialog open, re-enable the buttons and add an alert-banners line above the footer"
   },
   "disabled": {
    "status": "handled",
    "how": "Delete stays disabled, pale red with a not-allowed cursor, until the typed text matches; the sample is pre-typed, so it opens enabled",
    "evidence": "del.disabled = input.value.trim() !== want"
   },
   "overflow": {
    "status": "handled",
    "how": "in a narrow box the buttons stack full width with Delete on top; the item list has no height limit, so keep it to a few lines",
    "evidence": "@container (max-width: 26rem)"
   },
   "long_text": {
    "status": "handled",
    "how": "a long item name ends in an ellipsis and the amount never wraps; a long name to type breaks anywhere",
    "evidence": "text-overflow: ellipsis; white-space: nowrap"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-color-bg-danger-bold",
  "--ds-color-bg-danger-bold-hover",
  "--ds-color-bg-danger-bold-pressed",
  "--ds-color-bg-danger-subtle",
  "--ds-color-bg-field",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-border-danger",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-input",
  "--ds-color-border-subtle",
  "--ds-color-surface-overlay",
  "--ds-color-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-danger",
  "--ds-color-text-on-danger",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-elevation-overlay",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-font-size-input",
  "--ds-font-weight-label",
  "--ds-icon-stroke-md",
  "--ds-motion-duration-short",
  "--ds-motion-easing-hover",
  "--ds-radius-control",
  "--ds-radius-detail",
  "--ds-radius-full",
  "--ds-radius-nested",
  "--ds-radius-overlay",
  "--ds-size-control-lg",
  "--ds-size-control-md",
  "--ds-size-icon-md",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-4",
  "--ds-space-inline-md",
  "--ds-space-inline-sm",
  "--ds-space-inset-lg",
  "--ds-space-inset-md",
  "--ds-space-inset-xl",
  "--ds-space-inset-xs",
  "--ds-space-stack-lg",
  "--ds-space-stack-md",
  "--ds-space-stack-sm",
  "--ds-text-body-md",
  "--ds-text-code-md",
  "--ds-text-code-sm",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "An alertdialog labelled by its title and described by its sentence; the input has a visible label and hint, Delete stays a disabled native button until the typed name matches, and Enter confirms once it does.",
  "roles": [
   "alertdialog",
   "contentinfo",
   "list"
  ],
  "keyboard": [
   "Tab reaches the text box, then Cancel, then Delete when it is enabled",
   "Enter in the text box presses Delete once the typed text matches",
   "Enter or Space presses the focused button",
   "the file has no Escape handling or focus trap; the project's dialog code must add them"
  ],
  "controls": {
   "button": 2,
   "input": 1,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/confirm-dialog/component.html",
  "bytes": 9728,
  "script": true
 },
 "source": null,
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/confirm-dialog.html",
  "json": "https://opendesigner.dev/library/confirm-dialog.json",
  "page": "https://opendesigner.dev/library/confirm-dialog/"
 },
 "get": {
  "curl": "curl -fsSLo confirm-dialog.html https://opendesigner.dev/library/confirm-dialog.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add confirm-dialog --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component confirm-dialog to this project: https://opendesigner.dev/library/confirm-dialog.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
