itsi 0.2.16 → 0.2.18
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.
- checksums.yaml +4 -4
- data/.zed/settings.json +32 -0
- data/CHANGELOG.md +21 -0
- data/Cargo.lock +4 -2
- data/crates/itsi_acme/Cargo.toml +1 -1
- data/crates/itsi_scheduler/Cargo.toml +1 -1
- data/crates/itsi_server/Cargo.toml +3 -1
- data/crates/itsi_server/src/lib.rs +6 -1
- data/crates/itsi_server/src/ruby_types/itsi_body_proxy/mod.rs +2 -0
- data/crates/itsi_server/src/ruby_types/itsi_grpc_call.rs +4 -4
- data/crates/itsi_server/src/ruby_types/itsi_grpc_response_stream/mod.rs +14 -13
- data/crates/itsi_server/src/ruby_types/itsi_http_request.rs +64 -33
- data/crates/itsi_server/src/ruby_types/itsi_http_response.rs +151 -152
- data/crates/itsi_server/src/ruby_types/itsi_server/file_watcher.rs +422 -110
- data/crates/itsi_server/src/ruby_types/itsi_server/itsi_server_config.rs +62 -15
- data/crates/itsi_server/src/ruby_types/itsi_server.rs +1 -1
- data/crates/itsi_server/src/server/binds/listener.rs +45 -7
- data/crates/itsi_server/src/server/frame_stream.rs +142 -0
- data/crates/itsi_server/src/server/http_message_types.rs +142 -9
- data/crates/itsi_server/src/server/io_stream.rs +28 -5
- data/crates/itsi_server/src/server/lifecycle_event.rs +1 -1
- data/crates/itsi_server/src/server/middleware_stack/middlewares/auth_basic.rs +2 -3
- data/crates/itsi_server/src/server/middleware_stack/middlewares/compression.rs +8 -10
- data/crates/itsi_server/src/server/middleware_stack/middlewares/cors.rs +2 -3
- data/crates/itsi_server/src/server/middleware_stack/middlewares/csp.rs +3 -3
- data/crates/itsi_server/src/server/middleware_stack/middlewares/error_response/default_responses.rs +54 -56
- data/crates/itsi_server/src/server/middleware_stack/middlewares/error_response.rs +5 -7
- data/crates/itsi_server/src/server/middleware_stack/middlewares/etag.rs +5 -5
- data/crates/itsi_server/src/server/middleware_stack/middlewares/proxy.rs +7 -10
- data/crates/itsi_server/src/server/middleware_stack/middlewares/redirect.rs +2 -3
- data/crates/itsi_server/src/server/middleware_stack/middlewares/static_assets.rs +1 -2
- data/crates/itsi_server/src/server/middleware_stack/middlewares/static_response.rs +4 -6
- data/crates/itsi_server/src/server/mod.rs +1 -0
- data/crates/itsi_server/src/server/process_worker.rs +3 -4
- data/crates/itsi_server/src/server/serve_strategy/acceptor.rs +16 -12
- data/crates/itsi_server/src/server/serve_strategy/cluster_mode.rs +83 -31
- data/crates/itsi_server/src/server/serve_strategy/single_mode.rs +166 -142
- data/crates/itsi_server/src/server/signal.rs +37 -9
- data/crates/itsi_server/src/server/thread_worker.rs +84 -69
- data/crates/itsi_server/src/services/itsi_http_service.rs +43 -43
- data/crates/itsi_server/src/services/static_file_server.rs +28 -47
- data/docs/benchmark-dashboard/.gitignore +27 -0
- data/docs/benchmark-dashboard/app/api/benchmarks/route.ts +22 -0
- data/docs/benchmark-dashboard/app/globals.css +94 -0
- data/docs/benchmark-dashboard/app/layout.tsx +20 -0
- data/docs/benchmark-dashboard/app/page.tsx +252 -0
- data/docs/benchmark-dashboard/components/benchmark-dashboard.tsx +1663 -0
- data/docs/benchmark-dashboard/components/theme-provider.tsx +11 -0
- data/docs/benchmark-dashboard/components/ui/accordion.tsx +58 -0
- data/docs/benchmark-dashboard/components/ui/alert-dialog.tsx +141 -0
- data/docs/benchmark-dashboard/components/ui/alert.tsx +59 -0
- data/docs/benchmark-dashboard/components/ui/aspect-ratio.tsx +7 -0
- data/docs/benchmark-dashboard/components/ui/avatar.tsx +50 -0
- data/docs/benchmark-dashboard/components/ui/badge.tsx +36 -0
- data/docs/benchmark-dashboard/components/ui/breadcrumb.tsx +115 -0
- data/docs/benchmark-dashboard/components/ui/button.tsx +56 -0
- data/docs/benchmark-dashboard/components/ui/calendar.tsx +66 -0
- data/docs/benchmark-dashboard/components/ui/card.tsx +79 -0
- data/docs/benchmark-dashboard/components/ui/carousel.tsx +262 -0
- data/docs/benchmark-dashboard/components/ui/chart.tsx +365 -0
- data/docs/benchmark-dashboard/components/ui/checkbox.tsx +30 -0
- data/docs/benchmark-dashboard/components/ui/collapsible.tsx +11 -0
- data/docs/benchmark-dashboard/components/ui/command.tsx +153 -0
- data/docs/benchmark-dashboard/components/ui/context-menu.tsx +200 -0
- data/docs/benchmark-dashboard/components/ui/dialog.tsx +122 -0
- data/docs/benchmark-dashboard/components/ui/drawer.tsx +118 -0
- data/docs/benchmark-dashboard/components/ui/dropdown-menu.tsx +200 -0
- data/docs/benchmark-dashboard/components/ui/form.tsx +178 -0
- data/docs/benchmark-dashboard/components/ui/hover-card.tsx +29 -0
- data/docs/benchmark-dashboard/components/ui/input-otp.tsx +71 -0
- data/docs/benchmark-dashboard/components/ui/input.tsx +22 -0
- data/docs/benchmark-dashboard/components/ui/label.tsx +26 -0
- data/docs/benchmark-dashboard/components/ui/loading-spinner.tsx +12 -0
- data/docs/benchmark-dashboard/components/ui/menubar.tsx +236 -0
- data/docs/benchmark-dashboard/components/ui/navigation-menu.tsx +128 -0
- data/docs/benchmark-dashboard/components/ui/pagination.tsx +117 -0
- data/docs/benchmark-dashboard/components/ui/popover.tsx +31 -0
- data/docs/benchmark-dashboard/components/ui/progress.tsx +28 -0
- data/docs/benchmark-dashboard/components/ui/radio-group.tsx +44 -0
- data/docs/benchmark-dashboard/components/ui/resizable.tsx +45 -0
- data/docs/benchmark-dashboard/components/ui/scroll-area.tsx +48 -0
- data/docs/benchmark-dashboard/components/ui/select.tsx +160 -0
- data/docs/benchmark-dashboard/components/ui/separator.tsx +31 -0
- data/docs/benchmark-dashboard/components/ui/sheet.tsx +140 -0
- data/docs/benchmark-dashboard/components/ui/sidebar.tsx +763 -0
- data/docs/benchmark-dashboard/components/ui/skeleton.tsx +15 -0
- data/docs/benchmark-dashboard/components/ui/slider.tsx +28 -0
- data/docs/benchmark-dashboard/components/ui/sonner.tsx +31 -0
- data/docs/benchmark-dashboard/components/ui/switch.tsx +29 -0
- data/docs/benchmark-dashboard/components/ui/table.tsx +117 -0
- data/docs/benchmark-dashboard/components/ui/tabs.tsx +55 -0
- data/docs/benchmark-dashboard/components/ui/textarea.tsx +22 -0
- data/docs/benchmark-dashboard/components/ui/toast.tsx +129 -0
- data/docs/benchmark-dashboard/components/ui/toaster.tsx +35 -0
- data/docs/benchmark-dashboard/components/ui/toggle-group.tsx +61 -0
- data/docs/benchmark-dashboard/components/ui/toggle.tsx +45 -0
- data/docs/benchmark-dashboard/components/ui/tooltip.tsx +30 -0
- data/docs/benchmark-dashboard/components/ui/use-mobile.tsx +19 -0
- data/docs/benchmark-dashboard/components/ui/use-toast.ts +194 -0
- data/docs/benchmark-dashboard/components.json +21 -0
- data/docs/benchmark-dashboard/dist/benchmark-dashboard.css +1 -0
- data/docs/benchmark-dashboard/dist/benchmark-dashboard.iife.js +211 -0
- data/docs/benchmark-dashboard/dist/placeholder-logo.png +0 -0
- data/docs/benchmark-dashboard/dist/placeholder-logo.svg +1 -0
- data/docs/benchmark-dashboard/dist/placeholder-user.jpg +0 -0
- data/docs/benchmark-dashboard/dist/placeholder.jpg +0 -0
- data/docs/benchmark-dashboard/dist/placeholder.svg +1 -0
- data/docs/benchmark-dashboard/embed.tsx +13 -0
- data/docs/benchmark-dashboard/hooks/use-mobile.tsx +19 -0
- data/docs/benchmark-dashboard/hooks/use-toast.ts +194 -0
- data/docs/benchmark-dashboard/lib/benchmark-utils.ts +54 -0
- data/docs/benchmark-dashboard/lib/utils.ts +6 -0
- data/docs/benchmark-dashboard/next.config.mjs +14 -0
- data/docs/benchmark-dashboard/package-lock.json +5859 -0
- data/docs/benchmark-dashboard/package.json +72 -0
- data/docs/benchmark-dashboard/pnpm-lock.yaml +5 -0
- data/docs/benchmark-dashboard/postcss.config.mjs +8 -0
- data/docs/benchmark-dashboard/styles/globals.css +94 -0
- data/docs/benchmark-dashboard/tailwind.config.ts +96 -0
- data/docs/benchmark-dashboard/tsconfig.json +27 -0
- data/docs/benchmark-dashboard/vite.config.ts +24 -0
- data/docs/build.rb +52 -0
- data/docs/content/acknowledgements/_index.md +1 -1
- data/docs/content/benchmarks/index.md +96 -0
- data/docs/content/configuration/_index.md +2 -2
- data/docs/content/getting_started/_index.md +76 -46
- data/docs/content/itsi_scheduler/_index.md +2 -2
- data/docs/hugo.yaml +10 -1
- data/docs/static/results.json +1 -0
- data/docs/static/scripts/benchmark-dashboard.iife.js +211 -0
- data/docs/static/styles/benchmark-dashboard.css +1 -0
- data/examples/api_with_schema_and_controllers/README.md +1 -1
- data/gems/scheduler/Cargo.lock +1 -1
- data/gems/scheduler/lib/itsi/scheduler/version.rb +1 -1
- data/gems/server/Cargo.lock +3 -1
- data/gems/server/exe/itsi +8 -5
- data/gems/server/lib/itsi/http_request.rb +31 -39
- data/gems/server/lib/itsi/http_response.rb +5 -0
- data/gems/server/lib/itsi/rack_env_pool.rb +59 -0
- data/gems/server/lib/itsi/server/config/dsl.rb +6 -4
- data/gems/server/lib/itsi/server/config/middleware/compression.md +3 -3
- data/gems/server/lib/itsi/server/config/middleware/endpoint/controller.md +1 -1
- data/gems/server/lib/itsi/server/config/middleware/proxy.md +2 -2
- data/gems/server/lib/itsi/server/config/middleware/proxy.rb +1 -1
- data/gems/server/lib/itsi/server/config/middleware/rackup_file.rb +2 -2
- data/gems/server/lib/itsi/server/config/options/auto_reload_config.rb +11 -6
- data/gems/server/lib/itsi/server/config/options/include.md +1 -0
- data/gems/server/lib/itsi/server/config/options/include.rb +13 -8
- data/gems/server/lib/itsi/server/config/options/pipeline_flush.md +16 -0
- data/gems/server/lib/itsi/server/config/options/pipeline_flush.rb +19 -0
- data/gems/server/lib/itsi/server/config/options/reuse_port.rb +2 -4
- data/gems/server/lib/itsi/server/config/options/writev.md +25 -0
- data/gems/server/lib/itsi/server/config/options/writev.rb +19 -0
- data/gems/server/lib/itsi/server/config.rb +22 -9
- data/gems/server/lib/itsi/server/default_config/Itsi.rb +9 -8
- data/gems/server/lib/itsi/server/grpc/grpc_call.rb +2 -0
- data/gems/server/lib/itsi/server/grpc/grpc_interface.rb +2 -2
- data/gems/server/lib/itsi/server/rack/handler/itsi.rb +3 -1
- data/gems/server/lib/itsi/server/rack_interface.rb +17 -12
- data/gems/server/lib/itsi/server/scheduler_interface.rb +2 -0
- data/gems/server/lib/itsi/server/version.rb +1 -1
- data/gems/server/lib/itsi/server.rb +1 -0
- data/gems/server/lib/ruby_lsp/itsi/addon.rb +12 -13
- data/gems/server/test/helpers/test_helper.rb +12 -13
- data/gems/server/test/middleware/grpc/grpc.rb +13 -14
- data/gems/server/test/middleware/grpc/test_service_impl.rb +3 -3
- data/gems/server/test/middleware/proxy.rb +262 -268
- data/lib/itsi/version.rb +1 -1
- metadata +97 -6
- data/tasks.txt +0 -28
@@ -0,0 +1,236 @@
|
|
1
|
+
"use client"
|
2
|
+
|
3
|
+
import * as React from "react"
|
4
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar"
|
5
|
+
import { Check, ChevronRight, Circle } from "lucide-react"
|
6
|
+
|
7
|
+
import { cn } from "@/lib/utils"
|
8
|
+
|
9
|
+
const MenubarMenu = MenubarPrimitive.Menu
|
10
|
+
|
11
|
+
const MenubarGroup = MenubarPrimitive.Group
|
12
|
+
|
13
|
+
const MenubarPortal = MenubarPrimitive.Portal
|
14
|
+
|
15
|
+
const MenubarSub = MenubarPrimitive.Sub
|
16
|
+
|
17
|
+
const MenubarRadioGroup = MenubarPrimitive.RadioGroup
|
18
|
+
|
19
|
+
const Menubar = React.forwardRef<
|
20
|
+
React.ElementRef<typeof MenubarPrimitive.Root>,
|
21
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
|
22
|
+
>(({ className, ...props }, ref) => (
|
23
|
+
<MenubarPrimitive.Root
|
24
|
+
ref={ref}
|
25
|
+
className={cn(
|
26
|
+
"flex h-10 items-center space-x-1 rounded-md border bg-background p-1",
|
27
|
+
className
|
28
|
+
)}
|
29
|
+
{...props}
|
30
|
+
/>
|
31
|
+
))
|
32
|
+
Menubar.displayName = MenubarPrimitive.Root.displayName
|
33
|
+
|
34
|
+
const MenubarTrigger = React.forwardRef<
|
35
|
+
React.ElementRef<typeof MenubarPrimitive.Trigger>,
|
36
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
|
37
|
+
>(({ className, ...props }, ref) => (
|
38
|
+
<MenubarPrimitive.Trigger
|
39
|
+
ref={ref}
|
40
|
+
className={cn(
|
41
|
+
"flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
42
|
+
className
|
43
|
+
)}
|
44
|
+
{...props}
|
45
|
+
/>
|
46
|
+
))
|
47
|
+
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
|
48
|
+
|
49
|
+
const MenubarSubTrigger = React.forwardRef<
|
50
|
+
React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
|
51
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
|
52
|
+
inset?: boolean
|
53
|
+
}
|
54
|
+
>(({ className, inset, children, ...props }, ref) => (
|
55
|
+
<MenubarPrimitive.SubTrigger
|
56
|
+
ref={ref}
|
57
|
+
className={cn(
|
58
|
+
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
|
59
|
+
inset && "pl-8",
|
60
|
+
className
|
61
|
+
)}
|
62
|
+
{...props}
|
63
|
+
>
|
64
|
+
{children}
|
65
|
+
<ChevronRight className="ml-auto h-4 w-4" />
|
66
|
+
</MenubarPrimitive.SubTrigger>
|
67
|
+
))
|
68
|
+
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
|
69
|
+
|
70
|
+
const MenubarSubContent = React.forwardRef<
|
71
|
+
React.ElementRef<typeof MenubarPrimitive.SubContent>,
|
72
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
|
73
|
+
>(({ className, ...props }, ref) => (
|
74
|
+
<MenubarPrimitive.SubContent
|
75
|
+
ref={ref}
|
76
|
+
className={cn(
|
77
|
+
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
78
|
+
className
|
79
|
+
)}
|
80
|
+
{...props}
|
81
|
+
/>
|
82
|
+
))
|
83
|
+
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
|
84
|
+
|
85
|
+
const MenubarContent = React.forwardRef<
|
86
|
+
React.ElementRef<typeof MenubarPrimitive.Content>,
|
87
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
|
88
|
+
>(
|
89
|
+
(
|
90
|
+
{ className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
|
91
|
+
ref
|
92
|
+
) => (
|
93
|
+
<MenubarPrimitive.Portal>
|
94
|
+
<MenubarPrimitive.Content
|
95
|
+
ref={ref}
|
96
|
+
align={align}
|
97
|
+
alignOffset={alignOffset}
|
98
|
+
sideOffset={sideOffset}
|
99
|
+
className={cn(
|
100
|
+
"z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
101
|
+
className
|
102
|
+
)}
|
103
|
+
{...props}
|
104
|
+
/>
|
105
|
+
</MenubarPrimitive.Portal>
|
106
|
+
)
|
107
|
+
)
|
108
|
+
MenubarContent.displayName = MenubarPrimitive.Content.displayName
|
109
|
+
|
110
|
+
const MenubarItem = React.forwardRef<
|
111
|
+
React.ElementRef<typeof MenubarPrimitive.Item>,
|
112
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
|
113
|
+
inset?: boolean
|
114
|
+
}
|
115
|
+
>(({ className, inset, ...props }, ref) => (
|
116
|
+
<MenubarPrimitive.Item
|
117
|
+
ref={ref}
|
118
|
+
className={cn(
|
119
|
+
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
120
|
+
inset && "pl-8",
|
121
|
+
className
|
122
|
+
)}
|
123
|
+
{...props}
|
124
|
+
/>
|
125
|
+
))
|
126
|
+
MenubarItem.displayName = MenubarPrimitive.Item.displayName
|
127
|
+
|
128
|
+
const MenubarCheckboxItem = React.forwardRef<
|
129
|
+
React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
|
130
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
|
131
|
+
>(({ className, children, checked, ...props }, ref) => (
|
132
|
+
<MenubarPrimitive.CheckboxItem
|
133
|
+
ref={ref}
|
134
|
+
className={cn(
|
135
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
136
|
+
className
|
137
|
+
)}
|
138
|
+
checked={checked}
|
139
|
+
{...props}
|
140
|
+
>
|
141
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
142
|
+
<MenubarPrimitive.ItemIndicator>
|
143
|
+
<Check className="h-4 w-4" />
|
144
|
+
</MenubarPrimitive.ItemIndicator>
|
145
|
+
</span>
|
146
|
+
{children}
|
147
|
+
</MenubarPrimitive.CheckboxItem>
|
148
|
+
))
|
149
|
+
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
|
150
|
+
|
151
|
+
const MenubarRadioItem = React.forwardRef<
|
152
|
+
React.ElementRef<typeof MenubarPrimitive.RadioItem>,
|
153
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
|
154
|
+
>(({ className, children, ...props }, ref) => (
|
155
|
+
<MenubarPrimitive.RadioItem
|
156
|
+
ref={ref}
|
157
|
+
className={cn(
|
158
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
159
|
+
className
|
160
|
+
)}
|
161
|
+
{...props}
|
162
|
+
>
|
163
|
+
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
164
|
+
<MenubarPrimitive.ItemIndicator>
|
165
|
+
<Circle className="h-2 w-2 fill-current" />
|
166
|
+
</MenubarPrimitive.ItemIndicator>
|
167
|
+
</span>
|
168
|
+
{children}
|
169
|
+
</MenubarPrimitive.RadioItem>
|
170
|
+
))
|
171
|
+
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
|
172
|
+
|
173
|
+
const MenubarLabel = React.forwardRef<
|
174
|
+
React.ElementRef<typeof MenubarPrimitive.Label>,
|
175
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
|
176
|
+
inset?: boolean
|
177
|
+
}
|
178
|
+
>(({ className, inset, ...props }, ref) => (
|
179
|
+
<MenubarPrimitive.Label
|
180
|
+
ref={ref}
|
181
|
+
className={cn(
|
182
|
+
"px-2 py-1.5 text-sm font-semibold",
|
183
|
+
inset && "pl-8",
|
184
|
+
className
|
185
|
+
)}
|
186
|
+
{...props}
|
187
|
+
/>
|
188
|
+
))
|
189
|
+
MenubarLabel.displayName = MenubarPrimitive.Label.displayName
|
190
|
+
|
191
|
+
const MenubarSeparator = React.forwardRef<
|
192
|
+
React.ElementRef<typeof MenubarPrimitive.Separator>,
|
193
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
|
194
|
+
>(({ className, ...props }, ref) => (
|
195
|
+
<MenubarPrimitive.Separator
|
196
|
+
ref={ref}
|
197
|
+
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
198
|
+
{...props}
|
199
|
+
/>
|
200
|
+
))
|
201
|
+
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
|
202
|
+
|
203
|
+
const MenubarShortcut = ({
|
204
|
+
className,
|
205
|
+
...props
|
206
|
+
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
207
|
+
return (
|
208
|
+
<span
|
209
|
+
className={cn(
|
210
|
+
"ml-auto text-xs tracking-widest text-muted-foreground",
|
211
|
+
className
|
212
|
+
)}
|
213
|
+
{...props}
|
214
|
+
/>
|
215
|
+
)
|
216
|
+
}
|
217
|
+
MenubarShortcut.displayname = "MenubarShortcut"
|
218
|
+
|
219
|
+
export {
|
220
|
+
Menubar,
|
221
|
+
MenubarMenu,
|
222
|
+
MenubarTrigger,
|
223
|
+
MenubarContent,
|
224
|
+
MenubarItem,
|
225
|
+
MenubarSeparator,
|
226
|
+
MenubarLabel,
|
227
|
+
MenubarCheckboxItem,
|
228
|
+
MenubarRadioGroup,
|
229
|
+
MenubarRadioItem,
|
230
|
+
MenubarPortal,
|
231
|
+
MenubarSubContent,
|
232
|
+
MenubarSubTrigger,
|
233
|
+
MenubarGroup,
|
234
|
+
MenubarSub,
|
235
|
+
MenubarShortcut,
|
236
|
+
}
|
@@ -0,0 +1,128 @@
|
|
1
|
+
import * as React from "react"
|
2
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
|
3
|
+
import { cva } from "class-variance-authority"
|
4
|
+
import { ChevronDown } from "lucide-react"
|
5
|
+
|
6
|
+
import { cn } from "@/lib/utils"
|
7
|
+
|
8
|
+
const NavigationMenu = React.forwardRef<
|
9
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Root>,
|
10
|
+
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
|
11
|
+
>(({ className, children, ...props }, ref) => (
|
12
|
+
<NavigationMenuPrimitive.Root
|
13
|
+
ref={ref}
|
14
|
+
className={cn(
|
15
|
+
"relative z-10 flex max-w-max flex-1 items-center justify-center",
|
16
|
+
className
|
17
|
+
)}
|
18
|
+
{...props}
|
19
|
+
>
|
20
|
+
{children}
|
21
|
+
<NavigationMenuViewport />
|
22
|
+
</NavigationMenuPrimitive.Root>
|
23
|
+
))
|
24
|
+
NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
|
25
|
+
|
26
|
+
const NavigationMenuList = React.forwardRef<
|
27
|
+
React.ElementRef<typeof NavigationMenuPrimitive.List>,
|
28
|
+
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
|
29
|
+
>(({ className, ...props }, ref) => (
|
30
|
+
<NavigationMenuPrimitive.List
|
31
|
+
ref={ref}
|
32
|
+
className={cn(
|
33
|
+
"group flex flex-1 list-none items-center justify-center space-x-1",
|
34
|
+
className
|
35
|
+
)}
|
36
|
+
{...props}
|
37
|
+
/>
|
38
|
+
))
|
39
|
+
NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
|
40
|
+
|
41
|
+
const NavigationMenuItem = NavigationMenuPrimitive.Item
|
42
|
+
|
43
|
+
const navigationMenuTriggerStyle = cva(
|
44
|
+
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"
|
45
|
+
)
|
46
|
+
|
47
|
+
const NavigationMenuTrigger = React.forwardRef<
|
48
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
|
49
|
+
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
|
50
|
+
>(({ className, children, ...props }, ref) => (
|
51
|
+
<NavigationMenuPrimitive.Trigger
|
52
|
+
ref={ref}
|
53
|
+
className={cn(navigationMenuTriggerStyle(), "group", className)}
|
54
|
+
{...props}
|
55
|
+
>
|
56
|
+
{children}{" "}
|
57
|
+
<ChevronDown
|
58
|
+
className="relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180"
|
59
|
+
aria-hidden="true"
|
60
|
+
/>
|
61
|
+
</NavigationMenuPrimitive.Trigger>
|
62
|
+
))
|
63
|
+
NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
|
64
|
+
|
65
|
+
const NavigationMenuContent = React.forwardRef<
|
66
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Content>,
|
67
|
+
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
|
68
|
+
>(({ className, ...props }, ref) => (
|
69
|
+
<NavigationMenuPrimitive.Content
|
70
|
+
ref={ref}
|
71
|
+
className={cn(
|
72
|
+
"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",
|
73
|
+
className
|
74
|
+
)}
|
75
|
+
{...props}
|
76
|
+
/>
|
77
|
+
))
|
78
|
+
NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
|
79
|
+
|
80
|
+
const NavigationMenuLink = NavigationMenuPrimitive.Link
|
81
|
+
|
82
|
+
const NavigationMenuViewport = React.forwardRef<
|
83
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
|
84
|
+
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
|
85
|
+
>(({ className, ...props }, ref) => (
|
86
|
+
<div className={cn("absolute left-0 top-full flex justify-center")}>
|
87
|
+
<NavigationMenuPrimitive.Viewport
|
88
|
+
className={cn(
|
89
|
+
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
|
90
|
+
className
|
91
|
+
)}
|
92
|
+
ref={ref}
|
93
|
+
{...props}
|
94
|
+
/>
|
95
|
+
</div>
|
96
|
+
))
|
97
|
+
NavigationMenuViewport.displayName =
|
98
|
+
NavigationMenuPrimitive.Viewport.displayName
|
99
|
+
|
100
|
+
const NavigationMenuIndicator = React.forwardRef<
|
101
|
+
React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
|
102
|
+
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
|
103
|
+
>(({ className, ...props }, ref) => (
|
104
|
+
<NavigationMenuPrimitive.Indicator
|
105
|
+
ref={ref}
|
106
|
+
className={cn(
|
107
|
+
"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",
|
108
|
+
className
|
109
|
+
)}
|
110
|
+
{...props}
|
111
|
+
>
|
112
|
+
<div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
|
113
|
+
</NavigationMenuPrimitive.Indicator>
|
114
|
+
))
|
115
|
+
NavigationMenuIndicator.displayName =
|
116
|
+
NavigationMenuPrimitive.Indicator.displayName
|
117
|
+
|
118
|
+
export {
|
119
|
+
navigationMenuTriggerStyle,
|
120
|
+
NavigationMenu,
|
121
|
+
NavigationMenuList,
|
122
|
+
NavigationMenuItem,
|
123
|
+
NavigationMenuContent,
|
124
|
+
NavigationMenuTrigger,
|
125
|
+
NavigationMenuLink,
|
126
|
+
NavigationMenuIndicator,
|
127
|
+
NavigationMenuViewport,
|
128
|
+
}
|
@@ -0,0 +1,117 @@
|
|
1
|
+
import * as React from "react"
|
2
|
+
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"
|
3
|
+
|
4
|
+
import { cn } from "@/lib/utils"
|
5
|
+
import { ButtonProps, buttonVariants } from "@/components/ui/button"
|
6
|
+
|
7
|
+
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
8
|
+
<nav
|
9
|
+
role="navigation"
|
10
|
+
aria-label="pagination"
|
11
|
+
className={cn("mx-auto flex w-full justify-center", className)}
|
12
|
+
{...props}
|
13
|
+
/>
|
14
|
+
)
|
15
|
+
Pagination.displayName = "Pagination"
|
16
|
+
|
17
|
+
const PaginationContent = React.forwardRef<
|
18
|
+
HTMLUListElement,
|
19
|
+
React.ComponentProps<"ul">
|
20
|
+
>(({ className, ...props }, ref) => (
|
21
|
+
<ul
|
22
|
+
ref={ref}
|
23
|
+
className={cn("flex flex-row items-center gap-1", className)}
|
24
|
+
{...props}
|
25
|
+
/>
|
26
|
+
))
|
27
|
+
PaginationContent.displayName = "PaginationContent"
|
28
|
+
|
29
|
+
const PaginationItem = React.forwardRef<
|
30
|
+
HTMLLIElement,
|
31
|
+
React.ComponentProps<"li">
|
32
|
+
>(({ className, ...props }, ref) => (
|
33
|
+
<li ref={ref} className={cn("", className)} {...props} />
|
34
|
+
))
|
35
|
+
PaginationItem.displayName = "PaginationItem"
|
36
|
+
|
37
|
+
type PaginationLinkProps = {
|
38
|
+
isActive?: boolean
|
39
|
+
} & Pick<ButtonProps, "size"> &
|
40
|
+
React.ComponentProps<"a">
|
41
|
+
|
42
|
+
const PaginationLink = ({
|
43
|
+
className,
|
44
|
+
isActive,
|
45
|
+
size = "icon",
|
46
|
+
...props
|
47
|
+
}: PaginationLinkProps) => (
|
48
|
+
<a
|
49
|
+
aria-current={isActive ? "page" : undefined}
|
50
|
+
className={cn(
|
51
|
+
buttonVariants({
|
52
|
+
variant: isActive ? "outline" : "ghost",
|
53
|
+
size,
|
54
|
+
}),
|
55
|
+
className
|
56
|
+
)}
|
57
|
+
{...props}
|
58
|
+
/>
|
59
|
+
)
|
60
|
+
PaginationLink.displayName = "PaginationLink"
|
61
|
+
|
62
|
+
const PaginationPrevious = ({
|
63
|
+
className,
|
64
|
+
...props
|
65
|
+
}: React.ComponentProps<typeof PaginationLink>) => (
|
66
|
+
<PaginationLink
|
67
|
+
aria-label="Go to previous page"
|
68
|
+
size="default"
|
69
|
+
className={cn("gap-1 pl-2.5", className)}
|
70
|
+
{...props}
|
71
|
+
>
|
72
|
+
<ChevronLeft className="h-4 w-4" />
|
73
|
+
<span>Previous</span>
|
74
|
+
</PaginationLink>
|
75
|
+
)
|
76
|
+
PaginationPrevious.displayName = "PaginationPrevious"
|
77
|
+
|
78
|
+
const PaginationNext = ({
|
79
|
+
className,
|
80
|
+
...props
|
81
|
+
}: React.ComponentProps<typeof PaginationLink>) => (
|
82
|
+
<PaginationLink
|
83
|
+
aria-label="Go to next page"
|
84
|
+
size="default"
|
85
|
+
className={cn("gap-1 pr-2.5", className)}
|
86
|
+
{...props}
|
87
|
+
>
|
88
|
+
<span>Next</span>
|
89
|
+
<ChevronRight className="h-4 w-4" />
|
90
|
+
</PaginationLink>
|
91
|
+
)
|
92
|
+
PaginationNext.displayName = "PaginationNext"
|
93
|
+
|
94
|
+
const PaginationEllipsis = ({
|
95
|
+
className,
|
96
|
+
...props
|
97
|
+
}: React.ComponentProps<"span">) => (
|
98
|
+
<span
|
99
|
+
aria-hidden
|
100
|
+
className={cn("flex h-9 w-9 items-center justify-center", className)}
|
101
|
+
{...props}
|
102
|
+
>
|
103
|
+
<MoreHorizontal className="h-4 w-4" />
|
104
|
+
<span className="sr-only">More pages</span>
|
105
|
+
</span>
|
106
|
+
)
|
107
|
+
PaginationEllipsis.displayName = "PaginationEllipsis"
|
108
|
+
|
109
|
+
export {
|
110
|
+
Pagination,
|
111
|
+
PaginationContent,
|
112
|
+
PaginationEllipsis,
|
113
|
+
PaginationItem,
|
114
|
+
PaginationLink,
|
115
|
+
PaginationNext,
|
116
|
+
PaginationPrevious,
|
117
|
+
}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use client"
|
2
|
+
|
3
|
+
import * as React from "react"
|
4
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover"
|
5
|
+
|
6
|
+
import { cn } from "@/lib/utils"
|
7
|
+
|
8
|
+
const Popover = PopoverPrimitive.Root
|
9
|
+
|
10
|
+
const PopoverTrigger = PopoverPrimitive.Trigger
|
11
|
+
|
12
|
+
const PopoverContent = React.forwardRef<
|
13
|
+
React.ElementRef<typeof PopoverPrimitive.Content>,
|
14
|
+
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
|
15
|
+
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
|
16
|
+
<PopoverPrimitive.Portal>
|
17
|
+
<PopoverPrimitive.Content
|
18
|
+
ref={ref}
|
19
|
+
align={align}
|
20
|
+
sideOffset={sideOffset}
|
21
|
+
className={cn(
|
22
|
+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
23
|
+
className
|
24
|
+
)}
|
25
|
+
{...props}
|
26
|
+
/>
|
27
|
+
</PopoverPrimitive.Portal>
|
28
|
+
))
|
29
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName
|
30
|
+
|
31
|
+
export { Popover, PopoverTrigger, PopoverContent }
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use client"
|
2
|
+
|
3
|
+
import * as React from "react"
|
4
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress"
|
5
|
+
|
6
|
+
import { cn } from "@/lib/utils"
|
7
|
+
|
8
|
+
const Progress = React.forwardRef<
|
9
|
+
React.ElementRef<typeof ProgressPrimitive.Root>,
|
10
|
+
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
|
11
|
+
>(({ className, value, ...props }, ref) => (
|
12
|
+
<ProgressPrimitive.Root
|
13
|
+
ref={ref}
|
14
|
+
className={cn(
|
15
|
+
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
|
16
|
+
className
|
17
|
+
)}
|
18
|
+
{...props}
|
19
|
+
>
|
20
|
+
<ProgressPrimitive.Indicator
|
21
|
+
className="h-full w-full flex-1 bg-primary transition-all"
|
22
|
+
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
23
|
+
/>
|
24
|
+
</ProgressPrimitive.Root>
|
25
|
+
))
|
26
|
+
Progress.displayName = ProgressPrimitive.Root.displayName
|
27
|
+
|
28
|
+
export { Progress }
|
@@ -0,0 +1,44 @@
|
|
1
|
+
"use client"
|
2
|
+
|
3
|
+
import * as React from "react"
|
4
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
5
|
+
import { Circle } from "lucide-react"
|
6
|
+
|
7
|
+
import { cn } from "@/lib/utils"
|
8
|
+
|
9
|
+
const RadioGroup = React.forwardRef<
|
10
|
+
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
11
|
+
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
|
12
|
+
>(({ className, ...props }, ref) => {
|
13
|
+
return (
|
14
|
+
<RadioGroupPrimitive.Root
|
15
|
+
className={cn("grid gap-2", className)}
|
16
|
+
{...props}
|
17
|
+
ref={ref}
|
18
|
+
/>
|
19
|
+
)
|
20
|
+
})
|
21
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName
|
22
|
+
|
23
|
+
const RadioGroupItem = React.forwardRef<
|
24
|
+
React.ElementRef<typeof RadioGroupPrimitive.Item>,
|
25
|
+
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
|
26
|
+
>(({ className, ...props }, ref) => {
|
27
|
+
return (
|
28
|
+
<RadioGroupPrimitive.Item
|
29
|
+
ref={ref}
|
30
|
+
className={cn(
|
31
|
+
"aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
32
|
+
className
|
33
|
+
)}
|
34
|
+
{...props}
|
35
|
+
>
|
36
|
+
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
37
|
+
<Circle className="h-2.5 w-2.5 fill-current text-current" />
|
38
|
+
</RadioGroupPrimitive.Indicator>
|
39
|
+
</RadioGroupPrimitive.Item>
|
40
|
+
)
|
41
|
+
})
|
42
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
|
43
|
+
|
44
|
+
export { RadioGroup, RadioGroupItem }
|
@@ -0,0 +1,45 @@
|
|
1
|
+
"use client"
|
2
|
+
|
3
|
+
import { GripVertical } from "lucide-react"
|
4
|
+
import * as ResizablePrimitive from "react-resizable-panels"
|
5
|
+
|
6
|
+
import { cn } from "@/lib/utils"
|
7
|
+
|
8
|
+
const ResizablePanelGroup = ({
|
9
|
+
className,
|
10
|
+
...props
|
11
|
+
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
|
12
|
+
<ResizablePrimitive.PanelGroup
|
13
|
+
className={cn(
|
14
|
+
"flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
|
15
|
+
className
|
16
|
+
)}
|
17
|
+
{...props}
|
18
|
+
/>
|
19
|
+
)
|
20
|
+
|
21
|
+
const ResizablePanel = ResizablePrimitive.Panel
|
22
|
+
|
23
|
+
const ResizableHandle = ({
|
24
|
+
withHandle,
|
25
|
+
className,
|
26
|
+
...props
|
27
|
+
}: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
28
|
+
withHandle?: boolean
|
29
|
+
}) => (
|
30
|
+
<ResizablePrimitive.PanelResizeHandle
|
31
|
+
className={cn(
|
32
|
+
"relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 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-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
|
33
|
+
className
|
34
|
+
)}
|
35
|
+
{...props}
|
36
|
+
>
|
37
|
+
{withHandle && (
|
38
|
+
<div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
|
39
|
+
<GripVertical className="h-2.5 w-2.5" />
|
40
|
+
</div>
|
41
|
+
)}
|
42
|
+
</ResizablePrimitive.PanelResizeHandle>
|
43
|
+
)
|
44
|
+
|
45
|
+
export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
|
@@ -0,0 +1,48 @@
|
|
1
|
+
"use client"
|
2
|
+
|
3
|
+
import * as React from "react"
|
4
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"
|
5
|
+
|
6
|
+
import { cn } from "@/lib/utils"
|
7
|
+
|
8
|
+
const ScrollArea = React.forwardRef<
|
9
|
+
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
10
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
11
|
+
>(({ className, children, ...props }, ref) => (
|
12
|
+
<ScrollAreaPrimitive.Root
|
13
|
+
ref={ref}
|
14
|
+
className={cn("relative overflow-hidden", className)}
|
15
|
+
{...props}
|
16
|
+
>
|
17
|
+
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
18
|
+
{children}
|
19
|
+
</ScrollAreaPrimitive.Viewport>
|
20
|
+
<ScrollBar />
|
21
|
+
<ScrollAreaPrimitive.Corner />
|
22
|
+
</ScrollAreaPrimitive.Root>
|
23
|
+
))
|
24
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName
|
25
|
+
|
26
|
+
const ScrollBar = React.forwardRef<
|
27
|
+
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
28
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
|
29
|
+
>(({ className, orientation = "vertical", ...props }, ref) => (
|
30
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
31
|
+
ref={ref}
|
32
|
+
orientation={orientation}
|
33
|
+
className={cn(
|
34
|
+
"flex touch-none select-none transition-colors",
|
35
|
+
orientation === "vertical" &&
|
36
|
+
"h-full w-2.5 border-l border-l-transparent p-[1px]",
|
37
|
+
orientation === "horizontal" &&
|
38
|
+
"h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
39
|
+
className
|
40
|
+
)}
|
41
|
+
{...props}
|
42
|
+
>
|
43
|
+
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
44
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
45
|
+
))
|
46
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName
|
47
|
+
|
48
|
+
export { ScrollArea, ScrollBar }
|