@inf-monkeys-tech/monkeys-design 2.0.393 → 2.0.394
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/beautiful.css +43 -4
- package/dist/components/beautiful/index.js +50 -50
- package/dist/components/beautiful/index.js.map +1 -1
- package/dist/components/beautiful/index.mjs +44 -44
- package/dist/components/beautiful/index.mjs.map +1 -1
- package/dist/sources/{ab3a463e54918595b79681a411c9f8e5043333b5b3b7bdd2b93f6aaf5dc9f8ff.tsx → 6047804965b5f3ae2df2d223dcdf2059cbae24d3933b2cdc5b5b0965249eef37.tsx} +25 -18
- package/package.json +1 -1
|
@@ -86,7 +86,8 @@ const CHAT_SEARCH_MOTION = {
|
|
|
86
86
|
easing: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
function GlideGroup({ children }: { children: ReactNode }) {
|
|
89
|
+
function GlideGroup({ children, stationary = false }: { children: ReactNode; stationary?: boolean }) {
|
|
90
|
+
if (stationary) return <div className="flex flex-col gap-px">{children}</div>;
|
|
90
91
|
return (
|
|
91
92
|
<GlideMenu
|
|
92
93
|
rowSelector="[data-row]"
|
|
@@ -222,6 +223,8 @@ export function BUISidebarNav({
|
|
|
222
223
|
recents = EMPTY_RECENTS, recentUpdate, onRenameRecent, onDeleteRecent, variant,
|
|
223
224
|
}: SidebarNavProps) {
|
|
224
225
|
const translate = useBUICopy();
|
|
226
|
+
const lightEdge = variant === "light-edge";
|
|
227
|
+
const newChatInHeader = lightEdge && !showWorkspaceMenu;
|
|
225
228
|
const [collapsed, setCollapsed] = useState(false);
|
|
226
229
|
const [internalNav, setInternalNav] = useState("chats");
|
|
227
230
|
const currentNav = activeNav ?? internalNav;
|
|
@@ -292,10 +295,22 @@ export function BUISidebarNav({
|
|
|
292
295
|
setQuery("");
|
|
293
296
|
};
|
|
294
297
|
|
|
298
|
+
const newChatButton = (
|
|
299
|
+
<RailButton
|
|
300
|
+
icon={<IconEditBig size={18} />}
|
|
301
|
+
label={translate("New chat")}
|
|
302
|
+
onClick={() => {
|
|
303
|
+
if (activeTitle === undefined) setLocalActiveTitle(null);
|
|
304
|
+
selectNav("chats");
|
|
305
|
+
onNewChat?.();
|
|
306
|
+
}}
|
|
307
|
+
/>
|
|
308
|
+
);
|
|
309
|
+
|
|
295
310
|
return <BUIScope>{(
|
|
296
311
|
<aside
|
|
297
312
|
data-sidebar-collapsed={collapsed}
|
|
298
|
-
data-sidebar-variant={
|
|
313
|
+
data-sidebar-variant={lightEdge ? variant : undefined}
|
|
299
314
|
aria-label={translate("Workspace navigation")}
|
|
300
315
|
className={`relative flex shrink-0 overflow-hidden transition-[width] ${fill ? "h-full" : "h-[600px]"} ${className}`}
|
|
301
316
|
style={{
|
|
@@ -308,8 +323,8 @@ export function BUISidebarNav({
|
|
|
308
323
|
} as CSSProperties}
|
|
309
324
|
>
|
|
310
325
|
<div className={`flex min-h-0 shrink-0 flex-col ${fill ? "w-full" : "w-[224px]"}`}>
|
|
311
|
-
<div className=
|
|
312
|
-
<button
|
|
326
|
+
<div className={`sidebar-header relative mb-2.5 h-10 shrink-0 ${newChatInHeader ? "sidebar-header-new-chat" : ""}`}>
|
|
327
|
+
{newChatInHeader ? newChatButton : <button
|
|
313
328
|
ref={workspaceButtonRef}
|
|
314
329
|
data-workspace-trigger
|
|
315
330
|
type="button"
|
|
@@ -335,7 +350,7 @@ export function BUISidebarNav({
|
|
|
335
350
|
<span className="sidebar-copy ml-1 flex shrink-0 text-ink-3">
|
|
336
351
|
{showWorkspaceMenu && <IconChevronDownSmall size={16} />}
|
|
337
352
|
</span>
|
|
338
|
-
</button>
|
|
353
|
+
</button>}
|
|
339
354
|
|
|
340
355
|
{workspaceOpen && <WorkspaceMenu workspace={WORKSPACE} onAction={onWorkspaceAction} position={workspacePosition} onClose={() => setWorkspaceOpen(false)} />}
|
|
341
356
|
|
|
@@ -363,16 +378,8 @@ export function BUISidebarNav({
|
|
|
363
378
|
</button>
|
|
364
379
|
</div>
|
|
365
380
|
|
|
366
|
-
<GlideGroup>
|
|
367
|
-
|
|
368
|
-
icon={<IconEditBig size={18} />}
|
|
369
|
-
label={translate("New chat")}
|
|
370
|
-
onClick={() => {
|
|
371
|
-
if (activeTitle === undefined) setLocalActiveTitle(null);
|
|
372
|
-
selectNav("chats");
|
|
373
|
-
onNewChat?.();
|
|
374
|
-
}}
|
|
375
|
-
/>
|
|
381
|
+
{(!newChatInHeader || NAV_ITEMS.length > 0) && <GlideGroup stationary={lightEdge}>
|
|
382
|
+
{!newChatInHeader && newChatButton}
|
|
376
383
|
{NAV_ITEMS.map((item) => (
|
|
377
384
|
<RailButton
|
|
378
385
|
key={item.key}
|
|
@@ -383,7 +390,7 @@ export function BUISidebarNav({
|
|
|
383
390
|
onClick={() => selectNav(item.key)}
|
|
384
391
|
/>
|
|
385
392
|
))}
|
|
386
|
-
</GlideGroup>
|
|
393
|
+
</GlideGroup>}
|
|
387
394
|
|
|
388
395
|
<div hidden={collapsed} className="sidebar-history mt-3 min-h-0 flex-1 overflow-y-auto">
|
|
389
396
|
<div className="sidebar-history-header sidebar-copy relative mx-2 mb-1 h-8">
|
|
@@ -446,7 +453,7 @@ export function BUISidebarNav({
|
|
|
446
453
|
</div>
|
|
447
454
|
</div>
|
|
448
455
|
|
|
449
|
-
<GlideGroup>
|
|
456
|
+
<GlideGroup stationary={lightEdge}>
|
|
450
457
|
{visibleRecents.map((item) => {
|
|
451
458
|
const active = activeId !== undefined ? item.id === activeId : item.label === selectedTitle;
|
|
452
459
|
return (
|
|
@@ -454,7 +461,7 @@ export function BUISidebarNav({
|
|
|
454
461
|
<button type="button" title={item.label} aria-current={active ? "page" : undefined}
|
|
455
462
|
onClick={() => { selectNav("chats"); if (activeTitle === undefined) setLocalActiveTitle(item.label); onPick?.(item.id, item.label, item.prompt); }}
|
|
456
463
|
className="sidebar-recent-select min-w-0 flex-1 self-stretch text-left">
|
|
457
|
-
{
|
|
464
|
+
{lightEdge && <MessageSquare size={16} aria-hidden="true" />}
|
|
458
465
|
<span className={`sidebar-copy block truncate text-sm font-medium ${active ? "text-ink" : "text-ink-2"}`}>{item.label}</span>
|
|
459
466
|
</button>
|
|
460
467
|
{item.running && <span className="sidebar-recent-running" role="status" aria-label={translate("recentRunning")} title={translate("recentRunning")}><LoaderCircle size={16} className="animate-spin" aria-hidden="true" /></span>}
|