This commit is contained in:
Ubuntu
2026-07-03 16:58:28 +08:00
commit 32b43f85bd
6240 changed files with 1987678 additions and 0 deletions
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "accordion-style-default",
"type": "registry:block",
"title": "accordion-style-default",
"registryDependencies": [
"https://retroui.dev/r/accordion.json"
],
"files": [
{
"path": "preview/components/accordion-style-default.tsx",
"content": "\"use client\";\n\nimport { Accordion } from \"@/components/retroui/Accordion\";\n\nexport default function AccordionStyleDefault() {\n return (\n <Accordion type=\"single\" collapsible className=\"space-y-4 w-full\">\n <Accordion.Item value=\"item-1\">\n <Accordion.Header>Accordion Item 1</Accordion.Header>\n <Accordion.Content>\n This is the content of the first accordion item.\n </Accordion.Content>\n </Accordion.Item>\n <Accordion.Item value=\"item-2\">\n <Accordion.Header>Accordion Item 2</Accordion.Header>\n <Accordion.Content>\n This is the content of the second accordion item.\n </Accordion.Content>\n </Accordion.Item>\n <Accordion.Item value=\"item-3\">\n <Accordion.Header>Accordion Item 3</Accordion.Header>\n <Accordion.Content>\n This is the content of the third accordion item.\n </Accordion.Content>\n </Accordion.Item>\n </Accordion>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/accordion-style-default.tsx"
}
]
}
+19
View File
@@ -0,0 +1,19 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "accordion",
"type": "registry:component",
"title": "Accordion",
"description": "This collapsible component let's your users read only the content they care about. 😌",
"dependencies": [
"@radix-ui/react-accordion",
"lucide-react"
],
"files": [
{
"path": "components/retroui/Accordion.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as AccordionPrimitive from \"@radix-ui/react-accordion\";\nimport { ChevronDown } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst Accordion = AccordionPrimitive.Root;\n\nconst AccordionItem = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <AccordionPrimitive.Item\n ref={ref}\n className={cn(\n \"border-2 bg-background rounded text-foreground shadow-md hover:shadow-sm data-[state=open]:shadow-sm transition-all overflow-hidden\",\n className,\n )}\n {...props}\n />\n));\nAccordionItem.displayName = AccordionPrimitive.Item.displayName;\n\nconst AccordionHeader = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Header className=\"flex\">\n <AccordionPrimitive.Trigger\n ref={ref}\n className={cn(\n \"flex flex-1 items-start justify-between px-4 py-2 font-head cursor-pointer focus:outline-hidden [&[data-state=open]>svg]:rotate-180\",\n className,\n )}\n {...props}\n >\n {children}\n <ChevronDown className=\"h-4 w-4 shrink-0 transition-transform duration-200\" />\n </AccordionPrimitive.Trigger>\n </AccordionPrimitive.Header>\n));\nAccordionHeader.displayName = AccordionPrimitive.Header.displayName;\n\nconst AccordionContent = React.forwardRef<\n React.ElementRef<typeof AccordionPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <AccordionPrimitive.Content\n ref={ref}\n className=\"overflow-hidden font-body bg-white text-gray-700 data-[state=open]:animate-accordion-down data-[state=closed]:animate-accordion-up\"\n {...props}\n >\n <div className={cn(\"px-4 pt-2 pb-4\", className)}>{children}</div>\n </AccordionPrimitive.Content>\n));\n\nAccordionContent.displayName = AccordionPrimitive.Content.displayName;\n\nconst AccordionComponent = Object.assign(Accordion, {\n Item: AccordionItem,\n Header: AccordionHeader,\n Content: AccordionContent,\n});\n\nexport { AccordionComponent as Accordion };\n",
"type": "registry:component",
"target": "components/retroui/Accordion.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "alert-style-all-status",
"type": "registry:block",
"title": "alert-style-all-status",
"registryDependencies": [
"https://retroui.dev/r/alert.json"
],
"files": [
{
"path": "preview/components/alert-style-all-status.tsx",
"content": "import { Alert } from \"@/components/retroui/Alert\";\nimport { CheckCircle, InfoIcon, XIcon } from \"lucide-react\";\n\nexport default function AlertAllStatus() {\n return (\n <div className=\"space-y-4\">\n <Alert status=\"success\" className=\"flex items-center\">\n <CheckCircle className=\"h-4 w-4 mr-4\" />\n <Alert.Title>This is a success alert!</Alert.Title>\n </Alert>\n <Alert status=\"info\" className=\"flex items-center\">\n <InfoIcon className=\"h-4 w-4 mr-4\" />\n <Alert.Title>This is an info alert!</Alert.Title>\n </Alert>\n <Alert status=\"error\" className=\"flex items-center\">\n <XIcon className=\"h-4 w-4 mr-4\" />\n <Alert.Title>This is an error alert!</Alert.Title>\n </Alert>\n <Alert status=\"warning\" className=\"flex items-center\">\n <InfoIcon className=\"h-4 w-4 mr-4\" />\n <Alert.Title>This is an error alert!</Alert.Title>\n </Alert>\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/alert-style-all-status.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "alert-style-default",
"type": "registry:block",
"title": "alert-style-default",
"registryDependencies": [
"https://retroui.dev/r/alert.json"
],
"files": [
{
"path": "preview/components/alert-style-default.tsx",
"content": "import { Alert } from \"@/components/retroui/Alert\";\n\nexport default function AlertStyleDefault() {\n return (\n <Alert>\n <Alert.Title>Heads up!</Alert.Title>\n <Alert.Description>\n This is where you can write description that no one reads...\n </Alert.Description>\n </Alert>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/alert-style-default.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "alert-style-solid",
"type": "registry:block",
"title": "alert-style-solid",
"registryDependencies": [
"https://retroui.dev/r/alert.json"
],
"files": [
{
"path": "preview/components/alert-style-solid.tsx",
"content": "import { Alert } from \"@/components/retroui/Alert\";\n\nexport default function AlertStyleDefault() {\n return (\n <Alert variant=\"solid\">\n <Alert.Title>Heads up!</Alert.Title>\n <Alert.Description>\n This is where you can write description that no one reads...\n </Alert.Description>\n </Alert>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/alert-style-solid.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "alert-style-with-icon",
"type": "registry:block",
"title": "alert-style-with-icon",
"registryDependencies": [
"https://retroui.dev/r/alert.json"
],
"files": [
{
"path": "preview/components/alert-style-with-icon.tsx",
"content": "import { Alert } from \"@/components/retroui/Alert\";\nimport { CheckCircle } from \"lucide-react\";\n\nexport default function AlertStyleDefaultIcon() {\n return (\n <Alert className=\"flex\">\n <CheckCircle className=\"h-5 w-5 mr-4 mt-2\" />\n <div>\n <Alert.Title>Heads up!</Alert.Title>\n <Alert.Description>\n This is where you can write description that no one reads...\n </Alert.Description>\n </div>\n </Alert>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/alert-style-with-icon.tsx"
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "alert",
"type": "registry:component",
"title": "Alert",
"description": "Notify your users about important events and updates. 📣",
"dependencies": [
"class-variance-authority"
],
"files": [
{
"path": "components/retroui/Alert.tsx",
"content": "import { HtmlHTMLAttributes } from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Text } from \"@/components/retroui/Text\";\n\nconst alertVariants = cva(\"relative w-full rounded border-2 p-4\", {\n variants: {\n variant: {\n default: \"bg-background text-foreground [&_svg]:shrink-0\",\n solid: \"bg-black text-white\",\n },\n status: {\n error: \"bg-red-300 text-red-800 border-red-800\",\n success: \"bg-green-300 text-green-800 border-green-800\",\n warning: \"bg-yellow-300 text-yellow-800 border-yellow-800\",\n info: \"bg-blue-300 text-blue-800 border-blue-800\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n});\n\ninterface IAlertProps\n extends HtmlHTMLAttributes<HTMLDivElement>,\n VariantProps<typeof alertVariants> {}\n\nconst Alert = ({ className, variant, status, ...props }: IAlertProps) => (\n <div\n role=\"alert\"\n className={cn(alertVariants({ variant, status }), className)}\n {...props}\n />\n);\nAlert.displayName = \"Alert\";\n\ninterface IAlertTitleProps extends HtmlHTMLAttributes<HTMLHeadingElement> {}\nconst AlertTitle = ({ className, ...props }: IAlertTitleProps) => (\n <Text as=\"h5\" className={cn(className)} {...props} />\n);\nAlertTitle.displayName = \"AlertTitle\";\n\ninterface IAlertDescriptionProps\n extends HtmlHTMLAttributes<HTMLParagraphElement> {}\nconst AlertDescription = ({ className, ...props }: IAlertDescriptionProps) => (\n <div className={cn(\"text-muted-foreground\", className)} {...props} />\n);\n\nAlertDescription.displayName = \"AlertDescription\";\n\nconst AlertComponent = Object.assign(Alert, {\n Title: AlertTitle,\n Description: AlertDescription,\n});\n\nexport { AlertComponent as Alert };\n",
"type": "registry:component",
"target": "components/retroui/Alert.tsx"
}
]
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "avatar-style-circle-sizes",
"type": "registry:block",
"title": "avatar-style-circle-sizes",
"registryDependencies": [
"https://retroui.dev/r/avatar.json"
],
"files": [
{
"path": "preview/components/avatar-style-circle-sizes.tsx",
"content": "import { Avatar } from \"@/components/retroui/Avatar\";\n\nexport default function AvatarStyleCircleSizes() {\n return (\n <div className=\"flex items-center space-x-4\">\n <Avatar>\n <Avatar.Image src=\"/images/avatar.jpeg\" alt=\"Arif Logs\" />\n <Avatar.Fallback>AH</Avatar.Fallback>\n </Avatar>\n <Avatar className=\"h-16 w-16\">\n <Avatar.Image src=\"/images/avatar.jpeg\" alt=\"Arif Logs\" />\n <Avatar.Fallback>AH</Avatar.Fallback>\n </Avatar>\n <Avatar className=\"h-20 w-20\">\n <Avatar.Image src=\"/images/avatar.jpeg\" alt=\"Arif Logs\" />\n <Avatar.Fallback>AH</Avatar.Fallback>\n </Avatar>\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/avatar-style-circle-sizes.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "avatar-style-circle",
"type": "registry:block",
"title": "avatar-style-circle",
"registryDependencies": [
"https://retroui.dev/r/avatar.json"
],
"files": [
{
"path": "preview/components/avatar-style-circle.tsx",
"content": "import { Avatar } from \"@/components/retroui/Avatar\";\n\nexport default function AvatarStyleCircle() {\n return (\n <Avatar>\n <Avatar.Image src=\"/images/avatar.jpeg\" alt=\"Arif Logs\" />\n <Avatar.Fallback>AH</Avatar.Fallback>\n </Avatar>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/avatar-style-circle.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "avatar-style-fallbacks",
"type": "registry:block",
"title": "avatar-style-fallbacks",
"registryDependencies": [
"https://retroui.dev/r/avatar.json"
],
"files": [
{
"path": "preview/components/avatar-style-circle-fallbacks.tsx",
"content": "import { Avatar } from \"@/components/retroui/Avatar\";\n\nexport default function AvatarStyleFallback() {\n return (\n <Avatar>\n <Avatar.Image src=\"broken-link\" alt=\"Arif Logs\" />\n <Avatar.Fallback>AH</Avatar.Fallback>\n </Avatar>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/avatar-style-circle-fallbacks.tsx"
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "avatar",
"type": "registry:component",
"title": "Avatar",
"description": "Default rounded avatar that can show your users profile picture. ✨",
"dependencies": [
"@radix-ui/react-avatar"
],
"files": [
{
"path": "components/retroui/Avatar.tsx",
"content": "import * as React from \"react\";\nimport * as AvatarPrimitive from \"@radix-ui/react-avatar\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst Avatar = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex h-14 w-14 border-2 rounded-full overflow-hidden\",\n className,\n )}\n {...props}\n />\n));\nAvatar.displayName = \"Avatar\";\n\nconst AvatarImage = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Image>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Image\n ref={ref}\n className={cn(\"aspect-square h-full w-full\", className)}\n {...props}\n />\n));\nAvatarImage.displayName = \"Avatar.Image\";\n\nconst AvatarFallback = React.forwardRef<\n React.ElementRef<typeof AvatarPrimitive.Fallback>,\n React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>\n>(({ className, ...props }, ref) => (\n <AvatarPrimitive.Fallback\n ref={ref}\n className={cn(\n \"flex h-full w-full items-center justify-center rounded-full bg-muted bg-primary\",\n className,\n )}\n {...props}\n />\n));\nAvatarFallback.displayName = \"Avatar.Fallback\";\n\nconst AvatarComponent = Object.assign(Avatar, {\n Image: AvatarImage,\n Fallback: AvatarFallback,\n});\n\nexport { AvatarComponent as Avatar };\n",
"type": "registry:component",
"target": "components/retroui/Avatar.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "badge-style-default",
"type": "registry:block",
"title": "badge-style-default",
"registryDependencies": [
"https://retroui.dev/r/badge.json"
],
"files": [
{
"path": "preview/components/badge-style-rounded.tsx",
"content": "import { Badge } from \"@/components/retroui/Badge\";\n\nexport default function BadgeStyleRounded() {\n return (\n <div className=\"space-x-4\">\n <Badge variant=\"solid\" className=\"rounded-sm\">\n Rounded\n </Badge>\n <Badge variant=\"solid\" className=\"rounded-full\">\n Full\n </Badge>\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/badge-style-rounded.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "badge-style-sizes",
"type": "registry:block",
"title": "badge-style-sizes",
"registryDependencies": [
"https://retroui.dev/r/badge.json"
],
"files": [
{
"path": "preview/components/badge-style-sizes.tsx",
"content": "import { Badge } from \"@/components/retroui/Badge\";\n\nexport default function BadgeStyleVariants() {\n return (\n <div className=\"space-x-4\">\n <Badge size=\"sm\">small</Badge>\n <Badge>medium</Badge>\n <Badge size=\"lg\">large</Badge>\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/badge-style-sizes.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "badge-style-variants",
"type": "registry:block",
"title": "badge-style-variants",
"registryDependencies": [
"https://retroui.dev/r/badge.json"
],
"files": [
{
"path": "preview/components/badge-style-variants.tsx",
"content": "import { Badge } from \"@/components/retroui/Badge\";\n\nexport default function BadgeStyleVariants() {\n return (\n <div className=\"flex flex-wrap gap-4\">\n <Badge>Default</Badge>\n <Badge variant=\"outline\">Outlined</Badge>\n <Badge variant=\"solid\">Solid</Badge>\n <Badge variant=\"surface\">Surface</Badge>\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/badge-style-variants.tsx"
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "badge",
"type": "registry:component",
"title": "Badge",
"description": "The component that looks like a button but isn't clickable!",
"dependencies": [
"class-variance-authority"
],
"files": [
{
"path": "components/retroui/Badge.tsx",
"content": "import { cn } from \"@/lib/utils\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport React, { HTMLAttributes } from \"react\";\n\nconst badgeVariants = cva(\"font-semibold rounded\", {\n variants: {\n variant: {\n default: \"bg-muted text-muted-foreground\",\n outline: \"outline-2 outline-foreground text-foreground\",\n solid: \"bg-foreground text-background\",\n surface: \"outline-2 bg-primary text-primary-foreground\",\n },\n size: {\n sm: \"px-2 py-1 text-xs\",\n md: \"px-2.5 py-1.5 text-sm\",\n lg: \"px-3 py-2 text-base\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n});\n\ninterface ButtonProps\n extends HTMLAttributes<HTMLSpanElement>,\n VariantProps<typeof badgeVariants> {}\n\nexport function Badge({\n children,\n size = \"md\",\n variant = \"default\",\n className = \"\",\n ...props\n}: ButtonProps) {\n return (\n <span\n className={cn(badgeVariants({ variant, size }), className)}\n {...props}\n >\n {children}\n </span>\n );\n}\n",
"type": "registry:component",
"target": "components/retroui/Badge.tsx"
}
]
}
File diff suppressed because one or more lines are too long
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "breadcrumb",
"type": "registry:component",
"title": "Breadcrumb",
"dependencies": [
"@radix-ui/react-slot"
],
"files": [
{
"path": "components/retroui/Breadcrumb.tsx",
"content": "import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\n\nconst BreadcrumbRoot = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\">\n>(({ className, ...props }, ref) => (\n <nav\n ref={ref}\n aria-label=\"breadcrumb\"\n className={cn(\"w-full text-sm\", className)}\n {...props}\n />\n))\nBreadcrumbRoot.displayName = \"Breadcrumb\"\n\nconst BreadcrumbList = React.forwardRef<\n HTMLOListElement,\n React.ComponentPropsWithoutRef<\"ol\">\n>(({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 sm:gap-2.5 text-muted-foreground\",\n className\n )}\n {...props}\n />\n))\nBreadcrumbList.displayName = \"BreadcrumbList\"\n\nconst BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<\"li\">\n>(({ className, ...props }, ref) => (\n <li ref={ref} className={cn(\"inline-flex items-center\", className)} {...props} />\n))\nBreadcrumbItem.displayName = \"BreadcrumbItem\"\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & { asChild?: boolean }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = asChild ? Slot : \"a\"\n return (\n <Comp\n ref={ref}\n className={cn(\n \"font-medium transition-colors hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring rounded-sm\",\n className\n )}\n {...props}\n />\n )\n})\nBreadcrumbLink.displayName = \"BreadcrumbLink\"\n\nconst BreadcrumbPage = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n aria-current=\"page\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n))\nBreadcrumbPage.displayName = \"BreadcrumbPage\"\n\nconst BreadcrumbSeparator = ({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) => (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"text-muted-foreground [&>svg]:h-4 [&>svg]:w-4\", className)}\n {...props}\n >\n {children ?? <ChevronRight />}\n </li>\n)\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\"\n\nconst BreadcrumbEllipsis = ({\n className,\n ...props\n}: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n)\nBreadcrumbEllipsis.displayName = \"BreadcrumbEllipsis\"\n\nconst Breadcrumb = Object.assign(BreadcrumbRoot, {\n List: BreadcrumbList,\n Item: BreadcrumbItem,\n Link: BreadcrumbLink,\n Page: BreadcrumbPage,\n Separator: BreadcrumbSeparator,\n Ellipsis: BreadcrumbEllipsis,\n})\n\nexport { Breadcrumb }\n\n\n",
"type": "registry:component",
"target": "components/retroui/Breadcrumb.tsx"
}
]
}
@@ -0,0 +1,27 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "button-style-default",
"type": "registry:block",
"title": "button-style-default",
"registryDependencies": [
"https://retroui.dev/r/button.json"
],
"files": [
{
"path": "preview/components/button-style-default.tsx",
"content": "import { Button } from \"@/components/retroui/Button\";\n\nexport default function ButtonStyleDefault() {\n return <Button>Click Me!</Button>;\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/button-style-default.tsx"
}
],
"cssVars": {
"light": {
"primary": "60 100% 60%",
"primary-foreground": "0 0% 0%"
},
"dark": {
"primary": "60 100% 50%",
"primary-foreground": "0 0% 0%"
}
}
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "button-style-link",
"type": "registry:block",
"title": "button-style-link",
"registryDependencies": [
"https://retroui.dev/r/button.json"
],
"files": [
{
"path": "preview/components/button-style-link.tsx",
"content": "import { Button } from \"@/components/retroui/Button\";\n\nexport default function ButtonStyleLink() {\n return <Button variant=\"link\">Click Me!</Button>;\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/button-style-link.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "button-style-outline",
"type": "registry:block",
"title": "button-style-outline",
"registryDependencies": [
"https://retroui.dev/r/button.json"
],
"files": [
{
"path": "preview/components/button-style-outline.tsx",
"content": "import { Button } from \"@/components/retroui/Button\";\n\nexport default function ButtonStyleOutline() {\n return <Button variant=\"outline\">Click Me!</Button>;\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/button-style-outline.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "button-style-secondary",
"type": "registry:block",
"title": "button-style-secondary",
"registryDependencies": [
"https://retroui.dev/r/button.json"
],
"files": [
{
"path": "preview/components/button-style-secondary.tsx",
"content": "import { Button } from \"@/components/retroui/Button\";\n\nexport default function ButtonStyleSecondary() {\n return <Button variant=\"secondary\">Click Me!</Button>;\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/button-style-secondary.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "button-style-with-icon",
"type": "registry:block",
"title": "button-style-with-icon",
"registryDependencies": [
"https://retroui.dev/r/button.json"
],
"files": [
{
"path": "preview/components/button-style-with-icon.tsx",
"content": "import { Button } from \"@/components/retroui/Button\";\nimport { Trash } from \"lucide-react\";\n\nexport default function ButtonStyleWithIcon() {\n return (\n <Button className=\"bg-destructive text-white hover:bg-destructive/90\">\n <Trash className=\"h-4 w-4 mr-2\" /> Delete\n </Button>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/button-style-with-icon.tsx"
}
]
}
+19
View File
@@ -0,0 +1,19 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "button",
"type": "registry:component",
"title": "Retro Button",
"description": "This bold button makes sure your users click on it and perform the actions you want!",
"dependencies": [
"class-variance-authority",
"@radix-ui/react-slot"
],
"files": [
{
"path": "components/retroui/Button.tsx",
"content": "import { cn } from \"@/lib/utils\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport React, { ButtonHTMLAttributes } from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nexport const buttonVariants = cva(\n \"font-head transition-all rounded outline-hidden cursor-pointer duration-200 font-medium flex items-center\",\n {\n variants: {\n variant: {\n default:\n \"shadow-md hover:shadow active:shadow-none bg-primary text-primary-foreground border-2 border-black transition hover:translate-y-1 active:translate-y-2 active:translate-x-1 hover:bg-primary-hover\",\n secondary:\n \"shadow-md hover:shadow active:shadow-none bg-secondary shadow-primary text-secondary-foreground border-2 border-black transition hover:translate-y-1 active:translate-y-2 active:translate-x-1 hover:bg-secondary-hover\",\n outline:\n \"shadow-md hover:shadow active:shadow-none bg-transparent border-2 transition hover:translate-y-1 active:translate-y-2 active:translate-x-1\",\n link: \"bg-transparent hover:underline\",\n ghost: \"bg-transparent hover:bg-accent\"\n },\n size: {\n sm: \"px-3 py-1 text-sm shadow hover:shadow-none\",\n md: \"px-4 py-1.5 text-base\",\n lg: \"px-6 lg:px-8 py-2 lg:py-3 text-md lg:text-lg\",\n icon: \"p-2\",\n },\n },\n defaultVariants: {\n size: \"md\",\n variant: \"default\",\n },\n },\n);\n\nexport interface IButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, IButtonProps>(\n (\n {\n children,\n size = \"md\",\n className = \"\",\n variant = \"default\",\n asChild = false,\n ...props\n }: IButtonProps,\n forwardedRef,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n ref={forwardedRef}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {children}\n </Comp>\n );\n },\n);\n\nButton.displayName = \"Button\";",
"type": "registry:component",
"target": "components/retroui/Button.tsx"
}
]
}
File diff suppressed because one or more lines are too long
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "card-style-commerce",
"type": "registry:block",
"title": "card-style-commerce",
"registryDependencies": [
"https://retroui.dev/r/card.json"
],
"files": [
{
"path": "preview/components/card-style-commerce.tsx",
"content": "import { Button } from \"@/components/retroui/Button\";\nimport { Card } from \"@/components/retroui/Card\";\n\nexport default function CommerceCard() {\n return (\n <Card className=\"w-[350px] shadow-none hover:shadow-none\">\n <Card.Content className=\"pb-0\">\n <img\n src=\"/images/gameboy.jpg\"\n className=\"w-full h-full\"\n alt=\"Gameboy\"\n />\n </Card.Content>\n <Card.Header className=\"pb-0\">\n <Card.Title>Classic 8-bit Gameboy</Card.Title>\n </Card.Header>\n <Card.Content className=\"flex justify-between items-center\">\n <p className=\"text-lg font-semibold\">$29.90</p>\n <Button>Add to cart</Button>\n </Card.Content>\n </Card>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/card-style-commerce.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "card-style-default",
"type": "registry:block",
"title": "card-style-default",
"registryDependencies": [
"https://retroui.dev/r/card.json"
],
"files": [
{
"path": "preview/components/card-style-default.tsx",
"content": "import { Card } from \"@/components/retroui/Card\";\n\nexport default function BasicCard() {\n return (\n <Card>\n <Card.Header>\n <Card.Title>This is Card Title</Card.Title>\n <Card.Description>\n I can not find what to write here.. so imagine I wrote some good\n stuff.\n </Card.Description>\n </Card.Header>\n </Card>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/card-style-default.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "card-style-testimonial",
"type": "registry:block",
"title": "card-style-testimonial",
"registryDependencies": [
"https://retroui.dev/r/card.json"
],
"files": [
{
"path": "preview/components/card-style-testimonial.tsx",
"content": "import { Text } from \"@/components/retroui/Text\";\nimport { Card } from \"@/components/retroui/Card\";\nimport { Avatar } from \"@/components/retroui/Avatar\";\n\nexport default function TestimonialCard() {\n return (\n <Card className=\"w-full max-w-[400px] shadow-none hover:shadow-md\">\n <Card.Content>\n <Text className=\"text-lg\">\n &quot; RetroUI is the cooling looking UI library out there! &quot;\n </Text>\n\n <div className=\"flex items-center space-x-2 mt-6\">\n <Avatar className=\"h-10 w-10\">\n <Avatar.Image\n alt=\"avatar\"\n src=\"https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=880&q=80\"\n />\n </Avatar>\n <div>\n <div className=\"font-medium\">Leroy Jenkins</div>\n <div className=\"text-sm text-gray-500 dark:text-gray-400\">\n CEO of Uber\n </div>\n </div>\n </div>\n </Card.Content>\n </Card>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/card-style-testimonial.tsx"
}
]
}
+21
View File
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "card",
"type": "registry:component",
"title": "Card",
"description": "A customizable card component to visualize your content. 📝",
"files": [
{
"path": "components/retroui/Card.tsx",
"content": "import { cn } from \"@/lib/utils\";\nimport { HTMLAttributes } from \"react\";\nimport { Text } from \"@/components/retroui/Text\";\n\ninterface ICardProps extends HTMLAttributes<HTMLDivElement> {\n className?: string;\n}\n\nconst Card = ({ className, ...props }: ICardProps) => {\n return (\n <div\n className={cn(\n \"inline-block border-2 rounded shadow-md transition-all hover:shadow-none bg-card\",\n className,\n )}\n {...props}\n />\n );\n};\n\nconst CardHeader = ({ className, ...props }: ICardProps) => {\n return (\n <div\n className={cn(\"flex flex-col justify-start p-4\", className)}\n {...props}\n />\n );\n};\n\nconst CardTitle = ({ className, ...props }: ICardProps) => {\n return <Text as=\"h3\" className={cn(\"mb-2\", className)} {...props} />;\n};\n\nconst CardDescription = ({ className, ...props }: ICardProps) => (\n <p className={cn(\"text-muted-foreground\", className)} {...props} />\n);\n\nconst CardContent = ({ className, ...props }: ICardProps) => {\n return <div className={cn(\"p-4\", className)} {...props} />;\n};\n\nconst CardComponent = Object.assign(Card, {\n Header: CardHeader,\n Title: CardTitle,\n Description: CardDescription,\n Content: CardContent,\n});\n\nexport { CardComponent as Card };\n",
"type": "registry:component",
"target": "components/retroui/Card.tsx"
},
{
"path": "components/retroui/Text.tsx",
"content": "import { ElementType, HTMLAttributes } from \"react\";\nimport { VariantProps, cva } from \"class-variance-authority\";\nimport { cn } from \"@/lib/utils\";\n\nconst textVariants = cva(\"font-head\", {\n variants: {\n as: {\n p: \"font-sans text-base\",\n li: \"font-sans text-base\",\n a: \"font-sans text-base hover:underline underline-offset-2 decoration-primary\",\n h1: \"text-4xl lg:text-5xl font-bold\",\n h2: \"text-3xl lg:text-4xl font-semibold\",\n h3: \"text-2xl font-medium\",\n h4: \"text-xl font-normal\",\n h5: \"text-lg font-normal\",\n h6: \"text-base font-normal\",\n },\n },\n defaultVariants: {\n as: \"p\",\n },\n});\n\ninterface TextProps\n extends Omit<HTMLAttributes<HTMLElement>, \"className\">,\n VariantProps<typeof textVariants> {\n className?: string;\n}\n\nexport const Text = (props: TextProps) => {\n const { className, as, ...otherProps } = props;\n const Tag: ElementType = as || \"p\";\n\n return (\n <Tag className={cn(textVariants({ as }), className)} {...otherProps} />\n );\n};\n",
"type": "registry:component",
"target": "components/retroui/Text.tsx"
}
]
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "checkbox-style-default",
"type": "registry:block",
"title": "checkbox-style-default",
"registryDependencies": [
"https://retroui.dev/r/checkbox.json"
],
"files": [
{
"path": "preview/components/checkbox-style-sizes.tsx",
"content": "import { Checkbox } from \"@/components/retroui/Checkbox\";\n\nexport default function CheckboxStyleSizes() {\n return (\n <div className=\"flex gap-4\">\n <Checkbox size=\"sm\" />\n <Checkbox />\n <Checkbox size=\"lg\" />\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/checkbox-style-sizes.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "checkbox-style-toggle",
"type": "registry:block",
"title": "checkbox-style-toggle",
"registryDependencies": [
"https://retroui.dev/r/checkbox.json"
],
"files": [
{
"path": "preview/components/checkbox-style-variants.tsx",
"content": "import { Checkbox } from \"@/components/retroui/Checkbox\";\n\nexport default function CheckboxStyleVariants() {\n return (\n <div className=\"flex gap-4\">\n <Checkbox />\n <Checkbox variant=\"outline\" />\n <Checkbox variant=\"solid\" />\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/checkbox-style-variants.tsx"
}
]
}
+20
View File
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "checkbox",
"type": "registry:component",
"title": "Checkbox",
"description": "Let users confirm or reject an option.",
"dependencies": [
"@radix-ui/react-checkbox",
"class-variance-authority",
"lucide-react"
],
"files": [
{
"path": "components/retroui/Checkbox.tsx",
"content": "import { cn } from \"@/lib/utils\";\nimport * as CheckboxPrimitive from \"@radix-ui/react-checkbox\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport { Check } from \"lucide-react\";\n\nconst checkboxVariants = cva(\"border-2 rounded\", {\n variants: {\n variant: {\n default: \"data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground \",\n outline: \"\",\n solid:\n \"data-[state=checked]:bg-foreground data-[state=checked]:text-background\",\n },\n size: {\n sm: \"h-4 w-4\",\n md: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n});\n\ninterface CheckboxProps\n extends React.ComponentProps<typeof CheckboxPrimitive.Root>,\n VariantProps<typeof checkboxVariants> {}\n\nexport const Checkbox = ({\n className,\n size,\n variant,\n ...props\n}: CheckboxProps) => (\n <CheckboxPrimitive.Root\n className={cn(\n checkboxVariants({\n size,\n variant,\n }),\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"h-full w-full\">\n <Check className=\"h-full w-full\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n);\n",
"type": "registry:component",
"target": "components/retroui/Checkbox.tsx"
}
]
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "dialog-style-default",
"type": "registry:block",
"title": "dialog-style-default",
"registryDependencies": [
"https://retroui.dev/r/dialog.json"
],
"files": [
{
"path": "preview/components/dialog-style-default.tsx",
"content": "import { Button } from \"@/components/retroui/Button\";\nimport { Dialog } from \"@/components/retroui/Dialog\";\nimport { Text } from \"@/components/retroui/Text\";\n\nexport default function DialogStyleDefault() {\n return (\n <Dialog>\n <Dialog.Trigger asChild>\n <Button>Open Dialog</Button>\n </Dialog.Trigger>\n <Dialog.Content>\n <Dialog.Header>\n <Text as=\"h5\">Confirm your action?</Text>\n </Dialog.Header>\n <section className=\"flex flex-col gap-4 p-4\">\n <section className=\"text-xl\">\n <p>Are you sure you want to delete this item?</p>\n <p>This action cannout be undone.</p>\n </section>\n <section className=\"flex w-full justify-end\">\n <Dialog.Trigger asChild>\n <Button>Confirm</Button>\n </Dialog.Trigger>\n </section>\n </section>\n </Dialog.Content>\n </Dialog>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/dialog-style-default.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "dialog-style-width-variant",
"type": "registry:block",
"title": "dialog-style-width-variant",
"registryDependencies": [
"https://retroui.dev/r/dialog.json"
],
"files": [
{
"path": "preview/components/dialog-style-width-variant.tsx",
"content": "import { Button } from \"@/components/retroui/Button\";\nimport { Dialog } from \"@/components/retroui/Dialog\";\nimport { Text } from \"@/components/retroui/Text\";\nimport { useState } from \"react\";\n\ntype Variants =\n | \"auto\"\n | \"sm\"\n | \"md\"\n | \"lg\"\n | \"xl\"\n | \"2xl\"\n | \"3xl\"\n | \"4xl\"\n | \"screen\";\n\nexport default function DialogStyleWidthVariant() {\n const [variant, setVariant] = useState<Variants>(\"auto\");\n\n const sizes: Variants[] = [\n \"auto\",\n \"sm\",\n \"md\",\n \"lg\",\n \"xl\",\n \"2xl\",\n \"3xl\",\n \"4xl\",\n \"screen\",\n ];\n\n return (\n <Dialog>\n <Dialog.Trigger asChild>\n <Button>Open Dialog</Button>\n </Dialog.Trigger>\n <Dialog.Content size={variant}>\n <Dialog.Header>\n <Text as=\"h5\">Dialog with variants</Text>\n </Dialog.Header>\n <section className=\"flex flex-col gap-4 p-4\">\n <section className=\"text-xl\">\n <p>Choose your width size</p>\n <section className=\"flex flex-wrap gap-4\">\n {sizes.map((singleVariant) => (\n <Button\n key={\"variant-list-\" + singleVariant}\n type=\"button\"\n variant={singleVariant == variant ? \"default\" : \"outline\"}\n onClick={() => setVariant(singleVariant)}\n >\n {singleVariant}\n </Button>\n ))}\n </section>\n </section>\n </section>\n </Dialog.Content>\n </Dialog>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/dialog-style-width-variant.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "dialog-style-with-footer",
"type": "registry:block",
"title": "dialog-style-with-footer",
"registryDependencies": [
"https://retroui.dev/r/dialog.json"
],
"files": [
{
"path": "preview/components/dialog-style-with-footer.tsx",
"content": "import { Button } from \"@/components/retroui/Button\";\nimport { Text } from \"@/components/retroui/Text\";\nimport { Dialog } from \"@/components/retroui/Dialog\";\n\nexport default function DialogStyleWithFooter() {\n return (\n <Dialog>\n <Dialog.Trigger asChild>\n <Button>Open Dialog</Button>\n </Dialog.Trigger>\n <Dialog.Content>\n <Dialog.Header position={\"fixed\"} asChild>\n <Text as=\"h5\">Confirm your action?</Text>\n </Dialog.Header>\n <section className=\"flex flex-col gap-4 p-4\">\n <section className=\"text-xl\">\n <p>Are you sure you want to delete this item?</p>\n <p>This action cannout be undone.</p>\n </section>\n </section>\n <Dialog.Footer>\n <Dialog.Trigger asChild>\n <Button>Confirm</Button>\n </Dialog.Trigger>\n <Dialog.Trigger asChild>\n <Button variant={\"outline\"}>Close</Button>\n </Dialog.Trigger>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/dialog-style-with-footer.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "dialog-style-with-form",
"type": "registry:block",
"title": "dialog-style-with-form",
"registryDependencies": [
"https://retroui.dev/r/dialog.json"
],
"files": [
{
"path": "preview/components/dialog-style-with-form.tsx",
"content": "import { Button } from \"@/components/retroui/Button\";\nimport { Dialog } from \"@/components/retroui/Dialog\";\nimport { Input } from \"@/components/retroui/Input\";\nimport { Text } from \"@/components/retroui/Text\";\n\nexport default function DialogStyleWithForm() {\n return (\n <Dialog>\n <Dialog.Trigger asChild>\n <Button>Open Form</Button>\n </Dialog.Trigger>\n <Dialog.Content size={\"md\"}>\n <Dialog.Header position={\"fixed\"}>\n <Text as=\"h5\">Contact Us</Text>\n </Dialog.Header>\n <form className=\"flex flex-col gap-4\">\n <div className=\"flex flex-col p-4 gap-4\">\n <div className=\"flex-col gap-2\">\n <label htmlFor=\"name\">\n Your name <span className=\"text-red-500\">*</span>\n </label>\n <Input placeholder=\"Type your name\" required />\n </div>\n <div className=\"flex-col gap-2\">\n <label htmlFor=\"name\">\n Your e-email <span className=\"text-red-500\">*</span>\n </label>\n <Input placeholder=\"Type your name\" required />\n </div>\n </div>\n <Dialog.Footer>\n <Dialog.Trigger asChild>\n <Button type=\"submit\">Submit</Button>\n </Dialog.Trigger>\n </Dialog.Footer>\n </form>\n </Dialog.Content>\n </Dialog>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/dialog-style-with-form.tsx"
}
]
}
File diff suppressed because one or more lines are too long
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "drawer",
"type": "registry:component",
"title": "Drawer",
"description": "A component that can slide in from any side of the screen.",
"dependencies": [
"vaul"
],
"files": [
{
"path": "components/retroui/Drawer.tsx",
"content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"vaul\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Drawer({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />\n}\n\nfunction DrawerTrigger({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content bg-background fixed z-50 flex h-auto flex-col\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b data-[vaul-drawer-direction=top]:border-b-2\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t data-[vaul-drawer-direction=bottom]:border-t-2\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l-2 data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r-2 data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n <div className=\"bg-foreground mx-auto mt-4 hidden h-1 w-[60px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"text-foreground text-xl font-head font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nconst DrawerComponent = Object.assign(Drawer, {\n Trigger: DrawerTrigger,\n Portal: DrawerPortal,\n Overlay: DrawerOverlay,\n Close: DrawerClose,\n Content: DrawerContent,\n Header: DrawerHeader,\n Footer: DrawerFooter,\n Title: DrawerTitle,\n Description: DrawerDescription,\n});\n\nexport { DrawerComponent as Drawer };",
"type": "registry:component",
"target": "components/retroui/Drawer.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "input-style-default",
"type": "registry:block",
"title": "input-style-default",
"registryDependencies": [
"https://retroui.dev/r/input.json"
],
"files": [
{
"path": "preview/components/input-style-default.tsx",
"content": "import { Input } from \"@/components/retroui/Input\";\n\nexport default function InputStyleDefault() {\n return <Input type=\"text\" placeholder=\"type something...\" />;\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/input-style-default.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "input-style-error",
"type": "registry:block",
"title": "input-style-error",
"registryDependencies": [
"https://retroui.dev/r/input.json"
],
"files": [
{
"path": "preview/components/input-style-error.tsx",
"content": "import { Input } from \"@/components/retroui/Input\";\nimport { Label } from \"@/components/retroui/Label\";\n\nexport default function InputStyleError() {\n return (\n <div className=\"grid w-full max-w-sm items-center gap-1.5\">\n <Label htmlFor=\"pokemon\">Favorite Pokemon</Label>\n <Input\n type=\"pokemon\"\n id=\"pokemon\"\n placeholder=\"Charmander\"\n defaultValue=\"Son Goku\"\n aria-invalid\n />\n <p className=\"text-sm text-red-500\">Please provide a valid pokemon!</p>\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/input-style-error.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "input-style-with-label",
"type": "registry:block",
"title": "input-style-with-label",
"registryDependencies": [
"https://retroui.dev/r/input.json"
],
"files": [
{
"path": "preview/components/input-style-with-label.tsx",
"content": "import { Input } from \"@/components/retroui/Input\";\nimport { Label } from \"@/components/retroui/Label\";\n\nexport default function InputStyleWithLabel() {\n return (\n <div className=\"grid w-full max-w-sm items-center gap-1.5\">\n <Label htmlFor=\"pokemon\">Favorite Pokemon</Label>\n <Input type=\"pokemon\" id=\"pokemon\" placeholder=\"Charmander\" />\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/input-style-with-label.tsx"
}
]
}
+15
View File
@@ -0,0 +1,15 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "input",
"type": "registry:component",
"title": "Input",
"description": "This pretty input makes your users want to type stuff! ⌨️",
"files": [
{
"path": "components/retroui/Input.tsx",
"content": "import React, { InputHTMLAttributes } from \"react\";\n\ninterface InputProps extends InputHTMLAttributes<HTMLInputElement> {\n className?: string;\n}\n\nexport const Input: React.FC<InputProps> = ({\n type = \"text\",\n placeholder = \"Enter text\",\n className = \"\",\n ...props\n}) => {\n return (\n <input\n type={type}\n placeholder={placeholder}\n className={`px-4 py-2 w-full rounded border-2 shadow-md transition focus:outline-hidden focus:shadow-xs ${\n props[\"aria-invalid\"]\n ? \"border-destructive text-destructive shadow-xs shadow-destructive\"\n : \"\"\n } ${className}`}\n {...props}\n />\n );\n};\n",
"type": "registry:component",
"target": "components/retroui/Input.tsx"
}
]
}
+19
View File
@@ -0,0 +1,19 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "label",
"type": "registry:component",
"title": "Label",
"description": "Label for form fields",
"dependencies": [
"@radix-ui/react-label",
"class-variance-authority"
],
"files": [
{
"path": "components/retroui/Label.tsx",
"content": "import * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst labelVariants = cva(\n \"leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n);\n\nexport const Label = ({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) => (\n <LabelPrimitive.Root className={cn(labelVariants(), className)} {...props} />\n);\n",
"type": "registry:component",
"target": "components/retroui/Label.tsx"
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "line-chart",
"type": "registry:component",
"title": "Line Chart",
"description": "Beautiful line chart for data visualization with retro styling",
"dependencies": [
"recharts"
],
"files": [
{
"path": "components/retroui/charts/LineChart.tsx",
"content": "\"use client\"\n\nimport { cn } from \"@/lib/utils\"\nimport React from \"react\"\nimport {\n CartesianGrid,\n Line,\n LineChart as RechartsLineChart,\n ResponsiveContainer,\n Tooltip,\n XAxis,\n YAxis,\n} from \"recharts\"\n\ninterface LineChartProps extends React.HTMLAttributes<HTMLDivElement> {\n data: Record<string, any>[]\n index: string\n categories: string[]\n strokeColors?: string[]\n tooltipBgColor?: string\n tooltipBorderColor?: string\n gridColor?: string\n valueFormatter?: (value: number) => string\n showGrid?: boolean\n showTooltip?: boolean\n strokeWidth?: number\n dotSize?: number\n className?: string\n}\n\nconst LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(\n (\n {\n data = [],\n index,\n categories = [],\n strokeColors = [\"var(--foreground)\"],\n tooltipBgColor = \"var(--background)\",\n tooltipBorderColor = \"var(--border)\",\n gridColor = \"var(--muted)\",\n valueFormatter = (value: number) => value.toString(),\n showGrid = true,\n showTooltip = true,\n strokeWidth = 2,\n dotSize = 4,\n className,\n ...props\n },\n ref\n ) => {\n return (\n <div ref={ref} className={cn(\"h-80 w-full\", className)} {...props}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsLineChart data={data} margin={{ top: 0, right: 30, left: 0, bottom: 0 }}>\n {showGrid && (\n <CartesianGrid strokeDasharray=\"3 3\" stroke={gridColor} />\n )}\n \n <XAxis \n dataKey={index}\n axisLine={false}\n tickLine={false}\n className=\"text-xs fill-muted-foreground\"\n />\n \n <YAxis\n axisLine={false}\n tickLine={false}\n className=\"text-xs fill-muted-foreground\"\n tickFormatter={valueFormatter}\n />\n \n {showTooltip && (\n <Tooltip\n content={({ active, payload, label }) => {\n if (!active || !payload?.length) return null\n \n return (\n <div \n className=\"border p-2 shadow\"\n style={{ \n backgroundColor: tooltipBgColor,\n borderColor: tooltipBorderColor \n }}\n >\n <div className=\"grid grid-cols-2 gap-2\">\n <div className=\"flex flex-col\">\n <span className=\"text-[0.70rem] uppercase text-muted-foreground\">\n {index}\n </span>\n <span className=\"font-bold text-muted-foreground\">\n {label}\n </span>\n </div>\n {payload.map((entry, index) => (\n <div key={index} className=\"flex flex-col\">\n <span className=\"text-[0.70rem] uppercase text-muted-foreground\">\n {entry.dataKey}\n </span>\n <span className=\"font-bold\" style={{ color: entry.color }}>\n {valueFormatter(entry.value as number)}\n </span>\n </div>\n ))}\n </div>\n </div>\n )\n }}\n />\n )}\n \n {categories.map((category, index) => {\n const strokeColor = strokeColors[index] || strokeColors[0]\n \n return (\n <Line\n key={category}\n dataKey={category}\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n dot={{ r: dotSize, fill: strokeColor }}\n activeDot={{ r: dotSize + 2, fill: strokeColor }}\n />\n )\n })}\n </RechartsLineChart>\n </ResponsiveContainer>\n </div>\n )\n }\n)\n\nLineChart.displayName = \"LineChart\"\n\nexport { LineChart, type LineChartProps }",
"type": "registry:component",
"target": "components/retroui/charts/LineChart.tsx"
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "loader",
"type": "registry:component",
"title": "Loader",
"description": "A loading indicator",
"dependencies": [
"class-variance-authority"
],
"files": [
{
"path": "components/retroui/Loader.tsx",
"content": "import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"@/lib/utils\";\n\nconst loaderVariants = cva(\"flex gap-1\", {\n variants: {\n variant: {\n default: \"[&>div]:bg-primary [&>div]:border-black\",\n secondary:\n \"[&>div]:bg-secondary [&>div]:border-black\",\n outline: \"[&>div]:bg-transparent [&>div]:border-black\",\n },\n size: {\n sm: \"[&>div]:w-2 [&>div]:h-2\",\n md: \"[&>div]:w-3 [&>div]:h-3\",\n lg: \"[&>div]:w-4 [&>div]:h-4\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n});\n\ninterface LoaderProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"color\">,\n VariantProps<typeof loaderVariants> {\n asChild?: boolean;\n count?: number; // number of bouncing dots\n duration?: number; // animation duration in seconds\n delayStep?: number; // delay in ms\n}\n\nconst Loader = React.forwardRef<HTMLDivElement, LoaderProps>(\n (\n {\n className,\n variant,\n size,\n count = 3,\n duration = 0.5,\n delayStep = 100,\n ...props\n },\n ref,\n ) => {\n return (\n <div\n className={cn(loaderVariants({ variant, size }), className)}\n ref={ref}\n role=\"status\"\n aria-label=\"Loading...\"\n {...props}\n >\n {Array.from({ length: count }).map((_, i) => (\n <div\n key={i}\n className=\"border-2 animate-bounce\"\n style={{\n animationDuration: `${duration}s`,\n animationIterationCount: \"infinite\",\n animationDelay: `${i * delayStep}ms`,\n }}\n />\n ))}\n </div>\n );\n },\n);\n\nLoader.displayName = \"Loader\";\nexport { Loader };\n",
"type": "registry:component",
"target": "components/retroui/Loader.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "menu-style-default",
"type": "registry:block",
"title": "menu-style-default",
"registryDependencies": [
"https://retroui.dev/r/menu.json"
],
"files": [
{
"path": "preview/components/menu-style-default.tsx",
"content": "import { Button } from \"@/components/retroui/Button\";\nimport { Menu } from \"@/components/retroui/Menu\";\n\nexport default function MenuDefault() {\n return (\n <Menu>\n <Menu.Trigger asChild>\n <Button>Menu</Button>\n </Menu.Trigger>\n <Menu.Content className=\"min-w-36\">\n <Menu.Item>Menu Item 1</Menu.Item>\n <Menu.Item>Menu Item 2</Menu.Item>\n <Menu.Item>Menu Item 3</Menu.Item>\n </Menu.Content>\n </Menu>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/menu-style-default.tsx"
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "menu",
"type": "registry:component",
"title": "Menu",
"description": "Show your users a list of actions they can take. 📋",
"dependencies": [
"@radix-ui/react-dropdown-menu"
],
"files": [
{
"path": "components/retroui/Menu.tsx",
"content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport * as DropdownMenu from \"@radix-ui/react-dropdown-menu\";\nimport React, { ComponentPropsWithoutRef } from \"react\";\n\nconst Menu = DropdownMenu.Root;\nconst Trigger = DropdownMenu.Trigger;\n\ninterface IMenuContent\n extends ComponentPropsWithoutRef<typeof DropdownMenu.Content> {}\n\nconst Content = ({ className, ...props }: IMenuContent) => (\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n side=\"bottom\"\n align=\"start\"\n className={cn(\n \"bg-white border-2 shadow-md absolute top-2 min-w-20\",\n className,\n )}\n {...props}\n />\n </DropdownMenu.Portal>\n);\n\nconst MenuItem = React.forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof DropdownMenu.Item>\n>(({ className, ...props }, ref) => (\n <DropdownMenu.Item\n ref={ref}\n className={cn(\n \"relative text-black flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden transition-colors hover:bg-primary focus:bg-primary data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n {...props}\n />\n));\nMenuItem.displayName = \"MenuItem\";\n\nconst MenuComponent = Object.assign(Menu, {\n Trigger,\n Content,\n Item: MenuItem,\n});\n\nexport { MenuComponent as Menu };\n",
"type": "registry:component",
"target": "components/retroui/Menu.tsx"
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "pie-chart",
"type": "registry:component",
"title": "Pie Chart",
"description": "Beautiful pie chart for data visualization with retro styling",
"dependencies": [
"recharts"
],
"files": [
{
"path": "components/retroui/charts/PieChart.tsx",
"content": "\"use client\"\n\nimport { cn } from \"@/lib/utils\"\nimport React from \"react\"\nimport {\n Cell,\n Pie,\n PieChart as RechartsPieChart,\n ResponsiveContainer,\n Tooltip,\n} from \"recharts\"\n\ninterface PieChartProps extends React.HTMLAttributes<HTMLDivElement> {\n data: Record<string, any>[]\n dataKey: string\n nameKey: string\n colors?: string[]\n tooltipBgColor?: string\n tooltipBorderColor?: string\n valueFormatter?: (value: number) => string\n showTooltip?: boolean\n innerRadius?: number\n outerRadius?: number\n className?: string\n}\n\nconst PieChart = React.forwardRef<HTMLDivElement, PieChartProps>(\n (\n {\n data = [],\n dataKey,\n nameKey,\n colors = [\"var(--chart-1)\", \"var(--chart-2)\", \"var(--chart-3)\", \"var(--chart-4)\", \"var(--chart-5)\"],\n tooltipBgColor = \"var(--background)\",\n tooltipBorderColor = \"var(--border)\",\n valueFormatter = (value: number) => value.toString(),\n showTooltip = true,\n innerRadius = 0,\n outerRadius = 100,\n className,\n ...props\n },\n ref\n ) => {\n return (\n <div ref={ref} className={cn(\"h-80 w-full\", className)} {...props}>\n <ResponsiveContainer width=\"100%\" height=\"100%\">\n <RechartsPieChart>\n <Pie\n data={data}\n dataKey={dataKey}\n nameKey={nameKey}\n cx=\"50%\"\n cy=\"50%\"\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n isAnimationActive={false}\n className=\"w-full h-full\"\n >\n {data.map((entry, index) => (\n <Cell \n key={`cell-${index}`} \n fill={colors[index % colors.length]} \n />\n ))}\n </Pie>\n \n {showTooltip && (\n <Tooltip\n content={({ active, payload }) => {\n if (!active || !payload?.length) return null\n \n const data = payload[0]\n \n return (\n <div \n className=\"border p-2 shadow\"\n style={{ \n backgroundColor: tooltipBgColor,\n borderColor: tooltipBorderColor \n }}\n >\n <div className=\"flex flex-col gap-1\">\n <span className=\"text-[0.70rem] uppercase text-muted-foreground\">\n {data.name}\n </span>\n <span className=\"font-bold text-foreground\">\n {valueFormatter(data.value as number)}\n </span>\n </div>\n </div>\n )\n }}\n />\n )}\n </RechartsPieChart>\n </ResponsiveContainer>\n </div>\n )\n }\n)\n\nPieChart.displayName = \"PieChart\"\n\nexport { PieChart, type PieChartProps }",
"type": "registry:component",
"target": "components/retroui/charts/PieChart.tsx"
}
]
}
@@ -0,0 +1,23 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "popover-style-default-shadow",
"type": "registry:block",
"title": "popover-style-default-shadow",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/popover.json",
"https://retroui.dev/r/label.json",
"https://retroui.dev/r/input.json",
"https://retroui.dev/r/button.json"
],
"files": [
{
"path": "preview/components/popover-style-default-shadow.tsx",
"content": "\"use client\";\n\nimport { Popover, Label, Button, Input } from \"@/components/retroui\";\n\nexport default function PopoverStyleDefaultShadow() {\n return (\n <Popover>\n <Popover.Trigger asChild>\n <Button>Open Popover</Button>\n </Popover.Trigger>\n <Popover.Content className=\"w-80 shadow-md\">\n <div className=\"grid gap-4\">\n <div className=\"space-y-2\">\n <h4 className=\"font-medium leading-none\">Dimensions</h4>\n <p className=\"text-sm text-muted-foreground\">\n Set the dimensions for the layer.\n </p>\n </div>\n\n <div className=\"grid gap-2\">\n <div className=\"grid grid-cols-3 items-center gap-4\">\n <Label htmlFor=\"width\">Width</Label>\n\n <Input\n id=\"width\"\n defaultValue=\"100%\"\n className=\"col-span-2 h-8\"\n />\n </div>\n\n <div className=\"grid grid-cols-3 items-center gap-4\">\n <Label htmlFor=\"height\">Height</Label>\n\n <Input\n id=\"height\"\n defaultValue=\"25px\"\n className=\"col-span-2 h-8\"\n />\n </div>\n </div>\n </div>\n </Popover.Content>\n </Popover>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/popover-style-default-shadow.tsx"
}
]
}
@@ -0,0 +1,23 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "popover-style-default",
"type": "registry:block",
"title": "popover-style-default",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/popover.json",
"https://retroui.dev/r/label.json",
"https://retroui.dev/r/input.json",
"https://retroui.dev/r/button.json"
],
"files": [
{
"path": "preview/components/popover-style-default.tsx",
"content": "\"use client\";\n\nimport { Popover, Label, Button, Input } from \"@/components/retroui\";\n\nexport default function PopoverStyleDefault() {\n return (\n <Popover>\n <Popover.Trigger asChild>\n <Button>Open Popover</Button>\n </Popover.Trigger>\n <Popover.Content className=\"w-80 font-sans\">\n <div className=\"grid gap-4\">\n <div className=\"space-y-2\">\n <h4 className=\"font-medium leading-none\">Dimensions</h4>\n <p className=\"text-sm text-muted-foreground\">\n Set the dimensions for the layer.\n </p>\n </div>\n\n <div className=\"grid gap-2\">\n <div className=\"grid grid-cols-3 items-center gap-4\">\n <Label htmlFor=\"width\">Width</Label>\n\n <Input\n id=\"width\"\n defaultValue=\"100%\"\n className=\"col-span-2 h-8\"\n />\n </div>\n\n <div className=\"grid grid-cols-3 items-center gap-4\">\n <Label htmlFor=\"height\">Height</Label>\n\n <Input\n id=\"height\"\n defaultValue=\"25px\"\n className=\"col-span-2 h-8\"\n />\n </div>\n </div>\n </div>\n </Popover.Content>\n </Popover>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/popover-style-default.tsx"
}
]
}
@@ -0,0 +1,20 @@
{
"name": "popover-style-primary-shadow",
"title": "popover-style-primary-shadow",
"type": "registry:block",
"registryDependencies": [
"https://retroui.dev/r/popover.json",
"https://retroui.dev/r/label.json",
"https://retroui.dev/r/input.json",
"https://retroui.dev/r/button.json"
],
"dependencies": ["lucide-react"],
"files": [
{
"path": "preview/components/popover-style-primary-shadow.tsx",
"target": "components/retroui/preview/popover-style-primary-shadow.tsx",
"type": "registry:block",
"content": "\"use client\";\n\nimport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n Label,\n Button,\n Input,\n} from \"@/components/retroui\";\n\nexport default function PopoverStylePrimaryShadow() {\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button>Open Popover</Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-80 font-sans\" variant=\"primary\" shadow=\"md\">\n <div className=\"grid gap-4\">\n <div className=\"space-y-2\">\n <h4 className=\"font-medium leading-none\">Dimensions</h4>\n <p className=\"text-sm text-muted-foreground\">\n Set the dimensions for the layer.\n </p>\n </div>\n\n <div className=\"grid gap-2\">\n <div className=\"grid grid-cols-3 items-center gap-4\">\n <Label htmlFor=\"width\">Width</Label>\n\n <Input\n id=\"width\"\n defaultValue=\"100%\"\n className=\"col-span-2 h-8\"\n />\n </div>\n\n <div className=\"grid grid-cols-3 items-center gap-4\">\n <Label htmlFor=\"height\">Height</Label>\n\n <Input\n id=\"height\"\n defaultValue=\"25px\"\n className=\"col-span-2 h-8\"\n />\n </div>\n </div>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n"
}
]
}
@@ -0,0 +1,20 @@
{
"name": "popover-style-primary",
"title": "popover-style-default",
"type": "registry:block",
"registryDependencies": [
"https://retroui.dev/r/popover.json",
"https://retroui.dev/r/label.json",
"https://retroui.dev/r/input.json",
"https://retroui.dev/r/button.json"
],
"dependencies": ["lucide-react"],
"files": [
{
"path": "preview/components/popover-style-primary.tsx",
"target": "components/retroui/preview/popover-style-primary.tsx",
"type": "registry:block",
"content": "\"use client\";\n\nimport {\n Popover,\n PopoverTrigger,\n PopoverContent,\n Label,\n Button,\n Input,\n} from \"@/components/retroui\";\n\nexport default function PopoverStylePrimary() {\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button>Open Popover</Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-80 font-sans\" variant=\"primary\">\n <div className=\"grid gap-4\">\n <div className=\"space-y-2\">\n <h4 className=\"font-medium leading-none\">Dimensions</h4>\n <p className=\"text-sm text-muted-foreground\">\n Set the dimensions for the layer.\n </p>\n </div>\n\n <div className=\"grid gap-2\">\n <div className=\"grid grid-cols-3 items-center gap-4\">\n <Label htmlFor=\"width\">Width</Label>\n\n <Input\n id=\"width\"\n defaultValue=\"100%\"\n className=\"col-span-2 h-8\"\n />\n </div>\n\n <div className=\"grid grid-cols-3 items-center gap-4\">\n <Label htmlFor=\"height\">Height</Label>\n\n <Input\n id=\"height\"\n defaultValue=\"25px\"\n className=\"col-span-2 h-8\"\n />\n </div>\n </div>\n </div>\n </PopoverContent>\n </Popover>\n );\n}\n"
}
]
}
+20
View File
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "popover",
"type": "registry:component",
"title": "Popover",
"author": "Ankan Bhattacharya <https://github.com/ankan002>",
"description": "A handy small component for your little input needs...😉",
"dependencies": [
"@radix-ui/react-popover",
"class-variance-authority"
],
"files": [
{
"path": "components/retroui/Popover.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\n\nimport { cn } from \"@/lib/utils\";\nimport { cva, VariantProps } from \"class-variance-authority\";\n\nconst popoverContentVariants = cva(\n \"z-50 w-72 border-2 bg-background p-4 text-popover-foreground outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]\",\n);\n\nconst Popover = PopoverPrimitive.Root;\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverAnchor = PopoverPrimitive.Anchor;\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> &\n VariantProps<typeof popoverContentVariants>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n popoverContentVariants({\n className,\n }),\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nconst PopoverObject = Object.assign(Popover, {\n Trigger: PopoverTrigger,\n Content: PopoverContent,\n Anchor: PopoverAnchor,\n});\n\nexport { PopoverObject as Popover };\n",
"type": "registry:component",
"target": "components/retroui/Popover.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "progress-style-default",
"type": "registry:block",
"title": "progress-style-default",
"registryDependencies": [
"https://retroui.dev/r/progress.json"
],
"files": [
{
"path": "preview/components/progress-style-default.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { Progress } from \"@/components/retroui/Progress\";\n\nexport default function ProgressDemo() {\n const [progress, setProgress] = React.useState(13);\n\n React.useEffect(() => {\n const timer = setTimeout(() => setProgress(66), 500);\n return () => clearTimeout(timer);\n }, []);\n\n return <Progress value={progress} className=\"w-[60%]\" />;\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/progress-style-default.tsx"
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "progress",
"type": "registry:component",
"title": "Progress",
"description": "Show progress...",
"dependencies": [
"@radix-ui/react-progress"
],
"files": [
{
"path": "components/retroui/Progress.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as ProgressPrimitive from \"@radix-ui/react-progress\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst Progress = React.forwardRef<\n React.ElementRef<typeof ProgressPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>\n>(({ className, value, ...props }, ref) => (\n <ProgressPrimitive.Root\n ref={ref}\n className={cn(\n \"relative h-4 w-full overflow-hidden bg-background border-2\",\n className,\n )}\n {...props}\n >\n <ProgressPrimitive.Indicator\n className=\"h-full w-full flex-1 bg-primary transition-all\"\n style={{ transform: `translateX(-${100 - (value || 0)}%)` }}\n />\n </ProgressPrimitive.Root>\n));\nProgress.displayName = ProgressPrimitive.Root.displayName;\n\nexport { Progress };\n",
"type": "registry:component",
"target": "components/retroui/Progress.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "radio-style-default",
"type": "registry:block",
"title": "radio-style-default",
"registryDependencies": [
"https://retroui.dev/r/radio.json"
],
"files": [
{
"path": "preview/components/radio-style-default.tsx",
"content": "import { RadioGroup } from \"@/components/retroui/Radio\";\n\nexport default function RadioStyleSizes() {\n return (\n <RadioGroup>\n <div className=\"flex items-center space-x-2\">\n <RadioGroup.Item value=\"1\" />\n <label htmlFor=\"1\"> Option 1</label>\n </div>\n <div className=\"flex items-center space-x-2\">\n <RadioGroup.Item value=\"2\" />\n <label htmlFor=\"2\"> Option 2</label>\n </div>\n <div className=\"flex items-center space-x-2\">\n <RadioGroup.Item value=\"3\" />\n <label htmlFor=\"3\"> Option 3</label>\n </div>\n </RadioGroup>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/radio-style-default.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "radio-style-sizes",
"type": "registry:block",
"title": "radio-style-sizes",
"registryDependencies": [
"https://retroui.dev/r/radio.json"
],
"files": [
{
"path": "preview/components/radio-style-sizes.tsx",
"content": "import { RadioGroup } from \"@/components/retroui/Radio\";\n\nexport default function RadioStyleSizes() {\n return (\n <div className=\"flex gap-4\">\n <RadioGroup>\n <div className=\"flex items-center space-x-2\">\n <RadioGroup.Item value=\"sm\" size=\"sm\" />\n <label htmlFor=\"sm\" className=\"text-sm\">\n Small\n </label>\n </div>\n <div className=\"flex items-center space-x-2\">\n <RadioGroup.Item value=\"md\" size=\"md\" />\n <label htmlFor=\"md\">Medium</label>\n </div>\n <div className=\"flex items-center space-x-2\">\n <RadioGroup.Item value=\"lg\" size=\"lg\" />\n <label htmlFor=\"lg\" className=\"text-lg\">\n Large Size\n </label>\n </div>\n </RadioGroup>\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/radio-style-sizes.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "radio-style-variants",
"type": "registry:block",
"title": "radio-style-variants",
"registryDependencies": [
"https://retroui.dev/r/radio.json"
],
"files": [
{
"path": "preview/components/radio-style-variants.tsx",
"content": "import { RadioGroup } from \"@/components/retroui/Radio\";\n\nexport default function RadioStyleVariants() {\n return (\n <div className=\"flex gap-4\">\n <RadioGroup>\n <div className=\"flex items-center space-x-2\">\n <RadioGroup.Item value=\"default\" variant=\"default\" />\n <label htmlFor=\"default\">Default Style</label>\n </div>\n <div className=\"flex items-center space-x-2\">\n <RadioGroup.Item value=\"outline\" variant=\"outline\" />\n <label htmlFor=\"outline\">Outline Style</label>\n </div>\n <div className=\"flex items-center space-x-2\">\n <RadioGroup.Item value=\"solid\" variant=\"solid\" />\n <label htmlFor=\"solid\">Solid Style</label>\n </div>\n </RadioGroup>\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/radio-style-variants.tsx"
}
]
}
+19
View File
@@ -0,0 +1,19 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "radio",
"type": "registry:component",
"title": "Radio",
"description": "Sometimes you need to pick multiple options! That's where the Radio component comes into play.",
"dependencies": [
"@radix-ui/react-radio-group",
"class-variance-authority"
],
"files": [
{
"path": "components/retroui/Radio.tsx",
"content": "import { cn } from \"@/lib/utils\";\nimport * as RadioPrimitive from \"@radix-ui/react-radio-group\";\nimport { cva, VariantProps } from \"class-variance-authority\";\n\nconst radioVariants = cva(\"border-border border-2\", {\n variants: {\n variant: {\n default: \"\",\n outline: \"\",\n solid: \"\",\n },\n size: {\n sm: \"h-4 w-4\",\n md: \"h-5 w-5\",\n lg: \"h-6 w-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n});\n\nconst radioIndicatorVariants = cva(\"flex \", {\n variants: {\n variant: {\n default: \"bg-primary border-2 border-border\",\n outline: \"border-2 border-border\",\n solid: \"bg-border\",\n },\n size: {\n sm: \"h-2 w-2\",\n md: \"h-2.5 w-2.5\",\n lg: \"h-3.5 w-3.5\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n});\n\ninterface RadioGroupProps\n extends React.ComponentProps<typeof RadioPrimitive.Root> {}\n\nexport const RadioGroupRoot = ({ className, ...props }: RadioGroupProps) => (\n <RadioPrimitive.Root className={cn(\"grid gap-2\", className)} {...props} />\n);\n\ninterface RadioProps\n extends React.ComponentProps<typeof RadioPrimitive.Item>,\n VariantProps<typeof radioVariants> {}\n\nexport const RadioItem = ({\n children,\n className,\n size,\n variant,\n ...props\n}: RadioProps) => (\n <RadioPrimitive.Item\n {...props}\n className={cn(\n radioVariants({\n size,\n variant,\n }),\n className,\n )}\n >\n <RadioPrimitive.Indicator className=\"flex justify-center items-center\">\n <span className={radioIndicatorVariants({ size, variant })}></span>\n </RadioPrimitive.Indicator>\n {children}\n </RadioPrimitive.Item>\n);\n\nconst RadioComponent = Object.assign(RadioGroupRoot, {\n Item: RadioItem,\n});\n\nexport { RadioComponent as RadioGroup };\n",
"type": "registry:component",
"target": "components/retroui/Radio.tsx"
}
]
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "select-style-default",
"type": "registry:block",
"title": "select-style-default",
"registryDependencies": [
"https://retroui.dev/r/select.json"
],
"files": [
{
"path": "preview/components/select-style-default.tsx",
"content": "import { Select } from \"@/components/retroui/Select\";\nimport React from \"react\";\n\nexport default function SelectStyleDefault() {\n return (\n <Select>\n <Select.Trigger className=\"w-60\">\n <Select.Value placeholder=\"Pick your Pokemon\" />\n </Select.Trigger>\n <Select.Content>\n <Select.Group>\n <Select.Item value=\"pikachu\">Pikachu</Select.Item>\n <Select.Item value=\"charizard\">Charizard</Select.Item>\n <Select.Item value=\"bulbasaur\">Bulbasaur</Select.Item>\n <Select.Item value=\"squirtle\">Squirtle</Select.Item>\n </Select.Group>\n </Select.Content>\n </Select>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/select-style-default.tsx"
}
]
}
+19
View File
@@ -0,0 +1,19 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "select",
"type": "registry:component",
"title": "Select",
"description": "Let your users pick what they want.",
"dependencies": [
"@radix-ui/react-select",
"lucide-react"
],
"files": [
{
"path": "components/retroui/Select.tsx",
"content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { Check, ChevronDown, ChevronUp } from \"lucide-react\";\nimport React from \"react\";\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectTrigger = ({\n className,\n children,\n ...props\n}: SelectPrimitive.SelectTriggerProps) => {\n return (\n <SelectPrimitive.Trigger\n className={cn(\n \"flex h-10 rounded min-w-40 items-center shadow-md focus:shadow-xs justify-between border-2 border-input border-border bg-transparent px-4 py-2 placeholder:text-muted-foreground outline-none focus:outline-none focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDown className=\"ml-2 h-4 w-4\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n};\n\nconst SelectValue = SelectPrimitive.Value;\n\nconst SelectIcon = SelectPrimitive.Icon;\n\nconst SelectContent = ({\n className,\n children,\n position = \"popper\",\n ...props\n}: SelectPrimitive.SelectContentProps) => {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n className={cn(\n \"relative z-50 min-w-[8rem] overflow-hidden border border-border bg-background text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className,\n )}\n position={position}\n {...props}\n >\n <SelectPrimitive.ScrollUpButton className=\"flex cursor-default items-center justify-center py-1 text-muted-foreground\">\n <ChevronUp className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n <SelectPrimitive.Viewport\n className={cn(\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]\",\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectPrimitive.ScrollDownButton className=\"flex cursor-default items-center justify-center py-1 text-muted-foreground\">\n <ChevronDown className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n};\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectItem = ({\n className,\n children,\n ...props\n}: SelectPrimitive.SelectItemProps) => (\n <SelectPrimitive.Item\n className={cn(\n \"relative flex w-full cursor-default select-none items-center py-1.5 px-2 outline-none data-[highlighted]:bg-primary data-[highlighted]:text-primary-foreground focus:bg-primary focus:text-primary-foreground data-disabled:pointer-events-none data-disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n\n <span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <Check className=\"h-4 w-4 text-foreground\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n </SelectPrimitive.Item>\n);\nconst SelectLabel = SelectPrimitive.Label;\nconst SelectSeparator = SelectPrimitive.Separator;\n\nconst SelectObj = Object.assign(Select, {\n Trigger: SelectTrigger,\n Value: SelectValue,\n Icon: SelectIcon,\n Content: SelectContent,\n Group: SelectGroup,\n Item: SelectItem,\n Label: SelectLabel,\n Separator: SelectSeparator,\n});\n\nexport { SelectObj as Select };\n",
"type": "registry:component",
"target": "components/retroui/Select.tsx"
}
]
}
+19
View File
@@ -0,0 +1,19 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "slider",
"type": "registry:component",
"title": "Slider",
"description": "Let your users pick what they want.",
"dependencies": [
"@radix-ui/react-slider",
"lucide-react"
],
"files": [
{
"path": "components/retroui/Slider.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as SliderPrimitive from \"@radix-ui/react-slider\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst Slider = React.forwardRef<\n React.ElementRef<typeof SliderPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SliderPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <SliderPrimitive.Root\n ref={ref}\n className={cn(\n \"relative flex w-full touch-none select-none items-center\",\n className,\n )}\n {...props}\n >\n <SliderPrimitive.Track className=\"relative h-3 w-full grow overflow-hidden bg-background border-2\">\n <SliderPrimitive.Range className=\"absolute h-full bg-primary\" />\n </SliderPrimitive.Track>\n <SliderPrimitive.Thumb className=\"block h-4.5 w-4.5 border-2 bg-background shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\" />\n </SliderPrimitive.Root>\n));\nSlider.displayName = SliderPrimitive.Root.displayName;\n\nexport { Slider };\n",
"type": "registry:component",
"target": "components/retroui/Slider.tsx"
}
]
}
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "sonner-style-default",
"type": "registry:block",
"title": "sonner-style-default",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/sonner.json",
"https://retroui.dev/r/button.json"
],
"files": [
{
"path": "preview/components/sonner-style-default.tsx",
"content": "import { Button } from \"@/components/retroui\";\nimport { toast } from \"sonner\";\n\nexport default function SonnerStyleDefault() {\n const onClick = () => {\n toast(\"Event has been created\", {\n description: \"Sunday, December 03, 2025\",\n cancel: {\n label: \"Undo\",\n onClick: () => {},\n },\n });\n };\n\n return <Button onClick={onClick}>Show Toast</Button>;\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/sonner-style-default.tsx"
}
]
}
+21
View File
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "sonner-style-error",
"type": "registry:block",
"title": "sonner-style-error",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/sonner.json",
"https://retroui.dev/r/button.json"
],
"files": [
{
"path": "preview/components/sonner-style-error.tsx",
"content": "import { Button } from \"@/components/retroui\";\nimport { toast } from \"sonner\";\n\nexport default function SonnerStyleError() {\n const onClick = () => {\n toast.error(\"Oops! you ran into a pot hole\");\n };\n\n return <Button onClick={onClick}>Show Toast (Error)</Button>;\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/sonner-style-error.tsx"
}
]
}
@@ -0,0 +1,18 @@
{
"name": "sonner-style-rich-colors",
"title": "sonner-style-rich-colors",
"type": "registry:block",
"registryDependencies": [
"https://retroui.dev/r/sonner.json",
"https://retroui.dev/r/button.json"
],
"dependencies": ["lucide-react"],
"files": [
{
"path": "preview/components/sonner-style-rich-colors.tsx",
"target": "components/retroui/preview/sonner-style-rich-colors.tsx",
"type": "registry:block",
"content": "import { Button } from \"@/components/retroui\";\nimport { toast } from \"sonner\";\n\nexport default function SonnerStyleRichColors() {\n const onClick = () => {\n toast.success(\"Congrats man 🎉\", {\n richColors: true,\n });\n };\n\n return <Button onClick={onClick}>Show Toast (Rick colors)</Button>;\n}\n"
}
]
}
@@ -0,0 +1,18 @@
{
"name": "sonner-style-warning",
"title": "sonner-style-warning",
"type": "registry:block",
"registryDependencies": [
"https://retroui.dev/r/sonner.json",
"https://retroui.dev/r/button.json"
],
"dependencies": ["lucide-react"],
"files": [
{
"path": "preview/components/sonner-style-warning.tsx",
"target": "components/retroui/preview/sonner-style-warning.tsx",
"type": "registry:block",
"content": "import { Button } from \"@/components/retroui\";\nimport { toast } from \"sonner\";\n\nexport default function SonnerStyleWarning() {\n const onClick = () => {\n toast.warning(\"This is a serious warning\");\n };\n\n return <Button onClick={onClick}>Show Toast (Warning)</Button>;\n}\n"
}
]
}
+20
View File
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "sonner",
"type": "registry:component",
"title": "Sonner",
"description": "A beautiful toast component that can grab audience attention from any place.",
"dependencies": [
"sonner",
"lucide-react",
"class-variance-authority"
],
"files": [
{
"path": "components/retroui/Sonner.tsx",
"content": "\"use client\";\n\nimport { Toaster as Sonner } from \"sonner\";\n\ntype ToasterProps = React.ComponentProps<typeof Sonner>;\n\nconst Toaster = ({ ...props }: ToasterProps) => {\n return (\n <Sonner\n toastOptions={{\n classNames: {\n toast:\n \"h-auto w-full p-4 bg-background border group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border flex items-center relative\",\n description:\n \"group-[.toast]:text-muted-foreground ml-2 text-sm font-sans\",\n actionButton:\n \"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground py-1 px-2 bg-background border-border shadow hover:shadow-xs hover:translate-[2px] duration-200 transition-all focus:shadow-none border-2 ml-auto h-fit min-w-fit\",\n cancelButton:\n \"group-[.toast]:bg-muted group-[.toast]:text-foreground py-1 px-2 text-sm bg-background border-border shadow hover:shadow-xs hover:translate-[2px] duration-200 transition-all focus:shadow-none border-2 ml-auto h-fit min-w-fit\",\n title: \"ml-2 font-sans\",\n closeButton:\n \"absolute bg-background -top-1 -left-1 rounded-full p-0.5\",\n },\n unstyled: true,\n }}\n {...props}\n />\n );\n};\n\nexport { Toaster };\n",
"type": "registry:component",
"target": "components/retroui/Sonner.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "switch-style-default",
"type": "registry:block",
"title": "switch-style-default",
"registryDependencies": [
"https://retroui.dev/r/switch.json"
],
"files": [
{
"path": "preview/components/switch-style-default.tsx",
"content": "import { Switch } from \"@/components/retroui/Switch\";\nimport React from \"react\";\n\nexport default function SwitchStyleDefault() {\n return (\n <div className=\"flex items-center space-x-2\">\n <Switch id=\"notification\" />\n <label htmlFor=\"notification\">Email Notifications</label>\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/switch-style-default.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "switch-style-disabled",
"type": "registry:block",
"title": "switch-style-disabled",
"registryDependencies": [
"https://retroui.dev/r/switch.json"
],
"files": [
{
"path": "preview/components/switch-style-disabled.tsx",
"content": "import { Switch } from \"@/components/retroui/Switch\";\nimport React from \"react\";\n\nexport default function SwitchStyleDisabled() {\n return (\n <div className=\"flex items-center space-x-2\">\n <Switch id=\"notification\" disabled />\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/switch-style-disabled.tsx"
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "switch",
"type": "registry:component",
"title": "Switch",
"description": "Let users to turn on or off your marketing emails or notifications.",
"dependencies": [
"@radix-ui/react-switch"
],
"files": [
{
"path": "components/retroui/Switch.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as SwitchPrimitives from \"@radix-ui/react-switch\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst Switch = ({ className, ...props }: SwitchPrimitives.SwitchProps) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer border-2 border-foreground items-center disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary\",\n className,\n )}\n {...props}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-4 w-4 bg-primary border-2 mx-0.5 border-foreground ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 data-[state=checked]:bg-background\",\n )}\n />\n </SwitchPrimitives.Root>\n);\n\nexport { Switch };\n",
"type": "registry:component",
"target": "components/retroui/Switch.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "tab-style-default",
"type": "registry:block",
"title": "tab-style-default",
"registryDependencies": [
"https://retroui.dev/r/tab.json"
],
"files": [
{
"path": "preview/components/tab-style-default.tsx",
"content": "import { Tabs, TabsPanels, TabsTrigger, TabsContent, TabsTriggerList } from \"@/components/retroui/Tab\";\n\nexport default function TabStyleDefault() {\n return (\n <Tabs>\n <TabsTriggerList>\n <TabsTrigger>Home</TabsTrigger>\n <TabsTrigger>About</TabsTrigger>\n <TabsTrigger>Contact</TabsTrigger>\n </TabsTriggerList>\n <TabsPanels>\n <TabsContent>\n Welcome to RetroUI, a retro styled UI library built with React,\n Tailwind CSS & Headless UI.\n </TabsContent>\n <TabsContent>This is the about section!</TabsContent>\n <TabsContent>And, this is the contact section!</TabsContent>\n </TabsPanels>\n </Tabs>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/tab-style-default.tsx"
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "tab",
"type": "registry:component",
"title": "Tab",
"description": "Switch between different views using tabs.",
"dependencies": [
"@headlessui/react"
],
"files": [
{
"path": "components/retroui/Tab.tsx",
"content": "import { cn } from \"@/lib/utils\";\nimport {\n Tab,\n TabGroup,\n TabList,\n TabListProps,\n TabPanel,\n TabPanelProps,\n TabPanels,\n TabProps,\n} from \"@headlessui/react\";\n\nconst Tabs = TabGroup;\nconst TabsPanels = TabPanels;\n\ninterface ITabsTriggerList extends TabListProps {\n className?: string;\n}\nconst TabsTriggerList = ({\n children,\n className,\n ...props\n}: ITabsTriggerList) => {\n return (\n <TabList className={cn(\"flex flex-row space-x-2\", className)} {...props}>\n {children}\n </TabList>\n );\n};\n\ninterface ITabsTrigger extends TabProps {\n className?: string;\n}\nconst TabsTrigger = ({ children, className, ...props }: ITabsTrigger) => {\n return (\n <Tab\n className={cn(\n \"px-4 py-1 border-2 border-transparent data-selected:border-border data-selected:bg-primary data-selected:text-primary-foreground data-selected:font-semibold focus:outline-hidden\",\n className,\n )}\n {...props}\n >\n {children}\n </Tab>\n );\n};\n\ninterface ITabsContent extends TabPanelProps {\n className?: string;\n}\nconst TabsContent = ({ children, className, ...props }: ITabsContent) => {\n return (\n <TabPanel\n className={cn(\"border-2 border-border mt-2 p-4\", className)}\n {...props}\n >\n {children}\n </TabPanel>\n );\n};\n\nexport { Tabs, TabsPanels, TabsTrigger, TabsContent, TabsTriggerList };\n",
"type": "registry:component",
"target": "components/retroui/Tab.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "table-style-default",
"type": "registry:block",
"title": "table-style-default",
"registryDependencies": [
"https://retroui.dev/r/table.json"
],
"files": [
{
"path": "preview/components/table-style-default.tsx",
"content": "import { Badge } from \"@/components/retroui\"\nimport {\n Table,\n} from \"@/components/retroui/Table\"\n\nconst invoices = [\n {\n invoice: \"INV001\",\n customer: \"John Doe\",\n paymentStatus: \"Paid\",\n totalAmount: \"$250.00\",\n paymentMethod: \"Credit Card\",\n },\n {\n invoice: \"INV002\",\n customer: \"Jane Doe\",\n paymentStatus: \"Pending\",\n totalAmount: \"$150.00\",\n paymentMethod: \"PayPal\",\n },\n {\n invoice: \"INV003\",\n customer: \"Mark Doe\",\n paymentStatus: \"Unpaid\",\n totalAmount: \"$350.00\",\n paymentMethod: \"Bank Transfer\",\n },\n {\n invoice: \"INV004\",\n customer: \"Robert Doe\",\n paymentStatus: \"Paid\",\n totalAmount: \"$450.00\",\n paymentMethod: \"Credit Card\",\n },\n {\n invoice: \"INV005\",\n customer: \"Isabella Doe\",\n paymentStatus: \"Paid\",\n totalAmount: \"$550.00\",\n paymentMethod: \"PayPal\",\n },\n {\n invoice: \"INV006\",\n customer: \"Mrs. Doe\",\n paymentStatus: \"Pending\",\n totalAmount: \"$200.00\",\n paymentMethod: \"Bank Transfer\",\n },\n {\n invoice: \"INV007\",\n customer: \"Mr. Doe\",\n paymentStatus: \"Unpaid\",\n totalAmount: \"$300.00\",\n paymentMethod: \"Credit Card\",\n },\n]\n\nexport default function TableStyleDefault() {\n return (\n <Table className=\"max-w-lg mb-6 mx-auto\">\n <Table.Header>\n <Table.Row>\n <Table.Head className=\"w-[100px]\">Invoice</Table.Head>\n <Table.Head>Customer</Table.Head>\n <Table.Head>Status</Table.Head>\n <Table.Head>Method</Table.Head>\n <Table.Head className=\"text-right\">Amount</Table.Head>\n </Table.Row>\n </Table.Header>\n <Table.Body>\n {invoices.map((invoice) => (\n <Table.Row key={invoice.invoice}>\n <Table.Cell className=\"font-medium\">{invoice.invoice}</Table.Cell>\n <Table.Cell>{invoice.customer}</Table.Cell>\n <Table.Cell><Badge variant=\"solid\" size=\"sm\">{invoice.paymentStatus}</Badge></Table.Cell>\n <Table.Cell>{invoice.paymentMethod}</Table.Cell>\n <Table.Cell className=\"text-right\">{invoice.totalAmount}</Table.Cell>\n </Table.Row>\n ))}\n </Table.Body>\n <Table.Footer>\n <Table.Row>\n <Table.Cell colSpan={4}>Total</Table.Cell>\n <Table.Cell className=\"text-right\">$2,500.00</Table.Cell>\n </Table.Row>\n </Table.Footer>\n </Table>\n )\n}",
"type": "registry:block",
"target": "components/retroui/preview/table-style-default.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "table-with-checkbox",
"type": "registry:block",
"title": "table-with-checkbox",
"registryDependencies": [
"https://retroui.dev/r/table.json"
],
"files": [
{
"path": "preview/components/table-with-checkbox.tsx",
"content": "import { Badge, Checkbox } from \"@/components/retroui\"\nimport {\n Table,\n} from \"@/components/retroui/Table\"\nimport { useState } from \"react\"\n\nconst employees = [\n {\n id: \"1\",\n name: \"Alice Johnson\",\n department: \"Engineering\",\n status: \"Active\",\n salary: \"85,000\",\n },\n {\n id: \"2\",\n name: \"Bob Smith\",\n department: \"Product\",\n status: \"Active\",\n salary: \"95,000\",\n },\n {\n id: \"3\",\n name: \"Carol Williams\",\n department: \"Design\",\n status: \"On Leave\",\n salary: \"70,000\",\n },\n {\n id: \"4\",\n name: \"David Brown\",\n department: \"Engineering\",\n status: \"Active\",\n salary: \"90,000\",\n },\n {\n id: \"5\",\n name: \"Eve Davis\",\n department: \"Engineering\",\n status: \"Active\",\n salary: \"75,000\",\n },\n {\n id: \"6\",\n name: \"Frank Wilson\",\n department: \"Marketing\",\n status: \"Inactive\",\n salary: \"80,000\",\n },\n]\n\nexport default function TableWithCheckbox() {\n const [selectedEmployees, setSelectedEmployees] = useState<Set<string>>(new Set())\n\n const handleSelectAll = (checked: boolean) => {\n if (checked) {\n setSelectedEmployees(new Set(employees.map(emp => emp.id)))\n } else {\n setSelectedEmployees(new Set())\n }\n }\n\n const handleSelectEmployee = (employeeId: string, checked: boolean) => {\n const newSelected = new Set(selectedEmployees)\n if (checked) {\n newSelected.add(employeeId)\n } else {\n newSelected.delete(employeeId)\n }\n setSelectedEmployees(newSelected)\n }\n\n const isAllSelected = selectedEmployees.size === employees.length\n\n return (\n <Table className=\"max-w-lg mb-6 mx-auto\">\n <Table.Header>\n <Table.Row>\n <Table.Head className=\"w-[50px]\">\n <Checkbox\n checked={isAllSelected}\n onCheckedChange={handleSelectAll}\n />\n </Table.Head>\n <Table.Head>Name</Table.Head>\n <Table.Head>Department</Table.Head>\n <Table.Head>Status</Table.Head>\n <Table.Head className=\"text-right\">Salary</Table.Head>\n </Table.Row>\n </Table.Header>\n <Table.Body>\n {employees.map((employee) => (\n <Table.Row key={employee.id}>\n <Table.Cell>\n <Checkbox\n checked={selectedEmployees.has(employee.id)}\n onCheckedChange={(checked) => handleSelectEmployee(employee.id, Boolean(checked))}\n />\n </Table.Cell>\n <Table.Cell className=\"font-medium\">{employee.name}</Table.Cell>\n <Table.Cell>{employee.department}</Table.Cell>\n <Table.Cell>\n <Badge\n variant={employee.status === 'Active' ? 'default' : employee.status === 'On Leave' ? 'outline' : 'solid'}\n size=\"sm\"\n >\n {employee.status}\n </Badge>\n </Table.Cell>\n <Table.Cell className=\"text-right\">$ {employee.salary}</Table.Cell>\n </Table.Row>\n ))}\n </Table.Body>\n <Table.Footer>\n <Table.Row>\n <Table.Cell colSpan={4}>Selected: {selectedEmployees.size} / {employees.length}</Table.Cell>\n <Table.Cell className=\"text-right font-semibold\">$ {employees.reduce((total, employee) => total + Number(employee.salary.replace(',', '')), 0)}</Table.Cell>\n </Table.Row>\n </Table.Footer>\n </Table>\n )\n}",
"type": "registry:block",
"target": "components/retroui/preview/table-with-checkbox.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "table-with-sticky-header",
"type": "registry:block",
"title": "table-with-sticky-header",
"registryDependencies": [
"https://retroui.dev/r/table.json"
],
"files": [
{
"path": "preview/components/table-with-sticky-header.tsx",
"content": "import { Badge } from \"@/components/retroui\";\nimport { Table } from \"@/components/retroui/Table\";\n\nconst transactions = [\n {\n id: \"TXN001\",\n date: \"2024-01-15\",\n description: \"Payment from Customer A\",\n amount: \"$1,250.00\",\n category: \"Revenue\",\n },\n {\n id: \"TXN002\",\n date: \"2024-01-15\",\n description: \"Office Supplies Purchase\",\n amount: \"-$85.50\",\n category: \"Expense\",\n },\n {\n id: \"TXN003\",\n date: \"2024-01-16\",\n description: \"Software License Renewal\",\n category: \"Expense\",\n amount: \"-$299.99\",\n },\n {\n id: \"TXN004\",\n date: \"2024-01-16\",\n description: \"Payment from Customer B\",\n category: \"Revenue\",\n amount: \"$750.00\",\n },\n {\n id: \"TXN005\",\n date: \"2024-01-17\",\n description: \"Marketing Campaign\",\n category: \"Expense\",\n amount: \"-$500.00\",\n },\n {\n id: \"TXN006\",\n date: \"2024-01-17\",\n description: \"Freelancer Payment\",\n category: \"Expense\",\n amount: \"-$400.00\",\n },\n {\n id: \"TXN007\",\n date: \"2024-01-18\",\n description: \"Payment from Customer C\",\n category: \"Revenue\",\n amount: \"$2,100.00\",\n },\n {\n id: \"TXN008\",\n date: \"2024-01-18\",\n description: \"Equipment Purchase\",\n category: \"Expense\",\n amount: \"-$1,200.00\",\n },\n {\n id: \"TXN009\",\n date: \"2024-01-19\",\n description: \"Subscription Fee\",\n category: \"Expense\",\n amount: \"-$49.99\",\n status: \"Pending\",\n },\n {\n id: \"TXN010\",\n date: \"2024-01-19\",\n description: \"Payment from Customer D\",\n category: \"Revenue\",\n amount: \"$890.00\",\n },\n {\n id: \"TXN011\",\n date: \"2024-01-20\",\n description: \"Travel Expenses\",\n category: \"Expense\",\n amount: \"-$350.00\",\n },\n {\n id: \"TXN012\",\n date: \"2024-01-20\",\n description: \"Payment from Customer E\",\n category: \"Revenue\",\n amount: \"$1,500.00\",\n },\n];\n\nexport default function TableWithStickyHeader() {\n return (\n <div className=\"h-96 border-2\">\n <Table className=\"border-0 shadow-none\">\n <Table.Header className=\"sticky top-0\">\n <Table.Row className=\"bg-secondary hover:bg-secondary\">\n <Table.Head className=\"w-[100px] text-secondary-foreground\">\n ID\n </Table.Head>\n <Table.Head className=\"text-secondary-foreground\">Date</Table.Head>\n <Table.Head className=\"text-secondary-foreground\">\n Description\n </Table.Head>\n <Table.Head className=\"text-secondary-foreground\">\n Category\n </Table.Head>\n <Table.Head className=\"text-right text-secondary-foreground\">\n Amount\n </Table.Head>\n </Table.Row>\n </Table.Header>\n <Table.Body>\n {transactions.map((transaction) => (\n <Table.Row key={transaction.id}>\n <Table.Cell className=\"font-medium\">{transaction.id}</Table.Cell>\n <Table.Cell>{transaction.date}</Table.Cell>\n <Table.Cell>{transaction.description}</Table.Cell>\n <Table.Cell>\n <Badge\n variant={\n transaction.category === \"Revenue\" ? \"default\" : \"outline\"\n }\n size=\"sm\"\n >\n {transaction.category}\n </Badge>\n </Table.Cell>\n <Table.Cell\n className={`text-right font-medium ${transaction.amount.startsWith(\"-\") ? \"text-destructive\" : \"text-foreground\"}`}\n >\n {transaction.amount}\n </Table.Cell>\n </Table.Row>\n ))}\n </Table.Body>\n </Table>\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/table-with-sticky-header.tsx"
}
]
}
+15
View File
@@ -0,0 +1,15 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "table",
"type": "registry:component",
"title": "Table",
"description": "Show your data in a tabular format. 📊",
"files": [
{
"path": "components/retroui/Table.tsx",
"content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Table = React.forwardRef<\n HTMLTableElement,\n React.HTMLAttributes<HTMLTableElement>\n>(({ className, ...props }, ref) => (\n <div className=\"relative h-full w-full overflow-auto\">\n <table\n ref={ref}\n className={cn(\"w-full caption-bottom text-sm border-2 shadow-lg\", className)}\n {...props}\n />\n </div>\n))\nTable.displayName = \"Table\"\n\nconst TableHeader = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <thead ref={ref} className={cn(\"[&_tr]:border-b bg-primary text-primary-foreground font-head\", className)} {...props} />\n))\nTableHeader.displayName = \"TableHeader\"\n\nconst TableBody = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tbody\n ref={ref}\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n))\nTableBody.displayName = \"TableBody\"\n\nconst TableFooter = React.forwardRef<\n HTMLTableSectionElement,\n React.HTMLAttributes<HTMLTableSectionElement>\n>(({ className, ...props }, ref) => (\n <tfoot\n ref={ref}\n className={cn(\n \"border-t bg-accent font-medium [&>tr]:last:border-b-0\",\n className\n )}\n {...props}\n />\n))\nTableFooter.displayName = \"TableFooter\"\n\nconst TableRow = React.forwardRef<\n HTMLTableRowElement,\n React.HTMLAttributes<HTMLTableRowElement>\n>(({ className, ...props }, ref) => (\n <tr\n ref={ref}\n className={cn(\n \"border-b transition-colors hover:bg-primary/50 hover:text-primary-foreground data-[state=selected]:bg-muted\",\n className\n )}\n {...props}\n />\n))\nTableRow.displayName = \"TableRow\"\n\nconst TableHead = React.forwardRef<\n HTMLTableCellElement,\n React.ThHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <th\n ref={ref}\n className={cn(\n \"h-10 md:h-12 px-4 text-left align-middle font-medium text-primary-foreground [&:has([role=checkbox])]:pr-0\",\n className\n )}\n {...props}\n />\n))\nTableHead.displayName = \"TableHead\"\n\nconst TableCell = React.forwardRef<\n HTMLTableCellElement,\n React.TdHTMLAttributes<HTMLTableCellElement>\n>(({ className, ...props }, ref) => (\n <td\n ref={ref}\n className={cn(\"p-2 md:p-3 align-middle [&:has([role=checkbox])]:pr-0\", className)}\n {...props}\n />\n))\nTableCell.displayName = \"TableCell\"\n\nconst TableCaption = React.forwardRef<\n HTMLTableCaptionElement,\n React.HTMLAttributes<HTMLTableCaptionElement>\n>(({ className, ...props }, ref) => (\n <caption\n ref={ref}\n className={cn(\"my-2 text-sm text-muted-foreground\", className)}\n {...props}\n />\n))\nTableCaption.displayName = \"TableCaption\"\n\nconst TableObj = Object.assign(Table, {\n Header: TableHeader,\n Body: TableBody,\n Footer: TableFooter,\n Row: TableRow,\n Head: TableHead,\n Cell: TableCell,\n Caption: TableCaption,\n})\n\nexport {\n TableObj as Table,\n}",
"type": "registry:component",
"target": "components/retroui/Table.tsx"
}
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "text-headings",
"type": "registry:block",
"title": "text-headings",
"registryDependencies": [
"https://retroui.dev/r/text.json"
],
"files": [
{
"path": "preview/components/text-headings.tsx",
"content": "import { Text } from \"@/components/retroui/Text\";\n\nexport default function TextHeadings() {\n return (\n <div className=\"space-y-4\">\n <Text as=\"h1\">This is H1</Text>\n <Text as=\"h2\">This is H2</Text>\n <Text as=\"h3\">This is H3</Text>\n <Text as=\"h4\">This is H4</Text>\n <Text as=\"h5\">This is H5</Text>\n <Text as=\"h6\">This is H6</Text>\n </div>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/text-headings.tsx"
}
]
}
+18
View File
@@ -0,0 +1,18 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "text",
"type": "registry:component",
"title": "text",
"description": "Show your texts in different styles. 💅",
"dependencies": [
"class-variance-authority"
],
"files": [
{
"path": "components/retroui/Text.tsx",
"content": "import { ElementType, HTMLAttributes } from \"react\";\nimport { VariantProps, cva } from \"class-variance-authority\";\nimport { cn } from \"@/lib/utils\";\n\nconst textVariants = cva(\"font-head\", {\n variants: {\n as: {\n p: \"font-sans text-base\",\n li: \"font-sans text-base\",\n a: \"font-sans text-base hover:underline underline-offset-2 decoration-primary\",\n h1: \"text-4xl lg:text-5xl font-bold\",\n h2: \"text-3xl lg:text-4xl font-semibold\",\n h3: \"text-2xl font-medium\",\n h4: \"text-xl font-normal\",\n h5: \"text-lg font-normal\",\n h6: \"text-base font-normal\",\n },\n },\n defaultVariants: {\n as: \"p\",\n },\n});\n\ninterface TextProps\n extends Omit<HTMLAttributes<HTMLElement>, \"className\">,\n VariantProps<typeof textVariants> {\n className?: string;\n}\n\nexport const Text = (props: TextProps) => {\n const { className, as, ...otherProps } = props;\n const Tag: ElementType = as || \"p\";\n\n return (\n <Tag className={cn(textVariants({ as }), className)} {...otherProps} />\n );\n};\n",
"type": "registry:component",
"target": "components/retroui/Text.tsx"
}
]
}
@@ -0,0 +1,17 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "textarea-style-default",
"type": "registry:block",
"title": "textarea-style-default",
"registryDependencies": [
"https://retroui.dev/r/textarea.json"
],
"files": [
{
"path": "preview/components/textarea-style-default.tsx",
"content": "import { Textarea } from \"@/components/retroui/Textarea\";\n\nexport default function TextareaStyleDefault() {\n return (\n <Textarea\n rows={4}\n placeholder=\"type something...\"\n className=\"px-4 py-2 w-full border-2 shadow-md transition focus:outline-hidden focus:shadow-xs\"\n />\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/textarea-style-default.tsx"
}
]
}
+15
View File
@@ -0,0 +1,15 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "textarea",
"type": "registry:component",
"title": "textarea",
"description": "This pretty input makes your users want to type lots of stuff! ⌨️ ⌨",
"files": [
{
"path": "components/retroui/Textarea.tsx",
"content": "import React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport function Textarea({\n type = \"text\",\n placeholder = \"Enter text...\",\n className = \"\",\n ...props\n}) {\n return (\n <textarea\n placeholder={placeholder}\n rows={4}\n className={cn(\n \"px-4 py-2 w-full border-2 rounded border-border shadow-md transition focus:outline-hidden focus:shadow-xs placeholder:text-muted-foreground\",\n className\n )}\n {...props}\n />\n );\n}\n",
"type": "registry:component",
"target": "components/retroui/Textarea.tsx"
}
]
}
+15
View File
@@ -0,0 +1,15 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "toc",
"type": "registry:component",
"title": "Table of Contents",
"description": "Show your table of contents in a sidebar.",
"files": [
{
"path": "components/retroui/TableOfContents.tsx",
"content": "\n\"use client\";\n\nimport { cn } from '@/lib/utils';\nimport React, { useEffect, useState } from 'react';\n\ninterface TOCItem {\n title: string;\n url: string;\n level: number;\n items?: TOCItem[];\n}\n\ninterface TableOfContentsProps {\n depth?: number;\n className?: string;\n children?: React.ReactNode;\n}\n\nfunction generateTOCFromDOM(depth: number = 6): TOCItem[] {\n const headings: NodeListOf<HTMLHeadingElement> = document.querySelectorAll(\n Array.from({ length: depth }, (_, i) => `h${i + 1}`).join(', ')\n );\n\n const items: TOCItem[] = [];\n const stack: TOCItem[] = [];\n\n headings.forEach((heading) => {\n const level = parseInt(heading.tagName.charAt(1));\n const id = heading.id || heading.textContent?.toLowerCase().replace(/\\s+/g, '-').replace(/[^\\w-]/g, '') || '';\n\n if (!heading.id && id) {\n heading.id = id;\n }\n\n const item: TOCItem = {\n title: heading.textContent || '',\n url: `#${id}`,\n level,\n };\n\n while (stack.length > 0 && stack[stack.length - 1].level >= level) {\n stack.pop();\n }\n\n if (stack.length === 0) {\n items.push(item);\n } else {\n const parent = stack[stack.length - 1];\n if (!parent.items) parent.items = [];\n parent.items.push(item);\n }\n\n stack.push(item);\n });\n\n return items;\n}\n\nfunction renderTOCItems(items: TOCItem[], level = 0, activeId: string | null) {\n if (!items || items.length === 0) return null;\n\n return (\n <ul className={`space-y-1 ${level > 0 ? 'ml-4 mt-1' : ''}`}>\n {items.map((item, index) => {\n const isActive = activeId === item.url.substring(1);\n return (\n <li key={index}>\n <a\n href={item.url}\n className={`text-sm max-w-full truncate transition-colors block py-1 border-l-2 pl-2 ${\n isActive \n ? 'text-black border-black bg-accent' \n : 'border-transparent hover:border-black hover:text-black'\n }`}\n >\n {item.title}\n </a>\n {item.items && renderTOCItems(item.items, level + 1, activeId)}\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport function TableOfContents({\n depth = 2,\n className = \"\",\n children,\n}: TableOfContentsProps) {\n const [tocItems, setTocItems] = useState<TOCItem[]>([]);\n const [activeId, setActiveId] = useState<string | null>(null);\n\n useEffect(() => {\n const items = generateTOCFromDOM(depth);\n setTocItems(items);\n\n const observer = new MutationObserver(() => {\n const updatedItems = generateTOCFromDOM(depth);\n setTocItems(updatedItems);\n });\n\n observer.observe(document.body, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['id']\n });\n\n return () => observer.disconnect();\n }, [depth]);\n\n useEffect(() => {\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) {\n setActiveId(entry.target.id);\n }\n });\n },\n { rootMargin: '-20% 0% -35% 0%' }\n );\n\n const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');\n headings.forEach((heading) => observer.observe(heading));\n\n return () => observer.disconnect();\n }, []);\n\n if (tocItems.length === 0) {\n return null;\n }\n\n return (\n <div className={cn(\"border-2 shadow-md p-4 rounded w-52 h-60 overflow-y-auto sidebar-scroll\", className)}>\n {children}\n {renderTOCItems(tocItems, 0, activeId)}\n </div>\n );\n}",
"type": "registry:component",
"target": "components/retroui/TableOfContents.tsx"
}
]
}
@@ -0,0 +1,18 @@
{
"name": "toggle-group-style-outline-muted",
"title": "toggle-group-style-outline-muted",
"type": "registry:block",
"registryDependencies": [
"https://retroui.dev/r/toggle.json",
"https://retroui.dev/r/toggle-group.json"
],
"dependencies": ["lucide-react"],
"files": [
{
"path": "preview/components/toggle-group-style-outline-muted.tsx",
"target": "components/retroui/preview/toggle-group-style-outline-muted.tsx",
"type": "registry:block",
"content": "\"use client\";\n\nimport { ToggleGroup, ToggleGroupItem } from \"@/components/retroui\";\nimport { Bold, Italic, Underline } from \"lucide-react\";\n\nexport default function ToggleGroupStyleOutlined() {\n return (\n <ToggleGroup type=\"multiple\" variant=\"outlined\">\n <ToggleGroupItem value=\"bold\">\n <Bold className=\"h-4 w-4\" />\n </ToggleGroupItem>\n\n <ToggleGroupItem value=\"italic\">\n <Italic className=\"h-4 w-4\" />\n </ToggleGroupItem>\n\n <ToggleGroupItem value=\"underline\">\n <Underline className=\"h-4 w-4\" />\n </ToggleGroupItem>\n </ToggleGroup>\n );\n}\n"
}
]
}
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "toggle-group-style-default",
"type": "registry:block",
"title": "toggle-group-style-default",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/toggle.json",
"https://retroui.dev/r/toggle-group.json"
],
"files": [
{
"path": "preview/components/toggle-group-style-default.tsx",
"content": "\"use client\";\n\nimport { ToggleGroup, ToggleGroupItem } from \"@/components/retroui\";\nimport { Bold, Italic, Underline } from \"lucide-react\";\n\nexport default function ToggleGroupStyleDefault() {\n return (\n <ToggleGroup type=\"multiple\" variant=\"default\">\n <ToggleGroupItem value=\"bold\">\n <Bold className=\"h-4 w-4\" />\n </ToggleGroupItem>\n\n <ToggleGroupItem value=\"italic\">\n <Italic className=\"h-4 w-4\" />\n </ToggleGroupItem>\n\n <ToggleGroupItem value=\"underline\">\n <Underline className=\"h-4 w-4\" />\n </ToggleGroupItem>\n </ToggleGroup>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/toggle-group-style-default.tsx"
}
]
}
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "toggle-group-style-outline-muted",
"type": "registry:block",
"title": "toggle-group-style-outline-muted",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/toggle.json",
"https://retroui.dev/r/toggle-group.json"
],
"files": [
{
"path": "preview/components/toggle-group-style-outline-muted.tsx",
"content": "\"use client\";\n\nimport { ToggleGroup, ToggleGroupItem } from \"@/components/retroui\";\nimport { Bold, Italic, Underline } from \"lucide-react\";\n\nexport default function ToggleGroupStyleOutlineMuted() {\n return (\n <ToggleGroup type=\"multiple\" variant=\"outline-muted\">\n <ToggleGroupItem value=\"bold\">\n <Bold className=\"h-4 w-4\" />\n </ToggleGroupItem>\n\n <ToggleGroupItem value=\"italic\">\n <Italic className=\"h-4 w-4\" />\n </ToggleGroupItem>\n\n <ToggleGroupItem value=\"underline\">\n <Underline className=\"h-4 w-4\" />\n </ToggleGroupItem>\n </ToggleGroup>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/toggle-group-style-outline-muted.tsx"
}
]
}
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "toggle-group-style-outlined",
"type": "registry:block",
"title": "toggle-group-style-outlined",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/toggle.json",
"https://retroui.dev/r/toggle-group.json"
],
"files": [
{
"path": "preview/components/toggle-group-style-outlined.tsx",
"content": "\"use client\";\n\nimport { ToggleGroup, ToggleGroupItem } from \"@/components/retroui\";\nimport { Bold, Italic, Underline } from \"lucide-react\";\n\nexport default function ToggleGroupStyleOutlined() {\n return (\n <ToggleGroup type=\"multiple\" variant=\"outlined\">\n <ToggleGroupItem value=\"bold\">\n <Bold className=\"h-4 w-4\" />\n </ToggleGroupItem>\n\n <ToggleGroupItem value=\"italic\">\n <Italic className=\"h-4 w-4\" />\n </ToggleGroupItem>\n\n <ToggleGroupItem value=\"underline\">\n <Underline className=\"h-4 w-4\" />\n </ToggleGroupItem>\n </ToggleGroup>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/toggle-group-style-outlined.tsx"
}
]
}
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "toggle-group-style-solid",
"type": "registry:block",
"title": "toggle-group-style-solid",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/toggle.json",
"https://retroui.dev/r/toggle-group.json"
],
"files": [
{
"path": "preview/components/toggle-group-style-solid.tsx",
"content": "\"use client\";\n\nimport { ToggleGroup, ToggleGroupItem } from \"@/components/retroui\";\nimport { Bold, Italic, Underline } from \"lucide-react\";\n\nexport default function ToggleGroupStyleSolid() {\n return (\n <ToggleGroup type=\"multiple\" variant=\"solid\">\n <ToggleGroupItem value=\"bold\">\n <Bold className=\"h-4 w-4\" />\n </ToggleGroupItem>\n\n <ToggleGroupItem value=\"italic\">\n <Italic className=\"h-4 w-4\" />\n </ToggleGroupItem>\n\n <ToggleGroupItem value=\"underline\">\n <Underline className=\"h-4 w-4\" />\n </ToggleGroupItem>\n </ToggleGroup>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/toggle-group-style-solid.tsx"
}
]
}
+27
View File
@@ -0,0 +1,27 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "toggle-group",
"type": "registry:component",
"title": "Toggle Group",
"author": "Ankan Bhattacharya <https://github.com/ankan002>",
"description": "Group of toggling buttons...🤙",
"dependencies": [
"@radix-ui/react-toggle",
"@radix-ui/react-toggle-group",
"class-variance-authority"
],
"files": [
{
"path": "components/retroui/Toggle.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2\",\n {\n variants: {\n variant: {\n default:\n \"bg-transparent hover:bg-muted/70 hover:text-muted-foreground data-[state=on]:bg-muted\",\n outlined:\n \"border-2 border-input bg-transparent hover:bg-accent hover:text-accent-foreground/80 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\",\n solid: \"border-2 border-input bg-transparent hover:bg-secondary hover:text-secondary-foreground hover:border-secondary data-[state=on]:bg-secondary data-[state=on]:text-secondary-foreground data-[state=on]:border-secondary\",\n \"outline-muted\":\n \"border-2 border-input bg-transparent hover:hover:bg-muted/70 hover:hover:text-muted-foreground data-[state=on]:bg-muted\",\n },\n size: {\n default: \"h-10 px-3 min-w-10\",\n sm: \"h-9 px-2.5 min-w-9\",\n lg: \"h-11 px-5 min-w-11\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nconst Toggle = React.forwardRef<\n React.ElementRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n));\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants };\n",
"type": "registry:component",
"target": "components/retroui/Toggle.tsx"
},
{
"path": "components/retroui/ToggleGroup.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\";\nimport { type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\nimport { toggleVariants } from \"./Toggle\";\n\nconst ToggleGroupContext = React.createContext<\n VariantProps<typeof toggleVariants>\n>({\n size: \"default\",\n variant: \"default\",\n});\n\nconst ToggleGroup = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({ className, variant, size, children, ...props }, ref) => (\n <ToggleGroupPrimitive.Root\n ref={ref}\n className={cn(\"flex items-center justify-center gap-1\", className)}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size }}>\n {children}\n </ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n));\n\nToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;\n\nconst ToggleGroupItem = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &\n VariantProps<typeof toggleVariants>\n>(({ className, children, variant, size, ...props }, ref) => {\n const context = React.useContext(ToggleGroupContext);\n\n return (\n <ToggleGroupPrimitive.Item\n ref={ref}\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n className,\n )}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n});\n\nToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;\n\nexport { ToggleGroup, ToggleGroupItem };\n",
"type": "registry:component",
"target": "components/retroui/ToggleGroup.tsx"
}
]
}
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "toggle-style-default",
"type": "registry:block",
"title": "toggle-style-default",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/toggle.json"
],
"files": [
{
"path": "preview/components/toggle-style-default.tsx",
"content": "import { Toggle } from \"@/components/retroui\";\nimport { Bold } from \"lucide-react\";\n\nexport default function ToggleStyleDefault() {\n return (\n <Toggle>\n <Bold />\n </Toggle>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/toggle-style-default.tsx"
}
]
}
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "toggle-style-outline-muted",
"type": "registry:block",
"title": "toggle-style-outline-muted",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/toggle.json"
],
"files": [
{
"path": "preview/components/toggle-style-outline-muted.tsx",
"content": "import { Toggle } from \"@/components/retroui\";\nimport { Bold } from \"lucide-react\";\n\nexport default function ToggleStyleOutlineMuted() {\n return (\n <Toggle variant=\"outline-muted\">\n <Bold />\n </Toggle>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/toggle-style-outline-muted.tsx"
}
]
}
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "toggle-style-outlined",
"type": "registry:block",
"title": "toggle-style-outlined",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/toggle.json"
],
"files": [
{
"path": "preview/components/toggle-style-outlined.tsx",
"content": "import { Toggle } from \"@/components/retroui\";\nimport { Bold } from \"lucide-react\";\n\nexport default function ToggleStyleOutlined() {\n return (\n <Toggle variant=\"outlined\">\n <Bold />\n </Toggle>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/toggle-style-outlined.tsx"
}
]
}
+20
View File
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "toggle-style-solid",
"type": "registry:block",
"title": "toggle-style-solid",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/toggle.json"
],
"files": [
{
"path": "preview/components/toggle-style-solid.tsx",
"content": "import { Toggle } from \"@/components/retroui\";\nimport { Italic } from \"lucide-react\";\n\nexport default function ToggleStyleSolid() {\n return (\n <Toggle variant=\"solid\">\n <Italic /> Italics\n </Toggle>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/toggle-style-solid.tsx"
}
]
}
+20
View File
@@ -0,0 +1,20 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "toggle",
"type": "registry:component",
"title": "Toggle",
"author": "Ankan Bhattacharya <https://github.com/ankan002>",
"description": "This crazy toggling button keeps people toggling...😃",
"dependencies": [
"@radix-ui/react-toggle",
"class-variance-authority"
],
"files": [
{
"path": "components/retroui/Toggle.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst toggleVariants = cva(\n \"inline-flex items-center justify-center text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 gap-2\",\n {\n variants: {\n variant: {\n default:\n \"bg-transparent hover:bg-muted/70 hover:text-muted-foreground data-[state=on]:bg-muted\",\n outlined:\n \"border-2 border-input bg-transparent hover:bg-accent hover:text-accent-foreground/80 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground\",\n solid: \"border-2 border-input bg-transparent hover:bg-secondary hover:text-secondary-foreground hover:border-secondary data-[state=on]:bg-secondary data-[state=on]:text-secondary-foreground data-[state=on]:border-secondary\",\n \"outline-muted\":\n \"border-2 border-input bg-transparent hover:hover:bg-muted/70 hover:hover:text-muted-foreground data-[state=on]:bg-muted\",\n },\n size: {\n default: \"h-10 px-3 min-w-10\",\n sm: \"h-9 px-2.5 min-w-9\",\n lg: \"h-11 px-5 min-w-11\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nconst Toggle = React.forwardRef<\n React.ElementRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &\n VariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n <TogglePrimitive.Root\n ref={ref}\n className={cn(toggleVariants({ variant, size, className }))}\n {...props}\n />\n));\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants };\n",
"type": "registry:component",
"target": "components/retroui/Toggle.tsx"
}
]
}
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "tooltip-style-default",
"type": "registry:block",
"title": "tooltip-style-default",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/tooltip.json",
"https://retroui.dev/r/button.json"
],
"files": [
{
"path": "preview/components/tooltip-style-default.tsx",
"content": "\"use client\";\n\nimport { Button, Tooltip } from \"@/components/retroui\";\n\nexport default function TooltipStyleDefault() {\n return (\n <Tooltip.Provider>\n <Tooltip>\n <Tooltip.Trigger asChild>\n <Button variant=\"outline\">Hover</Button>\n </Tooltip.Trigger>\n <Tooltip.Content variant=\"default\">Add to Library</Tooltip.Content>\n </Tooltip>\n </Tooltip.Provider>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/tooltip-style-default.tsx"
}
]
}
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "tooltip-style-primary",
"type": "registry:block",
"title": "tooltip-style-primary",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/tooltip.json",
"https://retroui.dev/r/button.json"
],
"files": [
{
"path": "preview/components/tooltip-style-primary.tsx",
"content": "\"use client\";\n\nimport { Button, Tooltip } from \"@/components/retroui\";\n\nexport default function TooltipStylePrimary() {\n return (\n <Tooltip.Provider>\n <Tooltip>\n <Tooltip.Trigger asChild>\n <Button variant=\"outline\">Hover</Button>\n </Tooltip.Trigger>\n <Tooltip.Content variant=\"primary\">Add to Library</Tooltip.Content>\n </Tooltip>\n </Tooltip.Provider>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/tooltip-style-primary.tsx"
}
]
}
+21
View File
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "tooltip-style-solid",
"type": "registry:block",
"title": "tooltip-style-solid",
"dependencies": [
"lucide-react"
],
"registryDependencies": [
"https://retroui.dev/r/tooltip.json",
"https://retroui.dev/r/button.json"
],
"files": [
{
"path": "preview/components/tooltip-style-solid.tsx",
"content": "\"use client\";\n\nimport { Button, Tooltip } from \"@/components/retroui\";\n\nexport default function TooltipStyleSolid() {\n return (\n <Tooltip.Provider>\n <Tooltip>\n <Tooltip.Trigger asChild>\n <Button variant=\"outline\">Hover</Button>\n </Tooltip.Trigger>\n <Tooltip.Content variant=\"solid\">Add to Library</Tooltip.Content>\n </Tooltip>\n </Tooltip.Provider>\n );\n}\n",
"type": "registry:block",
"target": "components/retroui/preview/tooltip-style-solid.tsx"
}
]
}
+19
View File
@@ -0,0 +1,19 @@
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "tooltip",
"type": "registry:component",
"title": "Tooltip",
"description": "A cool way to give your users a hint of what a component does...😉",
"dependencies": [
"@radix-ui/react-tooltip",
"class-variance-authority"
],
"files": [
{
"path": "components/retroui/Tooltip.tsx",
"content": "\"use client\";\n\nimport * as React from \"react\";\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\n\nimport { cn } from \"@/lib/utils\";\nimport { cva, VariantProps } from \"class-variance-authority\";\n\nconst tooltipContentVariants = cva(\n \"z-50 overflow-hidden border-2 border-border bg-background px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]\",\n {\n variants: {\n variant: {\n default: \"bg-background text-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n solid: \"bg-black text-white\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nconst TooltipProvider = TooltipPrimitive.Provider;\n\nconst Tooltip = TooltipPrimitive.Root;\n\nconst TooltipTrigger = TooltipPrimitive.Trigger;\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> &\n VariantProps<typeof tooltipContentVariants>\n>(({ className, sideOffset = 4, variant, ...props }, ref) => (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n tooltipContentVariants({\n variant,\n className,\n }),\n )}\n {...props}\n />\n </TooltipPrimitive.Portal>\n));\nTooltipContent.displayName = TooltipPrimitive.Content.displayName;\n\nconst TooltipObject = Object.assign(Tooltip, {\n Trigger: TooltipTrigger,\n Content: TooltipContent,\n Provider: TooltipProvider,\n});\n\nexport { TooltipObject as Tooltip };\n",
"type": "registry:component",
"target": "components/retroui/Tooltip.tsx"
}
]
}

Some files were not shown because too many files have changed in this diff Show More