{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "cta-sticky-dock",
  "type": "registry:component",
  "title": "CTA Sticky Dock",
  "description": "A glass dock bar that springs up and sticks to the bottom of a framed page, shrinks while you scroll down, expands on the way up, and can be dismissed and restored.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "cta",
    "cta",
    "sticky",
    "dock",
    "announcement",
    "dismiss",
    "light"
  ],
  "docs": "https://hyperblur.dev/effects/cta-sticky-dock",
  "files": [
    {
      "path": "registry/hyperblur/cta-sticky-dock.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/cta-sticky-dock.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface CtaStickyDockProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  badge?: string;\n  title?: string;\n  description?: string;\n  primaryCta?: { label: string; href: string };\n  secondaryCta?: { label: string; href: string };\n  address?: string;\n  open?: boolean;\n  defaultOpen?: boolean;\n  onOpenChange?: (open: boolean) => void;\n  accent?: string;\n  children?: React.ReactNode;\n}\n\nconst css = `\n.hb-yi6 {\n  --hb-yi6-accent: #2f7bff;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  background: #ecebe6;\n  color: #16161a;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-yi6 *, .hb-yi6 *::before, .hb-yi6 *::after { box-sizing: border-box; }\n.hb-yi6::before {\n  content: \"\"; position: absolute; inset: 0; pointer-events: none;\n  background: radial-gradient(60% 50% at 50% 100%, color-mix(in srgb, var(--hb-yi6-accent) 18%, transparent), transparent 70%);\n}\n.hb-yi6-inner { position: relative; max-width: 1120px; margin: 0 auto; padding: 48px 16px 64px; }\n.hb-yi6-frame {\n  position: relative; border-radius: 18px; overflow: hidden; background: #fff;\n  border: 1px solid rgba(22, 22, 26, .1); box-shadow: 0 1px 0 #fff inset, 0 50px 90px -40px rgba(22, 22, 26, .35), 0 2px 8px rgba(22, 22, 26, .05);\n}\n.hb-yi6-chrome { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-bottom: 1px solid rgba(22, 22, 26, .08); background: #f8f8f6; }\n.hb-yi6-lights { display: flex; gap: 6px; }\n.hb-yi6-lights i { width: 10px; height: 10px; border-radius: 50%; background: #dcdcd8; }\n.hb-yi6-url {\n  flex: 1; max-width: 360px; margin: 0 auto; height: 26px; border-radius: 8px; background: #efefec; display: flex; align-items: center; justify-content: center; gap: 6px;\n  font-size: 12px; color: #6b6b70; white-space: nowrap; overflow: hidden;\n}\n.hb-yi6-url svg { width: 11px; height: 11px; flex: none; }\n.hb-yi6-scroll { position: relative; height: 500px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d6d6d2 transparent; }\n.hb-yi6-page { max-width: 680px; margin: 0 auto; padding: 44px 22px 40px; }\n.hb-yi6-tag { display: inline-block; margin: 0; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--hb-yi6-accent); background: color-mix(in srgb, var(--hb-yi6-accent) 10%, #fff); }\n.hb-yi6-h1 { margin: 16px 0 0; font-size: clamp(26px, 4.2cqi, 42px); line-height: 1.08; letter-spacing: -.035em; font-weight: 650; }\n.hb-yi6-by { display: flex; align-items: center; gap: 10px; margin: 20px 0 0; font-size: 13px; color: #6b6b70; }\n.hb-yi6-by i { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #f59e0b, #e2553f); flex: none; }\n.hb-yi6-by b { color: #16161a; font-weight: 600; }\n.hb-yi6-art {\n  height: 220px; margin: 28px 0; border-radius: 14px; position: relative; overflow: hidden;\n  background: linear-gradient(135deg, color-mix(in srgb, var(--hb-yi6-accent) 70%, #0b1020), #0b1020 70%);\n}\n.hb-yi6-art::before { content: \"\"; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 28px), repeating-linear-gradient(90deg, rgba(255, 255, 255, .06) 0 1px, transparent 1px 28px); }\n.hb-yi6-art::after { content: \"\"; position: absolute; left: 12%; right: 12%; bottom: 22%; height: 46%; border-radius: 50% 50% 0 0 / 100% 100% 0 0; border: 2px solid rgba(255, 255, 255, .6); border-bottom: 0; }\n.hb-yi6-p { margin: 0 0 16px; font-size: 16px; line-height: 1.75; color: #3c3c42; }\n.hb-yi6-h2 { margin: 30px 0 12px; font-size: 21px; letter-spacing: -.02em; }\n.hb-yi6-spacer { height: 110px; }\n.hb-yi6-dockwrap { position: sticky; bottom: 0; display: flex; justify-content: center; padding: 0 12px 16px; pointer-events: none; }\n.hb-yi6-dock {\n  pointer-events: auto; position: relative; display: flex; align-items: center; gap: 12px; width: 100%; max-width: 660px; padding: 10px 10px 10px 12px;\n  border-radius: 20px; color: #f4f4f5; background: rgba(18, 18, 22, .86); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);\n  border: 1px solid rgba(255, 255, 255, .1);\n  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 24px 50px -18px rgba(10, 10, 20, .6), 0 0 0 1px rgba(0, 0, 0, .25);\n  animation: hb-yi6-rise .8s .2s cubic-bezier(.2, 1.3, .4, 1) both;\n  transition: max-width .45s cubic-bezier(.3, 1.2, .5, 1), padding .45s cubic-bezier(.3, 1.2, .5, 1), border-radius .45s;\n}\n.hb-yi6-dock[data-compact=\"true\"] { max-width: 300px; }\n.hb-yi6-dock[data-leaving=\"true\"] { animation: hb-yi6-leave .35s cubic-bezier(.6, 0, .8, .4) both; }\n.hb-yi6-icon {\n  position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none;\n  background: linear-gradient(140deg, color-mix(in srgb, var(--hb-yi6-accent) 85%, #fff), color-mix(in srgb, var(--hb-yi6-accent) 70%, #000));\n  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 6px 16px -6px var(--hb-yi6-accent);\n}\n.hb-yi6-icon svg { width: 20px; height: 20px; color: #fff; }\n.hb-yi6-icon::after { content: \"\"; position: absolute; inset: -4px; border-radius: 15px; border: 1.5px solid var(--hb-yi6-accent); opacity: 0; animation: hb-yi6-ping 2.4s 1.2s ease-out infinite; }\n.hb-yi6-text { flex: 1; min-width: 0; }\n.hb-yi6-text p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-yi6-t { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }\n.hb-yi6-badge { padding: 2px 7px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: color-mix(in srgb, var(--hb-yi6-accent) 30%, transparent); color: color-mix(in srgb, var(--hb-yi6-accent) 35%, #fff); }\n.hb-yi6-d { margin-top: 2px !important; font-size: 12px; color: #a1a1aa; transition: opacity .3s; }\n.hb-yi6-dock[data-compact=\"true\"] .hb-yi6-d, .hb-yi6-dock[data-compact=\"true\"] .hb-yi6-sec { display: none; }\n.hb-yi6-acts { display: flex; align-items: center; gap: 6px; flex: none; }\n.hb-yi6-btn {\n  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 12px; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;\n  transition: background .2s, transform .2s, color .2s;\n}\n.hb-yi6-pri { position: relative; overflow: hidden; background: #fff; color: #111; }\n.hb-yi6-pri::after { content: \"\"; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(47, 123, 255, .25) 50%, transparent 65%); transform: translateX(-100%); animation: hb-yi6-shine 3.2s 1.4s ease-in-out infinite; }\n.hb-yi6-pri:hover { transform: translateY(-1px); }\n.hb-yi6-sec { color: #e4e4e7; }\n.hb-yi6-sec:hover { background: rgba(255, 255, 255, .08); }\n.hb-yi6-x {\n  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; border: 0; background: transparent; color: #8a8a93; cursor: pointer; transition: background .2s, color .2s;\n}\n.hb-yi6-x:hover { background: rgba(255, 255, 255, .08); color: #fff; }\n.hb-yi6-x svg { width: 14px; height: 14px; }\n.hb-yi6-btn:focus-visible, .hb-yi6-x:focus-visible, .hb-yi6-restore:focus-visible { outline: 2px solid var(--hb-yi6-accent); outline-offset: 2px; }\n.hb-yi6-restore {\n  pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(22, 22, 26, .12);\n  background: #fff; color: #16161a; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; box-shadow: 0 10px 24px -12px rgba(22, 22, 26, .35);\n  animation: hb-yi6-rise .5s cubic-bezier(.2, 1.3, .4, 1) both;\n}\n.hb-yi6-restore i { width: 8px; height: 8px; border-radius: 50%; background: var(--hb-yi6-accent); }\n@keyframes hb-yi6-rise { from { opacity: 0; transform: translateY(60px) scale(.94); } to { opacity: 1; transform: none; } }\n@keyframes hb-yi6-leave { to { opacity: 0; transform: translateY(40px) scale(.96); } }\n@keyframes hb-yi6-ping { 0% { opacity: .7; transform: scale(.9); } 70%, 100% { opacity: 0; transform: scale(1.25); } }\n@keyframes hb-yi6-shine { 0% { transform: translateX(-100%); } 40%, 100% { transform: translateX(100%); } }\n@container (max-width: 520px) {\n  .hb-yi6-d, .hb-yi6-sec { display: none; }\n  .hb-yi6-icon { width: 34px; height: 34px; }\n  .hb-yi6-btn { padding: 0 12px; }\n}\n@container (min-width: 760px) {\n  .hb-yi6-inner { padding: 64px 32px 88px; }\n  .hb-yi6-scroll { height: 560px; }\n  .hb-yi6-page { padding: 56px 32px 40px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-yi6-dock, .hb-yi6-dock[data-leaving=\"true\"], .hb-yi6-icon::after, .hb-yi6-pri::after, .hb-yi6-restore { animation: none; }\n  .hb-yi6-dock, .hb-yi6-btn, .hb-yi6-x { transition: none; }\n}\n`;\n\nfunction DefaultArticle() {\n  return (\n    <>\n      <p className=\"hb-yi6-tag\">Engineering</p>\n      <h1 className=\"hb-yi6-h1\">How we rebuilt sync for crews that work without signal</h1>\n      <p className=\"hb-yi6-by\">\n        <i aria-hidden=\"true\" />\n        <span>\n          <b>Hana Kowalski</b> · Oct 28, 2026 · 7 min read\n        </span>\n      </p>\n      <div className=\"hb-yi6-art\" aria-hidden=\"true\" />\n      <p className=\"hb-yi6-p\">\n        Most of our customers spend their day in basements, wind farms and hospital wards. Signal comes and goes, and the old sync engine treated every drop as an error. Field crews were losing photos, and supervisors were re-entering checklists by hand at the end of a shift.\n      </p>\n      <p className=\"hb-yi6-p\">\n        We started from one rule: the device is the source of truth until the server says otherwise. Every edit is written locally first, stamped with a logical clock and replayed in order once a connection returns.\n      </p>\n      <h2 className=\"hb-yi6-h2\">Conflicts are a product problem</h2>\n      <p className=\"hb-yi6-p\">\n        Two inspectors editing the same checklist is not rare, it is Tuesday. Instead of silently picking a winner, the new engine merges field by field and shows a small diff when two people changed the same answer.\n      </p>\n      <p className=\"hb-yi6-p\">\n        The result after six weeks in beta: sync failures down 92 percent, median upload time from 14 seconds to 1.8, and zero lost photos across 410,000 inspections.\n      </p>\n      <h2 className=\"hb-yi6-h2\">What comes next</h2>\n      <p className=\"hb-yi6-p\">\n        Background uploads on Android, selective sync for very large sites, and an audit trail that shows exactly when each change reached the server.\n      </p>\n      <div className=\"hb-yi6-spacer\" />\n    </>\n  );\n}\n\nexport function CtaStickyDock({\n  badge = \"New\",\n  title = \"Fieldnote 3.0 is live\",\n  description = \"Offline sync, 9x faster uploads and field-level merges.\",\n  primaryCta = { label: \"Try it free\", href: \"#\" },\n  secondaryCta = { label: \"See what changed\", href: \"#\" },\n  address = \"fieldnote.app/blog/offline-sync\",\n  open,\n  defaultOpen = true,\n  onOpenChange,\n  accent = \"#2f7bff\",\n  children,\n  className = \"\",\n  style,\n  ...rest\n}: CtaStickyDockProps) {\n  const [inner, setInner] = React.useState(defaultOpen);\n  const [leaving, setLeaving] = React.useState(false);\n  const [compact, setCompact] = React.useState(false);\n  const lastY = React.useRef(0);\n  const timer = React.useRef<number | undefined>(undefined);\n  const shown = open ?? inner;\n\n  React.useEffect(() => () => window.clearTimeout(timer.current), []);\n\n  const set = (next: boolean) => {\n    if (open === undefined) setInner(next);\n    onOpenChange?.(next);\n  };\n\n  const close = () => {\n    if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) {\n      set(false);\n      return;\n    }\n    setLeaving(true);\n    timer.current = window.setTimeout(() => {\n      setLeaving(false);\n      set(false);\n    }, 330);\n  };\n\n  const onScroll = (e: React.UIEvent<HTMLDivElement>) => {\n    const y = e.currentTarget.scrollTop;\n    const dy = y - lastY.current;\n    if (Math.abs(dy) > 6) {\n      setCompact(dy > 0 && y > 80);\n      lastY.current = y;\n    }\n  };\n\n  const vars = { \"--hb-yi6-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-yi6 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-cta-sticky-dock\" precedence=\"default\">{css}</style>\n      <div className=\"hb-yi6-inner\">\n        <div className=\"hb-yi6-frame\">\n          <div className=\"hb-yi6-chrome\" aria-hidden=\"true\">\n            <span className=\"hb-yi6-lights\">\n              <i />\n              <i />\n              <i />\n            </span>\n            <span className=\"hb-yi6-url\">\n              <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                <rect x=\"5\" y=\"11\" width=\"14\" height=\"10\" rx=\"2\" />\n                <path d=\"M8 11V8a4 4 0 0 1 8 0v3\" />\n              </svg>\n              {address}\n            </span>\n            <span style={{ width: 42 }} />\n          </div>\n          <div className=\"hb-yi6-scroll\" onScroll={onScroll} tabIndex={0} aria-label=\"Page preview\">\n            <article className=\"hb-yi6-page\">{children ?? <DefaultArticle />}</article>\n            <div className=\"hb-yi6-dockwrap\">\n              {shown ? (\n                <div\n                  className=\"hb-yi6-dock\"\n                  role=\"region\"\n                  aria-label={title}\n                  data-compact={compact}\n                  data-leaving={leaving}\n                  onKeyDown={(e) => {\n                    if (e.key === \"Escape\") close();\n                  }}\n                >\n                  <span className=\"hb-yi6-icon\" aria-hidden=\"true\">\n                    <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                      <path d=\"M13 2L4 14h7l-1 8 9-12h-7z\" />\n                    </svg>\n                  </span>\n                  <div className=\"hb-yi6-text\">\n                    <p className=\"hb-yi6-t\">\n                      {badge ? <span className=\"hb-yi6-badge\">{badge}</span> : null}\n                      {title}\n                    </p>\n                    {description ? <p className=\"hb-yi6-d\">{description}</p> : null}\n                  </div>\n                  <div className=\"hb-yi6-acts\">\n                    {secondaryCta ? (\n                      <a className=\"hb-yi6-btn hb-yi6-sec\" href={secondaryCta.href}>\n                        {secondaryCta.label}\n                      </a>\n                    ) : null}\n                    {primaryCta ? (\n                      <a className=\"hb-yi6-btn hb-yi6-pri\" href={primaryCta.href}>\n                        {primaryCta.label}\n                      </a>\n                    ) : null}\n                    <button type=\"button\" className=\"hb-yi6-x\" aria-label=\"Dismiss\" onClick={close}>\n                      <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\">\n                        <path d=\"M6 6l12 12M18 6L6 18\" />\n                      </svg>\n                    </button>\n                  </div>\n                </div>\n              ) : (\n                <button type=\"button\" className=\"hb-yi6-restore\" onClick={() => set(true)}>\n                  <i aria-hidden=\"true\" />\n                  Show the announcement\n                </button>\n              )}\n            </div>\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}