{
 "id": "home-listing",
 "name": "Home listing",
 "purpose": "A home to rent or buy: up to three photos (one large, two beside it when there is room), the price with its currency, the address, bedrooms, bathrooms and floor area, its status (available, under offer, let agreed), and a button to book a viewing.",
 "use_when": [
  "when someone searching for a home asks about one listing",
  "one home with its photos, price and key facts"
 ],
 "avoid_when": [
  "a holiday rental by the night: use stay-card",
  "several homes: use result-list"
 ],
 "type": "commerce",
 "style": "friendly",
 "width": "medium",
 "tags": {
  "audience": "consumer",
  "industries": [
   "home",
   "any"
  ],
  "keywords": [
   "property",
   "listing",
   "photo",
   "price",
   "card"
  ]
 },
 "root": ".odl-home-listing",
 "parts": [
  {
   "name": "photos",
   "selector": ".odl-pics",
   "what": "up to three photos; the first is largest",
   "slot": "list"
  },
  {
   "name": "photo",
   "selector": ".odl-pics .odl-img",
   "what": "one photo of the home",
   "slot": "media"
  },
  {
   "name": "title",
   "selector": ".odl-home-listing h3",
   "what": "what the home is",
   "slot": "text"
  },
  {
   "name": "address",
   "selector": ".odl-where",
   "what": "the street and area",
   "slot": "text"
  },
  {
   "name": "price",
   "selector": ".odl-price",
   "what": "the price with its currency, and what it covers",
   "slot": "number"
  },
  {
   "name": "facts",
   "selector": ".odl-facts",
   "what": "bedrooms, bathrooms and floor area",
   "slot": "text"
  },
  {
   "name": "status",
   "selector": ".odl-status",
   "what": "available, under offer or let agreed, coloured by what it says",
   "slot": "text"
  },
  {
   "name": "viewing",
   "selector": ".odl-btn",
   "what": "the main action: book a viewing",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "photos",
   "title",
   "address",
   "price"
  ],
  "properties": {
   "photos": {
    "type": "array",
    "minItems": 1,
    "maxItems": 3,
    "part": "photos",
    "items": {
     "type": "object",
     "required": [
      "photo"
     ],
     "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
        }
       }
      }
     }
    }
   },
   "title": {
    "type": "string",
    "maxLength": 60,
    "part": "title"
   },
   "address": {
    "type": "string",
    "maxLength": 60,
    "part": "address"
   },
   "price": {
    "type": "string",
    "maxLength": 16,
    "part": "price"
   },
   "price_note": {
    "type": "string",
    "maxLength": 40,
    "part": "price"
   },
   "beds": {
    "type": "string",
    "maxLength": 16,
    "part": "facts"
   },
   "baths": {
    "type": "string",
    "maxLength": 16,
    "part": "facts"
   },
   "area": {
    "type": "string",
    "maxLength": 12,
    "part": "facts"
   },
   "status": {
    "type": "string",
    "maxLength": 32,
    "part": "status"
   },
   "tone": {
    "type": "string",
    "enum": [
     "neutral",
     "success",
     "warning",
     "danger"
    ],
    "part": "status"
   }
  }
 },
 "states": {
  "shown": [
   "available",
   "under offer",
   "let agreed",
   "one photo when narrow",
   "three photos when wide",
   "hover",
   "focus",
   "disabled"
  ],
  "edge": {
   "empty": {
    "status": "not_built",
    "how": "without a home, answer in text"
   },
   "loading": {
    "status": "handled",
    "how": "each photo box keeps its shape on the sunken surface and pulses quietly until the photo arrives",
    "evidence": "aspect-ratio: 4 / 3"
   },
   "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 viewings are closed the app sends the button disabled; it turns quiet neutral, still readable",
    "evidence": ".odl-btn:disabled"
   },
   "overflow": {
    "status": "handled",
    "how": "in a narrow container only the first photo shows and the price goes under the title",
    "evidence": "@container (min-width: 36rem)"
   },
   "long_text": {
    "status": "handled",
    "how": "the title and address 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-2",
  "--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-lg",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "An article named by the listing; the photos are a list, each with alt text, and the status is words as well as colour.",
  "roles": [
   "article",
   "list"
  ],
  "keyboard": [
   "Tab reaches Book a viewing",
   "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/home-listing/component.html",
  "bytes": 11144,
  "script": false
 },
 "source": null,
 "photos": 3,
 "urls": {
  "html": "https://opendesigner.dev/library/home-listing.html",
  "json": "https://opendesigner.dev/library/home-listing.json",
  "page": "https://opendesigner.dev/library/home-listing/"
 },
 "get": {
  "curl": "curl -fsSLo home-listing.html https://opendesigner.dev/library/home-listing.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add home-listing --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component home-listing to this project: https://opendesigner.dev/library/home-listing.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
