diff --git a/app/docs/components/empty/page.tsx b/app/docs/components/empty/page.tsx new file mode 100644 index 00000000..4d1195fb --- /dev/null +++ b/app/docs/components/empty/page.tsx @@ -0,0 +1,119 @@ +import { Metadata } from "next"; + +import { IconBrandAmongUs } from "@tabler/icons-react"; + +import { emptyMetaData } from "@/lib/metadata"; + +import { Button } from "@/components/ui/8bit/button"; +import { + Empty, + EmptyContent, + EmptyDescription, + EmptyHeader, + EmptyMedia, + EmptyTitle, +} from "@/components/ui/8bit/empty"; +import { Separator } from "@/components/ui/separator"; + +import CodeSnippet from "@/app/docs/components/code-snippet"; +import CopyCommandButton from "@/app/docs/components/copy-command-button"; +import InstallationCommands from "@/app/docs/components/installation-commands"; +import { OpenInV0Button } from "@/app/docs/components/open-in-v0-button"; + +export const metadata: Metadata = { + title: "8-bit Empty", + description: "Displays an 8-bit empty component.", + openGraph: { + images: emptyMetaData, + }, +}; + +export default function EmptyPage() { + return ( +
+
+

Empty

+ +
+ +

+ Displays an 8-bit empty component. +

+ +
+
+

+ 8-bit empty component +

+ +
+ +
+
+ +
+ + + + + + No Characters Yet + + You haven't created any Characters yet. Get started by + creating your first character. + + + +
+ + +
+
+
+
+
+ +

Installation

+ + + + + +

Usage

+ + + + {`import { IconBrandAmongUs } from "@tabler/icons-react" +import { + Empty, + EmptyContent, + EmptyDescription, + EmptyHeader, + EmptyMedia, + EmptyTitle, +} from "@/components/ui/8bit/empty"`} + {` + + + + + No Characters Yet + + You haven't created any Characters yet. Get started by creating + your first character. + + + +
+ + +
+
+
+ `}
+
+ ); +} diff --git a/components/ui/8bit/empty.tsx b/components/ui/8bit/empty.tsx new file mode 100644 index 00000000..9ebabf52 --- /dev/null +++ b/components/ui/8bit/empty.tsx @@ -0,0 +1,130 @@ +"use client"; + +import { type VariantProps, cva } from "class-variance-authority"; + +import { cn } from "@/lib/utils"; + +import "./styles/retro.css"; + +const emptyMediaVariants = cva( + "flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0", + { + variants: { + variant: { + default: "bg-transparent", + icon: "relative bg-muted text-foreground flex size-12 shrink-0 items-center justify-center", + }, + font: { + normal: "", + retro: "retro", + }, + }, + defaultVariants: { + variant: "default", + font: "retro", + }, + } +); + +function Empty({ + className, + font, + ...props +}: React.ComponentProps<"div"> & { font?: "normal" | "retro" }) { + return ( +
+ ); +} + +function EmptyHeader({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ); +} + +function EmptyMedia({ + className, + variant = "default", + ...props +}: React.ComponentProps<"div"> & VariantProps) { + return ( +
+
+ {variant !== "default" && ( + <> +
+
+
+
+
+
+ + )} +
+ ); +} + +function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) { + return ( +
+ ); +} + +function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) { + return ( +

a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4", + className + )} + {...props} + /> + ); +} + +function EmptyContent({ className, ...props }: React.ComponentProps<"div">) { + return ( +

+ ); +} + +export { + Empty, + EmptyHeader, + EmptyTitle, + EmptyDescription, + EmptyContent, + EmptyMedia, +}; diff --git a/config/nav-items.ts b/config/nav-items.ts index a504bdc0..9a0e4722 100644 --- a/config/nav-items.ts +++ b/config/nav-items.ts @@ -79,6 +79,11 @@ const components = [ title: "Dropdown Menu", url: "/docs/components/dropdown-menu", }, + { + title: "Empty", + url: "/docs/components/empty", + new: true, + }, { title: "Enemy Health", url: "/docs/components/enemy-health-display", diff --git a/lib/metadata.ts b/lib/metadata.ts index 46a49b91..18b81035 100644 --- a/lib/metadata.ts +++ b/lib/metadata.ts @@ -60,3 +60,4 @@ export const spinnerMetaData = "/assets/8bitcn-spinner-light.png"; export const kbdMetaData = "/assets/8bitcn-kbd-light.png"; export const profileCreatorMetaData = "/assets/8bitcn-profile-creator.png"; +export const emptyMetaData = "/assets/8bitcn-empty-light.png"; diff --git a/public/assets/8bitcn-empty-dark.png b/public/assets/8bitcn-empty-dark.png new file mode 100644 index 00000000..294a63e6 Binary files /dev/null and b/public/assets/8bitcn-empty-dark.png differ diff --git a/public/assets/8bitcn-empty-light.png b/public/assets/8bitcn-empty-light.png new file mode 100644 index 00000000..9ce6989a Binary files /dev/null and b/public/assets/8bitcn-empty-light.png differ diff --git a/public/r/empty.json b/public/r/empty.json new file mode 100644 index 00000000..a742dfd3 --- /dev/null +++ b/public/r/empty.json @@ -0,0 +1,16 @@ +{ + "$schema": "https://ui.shadcn.com/schema/registry-item.json", + "name": "empty", + "type": "registry:component", + "title": "8-bit Empty", + "description": "Displays an 8-bit empty component.", + "registryDependencies": [], + "files": [ + { + "path": "components/ui/8bit/empty.tsx", + "content": "\"use client\";\n\nimport { type VariantProps, cva } from \"class-variance-authority\";\n\nimport { cn } from \"@/lib/utils\";\n\nimport \"./styles/retro.css\";\n\nconst emptyMediaVariants = cva(\n \"flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n icon: \"relative bg-muted text-foreground flex size-12 shrink-0 items-center justify-center\",\n },\n font: {\n normal: \"\",\n retro: \"retro\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n font: \"retro\",\n },\n }\n);\n\nfunction Empty({\n className,\n font,\n ...props\n}: React.ComponentProps<\"div\"> & { font?: \"normal\" | \"retro\" }) {\n return (\n \n );\n}\n\nfunction EmptyHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n );\n}\n\nfunction EmptyMedia({\n className,\n variant = \"default\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps) {\n return (\n
\n \n {variant !== \"default\" && (\n <>\n
\n
\n
\n
\n
\n
\n \n )}\n
\n );\n}\n\nfunction EmptyTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n );\n}\n\nfunction EmptyDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction EmptyContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n \n );\n}\n\nexport {\n Empty,\n EmptyHeader,\n EmptyTitle,\n EmptyDescription,\n EmptyContent,\n EmptyMedia,\n};\n", + "type": "registry:component", + "target": "components/ui/8bit/empty.tsx" + } + ] +} \ No newline at end of file diff --git a/public/r/registry.json b/public/r/registry.json index a2db81db..35ce047e 100644 --- a/public/r/registry.json +++ b/public/r/registry.json @@ -1822,6 +1822,20 @@ "target": "components/ui/8bit/styles/retro.css" } ] + }, + { + "name": "empty", + "type": "registry:component", + "title": "8-bit Empty", + "description": "Displays an 8-bit empty component.", + "registryDependencies": [], + "files": [ + { + "path": "components/ui/8bit/empty.tsx", + "type": "registry:component", + "target": "components/ui/8bit/empty.tsx" + } + ] } ] } diff --git a/registry.json b/registry.json index a2db81db..35ce047e 100644 --- a/registry.json +++ b/registry.json @@ -1822,6 +1822,20 @@ "target": "components/ui/8bit/styles/retro.css" } ] + }, + { + "name": "empty", + "type": "registry:component", + "title": "8-bit Empty", + "description": "Displays an 8-bit empty component.", + "registryDependencies": [], + "files": [ + { + "path": "components/ui/8bit/empty.tsx", + "type": "registry:component", + "target": "components/ui/8bit/empty.tsx" + } + ] } ] }