mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-08 14:35:09 +00:00
* feat: add base and radix docs * feat: transform code for display * fix * fix * fix * fix * fix * chore: remove claude files * fix * fix * fix * chore: run format:write * fix * feat: add more examples * fix * feat: add aspect-ratio * feat: add avatar * feat: add badge * feat: add breadcrumb * fix * feat: add button * fix * fix * fix * feat: add calendar and card * feat: add carousel * fix: chart * feat: add checkbox * feat: add collapsible * feat: add combobox * feat: add command * feat: add context menu * feat: add data-table dialog and drawer * feat: dropdown-menu * feat: add date-picker * feat: add empty * feat: add field and hover-card * fix: input * feat: add input * feat: add input-group * feat: add input-otp * feat: add item * feat: add kbd and label * feat: add menubar * feat: add native-select * feat: add more components * feat: more components * feat: more components * feat: add skeleton, slider and sonner * feat: add spinner and switch * feat: add more components * fix: tabs * fix: tabs * feat: add docs for sidebar * fix * fix * fi * docs: update * fix: create page * fix * fix * chore: add changelog * fix
53 lines
1.9 KiB
TypeScript
53 lines
1.9 KiB
TypeScript
"use client"
|
|
|
|
import * as React from "react"
|
|
import { cn } from "@/examples/base/lib/utils"
|
|
import * as ResizablePrimitive from "react-resizable-panels"
|
|
|
|
function ResizablePanelGroup({
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {
|
|
return (
|
|
<ResizablePrimitive.PanelGroup
|
|
data-slot="resizable-panel-group"
|
|
className={cn(
|
|
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
|
className
|
|
)}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|
|
|
|
function ResizablePanel({
|
|
...props
|
|
}: React.ComponentProps<typeof ResizablePrimitive.Panel>) {
|
|
return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />
|
|
}
|
|
|
|
function ResizableHandle({
|
|
withHandle,
|
|
className,
|
|
...props
|
|
}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
withHandle?: boolean
|
|
}) {
|
|
return (
|
|
<ResizablePrimitive.PanelResizeHandle
|
|
data-slot="resizable-handle"
|
|
className={cn(
|
|
"bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
{withHandle && (
|
|
<div className="bg-border z-10 flex h-6 w-1 shrink-0 rounded-lg" />
|
|
)}
|
|
</ResizablePrimitive.PanelResizeHandle>
|
|
)
|
|
}
|
|
|
|
export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
|