Skip to content

Commit 708ebc4

Browse files
raspaceeyube01Ashmit72BeEnAyA
authored
Dev (#18)
* fix: github star count, footer font and animation block * fix: reuse component homepage card in mobile screen * fix: reuse component animation * fix: reuse animation timing and ref * fix: type errors in vite and broken links * chore(cli): updated the css file template * fix(cli): website url changed from localhost to radianos * chore(cli): new version v0.1.2 published * perf(website): get-package-info cache set to no-store and removed revalidate * chore: check to see if github stars is being shown * chore: github button implementation updated * chore: implemented the counting animation in github stars button * chore: check to see if github stars is being shown * chore: check to see if github stars is being shown * feat(website): get-early-updates dialog implemented on landing page * style(website): get-early-updates dialog styling changed * chore(website): get-product-updates parameter to open dialog * feat(blog): email-subscribe functionality added to the form * docs: inverted-section and replaced with & * fix: hover and link on animation list component removed * style: copy terminal command toast styles updated * style: website.css heading's letter tracking set to -1% * fix: figma docs update * fix: community card pattern and color update * fix: figma cover image width and cta card pattern width * fix: blur image in dark-mode-playground * fix: usesage of lunk button in alert * style: accordion trigger and chevron gap set for FAQs * fix: figma width * chore: video added * fix: video aspect ratio applied and youtube video link added * fix: youtube embeded link * fix: youtube embed * fix: video embed youtube * fix: video width and beam animation * fix: table hover bg-fill1 and beam alignment * chore: .env.example updated with clarity * fix: add missing border colors in docs and change tab active text color * fix: minor z index issues * chore: fix typography headings * refactor: dark and light image added in reuseable ui blocks component * fix: reuseable float animation removed and image update * fix: homepage home-interactive section height update for small screen * chore(og): og static and dynamic images updated to new * chore(og): static og image updated to new dimension * style: email template background set * fix: base component section image size and badge size * fix: gradient in base component * fix: fix font issue in docs * fix: blocks search icon and add extra block links * fix: svg height * fix: readme file image link updated for website * chore: ibm-plex-sans font import url fixed and global css template for cli updated * chore(cli): released v0.1.3 radianui * style: change search command badge variant * chore: figma-card.tsx and upload.tsx updated * fix: removed gradient in bottom of cta section * fix: correct signup form label id * feat(website): add virtualized list example for combobox * refactor: carousel image refactor * fix: safari browser video * fix: video format changed for safari * fix: video tag updated for safari compatibility * test: debug video issue for safari * test: safari test with simple video implementation * test: safari autoplay * test: safari video loading * test: fallback poster and webm video format added * fix: adding cache for version * fix: build error * feat(sidebar): add initial sidebar implementation * feat: add temporary sidebar route * chore: minor changes/fix - open blocks link in new tab - remove arrow in sidebar tooltip * style(sidebar): add collapsed icon styles for sidebar examples * style(sidebar): nested collapsible sidebar poc * fix: playground section bg color inverted * style(sidebar): remove nested collapsible hover logic * fix: playground color * chore: color input added * test: llms.txt file added * chore: llms text file of components and it's examples * fix: color updated * chore: llms.txt file updated * fix: url in llms.txt * fix: unused color removed, llms.txt update and playground border updated to soft * fix: border color update * docs: add sidebar docs page * refactor: replace custom CodeSnippet component with standard MDX code blocks - Remove all <CodeSnippet> component usages in MDX files - Use default MDX code fence (```) syntax for code formatting - This enables Contentlayer to handle code highlighting consistently and reduces custom component overhead The change simplifies the codebase by relying on MDX's native code block support, making future maintenance easier and improving compatibility with standard Markdown tooling. * perf: replace CodeSnippet with ComponentSource in ComponentPreview ComponentSource caches highlighted code output, avoiding redundant syntax highlighting on every render. CodeSnippet recomputes this on each call, making it slower for frequently rendered previews. * chore: formatting issue * perf: eliminate client-side bundle bloat in docs pages - Remove allDocs import from AsideBar client component by migrating TOC rendering to a parallel route slot (@aside/[...slug]/page.tsx) with full slug access at build time - Remove redundant examples.json import from page.tsx — JSON was imported directly in mdx.tsx and the passed prop was unused - Fix mdx.tsx ComponentPreview lookup using hardcoded [0] index, replace with proper find() by file path - Convert DocsLayout and AsideBar to server components AllDocs and examples.json were being serialized into __NEXT_DATA__ on every docs page navigation, causing significant hydration overhead. * perf: move ThemeProvider out of layout.tsx * perf: add appropriate cache headers and fix middleware matching logic for .md routes * fix: correct import paths and remove aggressive cache override - Update imports from '@/registry' to '@/components' across affected files - Remove hardcoded Cache-Control: max-age=60, stale-while-revalidate=30 from next.config.js — this was overriding Next.js SSG default headers, causing Cloudflare to treat all docs pages as DYNAMIC and skip caching * chore: change cache header * chore: change cache header * fix: resolve color table values not being applied correctly * chore: merge main --------- Co-authored-by: yube01 <yubraja008@gmail.com> Co-authored-by: Ashmit72 <ashmitbastola@gmail.com> Co-authored-by: Be-En-AyA <bt.binaya@gmail.com> Co-authored-by: Ashmit Bastola <114178696+Ashmit72@users.noreply.github.com> Co-authored-by: Binaya Thapa <106618310+BeEnAyA@users.noreply.github.com>
1 parent 4ea8ae8 commit 708ebc4

25 files changed

Lines changed: 2530 additions & 2234 deletions

File tree

apps/website/next.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ const nextConfig = {
4747
},
4848
],
4949
},
50+
{
51+
source: "/docs/:path*",
52+
headers: [
53+
{
54+
key: "Cache-Control",
55+
value: "public, max-age=31536000, immutable",
56+
},
57+
],
58+
},
5059
]
5160
},
5261

apps/website/public/llms.txt

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Radian Documentation for LLMs
2+
3+
> Radian is an open source React-based UI component library that provides a wide range of reusable components and design tokens, along with an accompanying Figma design system, to help developers and designers build consistent and visually appealing web applications.
4+
5+
This documentation is designed for AI agents and LLMs, providing structured Markdown files optimized for context retrieval, semantic understanding, and automated code generation.
6+
7+
## Getting Started
8+
9+
- [Introduction](http://localhost:3001/docs/getting-started/introduction.md): Detailed documentation for Introduction
10+
- [Installation](http://localhost:3001/docs/getting-started/installation.md): Detailed documentation for Installation
11+
- [CLI](http://localhost:3001/docs/getting-started/cli.md): Detailed documentation for CLI
12+
- [Figma](http://localhost:3001/docs/getting-started/figma.md): Detailed documentation for Figma
13+
- [Changelog](http://localhost:3001/docs/getting-started/changelog.md): Detailed documentation for Changelog
14+
15+
## Installation
16+
17+
- [Nextjs](http://localhost:3001/docs/installation/next.md): Detailed documentation for Nextjs
18+
- [Vite](http://localhost:3001/docs/installation/vite.md): Detailed documentation for Vite
19+
- [Manual](http://localhost:3001/docs/installation/manual.md): Detailed documentation for Manual
20+
21+
## Fundamentals
22+
23+
> Universal settings for building a strong foundation for a digital product
24+
25+
- [Colors](http://localhost:3001/docs/fundamentals/colors.md): 156 colors, 70 color tokens
26+
- [Typography](http://localhost:3001/docs/fundamentals/typography.md): 17 Styles
27+
- [Iconography](http://localhost:3001/docs/fundamentals/iconography.md): 1,200 Components
28+
- [Theme](http://localhost:3001/docs/fundamentals/theme.md): 8 Types
29+
- [Theme — Next.js](http://localhost:3001/docs/fundamentals/theme/nextjs.md): Detailed documentation for Theme (Next.js)
30+
- [Theme — Vite](http://localhost:3001/docs/fundamentals/theme/vite.md): Detailed documentation for Theme (Vite)
31+
32+
## Components
33+
34+
- [Accordion](http://localhost:3001/docs/components/accordion.md): Detailed documentation for Accordion
35+
- [Alert](http://localhost:3001/docs/components/alert.md): Detailed documentation for Alert
36+
- [Alert Dialog](http://localhost:3001/docs/components/alert-dialog.md): Detailed documentation for Alert Dialog
37+
- [Aspect Ratio](http://localhost:3001/docs/components/aspect-ratio.md): Detailed documentation for Aspect Ratio
38+
- [Avatar](http://localhost:3001/docs/components/avatar.md): Detailed documentation for Avatar
39+
- [Badge](http://localhost:3001/docs/components/badge.md): Detailed documentation for Badge
40+
- [Banner](http://localhost:3001/docs/components/banner.md): Detailed documentation for Banner
41+
- [Breadcrumb](http://localhost:3001/docs/components/breadcrumb.md): Detailed documentation for Breadcrumb
42+
- [Button](http://localhost:3001/docs/components/button.md): Detailed documentation for Button
43+
- [Calendar](http://localhost:3001/docs/components/calendar.md): Detailed documentation for Calendar
44+
- [Card](http://localhost:3001/docs/components/card.md): Detailed documentation for Card
45+
- [Carousel](http://localhost:3001/docs/components/carousel.md): Detailed documentation for Carousel
46+
- [Checkbox](http://localhost:3001/docs/components/checkbox.md): Detailed documentation for Checkbox
47+
- [Code Area](http://localhost:3001/docs/components/code-area.md): Detailed documentation for Code Area
48+
- [Collapsible](http://localhost:3001/docs/components/collapsible.md): Detailed documentation for Collapsible
49+
- [Combobox](http://localhost:3001/docs/components/combobox.md): Detailed documentation for Combobox
50+
- [Command](http://localhost:3001/docs/components/command.md): Detailed documentation for Command
51+
- [Currency Input](http://localhost:3001/docs/components/currency-input.md): Detailed documentation for Currency Input
52+
- [Date Picker](http://localhost:3001/docs/components/date-picker.md): Detailed documentation for Date Picker
53+
- [Dialog](http://localhost:3001/docs/components/dialog.md): Detailed documentation for Dialog
54+
- [Divider](http://localhost:3001/docs/components/divider.md): Detailed documentation for Divider
55+
- [Drawer](http://localhost:3001/docs/components/drawer.md): Detailed documentation for Drawer
56+
- [Dropdown](http://localhost:3001/docs/components/dropdown.md): Detailed documentation for Dropdown
57+
- [Empty](http://localhost:3001/docs/components/empty.md): Detailed documentation for Empty
58+
- [File Upload](http://localhost:3001/docs/components/file-upload.md): Detailed documentation for File Upload
59+
- [Form](http://localhost:3001/docs/components/form.md): Detailed documentation for Form
60+
- [Hover Card](http://localhost:3001/docs/components/hover-card.md): Detailed documentation for Hover Card
61+
- [Input](http://localhost:3001/docs/components/input.md): Detailed documentation for Input
62+
- [Label](http://localhost:3001/docs/components/label.md): Detailed documentation for Label
63+
- [OTP Field](http://localhost:3001/docs/components/otp-field.md): Detailed documentation for OTP Field
64+
- [Pagination](http://localhost:3001/docs/components/pagination.md): Detailed documentation for Pagination
65+
- [Phone Number Input](http://localhost:3001/docs/components/phone-number-input.md): Detailed documentation for Phone Number Input
66+
- [Popover](http://localhost:3001/docs/components/popover.md): Detailed documentation for Popover
67+
- [Progress](http://localhost:3001/docs/components/progress.md): Detailed documentation for Progress
68+
- [Radio Group](http://localhost:3001/docs/components/radio-group.md): Detailed documentation for Radio Group
69+
- [Resizable](http://localhost:3001/docs/components/resizable.md): Detailed documentation for Resizable
70+
- [Scroll Area](http://localhost:3001/docs/components/scroll-area.md): Detailed documentation for Scroll Area
71+
- [Select](http://localhost:3001/docs/components/select.md): Detailed documentation for Select
72+
- [Skeleton](http://localhost:3001/docs/components/skeleton.md): Detailed documentation for Skeleton
73+
- [Slider](http://localhost:3001/docs/components/slider.md): Detailed documentation for Slider
74+
- [Sonner](http://localhost:3001/docs/components/sonner.md): Detailed documentation for Sonner
75+
- [Spinner](http://localhost:3001/docs/components/spinner.md): Detailed documentation for Spinner
76+
- [Switch](http://localhost:3001/docs/components/switch.md): Detailed documentation for Switch
77+
- [Table](http://localhost:3001/docs/components/table.md): Detailed documentation for Table
78+
- [Tabs](http://localhost:3001/docs/components/tabs.md): Detailed documentation for Tabs
79+
- [Text Area](http://localhost:3001/docs/components/text-area.md): Detailed documentation for Text Area
80+
- [Tooltip](http://localhost:3001/docs/components/tooltip.md): Detailed documentation for Tooltip
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { allDocs } from "contentlayer/generated"
2+
import AsideBar from "@/components/aside-bar"
3+
import { getHeadingsFromMdx } from "@/lib/get-mdx-headings"
4+
5+
export const revalidate = false
6+
export const dynamic = "force-static"
7+
export const dynamicParams = false
8+
9+
interface Props {
10+
params: Promise<{ slug: string[] }>
11+
}
12+
13+
export default async function AsideSlot({ params }: Props) {
14+
const resolvedParams = await params
15+
const slug = resolvedParams.slug.join("/")
16+
const doc = allDocs.find((d) => d.slugAsParams === slug)
17+
if (!doc) return null
18+
19+
const headings = await getHeadingsFromMdx(doc.rawMdx)
20+
21+
return <AsideBar headings={headings} />
22+
}

apps/website/src/app/(app)/docs/[...slug]/page.tsx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,25 @@ import { notFound } from "next/navigation"
77
import { Mdx } from "@/components/mdx"
88
import { PreviousNextButtons } from "@/components/prev-next-buttons"
99
import { websiteMetadata } from "@/config/website-metadata-config"
10-
import { ThemeProvider } from "@/contexts/theme-context"
11-
import Examples from "@/registry/example/example.json"
1210
import { Badge } from "@/registry/ui/badge"
1311

12+
export const revalidate = false
13+
export const dynamic = "force-static"
14+
export const dynamicParams = false
15+
1416
interface DocPageProps {
15-
params: Promise<{ slug: string[] }> // 👈 Promise-based!
17+
params: Promise<{ slug: string[] }>
1618
}
1719

18-
// Await `params` inside the function
20+
// Await `params` inside the function
1921
async function getDocFromParams({ params }: DocPageProps) {
2022
const resolvedParams = await params
2123
const slug = resolvedParams.slug.join("/") || ""
2224
const doc = allDocs.find((doc) => doc.slugAsParams === slug)
2325
return doc ?? null
2426
}
2527

26-
// Static path generation
28+
// Static path generation
2729
export async function generateStaticParams() {
2830
return allDocs.map((doc) => ({
2931
slug: doc.slugAsParams.split("/"),
@@ -69,13 +71,12 @@ export async function generateMetadata({
6971
}
7072
}
7173

72-
// Await `params` in the page itself
74+
// Await `params` in the page itself
7375
export default async function Page({ params }: DocPageProps) {
7476
const resolvedParams = await params
7577
const doc = await getDocFromParams({ params })
7678
const currentPath = `/docs/${resolvedParams.slug.join("/")}`
7779
const category = doc?.slugAsParams.split("/")[0].replace("-", " ")
78-
const componentName = doc?.slugAsParams.split("/").pop() || ""
7980

8081
if (!doc) return notFound()
8182

@@ -152,14 +153,8 @@ export default async function Page({ params }: DocPageProps) {
152153
</section>
153154
)}
154155
</div>
155-
<ThemeProvider>
156-
<Mdx
157-
code={doc.body.code}
158-
examples={Examples.filter(
159-
(example) => example.name === componentName
160-
)}
161-
/>
162-
</ThemeProvider>
156+
157+
<Mdx code={doc.body.code} />
163158

164159
<PreviousNextButtons currentPath={currentPath} className="mt-10" />
165160
</div>

apps/website/src/app/(app)/docs/layout.tsx

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,16 @@
1-
"use client"
2-
31
import React, { ReactNode } from "react"
4-
import { useTheme } from "next-themes"
5-
import { Toaster, ToasterProps } from "sonner"
6-
import AsideBar from "@/components/aside-bar"
72
import Sidebar from "@/components/sidebar-app"
8-
import { useToast } from "@/contexts/toast-context"
3+
import ToasterWrapper from "@/components/toaster-wrapper"
94

105
interface Props {
116
children: ReactNode
7+
aside: ReactNode
128
}
139

14-
const DocsLayout = ({ children }: Props) => {
15-
const { position, isExpandable } = useToast()
16-
const { theme = "system" } = useTheme()
17-
10+
const DocsLayout = ({ children, aside }: Props) => {
1811
return (
1912
<div className="max-w-368 mx-auto flex w-full px-4 md:px-5">
20-
<Toaster
21-
expand={isExpandable}
22-
position={position}
23-
theme={theme as ToasterProps["theme"]}
24-
/>
13+
<ToasterWrapper />
2514

2615
{/* Left Sidebar */}
2716
<Sidebar />
@@ -30,7 +19,7 @@ const DocsLayout = ({ children }: Props) => {
3019
<div className="flex-1 overflow-hidden">{children}</div>
3120

3221
{/* Right Sidebar (TOC) - Only show on docs pages */}
33-
<AsideBar />
22+
{aside}
3423
</div>
3524
)
3625
}

apps/website/src/app/(sidebar)/sidebar-doc/app-sidebar.tsx

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@ import {
99
FileChartColumn,
1010
Headset,
1111
Inbox,
12+
Info,
1213
Search,
1314
Settings,
1415
TvMinimal,
1516
Users2,
1617
} from "lucide-react"
1718
import Link from "next/link"
1819
import { Badge } from "@/registry/ui/badge"
20+
import { IconButton } from "@/registry/ui/button"
21+
import {
22+
HoverCard,
23+
HoverCardContent,
24+
HoverCardTrigger,
25+
} from "@/registry/ui/hover-card"
1926
import { Input, InputWrapper } from "@/registry/ui/input"
2027
import {
2128
Sidebar,
@@ -35,9 +42,11 @@ import {
3542
SidebarMenuSubItem,
3643
SidebarRail,
3744
SidebarSeparator,
45+
useSidebar,
3846
} from "@/registry/ui/sidebar"
3947
import AcmeLogo from "./acme-logo"
40-
import Logo from "./logo"
48+
import { InfoCard } from "./info-card"
49+
import MageLogo from "./mage-logo"
4150
import RadianCoreLogo from "./radian-core-logo"
4251
import { SidebarFooterUser } from "./sidebar-footer-user"
4352

@@ -119,7 +128,7 @@ const mainData: NavGroup[] = [
119128
title: "Projects",
120129
items: [
121130
{
122-
icon: Box,
131+
icon: MageLogo,
123132
label: "Mage Icons",
124133
},
125134
{
@@ -153,24 +162,43 @@ const footerData: NavGroup[] = [
153162
]
154163

155164
export function AppSidebar() {
165+
const { setOpen } = useSidebar()
166+
const inputRef = React.useRef<HTMLInputElement>(null)
167+
156168
return (
157169
<Sidebar collapsible="icon">
158-
<SidebarHeader>
170+
<SidebarHeader className="p-0">
159171
<div className="flex items-center gap-2 px-1.5 py-1">
160-
<Logo />
172+
<span className="w-6" />
161173
<span className="truncate font-semibold group-data-[collapsible=icon]:hidden">
162174
Debcon
163175
</span>
164176
</div>
165177

166-
<div className="w-full px-3 py-2 group-data-[state=collapsed]:hidden">
167-
<InputWrapper className="w-full">
168-
<Search className="text-fg-tertiary size-5" />
169-
<Input type="search" placeholder="Search" />
178+
<div className="w-full px-3 py-2 group-data-[state=collapsed]:px-2">
179+
<InputWrapper
180+
className="group-data-[state=collapsed]:hidden"
181+
size="32">
182+
<Search className="text-fg-tertiary" />
183+
<Input ref={inputRef} type="search" placeholder="Search" />
170184
<Badge size="20" color="neutral" variant="outline">
171185
⌘ /
172186
</Badge>
173187
</InputWrapper>
188+
189+
<IconButton
190+
onClick={() => {
191+
setOpen(true)
192+
setTimeout(() => {
193+
inputRef.current?.focus()
194+
}, 200)
195+
}}
196+
size="32"
197+
variant="outline"
198+
color="neutral"
199+
className="group-data-[mobile=true]:hidden group-data-[state=expanded]:hidden">
200+
<Search className="text-fg-tertiary" />
201+
</IconButton>
174202
</div>
175203
</SidebarHeader>
176204
<SidebarContent>
@@ -228,6 +256,24 @@ export function AppSidebar() {
228256
</SidebarContent>
229257

230258
<SidebarFooter className="gap-0 p-0">
259+
<div className="p-2 group-data-[mobile=true]:hidden group-data-[state=expanded]:hidden">
260+
<HoverCard>
261+
<HoverCardTrigger asChild>
262+
<IconButton size="32" variant="ghost" color="neutral">
263+
<Info className="text-fg-secondary" />
264+
</IconButton>
265+
</HoverCardTrigger>
266+
<HoverCardContent
267+
side="right"
268+
sideOffset={4}
269+
className="w-60 rounded-lg border-none p-0">
270+
<InfoCard className="p-0" />
271+
</HoverCardContent>
272+
</HoverCard>
273+
</div>
274+
275+
<InfoCard className="group-data-[state=collapsed]:hidden" />
276+
231277
<SidebarGroup>
232278
<SidebarGroupContent>
233279
<SidebarMenu>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { ChevronRight, Info } from "lucide-react"
2+
import { cn } from "@/lib/utils"
3+
4+
export function InfoCard({ className }: { className?: string }) {
5+
return (
6+
<div className={cn("px-3 py-1.5", className)}>
7+
<div className="bg-bg border-soft flex items-center gap-2 rounded-lg border px-2.5 py-1.5">
8+
<Info className="size-6" />
9+
<div className="flex flex-col">
10+
<span className="text-[13px] font-medium leading-5">
11+
Version 1.2 Update
12+
</span>
13+
<span className="text-fg-tertiary flex cursor-pointer items-center text-sm font-normal">
14+
<span>Learn More</span>
15+
<ChevronRight className="size-4" />
16+
</span>
17+
</div>
18+
</div>
19+
</div>
20+
)
21+
}

0 commit comments

Comments
 (0)