{
  "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-accordion-timer/mds-accordion-timer.tsx",
      "encapsulation": "shadow",
      "tag": "mds-accordion-timer",
      "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 `mds-accordion-timer-item` element/s."
        },
        {
          "name": "category",
          "text": "structure"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-accordion-timer>` web component is the orchestrating parent of an auto-advancing accordion in the Magma Design System. It groups one or more `<mds-accordion-timer-item>` children, runs a timed progress cycle over them, and automatically opens the next item when the current one elapses - a behaviour with no native HTML primitive.\n\n#### Semantic Behavior\n\n- **Compound parent**: Drives selection across its slotted `<mds-accordion-timer-item>` children; it is meaningless without item children.\n- **Initial selection**: The child carrying `selected` (the last one, if several do) becomes the active item and starts the timer on load; if none is selected, the timer stays idle until an item is activated.\n- **Auto-advance cycle**: When the active item elapses, the next item opens, wrapping back to the first after the last - producing a continuous loop.\n- **Per-item duration override**: Each item uses its own `duration` when set, otherwise falling back to the parent `duration`.\n- **Pause on hover**: Hovering the active item pauses the countdown and resumes on mouse-leave; this is suppressed while `paused` is set.\n- **Manual selection**: Clicking an item selects it and holds its countdown at the start until the pointer leaves the item, while programmatic selection restarts the timer from the beginning of that item. Both clear `paused`.\n- **Emitted event**: `mdsAccordionTimerChange` with the new item `index` whenever the active item changes, once for a click and once for an auto-advance.\n\n#### Properties & Visual Configurations\n\nThis component exposes only timing controls; it has no `variant` / `tone` / `size` ladder of its own.\n\n#### Other behavioral props\n\n- **`duration`** is the fallback cycle length in milliseconds applied to every item that does not declare its own `duration`; it is the global pacing knob for the whole accordion.\n- **`paused`** freezes the countdown at its current remaining time when set and resumes it when cleared. While paused, hover-driven pause/resume is disabled; selecting an item, by click or from code, clears it.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-accordion-timer>` 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 Auto-Advancing Accordion\n\nThe canonical form. Place `<mds-accordion-timer-item>` children inside the parent, mark exactly one with `selected` to define the initial panel, and provide a `description` for each header. The timer starts automatically on load and cycles through items continuously.\n\n```html\n<mds-accordion-timer>\n  <mds-accordion-timer-item selected description=\"Introduzione\">\n    <mds-text>Contenuto del primo pannello.</mds-text>\n  </mds-accordion-timer-item>\n  <mds-accordion-timer-item description=\"Caratteristiche\">\n    <mds-text>Contenuto del secondo pannello.</mds-text>\n  </mds-accordion-timer-item>\n  <mds-accordion-timer-item description=\"Conclusioni\">\n    <mds-text>Contenuto del terzo pannello.</mds-text>\n  </mds-accordion-timer-item>\n</mds-accordion-timer>\n```\n\n#### Controlling the Global Cycle Duration\n\nUse the `duration` prop (in milliseconds) to set how long each item stays open before the accordion auto-advances. The default is 10000 ms (10 seconds). This applies to all items that do not declare their own `duration`.\n\n```html\n<mds-accordion-timer duration=\"5000\">\n  <mds-accordion-timer-item selected description=\"Passo 1\">\n    <mds-text>Primo contenuto.</mds-text>\n  </mds-accordion-timer-item>\n  <mds-accordion-timer-item description=\"Passo 2\">\n    <mds-text>Secondo contenuto.</mds-text>\n  </mds-accordion-timer-item>\n</mds-accordion-timer>\n```\n\n#### Per-Item Duration Override\n\nSet `duration` on individual `<mds-accordion-timer-item>` children to give each item its own display time. An item-level `duration` takes precedence over the parent's global `duration` for that item only.\n\n```html\n<mds-accordion-timer duration=\"4000\">\n  <mds-accordion-timer-item selected description=\"Introduzione rapida\" duration=\"2000\">\n    <mds-text>Questo pannello rimane aperto per 2 secondi.</mds-text>\n  </mds-accordion-timer-item>\n  <mds-accordion-timer-item description=\"Approfondimento\" duration=\"8000\">\n    <mds-text>Questo pannello rimane aperto per 8 secondi.</mds-text>\n  </mds-accordion-timer-item>\n  <mds-accordion-timer-item description=\"Riepilogo\">\n    <mds-text>Questo pannello usa la durata globale (4 secondi).</mds-text>\n  </mds-accordion-timer-item>\n</mds-accordion-timer>\n```\n\n#### Starting in a Paused State\n\nSet the `paused` attribute on the parent to start the accordion with the timer frozen. The selected item will display without advancing until `paused` is removed or the user selects an item. Use this when the auto-advance should not begin until a user action occurs.\n\n```html\n<mds-accordion-timer paused>\n  <mds-accordion-timer-item selected description=\"In attesa di avvio\">\n    <mds-text>Il timer e' in pausa. Rimuovere l'attributo \"paused\" per avviarlo.</mds-text>\n  </mds-accordion-timer-item>\n  <mds-accordion-timer-item description=\"Secondo pannello\">\n    <mds-text>Secondo contenuto.</mds-text>\n  </mds-accordion-timer-item>\n</mds-accordion-timer>\n```\n\n#### Toggling Pause Programmatically\n\nToggle the `paused` prop from JavaScript to freeze and resume the countdown at runtime - for example in response to a user preference or a visibility-change event. Set the prop to `undefined` or `false` (or remove the attribute) to resume; in markup never write `paused=\"false\"`.\n\n```html\n<mds-accordion-timer id=\"slideshow\">\n  <mds-accordion-timer-item selected description=\"Novita' del mese\">\n    <mds-text>Contenuto del primo pannello.</mds-text>\n  </mds-accordion-timer-item>\n  <mds-accordion-timer-item description=\"Offerte speciali\">\n    <mds-text>Contenuto del secondo pannello.</mds-text>\n  </mds-accordion-timer-item>\n</mds-accordion-timer>\n\n<mds-button id=\"btn-pause\" label=\"Metti in pausa\" variant=\"primary\" tone=\"outline\"></mds-button>\n<mds-button id=\"btn-resume\" label=\"Riprendi\" variant=\"primary\" tone=\"strong\"></mds-button>\n```\n\n```javascript\nconst accordion = document.getElementById('slideshow');\ndocument.getElementById('btn-pause').addEventListener('click', () => {\n  accordion.paused = true;\n});\ndocument.getElementById('btn-resume').addEventListener('click', () => {\n  accordion.paused = undefined;\n});\n```\n\n#### Listening for Item Changes\n\nListen to the `mdsAccordionTimerChange` event to react whenever the active item changes - for example to synchronise an external indicator or analytics counter. The event detail carries the zero-based `index` of the newly selected item.\n\n```javascript\ndocument.querySelector('mds-accordion-timer').addEventListener('mdsAccordionTimerChange', (e) => {\n  console.log('Pannello attivo:', e.detail.index);\n});\n```\n\n#### Programmatic Item Selection\n\nTo jump to a specific item from code, set `selected = true` on that `<mds-accordion-timer-item>` element directly. The parent intercepts the resulting `mdsAccordionTimerItemSelect` event, clears `paused`, and restarts the timer from the beginning of that item.\n\n```javascript\nconst items = document.querySelectorAll('mds-accordion-timer-item');\n// Apre il terzo pannello e riavvia il timer\nitems[2].selected = true;\n```\n\n#### Customizing the Text Color via CSS Custom Properties\n\nStyle the component only through its public `--mds-accordion-timer-color` CSS custom property, which sets the text color of every item. Set it on the parent host or a parent selector; use semantic color roles via `rgb(var(--magma-<role>))` so dark mode continues to work. The colors and the thickness of the progress bar are not public: the bar follows the theme. Each item exposes it as its `progress` part, and its header text as the `label` part.\n\n```css\n.promo-slider mds-accordion-timer {\n  --mds-accordion-timer-color: rgb(var(--magma-accent-fg));\n}\n.promo-slider mds-accordion-timer-item::part(label) {\n  font-weight: 600;\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-accordion-timer>`. 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-accordion-timer-item Outside mds-accordion-timer\n\n`<mds-accordion-timer-item>` is a compound child that only works when discovered by the parent at load time; the parent assigns `uuid` values, drives the selection, and feeds `progress`. Outside its parent the item has no timer, no auto-advance, and no sibling coordination.\n\n```html\n<!-- INCORRECT -->\n<mds-accordion-timer-item selected description=\"Elemento isolato\">\n  <mds-text>Questo elemento non avra' mai un timer.</mds-text>\n</mds-accordion-timer-item>\n\n<!-- CORRECT -->\n<mds-accordion-timer>\n  <mds-accordion-timer-item selected description=\"Elemento corretto\">\n    <mds-text>Il timer funziona correttamente all'interno del genitore.</mds-text>\n  </mds-accordion-timer-item>\n</mds-accordion-timer>\n```\n\n#### Do Not Mix Child Types Inside mds-accordion-timer\n\nThe parent discovers children via `querySelectorAll('mds-accordion-timer-item')` and indexes them by position. A mixed-in `<mds-accordion-item>` or other component is left out of the rotation and toggles on its own; [`agents/conventions.md`](../../../../agents/conventions.md) forbids mixing child types in compound components.\n\n```html\n<!-- INCORRECT -->\n<mds-accordion-timer>\n  <mds-accordion-timer-item selected description=\"Timed item\">\n    <mds-text>Pannello a timer.</mds-text>\n  </mds-accordion-timer-item>\n  <mds-accordion-item label=\"Static item\">\n    <mds-text>Pannello statico non supportato qui.</mds-text>\n  </mds-accordion-item>\n</mds-accordion-timer>\n\n<!-- CORRECT -->\n<mds-accordion-timer>\n  <mds-accordion-timer-item selected description=\"Primo pannello\">\n    <mds-text>Pannello a timer.</mds-text>\n  </mds-accordion-timer-item>\n  <mds-accordion-timer-item description=\"Secondo pannello\">\n    <mds-text>Altro pannello a timer.</mds-text>\n  </mds-accordion-timer-item>\n</mds-accordion-timer>\n```\n\n#### Do Not Set paused=\"false\" to Resume the Timer\n\n`paused` is a boolean prop, and a false boolean is an absent attribute ([`agents/mistakes.md`](../../../../agents/mistakes.md)). Stencil reads the string `\"false\"` as `false` here, but the attribute stays on the element, so anything that checks `[paused]` still sees the timer as paused. Remove the attribute entirely (or set the property to `undefined` or `false`) to resume.\n\n```html\n<!-- INCORRECT -->\n<mds-accordion-timer paused=\"false\">\n  <mds-accordion-timer-item selected description=\"Primo pannello\">\n    <mds-text>L'attributo paused resta sull'elemento.</mds-text>\n  </mds-accordion-timer-item>\n</mds-accordion-timer>\n\n<!-- CORRECT -->\n<mds-accordion-timer>\n  <mds-accordion-timer-item selected description=\"Primo pannello\">\n    <mds-text>Il timer e' in esecuzione.</mds-text>\n  </mds-accordion-timer-item>\n</mds-accordion-timer>\n```\n\n```javascript\n// CORRECT (from code)\naccordion.paused = undefined; // or false: the property takes a real boolean\n```\n\n#### Do Not Set uuid or progress Manually\n\n`uuid` (item position index) and `progress` (0-1 fill value) are owned and continuously rewritten by the parent at runtime. Setting them from outside produces race conditions between your values and the parent's interval writes, leading to erratic progress bars and broken rotation.\n\n```html\n<!-- INCORRECT -->\n<mds-accordion-timer>\n  <mds-accordion-timer-item uuid=\"0\" progress=\"50\" selected description=\"Progresso manuale\">\n    <mds-text>La barra di progresso verra' sovrascritta dal genitore.</mds-text>\n  </mds-accordion-timer-item>\n</mds-accordion-timer>\n\n<!-- CORRECT -->\n<mds-accordion-timer>\n  <mds-accordion-timer-item selected description=\"Progresso gestito\">\n    <mds-text>Il genitore gestisce uuid e progress automaticamente.</mds-text>\n  </mds-accordion-timer-item>\n</mds-accordion-timer>\n```\n\n#### Do Not Pierce the Shadow DOM to Restyle the Progress Bar\n\nThe progress bar and the label are exposed on each item only as the documented `progress` and `label` parts. Use the public `--mds-accordion-timer-color` CSS custom property on the host (or a parent selector) to change the text color, and those parts for the rest of their appearance. Targeting internal class names or undocumented parts couples your code to the implementation and will break on minor releases.\n\n```css\n/* INCORRECT */\nmds-accordion-timer >>> .progress-bar {\n  background: red;\n}\nmds-accordion-timer-item::part(unknown-part) {\n  height: 4px;\n}\n\n/* CORRECT */\nmds-accordion-timer {\n  --mds-accordion-timer-color: rgb(var(--magma-accent-fg));\n}\nmds-accordion-timer-item::part(label) {\n  font-weight: 600;\n}\n```\n\n#### Do Not Listen for Native change Events Instead of mdsAccordionTimerChange\n\nThe component emits `mdsAccordionTimerChange` when the active item changes; it emits no native `change` event. Listen to the documented `mds*` event name.\n\n```javascript\n// INCORRECT\naccordion.addEventListener('change', (e) => { /* never fires */ });\n\n// CORRECT\naccordion.addEventListener('mdsAccordionTimerChange', (e) => {\n  console.log('Indice attivo:', e.detail.index);\n});\n```\n"
      },
      "props": [
        {
          "name": "duration",
          "type": "number",
          "complexType": {
            "original": "number",
            "resolved": "number",
            "references": {}
          },
          "mutable": false,
          "attr": "duration",
          "reflectToAttr": true,
          "docs": "Sets the duration of the single accordion item",
          "docsTags": [
            {
              "name": "default",
              "text": "10000"
            }
          ],
          "default": "10000",
          "values": [
            {
              "type": "number"
            }
          ],
          "optional": false,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "paused",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "paused",
          "reflectToAttr": true,
          "docs": "When paused is defined, the timer stops run",
          "docsTags": [],
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [
        {
          "event": "mdsAccordionTimerChange",
          "detail": "MdsAccordionTimerEventDetail",
          "bubbles": true,
          "complexType": {
            "original": "MdsAccordionTimerEventDetail",
            "resolved": "MdsAccordionTimerEventDetail",
            "references": {
              "MdsAccordionTimerEventDetail": {
                "location": "import",
                "path": "./meta/event-detail",
                "id": "src/components/mds-accordion-timer/meta/event-detail.ts::MdsAccordionTimerEventDetail",
                "referenceLocation": "MdsAccordionTimerEventDetail"
              }
            }
          },
          "cancelable": true,
          "composed": true,
          "docs": "Emits when the accordion changes it's item",
          "docsTags": []
        }
      ],
      "listeners": [
        {
          "event": "mdsAccordionTimerItemClickSelect",
          "capture": false,
          "passive": false
        },
        {
          "event": "mdsAccordionTimerItemSelect",
          "capture": false,
          "passive": false
        },
        {
          "event": "mdsAccordionTimerItemMouseEnterSelect",
          "capture": false,
          "passive": false
        },
        {
          "event": "mdsAccordionTimerItemMouseLeaveSelect",
          "capture": false,
          "passive": false
        }
      ],
      "styles": [
        {
          "name": "--mds-accordion-timer-color",
          "annotation": "prop",
          "docs": "Sets the text color of the component mds-accordion-timer-item",
          "visibility": "public"
        },
        {
          "name": "--mds-accordion-timer-duration",
          "annotation": "prop",
          "docs": "Sets the transition duration of open/close animation of the mds-accordion-timer-item",
          "visibility": "internal"
        },
        {
          "name": "--mds-accordion-timer-progress-bar-background",
          "annotation": "prop",
          "docs": "Sets the background-color of the progress bar when the mds-accordion-timer-item is selected",
          "visibility": "internal"
        },
        {
          "name": "--mds-accordion-timer-progress-bar-color",
          "annotation": "prop",
          "docs": "Sets the color of the progress bar when the mds-accordion-timer-item is selected",
          "visibility": "internal"
        },
        {
          "name": "--mds-accordion-timer-progress-bar-thickness",
          "annotation": "prop",
          "docs": "Sets thickness of the progress bar of the mds-accordion-timer-item",
          "visibility": "internal"
        }
      ],
      "slots": [
        {
          "name": "",
          "docs": "Add `mds-accordion-timer-item` element/s."
        }
      ],
      "parts": [],
      "states": [],
      "dependents": [],
      "dependencies": [],
      "dependencyGraph": {},
      "storybook": "ui-accordion-timer--docs"
    }
  ]
}
