{
  "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-input-tip/mds-input-tip.tsx",
      "encapsulation": "shadow",
      "tag": "mds-input-tip",
      "docs": "",
      "docsTags": [
        {
          "name": "slot",
          "text": "- Add `mds-input-tip-item` elements or `components` to this slot."
        },
        {
          "name": "parent",
          "text": "mds-input mds-input-date mds-input-select"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-input-tip>` web component is the floating helper container of the Magma Design System input family: it overlays an input field and carries supplementary content (slotted `mds-input-tip-item` chips: status labels, hints, counters) that slides into place when the field becomes active. It is a presentational compound child positioned against its parent input rather than a standalone control.\n\n#### Semantic Behavior\n\n- **Floating overlay**: The tip floats over the parent input's edge without intercepting interaction (`pointer-events: none`, which `mds-input-tip-item` keeps too).\n- **Active expansion**: Setting `active` slides a bottom tip onto the edge of the input; clearing it collapses the tip back flush with the input. A top tip stays where it stands, on the top border. It does not expand the items: each `mds-input-tip-item` shows its text only when its own `expanded` is set.\n- **On the top border**: A top tip stands on the top border of its field, half outside, so that it never covers the button at the end of the field. It keeps clear of the rounded corner by the radius of the field, which the field passes down to it, plus a margin, and sits on the straight part of the border.\n- **Empty collapse**: When the host has no slotted content it is hidden entirely, so an unused tip occupies no space.\n- **Default slot is content**: The single default slot carries the tip's arbitrary children; there are no named slots, events, form association, or focus management of its own.\n\n#### Properties & Visual Configurations\n\n- **`active`** drives the expanded vs. collapsed state and is normally toggled by the parent input in response to focus, not set manually.\n- **`position`** selects which edge of the input the tip anchors to: `'top'` (default) stands on the top border of the field, half outside, and stays there on focus; `'bottom'` sits inside the bottom edge and slides onto it when `active`.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-input-tip>` 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`<mds-input-tip>` is an internal compound child used inside [`mds-input`](../mds-input/AGENTS.md), [`mds-input-date`](../mds-input-date/AGENTS.md), and [`mds-input-select`](../mds-input-select/AGENTS.md). It is not meant for standalone use. The patterns below show what the parent components render internally, which is useful when building a custom input wrapper that needs the same behavior.\n\n#### Status Chips Above the Field (position=\"top\")\n\nPosition the tip on the top border of the input with `position=\"top\"` (the default), half outside, where it never covers the button at the end of the field. Slot [`mds-input-tip-item`](../mds-input-tip-item/AGENTS.md) children for each status badge to show. The parent inputs pass down the radius of their field, so that the tip keeps clear of its rounded corner. The top tip stays on the border when the field is focused; each item shows its label only when its own `expanded` is set, which the parent inputs set together with `active`.\n\n```html\n<div style=\"position: relative;\">\n  <mds-input-tip position=\"top\" active>\n    <mds-input-tip-item variant=\"required\" expanded></mds-input-tip-item>\n  </mds-input-tip>\n  <input type=\"text\" placeholder=\"Campo obbligatorio\" />\n</div>\n```\n\n#### Hint and Counter Below the Field (position=\"bottom\")\n\nUse `position=\"bottom\"` to anchor the tip below the input. This is the canonical placement for inline helper text and character-count feedback.\n\n```html\n<div style=\"position: relative;\">\n  <mds-input-tip position=\"bottom\" active>\n    <mds-input-tip-item variant=\"text\" expanded>\n      Inserisci almeno 8 caratteri\n    </mds-input-tip-item>\n    <mds-input-tip-item variant=\"count-incomplete\" expanded>\n      3 / 8\n    </mds-input-tip-item>\n  </mds-input-tip>\n  <input type=\"text\" />\n</div>\n```\n\n#### Toggling the Active State on Focus\n\nDrive `active`, and the `expanded` of the items that should open on focus, from a focus/blur handler to animate the tip in and out. Setting `active` slides a bottom tip onto the edge of the input, and removing it (or leaving it unset) collapses it back flush with it; a top tip stays on the border, and only its items expand.\n\n```html\n<div style=\"position: relative;\" id=\"wrapper\">\n  <mds-input-tip position=\"top\" id=\"tip\">\n    <mds-input-tip-item variant=\"required\"></mds-input-tip-item>\n  </mds-input-tip>\n  <input\n    type=\"text\"\n    id=\"field\"\n    placeholder=\"Nome utente\"\n  />\n</div>\n\n<script>\n  const field = document.getElementById('field');\n  const tip   = document.getElementById('tip');\n  const item  = tip.querySelector('mds-input-tip-item');\n  field.addEventListener('focus', () => { tip.active = true; item.expanded = true; });\n  field.addEventListener('blur',  () => { tip.active = undefined; item.expanded = undefined; });\n</script>\n```\n\n#### Disabled and Read-only State Chips\n\nWhen the parent input is disabled or read-only, pass the matching `variant` to show a system-translated label. The `expanded` prop on the item keeps it permanently visible even without focus.\n\n```html\n<div style=\"position: relative;\">\n  <mds-input-tip position=\"top\">\n    <mds-input-tip-item variant=\"disabled\" expanded></mds-input-tip-item>\n  </mds-input-tip>\n  <input type=\"text\" disabled placeholder=\"Campo disabilitato\" />\n</div>\n```\n\n#### Required-field Success Feedback\n\nSwitch the `<mds-input-tip-item>` variant to `required-success` once the field passes validation. The item renders a checkmark icon instead of the \"obbligatorio\" label.\n\n```html\n<div style=\"position: relative;\">\n  <mds-input-tip position=\"top\" active>\n    <mds-input-tip-item variant=\"required-success\" expanded></mds-input-tip-item>\n  </mds-input-tip>\n  <input type=\"text\" value=\"Valore valido\" />\n</div>\n```\n\n#### Multiple Tip Items in One Container\n\nSlot several `<mds-input-tip-item>` elements inside a single `<mds-input-tip>`. The container lays them out in a row and hides itself automatically when it has no children.\n\n```html\n<div style=\"position: relative;\">\n  <mds-input-tip position=\"bottom\" active>\n    <mds-input-tip-item variant=\"text\" expanded>\n      Solo lettere e numeri\n    </mds-input-tip-item>\n    <mds-input-tip-item variant=\"count-almost\" expanded>\n      18 / 20\n    </mds-input-tip-item>\n  </mds-input-tip>\n  <input type=\"text\" />\n</div>\n```\n\n#### CSS Customization\n\nStyle the tip only through its public `--mds-input-tip-background` CSS custom property; its offsets come from `position` and `active`. Set it on the host or a parent selector; use the semantic color roles via `rgb(var(--magma-<role>))` ([`agents/color.md`](../../../../agents/color.md)) so dark mode keeps working.\n\n```css\n.custom-input-wrapper mds-input-tip {\n  --mds-input-tip-background: rgb(var(--magma-surface-inverse));\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-input-tip>`. 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 mds-input-tip as a Standalone Tooltip\n\n`<mds-input-tip>` is an internal compound child of [`mds-input`](../mds-input/AGENTS.md), [`mds-input-date`](../mds-input-date/AGENTS.md), and [`mds-input-select`](../mds-input-select/AGENTS.md). It relies on absolute positioning inside a relatively-positioned input shell; outside that context it has no anchor. Use [`mds-tooltip`](../mds-tooltip/AGENTS.md) or [`mds-help`](../mds-help/AGENTS.md) for standalone floating hints.\n\n```html\n<!-- INCORRECT -->\n<mds-input-tip active>\n  <mds-input-tip-item variant=\"text\">Suggerimento generico</mds-input-tip-item>\n</mds-input-tip>\n\n<!-- CORRECT -->\n<mds-help>Suggerimento generico</mds-help>\n```\n\n#### Do Not Put Plain Text Directly in the Default Slot\n\nThe default slot of `<mds-input-tip>` accepts only [`mds-input-tip-item`](../mds-input-tip-item/AGENTS.md) elements. Plain text nodes are not styled or accessible. Use `<mds-input-tip-item variant=\"text\">` to carry freeform hint copy.\n\n```html\n<!-- INCORRECT -->\n<mds-input-tip position=\"bottom\" active>\n  Inserisci la tua email aziendale\n</mds-input-tip>\n\n<!-- CORRECT -->\n<mds-input-tip position=\"bottom\" active>\n  <mds-input-tip-item variant=\"text\">\n    Inserisci la tua email aziendale\n  </mds-input-tip-item>\n</mds-input-tip>\n```\n\n#### Do Not Set active=\"false\" to Collapse the Tip\n\n`active` is a boolean attribute: remove it (or set the prop to `undefined`) to collapse. A string value is fragile: `\"false\"` is read as `false` on this component, but the attribute stays on the element until the component renders (attribute selectors and scripts reading it see it set). Never write a boolean as a string.\n\n```html\n<!-- INCORRECT -->\n<mds-input-tip position=\"top\" active=\"false\">\n  <mds-input-tip-item variant=\"required\"></mds-input-tip-item>\n</mds-input-tip>\n\n<!-- CORRECT -->\n<mds-input-tip position=\"top\">\n  <mds-input-tip-item variant=\"required\"></mds-input-tip-item>\n</mds-input-tip>\n```\n\n#### Do Not Use an Undocumented position Value\n\n`position` accepts only `\"top\"` and `\"bottom\"`. Any other value (e.g. `\"left\"`, `\"right\"`) is not typed and has no matching CSS rule; the tip falls back to the initial-value behavior silently.\n\n```html\n<!-- INCORRECT -->\n<mds-input-tip position=\"left\" active>\n  <mds-input-tip-item variant=\"text\">Aiuto</mds-input-tip-item>\n</mds-input-tip>\n\n<!-- CORRECT -->\n<mds-input-tip position=\"bottom\" active>\n  <mds-input-tip-item variant=\"text\">Aiuto</mds-input-tip-item>\n</mds-input-tip>\n```\n\n#### Do Not Slot Non-tip-item Elements for Custom Styles\n\nSlotting arbitrary HTML or other Magma components (e.g. `<mds-badge>`, `<span>`) bypasses the item's own layout, color tokens, and border-radius joining logic. Always wrap content in `<mds-input-tip-item>`.\n\n```html\n<!-- INCORRECT -->\n<mds-input-tip position=\"bottom\" active>\n  <span style=\"color: red;\">Testo personalizzato</span>\n</mds-input-tip>\n\n<!-- CORRECT -->\n<mds-input-tip position=\"bottom\" active>\n  <mds-input-tip-item variant=\"text\">Testo personalizzato</mds-input-tip-item>\n</mds-input-tip>\n```\n\n#### Do Not Override Positioning via Inline Styles\n\nThe tip is absolutely positioned by its own CSS, driven by its `position` and `active` props. Setting `position`, `top`, `left`, or `right` inline breaks the animation transform and the active-state offset calculation.\n\n```css\n/* INCORRECT */\nmds-input-tip {\n  position: relative;\n  top: 10px;\n}\n```\n\n```html\n<!-- CORRECT -->\n<div style=\"position: relative;\">\n  <mds-input-tip position=\"bottom\" active>\n    <mds-input-tip-item variant=\"text\" expanded>Inserisci almeno 8 caratteri</mds-input-tip-item>\n  </mds-input-tip>\n  <input type=\"text\" />\n</div>\n```\n"
      },
      "props": [
        {
          "name": "active",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "active",
          "reflectToAttr": true,
          "docs": "Moves the bottom tip onto the edge of the input, as the parent input does while it has the\nfocus; the top tip stays on the border of the field. It does not expand the items: each\n`mds-input-tip-item` opens on its own `expanded`",
          "docsTags": [
            {
              "name": "default",
              "text": "false"
            }
          ],
          "default": "false",
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "position",
          "type": "\"bottom\" | \"top\" | undefined",
          "complexType": {
            "original": "InputTipPositionType",
            "resolved": "\"bottom\" | \"top\" | undefined",
            "references": {
              "InputTipPositionType": {
                "location": "import",
                "path": "./meta/types",
                "id": "src/components/mds-input-tip/meta/types.ts::InputTipPositionType",
                "referenceLocation": "InputTipPositionType"
              }
            }
          },
          "mutable": false,
          "attr": "position",
          "reflectToAttr": true,
          "docs": "Specifies the position of the element relative to its container: `top` stands on the top\nborder of the field, half outside, clear of its corner by the radius the field passes down plus\na margin; `bottom` sits inside the bottom edge",
          "docsTags": [
            {
              "name": "default",
              "text": "'top'"
            }
          ],
          "default": "'top'",
          "values": [
            {
              "value": "bottom",
              "type": "string"
            },
            {
              "value": "top",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-input-tip-active-translate",
          "annotation": "prop",
          "docs": "Transform applied to the bottom tip when active",
          "visibility": "internal"
        },
        {
          "name": "--mds-input-tip-background",
          "annotation": "prop",
          "docs": "Background color of the input tip",
          "visibility": "public"
        },
        {
          "name": "--mds-input-tip-field-radius",
          "annotation": "prop",
          "docs": "The corner radius of the field the tip stands on: the top tip keeps clear of the corner by it, plus a margin",
          "visibility": "internal"
        },
        {
          "name": "--mds-input-tip-horizontal-offset",
          "annotation": "prop",
          "docs": "Default horizontal offset of the bottom tip",
          "visibility": "internal"
        },
        {
          "name": "--mds-input-tip-horizontal-offset-focused",
          "annotation": "prop",
          "docs": "Horizontal offset of the bottom tip when the input is focused",
          "visibility": "internal"
        },
        {
          "name": "--mds-input-tip-vertical-offset",
          "annotation": "prop",
          "docs": "Vertical offset of the bottom tip",
          "visibility": "internal"
        }
      ],
      "slots": [
        {
          "name": "",
          "docs": "Add `mds-input-tip-item` elements or `components` to this slot."
        }
      ],
      "parts": [],
      "states": [],
      "dependents": [
        "mds-input",
        "mds-input-date",
        "mds-input-select"
      ],
      "dependencies": [],
      "dependencyGraph": {
        "mds-input": [
          "mds-input-tip"
        ],
        "mds-input-date": [
          "mds-input-tip"
        ],
        "mds-input-select": [
          "mds-input-tip"
        ]
      },
      "storybook": "form-input-tip--docs"
    }
  ]
}
