{
 "id": "place-card",
 "name": "Place card",
 "purpose": "One place in depth: a photo, the name and rating, area, price band and distance, whether it is open, why it fits what the person asked, the address, and a Get directions button. The photo sits beside the words when there is room.",
 "use_when": [
  "when an assistant recommends one place (\"where should I take my parents for lunch?\") or the person opens one from a list",
  "one recommended place, with why it fits"
 ],
 "avoid_when": [
  "three to five places to choose from: use place-list",
  "only the address and a map: use location-card"
 ],
 "type": "content",
 "style": "friendly",
 "width": "medium",
 "tags": {
  "audience": "consumer",
  "industries": [
   "food",
   "travel",
   "events",
   "any"
  ],
  "keywords": [
   "place",
   "recommendation",
   "photo",
   "rating",
   "card"
  ]
 },
 "root": ".odl-place-card",
 "parts": [
  {
   "name": "photo",
   "selector": ".odl-ph .odl-img",
   "what": "a photo of the place",
   "slot": "media"
  },
  {
   "name": "rating",
   "selector": ".odl-rate",
   "what": "the average rating out of 5 and how many reviews",
   "slot": "number"
  },
  {
   "name": "meta",
   "selector": ".odl-meta",
   "what": "the area, the price band and how far it is",
   "slot": "text"
  },
  {
   "name": "status",
   "selector": ".odl-status",
   "what": "open now, closing soon or fully booked, coloured by the data's meaning",
   "slot": "text"
  },
  {
   "name": "name",
   "selector": ".odl-place-card h3",
   "what": "the place's name",
   "slot": "text"
  },
  {
   "name": "why",
   "selector": ".odl-fit",
   "what": "why it fits what the person asked for",
   "slot": "text"
  },
  {
   "name": "address",
   "selector": ".odl-where",
   "what": "the address or how to find it",
   "slot": "text"
  },
  {
   "name": "directions",
   "selector": ".odl-go",
   "what": "the main action: directions",
   "slot": "action"
  },
  {
   "name": "open",
   "selector": ".odl-acts button:not(.odl-go)",
   "what": "an optional quieter action (the menu, the website)",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "photo",
   "name",
   "area"
  ],
  "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
     }
    }
   },
   "name": {
    "type": "string",
    "maxLength": 40,
    "part": "name"
   },
   "rating": {
    "type": "number",
    "minimum": 0,
    "maximum": 5,
    "part": "rating"
   },
   "reviews": {
    "type": "string",
    "maxLength": 8,
    "part": "rating"
   },
   "area": {
    "type": "string",
    "maxLength": 32,
    "part": "meta"
   },
   "price_band": {
    "type": "string",
    "maxLength": 6,
    "part": "meta"
   },
   "distance": {
    "type": "string",
    "maxLength": 20,
    "part": "meta"
   },
   "why": {
    "type": "string",
    "maxLength": 140,
    "part": "why"
   },
   "status": {
    "type": "string",
    "maxLength": 28,
    "part": "status"
   },
   "tone": {
    "type": "string",
    "enum": [
     "neutral",
     "success",
     "warning",
     "danger"
    ],
    "part": "status"
   },
   "address": {
    "type": "string",
    "maxLength": 80,
    "part": "address"
   }
  }
 },
 "states": {
  "shown": [
   "open now",
   "closing soon",
   "fully booked",
   "no address",
   "hover",
   "focus",
   "photo on top when narrow",
   "photo beside when wide"
  ],
  "edge": {
   "empty": {
    "status": "not_built",
    "how": "without a place, answer in text; the card is only for one place"
   },
   "loading": {
    "status": "handled",
    "how": "the photo box keeps its shape on the sunken surface and pulses quietly until the photo arrives",
    "evidence": "aspect-ratio: 16 / 10"
   },
   "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": "a disabled button turns quiet neutral, still readable",
    "evidence": "button:disabled"
   },
   "overflow": {
    "status": "handled",
    "how": "in a narrow container the photo goes on top and the buttons wrap",
    "evidence": "@container (min-width: 34rem)"
   },
   "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-tertiary",
  "--ds-color-text-warning",
  "--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-full",
  "--ds-radius-nested",
  "--ds-size-control-md",
  "--ds-size-control-sm",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-2",
  "--ds-space-6",
  "--ds-space-inline-md",
  "--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-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 place; the rating is read as \"Rated 4.7 out of 5\", open or closed is words as well as colour, and both buttons are real buttons.",
  "roles": [
   "article"
  ],
  "keyboard": [
   "Tab reaches Get directions, then the second button when there is one",
   "Enter or Space presses it"
  ],
  "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/place-card/component.html",
  "bytes": 10788,
  "script": false
 },
 "source": null,
 "photos": 1,
 "urls": {
  "html": "https://opendesigner.dev/library/place-card.html",
  "json": "https://opendesigner.dev/library/place-card.json",
  "page": "https://opendesigner.dev/library/place-card/"
 },
 "get": {
  "curl": "curl -fsSLo place-card.html https://opendesigner.dev/library/place-card.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add place-card --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component place-card to this project: https://opendesigner.dev/library/place-card.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
