{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "banner-07",
  "title": "Banner with action and link",
  "description": "A download button next to a learn more link.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/button.json",
    "https://ui.ndekocode.dev/r/icons.json",
    "https://ui.ndekocode.dev/r/status-orb.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/use-prefers-reduced-motion.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/components/banner/banner-07.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\nimport { useState } from 'react';\n\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { EclipseIcon, XIcon } from '@/registry/ndeko/lib/icons';\nimport { Button } from '@/registry/ndeko/ui/button';\nimport { StatusOrb } from '@/registry/ndeko/ui/status-orb';\n\nconst COLLAPSE_TRANSITION: Transition = { duration: 0.2, ease: [0.2, 0, 0, 1] };\nconst DISMISS_TRANSITION: Transition = {\n  duration: 0.15,\n  ease: [0.2, 0, 0, 1],\n};\n\nconst COLLAPSE_VARIANTS: Variants = {\n  shown: { height: 'auto', opacity: 1 },\n  hidden: { height: 0, opacity: 0, transition: DISMISS_TRANSITION },\n};\n\nconst FADE_VARIANTS: Variants = {\n  shown: { opacity: 1 },\n  hidden: { opacity: 0, transition: DISMISS_TRANSITION },\n};\n\nfunction collapseVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return COLLAPSE_VARIANTS;\n}\n\nexport default function Banner07() {\n  const [isVisible, setIsVisible] = useState(true);\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const collapseVariants = collapseVariantsOf(shouldReduceMotion);\n\n  function dismiss() {\n    setIsVisible(false);\n  }\n\n  return (\n    <AnimatePresence initial={false}>\n      {isVisible && (\n        <motion.div\n          key='banner'\n          className='bg-primary/[0.06] hairline-ring ring-primary/15 dark:bg-primary/10 @container w-full overflow-hidden rounded-xl'\n          variants={collapseVariants}\n          initial='hidden'\n          animate='shown'\n          exit='hidden'\n          transition={COLLAPSE_TRANSITION}\n        >\n          <div className='flex gap-2 px-4 py-3 @xl:items-center @xl:py-2'>\n            <div className='flex grow gap-3 @xl:items-center'>\n              <StatusOrb\n                tone='brand'\n                size='sm'\n                glyph={<EclipseIcon strokeWidth={2.25} />}\n              />\n              <div className='flex grow flex-col justify-between gap-3 @xl:flex-row @xl:items-center'>\n                <p className='py-0.5 text-[13px] leading-5'>\n                  The desktop app is ready. Download it to keep working offline.\n                </p>\n                <div className='flex flex-wrap gap-2'>\n                  <Button size='sm'>Download</Button>\n                  <Button\n                    variant='link'\n                    size='sm'\n                    render={<a href='#' />}\n                    nativeButton={false}\n                  >\n                    Learn more\n                  </Button>\n                </div>\n              </div>\n            </div>\n            <Button\n              variant='ghost'\n              size='icon-sm'\n              className='-my-0.5 -me-2 @xl:my-0'\n              aria-label='Dismiss banner'\n              onClick={dismiss}\n            >\n              <XIcon className='opacity-60' />\n            </Button>\n          </div>\n        </motion.div>\n      )}\n    </AnimatePresence>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "components",
    "banner"
  ],
  "type": "registry:component"
}