{
  "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-item/mds-avatar-stack-item.tsx",
      "encapsulation": "shadow",
      "tag": "mds-avatar-stack-item",
      "docs": "",
      "docsTags": [
        {
          "name": "parent",
          "text": "mds-avatar-stack"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-avatar-stack-item>` web component is a compound child that represents a single avatar inside an [`<mds-avatar-stack>`](../mds-avatar-stack/AGENTS.md), wrapping an internal `<mds-avatar>` so individual avatars can be overlapped, sized, and counted as a group rather than rendered standalone.\n\n#### Semantic Behavior\n\n- **Compound child only**: It must be a direct slot child of `<mds-avatar-stack>`. It is not meant to be used standalone or mixed with other child types in the stack.\n- **Parent-driven sizing**: The visual size of each item is governed by the parent's `size` (`sm` / `md` / `lg`) - the child exposes no `size` prop of its own.\n- **Overflow / count badge**: When `count` is set, the item renders as a numeric badge instead of a person. The parent uses this for the trailing \"+N\" indicator, computed from its `total`.\n- **Pass-through to mds-avatar**: It forwards `count`, `initials`, `src`, `tone`, and `variant` straight to its internal `<mds-avatar>`; it adds no events, state, focus, or ARIA of its own.\n- **Initials override color**: When `initials` are shown (no image available), they take precedence over `tone` and `variant` so each user stays visually distinguishable within the stack.\n\n#### Properties & Visual Configurations\n\nThe shared `tone` / `variant` ladders are defined in [`agents/variants.md`](../../../../agents/variants.md); `tone` accepts only the minimal set (`weak` default, `strong`) and `variant` accepts the avatar color set.\n\n- **`src`**: Use for the primary case - a real user photo. When absent the avatar falls back to `initials`, and only when neither is provided do `tone` / `variant` define the placeholder appearance.\n- **`initials`**: Provide a short identifier when no image exists; prefer it over relying on color alone, since it both labels and visually separates users in a dense stack.\n- **`count`**: Set only to render an explicit overflow badge manually. In most cases this is computed for you by the parent's `total`, so set it directly only when building the overflow indicator yourself.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-avatar-stack-item>` 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 Stack with Initials\n\nThe most common form: place one item per participant inside [`mds-avatar-stack`](../mds-avatar-stack/AGENTS.md). Use `initials` for users without a photo; the stack applies uniform sizing and overlap automatically.\n\n```html\n<mds-avatar-stack>\n  <mds-avatar-stack-item initials=\"mr\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"er\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Stack with Photos\n\nUse `src` when a real user photo is available. While `src` is set, `initials` is not displayed: an image that cannot be loaded is replaced by the generic person glyph. Items without `src` show their `initials`, and the tone/variant placeholder when neither is provided.\n\n```html\n<mds-avatar-stack>\n  <mds-avatar-stack-item src=\"/avatars/mario-rossi.jpg\" initials=\"mr\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item src=\"/avatars/anna-conti.jpg\" initials=\"ac\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"er\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Tone and Variant for Placeholder Color\n\nWhen no image or initials are provided, `tone` and `variant` determine the placeholder background. Use distinct variant values to keep users visually distinguishable. `tone` defaults to `weak`; use `strong` for higher contrast.\n\n```html\n<mds-avatar-stack>\n  <mds-avatar-stack-item variant=\"blue\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item variant=\"green\" tone=\"weak\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item variant=\"orchid\" tone=\"strong\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Overflow Counter via Parent `total`\n\nSet `total` on the parent to let it append the overflow badge automatically. The badge value is `total` minus the number of slotted items - do not set `count` on the items yourself for this use case.\n\n```html\n<mds-avatar-stack total=\"12\">\n  <mds-avatar-stack-item initials=\"mr\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"er\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Manual Overflow Badge via `count`\n\nUse `count` directly on a trailing item only when you are building the overflow indicator yourself and the parent does not own the total. This is rarely needed outside of fully custom stacks.\n\n```html\n<mds-avatar-stack>\n  <mds-avatar-stack-item initials=\"mr\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item count=\"8\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Size Controlled by the Parent\n\nSize is not set per item - it is set once on the parent with `size` (`sm`, `md`, `lg`). All items in the stack scale together.\n\n```html\n<!-- Small stack: dense lists, table cells -->\n<mds-avatar-stack size=\"sm\">\n  <mds-avatar-stack-item initials=\"mr\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n\n<!-- Large stack: profile overviews, hero sections -->\n<mds-avatar-stack size=\"lg\">\n  <mds-avatar-stack-item initials=\"er\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"mt\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Styling Customization\n\nStyle individual items through their public `--mds-avatar-stack-item-*` CSS custom properties, or control the whole stack at once via the parent's public `--mds-avatar-stack-background` (the item ring color inherits from it). Use semantic color roles with `rgb(var(--magma-<role>))` so dark mode keeps working.\n\n```css\n/* Override the separator ring color for the whole stack */\n.collab-panel mds-avatar-stack {\n  --mds-avatar-stack-background: rgb(var(--magma-surface-raised));\n}\n\n/* Override the separator ring color of a single item */\n.collab-panel mds-avatar-stack-item.highlight {\n  --mds-avatar-stack-item-background: rgb(var(--magma-accent-emphasis));\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-avatar-stack-item>`. 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 Use Outside `mds-avatar-stack`\n\n`<mds-avatar-stack-item>` is a compound child and relies on its parent for sizing, overlap and the overflow counter. Used standalone, it falls back to the medium size, with no stack container and no `size` / `total` control.\n\n```html\n<!-- INCORRECT -->\n<mds-avatar-stack-item initials=\"mr\"></mds-avatar-stack-item>\n\n<!-- CORRECT -->\n<mds-avatar-stack>\n  <mds-avatar-stack-item initials=\"mr\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Do Not Set `size` on the Item\n\nThe child has no `size` prop; setting it as an attribute has no effect. Control the scale of every item in the stack with the `size` prop on the parent.\n\n```html\n<!-- INCORRECT -->\n<mds-avatar-stack>\n  <mds-avatar-stack-item initials=\"mr\" size=\"lg\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n\n<!-- CORRECT -->\n<mds-avatar-stack size=\"lg\">\n  <mds-avatar-stack-item initials=\"mr\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Do Not Duplicate `count` When Using `total`\n\nWhen `total` is set on the parent it auto-appends the overflow item. Adding a manual `count` item on top produces a double overflow indicator.\n\n```html\n<!-- INCORRECT -->\n<mds-avatar-stack total=\"12\">\n  <mds-avatar-stack-item initials=\"mr\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item count=\"10\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n\n<!-- CORRECT - let the parent compute and render the overflow badge -->\n<mds-avatar-stack total=\"12\">\n  <mds-avatar-stack-item initials=\"mr\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Do Not Wrap Items in a Div\n\nThe parent counts only its direct `mds-avatar-stack-item` children to compute the overflow. Wrapping items in a `<div>` or any other element breaks that count, and the parent's `size` (applied with `::slotted`) no longer reaches the items.\n\n```html\n<!-- INCORRECT -->\n<mds-avatar-stack total=\"5\">\n  <div>\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 - items must be direct slot children -->\n<mds-avatar-stack total=\"5\">\n  <mds-avatar-stack-item initials=\"mr\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Do Not Use `tone` and `variant` as the Only Differentiator\n\n`tone` and `variant` style the placeholder background but are overridden by `initials` and ignored when `src` is present. Relying on color alone to identify users is not accessible. Always provide `initials` or `src`.\n\n```html\n<!-- INCORRECT - color-only identity, no label for screen readers -->\n<mds-avatar-stack>\n  <mds-avatar-stack-item variant=\"blue\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item variant=\"green\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n\n<!-- CORRECT - initials provide a visible and screen-reader-friendly label -->\n<mds-avatar-stack>\n  <mds-avatar-stack-item initials=\"mr\"></mds-avatar-stack-item>\n  <mds-avatar-stack-item initials=\"ac\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n\n#### Do Not Use an Invalid `tone` Value\n\n`tone` on this component accepts only `weak` (default) and `strong` - the `ToneMinimalVariantType` set. Values like `outline` or `text`, valid on other components, match no style here: the avatar renders as with `strong`, not with the `weak` default.\n\n```html\n<!-- INCORRECT (tone=\"outline\" is not in ToneMinimalVariantType) -->\n<mds-avatar-stack>\n  <mds-avatar-stack-item initials=\"mr\" tone=\"outline\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n\n<!-- CORRECT -->\n<mds-avatar-stack>\n  <mds-avatar-stack-item initials=\"mr\" tone=\"strong\"></mds-avatar-stack-item>\n</mds-avatar-stack>\n```\n"
      },
      "props": [
        {
          "name": "count",
          "type": "number | undefined",
          "complexType": {
            "original": "number",
            "resolved": "number | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "count",
          "reflectToAttr": true,
          "docs": "Specifies number of total avatars, the total number will be subtracted by the slotted ones",
          "docsTags": [],
          "values": [
            {
              "type": "number"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "initials",
          "type": "string | undefined",
          "complexType": {
            "original": "string",
            "resolved": "string | undefined",
            "references": {}
          },
          "mutable": true,
          "attr": "initials",
          "reflectToAttr": true,
          "docs": "The user's inizials displayed if there's no image available, initials will override tone and variant senttings to keep user recognizable from others",
          "docsTags": [],
          "values": [
            {
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "src",
          "type": "string | undefined",
          "complexType": {
            "original": "string",
            "resolved": "string | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "src",
          "reflectToAttr": true,
          "docs": "Specifies the path to the image",
          "docsTags": [],
          "values": [
            {
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "tone",
          "type": "\"strong\" | \"weak\" | undefined",
          "complexType": {
            "original": "ToneMinimalVariantType",
            "resolved": "\"strong\" | \"weak\" | undefined",
            "references": {
              "ToneMinimalVariantType": {
                "location": "import",
                "path": "@type/tone",
                "id": "src/type/tone.ts::ToneMinimalVariantType",
                "referenceLocation": "ToneMinimalVariantType"
              }
            }
          },
          "mutable": false,
          "attr": "tone",
          "reflectToAttr": true,
          "docs": "Specifies the color tone of the component",
          "docsTags": [
            {
              "name": "default",
              "text": "'weak'"
            }
          ],
          "default": "'weak'",
          "values": [
            {
              "value": "strong",
              "type": "string"
            },
            {
              "value": "weak",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "variant",
          "type": "\"amaranth\" | \"aqua\" | \"blue\" | \"error\" | \"green\" | \"info\" | \"lime\" | \"orange\" | \"orchid\" | \"primary\" | \"purple\" | \"red\" | \"sky\" | \"success\" | \"violet\" | \"warning\" | \"yellow\" | undefined",
          "complexType": {
            "original": "ThemeFullVariantAvatarType",
            "resolved": "\"amaranth\" | \"aqua\" | \"blue\" | \"error\" | \"green\" | \"info\" | \"lime\" | \"orange\" | \"orchid\" | \"primary\" | \"purple\" | \"red\" | \"sky\" | \"success\" | \"violet\" | \"warning\" | \"yellow\" | undefined",
            "references": {
              "ThemeFullVariantAvatarType": {
                "location": "import",
                "path": "@type/variant",
                "id": "src/type/variant.ts::ThemeFullVariantAvatarType",
                "referenceLocation": "ThemeFullVariantAvatarType"
              }
            }
          },
          "mutable": false,
          "attr": "variant",
          "reflectToAttr": true,
          "docs": "Specifies the color variant of the component",
          "docsTags": [],
          "values": [
            {
              "value": "amaranth",
              "type": "string"
            },
            {
              "value": "aqua",
              "type": "string"
            },
            {
              "value": "blue",
              "type": "string"
            },
            {
              "value": "error",
              "type": "string"
            },
            {
              "value": "green",
              "type": "string"
            },
            {
              "value": "info",
              "type": "string"
            },
            {
              "value": "lime",
              "type": "string"
            },
            {
              "value": "orange",
              "type": "string"
            },
            {
              "value": "orchid",
              "type": "string"
            },
            {
              "value": "primary",
              "type": "string"
            },
            {
              "value": "purple",
              "type": "string"
            },
            {
              "value": "red",
              "type": "string"
            },
            {
              "value": "sky",
              "type": "string"
            },
            {
              "value": "success",
              "type": "string"
            },
            {
              "value": "violet",
              "type": "string"
            },
            {
              "value": "warning",
              "type": "string"
            },
            {
              "value": "yellow",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-avatar-stack-item-background",
          "annotation": "prop",
          "docs": "The background color of each avatar in the stack",
          "visibility": "public"
        },
        {
          "name": "--mds-avatar-stack-item-border",
          "annotation": "prop",
          "docs": "Computed active border (based on selected size)",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-item-count-background-color",
          "annotation": "prop",
          "docs": "Background color of the count badge in the stack",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-item-count-color",
          "annotation": "prop",
          "docs": "Text color for the count badge in the stack",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-item-offset",
          "annotation": "prop",
          "docs": "Computed active offset (based on selected size)",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-item-offset-margin",
          "annotation": "prop",
          "docs": "Computed margin for overlapping avatars",
          "visibility": "internal"
        },
        {
          "name": "--mds-avatar-stack-item-size",
          "annotation": "prop",
          "docs": "Computed active size (based on selected size)",
          "visibility": "public"
        }
      ],
      "slots": [],
      "parts": [],
      "states": [],
      "dependents": [
        "mds-avatar-stack"
      ],
      "dependencies": [
        "mds-avatar"
      ],
      "dependencyGraph": {
        "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"
        ],
        "mds-avatar-stack": [
          "mds-avatar-stack-item"
        ]
      },
      "storybook": "ui-avatar-stack-item--docs"
    }
  ]
}
