{
  "timestamp": "2026-11-19T09:33:56",
  "compiler": {
    "name": "@stencil/core",
    "version": "4.45.4",
    "typescriptVersion": "5.8.3"
  },
  "storybook": "https://magma-design-system.github.io/magma/storybook/",
  "studio": "https://magma-design-system.github.io/magma/studio/",
  "components": [
    {
      "filePath": "src/components/mds-avatar-stack/mds-avatar-stack.tsx",
      "encapsulation": "shadow",
      "tag": "mds-avatar-stack",
      "docs": "",
      "docsTags": [
        {
          "name": "slot",
          "text": "- Add `mds-avatar-stack-item` elements to display in the stack."
        },
        {
          "name": "category",
          "text": "data"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-avatar-stack>` web component groups a set of overlapping `<mds-avatar-stack-item>` children into a single horizontal cluster, the Magma Design System pattern for showing the people associated with an entity (assignees, participants, collaborators) in a compact, space-saving row.\n\n#### Semantic Behavior\n\n- **Compound parent**: It is the container half of a compound component; its visible content is the default slot of `<mds-avatar-stack-item>` children, each of which wraps an `<mds-avatar>`.\n- **Size propagation**: `size` drives the dimensions, border, and horizontal overlap of every slotted item, so the whole stack stays visually consistent without sizing each avatar individually.\n- **Overflow counter**: When `total` is set and exceeds the number of slotted children, the stack appends one extra item rendering the remainder (e.g. \"+3\"), so it can represent a larger group than it physically shows.\n- **Live composition**: Children are counted again whenever they change: the overflow indicator follows both `total` and the items added or removed after load.\n\n#### Properties & Visual Configurations\n\n- **`size`** selects the avatar scale (`'sm'`, `'md'`, `'lg'`) for the entire stack; pick it to match the surrounding density, since it governs not just avatar diameter but also the overlap offset and ring border between stacked avatars.\n- **`total`** is the logical headcount of the represented group. Set it higher than the number of slotted avatars to surface a trailing count item for the hidden members; leave it unset (or equal to the child count) to show only the avatars in the markup with no counter.\n\nThis component does not use the shared `variant` / `tone` ladders; per-avatar appearance (tone, variant, initials, image source) is configured on each `<mds-avatar-stack-item>` instead.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-avatar-stack>` component, ordered from most common to most specialized. The examples assume a working knowledge of the shared component rules in [`agents/conventions.md`](../../../../agents/conventions.md).\n\n#### Basic Avatar Stack\n\nThe canonical form. Slot one [`<mds-avatar-stack-item>`](../mds-avatar-stack-item/AGENTS.md) per person directly inside the stack. Each item wraps an internal avatar; no extra wrapper elements are needed.\n\n```html\n<mds-avatar-stack>\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"er\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Avatar Stack with Profile Images\n\nUse `src` on each item when real user photos are available. If the image fails to load, the avatar shows the generic person glyph; while `src` is set, `initials` is not displayed.\n\n```html\n<mds-avatar-stack>\n  <mds-avatar-stack-item\n    src=\"/avatars/mario-rossi.jpg\"\n    initials=\"mr\"\n    tone=\"weak\"\n  ></mds-avatar-stack-item>\n  <mds-avatar-stack-item\n    src=\"/avatars/anna-conti.jpg\"\n    initials=\"ac\"\n    tone=\"weak\"\n  ></mds-avatar-stack-item>\n  <mds-avatar-stack-item\n    src=\"/avatars/elena-ricci.jpg\"\n    initials=\"er\"\n    tone=\"weak\"\n  ></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Sizing the Stack\n\nUse the `size` prop on the parent to scale the whole stack at once. Do not set individual sizes on the items - the parent drives dimensions, overlap, and border for all children.\n\n```html\n<!-- Small - compact lists, comment threads -->\n<mds-avatar-stack size=\"sm\">\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n\n<!-- Medium (default) -->\n<mds-avatar-stack size=\"md\">\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n\n<!-- Large - hero areas, team pages -->\n<mds-avatar-stack size=\"lg\">\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Overflow Counter via `total`\n\nWhen the represented group is larger than the number of visible avatars, set `total` to the real headcount. The component automatically appends a trailing \"+N\" badge for the hidden members.\n\n```html\n<!-- 5 visible avatars out of a team of 12: shows \"+7\" badge -->\n<mds-avatar-stack total=\"12\">\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"er\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"mt\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"jb\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Per-Item Variant Colors\n\nEach [`<mds-avatar-stack-item>`](../mds-avatar-stack-item/AGENTS.md) accepts its own `variant`, which colors the avatar when it has no `initials`: initials derive their own color and override it. `tone` accepts `strong` or `weak` (default).\n\n```html\n<mds-avatar-stack>\n  <mds-avatar-stack-item variant=\"primary\" tone=\"strong\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item variant=\"success\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item variant=\"warning\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item variant=\"info\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Size and Overflow Combined\n\nCombine `size` and `total` to produce a large, labelled stack for team-overview sections.\n\n```html\n<mds-avatar-stack size=\"lg\" total=\"25\">\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"er\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"mt\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Styling Customization\n\nStyle the stack only through its public `--mds-avatar-stack-*` CSS custom properties. Set them on the host or a parent selector; use semantic color roles via `rgb(var(--magma-<role>))` so dark mode keeps working.\n\n```css\n/* Custom ring color for a card-hero section */\n.team-hero mds-avatar-stack {\n  --mds-avatar-stack-background: rgb(var(--magma-accent-emphasis));\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-avatar-stack>`. Each entry pairs the wrong form with the right one and a one-line reason. System-wide rules (boolean-as-string, shadow piercing, Tailwind color utilities, raw native event listening) live in [`agents/mistakes.md`](../../../../agents/mistakes.md) - they apply here too but are not repeated.\n\n#### Do Not Place `<mds-avatar-stack-item>` Inside a Wrapper Element\n\nThe parent counts only its **direct** `mds-avatar-stack-item` children. An intermediate wrapper breaks that count, so the overflow counter is wrong, and the parent's `size` (applied with `::slotted`) does not reach the wrapped items.\n\n```html\n<!-- INCORRECT -->\n<mds-avatar-stack total=\"10\">\n  <div class=\"group\">\n    <mds-avatar-stack-item initials=\"mr\"></mds-avatar-stack-item>\n    <mds-avatar-stack-item initials=\"ac\"></mds-avatar-stack-item>\n  </div>\n</mds-avatar-stack>\n\n<!-- CORRECT -->\n<mds-avatar-stack total=\"10\">\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Do Not Slot a Raw `<mds-avatar>` Directly\n\n[`<mds-avatar-stack-item>`](../mds-avatar-stack-item/AGENTS.md) is the correct child for this compound component - it handles sizing, border, overlap offset, and count badge rendering. Slotting a bare `<mds-avatar>` skips all of that wiring.\n\n```html\n<!-- INCORRECT -->\n<mds-avatar-stack>\n  <mds-avatar initials=\"mr\"></mds-avatar>\n  <mds-avatar initials=\"ac\"></mds-avatar>\n</mds-avatar-stack>\n\n<!-- CORRECT -->\n<mds-avatar-stack>\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Do Not Set `total` Lower Than or Equal to the Child Count\n\nWhen `total` does not exceed the number of slotted items, no overflow badge is rendered. Setting `total` lower than the child count is also misleading about group size and produces no visible effect.\n\n```html\n<!-- INCORRECT - total equals child count, badge never appears -->\n<mds-avatar-stack total=\"3\">\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"er\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n\n<!-- CORRECT - total exceeds slotted count by the hidden members -->\n<mds-avatar-stack total=\"10\">\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"er\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Do Not Add `count` Manually When `total` Is Set\n\n`count` on `<mds-avatar-stack-item>` is reserved for the auto-generated overflow badge; the parent computes and appends it when `total` is provided. Adding a `count` item by hand alongside `total` results in a duplicate badge.\n\n```html\n<!-- INCORRECT -->\n<mds-avatar-stack total=\"10\">\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item count=\"8\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n\n<!-- CORRECT - let the parent handle the badge -->\n<mds-avatar-stack total=\"10\">\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Do Not Size Individual Items - Size the Parent\n\n[`<mds-avatar-stack-item>`](../mds-avatar-stack-item/AGENTS.md) exposes no `size` prop; dimensions are driven by the parent's `size`. Overriding size with inline CSS on individual items breaks the uniform overlap geometry the component calculates.\n\n```html\n<!-- INCORRECT -->\n<mds-avatar-stack>\n  <mds-avatar-stack-item initials=\"mr\" style=\"width: 48px; height: 48px;\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" style=\"width: 48px; height: 48px;\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n\n<!-- CORRECT -->\n<mds-avatar-stack size=\"lg\">\n  <mds-avatar-stack-item initials=\"mr\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\" tone=\"weak\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Customize via Documented Vars, Not Internal Selectors\n\nThe supported customization surface is the public `--mds-avatar-stack-*` CSS custom properties on the parent. Targeting shadow internals via `>>>` or undocumented `::part()` names couples your code to the implementation and will break on minor releases.\n\n```css\n/* INCORRECT */\nmds-avatar-stack >>> .avatar {\n  border-color: blue;\n}\n\n/* CORRECT */\nmds-avatar-stack {\n  --mds-avatar-stack-background: rgb(var(--magma-accent-emphasis));\n}\n```\n"
      },
      "props": [
        {
          "name": "size",
          "type": "\"lg\" | \"md\" | \"sm\" | undefined",
          "complexType": {
            "original": "AvatarSizeType",
            "resolved": "\"lg\" | \"md\" | \"sm\" | undefined",
            "references": {
              "AvatarSizeType": {
                "location": "import",
                "path": "./meta/types",
                "id": "src/components/mds-avatar-stack/meta/types.ts::AvatarSizeType",
                "referenceLocation": "AvatarSizeType"
              }
            }
          },
          "mutable": false,
          "attr": "size",
          "reflectToAttr": true,
          "docs": "Specifies the size of the slotted avatars elements",
          "docsTags": [],
          "values": [
            {
              "value": "lg",
              "type": "string"
            },
            {
              "value": "md",
              "type": "string"
            },
            {
              "value": "sm",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "total",
          "type": "number | undefined",
          "complexType": {
            "original": "number",
            "resolved": "number | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "total",
          "reflectToAttr": true,
          "docs": "Specifies the size of the slotted avatars elements",
          "docsTags": [],
          "values": [
            {
              "type": "number"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-avatar-stack-background",
          "annotation": "prop",
          "docs": "Background color for the avatar stack container",
          "visibility": "public"
        },
        {
          "name": "--mds-avatar-stack-count-background-color",
          "annotation": "prop",
          "docs": "Background color of the count indicator (e.g., \"+3\")",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-count-color",
          "annotation": "prop",
          "docs": "Text color of the count indicator",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-lg-border",
          "annotation": "prop",
          "docs": "Border width for large avatar stack items",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-lg-offset",
          "annotation": "prop",
          "docs": "Horizontal overlap offset for large avatars",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-lg-size",
          "annotation": "prop",
          "docs": "Size of large avatars in the stack",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-md-border",
          "annotation": "prop",
          "docs": "Border width for medium avatar stack items",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-md-offset",
          "annotation": "prop",
          "docs": "Horizontal overlap offset for medium avatars",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-md-size",
          "annotation": "prop",
          "docs": "Size of medium avatars in the stack",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-sm-border",
          "annotation": "prop",
          "docs": "Border width for small avatar stack items",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-sm-offset",
          "annotation": "prop",
          "docs": "Horizontal overlap offset for small avatars",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-sm-size",
          "annotation": "prop",
          "docs": "Size of small avatars in the stack",
          "visibility": "internal"
        }
      ],
      "slots": [
        {
          "name": "",
          "docs": "Add `mds-avatar-stack-item` elements to display in the stack."
        }
      ],
      "parts": [],
      "states": [],
      "dependents": [],
      "dependencies": [
        "mds-avatar-stack-item"
      ],
      "dependencyGraph": {
        "mds-avatar-stack": [
          "mds-avatar-stack-item"
        ],
        "mds-avatar-stack-item": [
          "mds-avatar"
        ],
        "mds-avatar": [
          "mds-img",
          "mds-icon"
        ],
        "mds-img": [
          "mds-icon",
          "mds-text",
          "mds-button"
        ],
        "mds-button": [
          "mds-icon",
          "mds-spinner",
          "mds-text"
        ]
      },
      "storybook": "ui-avatar-stack--docs"
    }
  ]
}
