{
 "id": "event-card",
 "name": "Event card",
 "purpose": "One event to go to: a photo, the name, the date and venue, the price with its currency, and how many seats are left as a status (sold out is never green), with a button to choose seats.",
 "use_when": [
  "when someone asks what is on, or about one event",
  "one event with a date, a place and tickets"
 ],
 "avoid_when": [
  "a ticket already bought, with seat and code: use event-ticket",
  "several events: use result-list"
 ],
 "type": "commerce",
 "style": "friendly",
 "width": "medium",
 "tags": {
  "audience": "consumer",
  "industries": [
   "events",
   "media",
   "travel",
   "any"
  ],
  "keywords": [
   "event",
   "tickets",
   "photo",
   "availability",
   "card"
  ]
 },
 "root": ".odl-event-card",
 "parts": [
  {
   "name": "photo",
   "selector": ".odl-ph .odl-img",
   "what": "a photo of the event or the place",
   "slot": "media"
  },
  {
   "name": "kicker",
   "selector": ".odl-kicker",
   "what": "the kind of event",
   "slot": "text"
  },
  {
   "name": "title",
   "selector": ".odl-event-card h3",
   "what": "the event's name",
   "slot": "text"
  },
  {
   "name": "facts",
   "selector": ".odl-facts",
   "what": "date and time, and the venue",
   "slot": "text"
  },
  {
   "name": "status",
   "selector": ".odl-status",
   "what": "seats or tickets left, coloured by what it says",
   "slot": "text"
  },
  {
   "name": "price",
   "selector": ".odl-price",
   "what": "the price with its currency, and a note",
   "slot": "number"
  },
  {
   "name": "tickets",
   "selector": ".odl-btn",
   "what": "the main action: choose seats or tickets",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "photo",
   "title",
   "date",
   "venue",
   "price"
  ],
  "properties": {
   "photo": {
    "type": "object",
    "part": "photo",
    "required": [
     "src",
     "alt"
    ],
    "properties": {
     "src": {
      "type": "string",
      "maxLength": 2048
     },
     "alt": {
      "type": "string",
      "maxLength": 200
     },
     "width": {
      "type": "integer"
     },
     "height": {
      "type": "integer"
     },
     "ratio": {
      "type": "string",
      "maxLength": 12
     },
     "credit": {
      "type": "string",
      "maxLength": 120
     }
    }
   },
   "kicker": {
    "type": "string",
    "maxLength": 30,
    "part": "kicker"
   },
   "title": {
    "type": "string",
    "maxLength": 60,
    "part": "title"
   },
   "date": {
    "type": "string",
    "maxLength": 40,
    "part": "facts"
   },
   "venue": {
    "type": "string",
    "maxLength": 60,
    "part": "facts"
   },
   "status": {
    "type": "string",
    "maxLength": 30,
    "part": "status"
   },
   "tone": {
    "type": "string",
    "enum": [
     "neutral",
     "success",
     "warning",
     "danger"
    ],
    "part": "status"
   },
   "price": {
    "type": "string",
    "maxLength": 20,
    "part": "price"
   },
   "price_note": {
    "type": "string",
    "maxLength": 40,
    "part": "price"
   }
  }
 },
 "states": {
  "shown": [
   "seats left",
   "few left",
   "sold out",
   "photo beside when wide",
   "stacked when narrow",
   "hover",
   "focus",
   "disabled"
  ],
  "edge": {
   "empty": {
    "status": "not_built",
    "how": "without an event, answer in text"
   },
   "loading": {
    "status": "handled",
    "how": "the photo box keeps its 16:9 shape on the sunken surface and pulses quietly until the photo arrives",
    "evidence": "aspect-ratio: 16 / 9"
   },
   "error": {
    "status": "handled",
    "how": "a photo that fails keeps its box, with an icon and the photo's description",
    "evidence": "class=\"odl-img\""
   },
   "disabled": {
    "status": "shown",
    "how": "when it is sold out the app sends the button disabled; it turns quiet neutral, still readable",
    "evidence": ".odl-btn:disabled"
   },
   "overflow": {
    "status": "handled",
    "how": "in a narrow container the photo goes on top and the price and button wrap",
    "evidence": "@container (min-width: 36rem)"
   },
   "long_text": {
    "status": "handled",
    "how": "the name and lines wrap, long words break",
    "evidence": "overflow-wrap: anywhere"
   },
   "missing_image": {
    "status": "handled",
    "evidence": "data-od-media",
    "how": "the Smart UI renderer swaps a photo that fails to load for a calm tile of the same shape with an icon and its alt text"
   }
  }
 },
 "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-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-danger",
  "--ds-color-text-on-action",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-success",
  "--ds-color-text-warning",
  "--ds-elevation-raised",
  "--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-standard",
  "--ds-radius-container",
  "--ds-radius-control",
  "--ds-radius-full",
  "--ds-size-control-md",
  "--ds-size-control-sm",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-6",
  "--ds-space-inline-md",
  "--ds-space-inline-sm",
  "--ds-space-inset-lg",
  "--ds-space-inset-sm",
  "--ds-space-inset-xl",
  "--ds-space-stack-sm",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-body-sm",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "An article named by the event; date and venue are read with their labels, and seats left is words as well as colour.",
  "roles": [
   "article",
   "list"
  ],
  "keyboard": [
   "Tab reaches the button",
   "Enter or Space presses it"
  ],
  "controls": {
   "button": 1,
   "input": 0,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/event-card/component.html",
  "bytes": 8827,
  "script": false
 },
 "source": null,
 "photos": 1,
 "urls": {
  "html": "https://opendesigner.dev/library/event-card.html",
  "json": "https://opendesigner.dev/library/event-card.json",
  "page": "https://opendesigner.dev/library/event-card/"
 },
 "get": {
  "curl": "curl -fsSLo event-card.html https://opendesigner.dev/library/event-card.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add event-card --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component event-card to this project: https://opendesigner.dev/library/event-card.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
