Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/v4/registry/new-york-v4/examples/calendar-demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default function CalendarDemo() {
mode="single"
selected={date}
onSelect={setDate}
defaultMonth={date}
className="rounded-md border shadow-sm"
captionLayout="dropdown"
/>
Expand Down
12 changes: 11 additions & 1 deletion apps/v4/registry/new-york-v4/ui/scroll-area.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,20 @@ import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"

import { cn } from "@/lib/utils"

interface ScrollAreaProps extends React.ComponentProps<typeof ScrollAreaPrimitive.Root> {
/**
* If true, renders the viewport as a child element without extra wrapping.
* Useful for custom scroll area implementations requiring direct viewport manipulation.
*/
raw?: boolean
}

function ScrollArea({
className,
children,
raw = false,
...props
}: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
}: ScrollAreaProps) {
return (
<ScrollAreaPrimitive.Root
data-slot="scroll-area"
Expand All @@ -18,6 +27,7 @@ function ScrollArea({
>
<ScrollAreaPrimitive.Viewport
data-slot="scroll-area-viewport"
asChild={raw}
className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
>
{children}
Expand Down