Skip to content

Commit 23e3587

Browse files
authored
fix: few issues in kit and web (#232)
1 parent c6c6983 commit 23e3587

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+766
-73
lines changed

apps/gallery/.source/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// @ts-nocheck -- skip type checking
2+
import * as entries_1 from "../content/entries/popover/klingai/popover-auto-open.mdx?collection=entries&hash=1757647098250"
3+
import * as entries_0 from "../content/entries/carousel/klingai/carousel-auto-play.mdx?collection=entries&hash=1757647098250"
4+
import * as pages_1 from "../content/pages/privacy-policy.mdx?collection=pages&hash=1757647098250"
5+
import * as pages_0 from "../content/pages/disclaimer.mdx?collection=pages&hash=1757647098250"
6+
import { _runtime } from "fumadocs-mdx"
7+
import * as _source from "../source.config"
8+
export const docs = _runtime.docs<typeof _source.docs>([], [])
9+
export const entries = _runtime.docs<typeof _source.entries>([{ info: {"path":"carousel/klingai/carousel-auto-play.mdx","absolutePath":"/Users/thedaviddias/Projects/ux-patterns-for-developers/apps/gallery/content/entries/carousel/klingai/carousel-auto-play.mdx"}, data: entries_0 }, { info: {"path":"popover/klingai/popover-auto-open.mdx","absolutePath":"/Users/thedaviddias/Projects/ux-patterns-for-developers/apps/gallery/content/entries/popover/klingai/popover-auto-open.mdx"}, data: entries_1 }], [])
10+
export const pages = _runtime.docs<typeof _source.pages>([{ info: {"path":"disclaimer.mdx","absolutePath":"/Users/thedaviddias/Projects/ux-patterns-for-developers/apps/gallery/content/pages/disclaimer.mdx"}, data: pages_0 }, { info: {"path":"privacy-policy.mdx","absolutePath":"/Users/thedaviddias/Projects/ux-patterns-for-developers/apps/gallery/content/pages/privacy-policy.mdx"}, data: pages_1 }], [])

apps/kit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# UP Kit
1+
# UX Patterns Kit
22

33
A component registry for UX patterns and UI components, compatible with shadcn/ui CLI.
44

apps/kit/app/(home)/page.tsx

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
JsonLd,
33
StructuredDataGenerator,
44
} from "@ux-patterns/seo/structured-data";
5-
import { Badge } from "@ux-patterns/ui/components/shadcn/badge";
5+
66
import { Button } from "@ux-patterns/ui/components/shadcn/button";
77
import {
88
Card,
@@ -15,14 +15,14 @@ import {
1515
BookOpen,
1616
Code,
1717
Globe,
18-
Palette,
1918
Shield,
2019
Smartphone,
2120
Zap,
2221
} from "lucide-react";
2322
import type { Metadata } from "next";
2423
import Link from "next/link";
2524
import { NewsletterForm } from "@/components/newsletter";
25+
import Hero from "@/components/sections/hero";
2626
import { siteConfig } from "@/lib/site.config";
2727

2828
export const metadata: Metadata = {
@@ -74,56 +74,12 @@ export default function HomePage() {
7474
))}
7575
<main className="flex flex-1 flex-col">
7676
{/* Hero Section */}
77-
<section className="container mx-auto px-4 py-16 md:py-24 text-center">
78-
<div className="max-w-4xl mx-auto">
79-
<Badge variant="secondary" className="mb-6">
80-
Copy & Paste Ready
81-
</Badge>
82-
<h1 className="text-4xl md:text-6xl font-bold mb-6 bg-gradient-to-r from-neutral-900 to-neutral-600 dark:from-neutral-100 dark:to-neutral-400 bg-clip-text text-transparent">
83-
UP Kit
84-
</h1>
85-
<p className="text-xl md:text-2xl text-muted-foreground mb-8 max-w-3xl mx-auto">
86-
Ship better UX than most design teams. Without the meetings.
87-
Production-ready components with all the UX decisions already
88-
made. Every pattern, animation, and interaction battle-tested.
89-
Copy the excellence, skip the committees.
90-
</p>
91-
<div className="flex flex-col sm:flex-row gap-4 justify-center mb-12">
92-
<Button asChild size="lg">
93-
<Link href="/docs">
94-
Get Started <ArrowRight className="h-4 w-4" />
95-
</Link>
96-
</Button>
97-
<Button variant="outline" size="lg" asChild>
98-
<Link href="/docs/components/button">View Components</Link>
99-
</Button>
100-
<Button variant="ghost" size="lg" asChild>
101-
<Link href="https://uxpatterns.dev">
102-
Learn the Patterns <ArrowRight className="h-4 w-4" />
103-
</Link>
104-
</Button>
105-
</div>
106-
<div className="flex flex-wrap justify-center gap-6 text-sm text-muted-foreground">
107-
<div className="flex items-center gap-2">
108-
<Code className="h-4 w-4" />
109-
<span>React + TypeScript</span>
110-
</div>
111-
<div className="flex items-center gap-2">
112-
<Palette className="h-4 w-4" />
113-
<span>Tailwind CSS</span>
114-
</div>
115-
<div className="flex items-center gap-2">
116-
<Shield className="h-4 w-4" />
117-
<span>WCAG 2.2 Compliant</span>
118-
</div>
119-
</div>
120-
</div>
121-
</section>
77+
<Hero />
12278

12379
{/* Features Section */}
12480
<section className="container mx-auto px-4 py-16">
12581
<div className="text-center mb-12">
126-
<h2 className="text-3xl md:text-4xl font-bold mb-4">
82+
<h2 className="text-3xl md:text-4xl font-bold mb-4 leading-[1.2] tracking-tighter">
12783
Everything you need to build great UX
12884
</h2>
12985
<p className="text-xl text-muted-foreground max-w-2xl mx-auto">

apps/kit/app/changelog/page.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import type { Metadata } from "next";
12
import { useMemo } from "react";
3+
import { metadataSEO } from "@/app/metadata";
24
import { source } from "@/lib/source";
35
import { formatDate } from "@/utils/date";
46

@@ -102,3 +104,22 @@ export default function ChangelogPage() {
102104
</div>
103105
);
104106
}
107+
108+
export const metadata: Metadata = {
109+
...metadataSEO,
110+
title: "Changelog",
111+
description: "Latest updates and changes to UP Kit components and features.",
112+
openGraph: {
113+
...metadataSEO.openGraph,
114+
title: "Changelog",
115+
description:
116+
"Latest updates and changes to UP Kit components and features.",
117+
url: "https://kit.uxpatterns.dev/changelog",
118+
},
119+
twitter: {
120+
...metadataSEO.twitter,
121+
title: "Changelog",
122+
description:
123+
"Latest updates and changes to UP Kit components and features.",
124+
},
125+
};

apps/kit/app/docs/[[...slug]]/page.tsx

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from "fumadocs-ui/page";
99
import type { Metadata } from "next";
1010
import { notFound } from "next/navigation";
11+
import { metadataSEO } from "@/app/metadata";
1112
import { LLMCopyButton, ViewOptions } from "@/components/page-actions";
1213
import { source } from "@/lib/source";
1314
import { getMDXComponents } from "@/mdx-components";
@@ -53,8 +54,25 @@ export async function generateMetadata(
5354
const page = source.getPage(params.slug);
5455
if (!page) notFound();
5556

57+
const title = page.data.title || "Documentation";
58+
const description =
59+
page.data.description || "UP Kit documentation and component guides.";
60+
const url = `https://kit.uxpatterns.dev/docs/${params.slug?.join("/") || ""}`;
61+
5662
return {
57-
title: page.data.title,
58-
description: page.data.description,
63+
...metadataSEO,
64+
title,
65+
description,
66+
openGraph: {
67+
...metadataSEO.openGraph,
68+
title,
69+
description,
70+
url,
71+
},
72+
twitter: {
73+
...metadataSEO.twitter,
74+
title,
75+
description,
76+
},
5977
};
6078
}

apps/kit/app/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@plugin 'tailwindcss-animate';
66
@plugin "tailwindcss-motion";
77

8-
@source '../node_modules/fumadocs-ui/dist/**/*.js';
8+
/* @source '../node_modules/fumadocs-ui/dist*.js'; */
99
@source '../../../__registry__/**/*.{js,ts,tsx}';
1010
@source '../../../packages/registry/registry/default/**/*.{js,ts,tsx}';
1111
@source '../../../packages/ui/src/**/*.{js,ts,tsx}';

apps/kit/app/metadata.ts

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import type { Metadata } from "next";
2+
3+
export const metadataSEO: Metadata = {
4+
title: {
5+
absolute: "UP Kit",
6+
template: "%s | UX Patterns Kit",
7+
},
8+
description:
9+
"UP Kit is a React component library that provides a set of reusable components for building web applications with great UX patterns.",
10+
robots: {
11+
index: true,
12+
follow: true,
13+
"max-image-preview": "large",
14+
"max-snippet": -1,
15+
"max-video-preview": -1,
16+
googleBot: "index, follow",
17+
},
18+
keywords: [
19+
"react",
20+
"components",
21+
"ui",
22+
"ux patterns",
23+
"component library",
24+
"typescript",
25+
"tailwind",
26+
"shadcn",
27+
],
28+
creator: "David Dias",
29+
metadataBase: new URL("https://kit.uxpatterns.dev"),
30+
category: "development",
31+
openGraph: {
32+
siteName: "UX Patterns Kit",
33+
type: "website",
34+
locale: "en_US",
35+
title: "UP Kit",
36+
description:
37+
"UP Kit is a React component library that provides a set of reusable components for building web applications with great UX patterns.",
38+
url: "https://kit.uxpatterns.dev",
39+
images: [
40+
{
41+
url: "/og/opengraph-image.png",
42+
width: 1200,
43+
height: 630,
44+
type: "image/png",
45+
},
46+
],
47+
},
48+
twitter: {
49+
card: "summary_large_image",
50+
creator: "@thedaviddias",
51+
site: "@thedaviddias",
52+
images: [
53+
{
54+
url: "/og/opengraph-image.png",
55+
alt: "UP Kit - A React component library for building great UX patterns",
56+
},
57+
],
58+
},
59+
appleWebApp: {
60+
title: "UP Kit",
61+
},
62+
other: {
63+
"msapplication-TileColor": "#fff",
64+
},
65+
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"use client";
2+
3+
import { usePlausible } from "next-plausible";
4+
import { trackFooterClick } from "@/lib/tracking";
5+
6+
export const FooterCopyright = () => {
7+
const plausible = usePlausible();
8+
9+
const handleAuthorClick = () => {
10+
trackFooterClick(plausible, "social", "David Dias");
11+
};
12+
13+
return (
14+
<div className="pt-8 flex justify-between text-sm">
15+
<p>&copy; {new Date().getFullYear()} UX Patterns Kit</p>
16+
<p className="mt-2">
17+
Made with{" "}
18+
<span aria-label="love" role="img">
19+
20+
</span>{" "}
21+
by{" "}
22+
<a
23+
href="https://thedaviddias.com"
24+
target="_blank"
25+
rel="noopener noreferrer"
26+
onClick={handleAuthorClick}
27+
className="font-semibold hover:underline"
28+
>
29+
David Dias
30+
</a>{" "}
31+
for the Open-Source Community.
32+
</p>
33+
</div>
34+
);
35+
};
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
"use client";
2+
3+
import Link from "next/link";
4+
import { usePlausible } from "next-plausible";
5+
import { trackFooterClick } from "@/lib/tracking";
6+
7+
interface FooterLinkProps {
8+
label: string;
9+
path?: string;
10+
shortlink?: string;
11+
rel?: string;
12+
linkType: "general" | "resource" | "social";
13+
}
14+
15+
export const FooterLink = ({
16+
label,
17+
path,
18+
shortlink,
19+
rel,
20+
linkType,
21+
}: FooterLinkProps) => {
22+
const plausible = usePlausible();
23+
24+
const handleClick = () => {
25+
trackFooterClick(plausible, linkType, label);
26+
};
27+
28+
// Merge rel attribute to preserve security tokens for external links
29+
const mergedRel = rel ? `${rel} noopener noreferrer` : undefined;
30+
31+
return (
32+
<Link
33+
href={path || shortlink || "#"}
34+
rel={mergedRel}
35+
onClick={handleClick}
36+
className="text-gray-500 hover:text-gray-900 dark:text-gray-200 dark:hover:text-white hover:underline transition-colors text-sm"
37+
>
38+
{label}
39+
</Link>
40+
);
41+
};

0 commit comments

Comments
 (0)