{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tilt-card",
  "type": "registry:item",
  "title": "Tilt Card",
  "description": "A card that tilts toward the pointer in 3D (up to `max` degrees) and springs back flat, with an optional `glare`. Flat on touch screens and under reduced motion.",
  "dependencies": [
    "@zubra/runtime@^5.13.1"
  ],
  "categories": [
    "motion"
  ],
  "registryDependencies": [
    "https://zubra-js.github.io/zubra-ui/r/theme.json"
  ],
  "files": [
    {
      "path": "components/tilt-card.js",
      "type": "registry:file",
      "target": "~/src/components/zubra/tilt-card.js",
      "content": "// Generated by zubra from tilt-card.zb. Do not edit.\nimport { $define, $r, $t } from \"@zubra/runtime\";\nimport { state as __zubraState, computed as __zubraComputed } from \"@zubra/runtime\";\n\nexport const tag = \"tilt-card\";\n\nexport default $define(tag, {\n  props: {\n    \"max\": { attribute: \"max\", default: 8, required: false },\n    \"glare\": { attribute: \"glare\", default: true, required: false },\n  },\n  abi: 3,\n  shadow: false,\n  form: false,\n  slots: [\"default\"],\n  events: [],\n  styled: true,\n  styles: \"@layer theme, base, components, utilities;\\n@layer components {\\n@scope (tilt-card) to ([data-zb-slotted=\\\"tilt-card\\\"]) {\\n  :scope { display: block; perspective: 60rem; }\\n  .tilt { position: relative; height: 100%; box-sizing: border-box; padding: 1.25rem; border: 1px solid var(--border, #e4e4e7); border-radius: var(--radius, 0.625rem); background: var(--card, #fff); color: var(--card-foreground, #18181b); transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); transform-style: preserve-3d; transition: transform var(--duration-slower, 700ms) var(--ease-spring, ease-out), box-shadow var(--duration-slow, 400ms) var(--ease-out, ease-out); overflow: hidden; }\\n  .tilt-active { transition: transform var(--duration-fast, 150ms) var(--ease-out, ease-out), box-shadow var(--duration-slow, 400ms) var(--ease-out, ease-out); box-shadow: 0 18px 40px #0000001f; }\\n  .tilt-glare { position: absolute; inset: 0; background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), #ffffff40, transparent 55%); opacity: 0; transition: opacity var(--duration-slow, 400ms) var(--ease-out, ease-out); pointer-events: none; mix-blend-mode: soft-light; }\\n  .tilt-active .tilt-glare { opacity: 1; }\\n  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; } }\\n}\\n}\\n\",\n  template: \"\\n  <div class=\\\"tilt\\\">\\n    <!--[--><!--]-->\\n    <!--[--><!--]-->\\n  </div>\\n\",\n  setup($p, $emit) {\nfunction __zubraAssign(signal, value) { signal.set(value); return value }\nfunction __zubraUpdate(signal, delta, prefix) { const old = signal.get(); signal.set(old + delta); return prefix ? old + delta : old }\n  const card = __zubraState(null)\n  const tilting = __zubraState(false)\n  function tilt(event) {\n    if (event.pointerType === \"touch\" || globalThis.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) return\n    const box = card.get().getBoundingClientRect()\n    const x = (event.clientX - box.left) / box.width - 0.5\n    const y = (event.clientY - box.top) / box.height - 0.5\n    card.get().style.setProperty(\"--tilt-x\", `${(-y * 2 * $p.max).toFixed(2)}deg`)\n    card.get().style.setProperty(\"--tilt-y\", `${(x * 2 * $p.max).toFixed(2)}deg`)\n    card.get().style.setProperty(\"--glare-x\", `${((x + 0.5) * 100).toFixed(1)}%`)\n    card.get().style.setProperty(\"--glare-y\", `${((y + 0.5) * 100).toFixed(1)}%`)\n    __zubraAssign(tilting, true)\n  }\n  function rest() {\n    __zubraAssign(tilting, false)\n    card.get().style.setProperty(\"--tilt-x\", \"0deg\")\n    card.get().style.setProperty(\"--tilt-y\", \"0deg\")\n  }\n    return [\n      { path: [0], ref: () => (($el) => (__zubraAssign(card, $el))) },\n      { path: [0], toggle: \"tilt-active\", value: () => $r(tilting) },\n      { path: [0], on: \"pointermove\", handler: () => $r(tilt) },\n      { path: [0], on: \"pointerleave\", handler: () => $r(rest) },\n      { path: [0, 0], slot: \"default\", fallback: null },\n      { path: [0, 1], when: () => $p.glare, blocks: [{ template: \"<div class=\\\"tilt-glare\\\" aria-hidden=\\\"true\\\"></div>\", parts: () => [] }, null] },\n    ];\n  },\n});\n"
    }
  ]
}
