{
  "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-help/mds-help.tsx",
      "encapsulation": "shadow",
      "tag": "mds-help",
      "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": "slot",
          "text": "- Add `text string` to this slot, **avoid** `HTML elements` or `components`."
        },
        {
          "name": "part",
          "text": "icon - The icon that shows the help text in a tooltip"
        },
        {
          "name": "category",
          "text": "overlays"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-help>` web component is a contextual help affordance of the Magma Design System: a small help icon that reveals an explanatory tooltip on interaction. It composes [`mds-icon`](../mds-icon/AGENTS.md) and [`mds-tooltip`](../mds-tooltip/AGENTS.md) into a single drop-in element, so there is no native HTML primitive it replaces.\n\n#### Semantic Behavior\n\n- **Tooltip-on-icon**: The host always renders a help icon and anchors a tooltip to it; the slotted text becomes the tooltip body and is shown while the pointer hovers the icon or the icon has the focus. The icon is a tab stop named by the tooltip text (`role=\"img\"` with `aria-labelledby`), so a screen reader reads the help on it.\n- **Auto-placement**: Unless `disableAutoPlacement` is set (auto-placement is on by default), the tooltip takes `placement` whenever it has room there, and moves to another side of the icon only when it does not fit.\n- **Default-slot is text**: The default slot is intended for a plain text string only; HTML elements or components in the slot are discouraged because the content is rendered inside the tooltip.\n\n#### Properties & Visual Configurations\n\n- **`icon`** is an SVG filename slug from the Magma icon library; when omitted, the component falls back to the standard outline help glyph, so set it only to convey a help affordance other than the default question mark.\n- **`placement`** sets the preferred side of the icon on which the tooltip appears (e.g. `'top'`, `'bottom-start'`). It is kept whenever it has room; auto-placement moves the tooltip away from it only when it does not fit.\n- **`disableAutoPlacement`** turns off dynamic repositioning. Leave it off in scrollable or edge-of-viewport contexts; set it only when you need the tooltip pinned strictly to the `placement` side.\n\nThe tooltip's dimensions and reveal timing are tuned via the CSS custom properties documented in [`AGENTS.md`](AGENTS.md) (`--mds-help-tooltip-width`, `--mds-help-tooltip-min-width`, `--mds-help-tooltip-max-width`, `--mds-help-tooltip-delay`).\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-help>` 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 Help\n\nThe canonical form. Drop `<mds-help>` inline next to a label or piece of text and slot in a plain string explaining the concept. The tooltip appears on hover and on keyboard focus of the help icon.\n\n```html\n<p>\n  Periodo di fatturazione\n  <mds-help>Il ciclo di fatturazione inizia il primo giorno del mese e termina l'ultimo.</mds-help>\n</p>\n```\n\n#### Placement Preference\n\nUse the `placement` prop to suggest a preferred side for the tooltip. The default is `top`; change it when the element sits near a viewport edge.\n\n```html\n<!-- Default: tooltip above the icon -->\n<mds-help placement=\"top\">Inserire il codice fiscale a 16 caratteri.</mds-help>\n\n<!-- Tooltip to the right, useful for left-aligned form labels -->\n<mds-help placement=\"right\">Il campo e' obbligatorio per la registrazione.</mds-help>\n\n<!-- Tooltip below, e.g. inside a sticky header bar -->\n<mds-help placement=\"bottom\">Clicca per espandere il pannello dei filtri.</mds-help>\n```\n\n#### Disabling Auto-Placement\n\nAuto-placement is enabled by default and moves the tooltip away from `placement` only when it has no room there. Add `disable-auto-placement` only when you need the tooltip pinned strictly to one side - for example in a fixed overlay where you control the available space.\n\n```html\n<!-- Add disable-auto-placement to pin the tooltip to placement=\"bottom\" -->\n<mds-help placement=\"bottom\" disable-auto-placement>\n  Questa descrizione deve sempre apparire in basso.\n</mds-help>\n```\n\n#### Custom Icon\n\nOverride the default question-mark glyph with any slug from the Magma icon library by setting the `icon` prop. Use this to match a specific visual context - for example a warning glyph when the help text explains a potentially destructive action.\n\n```html\n<mds-help icon=\"mi/baseline/info\">\n  Questa operazione puo' richiedere alcuni minuti.\n</mds-help>\n\n<mds-help icon=\"mi/baseline/warning\">\n  Attenzione: la modifica sara' applicata a tutti i documenti selezionati.\n</mds-help>\n```\n\n#### Tooltip Width Customization\n\nControl the tooltip dimensions with `--mds-help-tooltip-width`, `--mds-help-tooltip-min-width`, and `--mds-help-tooltip-max-width`. Useful when the help text is very short (narrow the tooltip) or contains several sentences (widen it).\n\n```css\n/* Wider tooltip for a multi-sentence explanation */\n.configurazione-avanzata mds-help {\n  --mds-help-tooltip-max-width: 480px;\n  --mds-help-tooltip-min-width: 300px;\n}\n\n/* Narrow tooltip for a short label */\n.campo-codice mds-help {\n  --mds-help-tooltip-max-width: 180px;\n  --mds-help-tooltip-min-width: 120px;\n}\n```\n\n#### Reveal Delay Customization\n\nIncrease `--mds-help-tooltip-delay` to prevent accidental tooltip flicker when users move their pointer across a dense form, or decrease it for touch-primary interfaces where hover is not applicable.\n\n```css\n/* Slower reveal for dense data tables */\n.tabella-dati mds-help {\n  --mds-help-tooltip-delay: 0.6s;\n}\n\n/* Faster reveal in a step-by-step wizard */\n.wizard-step mds-help {\n  --mds-help-tooltip-delay: 0.1s;\n}\n```\n\n#### Icon Part Customization\n\nTint the help icon to match a surrounding context using the documented `::part(icon)` surface. Keep using the semantic color roles so dark mode and high-contrast modes continue to work.\n\n```css\n/* Match the icon color to a warning banner context */\n.banner-warning mds-help::part(icon) {\n  fill: rgb(var(--magma-warning-text-default));\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-help>`. 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 Put HTML Elements in the Default Slot\n\nThe default slot is text-only; the content is rendered inside [`mds-tooltip`](../mds-tooltip/AGENTS.md), which expects a plain string. Nested elements or components may be stripped or break the tooltip layout.\n\n```html\n<!-- INCORRECT -->\n<mds-help>\n  <strong>Attenzione:</strong> il limite massimo e' <em>100 caratteri</em>.\n</mds-help>\n\n<!-- CORRECT -->\n<mds-help>Attenzione: il limite massimo e' 100 caratteri.</mds-help>\n```\n\n#### Do Not Pierce Shadow DOM to Style the Icon\n\nThe only supported customization surface is `--mds-help-*` CSS custom properties and the documented `::part(icon)` shadow part. Targeting internal elements via `>>>` or undocumented selectors couples your code to the shadow DOM implementation.\n\n```css\n/* INCORRECT */\nmds-help >>> mds-icon {\n  fill: red;\n}\n\n/* CORRECT */\nmds-help::part(icon) {\n  fill: rgb(var(--magma-warning-text-default));\n}\n```\n\n#### Do Not Use `<mds-help>` as a Generic Tooltip Anchor\n\n`<mds-help>` always renders its own help icon and wraps [`mds-tooltip`](../mds-tooltip/AGENTS.md) internally. It is not a generic popover wrapper. If you need a tooltip on an arbitrary element, use [`mds-tooltip`](../mds-tooltip/AGENTS.md) directly with a `target` selector.\n\n```html\n<!-- INCORRECT: slotting a custom trigger to replace the icon -->\n<mds-help>\n  <mds-button slot=\"default\" label=\"Dettagli\"></mds-button>\n  Testo di spiegazione.\n</mds-help>\n\n<!-- CORRECT: use mds-tooltip with a target for a custom trigger -->\n<mds-button id=\"info-btn\" label=\"Dettagli\"></mds-button>\n<mds-tooltip target=\"#info-btn\">Testo di spiegazione.</mds-tooltip>\n```\n\n#### Do Not Override Width with Inline Styles Instead of CSS Custom Properties\n\nSetting `style=\"width: ...\"` on the host bypasses the component's layout contract. Use the documented `--mds-help-tooltip-*` CSS custom properties to size the tooltip, and leave the host dimensions alone.\n\n```html\n<!-- INCORRECT -->\n<mds-help style=\"width: 400px;\">Descrizione del campo.</mds-help>\n\n<!-- CORRECT -->\n<style>\n  mds-help.sezione-avanzata {\n    --mds-help-tooltip-max-width: 400px;\n  }\n</style>\n<mds-help class=\"sezione-avanzata\">Descrizione del campo.</mds-help>\n```\n"
      },
      "props": [
        {
          "name": "disableAutoPlacement",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "disable-auto-placement",
          "reflectToAttr": true,
          "docs": "Pins the tooltip to `placement`: without it, the tooltip moves to another side of the icon\nwhen `placement` has no room.",
          "docsTags": [
            {
              "name": "default",
              "text": "false"
            }
          ],
          "default": "false",
          "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": false,
          "docs": "Set the name of the icon.",
          "docsTags": [],
          "values": [
            {
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "placement",
          "type": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\" | undefined",
          "complexType": {
            "original": "FloatingUIPlacement",
            "resolved": "\"bottom\" | \"bottom-end\" | \"bottom-start\" | \"left\" | \"left-end\" | \"left-start\" | \"right\" | \"right-end\" | \"right-start\" | \"top\" | \"top-end\" | \"top-start\" | undefined",
            "references": {
              "FloatingUIPlacement": {
                "location": "import",
                "path": "@type/floating-ui",
                "id": "src/type/floating-ui.ts::FloatingUIPlacement",
                "referenceLocation": "FloatingUIPlacement"
              }
            }
          },
          "mutable": false,
          "attr": "placement",
          "reflectToAttr": true,
          "docs": "Specifies where the tooltip should be placed relative to the icon: the side it takes\nwhenever it has room there.",
          "docsTags": [
            {
              "name": "default",
              "text": "'top'"
            }
          ],
          "default": "'top'",
          "values": [
            {
              "value": "bottom",
              "type": "string"
            },
            {
              "value": "bottom-end",
              "type": "string"
            },
            {
              "value": "bottom-start",
              "type": "string"
            },
            {
              "value": "left",
              "type": "string"
            },
            {
              "value": "left-end",
              "type": "string"
            },
            {
              "value": "left-start",
              "type": "string"
            },
            {
              "value": "right",
              "type": "string"
            },
            {
              "value": "right-end",
              "type": "string"
            },
            {
              "value": "right-start",
              "type": "string"
            },
            {
              "value": "top",
              "type": "string"
            },
            {
              "value": "top-end",
              "type": "string"
            },
            {
              "value": "top-start",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-help-tooltip-delay",
          "annotation": "prop",
          "docs": "The delay before the tooltip becomes visible.",
          "visibility": "public"
        },
        {
          "name": "--mds-help-tooltip-max-width",
          "annotation": "prop",
          "docs": "The maximum allowed width of the tooltip.",
          "visibility": "public"
        },
        {
          "name": "--mds-help-tooltip-min-width",
          "annotation": "prop",
          "docs": "The minimum allowed width of the tooltip.",
          "visibility": "public"
        },
        {
          "name": "--mds-help-tooltip-width",
          "annotation": "prop",
          "docs": "The width of the tooltip element.",
          "visibility": "public"
        }
      ],
      "slots": [
        {
          "name": "",
          "docs": "Add `text string` to this slot, **avoid** `HTML elements` or `components`."
        }
      ],
      "parts": [
        {
          "name": "icon",
          "docs": "The icon that shows the help text in a tooltip"
        }
      ],
      "states": [],
      "dependents": [
        "mds-policy-ai"
      ],
      "dependencies": [
        "mds-icon",
        "mds-tooltip"
      ],
      "dependencyGraph": {
        "mds-help": [
          "mds-icon",
          "mds-tooltip"
        ],
        "mds-tooltip": [
          "mds-text"
        ],
        "mds-policy-ai": [
          "mds-help"
        ]
      },
      "storybook": "ui-help--docs"
    }
  ]
}
