{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "status",
  "type": "registry:ui",
  "title": "Status",
  "description": "A small status component with customizable variants, indicator and shiny animation effects.",
  "author": "Ahdeetai <https://aditya.is-cool.dev>",
  "registryDependencies": ["badge"],
  "dependencies": ["class-variance-authority", "clsx", "tailwind-merge"],
  "css": {
    "@layer utilities": {
      ".animate-shine": {
        "animation": "shine 5s linear infinite"
      }
    },
    "@keyframes shine": {
      "0%": {
        "background-position": "100%"
      },
      "100%": {
        "background-position": "-100%"
      }
    }
  },
  "files": [
    {
      "type": "registry:ui",
      "path": "components/ui/status.tsx",
      "content": "import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { Badge } from '@/components/ui/badge';\nimport { cn } from '@/lib/utils';\n\nconst statusVariants = cva('border-transparent hover:opacity-100', {\n  variants: {\n    status: {\n      online: 'bg-green-500 text-white',\n      offline: 'bg-gray-500 text-white',\n      away: 'bg-yellow-500 text-white',\n      busy: 'bg-red-500 text-white',\n      idle: 'bg-blue-500 text-white',\n      pending: 'bg-orange-500 text-white',\n      success: 'bg-green-600 text-white',\n      error: 'bg-red-600 text-white',\n      warning: 'bg-amber-500 text-white',\n      info: 'bg-blue-600 text-white',\n    },\n  },\n  defaultVariants: {\n    status: 'offline',\n  },\n});\n\nexport interface StatusProps\n  extends\n    Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>,\n    VariantProps<typeof statusVariants> {\n  status?:\n    | 'online'\n    | 'offline'\n    | 'away'\n    | 'busy'\n    | 'idle'\n    | 'pending'\n    | 'success'\n    | 'error'\n    | 'warning'\n    | 'info';\n  statusindicator?: boolean;\n  indicatorClassName?: string;\n  shiny?: boolean;\n  shinySpeed?: number;\n  children?: React.ReactNode;\n}\n\nconst Status = React.forwardRef<HTMLDivElement, StatusProps>(\n  (\n    {\n      className,\n      status = 'offline',\n      statusindicator = false,\n      indicatorClassName,\n      shiny = false,\n      shinySpeed,\n      children,\n      ...props\n    },\n    ref,\n  ) => {\n    return (\n      <div ref={ref}>\n        <Badge\n          variant='outline'\n          className={cn(statusVariants({ status }), className)}\n          shiny={shiny}\n          shinySpeed={shinySpeed}\n          {...props}\n        >\n          <span className='inline-flex items-center gap-2'>\n            {statusindicator && (\n              <span\n                className={cn(\n                  'shrink-0 rounded-full bg-white',\n                  indicatorClassName,\n                )}\n                style={{\n                  width: indicatorClassName?.includes('w-')\n                    ? undefined\n                    : '0.375rem',\n                  height: indicatorClassName?.includes('h-')\n                    ? undefined\n                    : '0.375rem',\n                }}\n              />\n            )}\n            {children}\n          </span>\n        </Badge>\n      </div>\n    );\n  },\n);\n\nStatus.displayName = 'Status';\n\nexport { Status, statusVariants };\n"
    },
    {
      "type": "registry:ui",
      "path": "components/ui/badge.tsx",
      "content": "import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '@/lib/utils';\n\nconst badgeVariants = cva(\n  'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2',\n  {\n    variants: {\n      variant: {\n        default:\n          'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',\n        secondary:\n          'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',\n        destructive:\n          'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',\n        outline: 'text-foreground',\n      },\n      shiny: {\n        true: 'relative overflow-hidden',\n        false: '',\n      },\n    },\n    defaultVariants: {\n      variant: 'default',\n      shiny: false,\n    },\n  },\n);\n\nexport interface BadgeProps\n  extends\n    React.HTMLAttributes<HTMLDivElement>,\n    VariantProps<typeof badgeVariants> {\n  shiny?: boolean;\n  shinySpeed?: number;\n}\n\nfunction Badge({\n  className,\n  variant,\n  shiny = false,\n  shinySpeed = 5,\n  children,\n  ...props\n}: BadgeProps) {\n  const animationDuration = `${shinySpeed}s`;\n\n  return (\n    <div\n      className={cn(badgeVariants({ variant, shiny }), className)}\n      {...props}\n    >\n      <span className={shiny ? 'relative z-10' : ''}>{children}</span>\n\n      {shiny && (\n        <span\n          className='absolute inset-0 pointer-events-none animate-shine dark:hidden'\n          style={{\n            background:\n              'linear-gradient(120deg, transparent 40%, rgba(255,255,255,0.6) 50%, transparent 60%)',\n            backgroundSize: '200% 100%',\n            animationDuration,\n            mixBlendMode: 'screen',\n          }}\n        />\n      )}\n\n      {shiny && (\n        <span\n          className='absolute inset-0 pointer-events-none animate-shine hidden dark:block'\n          style={{\n            background:\n              'linear-gradient(120deg, transparent 40%, rgba(0,0,150,0.25) 50%, transparent 60%)',\n            backgroundSize: '200% 100%',\n            animationDuration,\n            mixBlendMode: 'multiply',\n          }}\n        />\n      )}\n    </div>\n  );\n}\n\nexport { Badge, badgeVariants };\n"
    },
    {
      "type": "registry:lib",
      "path": "lib/utils.ts",
      "content": "import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}"
    }
  ]
}
