Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

chore(deps): update assistant-ui dependencies and add new UI components

Steven Enamakel76fe963e8603
diff --git a/app/package.json b/app/package.json
index 4e4db8447b..023baf6626 100644
--- a/app/package.json
+++ b/app/package.json
@@ -73,6 +73,7 @@
"@assistant-ui/core": "^0.3.15",
"@assistant-ui/react": "^0.15.16",
"@assistant-ui/react-markdown": "^0.14.12",
+ "@base-ui/react": "^1.7.0",
"@elevenlabs/react": "^1.12.0",
"@noble/ciphers": "^1.2.1",
"@noble/curves": "^2.2.0",
diff --git a/app/src/components/assistant-ui/badge.tsx b/app/src/components/assistant-ui/badge.tsx
new file mode 100644
index 0000000000..7e9a5ae529
--- /dev/null
+++ b/app/src/components/assistant-ui/badge.tsx
@@ -0,0 +1,66 @@
+"use client";
+
+import type { ComponentProps } from "react";
+import { mergeProps } from "@base-ui/react/merge-props";
+import { useRender } from "@base-ui/react/use-render";
+import { cva, type VariantProps } from "class-variance-authority";
+import { cn } from "@/components/assistant-ui/lib/utils";
+
+const badgeVariants = cva(
+ "inline-flex items-center justify-center gap-1 rounded-md text-xs font-medium transition-colors [&_svg]:size-3 [&_svg]:shrink-0",
+ {
+ variants: {
+ variant: {
+ outline:
+ "border-input text-muted-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground border bg-transparent",
+ secondary:
+ "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/80",
+ muted:
+ "bg-muted text-muted-foreground [a&]:hover:bg-muted/80 [a&]:hover:text-foreground",
+ ghost:
+ "text-muted-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground bg-transparent",
+ info: "bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300 [a&]:hover:bg-blue-100/80",
+ warning:
+ "bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300 [a&]:hover:bg-amber-100/80",
+ success:
+ "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/50 dark:text-emerald-300 [a&]:hover:bg-emerald-100/80",
+ destructive:
+ "bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300 [a&]:hover:bg-red-100/80",
+ },
+ size: {
+ sm: "px-1.5 py-0.5",
+ default: "px-2 py-1",
+ lg: "px-2.5 py-1.5 text-sm",
+ },
+ },
+ defaultVariants: {
+ variant: "outline",
+ size: "default",
+ },
+ },
+);
+
+export type BadgeProps = useRender.ComponentProps<"span"> &
+ VariantProps<typeof badgeVariants>;
+
+function Badge({ className, variant, size, render, ...props }: BadgeProps) {
+ const dataProps = {
+ "data-slot": "badge",
+ "data-variant": variant,
+ "data-size": size,
+ } as ComponentProps<"span">;
+
+ return useRender({
+ defaultTagName: "span",
+ props: mergeProps<"span">(
+ dataProps,
+ {
+ className: cn(badgeVariants({ variant, size }), className),
+ },
+ props,
+ ),
+ render,
+ });
+}
+
+export { Badge, badgeVariants };
diff --git a/app/src/components/assistant-ui/composer-trigger-popover.tsx b/app/src/components/assistant-ui/composer-trigger-popover.tsx
new file mode 100644
index 0000000000..8dfa921015
--- /dev/null
+++ b/app/src/components/assistant-ui/composer-trigger-popover.tsx
@@ -0,0 +1,253 @@
+"use client";
+
+import { memo, useRef, type ComponentPropsWithoutRef, type FC } from "react";
+import {
+ ComposerPrimitive,
+ unstable_defaultDirectiveFormatter,
+ unstable_useTriggerPopoverScopeContext,
+ type Unstable_DirectiveFormatter,
+ type Unstable_TriggerItem,
+} from "@assistant-ui/react";
+import { ChevronLeftIcon, ChevronRightIcon, SparklesIcon } from "lucide-react";
+import { cn } from "@/components/assistant-ui/lib/utils";
+
+type IconComponent = FC<{ className?: string }>;
+
+type DirectiveBehaviorProps = {
+ /** Formatter used to serialize the selected item into composer text. */
+ formatter?: Unstable_DirectiveFormatter | undefined;
+ /** Called after the directive text has been inserted into the composer. */
+ onInserted?: ((item: Unstable_TriggerItem) => void) | undefined;
+};
+
+type ActionBehaviorProps = {
+ /** Formatter used to serialize the audit-trail chip (when `removeOnExecute` is false). */
+ formatter?: Unstable_DirectiveFormatter | undefined;
+ /** Invoked with the selected item at the moment of selection. */
+ onExecute: (item: Unstable_TriggerItem) => void;
+ /** If `true`, strip the trigger text from the composer after executing. @default false */
+ removeOnExecute?: boolean | undefined;
+};
+
+type ComposerTriggerPopoverBaseProps = Omit<
+ ComponentPropsWithoutRef<typeof ComposerPrimitive.Unstable_TriggerPopover>,
+ "children"
+> & {
+ /**
+ * Maps icon keys to components. Items look up via `item.metadata?.icon`
+ * (string); categories look up via their `id`.
+ */
+ iconMap?: Record<string, IconComponent>;
+ /** Fallback icon when no entry in `iconMap` matches. */
+ fallbackIcon?: IconComponent;
+ /** Label shown on the back button. @default "Back" */
+ backLabel?: string;
+ /** Label shown when no categories are available. @default "No items available" */
+ emptyCategoriesLabel?: string;
+ /** Label shown when no items match. @default "No matching items" */
+ emptyItemsLabel?: string;
+ /** Label shown while an async adapter is resolving items. @default "Loading…" */
+ loadingLabel?: string;
+};
+
+type ComposerTriggerPopoverProps = ComposerTriggerPopoverBaseProps &
+ (
+ | {
+ /** Insert-directive behavior. */
+ directive: DirectiveBehaviorProps;
+ action?: never;
+ }
+ | {
+ /** Action behavior. */
+ action: ActionBehaviorProps;
+ directive?: never;
+ }
+ );
+
+function resolveIcon(
+ iconKey: string | undefined,
+ iconMap: Record<string, IconComponent> | undefined,
+ fallback: IconComponent,
+): IconComponent {
+ if (iconKey && iconMap?.[iconKey]) return iconMap[iconKey]!;
+ return fallback;
+}
+
+type CategoriesProps = {
+ iconMap: Record<string, IconComponent> | undefined;
+ fallbackIcon: IconComponent;
+ emptyLabel: string;
+};
+
+const Categories: FC<CategoriesProps> = ({
+ iconMap,
+ fallbackIcon,
+ emptyLabel,
+}) => (
+ <ComposerPrimitive.Unstable_TriggerPopoverCategories>
+ {(categories) => (
+ <div
+ data-slot="composer-trigger-popover-categories"
+ className="flex flex-col py-1"
+ >
+ {categories.map((cat) => {
+ const Icon = resolveIcon(cat.id, iconMap, fallbackIcon);
+ return (
+ <ComposerPrimitive.Unstable_TriggerPopoverCategoryItem
+ key={cat.id}
+ categoryId={cat.id}
+ className="hover:bg-accent focus:bg-accent data-[highlighted]:bg-accent flex cursor-pointer items-center justify-between gap-2 px-3 py-2 text-sm transition-colors outline-none"
+ >
+ <span className="flex items-center gap-2">
+ <Icon className="text-muted-foreground size-4" />
+ {cat.label}
+ </span>
+ <ChevronRightIcon className="text-muted-foreground size-4" />
+ </ComposerPrimitive.Unstable_TriggerPopoverCategoryItem>
+ );
+ })}
+ {categories.length === 0 && (
+ <div className="text-muted-foreground px-3 py-2 text-sm">
+ {emptyLabel}
+ </div>
+ )}
+ </div>
+ )}
+ </ComposerPrimitive.Unstable_TriggerPopoverCategories>
+);
+
+type ItemsProps = {
+ iconMap: Record<string, IconComponent> | undefined;
+ fallbackIcon: IconComponent;
+ backLabel: string;
+ emptyLabel: string;
+ loadingLabel: string;
+};
+
+const Items: FC<ItemsProps> = ({
+ iconMap,
+ fallbackIcon,
+ backLabel,
+ emptyLabel,
+ loadingLabel,
+}) => {
+ const { isLoading } = unstable_useTriggerPopoverScopeContext();
+ return (
+ <ComposerPrimitive.Unstable_TriggerPopoverItems>
+ {(items) => (
+ <div
+ data-slot="composer-trigger-popover-items"
+ className="flex flex-col"
+ >
+ <ComposerPrimitive.Unstable_TriggerPopoverBack className="text-muted-foreground hover:bg-accent flex cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs tracking-wide uppercase transition-colors">
+ <ChevronLeftIcon className="size-3.5" />
+ {backLabel}
+ </ComposerPrimitive.Unstable_TriggerPopoverBack>
+
+ <div className="py-1">
+ {items.map((item, index) => {
+ const iconKey =
+ typeof item.metadata?.icon === "string"
+ ? item.metadata.icon
+ : undefined;
+ const Icon = resolveIcon(iconKey, iconMap, fallbackIcon);
+ return (
+ <ComposerPrimitive.Unstable_TriggerPopoverItem
+ key={item.id}
+ item={item}
+ index={index}
+ className="hover:bg-accent focus:bg-accent data-[highlighted]:bg-accent flex w-full cursor-pointer flex-col items-start gap-0.5 px-3 py-2 text-start transition-colors outline-none"
+ >
+ <span className="flex items-center gap-2 text-sm font-medium">
+ <Icon className="text-primary size-3.5" />
+ {item.label}
+ </span>
+ {item.description && (
+ <span className="text-muted-foreground ms-5.5 text-xs leading-tight">
+ {item.description}
+ </span>
+ )}
+ </ComposerPrimitive.Unstable_TriggerPopoverItem>
+ );
+ })}
+ {items.length === 0 && (
+ <div className="text-muted-foreground px-3 py-2 text-sm">
+ {isLoading ? loadingLabel : emptyLabel}
+ </div>
+ )}
+ </div>
+ </div>
+ )}
+ </ComposerPrimitive.Unstable_TriggerPopoverItems>
+ );
+};
+
+/**
+ * Pre-built popover UI for a trigger-driven picker (mentions, slash commands, etc).
+ * Pass exactly one of `directive` (inserts a chip) or `action` (fires a handler).
+ */
+const ComposerTriggerPopoverImpl: FC<ComposerTriggerPopoverProps> = ({
+ iconMap,
+ fallbackIcon = SparklesIcon,
+ backLabel = "Back",
+ emptyCategoriesLabel = "No items available",
+ emptyItemsLabel = "No matching items",
+ loadingLabel = "Loading…",
+ className,
+ directive,
+ action,
+ ...props
+}) => {
+ const warnedRef = useRef(false);
+ if (
+ process.env.NODE_ENV !== "production" &&
+ !warnedRef.current &&
+ Boolean(directive) === Boolean(action)
+ ) {
+ warnedRef.current = true;
+ console.warn(
+ "[assistant-ui] ComposerTriggerPopover requires exactly one of `directive` or `action` props.",
+ );
+ }
+
+ return (
+ <ComposerPrimitive.Unstable_TriggerPopover
+ data-slot="composer-trigger-popover"
+ className={cn(
+ "aui-composer-trigger-popover bg-popover text-popover-foreground absolute start-0 bottom-full z-50 mb-2 w-64 overflow-hidden rounded-xl border",
+ className,
+ )}
+ {...props}
+ >
+ {directive ? (
+ <ComposerPrimitive.Unstable_TriggerPopover.Directive
+ formatter={directive.formatter ?? unstable_defaultDirectiveFormatter}
+ onInserted={directive.onInserted}
+ />
+ ) : action ? (
+ <ComposerPrimitive.Unstable_TriggerPopover.Action
+ formatter={action.formatter ?? unstable_defaultDirectiveFormatter}
+ onExecute={action.onExecute}
+ removeOnExecute={action.removeOnExecute}
+ />
+ ) : null}
+ <Categories
+ iconMap={iconMap}
+ fallbackIcon={fallbackIcon}
+ emptyLabel={emptyCategoriesLabel}
+ />
+ <Items
+ iconMap={iconMap}
+ fallbackIcon={fallbackIcon}
+ backLabel={backLabel}
+ emptyLabel={emptyItemsLabel}
+ loadingLabel={loadingLabel}
+ />
+ </ComposerPrimitive.Unstable_TriggerPopover>
+ );
+};
+ComposerTriggerPopoverImpl.displayName = "ComposerTriggerPopover";
+
+export const ComposerTriggerPopover = memo(
+ ComposerTriggerPopoverImpl,
+) as FC<ComposerTriggerPopoverProps>;
diff --git a/app/src/components/assistant-ui/directive-text.tsx b/app/src/components/assistant-ui/directive-text.tsx
new file mode 100644
index 0000000000..a86a328033
--- /dev/null
+++ b/app/src/components/assistant-ui/directive-text.tsx
@@ -0,0 +1,73 @@
+"use client";
+
+import { memo, type FC } from "react";
+import type { TextMessagePartComponent } from "@assistant-ui/react";
+import type { Unstable_DirectiveFormatter } from "@assistant-ui/react";
+import { unstable_defaultDirectiveFormatter } from "@assistant-ui/react";
+import { Badge } from "./badge";
+
+type IconComponent = FC<{ className?: string }>;
+
+export type CreateDirectiveTextOptions = {
+ /** Maps a directive `type` to an icon component. */
+ iconMap?: Record<string, IconComponent>;
+ /** Icon rendered when `iconMap` has no entry for the segment type. */
+ fallbackIcon?: IconComponent;
+};
+
+/** Creates a `Text` message part component that parses directive syntax and renders inline chips. */
+export function createDirectiveText(
+ formatter: Unstable_DirectiveFormatter,
+ options?: CreateDirectiveTextOptions,
+): TextMessagePartComponent {
+ const iconMap = options?.iconMap;
+ const fallbackIcon = options?.fallbackIcon;
+
+ const Component: TextMessagePartComponent = ({ text }) => {
+ const segments = formatter.parse(text);
+
+ if (segments.length === 1 && segments[0]!.kind === "text") {
+ return <>{text}</>;
+ }
+
+ return (
+ <>
+ {segments.map((seg, i) => {
+ if (seg.kind === "text") {
+ return (
+ <span key={i} className="whitespace-pre-wrap">
+ {seg.text}
+ </span>
+ );
+ }
+
+ const Icon = iconMap?.[seg.type] ?? fallbackIcon;
+ return (
+ <Badge
+ key={i}
+ variant="info"
+ size="sm"
+ data-slot="directive-text-chip"
+ data-directive-type={seg.type}
+ data-directive-id={seg.id}
+ aria-label={`${seg.type}: ${seg.label}`}
+ className="aui-directive-chip items-baseline text-[13px] leading-none [&_svg]:self-center"
+ >
+ {Icon && <Icon />}
+ {seg.label}
+ </Badge>
+ );
+ })}
+ </>
+ );
+ };
+ Component.displayName = "DirectiveText";
+ return Component;
+}
+
+const DirectiveTextImpl = createDirectiveText(
+ unstable_defaultDirectiveFormatter,
+);
+
+/** `Text` message part component that renders directive syntax as inline chips. */
+export const DirectiveText: TextMessagePartComponent = memo(DirectiveTextImpl);
diff --git a/app/src/components/assistant-ui/dot-matrix.tsx b/app/src/components/assistant-ui/dot-matrix.tsx
new file mode 100644
index 0000000000..5885b965b6
--- /dev/null
+++ b/app/src/components/assistant-ui/dot-matrix.tsx
@@ -0,0 +1,267 @@
+import type { ComponentProps, CSSProperties } from "react";
+import { cn } from "@/components/assistant-ui/lib/utils";
+
+const GRID = 5;
+const CENTER = (GRID - 1) / 2;
+const DOT_INDEXES = Array.from({ length: GRID * GRID }, (_, i) => i);
+
+/* Deterministic bit-mixing hash so server and client render identical markup; takes a range in milliseconds and returns seconds. A plain (i * prime) % range correlates indexes a grid-stride apart and renders as column-synchronized waves instead of a twinkle. */
+const hash = (n: number, salt: number, range: number) => {
+ let h = (Math.imul(n, 374761393) + Math.imul(salt, 668265263)) >>> 0;
+ h = Math.imul(h ^ (h >>> 13), 1274126177) >>> 0;
+ return ((h ^ (h >>> 16)) % range) / 1000;
+};
+
+const glyph = (dots: [number, number][]) =>
+ new Set(dots.map(([row, col]) => row * GRID + col));
+
+const CHECK = glyph([
+ [1, 4],
+ [2, 3],
+ [3, 0],
+ [3, 2],
+ [4, 1],
+]);
+const CROSS = glyph([
+ [0, 0],
+ [0, 4],
+ [1, 1],
+ [1, 3],
+ [2, 2],
+ [3, 1],
+ [3, 3],
+ [4, 0],
+ [4, 4],
+]);
+const BANG = glyph([
+ [0, 2],
+ [1, 2],
+ [2, 2],
+ [4, 2],
+]);
+const INFO = glyph([
+ [0, 2],
+ [2, 2],
+ [3, 2],
+ [4, 2],
+]);
+const PAUSE = glyph([
+ [1, 1],
+ [2, 1],
+ [3, 1],
+ [1, 3],
+ [2, 3],
+ [3, 3],
+]);
+const STOP = glyph([
+ [1, 1],
+ [1, 2],
+ [1, 3],
+ [2, 1],
+ [2, 2],
+ [2, 3],
+ [3, 1],
+ [3, 2],
+ [3, 3],
+]);
+const RECORD = glyph([
+ [1, 2],
+ [2, 1],
+ [2, 2],
+ [2, 3],
+ [3, 2],
+]);
+const ELLIPSIS = glyph([
+ [2, 0],
+ [2, 2],
+ [2, 4],
+]);
+
+type Blink = { duration: number; delay: number; lo: number };
+
+type StateConfig = {
+ /** Text color class; dots inherit the surrounding color when omitted. */
+ color?: string;
+ /** Dots that render at full opacity; all others rest at `dim`. Omit for the full grid. */
+ glyph?: Set<number>;
+ /** Resting opacity of on dots. */
+ base?: number;
+ /** Resting opacity of off dots when a glyph is set. */
+ dim?: number;
+ /** Blink parameters per on dot, keyed by index and grid position. */
+ blink?: (i: number, row: number, col: number) => Blink;
+};
+
+const STATES = {
+ idle: { color: "text-muted-foreground", base: 0.3 },
+ loading: {
+ blink: (i) => ({
+ duration: 0.9 + hash(i, 2, 700),
+ delay: -hash(i, 1, 1200),
+ lo: 0.15,
+ }),
+ },
+ thinking: {
+ blink: (_i, row, col) => ({
+ duration: 1.2,
+ delay: -(row + col) * 0.09,
+ lo: 0.2,
+ }),
+ },
+ streaming: {
+ blink: (_i, row, col) => ({
+ duration: 0.9,
+ delay: -(row * 0.12 + hash(col, 3, 900)),
+ lo: 0.15,
+ }),
+ },
+ searching: {
+ blink: (_i, _row, col) => ({ duration: 1.1, delay: -col * 0.12, lo: 0.2 }),
+ },
+ syncing: {
+ blink: (_i, row, col) => {
+ const turn =
+ (Math.atan2(row - CENTER, col - CENTER) + Math.PI) / (2 * Math.PI);
+ return { duration: 1.3, delay: -turn * 1.3, lo: 0.2 };
+ },
+ },
+ connecting: {
+ blink: (_i, row, col) => ({
+ duration: 1.4,
+ delay: -Math.max(Math.abs(row - CENTER), Math.abs(col - CENTER)) * 0.18,
+ lo: 0.15,
+ }),
+ },
+ waiting: {
+ glyph: ELLIPSIS,
+ blink: (_i, _row, col) => ({
+ duration: 1.2,
+ delay: -col * 0.09,
+ lo: 0.2,
+ }),
+ },
+ uploading: {
+ blink: (_i, row) => ({
+ duration: 1,
+ delay: -(GRID - 1 - row) * 0.12,
+ lo: 0.2,
+ }),
+ },
+ downloading: {
+ blink: (_i, row) => ({ duration: 1, delay: -row * 0.12, lo: 0.2 }),
+ },
+ listening: {
+ blink: (_i, _row, col) => ({
+ duration: 0.7 + hash(col, 4, 500),
+ delay: -hash(col, 5, 900),
+ lo: 0.25,
+ }),
+ },
+ speaking: {
+ blink: (_i, _row, col) => ({
+ duration: 0.4 + hash(col, 6, 350),
+ delay: -hash(col, 7, 700),
+ lo: 0.2,
+ }),
+ },
+ recording: {
+ color: "text-red-500",
+ glyph: RECORD,
+ dim: 0.12,
+ blink: () => ({ duration: 1.4, delay: 0, lo: 0.3 }),
+ },
+ success: { color: "text-emerald-500", glyph: CHECK },
+ error: {
+ color: "text-red-500",
+ glyph: CROSS,
+ blink: () => ({ duration: 1.1, delay: 0, lo: 0.4 }),
+ },
+ warning: {
+ color: "text-amber-500",
+ glyph: BANG,
+ blink: () => ({ duration: 1.6, delay: 0, lo: 0.45 }),
+ },
+ info: { color: "text-blue-500", glyph: INFO },
+ paused: { color: "text-muted-foreground", glyph: PAUSE },
+ stopped: { color: "text-muted-foreground", glyph: STOP },
+ offline: { color: "text-muted-foreground", base: 0.15 },
+} satisfies Record<string, StateConfig>;
+
+export type DotMatrixState = keyof typeof STATES;
+
+const dotMatrixStates = Object.keys(STATES) as readonly DotMatrixState[];
+
+export type DotMatrixProps = Omit<ComponentProps<"span">, "children"> & {
+ state?: DotMatrixState;
+ label?: string;
+};
+
+/* The blink animation runs on every dot in every state (static states set hi = lo) and the registered hi/lo custom properties carry a transition, because removing or adding an animation never triggers a CSS transition on the animated property itself; transitioning the amplitude bounds is what makes state changes cross-fade. */
+const DOT_MATRIX_CSS =
+ '@property --aui-dot-matrix-hi{syntax:"<number>";inherits:false;initial-value:1}@property --aui-dot-matrix-lo{syntax:"<number>";inherits:false;initial-value:0.15}@keyframes aui-dot-matrix-blink{0%,100%{opacity:var(--aui-dot-matrix-hi,1)}50%{opacity:var(--aui-dot-matrix-lo,0.15)}}';
+
+/**
+ * Tiny 5x5 dot-matrix status indicator with 20 built-in states. Dots inherit the text color and animate in state-specific patterns: twinkle, waves, ripples, sweeps, equalizer columns, and check/cross/bang glyphs. State changes cross-fade per dot.
+ *
+ * ```tsx
+ * <DotMatrix state={isRunning ? "loading" : "success"} />
+ * ```
+ */
+function DotMatrix({
+ className,
+ state = "loading",
+ label,
+ ...props
+}: DotMatrixProps) {
+ const config: StateConfig = STATES[state];
+ return (
+ <span
+ data-slot="dot-matrix"
+ data-state={state}
+ role="status"
+ className={cn("inline-block size-4 shrink-0", config.color, className)}
+ {...props}
+ >
+ <span className="sr-only">{label ?? state}</span>
+ {/* Hoisted and deduplicated across instances by React; must live in HTML scope, inside the SVG it would be an SVG-namespace element React does not hoist. */}
+ <style href="aui-dot-matrix" precedence="low">
+ {DOT_MATRIX_CSS}
+ </style>
+ <svg
+ aria-hidden
+ viewBox="0 0 20 20"
+ fill="currentColor"
+ className="size-full"
+ >
+ {DOT_INDEXES.map((i) => {
+ const row = Math.floor(i / GRID);
+ const col = i % GRID;
+ const on = !config.glyph || config.glyph.has(i);
+ const hi = on ? (config.base ?? 1) : (config.dim ?? 0.15);
+ const blink = on ? config.blink?.(i, row, col) : undefined;
+ return (
+ <circle
+ key={i}
+ data-slot="dot-matrix-dot"
+ cx={2 + col * 4}
+ cy={2 + row * 4}
+ r={1.3}
+ className="[transition-property:--aui-dot-matrix-hi,--aui-dot-matrix-lo,opacity] duration-300 [animation-iteration-count:infinite] [animation-name:aui-dot-matrix-blink] [animation-timing-function:ease-in-out] motion-reduce:[animation-name:none]"
+ style={
+ {
+ opacity: hi,
+ animationDuration: `${blink?.duration ?? 1}s`,
+ animationDelay: `${blink?.delay ?? 0}s`,
+ "--aui-dot-matrix-hi": hi,
+ "--aui-dot-matrix-lo": blink?.lo ?? hi,
+ } as CSSProperties
+ }
+ />
+ );
+ })}
+ </svg>
+ </span>
+ );
+}
+
+export { DotMatrix, dotMatrixStates };
diff --git a/app/src/components/assistant-ui/message-timing.tsx b/app/src/components/assistant-ui/message-timing.tsx
new file mode 100644
index 0000000000..984876ac48
--- /dev/null
+++ b/app/src/components/assistant-ui/message-timing.tsx
@@ -0,0 +1,104 @@
+"use client";
+
+import { useMessageTiming } from "@assistant-ui/react";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/assistant-ui/ui/tooltip";
+import { cn } from "@/components/assistant-ui/lib/utils";
+import type { FC } from "react";
+
+const formatTimingMs = (ms: number | undefined): string => {
+ if (ms === undefined) return "—";
+ if (ms < 1000) return `${Math.round(ms)}ms`;
+ return `${(ms / 1000).toFixed(2)}s`;
+};
+
+/**
+ * Shows streaming stats (TTFT, total time, tok/s, chunks) as a badge with a
+ * hover/focus tooltip. Renders nothing until the stream completes.
+ *
+ * Place it inside `ActionBarPrimitive.Root` in your `thread.tsx` so it
+ * inherits the action bar's autohide behaviour:
+ *
+ * ```tsx
+ * import { MessageTiming } from "@/components/assistant-ui/message-timing";
+ *
+ * <ActionBarPrimitive.Root >
+ * <ActionBarPrimitive.Copy />
+ * <ActionBarPrimitive.Reload />
+ * <MessageTiming /> // <-- add this
+ * </ActionBarPrimitive.Root>
+ * ```
+ *
+ * @param side - Side of the tooltip relative to the badge trigger.
+ * @default "right"
+ */
+export const MessageTiming: FC<{
+ className?: string;
+ side?: "top" | "right" | "bottom" | "left";
+}> = ({ className, side = "right" }) => {
+ const timing = useMessageTiming();
+ if (timing?.totalStreamTime === undefined) return null;
+
+ return (
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <button
+ type="button"
+ data-slot="message-timing-trigger"
+ aria-label="Message timing"
+ className={cn(
+ "text-muted-foreground hover:bg-accent hover:text-accent-foreground flex items-center rounded-md p-1 font-mono text-xs tabular-nums transition-colors",
+ className,
+ )}
+ />
+ }
+ >
+ {formatTimingMs(timing.totalStreamTime)}
+ </TooltipTrigger>
+ <TooltipContent
+ side={side}
+ sideOffset={8}
+ data-slot="message-timing-popover"
+ className="bg-popover text-popover-foreground rounded-lg border px-3 py-2 [&_span>svg]:hidden!"
+ >
+ <div className="grid min-w-35 gap-1.5 text-xs">
+ {timing.firstTokenTime !== undefined && (
+ <div className="flex items-center justify-between gap-4">
+ <span className="text-muted-foreground">First token</span>
+ <span className="font-mono tabular-nums">
+ {formatTimingMs(timing.firstTokenTime)}
+ </span>
+ </div>
+ )}
+ <div className="flex items-center justify-between gap-4">
+ <span className="text-muted-foreground">Total</span>
+ <span className="font-mono tabular-nums">
+ {formatTimingMs(timing.totalStreamTime)}
+ </span>
+ </div>
+ {timing.tokensPerSecond !== undefined && (
+ <div className="flex items-center justify-between gap-4">
+ <span className="text-muted-foreground">Speed</span>
+ <span className="font-mono tabular-nums">
+ {timing.tokensPerSecond.toFixed(1)} tok/s
+ </span>
+ </div>
+ )}
+ <div className="flex items-center justify-between gap-4">
+ <span className="text-muted-foreground">Chunks</span>
+ <span className="font-mono tabular-nums">
+ {timing.totalChunks}
+ </span>
+ </div>
+ </div>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+ );
+};
diff --git a/app/src/components/assistant-ui/model-selector.tsx b/app/src/components/assistant-ui/model-selector.tsx
new file mode 100644
index 0000000000..72ac1d6e44
--- /dev/null
+++ b/app/src/components/assistant-ui/model-selector.tsx
@@ -0,0 +1,805 @@
+"use client";
+
+import {
+ memo,
+ useCallback,
+ useEffect,
+ useMemo,
+ useRef,
+ useState,
+ createContext,
+ useContext,
+ type ComponentPropsWithoutRef,
+ type ReactNode,
+} from "react";
+import { cva, type VariantProps } from "class-variance-authority";
+import { CheckIcon, ChevronDownIcon } from "lucide-react";
+import { useAui } from "@assistant-ui/react";
+import { cn } from "@/components/assistant-ui/lib/utils";
+import {
+ Popover,
+ PopoverContent,
+ PopoverTrigger,
+} from "@/components/assistant-ui/ui/popover";
+import {
+ Command,
+ CommandEmpty,
+ CommandGroup,
+ CommandInput,
+ CommandItem,
+ CommandList,
+ CommandSeparator,
+} from "@/components/assistant-ui/ui/command";
+import { RadioGroup } from "@base-ui/react/radio-group";
+import { Radio } from "@base-ui/react/radio";
+
+export type ModelSelectorEffortOption = {
+ id: string;
+ name: string;
+};
+
+export const DEFAULT_EFFORT_OPTIONS: readonly ModelSelectorEffortOption[] = [
+ { id: "low", name: "Low" },
+ { id: "medium", name: "Med" },
+ { id: "high", name: "High" },
+];
+
+export type ModelOption = {
+ id: string;
+ name: string;
+ description?: string;
+ icon?: ReactNode;
+ disabled?: boolean;
+ /** Extra terms matched by ModelSelector.Search, in addition to id and name. */
+ keywords?: readonly string[];
+ /**
+ * Reasoning effort levels the model supports. Pass `true` for the default
+ * low/medium/high levels, or a custom list. Omit for models without
+ * configurable reasoning.
+ */
+ efforts?: boolean | readonly ModelSelectorEffortOption[];
+};
+
+function getModelEfforts(
+ model: ModelOption | undefined,
+): readonly ModelSelectorEffortOption[] | undefined {
+ if (!model?.efforts) return undefined;
+ return model.efforts === true ? DEFAULT_EFFORT_OPTIONS : model.efforts;
+}
+
+function resolveEffort(
+ efforts: readonly ModelSelectorEffortOption[] | undefined,
+ effort: string | undefined,
+): string | undefined {
+ if (effort === undefined) return undefined;
+ return efforts?.some((e) => e.id === effort) ? effort : undefined;
+}
+
+/**
+ * Returns the effort id if the given model supports it, otherwise undefined.
+ * Effort selection is kept sticky across model switches; this resolves what
+ * actually applies to the current model.
+ */
+export function resolveModelEffort(
+ models: readonly ModelOption[],
+ modelId: string | undefined,
+ effort: string | undefined,
+): string | undefined {
+ return resolveEffort(
+ getModelEfforts(models.find((m) => m.id === modelId)),
+ effort,
+ );
+}
+
+function useControllableState<T>({
+ prop,
+ defaultProp,
+ onChange,
+}: {
+ prop: T | undefined;
+ defaultProp: T | undefined;
+ onChange: ((next: T) => void) | undefined;
+}) {
+ const [internal, setInternal] = useState(defaultProp);
+ const isControlled = prop !== undefined;
+ const value = isControlled ? prop : internal;
+ // Read onChange through a ref so inline callbacks don't recreate the setter
+ // (and with it the memoized context value) every render.
+ const onChangeRef = useRef(onChange);
+ useEffect(() => {
+ onChangeRef.current = onChange;
+ });
+ const setValue = useCallback(
+ (next: T) => {
+ if (!isControlled) setInternal(next);
+ onChangeRef.current?.(next);
+ },
+ [isControlled],
+ );
+ return [value, setValue] as const;
+}
+
+type ModelSelectorContextValue = {
+ models: readonly ModelOption[];
+ value: string | undefined;
+ setValue: (value: string) => void;
+ /** The model matching `value`, derived once for all sub-components. */
+ selectedModel: ModelOption | undefined;
+ /** The selected model's effort levels, undefined when not configurable. */
+ efforts: readonly ModelSelectorEffortOption[] | undefined;
+ /** Effort resolved against the selected model's supported levels. */
+ effort: string | undefined;
+ setEffort: (effort: string) => void;
+ setOpen: (open: boolean) => void;
+};
+
+const ModelSelectorContext = createContext<ModelSelectorContextValue | null>(
+ null,
+);
+
+function useModelSelectorContext() {
+ const ctx = useContext(ModelSelectorContext);
+ if (!ctx) {
+ throw new Error(
+ "ModelSelector sub-components must be used within ModelSelector.Root",
+ );
+ }
+ return ctx;
+}
+
+/**
+ * The selected model's effort levels and the active selection. Use it to build
+ * a custom effort UI inside ModelSelector.Content (e.g. a slider or a shadcn
+ * DropdownMenu) when the built-in ModelSelector.Effort layout doesn't fit.
+ * `efforts` is undefined for models without configurable reasoning.
+ */
+export function useModelSelectorEfforts(): {
+ efforts: readonly ModelSelectorEffortOption[] | undefined;
+ effort: string | undefined;
+ setEffort: (effort: string) => void;
+} {
+ const { efforts, effort, setEffort } = useModelSelectorContext();
+ return { efforts, effort, setEffort };
+}
+
+export type ModelSelectorRootProps = {
+ models: readonly ModelOption[];
+ value?: string;
+ defaultValue?: string;
+ onValueChange?: (value: string) => void;
+ effort?: string;
+ defaultEffort?: string;
+ onEffortChange?: (effort: string) => void;
+ open?: boolean;
+ defaultOpen?: boolean;
+ onOpenChange?: (open: boolean) => void;
+ children: ReactNode;
+};
+
+function ModelSelectorRoot({
+ models,
+ value: valueProp,
+ defaultValue,
+ onValueChange,
+ effort: effortProp,
+ defaultEffort,
+ onEffortChange,
+ open: openProp,
+ defaultOpen,
+ onOpenChange,
+ children,
+}: ModelSelectorRootProps) {
+ const [value, setValue] = useControllableState({
+ prop: valueProp,
+ defaultProp: defaultValue ?? models[0]?.id,
+ onChange: onValueChange,
+ });
+ const [effort, setEffort] = useControllableState({
+ prop: effortProp,
+ defaultProp: defaultEffort,
+ onChange: onEffortChange,
+ });
+ const [open, setOpen] = useControllableState({
+ prop: openProp,
+ defaultProp: defaultOpen ?? false,
+ onChange: onOpenChange,
+ });
+
+ const selectedModel = models.find((m) => m.id === value);
+ const efforts = getModelEfforts(selectedModel);
+ const activeEffort = resolveEffort(efforts, effort);
+ const contextValue = useMemo(
+ () => ({
+ models,
+ value,
+ setValue,
+ selectedModel,
+ efforts,
+ effort: activeEffort,
+ setEffort,
+ setOpen,
+ }),
+ [
+ models,
+ value,
+ setValue,
+ selectedModel,
+ efforts,
+ activeEffort,
+ setEffort,
+ setOpen,
+ ],
+ );
+
+ return (
+ <ModelSelectorContext.Provider value={contextValue}>
+ <Popover open={open ?? false} onOpenChange={setOpen}>
+ {children}
+ </Popover>
+ </ModelSelectorContext.Provider>
+ );
+}
+
+export const modelSelectorTriggerVariants = cva(
+ "focus-visible:ring-ring/50 flex w-fit items-center justify-between gap-2 overflow-hidden rounded-md text-sm whitespace-nowrap transition-colors outline-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5",
+ {
+ variants: {
+ variant: {
+ outline:
+ "border-input hover:bg-accent hover:text-accent-foreground border bg-transparent",
+ ghost: "hover:bg-accent hover:text-accent-foreground",
+ muted: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
+ },
+ size: {
+ default: "h-9 px-3 py-2",
+ sm: "h-8 px-2.5 py-1.5 text-xs",
+ lg: "h-10 px-4 py-2.5",
+ },
+ },
+ defaultVariants: {
+ variant: "outline",
+ size: "default",
+ },
+ },
+);
+
+export type ModelSelectorTriggerProps = ComponentPropsWithoutRef<
+ typeof PopoverTrigger
+> &
+ VariantProps<typeof modelSelectorTriggerVariants>;
+
+function ModelSelectorTrigger({
+ className,
+ variant,
+ size,
+ children,
+ onKeyDown,
+ ...props
+}: ModelSelectorTriggerProps) {
+ const { setOpen } = useModelSelectorContext();
+
+ return (
+ <PopoverTrigger
+ data-slot="model-selector-trigger"
+ data-variant={variant ?? "outline"}
+ data-size={size ?? "default"}
+ role="combobox"
+ aria-haspopup="listbox"
+ className={cn(modelSelectorTriggerVariants({ variant, size }), className)}
+ onKeyDown={(e) => {
+ onKeyDown?.(e);
+ if (e.defaultPrevented) return;
+ // ARIA combobox: arrows open the listbox from a focused trigger.
+ // Popover leaves this to the consumer.
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
+ e.preventDefault();
+ setOpen(true);
+ }
+ }}
+ {...props}
+ >
+ {children ?? <ModelSelectorValue />}
+ <ChevronDownIcon className="size-4 opacity-50" />
+ </PopoverTrigger>
+ );
+}
+
+export type ModelSelectorValueProps = {
+ placeholder?: ReactNode;
+ /** Show the active effort level next to the model name. */
+ showEffort?: boolean;
+ className?: string;
+};
+
+function ModelIcon({
+ children,
+ className,
+}: {
+ children: ReactNode;
+ className?: string;
+}) {
+ return (
+ <span
+ className={cn(
+ "flex size-3.5 shrink-0 items-center justify-center [&_svg]:size-3.5",
+ className,
+ )}
+ >
+ {children}
+ </span>
+ );
+}
+
+function ModelSelectorValue({
+ placeholder = "Select model",
+ showEffort = true,
+ className,
+}: ModelSelectorValueProps) {
+ const { selectedModel, efforts, effort } = useModelSelectorContext();
+
+ if (!selectedModel) {
+ return (
+ <span
+ data-slot="model-selector-value"
+ className={cn("text-muted-foreground", className)}
+ >
+ {placeholder}
+ </span>
+ );
+ }
+
+ const effortName =
+ showEffort && effort !== undefined
+ ? efforts?.find((e) => e.id === effort)?.name
+ : undefined;
+
+ return (
+ <span
+ data-slot="model-selector-value"
+ className={cn("flex min-w-0 items-center gap-2", className)}
+ >
+ {selectedModel.icon && <ModelIcon>{selectedModel.icon}</ModelIcon>}
+ <span className="truncate font-medium">{selectedModel.name}</span>
+ {effortName && (
+ <span className="text-muted-foreground min-w-7.5 truncate text-center">
+ {effortName}
+ </span>
+ )}
+ </span>
+ );
+}
+
+export type ModelSelectorContentProps = Omit<
+ ComponentPropsWithoutRef<typeof PopoverContent>,
+ "side"
+> & {
+ /**
+ * Preferred side for the initial placement. Once the popover is open, the
+ * rendered side takes over until it closes, so the popup does not jump
+ * between sides while filtering resizes the list.
+ */
+ side?: ComponentPropsWithoutRef<typeof PopoverContent>["side"];
+ searchable?: boolean;
+};
+
+// Base UI's Popover re-evaluates collision flipping whenever the popup
+// resizes, so filtering the list down flips the popup back to the preferred
+// side mid-interaction. Base UI only exposes its lazy-flip behavior on the
+// Combobox positioner, so mirror it here: feed the rendered side back as the
+// preferred side, making the popup keep its side until it no longer fits.
+function useLazyFlipSide(): {
+ side: ModelSelectorContentProps["side"];
+ popupRef: (node: HTMLDivElement | null) => void;
+} {
+ const [side, setSide] = useState<ModelSelectorContentProps["side"]>();
+ const observerRef = useRef<MutationObserver | null>(null);
+ const popupRef = useCallback((node: HTMLDivElement | null) => {
+ observerRef.current?.disconnect();
+ observerRef.current = null;
+ if (!node) {
+ setSide(undefined);
+ return;
+ }
+ const sync = () => {
+ const rendered = node.getAttribute("data-side");
+ if (rendered) setSide(rendered as ModelSelectorContentProps["side"]);
+ };
+ sync();
+ const observer = new MutationObserver(sync);
+ observer.observe(node, {
+ attributes: true,
+ attributeFilter: ["data-side"],
+ });
+ observerRef.current = observer;
+ }, []);
+ return { side, popupRef };
+}
+
+/**
+ * Hidden input that anchors cmdk's keyboard navigation, keeping the list
+ * keyboard-operable without a visible search box. ModelSelectorContent renders
+ * one automatically when unfiltered.
+ */
+function ModelSelectorFocusAnchor() {
+ return (
+ <div className="sr-only">
+ <CommandInput readOnly aria-label="Model" />
+ </div>
+ );
+}
+
+function ModelSelectorContent({
+ className,
+ align = "start",
+ side,
+ sideOffset = 6,
+ searchable,
+ children,
+ ...props
+}: ModelSelectorContentProps) {
+ const { value } = useModelSelectorContext();
+ const { side: renderedSide, popupRef } = useLazyFlipSide();
+ const unfiltered =
+ searchable === false || (!searchable && children === undefined);
+
+ return (
+ <PopoverContent
+ ref={popupRef}
+ data-slot="model-selector-content"
+ align={align}
+ side={renderedSide ?? side ?? "bottom"}
+ sideOffset={sideOffset}
+ className={cn(
+ "bg-popover w-72 min-w-(--anchor-width) overflow-hidden rounded-xl p-0",
+ className,
+ )}
+ {...props}
+ >
+ <Command
+ className="bg-transparent"
+ shouldFilter={!unfiltered}
+ {...(value !== undefined ? { defaultValue: value } : {})}
+ >
+ {unfiltered && <ModelSelectorFocusAnchor />}
+ {children ?? (
+ <>
+ {searchable && <ModelSelectorSearch />}
+ <ModelSelectorList />
+ <ModelSelectorEffort />
+ </>
+ )}
+ </Command>
+ </PopoverContent>
+ );
+}
+
+export type ModelSelectorSearchProps = ComponentPropsWithoutRef<
+ typeof CommandInput
+>;
+
+function ModelSelectorSearch({
+ placeholder = "Search models...",
+ ...props
+}: ModelSelectorSearchProps) {
+ return (
+ <CommandInput
+ data-slot="model-selector-search"
+ placeholder={placeholder}
+ {...props}
+ />
+ );
+}
+
+export type ModelSelectorListProps = ComponentPropsWithoutRef<
+ typeof CommandList
+>;
+
+function ModelSelectorList({
+ className,
+ children,
+ ...props
+}: ModelSelectorListProps) {
+ const { models } = useModelSelectorContext();
+
+ return (
+ <CommandList
+ data-slot="model-selector-list"
+ className={cn(
+ "[-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
+ className,
+ )}
+ {...props}
+ >
+ {children ?? (
+ <>
+ <ModelSelectorEmpty />
+ <CommandGroup>
+ {models.map((model) => (
+ <ModelSelectorItem key={model.id} model={model} />
+ ))}
+ </CommandGroup>
+ </>
+ )}
+ </CommandList>
+ );
+}
+
+export type ModelSelectorEmptyProps = ComponentPropsWithoutRef<
+ typeof CommandEmpty
+>;
+
+function ModelSelectorEmpty({ children, ...props }: ModelSelectorEmptyProps) {
+ return (
+ <CommandEmpty data-slot="model-selector-empty" {...props}>
+ {children ?? "No models found."}
+ </CommandEmpty>
+ );
+}
+
+export type ModelSelectorGroupProps = ComponentPropsWithoutRef<
+ typeof CommandGroup
+>;
+
+function ModelSelectorGroup(props: ModelSelectorGroupProps) {
+ return <CommandGroup data-slot="model-selector-group" {...props} />;
+}
+
+export type ModelSelectorSeparatorProps = ComponentPropsWithoutRef<
+ typeof CommandSeparator
+>;
+
+function ModelSelectorSeparator(props: ModelSelectorSeparatorProps) {
+ return <CommandSeparator data-slot="model-selector-separator" {...props} />;
+}
+
+export type ModelSelectorItemProps = Omit<
+ ComponentPropsWithoutRef<typeof CommandItem>,
+ "value"
+> & {
+ model: ModelOption;
+};
+
+function ModelSelectorItem({
+ model,
+ className,
+ children,
+ onSelect,
+ ...props
+}: ModelSelectorItemProps) {
+ const { value, setValue, setOpen } = useModelSelectorContext();
+ const isSelected = value === model.id;
+
+ return (
+ <CommandItem
+ data-slot="model-selector-item"
+ value={model.id}
+ keywords={[model.name, ...(model.keywords ?? [])]}
+ {...(model.disabled ? { disabled: true } : undefined)}
+ onSelect={(selectedValue) => {
+ setValue(model.id);
+ setOpen(false);
+ onSelect?.(selectedValue);
+ }}
+ className={cn(
+ "relative items-start gap-2 rounded-lg py-2 ps-3 pe-9 [&_svg:not([class*='size-'])]:size-3.5",
+ className,
+ )}
+ {...props}
+ >
+ {children ?? (
+ <>
+ {model.icon && (
+ <ModelIcon className="mt-[3px]">{model.icon}</ModelIcon>
+ )}
+ <span className="flex min-w-0 flex-col">
+ <span className="truncate font-medium">{model.name}</span>
+ {model.description && (
+ <span className="text-muted-foreground truncate text-xs">
+ {model.description}
+ </span>
+ )}
+ </span>
+ </>
+ )}
+ {isSelected && (
+ <span className="absolute end-3 top-2.5 flex size-4 items-center justify-center">
+ <CheckIcon className="size-4" />
+ </span>
+ )}
+ </CommandItem>
+ );
+}
+
+export type ModelSelectorEffortProps = ComponentPropsWithoutRef<"div"> & {
+ label?: ReactNode;
+};
+
+function ModelSelectorEffort({
+ label = "Thinking",
+ className,
+ onKeyDown,
+ onKeyDownCapture,
+ ...props
+}: ModelSelectorEffortProps) {
+ const { efforts, effort, setEffort } = useModelSelectorEfforts();
+
+ if (!efforts?.length) return null;
+
+ return (
+ <div
+ data-slot="model-selector-effort"
+ className={cn(
+ "flex cursor-default items-center justify-between gap-3 border-t px-3 py-2",
+ className,
+ )}
+ onKeyDownCapture={(e) => {
+ onKeyDownCapture?.(e);
+ if (e.defaultPrevented) return;
+ if (e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
+ // Base UI's RadioGroup composite claims vertical arrows for roving
+ // focus (orientation "both", not configurable), so intercept them in
+ // capture and hand the keypress to cmdk: the model list owns vertical
+ // navigation, and cmdk's Enter is inert while a radio has focus.
+ onKeyDown?.(e);
+ if (e.defaultPrevented) return;
+ const input = e.currentTarget
+ .closest("[cmdk-root]")
+ ?.querySelector<HTMLInputElement>("[cmdk-input]");
+ if (!input) return;
+ e.preventDefault();
+ e.stopPropagation();
+ input.focus();
+ input.dispatchEvent(new KeyboardEvent("keydown", e.nativeEvent));
+ }}
+ onKeyDown={(e) => {
+ if (e.key === "ArrowUp" || e.key === "ArrowDown") return;
+ onKeyDown?.(e);
+ if (e.defaultPrevented) return;
+ // Base UI's radio composite ignores Home/End and cmdk's Command
+ // root would claim them to jump the model list; move radio focus
+ // here so only the radiogroup reacts.
+ if (e.key === "Home" || e.key === "End") {
+ e.preventDefault();
+ e.stopPropagation();
+ const radios = Array.from(
+ e.currentTarget.querySelectorAll<HTMLElement>(
+ '[role="radio"]:not([data-disabled])',
+ ),
+ );
+ (e.key === "Home" ? radios[0] : radios[radios.length - 1])?.focus();
+ }
+ }}
+ {...props}
+ >
+ <span className="text-muted-foreground text-xs">{label}</span>
+ <RadioGroup
+ value={effort ?? ""}
+ onValueChange={setEffort}
+ aria-label={typeof label === "string" ? label : "Reasoning effort"}
+ className="flex items-center gap-0.5"
+ >
+ {efforts.map((option) => (
+ <Radio.Root
+ key={option.id}
+ value={option.id}
+ className={cn(
+ "focus-visible:ring-ring/50 text-muted-foreground hover:text-foreground rounded-md px-2 py-1 text-xs transition-colors outline-none focus-visible:ring-1",
+ "data-checked:bg-accent data-checked:text-accent-foreground data-checked:font-medium",
+ )}
+ >
+ {option.name}
+ </Radio.Root>
+ ))}
+ </RadioGroup>
+ </div>
+ );
+}
+
+export type ModelSelectorProps = Omit<ModelSelectorRootProps, "children"> &
+ VariantProps<typeof modelSelectorTriggerVariants> & {
+ /** Render a search input above the model list. */
+ searchable?: boolean;
+ /** Alignment of the dropdown relative to the trigger. Use `"end"` when the
+ * trigger sits at the right edge of its container. */
+ align?: ModelSelectorContentProps["align"];
+ className?: string;
+ contentClassName?: string;
+ };
+
+/** Registers the selection with assistant-ui's ModelContext system. The
+ * context's effort is already resolved against the selected model. */
+function ModelSelectorModelContext() {
+ const { value, effort } = useModelSelectorContext();
+ const api = useAui();
+
+ useEffect(() => {
+ if (value === undefined) return;
+ const config = {
+ config: {
+ modelName: value,
+ ...(effort !== undefined ? { reasoningEffort: effort } : undefined),
+ },
+ };
+ return api.modelContext.register({
+ getModelContext: () => config,
+ });
+ }, [api, value, effort]);
+
+ return null;
+}
+
+const ModelSelectorImpl = ({
+ searchable,
+ variant,
+ size,
+ align,
+ className,
+ contentClassName,
+ ...rootProps
+}: ModelSelectorProps) => {
+ return (
+ <ModelSelectorRoot {...rootProps}>
+ <ModelSelectorModelContext />
+ <ModelSelectorTrigger
+ variant={variant}
+ size={size}
+ className={className}
+ />
+ <ModelSelectorContent
+ {...(align !== undefined ? { align } : {})}
+ className={contentClassName}
+ searchable={searchable ?? false}
+ />
+ </ModelSelectorRoot>
+ );
+};
+
+type ModelSelectorComponent = typeof ModelSelectorImpl & {
+ displayName?: string;
+ Root: typeof ModelSelectorRoot;
+ Trigger: typeof ModelSelectorTrigger;
+ Value: typeof ModelSelectorValue;
+ Content: typeof ModelSelectorContent;
+ Search: typeof ModelSelectorSearch;
+ FocusAnchor: typeof ModelSelectorFocusAnchor;
+ List: typeof ModelSelectorList;
+ Empty: typeof ModelSelectorEmpty;
+ Group: typeof ModelSelectorGroup;
+ Separator: typeof ModelSelectorSeparator;
+ Item: typeof ModelSelectorItem;
+ Effort: typeof ModelSelectorEffort;
+};
+
+const ModelSelector = memo(
+ ModelSelectorImpl,
+) as unknown as ModelSelectorComponent;
+
+ModelSelector.displayName = "ModelSelector";
+ModelSelector.Root = ModelSelectorRoot;
+ModelSelector.Trigger = ModelSelectorTrigger;
+ModelSelector.Value = ModelSelectorValue;
+ModelSelector.Content = ModelSelectorContent;
+ModelSelector.Search = ModelSelectorSearch;
+ModelSelector.FocusAnchor = ModelSelectorFocusAnchor;
+ModelSelector.List = ModelSelectorList;
+ModelSelector.Empty = ModelSelectorEmpty;
+ModelSelector.Group = ModelSelectorGroup;
+ModelSelector.Separator = ModelSelectorSeparator;
+ModelSelector.Item = ModelSelectorItem;
+ModelSelector.Effort = ModelSelectorEffort;
+
+export {
+ ModelSelector,
+ ModelSelectorRoot,
+ ModelSelectorTrigger,
+ ModelSelectorValue,
+ ModelSelectorContent,
+ ModelSelectorSearch,
+ ModelSelectorFocusAnchor,
+ ModelSelectorList,
+ ModelSelectorEmpty,
+ ModelSelectorGroup,
+ ModelSelectorSeparator,
+ ModelSelectorItem,
+ ModelSelectorEffort,
+};
diff --git a/app/src/components/assistant-ui/quote.tsx b/app/src/components/assistant-ui/quote.tsx
new file mode 100644
index 0000000000..a10ab0fcac
--- /dev/null
+++ b/app/src/components/assistant-ui/quote.tsx
@@ -0,0 +1,289 @@
+"use client";
+
+import { memo, type ComponentProps, type FC } from "react";
+import type { QuoteMessagePartComponent } from "@assistant-ui/react";
+import {
+ ComposerPrimitive,
+ SelectionToolbarPrimitive,
+} from "@assistant-ui/react";
+import { QuoteIcon, XIcon } from "lucide-react";
+import { cn } from "@/components/assistant-ui/lib/utils";
+
+function QuoteBlockRoot({ className, ...props }: ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="quote-block"
+ className={cn("mb-2 flex items-start gap-1.5", className)}
+ {...props}
+ />
+ );
+}
+
+function QuoteBlockIcon({
+ className,
+ ...props
+}: ComponentProps<typeof QuoteIcon>) {
+ return (
+ <QuoteIcon
+ data-slot="quote-block-icon"
+ className={cn(
+ "text-muted-foreground/60 mt-0.5 size-3 shrink-0",
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function QuoteBlockText({ className, ...props }: ComponentProps<"p">) {
+ return (
+ <p
+ data-slot="quote-block-text"
+ className={cn(
+ "text-muted-foreground/80 line-clamp-2 min-w-0 text-sm italic",
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+/**
+ * Renders quoted text in user messages.
+ *
+ * Pass this to `MessagePrimitive.Parts` as the `Quote` renderer.
+ *
+ * @example
+ * ```tsx
+ * <MessagePrimitive.Quote>
+ * {(quote) => <QuoteBlock {...quote} />}
+ * </MessagePrimitive.Quote>
+ * ```
+ */
+const QuoteBlockImpl: QuoteMessagePartComponent = ({ text }) => {
+ return (
+ <QuoteBlockRoot>
+ <QuoteBlockIcon />
+ <QuoteBlockText>{text}</QuoteBlockText>
+ </QuoteBlockRoot>
+ );
+};
+
+const QuoteBlock = memo(
+ QuoteBlockImpl,
+) as unknown as QuoteMessagePartComponent & {
+ Root: typeof QuoteBlockRoot;
+ Icon: typeof QuoteBlockIcon;
+ Text: typeof QuoteBlockText;
+};
+
+QuoteBlock.displayName = "QuoteBlock";
+QuoteBlock.Root = QuoteBlockRoot;
+QuoteBlock.Icon = QuoteBlockIcon;
+QuoteBlock.Text = QuoteBlockText;
+
+function SelectionToolbarRoot({
+ className,
+ ...props
+}: ComponentProps<typeof SelectionToolbarPrimitive.Root>) {
+ return (
+ <SelectionToolbarPrimitive.Root
+ data-slot="selection-toolbar"
+ className={cn(
+ "bg-popover flex items-center gap-1 rounded-lg border px-1 py-1",
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function SelectionToolbarQuote({
+ className,
+ children,
+ ...props
+}: ComponentProps<typeof SelectionToolbarPrimitive.Quote>) {
+ return (
+ <SelectionToolbarPrimitive.Quote
+ data-slot="selection-toolbar-quote"
+ className={cn(
+ "text-popover-foreground hover:bg-accent flex items-center gap-1.5 rounded-md px-2.5 py-1 text-sm transition-colors",
+ className,
+ )}
+ {...props}
+ >
+ {children ?? (
+ <>
+ <QuoteIcon className="size-3.5" />
+ Quote
+ </>
+ )}
+ </SelectionToolbarPrimitive.Quote>
+ );
+}
+
+/**
+ * Floating toolbar that appears when text is selected in a message.
+ *
+ * Render anywhere inside `ThreadPrimitive.Root` (or any `AssistantRuntimeProvider` scope).
+ *
+ * @example
+ * ```tsx
+ * <ThreadPrimitive.Root>
+ * <ThreadPrimitive.Viewport>...</ThreadPrimitive.Viewport>
+ * <SelectionToolbar />
+ * </ThreadPrimitive.Root>
+ * ```
+ */
+const SelectionToolbarImpl: FC<ComponentProps<typeof SelectionToolbarRoot>> = ({
+ className,
+ ...props
+}) => {
+ return (
+ <SelectionToolbarRoot className={className} {...props}>
+ <SelectionToolbarQuote />
+ </SelectionToolbarRoot>
+ );
+};
+
+const SelectionToolbar = memo(
+ SelectionToolbarImpl,
+) as unknown as typeof SelectionToolbarImpl & {
+ Root: typeof SelectionToolbarRoot;
+ Quote: typeof SelectionToolbarQuote;
+};
+
+SelectionToolbar.displayName = "SelectionToolbar";
+SelectionToolbar.Root = SelectionToolbarRoot;
+SelectionToolbar.Quote = SelectionToolbarQuote;
+
+function ComposerQuotePreviewRoot({
+ className,
+ ...props
+}: ComponentProps<typeof ComposerPrimitive.Quote>) {
+ return (
+ <ComposerPrimitive.Quote
+ data-slot="composer-quote"
+ className={cn(
+ "bg-muted/60 mx-3 mt-2 flex items-start gap-2 rounded-lg px-3 py-2",
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function ComposerQuotePreviewIcon({
+ className,
+ ...props
+}: ComponentProps<typeof QuoteIcon>) {
+ return (
+ <QuoteIcon
+ data-slot="composer-quote-icon"
+ className={cn(
+ "text-muted-foreground/70 mt-0.5 size-3.5 shrink-0",
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function ComposerQuotePreviewText({
+ className,
+ ...props
+}: ComponentProps<typeof ComposerPrimitive.QuoteText>) {
+ return (
+ <ComposerPrimitive.QuoteText
+ data-slot="composer-quote-text"
+ className={cn(
+ "text-muted-foreground line-clamp-2 min-w-0 flex-1 text-sm",
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function ComposerQuotePreviewDismiss({
+ className,
+ children,
+ ...props
+}: ComponentProps<typeof ComposerPrimitive.QuoteDismiss>) {
+ const defaultClassName =
+ "shrink-0 rounded-sm p-0.5 text-muted-foreground/70 transition-colors hover:bg-accent hover:text-foreground";
+
+ return (
+ <ComposerPrimitive.QuoteDismiss
+ data-slot="composer-quote-dismiss"
+ className={children ? className : undefined}
+ {...props}
+ >
+ {children ?? (
+ <button
+ type="button"
+ aria-label="Dismiss quote"
+ className={cn(defaultClassName, className)}
+ >
+ <XIcon className="size-3.5" />
+ </button>
+ )}
+ </ComposerPrimitive.QuoteDismiss>
+ );
+}
+
+/**
+ * Quote preview inside the composer. Only renders when a quote is set.
+ *
+ * Place inside `ComposerPrimitive.Root`.
+ *
+ * @example
+ * ```tsx
+ * <ComposerPrimitive.Root>
+ * <ComposerQuotePreview />
+ * <ComposerPrimitive.Input />
+ * <ComposerPrimitive.Send />
+ * </ComposerPrimitive.Root>
+ * ```
+ */
+const ComposerQuotePreviewImpl: FC<
+ ComponentProps<typeof ComposerQuotePreviewRoot>
+> = ({ className, ...props }) => {
+ return (
+ <ComposerQuotePreviewRoot className={className} {...props}>
+ <ComposerQuotePreviewIcon />
+ <ComposerQuotePreviewText />
+ <ComposerQuotePreviewDismiss />
+ </ComposerQuotePreviewRoot>
+ );
+};
+
+const ComposerQuotePreview = memo(
+ ComposerQuotePreviewImpl,
+) as unknown as typeof ComposerQuotePreviewImpl & {
+ Root: typeof ComposerQuotePreviewRoot;
+ Icon: typeof ComposerQuotePreviewIcon;
+ Text: typeof ComposerQuotePreviewText;
+ Dismiss: typeof ComposerQuotePreviewDismiss;
+};
+
+ComposerQuotePreview.displayName = "ComposerQuotePreview";
+ComposerQuotePreview.Root = ComposerQuotePreviewRoot;
+ComposerQuotePreview.Icon = ComposerQuotePreviewIcon;
+ComposerQuotePreview.Text = ComposerQuotePreviewText;
+ComposerQuotePreview.Dismiss = ComposerQuotePreviewDismiss;
+
+export {
+ QuoteBlock,
+ QuoteBlockRoot,
+ QuoteBlockIcon,
+ QuoteBlockText,
+ SelectionToolbar,
+ SelectionToolbarRoot,
+ SelectionToolbarQuote,
+ ComposerQuotePreview,
+ ComposerQuotePreviewRoot,
+ ComposerQuotePreviewIcon,
+ ComposerQuotePreviewText,
+ ComposerQuotePreviewDismiss,
+};
diff --git a/app/src/components/assistant-ui/thread-list.tsx b/app/src/components/assistant-ui/thread-list.tsx
new file mode 100644
index 0000000000..9c0d22e04c
--- /dev/null
+++ b/app/src/components/assistant-ui/thread-list.tsx
@@ -0,0 +1,400 @@
+"use client";
+
+import { Button } from "@/components/assistant-ui/ui/button";
+import { Input } from "@/components/assistant-ui/ui/input";
+import { Skeleton } from "@/components/assistant-ui/ui/skeleton";
+import { cn } from "@/components/assistant-ui/lib/utils";
+import {
+ AuiIf,
+ ThreadListItemMorePrimitive,
+ ThreadListItemPrimitive,
+ ThreadListPrimitive,
+ useAui,
+ useAuiState,
+} from "@assistant-ui/react";
+import {
+ ArchiveIcon,
+ Loader2Icon,
+ MoreHorizontalIcon,
+ PencilIcon,
+ PlusIcon,
+ SearchIcon,
+ TrashIcon,
+} from "lucide-react";
+import {
+ forwardRef,
+ Fragment,
+ useEffect,
+ useMemo,
+ useRef,
+ useState,
+ type ComponentPropsWithoutRef,
+ type FC,
+} from "react";
+
+export const ThreadList: FC = () => {
+ const [search, setSearch] = useState("");
+ const hasThreads = useAuiState((s) => s.threads.threadIds.length > 0);
+
+ return (
+ <ThreadListRoot>
+ <ThreadListNew />
+ {hasThreads && (
+ <ThreadListSearch value={search} onValueChange={setSearch} />
+ )}
+ <ThreadListItems searchQuery={hasThreads ? search : ""} />
+ </ThreadListRoot>
+ );
+};
+
+export const ThreadListSearch = forwardRef<
+ HTMLInputElement,
+ Omit<ComponentPropsWithoutRef<typeof Input>, "value" | "onChange"> & {
+ value: string;
+ onValueChange: (value: string) => void;
+ }
+>(({ className, value, onValueChange, ...props }, ref) => {
+ return (
+ <div data-slot="aui_thread-list-search" className="relative px-0.5 py-1">
+ <SearchIcon
+ data-slot="aui_thread-list-search-icon"
+ className="text-muted-foreground pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2"
+ />
+ <Input
+ ref={ref}
+ type="search"
+ value={value}
+ onChange={(event) => onValueChange(event.target.value)}
+ aria-label="Search threads"
+ placeholder="Search threads"
+ className={cn("h-8 ps-8 text-sm", className)}
+ {...props}
+ />
+ </div>
+ );
+});
+
+ThreadListSearch.displayName = "ThreadListSearch";
+
+export const ThreadListRoot: FC<
+ ComponentPropsWithoutRef<typeof ThreadListPrimitive.Root>
+> = ({ className, ...props }) => {
+ return (
+ <ThreadListPrimitive.Root
+ data-slot="aui_thread-list-root"
+ className={cn("flex flex-col gap-0.5", className)}
+ {...props}
+ />
+ );
+};
+
+export const ThreadListItems: FC<
+ ComponentPropsWithoutRef<"div"> & { searchQuery?: string }
+> = ({ className, searchQuery = "", ...props }) => {
+ return (
+ <div
+ data-slot="aui_thread-list-items"
+ className={cn("flex flex-col gap-0.5", className)}
+ {...props}
+ >
+ <AuiIf condition={(s) => s.threads.isLoading}>
+ <ThreadListSkeleton />
+ </AuiIf>
+ <AuiIf condition={(s) => !s.threads.isLoading}>
+ <ThreadListItemGroups searchQuery={searchQuery} />
+ </AuiIf>
+ </div>
+ );
+};
+
+const DAY_IN_MS = 86_400_000;
+
+const dateGroupLabel = (
+ date: Date | undefined,
+ startOfToday: number,
+): string => {
+ if (!date || date.getTime() >= startOfToday) return "Today";
+ if (date.getTime() >= startOfToday - DAY_IN_MS) return "Yesterday";
+ return "Earlier";
+};
+
+type ThreadListGroup = { label: string; indices: number[] };
+
+const ThreadListItemGroups: FC<{ searchQuery?: string }> = ({
+ searchQuery = "",
+}) => {
+ const threadIds = useAuiState((s) => s.threads.threadIds);
+ const threadItems = useAuiState((s) => s.threads.threadItems);
+
+ const query = searchQuery.trim().toLowerCase();
+
+ const { filteredIndices, groups } = useMemo(() => {
+ const itemsById = new Map(threadItems.map((item) => [item.id, item]));
+ const dates = threadIds.map((id) => itemsById.get(id)?.lastMessageAt);
+ const filteredIndices = threadIds
+ .map((id, index) => ({ id, index }))
+ .filter(
+ ({ id }) =>
+ !query ||
+ (itemsById.get(id)?.title || "New Chat")
+ .toLowerCase()
+ .includes(query),
+ )
+ .map(({ index }) => index);
+ if (!filteredIndices.some((index) => dates[index])) {
+ return { filteredIndices, groups: null };
+ }
+
+ const now = new Date();
+ const startOfToday = new Date(
+ now.getFullYear(),
+ now.getMonth(),
+ now.getDate(),
+ ).getTime();
+ const time = (index: number) =>
+ dates[index]?.getTime() ?? Number.MAX_SAFE_INTEGER;
+ const sorted = [...filteredIndices].sort((a, b) => time(b) - time(a));
+
+ const result: ThreadListGroup[] = [];
+ for (const index of sorted) {
+ const label = dateGroupLabel(dates[index], startOfToday);
+ const lastGroup = result[result.length - 1];
+ if (lastGroup?.label === label) {
+ lastGroup.indices.push(index);
+ } else {
+ result.push({ label, indices: [index] });
+ }
+ }
+ return { filteredIndices, groups: result };
+ }, [threadIds, threadItems, query]);
+
+ if (query && filteredIndices.length === 0) {
+ return (
+ <div
+ data-slot="aui_thread-list-empty"
+ className="text-muted-foreground px-2.5 py-4 text-sm"
+ >
+ No threads found
+ </div>
+ );
+ }
+
+ if (!groups) {
+ return filteredIndices.map((index) => (
+ <ThreadListPrimitive.ItemByIndex
+ key={threadIds[index]}
+ index={index}
+ components={{ ThreadListItem }}
+ />
+ ));
+ }
+
+ return groups.map((group) => (
+ <Fragment key={group.label}>
+ <div
+ data-slot="aui_thread-list-group-label"
+ className="text-muted-foreground px-2.5 pt-3 pb-1 text-xs font-medium"
+ >
+ {group.label}
+ </div>
+ {group.indices.map((index) => (
+ <ThreadListPrimitive.ItemByIndex
+ key={threadIds[index]}
+ index={index}
+ components={{ ThreadListItem }}
+ />
+ ))}
+ </Fragment>
+ ));
+};
+
+export const ThreadListNew = forwardRef<
+ HTMLButtonElement,
+ ComponentPropsWithoutRef<typeof Button> & { labelClassName?: string }
+>(({ className, labelClassName, children, ...props }, ref) => {
+ return (
+ <ThreadListPrimitive.New render={<Button ref={ref} variant="ghost" data-slot="aui_thread-list-new" className={cn(
+ "hover:bg-muted data-active:bg-muted h-8 justify-start gap-2 rounded-md px-2.5 text-sm font-normal",
+ className,
+ )} {...props} />}>{children ?? (
+ <>
+ <PlusIcon
+ data-slot="aui_thread-list-new-icon"
+ className="size-4 shrink-0"
+ />
+ <span
+ data-slot="aui_thread-list-new-label"
+ className={cn("whitespace-nowrap", labelClassName)}
+ >
+ New Thread
+ </span>
+ </>
+ )}</ThreadListPrimitive.New>
+ );
+});
+
+ThreadListNew.displayName = "ThreadListNew";
+
+const ThreadListSkeleton: FC = () => {
+ return (
+ <div className="flex flex-col gap-0.5">
+ {Array.from({ length: 5 }, (_, i) => (
+ <div
+ key={i}
+ role="status"
+ aria-label="Loading threads"
+ data-slot="aui_thread-list-skeleton-wrapper"
+ className="flex h-8 items-center px-2.5"
+ >
+ <Skeleton
+ data-slot="aui_thread-list-skeleton"
+ className="h-3.5 w-full"
+ />
+ </div>
+ ))}
+ </div>
+ );
+};
+
+export const ThreadListItem: FC = () => {
+ const isRunning = useAuiState((s) => s.threadListItem.isRunning);
+ const [isRenaming, setIsRenaming] = useState(false);
+ const triggerRef = useRef<HTMLButtonElement>(null);
+ const restoreFocusRef = useRef(false);
+
+ useEffect(() => {
+ if (isRenaming || !restoreFocusRef.current) return;
+ restoreFocusRef.current = false;
+ triggerRef.current?.focus();
+ }, [isRenaming]);
+
+ return (
+ <ThreadListItemPrimitive.Root
+ data-slot="aui_thread-list-item"
+ className="group hover:bg-muted focus-visible:bg-muted data-active:bg-muted has-focus-visible:bg-muted has-data-[state=open]:bg-muted relative flex h-8 items-center rounded-md transition-colors focus-visible:outline-none"
+ >
+ {isRenaming ? (
+ <ThreadListItemRename
+ onDone={(restoreFocus) => {
+ restoreFocusRef.current = restoreFocus;
+ setIsRenaming(false);
+ }}
+ />
+ ) : (
+ <ThreadListItemPrimitive.Trigger
+ ref={triggerRef}
+ data-slot="aui_thread-list-item-trigger"
+ className="focus-visible:ring-ring/50 flex h-full min-w-0 flex-1 items-center rounded-md px-2.5 text-start text-sm outline-none group-hover:pe-9 group-has-focus-visible:pe-9 group-has-data-[state=open]:pe-9 group-data-active:pe-9 focus-visible:ring-1"
+ >
+ {isRunning && (
+ <Loader2Icon
+ aria-hidden
+ data-slot="aui_thread-list-item-running"
+ className="text-muted-foreground me-1.5 size-3.5 shrink-0 animate-spin"
+ />
+ )}
+ <span
+ data-slot="aui_thread-list-item-title"
+ className="min-w-0 flex-1 truncate"
+ >
+ <ThreadListItemPrimitive.Title fallback="New Chat" />
+ </span>
+ {isRunning && <span className="sr-only">Running</span>}
+ </ThreadListItemPrimitive.Trigger>
+ )}
+ <ThreadListItemMore onRename={() => setIsRenaming(true)} />
+ </ThreadListItemPrimitive.Root>
+ );
+};
+
+const ThreadListItemRename: FC<{
+ onDone: (restoreFocus: boolean) => void;
+}> = ({ onDone }) => {
+ const aui = useAui();
+ const title = useAuiState((s) => s.threadListItem.title) ?? "";
+ const [value, setValue] = useState(title);
+ const inputRef = useRef<HTMLInputElement>(null);
+ const settledRef = useRef(false);
+
+ useEffect(() => {
+ inputRef.current?.select();
+ }, []);
+
+ const commit = (restoreFocus: boolean) => {
+ if (settledRef.current) return;
+ settledRef.current = true;
+
+ const next = value.trim();
+ if (!next || next === title) {
+ onDone(restoreFocus);
+ return;
+ }
+
+ // Deferred so a synchronous throw lands on the rejection path too.
+ Promise.resolve()
+ .then(() => aui.threadListItem.rename(next))
+ .then(
+ () => onDone(restoreFocus),
+ () => {
+ settledRef.current = false;
+ if (restoreFocus) inputRef.current?.focus();
+ },
+ );
+ };
+
+ const cancel = () => {
+ if (settledRef.current) return;
+ settledRef.current = true;
+ onDone(true);
+ };
+
+ return (
+ <Input
+ ref={inputRef}
+ autoFocus
+ data-slot="aui_thread-list-item-rename"
+ aria-label="Rename thread"
+ value={value}
+ className="h-7 min-w-0 flex-1 ps-2.5 pe-9 text-sm"
+ onChange={(event) => setValue(event.target.value)}
+ onBlur={() => commit(false)}
+ onKeyDown={(event) => {
+ if (event.key === "Enter") {
+ event.preventDefault();
+ commit(true);
+ } else if (event.key === "Escape") {
+ event.preventDefault();
+ cancel();
+ }
+ }}
+ />
+ );
+};
+
+const ThreadListItemMore: FC<{ onRename: () => void }> = ({ onRename }) => {
+ return (
+ <ThreadListItemMorePrimitive.Root sharedFocusGroup>
+ <ThreadListItemMorePrimitive.Trigger render={<Button variant="ghost" size="icon" data-slot="aui_thread-list-item-more" className="data-[state=open]:bg-accent absolute end-1.5 top-1/2 size-6 -translate-y-1/2 p-0 opacity-0 group-hover:opacity-100 group-has-focus-visible:opacity-100 group-data-active:opacity-100 data-[state=open]:opacity-100" />}><MoreHorizontalIcon className="size-3.5" /><span className="sr-only">More options</span></ThreadListItemMorePrimitive.Trigger>
+ <ThreadListItemMorePrimitive.Content
+ side="right"
+ align="start"
+ sideOffset={6}
+ data-slot="aui_thread-list-item-more-content"
+ className="bg-popover text-popover-foreground data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out 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 z-50 min-w-32 overflow-hidden rounded-xl border p-1.5"
+ >
+ <ThreadListItemMorePrimitive.Item
+ data-slot="aui_thread-list-item-more-item"
+ className="hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm outline-none select-none"
+ onSelect={onRename}
+ >
+ <PencilIcon className="size-4" />
+ Rename
+ </ThreadListItemMorePrimitive.Item>
+ <ThreadListItemPrimitive.Archive render={<ThreadListItemMorePrimitive.Item data-slot="aui_thread-list-item-more-item" className="hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm outline-none select-none" />}><ArchiveIcon className="size-4" />Archive
+ </ThreadListItemPrimitive.Archive>
+ <ThreadListItemPrimitive.Delete render={<ThreadListItemMorePrimitive.Item data-slot="aui_thread-list-item-more-item" className="text-destructive hover:bg-destructive/10 hover:text-destructive focus:bg-destructive/10 focus:text-destructive flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 text-sm outline-none select-none" />}><TrashIcon className="size-4" />Delete
+ </ThreadListItemPrimitive.Delete>
+ </ThreadListItemMorePrimitive.Content>
+ </ThreadListItemMorePrimitive.Root>
+ );
+};
diff --git a/app/src/components/assistant-ui/tooltip-icon-button.tsx b/app/src/components/assistant-ui/tooltip-icon-button.tsx
index 2f10fd7ed7..551326449d 100644
--- a/app/src/components/assistant-ui/tooltip-icon-button.tsx
+++ b/app/src/components/assistant-ui/tooltip-icon-button.tsx
@@ -1,7 +1,6 @@
"use client";
import { type ComponentPropsWithRef, forwardRef } from "react";
-import { Slot } from "radix-ui";
import {
Tooltip,
@@ -22,22 +21,24 @@ export const TooltipIconButton = forwardRef<
TooltipIconButtonProps
>(({ children, tooltip, side = "bottom", className, ...rest }, ref) => {
return (
- <TooltipProvider delayDuration={0}>
+ <TooltipProvider>
<Tooltip>
- <TooltipTrigger asChild>
- <Button
- variant="ghost"
- size="icon"
- {...rest}
- className={cn(
- "aui-button-icon size-6 p-1 active:scale-90",
- className,
- )}
- ref={ref}
- >
- <Slot.Slottable>{children}</Slot.Slottable>
- <span className="aui-sr-only sr-only">{tooltip}</span>
- </Button>
+ <TooltipTrigger
+ render={
+ <Button
+ variant="ghost"
+ size="icon"
+ {...rest}
+ className={cn(
+ "aui-button-icon size-6 p-1 active:scale-90",
+ className,
+ )}
+ ref={ref}
+ />
+ }
+ >
+ {children}
+ <span className="aui-sr-only sr-only">{tooltip}</span>
</TooltipTrigger>
<TooltipContent side={side}>{tooltip}</TooltipContent>
</Tooltip>
diff --git a/app/src/components/assistant-ui/ui/button.tsx b/app/src/components/assistant-ui/ui/button.tsx
index 95c397cad4..fce64c57f2 100644
--- a/app/src/components/assistant-ui/ui/button.tsx
+++ b/app/src/components/assistant-ui/ui/button.tsx
@@ -1,30 +1,36 @@
-import * as React from "react"
-import { Slot } from "@radix-ui/react-slot"
+import { Button as ButtonPrimitive } from "@base-ui/react/button"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/components/assistant-ui/lib/utils"
const buttonVariants = cva(
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
+ "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
{
variants: {
variant: {
- default:
- "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",
- destructive:
- "bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
outline:
- "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",
+ "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
secondary:
- "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
- ghost: "hover:bg-accent hover:text-accent-foreground",
+ "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
+ ghost:
+ "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
+ destructive:
+ "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
- default: "h-9 px-4 py-2",
- sm: "h-8 rounded-md px-3 text-xs",
- lg: "h-10 rounded-md px-8",
- icon: "h-9 w-9",
+ default:
+ "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
+ lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
+ icon: "size-8",
+ "icon-xs":
+ "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
+ "icon-sm":
+ "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
+ "icon-lg": "size-9",
},
},
defaultVariants: {
@@ -34,24 +40,19 @@ const buttonVariants = cva(
}
)
-export interface ButtonProps
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
- VariantProps<typeof buttonVariants> {
- asChild?: boolean
+function Button({
+ className,
+ variant = "default",
+ size = "default",
+ ...props
+}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
+ return (
+ <ButtonPrimitive
+ data-slot="button"
+ className={cn(buttonVariants({ variant, size, className }))}
+ {...props}
+ />
+ )
}
-const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
- ({ className, variant, size, asChild = false, ...props }, ref) => {
- const Comp = asChild ? Slot : "button"
- return (
- <Comp
- className={cn(buttonVariants({ variant, size, className }))}
- ref={ref}
- {...props}
- />
- )
- }
-)
-Button.displayName = "Button"
-
export { Button, buttonVariants }
diff --git a/app/src/components/assistant-ui/ui/command.tsx b/app/src/components/assistant-ui/ui/command.tsx
new file mode 100644
index 0000000000..3d277dc006
--- /dev/null
+++ b/app/src/components/assistant-ui/ui/command.tsx
@@ -0,0 +1,194 @@
+import * as React from "react"
+import { Command as CommandPrimitive } from "cmdk"
+
+import { cn } from "@/components/assistant-ui/lib/utils"
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogHeader,
+ DialogTitle,
+} from "@/components/assistant-ui/ui/dialog"
+import {
+ InputGroup,
+ InputGroupAddon,
+} from "@/components/assistant-ui/ui/input-group"
+import { SearchIcon, CheckIcon } from "lucide-react"
+
+function Command({
+ className,
+ ...props
+}: React.ComponentProps<typeof CommandPrimitive>) {
+ return (
+ <CommandPrimitive
+ data-slot="command"
+ className={cn(
+ "flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function CommandDialog({
+ title = "Command Palette",
+ description = "Search for a command to run...",
+ children,
+ className,
+ showCloseButton = false,
+ ...props
+}: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
+ title?: string
+ description?: string
+ className?: string
+ showCloseButton?: boolean
+ children: React.ReactNode
+}) {
+ return (
+ <Dialog {...props}>
+ <DialogHeader className="sr-only">
+ <DialogTitle>{title}</DialogTitle>
+ <DialogDescription>{description}</DialogDescription>
+ </DialogHeader>
+ <DialogContent
+ className={cn(
+ "top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0",
+ className
+ )}
+ showCloseButton={showCloseButton}
+ >
+ {children}
+ </DialogContent>
+ </Dialog>
+ )
+}
+
+function CommandInput({
+ className,
+ ...props
+}: React.ComponentProps<typeof CommandPrimitive.Input>) {
+ return (
+ <div data-slot="command-input-wrapper" className="p-1 pb-0">
+ <InputGroup className="h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!">
+ <CommandPrimitive.Input
+ data-slot="command-input"
+ className={cn(
+ "w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
+ className
+ )}
+ {...props}
+ />
+ <InputGroupAddon>
+ <SearchIcon className="size-4 shrink-0 opacity-50" />
+ </InputGroupAddon>
+ </InputGroup>
+ </div>
+ )
+}
+
+function CommandList({
+ className,
+ ...props
+}: React.ComponentProps<typeof CommandPrimitive.List>) {
+ return (
+ <CommandPrimitive.List
+ data-slot="command-list"
+ className={cn(
+ "no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function CommandEmpty({
+ className,
+ ...props
+}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
+ return (
+ <CommandPrimitive.Empty
+ data-slot="command-empty"
+ className={cn("py-6 text-center text-sm", className)}
+ {...props}
+ />
+ )
+}
+
+function CommandGroup({
+ className,
+ ...props
+}: React.ComponentProps<typeof CommandPrimitive.Group>) {
+ return (
+ <CommandPrimitive.Group
+ data-slot="command-group"
+ className={cn(
+ "overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function CommandSeparator({
+ className,
+ ...props
+}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
+ return (
+ <CommandPrimitive.Separator
+ data-slot="command-separator"
+ className={cn("-mx-1 h-px bg-border", className)}
+ {...props}
+ />
+ )
+}
+
+function CommandItem({
+ className,
+ children,
+ ...props
+}: React.ComponentProps<typeof CommandPrimitive.Item>) {
+ return (
+ <CommandPrimitive.Item
+ data-slot="command-item"
+ className={cn(
+ "group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <CheckIcon className="ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
+ </CommandPrimitive.Item>
+ )
+}
+
+function CommandShortcut({
+ className,
+ ...props
+}: React.ComponentProps<"span">) {
+ return (
+ <span
+ data-slot="command-shortcut"
+ className={cn(
+ "ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export {
+ Command,
+ CommandDialog,
+ CommandInput,
+ CommandList,
+ CommandEmpty,
+ CommandGroup,
+ CommandItem,
+ CommandShortcut,
+ CommandSeparator,
+}
diff --git a/app/src/components/assistant-ui/ui/dialog.tsx b/app/src/components/assistant-ui/ui/dialog.tsx
index 5a5f3b99b2..e8b1c803a2 100644
--- a/app/src/components/assistant-ui/ui/dialog.tsx
+++ b/app/src/components/assistant-ui/ui/dialog.tsx
@@ -1,120 +1,158 @@
import * as React from "react"
-import * as DialogPrimitive from "@radix-ui/react-dialog"
-import { X } from "lucide-react"
+import { Dialog as DialogPrimitive } from "@base-ui/react/dialog"
import { cn } from "@/components/assistant-ui/lib/utils"
+import { Button } from "@/components/assistant-ui/ui/button"
+import { XIcon } from "lucide-react"
-const Dialog = DialogPrimitive.Root
-
-const DialogTrigger = DialogPrimitive.Trigger
+function Dialog({ ...props }: DialogPrimitive.Root.Props) {
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />
+}
-const DialogPortal = DialogPrimitive.Portal
+function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
+}
-const DialogClose = DialogPrimitive.Close
+function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
+}
-const DialogOverlay = React.forwardRef<
- React.ElementRef<typeof DialogPrimitive.Overlay>,
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
->(({ className, ...props }, ref) => (
- <DialogPrimitive.Overlay
- ref={ref}
- className={cn(
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
- className
- )}
- {...props}
- />
-))
-DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
+function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
+}
-const DialogContent = React.forwardRef<
- React.ElementRef<typeof DialogPrimitive.Content>,
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
->(({ className, children, ...props }, ref) => (
- <DialogPortal>
- <DialogOverlay />
- <DialogPrimitive.Content
- ref={ref}
+function DialogOverlay({
+ className,
+ ...props
+}: DialogPrimitive.Backdrop.Props) {
+ return (
+ <DialogPrimitive.Backdrop
+ data-slot="dialog-overlay"
className={cn(
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
+ "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
className
)}
{...props}
- >
- {children}
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
- <X className="h-4 w-4" />
- <span className="sr-only">Close</span>
- </DialogPrimitive.Close>
- </DialogPrimitive.Content>
- </DialogPortal>
-))
-DialogContent.displayName = DialogPrimitive.Content.displayName
+ />
+ )
+}
-const DialogHeader = ({
+function DialogContent({
className,
+ children,
+ showCloseButton = true,
...props
-}: React.HTMLAttributes<HTMLDivElement>) => (
- <div
- className={cn(
- "flex flex-col space-y-1.5 text-center sm:text-left",
- className
- )}
- {...props}
- />
-)
-DialogHeader.displayName = "DialogHeader"
+}: DialogPrimitive.Popup.Props & {
+ showCloseButton?: boolean
+}) {
+ return (
+ <DialogPortal>
+ <DialogOverlay />
+ <DialogPrimitive.Popup
+ data-slot="dialog-content"
+ className={cn(
+ "fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ {showCloseButton && (
+ <DialogPrimitive.Close
+ data-slot="dialog-close"
+ render={
+ <Button
+ variant="ghost"
+ className="absolute top-2 right-2"
+ size="icon-sm"
+ />
+ }
+ >
+ <XIcon
+ />
+ <span className="sr-only">Close</span>
+ </DialogPrimitive.Close>
+ )}
+ </DialogPrimitive.Popup>
+ </DialogPortal>
+ )
+}
-const DialogFooter = ({
+function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="dialog-header"
+ className={cn("flex flex-col gap-2", className)}
+ {...props}
+ />
+ )
+}
+
+function DialogFooter({
className,
+ showCloseButton = false,
+ children,
...props
-}: React.HTMLAttributes<HTMLDivElement>) => (
- <div
- className={cn(
- "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
- className
- )}
- {...props}
- />
-)
-DialogFooter.displayName = "DialogFooter"
+}: React.ComponentProps<"div"> & {
+ showCloseButton?: boolean
+}) {
+ return (
+ <div
+ data-slot="dialog-footer"
+ className={cn(
+ "-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ {showCloseButton && (
+ <DialogPrimitive.Close render={<Button variant="outline" />}>
+ Close
+ </DialogPrimitive.Close>
+ )}
+ </div>
+ )
+}
-const DialogTitle = React.forwardRef<
- React.ElementRef<typeof DialogPrimitive.Title>,
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
->(({ className, ...props }, ref) => (
- <DialogPrimitive.Title
- ref={ref}
- className={cn(
- "text-lg font-semibold leading-none tracking-tight",
- className
- )}
- {...props}
- />
-))
-DialogTitle.displayName = DialogPrimitive.Title.displayName
+function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
+ return (
+ <DialogPrimitive.Title
+ data-slot="dialog-title"
+ className={cn(
+ "font-heading text-base leading-none font-medium",
+ className
+ )}
+ {...props}
+ />
+ )
+}
-const DialogDescription = React.forwardRef<
- React.ElementRef<typeof DialogPrimitive.Description>,
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
->(({ className, ...props }, ref) => (
- <DialogPrimitive.Description
- ref={ref}
- className={cn("text-sm text-muted-foreground", className)}
- {...props}
- />
-))
-DialogDescription.displayName = DialogPrimitive.Description.displayName
+function DialogDescription({
+ className,
+ ...props
+}: DialogPrimitive.Description.Props) {
+ return (
+ <DialogPrimitive.Description
+ data-slot="dialog-description"
+ className={cn(
+ "text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
+ className
+ )}
+ {...props}
+ />
+ )
+}
export {
Dialog,
- DialogPortal,
- DialogOverlay,
- DialogTrigger,
DialogClose,
DialogContent,
- DialogHeader,
+ DialogDescription,
DialogFooter,
+ DialogHeader,
+ DialogOverlay,
+ DialogPortal,
DialogTitle,
- DialogDescription,
+ DialogTrigger,
}
diff --git a/app/src/components/assistant-ui/ui/input-group.tsx b/app/src/components/assistant-ui/ui/input-group.tsx
new file mode 100644
index 0000000000..743d4bb889
--- /dev/null
+++ b/app/src/components/assistant-ui/ui/input-group.tsx
@@ -0,0 +1,156 @@
+import * as React from "react"
+import { cva, type VariantProps } from "class-variance-authority"
+
+import { cn } from "@/components/assistant-ui/lib/utils"
+import { Button } from "@/components/assistant-ui/ui/button"
+import { Input } from "@/components/assistant-ui/ui/input"
+import { Textarea } from "@/components/assistant-ui/ui/textarea"
+
+function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="input-group"
+ role="group"
+ className={cn(
+ "group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+const inputGroupAddonVariants = cva(
+ "flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
+ {
+ variants: {
+ align: {
+ "inline-start":
+ "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
+ "inline-end":
+ "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
+ "block-start":
+ "order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
+ "block-end":
+ "order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2",
+ },
+ },
+ defaultVariants: {
+ align: "inline-start",
+ },
+ }
+)
+
+function InputGroupAddon({
+ className,
+ align = "inline-start",
+ ...props
+}: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
+ return (
+ <div
+ role="group"
+ data-slot="input-group-addon"
+ data-align={align}
+ className={cn(inputGroupAddonVariants({ align }), className)}
+ onClick={(e) => {
+ if ((e.target as HTMLElement).closest("button")) {
+ return
+ }
+ e.currentTarget.parentElement?.querySelector("input")?.focus()
+ }}
+ {...props}
+ />
+ )
+}
+
+const inputGroupButtonVariants = cva(
+ "flex items-center gap-2 text-sm shadow-none",
+ {
+ variants: {
+ size: {
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
+ sm: "",
+ "icon-xs":
+ "size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0",
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0",
+ },
+ },
+ defaultVariants: {
+ size: "xs",
+ },
+ }
+)
+
+function InputGroupButton({
+ className,
+ type = "button",
+ variant = "ghost",
+ size = "xs",
+ ...props
+}: Omit<React.ComponentProps<typeof Button>, "size" | "type"> &
+ VariantProps<typeof inputGroupButtonVariants> & {
+ type?: "button" | "submit" | "reset"
+ }) {
+ return (
+ <Button
+ type={type}
+ data-size={size}
+ variant={variant}
+ className={cn(inputGroupButtonVariants({ size }), className)}
+ {...props}
+ />
+ )
+}
+
+function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
+ return (
+ <span
+ className={cn(
+ "flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function InputGroupInput({
+ className,
+ ...props
+}: React.ComponentProps<"input">) {
+ return (
+ <Input
+ data-slot="input-group-control"
+ className={cn(
+ "flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+function InputGroupTextarea({
+ className,
+ ...props
+}: React.ComponentProps<"textarea">) {
+ return (
+ <Textarea
+ data-slot="input-group-control"
+ className={cn(
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export {
+ InputGroup,
+ InputGroupAddon,
+ InputGroupButton,
+ InputGroupText,
+ InputGroupInput,
+ InputGroupTextarea,
+}
diff --git a/app/src/components/assistant-ui/ui/input.tsx b/app/src/components/assistant-ui/ui/input.tsx
new file mode 100644
index 0000000000..c0c03764e6
--- /dev/null
+++ b/app/src/components/assistant-ui/ui/input.tsx
@@ -0,0 +1,20 @@
+import * as React from "react"
+import { Input as InputPrimitive } from "@base-ui/react/input"
+
+import { cn } from "@/components/assistant-ui/lib/utils"
+
+function Input({ className, type, ...props }: React.ComponentProps<"input">) {
+ return (
+ <InputPrimitive
+ type={type}
+ data-slot="input"
+ className={cn(
+ "h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export { Input }
diff --git a/app/src/components/assistant-ui/ui/popover.tsx b/app/src/components/assistant-ui/ui/popover.tsx
new file mode 100644
index 0000000000..d3321c19f8
--- /dev/null
+++ b/app/src/components/assistant-ui/ui/popover.tsx
@@ -0,0 +1,88 @@
+import * as React from "react"
+import { Popover as PopoverPrimitive } from "@base-ui/react/popover"
+
+import { cn } from "@/components/assistant-ui/lib/utils"
+
+function Popover({ ...props }: PopoverPrimitive.Root.Props) {
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
+}
+
+function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props) {
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
+}
+
+function PopoverContent({
+ className,
+ align = "center",
+ alignOffset = 0,
+ side = "bottom",
+ sideOffset = 4,
+ ...props
+}: PopoverPrimitive.Popup.Props &
+ Pick<
+ PopoverPrimitive.Positioner.Props,
+ "align" | "alignOffset" | "side" | "sideOffset"
+ >) {
+ return (
+ <PopoverPrimitive.Portal>
+ <PopoverPrimitive.Positioner
+ align={align}
+ alignOffset={alignOffset}
+ side={side}
+ sideOffset={sideOffset}
+ className="isolate z-50"
+ >
+ <PopoverPrimitive.Popup
+ data-slot="popover-content"
+ className={cn(
+ "z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
+ className
+ )}
+ {...props}
+ />
+ </PopoverPrimitive.Positioner>
+ </PopoverPrimitive.Portal>
+ )
+}
+
+function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
+ return (
+ <div
+ data-slot="popover-header"
+ className={cn("flex flex-col gap-0.5 text-sm", className)}
+ {...props}
+ />
+ )
+}
+
+function PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {
+ return (
+ <PopoverPrimitive.Title
+ data-slot="popover-title"
+ className={cn("font-medium", className)}
+ {...props}
+ />
+ )
+}
+
+function PopoverDescription({
+ className,
+ ...props
+}: PopoverPrimitive.Description.Props) {
+ return (
+ <PopoverPrimitive.Description
+ data-slot="popover-description"
+ className={cn("text-muted-foreground", className)}
+ {...props}
+ />
+ )
+}
+
+export {
+ Popover,
+ PopoverContent,
+ PopoverDescription,
+ PopoverHeader,
+ PopoverTitle,
+ PopoverTrigger,
+}
diff --git a/app/src/components/assistant-ui/ui/skeleton.tsx b/app/src/components/assistant-ui/ui/skeleton.tsx
index 240182e8f7..8d44c8e9df 100644
--- a/app/src/components/assistant-ui/ui/skeleton.tsx
+++ b/app/src/components/assistant-ui/ui/skeleton.tsx
@@ -1,12 +1,10 @@
import { cn } from "@/components/assistant-ui/lib/utils"
-function Skeleton({
- className,
- ...props
-}: React.HTMLAttributes<HTMLDivElement>) {
+function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
return (
<div
- className={cn("animate-pulse rounded-md bg-primary/10", className)}
+ data-slot="skeleton"
+ className={cn("animate-pulse rounded-md bg-muted", className)}
{...props}
/>
)
diff --git a/app/src/components/assistant-ui/ui/textarea.tsx b/app/src/components/assistant-ui/ui/textarea.tsx
new file mode 100644
index 0000000000..91a20395c4
--- /dev/null
+++ b/app/src/components/assistant-ui/ui/textarea.tsx
@@ -0,0 +1,18 @@
+import * as React from "react"
+
+import { cn } from "@/components/assistant-ui/lib/utils"
+
+function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
+ return (
+ <textarea
+ data-slot="textarea"
+ className={cn(
+ "flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
+ className
+ )}
+ {...props}
+ />
+ )
+}
+
+export { Textarea }
diff --git a/app/src/components/assistant-ui/ui/tooltip.tsx b/app/src/components/assistant-ui/ui/tooltip.tsx
index 0cc0b6dde1..f8dd437185 100644
--- a/app/src/components/assistant-ui/ui/tooltip.tsx
+++ b/app/src/components/assistant-ui/ui/tooltip.tsx
@@ -1,32 +1,64 @@
-"use client"
-
-import * as React from "react"
-import * as TooltipPrimitive from "@radix-ui/react-tooltip"
+import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip"
import { cn } from "@/components/assistant-ui/lib/utils"
-const TooltipProvider = TooltipPrimitive.Provider
+function TooltipProvider({
+ delay = 0,
+ ...props
+}: TooltipPrimitive.Provider.Props) {
+ return (
+ <TooltipPrimitive.Provider
+ data-slot="tooltip-provider"
+ delay={delay}
+ {...props}
+ />
+ )
+}
-const Tooltip = TooltipPrimitive.Root
+function Tooltip({ ...props }: TooltipPrimitive.Root.Props) {
+ return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
+}
-const TooltipTrigger = TooltipPrimitive.Trigger
+function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props) {
+ return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
+}
-const TooltipContent = React.forwardRef<
- React.ElementRef<typeof TooltipPrimitive.Content>,
- React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
->(({ className, sideOffset = 4, ...props }, ref) => (
- <TooltipPrimitive.Portal>
- <TooltipPrimitive.Content
- ref={ref}
- sideOffset={sideOffset}
- className={cn(
- "z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 origin-(--radix-tooltip-content-transform-origin)",
- className
- )}
- {...props}
- />
- </TooltipPrimitive.Portal>
-))
-TooltipContent.displayName = TooltipPrimitive.Content.displayName
+function TooltipContent({
+ className,
+ side = "top",
+ sideOffset = 4,
+ align = "center",
+ alignOffset = 0,
+ children,
+ ...props
+}: TooltipPrimitive.Popup.Props &
+ Pick<
+ TooltipPrimitive.Positioner.Props,
+ "align" | "alignOffset" | "side" | "sideOffset"
+ >) {
+ return (
+ <TooltipPrimitive.Portal>
+ <TooltipPrimitive.Positioner
+ align={align}
+ alignOffset={alignOffset}
+ side={side}
+ sideOffset={sideOffset}
+ className="isolate z-50"
+ >
+ <TooltipPrimitive.Popup
+ data-slot="tooltip-content"
+ className={cn(
+ "z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
+ className
+ )}
+ {...props}
+ >
+ {children}
+ <TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" />
+ </TooltipPrimitive.Popup>
+ </TooltipPrimitive.Positioner>
+ </TooltipPrimitive.Portal>
+ )
+}
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 627181501f..798f7e5b4e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -36,6 +36,9 @@ importers:
'@assistant-ui/react-markdown':
specifier: ^0.14.12
+ '@base-ui/react':
+ specifier: ^1.7.0
'@elevenlabs/react':
specifier: ^1.12.0
version: 1.12.0(@types/[email protected])([email protected])
@@ -527,6 +530,33 @@ packages:
resolution: {integrity: sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==}
engines: {node: '>=6.9.0'}
+ '@base-ui/[email protected]':
+ resolution: {integrity: sha512-j+8QjX44C32jrXD/qyEAGpFr70FRpGL2CY61mQd9nBPWN737CK0xxD1ceJ055rW4RtdvFDT1e7otzdlfxvsYug==}
+ engines: {node: '>=14.0.0'}
+ peerDependencies:
+ '@date-fns/tz': ^1.2.0
+ '@types/react': ^17 || ^18 || ^19
+ date-fns: ^4.0.0
+ react: ^17 || ^18 || ^19
+ react-dom: ^17 || ^18 || ^19
+ peerDependenciesMeta:
+ '@date-fns/tz':
+ optional: true
+ '@types/react':
+ optional: true
+ date-fns:
+ optional: true
+
+ '@base-ui/[email protected]':
+ resolution: {integrity: sha512-oWy1aq/I2GmYjpl4PhEAhzflF8VPGKgZeq0xAWTbfD5KBWyxcN0ZP2+WHSUm/5Z6lVMBDLReLcoXwSYoRc/zNQ==}
+ peerDependencies:
+ '@types/react': ^17 || ^18 || ^19
+ react: ^17 || ^18 || ^19
+ react-dom: ^17 || ^18 || ^19
+ peerDependenciesMeta:
+ '@types/react':
+ optional: true
+
resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==}
engines: {node: '>=18'}
@@ -815,18 +845,33 @@ packages:
'@floating-ui/[email protected]':
resolution: {integrity: sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==}
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==}
+
'@floating-ui/[email protected]':
resolution: {integrity: sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==}
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==}
+
'@floating-ui/[email protected]':
resolution: {integrity: sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A==}
peerDependencies:
react: '>=16.8.0'
react-dom: '>=16.8.0'
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg==}
+ peerDependencies:
+ react: '>=16.8.0'
+ react-dom: '>=16.8.0'
+
'@floating-ui/[email protected]':
resolution: {integrity: sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==}
+ '@floating-ui/[email protected]':
+ resolution: {integrity: sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==}
+
'@gilbarbara/[email protected]':
resolution: {integrity: sha512-QF2BGeQjsa59T59XvFdR3is5jrl28Eg0J6giXAC5919bcqvR8XP4B+07tpbs6Y6/IQd4FBncaL2WVXIBgSxt4w==}
@@ -5871,6 +5916,9 @@ packages:
resolution: {integrity: sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==}
+ resolution: {integrity: sha512-XGoLeRAVzUTcJ1qkxPQhDJyIZ5d6zzZD9nT7AEZOaaU9UbWclhycElmhO+VD5bFeLuzhPBaOV2oXC8uG35ZSpg==}
+
resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==}
engines: {node: '>=4'}
@@ -7092,6 +7140,29 @@ snapshots:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.28.5
+ dependencies:
+ '@babel/runtime': 7.29.2
+ '@floating-ui/react-dom': 2.1.9([email protected]([email protected]))([email protected])
+ '@floating-ui/utils': 0.2.12
+ react: 19.2.5
+ react-dom: 19.2.5([email protected])
+ use-sync-external-store: 1.6.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.14
+
+ dependencies:
+ '@babel/runtime': 7.29.2
+ '@floating-ui/utils': 0.2.12
+ react: 19.2.5
+ react-dom: 19.2.5([email protected])
+ reselect: 5.3.0
+ use-sync-external-store: 1.6.0([email protected])
+ optionalDependencies:
+ '@types/react': 19.2.14
+
'@bcoe/[email protected]': {}
'@bramus/[email protected]':
@@ -7305,19 +7376,36 @@ snapshots:
dependencies:
'@floating-ui/utils': 0.2.11
+ '@floating-ui/[email protected]':
+ dependencies:
+ '@floating-ui/utils': 0.2.12
+
'@floating-ui/[email protected]':
dependencies:
'@floating-ui/core': 1.7.5
'@floating-ui/utils': 0.2.11
+ '@floating-ui/[email protected]':
+ dependencies:
+ '@floating-ui/core': 1.8.0
+ '@floating-ui/utils': 0.2.12
+
dependencies:
'@floating-ui/dom': 1.7.6
react: 19.2.5
react-dom: 19.2.5([email protected])
+ dependencies:
+ '@floating-ui/dom': 1.8.0
+ react: 19.2.5
+ react-dom: 19.2.5([email protected])
+
'@floating-ui/[email protected]': {}
+ '@floating-ui/[email protected]': {}
+
'@gilbarbara/[email protected]': {}
@@ -13167,6 +13255,8 @@ snapshots:
+