{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "redline-tokens-demo",
  "type": "registry:block",
  "title": "Redline: Design System",
  "description": "Spacing Inspector Overlay example, Design System: A settings panel where every spacing label reads as a token through `tokens`, and `selector=\"[data-redline]\"` keeps the pointer on named parts. Pin a row, hold Alt and point at another to see the space between them. A take on the annotation (arrow). Fits features and docs sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "features",
    "docs",
    "annotation",
    "tooltip",
    "inspector",
    "hover",
    "design"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/redline#redline-tokens-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/redline.json"
  ],
  "files": [
    {
      "path": "components/redline-tokens-demo.tsx",
      "type": "registry:component",
      "content": "import { Redline } from \"@/components/ui/redline\";\n\nconst tokens = {\n  4: \"space-1\",\n  8: \"space-2\",\n  12: \"space-3\",\n  16: \"space-4\",\n  24: \"space-6\",\n  32: \"space-8\",\n};\n\nconst rows = [\n  {\n    name: \"Comments\",\n    note: \"Replies and mentions in threads you follow\",\n    on: true,\n    icon: \"M4 5h16v11H8l-4 4V5Z\",\n  },\n  {\n    name: \"Reviews\",\n    note: \"When someone asks you to review a file\",\n    on: true,\n    icon: \"M5 12.5 9.5 17 19 7\",\n  },\n  {\n    name: \"Weekly digest\",\n    note: \"A summary of the week, every Monday\",\n    on: false,\n    icon: \"M4 6h16M4 12h16M4 18h10\",\n  },\n];\n\nexport function RedlineTokensDemo() {\n  return (\n    <div className=\"w-full max-w-md text-zinc-900 dark:text-zinc-50\">\n      <Redline\n        tokens={tokens}\n        selector=\"[data-redline]\"\n        tour={[\"panel\", [\"Comments row\", \"Reviews row\"], \"header\", \"footer\"]}\n        aria-label=\"Notification settings, with spacing tokens\"\n        className=\"rounded-2xl\"\n      >\n        <div\n          data-redline=\"panel\"\n          className=\"flex flex-col gap-6 rounded-2xl bg-white p-6 shadow-sm ring-1 ring-zinc-950/5 dark:bg-zinc-900 dark:ring-white/10\"\n        >\n          <header data-redline=\"header\" className=\"flex flex-col gap-1\">\n            <h3 data-redline=\"heading\" className=\"text-base/6 font-semibold\">\n              Notifications\n            </h3>\n            <p data-redline=\"summary\" className=\"text-sm/5 text-zinc-500 dark:text-zinc-400\">\n              Choose what reaches you, and when.\n            </p>\n          </header>\n\n          <ul data-redline=\"list\" className=\"flex flex-col gap-2\">\n            {rows.map((row) => (\n              <li\n                key={row.name}\n                data-redline={`${row.name} row`}\n                className=\"flex items-center gap-3 rounded-xl bg-zinc-50 p-4 ring-1 ring-zinc-950/5 dark:bg-zinc-950/50 dark:ring-white/5\"\n              >\n                <span\n                  data-redline={`${row.name} icon`}\n                  className=\"grid size-8 shrink-0 place-items-center rounded-lg bg-white ring-1 ring-zinc-950/10 dark:bg-zinc-800 dark:ring-white/10\"\n                >\n                  <svg\n                    viewBox=\"0 0 24 24\"\n                    aria-hidden\n                    className=\"size-4 fill-none stroke-current stroke-2 text-zinc-500 dark:text-zinc-400\"\n                    strokeLinecap=\"round\"\n                    strokeLinejoin=\"round\"\n                  >\n                    <path d={row.icon} />\n                  </svg>\n                </span>\n                <span className=\"min-w-0 flex-1\">\n                  <span className=\"block text-sm/5 font-medium\">{row.name}</span>\n                  <span className=\"block truncate text-xs/4 text-zinc-500 dark:text-zinc-400\">\n                    {row.note}\n                  </span>\n                </span>\n                <span\n                  data-redline={`${row.name} switch`}\n                  role=\"img\"\n                  aria-label={row.on ? \"On\" : \"Off\"}\n                  className={\n                    row.on\n                      ? \"flex h-5 w-9 shrink-0 justify-end rounded-full bg-zinc-900 p-0.5 dark:bg-zinc-50\"\n                      : \"flex h-5 w-9 shrink-0 rounded-full bg-zinc-200 p-0.5 dark:bg-zinc-700\"\n                  }\n                >\n                  <span\n                    className={\n                      row.on\n                        ? \"size-4 rounded-full bg-white shadow-sm dark:bg-zinc-900\"\n                        : \"size-4 rounded-full bg-white shadow-sm dark:bg-zinc-300\"\n                    }\n                  />\n                </span>\n              </li>\n            ))}\n          </ul>\n\n          <footer\n            data-redline=\"footer\"\n            className=\"flex justify-end gap-2 border-t border-zinc-950/5 pt-6 dark:border-white/10\"\n          >\n            <button\n              data-redline=\"cancel\"\n              type=\"button\"\n              className=\"h-9 rounded-lg px-4 text-sm font-medium text-zinc-600 ring-1 ring-zinc-950/10 dark:text-zinc-300 dark:ring-white/15\"\n            >\n              Cancel\n            </button>\n            <button\n              data-redline=\"save\"\n              type=\"button\"\n              className=\"h-9 rounded-lg bg-zinc-900 px-4 text-sm font-medium text-white dark:bg-zinc-50 dark:text-zinc-900\"\n            >\n              Save\n            </button>\n          </footer>\n        </div>\n      </Redline>\n\n      <p className=\"mt-10 text-center text-xs/5 text-pretty text-zinc-500\">\n        Click a row to pin it, then hold{\" \"}\n        <kbd className=\"rounded bg-zinc-100 px-1.5 py-0.5 font-sans text-zinc-600 dark:bg-zinc-800 dark:text-zinc-300\">\n          ⌥ Option\n        </kbd>{\" \"}\n        and point at another. On a phone, tap two rows.\n      </p>\n    </div>\n  );\n}\n"
    }
  ]
}