@usetheo/ui 0.8.0-next.0 → 0.9.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -3050,6 +3050,79 @@ interface CodeBlockProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"
3050
3050
  }
3051
3051
  declare const CodeBlock: react.ForwardRefExoticComponent<CodeBlockProps & react.RefAttributes<HTMLDivElement>>;
3052
3052
 
3053
+ /**
3054
+ * Alert — persistent inline notice. Distinct from `Toast` (transient,
3055
+ * corner-positioned, multiple stackable) and `EmptyState` (centered card
3056
+ * for no-data affordances). Full-width-of-section banner that stays
3057
+ * visible until the user acts.
3058
+ *
3059
+ * `intent` drives icon + color tokens. `destructive` intent renders
3060
+ * `role="alert"` for assertive screen-reader announcement; the other
3061
+ * three intents render `role="status"` (polite). `onDismiss`, when
3062
+ * provided, renders a trailing `X` button. `action` slot accepts any
3063
+ * ReactNode (typically a `<Button>` or anchor).
3064
+ *
3065
+ * @example
3066
+ * <Alert
3067
+ * intent="warning"
3068
+ * title="Verify your email"
3069
+ * description="We sent a link to your email."
3070
+ * action={<Button size="sm" onClick={resend}>Resend</Button>}
3071
+ * />
3072
+ */
3073
+ type AlertIntent = "info" | "success" | "warning" | "destructive";
3074
+ interface AlertProps extends Omit<HTMLAttributes<HTMLDivElement>, "title" | "role"> {
3075
+ intent?: AlertIntent;
3076
+ title?: ReactNode;
3077
+ description?: ReactNode;
3078
+ action?: ReactNode;
3079
+ onDismiss?: () => void;
3080
+ }
3081
+ declare const Alert: react.ForwardRefExoticComponent<AlertProps & react.RefAttributes<HTMLDivElement>>;
3082
+
3083
+ /**
3084
+ * Pagination — accessible page-number navigation primitive.
3085
+ *
3086
+ * Renders a `<nav aria-label="Pagination">` containing a button group:
3087
+ * `[<<] [<] 1 ... 5 6 [7] 8 9 ... 42 [>] [>>]`. The active page carries
3088
+ * `aria-current="page"`. Keyboard navigation (ArrowLeft / ArrowRight /
3089
+ * Home / End) is wired on the nav. Ellipses are rendered as
3090
+ * non-interactive `<span>` elements with `aria-hidden`.
3091
+ *
3092
+ * Renders nothing when `totalPages <= 1` (the page is the whole list).
3093
+ *
3094
+ * `siblingCount` controls how many neighbors of the current page are
3095
+ * always visible (default 1 → "5 6 [7] 8 9"). `showJumpButtons`
3096
+ * toggles the first/last `<<` / `>>` buttons.
3097
+ *
3098
+ * Consumers control state (`currentPage`) and are responsible for any
3099
+ * URL routing — the buttons are `<button>`, not `<a>`.
3100
+ *
3101
+ * @example
3102
+ * <Pagination
3103
+ * currentPage={page}
3104
+ * totalPages={42}
3105
+ * onPageChange={setPage}
3106
+ * />
3107
+ */
3108
+ interface PaginationProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
3109
+ currentPage: number;
3110
+ totalPages: number;
3111
+ onPageChange: (page: number) => void;
3112
+ /** Neighbors of current page that stay visible. Default 1. */
3113
+ siblingCount?: number;
3114
+ /** Render `<<` / `>>` first/last buttons. Default true. */
3115
+ showJumpButtons?: boolean;
3116
+ /** Size variant. Default md. */
3117
+ size?: "sm" | "md";
3118
+ }
3119
+ /**
3120
+ * Pure helper: compute the visible page-range with ellipses.
3121
+ * Exported for unit testing — most pagination bugs live here.
3122
+ */
3123
+ declare function computePageRange(currentPage: number, totalPages: number, siblingCount?: number): Array<number | "ellipsis-start" | "ellipsis-end">;
3124
+ declare const Pagination: react.ForwardRefExoticComponent<PaginationProps & react.RefAttributes<HTMLElement>>;
3125
+
3053
3126
  interface ProgressChecklistProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
3054
3127
  title?: ReactNode;
3055
3128
  steps: TaskStep[];
@@ -4116,4 +4189,4 @@ interface CommandPaletteProps {
4116
4189
  */
4117
4190
  declare function CommandPalette({ open, onOpenChange, items, onSelect, placeholder, emptyMessage, filter, }: CommandPaletteProps): react_jsx_runtime.JSX.Element;
4118
4191
 
4119
- export { ALL_MODES, AccountMenu, type AccountMenuProps, AgentComposer, type AgentDraft, AgentEditor, AgentErrorCard, type AgentErrorKind, AgentEvent, type AgentEvent$1 as AgentEventModel, type AgentEventStatus, type AgentEventType, AgentHandoff, AgentProfile, type AgentProfileDescriptor, AgentStartingState, AgentStream, type AgentStreamItem, AgentStreaming, AgentTimeline, ApprovalCard, type ApprovalSeverity, ArtifactPreview, type Attachment, AttachmentChip, type AuditActorKind, type AuditEntry, AuditLogEntry, type AuditSeverity, AutoCompactNotice, Avatar, BadgeWithDot as Badge, type BadgeProps, BrowserControls, BuildLogStream, Button, type ButtonProps, type Capability, CapabilityIndicator, type CapabilityState, Card, ChatComposer, ChatMessage, ChatMessageAction, type ChatMessageActionProps, ChatMessageActions, type ChatMessageActionsProps, ChatMessageBranch, ChatMessageBranchContent, type ChatMessageBranchContentProps, ChatMessageBranchNext, type ChatMessageBranchNextProps, ChatMessageBranchPage, type ChatMessageBranchPageProps, ChatMessageBranchPrevious, type ChatMessageBranchPreviousProps, type ChatMessageBranchProps, ChatMessageBranchSelector, type ChatMessageBranchSelectorProps, ChatMessageContent, type ChatMessageContentProps, type ChatMessageContentVariant, type ChatMessageProps, ChatMessageResponse, type ChatMessageResponseProps, ChatMessageRoot, type ChatMessageRootProps, ChatMessageToolbar, type ChatMessageToolbarProps, ChatThread, Checkbox, CodeBlock, type CodeBlockProps, type ColorScale, type CommandItem, CommandPalette, type ComposerMode, ConfirmDialog, type ConfirmDialogProps, ContextCard, ContextWindowBar, CopyButton, type CopyButtonProps, CostMeter, type CreatedFile, CreatedFilesCard, type CronJob, CronJobCard, type CronJobStatus, CronJobsList, type CustomContentUIPart, DangerZone, type DangerZoneActionProps, type DangerZoneProps, DataPart, type DataPartProps, type DataRenderer, type DataRendererMap, type DataUIPart, type DefineThemeInput, type Density, type DensityContextValue, type Deployment, DeploymentRow, type DeploymentStatus, Dialog, type DiffHunk, type DiffLine, type DiffLineKind, DiffViewer, type Domain, DomainConfig, type DomainStatus, EmptyState, type EnvScope, type EnvVar, EnvVarEditor, FilePart, type FilePartProps, type FileUIPart, FolderContextCard, type FolderEntry, FolderSelector, FormField, HOOK_EVENTS, type HandoffParty, HookConfig, type HookEntry, type HookEvent, type HookEventEntry, HookEventLog, type HookEventResult, Input, type InputProps, type IntentOption, IntentSelector, Label, type Lane, LaneBoard, type LaneCard, type LaneState, type LogLevel, type LogLine, LoginSplit, type MCPServer, MCPServerCard, MCPServerList, type MCPServerStatus, MODE_LABEL, MemoryEditor, type MemoryLayer, type MemoryScope, type MentionItem, MentionMenu, type MentionTrigger, type MessageRole, type Metric, MetricsPanel, type Mode, type ModelCapabilityFlag, ModelCard, type ModelInfo, type ModelOption, ModelSelector, type PartRendererMap, type PermissionDecision, type PermissionDecisionKind, PermissionMatrix, PermissionModal, type PermissionOperation, type PermissionRequest, type PermissionRule, PlanBadge, type PlanBadgeProps, type PlanNode, type PlanNodeStatus, type PlanTier, type PreviewEnv, PreviewEnvCard, PreviewPanel, type PreviewService, Progress, ProgressChecklist, type ProgressProps, type Project, ProjectCard, type ProjectStatus, ProjectSwitcher, type ProviderMetadata, type QuickAction, QuickActionChips, RadioGroup, type RailStep, type ReasoningFileUIPart, ReasoningPart, type ReasoningPartProps, type ReasoningUIPart, type RecentFolder, RecentFoldersList, type RenderPartOptions, type RollbackTarget, RollbackUI, type Rule, RuleCard, RuleEditor, type RuleScope, type RuleState, RunStats, type RunningTaskItem, type RunningTaskStatus, RunningTasksPanel, ScrollArea, Select, SessionListItem, type SessionMode, type SessionRunStatus, type SessionStatus, type SessionSummary, SessionTimeline, Sheet, Sidebar, Skeleton, type Skill, SkillCard, SkillEditor, type SkillSource, type SkillState, SkillsList, SocialAuthRow, type SocialProvider, SourceDocumentPart, type SourceDocumentPartProps, type SourceDocumentUIPart, SourceUrlPart, type SourceUrlPartProps, type SourceUrlUIPart, StatTile, type StatTileProps, StatusDot, type StatusDotProps, type StatusKind, type StepStartUIPart, StepsRail, SubAgentDispatch, type SubAgentRun, type SubAgentState, Switch, SystemPromptEditor, Table, type TableCellProps, type TableHeaderCellProps, type TableProps, Tabs, TaskHeader, TaskNode, TaskPlan, type TaskSource, type TaskStatus, type TaskStep, type TaskStepStatus, type TerminalLine, TerminalPanel, TextPart, type TextPartProps, type TextUIPart, Textarea, type TextareaProps, type Theme, type ThemeFonts, type ThemeMode, ThemeProvider, ThemeScript, ThemeSwitcher, TheoUIProvider, type TheoUIProviderProps, Timestamp, type TimestampProps, Toast, type ToastVariant, Toaster, TokenUsageChart, type TokenUsagePoint, ToolCall, ToolCallCard, ToolCallPart, type ToolCallPartProps, type ToolCallStatus, type ToolEnablement, type ToolEntry, type ToolInvocationState, ToolResult, type ToolUIPart, ToolsList, TooltipWithStatics as Tooltip, TopNav, type UIMessage, type UIMessagePart, UsageMeter, type UsageMeterProps, type UsageMetric, anthropicStyle, auroraTerminal, avatarVariants, badgeVariants, builtinThemes, buttonVariants, capabilityPresets, classicPaper, cn, defineTheme, dracula, githubDark, hex, isCustomContentUIPart, isDataUIPart, isFileUIPart, isReasoningFileUIPart, isReasoningUIPart, isSourceDocumentUIPart, isSourceUrlUIPart, isStepStartUIPart, isTextUIPart, isToolUIPart, linearGlass, modelCapabilityPresets, oneDark, openaiStyle, renderPart, rgb, sheetVariants, useDensity, useTheme, useToast, vercelMono, violetForge };
4192
+ export { ALL_MODES, AccountMenu, type AccountMenuProps, AgentComposer, type AgentDraft, AgentEditor, AgentErrorCard, type AgentErrorKind, AgentEvent, type AgentEvent$1 as AgentEventModel, type AgentEventStatus, type AgentEventType, AgentHandoff, AgentProfile, type AgentProfileDescriptor, AgentStartingState, AgentStream, type AgentStreamItem, AgentStreaming, AgentTimeline, Alert, type AlertIntent, type AlertProps, ApprovalCard, type ApprovalSeverity, ArtifactPreview, type Attachment, AttachmentChip, type AuditActorKind, type AuditEntry, AuditLogEntry, type AuditSeverity, AutoCompactNotice, Avatar, BadgeWithDot as Badge, type BadgeProps, BrowserControls, BuildLogStream, Button, type ButtonProps, type Capability, CapabilityIndicator, type CapabilityState, Card, ChatComposer, ChatMessage, ChatMessageAction, type ChatMessageActionProps, ChatMessageActions, type ChatMessageActionsProps, ChatMessageBranch, ChatMessageBranchContent, type ChatMessageBranchContentProps, ChatMessageBranchNext, type ChatMessageBranchNextProps, ChatMessageBranchPage, type ChatMessageBranchPageProps, ChatMessageBranchPrevious, type ChatMessageBranchPreviousProps, type ChatMessageBranchProps, ChatMessageBranchSelector, type ChatMessageBranchSelectorProps, ChatMessageContent, type ChatMessageContentProps, type ChatMessageContentVariant, type ChatMessageProps, ChatMessageResponse, type ChatMessageResponseProps, ChatMessageRoot, type ChatMessageRootProps, ChatMessageToolbar, type ChatMessageToolbarProps, ChatThread, Checkbox, CodeBlock, type CodeBlockProps, type ColorScale, type CommandItem, CommandPalette, type ComposerMode, ConfirmDialog, type ConfirmDialogProps, ContextCard, ContextWindowBar, CopyButton, type CopyButtonProps, CostMeter, type CreatedFile, CreatedFilesCard, type CronJob, CronJobCard, type CronJobStatus, CronJobsList, type CustomContentUIPart, DangerZone, type DangerZoneActionProps, type DangerZoneProps, DataPart, type DataPartProps, type DataRenderer, type DataRendererMap, type DataUIPart, type DefineThemeInput, type Density, type DensityContextValue, type Deployment, DeploymentRow, type DeploymentStatus, Dialog, type DiffHunk, type DiffLine, type DiffLineKind, DiffViewer, type Domain, DomainConfig, type DomainStatus, EmptyState, type EnvScope, type EnvVar, EnvVarEditor, FilePart, type FilePartProps, type FileUIPart, FolderContextCard, type FolderEntry, FolderSelector, FormField, HOOK_EVENTS, type HandoffParty, HookConfig, type HookEntry, type HookEvent, type HookEventEntry, HookEventLog, type HookEventResult, Input, type InputProps, type IntentOption, IntentSelector, Label, type Lane, LaneBoard, type LaneCard, type LaneState, type LogLevel, type LogLine, LoginSplit, type MCPServer, MCPServerCard, MCPServerList, type MCPServerStatus, MODE_LABEL, MemoryEditor, type MemoryLayer, type MemoryScope, type MentionItem, MentionMenu, type MentionTrigger, type MessageRole, type Metric, MetricsPanel, type Mode, type ModelCapabilityFlag, ModelCard, type ModelInfo, type ModelOption, ModelSelector, Pagination, type PaginationProps, type PartRendererMap, type PermissionDecision, type PermissionDecisionKind, PermissionMatrix, PermissionModal, type PermissionOperation, type PermissionRequest, type PermissionRule, PlanBadge, type PlanBadgeProps, type PlanNode, type PlanNodeStatus, type PlanTier, type PreviewEnv, PreviewEnvCard, PreviewPanel, type PreviewService, Progress, ProgressChecklist, type ProgressProps, type Project, ProjectCard, type ProjectStatus, ProjectSwitcher, type ProviderMetadata, type QuickAction, QuickActionChips, RadioGroup, type RailStep, type ReasoningFileUIPart, ReasoningPart, type ReasoningPartProps, type ReasoningUIPart, type RecentFolder, RecentFoldersList, type RenderPartOptions, type RollbackTarget, RollbackUI, type Rule, RuleCard, RuleEditor, type RuleScope, type RuleState, RunStats, type RunningTaskItem, type RunningTaskStatus, RunningTasksPanel, ScrollArea, Select, SessionListItem, type SessionMode, type SessionRunStatus, type SessionStatus, type SessionSummary, SessionTimeline, Sheet, Sidebar, Skeleton, type Skill, SkillCard, SkillEditor, type SkillSource, type SkillState, SkillsList, SocialAuthRow, type SocialProvider, SourceDocumentPart, type SourceDocumentPartProps, type SourceDocumentUIPart, SourceUrlPart, type SourceUrlPartProps, type SourceUrlUIPart, StatTile, type StatTileProps, StatusDot, type StatusDotProps, type StatusKind, type StepStartUIPart, StepsRail, SubAgentDispatch, type SubAgentRun, type SubAgentState, Switch, SystemPromptEditor, Table, type TableCellProps, type TableHeaderCellProps, type TableProps, Tabs, TaskHeader, TaskNode, TaskPlan, type TaskSource, type TaskStatus, type TaskStep, type TaskStepStatus, type TerminalLine, TerminalPanel, TextPart, type TextPartProps, type TextUIPart, Textarea, type TextareaProps, type Theme, type ThemeFonts, type ThemeMode, ThemeProvider, ThemeScript, ThemeSwitcher, TheoUIProvider, type TheoUIProviderProps, Timestamp, type TimestampProps, Toast, type ToastVariant, Toaster, TokenUsageChart, type TokenUsagePoint, ToolCall, ToolCallCard, ToolCallPart, type ToolCallPartProps, type ToolCallStatus, type ToolEnablement, type ToolEntry, type ToolInvocationState, ToolResult, type ToolUIPart, ToolsList, TooltipWithStatics as Tooltip, TopNav, type UIMessage, type UIMessagePart, UsageMeter, type UsageMeterProps, type UsageMetric, anthropicStyle, auroraTerminal, avatarVariants, badgeVariants, builtinThemes, buttonVariants, capabilityPresets, classicPaper, cn, computePageRange, defineTheme, dracula, githubDark, hex, isCustomContentUIPart, isDataUIPart, isFileUIPart, isReasoningFileUIPart, isReasoningUIPart, isSourceDocumentUIPart, isSourceUrlUIPart, isStepStartUIPart, isTextUIPart, isToolUIPart, linearGlass, modelCapabilityPresets, oneDark, openaiStyle, renderPart, rgb, sheetVariants, useDensity, useTheme, useToast, vercelMono, violetForge };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { extendTailwindMerge } from 'tailwind-merge';
3
3
  import { createContext, forwardRef, useId, Children, isValidElement, cloneElement, useState, useMemo, Fragment as Fragment$1, memo, useContext, useEffect, useRef, useCallback, createElement } from 'react';
4
4
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
5
  import * as DropdownMenu2 from '@radix-ui/react-dropdown-menu';
6
- import { X, AlertCircle, ChevronDown, ChevronUp, Check, Minus, Circle, Settings2, Eye, Lock, Plus, Trash2, Users, User, BookOpen, Sparkles, Globe, Pencil, Coins, TrendingUp, TrendingDown, CircleX, CheckCircle2, Loader2, CircleDashed, RotateCcw, Folder, FolderOpen, Brain, Zap, ShieldAlert, Clock, Play, Square, Server, Plug, Wrench, CalendarDays, CornerDownRight, Bot, MessageSquare, ChevronRight, ArrowRight, AlertOctagon, Network, KeyRound, ShieldOff, Database, GitBranch, ChevronsUpDown, FileText, FileCode, FileSpreadsheet, FileImage, File, Hammer, ShieldCheck, Edit3, FilePlus, FileSearch, Terminal, AlertTriangle, CircleDot, FileEdit, Copy, ArrowUpRight, Cloud, RefreshCw, Maximize2, ArrowLeft, RotateCw, Search, Paperclip, Mic, Send, GitCommit, Activity, EyeOff, GitPullRequest, ExternalLink, ShieldX, ArrowDownLeft, TriangleAlert, Info, ShieldQuestion, BrainCircuitIcon, ImageIcon, FileIcon, ExternalLinkIcon, FileTextIcon, WrenchIcon, CodeIcon, ShieldIcon, AlertCircleIcon, CheckCircleIcon, LoaderIcon, Rocket, Image, Palette, Moon, Sun, ChevronLeftIcon, ChevronRightIcon, Hash, Slash, CheckIcon, CopyIcon } from 'lucide-react';
6
+ import { X, AlertCircle, ChevronDown, ChevronUp, Check, Minus, Circle, Settings2, Eye, Lock, Plus, Trash2, Users, User, BookOpen, Sparkles, Globe, Pencil, Coins, TrendingUp, TrendingDown, CircleX, CheckCircle2, Loader2, CircleDashed, RotateCcw, Folder, FolderOpen, Brain, Zap, ShieldAlert, Clock, Play, Square, Server, Plug, Wrench, CalendarDays, CornerDownRight, Bot, MessageSquare, ChevronRight, ArrowRight, AlertOctagon, Network, KeyRound, ShieldOff, Database, GitBranch, ChevronsUpDown, FileText, FileCode, FileSpreadsheet, FileImage, File, Hammer, ShieldCheck, Edit3, FilePlus, FileSearch, Terminal, AlertTriangle, CircleDot, FileEdit, Copy, ArrowUpRight, TriangleAlert, Info, ChevronsLeft, ChevronLeft, ChevronsRight, Cloud, RefreshCw, Maximize2, ArrowLeft, RotateCw, Search, Paperclip, Mic, Send, GitCommit, Activity, EyeOff, GitPullRequest, ExternalLink, ShieldX, ArrowDownLeft, ShieldQuestion, BrainCircuitIcon, ImageIcon, FileIcon, ExternalLinkIcon, FileTextIcon, WrenchIcon, CodeIcon, ShieldIcon, AlertCircleIcon, CheckCircleIcon, LoaderIcon, Rocket, Image, Palette, Moon, Sun, ChevronLeftIcon, ChevronRightIcon, Hash, Slash, CheckIcon, CopyIcon } from 'lucide-react';
7
7
  import * as ToastPrimitive from '@radix-ui/react-toast';
8
8
  import { cva } from 'class-variance-authority';
9
9
  import { Slot } from '@radix-ui/react-slot';
@@ -5546,12 +5546,12 @@ async function sanitizeHast(tree) {
5546
5546
  return safe2.type === "root" ? safe2 : { type: "root", children: [safe2] };
5547
5547
  }
5548
5548
  async function hastToReact(tree, components) {
5549
- const { Fragment: Fragment19, jsx: jsx129, jsxs: jsxs104 } = await import('react/jsx-runtime');
5549
+ const { Fragment: Fragment19, jsx: jsx131, jsxs: jsxs106 } = await import('react/jsx-runtime');
5550
5550
  const { toJsxRuntime } = await import('hast-util-to-jsx-runtime');
5551
5551
  return toJsxRuntime(tree, {
5552
5552
  Fragment: Fragment19,
5553
- jsx: jsx129,
5554
- jsxs: jsxs104,
5553
+ jsx: jsx131,
5554
+ jsxs: jsxs106,
5555
5555
  components
5556
5556
  });
5557
5557
  }
@@ -7641,6 +7641,278 @@ var CodeBlock2 = forwardRef(
7641
7641
  }
7642
7642
  );
7643
7643
  CodeBlock2.displayName = "CodeBlock";
7644
+ var INTENT = {
7645
+ info: {
7646
+ icon: Info,
7647
+ border: "border-primary/30",
7648
+ bg: "bg-primary/[0.04]",
7649
+ iconColor: "text-primary"
7650
+ },
7651
+ success: {
7652
+ icon: CheckCircle2,
7653
+ border: "border-success/30",
7654
+ bg: "bg-success/[0.04]",
7655
+ iconColor: "text-success"
7656
+ },
7657
+ warning: {
7658
+ icon: TriangleAlert,
7659
+ border: "border-warning/30",
7660
+ bg: "bg-warning/[0.04]",
7661
+ iconColor: "text-warning"
7662
+ },
7663
+ destructive: {
7664
+ icon: AlertCircle,
7665
+ border: "border-destructive/30",
7666
+ bg: "bg-destructive/[0.04]",
7667
+ iconColor: "text-destructive"
7668
+ }
7669
+ };
7670
+ var Alert = forwardRef(
7671
+ ({ className, intent = "info", title, description, action, onDismiss, ...props }, ref) => {
7672
+ const config = INTENT[intent];
7673
+ const Icon2 = config.icon;
7674
+ const hasTitle = title !== void 0 && title !== null;
7675
+ const hasDescription = description !== void 0 && description !== null;
7676
+ const role = intent === "destructive" ? "alert" : "status";
7677
+ return /* @__PURE__ */ jsx(
7678
+ "div",
7679
+ {
7680
+ ref,
7681
+ role,
7682
+ className: cn(
7683
+ "rounded-lg border",
7684
+ config.border,
7685
+ config.bg,
7686
+ hasTitle && hasDescription ? "p-4" : "p-3",
7687
+ className
7688
+ ),
7689
+ ...props,
7690
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
7691
+ /* @__PURE__ */ jsx(Icon2, { "aria-hidden": "true", className: cn("mt-0.5 size-4 shrink-0", config.iconColor) }),
7692
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
7693
+ hasTitle ? /* @__PURE__ */ jsx("div", { className: "font-medium font-sans text-body-sm text-foreground", children: title }) : null,
7694
+ hasDescription ? /* @__PURE__ */ jsx(
7695
+ "div",
7696
+ {
7697
+ className: cn("font-sans text-body-sm text-muted-foreground", hasTitle && "mt-0.5"),
7698
+ children: description
7699
+ }
7700
+ ) : null
7701
+ ] }),
7702
+ action !== void 0 ? /* @__PURE__ */ jsx("div", { className: "ml-auto shrink-0", children: action }) : null,
7703
+ onDismiss !== void 0 ? /* @__PURE__ */ jsx(
7704
+ "button",
7705
+ {
7706
+ type: "button",
7707
+ onClick: onDismiss,
7708
+ "aria-label": "Dismiss",
7709
+ className: cn(
7710
+ "shrink-0 rounded p-0.5 text-muted-foreground transition-colors",
7711
+ "hover:text-foreground",
7712
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
7713
+ ),
7714
+ children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true", className: "size-4" })
7715
+ }
7716
+ ) : null
7717
+ ] })
7718
+ }
7719
+ );
7720
+ }
7721
+ );
7722
+ Alert.displayName = "Alert";
7723
+ function computePageRange(currentPage, totalPages, siblingCount = 1) {
7724
+ if (totalPages <= 1) return [];
7725
+ const totalNumbers = siblingCount * 2 + 3;
7726
+ const totalWithEdges = totalNumbers + 2;
7727
+ if (totalPages <= totalWithEdges) {
7728
+ return Array.from({ length: totalPages }, (_, i) => i + 1);
7729
+ }
7730
+ const leftSibling = Math.max(currentPage - siblingCount, 1);
7731
+ const rightSibling = Math.min(currentPage + siblingCount, totalPages);
7732
+ const showLeftEllipsis = leftSibling > 2;
7733
+ const showRightEllipsis = rightSibling < totalPages - 1;
7734
+ if (!showLeftEllipsis && showRightEllipsis) {
7735
+ const leftRangeEnd = 1 + (siblingCount * 2 + 2);
7736
+ const leftRange = Array.from({ length: leftRangeEnd }, (_, i) => i + 1);
7737
+ return [...leftRange, "ellipsis-end", totalPages];
7738
+ }
7739
+ if (showLeftEllipsis && !showRightEllipsis) {
7740
+ const rightStart = totalPages - (siblingCount * 2 + 2);
7741
+ const rightRange = Array.from(
7742
+ { length: totalPages - rightStart + 1 },
7743
+ (_, i) => rightStart + i
7744
+ );
7745
+ return [1, "ellipsis-start", ...rightRange];
7746
+ }
7747
+ const middleRange = Array.from(
7748
+ { length: rightSibling - leftSibling + 1 },
7749
+ (_, i) => leftSibling + i
7750
+ );
7751
+ return [1, "ellipsis-start", ...middleRange, "ellipsis-end", totalPages];
7752
+ }
7753
+ var SIZE3 = {
7754
+ sm: "size-7 text-label",
7755
+ md: "size-8 text-body-sm"
7756
+ };
7757
+ var ICON_SIZE = {
7758
+ sm: "size-3",
7759
+ md: "size-3.5"
7760
+ };
7761
+ var Pagination = forwardRef(
7762
+ ({
7763
+ className,
7764
+ currentPage,
7765
+ totalPages,
7766
+ onPageChange,
7767
+ siblingCount = 1,
7768
+ showJumpButtons = true,
7769
+ size = "md",
7770
+ ...props
7771
+ }, ref) => {
7772
+ if (totalPages <= 1) {
7773
+ return null;
7774
+ }
7775
+ const range = computePageRange(currentPage, totalPages, siblingCount);
7776
+ const prevDisabled = currentPage <= 1;
7777
+ const nextDisabled = currentPage >= totalPages;
7778
+ const sizeClass = SIZE3[size];
7779
+ const iconClass = ICON_SIZE[size];
7780
+ const buttonBase = cn(
7781
+ "inline-flex items-center justify-center rounded-md font-mono tabular-nums",
7782
+ "transition-colors",
7783
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
7784
+ sizeClass
7785
+ );
7786
+ function go(page) {
7787
+ const clamped = Math.max(1, Math.min(totalPages, page));
7788
+ if (clamped !== currentPage) onPageChange(clamped);
7789
+ }
7790
+ function handleKeyDown(e) {
7791
+ if (e.key === "ArrowLeft") {
7792
+ e.preventDefault();
7793
+ go(currentPage - 1);
7794
+ } else if (e.key === "ArrowRight") {
7795
+ e.preventDefault();
7796
+ go(currentPage + 1);
7797
+ } else if (e.key === "Home") {
7798
+ e.preventDefault();
7799
+ go(1);
7800
+ } else if (e.key === "End") {
7801
+ e.preventDefault();
7802
+ go(totalPages);
7803
+ }
7804
+ }
7805
+ return /* @__PURE__ */ jsxs(
7806
+ "nav",
7807
+ {
7808
+ ref,
7809
+ "aria-label": "Pagination",
7810
+ onKeyDown: handleKeyDown,
7811
+ className: cn("flex items-center gap-1", className),
7812
+ ...props,
7813
+ children: [
7814
+ showJumpButtons ? /* @__PURE__ */ jsx(
7815
+ "button",
7816
+ {
7817
+ type: "button",
7818
+ onClick: () => go(1),
7819
+ disabled: prevDisabled,
7820
+ "aria-label": "Go to first page",
7821
+ "aria-disabled": prevDisabled || void 0,
7822
+ className: cn(
7823
+ buttonBase,
7824
+ "text-foreground hover:bg-muted",
7825
+ prevDisabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
7826
+ ),
7827
+ children: /* @__PURE__ */ jsx(ChevronsLeft, { "aria-hidden": "true", className: iconClass })
7828
+ }
7829
+ ) : null,
7830
+ /* @__PURE__ */ jsx(
7831
+ "button",
7832
+ {
7833
+ type: "button",
7834
+ onClick: () => go(currentPage - 1),
7835
+ disabled: prevDisabled,
7836
+ "aria-label": "Go to previous page",
7837
+ "aria-disabled": prevDisabled || void 0,
7838
+ className: cn(
7839
+ buttonBase,
7840
+ "text-foreground hover:bg-muted",
7841
+ prevDisabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
7842
+ ),
7843
+ children: /* @__PURE__ */ jsx(ChevronLeft, { "aria-hidden": "true", className: iconClass })
7844
+ }
7845
+ ),
7846
+ range.map((item) => {
7847
+ if (item === "ellipsis-start" || item === "ellipsis-end") {
7848
+ return /* @__PURE__ */ jsx(
7849
+ "span",
7850
+ {
7851
+ "aria-hidden": "true",
7852
+ className: cn(
7853
+ "inline-flex items-center justify-center text-muted-foreground",
7854
+ sizeClass
7855
+ ),
7856
+ children: "\u2026"
7857
+ },
7858
+ item
7859
+ );
7860
+ }
7861
+ const isActive = item === currentPage;
7862
+ return /* @__PURE__ */ jsx(
7863
+ "button",
7864
+ {
7865
+ type: "button",
7866
+ onClick: () => go(item),
7867
+ "aria-label": `Go to page ${item}`,
7868
+ "aria-current": isActive ? "page" : void 0,
7869
+ className: cn(
7870
+ buttonBase,
7871
+ isActive ? "bg-primary text-primary-foreground hover:bg-primary" : "text-foreground hover:bg-muted"
7872
+ ),
7873
+ children: item
7874
+ },
7875
+ item
7876
+ );
7877
+ }),
7878
+ /* @__PURE__ */ jsx(
7879
+ "button",
7880
+ {
7881
+ type: "button",
7882
+ onClick: () => go(currentPage + 1),
7883
+ disabled: nextDisabled,
7884
+ "aria-label": "Go to next page",
7885
+ "aria-disabled": nextDisabled || void 0,
7886
+ className: cn(
7887
+ buttonBase,
7888
+ "text-foreground hover:bg-muted",
7889
+ nextDisabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
7890
+ ),
7891
+ children: /* @__PURE__ */ jsx(ChevronRight, { "aria-hidden": "true", className: iconClass })
7892
+ }
7893
+ ),
7894
+ showJumpButtons ? /* @__PURE__ */ jsx(
7895
+ "button",
7896
+ {
7897
+ type: "button",
7898
+ onClick: () => go(totalPages),
7899
+ disabled: nextDisabled,
7900
+ "aria-label": "Go to last page",
7901
+ "aria-disabled": nextDisabled || void 0,
7902
+ className: cn(
7903
+ buttonBase,
7904
+ "text-foreground hover:bg-muted",
7905
+ nextDisabled && "cursor-not-allowed opacity-40 hover:bg-transparent"
7906
+ ),
7907
+ children: /* @__PURE__ */ jsx(ChevronsRight, { "aria-hidden": "true", className: iconClass })
7908
+ }
7909
+ ) : null
7910
+ ]
7911
+ }
7912
+ );
7913
+ }
7914
+ );
7915
+ Pagination.displayName = "Pagination";
7644
7916
  var statusIcon2 = {
7645
7917
  pending: CircleDashed,
7646
7918
  running: Loader2,
@@ -10411,6 +10683,6 @@ function CommandPalette({
10411
10683
  ] }) });
10412
10684
  }
10413
10685
 
10414
- export { ALL_MODES, AccountMenu, AgentComposer, AgentEditor, AgentErrorCard, AgentEvent, AgentHandoff, AgentProfile, AgentStartingState, AgentStream, AgentStreaming, AgentTimeline, ApprovalCard, ArtifactPreview, AttachmentChip, AuditLogEntry, AutoCompactNotice, Avatar, BadgeWithDot as Badge, BrowserControls, BuildLogStream, Button, CapabilityIndicator, Card, ChatComposer, ChatMessage, ChatMessageAction, ChatMessageActions, ChatMessageBranch, ChatMessageBranchContent, ChatMessageBranchNext, ChatMessageBranchPage, ChatMessageBranchPrevious, ChatMessageBranchSelector, ChatMessageContent, ChatMessageResponse, ChatMessageRoot, ChatMessageToolbar, ChatThread, Checkbox, CodeBlock2 as CodeBlock, CommandPalette, ConfirmDialog, ContextCard, ContextWindowBar, CopyButton, CostMeter, CreatedFilesCard, CronJobCard, CronJobsList, DangerZone, DataPart, DeploymentRow, Dialog, DiffViewer, DomainConfig, EmptyState, EnvVarEditor, FilePart, FolderContextCard, FolderSelector, FormField, HOOK_EVENTS, HookConfig, HookEventLog, Input, IntentSelector, Label, LaneBoard, LoginSplit, MCPServerCard, MCPServerList, MODE_LABEL, MemoryEditor, MentionMenu, MetricsPanel, ModelCard, ModelSelector, PermissionMatrix, PermissionModal, PlanBadge, PreviewEnvCard, PreviewPanel, Progress, ProgressChecklist, ProjectCard, ProjectSwitcher, QuickActionChips, RadioGroup, ReasoningPart, RecentFoldersList, RollbackUI, RuleCard, RuleEditor, RunStats, RunningTasksPanel, ScrollArea, Select, SessionListItem, SessionTimeline, Sheet, Sidebar, Skeleton, SkillCard, SkillEditor, SkillsList, SocialAuthRow, SourceDocumentPart, SourceUrlPart, StatTile, StatusDot, StepsRail, SubAgentDispatch, Switch, SystemPromptEditor, Table, Tabs, TaskHeader, TaskNode, TaskPlan, TerminalPanel, TextPart, Textarea, ThemeProvider, ThemeScript, ThemeSwitcher, TheoUIProvider, Timestamp, Toast, Toaster, TokenUsageChart, ToolCall, ToolCallCard, ToolCallPart, ToolResult, ToolsList, TooltipWithStatics as Tooltip, TopNav, UsageMeter, anthropicStyle, auroraTerminal, avatarVariants, badgeVariants, builtinThemes, buttonVariants, capabilityPresets, classicPaper, cn, defineTheme, dracula, githubDark, hex, isCustomContentUIPart, isDataUIPart, isFileUIPart, isReasoningFileUIPart, isReasoningUIPart, isSourceDocumentUIPart, isSourceUrlUIPart, isStepStartUIPart, isTextUIPart, isToolUIPart, linearGlass, modelCapabilityPresets, oneDark, openaiStyle, renderPart, rgb, sheetVariants, useDensity, useTheme, useToast, vercelMono, violetForge };
10686
+ export { ALL_MODES, AccountMenu, AgentComposer, AgentEditor, AgentErrorCard, AgentEvent, AgentHandoff, AgentProfile, AgentStartingState, AgentStream, AgentStreaming, AgentTimeline, Alert, ApprovalCard, ArtifactPreview, AttachmentChip, AuditLogEntry, AutoCompactNotice, Avatar, BadgeWithDot as Badge, BrowserControls, BuildLogStream, Button, CapabilityIndicator, Card, ChatComposer, ChatMessage, ChatMessageAction, ChatMessageActions, ChatMessageBranch, ChatMessageBranchContent, ChatMessageBranchNext, ChatMessageBranchPage, ChatMessageBranchPrevious, ChatMessageBranchSelector, ChatMessageContent, ChatMessageResponse, ChatMessageRoot, ChatMessageToolbar, ChatThread, Checkbox, CodeBlock2 as CodeBlock, CommandPalette, ConfirmDialog, ContextCard, ContextWindowBar, CopyButton, CostMeter, CreatedFilesCard, CronJobCard, CronJobsList, DangerZone, DataPart, DeploymentRow, Dialog, DiffViewer, DomainConfig, EmptyState, EnvVarEditor, FilePart, FolderContextCard, FolderSelector, FormField, HOOK_EVENTS, HookConfig, HookEventLog, Input, IntentSelector, Label, LaneBoard, LoginSplit, MCPServerCard, MCPServerList, MODE_LABEL, MemoryEditor, MentionMenu, MetricsPanel, ModelCard, ModelSelector, Pagination, PermissionMatrix, PermissionModal, PlanBadge, PreviewEnvCard, PreviewPanel, Progress, ProgressChecklist, ProjectCard, ProjectSwitcher, QuickActionChips, RadioGroup, ReasoningPart, RecentFoldersList, RollbackUI, RuleCard, RuleEditor, RunStats, RunningTasksPanel, ScrollArea, Select, SessionListItem, SessionTimeline, Sheet, Sidebar, Skeleton, SkillCard, SkillEditor, SkillsList, SocialAuthRow, SourceDocumentPart, SourceUrlPart, StatTile, StatusDot, StepsRail, SubAgentDispatch, Switch, SystemPromptEditor, Table, Tabs, TaskHeader, TaskNode, TaskPlan, TerminalPanel, TextPart, Textarea, ThemeProvider, ThemeScript, ThemeSwitcher, TheoUIProvider, Timestamp, Toast, Toaster, TokenUsageChart, ToolCall, ToolCallCard, ToolCallPart, ToolResult, ToolsList, TooltipWithStatics as Tooltip, TopNav, UsageMeter, anthropicStyle, auroraTerminal, avatarVariants, badgeVariants, builtinThemes, buttonVariants, capabilityPresets, classicPaper, cn, computePageRange, defineTheme, dracula, githubDark, hex, isCustomContentUIPart, isDataUIPart, isFileUIPart, isReasoningFileUIPart, isReasoningUIPart, isSourceDocumentUIPart, isSourceUrlUIPart, isStepStartUIPart, isTextUIPart, isToolUIPart, linearGlass, modelCapabilityPresets, oneDark, openaiStyle, renderPart, rgb, sheetVariants, useDensity, useTheme, useToast, vercelMono, violetForge };
10415
10687
  //# sourceMappingURL=index.js.map
10416
10688
  //# sourceMappingURL=index.js.map