{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "nav-announce-split",
  "type": "registry:component",
  "title": "Nav Announce Split",
  "description": "A light header with a dismissible announcement strip, the logo on the left, centered links with a drawing underline, log in and a call to action on the right, and a hairline that fills as the page scrolls.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "navigation",
    "navbar",
    "announcement",
    "light",
    "underline",
    "scroll progress",
    "navigation"
  ],
  "docs": "https://hyperblur.dev/effects/nav-announce-split",
  "files": [
    {
      "path": "registry/hyperblur/nav-announce-split.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/nav-announce-split.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface NavAnnounceSplitLink {\n  label: string;\n  href: string;\n}\n\nexport interface NavAnnounceSplitAnnouncement {\n  tag?: string;\n  text: string;\n  link?: NavAnnounceSplitLink;\n}\n\nexport interface NavAnnounceSplitProps extends Omit<React.HTMLAttributes<HTMLElement>, \"children\"> {\n  brand?: string;\n  announcement?: NavAnnounceSplitAnnouncement | null;\n  onDismiss?: () => void;\n  links?: NavAnnounceSplitLink[];\n  activeIndex?: number;\n  login?: NavAnnounceSplitLink | null;\n  cta?: NavAnnounceSplitLink | null;\n  progress?: number;\n  trackScroll?: boolean;\n  accent?: string;\n  showBackdrop?: boolean;\n}\n\nconst css = `\n.hb-ke4 {\n  --hb-ke4-accent: #e8590c;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  background: #fbfaf6;\n  color: #17171a;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-ke4 *, .hb-ke4 *::before, .hb-ke4 *::after { box-sizing: border-box; }\n.hb-ke4-strip {\n  position: relative;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 12px;\n  min-height: 40px;\n  padding: 8px 48px;\n  overflow: hidden;\n  background: #17171a;\n  color: #e9e7e1;\n  font-size: 13px;\n  line-height: 1.4;\n  text-align: center;\n}\n.hb-ke4-strip::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--hb-ke4-accent) 28%, transparent) 50%, transparent 70%);\n  transform: translateX(-100%);\n  animation: hb-ke4-sweep 5.5s cubic-bezier(.4,0,.2,1) 1s infinite;\n  pointer-events: none;\n}\n.hb-ke4-tag {\n  position: relative;\n  flex: none;\n  padding: 2px 8px;\n  border-radius: 999px;\n  background: var(--hb-ke4-accent);\n  color: #fff;\n  font-size: 11px;\n  font-weight: 700;\n  letter-spacing: .03em;\n  text-transform: uppercase;\n}\n.hb-ke4-msg { position: relative; }\n.hb-ke4-sl { position: relative; display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; color: #fff; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; transition: text-decoration-color .2s ease; }\n.hb-ke4-sl:hover { text-decoration-color: #fff; }\n.hb-ke4-sl svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s ease; }\n.hb-ke4-sl:hover svg { transform: translateX(2px); }\n.hb-ke4-x {\n  position: absolute;\n  top: 50%;\n  right: 10px;\n  display: grid;\n  place-items: center;\n  width: 28px;\n  height: 28px;\n  margin: 0;\n  padding: 0;\n  border: 0;\n  border-radius: 8px;\n  background: transparent;\n  color: #9a978f;\n  cursor: pointer;\n  transform: translateY(-50%);\n  transition: color .15s ease, background-color .15s ease;\n}\n.hb-ke4-x:hover { color: #fff; background: rgba(255,255,255,.08); }\n.hb-ke4-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }\n.hb-ke4-bar { position: relative; z-index: 3; background: rgba(251,250,246,.9); backdrop-filter: blur(10px); }\n.hb-ke4-row {\n  display: grid;\n  grid-template-columns: 1fr auto 1fr;\n  align-items: center;\n  gap: 24px;\n  max-width: 1120px;\n  height: 68px;\n  margin: 0 auto;\n  padding: 0 24px;\n}\n.hb-ke4-brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; color: #17171a; font-size: 18px; font-weight: 700; letter-spacing: -.03em; text-decoration: none; border-radius: 6px; }\n.hb-ke4-mark { position: relative; width: 26px; height: 26px; border-radius: 7px; background: #17171a; overflow: hidden; }\n.hb-ke4-mark::before, .hb-ke4-mark::after { content: \"\"; position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 2px; }\n.hb-ke4-mark::before { top: 8px; background: #fbfaf6; }\n.hb-ke4-mark::after { top: 15px; right: 11px; background: var(--hb-ke4-accent); }\n.hb-ke4-links { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }\n.hb-ke4-link {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  height: 36px;\n  padding: 0 12px;\n  border-radius: 8px;\n  color: #55534d;\n  font-size: 14.5px;\n  font-weight: 500;\n  text-decoration: none;\n  transition: color .2s ease;\n}\n.hb-ke4-link::after {\n  content: \"\";\n  position: absolute;\n  left: 12px;\n  right: 12px;\n  bottom: 5px;\n  height: 1.5px;\n  border-radius: 2px;\n  background: currentColor;\n  transform: scaleX(0);\n  transform-origin: 100% 50%;\n  transition: transform .38s cubic-bezier(.65,0,.25,1);\n}\n.hb-ke4-link:hover, .hb-ke4-link:focus-visible, .hb-ke4-link[aria-current=\"page\"] { color: #17171a; }\n.hb-ke4-link:hover::after, .hb-ke4-link:focus-visible::after { transform: scaleX(1); transform-origin: 0 50%; }\n.hb-ke4-link[aria-current=\"page\"]::after { transform: scaleX(1); background: var(--hb-ke4-accent); }\n.hb-ke4-end { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }\n.hb-ke4-login { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 999px; color: #17171a; font-size: 14.5px; font-weight: 500; text-decoration: none; transition: background-color .15s ease; }\n.hb-ke4-login:hover { background: rgba(23,23,26,.06); }\n.hb-ke4-cta {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  height: 38px;\n  padding: 0 8px 0 16px;\n  border-radius: 999px;\n  background: #17171a;\n  color: #fbfaf6;\n  font-size: 14.5px;\n  font-weight: 550;\n  text-decoration: none;\n  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 6px 16px -8px rgba(23,23,26,.6);\n  transition: transform .15s ease, box-shadow .2s ease;\n}\n.hb-ke4-cta:hover { box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 10px 22px -8px rgba(23,23,26,.55); }\n.hb-ke4-cta:active { transform: scale(.97); }\n.hb-ke4-ca { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--hb-ke4-accent); overflow: hidden; }\n.hb-ke4-ca svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }\n.hb-ke4-cta:hover .hb-ke4-ca svg { animation: hb-ke4-nudge .5s cubic-bezier(.65,0,.25,1); }\n.hb-ke4-menu {\n  display: none;\n  place-items: center;\n  width: 38px;\n  height: 38px;\n  margin: 0;\n  padding: 0;\n  border: 1px solid rgba(23,23,26,.12);\n  border-radius: 999px;\n  background: #fff;\n  color: #17171a;\n  cursor: pointer;\n}\n.hb-ke4-menu svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }\n.hb-ke4-line { position: relative; height: 1px; background: rgba(23,23,26,.1); }\n.hb-ke4-prog {\n  position: absolute;\n  left: 0;\n  top: -1px;\n  height: 2px;\n  width: 100%;\n  border-radius: 0 2px 2px 0;\n  background: linear-gradient(90deg, color-mix(in srgb, var(--hb-ke4-accent) 30%, transparent), var(--hb-ke4-accent));\n  transform: scaleX(var(--hb-ke4-p, 0));\n  transform-origin: 0 50%;\n  transition: transform .12s linear;\n}\n.hb-ke4-prog::after { content: \"\"; position: absolute; right: -3px; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--hb-ke4-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hb-ke4-accent) 20%, transparent); }\n.hb-ke4-sheet { display: none; }\n.hb-ke4 a:focus-visible, .hb-ke4 button:focus-visible { outline: 2px solid var(--hb-ke4-accent); outline-offset: 2px; }\n.hb-ke4-stage { position: relative; height: 470px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 50%, transparent); mask-image: linear-gradient(#000 50%, transparent); }\n.hb-ke4-art { max-width: 720px; margin: 0 auto; padding: 72px 24px 0; opacity: .6; }\n.hb-ke4-meta { display: flex; gap: 10px; color: #8a877e; font-size: 13px; }\n.hb-ke4-meta b { color: var(--hb-ke4-accent); font-weight: 600; }\n.hb-ke4-h { margin: 14px 0 18px; font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); font-size: clamp(34px, 5.6cqi, 56px); font-weight: 400; letter-spacing: -.02em; line-height: 1.04; }\n.hb-ke4-p { height: 12px; margin-top: 12px; border-radius: 6px; background: rgba(23,23,26,.08); }\n.hb-ke4-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }\n@keyframes hb-ke4-sweep { 0% { transform: translateX(-100%); } 40%, 100% { transform: translateX(100%); } }\n@keyframes hb-ke4-nudge { 0% { transform: translateX(0); } 45% { transform: translateX(16px); } 46% { transform: translateX(-16px); } 100% { transform: translateX(0); } }\n@container (max-width: 820px) {\n  .hb-ke4-row { grid-template-columns: 1fr auto; height: 60px; padding: 0 16px; }\n  .hb-ke4-links, .hb-ke4-login { display: none; }\n  .hb-ke4-menu { display: grid; }\n  .hb-ke4-strip { padding: 8px 40px 8px 14px; justify-content: flex-start; text-align: left; }\n  .hb-ke4-sheet[data-open=\"true\"] { display: block; padding: 8px 16px 16px; border-top: 1px solid rgba(23,23,26,.08); animation: hb-ke4-drop .25s ease both; }\n  .hb-ke4-sheet a { display: flex; align-items: center; height: 44px; padding: 0 4px; border-bottom: 1px solid rgba(23,23,26,.06); color: #17171a; font-size: 15px; text-decoration: none; }\n  .hb-ke4-sheet a[aria-current=\"page\"] { color: var(--hb-ke4-accent); }\n}\n@container (max-width: 420px) {\n  .hb-ke4-cta { padding: 0 6px 0 12px; font-size: 13.5px; }\n}\n@keyframes hb-ke4-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-ke4 *, .hb-ke4 *::before, .hb-ke4 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nconst defaultLinks: NavAnnounceSplitLink[] = [\n  { label: \"Product\", href: \"#\" },\n  { label: \"Customers\", href: \"#\" },\n  { label: \"Pricing\", href: \"#\" },\n  { label: \"Journal\", href: \"#\" },\n  { label: \"Company\", href: \"#\" },\n];\n\nconst defaultAnnouncement: NavAnnounceSplitAnnouncement = {\n  tag: \"New\",\n  text: \"Ledger 2.0 is live: multi-entity books and same-day payouts.\",\n  link: { label: \"Read the launch post\", href: \"#\" },\n};\n\nexport function NavAnnounceSplit({\n  brand = \"Ledger\",\n  announcement = defaultAnnouncement,\n  onDismiss,\n  links = defaultLinks,\n  activeIndex = 3,\n  login = { label: \"Log in\", href: \"#\" },\n  cta = { label: \"Get started\", href: \"#\" },\n  progress,\n  trackScroll = true,\n  accent = \"#e8590c\",\n  showBackdrop = true,\n  className = \"\",\n  style,\n  ...rest\n}: NavAnnounceSplitProps) {\n  const uid = React.useId();\n  const [dismissed, setDismissed] = React.useState(false);\n  const [menuOpen, setMenuOpen] = React.useState(false);\n  const progRef = React.useRef<HTMLSpanElement>(null);\n\n  React.useEffect(() => {\n    if (progress !== undefined || !trackScroll) return;\n    let frame = 0;\n    const update = () => {\n      frame = 0;\n      const max = document.documentElement.scrollHeight - window.innerHeight;\n      const value = max > 0 ? Math.min(1, Math.max(0, window.scrollY / max)) : 0;\n      const node = progRef.current;\n      if (!node) return;\n      node.style.setProperty(\"--hb-ke4-p\", value.toFixed(4));\n      node.setAttribute(\"aria-valuenow\", String(Math.round(value * 100)));\n    };\n    const onScroll = () => {\n      if (!frame) frame = window.requestAnimationFrame(update);\n    };\n    update();\n    window.addEventListener(\"scroll\", onScroll, { passive: true });\n    window.addEventListener(\"resize\", onScroll);\n    return () => {\n      window.cancelAnimationFrame(frame);\n      window.removeEventListener(\"scroll\", onScroll);\n      window.removeEventListener(\"resize\", onScroll);\n    };\n  }, [progress, trackScroll]);\n\n  const arrow = (\n    <svg viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n      <path d=\"M2.5 6h7M6.5 3l3 3-3 3\" />\n    </svg>\n  );\n\n  const value = progress === undefined ? undefined : Math.min(1, Math.max(0, progress)).toFixed(4);\n\n  return (\n    <header className={`hb-ke4 ${className}`} style={{ \"--hb-ke4-accent\": accent, ...style } as React.CSSProperties} {...rest}>\n      <style href=\"hb-nav-announce-split\" precedence=\"default\">\n        {css}\n      </style>\n      {announcement && !dismissed && (\n        <div className=\"hb-ke4-strip\" role=\"region\" aria-label=\"Announcement\">\n          {announcement.tag && <span className=\"hb-ke4-tag\">{announcement.tag}</span>}\n          <span className=\"hb-ke4-msg\">\n            {announcement.text}\n            {announcement.link && (\n              <a href={announcement.link.href} className=\"hb-ke4-sl\">\n                {announcement.link.label}\n                {arrow}\n              </a>\n            )}\n          </span>\n          <button\n            type=\"button\"\n            className=\"hb-ke4-x\"\n            aria-label=\"Dismiss announcement\"\n            onClick={() => {\n              setDismissed(true);\n              onDismiss?.();\n            }}\n          >\n            <svg viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n              <path d=\"M3.5 3.5l7 7M10.5 3.5l-7 7\" />\n            </svg>\n          </button>\n        </div>\n      )}\n      <div className=\"hb-ke4-bar\">\n        <nav className=\"hb-ke4-row\" aria-label=\"Main\">\n          <a href=\"#\" className=\"hb-ke4-brand\" aria-label={`${brand} home`}>\n            <span className=\"hb-ke4-mark\" aria-hidden=\"true\" />\n            {brand}\n          </a>\n          <ul className=\"hb-ke4-links\">\n            {links.map((link, i) => (\n              <li key={link.label}>\n                <a href={link.href} className=\"hb-ke4-link\" aria-current={i === activeIndex ? \"page\" : undefined}>\n                  {link.label}\n                </a>\n              </li>\n            ))}\n          </ul>\n          <div className=\"hb-ke4-end\">\n            {login && (\n              <a href={login.href} className=\"hb-ke4-login\">\n                {login.label}\n              </a>\n            )}\n            {cta && (\n              <a href={cta.href} className=\"hb-ke4-cta\">\n                {cta.label}\n                <span className=\"hb-ke4-ca\">{arrow}</span>\n              </a>\n            )}\n            <button\n              type=\"button\"\n              className=\"hb-ke4-menu\"\n              aria-label={menuOpen ? \"Close menu\" : \"Open menu\"}\n              aria-expanded={menuOpen}\n              aria-controls={`${uid}-sheet`}\n              onClick={() => setMenuOpen((v) => !v)}\n            >\n              <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n                {menuOpen ? <path d=\"M4 4l8 8M12 4l-8 8\" /> : <path d=\"M2.5 5h11M2.5 11h11\" />}\n              </svg>\n            </button>\n          </div>\n        </nav>\n        <div\n          id={`${uid}-sheet`}\n          className=\"hb-ke4-sheet\"\n          data-open={menuOpen ? \"true\" : \"false\"}\n          onKeyDown={(e) => {\n            if (e.key === \"Escape\") setMenuOpen(false);\n          }}\n        >\n          {links.map((link, i) => (\n            <a key={link.label} href={link.href} aria-current={i === activeIndex ? \"page\" : undefined} onClick={() => setMenuOpen(false)}>\n              {link.label}\n            </a>\n          ))}\n          {login && <a href={login.href}>{login.label}</a>}\n        </div>\n        <div className=\"hb-ke4-line\">\n          <span\n            ref={progRef}\n            className=\"hb-ke4-prog\"\n            role=\"progressbar\"\n            aria-label=\"Reading progress\"\n            aria-valuemin={0}\n            aria-valuemax={100}\n            aria-valuenow={value === undefined ? undefined : Math.round(Number(value) * 100)}\n            style={value === undefined ? undefined : ({ \"--hb-ke4-p\": value } as React.CSSProperties)}\n          />\n        </div>\n      </div>\n      {showBackdrop && (\n        <div className=\"hb-ke4-stage\" aria-hidden=\"true\">\n          <div className=\"hb-ke4-art\">\n            <div className=\"hb-ke4-meta\">\n              <b>Engineering</b>\n              <span>8 min read</span>\n              <span>Oct 28, 2026</span>\n            </div>\n            <p className=\"hb-ke4-h\">How we close the books for 3,000 companies in four hours</p>\n            <div className=\"hb-ke4-p\" style={{ width: \"100%\" }} />\n            <div className=\"hb-ke4-p\" style={{ width: \"94%\" }} />\n            <div className=\"hb-ke4-p\" style={{ width: \"97%\" }} />\n            <div className=\"hb-ke4-p\" style={{ width: \"62%\" }} />\n            <div className=\"hb-ke4-p\" style={{ width: \"88%\", marginTop: 28 }} />\n            <div className=\"hb-ke4-p\" style={{ width: \"91%\" }} />\n          </div>\n        </div>\n      )}\n    </header>\n  );\n}\n"
    }
  ]
}