@dinachi/cli 0.7.1 → 0.7.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/package.json
CHANGED
|
@@ -4,7 +4,79 @@ import * as React from "react"
|
|
|
4
4
|
import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area"
|
|
5
5
|
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
7
|
+
/* -------------------------------------------------------------------------------------------------
|
|
8
|
+
* Compound ScrollArea — handles Root + Viewport + Content + Scrollbar + Thumb internally
|
|
9
|
+
* ------------------------------------------------------------------------------------------------*/
|
|
10
|
+
|
|
7
11
|
const ScrollArea = React.forwardRef<
|
|
12
|
+
React.ComponentRef<typeof ScrollAreaPrimitive.Root>,
|
|
13
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root> & {
|
|
14
|
+
orientation?: "vertical" | "horizontal" | "both"
|
|
15
|
+
viewportClassName?: string
|
|
16
|
+
scrollbarClassName?: string
|
|
17
|
+
}
|
|
18
|
+
>(
|
|
19
|
+
(
|
|
20
|
+
{
|
|
21
|
+
className,
|
|
22
|
+
orientation = "vertical",
|
|
23
|
+
viewportClassName,
|
|
24
|
+
scrollbarClassName,
|
|
25
|
+
children,
|
|
26
|
+
...props
|
|
27
|
+
},
|
|
28
|
+
ref
|
|
29
|
+
) => (
|
|
30
|
+
<ScrollAreaPrimitive.Root
|
|
31
|
+
ref={ref}
|
|
32
|
+
className={cn("relative overflow-hidden", className)}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
<ScrollAreaPrimitive.Viewport
|
|
36
|
+
className={cn("size-full rounded-[inherit]", viewportClassName)}
|
|
37
|
+
>
|
|
38
|
+
<ScrollAreaPrimitive.Content className="min-w-full">
|
|
39
|
+
{children}
|
|
40
|
+
</ScrollAreaPrimitive.Content>
|
|
41
|
+
</ScrollAreaPrimitive.Viewport>
|
|
42
|
+
|
|
43
|
+
{(orientation === "vertical" || orientation === "both") && (
|
|
44
|
+
<ScrollAreaPrimitive.Scrollbar
|
|
45
|
+
orientation="vertical"
|
|
46
|
+
className={cn(
|
|
47
|
+
"flex touch-none select-none p-0.5 transition-colors",
|
|
48
|
+
"h-full w-2.5 border-l border-l-transparent",
|
|
49
|
+
scrollbarClassName
|
|
50
|
+
)}
|
|
51
|
+
>
|
|
52
|
+
<ScrollAreaPrimitive.Thumb className="relative flex-1 rounded-full bg-border" />
|
|
53
|
+
</ScrollAreaPrimitive.Scrollbar>
|
|
54
|
+
)}
|
|
55
|
+
|
|
56
|
+
{(orientation === "horizontal" || orientation === "both") && (
|
|
57
|
+
<ScrollAreaPrimitive.Scrollbar
|
|
58
|
+
orientation="horizontal"
|
|
59
|
+
className={cn(
|
|
60
|
+
"flex touch-none select-none p-0.5 transition-colors",
|
|
61
|
+
"h-2.5 w-full flex-col border-t border-t-transparent",
|
|
62
|
+
scrollbarClassName
|
|
63
|
+
)}
|
|
64
|
+
>
|
|
65
|
+
<ScrollAreaPrimitive.Thumb className="relative flex-1 rounded-full bg-border" />
|
|
66
|
+
</ScrollAreaPrimitive.Scrollbar>
|
|
67
|
+
)}
|
|
68
|
+
|
|
69
|
+
{orientation === "both" && <ScrollAreaPrimitive.Corner className="bg-background" />}
|
|
70
|
+
</ScrollAreaPrimitive.Root>
|
|
71
|
+
)
|
|
72
|
+
)
|
|
73
|
+
ScrollArea.displayName = "ScrollArea"
|
|
74
|
+
|
|
75
|
+
/* -------------------------------------------------------------------------------------------------
|
|
76
|
+
* Primitives — re-exported for advanced composition (e.g. dual-axis with custom placement)
|
|
77
|
+
* ------------------------------------------------------------------------------------------------*/
|
|
78
|
+
|
|
79
|
+
const ScrollAreaRoot = React.forwardRef<
|
|
8
80
|
React.ComponentRef<typeof ScrollAreaPrimitive.Root>,
|
|
9
81
|
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
10
82
|
>(({ className, ...props }, ref) => (
|
|
@@ -14,7 +86,7 @@ const ScrollArea = React.forwardRef<
|
|
|
14
86
|
{...props}
|
|
15
87
|
/>
|
|
16
88
|
))
|
|
17
|
-
|
|
89
|
+
ScrollAreaRoot.displayName = "ScrollAreaRoot"
|
|
18
90
|
|
|
19
91
|
const ScrollAreaViewport = React.forwardRef<
|
|
20
92
|
React.ComponentRef<typeof ScrollAreaPrimitive.Viewport>,
|
|
@@ -85,6 +157,7 @@ ScrollAreaCorner.displayName = "ScrollAreaCorner"
|
|
|
85
157
|
|
|
86
158
|
export {
|
|
87
159
|
ScrollArea,
|
|
160
|
+
ScrollAreaRoot,
|
|
88
161
|
ScrollAreaViewport,
|
|
89
162
|
ScrollAreaContent,
|
|
90
163
|
ScrollAreaScrollbar,
|