{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "layout",
  "title": "Layout",
  "author": "zyx1121 (https://github.com/zyx1121)",
  "description": "The page layout every zyx.tw page shares: the gutter, the one centered column, the room for the corners and the row-by-row enter fade.",
  "files": [
    {
      "path": "registry/zyx/lib/layout.ts",
      "content": "/**\n * The one column every page's content sits in: 576, 768 and 1024px wide at\n * the base, lg and 2xl breakpoints, with the gutter the corners have (12px,\n * `--gutter`). The nav and the other\n * links sit in the viewport's corners instead (corners.tsx). Width changes\n * between breakpoints ease over 300ms (`transition-column`).\n */\nexport const column =\n  \"mx-auto w-full max-w-xl px-(--gutter) motion-safe:transition-column lg:max-w-3xl 2xl:max-w-5xl\"\n\n/**\n * A page's space for the fixed corners: the title starts 120px down, and the\n * last line ends 100px up, 60px clear of the bottom corners.\n */\nexport const page = \"pt-44 pb-36\"\n\n/**\n * Enter fade (tw-animate-css): opacity 0 to 1 over 300ms ease-out, filled\n * both ways so a delayed row stays hidden until its turn. Under reduced motion\n * none of it applies and every row shows at once.\n */\nexport const enter =\n  \"motion-safe:animate-in motion-safe:fade-in motion-safe:fill-mode-both motion-safe:animation-duration-300 motion-safe:ease-out\"\n\n/**\n * The enter fade for the row at `index` in document order, 25ms apart,\n * counting the top corners as row 0: a page's title is row 1, its subtitle\n * row 2, and each block after them one row further. The delay is the\n * `enter-row-<n>` utility in globals.css, which sets tw-animate-css's own\n * delay variable rather than `delay-*`, so transitions are not delayed.\n */\nexport function enterRow(index: number) {\n  return `${enter} ${rowDelay(index)}`\n}\n\n/** Only the delay of row `index`, for an animation other than the fade. */\nexport function rowDelay(index: number) {\n  return `enter-row-${Math.min(Math.max(Math.round(index), 0), 40)}`\n}\n\n/** The bottom corners come in last, at 375ms. */\nexport const enterFooter = `${enter} enter-row-15`\n",
      "type": "registry:lib"
    }
  ],
  "css": {
    ":root": {
      "--bezel": "0px",
      "--gutter": "0.75rem"
    },
    "@utility enter-row-*": {
      "--tw-animation-delay": "calc(--value(integer) * 25ms)"
    },
    "@utility transition-column": {
      "transition-property": "max-width",
      "transition-duration": "300ms",
      "transition-timing-function": "cubic-bezier(0.4, 0, 0.2, 1)"
    },
    "@utility corner-top": {
      "top": "calc(var(--bezel) + var(--gutter))"
    },
    "@utility corner-bottom": {
      "bottom": "calc(var(--bezel) + var(--gutter))"
    },
    "@utility corner-left": {
      "left": "calc(var(--bezel) + var(--gutter))"
    },
    "@utility corner-right": {
      "right": "calc(var(--bezel) + var(--gutter))"
    }
  },
  "meta": {
    "useWhen": "Laying out a page: column, page and enterRow(n) from lib/layout.",
    "notFor": "Spacing inside a component; use the spacing scale.",
    "related": [
      "corners",
      "page-decode",
      "task"
    ]
  },
  "docs": "Use when: Laying out a page: column, page and enterRow(n) from lib/layout.\nNot for: Spacing inside a component; use the spacing scale.\nGuide: https://ui.zyx.tw/index.md",
  "categories": [
    "layout",
    "motion"
  ],
  "type": "registry:lib"
}