{
  "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-stepper-bar/mds-stepper-bar.tsx",
      "encapsulation": "shadow",
      "tag": "mds-stepper-bar",
      "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-stepper-bar-item` element/s."
        },
        {
          "name": "slot",
          "text": "content - Add `HTML elements` or `components`, one per mds-stepper-bar-item added"
        },
        {
          "name": "part",
          "text": "items - Selects the `items` container element wrapped in shadowDOM."
        },
        {
          "name": "part",
          "text": "contents - Selects the `contents` container element wrapped in shadowDOM."
        },
        {
          "name": "category",
          "text": "navigation"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-stepper-bar>` web component is the Magma Design System container that orchestrates a multi-step progress flow, coordinating a set of slotted `<mds-stepper-bar-item>` children and revealing the matching content panel for the active step. It has no native HTML equivalent; it composes a stepper indicator track with a switchable content region.\n\n#### Semantic Behavior\n\n- **Compound parent**: It is the controlling parent of `<mds-stepper-bar-item>` children placed in the default slot, driving every child's `done`/`current` state - children do not manage their own progression.\n- **Active step derivation**: From `itemsDone` it marks all earlier items as `done`, the item at the current index as `current`, and clears the rest; the active step is `itemsDone - 1`.\n- **Content synchronization**: Each `slot=\"content\"` element is paired by position to a stepper item; only the panel matching the current index is shown. The other panels get the `hidden` attribute, so no style of the page is needed (a `display` the page sets on a panel overrides it). The panels are the direct children with `slot=\"content\"`, read again at every step and whenever the slot changes: a panel that a framework renders, replaces or removes after the load (conditional rendering, a keyed list) takes the state of its step at once.\n- **Child requests, page decides**: A step that is done emits `mdsStepperBarItemDone` when the user activates it; the bar does not move by itself, progress is driven by `itemsDone` only. To let the user go back, listen for the event and set `itemsDone` to the index of that item plus one.\n- **Auto-scroll**: When a step becomes current the indicator track scrolls horizontally to center the active item.\n- **Change event**: It emits `mdsStepperBarChange` when it loads and whenever `itemsDone` changes, with a detail of the active `step` index and a comma-joined `value` string collected from the completed items.\n\n#### Properties & Visual Configurations\n\n- **`itemsDone`** is the controlled entry point for progress: `0` means no step completed, `1` activates the first step, and `last + 1` marks the whole flow complete. Treat it as the single source of truth for which step is current rather than mutating children directly.\n\n#### Other behavioral props\n\n- **`navigation`** selects how the indicator track is traversed: `'none'` (default) keeps the track static, while `'scrollbar'` exposes a horizontal scrollbar (styleable through the `--mds-stepper-bar-scrollbar-*` custom properties) for flows with many steps.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-stepper-bar>` 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 Stepper with Step Labels\n\nThe canonical form. Place `<mds-stepper-bar-item>` elements in the default slot, one per step. Every item requires `icon` and `label`; `badge` and `step` enable the status badge and step counter visuals. Set `items-done` to control which step is active - `1` activates the first step.\n\n```html\n<mds-stepper-bar items-done=\"1\">\n  <mds-stepper-bar-item\n    badge\n    step\n    icon=\"mi/baseline/person\"\n    icon-checked=\"mi/baseline/done\"\n    label=\"Dati account\"\n  ></mds-stepper-bar-item>\n  <mds-stepper-bar-item\n    badge\n    step\n    icon=\"mi/baseline/badge\"\n    icon-checked=\"mi/baseline/done\"\n    label=\"Dati personali\"\n  ></mds-stepper-bar-item>\n  <mds-stepper-bar-item\n    badge\n    step\n    icon=\"mi/baseline/lock-open\"\n    icon-checked=\"mi/baseline/done\"\n    label=\"Attivazione\"\n  ></mds-stepper-bar-item>\n</mds-stepper-bar>\n```\n\n#### Advancing Steps Programmatically\n\nDrive progress by updating `items-done` from outside. `itemsDone = 0` leaves all items pending; `itemsDone = N + 1` (where N is the total number of items) marks the whole flow as complete. Do not mutate the children's `done` or `current` attributes directly - only the parent controls those.\n\n```html\n<mds-stepper-bar id=\"reg-stepper\" items-done=\"1\">\n  <mds-stepper-bar-item badge step icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item badge step icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Profilo\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item badge step icon=\"mi/baseline/done\" icon-checked=\"mi/baseline/done\" label=\"Conferma\"></mds-stepper-bar-item>\n</mds-stepper-bar>\n\n<mds-button label=\"Prossimo\" variant=\"primary\" tone=\"strong\" id=\"btn-next\"></mds-button>\n\n<script>\n  let step = 1;\n  document.getElementById('btn-next').addEventListener('click', () => {\n    step += 1;\n    document.getElementById('reg-stepper').setAttribute('items-done', String(step));\n  });\n</script>\n```\n\n#### Listening to the Change Event\n\nReact to step changes via `mdsStepperBarChange`. The event detail carries `step` (zero-based index of the current item) and `value` (comma-joined `value` attributes of all completed items).\n\n```html\n<mds-stepper-bar id=\"wizard\" items-done=\"1\">\n  <mds-stepper-bar-item value=\"account\" badge step icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item value=\"profilo\" badge step icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Profilo\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item value=\"conferma\" badge step icon=\"mi/baseline/done\" icon-checked=\"mi/baseline/done\" label=\"Conferma\"></mds-stepper-bar-item>\n</mds-stepper-bar>\n\n<script>\n  document.getElementById('wizard').addEventListener('mdsStepperBarChange', (e) => {\n    console.log('Step corrente:', e.detail.step);\n    console.log('Passi completati:', e.detail.value); // es. \"account,profilo\"\n  });\n</script>\n```\n\n#### Content Panels Synchronized with Steps\n\nAdd elements with `slot=\"content\"` - one per step in the same order as the items. The component hides all panels except the one matching the active step, with the `hidden` attribute: no style of the page is needed. Nest navigation buttons inside each panel to let users move forward and back.\n\n```html\n<mds-stepper-bar items-done=\"1\">\n  <mds-stepper-bar-item badge step icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item badge step icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Profilo\"></mds-stepper-bar-item>\n\n  <div slot=\"content\">\n    <mds-text>Inserisci i dati del tuo account.</mds-text>\n    <mds-button\n      label=\"Prossimo\"\n      variant=\"primary\"\n      tone=\"strong\"\n      onclick=\"document.querySelector('mds-stepper-bar').setAttribute('items-done', '2')\"\n    ></mds-button>\n  </div>\n\n  <div slot=\"content\">\n    <mds-text>Completa il tuo profilo.</mds-text>\n    <mds-button\n      label=\"Indietro\"\n      variant=\"dark\"\n      tone=\"outline\"\n      onclick=\"document.querySelector('mds-stepper-bar').setAttribute('items-done', '1')\"\n    ></mds-button>\n    <mds-button\n      label=\"Conferma\"\n      variant=\"primary\"\n      tone=\"strong\"\n      onclick=\"document.querySelector('mds-stepper-bar').setAttribute('items-done', '3')\"\n    ></mds-button>\n  </div>\n</mds-stepper-bar>\n```\n\n#### Scrollbar Navigation for Long Flows\n\nFor flows with many steps, set `navigation=\"scrollbar\"` to expose a styled horizontal scrollbar under the indicator track. The active item scrolls into view automatically; the scrollbar appearance is configurable through the `--mds-stepper-bar-scrollbar-*` custom properties.\n\n```html\n<mds-stepper-bar items-done=\"1\" navigation=\"scrollbar\">\n  <mds-stepper-bar-item badge step icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item badge step icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Dati personali\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item badge step icon=\"mi/round/email\" icon-checked=\"mi/baseline/done\" label=\"Newsletter\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item badge step icon=\"mi/baseline/lock-open\" icon-checked=\"mi/baseline/done\" label=\"Attivazione\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item badge step icon=\"mi/baseline/login\" icon-checked=\"mi/baseline/done\" label=\"Accedi\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item badge step icon=\"mi/baseline/done\" icon-checked=\"mi/baseline/done\" label=\"Completato\"></mds-stepper-bar-item>\n</mds-stepper-bar>\n```\n\n#### Offset Margin inside a Padded Container\n\nWhen the stepper bar lives inside a padded card or panel, use `--mds-stepper-bar-offset-margin` to let the indicator track bleed into the padding without altering the outer container's spacing.\n\n```css\n.wizard-card mds-stepper-bar {\n  --mds-stepper-bar-offset-margin: 24px;\n}\n```\n\n```html\n<div class=\"wizard-card\" style=\"padding: 24px;\">\n  <mds-stepper-bar items-done=\"2\">\n    <mds-stepper-bar-item badge step icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n    <mds-stepper-bar-item badge step icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Profilo\"></mds-stepper-bar-item>\n    <mds-stepper-bar-item badge step icon=\"mi/baseline/done\" icon-checked=\"mi/baseline/done\" label=\"Conferma\"></mds-stepper-bar-item>\n  </mds-stepper-bar>\n</div>\n```\n\n#### Styling the Gap\n\nSet the item spacing through the public `--mds-stepper-bar-*` CSS custom properties; the scrollbar of the indicator track is styled by the component. Use semantic color roles via `rgb(var(--magma-<role>))` for any colour you set, so dark mode and high-contrast keep working.\n\n```css\nmds-stepper-bar {\n  --mds-stepper-bar-gap: calc(var(--spacing) * 700);\n}\n```\n\n#### Targeting Shadow Parts for Deep Customization\n\nThe two documented shadow parts - `items` (the indicator track wrapper) and `contents` (the content panel wrapper) - let you apply layout overrides that CSS custom properties cannot express. Limit `::part()` use to structural needs only; prefer the `--mds-stepper-bar-*` properties for everything else.\n\n```css\nmds-stepper-bar::part(items) {\n  padding-block: calc(var(--spacing) * 400);\n  border-bottom: 1px solid rgb(var(--magma-border-muted));\n}\n\nmds-stepper-bar::part(contents) {\n  padding-block: calc(var(--spacing) * 600);\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-stepper-bar>`. 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 Mutate Child State Directly\n\n`done` and `current` on `<mds-stepper-bar-item>` are managed exclusively by the parent; writing them from outside bypasses the synchronization logic and breaks content panel visibility, scroll centering, and the `mdsStepperBarChange` event. Drive progress through `items-done` on the parent instead.\n\n```html\n<!-- INCORRECT -->\n<mds-stepper-bar>\n  <mds-stepper-bar-item done icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item current icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Profilo\"></mds-stepper-bar-item>\n</mds-stepper-bar>\n\n<!-- CORRECT -->\n<mds-stepper-bar items-done=\"2\">\n  <mds-stepper-bar-item icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Profilo\"></mds-stepper-bar-item>\n</mds-stepper-bar>\n```\n\n#### Do Not Listen for Native `change` Events\n\n`<mds-stepper-bar>` emits `mdsStepperBarChange` - not a native `change` event. Native DOM events do not bubble out of shadow DOM reliably, so listening for `change` will silently never fire.\n\n```html\n<!-- INCORRECT -->\n<mds-stepper-bar id=\"stepper\" items-done=\"1\">...</mds-stepper-bar>\n<script>\n  document.getElementById('stepper').addEventListener('change', handler);\n</script>\n\n<!-- CORRECT -->\n<mds-stepper-bar id=\"stepper\" items-done=\"1\">...</mds-stepper-bar>\n<script>\n  document.getElementById('stepper').addEventListener('mdsStepperBarChange', handler);\n</script>\n```\n\n#### Do Not Use `<mds-stepper-bar-item>` Outside `<mds-stepper-bar>`\n\n`<mds-stepper-bar-item>` is a compound child; it relies on the parent to receive its `done`/`current` state. Outside the parent it renders without state management and will not advance any stepper.\n\n```html\n<!-- INCORRECT -->\n<div class=\"custom-steps\">\n  <mds-stepper-bar-item icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Profilo\"></mds-stepper-bar-item>\n</div>\n\n<!-- CORRECT -->\n<mds-stepper-bar items-done=\"1\">\n  <mds-stepper-bar-item icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Profilo\"></mds-stepper-bar-item>\n</mds-stepper-bar>\n```\n\n#### Do Not Wrap Items in Extra Elements\n\nThe indicator track lays out its direct slot children (flex row, `--mds-stepper-bar-gap`, scroll snapping): a wrapper becomes a single item of the track, so the steps lose that layout. Compound children must be direct children of the parent.\n\n```html\n<!-- INCORRECT -->\n<mds-stepper-bar items-done=\"1\">\n  <div class=\"step-group\">\n    <mds-stepper-bar-item icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n    <mds-stepper-bar-item icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Profilo\"></mds-stepper-bar-item>\n  </div>\n</mds-stepper-bar>\n\n<!-- CORRECT -->\n<mds-stepper-bar items-done=\"1\">\n  <mds-stepper-bar-item icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Profilo\"></mds-stepper-bar-item>\n</mds-stepper-bar>\n```\n\n#### Do Not Supply Fewer `slot=\"content\"` Panels than Items\n\nThe component pairs panels to items by index position; if a panel is missing for a given index, the content region for that step will be empty with no warning. Always provide exactly one `slot=\"content\"` element per `<mds-stepper-bar-item>`.\n\n```html\n<!-- INCORRECT - three items, only two content panels -->\n<mds-stepper-bar items-done=\"1\">\n  <mds-stepper-bar-item icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Profilo\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item icon=\"mi/baseline/done\" icon-checked=\"mi/baseline/done\" label=\"Conferma\"></mds-stepper-bar-item>\n\n  <div slot=\"content\"><mds-text>Account</mds-text></div>\n  <div slot=\"content\"><mds-text>Profilo</mds-text></div>\n</mds-stepper-bar>\n\n<!-- CORRECT - one panel per item -->\n<mds-stepper-bar items-done=\"1\">\n  <mds-stepper-bar-item icon=\"mi/baseline/person\" icon-checked=\"mi/baseline/done\" label=\"Account\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item icon=\"mi/baseline/badge\" icon-checked=\"mi/baseline/done\" label=\"Profilo\"></mds-stepper-bar-item>\n  <mds-stepper-bar-item icon=\"mi/baseline/done\" icon-checked=\"mi/baseline/done\" label=\"Conferma\"></mds-stepper-bar-item>\n\n  <div slot=\"content\"><mds-text>Account</mds-text></div>\n  <div slot=\"content\"><mds-text>Profilo</mds-text></div>\n  <div slot=\"content\"><mds-text>Conferma</mds-text></div>\n</mds-stepper-bar>\n```\n\n#### Do Not Set `items-done` as a Boolean\n\n`items-done` is a number, not a flag. Setting it as a bare boolean attribute sends the string `\"\"`, which parses to `NaN`: no step is marked current or done. Always pass a numeric value.\n\n```html\n<!-- INCORRECT -->\n<mds-stepper-bar items-done>...</mds-stepper-bar>\n\n<!-- CORRECT -->\n<mds-stepper-bar items-done=\"1\">...</mds-stepper-bar>\n```\n"
      },
      "props": [
        {
          "name": "itemsDone",
          "type": "number",
          "complexType": {
            "original": "number",
            "resolved": "number",
            "references": {}
          },
          "mutable": false,
          "attr": "items-done",
          "reflectToAttr": false,
          "docs": "Sets the current item by its position, counted from 1: the items before it are done. 1 makes\nthe first item current with none done, 0 makes no item current, the number of items + 1 marks\nthem all done",
          "docsTags": [
            {
              "name": "default",
              "text": "1"
            }
          ],
          "default": "1",
          "values": [
            {
              "type": "number"
            }
          ],
          "optional": false,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "navigation",
          "type": "\"none\" | \"scrollbar\"",
          "complexType": {
            "original": "StepperBarNavigationType",
            "resolved": "\"none\" | \"scrollbar\"",
            "references": {
              "StepperBarNavigationType": {
                "location": "import",
                "path": "./meta/meta",
                "id": "src/components/mds-stepper-bar/meta/meta.ts::StepperBarNavigationType",
                "referenceLocation": "StepperBarNavigationType"
              }
            }
          },
          "mutable": false,
          "attr": "navigation",
          "reflectToAttr": true,
          "docs": "Specifies the navigation type",
          "docsTags": [
            {
              "name": "default",
              "text": "'none'"
            }
          ],
          "default": "'none'",
          "values": [
            {
              "value": "none",
              "type": "string"
            },
            {
              "value": "scrollbar",
              "type": "string"
            }
          ],
          "optional": false,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [
        {
          "event": "mdsStepperBarChange",
          "detail": "MdsStepperBarEventDetail",
          "bubbles": true,
          "complexType": {
            "original": "MdsStepperBarEventDetail",
            "resolved": "MdsStepperBarEventDetail",
            "references": {
              "MdsStepperBarEventDetail": {
                "location": "import",
                "path": "./meta/event-detail",
                "id": "src/components/mds-stepper-bar/meta/event-detail.ts::MdsStepperBarEventDetail",
                "referenceLocation": "MdsStepperBarEventDetail"
              }
            }
          },
          "cancelable": true,
          "composed": true,
          "docs": "Emits when a step is changed",
          "docsTags": []
        }
      ],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-stepper-bar-gap",
          "annotation": "prop",
          "docs": "Sets the gap between the stepper bar items.",
          "visibility": "public"
        },
        {
          "name": "--mds-stepper-bar-offset-margin",
          "annotation": "prop",
          "docs": "Sets the offset margin of the stepper bar.",
          "visibility": "public"
        },
        {
          "name": "--mds-stepper-bar-scroll-behavior",
          "annotation": "prop",
          "docs": "Sets the scroll behavior of the stepper bar.",
          "visibility": "internal"
        },
        {
          "name": "--mds-stepper-bar-scrollbar-margin",
          "annotation": "prop",
          "docs": "Sets the margin of the scrollbar.",
          "visibility": "internal"
        },
        {
          "name": "--mds-stepper-bar-scrollbar-radius",
          "annotation": "prop",
          "docs": "Sets the radius of the scrollbar.",
          "visibility": "internal"
        },
        {
          "name": "--mds-stepper-bar-scrollbar-size",
          "annotation": "prop",
          "docs": "Sets the size of the scrollbar.",
          "visibility": "internal"
        },
        {
          "name": "--mds-stepper-bar-scrollbar-thumb-background",
          "annotation": "prop",
          "docs": "Sets the background color of the scrollbar thumb.",
          "visibility": "internal"
        },
        {
          "name": "--mds-stepper-bar-scrollbar-track-background",
          "annotation": "prop",
          "docs": "Sets the background color of the scrollbar track.",
          "visibility": "internal"
        }
      ],
      "slots": [
        {
          "name": "",
          "docs": "Add `mds-stepper-bar-item` element/s."
        },
        {
          "name": "content",
          "docs": "Add `HTML elements` or `components`, one per mds-stepper-bar-item added"
        }
      ],
      "parts": [
        {
          "name": "contents",
          "docs": "Selects the `contents` container element wrapped in shadowDOM."
        },
        {
          "name": "items",
          "docs": "Selects the `items` container element wrapped in shadowDOM."
        }
      ],
      "states": [],
      "dependents": [],
      "dependencies": [],
      "dependencyGraph": {},
      "storybook": "ui-stepper-bar--docs"
    }
  ]
}
