@agent-native/dispatch 0.38.15 → 0.38.16-nightly-20260927213438
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/create-workspace-resource.d.ts +13 -13
- package/dist/actions/provider-api-register.d.ts +12 -12
- package/dist/components/automation-create-dialog.js +4 -4
- package/dist/components/automation-create-dialog.js.map +1 -1
- package/dist/components/layout/Header.js +1 -1
- package/dist/components/layout/Header.js.map +1 -1
- package/dist/components/layout/Layout.d.ts +7 -0
- package/dist/components/layout/Layout.d.ts.map +1 -1
- package/dist/components/layout/Layout.js +19 -4
- package/dist/components/layout/Layout.js.map +1 -1
- package/dist/components/messaging-setup-panel.d.ts.map +1 -1
- package/dist/components/messaging-setup-panel.js +7 -28
- package/dist/components/messaging-setup-panel.js.map +1 -1
- package/dist/components/transactional-email-send-log.js +1 -1
- package/dist/components/transactional-email-send-log.js.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +1 -20
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.js +1 -26
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/button.d.ts +1 -11
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +1 -33
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/carousel.d.ts +2 -2
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/input.d.ts +1 -3
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/input.js +1 -8
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +4 -2
- package/dist/components/ui/sidebar.d.ts.map +1 -1
- package/dist/components/ui/switch.d.ts +1 -4
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/switch.js +1 -7
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/tabs.d.ts +1 -7
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/tabs.js +1 -12
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/toggle.d.ts +1 -12
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/toggle.js +1 -25
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/usage-alerts-panel.d.ts.map +1 -1
- package/dist/components/usage-alerts-panel.js +1 -1
- package/dist/components/usage-alerts-panel.js.map +1 -1
- package/dist/components/workspace-app-search.d.ts.map +1 -1
- package/dist/components/workspace-app-search.js +1 -1
- package/dist/components/workspace-app-search.js.map +1 -1
- package/dist/routes/pages/automations.d.ts.map +1 -1
- package/dist/routes/pages/automations.js +2 -2
- package/dist/routes/pages/automations.js.map +1 -1
- package/dist/routes/pages/metrics.d.ts.map +1 -1
- package/dist/routes/pages/metrics.js +1 -1
- package/dist/routes/pages/metrics.js.map +1 -1
- package/dist/routes/pages/settings.d.ts +9 -0
- package/dist/routes/pages/settings.d.ts.map +1 -1
- package/dist/routes/pages/settings.js +65 -12
- package/dist/routes/pages/settings.js.map +1 -1
- package/dist/routes/pages/thread-debug.js +1 -1
- package/dist/routes/pages/thread-debug.js.map +1 -1
- package/dist/routes/pages/vault.d.ts.map +1 -1
- package/dist/routes/pages/vault.js +2 -2
- package/dist/routes/pages/vault.js.map +1 -1
- package/dist/server/lib/usage-metrics-store.js +2 -3
- package/dist/server/lib/usage-metrics-store.js.map +1 -1
- package/dist/server/plugins/db.d.ts.map +1 -1
- package/dist/server/plugins/db.js +44 -0
- package/dist/server/plugins/db.js.map +1 -1
- package/package.json +4 -4
- package/src/components/automation-create-dialog.tsx +6 -6
- package/src/components/layout/Header.tsx +2 -2
- package/src/components/layout/Layout.spec.tsx +28 -0
- package/src/components/layout/Layout.tsx +73 -43
- package/src/components/messaging-setup-panel.spec.tsx +5 -1
- package/src/components/messaging-setup-panel.tsx +9 -45
- package/src/components/transactional-email-send-log.tsx +1 -1
- package/src/components/ui/alert-dialog.tsx +1 -139
- package/src/components/ui/button.tsx +1 -56
- package/src/components/ui/input.tsx +1 -22
- package/src/components/ui/switch.tsx +1 -27
- package/src/components/ui/tabs.tsx +1 -53
- package/src/components/ui/toggle.tsx +1 -43
- package/src/components/usage-alerts-panel.tsx +6 -12
- package/src/components/workspace-app-search.tsx +2 -1
- package/src/routes/pages/automations.tsx +4 -2
- package/src/routes/pages/metrics.tsx +2 -1
- package/src/routes/pages/settings.spec.tsx +179 -0
- package/src/routes/pages/settings.tsx +179 -119
- package/src/routes/pages/thread-debug.tsx +1 -1
- package/src/routes/pages/vault.tsx +3 -2
- package/src/server/lib/usage-metrics-store.spec.ts +1 -0
- package/src/server/lib/usage-metrics-store.ts +2 -2
- package/src/server/plugins/db.ts +49 -0
|
@@ -58,16 +58,22 @@ import {
|
|
|
58
58
|
type ChatFirstPrimaryTab,
|
|
59
59
|
} from "@agent-native/core/client/chat-first";
|
|
60
60
|
import { writeClipboardText } from "@agent-native/core/client/clipboard";
|
|
61
|
+
import {
|
|
62
|
+
useFeatureFlagState,
|
|
63
|
+
type FeatureFlagState,
|
|
64
|
+
} from "@agent-native/core/client/feature-flags";
|
|
61
65
|
import { useActionQuery } from "@agent-native/core/client/hooks";
|
|
62
66
|
import { useT } from "@agent-native/core/client/i18n";
|
|
63
67
|
import { openCommandMenu } from "@agent-native/core/client/navigation";
|
|
64
68
|
import { InvitationBanner, OrgSwitcher } from "@agent-native/core/client/org";
|
|
65
69
|
import { RunsTray } from "@agent-native/core/client/progress";
|
|
70
|
+
import { isSettingsPathname } from "@agent-native/core/client/settings";
|
|
66
71
|
import {
|
|
67
72
|
AppSidebarFooter,
|
|
68
73
|
AppSidebarHeader,
|
|
69
74
|
FeedbackButton,
|
|
70
75
|
} from "@agent-native/core/client/ui";
|
|
76
|
+
import { SETTINGS_REDESIGN_FLAG } from "@agent-native/core/feature-flags/registry";
|
|
71
77
|
import {
|
|
72
78
|
ChatHistoryRail,
|
|
73
79
|
type ChatHistoryItem,
|
|
@@ -335,6 +341,21 @@ export function shouldAutoCollapseDispatchSidebar(pathname: string): boolean {
|
|
|
335
341
|
return localDispatchPath(pathname).startsWith("/apps/");
|
|
336
342
|
}
|
|
337
343
|
|
|
344
|
+
/**
|
|
345
|
+
* The redesigned Settings brings its own navigation, header, and agent
|
|
346
|
+
* toggle, so it renders full width. While the flag loads it shows the
|
|
347
|
+
* shell's skeleton, which needs the same frame.
|
|
348
|
+
*/
|
|
349
|
+
export function isRedesignedSettingsPath(
|
|
350
|
+
pathname: string,
|
|
351
|
+
settingsRedesign: FeatureFlagState,
|
|
352
|
+
): boolean {
|
|
353
|
+
return (
|
|
354
|
+
isSettingsPathname(localDispatchPath(pathname)) &&
|
|
355
|
+
(settingsRedesign.enabled || settingsRedesign.status === "loading")
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
|
|
338
359
|
function chatFirstPrimaryTabForPath(
|
|
339
360
|
pathname: string,
|
|
340
361
|
): ChatFirstPrimaryTab | undefined {
|
|
@@ -1358,6 +1379,10 @@ export function Layout({
|
|
|
1358
1379
|
);
|
|
1359
1380
|
const isChatRoute =
|
|
1360
1381
|
localPathname === "/chat" || localPathname.startsWith("/chat/");
|
|
1382
|
+
const isRedesignedSettingsRoute = isRedesignedSettingsPath(
|
|
1383
|
+
location.pathname,
|
|
1384
|
+
useFeatureFlagState(SETTINGS_REDESIGN_FLAG.key),
|
|
1385
|
+
);
|
|
1361
1386
|
const chatFirstSurfaceScope = threadIdFromPath(localPathname) ?? "new";
|
|
1362
1387
|
const isWorkspaceAppRoute = shouldAutoCollapseDispatchSidebar(
|
|
1363
1388
|
location.pathname,
|
|
@@ -2232,7 +2257,10 @@ export function Layout({
|
|
|
2232
2257
|
);
|
|
2233
2258
|
}
|
|
2234
2259
|
|
|
2235
|
-
const showAgentControls =
|
|
2260
|
+
const showAgentControls =
|
|
2261
|
+
!isChatRoute &&
|
|
2262
|
+
!isRedesignedSettingsRoute &&
|
|
2263
|
+
!pageOwnsToolbar(localPathname);
|
|
2236
2264
|
function openAskAgentFullscreen() {
|
|
2237
2265
|
focusAgentChat();
|
|
2238
2266
|
navigateWithAgentChatViewTransition(
|
|
@@ -2301,8 +2329,8 @@ export function Layout({
|
|
|
2301
2329
|
<div className="pointer-events-none sticky top-0 z-10 flex justify-end px-4 pt-2 lg:px-6">
|
|
2302
2330
|
<Button
|
|
2303
2331
|
variant="ghost"
|
|
2304
|
-
size="icon"
|
|
2305
|
-
className="pointer-events-auto absolute start-4 top-2
|
|
2332
|
+
size="icon-sm"
|
|
2333
|
+
className="pointer-events-auto absolute start-4 top-2 lg:hidden"
|
|
2306
2334
|
onClick={() => setMobileOpen(true)}
|
|
2307
2335
|
aria-label="Open navigation"
|
|
2308
2336
|
>
|
|
@@ -2454,46 +2482,48 @@ export function Layout({
|
|
|
2454
2482
|
<DispatchExtensionsContext.Provider value={extensions}>
|
|
2455
2483
|
<HeaderActionsProvider>
|
|
2456
2484
|
<div className="agent-layout-shell flex h-screen w-full overflow-hidden bg-background">
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2485
|
+
{isRedesignedSettingsRoute ? null : (
|
|
2486
|
+
<aside
|
|
2487
|
+
data-collapsed={sidebarCollapsed ? "true" : "false"}
|
|
2488
|
+
className={cn(
|
|
2489
|
+
"agent-layout-left-drawer hidden shrink-0 flex-col border-e !border-e-sidebar-border bg-sidebar text-sidebar-foreground transition-[width] duration-200 ease-out lg:flex",
|
|
2490
|
+
sidebarCollapsed ? "w-14" : "w-[260px]",
|
|
2491
|
+
)}
|
|
2492
|
+
>
|
|
2493
|
+
<NavContent
|
|
2494
|
+
extensions={extensions}
|
|
2495
|
+
brandName={brandName}
|
|
2496
|
+
brandIcon={brandIcon}
|
|
2497
|
+
chatFirstMode={chatFirstMode}
|
|
2498
|
+
chatFirstEmbedded={chatFirstEmbedded}
|
|
2499
|
+
collapsed={sidebarCollapsed}
|
|
2500
|
+
chatFirstAppLayout={chatFirstAppLayout}
|
|
2501
|
+
onChatFirstAppLayoutChange={persistChatFirstAppLayout}
|
|
2502
|
+
chatFirstApps={chatFirstAppItems}
|
|
2503
|
+
chatFirstAppsLoading={chatFirstAppsQuery.isLoading}
|
|
2504
|
+
chatFirstAppsError={
|
|
2505
|
+
chatFirstAppsQuery.isError
|
|
2506
|
+
? chatFirstCopy("appsLoadError")
|
|
2507
|
+
: null
|
|
2508
|
+
}
|
|
2509
|
+
chatFirstActiveAppId={chatFirstActiveAppId}
|
|
2510
|
+
chatFirstActivePrimaryTab={chatFirstActivePrimaryTab}
|
|
2511
|
+
onChatFirstNewChat={() => {
|
|
2512
|
+
closeChatFirstSessionWatch();
|
|
2513
|
+
chatFirstSurfaceTabsStore.closeAll();
|
|
2514
|
+
setChatFirstSurfacePanelOpen(false);
|
|
2515
|
+
}}
|
|
2516
|
+
onChatFirstAppOpen={(app) => {
|
|
2517
|
+
if (isDispatchWorkspaceAppId(app.id)) return;
|
|
2518
|
+
setSidebarCollapsed(true);
|
|
2519
|
+
openChatFirstApp(app);
|
|
2520
|
+
}}
|
|
2521
|
+
onChatFirstAppsRetry={() => void chatFirstAppsQuery.refetch()}
|
|
2522
|
+
collapsible
|
|
2523
|
+
onCollapsedChange={setSidebarCollapsed}
|
|
2524
|
+
/>
|
|
2525
|
+
</aside>
|
|
2526
|
+
)}
|
|
2497
2527
|
|
|
2498
2528
|
<Sheet open={mobileOpen} onOpenChange={setMobileOpen}>
|
|
2499
2529
|
<SheetContent
|
|
@@ -11,7 +11,11 @@ const clientState = vi.hoisted(() => ({
|
|
|
11
11
|
envStatuses: [] as any[],
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
|
-
vi.mock("@agent-native/core/client/integrations", () => ({
|
|
14
|
+
vi.mock("@agent-native/core/client/integrations", async () => ({
|
|
15
|
+
// The shared channel helpers are real; only the network calls are faked.
|
|
16
|
+
...(await vi.importActual<
|
|
17
|
+
typeof import("@agent-native/core/client/integrations")
|
|
18
|
+
>("@agent-native/core/client/integrations")),
|
|
15
19
|
disconnectManagedIntegrationInstallation: vi.fn(() => Promise.resolve()),
|
|
16
20
|
listManagedIntegrationBudgets: vi.fn(() => Promise.resolve([])),
|
|
17
21
|
listManagedIntegrationInstallations: vi.fn(() => Promise.resolve([])),
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { useFormatters, useT } from "@agent-native/core/client/i18n";
|
|
2
2
|
import {
|
|
3
|
+
channelIcon,
|
|
3
4
|
disconnectManagedIntegrationInstallation,
|
|
5
|
+
hasMissingRequiredCredentials,
|
|
4
6
|
listManagedIntegrationBudgets,
|
|
5
7
|
listManagedIntegrationInstallations,
|
|
6
8
|
listManagedIntegrationScopes,
|
|
@@ -23,14 +25,9 @@ import {
|
|
|
23
25
|
import {
|
|
24
26
|
listBuiltInChannelIntegrations,
|
|
25
27
|
type IntegrationCatalogEntry,
|
|
26
|
-
type IntegrationCredentialRequirement,
|
|
27
28
|
} from "@agent-native/core/integrations";
|
|
28
29
|
import {
|
|
29
|
-
IconBrandDiscord,
|
|
30
30
|
IconBrandSlack,
|
|
31
|
-
IconBrandTelegram,
|
|
32
|
-
IconBrandTeams,
|
|
33
|
-
IconBrandWhatsapp,
|
|
34
31
|
IconCheck,
|
|
35
32
|
IconChevronRight,
|
|
36
33
|
IconCopy,
|
|
@@ -38,8 +35,6 @@ import {
|
|
|
38
35
|
IconFileDescription,
|
|
39
36
|
IconInfoCircle,
|
|
40
37
|
IconLoader2,
|
|
41
|
-
IconMail,
|
|
42
|
-
IconPlug,
|
|
43
38
|
} from "@tabler/icons-react";
|
|
44
39
|
import { type ReactNode, useEffect, useMemo, useState } from "react";
|
|
45
40
|
import { toast } from "sonner";
|
|
@@ -61,42 +56,11 @@ import { Skeleton } from "./ui/skeleton";
|
|
|
61
56
|
import { Switch } from "./ui/switch";
|
|
62
57
|
import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
|
|
63
58
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
discord: IconBrandDiscord,
|
|
70
|
-
telegram: IconBrandTelegram,
|
|
71
|
-
whatsapp: IconBrandWhatsapp,
|
|
72
|
-
email: IconMail,
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
function hasMissingRequiredCredentials(
|
|
76
|
-
credentials: readonly IntegrationCredentialRequirement[],
|
|
77
|
-
envStatusByKey: Map<string, IntegrationEnvStatus>,
|
|
78
|
-
) {
|
|
79
|
-
const alternatives = new Map<
|
|
80
|
-
string,
|
|
81
|
-
readonly IntegrationCredentialRequirement[]
|
|
82
|
-
>();
|
|
83
|
-
|
|
84
|
-
for (const credential of credentials) {
|
|
85
|
-
if (!credential.required) continue;
|
|
86
|
-
if (!credential.alternativeGroup) {
|
|
87
|
-
if (!envStatusByKey.get(credential.key)?.configured) return true;
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
const group = alternatives.get(credential.alternativeGroup) ?? [];
|
|
91
|
-
alternatives.set(credential.alternativeGroup, [...group, credential]);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return [...alternatives.values()].some((group) =>
|
|
95
|
-
group.every(
|
|
96
|
-
(credential) => !envStatusByKey.get(credential.key)?.configured,
|
|
97
|
-
),
|
|
98
|
-
);
|
|
99
|
-
}
|
|
59
|
+
// Google Docs reads its service account key from the deployment environment
|
|
60
|
+
// only, so this credential form can't set it up; apps list it in Channels.
|
|
61
|
+
const CHANNELS = listBuiltInChannelIntegrations().filter(
|
|
62
|
+
(entry) => entry.id !== "google-docs",
|
|
63
|
+
);
|
|
100
64
|
|
|
101
65
|
function HelpTooltip({ content }: { content: string }) {
|
|
102
66
|
return (
|
|
@@ -505,7 +469,7 @@ export function MessagingSetupPanel() {
|
|
|
505
469
|
);
|
|
506
470
|
const missingRequiredCredentials = hasMissingRequiredCredentials(
|
|
507
471
|
envKeys,
|
|
508
|
-
envStatusByKey,
|
|
472
|
+
(key) => Boolean(envStatusByKey.get(key)?.configured),
|
|
509
473
|
);
|
|
510
474
|
const configuredCredentialCount = envKeys.filter(
|
|
511
475
|
(envKey) => envStatusByKey.get(envKey.key)?.configured,
|
|
@@ -515,7 +479,7 @@ export function MessagingSetupPanel() {
|
|
|
515
479
|
: missingRequiredCredentials
|
|
516
480
|
? "Required credentials are missing"
|
|
517
481
|
: `${configuredCredentialCount} saved`;
|
|
518
|
-
const Icon =
|
|
482
|
+
const Icon = channelIcon(platform.iconKey);
|
|
519
483
|
|
|
520
484
|
return (
|
|
521
485
|
<AccordionItem
|
|
@@ -1,139 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
import { buttonVariants } from "./button";
|
|
6
|
-
|
|
7
|
-
const AlertDialog = AlertDialogPrimitive.Root;
|
|
8
|
-
|
|
9
|
-
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
10
|
-
|
|
11
|
-
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
12
|
-
|
|
13
|
-
const AlertDialogOverlay = React.forwardRef<
|
|
14
|
-
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
15
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
16
|
-
>(({ className, ...props }, ref) => (
|
|
17
|
-
<AlertDialogPrimitive.Overlay
|
|
18
|
-
className={cn(
|
|
19
|
-
"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",
|
|
20
|
-
className,
|
|
21
|
-
)}
|
|
22
|
-
{...props}
|
|
23
|
-
ref={ref}
|
|
24
|
-
/>
|
|
25
|
-
));
|
|
26
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
27
|
-
|
|
28
|
-
const AlertDialogContent = React.forwardRef<
|
|
29
|
-
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
30
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
31
|
-
>(({ className, ...props }, ref) => (
|
|
32
|
-
<AlertDialogPortal>
|
|
33
|
-
<AlertDialogOverlay />
|
|
34
|
-
<AlertDialogPrimitive.Content
|
|
35
|
-
ref={ref}
|
|
36
|
-
className={cn(
|
|
37
|
-
"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",
|
|
38
|
-
className,
|
|
39
|
-
)}
|
|
40
|
-
{...props}
|
|
41
|
-
/>
|
|
42
|
-
</AlertDialogPortal>
|
|
43
|
-
));
|
|
44
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
45
|
-
|
|
46
|
-
const AlertDialogHeader = ({
|
|
47
|
-
className,
|
|
48
|
-
...props
|
|
49
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
50
|
-
<div
|
|
51
|
-
className={cn(
|
|
52
|
-
"flex flex-col space-y-2 text-center sm:text-left",
|
|
53
|
-
className,
|
|
54
|
-
)}
|
|
55
|
-
{...props}
|
|
56
|
-
/>
|
|
57
|
-
);
|
|
58
|
-
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
59
|
-
|
|
60
|
-
const AlertDialogFooter = ({
|
|
61
|
-
className,
|
|
62
|
-
...props
|
|
63
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
64
|
-
<div
|
|
65
|
-
className={cn(
|
|
66
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
67
|
-
className,
|
|
68
|
-
)}
|
|
69
|
-
{...props}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
72
|
-
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
73
|
-
|
|
74
|
-
const AlertDialogTitle = React.forwardRef<
|
|
75
|
-
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
76
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
77
|
-
>(({ className, ...props }, ref) => (
|
|
78
|
-
<AlertDialogPrimitive.Title
|
|
79
|
-
ref={ref}
|
|
80
|
-
className={cn("text-lg font-semibold", className)}
|
|
81
|
-
{...props}
|
|
82
|
-
/>
|
|
83
|
-
));
|
|
84
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
85
|
-
|
|
86
|
-
const AlertDialogDescription = React.forwardRef<
|
|
87
|
-
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
88
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
89
|
-
>(({ className, ...props }, ref) => (
|
|
90
|
-
<AlertDialogPrimitive.Description
|
|
91
|
-
ref={ref}
|
|
92
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
93
|
-
{...props}
|
|
94
|
-
/>
|
|
95
|
-
));
|
|
96
|
-
AlertDialogDescription.displayName =
|
|
97
|
-
AlertDialogPrimitive.Description.displayName;
|
|
98
|
-
|
|
99
|
-
const AlertDialogAction = React.forwardRef<
|
|
100
|
-
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
101
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
102
|
-
>(({ className, ...props }, ref) => (
|
|
103
|
-
<AlertDialogPrimitive.Action
|
|
104
|
-
ref={ref}
|
|
105
|
-
className={cn(buttonVariants(), className)}
|
|
106
|
-
{...props}
|
|
107
|
-
/>
|
|
108
|
-
));
|
|
109
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
110
|
-
|
|
111
|
-
const AlertDialogCancel = React.forwardRef<
|
|
112
|
-
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
113
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
114
|
-
>(({ className, ...props }, ref) => (
|
|
115
|
-
<AlertDialogPrimitive.Cancel
|
|
116
|
-
ref={ref}
|
|
117
|
-
className={cn(
|
|
118
|
-
buttonVariants({ variant: "outline" }),
|
|
119
|
-
"mt-2 sm:mt-0",
|
|
120
|
-
className,
|
|
121
|
-
)}
|
|
122
|
-
{...props}
|
|
123
|
-
/>
|
|
124
|
-
));
|
|
125
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
126
|
-
|
|
127
|
-
export {
|
|
128
|
-
AlertDialog,
|
|
129
|
-
AlertDialogPortal,
|
|
130
|
-
AlertDialogOverlay,
|
|
131
|
-
AlertDialogTrigger,
|
|
132
|
-
AlertDialogContent,
|
|
133
|
-
AlertDialogHeader,
|
|
134
|
-
AlertDialogFooter,
|
|
135
|
-
AlertDialogTitle,
|
|
136
|
-
AlertDialogDescription,
|
|
137
|
-
AlertDialogAction,
|
|
138
|
-
AlertDialogCancel,
|
|
139
|
-
};
|
|
1
|
+
export * from "@agent-native/toolkit/ui/alert-dialog";
|
|
@@ -1,56 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const buttonVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
-
destructive:
|
|
14
|
-
"bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
15
|
-
outline: "bg-accent text-accent-foreground hover:bg-accent/80",
|
|
16
|
-
secondary:
|
|
17
|
-
"bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
18
|
-
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
19
|
-
link: "text-primary underline-offset-4 hover:underline",
|
|
20
|
-
},
|
|
21
|
-
size: {
|
|
22
|
-
default: "h-10 px-4 py-2",
|
|
23
|
-
sm: "h-9 rounded-md px-3",
|
|
24
|
-
lg: "h-11 rounded-md px-8",
|
|
25
|
-
icon: "h-10 w-10",
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
defaultVariants: {
|
|
29
|
-
variant: "default",
|
|
30
|
-
size: "default",
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
export interface ButtonProps
|
|
36
|
-
extends
|
|
37
|
-
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
38
|
-
VariantProps<typeof buttonVariants> {
|
|
39
|
-
asChild?: boolean;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
43
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
44
|
-
const Comp = asChild ? Slot : "button";
|
|
45
|
-
return (
|
|
46
|
-
<Comp
|
|
47
|
-
className={cn(buttonVariants({ variant, size, className }))}
|
|
48
|
-
ref={ref}
|
|
49
|
-
{...props}
|
|
50
|
-
/>
|
|
51
|
-
);
|
|
52
|
-
},
|
|
53
|
-
);
|
|
54
|
-
Button.displayName = "Button";
|
|
55
|
-
|
|
56
|
-
export { Button, buttonVariants };
|
|
1
|
+
export * from "@agent-native/toolkit/ui/button";
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { cn } from "../../lib/utils";
|
|
4
|
-
|
|
5
|
-
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
|
|
6
|
-
({ className, type, ...props }, ref) => {
|
|
7
|
-
return (
|
|
8
|
-
<input
|
|
9
|
-
type={type}
|
|
10
|
-
className={cn(
|
|
11
|
-
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
12
|
-
className,
|
|
13
|
-
)}
|
|
14
|
-
ref={ref}
|
|
15
|
-
{...props}
|
|
16
|
-
/>
|
|
17
|
-
);
|
|
18
|
-
},
|
|
19
|
-
);
|
|
20
|
-
Input.displayName = "Input";
|
|
21
|
-
|
|
22
|
-
export { Input };
|
|
1
|
+
export * from "@agent-native/toolkit/ui/input";
|
|
@@ -1,27 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
|
|
6
|
-
const Switch = React.forwardRef<
|
|
7
|
-
React.ElementRef<typeof SwitchPrimitives.Root>,
|
|
8
|
-
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
|
|
9
|
-
>(({ className, ...props }, ref) => (
|
|
10
|
-
<SwitchPrimitives.Root
|
|
11
|
-
className={cn(
|
|
12
|
-
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
|
|
13
|
-
className,
|
|
14
|
-
)}
|
|
15
|
-
{...props}
|
|
16
|
-
ref={ref}
|
|
17
|
-
>
|
|
18
|
-
<SwitchPrimitives.Thumb
|
|
19
|
-
className={cn(
|
|
20
|
-
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
|
21
|
-
)}
|
|
22
|
-
/>
|
|
23
|
-
</SwitchPrimitives.Root>
|
|
24
|
-
));
|
|
25
|
-
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
26
|
-
|
|
27
|
-
export { Switch };
|
|
1
|
+
export * from "@agent-native/toolkit/ui/switch";
|
|
@@ -1,53 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
|
|
6
|
-
const Tabs = TabsPrimitive.Root;
|
|
7
|
-
|
|
8
|
-
const TabsList = React.forwardRef<
|
|
9
|
-
React.ElementRef<typeof TabsPrimitive.List>,
|
|
10
|
-
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
|
|
11
|
-
>(({ className, ...props }, ref) => (
|
|
12
|
-
<TabsPrimitive.List
|
|
13
|
-
ref={ref}
|
|
14
|
-
className={cn(
|
|
15
|
-
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
|
|
16
|
-
className,
|
|
17
|
-
)}
|
|
18
|
-
{...props}
|
|
19
|
-
/>
|
|
20
|
-
));
|
|
21
|
-
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
22
|
-
|
|
23
|
-
const TabsTrigger = React.forwardRef<
|
|
24
|
-
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
25
|
-
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
|
|
26
|
-
>(({ className, ...props }, ref) => (
|
|
27
|
-
<TabsPrimitive.Trigger
|
|
28
|
-
ref={ref}
|
|
29
|
-
className={cn(
|
|
30
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
31
|
-
className,
|
|
32
|
-
)}
|
|
33
|
-
{...props}
|
|
34
|
-
/>
|
|
35
|
-
));
|
|
36
|
-
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
37
|
-
|
|
38
|
-
const TabsContent = React.forwardRef<
|
|
39
|
-
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
40
|
-
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
|
|
41
|
-
>(({ className, ...props }, ref) => (
|
|
42
|
-
<TabsPrimitive.Content
|
|
43
|
-
ref={ref}
|
|
44
|
-
className={cn(
|
|
45
|
-
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
46
|
-
className,
|
|
47
|
-
)}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
));
|
|
51
|
-
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
52
|
-
|
|
53
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
1
|
+
export * from "@agent-native/toolkit/ui/tabs";
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const toggleVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: "bg-transparent",
|
|
13
|
-
outline:
|
|
14
|
-
"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
|
|
15
|
-
},
|
|
16
|
-
size: {
|
|
17
|
-
default: "h-10 px-3",
|
|
18
|
-
sm: "h-9 px-2.5",
|
|
19
|
-
lg: "h-11 px-5",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
variant: "default",
|
|
24
|
-
size: "default",
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
const Toggle = React.forwardRef<
|
|
30
|
-
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
31
|
-
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
|
|
32
|
-
VariantProps<typeof toggleVariants>
|
|
33
|
-
>(({ className, variant, size, ...props }, ref) => (
|
|
34
|
-
<TogglePrimitive.Root
|
|
35
|
-
ref={ref}
|
|
36
|
-
className={cn(toggleVariants({ variant, size, className }))}
|
|
37
|
-
{...props}
|
|
38
|
-
/>
|
|
39
|
-
));
|
|
40
|
-
|
|
41
|
-
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
42
|
-
|
|
43
|
-
export { Toggle, toggleVariants };
|
|
1
|
+
export * from "@agent-native/toolkit/ui/toggle";
|