ruler-components 0.1.1 → 0.1.2
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/index.d.mts +51 -0
- package/dist/index.d.ts +51 -0
- package/dist/index.js +534 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +498 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +21 -2
- package/AGENTS.md +0 -9
- package/CLAUDE.md +0 -1
- package/app/docs/[slug]/page.tsx +0 -147
- package/app/docs/layout.tsx +0 -26
- package/app/docs/page.tsx +0 -148
- package/app/favicon.ico +0 -0
- package/app/globals.css +0 -168
- package/app/icon.png +0 -0
- package/app/layout.tsx +0 -90
- package/app/opengraph-image.tsx +0 -10
- package/app/page.tsx +0 -34
- package/app/twitter-image.tsx +0 -10
- package/components/docs/accordion-doc-page.tsx +0 -352
- package/components/docs/alert-doc-page.tsx +0 -293
- package/components/docs/allinput-doc-page.tsx +0 -183
- package/components/docs/avatar-doc-page.tsx +0 -424
- package/components/docs/badge-doc-page.tsx +0 -363
- package/components/docs/button-doc-page.tsx +0 -406
- package/components/docs/card-doc-page.tsx +0 -364
- package/components/docs/checkbox-doc-page.tsx +0 -277
- package/components/docs/colors-doc-page.tsx +0 -430
- package/components/docs/dialog-doc-page.tsx +0 -364
- package/components/docs/docs-footer.tsx +0 -11
- package/components/docs/docs-mobile-menu-bar.tsx +0 -22
- package/components/docs/docs-mobile-nav-context.tsx +0 -27
- package/components/docs/docs-page.tsx +0 -263
- package/components/docs/docs-search.tsx +0 -303
- package/components/docs/docs-sidebar.tsx +0 -165
- package/components/docs/docs-topbar.tsx +0 -32
- package/components/docs/dropdown-doc-page.tsx +0 -522
- package/components/docs/getting-started-doc-page.tsx +0 -205
- package/components/docs/label-doc-page.tsx +0 -173
- package/components/docs/loaders-doc-page.tsx +0 -244
- package/components/docs/menu-doc-page.tsx +0 -373
- package/components/docs/modal-doc-page.tsx +0 -436
- package/components/docs/next-steps.tsx +0 -53
- package/components/docs/pagination-doc-page.tsx +0 -316
- package/components/docs/progress-doc-page.tsx +0 -387
- package/components/docs/radio-doc-page.tsx +0 -270
- package/components/docs/skeleton-doc-page.tsx +0 -230
- package/components/docs/stepper-doc-page.tsx +0 -309
- package/components/docs/switch-doc-page.tsx +0 -264
- package/components/docs/table-doc-page.tsx +0 -689
- package/components/docs/tabs-doc-page.tsx +0 -359
- package/components/docs/theming-doc-page.tsx +0 -243
- package/components/docs/tooltip-doc-page.tsx +0 -357
- package/components/docs/usage-section.tsx +0 -21
- package/components/icons/discord.tsx +0 -9
- package/components/icons/github.tsx +0 -9
- package/components/icons/x.tsx +0 -9
- package/components/installation-section.tsx +0 -34
- package/components/landing/feature-highlights.tsx +0 -105
- package/components/landing/footer-strip.tsx +0 -45
- package/components/landing/hero-card.tsx +0 -14
- package/components/landing/hero-spotlight.tsx +0 -126
- package/components/landing/hero.tsx +0 -64
- package/components/landing/navbar.tsx +0 -44
- package/components/landing/quick-start-section.tsx +0 -59
- package/components/landing/site-footer.tsx +0 -55
- package/components/theme-provider.tsx +0 -60
- package/components/ui/accordion.tsx +0 -174
- package/components/ui/alert.tsx +0 -103
- package/components/ui/allinput.tsx +0 -210
- package/components/ui/avatar.tsx +0 -179
- package/components/ui/badge.tsx +0 -52
- package/components/ui/button.tsx +0 -75
- package/components/ui/card.tsx +0 -105
- package/components/ui/checkbox.tsx +0 -130
- package/components/ui/code-block.tsx +0 -60
- package/components/ui/data-table.tsx +0 -235
- package/components/ui/dialog.tsx +0 -173
- package/components/ui/dropdown.tsx +0 -78
- package/components/ui/feature-card.tsx +0 -38
- package/components/ui/input.tsx +0 -44
- package/components/ui/label.tsx +0 -110
- package/components/ui/loaders.tsx +0 -139
- package/components/ui/menu.tsx +0 -118
- package/components/ui/modal.tsx +0 -399
- package/components/ui/package-manager-tabs.tsx +0 -40
- package/components/ui/pagination.tsx +0 -200
- package/components/ui/progress.tsx +0 -134
- package/components/ui/radio.tsx +0 -262
- package/components/ui/skeleton.tsx +0 -102
- package/components/ui/steppers.tsx +0 -309
- package/components/ui/switch.tsx +0 -153
- package/components/ui/table.tsx +0 -58
- package/components/ui/tabs.tsx +0 -166
- package/components/ui/theme-toggle.tsx +0 -60
- package/components/ui/tooltip.tsx +0 -238
- package/data/color-palette.ts +0 -35
- package/data/docs-nav.ts +0 -84
- package/eslint.config.mjs +0 -18
- package/index.ts +0 -8
- package/lib/cn.ts +0 -4
- package/lib/color.ts +0 -85
- package/lib/og-image.tsx +0 -138
- package/lib/theme.ts +0 -33
- package/next.config.ts +0 -7
- package/postcss.config.mjs +0 -7
- package/public/dark.png +0 -0
- package/public/dark1.png +0 -0
- package/public/dark2.png +0 -0
- package/public/file.svg +0 -1
- package/public/globe.svg +0 -1
- package/public/light.png +0 -0
- package/public/light1.png +0 -0
- package/public/next.svg +0 -1
- package/public/vercel.svg +0 -1
- package/public/video/hero-demo.mp4 +0 -0
- package/public/window.svg +0 -1
- package/tsconfig.json +0 -34
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { createPortal } from "react-dom";
|
|
5
|
-
import Link from "next/link";
|
|
6
|
-
import { usePathname } from "next/navigation";
|
|
7
|
-
import { ChevronDown, X } from "lucide-react";
|
|
8
|
-
import { cn } from "@/lib/cn";
|
|
9
|
-
import { DOCS_NAV } from "@/data/docs-nav";
|
|
10
|
-
import { useDocsMobileNav } from "@/components/docs/docs-mobile-nav-context";
|
|
11
|
-
|
|
12
|
-
function DocsNavContent({ onNavigate }: { onNavigate?: () => void }) {
|
|
13
|
-
const pathname = usePathname();
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<>
|
|
17
|
-
<nav className="flex flex-col gap-10">
|
|
18
|
-
{DOCS_NAV.map((group) => {
|
|
19
|
-
const GroupIcon = group.items[0]?.icon;
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<div key={group.title} className="relative">
|
|
23
|
-
<div className="relative z-10 mb-2 flex items-center gap-3 px-1">
|
|
24
|
-
<div className="flex h-8 w-8 items-center justify-center rounded-xl bg-black dark:bg-white border border-zinc-200 dark:border-zinc-800 text-white dark:text-black shadow-[0_2px_4px_rgba(0,0,0,0.02)]">
|
|
25
|
-
{GroupIcon && <GroupIcon size={14} />}
|
|
26
|
-
</div>
|
|
27
|
-
<p className="text-[11px] font-bold tracking-[0.15em] text-zinc-400 dark:text-zinc-500 uppercase">
|
|
28
|
-
{group.title}
|
|
29
|
-
</p>
|
|
30
|
-
</div>
|
|
31
|
-
<div className="ml-5 flex flex-col border-l border-zinc-200 dark:border-zinc-800 pl-4 relative -mt-4 pt-4">
|
|
32
|
-
{group.items.map((item) => {
|
|
33
|
-
const href = `/docs${item.slug ? `/${item.slug}` : ""}`;
|
|
34
|
-
const active = pathname === href;
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<Link
|
|
38
|
-
key={item.title}
|
|
39
|
-
href={href}
|
|
40
|
-
onClick={onNavigate}
|
|
41
|
-
className={cn(
|
|
42
|
-
"group relative flex items-center py-2 text-[14px] transition-all duration-500 ease-out",
|
|
43
|
-
active
|
|
44
|
-
? "font-bold text-zinc-900 dark:text-white"
|
|
45
|
-
: "text-zinc-500 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-100"
|
|
46
|
-
)}
|
|
47
|
-
>
|
|
48
|
-
<span
|
|
49
|
-
className={cn(
|
|
50
|
-
"absolute -left-[17.5px] top-1/2 w-[3px] -translate-y-1/2 rounded-full transition-all duration-500 ease-in-out z-20",
|
|
51
|
-
active
|
|
52
|
-
? "h-6 bg-zinc-900 dark:bg-white opacity-100 shadow-[0_0_10px_rgba(0,0,0,0.1)]"
|
|
53
|
-
: "h-0 bg-zinc-400 dark:bg-zinc-600 opacity-0 group-hover:h-3 group-hover:opacity-100"
|
|
54
|
-
)}
|
|
55
|
-
/>
|
|
56
|
-
{item.title}
|
|
57
|
-
</Link>
|
|
58
|
-
);
|
|
59
|
-
})}
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
63
|
-
})}
|
|
64
|
-
</nav>
|
|
65
|
-
|
|
66
|
-
<div className="mt-10 pt-6 border-t border-zinc-100 dark:border-zinc-900">
|
|
67
|
-
<button
|
|
68
|
-
type="button"
|
|
69
|
-
className="group flex w-full items-center justify-between rounded-xl border border-zinc-200 bg-zinc-50/50 px-4 py-2.5 text-xs font-semibold text-zinc-600 transition-all duration-300 hover:bg-zinc-100 dark:border-zinc-800 dark:bg-zinc-900/40 dark:text-zinc-400 dark:hover:bg-zinc-800"
|
|
70
|
-
>
|
|
71
|
-
<span className="flex items-center gap-2">
|
|
72
|
-
<span className="relative flex h-2 w-2">
|
|
73
|
-
<span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
|
|
74
|
-
<span className="relative inline-flex rounded-full h-2 w-2 bg-emerald-500"></span>
|
|
75
|
-
</span>
|
|
76
|
-
v1.0.0
|
|
77
|
-
</span>
|
|
78
|
-
<ChevronDown size={14} className="opacity-40" />
|
|
79
|
-
</button>
|
|
80
|
-
</div>
|
|
81
|
-
</>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function MobileDocsDrawer() {
|
|
86
|
-
const { open, setOpen } = useDocsMobileNav();
|
|
87
|
-
const [mounted, setMounted] = React.useState(false);
|
|
88
|
-
const [visible, setVisible] = React.useState(false);
|
|
89
|
-
|
|
90
|
-
React.useEffect(() => setMounted(true), []);
|
|
91
|
-
|
|
92
|
-
React.useEffect(() => {
|
|
93
|
-
if (!open) {
|
|
94
|
-
setVisible(false);
|
|
95
|
-
document.body.style.overflow = "";
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
document.body.style.overflow = "hidden";
|
|
99
|
-
const frame = requestAnimationFrame(() => setVisible(true));
|
|
100
|
-
return () => {
|
|
101
|
-
cancelAnimationFrame(frame);
|
|
102
|
-
document.body.style.overflow = "";
|
|
103
|
-
};
|
|
104
|
-
}, [open]);
|
|
105
|
-
|
|
106
|
-
React.useEffect(() => {
|
|
107
|
-
if (!open) return;
|
|
108
|
-
const handleKeyDown = (event: KeyboardEvent) => {
|
|
109
|
-
if (event.key === "Escape") setOpen(false);
|
|
110
|
-
};
|
|
111
|
-
window.addEventListener("keydown", handleKeyDown);
|
|
112
|
-
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
113
|
-
}, [open, setOpen]);
|
|
114
|
-
|
|
115
|
-
if (!mounted || !open) return null;
|
|
116
|
-
|
|
117
|
-
return createPortal(
|
|
118
|
-
<div className="fixed inset-0 z-[100] lg:hidden">
|
|
119
|
-
<div
|
|
120
|
-
aria-hidden
|
|
121
|
-
onClick={() => setOpen(false)}
|
|
122
|
-
className={cn(
|
|
123
|
-
"absolute inset-0 bg-zinc-900/45 backdrop-blur-[2px] transition-opacity duration-200 ease-out dark:bg-black/65",
|
|
124
|
-
visible ? "opacity-100" : "opacity-0",
|
|
125
|
-
)}
|
|
126
|
-
/>
|
|
127
|
-
<aside
|
|
128
|
-
role="dialog"
|
|
129
|
-
aria-modal="true"
|
|
130
|
-
aria-label="Component navigation"
|
|
131
|
-
className={cn(
|
|
132
|
-
"absolute inset-y-0 left-0 flex w-72 max-w-[85vw] flex-col bg-white shadow-2xl transition-transform duration-200 ease-out dark:bg-black",
|
|
133
|
-
visible ? "translate-x-0" : "-translate-x-full",
|
|
134
|
-
)}
|
|
135
|
-
>
|
|
136
|
-
<div className="flex shrink-0 items-center justify-between px-6 pb-4 pt-6">
|
|
137
|
-
<p className="text-sm font-bold text-zinc-900 dark:text-white">Components</p>
|
|
138
|
-
<button
|
|
139
|
-
type="button"
|
|
140
|
-
onClick={() => setOpen(false)}
|
|
141
|
-
aria-label="Close navigation menu"
|
|
142
|
-
className="flex h-8 w-8 items-center justify-center rounded-lg text-zinc-400 transition-colors hover:bg-zinc-100 hover:text-zinc-900 dark:hover:bg-zinc-800 dark:hover:text-white"
|
|
143
|
-
>
|
|
144
|
-
<X className="h-4 w-4" />
|
|
145
|
-
</button>
|
|
146
|
-
</div>
|
|
147
|
-
<div className="docs-scrollbar min-h-0 flex-1 overflow-y-auto px-6 pb-6">
|
|
148
|
-
<DocsNavContent onNavigate={() => setOpen(false)} />
|
|
149
|
-
</div>
|
|
150
|
-
</aside>
|
|
151
|
-
</div>,
|
|
152
|
-
document.body,
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export function DocsSidebar() {
|
|
157
|
-
return (
|
|
158
|
-
<>
|
|
159
|
-
<aside className="docs-scrollbar sticky top-16 z-10 hidden h-[calc(100vh-4rem)] w-64 shrink-0 overflow-y-auto border-r border-zinc-200 bg-white px-6 py-8 dark:border-zinc-800 dark:bg-black lg:block">
|
|
160
|
-
<DocsNavContent />
|
|
161
|
-
</aside>
|
|
162
|
-
<MobileDocsDrawer />
|
|
163
|
-
</>
|
|
164
|
-
);
|
|
165
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import Link from "next/link";
|
|
2
|
-
import { GithubIcon } from "@/components/icons/github";
|
|
3
|
-
import { ThemeToggle } from "@/components/ui/theme-toggle";
|
|
4
|
-
import { DocsSearch } from "@/components/docs/docs-search";
|
|
5
|
-
|
|
6
|
-
export function DocsTopbar() {
|
|
7
|
-
return (
|
|
8
|
-
<header className="sticky top-0 z-40 border-b border-zinc-200 bg-white/80 shadow-[0_1px_0_rgba(0,0,0,0.02)] backdrop-blur-md dark:border-zinc-800 dark:bg-zinc-950/80">
|
|
9
|
-
<div className="grid h-16 min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-2 px-3 sm:grid-cols-[1fr_auto_1fr] sm:gap-4 sm:px-6">
|
|
10
|
-
<Link href="/" className="flex min-w-0 items-center gap-2.5 justify-self-start">
|
|
11
|
-
{/* eslint-disable-next-line @next/next/no-img-element */}
|
|
12
|
-
<img src="/light1.png" alt="ruler.ui" className="h-7 w-auto max-w-[7.5rem] object-contain dark:hidden sm:h-8 sm:max-w-none" />
|
|
13
|
-
{/* eslint-disable-next-line @next/next/no-img-element */}
|
|
14
|
-
<img src="/dark2.png" alt="ruler.ui" className="hidden h-7 w-auto max-w-[7.5rem] object-contain dark:block sm:h-8 sm:max-w-none" />
|
|
15
|
-
</Link>
|
|
16
|
-
|
|
17
|
-
<DocsSearch />
|
|
18
|
-
|
|
19
|
-
<div className="flex shrink-0 items-center justify-end gap-2 justify-self-end">
|
|
20
|
-
<Link
|
|
21
|
-
href="#"
|
|
22
|
-
className="hidden items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-sm font-medium text-zinc-600 transition-colors hover:bg-zinc-100 hover:text-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-800/70 dark:hover:text-zinc-100 sm:flex"
|
|
23
|
-
>
|
|
24
|
-
<GithubIcon className="h-4 w-4" />
|
|
25
|
-
GitHub
|
|
26
|
-
</Link>
|
|
27
|
-
<ThemeToggle />
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</header>
|
|
31
|
-
);
|
|
32
|
-
}
|