{
  "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-mention/mds-mention.tsx",
      "encapsulation": "shadow",
      "tag": "mds-mention",
      "docs": "",
      "docsTags": [
        {
          "name": "category",
          "text": "tags"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-mention>` web component renders a compact inline chip that references a person or entity - the kind of token produced when you type `@name` in an editor or comment field. It pairs an icon, a text label, and a removable action into a single self-contained pill.\n\n#### Semantic Behavior\n\n- **Props-only**: It has no default slot and exposes its content exclusively through props.\n- **Default icon**: When `icon` is not set the component falls back to the `alternate-email` (`@`) glyph, reinforcing the mention metaphor.\n- **Opt-in remove affordance**: `deletable` adds a trailing remove button; its click emits `mdsMentionDelete`, and the component leaves the removal itself to the application.\n- **Size-driven typography**: `size` maps to a fixed typography ramp (`sm` -> `caption`, `md` -> `detail`, `lg` -> `h6`); the label is wrapped in `<b>` at `sm` and `md`, and at `lg` it takes the bold `h6` title style.\n\n#### Properties & Visual Configurations\n\n- **`deletable`** turns on the trailing remove button. Without it the mention is a read-only token: no button, no event.\n- **`icon`** is an SVG filename slug from the Magma icon library, shown at the left of the label; omit it to keep the default `@` mention glyph.\n- **`size`** controls both the physical scale and the typography of the label - pick `sm` for dense inline contexts, `lg` for prominent, headline-adjacent placements. The label is bold at every size (a `<b>` below `lg`, the `h6` title style at `lg`).\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-mention>` 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 Inline Mention\n\nThe canonical form. Provide `label` with the user handle or display name. The component renders the default `@` glyph; the mention is read-only until `deletable` is set.\n\n```html\n<mds-text>\n  Ciao <mds-mention label=\"mario.rossi\"></mds-mention>, sei riuscito a inviare il messaggio?\n</mds-text>\n```\n\n#### Removable Mention\n\nSet `deletable` to show the remove button, then listen for `mdsMentionDelete` on the element. The\nevent carries the mention that was dismissed, so one handler can serve a whole list.\n\n```html\n<mds-mention id=\"m1\" label=\"mario.rossi\" deletable></mds-mention>\n<script>\n  document.querySelector('#m1').addEventListener('mdsMentionDelete', ({ detail }) => {\n    detail.element.remove();\n  });\n</script>\n```\n\n#### Custom Icon\n\nOverride the default `@` glyph with any Magma icon slug via the `icon` prop. Use this when the mention refers to a team, group, or entity that has a dedicated icon.\n\n```html\n<mds-mention label=\"team-design\" icon=\"mi/baseline/group\"></mds-mention>\n```\n\n#### Sizing\n\nUse the `size` prop to match the mention's visual weight to its context. `sm` is the default for dense inline use; `md` scales up the icon and typography; `lg` uses headline-weight typography for prominent placements.\n\n```html\n<!-- Dense list or comment thread -->\n<mds-mention label=\"anna.verdi\" size=\"sm\"></mds-mention>\n\n<!-- Standard body text -->\n<mds-mention label=\"anna.verdi\" size=\"md\"></mds-mention>\n\n<!-- Heading-adjacent or featured mention -->\n<mds-mention label=\"anna.verdi\" size=\"lg\"></mds-mention>\n```\n\n#### Mention Inside a Comment or Message\n\nPlace `<mds-mention>` inline within `<mds-text>` to embed it naturally in body copy, preserving vertical alignment.\n\n```html\n<mds-text>\n  Il documento e' stato approvato da\n  <mds-mention label=\"lucia.ferrari\" icon=\"mi/baseline/person\"></mds-mention>\n  e sara' pubblicato domani.\n</mds-text>\n```\n\n#### Multiple Mentions in One Sentence\n\nDrop several `<mds-mention>` tokens in the same text flow. Each is a self-contained pill; they line-wrap independently.\n\n```html\n<mds-text>\n  <mds-mention label=\"marco.bianchi\"></mds-mention> e\n  <mds-mention label=\"giulia.conti\"></mds-mention>\n  sono stati assegnati alla revisione.\n</mds-text>\n```\n\n#### Styling Customization\n\n`<mds-mention>` has no public CSS custom property and no shadow parts: the icon size follows the `size` prop (see Sizing above), which keeps the icon, the padding and the typography in step. For a larger icon, pick the next size instead of resizing the icon by hand.\n\n```html\n<mds-mention label=\"lucia.ferrari\" icon=\"mi/baseline/person\" size=\"md\"></mds-mention>\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-mention>`. 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 Slot Content Into the Component\n\n`<mds-mention>` has no default slot and no named slots. Any child nodes placed inside the tag are silently ignored. Pass all content through the `label` and `icon` props.\n\n```html\n<!-- INCORRECT -->\n<mds-mention>\n  <mds-icon name=\"mi/baseline/person\"></mds-icon>\n  mario.rossi\n</mds-mention>\n\n<!-- CORRECT -->\n<mds-mention label=\"mario.rossi\" icon=\"mi/baseline/person\"></mds-mention>\n```\n\n#### Do Not Use a Raw `<span>` Chip Instead of the Component\n\nWrapping text in a styled `<span>` misses the remove affordance, icon handling, size ramp, and dark-mode token cascade. Use `<mds-mention>` whenever the UI needs an @-mention token.\n\n```html\n<!-- INCORRECT -->\n<span class=\"pill\">@mario.rossi</span>\n\n<!-- CORRECT -->\n<mds-mention label=\"mario.rossi\"></mds-mention>\n```\n\n#### Do Not Override Size with Inline CSS\n\nThe `size` prop drives icon dimensions, padding, and typography together as a coordinated unit. Setting `font-size`, `width`, or `height` inline breaks that coordination and can misalign the icon and label.\n\n```html\n<!-- INCORRECT -->\n<mds-mention label=\"anna.verdi\" style=\"font-size: 20px; height: 40px;\"></mds-mention>\n\n<!-- CORRECT -->\n<mds-mention label=\"anna.verdi\" size=\"lg\"></mds-mention>\n```\n\n#### Do Not Customize Style by Piercing the Shadow DOM\n\n`<mds-mention>` has no public CSS custom property and no shadow parts: the icon size comes from the `size` prop. Targeting internal elements via `>>>`, `/deep/`, or undocumented `::part()` names couples your code to implementation details and will break on minor releases.\n\n```css\n/* INCORRECT */\nmds-mention >>> mds-icon {\n  width: 32px;\n}\n```\n\n```html\n<!-- CORRECT -->\n<mds-mention label=\"anna.verdi\" size=\"md\"></mds-mention>\n```\n\n#### Do Not Listen for `click` on the Remove Button Directly\n\nThe remove button lives inside the shadow DOM and stops its own `click` from propagating: a `click`\nlistener on the host never sees the remove action (it fires only for clicks on the rest of the\npill), and reaching into the shadow root ties your code to an internal class name. Listen for `mdsMentionDelete` instead - it is the contract, and it names the mention that was\ndismissed.\n\n```html\n<!-- INCORRECT -->\n<mds-mention id=\"m1\" label=\"marco.bianchi\" deletable></mds-mention>\n<script>\n  document.querySelector('#m1').addEventListener('click', removeMention);\n</script>\n\n<!-- CORRECT -->\n<mds-mention id=\"m1\" label=\"marco.bianchi\" deletable></mds-mention>\n<script>\n  document.querySelector('#m1').addEventListener('mdsMentionDelete', removeMention);\n</script>\n```\n"
      },
      "props": [
        {
          "name": "deletable",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "deletable",
          "reflectToAttr": true,
          "docs": "Shows the cross icon to perform cancel/delete action on element",
          "docsTags": [],
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "icon",
          "type": "string | undefined",
          "complexType": {
            "original": "string",
            "resolved": "string | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "icon",
          "reflectToAttr": true,
          "docs": "Sets the icon shown at the left of the label",
          "docsTags": [],
          "values": [
            {
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "label",
          "type": "string | undefined",
          "complexType": {
            "original": "string",
            "resolved": "string | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "label",
          "reflectToAttr": true,
          "docs": "Sets the label of the component",
          "docsTags": [],
          "values": [
            {
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "size",
          "type": "\"lg\" | \"md\" | \"sm\" | undefined",
          "complexType": {
            "original": "MentionSize",
            "resolved": "\"lg\" | \"md\" | \"sm\" | undefined",
            "references": {
              "MentionSize": {
                "location": "import",
                "path": "./meta/type",
                "id": "src/components/mds-mention/meta/type.ts::MentionSize",
                "referenceLocation": "MentionSize"
              }
            }
          },
          "mutable": false,
          "attr": "size",
          "reflectToAttr": true,
          "docs": "Sets the size of the component: the typography of the label (`sm` caption, `md` detail,\n`lg` h6) and the size of the icon",
          "docsTags": [
            {
              "name": "default",
              "text": "'sm'"
            }
          ],
          "default": "'sm'",
          "values": [
            {
              "value": "lg",
              "type": "string"
            },
            {
              "value": "md",
              "type": "string"
            },
            {
              "value": "sm",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [
        {
          "event": "mdsMentionDelete",
          "detail": "MdsMentionEvent",
          "bubbles": true,
          "complexType": {
            "original": "MdsMentionEvent",
            "resolved": "MdsMentionEvent",
            "references": {
              "MdsMentionEvent": {
                "location": "import",
                "path": "./meta/interface",
                "id": "src/components/mds-mention/meta/interface.ts::MdsMentionEvent",
                "referenceLocation": "MdsMentionEvent"
              }
            }
          },
          "cancelable": true,
          "composed": true,
          "docs": "Emits when the component's delete button is clicked",
          "docsTags": []
        }
      ],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-mention-icon-size",
          "annotation": "prop",
          "docs": "Sets the size (width and height) of the mention icon.",
          "visibility": "internal"
        }
      ],
      "slots": [],
      "parts": [],
      "states": [],
      "dependents": [],
      "dependencies": [
        "mds-icon",
        "mds-text",
        "mds-button"
      ],
      "dependencyGraph": {
        "mds-mention": [
          "mds-icon",
          "mds-text",
          "mds-button"
        ],
        "mds-button": [
          "mds-icon",
          "mds-spinner",
          "mds-text"
        ]
      },
      "storybook": "ui-mention--docs"
    }
  ]
}
