{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "banner",
  "title": "Banner",
  "description": "Full-width announcement bar for the top of a page or region, with title, description, actions and close.",
  "dependencies": [
    "class-variance-authority@^0.7.1",
    "lucide-react@^1.27.0"
  ],
  "registryDependencies": [
    "@pestoui/style",
    "@pestoui/utils"
  ],
  "files": [
    {
      "path": "pestoui/ui/banner.tsx",
      "content": "import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* Page-level announcement bar. Wider and quieter than Alert: Alert is an inline\n   block inside content, Banner spans the full width of the region it heads.\n   The semantic tints are the exact Alert set so the two never disagree.\n\n   The arrival is the same idea as Alert's, one notch heavier: a banner heads a\n   region, so it counts as chrome and takes the wider blur. Panel spring, and it\n   materialises from the edge it is attached to rather than from below. */\nconst bannerVariants = cva(\n  \"group/banner relative flex w-full items-center gap-3 text-left text-body animate-in fade-in-0 blur-in-6 anim-spring-panel ease-spring-panel has-data-[slot=banner-close]:pe-12\",\n  {\n    variants: {\n      variant: {\n        default:\n          \"border-border/70 bg-card text-card-foreground *:data-[slot=banner-icon]:text-muted-foreground\",\n        info: \"border-info/20 bg-info/8 text-foreground *:data-[slot=banner-icon]:text-info\",\n        success:\n          \"border-success/20 bg-success/8 text-foreground *:data-[slot=banner-icon]:text-success\",\n        warning:\n          \"border-warning/30 bg-warning/12 text-foreground *:data-[slot=banner-icon]:text-warning\",\n        destructive:\n          \"border-destructive/20 bg-destructive/8 text-foreground *:data-[slot=banner-icon]:text-destructive\",\n      },\n      /* Edge-to-edge is a rule, not a card: square corners, one hairline underneath.\n         Floating lifts the same bar into an inset card on the third elevation tier.\n         The entrance follows the same split — the rule drops in from the edge it\n         is pinned to, the card rises the way every other loose surface does. */\n      floating: {\n        false:\n          \"rounded-none border-x-0 border-t-0 border-b px-4 py-3 slide-in-from-top-2 sm:px-6\",\n        true: \"rounded-xl border px-4 py-3.5 shadow-card slide-in-from-bottom-2 sm:px-5\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      floating: false,\n    },\n  }\n)\n\nfunction Banner({\n  className,\n  variant = \"default\",\n  floating = false,\n  icon,\n  children,\n  ...props\n}: React.ComponentProps<\"div\"> &\n  VariantProps<typeof bannerVariants> & {\n    icon?: React.ReactNode\n  }) {\n  /* Errors interrupt, everything else waits for a pause. Declared before the\n     spread so a consumer can still override the role. */\n  const role = variant === \"destructive\" ? \"alert\" : \"status\"\n\n  return (\n    <div\n      data-slot=\"banner\"\n      data-variant={variant}\n      data-floating={floating ? \"true\" : \"false\"}\n      role={role}\n      className={cn(bannerVariants({ variant, floating }), className)}\n      {...props}\n    >\n      {icon ? (\n        <span\n          data-slot=\"banner-icon\"\n          aria-hidden=\"true\"\n          className=\"flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4.5\"\n        >\n          {icon}\n        </span>\n      ) : null}\n      <div\n        data-slot=\"banner-content\"\n        className=\"flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1\"\n      >\n        {children}\n      </div>\n    </div>\n  )\n}\n\nfunction BannerTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"banner-title\"\n      className={cn(\n        \"font-semibold tracking-snug [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction BannerDescription({\n  className,\n  ...props\n}: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"banner-description\"\n      className={cn(\n        \"min-w-0 text-body leading-normal text-muted-foreground [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\nfunction BannerActions({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"banner-actions\"\n      className={cn(\"ms-auto flex shrink-0 items-center gap-2\", className)}\n      {...props}\n    />\n  )\n}\n\n/* Icon button — squircle, never a circle. 32px box keeps the 2px-per-4px\n   series the Button icon sizes run on (36 -> 11, 40 -> 13, 44 -> 15). */\nfunction BannerClose({\n  className,\n  children,\n  \"aria-label\": ariaLabel = \"Dismiss\",\n  ...props\n}: React.ComponentProps<\"button\">) {\n  return (\n    <button\n      type=\"button\"\n      data-slot=\"banner-close\"\n      aria-label={ariaLabel}\n      className={cn(\n        \"absolute end-3 top-1/2 inline-flex size-8 -translate-y-1/2 shrink-0 items-center justify-center rounded-[9px] text-muted-foreground transition-all duration-fast ease-out-expo outline-none select-none hover:bg-foreground/[0.06] hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 active:scale-90 active:duration-spring-press active:ease-spring-press disabled:pointer-events-none disabled:opacity-50 dark:hover:bg-foreground/10 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    >\n      {children ?? <X aria-hidden=\"true\" />}\n    </button>\n  )\n}\n\nexport {\n  Banner,\n  BannerTitle,\n  BannerDescription,\n  BannerActions,\n  BannerClose,\n  bannerVariants,\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}