{
  "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-table-row/mds-table-row.tsx",
      "encapsulation": "shadow",
      "tag": "mds-table-row",
      "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": "- Put `mds-table-cell` element/s."
        },
        {
          "name": "slot",
          "text": "action - Put `mds-button` element/s or other kind of actions as aside menu for the single row."
        },
        {
          "name": "parent",
          "text": "mds-table-body"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-table-row>` web component represents a single data row inside a [`<mds-table>`](../mds-table/AGENTS.md) (slotted through `mds-table-body`; `mds-table-header` and `mds-table-footer` are rows themselves). It wraps a set of `mds-table-cell` children, and optionally exposes a per-row selection checkbox and an aside actions menu.\n\n#### Semantic Behavior\n\n- **Compound child only**: `<mds-table-row>` must be slotted inside the `mds-table-body` of an `<mds-table>`; it is not used standalone and its default slot must contain `mds-table-cell` elements, not arbitrary markup.\n- **Parent-driven configuration**: `interactive`, `selectable`, and `overlayActions` are set by the parent `<mds-table>` on every row, so rows stay in sync with table state rather than being configured one by one.\n- **Selection reporting**: When `selectable` is on, the row renders a leading selection checkbox; toggling it updates the row's `selected` prop and tells the table to recompute and emit the table-level selection event.\n- **Selected as two-way state**: `selected` can be read and set by the parent to drive bulk select-all behavior.\n- **Actions menu**: An `action`-named slot, when present, renders an actions cell that floats correctly over the scrolling row.\n- **Localized accessibility labels**: The selection switch's title is localized (Select/Deselect row) across el/en/es/it.\n\n#### Properties & Visual Configurations\n\nMost props are orchestrated by the parent table rather than set directly by consumers:\n\n- **`interactive`**: mirrors the table's interactive mode (hover highlight); normally inherited from `<mds-table>` rather than set per row.\n- **`selectable`**: enables the leading selection switch; toggled by the table so all rows gain or lose selection together.\n- **`overlayActions`**: set by the table when the row content overflows horizontally, switching the actions menu to an overlay rendering so it stays reachable while scrolling.\n- **`selected`**: the row's current selection state; read and written by the parent for select-all and batch operations. Write it in the markup for a row that starts selected: the table counts it on load, without an `mdsTableSelectionChange`.\n- **`value`**: the identifying payload reported back in the table's selection event for this row - set this to the business key (e.g. record id) you need when handling selections.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-table-row>` 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 Row with Data Cells\n\nThe minimal form: slot one or more [`mds-table-cell`](../mds-table-cell/AGENTS.md) elements into the default slot. Always place `<mds-table-row>` inside [`mds-table-body`](../mds-table-body/AGENTS.md) - never standalone, and never inside `mds-table-header` / `mds-table-footer`, which are rows themselves.\n\n```html\n<mds-table>\n  <mds-table-header>\n    <mds-table-header-cell label=\"Nome\"></mds-table-header-cell>\n    <mds-table-header-cell label=\"Email\"></mds-table-header-cell>\n    <mds-table-header-cell label=\"Data\"></mds-table-header-cell>\n  </mds-table-header>\n  <mds-table-body>\n    <mds-table-row>\n      <mds-table-cell><mds-text typography=\"detail\">Mario Rossi</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">mario.rossi@example.com</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">12 ottobre 1985</mds-text></mds-table-cell>\n    </mds-table-row>\n    <mds-table-row>\n      <mds-table-cell><mds-text typography=\"detail\">Luigi Verdi</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">luigi.verdi@example.com</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">3 marzo 1993</mds-text></mds-table-cell>\n    </mds-table-row>\n  </mds-table-body>\n</mds-table>\n```\n\n#### Row with Per-Row Actions\n\nSlot one or more [`mds-button`](../mds-button/AGENTS.md) elements into the `action` slot to add a contextual actions menu that slides in on row hover. Use icon-only buttons with `aria-label` (or `title`) because the label has no space.\n\n```html\n<mds-table-row value=\"42\">\n  <mds-table-cell><mds-text typography=\"detail\">Documento riservato.pdf</mds-text></mds-table-cell>\n  <mds-table-cell><mds-text typography=\"detail\">2 MB</mds-text></mds-table-cell>\n  <mds-button\n    slot=\"action\"\n    icon=\"mi/baseline/download\"\n    title=\"Scarica\"\n    variant=\"primary\"\n    tone=\"text\"\n  ></mds-button>\n  <mds-button\n    slot=\"action\"\n    icon=\"mi/baseline/delete\"\n    title=\"Elimina\"\n    variant=\"error\"\n    tone=\"text\"\n  ></mds-button>\n</mds-table-row>\n```\n\n#### Row with Identifying `value`\n\nSet `value` to the business key (record id or slug) that the parent table should include in the `mdsTableSelectionChange` event detail. This wires the visual row to the data layer without any manual DOM traversal.\n\n```html\n<mds-table selectable>\n  <mds-table-body>\n    <mds-table-row value=\"user-101\">\n      <mds-table-cell><mds-text typography=\"detail\">Carla Bianchi</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">carla.bianchi@example.com</mds-text></mds-table-cell>\n    </mds-table-row>\n    <mds-table-row value=\"user-102\">\n      <mds-table-cell><mds-text typography=\"detail\">Federica Neri</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">federica.neri@example.com</mds-text></mds-table-cell>\n    </mds-table-row>\n  </mds-table-body>\n</mds-table>\n```\n\n#### Selectable Table - Reading the Selection Event\n\nWhen the parent `<mds-table>` sets `selectable`, each row renders a leading checkbox automatically. Listen for `mdsTableSelectionChange` on the table - do not wire per-row events.\n\n```html\n<mds-table id=\"utenti\" selectable>\n  <mds-table-body>\n    <mds-table-row value=\"101\">\n      <mds-table-cell><mds-text typography=\"detail\">Mario Rossi</mds-text></mds-table-cell>\n    </mds-table-row>\n    <mds-table-row value=\"102\">\n      <mds-table-cell><mds-text typography=\"detail\">Luigi Verdi</mds-text></mds-table-cell>\n    </mds-table-row>\n  </mds-table-body>\n</mds-table>\n\n<script>\n  document.getElementById('utenti').addEventListener('mdsTableSelectionChange', (e) => {\n    console.log('Righe selezionate:', e.detail.rows);\n  });\n</script>\n```\n\n#### Programmatic Selection\n\n`selected` is mutable and reflected. Set it from JavaScript to restore a previously saved selection state. The parent table follows it: it emits `mdsTableSelectionChange` and updates the header checkbox and the batch-action bar, once for the rows changed together. For bulk \"select all\" use the table's `selectAll()`.\n\n```html\n<mds-table selectable id=\"tabella-record\">\n  <mds-table-body>\n    <mds-table-row id=\"riga-principale\" value=\"rec-1\">\n      <mds-table-cell><mds-text typography=\"detail\">Record principale</mds-text></mds-table-cell>\n    </mds-table-row>\n  </mds-table-body>\n</mds-table>\n\n<script>\n  // Select the row programmatically (e.g. after restoring from storage)\n  document.getElementById('riga-principale').selected = true;\n</script>\n```\n\n#### Interactive Table (Hover Highlight)\n\nSet `interactive` on the parent `<mds-table>` to enable per-row hover highlights. The prop is mirrored to each row by the table - do not set it on individual rows.\n\n```html\n<mds-table interactive>\n  <mds-table-body>\n    <mds-table-row value=\"p-01\">\n      <mds-table-cell><mds-text typography=\"detail\">Pratica 01</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">In lavorazione</mds-text></mds-table-cell>\n    </mds-table-row>\n    <mds-table-row value=\"p-02\">\n      <mds-table-cell><mds-text typography=\"detail\">Pratica 02</mds-text></mds-table-cell>\n      <mds-table-cell><mds-text typography=\"detail\">Completata</mds-text></mds-table-cell>\n    </mds-table-row>\n  </mds-table-body>\n</mds-table>\n```\n\n#### Styling Customization\n\nA row takes its colours from the parent `mds-table-body` (and `mds-table`), and its hover, selected and sorted colours and the spacing of its actions follow its states. Restyle the rows through the public `--mds-table-body-*` or `--mds-table-*` properties of the parents. Use the semantic color roles wrapped in `rgb(var(--magma-<role>))` so dark mode and high-contrast modes stay consistent.\n\n```css\n/* Branded colours for the rows of a table */\n.tabella-brand mds-table-body {\n  --mds-table-body-background: rgb(var(--magma-surface-raised));\n  --mds-table-body-color: rgb(var(--magma-text-default));\n}\n```\n\nThe one public custom property of the row, `--mds-table-row-actions-background`, is read-only: it is the background the actions box paints in the current state of the row (at rest, on hover, while a column sorts a selectable table). Content of the `action` slot reads it to paint the same colour when it moves out of the box, for example a status that follows the part of a tall row on screen. Read it, never set it: the box sets it itself, so a value set from outside changes nothing.\n\n```html\n<mds-table interactive>\n  <mds-table-body>\n    <mds-table-row value=\"p-01\">\n      <mds-table-cell><mds-text typography=\"detail\">Pratica 01</mds-text></mds-table-cell>\n      <mds-text slot=\"action\" typography=\"detail\" class=\"bg-(--mds-table-row-actions-background)\">Copiato</mds-text>\n    </mds-table-row>\n  </mds-table-body>\n</mds-table>\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-table-row>`. 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-table-row>` Standalone\n\n`<mds-table-row>` is a compound child component and must be slotted inside the [`mds-table-body`](../mds-table-body/AGENTS.md) of an [`mds-table`](../mds-table/AGENTS.md). Using it outside the table subtree breaks layout and the internal parent-child communication that drives selection and interactive state.\n\n```html\n<!-- INCORRECT -->\n<div class=\"my-list\">\n  <mds-table-row>\n    <mds-table-cell>Mario Rossi</mds-table-cell>\n  </mds-table-row>\n</div>\n\n<!-- CORRECT -->\n<mds-table>\n  <mds-table-body>\n    <mds-table-row>\n      <mds-table-cell><mds-text typography=\"detail\">Mario Rossi</mds-text></mds-table-cell>\n    </mds-table-row>\n  </mds-table-body>\n</mds-table>\n```\n\n#### Do Not Put Arbitrary HTML in the Default Slot\n\nThe default slot of `<mds-table-row>` accepts only [`mds-table-cell`](../mds-table-cell/AGENTS.md) elements. Slotting raw `<td>`, `<div>`, or other markup breaks the table layout model and the sort/selection logic that relies on `mds-table-cell` identity.\n\n```html\n<!-- INCORRECT -->\n<mds-table-row>\n  <td>Mario Rossi</td>\n  <div>mario.rossi@example.com</div>\n</mds-table-row>\n\n<!-- CORRECT -->\n<mds-table-row>\n  <mds-table-cell><mds-text typography=\"detail\">Mario Rossi</mds-text></mds-table-cell>\n  <mds-table-cell><mds-text typography=\"detail\">mario.rossi@example.com</mds-text></mds-table-cell>\n</mds-table-row>\n```\n\n#### Do Not Set `interactive` or `selectable` Directly on Individual Rows\n\nBoth props are orchestrated by the parent `<mds-table>` and propagated to every row automatically. Setting them per-row creates a desynchronized state where some rows behave differently from others, and the table's own state machine does not know about the override.\n\n```html\n<!-- INCORRECT -->\n<mds-table>\n  <mds-table-body>\n    <mds-table-row interactive selectable>\n      <mds-table-cell><mds-text typography=\"detail\">Pratica 01</mds-text></mds-table-cell>\n    </mds-table-row>\n  </mds-table-body>\n</mds-table>\n\n<!-- CORRECT -->\n<mds-table interactive selectable>\n  <mds-table-body>\n    <mds-table-row value=\"p-01\">\n      <mds-table-cell><mds-text typography=\"detail\">Pratica 01</mds-text></mds-table-cell>\n    </mds-table-row>\n  </mds-table-body>\n</mds-table>\n```\n\n#### Do Not Listen for Row Events to Track Selection - Use the Table Event\n\n`<mds-table-row>` does not emit a public selection event. The table-level `mdsTableSelectionChange` event is the single aggregated source of truth for which rows are selected. Polling each row's `selected` attribute via MutationObserver or querying the DOM on every click is fragile and bypasses the table's own selection bookkeeping.\n\n```html\n<!-- INCORRECT -->\n<script>\n  document.querySelectorAll('mds-table-row').forEach((row) => {\n    row.addEventListener('click', () => {\n      console.log('selezionato:', row.selected);\n    });\n  });\n</script>\n\n<!-- CORRECT -->\n<script>\n  document.querySelector('mds-table').addEventListener('mdsTableSelectionChange', (e) => {\n    console.log('Righe selezionate:', e.detail.rows);\n  });\n</script>\n```\n\n#### Do Not Slot Icon-Only Action Buttons Without an Accessible Name\n\nButtons in the `action` slot render without visible labels. An `<mds-button>` that has neither `label` nor `aria-label` / `title` falls back to the last segment of its icon slug (`delete`), which names the icon, not the action. Always provide `title` or `aria-label` on every action button.\n\n```html\n<!-- INCORRECT -->\n<mds-table-row>\n  <mds-table-cell><mds-text typography=\"detail\">Documento.pdf</mds-text></mds-table-cell>\n  <mds-button slot=\"action\" icon=\"mi/baseline/delete\" variant=\"error\" tone=\"text\"></mds-button>\n</mds-table-row>\n\n<!-- CORRECT -->\n<mds-table-row>\n  <mds-table-cell><mds-text typography=\"detail\">Documento.pdf</mds-text></mds-table-cell>\n  <mds-button\n    slot=\"action\"\n    icon=\"mi/baseline/delete\"\n    title=\"Elimina documento\"\n    variant=\"error\"\n    tone=\"text\"\n  ></mds-button>\n</mds-table-row>\n```\n\n#### Do Not Override Row Appearance with Inline Styles or Undocumented Selectors\n\n`mds-table-row` has no public CSS custom property and no shadow part: restyle the rows through the public `--mds-table-body-*` or `--mds-table-*` properties of the parents. Targeting internal shadow parts or setting `background-color` / `color` directly on the host element bypasses the interactive and selected state logic and will break on minor releases.\n\n```css\n/* INCORRECT */\nmds-table-row {\n  background-color: rgb(var(--magma-surface-raised));\n  color: rgb(var(--magma-text-default));\n}\nmds-table-row::part(actions) {\n  gap: 4px;\n}\n\n/* CORRECT */\nmds-table-body {\n  --mds-table-body-background: rgb(var(--magma-surface-raised));\n  --mds-table-body-color: rgb(var(--magma-text-default));\n}\n```\n"
      },
      "props": [
        {
          "name": "interactive",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "interactive",
          "reflectToAttr": true,
          "docs": "Specifies whether the row reacts to user interaction (hover/focus).",
          "docsTags": [],
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "overlayActions",
          "type": "boolean",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean",
            "references": {}
          },
          "mutable": false,
          "attr": "overlay-actions",
          "reflectToAttr": true,
          "docs": "Specifies whether the row's actions are shown as an overlay.",
          "docsTags": [],
          "values": [
            {
              "type": "boolean"
            }
          ],
          "optional": false,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "selectable",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "selectable",
          "reflectToAttr": true,
          "docs": "Specifies whether the row can be selected via a checkbox.",
          "docsTags": [
            {
              "name": "default",
              "text": "undefined"
            }
          ],
          "default": "undefined",
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "selected",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": true,
          "attr": "selected",
          "reflectToAttr": true,
          "docs": "Specifies whether the row is currently selected.",
          "docsTags": [],
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "selection",
          "type": "boolean | undefined",
          "complexType": {
            "original": "boolean",
            "resolved": "boolean | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "selection",
          "reflectToAttr": true,
          "docs": "Reflects the parent table selection state (set by mds-table); drives the\nrow action background without :host-context",
          "docsTags": [],
          "values": [
            {
              "type": "boolean"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        },
        {
          "name": "value",
          "type": "number | string | undefined",
          "complexType": {
            "original": "string | number",
            "resolved": "number | string | undefined",
            "references": {}
          },
          "mutable": false,
          "attr": "value",
          "reflectToAttr": true,
          "docs": "The value associated with the row, emitted when the row is selected.",
          "docsTags": [],
          "values": [
            {
              "type": "number"
            },
            {
              "type": "string"
            },
            {
              "type": "undefined"
            }
          ],
          "optional": true,
          "required": false,
          "getter": false,
          "setter": false
        }
      ],
      "methods": [],
      "events": [],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-table-row-actions-background",
          "annotation": "prop",
          "docs": "Read-only: the background the actions box paints in the current state of the row (at rest, on hover, while a column sorts a selectable table), for content of the `action` slot that paints it too when it moves out of the box. The box sets it itself, so a value set from outside changes nothing.",
          "visibility": "public"
        },
        {
          "name": "--mds-table-row-actions-gap",
          "annotation": "prop",
          "docs": "Gap spacing for actions inside table rows.",
          "visibility": "internal"
        },
        {
          "name": "--mds-table-row-background-alt",
          "annotation": "prop",
          "docs": "Background color of the rows while a column sorts the table.",
          "visibility": "internal"
        },
        {
          "name": "--mds-table-row-background-hover",
          "annotation": "prop",
          "docs": "Background color for table row on hover.",
          "visibility": "internal"
        },
        {
          "name": "--mds-table-row-color-alt",
          "annotation": "prop",
          "docs": "Text color of the rows while a column sorts the table.",
          "visibility": "internal"
        },
        {
          "name": "--mds-table-row-color-hover",
          "annotation": "prop",
          "docs": "Text color for table row on hover.",
          "visibility": "internal"
        }
      ],
      "slots": [
        {
          "name": "",
          "docs": "Put `mds-table-cell` element/s."
        },
        {
          "name": "action",
          "docs": "Put `mds-button` element/s or other kind of actions as aside menu for the single row."
        }
      ],
      "parts": [],
      "states": [],
      "dependents": [],
      "dependencies": [
        "mds-table-cell",
        "mds-input-switch"
      ],
      "dependencyGraph": {
        "mds-table-row": [
          "mds-table-cell",
          "mds-input-switch"
        ],
        "mds-input-switch": [
          "mds-icon",
          "mds-text"
        ]
      },
      "storybook": "layout-table-row--docs"
    }
  ]
}
