{
  "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-paginator-item/mds-paginator-item.tsx",
      "encapsulation": "shadow",
      "tag": "mds-paginator-item",
      "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` to this slot, **avoid** to add `HTML elements` or `components` here."
        },
        {
          "name": "parent",
          "text": "mds-paginator"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-paginator-item>` web component is a compound child of [`<mds-paginator>`](../mds-paginator/AGENTS.md) that renders a single clickable cell of the pagination control: either a numbered page or a navigation arrow. It has no standalone meaning and exists only to be orchestrated by its parent, which owns page state and emits the page-change event.\n\n#### Semantic Behavior\n\n- **Compound child only**: It is rendered exclusively by `<mds-paginator>` (one per page number plus the back/forward arrows) and is not used standalone or mixed with other child types; the parent manages count, ordering, scrolling, and selection.\n- **State is parent-driven**: `selected` and `disabled` are not set by the consumer - the parent reflects them based on `currentPage` and the page boundaries, and the item only renders the resulting visual state.\n- **Click reported upward**: The item carries no internal page logic; clicking it is resolved by the parent, which emits `mdsPaginatorChange`.\n- **Keyboard activation**: The item is a button (`role=\"button\"`) that Enter and Space activate, but only while it is neither `disabled` nor `selected`. A `disabled` item leaves the tab order and carries `aria-disabled=\"true\"`; the `selected` one stays in it, as the current page (`aria-current=\"page\"`), and ignores activation.\n- **Icon vs. text rendering**: When `icon` is set the item renders an icon (used for the back/forward arrows); otherwise it renders the default slot as the page number.\n- **Text-only slot**: The default slot is meant for a plain text string (a page number); HTML elements or nested components should not be placed in it.\n\n#### Properties & Visual Configurations\n\nThis child exposes only three props, none of which a consumer normally sets directly:\n\n- **`icon`**: Provide an icon name to turn the cell into a navigation control (the parent passes the back/forward arrows); leave it unset for a numbered page that uses the text slot instead.\n- **`selected`**: Marks the cell as the current page. Set by the parent only; it switches the item to its selected visual treatment and makes it inert.\n- **`disabled`**: Marks the cell as unavailable (e.g. the back arrow on page 1, the forward arrow on the last page). Set by the parent only; it blocks activation and applies the disabled styling.\n\nVisual appearance (size, radius, colors, shadows for the default, hover, selected, and disabled states) is set through the `--mds-paginator-item-*` CSS custom properties listed in [`AGENTS.md`](AGENTS.md) rather than through props. The items live in the shadow DOM of `mds-paginator`, so set them on the paginator (or a parent selector): the items inherit them.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-paginator-item>` 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> **Note:** `<mds-paginator-item>` is an internal sub-part of [`mds-paginator`](../mds-paginator/AGENTS.md). The idiomatic way to display page navigation is to use `<mds-paginator>` directly - it renders and manages all items automatically. The patterns below document the component's surface to show how the parent assembles it.\n\n#### Using mds-paginator (the normal case)\n\nRender a paginator by setting `pages` and `current-page` on the parent. The parent creates one `<mds-paginator-item>` per page number plus the back and forward arrow items; you never instantiate them yourself.\n\n```html\n<mds-paginator pages=\"12\" current-page=\"1\"></mds-paginator>\n```\n\n#### Listening for Page Changes\n\nThe page-change event is emitted by the parent `<mds-paginator>` as `mdsPaginatorChange`. Do not listen for click events on individual items.\n\n```html\n<mds-paginator id=\"paginatore\" pages=\"20\" current-page=\"1\"></mds-paginator>\n\n<script>\n  document.querySelector('#paginatore').addEventListener('mdsPaginatorChange', (e) => {\n    console.log('Pagina selezionata:', e.detail.page);\n  });\n</script>\n```\n\n#### Numbered Page Item (text slot)\n\nWhen `icon` is not set, the item renders the default slot content as the page number label. The slot expects a plain text string - no HTML elements or components.\n\n```html\n<!-- Rendered internally by mds-paginator; shown here for reference only -->\n<mds-paginator-item>7</mds-paginator-item>\n```\n\n#### Icon-Based Navigation Item\n\nWhen `icon` is set, the item renders an icon instead of the text slot and is used for the back and forward arrow controls. The parent passes its own back and forward arrow icons, bundled in the component, and names each arrow with an `aria-label`: an icon alone gives the item no accessible name.\n\n```html\n<!-- Rendered internally by mds-paginator; shown here for reference only -->\n<mds-paginator-item icon=\"mi/baseline/arrow-back\" aria-label=\"Pagina precedente\" disabled></mds-paginator-item>\n<mds-paginator-item icon=\"mi/baseline/arrow-forward\" aria-label=\"Pagina successiva\"></mds-paginator-item>\n```\n\n#### Selected and Disabled States\n\n`selected` marks the current page and makes the item inert. `disabled` marks a navigation arrow as unavailable (e.g. back arrow on page 1) and also blocks activation. Both are boolean attributes that the parent manages.\n\n```html\n<!-- Current page - selected, inert -->\n<mds-paginator-item selected>3</mds-paginator-item>\n\n<!-- Back arrow on page 1 - disabled, inert -->\n<mds-paginator-item icon=\"mi/baseline/arrow-back\" aria-label=\"Pagina precedente\" disabled></mds-paginator-item>\n```\n\n#### CSS Customization\n\nThe items live in the shadow DOM of the parent `mds-paginator`, so the public `--mds-paginator-item-*` CSS custom properties reach them by inheritance: set them on the `mds-paginator` host or on a containing selector, next to the parent's own `--mds-paginator-background` and `--mds-paginator-scroll-behavior`. Use the semantic color roles so dark mode keeps working.\n\n```css\nmds-paginator {\n  --mds-paginator-background: rgb(var(--magma-wash-strong));\n  --mds-paginator-item-size: calc(var(--spacing) * 800);\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-paginator-item>`. 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-paginator-item Standalone\n\n`<mds-paginator-item>` is an internal sub-part rendered exclusively by `<mds-paginator>`. It has no standalone meaning; it relies on the parent to supply state (`selected`, `disabled`) and to handle page logic and the `mdsPaginatorChange` event.\n\n```html\n<!-- INCORRECT -->\n<mds-paginator-item>1</mds-paginator-item>\n<mds-paginator-item selected>2</mds-paginator-item>\n<mds-paginator-item>3</mds-paginator-item>\n\n<!-- CORRECT -->\n<mds-paginator pages=\"10\" current-page=\"2\"></mds-paginator>\n```\n\n#### Do Not Put HTML in the Default Slot\n\nThe default slot accepts a plain text string - the page number. Nested elements are not supported and break the item's layout.\n\n```html\n<!-- INCORRECT -->\n<mds-paginator-item>\n  <strong>5</strong>\n</mds-paginator-item>\n\n<!-- CORRECT -->\n<mds-paginator-item>5</mds-paginator-item>\n```\n\n#### Do Not Set selected or disabled From Consumer Code\n\nBoth `selected` and `disabled` are driven by the parent paginator based on `currentPage` and page boundaries. Setting them manually from consumer code creates state conflicts with the parent's rendering logic.\n\n```html\n<!-- INCORRECT - consumer forcing selected state -->\n<mds-paginator pages=\"10\" current-page=\"3\">\n  <!-- attempting to override individual item state externally -->\n</mds-paginator>\n<script>\n  document.querySelector('mds-paginator')\n    .shadowRoot.querySelectorAll('mds-paginator-item')[2]\n    .setAttribute('selected', '');\n</script>\n\n<!-- CORRECT - drive state through the parent prop -->\n<mds-paginator pages=\"10\" current-page=\"3\"></mds-paginator>\n```\n\n#### Do Not Listen for Click Events on Items\n\nIndividual item clicks are handled internally by `<mds-paginator>`. Listening for `click` on items reaches into shadow DOM and bypasses the parent's page validation and scroll logic. Use the documented `mdsPaginatorChange` event on the parent.\n\n```html\n<!-- INCORRECT -->\n<mds-paginator id=\"pag\" pages=\"10\" current-page=\"1\"></mds-paginator>\n<script>\n  document.querySelector('#pag').shadowRoot\n    .querySelectorAll('mds-paginator-item')\n    .forEach((item) => item.addEventListener('click', handleClick));\n</script>\n\n<!-- CORRECT -->\n<mds-paginator id=\"pag\" pages=\"10\" current-page=\"1\"></mds-paginator>\n<script>\n  document.querySelector('#pag').addEventListener('mdsPaginatorChange', (e) => {\n    console.log('Pagina:', e.detail.page);\n  });\n</script>\n```\n\n#### Do Not Pierce Shadow DOM to Style Items\n\nFrom outside, the supported customization surface is the documented `--mds-paginator-*` and `--mds-paginator-item-*` CSS custom properties, set on `mds-paginator`: the items inherit them. Targeting internals via `::part()`, `>>>`, or undocumented selectors couples your code to the implementation and will break on minor releases.\n\n```css\n/* INCORRECT */\nmds-paginator-item >>> .text {\n  font-weight: 900;\n}\n\n/* CORRECT */\nmds-paginator {\n  --mds-paginator-background: rgb(var(--magma-wash-strong));\n  --mds-paginator-item-color: rgb(var(--magma-text-muted));\n}\n```\n"
      },
      "props": [
        {
          "name": "disabled",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "disabled",
          "reflectToAttr": true,
          "docs": "Specifies if the item is disabled or not, is handled from the parent paginator",
          "docsTags": [],
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "icon",
          "type": "string | undefined",
          "complexType": {
            "original": "string",
            "resolved": "string | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "icon",
          "reflectToAttr": true,
          "docs": "Specifies the icon used inside the paginator item",
          "docsTags": [],
          "values": [
            {
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "selected",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "selected",
          "reflectToAttr": true,
          "docs": "Specifies if the item is selected or not, is handled from the parent paginator",
          "docsTags": [],
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-paginator-item-background",
          "annotation": "prop",
          "docs": "Sets the background-color of the item",
          "visibility": "public"
        },
        {
          "name": "--mds-paginator-item-background-disabled",
          "annotation": "prop",
          "docs": "Sets the background-color of the item when is disabled",
          "visibility": "internal"
        },
        {
          "name": "--mds-paginator-item-background-hover",
          "annotation": "prop",
          "docs": "Sets the background-color of the item when the mouse is over it",
          "visibility": "internal"
        },
        {
          "name": "--mds-paginator-item-background-selected",
          "annotation": "prop",
          "docs": "Sets the background-color of the item when is selected",
          "visibility": "internal"
        },
        {
          "name": "--mds-paginator-item-color",
          "annotation": "prop",
          "docs": "Sets the text color of the component",
          "visibility": "public"
        },
        {
          "name": "--mds-paginator-item-color-disabled",
          "annotation": "prop",
          "docs": "Sets the color of the item when is disabled",
          "visibility": "internal"
        },
        {
          "name": "--mds-paginator-item-color-hover",
          "annotation": "prop",
          "docs": "Sets the text color of the item when the mouse is over it",
          "visibility": "internal"
        },
        {
          "name": "--mds-paginator-item-color-selected",
          "annotation": "prop",
          "docs": "Sets the text color of the item when is selected",
          "visibility": "internal"
        },
        {
          "name": "--mds-paginator-item-radius",
          "annotation": "prop",
          "docs": "Sets the border-radius of the component",
          "visibility": "public"
        },
        {
          "name": "--mds-paginator-item-shadow",
          "annotation": "prop",
          "docs": "Sets the box-shadow of the component",
          "visibility": "public"
        },
        {
          "name": "--mds-paginator-item-shadow-disabled",
          "annotation": "prop",
          "docs": "Sets the box-shadow of the item when is disabled",
          "visibility": "internal"
        },
        {
          "name": "--mds-paginator-item-shadow-hover",
          "annotation": "prop",
          "docs": "Sets the box-shadow of the item when the mouse is over it",
          "visibility": "internal"
        },
        {
          "name": "--mds-paginator-item-shadow-selected",
          "annotation": "prop",
          "docs": "Sets the box-shadow of the item when is selected",
          "visibility": "internal"
        },
        {
          "name": "--mds-paginator-item-size",
          "annotation": "prop",
          "docs": "Sets the height and the min-width of the paginator item",
          "visibility": "public"
        }
      ],
      "slots": [
        {
          "name": "",
          "docs": "Add `text string` to this slot, **avoid** to add `HTML elements` or `components` here."
        }
      ],
      "parts": [],
      "states": [],
      "dependents": [
        "mds-paginator"
      ],
      "dependencies": [
        "mds-icon",
        "mds-text"
      ],
      "dependencyGraph": {
        "mds-paginator-item": [
          "mds-icon",
          "mds-text"
        ],
        "mds-paginator": [
          "mds-paginator-item"
        ]
      },
      "storybook": "ui-paginator-item--docs"
    }
  ]
}
