{
  "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-note/mds-note.tsx",
      "encapsulation": "shadow",
      "tag": "mds-note",
      "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`, `HTML elements` or `components` to this slot."
        },
        {
          "name": "slot",
          "text": "title - Add `text string`, `HTML elements` or `components` to this slot."
        },
        {
          "name": "category",
          "text": "content"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-note>` web component is the annotation surface of the Magma Design System: a short, colored sticky-note block used to attach a remark, reminder, or callout to surrounding content. It has no native HTML primitive - it renders as a semantic note region with an optional title and a decorative folded corner.\n\n#### Semantic Behavior\n\n- **Note role**: Exposed to assistive technology as a standalone annotation (`role=\"note\"`) regardless of theme or variant.\n- **Deletable mode**: When `deletable` is set, the component renders an embedded close button; activating it emits the delete event without removing the note itself, leaving the host application in control of dismissal.\n- **Delete event**: `mdsNoteDelete` fires when the close control is activated, signalling intent to cancel or remove the note.\n- **Keyboard handling**: While `deletable`, the close action is keyboard-reachable.\n- **Localized close label**: The close button's accessible title is resolved in the active language (el/en/es/it).\n- **Title vs. body slots**: The named `title` slot holds the note heading; the default slot holds the note body text, HTML, or nested components.\n\n#### Properties & Visual Configurations\n\n- **`deletable`** turns the note from a static annotation into a dismissible one by exposing the close control and its delete event; pick it only when the consuming application is prepared to handle `mdsNoteDelete`.\n\n#### Component-specific variants and tones\n\n`<mds-note>` does **not** use the shared `tone` / `variant` ladders from [`agents/variants.md`](../../../../agents/variants.md). Instead, its `variant` prop selects a flat **color palette** for the note paper (the `ThemeLabelVariantType` set, e.g. `'yellow'`, `'blue'`, `'green'`, `'red'`), defaulting to `'yellow'`. Choose the color to convey the note's category, not a state or a hierarchy of emphasis: a label color never communicates state, for a warning or an error use [`mds-banner`](../mds-banner/AGENTS.md).\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-note>` component, ordered from most common to most specialized. The examples assume a working knowledge of the label-color variants documented in [`agents/variants.md`](../../../../agents/variants.md) and the shared component rules in [`agents/conventions.md`](../../../../agents/conventions.md).\n\n#### Plain Note with Body Text\n\nThe minimal form: a sticky-note block with only body content in the default slot. `variant` defaults to `'yellow'`; omit it when yellow suits the context.\n\n```html\n<mds-note>\n  <mds-text typography=\"detail\">Ricordare di aggiornare le credenziali prima del 30 giugno.</mds-text>\n</mds-note>\n```\n\n#### Note with a Title\n\nUse the named `title` slot for the heading and the default slot for the body. Both slots accept text, HTML elements, and components.\n\n```html\n<mds-note variant=\"blue\">\n  <mds-text typography=\"h5\" slot=\"title\">Nota riunione del 5 giugno</mds-text>\n  <mds-text typography=\"detail\">Confermare la disponibilita' di sala entro venerdi'.</mds-text>\n  <mds-text typography=\"detail\">Invitare anche il responsabile del progetto Synbee.</mds-text>\n</mds-note>\n```\n\n#### Color Variant for Category\n\nChoose `variant` based on the note's category, not on aesthetic preference; a label color never communicates state ([`agents/variants.md`](../../../../agents/variants.md)). All twelve label colors are available.\n\n```html\n<!-- Category: reminders -->\n<mds-note variant=\"yellow\">\n  <mds-text typography=\"detail\">Scadenza domani: inviare il report trimestrale.</mds-text>\n</mds-note>\n\n<!-- Category: approvals -->\n<mds-note variant=\"orange\">\n  <mds-text typography=\"detail\">Approvazione in attesa - contattare il responsabile.</mds-text>\n</mds-note>\n\n<!-- Category: review notes -->\n<mds-note variant=\"sky\">\n  <mds-text typography=\"detail\">Questo blocco e' in sola lettura fino al completamento della revisione.</mds-text>\n</mds-note>\n\n<!-- Category: configuration -->\n<mds-note variant=\"green\">\n  <mds-text typography=\"detail\">Configurazione del modulo fatture: usare il profilo standard.</mds-text>\n</mds-note>\n```\n\n#### Dismissible Note via `deletable`\n\nSet `deletable` to expose the close button. The component emits `mdsNoteDelete` when the button is activated but does not remove itself - the host application is responsible for removal.\n\n```html\n<mds-note variant=\"amaranth\" deletable>\n  <mds-text typography=\"h5\" slot=\"title\">Attenzione</mds-text>\n  <mds-text typography=\"detail\">Questo avviso sparira' una volta confermata l'azione.</mds-text>\n</mds-note>\n```\n\n```javascript\ndocument.querySelector('mds-note').addEventListener('mdsNoteDelete', () => {\n  document.querySelector('mds-note').remove();\n});\n```\n\n#### Styling Customization via CSS Custom Properties\n\nCustomize the note only through the public `--mds-note-*` 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.featured-note mds-note {\n  --mds-note-background: rgb(var(--label-orchid-09));\n  --mds-note-color: rgb(var(--label-orchid-02));\n}\n```\n\n#### Multiple Notes in a Grid\n\nPlace several notes in a layout container; each note is independent and carries its own variant and deletable state.\n\n```html\n<div style=\"display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem;\">\n  <mds-note variant=\"yellow\" deletable>\n    <mds-text typography=\"h6\" slot=\"title\">Da fare</mds-text>\n    <mds-text typography=\"detail\">Revisionare il capitolato prima di lunedi'.</mds-text>\n  </mds-note>\n  <mds-note variant=\"lime\">\n    <mds-text typography=\"h6\" slot=\"title\">Completato</mds-text>\n    <mds-text typography=\"detail\">Migrazione database eseguita con successo.</mds-text>\n  </mds-note>\n  <mds-note variant=\"red\" deletable>\n    <mds-text typography=\"h6\" slot=\"title\">Bloccante</mds-text>\n    <mds-text typography=\"detail\">Servizio di autenticazione non raggiungibile in produzione.</mds-text>\n  </mds-note>\n</div>\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-note>`. 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 Remove the Note Directly - Listen for `mdsNoteDelete`\n\nThe component emits `mdsNoteDelete` when the close button is activated; it never removes itself. Removing the element without listening to the event means deletable notes can never be dismissed, while bypassing the event skips any cleanup logic the host application needs to run.\n\n```html\n<!-- INCORRECT: close button present but nothing removes the note -->\n<mds-note variant=\"yellow\" deletable>\n  <mds-text typography=\"detail\">Questa nota non sparira' mai.</mds-text>\n</mds-note>\n\n<!-- CORRECT: listen for the event and remove programmatically -->\n<mds-note id=\"nota-avviso\" variant=\"yellow\" deletable>\n  <mds-text typography=\"detail\">Chiudi per rimuovere questa nota.</mds-text>\n</mds-note>\n<script>\n  document.getElementById('nota-avviso').addEventListener('mdsNoteDelete', (e) => {\n    e.target.remove();\n  });\n</script>\n```\n\n#### Do Not Use `variant` Values from the Status or Brand Ladders\n\n`<mds-note>` uses `ThemeLabelVariantType` - the twelve decorative label colors (`yellow`, `blue`, `green`, `red`, `orange`, `sky`, `violet`, `lime`, `aqua`, `orchid`, `purple`, `amaranth`). Status values (`info`, `success`, `warning`, `error`) and brand values (`primary`, `secondary`) are not part of this type and silently fall back to the yellow base, breaking the intended color. A label color never communicates state: a status message is an [`mds-banner`](../mds-banner/AGENTS.md).\n\n```html\n<!-- INCORRECT: status variant not accepted by mds-note -->\n<mds-note variant=\"warning\">\n  <mds-text typography=\"detail\">Operazione in corso.</mds-text>\n</mds-note>\n\n<!-- CORRECT: a state is a banner with a status variant -->\n<mds-banner variant=\"warning\">\n  <mds-text typography=\"detail\">Operazione in corso.</mds-text>\n</mds-banner>\n```\n\n#### Do Not Put the Title in the Default Slot\n\nThe component provides a dedicated named `title` slot for the note heading. Placing a heading element in the default slot renders it inside the body content area, without the fixed position of the `title` slot, which is always rendered before the body whatever the source order.\n\n```html\n<!-- INCORRECT: heading mixed into default body slot -->\n<mds-note variant=\"blue\">\n  <mds-text typography=\"h5\">Nota importante</mds-text>\n  <mds-text typography=\"detail\">Dettagli dell'annotazione qui.</mds-text>\n</mds-note>\n\n<!-- CORRECT: heading goes in the title slot -->\n<mds-note variant=\"blue\">\n  <mds-text typography=\"h5\" slot=\"title\">Nota importante</mds-text>\n  <mds-text typography=\"detail\">Dettagli dell'annotazione qui.</mds-text>\n</mds-note>\n```\n\n#### Do Not Set `deletable=\"false\"` to Disable the Close Button\n\n`deletable` is a boolean attribute, and a false boolean is an absent attribute ([`agents/conventions.md`](../../../../agents/conventions.md)). The runtime parses the string `\"false\"` as `false` and hides the button, 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 note. Remove the attribute entirely to hide it.\n\n```html\n<!-- INCORRECT: the attribute still says the note is deletable -->\n<mds-note variant=\"green\" deletable=\"false\">\n  <mds-text typography=\"detail\">Questa nota dovrebbe essere fissa.</mds-text>\n</mds-note>\n\n<!-- CORRECT: omit the attribute -->\n<mds-note variant=\"green\">\n  <mds-text typography=\"detail\">Questa nota e' fissa.</mds-text>\n</mds-note>\n```\n\n#### Do Not Style the Note with Arbitrary CSS or Tailwind Utilities\n\nThe only supported customization surface is the documented `--mds-note-*` CSS custom properties. Applying Tailwind background utilities or raw color values couples the note's appearance to the utility layer and breaks dark mode and high-contrast handling.\n\n```css\n/* INCORRECT */\nmds-note {\n  background-color: #fffacd;\n  color: #3a3000;\n}\n\n/* CORRECT */\nmds-note {\n  --mds-note-background: rgb(var(--label-yellow-09));\n  --mds-note-color: rgb(var(--label-yellow-02));\n}\n```\n"
      },
      "props": [
        {
          "name": "deletable",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "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"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "variant",
          "type": "\"amaranth\" | \"aqua\" | \"blue\" | \"green\" | \"lime\" | \"orange\" | \"orchid\" | \"purple\" | \"red\" | \"sky\" | \"violet\" | \"yellow\" | undefined",
          "complexType": {
            "original": "ThemeLabelVariantType",
            "resolved": "\"amaranth\" | \"aqua\" | \"blue\" | \"green\" | \"lime\" | \"orange\" | \"orchid\" | \"purple\" | \"red\" | \"sky\" | \"violet\" | \"yellow\" | undefined",
            "references": {
              "ThemeLabelVariantType": {
                "location": "import",
                "path": "@type/variant",
                "id": "src/type/variant.ts::ThemeLabelVariantType",
                "referenceLocation": "ThemeLabelVariantType"
              }
            }
          },
          "mutable": false,
          "attr": "variant",
          "reflectToAttr": true,
          "docs": "Specifies the color variant for the element",
          "docsTags": [
            {
              "name": "default",
              "text": "'yellow'"
            }
          ],
          "default": "'yellow'",
          "values": [
            {
              "value": "amaranth",
              "type": "string"
            },
            {
              "value": "aqua",
              "type": "string"
            },
            {
              "value": "blue",
              "type": "string"
            },
            {
              "value": "green",
              "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": "violet",
              "type": "string"
            },
            {
              "value": "yellow",
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [
        {
          "event": "mdsNoteDelete",
          "detail": "void",
          "bubbles": true,
          "complexType": {
            "original": "void",
            "resolved": "void",
            "references": {}
          },
          "cancelable": true,
          "composed": true,
          "docs": "Emits when the note has to be cancelled",
          "docsTags": []
        }
      ],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-note-background",
          "annotation": "prop",
          "docs": "Sets the background-color of the component",
          "visibility": "public"
        },
        {
          "name": "--mds-note-color",
          "annotation": "prop",
          "docs": "Sets the text color of the component",
          "visibility": "public"
        },
        {
          "name": "--mds-note-fold-color",
          "annotation": "prop",
          "docs": "Sets the color of the fold decoration at the bottom right of the component",
          "visibility": "internal"
        },
        {
          "name": "--mds-note-fold-size",
          "annotation": "prop",
          "docs": "Sets the size of the fold decoration at the bottom right of the component",
          "visibility": "internal"
        },
        {
          "name": "--mds-note-selection-background",
          "annotation": "prop",
          "docs": "Sets the selection text background-color of the component",
          "visibility": "internal"
        },
        {
          "name": "--mds-note-selection-color",
          "annotation": "prop",
          "docs": "Sets the selection text color of the component",
          "visibility": "internal"
        }
      ],
      "slots": [
        {
          "name": "",
          "docs": "Add `text string`, `HTML elements` or `components` to this slot."
        },
        {
          "name": "title",
          "docs": "Add `text string`, `HTML elements` or `components` to this slot."
        }
      ],
      "parts": [],
      "states": [],
      "dependents": [],
      "dependencies": [
        "mds-button"
      ],
      "dependencyGraph": {
        "mds-note": [
          "mds-button"
        ],
        "mds-button": [
          "mds-icon",
          "mds-spinner",
          "mds-text"
        ]
      },
      "storybook": "ui-note--docs"
    }
  ]
}
