{
  "$schema": "https://shadcn-vue.com/schema/registry-item.json",
  "name": "exit-intent-newsletter",
  "title": "Exit Intent — Newsletter",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-vue/blocks/exit-intent-newsletter/ExitIntentNewsletter.vue",
      "content": "<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, ref } from 'vue'\nimport { Check, Mail } from 'lucide-vue-next'\nimport { Badge } from '@/components/ui/badge'\nimport { Button } from '@/components/ui/button'\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '@/components/ui/dialog'\nimport { Input } from '@/components/ui/input'\nimport { Separator } from '@/components/ui/separator'\n\nconst props = withDefaults(defineProps<{ storageKey?: string }>(), {\n  storageKey: 'uipkge:exit-newsletter-seen',\n})\n\nconst open = ref(false)\nconst email = ref('')\nconst submitted = ref(false)\n\nfunction onPointerOut(event: MouseEvent) {\n  // Top edge only: leaving sideways is usually the scrollbar or another window.\n  if (event.relatedTarget || event.clientY > 4) return\n  try {\n    if (window.sessionStorage.getItem(props.storageKey) === '1') return\n    window.sessionStorage.setItem(props.storageKey, '1')\n  } catch {\n    // Blocked storage: shows once more this page view, never in a loop.\n  }\n  open.value = true\n  document.removeEventListener('mouseout', onPointerOut)\n}\n\nfunction subscribe() {\n  if (!email.value.trim()) return\n  submitted.value = true\n}\n\nonMounted(() => document.addEventListener('mouseout', onPointerOut))\nonBeforeUnmount(() => document.removeEventListener('mouseout', onPointerOut))\n</script>\n\n<template>\n  <div data-slot=\"exit-intent-newsletter\">\n    <Dialog v-model:open=\"open\">\n      <DialogContent class=\"sm:max-w-md\">\n        <DialogHeader>\n          <Badge variant=\"secondary\" class=\"w-fit gap-1.5\">\n            <Mail class=\"size-3\" aria-hidden=\"true\" />\n            Monthly notes\n          </Badge>\n          <DialogTitle class=\"mt-3 text-xl leading-snug text-balance\">\n            Not ready to trial? Take the writing instead\n          </DialogTitle>\n          <DialogDescription class=\"leading-relaxed\">\n            Last issue: “Why we version metric definitions instead of dashboards.” One email a month, no product\n            announcements, unsubscribe in one click.\n          </DialogDescription>\n        </DialogHeader>\n\n        <Separator />\n\n        <form @submit.prevent=\"subscribe\">\n          <div class=\"flex gap-2\">\n            <Input\n              v-model=\"email\"\n              type=\"email\"\n              required\n              placeholder=\"you@company.com\"\n              autocomplete=\"email\"\n              aria-label=\"Email address\"\n            />\n            <Button type=\"submit\" class=\"shrink-0\">Subscribe</Button>\n          </div>\n          <p class=\"mt-2 min-h-5 text-xs\" aria-live=\"polite\">\n            <span v-if=\"submitted\" class=\"text-success inline-flex items-center gap-1.5\">\n              <Check class=\"size-3\" aria-hidden=\"true\" />\n              Check your inbox to confirm.\n            </span>\n            <span v-else class=\"text-muted-foreground\">8,400 subscribers, mostly data and finance engineers.</span>\n          </p>\n        </form>\n      </DialogContent>\n    </Dialog>\n  </div>\n</template>\n",
      "type": "registry:block",
      "target": "~/app/components/blocks/ExitIntentNewsletter.vue"
    }
  ],
  "dependencies": [
    "lucide-vue-next"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/vue/badge.json",
    "https://uipkge.dev/r/vue/button.json",
    "https://uipkge.dev/r/vue/dialog.json",
    "https://uipkge.dev/r/vue/input.json",
    "https://uipkge.dev/r/vue/separator.json"
  ],
  "description": "Exit-intent dialog capturing an email for the monthly notes rather than pushing a discount, with the last issue named so the ask is concrete.",
  "categories": [
    "marketing"
  ],
  "deprecated": true,
  "replacedBy": "exit-intent"
}