@leanspec/ui 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/standalone/packages/web/.next/BUILD_ID +1 -1
- package/dist/standalone/packages/web/.next/build-manifest.json +2 -2
- package/dist/standalone/packages/web/.next/prerender-manifest.json +3 -3
- package/dist/standalone/packages/web/.next/server/app/_global-error.html +2 -2
- package/dist/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/app/_not-found.html +2 -2
- package/dist/standalone/packages/web/.next/server/app/_not-found.rsc +2 -2
- package/dist/standalone/packages/web/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/dist/standalone/packages/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/api/projects/[id]/specs/route.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/app/api/projects/route.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/app/api/revalidate/route.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/app/api/specs/[id]/dependency-graph/route.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/app/api/specs/[id]/route.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/app/api/specs/[id]/subspecs/[file]/route.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/app/api/stats/route.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/app/board/page.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/app/board.html +1 -1
- package/dist/standalone/packages/web/.next/server/app/board.rsc +2 -2
- package/dist/standalone/packages/web/.next/server/app/board.segments/_full.segment.rsc +2 -2
- package/dist/standalone/packages/web/.next/server/app/board.segments/_index.segment.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/board.segments/_tree.segment.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/board.segments/board/__PAGE__.segment.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/board.segments/board.segment.rsc +1 -1
- package/dist/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/app/specs/[id]/page.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/app/specs/[id]/page_client-reference-manifest.js +1 -1
- package/dist/standalone/packages/web/.next/server/app/specs/page.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/app/stats/page.js.nft.json +1 -1
- package/dist/standalone/packages/web/.next/server/chunks/[root-of-the-server]__2e0f9179._.js +1 -1
- package/dist/standalone/packages/web/.next/server/chunks/[root-of-the-server]__577d6d08._.js +1 -1
- package/dist/standalone/packages/web/.next/server/chunks/[root-of-the-server]__e54bc4b8._.js +1 -1
- package/dist/standalone/packages/web/.next/server/chunks/[root-of-the-server]__f8978f3e._.js +1 -1
- package/dist/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__be46bb7c._.js +1 -1
- package/dist/standalone/packages/web/.next/server/chunks/ssr/_7dedc302._.js +1 -1
- package/dist/standalone/packages/web/.next/server/chunks/ssr/_ad71cd8c._.js +1 -1
- package/dist/standalone/packages/web/.next/server/chunks/ssr/_c5a5c652._.js +1 -1
- package/dist/standalone/packages/web/.next/server/pages/404.html +2 -2
- package/dist/standalone/packages/web/.next/server/pages/500.html +2 -2
- package/dist/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
- package/dist/standalone/packages/web/.next/server/server-reference-manifest.json +1 -1
- package/dist/{static/chunks/0de258404bcae76f.js → standalone/packages/web/.next/static/chunks/8864b47e107cbe63.js} +1 -1
- package/dist/{static/chunks/09ff02250dd56621.js → standalone/packages/web/.next/static/chunks/a2889ecda42c83e7.js} +1 -1
- package/dist/standalone/packages/web/.next/static/chunks/c22619397bb8368e.js +1 -0
- package/dist/standalone/packages/web/components.json +20 -0
- package/dist/standalone/packages/web/drizzle/0000_reflective_thena.sql +59 -0
- package/dist/standalone/packages/web/drizzle/0001_fresh_carmella_unuscione.sql +1 -0
- package/dist/standalone/packages/web/drizzle/meta/0000_snapshot.json +427 -0
- package/dist/standalone/packages/web/drizzle/meta/0001_snapshot.json +436 -0
- package/dist/standalone/packages/web/drizzle/meta/_journal.json +20 -0
- package/dist/standalone/packages/web/drizzle.config.ts +10 -0
- package/dist/standalone/packages/web/eslint.config.mjs +18 -0
- package/dist/standalone/packages/web/next.config.ts +7 -0
- package/dist/standalone/packages/web/package.json +1 -1
- package/dist/standalone/packages/web/postcss.config.mjs +8 -0
- package/dist/standalone/packages/web/src/app/api/projects/[id]/specs/route.ts +23 -0
- package/dist/standalone/packages/web/src/app/api/projects/route.ts +19 -0
- package/dist/standalone/packages/web/src/app/api/revalidate/route.ts +63 -0
- package/dist/standalone/packages/web/src/app/api/specs/[id]/dependency-graph/route.test.ts +51 -0
- package/dist/standalone/packages/web/src/app/api/specs/[id]/dependency-graph/route.ts +171 -0
- package/dist/standalone/packages/web/src/app/api/specs/[id]/route.ts +36 -0
- package/dist/standalone/packages/web/src/app/api/specs/[id]/subspecs/[file]/route.ts +46 -0
- package/dist/standalone/packages/web/src/app/api/stats/route.ts +19 -0
- package/dist/standalone/packages/web/src/app/board/board-client.tsx +162 -0
- package/dist/standalone/packages/web/src/app/board/loading.tsx +43 -0
- package/dist/standalone/packages/web/src/app/board/page.tsx +18 -0
- package/dist/standalone/packages/web/src/app/dashboard-client.tsx +364 -0
- package/dist/standalone/packages/web/src/app/error.tsx +43 -0
- package/dist/standalone/packages/web/src/app/globals.css +531 -0
- package/dist/standalone/packages/web/src/app/home-client.tsx +277 -0
- package/dist/standalone/packages/web/src/app/layout.tsx +70 -0
- package/dist/standalone/packages/web/src/app/loading.tsx +87 -0
- package/dist/standalone/packages/web/src/app/not-found.tsx +27 -0
- package/dist/standalone/packages/web/src/app/page.tsx +18 -0
- package/dist/standalone/packages/web/src/app/specs/[id]/loading.tsx +5 -0
- package/dist/standalone/packages/web/src/app/specs/[id]/page.tsx +43 -0
- package/dist/standalone/packages/web/src/app/specs/page.tsx +18 -0
- package/dist/standalone/packages/web/src/app/specs/specs-client.tsx +425 -0
- package/dist/standalone/packages/web/src/app/stats/page.tsx +18 -0
- package/dist/standalone/packages/web/src/app/stats/stats-client.tsx +283 -0
- package/dist/standalone/packages/web/src/components/back-to-top.tsx +46 -0
- package/dist/standalone/packages/web/src/components/empty-state.tsx +52 -0
- package/dist/standalone/packages/web/src/components/main-sidebar.tsx +175 -0
- package/dist/standalone/packages/web/src/components/markdown-link.test.ts +96 -0
- package/dist/standalone/packages/web/src/components/markdown-link.tsx +95 -0
- package/dist/standalone/packages/web/src/components/navigation.tsx +210 -0
- package/dist/standalone/packages/web/src/components/priority-badge.tsx +53 -0
- package/dist/standalone/packages/web/src/components/quick-search.tsx +180 -0
- package/dist/standalone/packages/web/src/components/skeletons.tsx +119 -0
- package/dist/standalone/packages/web/src/components/spec-dependency-graph.tsx +369 -0
- package/dist/standalone/packages/web/src/components/spec-detail-client.tsx +372 -0
- package/dist/standalone/packages/web/src/components/spec-detail-loading-shell.tsx +42 -0
- package/dist/standalone/packages/web/src/components/spec-detail-wrapper.tsx +70 -0
- package/dist/standalone/packages/web/src/components/spec-metadata.tsx +136 -0
- package/dist/standalone/packages/web/src/components/spec-sidebar.tsx +127 -0
- package/dist/standalone/packages/web/src/components/spec-timeline.tsx +186 -0
- package/dist/standalone/packages/web/src/components/specs-nav-sidebar.tsx +561 -0
- package/dist/standalone/packages/web/src/components/status-badge.tsx +53 -0
- package/dist/standalone/packages/web/src/components/sub-spec-tabs.tsx +143 -0
- package/dist/standalone/packages/web/src/components/table-of-contents.tsx +130 -0
- package/dist/standalone/packages/web/src/components/theme-provider.tsx +11 -0
- package/dist/standalone/packages/web/src/components/theme-toggle.tsx +37 -0
- package/dist/standalone/packages/web/src/components/ui/avatar.tsx +50 -0
- package/dist/standalone/packages/web/src/components/ui/badge.tsx +36 -0
- package/dist/standalone/packages/web/src/components/ui/breadcrumb.tsx +110 -0
- package/dist/standalone/packages/web/src/components/ui/button.tsx +57 -0
- package/dist/standalone/packages/web/src/components/ui/card.tsx +76 -0
- package/dist/standalone/packages/web/src/components/ui/command.tsx +153 -0
- package/dist/standalone/packages/web/src/components/ui/dialog.tsx +122 -0
- package/dist/standalone/packages/web/src/components/ui/input.tsx +24 -0
- package/dist/standalone/packages/web/src/components/ui/select.tsx +159 -0
- package/dist/standalone/packages/web/src/components/ui/separator.tsx +31 -0
- package/dist/standalone/packages/web/src/components/ui/skeleton.tsx +15 -0
- package/dist/standalone/packages/web/src/components/ui/tabs.tsx +55 -0
- package/dist/standalone/packages/web/src/components/ui/toast.tsx +30 -0
- package/dist/standalone/packages/web/src/components/ui/tooltip.tsx +32 -0
- package/dist/standalone/packages/web/src/lib/date-utils.ts +76 -0
- package/dist/standalone/packages/web/src/lib/db/index.ts +42 -0
- package/dist/standalone/packages/web/src/lib/db/migrate.ts +18 -0
- package/dist/standalone/packages/web/src/lib/db/queries.ts +114 -0
- package/dist/standalone/packages/web/src/lib/db/schema.ts +123 -0
- package/dist/standalone/packages/web/src/lib/db/seed.ts +156 -0
- package/dist/standalone/packages/web/src/lib/db/service-queries.ts +216 -0
- package/dist/standalone/packages/web/src/lib/dependency-graph.ts +105 -0
- package/dist/standalone/packages/web/src/lib/specs/service.ts +120 -0
- package/dist/standalone/packages/web/src/lib/specs/sources/database-source.ts +94 -0
- package/dist/standalone/packages/web/src/lib/specs/sources/filesystem-source.ts +249 -0
- package/dist/standalone/packages/web/src/lib/specs/types.ts +55 -0
- package/dist/standalone/packages/web/src/lib/stores/specs-sidebar-store.ts +152 -0
- package/dist/standalone/packages/web/src/lib/sub-specs.ts +171 -0
- package/dist/standalone/packages/web/src/lib/utils.ts +17 -0
- package/dist/standalone/packages/web/src/types/specs.ts +18 -0
- package/dist/standalone/packages/web/tailwind.config.ts +58 -0
- package/dist/standalone/packages/web/tsconfig.json +34 -0
- package/dist/standalone/packages/web/vitest.config.ts +14 -0
- package/dist/standalone/specs/100-release-process-typecheck-failure/README.md +266 -0
- package/dist/standalone/specs/101-sidebar-scroll-position-drift/README.md +100 -0
- package/package.json +5 -3
- package/dist/BUILD_ID +0 -1
- package/dist/static/chunks/a3e649fcddd3d715.js +0 -1
- /package/dist/{static/Z_BxkB0KJViCNbULN1S5p → standalone/packages/web/.next/static/DDHAmoL_2Poji-whvFjry}/_buildManifest.js +0 -0
- /package/dist/{static/Z_BxkB0KJViCNbULN1S5p → standalone/packages/web/.next/static/DDHAmoL_2Poji-whvFjry}/_clientMiddlewareManifest.json +0 -0
- /package/dist/{static/Z_BxkB0KJViCNbULN1S5p → standalone/packages/web/.next/static/DDHAmoL_2Poji-whvFjry}/_ssgManifest.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/0c19c69aa7625475.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/116800b03245a1e5.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/19e80edf527aef5c.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/2ece90370908f56c.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/36fd2dddb486f6bc.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/5c2072ad938de8ed.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/6577fe797a336bab.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/6a05a93ec8fa7b83.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/7f732ea69e643219.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/a02c1f50ff00204f.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/a45464b9776dd88e.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/a6dad97d9634a72d.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/ae04dcd433be6dab.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/b20313408e970968.css +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/c46095e1a421d93f.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/c48dd4c72d7c5ef4.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/c557ac675be79771.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/dca0c854c59234cd.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/df1731c03abf1aee.css +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/dfd41488ad062cd5.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/ebd89051637b9a47.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/f3ec9fd77a8618b1.js +0 -0
- /package/dist/{static → standalone/packages/web/.next/static}/chunks/turbopack-7450632b40b2e378.js +0 -0
- /package/dist/{public → standalone/packages/web/public}/f864aa7e7061c0600e35cf3d879b27cf.txt +0 -0
- /package/dist/{public → standalone/packages/web/public}/favicon.ico +0 -0
- /package/dist/{public → standalone/packages/web/public}/file.svg +0 -0
- /package/dist/{public → standalone/packages/web/public}/github-mark-white.svg +0 -0
- /package/dist/{public → standalone/packages/web/public}/github-mark.svg +0 -0
- /package/dist/{public → standalone/packages/web/public}/globe.svg +0 -0
- /package/dist/{public → standalone/packages/web/public}/icon.svg +0 -0
- /package/dist/{public → standalone/packages/web/public}/logo-dark-bg.svg +0 -0
- /package/dist/{public → standalone/packages/web/public}/logo-with-bg.svg +0 -0
- /package/dist/{public → standalone/packages/web/public}/logo.svg +0 -0
- /package/dist/{public → standalone/packages/web/public}/next.svg +0 -0
- /package/dist/{public → standalone/packages/web/public}/vercel.svg +0 -0
- /package/dist/{public → standalone/packages/web/public}/window.svg +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sub-spec tabs component for spec detail page
|
|
3
|
+
*/
|
|
4
|
+
'use client';
|
|
5
|
+
|
|
6
|
+
import { useState } from 'react';
|
|
7
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
|
8
|
+
import { Card } from '@/components/ui/card';
|
|
9
|
+
import ReactMarkdown from 'react-markdown';
|
|
10
|
+
import remarkGfm from 'remark-gfm';
|
|
11
|
+
import rehypeHighlight from 'rehype-highlight';
|
|
12
|
+
import { cn } from '@/lib/utils';
|
|
13
|
+
import { FileText, Palette, Code, TestTube, CheckSquare, Wrench, Map, GitBranch, BookOpen } from 'lucide-react';
|
|
14
|
+
|
|
15
|
+
export interface SubSpec {
|
|
16
|
+
name: string;
|
|
17
|
+
file: string;
|
|
18
|
+
iconName: string;
|
|
19
|
+
color: string;
|
|
20
|
+
content: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const ICON_MAP: Record<string, React.ComponentType<{ className?: string }>> = {
|
|
24
|
+
FileText,
|
|
25
|
+
Palette,
|
|
26
|
+
Code,
|
|
27
|
+
TestTube,
|
|
28
|
+
CheckSquare,
|
|
29
|
+
Wrench,
|
|
30
|
+
Map,
|
|
31
|
+
GitBranch,
|
|
32
|
+
BookOpen,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
interface SubSpecTabsProps {
|
|
36
|
+
mainContent: string;
|
|
37
|
+
subSpecs: SubSpec[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function SubSpecTabs({ mainContent, subSpecs }: SubSpecTabsProps) {
|
|
41
|
+
const [activeTab, setActiveTab] = useState('readme');
|
|
42
|
+
|
|
43
|
+
// If no sub-specs, just render main content
|
|
44
|
+
if (subSpecs.length === 0) {
|
|
45
|
+
return (
|
|
46
|
+
<article className="prose prose-slate dark:prose-invert max-w-none">
|
|
47
|
+
<ReactMarkdown
|
|
48
|
+
remarkPlugins={[remarkGfm]}
|
|
49
|
+
rehypePlugins={[rehypeHighlight]}
|
|
50
|
+
>
|
|
51
|
+
{mainContent}
|
|
52
|
+
</ReactMarkdown>
|
|
53
|
+
</article>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Show overview tab listing all sub-specs if there are many
|
|
58
|
+
const showOverview = subSpecs.length > 0;
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div className="space-y-4">
|
|
62
|
+
{showOverview && activeTab === 'readme' && subSpecs.length > 2 && (
|
|
63
|
+
<Card className="p-4 bg-muted/50 border-l-4 border-l-primary">
|
|
64
|
+
<div className="flex items-start gap-3">
|
|
65
|
+
<BookOpen className="h-5 w-5 text-primary mt-0.5" />
|
|
66
|
+
<div>
|
|
67
|
+
<h4 className="font-semibold text-sm mb-2">This spec has multiple sections</h4>
|
|
68
|
+
<p className="text-sm text-muted-foreground mb-3">
|
|
69
|
+
Use the tabs below to navigate between the main overview and detailed sections:
|
|
70
|
+
</p>
|
|
71
|
+
<div className="grid grid-cols-1 sm:grid-cols-2 gap-2">
|
|
72
|
+
{subSpecs.map((subSpec) => {
|
|
73
|
+
const Icon = ICON_MAP[subSpec.iconName];
|
|
74
|
+
return (
|
|
75
|
+
<button
|
|
76
|
+
key={subSpec.file}
|
|
77
|
+
onClick={() => setActiveTab(subSpec.name.toLowerCase())}
|
|
78
|
+
className="flex items-center gap-2 p-2 text-left hover:bg-accent rounded-md transition-colors text-sm"
|
|
79
|
+
>
|
|
80
|
+
{Icon && <Icon className={cn("h-4 w-4", subSpec.color)} />}
|
|
81
|
+
<span className="font-medium">{subSpec.name}</span>
|
|
82
|
+
</button>
|
|
83
|
+
);
|
|
84
|
+
})}
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</Card>
|
|
89
|
+
)}
|
|
90
|
+
|
|
91
|
+
<Tabs value={activeTab} onValueChange={setActiveTab} className="w-full">
|
|
92
|
+
<div className="border-b mb-6">
|
|
93
|
+
<TabsList className="h-auto p-0 bg-transparent w-full justify-start">
|
|
94
|
+
<TabsTrigger
|
|
95
|
+
value="readme"
|
|
96
|
+
className="flex items-center gap-2 data-[state=active]:border-b-2 data-[state=active]:border-primary rounded-none px-4 py-3"
|
|
97
|
+
>
|
|
98
|
+
<FileText className="h-4 w-4" />
|
|
99
|
+
Overview
|
|
100
|
+
</TabsTrigger>
|
|
101
|
+
{subSpecs.map((subSpec) => {
|
|
102
|
+
const Icon = ICON_MAP[subSpec.iconName];
|
|
103
|
+
return (
|
|
104
|
+
<TabsTrigger
|
|
105
|
+
key={subSpec.file}
|
|
106
|
+
value={subSpec.name.toLowerCase()}
|
|
107
|
+
className="flex items-center gap-2 data-[state=active]:border-b-2 data-[state=active]:border-primary rounded-none px-4 py-3"
|
|
108
|
+
>
|
|
109
|
+
{Icon && <Icon className={cn("h-4 w-4", subSpec.color)} />}
|
|
110
|
+
{subSpec.name}
|
|
111
|
+
</TabsTrigger>
|
|
112
|
+
);
|
|
113
|
+
})}
|
|
114
|
+
</TabsList>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<TabsContent value="readme" className="mt-0">
|
|
118
|
+
<article className="prose prose-slate dark:prose-invert max-w-none">
|
|
119
|
+
<ReactMarkdown
|
|
120
|
+
remarkPlugins={[remarkGfm]}
|
|
121
|
+
rehypePlugins={[rehypeHighlight]}
|
|
122
|
+
>
|
|
123
|
+
{mainContent}
|
|
124
|
+
</ReactMarkdown>
|
|
125
|
+
</article>
|
|
126
|
+
</TabsContent>
|
|
127
|
+
|
|
128
|
+
{subSpecs.map((subSpec) => (
|
|
129
|
+
<TabsContent key={subSpec.file} value={subSpec.name.toLowerCase()} className="mt-0">
|
|
130
|
+
<article className="prose prose-slate dark:prose-invert max-w-none">
|
|
131
|
+
<ReactMarkdown
|
|
132
|
+
remarkPlugins={[remarkGfm]}
|
|
133
|
+
rehypePlugins={[rehypeHighlight]}
|
|
134
|
+
>
|
|
135
|
+
{subSpec.content}
|
|
136
|
+
</ReactMarkdown>
|
|
137
|
+
</article>
|
|
138
|
+
</TabsContent>
|
|
139
|
+
))}
|
|
140
|
+
</Tabs>
|
|
141
|
+
</div>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Button } from '@/components/ui/button';
|
|
5
|
+
import {
|
|
6
|
+
Dialog,
|
|
7
|
+
DialogContent,
|
|
8
|
+
DialogHeader,
|
|
9
|
+
DialogTitle,
|
|
10
|
+
DialogTrigger,
|
|
11
|
+
} from '@/components/ui/dialog';
|
|
12
|
+
import { List, ChevronRight } from 'lucide-react';
|
|
13
|
+
import GithubSlugger from 'github-slugger';
|
|
14
|
+
import { cn } from '@/lib/utils';
|
|
15
|
+
|
|
16
|
+
interface TOCItem {
|
|
17
|
+
id: string;
|
|
18
|
+
text: string;
|
|
19
|
+
level: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface TableOfContentsProps {
|
|
23
|
+
content: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Extract headings from markdown content
|
|
28
|
+
*/
|
|
29
|
+
function extractHeadings(markdown: string): TOCItem[] {
|
|
30
|
+
if (!markdown) return [];
|
|
31
|
+
|
|
32
|
+
const headings: TOCItem[] = [];
|
|
33
|
+
const lines = markdown.split('\n');
|
|
34
|
+
let inCodeBlock = false;
|
|
35
|
+
const slugger = new GithubSlugger();
|
|
36
|
+
|
|
37
|
+
for (const line of lines) {
|
|
38
|
+
// Track code blocks
|
|
39
|
+
if (line.trim().startsWith('```')) {
|
|
40
|
+
inCodeBlock = !inCodeBlock;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Skip lines inside code blocks
|
|
45
|
+
if (inCodeBlock) continue;
|
|
46
|
+
|
|
47
|
+
// Match headings (## Heading or ### Heading, skip # H1)
|
|
48
|
+
const match = line.match(/^(#{2,6})\s+(.+)$/);
|
|
49
|
+
if (match) {
|
|
50
|
+
const level = match[1].length;
|
|
51
|
+
const text = match[2].trim();
|
|
52
|
+
const id = slugger.slug(text);
|
|
53
|
+
|
|
54
|
+
headings.push({ id, text, level });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return headings;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function TableOfContents({ content }: TableOfContentsProps) {
|
|
62
|
+
const [open, setOpen] = React.useState(false);
|
|
63
|
+
const headings = React.useMemo(() => extractHeadings(content), [content]);
|
|
64
|
+
|
|
65
|
+
// If no headings, don't render
|
|
66
|
+
if (headings.length === 0) return null;
|
|
67
|
+
|
|
68
|
+
const handleHeadingClick = (id: string) => {
|
|
69
|
+
setOpen(false);
|
|
70
|
+
// Small delay to allow dialog to close before scrolling
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
const element = document.getElementById(id);
|
|
73
|
+
if (element) {
|
|
74
|
+
// Scroll with offset for sticky header (top navbar + spec header)
|
|
75
|
+
const headerOffset = 180; // Adjust based on your header height
|
|
76
|
+
const elementPosition = element.getBoundingClientRect().top;
|
|
77
|
+
const offsetPosition = elementPosition + window.pageYOffset - headerOffset;
|
|
78
|
+
|
|
79
|
+
window.scrollTo({
|
|
80
|
+
top: offsetPosition,
|
|
81
|
+
behavior: 'smooth'
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
if (window.history.replaceState) {
|
|
85
|
+
window.history.replaceState(null, '', `#${id}`);
|
|
86
|
+
} else {
|
|
87
|
+
window.location.hash = id;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}, 100);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
95
|
+
<DialogTrigger asChild>
|
|
96
|
+
<Button
|
|
97
|
+
size="icon"
|
|
98
|
+
className="fixed bottom-24 right-6 h-12 w-12 rounded-full shadow-lg z-40 hover:scale-110 transition-transform"
|
|
99
|
+
aria-label="Table of contents"
|
|
100
|
+
>
|
|
101
|
+
<List className="h-5 w-5" />
|
|
102
|
+
</Button>
|
|
103
|
+
</DialogTrigger>
|
|
104
|
+
<DialogContent className="max-w-md max-h-[80vh] overflow-y-auto">
|
|
105
|
+
<DialogHeader>
|
|
106
|
+
<DialogTitle>Table of Contents</DialogTitle>
|
|
107
|
+
</DialogHeader>
|
|
108
|
+
<nav className="space-y-1">
|
|
109
|
+
{headings.map((heading, index) => (
|
|
110
|
+
<button
|
|
111
|
+
key={`${heading.id}-${index}`}
|
|
112
|
+
onClick={() => handleHeadingClick(heading.id)}
|
|
113
|
+
className={cn(
|
|
114
|
+
'w-full text-left px-2 py-1.5 text-sm rounded-md hover:bg-muted transition-colors flex items-start gap-2 group',
|
|
115
|
+
heading.level === 2 && 'font-medium',
|
|
116
|
+
heading.level === 3 && 'pl-6',
|
|
117
|
+
heading.level === 4 && 'pl-10',
|
|
118
|
+
heading.level === 5 && 'pl-14',
|
|
119
|
+
heading.level === 6 && 'pl-18'
|
|
120
|
+
)}
|
|
121
|
+
>
|
|
122
|
+
<ChevronRight className="h-4 w-4 mt-0.5 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity" />
|
|
123
|
+
<span className="flex-1">{heading.text}</span>
|
|
124
|
+
</button>
|
|
125
|
+
))}
|
|
126
|
+
</nav>
|
|
127
|
+
</DialogContent>
|
|
128
|
+
</Dialog>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { ThemeProvider as NextThemesProvider } from "next-themes"
|
|
5
|
+
|
|
6
|
+
export function ThemeProvider({
|
|
7
|
+
children,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof NextThemesProvider>) {
|
|
10
|
+
return <NextThemesProvider {...props}>{children}</NextThemesProvider>
|
|
11
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Moon, Sun } from "lucide-react"
|
|
5
|
+
import { useTheme } from "next-themes"
|
|
6
|
+
|
|
7
|
+
import { Button } from "@/components/ui/button"
|
|
8
|
+
|
|
9
|
+
export function ThemeToggle() {
|
|
10
|
+
const { theme, setTheme } = useTheme()
|
|
11
|
+
const [mounted, setMounted] = React.useState(false)
|
|
12
|
+
|
|
13
|
+
// useEffect only runs on the client, so now we can safely show the UI
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
setMounted(true)
|
|
16
|
+
}, [])
|
|
17
|
+
|
|
18
|
+
if (!mounted) {
|
|
19
|
+
return (
|
|
20
|
+
<Button variant="ghost" size="icon" disabled aria-label="Toggle theme">
|
|
21
|
+
<Sun className="h-5 w-5" />
|
|
22
|
+
</Button>
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Button
|
|
28
|
+
variant="ghost"
|
|
29
|
+
size="icon"
|
|
30
|
+
onClick={() => setTheme(theme === "light" ? "dark" : "light")}
|
|
31
|
+
aria-label="Toggle theme"
|
|
32
|
+
>
|
|
33
|
+
<Sun className="h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
|
|
34
|
+
<Moon className="absolute h-5 w-5 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
|
|
35
|
+
</Button>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
const Avatar = React.forwardRef<
|
|
9
|
+
React.ElementRef<typeof AvatarPrimitive.Root>,
|
|
10
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
|
|
11
|
+
>(({ className, ...props }, ref) => (
|
|
12
|
+
<AvatarPrimitive.Root
|
|
13
|
+
ref={ref}
|
|
14
|
+
className={cn(
|
|
15
|
+
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
|
|
16
|
+
className
|
|
17
|
+
)}
|
|
18
|
+
{...props}
|
|
19
|
+
/>
|
|
20
|
+
))
|
|
21
|
+
Avatar.displayName = AvatarPrimitive.Root.displayName
|
|
22
|
+
|
|
23
|
+
const AvatarImage = React.forwardRef<
|
|
24
|
+
React.ElementRef<typeof AvatarPrimitive.Image>,
|
|
25
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
|
|
26
|
+
>(({ className, ...props }, ref) => (
|
|
27
|
+
<AvatarPrimitive.Image
|
|
28
|
+
ref={ref}
|
|
29
|
+
className={cn("aspect-square h-full w-full", className)}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
))
|
|
33
|
+
AvatarImage.displayName = AvatarPrimitive.Image.displayName
|
|
34
|
+
|
|
35
|
+
const AvatarFallback = React.forwardRef<
|
|
36
|
+
React.ElementRef<typeof AvatarPrimitive.Fallback>,
|
|
37
|
+
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
|
|
38
|
+
>(({ className, ...props }, ref) => (
|
|
39
|
+
<AvatarPrimitive.Fallback
|
|
40
|
+
ref={ref}
|
|
41
|
+
className={cn(
|
|
42
|
+
"flex h-full w-full items-center justify-center rounded-full bg-muted",
|
|
43
|
+
className
|
|
44
|
+
)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
))
|
|
48
|
+
AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName
|
|
49
|
+
|
|
50
|
+
export { Avatar, AvatarImage, AvatarFallback }
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
const badgeVariants = cva(
|
|
7
|
+
"inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default:
|
|
12
|
+
"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",
|
|
13
|
+
secondary:
|
|
14
|
+
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
15
|
+
destructive:
|
|
16
|
+
"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",
|
|
17
|
+
outline: "text-foreground",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
variant: "default",
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
export interface BadgeProps
|
|
27
|
+
extends React.HTMLAttributes<HTMLDivElement>,
|
|
28
|
+
VariantProps<typeof badgeVariants> {}
|
|
29
|
+
|
|
30
|
+
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
31
|
+
return (
|
|
32
|
+
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { Badge, badgeVariants }
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { ChevronRight, MoreHorizontal } from "lucide-react"
|
|
3
|
+
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
|
+
|
|
6
|
+
const Breadcrumb = React.forwardRef<
|
|
7
|
+
HTMLElement,
|
|
8
|
+
React.ComponentPropsWithoutRef<"nav"> & {
|
|
9
|
+
separator?: React.ReactNode
|
|
10
|
+
}
|
|
11
|
+
>(({ ...props }, ref) => <nav ref={ref} aria-label="breadcrumb" {...props} />)
|
|
12
|
+
Breadcrumb.displayName = "Breadcrumb"
|
|
13
|
+
|
|
14
|
+
const BreadcrumbList = React.forwardRef<
|
|
15
|
+
HTMLOListElement,
|
|
16
|
+
React.ComponentPropsWithoutRef<"ol">
|
|
17
|
+
>(({ className, ...props }, ref) => (
|
|
18
|
+
<ol
|
|
19
|
+
ref={ref}
|
|
20
|
+
className={cn(
|
|
21
|
+
"flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",
|
|
22
|
+
className
|
|
23
|
+
)}
|
|
24
|
+
{...props}
|
|
25
|
+
/>
|
|
26
|
+
))
|
|
27
|
+
BreadcrumbList.displayName = "BreadcrumbList"
|
|
28
|
+
|
|
29
|
+
const BreadcrumbItem = React.forwardRef<
|
|
30
|
+
HTMLLIElement,
|
|
31
|
+
React.ComponentPropsWithoutRef<"li">
|
|
32
|
+
>(({ className, ...props }, ref) => (
|
|
33
|
+
<li
|
|
34
|
+
ref={ref}
|
|
35
|
+
className={cn("inline-flex items-center gap-1.5", className)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
))
|
|
39
|
+
BreadcrumbItem.displayName = "BreadcrumbItem"
|
|
40
|
+
|
|
41
|
+
const BreadcrumbLink = React.forwardRef<
|
|
42
|
+
HTMLAnchorElement,
|
|
43
|
+
React.ComponentPropsWithoutRef<"a"> & {
|
|
44
|
+
asChild?: boolean
|
|
45
|
+
}
|
|
46
|
+
>(({ className, ...props }, ref) => (
|
|
47
|
+
<a
|
|
48
|
+
ref={ref}
|
|
49
|
+
className={cn("transition-colors hover:text-foreground", className)}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
))
|
|
53
|
+
BreadcrumbLink.displayName = "BreadcrumbLink"
|
|
54
|
+
|
|
55
|
+
const BreadcrumbPage = React.forwardRef<
|
|
56
|
+
HTMLSpanElement,
|
|
57
|
+
React.ComponentPropsWithoutRef<"span">
|
|
58
|
+
>(({ className, ...props }, ref) => (
|
|
59
|
+
<span
|
|
60
|
+
ref={ref}
|
|
61
|
+
role="link"
|
|
62
|
+
aria-disabled="true"
|
|
63
|
+
aria-current="page"
|
|
64
|
+
className={cn("font-normal text-foreground", className)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
))
|
|
68
|
+
BreadcrumbPage.displayName = "BreadcrumbPage"
|
|
69
|
+
|
|
70
|
+
const BreadcrumbSeparator = ({
|
|
71
|
+
children,
|
|
72
|
+
className,
|
|
73
|
+
...props
|
|
74
|
+
}: React.ComponentProps<"li">) => (
|
|
75
|
+
<li
|
|
76
|
+
role="presentation"
|
|
77
|
+
aria-hidden="true"
|
|
78
|
+
className={cn("[&>svg]:w-3.5 [&>svg]:h-3.5", className)}
|
|
79
|
+
{...props}
|
|
80
|
+
>
|
|
81
|
+
{children ?? <ChevronRight />}
|
|
82
|
+
</li>
|
|
83
|
+
)
|
|
84
|
+
BreadcrumbSeparator.displayName = "BreadcrumbSeparator"
|
|
85
|
+
|
|
86
|
+
const BreadcrumbEllipsis = ({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: React.ComponentProps<"span">) => (
|
|
90
|
+
<span
|
|
91
|
+
role="presentation"
|
|
92
|
+
aria-hidden="true"
|
|
93
|
+
className={cn("flex h-9 w-9 items-center justify-center", className)}
|
|
94
|
+
{...props}
|
|
95
|
+
>
|
|
96
|
+
<MoreHorizontal className="h-4 w-4" />
|
|
97
|
+
<span className="sr-only">More</span>
|
|
98
|
+
</span>
|
|
99
|
+
)
|
|
100
|
+
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis"
|
|
101
|
+
|
|
102
|
+
export {
|
|
103
|
+
Breadcrumb,
|
|
104
|
+
BreadcrumbList,
|
|
105
|
+
BreadcrumbItem,
|
|
106
|
+
BreadcrumbLink,
|
|
107
|
+
BreadcrumbPage,
|
|
108
|
+
BreadcrumbSeparator,
|
|
109
|
+
BreadcrumbEllipsis,
|
|
110
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
+
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
6
|
+
|
|
7
|
+
const buttonVariants = cva(
|
|
8
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default:
|
|
13
|
+
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
14
|
+
destructive:
|
|
15
|
+
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
16
|
+
outline:
|
|
17
|
+
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
18
|
+
secondary:
|
|
19
|
+
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
20
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
21
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
22
|
+
},
|
|
23
|
+
size: {
|
|
24
|
+
default: "h-9 px-4 py-2",
|
|
25
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
26
|
+
lg: "h-10 rounded-md px-8",
|
|
27
|
+
icon: "h-9 w-9",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
variant: "default",
|
|
32
|
+
size: "default",
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
export interface ButtonProps
|
|
38
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
39
|
+
VariantProps<typeof buttonVariants> {
|
|
40
|
+
asChild?: boolean
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
44
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
45
|
+
const Comp = asChild ? Slot : "button"
|
|
46
|
+
return (
|
|
47
|
+
<Comp
|
|
48
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
49
|
+
ref={ref}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
Button.displayName = "Button"
|
|
56
|
+
|
|
57
|
+
export { Button, buttonVariants }
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
|
|
3
|
+
import { cn } from "@/lib/utils"
|
|
4
|
+
|
|
5
|
+
const Card = React.forwardRef<
|
|
6
|
+
HTMLDivElement,
|
|
7
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
8
|
+
>(({ className, ...props }, ref) => (
|
|
9
|
+
<div
|
|
10
|
+
ref={ref}
|
|
11
|
+
className={cn(
|
|
12
|
+
"rounded-xl border border-gray-200 dark:border-gray-800 bg-card text-card-foreground shadow",
|
|
13
|
+
className
|
|
14
|
+
)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
))
|
|
18
|
+
Card.displayName = "Card"
|
|
19
|
+
|
|
20
|
+
const CardHeader = React.forwardRef<
|
|
21
|
+
HTMLDivElement,
|
|
22
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
23
|
+
>(({ className, ...props }, ref) => (
|
|
24
|
+
<div
|
|
25
|
+
ref={ref}
|
|
26
|
+
className={cn("flex flex-col space-y-1.5 p-6", className)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
))
|
|
30
|
+
CardHeader.displayName = "CardHeader"
|
|
31
|
+
|
|
32
|
+
const CardTitle = React.forwardRef<
|
|
33
|
+
HTMLDivElement,
|
|
34
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
35
|
+
>(({ className, ...props }, ref) => (
|
|
36
|
+
<div
|
|
37
|
+
ref={ref}
|
|
38
|
+
className={cn("font-semibold leading-none tracking-tight", className)}
|
|
39
|
+
{...props}
|
|
40
|
+
/>
|
|
41
|
+
))
|
|
42
|
+
CardTitle.displayName = "CardTitle"
|
|
43
|
+
|
|
44
|
+
const CardDescription = React.forwardRef<
|
|
45
|
+
HTMLDivElement,
|
|
46
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
47
|
+
>(({ className, ...props }, ref) => (
|
|
48
|
+
<div
|
|
49
|
+
ref={ref}
|
|
50
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
))
|
|
54
|
+
CardDescription.displayName = "CardDescription"
|
|
55
|
+
|
|
56
|
+
const CardContent = React.forwardRef<
|
|
57
|
+
HTMLDivElement,
|
|
58
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
59
|
+
>(({ className, ...props }, ref) => (
|
|
60
|
+
<div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
|
|
61
|
+
))
|
|
62
|
+
CardContent.displayName = "CardContent"
|
|
63
|
+
|
|
64
|
+
const CardFooter = React.forwardRef<
|
|
65
|
+
HTMLDivElement,
|
|
66
|
+
React.HTMLAttributes<HTMLDivElement>
|
|
67
|
+
>(({ className, ...props }, ref) => (
|
|
68
|
+
<div
|
|
69
|
+
ref={ref}
|
|
70
|
+
className={cn("flex items-center p-6 pt-0", className)}
|
|
71
|
+
{...props}
|
|
72
|
+
/>
|
|
73
|
+
))
|
|
74
|
+
CardFooter.displayName = "CardFooter"
|
|
75
|
+
|
|
76
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }
|