{
 "id": "alert-banners",
 "name": "Alert banners",
 "purpose": "Four inline notices (info, success, warning and danger), each with a bold first phrase, one sentence, an optional action and a dismiss button.",
 "use_when": [
  "for telling people something about the page they are on, from a tip to a failure",
  "a stack of page-level notices of mixed urgency, each with its own fix and a way to dismiss it"
 ],
 "avoid_when": [
  "a short confirmation after an action that should go away on its own: use toast-stack",
  "a page with nothing to show yet: use empty-state",
  "a question the person must answer before going on: use confirm-dialog"
 ],
 "type": "feedback",
 "style": "quiet",
 "width": "medium",
 "tags": {
  "audience": "work",
  "industries": [
   "any"
  ],
  "keywords": [
   "alert",
   "banner",
   "notice",
   "callout",
   "status"
  ]
 },
 "root": ".odl-alert-banners",
 "parts": [
  {
   "name": "notices",
   "selector": ".odl-alert-banners li",
   "what": "one notice, toned info, success, warning or danger",
   "slot": "list"
  },
  {
   "name": "icon",
   "selector": ".odl-icon",
   "what": "the tone's icon in a tinted circle",
   "slot": "none"
  },
  {
   "name": "message",
   "selector": ".odl-body p",
   "what": "a bold first phrase, then one sentence",
   "slot": "rich"
  },
  {
   "name": "actions",
   "selector": ".odl-act",
   "what": "zero to two buttons that fix or explain the notice; one may be the strong danger button",
   "slot": "action"
  },
  {
   "name": "dismiss",
   "selector": ".odl-close",
   "what": "an icon button that hides the notice",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "notices"
  ],
  "properties": {
   "label": {
    "type": "string",
    "maxLength": 32
   },
   "notices": {
    "type": "array",
    "minItems": 1,
    "maxItems": 5,
    "part": "notices",
    "items": {
     "type": "object",
     "required": [
      "tone",
      "title"
     ],
     "properties": {
      "tone": {
       "enum": [
        "info",
        "success",
        "warning",
        "danger"
       ]
      },
      "title": {
       "type": "string",
       "maxLength": 60,
       "part": "message"
      },
      "body": {
       "type": "string",
       "maxLength": 160,
       "part": "message"
      },
      "actions": {
       "type": "array",
       "minItems": 0,
       "maxItems": 2,
       "part": "actions",
       "items": {
        "type": "object",
        "required": [
         "label"
        ],
        "properties": {
         "label": {
          "type": "string",
          "maxLength": 24
         },
         "strong": {
          "type": "boolean"
         }
        }
       }
      },
      "dismissible": {
       "type": "boolean",
       "part": "dismiss"
      }
     }
    }
   }
  }
 },
 "states": {
  "shown": [
   "info",
   "success",
   "warning",
   "danger",
   "hover",
   "focus",
   "dismissed"
  ],
  "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": "shown",
    "how": "the danger notice is the error form, announced at once as an alert, with a strong fix button",
    "evidence": "role=\"alert\""
   },
   "disabled": {
    "status": "not_built",
    "how": "while an action runs, set disabled on its button and add a :disabled style in the muted text colour"
   },
   "overflow": {
    "status": "handled",
    "how": "action buttons wrap to a new line, and in a narrow box each takes the full width",
    "evidence": ".odl-alert-banners .odl-acts button { flex: 1 1 100%; }"
   },
   "long_text": {
    "status": "handled",
    "how": "the message column can shrink and wraps; button labels never wrap",
    "evidence": "minmax(0, 1fr) auto"
   },
   "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-subtle",
  "--ds-color-bg-info-subtle",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-bg-success-subtle",
  "--ds-color-bg-warning-subtle",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-subtle",
  "--ds-color-icon-subtle",
  "--ds-color-surface-raised",
  "--ds-color-text-danger",
  "--ds-color-text-info",
  "--ds-color-text-on-danger",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-success",
  "--ds-color-text-warning",
  "--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-container",
  "--ds-radius-control",
  "--ds-radius-full",
  "--ds-size-control-sm",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-inline-md",
  "--ds-space-inline-sm",
  "--ds-space-inline-xs",
  "--ds-space-inset-lg",
  "--ds-space-inset-sm",
  "--ds-space-inset-xl",
  "--ds-space-inset-xs",
  "--ds-space-stack-md",
  "--ds-space-stack-sm",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-label-lg"
 ],
 "a11y": {
  "summary": "Info, success and warning use role status and the danger notice uses role alert; actions and dismiss are real buttons, and dismissing moves focus to the next notice.",
  "roles": [
   "alert",
   "list",
   "status"
  ],
  "keyboard": [
   "Tab reaches each notice's action buttons, then its Dismiss button, notice by notice",
   "Enter or Space presses the focused button",
   "Dismissing a notice moves focus to the Dismiss button of the next notice, or the previous one if it was last"
  ],
  "controls": {
   "button": 11,
   "input": 0,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/alert-banners/component.html",
  "bytes": 10846,
  "script": true
 },
 "source": null,
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/alert-banners.html",
  "json": "https://opendesigner.dev/library/alert-banners.json",
  "page": "https://opendesigner.dev/library/alert-banners/"
 },
 "get": {
  "curl": "curl -fsSLo alert-banners.html https://opendesigner.dev/library/alert-banners.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add alert-banners --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component alert-banners to this project: https://opendesigner.dev/library/alert-banners.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
