{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "comp-319",
  "type": "registry:component",
  "title": "Comp 319",
  "description": "Comp 319",
  "files": [
    {
      "path": "registry/ui-basic/comp-319.tsx",
      "content": "\"use client\";\n\nimport { useRef, useState } from \"react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogClose,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\n\nexport default function Component() {\n\tconst [hasReadToBottom, setHasReadToBottom] = useState(false);\n\tconst contentRef = useRef<HTMLDivElement>(null);\n\n\tconst handleScroll = () => {\n\t\tconst content = contentRef.current;\n\t\tif (!content) return;\n\n\t\tconst scrollPercentage =\n\t\t\tcontent.scrollTop / (content.scrollHeight - content.clientHeight);\n\t\tif (scrollPercentage >= 0.99 && !hasReadToBottom) {\n\t\t\tsetHasReadToBottom(true);\n\t\t}\n\t};\n\n\treturn (\n\t\t<Dialog>\n\t\t\t<DialogTrigger asChild>\n\t\t\t\t<Button variant=\"outline\">Terms & Conditions</Button>\n\t\t\t</DialogTrigger>\n\t\t\t<DialogContent className=\"flex flex-col gap-0 p-0 sm:max-h-[min(640px,80vh)] sm:max-w-lg [&>button:last-child]:top-3.5\">\n\t\t\t\t<DialogHeader className=\"contents space-y-0 text-left\">\n\t\t\t\t\t<DialogTitle className=\"border-b px-6 py-4 text-base\">\n\t\t\t\t\t\tTerms & Conditions\n\t\t\t\t\t</DialogTitle>\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={contentRef}\n\t\t\t\t\t\tonScroll={handleScroll}\n\t\t\t\t\t\tclassName=\"overflow-y-auto\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<DialogDescription asChild>\n\t\t\t\t\t\t\t<div className=\"px-6 py-4\">\n\t\t\t\t\t\t\t\t<div className=\"[&_strong]:text-foreground space-y-4 [&_strong]:font-semibold\">\n\t\t\t\t\t\t\t\t\t<div className=\"space-y-4\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"space-y-1\">\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<strong>Acceptance of Terms</strong>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tBy accessing and using this website, users\n\t\t\t\t\t\t\t\t\t\t\t\tagree to comply with and be bound by these\n\t\t\t\t\t\t\t\t\t\t\t\tTerms of Service. Users who do not agree\n\t\t\t\t\t\t\t\t\t\t\t\twith these terms should discontinue use of\n\t\t\t\t\t\t\t\t\t\t\t\tthe website immediately.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"space-y-1\">\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t\t\t\t\tUser Account Responsibilities\n\t\t\t\t\t\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tUsers are responsible for maintaining the\n\t\t\t\t\t\t\t\t\t\t\t\tconfidentiality of their account\n\t\t\t\t\t\t\t\t\t\t\t\tcredentials. Any activities occurring under\n\t\t\t\t\t\t\t\t\t\t\t\ta user&lsquo;s account are the sole\n\t\t\t\t\t\t\t\t\t\t\t\tresponsibility of the account holder. Users\n\t\t\t\t\t\t\t\t\t\t\t\tmust notify the website administrators\n\t\t\t\t\t\t\t\t\t\t\t\timmediately of any unauthorized account\n\t\t\t\t\t\t\t\t\t\t\t\taccess.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"space-y-1\">\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t\t\t\t\t\t\tContent Usage and Restrictions\n\t\t\t\t\t\t\t\t\t\t\t\t</strong>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tThe website and its original content are\n\t\t\t\t\t\t\t\t\t\t\t\tprotected by intellectual property laws.\n\t\t\t\t\t\t\t\t\t\t\t\tUsers may not reproduce, distribute, modify,\n\t\t\t\t\t\t\t\t\t\t\t\tcreate derivative works, or commercially\n\t\t\t\t\t\t\t\t\t\t\t\texploit any content without explicit written\n\t\t\t\t\t\t\t\t\t\t\t\tpermission from the website owners.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"space-y-1\">\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<strong>Limitation of Liability</strong>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tThe website provides content &ldquo;as\n\t\t\t\t\t\t\t\t\t\t\t\tis&ldquo; without any warranties. The\n\t\t\t\t\t\t\t\t\t\t\t\twebsite owners shall not be liable for\n\t\t\t\t\t\t\t\t\t\t\t\tdirect, indirect, incidental, consequential,\n\t\t\t\t\t\t\t\t\t\t\t\tor punitive damages arising from user\n\t\t\t\t\t\t\t\t\t\t\t\tinteractions with the platform.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"space-y-1\">\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<strong>User Conduct Guidelines</strong>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<ul className=\"list-disc pl-6\">\n\t\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\tNot upload harmful or malicious content\n\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li>Respect the rights of other users</li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\tAvoid activities that could disrupt\n\t\t\t\t\t\t\t\t\t\t\t\t\twebsite functionality\n\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\tComply with applicable local and\n\t\t\t\t\t\t\t\t\t\t\t\t\tinternational laws\n\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"space-y-1\">\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<strong>Modifications to Terms</strong>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tThe website reserves the right to modify\n\t\t\t\t\t\t\t\t\t\t\t\tthese terms at any time. Continued use of\n\t\t\t\t\t\t\t\t\t\t\t\tthe website after changes constitutes\n\t\t\t\t\t\t\t\t\t\t\t\tacceptance of the new terms.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"space-y-1\">\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<strong>Termination Clause</strong>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tThe website may terminate or suspend user\n\t\t\t\t\t\t\t\t\t\t\t\taccess without prior notice for violations\n\t\t\t\t\t\t\t\t\t\t\t\tof these terms or for any other reason\n\t\t\t\t\t\t\t\t\t\t\t\tdeemed appropriate by the administration.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t\t<div className=\"space-y-1\">\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t<strong>Governing Law</strong>\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tThese terms are governed by the laws of the\n\t\t\t\t\t\t\t\t\t\t\t\tjurisdiction where the website is primarily\n\t\t\t\t\t\t\t\t\t\t\t\toperated, without regard to conflict of law\n\t\t\t\t\t\t\t\t\t\t\t\tprinciples.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</DialogDescription>\n\t\t\t\t\t</div>\n\t\t\t\t</DialogHeader>\n\t\t\t\t<DialogFooter className=\"border-t px-6 py-4 sm:items-center\">\n\t\t\t\t\t{!hasReadToBottom && (\n\t\t\t\t\t\t<span className=\"text-muted-foreground grow text-xs max-sm:text-center\">\n\t\t\t\t\t\t\tRead all terms before accepting.\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t\t<DialogClose asChild>\n\t\t\t\t\t\t<Button type=\"button\" variant=\"outline\">\n\t\t\t\t\t\t\tCancel\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</DialogClose>\n\t\t\t\t\t<DialogClose asChild>\n\t\t\t\t\t\t<Button type=\"button\" disabled={!hasReadToBottom}>\n\t\t\t\t\t\t\tI agree\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</DialogClose>\n\t\t\t\t</DialogFooter>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n}\n",
      "type": "registry:ui"
    },
    {
      "path": "components/ui/button.tsx",
      "content": "import * as React from \"react\";\r\n\r\nimport { cn } from \"@/registry/utilities/cn\";\r\nimport { Slot } from \"@radix-ui/react-slot\";\r\nimport { cva, type VariantProps } from \"class-variance-authority\";\r\n\r\nconst buttonVariants = cva(\r\n\t\"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm text-white hover:text-gray-400 font-medium ring-offset-background transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\r\n\t{\r\n\t\tvariants: {\r\n\t\t\tvariant: {\r\n\t\t\t\tsimple:\r\n\t\t\t\t\t\"bg-secondary relative z-10 bg-transparent hover:border-secondary hover:bg-secondary/50  border border-transparent dark:text-white text-sm md:text-sm transition font-medium duration-200  rounded-md px-4 py-2  flex items-center justify-center\",\r\n\t\t\t\tdefault: \"bg-primary text-primary-foreground hover:bg-primary/90\",\r\n\t\t\t\tdestructive:\r\n\t\t\t\t\t\"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\r\n\t\t\t\toutline:\r\n\t\t\t\t\t\"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\r\n\t\t\t\tsecondary:\r\n\t\t\t\t\t\"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\r\n\t\t\t\tghost: \"hover:bg-accent hover:text-black hover:stroke-black dark:text-white text-black\",\r\n\t\t\t\tlink: \"text-primary underline-offset-4 hover:underline\",\r\n\t\t\t},\r\n\t\t\tsize: {\r\n\t\t\t\tdefault: \"h-10 px-4 py-2\",\r\n\t\t\t\tsm: \"h-9 rounded-md px-3\",\r\n\t\t\t\tlg: \"h-11 rounded-md px-8\",\r\n\t\t\t\ticon: \"h-10 w-10\",\r\n\t\t\t},\r\n\t\t},\r\n\t\tdefaultVariants: {\r\n\t\t\tvariant: \"default\",\r\n\t\t\tsize: \"default\",\r\n\t\t},\r\n\t}\r\n);\r\n\r\nexport interface ButtonProps\r\n\textends React.ButtonHTMLAttributes<HTMLButtonElement>,\r\n\t\tVariantProps<typeof buttonVariants> {\r\n\tasChild?: boolean;\r\n}\r\n\r\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\r\n\t({ className, variant, size, asChild = false, ...props }, ref) => {\r\n\t\tconst Comp = asChild ? Slot : \"button\";\r\n\t\treturn (\r\n\t\t\t<Comp\r\n\t\t\t\tclassName={cn(buttonVariants({ variant, size, className }))}\r\n\t\t\t\tref={ref}\r\n\t\t\t\t{...props}\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n);\r\nButton.displayName = \"Button\";\r\n\r\nexport { Button, buttonVariants };\r\n",
      "type": "registry:ui"
    },
    {
      "path": "registry/utilities/cn.ts",
      "content": "import { ClassValue, clsx } from \"clsx\";\r\nimport { twMerge } from \"tailwind-merge\";\r\n\r\nexport function cn(...inputs: ClassValue[]) {\r\n\treturn twMerge(clsx(inputs));\r\n}\r\n",
      "type": "registry:ui"
    }
  ]
}