@datum-cloud/datum-ui 3.2.0 → 3.4.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/dist/app-navigation/index.mjs +2 -2
- package/dist/{app-navigation-DEqa2_TC.mjs → app-navigation-BB_NLEWv.mjs} +48 -31
- package/dist/assistant/index.mjs +197 -68
- package/dist/components/features/app-navigation/nav-menu/parts.d.ts +21 -3
- package/dist/components/features/assistant/components/assistant-workspace.d.ts +18 -1
- package/dist/components/features/assistant/components/empty-state.d.ts +3 -1
- package/dist/components/features/assistant/index.d.ts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/sidebar/index.mjs +1 -1
- package/dist/{sidebar-BeWEEu7P.mjs → sidebar-sbqOOFii.mjs} +9 -0
- package/package.json +15 -15
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as SidebarProvider, S as SidebarGroupLabel, _ as SidebarMenuSubButton, a as SidebarInput, b as SidebarGroupAction, c as SidebarSeparator, d as SidebarMenuAction, f as SidebarMenuBadge, g as SidebarMenuSub, h as SidebarMenuSkeleton, i as SidebarHeader, l as SidebarTrigger, m as SidebarMenuItem, n as SidebarContent, o as SidebarInset, p as SidebarMenuButton, r as SidebarFooter, s as SidebarRail, t as Sidebar, u as SidebarMenu, v as SidebarMenuSubItem, w as useSidebar, x as SidebarGroupContent, y as SidebarGroup } from "../sidebar-
|
|
2
|
-
import { a as hasActiveDescendant, i as findItemByHref, n as NavMenu, o as isNavItemActive, r as NavMenuItem, s as normalizePath, t as AppNavigation } from "../app-navigation-
|
|
1
|
+
import { C as SidebarProvider, S as SidebarGroupLabel, _ as SidebarMenuSubButton, a as SidebarInput, b as SidebarGroupAction, c as SidebarSeparator, d as SidebarMenuAction, f as SidebarMenuBadge, g as SidebarMenuSub, h as SidebarMenuSkeleton, i as SidebarHeader, l as SidebarTrigger, m as SidebarMenuItem, n as SidebarContent, o as SidebarInset, p as SidebarMenuButton, r as SidebarFooter, s as SidebarRail, t as Sidebar, u as SidebarMenu, v as SidebarMenuSubItem, w as useSidebar, x as SidebarGroupContent, y as SidebarGroup } from "../sidebar-sbqOOFii.mjs";
|
|
2
|
+
import { a as hasActiveDescendant, i as findItemByHref, n as NavMenu, o as isNavItemActive, r as NavMenuItem, s as normalizePath, t as AppNavigation } from "../app-navigation-BB_NLEWv.mjs";
|
|
3
3
|
export { AppNavigation, NavMenu, NavMenuItem, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, findItemByHref, hasActiveDescendant, isNavItemActive, normalizePath, useSidebar };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as cn } from "./utils-Bu32wN-x.mjs";
|
|
2
2
|
import { t as Icon } from "./icon-wrapper-DKfJlJd0.mjs";
|
|
3
3
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "./collapsible/index.mjs";
|
|
4
|
-
import { c as SidebarSeparator, g as SidebarMenuSub, h as SidebarMenuSkeleton, i as SidebarHeader, l as SidebarTrigger, m as SidebarMenuItem, n as SidebarContent, p as SidebarMenuButton, r as SidebarFooter, t as Sidebar, u as SidebarMenu, w as useSidebar, x as SidebarGroupContent, y as SidebarGroup } from "./sidebar-
|
|
4
|
+
import { c as SidebarSeparator, g as SidebarMenuSub, h as SidebarMenuSkeleton, i as SidebarHeader, l as SidebarTrigger, m as SidebarMenuItem, n as SidebarContent, p as SidebarMenuButton, r as SidebarFooter, t as Sidebar, u as SidebarMenu, w as useSidebar, x as SidebarGroupContent, y as SidebarGroup } from "./sidebar-sbqOOFii.mjs";
|
|
5
5
|
import { n as EASE } from "./motion-DvGRWdsm.mjs";
|
|
6
6
|
import { ChevronRight, ExternalLinkIcon } from "lucide-react";
|
|
7
7
|
import { createContext, memo, use, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -112,9 +112,27 @@ function getNavItemKey(item, level) {
|
|
|
112
112
|
//#endregion
|
|
113
113
|
//#region src/components/features/app-navigation/nav-menu/parts.tsx
|
|
114
114
|
const NAV_STYLES = {
|
|
115
|
-
/**
|
|
116
|
-
|
|
117
|
-
|
|
115
|
+
/**
|
|
116
|
+
* Side inset of every row. With the button's own px-2 it puts each icon 16px
|
|
117
|
+
* from the edge, which centres it in the 48px icon rail, so icons hold still
|
|
118
|
+
* while the sidebar collapses and expands.
|
|
119
|
+
*/
|
|
120
|
+
rowInset: "px-2",
|
|
121
|
+
/**
|
|
122
|
+
* Labels, badges and chevrons fade out in the icon rail instead of dropping
|
|
123
|
+
* out of the layout, so collapsing reads as the sidebar narrowing over them
|
|
124
|
+
* rather than the row snapping to its rail shape before the width moves.
|
|
125
|
+
* They also stop shrinking, so a label clips at the edge with its badge
|
|
126
|
+
* instead of truncating to "Co…" beside a full-width badge.
|
|
127
|
+
*/
|
|
128
|
+
railFade: "transition-opacity duration-150 group-data-[collapsible=icon]:shrink-0 group-data-[collapsible=icon]:opacity-0",
|
|
129
|
+
/**
|
|
130
|
+
* Row wrapper. A flex column, so the tooltip's inline wrapper never sits on a
|
|
131
|
+
* text baseline: in the icon rail the label is hidden, and the descender space
|
|
132
|
+
* under that baseline would make each rail row taller than its expanded twin.
|
|
133
|
+
*/
|
|
134
|
+
menuItem: "flex flex-col [&>*:first-child]:w-full",
|
|
135
|
+
menuButton: "rounded-xl h-8 font-normal text-xs transition-all px-2 py-1 group-data-[collapsible=icon]:w-full! data-[active=true]:bg-sidebar data-[active=true]:text-foreground data-[active=true]:text-sidebar-primary data-[active=true]:[&>svg]:text-primary hover:bg-sidebar hover:text-sidebar-primary hover:[&>svg]:text-sidebar-primary hover:bg-sidebar-accent data-[active=true]:bg-sidebar-accent hover:font-semibold data-[active=true]:hover:[&>svg]:text-sidebar-primary transition-colors duration-300 gap-2.5 text-foreground [&>svg]:text-icon-primary",
|
|
118
136
|
disabled: "pointer-events-none opacity-50",
|
|
119
137
|
icon: "duration-300 transition-all",
|
|
120
138
|
iconSmall: "size-4 duration-300 transition-all"
|
|
@@ -216,30 +234,29 @@ const NavMenuItem = memo(({ item, level = 0 }) => {
|
|
|
216
234
|
NavMenuItem.displayName = "NavMenuItem";
|
|
217
235
|
/**
|
|
218
236
|
* A labelled group of nav items (always open — Vercel-style section headers).
|
|
219
|
-
* The same tree renders in the icon rail
|
|
220
|
-
*
|
|
237
|
+
* The same tree renders in the icon rail, so the rail shows every item's icon
|
|
238
|
+
* and collapsing the sidebar never remounts the items.
|
|
239
|
+
*
|
|
240
|
+
* In the rail the header keeps its row height and shows a short rule instead of
|
|
241
|
+
* its label, so every item sits at the same height collapsed and expanded and
|
|
242
|
+
* hover-expanding never shifts a row out from under the pointer.
|
|
221
243
|
*/
|
|
222
244
|
function NavGroup({ item, level }) {
|
|
223
|
-
const
|
|
224
|
-
const { pathname } = ctx;
|
|
245
|
+
const { pathname } = useNavMenuContext();
|
|
225
246
|
const hasActiveChild = item.children?.some((child) => hasActiveDescendant(child, pathname)) ?? false;
|
|
226
247
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
227
248
|
item.showSeparatorAbove && /* @__PURE__ */ jsx(SidebarSeparator, { className: "my-2" }),
|
|
228
249
|
/* @__PURE__ */ jsxs(SidebarGroup, {
|
|
229
250
|
className: cn("mb-1 p-0!", !item.showSeparatorAbove && "mt-3"),
|
|
230
|
-
children: [item.title && /* @__PURE__ */
|
|
231
|
-
className: cn("
|
|
232
|
-
children: /* @__PURE__ */ jsx(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
className: "min-w-0 truncate",
|
|
240
|
-
children: item.title
|
|
241
|
-
})
|
|
242
|
-
})
|
|
251
|
+
children: [item.title && /* @__PURE__ */ jsxs("div", {
|
|
252
|
+
className: cn("relative flex h-7 shrink-0 items-center", NAV_STYLES.rowInset),
|
|
253
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
254
|
+
className: cn("text-muted-foreground min-w-0 truncate px-2 text-xs font-medium", NAV_STYLES.railFade, hasActiveChild && "text-primary"),
|
|
255
|
+
children: item.title
|
|
256
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
257
|
+
"aria-hidden": true,
|
|
258
|
+
className: "bg-sidebar-border absolute left-4 h-px w-4 opacity-0 transition-opacity duration-150 group-data-[collapsible=icon]:opacity-100 group-data-[collapsible=icon]:delay-150"
|
|
259
|
+
})]
|
|
243
260
|
}), /* @__PURE__ */ jsx(SidebarGroupContent, {
|
|
244
261
|
className: "flex flex-col gap-0.5",
|
|
245
262
|
children: (item.children || []).map((child) => /* @__PURE__ */ jsx(NavMenuItem, {
|
|
@@ -289,7 +306,7 @@ function NavCollapsibleItem({ item, level }) {
|
|
|
289
306
|
},
|
|
290
307
|
className: "group/collapsible",
|
|
291
308
|
children: /* @__PURE__ */ jsxs(SidebarMenuItem, {
|
|
292
|
-
className:
|
|
309
|
+
className: NAV_STYLES.menuItem,
|
|
293
310
|
children: [/* @__PURE__ */ jsx(CollapsibleTrigger, {
|
|
294
311
|
asChild: true,
|
|
295
312
|
className: "w-full",
|
|
@@ -301,16 +318,16 @@ function NavCollapsibleItem({ item, level }) {
|
|
|
301
318
|
activeClassName: ctx.activeItemClassName,
|
|
302
319
|
children: [
|
|
303
320
|
/* @__PURE__ */ jsx("span", {
|
|
304
|
-
className: "min-w-0 truncate
|
|
321
|
+
className: cn("min-w-0 truncate", NAV_STYLES.railFade),
|
|
305
322
|
children: item.title
|
|
306
323
|
}),
|
|
307
324
|
item.badge && /* @__PURE__ */ jsx("span", {
|
|
308
|
-
className:
|
|
325
|
+
className: NAV_STYLES.railFade,
|
|
309
326
|
children: /* @__PURE__ */ jsx(NavBadge, { badge: item.badge })
|
|
310
327
|
}),
|
|
311
328
|
/* @__PURE__ */ jsx(Icon, {
|
|
312
329
|
icon: ChevronRight,
|
|
313
|
-
className: "ml-auto shrink-0 transition-transform duration-200 group-data-[collapsible=icon]:
|
|
330
|
+
className: "ml-auto shrink-0 transition-[transform,opacity] duration-200 group-data-[collapsible=icon]:opacity-0 group-data-[state=open]/collapsible:rotate-90"
|
|
314
331
|
})
|
|
315
332
|
]
|
|
316
333
|
})
|
|
@@ -355,7 +372,7 @@ function NavLeafItem({ item, level }) {
|
|
|
355
372
|
/* @__PURE__ */ jsx(SidebarMenu, {
|
|
356
373
|
className: cn(`level_${level}`, rowInsetFor(level)),
|
|
357
374
|
children: /* @__PURE__ */ jsx(SidebarMenuItem, {
|
|
358
|
-
className:
|
|
375
|
+
className: NAV_STYLES.menuItem,
|
|
359
376
|
children: /* @__PURE__ */ jsx(NavSidebarMenuButton, {
|
|
360
377
|
asChild: true,
|
|
361
378
|
item,
|
|
@@ -374,15 +391,15 @@ function NavLeafItem({ item, level }) {
|
|
|
374
391
|
className: "size-4 shrink-0 transition-all duration-300"
|
|
375
392
|
}),
|
|
376
393
|
/* @__PURE__ */ jsx("span", {
|
|
377
|
-
className: "min-w-0 truncate
|
|
394
|
+
className: cn("min-w-0 truncate", NAV_STYLES.railFade),
|
|
378
395
|
children: item.title
|
|
379
396
|
}),
|
|
380
397
|
item.badge ? /* @__PURE__ */ jsx("span", {
|
|
381
|
-
className:
|
|
398
|
+
className: NAV_STYLES.railFade,
|
|
382
399
|
children: /* @__PURE__ */ jsx(NavBadge, { badge: item.badge })
|
|
383
400
|
}) : /* @__PURE__ */ jsx(Icon, {
|
|
384
401
|
icon: ExternalLinkIcon,
|
|
385
|
-
className: "ml-auto size-4 shrink-0
|
|
402
|
+
className: cn("ml-auto size-4 shrink-0", NAV_STYLES.railFade)
|
|
386
403
|
})
|
|
387
404
|
]
|
|
388
405
|
}) : /* @__PURE__ */ jsxs(ctx.linkComponent, {
|
|
@@ -396,11 +413,11 @@ function NavLeafItem({ item, level }) {
|
|
|
396
413
|
className: "text-sidebar-primary shrink-0 transition-all duration-300"
|
|
397
414
|
}),
|
|
398
415
|
/* @__PURE__ */ jsx("span", {
|
|
399
|
-
className: "min-w-0 truncate
|
|
416
|
+
className: cn("min-w-0 truncate", NAV_STYLES.railFade),
|
|
400
417
|
children: item.title
|
|
401
418
|
}),
|
|
402
419
|
item.badge && /* @__PURE__ */ jsx("span", {
|
|
403
|
-
className:
|
|
420
|
+
className: NAV_STYLES.railFade,
|
|
404
421
|
children: /* @__PURE__ */ jsx(NavBadge, { badge: item.badge })
|
|
405
422
|
})
|
|
406
423
|
]
|
package/dist/assistant/index.mjs
CHANGED
|
@@ -5,9 +5,9 @@ import { t as Dialog } from "../dialog-Gu70fban.mjs";
|
|
|
5
5
|
import { a as DropdownMenuRadioGroup, c as DropdownMenuTrigger, i as DropdownMenuLabel, o as DropdownMenuRadioItem, r as DropdownMenuContent, s as DropdownMenuSeparator, t as DropdownMenu } from "../dropdown-menu-b8zY5Cs6.mjs";
|
|
6
6
|
import { t as Tooltip } from "../tooltip-DhbN1BDK.mjs";
|
|
7
7
|
import { n as EASE, t as DURATION } from "../motion-DvGRWdsm.mjs";
|
|
8
|
-
import { Archive, ArchiveRestore, ArrowDown, ArrowRight, ArrowUp, Brain, Check, ChevronDown, Copy, Download, MessagesSquare, Mic, MicOff, PanelLeft, Plus, RotateCw, Square, Trash2 } from "lucide-react";
|
|
8
|
+
import { Archive, ArchiveRestore, ArrowDown, ArrowRight, ArrowUp, Brain, Check, ChevronDown, Copy, Download, MessagesSquare, Mic, MicOff, PanelLeft, Plus, RotateCw, Square, SquarePen, Trash2, X } from "lucide-react";
|
|
9
9
|
import { Fragment, createContext, useCallback, useContext, useMemo, useRef, useState } from "react";
|
|
10
|
-
import {
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { AnimatePresence, motion } from "motion/react";
|
|
12
12
|
import { EditorContent } from "@tiptap/react";
|
|
13
13
|
import { getToolName, isReasoningUIPart, isTextUIPart, isToolUIPart } from "ai";
|
|
@@ -100,7 +100,10 @@ function ModelSelector({ modelId, effortId, onModelChange, onEffortChange, disab
|
|
|
100
100
|
children: model.label
|
|
101
101
|
}),
|
|
102
102
|
/* @__PURE__ */ jsx("span", { children: effort.label }),
|
|
103
|
-
/* @__PURE__ */ jsx(
|
|
103
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
104
|
+
icon: ChevronDown,
|
|
105
|
+
className: "size-3.5 shrink-0"
|
|
106
|
+
})
|
|
104
107
|
]
|
|
105
108
|
})
|
|
106
109
|
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
@@ -170,7 +173,13 @@ function PromptCard({ editor, isReady, canRetry, onSend, onStop, onRetry, modelI
|
|
|
170
173
|
onClick: onMicToggle,
|
|
171
174
|
"aria-label": isListening ? "Stop listening" : "Start voice input",
|
|
172
175
|
className: cn("hover:bg-accent shrink-0 rounded-full p-1.5 transition-colors", isListening ? "text-destructive hover:text-destructive/80" : "text-muted-foreground hover:text-foreground"),
|
|
173
|
-
children: isListening ? frequencyData ? /* @__PURE__ */ jsx(Equalizer, { frequencyData }) : /* @__PURE__ */ jsx(
|
|
176
|
+
children: isListening ? frequencyData ? /* @__PURE__ */ jsx(Equalizer, { frequencyData }) : /* @__PURE__ */ jsx(Icon, {
|
|
177
|
+
icon: MicOff,
|
|
178
|
+
className: "size-4"
|
|
179
|
+
}) : /* @__PURE__ */ jsx(Icon, {
|
|
180
|
+
icon: Mic,
|
|
181
|
+
className: "size-4"
|
|
182
|
+
})
|
|
174
183
|
})
|
|
175
184
|
}),
|
|
176
185
|
/* @__PURE__ */ jsx(AnimatePresence, { children: canRetry && /* @__PURE__ */ jsx(motion.div, {
|
|
@@ -200,7 +209,10 @@ function PromptCard({ editor, isReady, canRetry, onSend, onStop, onRetry, modelI
|
|
|
200
209
|
onClick: onRetry,
|
|
201
210
|
"aria-label": "Retry last message",
|
|
202
211
|
className: "text-muted-foreground hover:text-foreground hover:bg-accent shrink-0 rounded-full p-1.5 transition-colors",
|
|
203
|
-
children: /* @__PURE__ */ jsx(
|
|
212
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
213
|
+
icon: RotateCw,
|
|
214
|
+
className: "size-4"
|
|
215
|
+
})
|
|
204
216
|
})
|
|
205
217
|
})
|
|
206
218
|
}) }),
|
|
@@ -212,7 +224,10 @@ function PromptCard({ editor, isReady, canRetry, onSend, onStop, onRetry, modelI
|
|
|
212
224
|
onClick: onSend,
|
|
213
225
|
"aria-label": "Send message",
|
|
214
226
|
className: "bg-primary text-primary-foreground hover:bg-primary/90 shrink-0 rounded-full p-1.5 transition-colors",
|
|
215
|
-
children: /* @__PURE__ */ jsx(
|
|
227
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
228
|
+
icon: ArrowUp,
|
|
229
|
+
className: "size-4"
|
|
230
|
+
})
|
|
216
231
|
})
|
|
217
232
|
}) : /* @__PURE__ */ jsx(Tooltip, {
|
|
218
233
|
message: "Stop generating",
|
|
@@ -222,7 +237,10 @@ function PromptCard({ editor, isReady, canRetry, onSend, onStop, onRetry, modelI
|
|
|
222
237
|
onClick: onStop,
|
|
223
238
|
"aria-label": "Stop generating",
|
|
224
239
|
className: "bg-primary text-primary-foreground hover:bg-primary/90 shrink-0 rounded-full p-1.5 transition-colors",
|
|
225
|
-
children: /* @__PURE__ */ jsx(
|
|
240
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
241
|
+
icon: Square,
|
|
242
|
+
className: "size-4 fill-current"
|
|
243
|
+
})
|
|
226
244
|
})
|
|
227
245
|
})
|
|
228
246
|
]
|
|
@@ -375,9 +393,15 @@ function ThinkingBlock({ text, isStreaming = false }) {
|
|
|
375
393
|
disabled: isStreaming,
|
|
376
394
|
className: cn("text-muted-foreground flex items-center gap-1.5 text-xs transition-colors", !isStreaming && "hover:text-foreground cursor-pointer", isStreaming && "cursor-default"),
|
|
377
395
|
children: [
|
|
378
|
-
/* @__PURE__ */ jsx(
|
|
396
|
+
/* @__PURE__ */ jsx(Icon, {
|
|
397
|
+
icon: Brain,
|
|
398
|
+
className: cn("size-3.5 shrink-0", isStreaming && "animate-pulse")
|
|
399
|
+
}),
|
|
379
400
|
/* @__PURE__ */ jsx("span", { children: label }),
|
|
380
|
-
!isStreaming && /* @__PURE__ */ jsx(
|
|
401
|
+
!isStreaming && /* @__PURE__ */ jsx(Icon, {
|
|
402
|
+
icon: ChevronDown,
|
|
403
|
+
className: cn("size-3.5 shrink-0 transition-transform", open && "rotate-180")
|
|
404
|
+
})
|
|
381
405
|
]
|
|
382
406
|
}), /* @__PURE__ */ jsx("div", {
|
|
383
407
|
className: cn("grid transition-[grid-template-rows] duration-200", open && !isStreaming ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
|
|
@@ -491,7 +515,13 @@ function MessageActions({ msg }) {
|
|
|
491
515
|
onClick: handleCopy,
|
|
492
516
|
"aria-label": "Copy message",
|
|
493
517
|
className: "hover:text-foreground rounded p-1 transition-colors",
|
|
494
|
-
children: copied ? /* @__PURE__ */ jsx(
|
|
518
|
+
children: copied ? /* @__PURE__ */ jsx(Icon, {
|
|
519
|
+
icon: Check,
|
|
520
|
+
className: "size-3.5"
|
|
521
|
+
}) : /* @__PURE__ */ jsx(Icon, {
|
|
522
|
+
icon: Copy,
|
|
523
|
+
className: "size-3.5"
|
|
524
|
+
})
|
|
495
525
|
})
|
|
496
526
|
}), /* @__PURE__ */ jsx(Tooltip, {
|
|
497
527
|
message: "Download as Markdown",
|
|
@@ -501,7 +531,10 @@ function MessageActions({ msg }) {
|
|
|
501
531
|
onClick: handleDownload,
|
|
502
532
|
"aria-label": "Download message",
|
|
503
533
|
className: "hover:text-foreground rounded p-1 transition-colors",
|
|
504
|
-
children: /* @__PURE__ */ jsx(
|
|
534
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
535
|
+
icon: Download,
|
|
536
|
+
className: "size-3.5"
|
|
537
|
+
})
|
|
505
538
|
})
|
|
506
539
|
})]
|
|
507
540
|
});
|
|
@@ -546,7 +579,10 @@ function ScrollToBottomButton({ show, onClick }) {
|
|
|
546
579
|
onClick,
|
|
547
580
|
"aria-label": "Scroll to bottom",
|
|
548
581
|
className: "ring-border bg-card text-muted-foreground hover:text-foreground absolute -top-10 left-1/2 z-10 -translate-x-1/2 rounded-full p-1.5 ring-1 transition-colors",
|
|
549
|
-
children: /* @__PURE__ */ jsx(
|
|
582
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
583
|
+
icon: ArrowDown,
|
|
584
|
+
className: "size-3.5"
|
|
585
|
+
})
|
|
550
586
|
}) });
|
|
551
587
|
}
|
|
552
588
|
//#endregion
|
|
@@ -728,10 +764,10 @@ function BrainGlyph({ className }) {
|
|
|
728
764
|
}
|
|
729
765
|
//#endregion
|
|
730
766
|
//#region src/components/features/assistant/components/empty-state.tsx
|
|
731
|
-
function EmptyState({ name, isReady, onSuggestion, children }) {
|
|
767
|
+
function EmptyState({ name, isReady, onSuggestion, compact = false, children }) {
|
|
732
768
|
const { greeting, suggestions } = useAssistantConfig();
|
|
733
769
|
return /* @__PURE__ */ jsxs("div", {
|
|
734
|
-
className: "mx-auto flex w-full max-w-2xl flex-1 flex-col justify-center
|
|
770
|
+
className: cn("mx-auto flex w-full max-w-2xl flex-1 flex-col px-4", compact ? "min-h-0 justify-center-safe overflow-y-auto py-6" : "justify-center py-8"),
|
|
735
771
|
children: [
|
|
736
772
|
/* @__PURE__ */ jsxs(motion.div, {
|
|
737
773
|
initial: {
|
|
@@ -746,9 +782,9 @@ function EmptyState({ name, isReady, onSuggestion, children }) {
|
|
|
746
782
|
duration: .3,
|
|
747
783
|
ease: EASE.out
|
|
748
784
|
},
|
|
749
|
-
className: "mb-8 flex flex-col items-center text-center",
|
|
750
|
-
children: [/* @__PURE__ */ jsx(BrainGlyph, { className: "mb-4 size-16" }), /* @__PURE__ */ jsx("h1", {
|
|
751
|
-
className: "text-foreground font-title text-3xl leading-[34px] font-normal tracking-[-1.2px]",
|
|
785
|
+
className: cn("mb-8 flex flex-col items-center text-center", compact && "mb-6"),
|
|
786
|
+
children: [/* @__PURE__ */ jsx(BrainGlyph, { className: cn("mb-4 size-16", compact && "mb-3 size-12") }), /* @__PURE__ */ jsx("h1", {
|
|
787
|
+
className: cn("text-foreground font-title text-3xl leading-[34px] font-normal tracking-[-1.2px]", compact && "text-2xl leading-8 tracking-[-0.8px]"),
|
|
752
788
|
children: greeting(name)
|
|
753
789
|
})]
|
|
754
790
|
}),
|
|
@@ -787,8 +823,11 @@ function EmptyState({ name, isReady, onSuggestion, children }) {
|
|
|
787
823
|
},
|
|
788
824
|
disabled: !isReady,
|
|
789
825
|
onClick: () => onSuggestion(suggestion),
|
|
790
|
-
className: "group bg-sidebar-accent text-foreground flex items-center justify-between rounded-xl px-4 py-3 text-left text-sm transition-[filter] hover:brightness-95 disabled:cursor-not-allowed disabled:opacity-50",
|
|
791
|
-
children: [/* @__PURE__ */ jsx("span", { children: suggestion }), /* @__PURE__ */ jsx(
|
|
826
|
+
className: cn("group bg-sidebar-accent text-foreground flex items-center justify-between gap-3 rounded-xl px-4 py-3 text-left text-sm transition-[filter] hover:brightness-95 disabled:cursor-not-allowed disabled:opacity-50", compact && "px-3 py-2.5"),
|
|
827
|
+
children: [/* @__PURE__ */ jsx("span", { children: suggestion }), /* @__PURE__ */ jsx(Icon, {
|
|
828
|
+
icon: ArrowRight,
|
|
829
|
+
className: "text-muted-foreground group-hover:text-foreground size-4 shrink-0 transition-colors"
|
|
830
|
+
})]
|
|
792
831
|
}, suggestion))
|
|
793
832
|
})
|
|
794
833
|
]
|
|
@@ -810,9 +849,10 @@ function ChatRail({ historyOpen, onNewChat, onToggleHistory }) {
|
|
|
810
849
|
className: cn(iconClass, "group"),
|
|
811
850
|
children: /* @__PURE__ */ jsx("span", {
|
|
812
851
|
className: "bg-foreground text-background group-hover:bg-primary flex size-4 items-center justify-center rounded-full transition-colors",
|
|
813
|
-
children: /* @__PURE__ */ jsx(
|
|
814
|
-
|
|
815
|
-
|
|
852
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
853
|
+
icon: Plus,
|
|
854
|
+
size: 12,
|
|
855
|
+
strokeWidth: 1.25
|
|
816
856
|
})
|
|
817
857
|
})
|
|
818
858
|
})
|
|
@@ -1022,8 +1062,15 @@ function HistoryPanel({ chatList, currentChatId, onLoadChat, onDeleteChat, onArc
|
|
|
1022
1062
|
}
|
|
1023
1063
|
//#endregion
|
|
1024
1064
|
//#region src/components/features/assistant/components/assistant-workspace.tsx
|
|
1025
|
-
|
|
1065
|
+
const HEADER_BUTTON_CLASS = "text-muted-foreground hover:text-foreground hover:bg-accent shrink-0 rounded-md p-1.5 transition-colors";
|
|
1066
|
+
const PANEL_SPRING = {
|
|
1067
|
+
type: "spring",
|
|
1068
|
+
stiffness: 400,
|
|
1069
|
+
damping: 32
|
|
1070
|
+
};
|
|
1071
|
+
function AssistantWorkspace({ orientation = "horizontal", onClose, config, userName, title, messages, status, error, isReady, chatList, currentChatId, sidebarHeader, editor, htmlByUserMsgIndex, bottomRef, containerRef, userScrolledUpRef, onSend, onStop, onRetry, onNewChat, onLoadChat, onDeleteChat, onArchiveChat, onUnarchiveChat, confirmDelete, onSuggestion, modelId, effortId, onModelChange, onEffortChange, micSupported, micListening, micFrequencyData, onMicToggle, historyOpen, onToggleHistory }) {
|
|
1026
1072
|
const hasMessages = messages.length > 0;
|
|
1073
|
+
const isVertical = orientation === "vertical";
|
|
1027
1074
|
const promptCard = /* @__PURE__ */ jsx(PromptCard, {
|
|
1028
1075
|
editor,
|
|
1029
1076
|
isReady,
|
|
@@ -1040,6 +1087,122 @@ function AssistantWorkspace({ config, userName, title, messages, status, error,
|
|
|
1040
1087
|
frequencyData: micFrequencyData,
|
|
1041
1088
|
onMicToggle
|
|
1042
1089
|
});
|
|
1090
|
+
const historyPanel = /* @__PURE__ */ jsx(HistoryPanel, {
|
|
1091
|
+
chatList,
|
|
1092
|
+
currentChatId,
|
|
1093
|
+
header: sidebarHeader,
|
|
1094
|
+
onLoadChat: (chat) => {
|
|
1095
|
+
onLoadChat(chat);
|
|
1096
|
+
if (isVertical) onToggleHistory();
|
|
1097
|
+
},
|
|
1098
|
+
onDeleteChat,
|
|
1099
|
+
onArchiveChat,
|
|
1100
|
+
onUnarchiveChat,
|
|
1101
|
+
confirmDelete
|
|
1102
|
+
});
|
|
1103
|
+
const historyToggle = /* @__PURE__ */ jsx(Tooltip, {
|
|
1104
|
+
message: historyOpen ? "Close sidebar" : "Open sidebar",
|
|
1105
|
+
side: "bottom",
|
|
1106
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
1107
|
+
type: "button",
|
|
1108
|
+
"aria-label": "Toggle sidebar",
|
|
1109
|
+
"aria-expanded": historyOpen,
|
|
1110
|
+
onClick: onToggleHistory,
|
|
1111
|
+
className: HEADER_BUTTON_CLASS,
|
|
1112
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
1113
|
+
icon: PanelLeft,
|
|
1114
|
+
className: "size-4"
|
|
1115
|
+
})
|
|
1116
|
+
})
|
|
1117
|
+
});
|
|
1118
|
+
const closeButton = onClose && /* @__PURE__ */ jsx(Tooltip, {
|
|
1119
|
+
message: "Close",
|
|
1120
|
+
side: "bottom",
|
|
1121
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
1122
|
+
type: "button",
|
|
1123
|
+
"aria-label": "Close",
|
|
1124
|
+
onClick: onClose,
|
|
1125
|
+
className: HEADER_BUTTON_CLASS,
|
|
1126
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
1127
|
+
icon: X,
|
|
1128
|
+
className: "size-4"
|
|
1129
|
+
})
|
|
1130
|
+
})
|
|
1131
|
+
});
|
|
1132
|
+
const content = hasMessages ? /* @__PURE__ */ jsx(Conversation, {
|
|
1133
|
+
messages,
|
|
1134
|
+
status,
|
|
1135
|
+
error,
|
|
1136
|
+
htmlByUserMsgIndex,
|
|
1137
|
+
containerRef,
|
|
1138
|
+
bottomRef,
|
|
1139
|
+
userScrolledUpRef,
|
|
1140
|
+
footer: promptCard
|
|
1141
|
+
}) : /* @__PURE__ */ jsx(EmptyState, {
|
|
1142
|
+
name: userName,
|
|
1143
|
+
isReady,
|
|
1144
|
+
onSuggestion,
|
|
1145
|
+
compact: isVertical,
|
|
1146
|
+
children: promptCard
|
|
1147
|
+
});
|
|
1148
|
+
if (isVertical) return /* @__PURE__ */ jsx(AssistantConfigProvider, {
|
|
1149
|
+
config,
|
|
1150
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1151
|
+
className: "bg-background flex h-full w-full flex-col overflow-hidden",
|
|
1152
|
+
children: [/* @__PURE__ */ jsxs("header", {
|
|
1153
|
+
className: "flex h-12 shrink-0 items-center gap-1 border-b px-2",
|
|
1154
|
+
children: [
|
|
1155
|
+
historyToggle,
|
|
1156
|
+
/* @__PURE__ */ jsx("span", {
|
|
1157
|
+
className: "text-foreground min-w-0 flex-1 truncate px-1 text-sm font-medium",
|
|
1158
|
+
children: title
|
|
1159
|
+
}),
|
|
1160
|
+
/* @__PURE__ */ jsx(Tooltip, {
|
|
1161
|
+
message: "New chat",
|
|
1162
|
+
side: "bottom",
|
|
1163
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
1164
|
+
type: "button",
|
|
1165
|
+
"aria-label": "New chat",
|
|
1166
|
+
onClick: () => {
|
|
1167
|
+
onNewChat();
|
|
1168
|
+
if (historyOpen) onToggleHistory();
|
|
1169
|
+
},
|
|
1170
|
+
className: HEADER_BUTTON_CLASS,
|
|
1171
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
1172
|
+
icon: SquarePen,
|
|
1173
|
+
className: "size-4"
|
|
1174
|
+
})
|
|
1175
|
+
})
|
|
1176
|
+
}),
|
|
1177
|
+
closeButton
|
|
1178
|
+
]
|
|
1179
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1180
|
+
className: "relative flex min-h-0 flex-1 flex-col",
|
|
1181
|
+
children: [content, /* @__PURE__ */ jsxs(AnimatePresence, {
|
|
1182
|
+
initial: false,
|
|
1183
|
+
children: [historyOpen && /* @__PURE__ */ jsx(motion.div, {
|
|
1184
|
+
"aria-hidden": true,
|
|
1185
|
+
className: "bg-foreground/10 absolute inset-0 z-30",
|
|
1186
|
+
initial: { opacity: 0 },
|
|
1187
|
+
animate: { opacity: 1 },
|
|
1188
|
+
exit: { opacity: 0 },
|
|
1189
|
+
transition: { duration: .2 },
|
|
1190
|
+
onClick: onToggleHistory
|
|
1191
|
+
}, "history-scrim"), historyOpen && /* @__PURE__ */ jsx(motion.div, {
|
|
1192
|
+
className: "absolute inset-y-0 left-0 z-40 max-w-[85%] overflow-hidden shadow-lg",
|
|
1193
|
+
initial: { width: 0 },
|
|
1194
|
+
animate: { width: 256 },
|
|
1195
|
+
exit: { width: 0 },
|
|
1196
|
+
transition: PANEL_SPRING,
|
|
1197
|
+
onKeyDown: (e) => {
|
|
1198
|
+
if (e.key === "Escape") onToggleHistory();
|
|
1199
|
+
},
|
|
1200
|
+
children: historyPanel
|
|
1201
|
+
}, "history-drawer")]
|
|
1202
|
+
})]
|
|
1203
|
+
})]
|
|
1204
|
+
})
|
|
1205
|
+
});
|
|
1043
1206
|
return /* @__PURE__ */ jsx(AssistantConfigProvider, {
|
|
1044
1207
|
config,
|
|
1045
1208
|
children: /* @__PURE__ */ jsxs("div", {
|
|
@@ -1057,59 +1220,25 @@ function AssistantWorkspace({ config, userName, title, messages, status, error,
|
|
|
1057
1220
|
initial: { width: 0 },
|
|
1058
1221
|
animate: { width: 256 },
|
|
1059
1222
|
exit: { width: 0 },
|
|
1060
|
-
transition:
|
|
1061
|
-
|
|
1062
|
-
stiffness: 400,
|
|
1063
|
-
damping: 32
|
|
1064
|
-
},
|
|
1065
|
-
children: /* @__PURE__ */ jsx(HistoryPanel, {
|
|
1066
|
-
chatList,
|
|
1067
|
-
currentChatId,
|
|
1068
|
-
header: sidebarHeader,
|
|
1069
|
-
onLoadChat,
|
|
1070
|
-
onDeleteChat,
|
|
1071
|
-
onArchiveChat,
|
|
1072
|
-
onUnarchiveChat,
|
|
1073
|
-
confirmDelete
|
|
1074
|
-
})
|
|
1223
|
+
transition: PANEL_SPRING,
|
|
1224
|
+
children: historyPanel
|
|
1075
1225
|
})
|
|
1076
1226
|
}),
|
|
1077
|
-
/* @__PURE__ */
|
|
1078
|
-
className: "flex min-w-0 flex-1 flex-col",
|
|
1079
|
-
children: hasMessages ? /* @__PURE__ */ jsxs(
|
|
1227
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1228
|
+
className: "relative flex min-w-0 flex-1 flex-col",
|
|
1229
|
+
children: [hasMessages ? /* @__PURE__ */ jsxs("header", {
|
|
1080
1230
|
className: "flex h-12 shrink-0 items-center justify-between border-b px-4",
|
|
1081
1231
|
children: [/* @__PURE__ */ jsx("span", {
|
|
1082
1232
|
className: "text-foreground min-w-0 truncate text-sm font-medium",
|
|
1083
1233
|
children: title
|
|
1084
|
-
}), /* @__PURE__ */
|
|
1234
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1085
1235
|
className: "flex items-center gap-1",
|
|
1086
|
-
children:
|
|
1087
|
-
message: historyOpen ? "Close sidebar" : "Open sidebar",
|
|
1088
|
-
side: "bottom",
|
|
1089
|
-
children: /* @__PURE__ */ jsx("button", {
|
|
1090
|
-
type: "button",
|
|
1091
|
-
"aria-label": "Toggle sidebar",
|
|
1092
|
-
onClick: onToggleHistory,
|
|
1093
|
-
className: "text-muted-foreground hover:text-foreground hover:bg-accent rounded-md p-1.5 transition-colors",
|
|
1094
|
-
children: /* @__PURE__ */ jsx(PanelLeft, { className: "size-4" })
|
|
1095
|
-
})
|
|
1096
|
-
})
|
|
1236
|
+
children: [historyToggle, closeButton]
|
|
1097
1237
|
})]
|
|
1098
|
-
})
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
htmlByUserMsgIndex,
|
|
1103
|
-
containerRef,
|
|
1104
|
-
bottomRef,
|
|
1105
|
-
userScrolledUpRef,
|
|
1106
|
-
footer: promptCard
|
|
1107
|
-
})] }) : /* @__PURE__ */ jsx(EmptyState, {
|
|
1108
|
-
name: userName,
|
|
1109
|
-
isReady,
|
|
1110
|
-
onSuggestion,
|
|
1111
|
-
children: promptCard
|
|
1112
|
-
})
|
|
1238
|
+
}) : closeButton && /* @__PURE__ */ jsx("div", {
|
|
1239
|
+
className: "absolute top-2 right-2 z-10",
|
|
1240
|
+
children: closeButton
|
|
1241
|
+
}), content]
|
|
1113
1242
|
})
|
|
1114
1243
|
]
|
|
1115
1244
|
})
|
|
@@ -3,9 +3,27 @@ import type { ComponentProps } from 'react';
|
|
|
3
3
|
import type { NavItem } from './types';
|
|
4
4
|
import { SidebarMenuButton } from '../../../base/sidebar';
|
|
5
5
|
export declare const NAV_STYLES: {
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Side inset of every row. With the button's own px-2 it puts each icon 16px
|
|
8
|
+
* from the edge, which centres it in the 48px icon rail, so icons hold still
|
|
9
|
+
* while the sidebar collapses and expands.
|
|
10
|
+
*/
|
|
11
|
+
readonly rowInset: "px-2";
|
|
12
|
+
/**
|
|
13
|
+
* Labels, badges and chevrons fade out in the icon rail instead of dropping
|
|
14
|
+
* out of the layout, so collapsing reads as the sidebar narrowing over them
|
|
15
|
+
* rather than the row snapping to its rail shape before the width moves.
|
|
16
|
+
* They also stop shrinking, so a label clips at the edge with its badge
|
|
17
|
+
* instead of truncating to "Co…" beside a full-width badge.
|
|
18
|
+
*/
|
|
19
|
+
readonly railFade: "transition-opacity duration-150 group-data-[collapsible=icon]:shrink-0 group-data-[collapsible=icon]:opacity-0";
|
|
20
|
+
/**
|
|
21
|
+
* Row wrapper. A flex column, so the tooltip's inline wrapper never sits on a
|
|
22
|
+
* text baseline: in the icon rail the label is hidden, and the descender space
|
|
23
|
+
* under that baseline would make each rail row taller than its expanded twin.
|
|
24
|
+
*/
|
|
25
|
+
readonly menuItem: "flex flex-col [&>*:first-child]:w-full";
|
|
26
|
+
readonly menuButton: "rounded-xl h-8 font-normal text-xs transition-all px-2 py-1 group-data-[collapsible=icon]:w-full! data-[active=true]:bg-sidebar data-[active=true]:text-foreground data-[active=true]:text-sidebar-primary data-[active=true]:[&>svg]:text-primary hover:bg-sidebar hover:text-sidebar-primary hover:[&>svg]:text-sidebar-primary hover:bg-sidebar-accent data-[active=true]:bg-sidebar-accent hover:font-semibold data-[active=true]:hover:[&>svg]:text-sidebar-primary transition-colors duration-300 gap-2.5 text-foreground [&>svg]:text-icon-primary";
|
|
9
27
|
readonly disabled: "pointer-events-none opacity-50";
|
|
10
28
|
readonly icon: "duration-300 transition-all";
|
|
11
29
|
readonly iconSmall: "size-4 duration-300 transition-all";
|
|
@@ -2,13 +2,30 @@ import type { Editor } from '@tiptap/react';
|
|
|
2
2
|
import type { UIMessage } from 'ai';
|
|
3
3
|
import type { MouseEvent as ReactMouseEvent, ReactNode, RefObject } from 'react';
|
|
4
4
|
import type { AssistantConfig, ChatSummary, EffortId } from '../types';
|
|
5
|
+
export type AssistantWorkspaceOrientation = 'horizontal' | 'vertical';
|
|
5
6
|
/**
|
|
6
7
|
* Presentational, props-driven assistant layout: left rail + collapsible
|
|
7
8
|
* history + (empty state | conversation) + composer. The host owns all state
|
|
8
9
|
* and transport (via its own chat hook) and feeds it in here, so staff and
|
|
9
10
|
* cloud reuse the exact same layout. Shell-agnostic — it fills its container.
|
|
11
|
+
*
|
|
12
|
+
* `orientation="vertical"` suits a tall, narrow container such as a docked side
|
|
13
|
+
* panel: the rail folds into a top bar and history opens as a drawer over the
|
|
14
|
+
* content instead of narrowing it.
|
|
10
15
|
*/
|
|
11
16
|
export interface AssistantWorkspaceProps {
|
|
17
|
+
/**
|
|
18
|
+
* `horizontal` (default) puts the rail and history beside the content, for a
|
|
19
|
+
* wide container. `vertical` swaps them for a top bar and a history drawer,
|
|
20
|
+
* for a tall, narrow one such as a side dock.
|
|
21
|
+
*/
|
|
22
|
+
orientation?: AssistantWorkspaceOrientation;
|
|
23
|
+
/**
|
|
24
|
+
* Renders a close button at the end of the header. Hosts that show the
|
|
25
|
+
* workspace in a dismissible panel pass this instead of overlaying their own
|
|
26
|
+
* button, which would collide with the header's controls.
|
|
27
|
+
*/
|
|
28
|
+
onClose?: () => void;
|
|
12
29
|
/** Host-specific configuration (copy, suggestions, tool labels, models, …). */
|
|
13
30
|
config?: Partial<AssistantConfig>;
|
|
14
31
|
/** Display name for the greeting; the host reads it from its own user context. */
|
|
@@ -60,4 +77,4 @@ export interface AssistantWorkspaceProps {
|
|
|
60
77
|
historyOpen: boolean;
|
|
61
78
|
onToggleHistory: () => void;
|
|
62
79
|
}
|
|
63
|
-
export declare function AssistantWorkspace({ config, userName, title, messages, status, error, isReady, chatList, currentChatId, sidebarHeader, editor, htmlByUserMsgIndex, bottomRef, containerRef, userScrolledUpRef, onSend, onStop, onRetry, onNewChat, onLoadChat, onDeleteChat, onArchiveChat, onUnarchiveChat, confirmDelete, onSuggestion, modelId, effortId, onModelChange, onEffortChange, micSupported, micListening, micFrequencyData, onMicToggle, historyOpen, onToggleHistory, }: AssistantWorkspaceProps): import("react").JSX.Element;
|
|
80
|
+
export declare function AssistantWorkspace({ orientation, onClose, config, userName, title, messages, status, error, isReady, chatList, currentChatId, sidebarHeader, editor, htmlByUserMsgIndex, bottomRef, containerRef, userScrolledUpRef, onSend, onStop, onRetry, onNewChat, onLoadChat, onDeleteChat, onArchiveChat, onUnarchiveChat, confirmDelete, onSuggestion, modelId, effortId, onModelChange, onEffortChange, micSupported, micListening, micFrequencyData, onMicToggle, historyOpen, onToggleHistory, }: AssistantWorkspaceProps): import("react").JSX.Element;
|
|
@@ -3,8 +3,10 @@ interface EmptyStateProps {
|
|
|
3
3
|
name?: string;
|
|
4
4
|
isReady: boolean;
|
|
5
5
|
onSuggestion: (text: string) => void;
|
|
6
|
+
/** Tighter spacing for a narrow container (the workspace's vertical orientation). */
|
|
7
|
+
compact?: boolean;
|
|
6
8
|
/** The shared prompt card. */
|
|
7
9
|
children: ReactNode;
|
|
8
10
|
}
|
|
9
|
-
export declare function EmptyState({ name, isReady, onSuggestion, children }: EmptyStateProps): import("react").JSX.Element;
|
|
11
|
+
export declare function EmptyState({ name, isReady, onSuggestion, compact, children }: EmptyStateProps): import("react").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AssistantWorkspace, type AssistantWorkspaceProps } from './components/assistant-workspace';
|
|
1
|
+
export { AssistantWorkspace, type AssistantWorkspaceOrientation, type AssistantWorkspaceProps, } from './components/assistant-workspace';
|
|
2
2
|
export { BrainGlyph } from './components/brain-glyph';
|
|
3
3
|
export * from './components/composer';
|
|
4
4
|
export * from './components/conversation';
|
package/dist/index.mjs
CHANGED
|
@@ -34,7 +34,7 @@ import { t as ResponsiveDropdown } from "./responsive-dropdown-C_KKgLbH.mjs";
|
|
|
34
34
|
import { t as ResponsivePopover } from "./responsive-popover-8VcjBM2d.mjs";
|
|
35
35
|
import { a as SelectLabel, c as SelectSeparator, i as SelectItem, l as SelectTrigger, n as SelectContent, o as SelectScrollDownButton, r as SelectGroup, s as SelectScrollUpButton, t as Select, u as SelectValue } from "./select-D4pk9e2d.mjs";
|
|
36
36
|
import { n as SettingsNavItem, r as SettingsNavLabel, t as SettingsNav } from "./settings-nav-Hf3GrCGv.mjs";
|
|
37
|
-
import { C as SidebarProvider, S as SidebarGroupLabel, _ as SidebarMenuSubButton, a as SidebarInput, b as SidebarGroupAction, c as SidebarSeparator, d as SidebarMenuAction, f as SidebarMenuBadge, g as SidebarMenuSub, h as SidebarMenuSkeleton, i as SidebarHeader, l as SidebarTrigger, m as SidebarMenuItem, n as SidebarContent, o as SidebarInset, p as SidebarMenuButton, r as SidebarFooter, s as SidebarRail, t as Sidebar, u as SidebarMenu, v as SidebarMenuSubItem, w as useSidebar, x as SidebarGroupContent, y as SidebarGroup } from "./sidebar-
|
|
37
|
+
import { C as SidebarProvider, S as SidebarGroupLabel, _ as SidebarMenuSubButton, a as SidebarInput, b as SidebarGroupAction, c as SidebarSeparator, d as SidebarMenuAction, f as SidebarMenuBadge, g as SidebarMenuSub, h as SidebarMenuSkeleton, i as SidebarHeader, l as SidebarTrigger, m as SidebarMenuItem, n as SidebarContent, o as SidebarInset, p as SidebarMenuButton, r as SidebarFooter, s as SidebarRail, t as Sidebar, u as SidebarMenu, v as SidebarMenuSubItem, w as useSidebar, x as SidebarGroupContent, y as SidebarGroup } from "./sidebar-sbqOOFii.mjs";
|
|
38
38
|
import { t as Tooltip } from "./tooltip-DhbN1BDK.mjs";
|
|
39
39
|
import { Skeleton } from "./skeleton/index.mjs";
|
|
40
40
|
import { t as Switch } from "./switch-BaR-Vna4.mjs";
|
|
@@ -43,7 +43,7 @@ import { Tabs, TabsContent, TabsLinkTrigger, TabsList, TabsTrigger } from "./tab
|
|
|
43
43
|
import { t as Textarea } from "./textarea-DiSGxCBO.mjs";
|
|
44
44
|
import { a as ListItem, c as Title, d as titleVariants, i as List, l as paragraphVariants, n as Code, o as Paragraph, r as Link, s as Text, t as Blockquote, u as textVariants } from "./typography-q71iTG72.mjs";
|
|
45
45
|
import { t as VisuallyHidden } from "./visuallyhidden-D7L_qs8b.mjs";
|
|
46
|
-
import { a as hasActiveDescendant, i as findItemByHref, n as NavMenu, o as isNavItemActive, r as NavMenuItem, s as normalizePath, t as AppNavigation } from "./app-navigation-
|
|
46
|
+
import { a as hasActiveDescendant, i as findItemByHref, n as NavMenu, o as isNavItemActive, r as NavMenuItem, s as normalizePath, t as AppNavigation } from "./app-navigation-BB_NLEWv.mjs";
|
|
47
47
|
import { n as EASE, t as DURATION } from "./motion-DvGRWdsm.mjs";
|
|
48
48
|
import { t as LoaderOverlay } from "./loader-overlay-DD94azZX.mjs";
|
|
49
49
|
import { t as Autocomplete } from "./autocomplete-BxtzndxZ.mjs";
|
package/dist/sidebar/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as SidebarProvider, S as SidebarGroupLabel, _ as SidebarMenuSubButton, a as SidebarInput, b as SidebarGroupAction, c as SidebarSeparator, d as SidebarMenuAction, f as SidebarMenuBadge, g as SidebarMenuSub, h as SidebarMenuSkeleton, i as SidebarHeader, l as SidebarTrigger, m as SidebarMenuItem, n as SidebarContent, o as SidebarInset, p as SidebarMenuButton, r as SidebarFooter, s as SidebarRail, t as Sidebar, u as SidebarMenu, v as SidebarMenuSubItem, w as useSidebar, x as SidebarGroupContent, y as SidebarGroup } from "../sidebar-
|
|
1
|
+
import { C as SidebarProvider, S as SidebarGroupLabel, _ as SidebarMenuSubButton, a as SidebarInput, b as SidebarGroupAction, c as SidebarSeparator, d as SidebarMenuAction, f as SidebarMenuBadge, g as SidebarMenuSub, h as SidebarMenuSkeleton, i as SidebarHeader, l as SidebarTrigger, m as SidebarMenuItem, n as SidebarContent, o as SidebarInset, p as SidebarMenuButton, r as SidebarFooter, s as SidebarRail, t as Sidebar, u as SidebarMenu, v as SidebarMenuSubItem, w as useSidebar, x as SidebarGroupContent, y as SidebarGroup } from "../sidebar-sbqOOFii.mjs";
|
|
2
2
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
|
|
@@ -291,6 +291,13 @@ const sidebarMenuButtonVariants = cva("peer/menu-button flex w-full items-center
|
|
|
291
291
|
function SidebarMenuButton({ asChild = false, isActive = false, variant = "default", size = "default", tooltip, className, ...props }) {
|
|
292
292
|
const Comp = asChild ? Slot : "button";
|
|
293
293
|
const { isMobile, state } = useSidebar();
|
|
294
|
+
const [tooltipOpen, setTooltipOpen] = React.useState(false);
|
|
295
|
+
const [tooltipState, setTooltipState] = React.useState(state);
|
|
296
|
+
if (tooltipState !== state) {
|
|
297
|
+
setTooltipState(state);
|
|
298
|
+
setTooltipOpen(false);
|
|
299
|
+
}
|
|
300
|
+
const handleTooltipOpenChange = React.useCallback((open) => setTooltipOpen(open && state === "collapsed" && !isMobile), [state, isMobile]);
|
|
294
301
|
const button = /* @__PURE__ */ jsx(Comp, {
|
|
295
302
|
"data-slot": "sidebar-menu-button",
|
|
296
303
|
"data-sidebar": "menu-button",
|
|
@@ -313,6 +320,8 @@ function SidebarMenuButton({ asChild = false, isActive = false, variant = "defau
|
|
|
313
320
|
side: "right",
|
|
314
321
|
align: "center",
|
|
315
322
|
hidden: state !== "collapsed" || isMobile,
|
|
323
|
+
open: tooltipOpen && state === "collapsed",
|
|
324
|
+
onOpenChange: handleTooltipOpenChange,
|
|
316
325
|
...tooltipProps,
|
|
317
326
|
children: button
|
|
318
327
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datum-cloud/datum-ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.4.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "https://github.com/datum-cloud/datum-ui"
|
|
@@ -440,16 +440,16 @@
|
|
|
440
440
|
"@streamdown/code": ">=1 <2",
|
|
441
441
|
"@tanstack/react-table": ">=9 <10",
|
|
442
442
|
"@tanstack/react-virtual": ">=3.14.3 <4",
|
|
443
|
-
"@tiptap/extension-character-count": ">=3.
|
|
444
|
-
"@tiptap/extension-link": ">=3.
|
|
445
|
-
"@tiptap/extension-placeholder": ">=3.
|
|
446
|
-
"@tiptap/extension-underline": ">=3.
|
|
447
|
-
"@tiptap/react": ">=3.
|
|
448
|
-
"@tiptap/starter-kit": ">=3.
|
|
443
|
+
"@tiptap/extension-character-count": ">=3.30.5 <4",
|
|
444
|
+
"@tiptap/extension-link": ">=3.30.5 <4",
|
|
445
|
+
"@tiptap/extension-placeholder": ">=3.30.5 <4",
|
|
446
|
+
"@tiptap/extension-underline": ">=3.30.5 <4",
|
|
447
|
+
"@tiptap/react": ">=3.30.5 <4",
|
|
448
|
+
"@tiptap/starter-kit": ">=3.30.5 <4",
|
|
449
449
|
"ai": ">=7 <8",
|
|
450
450
|
"date-fns": ">=4.1.0 <5",
|
|
451
451
|
"date-fns-tz": ">=3 <4",
|
|
452
|
-
"js-yaml": ">=5.
|
|
452
|
+
"js-yaml": ">=5.4.1 <6",
|
|
453
453
|
"leaflet": ">=1.9 <2",
|
|
454
454
|
"leaflet-draw": ">=1 <2",
|
|
455
455
|
"leaflet.fullscreen": ">=5 <6",
|
|
@@ -629,12 +629,12 @@
|
|
|
629
629
|
"@testing-library/jest-dom": "^7.0.1",
|
|
630
630
|
"@testing-library/react": "^16.3.2",
|
|
631
631
|
"@testing-library/user-event": "^14.6.1",
|
|
632
|
-
"@tiptap/extension-character-count": "^3.
|
|
633
|
-
"@tiptap/extension-link": "^3.
|
|
634
|
-
"@tiptap/extension-placeholder": "^3.
|
|
635
|
-
"@tiptap/extension-underline": "^3.
|
|
636
|
-
"@tiptap/react": "^3.
|
|
637
|
-
"@tiptap/starter-kit": "^3.
|
|
632
|
+
"@tiptap/extension-character-count": "^3.31.3",
|
|
633
|
+
"@tiptap/extension-link": "^3.31.3",
|
|
634
|
+
"@tiptap/extension-placeholder": "^3.31.3",
|
|
635
|
+
"@tiptap/extension-underline": "^3.31.3",
|
|
636
|
+
"@tiptap/react": "^3.31.3",
|
|
637
|
+
"@tiptap/starter-kit": "^3.31.3",
|
|
638
638
|
"@types/leaflet": "^1.9.22",
|
|
639
639
|
"@types/leaflet-draw": "^1.0.13",
|
|
640
640
|
"@types/leaflet.fullscreen": "^5.2.0",
|
|
@@ -647,7 +647,7 @@
|
|
|
647
647
|
"date-fns": "^4.4.0",
|
|
648
648
|
"date-fns-tz": "^3.2.0",
|
|
649
649
|
"eslint": "^10.8.1",
|
|
650
|
-
"js-yaml": "^5.
|
|
650
|
+
"js-yaml": "^5.4.2",
|
|
651
651
|
"jsdom": "^30.0.1",
|
|
652
652
|
"leaflet": "^1.9.4",
|
|
653
653
|
"leaflet-draw": "^1.0.4",
|