{
  "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-label/mds-label.tsx",
      "encapsulation": "shadow",
      "tag": "mds-label",
      "docs": "This is a web-component from Maggioli Design System [Magma](https://magma.maggiolicloud.it), built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScript framework you are using.",
      "docsTags": [
        {
          "name": "category",
          "text": "tags"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-label>` web component is the Magma Design System tag/chip used to display a short, non-interactive piece of text such as a status, a category, or a removable selection.\n\n#### Semantic Behavior\n\n- **Text content**: The visible text comes from the `label` prop only; the component renders no `<slot>`, so content placed between the tags is not displayed.\n- **Deletable affordance**: When `deletable` is set, the component renders a trailing close button and emits the `mdsLabelDelete` event on activation; the click is stopped at the close button, so it does not reach a surrounding clickable container.\n- **Keyboard interaction**: While `deletable`, the close button can be triggered by keyboard as well as pointer.\n- **Localization**: The close button's `title` is localized (el/en/it; `es` currently gets the English string).\n\n#### Properties & Visual Configurations\n\nThe `variant` and `tone` props follow the shared ladders defined in [`agents/variants.md`](../../../../agents/variants.md); `tone` is limited to the minimal `'strong'` / `'weak'` set and defaults to `'weak'`.\n\n#### Component-specific variants and tones\n\n`variant` accepts both the theme label palette (e.g. `'sky'`, the default) and the status palette (`'error'`, `'warning'`, `'success'`, `'info'`). Pick a status value when the label communicates an outcome or state; pick a theme color when it is a neutral category or decorative tag.\n\n#### Other behavioral props\n\n- **`truncate`** controls overflow handling of the inner text: `'word'` (default) keeps it on one line, `'all'` wraps and clamps it to three lines with an ellipsis, and `'none'` allows multiline wrapping. In every mode the label is as wide as its text, up to the width it is given (its own `width` or its container's), and `'all'` and `'none'` wrap the text at that width.\n- **`typography`** selects a compact type scale (`'caption'`, `'detail'`, `'tip'`) appropriate to the label's small footprint, defaulting to `'caption'`.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-label>` component, ordered from most common to most specialized. The examples assume a working knowledge of the variant / tone ladders documented in [`agents/variants.md`](../../../../agents/variants.md) and the shared component rules in [`agents/conventions.md`](../../../../agents/conventions.md).\n\n#### Basic Label via `label` Prop\n\nThe canonical form. Use the `label` prop for the text; it is the only way to set visible content because the component renders no `<slot>` element.\n\n```html\n<mds-label label=\"Categoria\"></mds-label>\n```\n\n#### Decorative Color via `variant`\n\nPick from the twelve label palette colors for neutral, decorative tags. Default is `sky`; change only when the color carries meaning to the user.\n\n```html\n<mds-label label=\"Ambiente\" variant=\"green\"></mds-label>\n<mds-label label=\"Priorita'\" variant=\"orange\"></mds-label>\n<mds-label label=\"Archivio\" variant=\"violet\"></mds-label>\n<mds-label label=\"Bozza\" variant=\"sky\"></mds-label>\n```\n\n#### Status Variant for Outcome Communication\n\nUse a status variant when the label communicates a system outcome or validation state, not just a decorative category.\n\n```html\n<mds-label label=\"Approvato\" variant=\"success\"></mds-label>\n<mds-label label=\"In attesa\" variant=\"warning\"></mds-label>\n<mds-label label=\"Rifiutato\" variant=\"error\"></mds-label>\n<mds-label label=\"Informazione\" variant=\"info\"></mds-label>\n```\n\n#### Tone for Emphasis\n\nPair `tone=\"strong\"` for higher-contrast situations; the default `weak` is lighter and suits most inline contexts.\n\n```html\n<!-- Default: subtle tinted background -->\n<mds-label label=\"Etichetta\" variant=\"blue\" tone=\"weak\"></mds-label>\n\n<!-- Higher contrast: solid background -->\n<mds-label label=\"Etichetta\" variant=\"blue\" tone=\"strong\"></mds-label>\n```\n\n#### Deletable Label with `mdsLabelDelete` Event\n\nSet `deletable` to render the trailing close button. Listen to `mdsLabelDelete` to remove the label from your model; the close button stops event propagation so clicks do not reach a surrounding interactive container.\n\n```html\n<mds-label label=\"Tag rimovibile\" variant=\"purple\" deletable></mds-label>\n```\n\n```javascript\ndocument.querySelector('mds-label').addEventListener('mdsLabelDelete', () => {\n  // rimuovi il tag dal modello\n});\n```\n\n#### Truncation Control via `truncate`\n\nUse `truncate=\"word\"` (default) to keep the text on one line, cut with an ellipsis. Use `truncate=\"none\"` to allow multiline wrapping inside a constrained container.\n\n```html\n<!-- Single-line truncation (default) -->\n<mds-label\n  label=\"Testo molto lungo che supera il limite\"\n  truncate=\"word\"\n  variant=\"lime\"\n  class=\"w-3200\"\n></mds-label>\n\n<!-- Multiline inside a narrow container -->\n<mds-label\n  label=\"Testo molto lungo che supera il limite\"\n  truncate=\"none\"\n  variant=\"lime\"\n  class=\"w-3200\"\n></mds-label>\n```\n\n#### Typography Scale\n\nChoose `typography` to match the surrounding text hierarchy. The default `caption` suits most label contexts; use `detail` (larger) next to body-size text and `tip` (smaller) only when the label sits alongside even smaller text.\n\n```html\n<mds-label label=\"Caption (default)\" variant=\"aqua\" typography=\"caption\"></mds-label>\n<mds-label label=\"Detail\" variant=\"aqua\" typography=\"detail\"></mds-label>\n<mds-label label=\"Tip\" variant=\"aqua\" typography=\"tip\"></mds-label>\n```\n\n#### Styling Customization\n\nStyle the label only through its public `--mds-label-*` CSS custom properties. Set them on the host or a parent selector; use Magma color tokens via `rgb(var(--<token>))` so dark mode and high-contrast modes keep working.\n\n```css\n.categoria-speciale mds-label {\n  --mds-label-background: rgb(var(--label-orchid-08));\n  --mds-label-color: rgb(var(--label-orchid-02));\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-label>`. 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 Rely on the Default Slot for Visible Text\n\nThe component's `render()` method does not include a `<slot>` element, so content placed in the default slot is never rendered. Use the `label` prop exclusively.\n\n```html\n<!-- INCORRECT -->\n<mds-label>Stato documento</mds-label>\n\n<!-- CORRECT -->\n<mds-label label=\"Stato documento\"></mds-label>\n```\n\n#### Do Not Use `<mds-label>` as a Form Input Label\n\n`<mds-label>` is a standalone decorative tag for categories and statuses. It is not a replacement for `<label>` or for the `label` prop of `mds-input-field`, and it has no `for` / `htmlFor` association with form controls.\n\n```html\n<!-- INCORRECT -->\n<mds-label label=\"Nome utente\"></mds-label>\n<mds-input name=\"username\"></mds-input>\n\n<!-- CORRECT -->\n<mds-input-field label=\"Nome utente\">\n  <mds-input name=\"username\"></mds-input>\n</mds-input-field>\n```\n\n#### Do Not Set `deletable=\"false\"` as a String\n\n`deletable` is a boolean prop, and a false boolean is an absent attribute ([`agents/conventions.md`](../../../../agents/conventions.md)). The runtime parses the string `\"false\"` as `false`, but the prop is not reflected, so the attribute stays on the element and `[deletable]` selectors or any code that reads the markup see a deletable tag. Remove the attribute entirely to disable the affordance.\n\n```html\n<!-- INCORRECT -->\n<mds-label label=\"Tag\" deletable=\"false\"></mds-label>\n\n<!-- CORRECT -->\n<mds-label label=\"Tag\"></mds-label>\n```\n\n#### Do Not Use a Status Variant for Decorative Tags\n\nStatus variants (`error`, `warning`, `success`, `info`) communicate system outcomes. Using them for neutral categories misleads users about the meaning of the label.\n\n```html\n<!-- INCORRECT: \"Fauna\" is a category, not an error state -->\n<mds-label label=\"Fauna\" variant=\"error\"></mds-label>\n\n<!-- CORRECT: use a decorative palette color -->\n<mds-label label=\"Fauna\" variant=\"green\"></mds-label>\n```\n\n#### Do Not Nest Interactive Elements Inside `<mds-label>`\n\nThe component renders no slot; placing buttons or links in the default slot position has no effect. For a deletable label use `deletable` and listen to `mdsLabelDelete`.\n\n```html\n<!-- INCORRECT -->\n<mds-label label=\"Categoria\">\n  <button onclick=\"remove()\">x</button>\n</mds-label>\n\n<!-- CORRECT -->\n<mds-label label=\"Categoria\" deletable></mds-label>\n```\n\n#### Customize via Documented Vars, Not Internal Selectors\n\nThe supported customization surface is `--mds-label-*` CSS custom properties. Targeting shadow internals via `::part()`, `>>>`, or undocumented class names couples your code to the Shadow DOM implementation and will break on minor releases.\n\n```css\n/* INCORRECT */\nmds-label >>> .text {\n  font-weight: bold;\n}\n\n/* CORRECT */\nmds-label {\n  --mds-label-background: rgb(var(--label-blue-08));\n  --mds-label-color: rgb(var(--label-blue-02));\n}\n```\n"
      },
      "props": [
        {
          "name": "deletable",
          "type": "boolean",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean",
            "references": {}
          },
          "mutable": false,
          "attr": "deletable",
          "reflectToAttr": false,
          "docs": "Enables the cross icon to perform cancel/delete action on element",
          "docsTags": [
            {
              "name": "default",
              "text": "false"
            }
          ],
          "default": "false",
          "values": [
            {
              "type": "boolean"
            }
          ],
          "optional": false,
          "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": "The label of the component",
          "docsTags": [],
          "values": [
            {
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "tone",
          "type": "\"strong\" | \"weak\"",
          "complexType": {
            "original": "ToneMinimalVariantType",
            "resolved": "\"strong\" | \"weak\"",
            "references": {
              "ToneMinimalVariantType": {
                "location": "import",
                "path": "@type/tone",
                "id": "src/type/tone.ts::ToneMinimalVariantType",
                "referenceLocation": "ToneMinimalVariantType"
              }
            }
          },
          "mutable": false,
          "attr": "tone",
          "reflectToAttr": true,
          "docs": "Sets the tone of the color variant",
          "docsTags": [
            {
              "name": "default",
              "text": "'weak'"
            }
          ],
          "default": "'weak'",
          "values": [
            {
              "value": "strong",
              "type": "string"
            },
            {
              "value": "weak",
              "type": "string"
            }
          ],
          "optional": false,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "truncate",
          "type": "\"all\" | \"none\" | \"word\" | undefined",
          "complexType": {
            "original": "TypographyTruncateType",
            "resolved": "\"all\" | \"none\" | \"word\" | undefined",
            "references": {
              "TypographyTruncateType": {
                "location": "import",
                "path": "@type/text",
                "id": "src/type/text.ts::TypographyTruncateType",
                "referenceLocation": "TypographyTruncateType"
              }
            }
          },
          "mutable": false,
          "attr": "truncate",
          "reflectToAttr": true,
          "docs": "Truncates text inside the label or displays it in multiline if needed",
          "docsTags": [
            {
              "name": "default",
              "text": "'word'"
            }
          ],
          "default": "'word'",
          "values": [
            {
              "value": "all",
              "type": "string"
            },
            {
              "value": "none",
              "type": "string"
            },
            {
              "value": "word",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "typography",
          "type": "\"caption\" | \"detail\" | \"tip\"",
          "complexType": {
            "original": "TypographyTooltipType",
            "resolved": "\"caption\" | \"detail\" | \"tip\"",
            "references": {
              "TypographyTooltipType": {
                "location": "import",
                "path": "@type/typography",
                "id": "src/type/typography.ts::TypographyTooltipType",
                "referenceLocation": "TypographyTooltipType"
              }
            }
          },
          "mutable": false,
          "attr": "typography",
          "reflectToAttr": false,
          "docs": "Specifies the typography of the element",
          "docsTags": [
            {
              "name": "default",
              "text": "'caption'"
            }
          ],
          "default": "'caption'",
          "values": [
            {
              "value": "caption",
              "type": "string"
            },
            {
              "value": "detail",
              "type": "string"
            },
            {
              "value": "tip",
              "type": "string"
            }
          ],
          "optional": false,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "variant",
          "type": "\"amaranth\" | \"aqua\" | \"blue\" | \"error\" | \"green\" | \"info\" | \"lime\" | \"orange\" | \"orchid\" | \"purple\" | \"red\" | \"sky\" | \"success\" | \"violet\" | \"warning\" | \"yellow\"",
          "complexType": {
            "original": "MdsLabelVariantType",
            "resolved": "\"amaranth\" | \"aqua\" | \"blue\" | \"error\" | \"green\" | \"info\" | \"lime\" | \"orange\" | \"orchid\" | \"purple\" | \"red\" | \"sky\" | \"success\" | \"violet\" | \"warning\" | \"yellow\"",
            "references": {
              "MdsLabelVariantType": {
                "location": "local",
                "path": "/home/runner/work/magma/magma/projects/stencil/src/components/mds-label/mds-label.tsx",
                "id": "src/components/mds-label/mds-label.tsx::MdsLabelVariantType"
              }
            }
          },
          "mutable": false,
          "attr": "variant",
          "reflectToAttr": true,
          "docs": "Sets the theme variant colors",
          "docsTags": [
            {
              "name": "default",
              "text": "'sky'"
            }
          ],
          "default": "'sky'",
          "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": "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"
            }
          ],
          "optional": false,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [
        {
          "event": "mdsLabelDelete",
          "detail": "void",
          "bubbles": true,
          "complexType": {
            "original": "void",
            "resolved": "void",
            "references": {}
          },
          "cancelable": true,
          "composed": true,
          "docs": "Emits when the label has to be cancelled",
          "docsTags": []
        }
      ],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-label-background",
          "annotation": "prop",
          "docs": "The background color of the label component.",
          "visibility": "public"
        },
        {
          "name": "--mds-label-button-background",
          "annotation": "prop",
          "docs": "The background color of a button inside the label.",
          "visibility": "internal"
        },
        {
          "name": "--mds-label-button-background-hover",
          "annotation": "prop",
          "docs": "The background color of the button when hovered.",
          "visibility": "internal"
        },
        {
          "name": "--mds-label-button-icon-color",
          "annotation": "prop",
          "docs": "The color of the icon inside the button.",
          "visibility": "internal"
        },
        {
          "name": "--mds-label-color",
          "annotation": "prop",
          "docs": "The text color of the label.",
          "visibility": "public"
        },
        {
          "name": "--mds-label-icon-color",
          "annotation": "prop",
          "docs": "The color applied to any icon inside the label.",
          "visibility": "internal"
        },
        {
          "name": "--mds-label-selection-background",
          "annotation": "prop",
          "docs": "The background color applied when the label is selected.",
          "visibility": "internal"
        },
        {
          "name": "--mds-label-selection-color",
          "annotation": "prop",
          "docs": "The text color applied when the label is selected.",
          "visibility": "internal"
        }
      ],
      "slots": [],
      "parts": [],
      "states": [],
      "dependents": [],
      "dependencies": [
        "mds-text",
        "mds-button"
      ],
      "dependencyGraph": {
        "mds-label": [
          "mds-text",
          "mds-button"
        ],
        "mds-button": [
          "mds-icon",
          "mds-spinner",
          "mds-text"
        ]
      },
      "storybook": "ui-label--docs"
    }
  ]
}
