@agent-native/dispatch 0.21.0 → 0.22.1
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/dist/actions/get-agent-thread-debug.d.ts +2 -0
- package/dist/actions/provider-api-register.d.ts +8 -8
- package/dist/actions/search-agent-threads.js +2 -2
- package/dist/actions/search-agent-threads.js.map +1 -1
- package/dist/components/layout/HeaderActions.d.ts +1 -17
- package/dist/components/layout/HeaderActions.d.ts.map +1 -1
- package/dist/components/layout/HeaderActions.js +1 -51
- package/dist/components/layout/HeaderActions.js.map +1 -1
- package/dist/components/layout/Layout.d.ts.map +1 -1
- package/dist/components/layout/Layout.js +22 -14
- package/dist/components/layout/Layout.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +1 -19
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.js +1 -22
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +1 -27
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.js +1 -35
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/popover.d.ts +2 -1
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +2 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/select.d.ts +1 -13
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/select.js +1 -26
- package/dist/components/ui/select.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts +1 -1
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +1 -15
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/lib/automation-display.js +1 -1
- package/dist/lib/automation-display.js.map +1 -1
- package/dist/routes/pages/thread-debug.d.ts.map +1 -1
- package/dist/routes/pages/thread-debug.js +288 -118
- package/dist/routes/pages/thread-debug.js.map +1 -1
- package/dist/server/lib/thread-debug-store.d.ts +2 -0
- package/dist/server/lib/thread-debug-store.d.ts.map +1 -1
- package/dist/server/lib/thread-debug-store.js +6 -2
- package/dist/server/lib/thread-debug-store.js.map +1 -1
- package/package.json +3 -3
- package/src/actions/search-agent-threads.ts +2 -2
- package/src/components/layout/HeaderActions.tsx +1 -84
- package/src/components/layout/Layout.spec.tsx +94 -10
- package/src/components/layout/Layout.tsx +107 -101
- package/src/components/ui/dialog.tsx +1 -120
- package/src/components/ui/dropdown-menu.tsx +1 -198
- package/src/components/ui/popover.tsx +3 -1
- package/src/components/ui/select.tsx +1 -158
- package/src/hooks/use-mobile.tsx +1 -21
- package/src/lib/automation-display.spec.ts +1 -1
- package/src/lib/automation-display.ts +1 -1
- package/src/routes/pages/thread-debug.spec.tsx +103 -5
- package/src/routes/pages/thread-debug.tsx +1051 -451
- package/src/server/lib/thread-debug-store.spec.ts +17 -0
- package/src/server/lib/thread-debug-store.ts +9 -2
|
@@ -118,7 +118,6 @@ import { Skeleton } from "../ui/skeleton";
|
|
|
118
118
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip";
|
|
119
119
|
import { Header } from "./Header";
|
|
120
120
|
import { HeaderActionsProvider } from "./HeaderActions";
|
|
121
|
-
import { WorkspaceAppsRail } from "./workspace-apps-rail";
|
|
122
121
|
|
|
123
122
|
export type DispatchNavSection = "primary" | "operations";
|
|
124
123
|
|
|
@@ -521,14 +520,20 @@ function DispatchChatsSection({
|
|
|
521
520
|
prelude,
|
|
522
521
|
chatFirstMode = false,
|
|
523
522
|
chatFirstEmbedded = false,
|
|
523
|
+
chatFirstNavigation,
|
|
524
524
|
}: {
|
|
525
525
|
onNavigate?: () => void;
|
|
526
526
|
showNewChat?: boolean;
|
|
527
527
|
prelude?: ReactNode;
|
|
528
528
|
chatFirstMode?: boolean;
|
|
529
529
|
chatFirstEmbedded?: boolean;
|
|
530
|
+
chatFirstNavigation?: {
|
|
531
|
+
onOpenIntegrations: () => void;
|
|
532
|
+
onOpenScheduled: () => void;
|
|
533
|
+
};
|
|
530
534
|
}) {
|
|
531
535
|
const t = useT();
|
|
536
|
+
const chatFirstCopy = useMemo(() => createDispatchChatFirstCopy(t), [t]);
|
|
532
537
|
const navigate = useNavigate();
|
|
533
538
|
const location = useLocation();
|
|
534
539
|
const [includeExternal, setIncludeExternal] = useState(false);
|
|
@@ -662,54 +667,57 @@ function DispatchChatsSection({
|
|
|
662
667
|
showNewChat && "dispatch-chat-first-chats",
|
|
663
668
|
)}
|
|
664
669
|
>
|
|
665
|
-
{showNewChat ? (
|
|
666
|
-
<
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
670
|
+
{showNewChat && chatFirstNavigation ? (
|
|
671
|
+
<nav className="space-y-0.5 px-2 py-2">
|
|
672
|
+
<ChatFirstPrimaryNavigation
|
|
673
|
+
copy={chatFirstCopy}
|
|
674
|
+
onNewChat={() => void handleNewChat()}
|
|
675
|
+
onOpenIntegrations={chatFirstNavigation.onOpenIntegrations}
|
|
676
|
+
onOpenScheduled={chatFirstNavigation.onOpenScheduled}
|
|
677
|
+
onSearch={openCommandMenu}
|
|
678
|
+
/>
|
|
679
|
+
</nav>
|
|
674
680
|
) : null}
|
|
675
681
|
{prelude}
|
|
676
|
-
|
|
677
|
-
<
|
|
678
|
-
<
|
|
679
|
-
<
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
682
|
+
{!chatFirstMode ? (
|
|
683
|
+
<div className="flex justify-end px-2 pt-0.5">
|
|
684
|
+
<Tooltip>
|
|
685
|
+
<TooltipTrigger asChild>
|
|
686
|
+
<button
|
|
687
|
+
type="button"
|
|
688
|
+
data-dispatch-chat-source-toggle
|
|
689
|
+
aria-pressed={includeExternal}
|
|
690
|
+
aria-label={
|
|
691
|
+
includeExternal
|
|
692
|
+
? t("dispatch.sidebar.showLocalChats", {
|
|
693
|
+
defaultValue: "Show local chats",
|
|
694
|
+
})
|
|
695
|
+
: t("dispatch.sidebar.showAllChats", {
|
|
696
|
+
defaultValue: "Show all chats",
|
|
697
|
+
})
|
|
698
|
+
}
|
|
699
|
+
onClick={() => setIncludeExternal((current) => !current)}
|
|
700
|
+
className="flex size-6 items-center justify-center rounded-md text-sidebar-foreground/55 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"
|
|
701
|
+
>
|
|
702
|
+
{includeExternal ? (
|
|
703
|
+
<IconWorld size={14} aria-hidden="true" />
|
|
704
|
+
) : (
|
|
705
|
+
<IconDeviceDesktop size={14} aria-hidden="true" />
|
|
706
|
+
)}
|
|
707
|
+
</button>
|
|
708
|
+
</TooltipTrigger>
|
|
709
|
+
<TooltipContent side="right">
|
|
710
|
+
{includeExternal
|
|
711
|
+
? t("dispatch.sidebar.showLocalChats", {
|
|
712
|
+
defaultValue: "Show local chats",
|
|
713
|
+
})
|
|
714
|
+
: t("dispatch.sidebar.showAllChats", {
|
|
715
|
+
defaultValue: "Show all chats",
|
|
716
|
+
})}
|
|
717
|
+
</TooltipContent>
|
|
718
|
+
</Tooltip>
|
|
719
|
+
</div>
|
|
720
|
+
) : null}
|
|
713
721
|
{!chatFirstMode &&
|
|
714
722
|
chatsLoading &&
|
|
715
723
|
visibleThreads.length === 0 &&
|
|
@@ -983,20 +991,6 @@ export function NavContent({
|
|
|
983
991
|
/>
|
|
984
992
|
);
|
|
985
993
|
|
|
986
|
-
const chatFirstPrimaryNavigation = (
|
|
987
|
-
<ChatFirstPrimaryNavigation
|
|
988
|
-
copy={chatFirstCopy}
|
|
989
|
-
onOpenIntegrations={() => {
|
|
990
|
-
navigate(dispatchNavLinkTarget("/admin/integrations"));
|
|
991
|
-
onNavigate?.();
|
|
992
|
-
}}
|
|
993
|
-
onOpenScheduled={() => {
|
|
994
|
-
navigate(dispatchNavLinkTarget("/admin/automations"));
|
|
995
|
-
onNavigate?.();
|
|
996
|
-
}}
|
|
997
|
-
/>
|
|
998
|
-
);
|
|
999
|
-
|
|
1000
994
|
const chatFirstAppsRail = (
|
|
1001
995
|
<ChatFirstAppsRail
|
|
1002
996
|
apps={chatFirstApps}
|
|
@@ -1011,6 +1005,10 @@ export function NavContent({
|
|
|
1011
1005
|
onChatFirstAppOpen?.(app);
|
|
1012
1006
|
onNavigate?.();
|
|
1013
1007
|
}}
|
|
1008
|
+
onOpenAllApps={() => {
|
|
1009
|
+
navigate(dispatchNavLinkTarget("/apps"));
|
|
1010
|
+
onNavigate?.();
|
|
1011
|
+
}}
|
|
1014
1012
|
createAppTrigger={chatFirstCreateAppTrigger}
|
|
1015
1013
|
renderIcon={(app) => (
|
|
1016
1014
|
<AppIcon
|
|
@@ -1055,6 +1053,7 @@ export function NavContent({
|
|
|
1055
1053
|
onNavigate?.();
|
|
1056
1054
|
}}
|
|
1057
1055
|
aria-label={label}
|
|
1056
|
+
aria-current={itemMatchesLocalPath ? "page" : undefined}
|
|
1058
1057
|
className={cn(
|
|
1059
1058
|
"flex size-9 items-center justify-center rounded-md text-sm",
|
|
1060
1059
|
itemMatchesLocalPath
|
|
@@ -1093,6 +1092,7 @@ export function NavContent({
|
|
|
1093
1092
|
}
|
|
1094
1093
|
onNavigate?.();
|
|
1095
1094
|
}}
|
|
1095
|
+
aria-current={itemMatchesLocalPath ? "page" : undefined}
|
|
1096
1096
|
className={cn(
|
|
1097
1097
|
"flex h-8 w-full items-center gap-2 rounded-md px-2 text-sm",
|
|
1098
1098
|
itemMatchesLocalPath
|
|
@@ -1119,6 +1119,33 @@ export function NavContent({
|
|
|
1119
1119
|
);
|
|
1120
1120
|
};
|
|
1121
1121
|
|
|
1122
|
+
const bottomNavigation = (
|
|
1123
|
+
<nav className={cn("py-1", collapsed ? "px-1.5" : "px-2")}>
|
|
1124
|
+
<ul
|
|
1125
|
+
className={cn(
|
|
1126
|
+
collapsed ? "flex flex-col items-center gap-1" : "space-y-0.5",
|
|
1127
|
+
)}
|
|
1128
|
+
>
|
|
1129
|
+
{BOTTOM_NAV_ITEMS.map(renderNavItem)}
|
|
1130
|
+
</ul>
|
|
1131
|
+
</nav>
|
|
1132
|
+
);
|
|
1133
|
+
const organizationPicker = (
|
|
1134
|
+
<div
|
|
1135
|
+
className={cn("py-2", collapsed ? "flex justify-center px-1" : "px-3")}
|
|
1136
|
+
>
|
|
1137
|
+
<OrgSwitcher compact={collapsed} reserveSpace />
|
|
1138
|
+
</div>
|
|
1139
|
+
);
|
|
1140
|
+
const sidebarFooterActions = (
|
|
1141
|
+
<SidebarFooterActions
|
|
1142
|
+
collapsed={collapsed}
|
|
1143
|
+
feedback={feedbackButton}
|
|
1144
|
+
search={searchButton}
|
|
1145
|
+
collapse={collapseButton}
|
|
1146
|
+
/>
|
|
1147
|
+
);
|
|
1148
|
+
|
|
1122
1149
|
return (
|
|
1123
1150
|
<>
|
|
1124
1151
|
<div
|
|
@@ -1175,14 +1202,18 @@ export function NavContent({
|
|
|
1175
1202
|
onNavigate={onNavigate}
|
|
1176
1203
|
showNewChat
|
|
1177
1204
|
chatFirstMode
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1205
|
+
chatFirstEmbedded={chatFirstEmbedded}
|
|
1206
|
+
chatFirstNavigation={{
|
|
1207
|
+
onOpenIntegrations: () => {
|
|
1208
|
+
navigate(dispatchNavLinkTarget("/admin/integrations"));
|
|
1209
|
+
onNavigate?.();
|
|
1210
|
+
},
|
|
1211
|
+
onOpenScheduled: () => {
|
|
1212
|
+
navigate(dispatchNavLinkTarget("/admin/automations"));
|
|
1213
|
+
onNavigate?.();
|
|
1214
|
+
},
|
|
1215
|
+
}}
|
|
1216
|
+
prelude={chatFirstAppsRail}
|
|
1186
1217
|
/>
|
|
1187
1218
|
) : (
|
|
1188
1219
|
chatFirstAppsRail
|
|
@@ -1203,44 +1234,19 @@ export function NavContent({
|
|
|
1203
1234
|
>
|
|
1204
1235
|
{primaryNavItems.map(renderNavItem)}
|
|
1205
1236
|
</ul>
|
|
1206
|
-
|
|
1207
|
-
<WorkspaceAppsRail collapsed={collapsed} onNavigate={onNavigate} />
|
|
1208
1237
|
</nav>
|
|
1209
1238
|
|
|
1210
1239
|
<div className="mt-auto shrink-0">
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
className={cn(
|
|
1214
|
-
collapsed ? "flex flex-col items-center gap-1" : "space-y-0.5",
|
|
1215
|
-
)}
|
|
1216
|
-
>
|
|
1217
|
-
{BOTTOM_NAV_ITEMS.map(renderNavItem)}
|
|
1218
|
-
</ul>
|
|
1219
|
-
</nav>
|
|
1220
|
-
<div
|
|
1221
|
-
className={cn(
|
|
1222
|
-
"py-2",
|
|
1223
|
-
collapsed ? "flex justify-center px-1" : "px-3",
|
|
1224
|
-
)}
|
|
1225
|
-
>
|
|
1226
|
-
<OrgSwitcher compact={collapsed} reserveSpace />
|
|
1227
|
-
</div>
|
|
1240
|
+
{bottomNavigation}
|
|
1241
|
+
{organizationPicker}
|
|
1228
1242
|
</div>
|
|
1229
|
-
|
|
1230
|
-
collapsed={collapsed}
|
|
1231
|
-
feedback={feedbackButton}
|
|
1232
|
-
search={searchButton}
|
|
1233
|
-
collapse={collapseButton}
|
|
1234
|
-
/>
|
|
1243
|
+
{sidebarFooterActions}
|
|
1235
1244
|
</div>
|
|
1236
|
-
{chatFirstMode
|
|
1245
|
+
{chatFirstMode ? (
|
|
1237
1246
|
<div className="mt-auto shrink-0">
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
search={searchButton}
|
|
1242
|
-
collapse={collapseButton}
|
|
1243
|
-
/>
|
|
1247
|
+
{bottomNavigation}
|
|
1248
|
+
{organizationPicker}
|
|
1249
|
+
{collapsed ? sidebarFooterActions : null}
|
|
1244
1250
|
</div>
|
|
1245
1251
|
) : null}
|
|
1246
1252
|
</>
|
|
@@ -1,120 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { IconX } from "@tabler/icons-react";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const Dialog = DialogPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const DialogTrigger = DialogPrimitive.Trigger;
|
|
10
|
-
|
|
11
|
-
const DialogPortal = DialogPrimitive.Portal;
|
|
12
|
-
|
|
13
|
-
const DialogClose = DialogPrimitive.Close;
|
|
14
|
-
|
|
15
|
-
const DialogOverlay = React.forwardRef<
|
|
16
|
-
React.ElementRef<typeof DialogPrimitive.Overlay>,
|
|
17
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
|
|
18
|
-
>(({ className, ...props }, ref) => (
|
|
19
|
-
<DialogPrimitive.Overlay
|
|
20
|
-
ref={ref}
|
|
21
|
-
className={cn(
|
|
22
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
23
|
-
className,
|
|
24
|
-
)}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
));
|
|
28
|
-
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
29
|
-
|
|
30
|
-
const DialogContent = React.forwardRef<
|
|
31
|
-
React.ElementRef<typeof DialogPrimitive.Content>,
|
|
32
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
|
|
33
|
-
>(({ className, children, ...props }, ref) => (
|
|
34
|
-
<DialogPortal>
|
|
35
|
-
<DialogOverlay />
|
|
36
|
-
<DialogPrimitive.Content
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn(
|
|
39
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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 sm:rounded-lg",
|
|
40
|
-
className,
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
>
|
|
44
|
-
{children}
|
|
45
|
-
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
|
|
46
|
-
<IconX className="h-4 w-4" />
|
|
47
|
-
<span className="sr-only">Close</span>
|
|
48
|
-
</DialogPrimitive.Close>
|
|
49
|
-
</DialogPrimitive.Content>
|
|
50
|
-
</DialogPortal>
|
|
51
|
-
));
|
|
52
|
-
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
53
|
-
|
|
54
|
-
const DialogHeader = ({
|
|
55
|
-
className,
|
|
56
|
-
...props
|
|
57
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
58
|
-
<div
|
|
59
|
-
className={cn(
|
|
60
|
-
"flex flex-col space-y-1.5 text-center sm:text-left",
|
|
61
|
-
className,
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
DialogHeader.displayName = "DialogHeader";
|
|
67
|
-
|
|
68
|
-
const DialogFooter = ({
|
|
69
|
-
className,
|
|
70
|
-
...props
|
|
71
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
72
|
-
<div
|
|
73
|
-
className={cn(
|
|
74
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
75
|
-
className,
|
|
76
|
-
)}
|
|
77
|
-
{...props}
|
|
78
|
-
/>
|
|
79
|
-
);
|
|
80
|
-
DialogFooter.displayName = "DialogFooter";
|
|
81
|
-
|
|
82
|
-
const DialogTitle = React.forwardRef<
|
|
83
|
-
React.ElementRef<typeof DialogPrimitive.Title>,
|
|
84
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
|
|
85
|
-
>(({ className, ...props }, ref) => (
|
|
86
|
-
<DialogPrimitive.Title
|
|
87
|
-
ref={ref}
|
|
88
|
-
className={cn(
|
|
89
|
-
"text-lg font-semibold leading-none tracking-tight",
|
|
90
|
-
className,
|
|
91
|
-
)}
|
|
92
|
-
{...props}
|
|
93
|
-
/>
|
|
94
|
-
));
|
|
95
|
-
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
96
|
-
|
|
97
|
-
const DialogDescription = React.forwardRef<
|
|
98
|
-
React.ElementRef<typeof DialogPrimitive.Description>,
|
|
99
|
-
React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
|
|
100
|
-
>(({ className, ...props }, ref) => (
|
|
101
|
-
<DialogPrimitive.Description
|
|
102
|
-
ref={ref}
|
|
103
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
104
|
-
{...props}
|
|
105
|
-
/>
|
|
106
|
-
));
|
|
107
|
-
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
108
|
-
|
|
109
|
-
export {
|
|
110
|
-
Dialog,
|
|
111
|
-
DialogPortal,
|
|
112
|
-
DialogOverlay,
|
|
113
|
-
DialogClose,
|
|
114
|
-
DialogTrigger,
|
|
115
|
-
DialogContent,
|
|
116
|
-
DialogHeader,
|
|
117
|
-
DialogFooter,
|
|
118
|
-
DialogTitle,
|
|
119
|
-
DialogDescription,
|
|
120
|
-
};
|
|
1
|
+
export * from "@agent-native/toolkit/ui/dialog";
|
|
@@ -1,198 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { IconCheck, IconChevronRight, IconCircle } from "@tabler/icons-react";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
10
|
-
|
|
11
|
-
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
12
|
-
|
|
13
|
-
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
14
|
-
|
|
15
|
-
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
16
|
-
|
|
17
|
-
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
18
|
-
|
|
19
|
-
const DropdownMenuSubTrigger = React.forwardRef<
|
|
20
|
-
React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
|
|
21
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
-
inset?: boolean;
|
|
23
|
-
}
|
|
24
|
-
>(({ className, inset, children, ...props }, ref) => (
|
|
25
|
-
<DropdownMenuPrimitive.SubTrigger
|
|
26
|
-
ref={ref}
|
|
27
|
-
className={cn(
|
|
28
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
29
|
-
inset && "pl-8",
|
|
30
|
-
className,
|
|
31
|
-
)}
|
|
32
|
-
{...props}
|
|
33
|
-
>
|
|
34
|
-
{children}
|
|
35
|
-
<IconChevronRight className="ml-auto h-4 w-4" />
|
|
36
|
-
</DropdownMenuPrimitive.SubTrigger>
|
|
37
|
-
));
|
|
38
|
-
DropdownMenuSubTrigger.displayName =
|
|
39
|
-
DropdownMenuPrimitive.SubTrigger.displayName;
|
|
40
|
-
|
|
41
|
-
const DropdownMenuSubContent = React.forwardRef<
|
|
42
|
-
React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
|
|
43
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
|
|
44
|
-
>(({ className, ...props }, ref) => (
|
|
45
|
-
<DropdownMenuPrimitive.SubContent
|
|
46
|
-
ref={ref}
|
|
47
|
-
className={cn(
|
|
48
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
|
|
49
|
-
className,
|
|
50
|
-
)}
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
));
|
|
54
|
-
DropdownMenuSubContent.displayName =
|
|
55
|
-
DropdownMenuPrimitive.SubContent.displayName;
|
|
56
|
-
|
|
57
|
-
const DropdownMenuContent = React.forwardRef<
|
|
58
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Content>,
|
|
59
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
|
|
60
|
-
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
61
|
-
<DropdownMenuPrimitive.Portal>
|
|
62
|
-
<DropdownMenuPrimitive.Content
|
|
63
|
-
ref={ref}
|
|
64
|
-
sideOffset={sideOffset}
|
|
65
|
-
className={cn(
|
|
66
|
-
"z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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",
|
|
67
|
-
className,
|
|
68
|
-
)}
|
|
69
|
-
{...props}
|
|
70
|
-
/>
|
|
71
|
-
</DropdownMenuPrimitive.Portal>
|
|
72
|
-
));
|
|
73
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
74
|
-
|
|
75
|
-
const DropdownMenuItem = React.forwardRef<
|
|
76
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Item>,
|
|
77
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
78
|
-
inset?: boolean;
|
|
79
|
-
}
|
|
80
|
-
>(({ className, inset, ...props }, ref) => (
|
|
81
|
-
<DropdownMenuPrimitive.Item
|
|
82
|
-
ref={ref}
|
|
83
|
-
className={cn(
|
|
84
|
-
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
85
|
-
inset && "pl-8",
|
|
86
|
-
className,
|
|
87
|
-
)}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
));
|
|
91
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
92
|
-
|
|
93
|
-
const DropdownMenuCheckboxItem = React.forwardRef<
|
|
94
|
-
React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
|
|
95
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
|
|
96
|
-
>(({ className, children, checked, ...props }, ref) => (
|
|
97
|
-
<DropdownMenuPrimitive.CheckboxItem
|
|
98
|
-
ref={ref}
|
|
99
|
-
className={cn(
|
|
100
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
101
|
-
className,
|
|
102
|
-
)}
|
|
103
|
-
checked={checked}
|
|
104
|
-
{...props}
|
|
105
|
-
>
|
|
106
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
107
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
108
|
-
<IconCheck className="h-4 w-4" />
|
|
109
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
110
|
-
</span>
|
|
111
|
-
{children}
|
|
112
|
-
</DropdownMenuPrimitive.CheckboxItem>
|
|
113
|
-
));
|
|
114
|
-
DropdownMenuCheckboxItem.displayName =
|
|
115
|
-
DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
116
|
-
|
|
117
|
-
const DropdownMenuRadioItem = React.forwardRef<
|
|
118
|
-
React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
|
|
119
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
|
|
120
|
-
>(({ className, children, ...props }, ref) => (
|
|
121
|
-
<DropdownMenuPrimitive.RadioItem
|
|
122
|
-
ref={ref}
|
|
123
|
-
className={cn(
|
|
124
|
-
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
125
|
-
className,
|
|
126
|
-
)}
|
|
127
|
-
{...props}
|
|
128
|
-
>
|
|
129
|
-
<span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
|
|
130
|
-
<DropdownMenuPrimitive.ItemIndicator>
|
|
131
|
-
<IconCircle className="h-2 w-2 fill-current" />
|
|
132
|
-
</DropdownMenuPrimitive.ItemIndicator>
|
|
133
|
-
</span>
|
|
134
|
-
{children}
|
|
135
|
-
</DropdownMenuPrimitive.RadioItem>
|
|
136
|
-
));
|
|
137
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
138
|
-
|
|
139
|
-
const DropdownMenuLabel = React.forwardRef<
|
|
140
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Label>,
|
|
141
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
|
|
142
|
-
inset?: boolean;
|
|
143
|
-
}
|
|
144
|
-
>(({ className, inset, ...props }, ref) => (
|
|
145
|
-
<DropdownMenuPrimitive.Label
|
|
146
|
-
ref={ref}
|
|
147
|
-
className={cn(
|
|
148
|
-
"px-2 py-1.5 text-sm font-semibold",
|
|
149
|
-
inset && "pl-8",
|
|
150
|
-
className,
|
|
151
|
-
)}
|
|
152
|
-
{...props}
|
|
153
|
-
/>
|
|
154
|
-
));
|
|
155
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
156
|
-
|
|
157
|
-
const DropdownMenuSeparator = React.forwardRef<
|
|
158
|
-
React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
|
|
159
|
-
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
|
|
160
|
-
>(({ className, ...props }, ref) => (
|
|
161
|
-
<DropdownMenuPrimitive.Separator
|
|
162
|
-
ref={ref}
|
|
163
|
-
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
164
|
-
{...props}
|
|
165
|
-
/>
|
|
166
|
-
));
|
|
167
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
168
|
-
|
|
169
|
-
const DropdownMenuShortcut = ({
|
|
170
|
-
className,
|
|
171
|
-
...props
|
|
172
|
-
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
173
|
-
return (
|
|
174
|
-
<span
|
|
175
|
-
className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
|
|
176
|
-
{...props}
|
|
177
|
-
/>
|
|
178
|
-
);
|
|
179
|
-
};
|
|
180
|
-
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
181
|
-
|
|
182
|
-
export {
|
|
183
|
-
DropdownMenu,
|
|
184
|
-
DropdownMenuTrigger,
|
|
185
|
-
DropdownMenuContent,
|
|
186
|
-
DropdownMenuItem,
|
|
187
|
-
DropdownMenuCheckboxItem,
|
|
188
|
-
DropdownMenuRadioItem,
|
|
189
|
-
DropdownMenuLabel,
|
|
190
|
-
DropdownMenuSeparator,
|
|
191
|
-
DropdownMenuShortcut,
|
|
192
|
-
DropdownMenuGroup,
|
|
193
|
-
DropdownMenuPortal,
|
|
194
|
-
DropdownMenuSub,
|
|
195
|
-
DropdownMenuSubContent,
|
|
196
|
-
DropdownMenuSubTrigger,
|
|
197
|
-
DropdownMenuRadioGroup,
|
|
198
|
-
};
|
|
1
|
+
export * from "@agent-native/toolkit/ui/dropdown-menu";
|
|
@@ -5,6 +5,8 @@ import { cn } from "../../lib/utils";
|
|
|
5
5
|
|
|
6
6
|
const Popover = PopoverPrimitive.Root;
|
|
7
7
|
|
|
8
|
+
const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
9
|
+
|
|
8
10
|
const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
9
11
|
|
|
10
12
|
const PopoverContent = React.forwardRef<
|
|
@@ -26,4 +28,4 @@ const PopoverContent = React.forwardRef<
|
|
|
26
28
|
));
|
|
27
29
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
28
30
|
|
|
29
|
-
export { Popover, PopoverTrigger, PopoverContent };
|
|
31
|
+
export { Popover, PopoverAnchor, PopoverTrigger, PopoverContent };
|