{
  "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-push-notification/mds-push-notification.tsx",
      "encapsulation": "shadow",
      "tag": "mds-push-notification",
      "docs": "",
      "docsTags": [
        {
          "name": "part",
          "text": "notifications - The container wrapper of the notifications."
        },
        {
          "name": "slot",
          "text": "- Add `HTML elements` or `components`, it is **recommended** to use `mds-push-notification` element."
        },
        {
          "name": "category",
          "text": "feedback"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-push-notification>` web component is the Magma Design System container that hosts and orchestrates a stack of transient notification items, managing their show/hide lifecycle, entry/exit animations, and overall visibility. It is a compound parent: its default slot holds `mds-push-notification-item` children, and it has no direct HTML primitive equivalent.\n\n#### Semantic Behavior\n\n- **Slot-driven lifecycle**: Items placed in the default slot are animated in automatically; each item animates out and is removed when closed (an item shows its close button only with `dismissible`).\n- **Built-in clear button**: The container always renders its own clear button, labelled in the page language (\"Clear notifications\", \"Cancella notifiche\"), which animates out every item and hides the container.\n- **Auto vs. manual behavior**: With `behavior=\"auto\"` the container shows itself as soon as one or more items are added; with `behavior=\"manual\"` visibility is driven only by the `visible` prop or the imperative methods.\n- **Empty-stack auto-hide**: When the last remaining item animates out, the container hides itself regardless of behavior; the clear button and `hide()` hide it too.\n- **Emitted events**: `mdsPushNotificationShow` fires when it becomes visible, `mdsPushNotificationHide` when hidden, and `mdsPushNotificationChange` on every transition carrying a `{ visible: boolean }` detail.\n- **Imperative API**: Exposes `show()` and `hide()` methods to control visibility programmatically, plus `removeNotification()` to dismiss one or an array of `mds-push-notification-item` elements with the standard outro animation.\n- **Animation timing**: The intro and outro motion of the items is set by the component; the fade-out delay and the gap between items are read from the public CSS custom properties `--mds-push-notification-fadeout-delay` and `--mds-push-notification-gap`, so they are themeable without code changes.\n\n#### Properties & Visual Configurations\n\nThe container intentionally exposes a minimal prop surface; most configuration is structural (which items you slot in) or stylistic (via CSS custom properties).\n\n#### Other behavioral props\n\n- **`behavior`** selects the visibility strategy: pick `'auto'` (default) when the stack should appear and disappear purely as a function of how many items it contains, and `'manual'` when you want explicit control over when the container is shown via `visible` or the `show()`/`hide()` methods.\n- **`visible`** is the controlled visibility flag; set it to drive the container open or closed, while reading it returns the current visibility.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-push-notification>` 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#### Minimal Auto-Managed Stack\n\nThe default `behavior=\"auto\"` configuration. Drop `mds-push-notification-item` children into the default slot and the container shows itself, animates each item in, and hides itself when all items have been dismissed. Set `dismissible` on an item to give it its own close button.\n\n```html\n<mds-push-notification>\n  <mds-push-notification-item\n    dismissible\n    subject=\"Nuovo messaggio\"\n    message=\"Il documento e' pronto per la revisione.\"\n  ></mds-push-notification-item>\n</mds-push-notification>\n```\n\n#### Items with Avatar Preview\n\nUse `preview=\"avatar\"` and `src` to show a user photo. Supply `initials` as a fallback when no image is available.\n\n```html\n<mds-push-notification>\n  <mds-push-notification-item\n    preview=\"avatar\"\n    src=\"/avatars/marco.jpg\"\n    initials=\"MC\"\n    subject=\"Marco Cicognetti\"\n    message=\"Ci sei andato poi alla riunione?\"\n  ></mds-push-notification-item>\n</mds-push-notification>\n```\n\n#### Items with Icon Preview\n\nUse `icon` (an icon slug with its set prefix) instead of `src` when the notification represents an event or system action rather than a person.\n\n```html\n<mds-push-notification>\n  <mds-push-notification-item\n    icon=\"mi/baseline/attachment\"\n    subject=\"Documento allegato\"\n    message=\"E' stato caricato un nuovo allegato nella pratica 2024-1042.\"\n  ></mds-push-notification-item>\n</mds-push-notification>\n```\n\n#### Item with Date and Timestamp\n\nPass an ISO 8601 datetime string to display a relative time-ago label (default) or a static formatted date.\n\n```html\n<mds-push-notification>\n  <mds-push-notification-item\n    subject=\"Approvazione completata\"\n    message=\"La richiesta e' stata approvata.\"\n    datetime=\"2024-11-12T09:30:00Z\"\n  ></mds-push-notification-item>\n\n  <!-- Static date format -->\n  <mds-push-notification-item\n    subject=\"Scadenza contratto\"\n    message=\"Il contratto scade il giorno indicato.\"\n    datetime=\"2024-12-31T00:00:00Z\"\n    date-format=\"DD/MM/YYYY\"\n  ></mds-push-notification-item>\n</mds-push-notification>\n```\n\n#### Item with Action Button\n\nSlot an `mds-button` into the `action` slot of the item to provide an inline CTA.\n\n```html\n<mds-push-notification>\n  <mds-push-notification-item\n    preview=\"avatar\"\n    src=\"/avatars/sara.jpg\"\n    subject=\"Sara Ho\"\n    message=\"Hai ricevuto una nuova richiesta di collaborazione.\"\n  >\n    <mds-button slot=\"action\" variant=\"primary\" tone=\"weak\" size=\"sm\">\n      Rispondi\n    </mds-button>\n  </mds-push-notification-item>\n</mds-push-notification>\n```\n\n#### Manual Behavior with Programmatic Control\n\nSet `behavior=\"manual\"` when visibility should be controlled by your application logic rather than inferred from slot contents. Toggle the `visible` attribute or call `show()` / `hide()` on the element.\n\n```html\n<mds-push-notification behavior=\"manual\" id=\"notif-panel\">\n  <mds-push-notification-item\n    subject=\"Aggiornamento sistema\"\n    message=\"Un aggiornamento e' disponibile. Riavviare per applicarlo.\"\n  ></mds-push-notification-item>\n</mds-push-notification>\n\n<script>\n  const panel = document.querySelector('#notif-panel');\n\n  // Show programmatically\n  panel.show();\n\n  // Hide programmatically\n  panel.hide();\n</script>\n```\n\n#### Programmatic Dismissal of a Single Item\n\nCall `removeNotification()` with an `mds-push-notification-item` element reference to animate it out and remove it without the user interacting with the close button.\n\n```html\n<mds-push-notification id=\"notif-panel\">\n  <mds-push-notification-item id=\"item-1\"\n    subject=\"Avviso temporaneo\"\n    message=\"Questa notifica viene rimossa dopo 5 secondi.\"\n  ></mds-push-notification-item>\n</mds-push-notification>\n\n<script>\n  const panel = document.querySelector('#notif-panel');\n  const item = document.querySelector('#item-1');\n\n  setTimeout(() => {\n    panel.removeNotification(item);\n  }, 5000);\n</script>\n```\n\n#### Reacting to Visibility Events\n\nListen to `mdsPushNotificationShow`, `mdsPushNotificationHide`, or `mdsPushNotificationChange` to synchronize UI state when the panel opens or closes.\n\n```javascript\nconst panel = document.querySelector('mds-push-notification');\n\npanel.addEventListener('mdsPushNotificationShow', () => {\n  console.info('Pannello notifiche aperto');\n});\n\npanel.addEventListener('mdsPushNotificationHide', () => {\n  console.info('Pannello notifiche chiuso');\n});\n\npanel.addEventListener('mdsPushNotificationChange', (e) => {\n  console.info('Visibilita cambiata:', e.detail.visible);\n});\n```\n\n#### Item Tone and Variant\n\nUse `variant` and `tone` on the item to reflect the semantic nature of the notification (status or theme family). `tone` accepts `strong` or `weak` on this component. They paint the item's icon or avatar preview, so they show only together with `icon` (or `preview=\"avatar\"`).\n\n```html\n<mds-push-notification>\n  <mds-push-notification-item\n    icon=\"mi/baseline/check-circle\"\n    variant=\"success\"\n    tone=\"weak\"\n    subject=\"Operazione completata\"\n    message=\"Il file e' stato salvato con successo.\"\n  ></mds-push-notification-item>\n\n  <mds-push-notification-item\n    icon=\"mi/baseline/error\"\n    variant=\"error\"\n    tone=\"strong\"\n    subject=\"Errore critico\"\n    message=\"Impossibile completare l'operazione. Riprovare.\"\n  ></mds-push-notification-item>\n</mds-push-notification>\n```\n\n#### Styling Customization via CSS Custom Properties\n\nOverride the fade-out delay, the gap between items, and the panel background through the public `--mds-push-notification-*` properties; the intro and outro motion of the items is set by the component. Set them on the host or a parent selector; for colours name a semantic role, `rgb(var(--magma-<role>))` ([`agents/color.md`](../../../../agents/color.md)).\n\n```css\nmds-push-notification {\n  --mds-push-notification-gap: calc(var(--spacing) * 300);\n  --mds-push-notification-fadeout-delay: 0.5s;\n  --mds-push-notification-background: linear-gradient(\n    to right,\n    rgb(var(--magma-surface-overlay) / 0) 0%,\n    rgb(var(--magma-surface-overlay) / 0.95) 100%\n  );\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-push-notification>`. 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 Arbitrary HTML in the Default Slot\n\nThe default slot is designed for `mds-push-notification-item` children only. Placing raw HTML or other components breaks the animation lifecycle, event wiring, and the intro/outro sequencing the container manages.\n\n```html\n<!-- INCORRECT -->\n<mds-push-notification>\n  <div class=\"my-notification\">\n    <strong>Avviso</strong>\n    <p>Il documento e' pronto.</p>\n  </div>\n</mds-push-notification>\n\n<!-- CORRECT -->\n<mds-push-notification>\n  <mds-push-notification-item\n    subject=\"Avviso\"\n    message=\"Il documento e' pronto.\"\n  ></mds-push-notification-item>\n</mds-push-notification>\n```\n\n#### Do Not Set `visible=\"false\"` to Hide the Panel\n\n`visible` is a boolean prop: a false boolean is written by removing the attribute, the convention for every Magma boolean ([`agents/conventions.md`](../../../../agents/conventions.md)). Stencil does parse `\"false\"` as `false`, but the attribute stays in the markup until the component hydrates and its reflection removes it, so a `[visible]` selector or any code reading the attribute sees it set in the meantime. Remove the attribute entirely - or call `hide()` - to close the panel.\n\n```html\n<!-- INCORRECT -->\n<mds-push-notification visible=\"false\"></mds-push-notification>\n\n<!-- CORRECT: remove the attribute -->\n<mds-push-notification></mds-push-notification>\n```\n\n```javascript\n// CORRECT: via imperative method\ndocument.querySelector('mds-push-notification').hide();\n```\n\n#### Do Not Listen to the Native `close` Event Instead of `mdsPushNotificationHide`\n\nThe component emits `mdsPushNotificationHide` when the panel hides. Listening for a native `close` event will never fire because the component does not dispatch it, and native DOM events from inside the shadow root do not reliably bubble to the light DOM.\n\n```javascript\n// INCORRECT\npanel.addEventListener('close', () => updateUI());\n\n// CORRECT\npanel.addEventListener('mdsPushNotificationHide', () => updateUI());\n```\n\n#### Do Not Use `behavior=\"manual\"` and Then Forget to Call `show()` / `hide()`\n\nWith `behavior=\"manual\"` the container never auto-shows when items are added; you must explicitly call `show()` or set `visible`. Leaving it on `manual` without wiring visibility logic means notifications are silently queued but never displayed.\n\n```html\n<!-- INCORRECT: items never appear because manual mode needs explicit show() -->\n<mds-push-notification behavior=\"manual\" id=\"notif-panel\">\n  <mds-push-notification-item\n    subject=\"Nuovo messaggio\"\n    message=\"Messaggio ricevuto.\"\n  ></mds-push-notification-item>\n</mds-push-notification>\n\n<!-- CORRECT: call show() after adding items -->\n<mds-push-notification behavior=\"manual\" id=\"notif-panel\">\n  <mds-push-notification-item\n    subject=\"Nuovo messaggio\"\n    message=\"Messaggio ricevuto.\"\n  ></mds-push-notification-item>\n</mds-push-notification>\n\n<script>\n  document.querySelector('#notif-panel').show();\n</script>\n```\n\n#### Do Not Pierce Shadow DOM to Style Item Internals\n\nThe only supported customization surface for the container is the public `--mds-push-notification-*` CSS custom properties plus the documented `::part(notifications)` part. Use the public per-item CSS custom properties (prefixed `--mds-push-notification-item-*`) for item-level styling. Do not reach into shadow parts that are not documented.\n\n```css\n/* INCORRECT */\nmds-push-notification >>> .notifications {\n  background: white;\n}\nmds-push-notification::part(content) {\n  padding: 2rem;\n}\n\n/* CORRECT */\nmds-push-notification {\n  --mds-push-notification-background: rgb(var(--magma-surface-overlay) / 0.9);\n  --mds-push-notification-gap: calc(var(--spacing) * 300);\n}\nmds-push-notification::part(notifications) {\n  /* documented part - safe to target */\n  padding-block: calc(var(--spacing) * 200);\n}\n```\n\n#### Do Not Slot Actions in the Wrong Slot\n\nAction buttons belong in the `action` slot of `mds-push-notification-item`, not in the default slot of `mds-push-notification`. Placing a button in the parent's default slot treats it like a notification item, breaks the animation sequence, and the button will be styled and animated as if it were a notification. A clear-all button is not needed either: the container renders its own.\n\n```html\n<!-- INCORRECT: button lands in the parent's default slot -->\n<mds-push-notification>\n  <mds-button variant=\"dark\">Cancella tutto</mds-button>\n  <mds-push-notification-item subject=\"Avviso\" message=\"Nuovo messaggio.\"></mds-push-notification-item>\n</mds-push-notification>\n\n<!-- CORRECT: action belongs on the item's action slot -->\n<mds-push-notification>\n  <mds-push-notification-item subject=\"Avviso\" message=\"Nuovo messaggio.\">\n    <mds-button slot=\"action\" variant=\"primary\" tone=\"weak\" size=\"sm\">Apri</mds-button>\n  </mds-push-notification-item>\n</mds-push-notification>\n```\n\n#### Do Not Apply an Unsupported `tone` Value to Item\n\n`mds-push-notification-item` accepts `tone=\"strong\"` or `tone=\"weak\"` only (`ToneMinimalVariantType`). Using `tone=\"outline\"` (a tone of `mds-button` and `mds-badge`) silently falls back to the default `weak` look and the intended visual emphasis is lost. `variant` and `tone` paint only the item's icon or avatar, so pair them with `icon`.\n\n```html\n<!-- INCORRECT: outline and text are not supported tones for this component -->\n<mds-push-notification-item\n  icon=\"mi/baseline/error\"\n  variant=\"error\"\n  tone=\"outline\"\n  subject=\"Errore\"\n  message=\"Operazione fallita.\"\n></mds-push-notification-item>\n\n<!-- CORRECT -->\n<mds-push-notification-item\n  icon=\"mi/baseline/error\"\n  variant=\"error\"\n  tone=\"strong\"\n  subject=\"Errore\"\n  message=\"Operazione fallita.\"\n></mds-push-notification-item>\n```\n"
      },
      "props": [
        {
          "name": "behavior",
          "type": "\"auto\" | \"manual\" | undefined",
          "complexType": {
            "original": "'auto' | 'manual'",
            "resolved": "\"auto\" | \"manual\" | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "behavior",
          "reflectToAttr": false,
          "docs": "Specifies when the stack shows: with `auto` whenever notifications are added, with `manual`\nonly through `visible` or `show()`. In both, removing the last notification hides it; a\nclick outside does not.",
          "docsTags": [
            {
              "name": "default",
              "text": "'auto'"
            }
          ],
          "default": "'auto'",
          "values": [
            {
              "value": "auto",
              "type": "string"
            },
            {
              "value": "manual",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "visible",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": true,
          "attr": "visible",
          "reflectToAttr": true,
          "docs": "Specifies if the component is visible or not.",
          "docsTags": [],
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [
        {
          "name": "hide",
          "returns": {
            "type": "Promise<void>",
            "docs": ""
          },
          "complexType": {
            "signature": "() => Promise<void>",
            "parameters": [],
            "references": {
              "Promise": {
                "location": "global",
                "id": "global::Promise"
              }
            },
            "return": "Promise<void>"
          },
          "signature": "hide() => Promise<void>",
          "parameters": [],
          "docs": "Hides the notification container.",
          "docsTags": []
        },
        {
          "name": "removeNotification",
          "returns": {
            "type": "Promise<void>",
            "docs": ""
          },
          "complexType": {
            "signature": "(notification: HTMLMdsPushNotificationItemElement | HTMLMdsPushNotificationItemElement[]) => Promise<void>",
            "parameters": [
              {
                "name": "notification",
                "type": "HTMLMdsPushNotificationItemElement | HTMLMdsPushNotificationItemElement[]",
                "docs": "the notification item or items to remove"
              }
            ],
            "references": {
              "Promise": {
                "location": "global",
                "id": "global::Promise"
              },
              "HTMLMdsPushNotificationItemElement": {
                "location": "global",
                "id": "global::HTMLMdsPushNotificationItemElement"
              }
            },
            "return": "Promise<void>"
          },
          "signature": "removeNotification(notification: HTMLMdsPushNotificationItemElement | HTMLMdsPushNotificationItemElement[]) => Promise<void>",
          "parameters": [
            {
              "name": "notification",
              "type": "HTMLMdsPushNotificationItemElement | HTMLMdsPushNotificationItemElement[]",
              "docs": "the notification item or items to remove"
            }
          ],
          "docs": "Removes the given notification item(s) from the stack.",
          "docsTags": [
            {
              "name": "param",
              "text": "notification the notification item or items to remove"
            }
          ]
        },
        {
          "name": "show",
          "returns": {
            "type": "Promise<void>",
            "docs": ""
          },
          "complexType": {
            "signature": "() => Promise<void>",
            "parameters": [],
            "references": {
              "Promise": {
                "location": "global",
                "id": "global::Promise"
              }
            },
            "return": "Promise<void>"
          },
          "signature": "show() => Promise<void>",
          "parameters": [],
          "docs": "Shows the notification container.",
          "docsTags": []
        }
      ],
      "events": [
        {
          "event": "mdsPushNotificationChange",
          "detail": "MdsPushNotificationEventDetail",
          "bubbles": true,
          "complexType": {
            "original": "MdsPushNotificationEventDetail",
            "resolved": "MdsPushNotificationEventDetail",
            "references": {
              "MdsPushNotificationEventDetail": {
                "location": "import",
                "path": "./meta/event-detail",
                "id": "src/components/mds-push-notification/meta/event-detail.ts::MdsPushNotificationEventDetail",
                "referenceLocation": "MdsPushNotificationEventDetail"
              }
            }
          },
          "cancelable": true,
          "composed": true,
          "docs": "Emits when the component visibility changes",
          "docsTags": []
        },
        {
          "event": "mdsPushNotificationHide",
          "detail": "void",
          "bubbles": true,
          "complexType": {
            "original": "void",
            "resolved": "void",
            "references": {}
          },
          "cancelable": true,
          "composed": true,
          "docs": "Emits when the component is hidden",
          "docsTags": []
        },
        {
          "event": "mdsPushNotificationShow",
          "detail": "void",
          "bubbles": true,
          "complexType": {
            "original": "void",
            "resolved": "void",
            "references": {}
          },
          "cancelable": true,
          "composed": true,
          "docs": "Emits when the component is shown",
          "docsTags": []
        }
      ],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-push-notification-background",
          "annotation": "prop",
          "docs": "Background of the push notification, supports gradients.",
          "visibility": "public"
        },
        {
          "name": "--mds-push-notification-fadeout-delay",
          "annotation": "prop",
          "docs": "Delay before the push notification starts fading out.",
          "visibility": "public"
        },
        {
          "name": "--mds-push-notification-gap",
          "annotation": "prop",
          "docs": "Gap between multiple push notifications.",
          "visibility": "public"
        },
        {
          "name": "--mds-push-notification-items-duration",
          "annotation": "prop",
          "docs": "Duration of the item animation inside the notification.",
          "visibility": "internal"
        },
        {
          "name": "--mds-push-notification-items-gap",
          "annotation": "prop",
          "docs": "Gap between items inside the notification.",
          "visibility": "internal"
        },
        {
          "name": "--mds-push-notification-items-intro-delay",
          "annotation": "prop",
          "docs": "Delay before items inside the notification animate in.",
          "visibility": "internal"
        },
        {
          "name": "--mds-push-notification-items-outro-delay",
          "annotation": "prop",
          "docs": "Delay before items inside the notification animate out.",
          "visibility": "internal"
        },
        {
          "name": "--mds-push-notification-items-timing-function",
          "annotation": "prop",
          "docs": "Timing function used for item animations inside the notification.",
          "visibility": "internal"
        }
      ],
      "slots": [
        {
          "name": "",
          "docs": "Add `HTML elements` or `components`, it is **recommended** to use `mds-push-notification` element."
        }
      ],
      "parts": [
        {
          "name": "notifications",
          "docs": "The container wrapper of the notifications."
        }
      ],
      "states": [],
      "dependents": [],
      "dependencies": [
        "mds-button"
      ],
      "dependencyGraph": {
        "mds-push-notification": [
          "mds-button"
        ],
        "mds-button": [
          "mds-icon",
          "mds-spinner",
          "mds-text"
        ]
      },
      "storybook": "ui-push-notification--docs"
    }
  ]
}
