{
 "id": "invite-members",
 "name": "Invite members",
 "purpose": "Invite several people at once: emails become removable chips, one role applies to all with a line on what it can do, and a seat count shows what the invites use.",
 "use_when": [
  "when adding people to a workspace or team",
  "a plan with a seat limit, where people need to see what the invites will use before sending"
 ],
 "avoid_when": [
  "managing people who are already members: use member-list",
  "sharing one item by link or app: use share-sheet",
  "signing a single person in: use sign-in-form"
 ],
 "type": "form",
 "style": "quiet",
 "width": "medium",
 "tags": {
  "audience": "work",
  "industries": [
   "saas",
   "productivity",
   "any"
  ],
  "keywords": [
   "invite",
   "team",
   "members",
   "roles",
   "seats",
   "chips"
  ]
 },
 "root": ".odl-invite-members",
 "parts": [
  {
   "name": "title",
   "selector": ".odl-head h2",
   "what": "who is being invited to what",
   "slot": "text"
  },
  {
   "name": "lede",
   "selector": ".odl-head p",
   "what": "what the invited person receives",
   "slot": "text"
  },
  {
   "name": "emails",
   "selector": ".odl-chip",
   "what": "one address as a removable chip; red when it is not a full address",
   "slot": "list"
  },
  {
   "name": "email_input",
   "selector": ".odl-chips input",
   "what": "where addresses are typed or pasted",
   "slot": "input"
  },
  {
   "name": "hint",
   "selector": ".odl-hint",
   "what": "how to add addresses, or which one is wrong",
   "slot": "text"
  },
  {
   "name": "role",
   "selector": "select",
   "what": "one role for everyone invited",
   "slot": "input"
  },
  {
   "name": "role_desc",
   "selector": ".odl-role-desc",
   "what": "what the chosen role can and cannot do",
   "slot": "text"
  },
  {
   "name": "seats",
   "selector": ".odl-seats",
   "what": "a bar of seats in use and seats these invites take, with a sentence",
   "slot": "rich"
  },
  {
   "name": "cancel",
   "selector": ".odl-cancel",
   "what": "close without sending",
   "slot": "action"
  },
  {
   "name": "send",
   "selector": ".odl-send",
   "what": "send the invites, with the count in the label",
   "slot": "action"
  }
 ],
 "data": {
  "type": "object",
  "required": [
   "title",
   "roles",
   "seats_used",
   "seats_total"
  ],
  "properties": {
   "title": {
    "type": "string",
    "maxLength": 48,
    "part": "title"
   },
   "lede": {
    "type": "string",
    "maxLength": 90,
    "part": "lede"
   },
   "emails": {
    "type": "array",
    "minItems": 0,
    "maxItems": 12,
    "part": "emails",
    "items": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "address": {
       "type": "string",
       "maxLength": 254
      }
     }
    }
   },
   "placeholder": {
    "type": "string",
    "maxLength": 24,
    "part": "email_input"
   },
   "roles": {
    "type": "array",
    "minItems": 2,
    "maxItems": 5,
    "part": "role",
    "items": {
     "type": "object",
     "required": [
      "value",
      "label",
      "description"
     ],
     "properties": {
      "value": {
       "type": "string",
       "maxLength": 20
      },
      "label": {
       "type": "string",
       "maxLength": 20
      },
      "description": {
       "type": "string",
       "maxLength": 110,
       "part": "role_desc"
      }
     }
    }
   },
   "default_role": {
    "type": "string",
    "maxLength": 20,
    "part": "role"
   },
   "seats_used": {
    "type": "integer",
    "minimum": 0,
    "part": "seats"
   },
   "seats_total": {
    "type": "integer",
    "minimum": 1,
    "part": "seats"
   },
   "role_description": {
    "type": "string",
    "maxLength": 80
   }
  }
 },
 "states": {
  "shown": [
   "hover",
   "focus",
   "invalid email",
   "seats used",
   "over seat limit",
   "disabled send"
  ],
  "edge": {
   "empty": {
    "status": "handled",
    "how": "when every chip is removed the hint goes back to how to add addresses and Send is disabled",
    "evidence": "send.disabled = !ok || over"
   },
   "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": "an address that is not a full email turns into a red chip and the hint names it; over the seat limit the seat line says how many to remove",
    "evidence": ".odl-chip.is-invalid"
   },
   "disabled": {
    "status": "handled",
    "how": "Send turns grey and cannot be pressed with no valid address or too many for the seats left",
    "evidence": ".odl-send:disabled"
   },
   "overflow": {
    "status": "handled",
    "how": "chips wrap onto new rows and the field grows; it has no height limit, so a long pasted list makes the dialog tall",
    "evidence": "flex-wrap: wrap; align-items: center; gap: var(--ds-space-stack-md) var(--ds-space-inline-sm)"
   },
   "long_text": {
    "status": "handled",
    "how": "a long address ends in an ellipsis inside its chip; the remove button stays visible",
    "evidence": ".odl-chip > span { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis"
   },
   "missing_image": {
    "status": "none",
    "how": "the part has no photo"
   }
  }
 },
 "tokens": [
  "--ds-border-width-default",
  "--ds-color-bg-action-primary",
  "--ds-color-bg-action-primary-hover",
  "--ds-color-bg-action-primary-pressed",
  "--ds-color-bg-danger-subtle",
  "--ds-color-bg-disabled",
  "--ds-color-bg-field",
  "--ds-color-bg-neutral-subtle",
  "--ds-color-bg-neutral-subtle-hover",
  "--ds-color-border-danger",
  "--ds-color-border-default",
  "--ds-color-border-focus",
  "--ds-color-border-input",
  "--ds-color-border-strong",
  "--ds-color-border-subtle",
  "--ds-color-icon-subtle",
  "--ds-color-surface-overlay",
  "--ds-color-surface-raised",
  "--ds-color-surface-sunken",
  "--ds-color-text-danger",
  "--ds-color-text-disabled",
  "--ds-color-text-on-action",
  "--ds-color-text-primary",
  "--ds-color-text-secondary",
  "--ds-color-text-tertiary",
  "--ds-elevation-overlay",
  "--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-control-sm",
  "--ds-radius-full",
  "--ds-radius-overlay",
  "--ds-size-control-lg",
  "--ds-size-control-md",
  "--ds-size-control-sm",
  "--ds-size-icon-sm",
  "--ds-size-target-min",
  "--ds-space-2",
  "--ds-space-32",
  "--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-inset-xs",
  "--ds-space-stack-lg",
  "--ds-space-stack-md",
  "--ds-space-stack-sm",
  "--ds-text-body-md",
  "--ds-text-label-lg",
  "--ds-text-label-md",
  "--ds-text-title-md"
 ],
 "a11y": {
  "summary": "The email field is a labelled input; each chip has a remove button that names the address, Backspace removes the last chip, the role is a native select described by its explanation, and errors are tied to the field.",
  "roles": [
   "dialog",
   "region"
  ],
  "keyboard": [
   "Tab reaches each chip's remove button, the email field, the role choice, Cancel, then Send",
   "Enter or comma in the email field turns what was typed into a chip; leaving the field does the same",
   "Backspace in an empty email field removes the last chip",
   "Enter or Space on a chip's remove button removes that address",
   "Arrow keys change the role, as in any native select, and the line under it updates"
  ],
  "controls": {
   "button": 6,
   "input": 1,
   "link": 0,
   "select": 1,
   "textarea": 0,
   "summary": 0
  },
  "focus_visible": true,
  "reduced_motion": true,
  "min_target": true
 },
 "files": {
  "html": "components/invite-members/component.html",
  "bytes": 17430,
  "script": true
 },
 "source": null,
 "photos": 0,
 "urls": {
  "html": "https://opendesigner.dev/library/invite-members.html",
  "json": "https://opendesigner.dev/library/invite-members.json",
  "page": "https://opendesigner.dev/library/invite-members/"
 },
 "get": {
  "curl": "curl -fsSLo invite-members.html https://opendesigner.dev/library/invite-members.html",
  "opendesigner": "python3 path/to/skills/opendesigner/scripts/library.py add invite-members --from https://opendesigner.dev",
  "prompt": "Add the OpenDesigner component invite-members to this project: https://opendesigner.dev/library/invite-members.html. Keep its markup and states; map its --ds-* variables to my tokens."
 }
}
