@agent-native/toolkit 0.6.0 → 0.8.0
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/README.md +17 -1
- package/agent-native.eject.json +411 -0
- package/dist/chat-history/ChatHistoryList.d.ts +103 -0
- package/dist/chat-history/ChatHistoryList.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryList.js +109 -0
- package/dist/chat-history/ChatHistoryList.js.map +1 -0
- package/dist/chat-history/ChatHistoryList.spec.d.ts +2 -0
- package/dist/chat-history/ChatHistoryList.spec.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryList.spec.js +283 -0
- package/dist/chat-history/ChatHistoryList.spec.js.map +1 -0
- package/dist/chat-history/index.d.ts +2 -0
- package/dist/chat-history/index.d.ts.map +1 -0
- package/dist/chat-history/index.js +2 -0
- package/dist/chat-history/index.js.map +1 -0
- package/dist/chat-history.css +314 -0
- package/package.json +20 -1
- package/src/app-shell/header-actions.tsx +84 -0
- package/src/app-shell/index.ts +1 -0
- package/src/chat-history/ChatHistoryList.spec.tsx +453 -0
- package/src/chat-history/ChatHistoryList.tsx +469 -0
- package/src/chat-history/index.ts +7 -0
- package/src/chat-history.css +314 -0
- package/src/collab-ui/AgentPresenceChip.tsx +69 -0
- package/src/collab-ui/LiveCursorOverlay.tsx +241 -0
- package/src/collab-ui/PresenceBar.tsx +346 -0
- package/src/collab-ui/RecentEditHighlights.tsx +225 -0
- package/src/collab-ui/RemoteSelectionRings.tsx +227 -0
- package/src/collab-ui/agent-identity.ts +16 -0
- package/src/collab-ui/index.ts +39 -0
- package/src/collab-ui/lead-client.ts +32 -0
- package/src/collab-ui/types.spec.ts +18 -0
- package/src/collab-ui/types.ts +96 -0
- package/src/composer/AgentComposerFrame.tsx +59 -0
- package/src/composer/ComposerPlusMenu.tsx +983 -0
- package/src/composer/MentionPopover.tsx +412 -0
- package/src/composer/PastedTextChip.tsx +150 -0
- package/src/composer/PromptComposer.spec.ts +73 -0
- package/src/composer/PromptComposer.tsx +718 -0
- package/src/composer/RealtimeVoiceMode.spec.tsx +771 -0
- package/src/composer/RealtimeVoiceMode.tsx +856 -0
- package/src/composer/TiptapComposer.spec.ts +390 -0
- package/src/composer/TiptapComposer.tsx +2936 -0
- package/src/composer/VoiceButton.spec.ts +33 -0
- package/src/composer/VoiceButton.tsx +255 -0
- package/src/composer/asset-picker-url.spec.ts +56 -0
- package/src/composer/asset-picker-url.ts +80 -0
- package/src/composer/attachment-accept.spec.ts +22 -0
- package/src/composer/attachment-accept.ts +71 -0
- package/src/composer/draft-key.spec.ts +19 -0
- package/src/composer/draft-key.ts +7 -0
- package/src/composer/extensions/FileReference.tsx +55 -0
- package/src/composer/extensions/MentionReference.tsx +93 -0
- package/src/composer/extensions/SkillReference.tsx +56 -0
- package/src/composer/index.ts +79 -0
- package/src/composer/pasted-text.spec.ts +162 -0
- package/src/composer/pasted-text.ts +160 -0
- package/src/composer/prompt-attachments.spec.ts +80 -0
- package/src/composer/prompt-attachments.ts +93 -0
- package/src/composer/realtime-voice-audio-level.spec.ts +32 -0
- package/src/composer/realtime-voice-audio-level.ts +64 -0
- package/src/composer/realtime-voice-transcript.spec.ts +95 -0
- package/src/composer/realtime-voice-transcript.ts +134 -0
- package/src/composer/runtime-adapters.tsx +343 -0
- package/src/composer/types.ts +66 -0
- package/src/composer/use-file-search.ts +64 -0
- package/src/composer/use-mention-search.ts +90 -0
- package/src/composer/use-skills.ts +45 -0
- package/src/composer/useRealtimeVoiceMode.spec.ts +818 -0
- package/src/composer/useRealtimeVoiceMode.tsx +2117 -0
- package/src/composer/useVoiceDictation.spec.ts +45 -0
- package/src/composer/useVoiceDictation.ts +1191 -0
- package/src/context-ui/ContextMeter.tsx +101 -0
- package/src/context-ui/ContextSegmentRow.tsx +184 -0
- package/src/context-ui/ContextTreemap.tsx +125 -0
- package/src/context-ui/ContextXRayPanel.tsx +377 -0
- package/src/context-ui/format.ts +42 -0
- package/src/context-ui/index.ts +15 -0
- package/src/context-ui/types.ts +43 -0
- package/src/design-tweaks/index.ts +1 -0
- package/src/design-tweaks/visual-style-controls.tsx +1084 -0
- package/src/editor/BubbleToolbar.tsx +253 -0
- package/src/editor/CodeBlockNode.tsx +254 -0
- package/src/editor/DragHandle.spec.ts +588 -0
- package/src/editor/DragHandle.ts +1437 -0
- package/src/editor/ImageExtension.roundtrip.spec.ts +117 -0
- package/src/editor/ImageExtension.ts +306 -0
- package/src/editor/RegistryBlockContext.tsx +107 -0
- package/src/editor/RegistryBlockNode.spec.ts +279 -0
- package/src/editor/RegistryBlockNode.tsx +652 -0
- package/src/editor/RichMarkdownEditor.collab.spec.ts +79 -0
- package/src/editor/RichMarkdownEditor.roundtrip.spec.ts +226 -0
- package/src/editor/RichMarkdownEditor.tsx +81 -0
- package/src/editor/RunId.ts +61 -0
- package/src/editor/SharedRichEditor.tsx +321 -0
- package/src/editor/SlashCommandMenu.tsx +310 -0
- package/src/editor/disableHistory.spec.ts +85 -0
- package/src/editor/extensions.ts +402 -0
- package/src/editor/gfmDoc.spec.ts +230 -0
- package/src/editor/gfmDoc.ts +92 -0
- package/src/editor/index.ts +93 -0
- package/src/editor/registrySlashCommands.ts +131 -0
- package/src/editor/structuralReorderUndo.spec.ts +144 -0
- package/src/editor/surgical-apply.spec.ts +279 -0
- package/src/editor/surgical-apply.ts +192 -0
- package/src/editor/useCollabReconcile.concurrent.spec.ts +422 -0
- package/src/editor/useCollabReconcile.idempotent.spec.ts +324 -0
- package/src/editor/useCollabReconcile.ts +589 -0
- package/src/editor.css +510 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/use-mobile.tsx +21 -0
- package/src/hooks/use-toast.ts +188 -0
- package/src/index.ts +8 -0
- package/src/onboarding/index.ts +1 -0
- package/src/provider.tsx +47 -0
- package/src/sharing/VisibilityBadge.spec.ts +96 -0
- package/src/sharing/VisibilityBadge.tsx +37 -0
- package/src/sharing/index.ts +4 -0
- package/src/styles.css +21 -0
- package/src/ui/accordion.tsx +56 -0
- package/src/ui/alert-dialog.tsx +141 -0
- package/src/ui/alert.tsx +59 -0
- package/src/ui/aspect-ratio.tsx +5 -0
- package/src/ui/avatar.tsx +48 -0
- package/src/ui/badge.tsx +37 -0
- package/src/ui/breadcrumb.tsx +115 -0
- package/src/ui/button.tsx +78 -0
- package/src/ui/calendar.tsx +214 -0
- package/src/ui/card.tsx +86 -0
- package/src/ui/carousel.tsx +260 -0
- package/src/ui/chart.tsx +375 -0
- package/src/ui/checkbox.tsx +28 -0
- package/src/ui/collapsible.tsx +9 -0
- package/src/ui/command.spec.tsx +51 -0
- package/src/ui/command.tsx +174 -0
- package/src/ui/context-menu.tsx +202 -0
- package/src/ui/date-picker.tsx +64 -0
- package/src/ui/dialog.spec.tsx +43 -0
- package/src/ui/dialog.tsx +146 -0
- package/src/ui/drawer.tsx +126 -0
- package/src/ui/dropdown-menu.tsx +218 -0
- package/src/ui/form.tsx +177 -0
- package/src/ui/hover-card.tsx +27 -0
- package/src/ui/index.ts +52 -0
- package/src/ui/input-otp.tsx +69 -0
- package/src/ui/input.tsx +22 -0
- package/src/ui/label.tsx +24 -0
- package/src/ui/logo.tsx +36 -0
- package/src/ui/menubar.tsx +235 -0
- package/src/ui/navigation-menu.tsx +128 -0
- package/src/ui/pagination.tsx +121 -0
- package/src/ui/popover.tsx +44 -0
- package/src/ui/progress.tsx +26 -0
- package/src/ui/radio-group.tsx +42 -0
- package/src/ui/resizable.tsx +43 -0
- package/src/ui/scroll-area.tsx +46 -0
- package/src/ui/select.tsx +158 -0
- package/src/ui/separator.tsx +29 -0
- package/src/ui/sheet.tsx +160 -0
- package/src/ui/sidebar.tsx +777 -0
- package/src/ui/skeleton.tsx +18 -0
- package/src/ui/slider.tsx +26 -0
- package/src/ui/sonner.tsx +58 -0
- package/src/ui/spinner.tsx +17 -0
- package/src/ui/switch.tsx +27 -0
- package/src/ui/table.tsx +117 -0
- package/src/ui/tabs.tsx +53 -0
- package/src/ui/textarea.tsx +23 -0
- package/src/ui/toast.tsx +127 -0
- package/src/ui/toaster.tsx +33 -0
- package/src/ui/toggle-group.tsx +59 -0
- package/src/ui/toggle.tsx +43 -0
- package/src/ui/tooltip.tsx +53 -0
- package/src/ui/use-toast.ts +3 -0
- package/src/utils.ts +8 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
|
2
|
+
import { IconCheck, IconChevronRight, IconCircle } from "@tabler/icons-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../utils.js";
|
|
6
|
+
|
|
7
|
+
const MenubarMenu: typeof MenubarPrimitive.Menu = MenubarPrimitive.Menu;
|
|
8
|
+
|
|
9
|
+
const MenubarGroup: typeof MenubarPrimitive.Group = MenubarPrimitive.Group;
|
|
10
|
+
|
|
11
|
+
const MenubarPortal: typeof MenubarPrimitive.Portal = MenubarPrimitive.Portal;
|
|
12
|
+
|
|
13
|
+
const MenubarSub: typeof MenubarPrimitive.Sub = MenubarPrimitive.Sub;
|
|
14
|
+
|
|
15
|
+
const MenubarRadioGroup: typeof MenubarPrimitive.RadioGroup =
|
|
16
|
+
MenubarPrimitive.RadioGroup;
|
|
17
|
+
|
|
18
|
+
const Menubar = React.forwardRef<
|
|
19
|
+
React.ElementRef<typeof MenubarPrimitive.Root>,
|
|
20
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
|
|
21
|
+
>(({ className, ...props }, ref) => (
|
|
22
|
+
<MenubarPrimitive.Root
|
|
23
|
+
ref={ref}
|
|
24
|
+
className={cn(
|
|
25
|
+
"flex h-10 items-center space-x-1 rounded-md border bg-background p-1",
|
|
26
|
+
className,
|
|
27
|
+
)}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
));
|
|
31
|
+
Menubar.displayName = MenubarPrimitive.Root.displayName;
|
|
32
|
+
|
|
33
|
+
const MenubarTrigger = React.forwardRef<
|
|
34
|
+
React.ElementRef<typeof MenubarPrimitive.Trigger>,
|
|
35
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
|
|
36
|
+
>(({ className, ...props }, ref) => (
|
|
37
|
+
<MenubarPrimitive.Trigger
|
|
38
|
+
ref={ref}
|
|
39
|
+
className={cn(
|
|
40
|
+
"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",
|
|
41
|
+
className,
|
|
42
|
+
)}
|
|
43
|
+
{...props}
|
|
44
|
+
/>
|
|
45
|
+
));
|
|
46
|
+
MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName;
|
|
47
|
+
|
|
48
|
+
const MenubarSubTrigger = React.forwardRef<
|
|
49
|
+
React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
|
|
50
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
|
|
51
|
+
inset?: boolean;
|
|
52
|
+
}
|
|
53
|
+
>(({ className, inset, children, ...props }, ref) => (
|
|
54
|
+
<MenubarPrimitive.SubTrigger
|
|
55
|
+
ref={ref}
|
|
56
|
+
className={cn(
|
|
57
|
+
"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",
|
|
58
|
+
inset && "ps-8",
|
|
59
|
+
className,
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
>
|
|
63
|
+
{children}
|
|
64
|
+
<IconChevronRight className="ms-auto h-4 w-4 rtl:-scale-x-100" />
|
|
65
|
+
</MenubarPrimitive.SubTrigger>
|
|
66
|
+
));
|
|
67
|
+
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
68
|
+
|
|
69
|
+
const MenubarSubContent = React.forwardRef<
|
|
70
|
+
React.ElementRef<typeof MenubarPrimitive.SubContent>,
|
|
71
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
|
|
72
|
+
>(({ className, ...props }, ref) => (
|
|
73
|
+
<MenubarPrimitive.SubContent
|
|
74
|
+
ref={ref}
|
|
75
|
+
className={cn(
|
|
76
|
+
"z-[290] min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground origin-[var(--radix-menubar-content-transform-origin)] 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 motion-reduce:data-[state=open]:zoom-in-100 motion-reduce:data-[state=closed]:zoom-out-100 motion-reduce:data-[side=bottom]:slide-in-from-top-0 motion-reduce:data-[side=left]:slide-in-from-right-0 motion-reduce:data-[side=right]:slide-in-from-left-0 motion-reduce:data-[side=top]:slide-in-from-bottom-0",
|
|
77
|
+
className,
|
|
78
|
+
)}
|
|
79
|
+
{...props}
|
|
80
|
+
/>
|
|
81
|
+
));
|
|
82
|
+
MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName;
|
|
83
|
+
|
|
84
|
+
const MenubarContent = React.forwardRef<
|
|
85
|
+
React.ElementRef<typeof MenubarPrimitive.Content>,
|
|
86
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
|
|
87
|
+
>(
|
|
88
|
+
(
|
|
89
|
+
{ className, align = "start", alignOffset = -4, sideOffset = 8, ...props },
|
|
90
|
+
ref,
|
|
91
|
+
) => (
|
|
92
|
+
<MenubarPrimitive.Portal>
|
|
93
|
+
<MenubarPrimitive.Content
|
|
94
|
+
ref={ref}
|
|
95
|
+
align={align}
|
|
96
|
+
alignOffset={alignOffset}
|
|
97
|
+
sideOffset={sideOffset}
|
|
98
|
+
className={cn(
|
|
99
|
+
"z-[290] min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md origin-[var(--radix-menubar-content-transform-origin)] 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 motion-reduce:data-[state=open]:zoom-in-100 motion-reduce:data-[state=closed]:zoom-out-100 motion-reduce:data-[side=bottom]:slide-in-from-top-0 motion-reduce:data-[side=left]:slide-in-from-right-0 motion-reduce:data-[side=right]:slide-in-from-left-0 motion-reduce:data-[side=top]:slide-in-from-bottom-0",
|
|
100
|
+
className,
|
|
101
|
+
)}
|
|
102
|
+
{...props}
|
|
103
|
+
/>
|
|
104
|
+
</MenubarPrimitive.Portal>
|
|
105
|
+
),
|
|
106
|
+
);
|
|
107
|
+
MenubarContent.displayName = MenubarPrimitive.Content.displayName;
|
|
108
|
+
|
|
109
|
+
const MenubarItem = React.forwardRef<
|
|
110
|
+
React.ElementRef<typeof MenubarPrimitive.Item>,
|
|
111
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
|
|
112
|
+
inset?: boolean;
|
|
113
|
+
}
|
|
114
|
+
>(({ className, inset, ...props }, ref) => (
|
|
115
|
+
<MenubarPrimitive.Item
|
|
116
|
+
ref={ref}
|
|
117
|
+
className={cn(
|
|
118
|
+
"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",
|
|
119
|
+
inset && "ps-8",
|
|
120
|
+
className,
|
|
121
|
+
)}
|
|
122
|
+
{...props}
|
|
123
|
+
/>
|
|
124
|
+
));
|
|
125
|
+
MenubarItem.displayName = MenubarPrimitive.Item.displayName;
|
|
126
|
+
|
|
127
|
+
const MenubarCheckboxItem = React.forwardRef<
|
|
128
|
+
React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
|
|
129
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
|
|
130
|
+
>(({ className, children, checked, ...props }, ref) => (
|
|
131
|
+
<MenubarPrimitive.CheckboxItem
|
|
132
|
+
ref={ref}
|
|
133
|
+
className={cn(
|
|
134
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 ps-8 pe-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
135
|
+
className,
|
|
136
|
+
)}
|
|
137
|
+
checked={checked}
|
|
138
|
+
{...props}
|
|
139
|
+
>
|
|
140
|
+
<span className="absolute start-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
141
|
+
<MenubarPrimitive.ItemIndicator>
|
|
142
|
+
<IconCheck className="h-4 w-4" />
|
|
143
|
+
</MenubarPrimitive.ItemIndicator>
|
|
144
|
+
</span>
|
|
145
|
+
{children}
|
|
146
|
+
</MenubarPrimitive.CheckboxItem>
|
|
147
|
+
));
|
|
148
|
+
MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName;
|
|
149
|
+
|
|
150
|
+
const MenubarRadioItem = React.forwardRef<
|
|
151
|
+
React.ElementRef<typeof MenubarPrimitive.RadioItem>,
|
|
152
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
|
|
153
|
+
>(({ className, children, ...props }, ref) => (
|
|
154
|
+
<MenubarPrimitive.RadioItem
|
|
155
|
+
ref={ref}
|
|
156
|
+
className={cn(
|
|
157
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 ps-8 pe-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
158
|
+
className,
|
|
159
|
+
)}
|
|
160
|
+
{...props}
|
|
161
|
+
>
|
|
162
|
+
<span className="absolute start-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
163
|
+
<MenubarPrimitive.ItemIndicator>
|
|
164
|
+
<IconCircle className="h-2 w-2 fill-current" />
|
|
165
|
+
</MenubarPrimitive.ItemIndicator>
|
|
166
|
+
</span>
|
|
167
|
+
{children}
|
|
168
|
+
</MenubarPrimitive.RadioItem>
|
|
169
|
+
));
|
|
170
|
+
MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName;
|
|
171
|
+
|
|
172
|
+
const MenubarLabel = React.forwardRef<
|
|
173
|
+
React.ElementRef<typeof MenubarPrimitive.Label>,
|
|
174
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
|
|
175
|
+
inset?: boolean;
|
|
176
|
+
}
|
|
177
|
+
>(({ className, inset, ...props }, ref) => (
|
|
178
|
+
<MenubarPrimitive.Label
|
|
179
|
+
ref={ref}
|
|
180
|
+
className={cn(
|
|
181
|
+
"px-2 py-1.5 text-sm font-semibold",
|
|
182
|
+
inset && "ps-8",
|
|
183
|
+
className,
|
|
184
|
+
)}
|
|
185
|
+
{...props}
|
|
186
|
+
/>
|
|
187
|
+
));
|
|
188
|
+
MenubarLabel.displayName = MenubarPrimitive.Label.displayName;
|
|
189
|
+
|
|
190
|
+
const MenubarSeparator = React.forwardRef<
|
|
191
|
+
React.ElementRef<typeof MenubarPrimitive.Separator>,
|
|
192
|
+
React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
|
|
193
|
+
>(({ className, ...props }, ref) => (
|
|
194
|
+
<MenubarPrimitive.Separator
|
|
195
|
+
ref={ref}
|
|
196
|
+
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
197
|
+
{...props}
|
|
198
|
+
/>
|
|
199
|
+
));
|
|
200
|
+
MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
201
|
+
|
|
202
|
+
const MenubarShortcut = ({
|
|
203
|
+
className,
|
|
204
|
+
...props
|
|
205
|
+
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
206
|
+
return (
|
|
207
|
+
<span
|
|
208
|
+
className={cn(
|
|
209
|
+
"ms-auto text-xs tracking-widest text-muted-foreground",
|
|
210
|
+
className,
|
|
211
|
+
)}
|
|
212
|
+
{...props}
|
|
213
|
+
/>
|
|
214
|
+
);
|
|
215
|
+
};
|
|
216
|
+
MenubarShortcut.displayname = "MenubarShortcut";
|
|
217
|
+
|
|
218
|
+
export {
|
|
219
|
+
Menubar,
|
|
220
|
+
MenubarMenu,
|
|
221
|
+
MenubarTrigger,
|
|
222
|
+
MenubarContent,
|
|
223
|
+
MenubarItem,
|
|
224
|
+
MenubarSeparator,
|
|
225
|
+
MenubarLabel,
|
|
226
|
+
MenubarCheckboxItem,
|
|
227
|
+
MenubarRadioGroup,
|
|
228
|
+
MenubarRadioItem,
|
|
229
|
+
MenubarPortal,
|
|
230
|
+
MenubarSubContent,
|
|
231
|
+
MenubarSubTrigger,
|
|
232
|
+
MenubarGroup,
|
|
233
|
+
MenubarSub,
|
|
234
|
+
MenubarShortcut,
|
|
235
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
2
|
+
import { IconChevronDown } from "@tabler/icons-react";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../utils.js";
|
|
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-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent",
|
|
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
|
+
<IconChevronDown
|
|
58
|
+
className="relative top-[1px] ms-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
|
+
"start-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 start-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,121 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IconChevronLeft,
|
|
3
|
+
IconChevronRight,
|
|
4
|
+
IconDots,
|
|
5
|
+
} from "@tabler/icons-react";
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
|
|
8
|
+
import { cn } from "../utils.js";
|
|
9
|
+
import { ButtonProps, buttonVariants } from "./button.js";
|
|
10
|
+
|
|
11
|
+
const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
|
|
12
|
+
<nav
|
|
13
|
+
role="navigation"
|
|
14
|
+
aria-label="pagination"
|
|
15
|
+
className={cn("mx-auto flex w-full justify-center", className)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
Pagination.displayName = "Pagination";
|
|
20
|
+
|
|
21
|
+
const PaginationContent = React.forwardRef<
|
|
22
|
+
HTMLUListElement,
|
|
23
|
+
React.ComponentProps<"ul">
|
|
24
|
+
>(({ className, ...props }, ref) => (
|
|
25
|
+
<ul
|
|
26
|
+
ref={ref}
|
|
27
|
+
className={cn("flex flex-row items-center gap-1", className)}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
));
|
|
31
|
+
PaginationContent.displayName = "PaginationContent";
|
|
32
|
+
|
|
33
|
+
const PaginationItem = React.forwardRef<
|
|
34
|
+
HTMLLIElement,
|
|
35
|
+
React.ComponentProps<"li">
|
|
36
|
+
>(({ className, ...props }, ref) => (
|
|
37
|
+
<li ref={ref} className={cn("", className)} {...props} />
|
|
38
|
+
));
|
|
39
|
+
PaginationItem.displayName = "PaginationItem";
|
|
40
|
+
|
|
41
|
+
type PaginationLinkProps = {
|
|
42
|
+
isActive?: boolean;
|
|
43
|
+
} & Pick<ButtonProps, "size"> &
|
|
44
|
+
React.ComponentProps<"a">;
|
|
45
|
+
|
|
46
|
+
const PaginationLink = ({
|
|
47
|
+
className,
|
|
48
|
+
isActive,
|
|
49
|
+
size = "icon",
|
|
50
|
+
...props
|
|
51
|
+
}: PaginationLinkProps) => (
|
|
52
|
+
<a
|
|
53
|
+
aria-current={isActive ? "page" : undefined}
|
|
54
|
+
className={cn(
|
|
55
|
+
buttonVariants({
|
|
56
|
+
variant: isActive ? "outline" : "ghost",
|
|
57
|
+
size,
|
|
58
|
+
}),
|
|
59
|
+
className,
|
|
60
|
+
)}
|
|
61
|
+
{...props}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
PaginationLink.displayName = "PaginationLink";
|
|
65
|
+
|
|
66
|
+
const PaginationPrevious = ({
|
|
67
|
+
className,
|
|
68
|
+
...props
|
|
69
|
+
}: React.ComponentProps<typeof PaginationLink>) => (
|
|
70
|
+
<PaginationLink
|
|
71
|
+
aria-label="Go to previous page"
|
|
72
|
+
size="default"
|
|
73
|
+
className={cn("gap-1 ps-2.5", className)}
|
|
74
|
+
{...props}
|
|
75
|
+
>
|
|
76
|
+
<IconChevronLeft className="h-4 w-4 rtl:-scale-x-100" />
|
|
77
|
+
<span>Previous</span>
|
|
78
|
+
</PaginationLink>
|
|
79
|
+
);
|
|
80
|
+
PaginationPrevious.displayName = "PaginationPrevious";
|
|
81
|
+
|
|
82
|
+
const PaginationNext = ({
|
|
83
|
+
className,
|
|
84
|
+
...props
|
|
85
|
+
}: React.ComponentProps<typeof PaginationLink>) => (
|
|
86
|
+
<PaginationLink
|
|
87
|
+
aria-label="Go to next page"
|
|
88
|
+
size="default"
|
|
89
|
+
className={cn("gap-1 pe-2.5", className)}
|
|
90
|
+
{...props}
|
|
91
|
+
>
|
|
92
|
+
<span>Next</span>
|
|
93
|
+
<IconChevronRight className="h-4 w-4 rtl:-scale-x-100" />
|
|
94
|
+
</PaginationLink>
|
|
95
|
+
);
|
|
96
|
+
PaginationNext.displayName = "PaginationNext";
|
|
97
|
+
|
|
98
|
+
const PaginationEllipsis = ({
|
|
99
|
+
className,
|
|
100
|
+
...props
|
|
101
|
+
}: React.ComponentProps<"span">) => (
|
|
102
|
+
<span
|
|
103
|
+
aria-hidden
|
|
104
|
+
className={cn("flex h-9 w-9 items-center justify-center", className)}
|
|
105
|
+
{...props}
|
|
106
|
+
>
|
|
107
|
+
<IconDots className="h-4 w-4" />
|
|
108
|
+
<span className="sr-only">More pages</span>
|
|
109
|
+
</span>
|
|
110
|
+
);
|
|
111
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
112
|
+
|
|
113
|
+
export {
|
|
114
|
+
Pagination,
|
|
115
|
+
PaginationContent,
|
|
116
|
+
PaginationEllipsis,
|
|
117
|
+
PaginationItem,
|
|
118
|
+
PaginationLink,
|
|
119
|
+
PaginationNext,
|
|
120
|
+
PaginationPrevious,
|
|
121
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../utils.js";
|
|
5
|
+
|
|
6
|
+
const Popover = PopoverPrimitive.Root;
|
|
7
|
+
|
|
8
|
+
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
9
|
+
|
|
10
|
+
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
11
|
+
|
|
12
|
+
const PopoverContent = React.forwardRef<
|
|
13
|
+
React.ElementRef<typeof PopoverPrimitive.Content>,
|
|
14
|
+
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & {
|
|
15
|
+
// When false, renders inline without a portal — useful inside overflow-hidden
|
|
16
|
+
// containers where a portalled overlay would escape the clip boundary.
|
|
17
|
+
portalled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
>(
|
|
20
|
+
(
|
|
21
|
+
{ className, align = "center", sideOffset = 4, portalled = true, ...props },
|
|
22
|
+
ref,
|
|
23
|
+
) => {
|
|
24
|
+
const content = (
|
|
25
|
+
<PopoverPrimitive.Content
|
|
26
|
+
ref={ref}
|
|
27
|
+
align={align}
|
|
28
|
+
sideOffset={sideOffset}
|
|
29
|
+
className={cn(
|
|
30
|
+
"z-[290] w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none origin-[var(--radix-popover-content-transform-origin)] 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 motion-reduce:data-[state=open]:zoom-in-100 motion-reduce:data-[state=closed]:zoom-out-100 motion-reduce:data-[side=bottom]:slide-in-from-top-0 motion-reduce:data-[side=left]:slide-in-from-right-0 motion-reduce:data-[side=right]:slide-in-from-left-0 motion-reduce:data-[side=top]:slide-in-from-bottom-0",
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
if (!portalled) return content;
|
|
38
|
+
|
|
39
|
+
return <PopoverPrimitive.Portal>{content}</PopoverPrimitive.Portal>;
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
43
|
+
|
|
44
|
+
export { Popover, PopoverTrigger, PopoverAnchor, PopoverContent };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../utils.js";
|
|
5
|
+
|
|
6
|
+
const Progress = React.forwardRef<
|
|
7
|
+
React.ElementRef<typeof ProgressPrimitive.Root>,
|
|
8
|
+
React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
|
|
9
|
+
>(({ className, value, ...props }, ref) => (
|
|
10
|
+
<ProgressPrimitive.Root
|
|
11
|
+
ref={ref}
|
|
12
|
+
className={cn(
|
|
13
|
+
"relative h-4 w-full overflow-hidden rounded-full bg-secondary",
|
|
14
|
+
className,
|
|
15
|
+
)}
|
|
16
|
+
{...props}
|
|
17
|
+
>
|
|
18
|
+
<ProgressPrimitive.Indicator
|
|
19
|
+
className="h-full w-full flex-1 bg-primary transition-all"
|
|
20
|
+
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
21
|
+
/>
|
|
22
|
+
</ProgressPrimitive.Root>
|
|
23
|
+
));
|
|
24
|
+
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
25
|
+
|
|
26
|
+
export { Progress };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
2
|
+
import { IconCircleFilled } from "@tabler/icons-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../utils.js";
|
|
6
|
+
|
|
7
|
+
const RadioGroup = React.forwardRef<
|
|
8
|
+
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
|
9
|
+
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
|
|
10
|
+
>(({ className, ...props }, ref) => {
|
|
11
|
+
return (
|
|
12
|
+
<RadioGroupPrimitive.Root
|
|
13
|
+
className={cn("grid gap-2", className)}
|
|
14
|
+
{...props}
|
|
15
|
+
ref={ref}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
20
|
+
|
|
21
|
+
const RadioGroupItem = React.forwardRef<
|
|
22
|
+
React.ElementRef<typeof RadioGroupPrimitive.Item>,
|
|
23
|
+
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
|
|
24
|
+
>(({ className, ...props }, ref) => {
|
|
25
|
+
return (
|
|
26
|
+
<RadioGroupPrimitive.Item
|
|
27
|
+
ref={ref}
|
|
28
|
+
className={cn(
|
|
29
|
+
"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",
|
|
30
|
+
className,
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
34
|
+
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
|
35
|
+
<IconCircleFilled className="h-2.5 w-2.5 text-current" />
|
|
36
|
+
</RadioGroupPrimitive.Indicator>
|
|
37
|
+
</RadioGroupPrimitive.Item>
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
41
|
+
|
|
42
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { IconGripVertical } from "@tabler/icons-react";
|
|
2
|
+
import * as ResizablePrimitive from "react-resizable-panels";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../utils.js";
|
|
5
|
+
|
|
6
|
+
const ResizablePanelGroup = ({
|
|
7
|
+
className,
|
|
8
|
+
...props
|
|
9
|
+
}: React.ComponentProps<typeof ResizablePrimitive.Group>) => (
|
|
10
|
+
<ResizablePrimitive.Group
|
|
11
|
+
className={cn(
|
|
12
|
+
"flex h-full w-full aria-[orientation=vertical]:flex-col",
|
|
13
|
+
className,
|
|
14
|
+
)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const ResizablePanel = ResizablePrimitive.Panel;
|
|
20
|
+
|
|
21
|
+
const ResizableHandle = ({
|
|
22
|
+
withHandle,
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<typeof ResizablePrimitive.Separator> & {
|
|
26
|
+
withHandle?: boolean;
|
|
27
|
+
}) => (
|
|
28
|
+
<ResizablePrimitive.Separator
|
|
29
|
+
className={cn(
|
|
30
|
+
"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 aria-[orientation=vertical]:h-px aria-[orientation=vertical]:w-full aria-[orientation=vertical]:after:left-0 aria-[orientation=vertical]:after:h-1 aria-[orientation=vertical]:after:w-full aria-[orientation=vertical]:after:-translate-y-1/2 aria-[orientation=vertical]:after:translate-x-0 [&[aria-orientation=vertical]>div]:rotate-90",
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
{withHandle && (
|
|
36
|
+
<div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
|
|
37
|
+
<IconGripVertical className="h-2.5 w-2.5" />
|
|
38
|
+
</div>
|
|
39
|
+
)}
|
|
40
|
+
</ResizablePrimitive.Separator>
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../utils.js";
|
|
5
|
+
|
|
6
|
+
const ScrollArea = React.forwardRef<
|
|
7
|
+
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
|
|
8
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
|
|
9
|
+
>(({ className, children, ...props }, ref) => (
|
|
10
|
+
<ScrollAreaPrimitive.Root
|
|
11
|
+
ref={ref}
|
|
12
|
+
className={cn("relative overflow-hidden", className)}
|
|
13
|
+
{...props}
|
|
14
|
+
>
|
|
15
|
+
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
|
16
|
+
{children}
|
|
17
|
+
</ScrollAreaPrimitive.Viewport>
|
|
18
|
+
<ScrollBar />
|
|
19
|
+
<ScrollAreaPrimitive.Corner />
|
|
20
|
+
</ScrollAreaPrimitive.Root>
|
|
21
|
+
));
|
|
22
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
23
|
+
|
|
24
|
+
const ScrollBar = React.forwardRef<
|
|
25
|
+
React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
|
|
26
|
+
React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
27
|
+
>(({ className, orientation = "vertical", ...props }, ref) => (
|
|
28
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
29
|
+
ref={ref}
|
|
30
|
+
orientation={orientation}
|
|
31
|
+
className={cn(
|
|
32
|
+
"flex touch-none select-none transition-colors",
|
|
33
|
+
orientation === "vertical" &&
|
|
34
|
+
"h-full w-2.5 border-s border-s-transparent p-[1px]",
|
|
35
|
+
orientation === "horizontal" &&
|
|
36
|
+
"h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
37
|
+
className,
|
|
38
|
+
)}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
|
42
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
43
|
+
));
|
|
44
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
45
|
+
|
|
46
|
+
export { ScrollArea, ScrollBar };
|