{
  "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-author/mds-author.tsx",
      "encapsulation": "shadow",
      "tag": "mds-author",
      "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. Insert author information, name, role or other useful author infos."
        },
        {
          "name": "slot",
          "text": "avatar - Insert an avatar image, it is **recommended** to add `mds-avatar` element."
        },
        {
          "name": "category",
          "text": "data"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-author>` web component is the layout primitive of the Magma Design System for presenting a person's identity: it pairs an avatar with author information (name, role, or any related details). It exposes no props and acts purely as a slotted container, arranging an optional `avatar` slot beside a default content slot.\n\n#### Semantic Behavior\n\n- **Conditional avatar rendering**: The avatar column appears only while a direct child assigned to `slot=\"avatar\"` is present, also when it is added after the first render, so omitting it produces no empty column.\n- **Default slot is content, not text**: The default slot is meant to hold structured author information (typically stacked `mds-text` elements for name and role) rather than a single inline label.\n- **Responsive collapse**: Below ~200px wide the avatar stacks above the info and they center, so the same markup adapts from a horizontal row to a compact vertical card.\n- **Compound usage**: It is designed to wrap an `mds-avatar` in the `avatar` slot; the avatar element owns initials/image fallback logic, while `<mds-author>` only positions it.\n\n#### Properties & Visual Configurations\n\nThis component has no properties. All configuration is expressed through its two slots:\n\n- **`avatar` slot**: the leading element, recommended to be an `mds-avatar`. Its presence is what toggles the two-column layout.\n- **default slot**: the trailing block holding the author's textual details, laid out so multiple lines stack cleanly and shrink to the available width (set `truncate` on an `mds-text` to cut a long line).\n\nSee [`agents/conventions.md`](../../../../agents/conventions.md) for the shared compound-component conventions and the usage contract.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-author>` component, ordered from most common to most specialized. The examples assume a working knowledge of compound-component conventions documented in [`agents/conventions.md`](../../../../agents/conventions.md).\n\n#### Full Byline with Avatar\n\nThe canonical form. Place an [`mds-avatar`](../mds-avatar/AGENTS.md) in the `avatar` slot and stack the author's name and role in the default slot using [`mds-text`](../mds-text/AGENTS.md).\n\n```html\n<mds-author>\n  <mds-avatar slot=\"avatar\" initials=\"mg\" src=\"/assets/avatars/mario-gomez.webp\"></mds-avatar>\n  <mds-text typography=\"h6\">Mario Gomez</mds-text>\n  <mds-text typography=\"caption\">Responsabile editoriale</mds-text>\n</mds-author>\n```\n\n#### Avatar with Initials Fallback\n\nWhen no profile image is available, omit `src` and rely on `initials`. The avatar component derives a deterministic identity color from the initials, keeping people visually distinguishable.\n\n```html\n<mds-author>\n  <mds-avatar slot=\"avatar\" initials=\"ag\"></mds-avatar>\n  <mds-text typography=\"h6\">Anna Grandi</mds-text>\n  <mds-text typography=\"caption\">Giornalista</mds-text>\n</mds-author>\n```\n\n#### Multiple Info Lines\n\nThe default slot is a grid container - any number of stacked lines render cleanly and shrink to the available width; set `truncate` on an `mds-text` to cut a long line.\n\n```html\n<mds-author>\n  <mds-avatar slot=\"avatar\" initials=\"fb\" src=\"/assets/avatars/fred-brooks.webp\"></mds-avatar>\n  <mds-text typography=\"h6\">Fred Brooks</mds-text>\n  <mds-text typography=\"caption\">Ingegnere del software</mds-text>\n  <mds-text typography=\"caption\">Dipartimento IT</mds-text>\n</mds-author>\n```\n\n#### Text-Only Author (No Avatar)\n\nOmitting the `avatar` slot entirely collapses the avatar column. No empty space is left - the info block fills the full width.\n\n```html\n<mds-author>\n  <mds-text typography=\"h6\">Luca Ferretti</mds-text>\n  <mds-text typography=\"caption\">Redattore capo</mds-text>\n</mds-author>\n```\n\n#### Author Card Inside an Article Header\n\n`<mds-author>` is typically embedded inside a card or article header, paired with a date or category label.\n\n```html\n<mds-card>\n  <mds-card-header slot=\"header\">\n    <mds-author>\n      <mds-avatar slot=\"avatar\" initials=\"cs\" src=\"/assets/avatars/chiara-sala.webp\"></mds-avatar>\n      <mds-text typography=\"h6\">Chiara Sala</mds-text>\n      <mds-text typography=\"caption\">Pubblicato il 3 giugno 2026</mds-text>\n    </mds-author>\n  </mds-card-header>\n</mds-card>\n```\n\n#### Avatar with Icon for Non-Human Entities\n\nWhen the author represents an organization or system - rather than a person - pass an icon slug to `mds-avatar` instead of initials or a photo.\n\n```html\n<mds-author>\n  <mds-avatar slot=\"avatar\" icon=\"mi/baseline/business\"></mds-avatar>\n  <mds-text typography=\"h6\">Redazione Magma</mds-text>\n  <mds-text typography=\"caption\">Contenuto istituzionale</mds-text>\n</mds-author>\n```\n\n#### Narrow-Container Responsive Behavior\n\n`<mds-author>` uses a CSS container query: inside a container narrower than 200px the avatar stacks above the info and both center automatically. No extra markup is needed - size the parent container to trigger it.\n\n```html\n<!-- In a sidebar widget constrained to ~160px wide, the layout collapses automatically -->\n<aside style=\"width: 160px;\">\n  <mds-author>\n    <mds-avatar slot=\"avatar\" initials=\"gv\"></mds-avatar>\n    <mds-text typography=\"label\">Giulia Verdi</mds-text>\n    <mds-text typography=\"caption\">Moderatrice</mds-text>\n  </mds-author>\n</aside>\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-author>`. 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 Put Plain Text Directly in the Default Slot\n\nThe default slot is a grid container designed for structured elements like `mds-text`. Bare text nodes render without typography tokens, scale inconsistently, and cannot be truncated reliably.\n\n```html\n<!-- INCORRECT -->\n<mds-author>\n  <mds-avatar slot=\"avatar\" initials=\"lr\"></mds-avatar>\n  Luca Rossi\n  Redattore\n</mds-author>\n\n<!-- CORRECT -->\n<mds-author>\n  <mds-avatar slot=\"avatar\" initials=\"lr\"></mds-avatar>\n  <mds-text typography=\"h6\">Luca Rossi</mds-text>\n  <mds-text typography=\"caption\">Redattore</mds-text>\n</mds-author>\n```\n\n#### Do Not Place the Avatar in the Default Slot\n\nAssigning an `mds-avatar` without `slot=\"avatar\"` puts it in the text/info region. The component only wires up the two-column layout when a child is assigned to the named `avatar` slot.\n\n```html\n<!-- INCORRECT -->\n<mds-author>\n  <mds-avatar initials=\"ab\"></mds-avatar>\n  <mds-text typography=\"h6\">Anna Bianchi</mds-text>\n</mds-author>\n\n<!-- CORRECT -->\n<mds-author>\n  <mds-avatar slot=\"avatar\" initials=\"ab\"></mds-avatar>\n  <mds-text typography=\"h6\">Anna Bianchi</mds-text>\n</mds-author>\n```\n\n#### Do Not Inline an `<img>` Instead of `mds-avatar`\n\nUsing a raw `<img>` in the avatar slot skips the image-load error handling (a person glyph replaces a broken image), the loading placeholder, and the consistent sizing that `mds-avatar` provides.\n\n```html\n<!-- INCORRECT -->\n<mds-author>\n  <img slot=\"avatar\" src=\"/assets/foto.jpg\" alt=\"Foto autore\" />\n  <mds-text typography=\"h6\">Paolo Neri</mds-text>\n</mds-author>\n\n<!-- CORRECT -->\n<mds-author>\n  <mds-avatar slot=\"avatar\" src=\"/assets/foto.jpg\" initials=\"pn\"></mds-avatar>\n  <mds-text typography=\"h6\">Paolo Neri</mds-text>\n</mds-author>\n```\n\n#### Do Not Force Layout via Inline Styles\n\n`<mds-author>` manages its own flex and container-query layout. Overriding `display`, `flex-direction`, or `align-items` on the host breaks the responsive collapse at narrow widths.\n\n```html\n<!-- INCORRECT -->\n<mds-author style=\"flex-direction: column; align-items: flex-start;\">\n  <mds-avatar slot=\"avatar\" initials=\"sv\"></mds-avatar>\n  <mds-text typography=\"h6\">Sara Vitale</mds-text>\n</mds-author>\n\n<!-- CORRECT -->\n<!-- Constrain the parent container width to let the built-in container query handle the collapse -->\n<div style=\"width: 160px;\">\n  <mds-author>\n    <mds-avatar slot=\"avatar\" initials=\"sv\"></mds-avatar>\n    <mds-text typography=\"h6\">Sara Vitale</mds-text>\n  </mds-author>\n</div>\n```\n\n#### Do Not Use `<mds-author>` as a Generic Flex Row\n\n`<mds-author>` is specifically designed for author bylines. For other avatar-plus-text combinations (entity cards, mention chips, user list rows) use [`mds-entity`](../mds-entity/AGENTS.md) or [`mds-mention`](../mds-mention/AGENTS.md) instead.\n\n```html\n<!-- INCORRECT - using mds-author to display a product or file entry -->\n<mds-author>\n  <mds-avatar slot=\"avatar\" icon=\"mi/baseline/folder\"></mds-avatar>\n  <mds-text typography=\"h6\">Documento strategico.pdf</mds-text>\n  <mds-text typography=\"caption\">1.2 MB</mds-text>\n</mds-author>\n\n<!-- CORRECT -->\n<mds-entity icon=\"mi/baseline/folder\">\n  <mds-text typography=\"h6\">Documento strategico.pdf</mds-text>\n  <mds-text slot=\"detail\" typography=\"caption\">1.2 MB</mds-text>\n</mds-entity>\n```\n"
      },
      "props": [],
      "methods": [],
      "events": [],
      "listeners": [],
      "styles": [],
      "slots": [
        {
          "name": "",
          "docs": "Add `text string`, `HTML elements` or `components` to this slot. Insert author information, name, role or other useful author infos."
        },
        {
          "name": "avatar",
          "docs": "Insert an avatar image, it is **recommended** to add `mds-avatar` element."
        }
      ],
      "parts": [],
      "states": [],
      "dependents": [],
      "dependencies": [],
      "dependencyGraph": {},
      "storybook": "ui-author--docs"
    }
  ]
}
