{
 "id": "plan-picker",
 "name": "Plan picker",
 "purpose": "Three plans as cards you select, with a monthly or yearly switch that changes the prices and one plan marked as the common choice.",
 "use_when": [
  "on a pricing or upgrade page",
  "an upgrade step inside a product, where the person picks a plan before going to checkout"
 ],
 "avoid_when": [
  "more than three plans, or a feature-by-feature comparison grid: the layout holds three cards side by side",
  "paying for the plan once chosen: use order-summary",
  "turning single add-ons on or off: use settings-toggles"
 ],
 "type": "commerce",
 "style": "friendly",
 "width": "wide",
 "tags": {
  "audience": "work",
  "industries": [
   "saas",
   "productivity",
   "education"
  ],
  "keywords": [
   "pricing",
   "plans",
   "billing",
   "radio cards",
   "upgrade"
  ]
 },
 "root": ".odl-plan-picker",
 "parts": [
  {
   "name": "title",
   "selector": "h3",
   "what": "the picker's heading",
   "slot": "text"
  },
  {
   "name": "period",
   "selector": ".odl-period label",
   "what": "one billing period choice, Monthly or Yearly, with an optional saving note",
   "slot": "input"
  },
  {
   "name": "plans",
   "selector": ".odl-plan",
   "what": "one plan as a selectable card: radio, name, price, who it is for and features",
   "slot": "list"
  },
  {
   "name": "name",
   "selector": ".odl-name",
   "what": "the plan's name",
   "slot": "text"
  },
  {
   "name": "tag",
   "selector": ".odl-tag",
   "what": "a note on the plan most people choose",
   "slot": "text"
  },
  {
   "name": "price",
   "selector": ".odl-price",
   "what": "the price for the chosen period, its unit, and the yearly total",
   "slot": "number"
  },
  {
   "name": "for",
   "selector": ".odl-for",
   "what": "one line on who the plan suits",
   "slot": "text"
  },
  {
   "name": "features",
   "selector": ".odl-plan li",
   "what": "one included feature, after a check",
   "slot": "list"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "plans"
  ],
  "properties": {
   "title": {
    "type": "string",
    "maxLength": 32,
    "part": "title"
   },
   "period": {
    "enum": [
     "month",
     "year"
    ],
    "part": "period"
   },
   "yearly_note": {
    "type": "string",
    "maxLength": 20,
    "part": "period"
   },
   "plans": {
    "type": "array",
    "minItems": 2,
    "maxItems": 3,
    "part": "plans",
    "items": {
     "type": "object",
     "required": [
      "id",
      "name",
      "price_month"
     ],
     "properties": {
      "id": {
       "type": "string",
       "maxLength": 24
      },
      "name": {
       "type": "string",
       "maxLength": 16,
       "part": "name"
      },
      "tag": {
       "type": "string",
       "maxLength": 24,
       "part": "tag"
      },
      "price_month": {
       "type": "string",
       "maxLength": 8,
       "part": "price"
      },
      "price_year": {
       "type": "string",
       "maxLength": 8,
       "part": "price"
      },
      "unit": {
       "type": "string",
       "maxLength": 24,
       "part": "price"
      },
      "billed_yearly": {
       "type": "string",
       "maxLength": 36,
       "part": "price"
      },
      "for": {
       "type": "string",
       "maxLength": 60,
       "part": "for"
      },
      "features": {
       "type": "array",
       "minItems": 1,
       "maxItems": 6,
       "part": "features",
       "items": {
        "type": "object",
        "required": [
         "text"
        ],
        "properties": {
         "text": {
          "type": "string",
          "maxLength": 32
         }
        }
       }
      },
      "selected": {
       "type": "boolean"
      }
     }
    }
   }
  }
 },
 "states": {
  "shown": [
   "selected",
   "hover",
   "focus",
   "monthly",
   "yearly"
  ],
  "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 prices cannot load, put an alert-banners line with a retry above the cards"
   },
   "disabled": {
    "status": "not_built",
    "how": "for the plan the person is already on, set disabled on its radio, dim the card and add a 'Current plan' tag"
   },
   "overflow": {
    "status": "handled",
    "how": "three cards sit side by side in a wide box and stack in one column below that, with their rows lined up across cards",
    "evidence": "@container (min-width: 52rem)"
   },
   "long_text": {
    "status": "handled",
    "how": "plan names and features wrap, the name leaves room for the radio, and the tag and period labels never wrap",
    "evidence": ".odl-plan-picker .odl-tag { white-space: nowrap;"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-border-width-emphasis",
  "--ds-color-bg-action-primary",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-border-accent",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-strong",
  "--ds-color-border-subtle",
  "--ds-color-icon-default",
  "--ds-color-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-success",
  "--ds-color-text-tertiary",
  "--ds-elevation-floating",
  "--ds-elevation-raised",
  "--ds-focus-ring-offset",
  "--ds-focus-ring-width",
  "--ds-icon-stroke-md",
  "--ds-motion-duration-short",
  "--ds-motion-easing-standard",
  "--ds-radius-container",
  "--ds-radius-control",
  "--ds-radius-control-sm",
  "--ds-radius-full",
  "--ds-size-control-sm",
  "--ds-size-icon-md",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-2",
  "--ds-space-32",
  "--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-md",
  "--ds-space-stack-sm",
  "--ds-space-stack-xl",
  "--ds-space-stack-xs",
  "--ds-text-body-md",
  "--ds-text-body-sm",
  "--ds-text-headline-sm",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-title-lg",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "Native radio groups for the period and the plan; the whole card is the label, and the focus ring goes around the card.",
  "roles": [
   "list"
  ],
  "keyboard": [
   "Tab moves to the billing period group, then to the plan group",
   "Left and Right or Up and Down arrows move between Monthly and Yearly, and the prices change at once",
   "Arrow keys move between the plan cards and select the one reached"
  ],
  "controls": {
   "button": 0,
   "input": 6,
   "link": 0,
   "select": 0,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/plan-picker/component.html",
  "bytes": 12610,
  "script": true
 },
 "source": "brand/showcase/components/01-pricing-glass",
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/plan-picker.html",
  "json": "https://opendesigner.dev/library/plan-picker.json",
  "page": "https://opendesigner.dev/library/plan-picker/"
 },
 "get": {
  "curl": "curl -fsSLo plan-picker.html https://opendesigner.dev/library/plan-picker.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add plan-picker --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component plan-picker to this project: https://opendesigner.dev/library/plan-picker.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
