{
  "name": "Fedi Design System — Components",
  "version": "1.0.0",
  "note": "Composed patterns built from the foundation tokens. Reference CSS variables (--ink, --blue, --r-card, …) — never hardcode. All components are mobile-first. Aligned with the Fedi Design Figma file.",
  "components": {
    "badge": {
      "description": "Tiny status/count marker. Either a numeric count or a status dot.",
      "anatomy": "Pill or circle, Albert Sans 11px / 600, min 18px.",
      "variants": {
        "count": "Filled --red circle, white text, for unread counts.",
        "status": "6px dot — --green (online/success), --amber-deep (pending), --g400 (offline).",
        "label": "Soft pill: --primary-soft bg, --ink text, for small tags."
      },
      "radius": "--r-pill"
    },
    "banner": {
      "description": "Full-width inline message at the top of a screen or section.",
      "anatomy": "Row: leading icon + text + optional close/action. Radius --r-card, padding 12–16px.",
      "variants": {
        "info": "bg tint of --blue, text --ink, icon --blue.",
        "success": "bg --green-soft, text --green.",
        "warning": "bg --amber-soft, text --amber-deep.",
        "error": "bg tint of --red, text --red."
      }
    },
    "button": {
      "description": "Pill action. Primary solid black, secondary solid white + border, blue solid.",
      "radius": "--r-pill",
      "font": "Poppins 500",
      "sizes": {
        "medium": {
          "height": "52px",
          "padding": "0 28px",
          "fontSize": "16px",
          "use": "Primary screen actions, full-width CTAs."
        },
        "small": {
          "height": "40px",
          "padding": "0 20px",
          "fontSize": "14px",
          "use": "Inline / secondary actions."
        },
        "xsmall": {
          "height": "32px",
          "padding": "0 14px",
          "fontSize": "13px",
          "use": "Compact actions, chips-as-buttons, toolbars."
        }
      },
      "states": {
        "default": "Full color (--btn-k / --btn-w / --btn-blue).",
        "pressed": "Darken ~8% (or --blue-deep / --orange-deep) and scale 0.98.",
        "disabled": "opacity 0.4, no shadow, cursor not-allowed.",
        "loading": "Show a spinner, hide/dim the label, keep width, disable interaction."
      }
    },
    "card": {
      "description": "Surface for grouped content / list rows.",
      "anatomy": "bg --g100 (or --white + 1px --g150 border), radius --r-card (15px), padding 16px.",
      "variants": {
        "default": "--g100 fill, no border.",
        "outlined": "--white with 1px --g150 border.",
        "hero": "radius --r-lg (40px) for feature blocks.",
        "selected": "tint with --primary-soft."
      },
      "shadow": "none by default; --sh-float only when elevated/floating."
    },
    "chip": {
      "description": "Pill status/tag. Tinted background + matching text. Two styles: default and uppercase (role/label).",
      "anatomy": "Pill --radius-full, Poppins 12–13px, height ~26px, padding 4px 12px, optional leading dot/icon.",
      "states": {
        "neutral": "bg --gray-50, text --gray-500.",
        "pending": "bg --orange-100, text --orange-600.",
        "approved": "bg --green-100, text --green-600.",
        "rejected": "bg --red-100, text --red-600.",
        "info": "bg --blue-100, text --blue-700."
      },
      "styles": {
        "default": "Sentence-case label, optional leading status dot.",
        "uppercase": "Tiny uppercase role/label pill — Poppins 10px / 700, letter-spacing 1px, padding 3px 9px. Tinted per role, e.g. issuer (violet rgba(124,58,237,.10)/#5B21B6), holder (blue --blue-100/--blue-700). From the verification flow."
      }
    },
    "toast": {
      "description": "Transient confirmation message at the bottom of the screen; auto-dismisses.",
      "anatomy": "Dark pill: --black bg, white text, radius --radius-lg (12px), padding 11px 16px, b2Mdm (14/500), shadow --shadow-regular, optional leading icon, slides up + fades in.",
      "variants": {
        "default": "Plain ink toast.",
        "success": "Leading green check icon.",
        "error": "Leading red icon."
      }
    },
    "input": {
      "description": "Text input field.",
      "anatomy": "Optional label (--dim 13px) above, field height 48px, radius --r-sm (12px), 1px --g200 border, --white bg, Poppins 16px, placeholder --g400.",
      "states": {
        "default": "1px --g200 border.",
        "focus": "border --ink (or --blue), subtle ring.",
        "filled": "value in --ink.",
        "error": "border --red, helper text --red.",
        "disabled": "bg --g50, text --g400."
      }
    },
    "toggle": {
      "description": "On/off switch.",
      "anatomy": "Track 38×22px radius --r-pill, knob 18px white circle with subtle shadow.",
      "states": {
        "off": "track --g200.",
        "on": "track --ink, knob slides right.",
        "disabled": "opacity 0.4."
      }
    },
    "note": {
      "description": "Inline note block (from Figma Notes). Formed by container + label + icon.",
      "anatomy": "Header row: title/label left, action (Add/Edit) right. Body text --dim 14px.",
      "variants": {
        "default": "--white container, 1px --g150 (often dashed when empty), 'Add' action.",
        "filled": "--white container with body text and 'Edit' action.",
        "callout": "bg --amber-soft, leading note icon, title --ink 600 + body --amber-deep/--ink."
      },
      "radius": "--r-card"
    },
    "tabs": {
      "description": "Segmented tabs — a pill track with 2–3 segments; the active segment is a raised white pill. Used for switching views (e.g. Public / Private).",
      "anatomy": "Track bg --gray-50 radius --radius-full, 3px padding; active segment --white pill with a subtle shadow; labels Poppins 14/500, active --black, inactive --gray-500.",
      "states": {
        "active": "raised white pill, --black label",
        "inactive": "transparent, --gray-500 label"
      }
    },
    "chat": {
      "description": "Chat message bubbles + input bar (from Figma Chat).",
      "bubbles": {
        "sent": "Right-aligned, bg --blue, text --white, radius 16px (tight bottom-right).",
        "received": "Left-aligned, bg --extraLightGrey/--g100, text --ink, radius 16px (tight bottom-left).",
        "payment": "bg --orange/--bitcoin, white text, shows amount + status (e.g. 'Paid'), optional Cancel.",
        "system": "Centered --dim 12px meta line (timestamps, joins)."
      },
      "input": {
        "anatomy": "Rounded bar: leading image/file/+ icons, text field, trailing send button (circle --ink with white arrow).",
        "states": [
          "default (Type message…)",
          "write",
          "write-tag",
          "select-user",
          "reply (shows reply preview + close)"
        ]
      }
    },
    "bottomNav": {
      "description": "5-tab bottom bar with a prominent center action. Uses the canonical Fedi nav icons (see tokens.icons.nav).",
      "anatomy": "bg --white, top hairline --gray-150, 5 items each icon + label (Poppins 10px). Active tab --black, inactive --gray-400. Center item (Scan/Paste) is a raised --black circle (48px) with white icon, overflowing ~22px above the bar.",
      "tabs": [
        "Wallet",
        "Chat",
        "Scan/Paste (center FAB)",
        "Mini apps",
        "Spaces"
      ]
    },
    "emojiReactions": {
      "description": "Emoji reactions on chat messages. Reaction chips (emoji + count) attach to a bubble; a quick-reaction picker bar offers fast emoji.",
      "anatomy": "Chip: white pill, 1px --gray-150 border, ~22px tall, emoji + optional count in --gray-500 b3. Sits just below/overlapping the bubble, aligned to the bubble side. 'Add reaction' is a chip with a smiley + plus. Picker: white rounded bar with a row of quick emoji + a search/more affordance.",
      "states": {
        "reacted": "Chip with --color-primary-subtle tint or --blue-100 when the current user reacted.",
        "default": "White chip, --gray-150 border."
      }
    },
    "avatar": {
      "description": "User/entity avatar. Sizes 24–88px, circle or rectangle, image / initials / icon content with status-tint or brand-gradient fills.",
      "anatomy": "Container at size px; circle = --radius-full, rectangle = --radius-lg (12px). Content: img, initials (Poppins 600, scaled to size), or icon.",
      "sizes": [
        24,
        32,
        36,
        40,
        48,
        64,
        88
      ],
      "styles": {
        "image": "--gray-150 bg behind the photo.",
        "tint": "Accent-100 bg + accent-600 fg (orange/green/blue/red) — for initials or icons. Status/categorisation only.",
        "neutral": "--gray-150 bg, --gray-500 fg — profile silhouette / default.",
        "brand": "rainbowFedi gradient bg — ONLY for the Fedi logo avatar and brand moments; never user content, never buttons."
      },
      "initialsFontSize": {
        "24": "10px",
        "32": "12px",
        "36": "12px",
        "40": "14px",
        "48": "16px",
        "64": "20px",
        "88": "28px"
      }
    }
  }
}