@inf-monkeys-tech/monkeys-design 1.0.78 → 1.0.80

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/index.mjs CHANGED
@@ -4,7 +4,7 @@ import * as React4 from 'react';
4
4
  import React4__default, { forwardRef, useMemo, useId, useRef, useState, useEffect, createElement, createContext, useCallback, useContext, Children, isValidElement, Fragment as Fragment$1, useLayoutEffect } from 'react';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
6
  import * as PopoverPrimitive from '@radix-ui/react-popover';
7
- import { ChevronDown, Search, Circle, Check, ChevronRight, ChevronUp, Plus, Pin, Blocks, Settings, TerminalSquare, FileOutput, Download, X, RefreshCw, Bot, SquarePen, MessageSquare, Clock3, Loader2, CheckCircle2, XCircle, CircleStop, AlertCircle, GitFork, PencilLine, Copy, RotateCcw, FileCode2, Files, TestTube2, Ellipsis, Pencil, Trash2, Image } from 'lucide-react';
7
+ import { ChevronDown, Search, Circle, Check, ChevronRight, ChevronUp, Plus, Pin, Blocks, Settings, TerminalSquare, FileOutput, Download, X, RefreshCw, Bot, SquarePen, MessageSquare, Clock3, Loader2, CheckCircle2, XCircle, CircleStop, AlertCircle, GitFork, PencilLine, Copy, RotateCcw, FileCode2, Files, TestTube2, Ellipsis, Trash2, Pencil, Image } from 'lucide-react';
8
8
  import { twMerge } from 'tailwind-merge';
9
9
  import * as DropdownMenu2 from '@radix-ui/react-dropdown-menu';
10
10
  import * as ContextMenu from '@radix-ui/react-context-menu';
@@ -18369,6 +18369,7 @@ function AgentWorkbenchSidebarSearch({
18369
18369
  label,
18370
18370
  placeholder = label,
18371
18371
  className,
18372
+ variant = "default",
18372
18373
  onChange
18373
18374
  }) {
18374
18375
  const messages = useMonkeysLocaleMessages().agentWorkbench.navigation;
@@ -18384,47 +18385,60 @@ function AgentWorkbenchSidebarSearch({
18384
18385
  window.addEventListener("keydown", handleShortcut);
18385
18386
  return () => window.removeEventListener("keydown", handleShortcut);
18386
18387
  }, []);
18387
- return /* @__PURE__ */ jsxs(InputGroup, { className: cn2("h-10 rounded-lg bg-card", className), children: [
18388
- /* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(Search, { className: "size-4", "aria-hidden": "true" }) }),
18389
- /* @__PURE__ */ jsx(
18390
- InputGroupInput,
18391
- {
18392
- ref: searchRef,
18393
- type: "search",
18394
- value,
18395
- "aria-label": label,
18396
- placeholder,
18397
- className: "min-w-0 [&::-webkit-search-cancel-button]:hidden",
18398
- onChange: (event) => onChange(event.target.value),
18399
- onKeyDown: (event) => {
18400
- if (event.key !== "Escape") return;
18401
- onChange("");
18402
- event.currentTarget.blur();
18403
- }
18404
- }
18405
- ),
18406
- value ? /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx(
18407
- InputGroupButton,
18408
- {
18409
- size: "icon-xs",
18410
- "aria-label": messages.clearSearch,
18411
- onClick: () => onChange(""),
18412
- children: /* @__PURE__ */ jsx(X, { className: "size-3.5", "aria-hidden": "true" })
18413
- }
18414
- ) }) : /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx("kbd", { className: "border border-border px-1.5 py-0.5 text-[10px]", children: "Ctrl K" }) })
18415
- ] });
18388
+ return /* @__PURE__ */ jsxs(
18389
+ InputGroup,
18390
+ {
18391
+ className: cn2(
18392
+ variant === "trend" ? "h-12 rounded-[var(--radius)] border-border bg-card text-foreground" : "h-10 rounded-lg bg-card",
18393
+ className
18394
+ ),
18395
+ children: [
18396
+ /* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(Search, { className: "size-4", "aria-hidden": "true" }) }),
18397
+ /* @__PURE__ */ jsx(
18398
+ InputGroupInput,
18399
+ {
18400
+ ref: searchRef,
18401
+ type: "search",
18402
+ value,
18403
+ "aria-label": label,
18404
+ placeholder,
18405
+ className: "min-w-0 [&::-webkit-search-cancel-button]:hidden",
18406
+ onChange: (event) => onChange(event.target.value),
18407
+ onKeyDown: (event) => {
18408
+ if (event.key !== "Escape") return;
18409
+ onChange("");
18410
+ event.currentTarget.blur();
18411
+ }
18412
+ }
18413
+ ),
18414
+ value ? /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx(
18415
+ InputGroupButton,
18416
+ {
18417
+ size: "icon-xs",
18418
+ "aria-label": messages.clearSearch,
18419
+ onClick: () => onChange(""),
18420
+ children: /* @__PURE__ */ jsx(X, { className: "size-3.5", "aria-hidden": "true" })
18421
+ }
18422
+ ) }) : /* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx("kbd", { className: "border border-border px-1.5 py-0.5 text-[10px]", children: "Ctrl K" }) })
18423
+ ]
18424
+ }
18425
+ );
18416
18426
  }
18417
18427
  function AgentWorkbenchSidebarNewSessionButton({
18418
18428
  label,
18419
18429
  className,
18430
+ variant = "default",
18420
18431
  onClick
18421
18432
  }) {
18422
18433
  return /* @__PURE__ */ jsxs(
18423
18434
  Button,
18424
18435
  {
18425
18436
  type: "button",
18426
- variant: "ghost",
18427
- className: cn2("h-9 w-full justify-start gap-2 px-3 text-sm", className),
18437
+ variant: variant === "trend" ? "default" : "ghost",
18438
+ className: cn2(
18439
+ variant === "trend" ? "h-11 w-full justify-center gap-2 rounded-[var(--radius)] border border-primary/60 bg-primary px-3 font-semibold text-primary-foreground hover:bg-primary/90" : "h-9 w-full justify-start gap-2 px-3 text-sm",
18440
+ className
18441
+ ),
18428
18442
  onClick,
18429
18443
  children: [
18430
18444
  /* @__PURE__ */ jsx(SquarePen, { className: "size-4", "aria-hidden": "true" }),
@@ -18513,6 +18527,7 @@ function AgentWorkbenchSessionList({
18513
18527
  retryLabel,
18514
18528
  groupByMode = false,
18515
18529
  showHeading = false,
18530
+ variant = "default",
18516
18531
  className,
18517
18532
  itemClassName,
18518
18533
  capabilities,
@@ -18572,6 +18587,59 @@ function AgentWorkbenchSessionList({
18572
18587
  if (sessions.length === 0) {
18573
18588
  return /* @__PURE__ */ jsx("div", { className: "px-3 py-8 text-center text-sm text-muted-foreground", children: query ? noResultsLabel : emptyLabel });
18574
18589
  }
18590
+ const renderTrendItems = (items) => /* @__PURE__ */ jsx("div", { className: "space-y-3", children: items.map((item) => /* @__PURE__ */ jsxs(
18591
+ "div",
18592
+ {
18593
+ "aria-current": item.id === selectedSessionId ? "page" : void 0,
18594
+ className: "group flex h-10 w-full min-w-0 items-center rounded-[var(--radius)] border border-transparent bg-muted/60 text-foreground transition hover:bg-muted aria-[current=page]:border-primary aria-[current=page]:bg-primary/10",
18595
+ children: [
18596
+ /* @__PURE__ */ jsx(
18597
+ "button",
18598
+ {
18599
+ type: "button",
18600
+ title: item.title,
18601
+ className: "h-full min-w-0 flex-1 truncate px-3 text-left text-sm font-semibold",
18602
+ onClick: () => onSelect(item.id),
18603
+ children: item.title
18604
+ }
18605
+ ),
18606
+ capabilities?.delete ? /* @__PURE__ */ jsx(
18607
+ "span",
18608
+ {
18609
+ "data-agent-workbench-item-actions": true,
18610
+ className: "mr-1 shrink-0 opacity-0 transition-opacity group-aria-[current=page]:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100",
18611
+ onClick: (event) => event.stopPropagation(),
18612
+ onKeyDown: (event) => event.stopPropagation(),
18613
+ children: /* @__PURE__ */ jsxs(DropdownMenu4, { children: [
18614
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
18615
+ Button,
18616
+ {
18617
+ type: "button",
18618
+ variant: "ghost",
18619
+ size: "icon",
18620
+ "aria-label": messages.actions,
18621
+ className: "size-8 text-muted-foreground",
18622
+ children: /* @__PURE__ */ jsx(Ellipsis, { className: "size-4", "aria-hidden": "true" })
18623
+ }
18624
+ ) }),
18625
+ /* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", children: /* @__PURE__ */ jsxs(
18626
+ DropdownMenuItem,
18627
+ {
18628
+ className: "text-destructive-text",
18629
+ onSelect: () => onDelete?.(item.id),
18630
+ children: [
18631
+ /* @__PURE__ */ jsx(Trash2, { className: "mr-2 size-4", "aria-hidden": "true" }),
18632
+ messages.delete
18633
+ ]
18634
+ }
18635
+ ) })
18636
+ ] })
18637
+ }
18638
+ ) : null
18639
+ ]
18640
+ },
18641
+ item.id
18642
+ )) });
18575
18643
  const renderItems = (items) => /* @__PURE__ */ jsx("div", { className: "space-y-1", children: items.map((item) => {
18576
18644
  const percent = item.contextUsage && item.contextUsage.maxTokens > 0 ? Math.min(
18577
18645
  100,
@@ -18728,7 +18796,7 @@ function AgentWorkbenchSessionList({
18728
18796
  }) });
18729
18797
  return /* @__PURE__ */ jsxs("div", { className: cn2("space-y-2", className), children: [
18730
18798
  showHeading && !groupByMode ? /* @__PURE__ */ jsx("h3", { className: "mb-2 px-3 text-xs font-medium text-muted-foreground", children: messages.recentSessions }) : null,
18731
- groupByMode ? [
18799
+ variant === "trend" ? renderTrendItems(sessions) : groupByMode ? [
18732
18800
  {
18733
18801
  id: "chatbot",
18734
18802
  label: messages.chats,
@@ -19157,6 +19225,7 @@ function AgentWorkbenchExploreSidebar({
19157
19225
  error,
19158
19226
  showDraftSession = !selectedSessionId,
19159
19227
  deleteSessions = false,
19228
+ variant = "default",
19160
19229
  defaultGroupId,
19161
19230
  header,
19162
19231
  footer,
@@ -19242,6 +19311,7 @@ function AgentWorkbenchExploreSidebar({
19242
19311
  {
19243
19312
  value: searchQuery,
19244
19313
  label: labels.search,
19314
+ variant,
19245
19315
  onChange: (query) => onIntent?.({ type: "change-search", query })
19246
19316
  }
19247
19317
  ) : void 0,
@@ -19249,6 +19319,7 @@ function AgentWorkbenchExploreSidebar({
19249
19319
  AgentWorkbenchSidebarNewSessionButton,
19250
19320
  {
19251
19321
  label: labels.newSession,
19322
+ variant,
19252
19323
  onClick: () => onIntent?.({ type: "create-session" })
19253
19324
  }
19254
19325
  ) : void 0,
@@ -19280,6 +19351,7 @@ function AgentWorkbenchExploreSidebar({
19280
19351
  noResultsLabel: labels.noResults,
19281
19352
  retryLabel: labels.retry,
19282
19353
  groupByMode: resolvedConfig.navigationMode !== "default",
19354
+ variant,
19283
19355
  capabilities: { delete: deleteSessions },
19284
19356
  onSelect: (sessionId) => onIntent?.({ type: "select-session", sessionId }),
19285
19357
  onDelete: (sessionId) => onIntent?.({ type: "delete-session", sessionId }),