From 071e2cdc99ede5083133296f8a409d9e3077d738 Mon Sep 17 00:00:00 2001 From: Radiumcoders Date: Fri, 11 Sep 2026 16:51:31 +0530 Subject: [PATCH 1/2] feat: spring dashed leaders along the docs sidebar Keep the selected trail on the current page and animate a second hover trail between items, including across section headings. Co-authored-by: Cursor --- components/docs-sidebar.tsx | 127 +++++++++++++++++++++++++++++------- 1 file changed, 104 insertions(+), 23 deletions(-) diff --git a/components/docs-sidebar.tsx b/components/docs-sidebar.tsx index 3753080..d209174 100644 --- a/components/docs-sidebar.tsx +++ b/components/docs-sidebar.tsx @@ -3,6 +3,7 @@ import * as React from "react" import Link from "next/link" import { usePathname } from "next/navigation" +import { LayoutGroup, motion, useReducedMotion } from "motion/react" import { DocsSidebarTrigger } from "@/components/docs-sidebar-trigger" import { Logo } from "@/components/logo" @@ -48,28 +49,78 @@ function isCurrent(pathname: string, url: string) { return pathname === url } +const headingClassName = + "mt-4 mb-0.5 h-auto px-3 py-1 truncate text-[11px] font-medium tracking-[0.16em] text-foreground/35 uppercase first:mt-0" + +const markSpring = { + type: "spring" as const, + stiffness: 460, + damping: 34, + mass: 0.7, +} + +function DashMark({ + layoutId, + opacity, +}: { + layoutId: string + opacity: number +}) { + const reduce = useReducedMotion() ?? false + + return ( + + ) +} + +type TabHover = { + hoveredUrl: string | null + onHover: (url: string) => void +} + function PageItem({ node, pathname, indented = false, + hoveredUrl, + onHover, }: { node: PageNode pathname: string indented?: boolean -}) { +} & TabHover) { + const active = isCurrent(pathname, node.url) + const showHover = hoveredUrl === node.url && !active + return ( - + onHover(node.url)} + onMouseEnter={() => onHover(node.url)} + > } - isActive={isCurrent(pathname, node.url)} + isActive={active} className={cn( - "hover:bg-foreground/5 data-active:bg-foreground/10", + "h-8 gap-0 overflow-visible rounded-lg bg-transparent font-normal text-foreground/45 transition-colors duration-200 hover:bg-transparent hover:text-foreground/80 active:bg-transparent data-active:bg-transparent data-active:font-normal data-active:text-foreground data-active:hover:bg-transparent data-active:hover:text-foreground [&>span:last-child]:overflow-visible [&>span:last-child]:text-clip", indented && "pl-6" )} > - {node.name} + {node.name} + {active ? ( + + ) : null} + {showHover ? ( + + ) : null} ) @@ -81,9 +132,7 @@ function SeparatorItem({ node }: { node: SeparatorNode }) { } return ( - - {node.name} - + {node.name} ) } @@ -95,28 +144,37 @@ function NavItems({ nodes, pathname, indented = false, + hoveredUrl, + onHover, }: { nodes: TreeNode[] pathname: string indented?: boolean -}) { +} & TabHover) { + let inSection = indented + return nodes.map((node, i) => { - if (isPage(node)) { + if (isSeparator(node)) { + if (node.name != null && node.name !== "") { + inSection = true + } return ( - ) } - if (isSeparator(node)) { + if (isPage(node)) { return ( - ) } @@ -127,14 +185,24 @@ function NavItems({ return ( {node.index ? ( - + ) : hasSectionedChildren ? null : ( - {node.name} + + {node.name} + )} ) @@ -153,10 +221,23 @@ function NavList({ pathname: string indented?: boolean }) { + const [hoveredUrl, setHoveredUrl] = React.useState(null) + return ( - - - + + setHoveredUrl(null)} + onMouseLeave={() => setHoveredUrl(null)} + > + setHoveredUrl(url)} + /> + + ) } From 7ee0f72aa98924c0afb3e2316706f019861d3e60 Mon Sep 17 00:00:00 2001 From: Radiumcoders Date: Fri, 11 Sep 2026 16:51:40 +0530 Subject: [PATCH 2/2] fix: fill the Phosphor Score demo with the dark CRT ground The stage was using the page background, so the score sat on a mismatched field in dark mode. Co-authored-by: Cursor --- registry/phosphor-score/phosphor-score-demo.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/registry/phosphor-score/phosphor-score-demo.tsx b/registry/phosphor-score/phosphor-score-demo.tsx index 1d4c9d8..5737f75 100644 --- a/registry/phosphor-score/phosphor-score-demo.tsx +++ b/registry/phosphor-score/phosphor-score-demo.tsx @@ -12,6 +12,7 @@ import { ComponentPreview } from "@/components/component-preview" import { useHydratedTheme } from "@/hooks/use-hydrated-theme" import { usePreviewProps } from "@/hooks/use-preview-props" import { + DARK_BG, DARK_COLOR, DEFAULT_DENSITY, DEFAULT_GLOW, @@ -60,9 +61,12 @@ export function PhosphorScoreDemo() { <> -
+