{
  "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-policy-ai/mds-policy-ai.tsx",
      "encapsulation": "shadow",
      "tag": "mds-policy-ai",
      "docs": "",
      "docsTags": [
        {
          "name": "part",
          "text": "icon - Selects the `icon` component wrapped in shadowDOM, will be found only if attirbute `variant` is set to `icon`."
        },
        {
          "name": "part",
          "text": "chip - Selects the `mds-chip` wrapped in shadowDOM, will be found only if attirbute `variant` is set to `chip`."
        },
        {
          "name": "part",
          "text": "chip-wrapper - Selects the wrapper of the chip and of its dropdown, will be found only if attirbute `variant` is set to `chip`."
        },
        {
          "name": "part",
          "text": "card - Selects the `card` component wrapped in shadowDOM, will be found only if attirbute `variant` is set to `card`."
        },
        {
          "name": "part",
          "text": "banner - Selects the `banner` component wrapped in shadowDOM, will be found only if attirbute `variant` is set to `banner`."
        },
        {
          "name": "category",
          "text": "tags"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-policy-ai>` web component is the Magma Design System disclosure marker that flags AI-generated content as produced by MIA (Maggioli's artificial intelligence) and links to the official AI usage policy. It is a presentational compound component with no native HTML primitive, rendering one of four interchangeable surfaces (icon, chip, card, banner).\n\n#### Semantic Behavior\n\n- **Variant-exclusive rendering**: Exactly one surface is mounted per the `variant` value, exposed through the matching shadow part (`icon`, `chip`, `card`, `banner`).\n- **Localization**: Supplies all default copy (headline, description, link labels) in `el`, `en`, `es`, `it`, resolved from the host language.\n- **Policy navigation**: Every variant routes the user to the policy `href` - the `icon` variant opens it in a new tab on click, while the other variants embed a button link to it.\n- **Content fallbacks**: `headline` and `description` override the localized defaults where the active variant uses them; otherwise the built-in MIA disclosure text is shown.\n\n#### Properties & Visual Configurations\n\n- **`variant`** selects the disclosure surface and is the primary configuration knob. Each value carries a distinct placement intent:\n  - **`'chip'`** (default): a compact \"Generated with MIA\" chip with a hover dropdown holding the disclaimer and policy link - for inline placement next to generated text.\n  - **`'icon'`**: a minimal help glyph with a tooltip - for the most space-constrained contexts.\n  - **`'card'`**: a small card pairing the disclaimer with a policy button - for sidebars or standalone blocks.\n  - **`'banner'`**: a full-width banner with title, description, and action - for prominent page-level notices.\n- **`headline`** sets the short title used by the `chip`, `icon`, and `banner` surfaces; **`description`** sets the longer disclaimer body shown across the variants that expose it.\n- **`href`** points to the AI policy page and defaults to the Maggioli EU AI-regulation article; override it to target a tenant-specific policy.\n\nThe internal surfaces are fixed to `variant=\"ai\"` of their underlying Magma components (the chip at its default `strong` tone, the banner and the buttons at `tone=\"weak\"`) and are not configurable from this component; the shared variant/tone ladder is documented in [`agents/variants.md`](../../../../agents/variants.md).\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-policy-ai>` 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#### Default Chip - Inline Disclosure Next to Generated Text\n\nThe default form. Drop the component directly after AI-generated content with no additional attributes. The built-in \"Generato con MIA\" chip appears with a hover dropdown linking to the policy page.\n\n```html\n<mds-text typography=\"paragraph\">\n  Il presente estratto e' stato generato automaticamente dall'intelligenza artificiale MIA.\n</mds-text>\n<mds-policy-ai></mds-policy-ai>\n```\n\n#### Explicit Chip Variant\n\nDeclare `variant=\"chip\"` explicitly when component selection is driven by configuration or template logic. Behavior is identical to the default.\n\n```html\n<mds-policy-ai variant=\"chip\"></mds-policy-ai>\n```\n\n#### Custom Headline and Description on the Chip\n\nOverride the localized defaults with `headline` and `description` when the tenant's disclosure copy differs from the built-in MIA text. Both attributes reflect on the host element and are safe to drive from CSS attribute selectors.\n\n```html\n<mds-policy-ai\n  variant=\"chip\"\n  headline=\"Estratto generato con AI\"\n  description=\"L'estratto che stai leggendo e' stato generato tramite i nostri servizi di intelligenza artificiale e potrebbe contenere inesattezze.\"\n></mds-policy-ai>\n```\n\n#### Icon Variant - Space-Constrained Placement\n\nUse `variant=\"icon\"` when available space is too narrow for a chip - for example, overlaid on a thumbnail image. The icon opens the policy URL in a new tab on click and shows a tooltip with the disclosure text on hover.\n\n```html\n<div class=\"relative\">\n  <mds-policy-ai variant=\"icon\" class=\"absolute bottom-200 right-200 z-10\"></mds-policy-ai>\n  <mds-img src=\"./copertina-documento.webp\" alt=\"Copertina del documento\" class=\"rounded-(--magma-radius-md) shadow-sm\"></mds-img>\n</div>\n```\n\n#### Card Variant - Sidebar or Standalone Block\n\nUse `variant=\"card\"` when the disclosure needs more visual weight than a chip but is not a page-level notice. A compact card renders the disclaimer text and a policy button. Supply `description` to replace the default body copy.\n\n```html\n<mds-policy-ai\n  variant=\"card\"\n  description=\"Le FAQ che stai leggendo sono generate tramite i nostri servizi di intelligenza artificiale e potrebbero contenere inesattezze.\"\n></mds-policy-ai>\n```\n\n#### Banner Variant - Page-Level Notice\n\nUse `variant=\"banner\"` at the top or bottom of AI-heavy pages where a prominent notice is required. The banner renders a full-width tile with headline, description, and a policy action button. Override both props to match the page context.\n\n```html\n<mds-policy-ai\n  variant=\"banner\"\n  headline=\"Contenuto generato con intelligenza artificiale\"\n  description=\"Questo testo e' stato generato automaticamente tramite MIA e potrebbe contenere inesattezze. Ti invitiamo a verificarne l'accuratezza e a consultare fonti ufficiali.\"\n></mds-policy-ai>\n```\n\n#### Custom Policy URL via `href`\n\nThe default `href` points to the Maggioli EU AI-regulation article. Override it to link to a tenant-specific policy page. All four variants route the user to the same `href`.\n\n```html\n<mds-policy-ai\n  variant=\"banner\"\n  href=\"https://example.com/informativa-intelligenza-artificiale\"\n></mds-policy-ai>\n```\n\n#### Styling via Shadow Parts\n\nEach variant exposes a named `::part()`: `icon`, `chip` and `banner` are the inner [`mds-help`](../mds-help/AGENTS.md), [`mds-chip`](../mds-chip/AGENTS.md) and [`mds-banner`](../mds-banner/AGENTS.md) elements, so their public CSS custom properties can be set there; `card` is the card container, and the chip variant adds `chip-wrapper`, the wrapper around the chip and its dropdown. Use these only for a deep customization.\n\n```css\n/* Increase the border radius of the card surface */\nmds-policy-ai::part(card) {\n  border-radius: var(--magma-radius-xl);\n}\n\n/* A border on the chip itself: chip-wrapper would reach its dropdown too */\nmds-policy-ai::part(chip) {\n  border: 1px solid rgb(var(--magma-accent-ai-border));\n}\n\n/* An AI tint for the banner surface */\nmds-policy-ai::part(banner) {\n  --mds-banner-background: rgb(var(--magma-accent-ai-surface));\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-policy-ai>`. 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 Custom Content Into the Component\n\n`<mds-policy-ai>` has no public slots. All customization is done through the `headline`, `description`, and `href` props. Placing children inside the element has no effect - the shadow DOM ignores them entirely.\n\n```html\n<!-- INCORRECT -->\n<mds-policy-ai>\n  <p>Contenuto generato con intelligenza artificiale.</p>\n</mds-policy-ai>\n\n<!-- CORRECT -->\n<mds-policy-ai\n  description=\"Contenuto generato con intelligenza artificiale.\"\n></mds-policy-ai>\n```\n\n#### Do Not Use `variant` to Choose a Color - Use It to Choose a Surface\n\n`variant` is not a color knob. It selects the entire rendering surface (`icon`, `chip`, `card`, `banner`), each carrying a distinct placement intent. Choosing a value because it looks lighter or darker will produce the wrong layout for the context.\n\n```html\n<!-- INCORRECT - choosing \"icon\" because the space is small while also expecting the description on the page: the icon shows it only in a hover tooltip -->\n<mds-policy-ai\n  variant=\"icon\"\n  description=\"Questo testo e' stato generato con AI e potrebbe contenere inesattezze. Verifica le informazioni.\"\n></mds-policy-ai>\n\n<!-- CORRECT - \"card\" renders the description body as intended in compact contexts -->\n<mds-policy-ai\n  variant=\"card\"\n  description=\"Questo testo e' stato generato con AI e potrebbe contenere inesattezze. Verifica le informazioni.\"\n></mds-policy-ai>\n```\n\n#### Do Not Pierce the Shadow DOM to Restyle Inner Components\n\nThe shadow parts `chip`, `icon`, `card`, and `banner` are the documented customization surface. Reaching into undocumented internals with `>>>`, `/deep/`, or class selectors will break on any minor release.\n\n```css\n/* INCORRECT */\nmds-policy-ai >>> mds-chip {\n  background-color: red;\n}\n\n/* CORRECT - target the part and set the inner component's own CSS custom property */\nmds-policy-ai::part(banner) {\n  --mds-banner-radius: var(--magma-radius-xl);\n}\n```\n\n#### Do Not Wrap in a Native `<a>` to Override the Policy Link\n\nThe component manages its own `href` routing on every variant. Nesting it inside an `<a>` creates overlapping interactive controls, breaks keyboard navigation, and does not override the internal link - it adds a second, outer link on top.\n\n```html\n<!-- INCORRECT -->\n<a href=\"https://example.com/policy-ai\">\n  <mds-policy-ai variant=\"chip\"></mds-policy-ai>\n</a>\n\n<!-- CORRECT - override the href prop to point to the tenant-specific page -->\n<mds-policy-ai\n  variant=\"chip\"\n  href=\"https://example.com/policy-ai\"\n></mds-policy-ai>\n```\n\n#### Do Not Use `headline` on the Card Variant - It Has No Effect There\n\nThe `card` variant does not render a headline - only `description` is shown. Passing `headline` to a card is silently ignored. Use `variant=\"banner\"` when both a title and a body are required.\n\n```html\n<!-- INCORRECT - headline is ignored by variant=\"card\" -->\n<mds-policy-ai\n  variant=\"card\"\n  headline=\"Contenuto generato con AI\"\n  description=\"Questo estratto e' stato generato automaticamente.\"\n></mds-policy-ai>\n\n<!-- CORRECT - use banner when both headline and description must appear -->\n<mds-policy-ai\n  variant=\"banner\"\n  headline=\"Contenuto generato con AI\"\n  description=\"Questo estratto e' stato generato automaticamente.\"\n></mds-policy-ai>\n```\n"
      },
      "props": [
        {
          "name": "description",
          "type": "string | undefined",
          "complexType": {
            "original": "string",
            "resolved": "string | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "description",
          "reflectToAttr": true,
          "docs": "Sets the description to custom component long text",
          "docsTags": [],
          "values": [
            {
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "headline",
          "type": "string | undefined",
          "complexType": {
            "original": "string",
            "resolved": "string | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "headline",
          "reflectToAttr": true,
          "docs": "Sets the headline to custom component text",
          "docsTags": [],
          "values": [
            {
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "href",
          "type": "string | undefined",
          "complexType": {
            "original": "string",
            "resolved": "string | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "href",
          "reflectToAttr": true,
          "docs": "Sets the pointing URL of the component",
          "docsTags": [
            {
              "name": "default",
              "text": "'https://www.maggiolieditore.it/il-regolamento-europeo-sull-intelligenza-artificiale.html'"
            }
          ],
          "default": "'https://www.maggiolieditore.it/il-regolamento-europeo-sull-intelligenza-artificiale.html'",
          "values": [
            {
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "variant",
          "type": "\"banner\" | \"card\" | \"chip\" | \"icon\" | undefined",
          "complexType": {
            "original": "PolicyAiVariant",
            "resolved": "\"banner\" | \"card\" | \"chip\" | \"icon\" | undefined",
            "references": {
              "PolicyAiVariant": {
                "location": "import",
                "path": "./meta/types",
                "id": "src/components/mds-policy-ai/meta/types.ts::PolicyAiVariant",
                "referenceLocation": "PolicyAiVariant"
              }
            }
          },
          "mutable": false,
          "attr": "variant",
          "reflectToAttr": true,
          "docs": "Sets the variant type of the component",
          "docsTags": [
            {
              "name": "default",
              "text": "'chip'"
            }
          ],
          "default": "'chip'",
          "values": [
            {
              "value": "banner",
              "type": "string"
            },
            {
              "value": "card",
              "type": "string"
            },
            {
              "value": "chip",
              "type": "string"
            },
            {
              "value": "icon",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [],
      "listeners": [],
      "styles": [],
      "slots": [],
      "parts": [
        {
          "name": "banner",
          "docs": "Selects the `banner` component wrapped in shadowDOM, will be found only if attirbute `variant` is set to `banner`."
        },
        {
          "name": "card",
          "docs": "Selects the `card` component wrapped in shadowDOM, will be found only if attirbute `variant` is set to `card`."
        },
        {
          "name": "chip",
          "docs": "Selects the `mds-chip` wrapped in shadowDOM, will be found only if attirbute `variant` is set to `chip`."
        },
        {
          "name": "chip-wrapper",
          "docs": "Selects the wrapper of the chip and of its dropdown, will be found only if attirbute `variant` is set to `chip`."
        },
        {
          "name": "icon",
          "docs": "Selects the `icon` component wrapped in shadowDOM, will be found only if attirbute `variant` is set to `icon`."
        }
      ],
      "states": [],
      "dependents": [],
      "dependencies": [
        "mds-help",
        "mds-text",
        "mds-chip",
        "mds-dropdown",
        "mds-button",
        "mds-icon",
        "mds-banner"
      ],
      "dependencyGraph": {
        "mds-policy-ai": [
          "mds-help",
          "mds-text",
          "mds-chip",
          "mds-dropdown",
          "mds-button",
          "mds-icon",
          "mds-banner"
        ],
        "mds-help": [
          "mds-icon",
          "mds-tooltip"
        ],
        "mds-tooltip": [
          "mds-text"
        ],
        "mds-chip": [
          "mds-icon",
          "mds-text",
          "mds-button"
        ],
        "mds-button": [
          "mds-icon",
          "mds-spinner",
          "mds-text"
        ],
        "mds-banner": [
          "mds-icon",
          "mds-text",
          "mds-button"
        ]
      },
      "storybook": "ui-policy-ai--docs"
    }
  ]
}
