{
  "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-kpi/mds-kpi.tsx",
      "encapsulation": "shadow",
      "tag": "mds-kpi",
      "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-kpi-item` element/s."
        },
        {
          "name": "category",
          "text": "data"
        }
      ],
      "usage": {
        "1. Description": "The `<mds-kpi>` web component is the layout container of the Magma Design System for presenting groups of key performance indicators. It is a compound parent with no props of its own: it establishes an accessible list region and hosts one or more `<mds-kpi-item>` children that render the actual figures.\n\n#### Semantic Behavior\n\n- **List semantics**: The host exposes its `<mds-kpi-item>` children as a single semantic list group to assistive technology.\n- **Compound relationship**: It carries no value or configuration itself; every metric - label, description, icon, and on-scroll animation - is defined on the slotted `<mds-kpi-item>` children.\n- **Default slot is content**: The default slot is meant exclusively for `<mds-kpi-item>` elements; anything else has no styled placement.\n\n#### Properties & Visual Configurations\n\n`<mds-kpi>` itself exposes no props. Configuration happens on the `<mds-kpi-item>` children and through the CSS custom properties this component publishes for them.\n\n#### Other behavioral props\n\n- **`--mds-kpi-text-animation-speed`** and **`--mds-kpi-text-animation-placeholder-char`**: tune the scramble/reveal text effect used by children. The animation only runs when a child sets a non-zero `threshold`, which animates the value in once the item scrolls into view; with the default `threshold` of `0` the figure renders statically.\n",
        "2. Examples": "Correct and idiomatic ways to use the `<mds-kpi>` 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 KPI Panel\n\nThe canonical form. Place one or more [`mds-kpi-item`](../mds-kpi-item/AGENTS.md) elements as direct children. `mds-kpi` provides the responsive grid; `mds-kpi-item` owns every visible value.\n\n```html\n<mds-kpi>\n  <mds-kpi-item label=\"1.240\" description=\"Pratiche aperte\"></mds-kpi-item>\n  <mds-kpi-item label=\"387\" description=\"In lavorazione\"></mds-kpi-item>\n  <mds-kpi-item label=\"56\" description=\"Scadute\"></mds-kpi-item>\n</mds-kpi>\n```\n\n#### KPI Item with Icon\n\nSet `icon` to an icon slug to display a glyph above the value. Use slugs from the Magma icon library - `mi/baseline/*` for Material Icons or an `mgg/` Maggioli slug.\n\n```html\n<mds-kpi>\n  <mds-kpi-item\n    icon=\"mi/baseline/folder-open\"\n    label=\"1.240\"\n    description=\"Pratiche aperte\"\n  ></mds-kpi-item>\n  <mds-kpi-item\n    icon=\"mi/baseline/pending-actions\"\n    label=\"387\"\n    description=\"In lavorazione\"\n  ></mds-kpi-item>\n  <mds-kpi-item\n    icon=\"mi/baseline/warning\"\n    label=\"56\"\n    description=\"Scadute\"\n  ></mds-kpi-item>\n</mds-kpi>\n```\n\n#### Scroll-Triggered Animation\n\nSet `threshold` to a value between `0` (exclusive) and `1` to activate the scramble/reveal animation when the item scrolls into the viewport. A threshold of `0.5` triggers once at least half the element is visible. Omit `threshold` (or leave it at the default `0`) for static rendering.\n\n```html\n<mds-kpi>\n  <mds-kpi-item\n    icon=\"mi/baseline/groups\"\n    label=\"4.512\"\n    description=\"Dipendenti\"\n    threshold=\"0.5\"\n  ></mds-kpi-item>\n  <mds-kpi-item\n    icon=\"mi/baseline/location-city\"\n    label=\"38\"\n    description=\"Sedi operative\"\n    threshold=\"0.5\"\n  ></mds-kpi-item>\n  <mds-kpi-item\n    icon=\"mi/baseline/stars\"\n    label=\"12\"\n    description=\"Anni di attivita\"\n    threshold=\"0.5\"\n  ></mds-kpi-item>\n</mds-kpi>\n```\n\n#### Tuning the Animation Speed Globally\n\nUse `--mds-kpi-text-animation-speed` on the `<mds-kpi>` host to slow down or speed up the scramble effect for all children at once. The default is `0.15`. The placeholder character during the scramble phase is controlled by `--mds-kpi-text-animation-placeholder-char` (default: a space).\n\n```css\n.hero-section mds-kpi {\n  --mds-kpi-text-animation-speed: 0.08;\n  --mds-kpi-text-animation-placeholder-char: '-';\n}\n```\n\n#### Styling Individual Items\n\n`<mds-kpi-item>` has no public CSS custom property: customize a single item through its documented shadow parts, painted with the semantic color roles via `rgb(var(--magma-<role>))` ([`agents/color.md`](../../../../agents/color.md)) so dark mode keeps working.\n\n```css\n.progetto-kpi mds-kpi-item::part(icon) {\n  fill: rgb(var(--magma-accent-emphasis));\n}\n\n.progetto-kpi mds-kpi-item::part(content) {\n  background-color: rgb(var(--magma-surface-overlay));\n}\n```\n\n#### Targeting Shadow Parts\n\nWhen a CSS custom property is not enough, target the documented shadow parts of `<mds-kpi-item>` - `icon`, `icon-container`, and `content` - via `::part()`. Use this only when deeper visual control is required.\n\n```css\nmds-kpi-item::part(icon) {\n  width: 30%;\n}\n\nmds-kpi-item::part(content) {\n  text-align: left;\n}\n```\n",
        "3. Mistakes": "Common incorrect uses of `<mds-kpi>`. 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 Place Raw HTML in the Default Slot\n\nThe default slot of `<mds-kpi>` is meant exclusively for [`mds-kpi-item`](../mds-kpi-item/AGENTS.md) elements. Arbitrary HTML has no styled placement inside the grid and breaks the list semantics the component exposes to assistive technology.\n\n```html\n<!-- INCORRECT -->\n<mds-kpi>\n  <div class=\"metric\">\n    <h2>1.240</h2>\n    <p>Pratiche aperte</p>\n  </div>\n</mds-kpi>\n\n<!-- CORRECT -->\n<mds-kpi>\n  <mds-kpi-item label=\"1.240\" description=\"Pratiche aperte\"></mds-kpi-item>\n</mds-kpi>\n```\n\n#### Do Not Use `mds-kpi-item` Outside `mds-kpi`\n\n`<mds-kpi-item>` is a compound child and relies on the grid context and CSS custom property cascade provided by its parent. Using it as a standalone element loses the responsive layout and the shared animation-speed variables.\n\n```html\n<!-- INCORRECT -->\n<mds-kpi-item label=\"387\" description=\"In lavorazione\"></mds-kpi-item>\n\n<!-- CORRECT -->\n<mds-kpi>\n  <mds-kpi-item label=\"387\" description=\"In lavorazione\"></mds-kpi-item>\n</mds-kpi>\n```\n\n#### Do Not Set `threshold=\"0\"` Explicitly to Disable Animation\n\n`threshold` defaults to `0`, which means static rendering. Writing `threshold=\"0\"` is redundant: it changes nothing. Simply omit the attribute.\n\n```html\n<!-- INCORRECT -->\n<mds-kpi-item label=\"56\" description=\"Scadute\" threshold=\"0\"></mds-kpi-item>\n\n<!-- CORRECT -->\n<mds-kpi-item label=\"56\" description=\"Scadute\"></mds-kpi-item>\n```\n\n#### Do Not Slot `mds-icon` to Display an Icon\n\nThe `icon` prop on `<mds-kpi-item>` renders the glyph in its own styled container above the value. `mds-kpi-item` renders no slot, so an `<mds-icon>` or any other element slotted into it is not displayed.\n\n```html\n<!-- INCORRECT -->\n<mds-kpi>\n  <mds-kpi-item label=\"75\" description=\"Allenatori\">\n    <mds-icon name=\"mi/baseline/directions-walk\"></mds-icon>\n  </mds-kpi-item>\n</mds-kpi>\n\n<!-- CORRECT -->\n<mds-kpi>\n  <mds-kpi-item\n    icon=\"mi/baseline/directions-walk\"\n    label=\"75\"\n    description=\"Allenatori\"\n  ></mds-kpi-item>\n</mds-kpi>\n```\n\n#### Do Not Override the Animation Speed by Targeting Internal Text Components\n\n`<mds-kpi-item>` forwards `--mds-kpi-text-animation-speed` and `--mds-kpi-text-animation-placeholder-char` to its internal `<mds-text>` elements. Setting `--mds-text-animation-speed` from outside has no effect: the item sets it on its inner texts from its own variables. Use the published `--mds-kpi-*` or `--mds-kpi-item-*` variables instead.\n\n```css\n/* INCORRECT */\nmds-kpi-item {\n  --mds-text-animation-speed: 0.05;\n}\n\n/* CORRECT */\nmds-kpi {\n  --mds-kpi-text-animation-speed: 0.05;\n}\n```\n"
      },
      "props": [],
      "methods": [],
      "events": [],
      "listeners": [],
      "styles": [
        {
          "name": "--mds-kpi-text-animation-placeholder-char",
          "annotation": "prop",
          "docs": "Sets the animation placeholder char of the text",
          "visibility": "public"
        },
        {
          "name": "--mds-kpi-text-animation-speed",
          "annotation": "prop",
          "docs": "Sets the animation speed of the text",
          "visibility": "public"
        }
      ],
      "slots": [
        {
          "name": "",
          "docs": "Add `mds-kpi-item` element/s."
        }
      ],
      "parts": [],
      "states": [],
      "dependents": [],
      "dependencies": [],
      "dependencyGraph": {},
      "storybook": "ui-kpi--docs"
    }
  ]
}
