@inf-monkeys-tech/monkeys-design 1.0.49 → 1.0.52

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.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var lucideReact = require('lucide-react');
4
- var React2 = require('react');
4
+ var React5 = require('react');
5
5
  var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
6
6
  var tailwindMerge = require('tailwind-merge');
7
7
  var jsxRuntime = require('react/jsx-runtime');
@@ -38,7 +38,7 @@ function _interopNamespace(e) {
38
38
  return Object.freeze(n);
39
39
  }
40
40
 
41
- var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
41
+ var React5__namespace = /*#__PURE__*/_interopNamespace(React5);
42
42
  var DropdownMenuPrimitive__namespace = /*#__PURE__*/_interopNamespace(DropdownMenuPrimitive);
43
43
  var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
44
44
  var CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
@@ -354,17 +354,17 @@ var MONKEYS_PROVIDER_CONTEXTS_KEY = /* @__PURE__ */ Symbol.for(
354
354
  );
355
355
  function createMonkeysProviderContexts() {
356
356
  return Object.freeze({
357
- locale: React2.createContext({
357
+ locale: React5.createContext({
358
358
  ...defaultMonkeysLocale,
359
359
  provided: false
360
360
  }),
361
- theme: React2.createContext({
361
+ theme: React5.createContext({
362
362
  provided: false
363
363
  }),
364
- direction: React2.createContext({
364
+ direction: React5.createContext({
365
365
  provided: false
366
366
  }),
367
- environment: React2.createContext({
367
+ environment: React5.createContext({
368
368
  provided: false,
369
369
  environment: EMPTY_ENVIRONMENT,
370
370
  portal: EMPTY_PORTAL
@@ -390,10 +390,10 @@ providerContexts.theme;
390
390
  providerContexts.direction;
391
391
  providerContexts.environment;
392
392
  function useMonkeysLocale() {
393
- return React2.useContext(MonkeysLocaleContext);
393
+ return React5.useContext(MonkeysLocaleContext);
394
394
  }
395
395
  function useMonkeysLocaleMessages() {
396
- return React2.useContext(MonkeysLocaleContext).messages;
396
+ return React5.useContext(MonkeysLocaleContext).messages;
397
397
  }
398
398
  function cn(...parts) {
399
399
  return tailwindMerge.twMerge(parts.filter(Boolean).join(" "));
@@ -401,7 +401,118 @@ function cn(...parts) {
401
401
  function cn2(...inputs) {
402
402
  return inputs.filter(Boolean).join(" ");
403
403
  }
404
- var AccordionItem = React2__namespace.forwardRef(({ className, style, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
404
+ var useAutosizeTextArea = ({
405
+ textAreaRef,
406
+ triggerAutoSize,
407
+ maxHeight = Number.MAX_SAFE_INTEGER,
408
+ minHeight = 0
409
+ }) => {
410
+ const [init, setInit] = React5__namespace.useState(true);
411
+ React5__namespace.useEffect(() => {
412
+ const offsetBorder = 2;
413
+ if (textAreaRef) {
414
+ if (init) {
415
+ textAreaRef.style.minHeight = `${minHeight + offsetBorder}px`;
416
+ if (maxHeight > minHeight) {
417
+ textAreaRef.style.maxHeight = `${maxHeight}px`;
418
+ }
419
+ setInit(false);
420
+ }
421
+ textAreaRef.style.height = `${minHeight + offsetBorder}px`;
422
+ const scrollHeight = textAreaRef.scrollHeight;
423
+ if (scrollHeight > maxHeight) {
424
+ textAreaRef.style.height = `${maxHeight}px`;
425
+ } else {
426
+ textAreaRef.style.height = `${scrollHeight + offsetBorder}px`;
427
+ }
428
+ }
429
+ }, [textAreaRef, triggerAutoSize]);
430
+ };
431
+ var AutosizeTextarea = React5__namespace.forwardRef(
432
+ ({
433
+ maxHeight = Number.MAX_SAFE_INTEGER,
434
+ minHeight = 52,
435
+ className,
436
+ onChange,
437
+ value,
438
+ onKeyDown,
439
+ onSubmit,
440
+ onCompositionStart: propsOnCompositionStart,
441
+ onCompositionEnd: propsOnCompositionEnd,
442
+ ...props
443
+ }, ref) => {
444
+ const textAreaRef = React5__namespace.useRef(null);
445
+ const [triggerAutoSize, setTriggerAutoSize] = React5__namespace.useState("");
446
+ const [isComposing, setIsComposing] = React5__namespace.useState(false);
447
+ const [compositionValue, setCompositionValue] = React5__namespace.useState("");
448
+ useAutosizeTextArea({
449
+ textAreaRef: textAreaRef.current,
450
+ triggerAutoSize,
451
+ maxHeight,
452
+ minHeight
453
+ });
454
+ React5.useImperativeHandle(ref, () => ({
455
+ textArea: textAreaRef.current,
456
+ focus: () => textAreaRef.current?.focus(),
457
+ maxHeight,
458
+ minHeight
459
+ }));
460
+ React5__namespace.useEffect(() => {
461
+ setTriggerAutoSize(value);
462
+ }, [props?.defaultValue, value]);
463
+ const handleKeyDown = React5__namespace.useCallback((e) => {
464
+ if (e.key === "ArrowUp" && triggerAutoSize.length <= 0 && !(e.metaKey || e.altKey || e.ctrlKey)) {
465
+ e.preventDefault();
466
+ return;
467
+ }
468
+ if (onSubmit) {
469
+ const shouldSubmit = e.key === "Enter" && e.keyCode !== 229 && !e.nativeEvent.isComposing && !isComposing && !e.altKey && !e.ctrlKey && !e.shiftKey && !e.metaKey;
470
+ if (shouldSubmit) {
471
+ e.preventDefault();
472
+ onSubmit(e);
473
+ }
474
+ }
475
+ onKeyDown?.(e);
476
+ }, [isComposing, onKeyDown, onSubmit, triggerAutoSize.length]);
477
+ return /* @__PURE__ */ jsxRuntime.jsx(
478
+ "textarea",
479
+ {
480
+ ...props,
481
+ onKeyDown: handleKeyDown,
482
+ value: typeof value !== "undefined" ? isComposing ? compositionValue : value ?? "" : void 0,
483
+ ref: textAreaRef,
484
+ className: cn(
485
+ "flex w-full resize-y rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background 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",
486
+ className
487
+ ),
488
+ onCompositionStart: (e) => {
489
+ setIsComposing(true);
490
+ setCompositionValue(e.currentTarget.value);
491
+ propsOnCompositionStart?.(e);
492
+ },
493
+ onCompositionEnd: (e) => {
494
+ setIsComposing(false);
495
+ const finalValue = e.currentTarget.value;
496
+ setCompositionValue(finalValue);
497
+ setTriggerAutoSize(finalValue);
498
+ onChange?.(e);
499
+ propsOnCompositionEnd?.(e);
500
+ },
501
+ onChange: (e) => {
502
+ if (e.nativeEvent.isComposing) {
503
+ setCompositionValue(e.target.value);
504
+ setTriggerAutoSize(e.target.value);
505
+ return;
506
+ }
507
+ setTriggerAutoSize(e.target.value);
508
+ onChange?.(e);
509
+ }
510
+ }
511
+ );
512
+ }
513
+ );
514
+ AutosizeTextarea.displayName = "AutosizeTextarea";
515
+ var AccordionItem = React5__namespace.forwardRef(({ className, style, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
405
516
  AccordionPrimitive__namespace.Item,
406
517
  {
407
518
  ref,
@@ -414,7 +525,7 @@ var AccordionItem = React2__namespace.forwardRef(({ className, style, ...props }
414
525
  }
415
526
  ));
416
527
  AccordionItem.displayName = "AccordionItem";
417
- var AccordionTrigger = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
528
+ var AccordionTrigger = React5__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
418
529
  AccordionPrimitive__namespace.Trigger,
419
530
  {
420
531
  ref,
@@ -436,7 +547,7 @@ var AccordionTrigger = React2__namespace.forwardRef(({ className, children, ...p
436
547
  }
437
548
  ) }));
438
549
  AccordionTrigger.displayName = "AccordionTrigger";
439
- var AccordionContent = React2__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
550
+ var AccordionContent = React5__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
440
551
  AccordionPrimitive__namespace.Content,
441
552
  {
442
553
  ref,
@@ -446,7 +557,7 @@ var AccordionContent = React2__namespace.forwardRef(({ className, children, ...p
446
557
  }
447
558
  ));
448
559
  AccordionContent.displayName = "AccordionContent";
449
- var Checkbox = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
560
+ var Checkbox = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
450
561
  CheckboxPrimitive__namespace.Root,
451
562
  {
452
563
  ref,
@@ -481,7 +592,7 @@ var buttonVariants = classVarianceAuthority.cva(
481
592
  defaultVariants: { variant: "default", size: "default" }
482
593
  }
483
594
  );
484
- var Button = React2__namespace.forwardRef(
595
+ var Button = React5__namespace.forwardRef(
485
596
  ({ className, variant, size, asChild = false, ...props }, ref) => {
486
597
  const Component = asChild ? reactSlot.Slot : "button";
487
598
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -495,7 +606,7 @@ var Button = React2__namespace.forwardRef(
495
606
  }
496
607
  );
497
608
  Button.displayName = "Button";
498
- var PopoverContent = React2__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive2__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
609
+ var PopoverContent = React5__namespace.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(PopoverPrimitive2__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
499
610
  PopoverPrimitive2__namespace.Content,
500
611
  {
501
612
  ref,
@@ -509,7 +620,7 @@ var PopoverContent = React2__namespace.forwardRef(({ className, align = "center"
509
620
  }
510
621
  ) }));
511
622
  PopoverContent.displayName = "PopoverContent";
512
- var ScrollArea = React2__namespace.forwardRef(
623
+ var ScrollArea = React5__namespace.forwardRef(
513
624
  ({
514
625
  className,
515
626
  children,
@@ -553,7 +664,7 @@ var ScrollArea = React2__namespace.forwardRef(
553
664
  )
554
665
  );
555
666
  ScrollArea.displayName = "ScrollArea";
556
- var ScrollBar = React2__namespace.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
667
+ var ScrollBar = React5__namespace.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
557
668
  ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
558
669
  {
559
670
  ref,
@@ -569,7 +680,7 @@ var ScrollBar = React2__namespace.forwardRef(({ className, orientation = "vertic
569
680
  }
570
681
  ));
571
682
  ScrollBar.displayName = "ScrollBar";
572
- var Switch = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
683
+ var Switch = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
573
684
  SwitchPrimitive__namespace.Root,
574
685
  {
575
686
  ref,
@@ -582,9 +693,9 @@ var Switch = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @
582
693
  }
583
694
  ));
584
695
  Switch.displayName = "Switch";
585
- var Tabs = React2__namespace.forwardRef(({ variant = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Root, { ref, "data-variant": variant, ...props }));
696
+ var Tabs = React5__namespace.forwardRef(({ variant = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TabsPrimitive__namespace.Root, { ref, "data-variant": variant, ...props }));
586
697
  Tabs.displayName = "Tabs";
587
- var TabsList = React2__namespace.forwardRef(({ className, gap, style, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
698
+ var TabsList = React5__namespace.forwardRef(({ className, gap, style, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
588
699
  TabsPrimitive__namespace.List,
589
700
  {
590
701
  ref,
@@ -597,7 +708,7 @@ var TabsList = React2__namespace.forwardRef(({ className, gap, style, ...props }
597
708
  }
598
709
  ));
599
710
  TabsList.displayName = "TabsList";
600
- var TabsTrigger = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
711
+ var TabsTrigger = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
601
712
  TabsPrimitive__namespace.Trigger,
602
713
  {
603
714
  ref,
@@ -609,7 +720,7 @@ var TabsTrigger = React2__namespace.forwardRef(({ className, ...props }, ref) =>
609
720
  }
610
721
  ));
611
722
  TabsTrigger.displayName = "TabsTrigger";
612
- var TabsContent = React2__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
723
+ var TabsContent = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
613
724
  TabsPrimitive__namespace.Content,
614
725
  {
615
726
  ref,
@@ -621,7 +732,7 @@ var TabsContent = React2__namespace.forwardRef(({ className, ...props }, ref) =>
621
732
  }
622
733
  ));
623
734
  TabsContent.displayName = "TabsContent";
624
- var TooltipContent = React2__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
735
+ var TooltipContent = React5__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
625
736
  TooltipPrimitive__namespace.Content,
626
737
  {
627
738
  ref,
@@ -634,67 +745,215 @@ var TooltipContent = React2__namespace.forwardRef(({ className, sideOffset = 4,
634
745
  }
635
746
  ) }));
636
747
  TooltipContent.displayName = "TooltipContent";
748
+ var Input = React5__namespace.forwardRef(({ className, appearance = "standard", type, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
749
+ "input",
750
+ {
751
+ ref,
752
+ type,
753
+ className: cn(
754
+ "flex w-full border border-input bg-control-surface px-3 text-foreground ring-offset-control-surface transition-[border-color,background-color,color,box-shadow] file:border-0 file:bg-transparent file:text-sm file:font-medium 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",
755
+ appearance === "compact" ? "h-9 rounded-md py-1 text-sm shadow-sm" : "h-10 rounded-md py-2 text-sm shadow-sm",
756
+ appearance === "shadow" && "rounded-lg shadow-sm shadow-black/[0.02] dark:border-white/10 dark:bg-white/[0.04] dark:shadow-none",
757
+ className
758
+ ),
759
+ ...props
760
+ }
761
+ ));
762
+ Input.displayName = "Input";
763
+ var Textarea = React5__namespace.forwardRef(({ className, appearance = "standard", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
764
+ "textarea",
765
+ {
766
+ ref,
767
+ className: cn(
768
+ "flex w-full border border-input bg-control-surface px-3 py-2 text-foreground ring-offset-control-surface 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",
769
+ appearance === "compact" ? "min-h-[60px] rounded-md text-sm shadow-sm" : "min-h-[80px] rounded-md text-sm",
770
+ appearance === "shadow" && "shadow-sm shadow-black/[0.02] dark:border-white/10 dark:bg-white/[0.04] dark:shadow-none",
771
+ className
772
+ ),
773
+ ...props
774
+ }
775
+ ));
776
+ Textarea.displayName = "Textarea";
777
+ function InputGroup({ className, ...props }) {
778
+ return /* @__PURE__ */ jsxRuntime.jsx(
779
+ "div",
780
+ {
781
+ "data-slot": "input-group",
782
+ role: "group",
783
+ className: cn(
784
+ "group/input-group shadow-xs relative flex w-full items-center rounded-md border border-input outline-none transition-[color,box-shadow] dark:bg-input/30",
785
+ "h-9 has-[>textarea]:h-auto",
786
+ // Variants based on alignment.
787
+ "has-[>[data-align=inline-start]]:[&>input]:pl-2",
788
+ "has-[>[data-align=inline-end]]:[&>input]:pr-2",
789
+ "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
790
+ "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
791
+ // Focus state.
792
+ "has-[[data-slot=input-group-control]:focus-visible]:ring-1 has-[[data-slot=input-group-control]:focus-visible]:ring-ring",
793
+ // Error state.
794
+ "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
795
+ className
796
+ ),
797
+ ...props
798
+ }
799
+ );
800
+ }
801
+ var inputGroupAddonVariants = classVarianceAuthority.cva(
802
+ "text-muted-foreground flex h-auto cursor-text select-none items-center justify-center gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
803
+ {
804
+ variants: {
805
+ align: {
806
+ "inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
807
+ "inline-end": "order-last pr-3 has-[>button]:mr-[-0.4rem] has-[>kbd]:mr-[-0.35rem]",
808
+ "block-start": "[.border-b]:pb-3 order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5",
809
+ "block-end": "[.border-t]:pt-3 order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5"
810
+ }
811
+ },
812
+ defaultVariants: {
813
+ align: "inline-start"
814
+ }
815
+ }
816
+ );
817
+ function InputGroupAddon({
818
+ className,
819
+ align = "inline-start",
820
+ ...props
821
+ }) {
822
+ return /* @__PURE__ */ jsxRuntime.jsx(
823
+ "div",
824
+ {
825
+ role: "group",
826
+ "data-slot": "input-group-addon",
827
+ "data-align": align,
828
+ className: cn(inputGroupAddonVariants({ align }), className),
829
+ onClick: (e) => {
830
+ if (e.target.closest("button")) {
831
+ return;
832
+ }
833
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
834
+ },
835
+ ...props
836
+ }
837
+ );
838
+ }
839
+ var inputGroupButtonVariants = classVarianceAuthority.cva("flex items-center gap-2 text-sm shadow-none", {
840
+ variants: {
841
+ size: {
842
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
843
+ sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
844
+ "icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
845
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0"
846
+ }
847
+ },
848
+ defaultVariants: {
849
+ size: "xs"
850
+ }
851
+ });
852
+ function InputGroupButton({
853
+ className,
854
+ type = "button",
855
+ variant = "ghost",
856
+ size = "xs",
857
+ ...props
858
+ }) {
859
+ return /* @__PURE__ */ jsxRuntime.jsx(
860
+ Button,
861
+ {
862
+ type,
863
+ "data-size": size,
864
+ variant,
865
+ className: cn(inputGroupButtonVariants({ size }), className),
866
+ ...props
867
+ }
868
+ );
869
+ }
870
+ var InputGroupInput = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
871
+ Input,
872
+ {
873
+ ref,
874
+ "data-slot": "input-group-control",
875
+ className: cn(
876
+ "flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
877
+ className
878
+ ),
879
+ ...props
880
+ }
881
+ ));
882
+ InputGroupInput.displayName = "InputGroupInput";
883
+ var InputGroupTextarea = React5__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
884
+ Textarea,
885
+ {
886
+ ref,
887
+ "data-slot": "input-group-control",
888
+ className: cn(
889
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
890
+ className
891
+ ),
892
+ ...props
893
+ }
894
+ ));
895
+ InputGroupTextarea.displayName = "InputGroupTextarea";
637
896
  var menuItemClassName = "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0";
638
897
  var menuContentClassName = "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-menu-surface p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2";
639
898
  var DropdownMenu2 = DropdownMenuPrimitive__namespace.Root;
640
899
  var DropdownMenuTrigger = DropdownMenuPrimitive__namespace.Trigger;
641
- var DropdownMenuSubTrigger = React2__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuPrimitive__namespace.SubTrigger, { ref, className: cn(menuItemClassName, "data-[state=open]:bg-accent", inset && "pl-8", className), ...props, children: [
900
+ var DropdownMenuSubTrigger = React5__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuPrimitive__namespace.SubTrigger, { ref, className: cn(menuItemClassName, "data-[state=open]:bg-accent", inset && "pl-8", className), ...props, children: [
642
901
  children,
643
902
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { "aria-hidden": "true", className: "ml-auto" })
644
903
  ] }));
645
904
  DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
646
- var DropdownMenuSubContent = React2__namespace.forwardRef(
905
+ var DropdownMenuSubContent = React5__namespace.forwardRef(
647
906
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.SubContent, { ref, className: cn(menuContentClassName, className), ...props })
648
907
  );
649
908
  DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
650
- var DropdownMenuContent = React2__namespace.forwardRef(
909
+ var DropdownMenuContent = React5__namespace.forwardRef(
651
910
  ({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Content, { ref, sideOffset, className: cn(menuContentClassName, className), ...props }) })
652
911
  );
653
912
  DropdownMenuContent.displayName = "DropdownMenuContent";
654
- var DropdownMenuItem = React2__namespace.forwardRef(
913
+ var DropdownMenuItem = React5__namespace.forwardRef(
655
914
  ({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Item, { ref, className: cn(menuItemClassName, inset && "pl-8", className), ...props })
656
915
  );
657
916
  DropdownMenuItem.displayName = "DropdownMenuItem";
658
- var DropdownMenuCheckboxItem = React2__namespace.forwardRef(
917
+ var DropdownMenuCheckboxItem = React5__namespace.forwardRef(
659
918
  ({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuPrimitive__namespace.CheckboxItem, { ref, className: cn(menuItemClassName, "pl-8", className), checked, ...props, children: [
660
919
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { "aria-hidden": "true", className: "h-4 w-4" }) }) }),
661
920
  children
662
921
  ] })
663
922
  );
664
923
  DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
665
- var DropdownMenuRadioItem = React2__namespace.forwardRef(
924
+ var DropdownMenuRadioItem = React5__namespace.forwardRef(
666
925
  ({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuPrimitive__namespace.RadioItem, { ref, className: cn(menuItemClassName, "pl-8", className), ...props, children: [
667
926
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { "aria-hidden": "true", className: "h-2 w-2 fill-current" }) }) }),
668
927
  children
669
928
  ] })
670
929
  );
671
930
  DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
672
- var DropdownMenuLabel = React2__namespace.forwardRef(
931
+ var DropdownMenuLabel = React5__namespace.forwardRef(
673
932
  ({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Label, { ref, className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className), ...props })
674
933
  );
675
934
  DropdownMenuLabel.displayName = "DropdownMenuLabel";
676
- var DropdownMenuSeparator = React2__namespace.forwardRef(
935
+ var DropdownMenuSeparator = React5__namespace.forwardRef(
677
936
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props })
678
937
  );
679
938
  DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
680
939
  var Select = SelectPrimitive__namespace.Root;
681
940
  var SelectValue = SelectPrimitive__namespace.Value;
682
- var SelectTrigger = React2__namespace.forwardRef(
683
- ({ className, children, iconClassName, size = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(SelectPrimitive__namespace.Trigger, { ref, className: cn("flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-control-surface px-3 py-2 text-left text-sm shadow-sm ring-offset-control-surface data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:min-w-0 [&>span]:flex-1 [&>span]:text-left", size === "sm" && "h-8 px-2 py-1 text-xs", className), ...props, children: [
941
+ var SelectTrigger = React5__namespace.forwardRef(
942
+ ({ className, children, iconClassName, size = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(SelectPrimitive__namespace.Trigger, { ref, className: cn("flex h-10 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-control-surface px-3 py-2 text-left text-sm text-foreground shadow-sm ring-offset-control-surface data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 [&>span]:min-w-0 [&>span]:flex-1 [&>span]:text-left", size === "sm" && "h-8 px-2 py-1 text-xs", className), ...props, children: [
684
943
  children,
685
944
  /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { "aria-hidden": "true", className: cn("h-4 w-4 opacity-50", iconClassName) }) })
686
945
  ] })
687
946
  );
688
947
  SelectTrigger.displayName = "SelectTrigger";
689
- var SelectScrollUpButton = React2__namespace.forwardRef(
948
+ var SelectScrollUpButton = React5__namespace.forwardRef(
690
949
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ScrollUpButton, { ref, className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { "aria-hidden": "true", className: "h-4 w-4" }) })
691
950
  );
692
951
  SelectScrollUpButton.displayName = "SelectScrollUpButton";
693
- var SelectScrollDownButton = React2__namespace.forwardRef(
952
+ var SelectScrollDownButton = React5__namespace.forwardRef(
694
953
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ScrollDownButton, { ref, className: cn("flex cursor-default items-center justify-center py-1", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { "aria-hidden": "true", className: "h-4 w-4" }) })
695
954
  );
696
955
  SelectScrollDownButton.displayName = "SelectScrollDownButton";
697
- var SelectContent = React2__namespace.forwardRef(
956
+ var SelectContent = React5__namespace.forwardRef(
698
957
  ({ className, children, position = "popper", viewportClassName, disableTriggerViewportSizing = false, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(SelectPrimitive__namespace.Content, { ref, position, className: cn(menuContentClassName, "relative max-h-[var(--radix-select-content-available-height)] overflow-y-auto overflow-x-hidden", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className), ...props, children: [
699
958
  /* @__PURE__ */ jsxRuntime.jsx(SelectScrollUpButton, {}),
700
959
  /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Viewport, { className: cn("p-1", position === "popper" && "w-full min-w-[var(--radix-select-trigger-width)]", position === "popper" && !disableTriggerViewportSizing && "h-[var(--radix-select-trigger-height)]", viewportClassName), children }),
@@ -702,11 +961,11 @@ var SelectContent = React2__namespace.forwardRef(
702
961
  ] }) })
703
962
  );
704
963
  SelectContent.displayName = "SelectContent";
705
- var SelectLabel = React2__namespace.forwardRef(
964
+ var SelectLabel = React5__namespace.forwardRef(
706
965
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Label, { ref, className: cn("px-2 py-1.5 text-sm font-semibold", className), ...props })
707
966
  );
708
967
  SelectLabel.displayName = "SelectLabel";
709
- var SelectItem = React2__namespace.forwardRef(
968
+ var SelectItem = React5__namespace.forwardRef(
710
969
  ({ className, children, indicatorClassName, itemText, hideIndicator = false, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(SelectPrimitive__namespace.Item, { ref, className: cn(menuItemClassName, "w-full", hideIndicator ? "px-2" : "pl-8 pr-2", className), ...props, children: [
711
970
  !hideIndicator ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("absolute left-2 flex h-3.5 w-3.5 items-center justify-center", indicatorClassName), children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { "aria-hidden": "true", className: "h-4 w-4" }) }) }) : null,
712
971
  itemText ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
@@ -716,7 +975,7 @@ var SelectItem = React2__namespace.forwardRef(
716
975
  ] })
717
976
  );
718
977
  SelectItem.displayName = "SelectItem";
719
- var SelectSeparator = React2__namespace.forwardRef(
978
+ var SelectSeparator = React5__namespace.forwardRef(
720
979
  ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Separator, { ref, className: cn("-mx-1 my-1 h-px bg-muted", className), ...props })
721
980
  );
722
981
  SelectSeparator.displayName = "SelectSeparator";
@@ -740,11 +999,11 @@ function AgentWorkbenchComposer({
740
999
  onIntent
741
1000
  }) {
742
1001
  const messages = useMonkeysLocaleMessages().agentWorkbench;
743
- const fileInputRef = React2.useRef(null);
744
- const surfaceRef = React2.useRef(null);
745
- const [editingDraftId, setEditingDraftId] = React2.useState();
746
- const [editingText, setEditingText] = React2.useState("");
747
- const [isNarrow, setIsNarrow] = React2.useState(false);
1002
+ const fileInputRef = React5.useRef(null);
1003
+ const surfaceRef = React5.useRef(null);
1004
+ const [editingDraftId, setEditingDraftId] = React5.useState();
1005
+ const [editingText, setEditingText] = React5.useState("");
1006
+ const [isNarrow, setIsNarrow] = React5.useState(false);
748
1007
  const narrowBreakpoint = modeSelectionEnabled ? 900 : 704;
749
1008
  const isBusy = viewModel.status === "loading" || viewModel.status === "streaming" || viewModel.status === "stopping";
750
1009
  const isStopping = viewModel.status === "stopping";
@@ -752,15 +1011,15 @@ function AgentWorkbenchComposer({
752
1011
  const canSubmit = !isStopping && !isUploading && (viewModel.value.trim().length > 0 || viewModel.attachments.some((item) => item.status === "ready"));
753
1012
  const showSubmitButton = !isBusy || canSubmit;
754
1013
  const filterModelsByMode = modeSelectionEnabled || modeFilteringEnabled;
755
- const visibleModelOptions = React2.useMemo(
1014
+ const visibleModelOptions = React5.useMemo(
756
1015
  () => filterModelsByMode ? viewModel.model.options.filter((option) => option.mode === viewModel.mode) : viewModel.model.options,
757
1016
  [filterModelsByMode, viewModel.mode, viewModel.model.options]
758
1017
  );
759
- const selectedModelValue = React2.useMemo(() => {
1018
+ const selectedModelValue = React5.useMemo(() => {
760
1019
  const selected = visibleModelOptions.find((option) => option.id === viewModel.model.selectedId && option.mode === viewModel.mode);
761
1020
  return selected ? modelOptionValue(selected) : visibleModelOptions[0] ? modelOptionValue(visibleModelOptions[0]) : "";
762
1021
  }, [viewModel.mode, viewModel.model.selectedId, visibleModelOptions]);
763
- React2.useEffect(() => {
1022
+ React5.useEffect(() => {
764
1023
  const surface = surfaceRef.current;
765
1024
  if (!surface) return void 0;
766
1025
  const updateLayout = () => setIsNarrow(surface.getBoundingClientRect().width <= narrowBreakpoint);
@@ -801,12 +1060,13 @@ function AgentWorkbenchComposer({
801
1060
  children: /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "space-y-1.5", children: viewModel.queuedDrafts.map((draft, index) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex min-h-9 min-w-0 max-w-full items-center gap-2 overflow-hidden rounded-md bg-background px-2 py-1.5 text-sm", children: [
802
1061
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-5 shrink-0 text-center text-xs text-muted-foreground", children: index + 1 }),
803
1062
  editingDraftId === draft.id ? /* @__PURE__ */ jsxRuntime.jsx(
804
- "input",
1063
+ Input,
805
1064
  {
806
1065
  autoFocus: true,
807
1066
  value: editingText,
808
1067
  "aria-label": messages.composer.editQueued,
809
- className: "min-w-0 flex-1 rounded border border-input bg-background px-2 py-1 outline-none focus-visible:ring-2 focus-visible:ring-ring",
1068
+ appearance: "compact",
1069
+ className: "h-8 min-w-0 flex-1 px-2 py-1",
810
1070
  onChange: (event) => setEditingText(event.target.value),
811
1071
  onBlur: () => {
812
1072
  if (editingText.trim()) onIntent?.({ type: "edit-queued-draft", draftId: draft.id, text: editingText });
@@ -844,7 +1104,7 @@ function AgentWorkbenchComposer({
844
1104
  type: "button",
845
1105
  variant: "secondary",
846
1106
  size: "icon",
847
- className: "absolute right-1 top-1 flex size-5 items-center justify-center rounded-full bg-background/90 text-foreground shadow",
1107
+ className: "absolute right-1 top-1 !size-5 min-w-5 rounded-full bg-background/90 p-0 text-foreground shadow [&_svg]:!size-3",
848
1108
  "aria-label": messages.composer.removeAttachment,
849
1109
  onClick: () => onIntent?.({ type: "remove-attachment", attachmentId: attachment.id }),
850
1110
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3" })
@@ -853,13 +1113,14 @@ function AgentWorkbenchComposer({
853
1113
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "absolute inset-x-0 bottom-0 truncate bg-background/85 px-1 py-0.5 text-[9px]", children: attachment.name })
854
1114
  ] }, attachment.id)) }) : null,
855
1115
  /* @__PURE__ */ jsxRuntime.jsx(
856
- "textarea",
1116
+ AutosizeTextarea,
857
1117
  {
858
1118
  value: viewModel.value,
859
- rows: 2,
1119
+ minHeight: 54,
1120
+ maxHeight: 256,
860
1121
  "aria-label": messages.composer.message,
861
1122
  placeholder: viewModel.placeholder,
862
- className: cn2("max-h-64 min-h-14 min-w-0 w-full resize-none border-0 bg-transparent text-sm leading-relaxed text-foreground outline-none placeholder:text-muted-foreground", classNames?.textarea),
1123
+ className: cn2("min-w-0 w-full resize-none rounded-none border-0 bg-transparent px-0 py-0 text-sm leading-relaxed text-foreground shadow-none focus-visible:ring-0 focus-visible:ring-offset-0", classNames?.textarea),
863
1124
  onChange: (event) => onIntent?.({ type: "change-value", value: event.target.value }),
864
1125
  onKeyDown: (event) => {
865
1126
  if (event.key === "Enter" && !event.shiftKey && !event.nativeEvent.isComposing) {
@@ -893,28 +1154,30 @@ function AgentWorkbenchComposer({
893
1154
  messages.composer.webSearch,
894
1155
  /* @__PURE__ */ jsxRuntime.jsx(Switch, { checked: viewModel.webSearchEnabled, onCheckedChange: (enabled) => onIntent?.({ type: "toggle-web-search", enabled }) })
895
1156
  ] }) : null,
896
- modeSelectionEnabled ? /* @__PURE__ */ jsxRuntime.jsx(
897
- "div",
1157
+ modeSelectionEnabled ? /* @__PURE__ */ jsxRuntime.jsxs(
1158
+ Tabs,
898
1159
  {
899
- className: "flex h-8 shrink-0 items-center rounded-md border border-border bg-muted p-0.5",
900
- role: "group",
901
- "aria-label": messages.composer.chatMode,
902
- children: ["chat", "work"].map((mode) => /* @__PURE__ */ jsxRuntime.jsx(
903
- Button,
904
- {
905
- type: "button",
906
- variant: "ghost",
907
- size: "sm",
908
- "aria-pressed": viewModel.mode === mode,
909
- className: cn2(
910
- "h-7 rounded px-2.5 text-xs font-medium shadow-none",
911
- viewModel.mode === mode ? "bg-background text-foreground shadow-sm" : "text-foreground/75 hover:text-foreground"
912
- ),
913
- onClick: () => onIntent?.({ type: "change-mode", mode }),
914
- children: messages.modes[mode]
915
- },
916
- mode
917
- ))
1160
+ value: viewModel.mode,
1161
+ onValueChange: (mode) => onIntent?.({ type: "change-mode", mode }),
1162
+ children: [
1163
+ /* @__PURE__ */ jsxRuntime.jsx(
1164
+ TabsList,
1165
+ {
1166
+ "aria-label": messages.composer.chatMode,
1167
+ className: "h-8 shrink-0 gap-0.5 rounded-md bg-muted/60 p-0.5",
1168
+ children: ["chat", "work"].map((mode) => /* @__PURE__ */ jsxRuntime.jsx(
1169
+ TabsTrigger,
1170
+ {
1171
+ value: mode,
1172
+ className: "h-7 min-w-0 px-2.5 text-xs text-foreground/75 shadow-none hover:text-foreground data-[state=active]:bg-primary/10 data-[state=active]:text-primary data-[state=active]:shadow-none",
1173
+ children: messages.modes[mode]
1174
+ },
1175
+ mode
1176
+ ))
1177
+ }
1178
+ ),
1179
+ ["chat", "work"].map((mode) => /* @__PURE__ */ jsxRuntime.jsx(TabsContent, { value: mode, className: "hidden" }, mode))
1180
+ ]
918
1181
  }
919
1182
  ) : null,
920
1183
  viewModel.capabilities.modelSelection ? /* @__PURE__ */ jsxRuntime.jsx(
@@ -1015,11 +1278,11 @@ function TemplateVisual({ template }) {
1015
1278
  }
1016
1279
  function AgentWorkbenchQuickStart({ viewModel, className, onIntent }) {
1017
1280
  const messages = useMonkeysLocaleMessages().agentWorkbench.quickStart;
1018
- const fileInputRef = React2.useRef(null);
1019
- const [activeCategoryId, setActiveCategoryId] = React2.useState();
1020
- const [activeSectionId, setActiveSectionId] = React2.useState();
1021
- const [pendingTemplate, setPendingTemplate] = React2.useState();
1022
- const categories = React2.useMemo(
1281
+ const fileInputRef = React5.useRef(null);
1282
+ const [activeCategoryId, setActiveCategoryId] = React5.useState();
1283
+ const [activeSectionId, setActiveSectionId] = React5.useState();
1284
+ const [pendingTemplate, setPendingTemplate] = React5.useState();
1285
+ const categories = React5.useMemo(
1023
1286
  () => viewModel.categories.map((category) => ({
1024
1287
  ...category,
1025
1288
  sections: category.sections.map((section) => ({
@@ -1032,7 +1295,7 @@ function AgentWorkbenchQuickStart({ viewModel, className, onIntent }) {
1032
1295
  const activeCategory = categories.find((category) => category.id === activeCategoryId);
1033
1296
  const activeSection = activeCategory?.sections.find((section) => section.id === activeSectionId) || activeCategory?.sections[0];
1034
1297
  const usesCompactList = activeSection?.templates.length ? activeSection.templates.every((template) => !template.coverImageUrl) : false;
1035
- React2.useEffect(() => {
1298
+ React5.useEffect(() => {
1036
1299
  if (activeCategoryId && !categories.some((category) => category.id === activeCategoryId)) {
1037
1300
  setActiveCategoryId(void 0);
1038
1301
  setActiveSectionId(void 0);
@@ -1168,7 +1431,7 @@ function AgentWorkbenchQuickStart({ viewModel, className, onIntent }) {
1168
1431
  ] });
1169
1432
  }
1170
1433
  function ItemAvatar({ item }) {
1171
- const [failed, setFailed] = React2.useState(false);
1434
+ const [failed, setFailed] = React5.useState(false);
1172
1435
  if (item.iconUrl && !failed) {
1173
1436
  return /* @__PURE__ */ jsxRuntime.jsx("img", { src: item.iconUrl, alt: "", className: "size-full object-cover", onError: () => setFailed(true) });
1174
1437
  }
@@ -1176,7 +1439,7 @@ function ItemAvatar({ item }) {
1176
1439
  return initial ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold", children: initial }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bot, { className: "size-4" });
1177
1440
  }
1178
1441
  function SessionAvatar({ item }) {
1179
- const [failed, setFailed] = React2.useState(false);
1442
+ const [failed, setFailed] = React5.useState(false);
1180
1443
  if (item.thumbnailUrl && !failed) {
1181
1444
  return /* @__PURE__ */ jsxRuntime.jsx(
1182
1445
  "img",
@@ -1214,7 +1477,7 @@ function CollectionState({
1214
1477
  if (status === "error") {
1215
1478
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center gap-3 px-3 py-8 text-center", children: [
1216
1479
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", role: "alert", children: error }),
1217
- /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "inline-flex items-center gap-1.5 text-sm font-medium text-primary", onClick: onRetry, children: [
1480
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "gap-1.5 px-0 text-sm text-primary hover:text-primary", onClick: onRetry, children: [
1218
1481
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "size-3.5", "aria-hidden": "true" }),
1219
1482
  messages.retry
1220
1483
  ] })
@@ -1246,7 +1509,7 @@ function SessionActions({
1246
1509
  const messages = useMonkeysLocaleMessages().agentWorkbench.navigation;
1247
1510
  if (!capabilities.renameSessions && !capabilities.deleteSessions) return null;
1248
1511
  return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu2, { children: [
1249
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "flex size-8 items-center justify-center rounded-md hover:bg-muted", "aria-label": messages.actions, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Ellipsis, { className: "size-4", "aria-hidden": "true" }) }) }),
1512
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "size-8", "aria-label": messages.actions, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Ellipsis, { className: "size-4", "aria-hidden": "true" }) }) }),
1250
1513
  /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuContent, { align: "end", children: [
1251
1514
  capabilities.renameSessions ? /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenuItem, { onSelect: () => onIntent?.({ type: "rename-session", sessionId: item.id, title: item.title }), children: [
1252
1515
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "mr-2 size-4", "aria-hidden": "true" }),
@@ -1270,22 +1533,22 @@ function AgentWorkbenchSidebar({
1270
1533
  const { locale } = useMonkeysLocale();
1271
1534
  const messages = useMonkeysLocaleMessages().agentWorkbench.navigation;
1272
1535
  const sessionsOnly = navigationMode === "sessions-only";
1273
- const searchRef = React2.useRef(null);
1274
- const renameInputRef = React2.useRef(null);
1275
- const [editingSessionId, setEditingSessionId] = React2.useState();
1276
- const [editingTitle, setEditingTitle] = React2.useState("");
1536
+ const searchRef = React5.useRef(null);
1537
+ const renameInputRef = React5.useRef(null);
1538
+ const [editingSessionId, setEditingSessionId] = React5.useState();
1539
+ const [editingTitle, setEditingTitle] = React5.useState("");
1277
1540
  const query = viewModel.searchQuery.trim().toLocaleLowerCase();
1278
- const agents = React2.useMemo(
1541
+ const agents = React5.useMemo(
1279
1542
  () => viewModel.agents.items.filter((item) => !query || `${item.name} ${item.description ?? ""}`.toLocaleLowerCase().includes(query)),
1280
1543
  [query, viewModel.agents.items]
1281
1544
  );
1282
- const sessions = React2.useMemo(
1545
+ const sessions = React5.useMemo(
1283
1546
  () => viewModel.sessions.items.filter((item) => !query || item.title.toLocaleLowerCase().includes(query)),
1284
1547
  [query, viewModel.sessions.items]
1285
1548
  );
1286
- const chatbotSessions = React2.useMemo(() => sessions.filter((item) => item.mode !== "work"), [sessions]);
1287
- const agentSessions = React2.useMemo(() => sessions.filter((item) => item.mode === "work"), [sessions]);
1288
- React2.useEffect(() => {
1549
+ const chatbotSessions = React5.useMemo(() => sessions.filter((item) => item.mode !== "work"), [sessions]);
1550
+ const agentSessions = React5.useMemo(() => sessions.filter((item) => item.mode === "work"), [sessions]);
1551
+ React5.useEffect(() => {
1289
1552
  const handleShortcut = (event) => {
1290
1553
  if (!(event.ctrlKey || event.metaKey) || event.key.toLocaleLowerCase() !== "k") return;
1291
1554
  event.preventDefault();
@@ -1295,7 +1558,7 @@ function AgentWorkbenchSidebar({
1295
1558
  window.addEventListener("keydown", handleShortcut);
1296
1559
  return () => window.removeEventListener("keydown", handleShortcut);
1297
1560
  }, []);
1298
- React2.useEffect(() => {
1561
+ React5.useEffect(() => {
1299
1562
  if (!editingSessionId) return;
1300
1563
  renameInputRef.current?.focus();
1301
1564
  renameInputRef.current?.select();
@@ -1322,12 +1585,13 @@ function AgentWorkbenchSidebar({
1322
1585
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted", children: /* @__PURE__ */ jsxRuntime.jsx(SessionAvatar, { item }) }),
1323
1586
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
1324
1587
  /* @__PURE__ */ jsxRuntime.jsx(
1325
- "input",
1588
+ Input,
1326
1589
  {
1327
1590
  ref: renameInputRef,
1328
1591
  value: editingTitle,
1329
1592
  "aria-label": messages.rename,
1330
- className: "h-6 w-full rounded border border-primary bg-background px-1.5 text-sm font-medium outline-none",
1593
+ appearance: "compact",
1594
+ className: "h-6 w-full border-primary px-1.5 text-sm font-medium",
1331
1595
  onChange: (event) => setEditingTitle(event.target.value),
1332
1596
  onClick: (event) => event.stopPropagation(),
1333
1597
  onBlur: () => saveRenameSession(item),
@@ -1357,7 +1621,7 @@ function AgentWorkbenchSidebar({
1357
1621
  percent,
1358
1622
  "%"
1359
1623
  ] }) : /* @__PURE__ */ jsxRuntime.jsx(StatusIndicator, { status: item.status }),
1360
- viewModel.capabilities.pinSessions ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", "aria-label": item.pinned ? messages.unpin : messages.pin, className: cn2("flex size-8 items-center justify-center rounded-md text-muted-foreground opacity-0 hover:bg-muted group-hover:opacity-100", item.pinned && "text-primary opacity-100"), onClick: (event) => {
1624
+ viewModel.capabilities.pinSessions ? /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": item.pinned ? messages.unpin : messages.pin, className: cn2("size-8 text-muted-foreground opacity-0 group-hover:opacity-100", item.pinned && "text-primary opacity-100"), onClick: (event) => {
1361
1625
  event.stopPropagation();
1362
1626
  onIntent?.({ type: "toggle-session-pin", sessionId: item.id, pinned: !item.pinned });
1363
1627
  }, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pin, { className: cn2("size-4", item.pinned && "fill-current") }) }) : null,
@@ -1375,17 +1639,17 @@ function AgentWorkbenchSidebar({
1375
1639
  className: "flex h-full min-h-0 flex-col bg-background text-foreground",
1376
1640
  children: [
1377
1641
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "shrink-0 space-y-3 p-4 pb-2", children: [
1378
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn2("flex h-10 items-center gap-2 rounded-lg border border-border bg-card px-3 focus-within:ring-2 focus-within:ring-ring", classNames?.search), children: [
1379
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "size-4 shrink-0 text-muted-foreground", "aria-hidden": "true" }),
1642
+ /* @__PURE__ */ jsxRuntime.jsxs(InputGroup, { className: cn2("h-10 rounded-lg bg-card", classNames?.search), children: [
1643
+ /* @__PURE__ */ jsxRuntime.jsx(InputGroupAddon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "size-4", "aria-hidden": "true" }) }),
1380
1644
  /* @__PURE__ */ jsxRuntime.jsx(
1381
- "input",
1645
+ InputGroupInput,
1382
1646
  {
1383
1647
  ref: searchRef,
1384
1648
  type: "search",
1385
1649
  value: viewModel.searchQuery,
1386
1650
  "aria-label": sessionsOnly ? messages.searchSessions : messages.search,
1387
1651
  placeholder: sessionsOnly ? messages.searchSessions : messages.search,
1388
- className: "min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground [&::-webkit-search-cancel-button]:hidden",
1652
+ className: "min-w-0 [&::-webkit-search-cancel-button]:hidden",
1389
1653
  onChange: (event) => onIntent?.({ type: "change-search", query: event.target.value }),
1390
1654
  onKeyDown: (event) => {
1391
1655
  if (event.key !== "Escape") return;
@@ -1394,7 +1658,7 @@ function AgentWorkbenchSidebar({
1394
1658
  }
1395
1659
  }
1396
1660
  ),
1397
- viewModel.searchQuery ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "flex size-6 items-center justify-center rounded-md hover:bg-muted", "aria-label": messages.clearSearch, onClick: () => onIntent?.({ type: "change-search", query: "" }), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3.5", "aria-hidden": "true" }) }) : /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "rounded border border-border px-1.5 py-0.5 text-[10px] text-muted-foreground", children: "Ctrl K" })
1661
+ viewModel.searchQuery ? /* @__PURE__ */ jsxRuntime.jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsxRuntime.jsx(InputGroupButton, { size: "icon-xs", "aria-label": messages.clearSearch, onClick: () => onIntent?.({ type: "change-search", query: "" }), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3.5", "aria-hidden": "true" }) }) }) : /* @__PURE__ */ jsxRuntime.jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsxRuntime.jsx("kbd", { className: "border border-border px-1.5 py-0.5 text-[10px]", children: "Ctrl K" }) })
1398
1662
  ] }),
1399
1663
  !sessionsOnly || headerActions ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1400
1664
  !sessionsOnly ? /* @__PURE__ */ jsxRuntime.jsxs(TabsList, { className: cn2("grid min-w-0 flex-1 grid-cols-2 text-foreground", classNames?.tabs), "aria-label": messages.tabsLabel, children: [
@@ -1405,7 +1669,7 @@ function AgentWorkbenchSidebar({
1405
1669
  ] }) : null
1406
1670
  ] }),
1407
1671
  !sessionsOnly ? /* @__PURE__ */ jsxRuntime.jsxs(TabsContent, { value: "agents", className: cn2("mt-0 min-h-0 flex-1 overflow-y-auto px-4 pb-4", classNames?.body), children: [
1408
- viewModel.capabilities.createAgent ? /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "mb-3 flex h-9 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "create-agent" }), children: [
1672
+ viewModel.capabilities.createAgent ? /* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "button", variant: "ghost", className: "mb-3 h-9 w-full justify-start gap-2 px-3 text-sm", onClick: () => onIntent?.({ type: "create-agent" }), children: [
1409
1673
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-4", "aria-hidden": "true" }),
1410
1674
  messages.newAgent
1411
1675
  ] }) : null,
@@ -1426,11 +1690,13 @@ function AgentWorkbenchSidebar({
1426
1690
  ] }),
1427
1691
  item.builtIn ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-full bg-muted px-1.5 py-1 text-[10px] text-foreground", children: messages.builtIn }) : null,
1428
1692
  viewModel.capabilities.pinAgents ? /* @__PURE__ */ jsxRuntime.jsx(
1429
- "button",
1693
+ Button,
1430
1694
  {
1431
1695
  type: "button",
1696
+ variant: "ghost",
1697
+ size: "icon",
1432
1698
  "aria-label": item.pinned ? messages.unpin : messages.pin,
1433
- className: cn2("flex size-8 items-center justify-center rounded-md text-muted-foreground opacity-0 hover:bg-muted group-hover:opacity-100", item.pinned && "text-primary opacity-100"),
1699
+ className: cn2("size-8 text-muted-foreground opacity-0 group-hover:opacity-100", item.pinned && "text-primary opacity-100"),
1434
1700
  onClick: (event) => {
1435
1701
  event.stopPropagation();
1436
1702
  onIntent?.({ type: "toggle-agent-pin", itemId: item.id, pinned: !item.pinned });
@@ -1451,11 +1717,11 @@ function AgentWorkbenchSidebar({
1451
1717
  )) })
1452
1718
  ] }) : null,
1453
1719
  /* @__PURE__ */ jsxRuntime.jsxs(TabsContent, { value: "sessions", className: cn2("mt-0 min-h-0 flex-1 overflow-y-auto px-4 pb-4", classNames?.body), children: [
1454
- viewModel.capabilities.createSession ? /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "flex h-9 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "create-session" }), children: [
1720
+ viewModel.capabilities.createSession ? /* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "button", variant: "ghost", className: "h-9 w-full justify-start gap-2 px-3 text-sm", onClick: () => onIntent?.({ type: "create-session" }), children: [
1455
1721
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.SquarePen, { className: "size-4", "aria-hidden": "true" }),
1456
1722
  messages.newSession
1457
1723
  ] }) : null,
1458
- !sessionsOnly && viewModel.capabilities.manageCapabilities ? /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "mb-3 flex h-9 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "open-capabilities" }), children: [
1724
+ !sessionsOnly && viewModel.capabilities.manageCapabilities ? /* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "button", variant: "ghost", className: "mb-3 h-9 w-full justify-start gap-2 px-3 text-sm", onClick: () => onIntent?.({ type: "open-capabilities" }), children: [
1459
1725
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Blocks, { className: "size-4", "aria-hidden": "true" }),
1460
1726
  messages.capabilities
1461
1727
  ] }) : null,
@@ -1472,7 +1738,7 @@ function AgentWorkbenchSidebar({
1472
1738
  renderSessionItems(items)
1473
1739
  ] }, id)) }) : !sessionsOnly ? renderSessionItems(sessions) : null
1474
1740
  ] }),
1475
- !sessionsOnly && viewModel.capabilities.manageAgentSettings ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn2("shrink-0 border-t border-border p-4", classNames?.footer), children: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "flex h-10 w-full items-center gap-2 rounded-md px-3 text-left text-sm font-medium hover:bg-muted", onClick: () => onIntent?.({ type: "open-agent-settings" }), children: [
1741
+ !sessionsOnly && viewModel.capabilities.manageAgentSettings ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn2("shrink-0 border-t border-border p-4", classNames?.footer), children: /* @__PURE__ */ jsxRuntime.jsxs(Button, { type: "button", variant: "ghost", className: "h-10 w-full justify-start gap-2 px-3 text-sm", onClick: () => onIntent?.({ type: "open-agent-settings" }), children: [
1476
1742
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-4", "aria-hidden": "true" }),
1477
1743
  messages.settings
1478
1744
  ] }) }) : null
@@ -1609,7 +1875,7 @@ function AgentWorkbenchTool({
1609
1875
  onExpandedChange
1610
1876
  }) {
1611
1877
  const messages = useMonkeysLocaleMessages().agentWorkbench.tool;
1612
- const [uncontrolledExpanded, setUncontrolledExpanded] = React2.useState(defaultExpanded);
1878
+ const [uncontrolledExpanded, setUncontrolledExpanded] = React5.useState(defaultExpanded);
1613
1879
  const isControlled = expanded !== void 0;
1614
1880
  const isExpanded = expanded ?? uncontrolledExpanded;
1615
1881
  const status = event.payload.status;
@@ -1883,10 +2149,11 @@ function AgentWorkbenchActivity({
1883
2149
  event.payload.requestedAction !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsx(JsonValue2, { value: event.payload.requestedAction }) }) : null,
1884
2150
  requested ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex flex-wrap gap-2", children: [
1885
2151
  /* @__PURE__ */ jsxRuntime.jsx(
1886
- "button",
2152
+ Button,
1887
2153
  {
1888
2154
  type: "button",
1889
- className: "rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground outline-none hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
2155
+ size: "sm",
2156
+ className: "h-auto px-3 py-1.5 text-sm",
1890
2157
  disabled: !onApprovalDecision,
1891
2158
  onClick: () => onApprovalDecision?.({
1892
2159
  approvalId: event.payload.approvalId,
@@ -1896,10 +2163,12 @@ function AgentWorkbenchActivity({
1896
2163
  }
1897
2164
  ),
1898
2165
  /* @__PURE__ */ jsxRuntime.jsx(
1899
- "button",
2166
+ Button,
1900
2167
  {
1901
2168
  type: "button",
1902
- className: "rounded-md border border-border bg-background px-3 py-1.5 text-sm font-medium text-foreground outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
2169
+ variant: "outline",
2170
+ size: "sm",
2171
+ className: "h-auto px-3 py-1.5 text-sm",
1903
2172
  disabled: !onApprovalDecision,
1904
2173
  onClick: () => onApprovalDecision?.({
1905
2174
  approvalId: event.payload.approvalId,
@@ -1931,10 +2200,12 @@ function AgentWorkbenchActivity({
1931
2200
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs text-muted-foreground", children: messages.artifact[event.payload.status] })
1932
2201
  ] }),
1933
2202
  event.payload.url ? /* @__PURE__ */ jsxRuntime.jsx(
1934
- "button",
2203
+ Button,
1935
2204
  {
1936
2205
  type: "button",
1937
- className: "rounded-md p-2 text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
2206
+ variant: "ghost",
2207
+ size: "icon",
2208
+ className: "text-muted-foreground hover:text-foreground",
1938
2209
  "aria-label": messages.artifact.open({
1939
2210
  name: event.payload.name
1940
2211
  }),
@@ -2202,20 +2473,23 @@ function SummaryPanel({
2202
2473
  error ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3 rounded-md border border-destructive/30 bg-destructive/5 p-2.5 text-sm text-destructive-text", role: "alert", children: error.payload.message }) : null,
2203
2474
  retryable || canResume ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 flex flex-wrap gap-2", children: [
2204
2475
  retryable ? /* @__PURE__ */ jsxRuntime.jsx(
2205
- "button",
2476
+ Button,
2206
2477
  {
2207
2478
  type: "button",
2208
- className: "rounded-md border border-border bg-background px-2.5 py-1.5 text-xs font-medium outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring",
2479
+ variant: "outline",
2480
+ size: "sm",
2481
+ className: "h-auto px-2.5 py-1.5 text-xs",
2209
2482
  disabled: !onIntent,
2210
2483
  onClick: () => onIntent?.({ type: "retry", eventId: error.eventId }),
2211
2484
  children: messages.actions.retry
2212
2485
  }
2213
2486
  ) : null,
2214
2487
  canResume ? /* @__PURE__ */ jsxRuntime.jsx(
2215
- "button",
2488
+ Button,
2216
2489
  {
2217
2490
  type: "button",
2218
- className: "rounded-md bg-primary px-2.5 py-1.5 text-xs font-medium text-primary-foreground outline-none hover:bg-primary/90 focus-visible:ring-2 focus-visible:ring-ring",
2491
+ size: "sm",
2492
+ className: "h-auto px-2.5 py-1.5 text-xs",
2219
2493
  disabled: !onIntent,
2220
2494
  onClick: () => onIntent?.({ type: "resume", sessionId: model.sessionId }),
2221
2495
  children: messages.actions.resume
@@ -2225,10 +2499,12 @@ function SummaryPanel({
2225
2499
  ] }),
2226
2500
  /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex flex-wrap gap-2 rounded-lg border border-border bg-card p-3 text-card-foreground", children: [
2227
2501
  canContinueInNewTask ? /* @__PURE__ */ jsxRuntime.jsxs(
2228
- "button",
2502
+ Button,
2229
2503
  {
2230
2504
  type: "button",
2231
- className: "inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-2.5 py-1.5 text-xs font-medium outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring",
2505
+ variant: "outline",
2506
+ size: "sm",
2507
+ className: "h-auto gap-1.5 px-2.5 py-1.5 text-xs",
2232
2508
  disabled: !onIntent,
2233
2509
  onClick: () => onIntent?.({ type: "continue-in-new-task", sessionId: model.sessionId }),
2234
2510
  children: [
@@ -2238,10 +2514,12 @@ function SummaryPanel({
2238
2514
  }
2239
2515
  ) : null,
2240
2516
  canEditAndRerun ? /* @__PURE__ */ jsxRuntime.jsxs(
2241
- "button",
2517
+ Button,
2242
2518
  {
2243
2519
  type: "button",
2244
- className: "inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-2.5 py-1.5 text-xs font-medium outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring",
2520
+ variant: "outline",
2521
+ size: "sm",
2522
+ className: "h-auto gap-1.5 px-2.5 py-1.5 text-xs",
2245
2523
  disabled: !onIntent,
2246
2524
  onClick: () => onIntent?.({ type: "edit-and-rerun", sessionId: model.sessionId }),
2247
2525
  children: [
@@ -2251,10 +2529,12 @@ function SummaryPanel({
2251
2529
  }
2252
2530
  ) : null,
2253
2531
  /* @__PURE__ */ jsxRuntime.jsxs(
2254
- "button",
2532
+ Button,
2255
2533
  {
2256
2534
  type: "button",
2257
- className: "inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-2.5 py-1.5 text-xs font-medium outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring",
2535
+ variant: "outline",
2536
+ size: "sm",
2537
+ className: "h-auto gap-1.5 px-2.5 py-1.5 text-xs",
2258
2538
  disabled: !onIntent,
2259
2539
  onClick: () => onIntent?.({ type: "export", sessionId: model.sessionId }),
2260
2540
  children: [
@@ -2268,10 +2548,12 @@ function SummaryPanel({
2268
2548
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
2269
2549
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-semibold", children: messages.summary }),
2270
2550
  summary?.payload.text ? /* @__PURE__ */ jsxRuntime.jsx(
2271
- "button",
2551
+ Button,
2272
2552
  {
2273
2553
  type: "button",
2274
- className: "rounded-md p-1.5 text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
2554
+ variant: "ghost",
2555
+ size: "icon",
2556
+ className: "size-8 text-muted-foreground hover:text-foreground",
2275
2557
  "aria-label": messages.actions.copySummary,
2276
2558
  disabled: !onIntent,
2277
2559
  onClick: () => onIntent?.({
@@ -2286,10 +2568,12 @@ function SummaryPanel({
2286
2568
  summary?.payload.status === "failed" ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-3 space-y-2", children: [
2287
2569
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-destructive-text", role: "alert", children: messages.summaryFailed }),
2288
2570
  /* @__PURE__ */ jsxRuntime.jsxs(
2289
- "button",
2571
+ Button,
2290
2572
  {
2291
2573
  type: "button",
2292
- className: "inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5 text-xs font-medium outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring",
2574
+ variant: "outline",
2575
+ size: "sm",
2576
+ className: "h-auto gap-1.5 px-2.5 py-1.5 text-xs",
2293
2577
  disabled: !onIntent,
2294
2578
  onClick: () => onIntent?.({ type: "retry-summary", eventId: summary.eventId }),
2295
2579
  children: [
@@ -2426,16 +2710,6 @@ function AgentWorkbenchTaskDetails({
2426
2710
  { id: "summary", label: messages.tabs.summary, count: model.summary ? 1 : 0 },
2427
2711
  ...workspaceAvailable ? [{ id: "workspace", label: messages.tabs.workspace, count: workspaceCount }] : []
2428
2712
  ];
2429
- const tabId = (tab) => `agent-workbench-details-${viewModel.sessionId}-${tab}`.replace(
2430
- /[^a-zA-Z0-9_-]/g,
2431
- "-"
2432
- );
2433
- const onTabKeyDown = (event, index) => {
2434
- if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key)) return;
2435
- event.preventDefault();
2436
- const nextIndex = event.key === "Home" ? 0 : event.key === "End" ? tabs.length - 1 : (index + (event.key === "ArrowRight" ? 1 : -1) + tabs.length) % tabs.length;
2437
- onActiveTabChange?.(tabs[nextIndex].id);
2438
- };
2439
2713
  return /* @__PURE__ */ jsxRuntime.jsxs(
2440
2714
  "aside",
2441
2715
  {
@@ -2452,54 +2726,71 @@ function AgentWorkbenchTaskDetails({
2452
2726
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: messages.description })
2453
2727
  ] }),
2454
2728
  onIntent ? /* @__PURE__ */ jsxRuntime.jsx(
2455
- "button",
2729
+ Button,
2456
2730
  {
2457
2731
  type: "button",
2458
- className: "rounded-md p-2 text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
2732
+ variant: "ghost",
2733
+ size: "icon",
2734
+ className: "text-muted-foreground hover:text-foreground",
2459
2735
  "aria-label": messages.actions.close,
2460
2736
  onClick: () => onIntent({ type: "close" }),
2461
2737
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-4", "aria-hidden": "true" })
2462
2738
  }
2463
2739
  ) : null
2464
2740
  ] }),
2465
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn2("flex shrink-0 gap-1 border-b border-border px-3 py-2", classNames?.tabs), role: "tablist", "aria-label": messages.tabs.label, children: tabs.map((tab, index) => /* @__PURE__ */ jsxRuntime.jsxs(
2466
- "button",
2741
+ /* @__PURE__ */ jsxRuntime.jsxs(
2742
+ Tabs,
2467
2743
  {
2468
- id: tabId(tab.id),
2469
- type: "button",
2470
- role: "tab",
2471
- "aria-selected": resolvedTab === tab.id,
2472
- "aria-controls": `${tabId(tab.id)}-panel`,
2473
- tabIndex: resolvedTab === tab.id ? 0 : -1,
2474
- className: cn2(
2475
- "inline-flex min-w-0 flex-1 items-center justify-center gap-1 rounded-md px-2 py-1.5 text-xs font-medium outline-none focus-visible:ring-2 focus-visible:ring-ring",
2476
- resolvedTab === tab.id ? "bg-primary/10 text-primary" : "text-muted-foreground hover:bg-muted hover:text-foreground"
2477
- ),
2478
- onClick: () => onActiveTabChange?.(tab.id),
2479
- onKeyDown: (event) => onTabKeyDown(event, index),
2744
+ value: resolvedTab,
2745
+ className: "flex min-h-0 flex-1 flex-col",
2746
+ onValueChange: (tab) => onActiveTabChange?.(tab),
2480
2747
  children: [
2481
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: tab.label }),
2482
- /* @__PURE__ */ jsxRuntime.jsx(Count, { value: tab.count })
2748
+ /* @__PURE__ */ jsxRuntime.jsx(
2749
+ TabsList,
2750
+ {
2751
+ "aria-label": messages.tabs.label,
2752
+ className: cn2(
2753
+ "flex h-auto shrink-0 gap-1 rounded-none border-b border-border bg-transparent px-3 py-2",
2754
+ classNames?.tabs
2755
+ ),
2756
+ children: tabs.map((tab) => /* @__PURE__ */ jsxRuntime.jsxs(
2757
+ TabsTrigger,
2758
+ {
2759
+ value: tab.id,
2760
+ className: "min-w-0 flex-1 gap-1 px-2 py-1.5 text-xs shadow-none data-[state=active]:bg-primary/10 data-[state=active]:text-primary data-[state=active]:shadow-none",
2761
+ children: [
2762
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: tab.label }),
2763
+ /* @__PURE__ */ jsxRuntime.jsx(Count, { value: tab.count })
2764
+ ]
2765
+ },
2766
+ tab.id
2767
+ ))
2768
+ }
2769
+ ),
2770
+ /* @__PURE__ */ jsxRuntime.jsx(
2771
+ TabsContent,
2772
+ {
2773
+ value: "summary",
2774
+ className: cn2("mt-0 min-h-0 flex-1 overflow-y-auto p-3", classNames?.body),
2775
+ children: /* @__PURE__ */ jsxRuntime.jsx(SummaryPanel, { model, onIntent })
2776
+ }
2777
+ ),
2778
+ workspaceAvailable ? /* @__PURE__ */ jsxRuntime.jsx(
2779
+ TabsContent,
2780
+ {
2781
+ value: "workspace",
2782
+ className: cn2("mt-0 min-h-0 flex-1 overflow-y-auto p-3", classNames?.body),
2783
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2784
+ WorkspacePanel,
2785
+ {
2786
+ model,
2787
+ sectionClassName: classNames?.section,
2788
+ codeClassName: classNames?.code
2789
+ }
2790
+ )
2791
+ }
2792
+ ) : null
2483
2793
  ]
2484
- },
2485
- tab.id
2486
- )) }),
2487
- /* @__PURE__ */ jsxRuntime.jsx(
2488
- "div",
2489
- {
2490
- id: `${tabId(resolvedTab)}-panel`,
2491
- role: "tabpanel",
2492
- "aria-labelledby": tabId(resolvedTab),
2493
- tabIndex: 0,
2494
- className: cn2("min-h-0 flex-1 overflow-y-auto p-3 outline-none", classNames?.body),
2495
- children: resolvedTab === "summary" ? /* @__PURE__ */ jsxRuntime.jsx(SummaryPanel, { model, onIntent }) : /* @__PURE__ */ jsxRuntime.jsx(
2496
- WorkspacePanel,
2497
- {
2498
- model,
2499
- sectionClassName: classNames?.section,
2500
- codeClassName: classNames?.code
2501
- }
2502
- )
2503
2794
  }
2504
2795
  )
2505
2796
  ]
@@ -2596,12 +2887,12 @@ function AgentWorkbenchThread({
2596
2887
  onArtifactOpen
2597
2888
  }) {
2598
2889
  const messages = useMonkeysLocaleMessages().agentWorkbench;
2599
- const scrollRef = React2.useRef(null);
2600
- const entries = React2.useMemo(
2890
+ const scrollRef = React5.useRef(null);
2891
+ const entries = React5.useMemo(
2601
2892
  () => viewModel ? createThreadEntries(viewModel) : [],
2602
2893
  [viewModel]
2603
2894
  );
2604
- React2.useEffect(() => {
2895
+ React5.useEffect(() => {
2605
2896
  if (!autoScroll || !viewModel) return;
2606
2897
  const element = scrollRef.current;
2607
2898
  if (element) element.scrollTop = element.scrollHeight;
@@ -2698,11 +2989,11 @@ function AgentWorkbenchProcess({
2698
2989
  }) {
2699
2990
  const messages = useMonkeysLocaleMessages().agentWorkbench;
2700
2991
  const controlled = open !== void 0;
2701
- const [internalOpen, setInternalOpen] = React2.useState(defaultOpen ?? isActive(status));
2702
- const userChangedOpen = React2.useRef(false);
2703
- const previousStatus = React2.useRef(status);
2992
+ const [internalOpen, setInternalOpen] = React5.useState(defaultOpen ?? isActive(status));
2993
+ const userChangedOpen = React5.useRef(false);
2994
+ const previousStatus = React5.useRef(status);
2704
2995
  const resolvedOpen = controlled ? open : internalOpen;
2705
- React2.useEffect(() => {
2996
+ React5.useEffect(() => {
2706
2997
  if (controlled || userChangedOpen.current || previousStatus.current === status) return;
2707
2998
  previousStatus.current = status;
2708
2999
  setInternalOpen(isActive(status));
@@ -2862,10 +3153,11 @@ function ArtifactGroup({
2862
3153
  return /* @__PURE__ */ jsxRuntime.jsxs("section", { className: "flex min-w-0 flex-col gap-2", children: [
2863
3154
  /* @__PURE__ */ jsxRuntime.jsx("div", { role: "heading", "aria-level": 2, className: "text-sm font-medium text-muted-foreground", children: title }),
2864
3155
  artifacts.slice(0, maxItems).map((artifact) => /* @__PURE__ */ jsxRuntime.jsxs(
2865
- "button",
3156
+ Button,
2866
3157
  {
2867
3158
  type: "button",
2868
- className: "flex min-w-0 items-center gap-2 rounded-md px-0.5 py-0.5 text-left text-sm outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default",
3159
+ variant: "ghost",
3160
+ className: "h-auto min-w-0 justify-start gap-2 px-0.5 py-0.5 text-left text-sm font-normal disabled:cursor-default",
2869
3161
  disabled: !onArtifactOpen || artifact.status === "loading",
2870
3162
  onClick: () => onArtifactOpen?.(artifact),
2871
3163
  children: [
@@ -2940,10 +3232,12 @@ function AgentWorkbenchArtifactSummary({
2940
3232
  }
2941
3233
  ) : null,
2942
3234
  onViewAll && !showAll && (outputs.length > maxItemsPerGroup || sources.length > maxItemsPerGroup) ? /* @__PURE__ */ jsxRuntime.jsxs(
2943
- "button",
3235
+ Button,
2944
3236
  {
2945
3237
  type: "button",
2946
- className: "flex min-h-8 items-center gap-2 rounded-md text-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
3238
+ variant: "ghost",
3239
+ size: "sm",
3240
+ className: "min-h-8 gap-2 px-0 text-sm text-muted-foreground hover:text-foreground",
2947
3241
  onClick: onViewAll,
2948
3242
  children: [
2949
3243
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link2, { className: "size-4", "aria-hidden": "true" }),
@@ -3080,20 +3374,24 @@ function AgentWorkbenchArtifactWorkspace({
3080
3374
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative z-20 flex shrink-0 items-center gap-2", children: [
3081
3375
  activeArtifact.url ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3082
3376
  /* @__PURE__ */ jsxRuntime.jsx(
3083
- "button",
3377
+ Button,
3084
3378
  {
3085
3379
  type: "button",
3086
- className: "flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
3380
+ variant: "ghost",
3381
+ size: "icon",
3382
+ className: "size-8 shrink-0 text-muted-foreground hover:text-foreground",
3087
3383
  "aria-label": messages.download({ name: activeArtifact.name }),
3088
3384
  onClick: () => onIntent?.({ type: "download", artifactId: activeArtifact.id }),
3089
3385
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "size-4", "aria-hidden": "true" })
3090
3386
  }
3091
3387
  ),
3092
3388
  /* @__PURE__ */ jsxRuntime.jsx(
3093
- "button",
3389
+ Button,
3094
3390
  {
3095
3391
  type: "button",
3096
- className: "flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
3392
+ variant: "ghost",
3393
+ size: "icon",
3394
+ className: "size-8 shrink-0 text-muted-foreground hover:text-foreground",
3097
3395
  "aria-label": messages.openExternal({ name: activeArtifact.name }),
3098
3396
  onClick: () => onIntent?.({ type: "open-external", artifactId: activeArtifact.id }),
3099
3397
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "size-4", "aria-hidden": "true" })
@@ -3101,10 +3399,12 @@ function AgentWorkbenchArtifactWorkspace({
3101
3399
  )
3102
3400
  ] }) : null,
3103
3401
  /* @__PURE__ */ jsxRuntime.jsx(
3104
- "button",
3402
+ Button,
3105
3403
  {
3106
3404
  type: "button",
3107
- className: "flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
3405
+ variant: "ghost",
3406
+ size: "icon",
3407
+ className: "size-8 shrink-0 text-muted-foreground hover:text-foreground",
3108
3408
  "aria-label": messages.closeWorkspace,
3109
3409
  onClick: () => onIntent?.({ type: "close-workspace" }),
3110
3410
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.PanelRightClose, { className: "size-4", "aria-hidden": "true" })