diff --git a/app/(app)/showcase/page.tsx b/app/(app)/showcase/page.tsx new file mode 100644 index 00000000..f1536223 --- /dev/null +++ b/app/(app)/showcase/page.tsx @@ -0,0 +1,32 @@ +import React from "react" + +import { ListSites } from "@/app/(app)/showcase/partials/list-sites" +import { Header } from "@/components/header" +import { siteConfig } from "@/resources/config/site" +import type { Metadata } from "next" +import { Container } from "ui" + +export const metadata: Metadata = { + title: "Showcase", + description: "A showcase of justd components, tools, and more.", + metadataBase: new URL(process.env.NEXT_PUBLIC_APP_URL ?? siteConfig.url), + applicationName: siteConfig.name +} + +export default async function Page() { + const res = await fetch( + "https://raw.githubusercontent.com/justdlabs/showcase/refs/heads/main/sites.json" + ) + const sites = await res.json() + return ( + <> +
+ Show + case +
+ + + + + ) +} diff --git a/app/(app)/showcase/partials/list-sites.tsx b/app/(app)/showcase/partials/list-sites.tsx new file mode 100644 index 00000000..9a23c5a8 --- /dev/null +++ b/app/(app)/showcase/partials/list-sites.tsx @@ -0,0 +1,51 @@ +"use client" + +import * as React from "react" + +import { getSiteName } from "@/resources/lib/utils" +import { Collection, ListBox as Primitive, ListBoxItem, Section, Text } from "react-aria-components" +import { Avatar } from "ui" + +interface Props { + sites: { + name: string + url: string + }[] +} + +export function ListSites({ sites }: Props) { + return ( + +
+ + {(item) => { + return ( + + +
+ + {item.name} + + + {item.url} + +
+
+ ) + }} +
+
+
+ ) +} diff --git a/bun.lockb b/bun.lockb index 2f4ef474..c221be6e 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/theme-provider.tsx b/components/theme-provider.tsx index 8fc948f5..34f3e70f 100644 --- a/components/theme-provider.tsx +++ b/components/theme-provider.tsx @@ -7,7 +7,7 @@ import { type ThemeProviderProps } from "next-themes/dist/types" const ThemeProvider = ({ children, ...props }: ThemeProviderProps) => { return ( - + {children} ) diff --git a/components/ui/dropdown.tsx b/components/ui/dropdown.tsx index cb801d56..eb8997b2 100644 --- a/components/ui/dropdown.tsx +++ b/components/ui/dropdown.tsx @@ -114,7 +114,7 @@ const DropdownItemDetails = ({ label, description, classNames, ...props }: Dropd const { slot, children, title, ...restProps } = props return ( -
+
{label && ( setTimeout(resolve, number)) } +export function getSiteName(url: string): string { + return url.replace(/^(https?:\/\/)?(www\.)?/, "").split(".")[0] +} + export function extractAndFormat(url: string): string { const match = url.match(/\/([^/]+)\.html/) if (match) { diff --git a/resources/types/global.d.ts b/resources/types/global.d.ts index 7c015112..8fd4b4aa 100644 --- a/resources/types/global.d.ts +++ b/resources/types/global.d.ts @@ -2,6 +2,8 @@ import "rehype-pretty-code" declare module "react-syntax-highlighter/dist/esm/styles/prism" +// declare module "tailwindcss-motion" + declare module "rehype-pretty-code" { interface Options { theme?: string