{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "banner-05",
  "title": "Dismissible feature banner",
  "description": "A feature banner that folds away when dismissed.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/button.json",
    "https://ui.ndekocode.dev/r/icons.json",
    "https://ui.ndekocode.dev/r/recipes.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",
    "https://ui.ndekocode.dev/r/utils.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/components/banner/banner-05.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 { ArrowRightIcon, EclipseIcon, XIcon } from '@/registry/ndeko/lib/icons';\nimport { FOCUS_RING } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\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 Banner05() {\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'>\n            <div className='flex grow gap-3'>\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-2 py-0.5 @xl:flex-row'>\n                <p className='text-[13px] leading-5'>\n                  Saved views are here: keep your filters and reopen them in one\n                  click.\n                </p>\n                <a\n                  href='#'\n                  className={cn(\n                    'group text-primary-ink inline-flex w-fit items-center gap-1 rounded-sm text-[13px] leading-5 font-medium whitespace-nowrap',\n                    FOCUS_RING\n                  )}\n                >\n                  Learn more\n                  <ArrowRightIcon className='size-4 opacity-60 transition-transform group-hover:translate-x-0.5' />\n                </a>\n              </div>\n            </div>\n            <Button\n              variant='ghost'\n              size='icon-sm'\n              className='-my-0.5 -me-2'\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"
}