@tangle-network/ui 11.51.20 → 11.51.22
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/CHANGELOG.md +16 -0
- package/README.md +6 -0
- package/dist/hooks/use-event-stream.d.ts +11 -1
- package/dist/hooks/use-event-stream.js +6 -1
- package/dist/hooks.d.ts +2 -2
- package/dist/hooks.js +2 -2
- package/dist/index.d.ts +5 -4
- package/dist/index.js +4 -3
- package/dist/lib/code-presentation.js +8 -22
- package/dist/primitives/hover-card.d.ts +0 -1
- package/dist/primitives/hover-card.js +66 -53
- package/dist/primitives/table.d.ts +10 -1
- package/dist/primitives/table.js +15 -3
- package/dist/primitives/theme-toggle.d.ts +25 -3
- package/dist/primitives/theme-toggle.js +114 -74
- package/dist/primitives.d.ts +3 -3
- package/dist/primitives.js +2 -2
- package/dist/utils/token-milliseconds.d.ts +2 -0
- package/dist/utils/token-milliseconds.js +17 -0
- package/dist/utils.d.ts +2 -1
- package/dist/utils.js +2 -1
- package/package.json +2 -2
- package/src/hooks/index.ts +1 -1
- package/src/hooks/use-event-stream.ts +1 -2
- package/src/lib/code-presentation.ts +3 -11
- package/src/primitives/hover-card.tsx +19 -19
- package/src/primitives/index.ts +4 -1
- package/src/primitives/table.tsx +32 -13
- package/src/primitives/theme-toggle.tsx +109 -82
- package/src/utils/index.ts +1 -0
- package/src/utils/token-milliseconds.ts +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 11.51.22
|
|
2
|
+
|
|
3
|
+
### Patch Changes
|
|
4
|
+
|
|
5
|
+
- df08ce7: Keep delegated previews readable across their own anchor, content and focused actions. Share the existing scoped CSS time reader with previews, canvas consumers and clipboard feedback; preserve zero and missing budgets and resolve scoped calc() values.
|
|
6
|
+
- 5219d82: Export the existing native event-stream lifecycle from hooks so imperative adapters share the hook's cursor, reconnect, terminal-event and cleanup behavior. Native retries now back off during outages; buffered streams retain their configured policy.
|
|
7
|
+
|
|
8
|
+
Delegated hover anchors that attach after pointer entry now open through the same token delay as direct triggers.
|
|
9
|
+
|
|
10
|
+
## 11.51.21
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- b1f7c14: Reconcile preferences changed by another tab while theme consumers are unmounted, retaining in-memory preferences when browser storage is unavailable.
|
|
15
|
+
- 66a2c78: Add configurable theme persistence and product attributes through the existing theme engine, and controlled accessible sorting on TableHead. Existing useTheme callers retain their default behavior.
|
|
16
|
+
|
|
1
17
|
## 11.51.20
|
|
2
18
|
|
|
3
19
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -171,3 +171,9 @@ Retained report readers can import existing `chat/agent-timeline`, `chat/speaker
|
|
|
171
171
|
`@tangle-network/ui/utils/format` is a pure module for duration, clock, compact counts, USD, bytes and UTC labels. It loads without React. Charts re-exports these helpers for static figures and record views. `formatDuration` and `formatUptime` remain aliases of `formatSpanDuration`; chat timestamps use explicit UTC, and file/upload sizes share `formatBytes`.
|
|
172
172
|
|
|
173
173
|
`HoverCard` shares Popover positioning, portal and keyboard behavior. Its optional `anchor` accepts an existing DOM element for virtualized rows or canvas nodes. Hover delays default to the trigger's `--duration-fast` token. `HoverCardContent` and `PopoverContent` accept the local theme container, so previews preserve inherited tokens without copying computed styles.
|
|
174
|
+
|
|
175
|
+
### Product theme and table sorting
|
|
176
|
+
|
|
177
|
+
Create a `createThemeController({ storageKey, defaultTheme, storageValues, attribute })` once outside React components when a product has established persisted names or a mode attribute. Its `useTheme` shares state across components and tabs; `setTheme` persists the preference, while `applyTheme` applies a temporary page mode without replacing it. The parameterless `useTheme` keeps the default `theme` key and named Brand themes.
|
|
178
|
+
|
|
179
|
+
`TableHead` accepts `sort={{ direction, onSort, label, buttonClassName }}`. It owns the native button, keyboard activation, indicator and column `aria-sort`; the consumer owns row ordering, comparator, URL state and sort cycle. `direction` is `asc`, `desc` or omitted. Supply `label` when the header is not plain text.
|
|
@@ -11,5 +11,15 @@ export interface EventStreamHandlers {
|
|
|
11
11
|
onStart?: () => void;
|
|
12
12
|
onLiveChange?: (live: boolean) => void;
|
|
13
13
|
}
|
|
14
|
+
type NativePolicy = EventStreamHandlers & {
|
|
15
|
+
terminalEvent?: string;
|
|
16
|
+
onConnecting?: (attempt: number) => void;
|
|
17
|
+
retryDelay?: (attempt: number) => number | undefined;
|
|
18
|
+
};
|
|
19
|
+
/** The sole native EventSource lifecycle, shared by buffered and producer-owned streams. */
|
|
20
|
+
export declare function openNativeStream(url: string | (() => string), handlers: NativePolicy): {
|
|
21
|
+
close(): void;
|
|
22
|
+
};
|
|
14
23
|
/** Producer-owned named events; host transports keep their authenticated reconnect lifecycle. */
|
|
15
|
-
export declare function useEventStream(url: string | (() => string) | undefined, handlers: EventStreamHandlers): void;
|
|
24
|
+
export declare function useEventStream(url: string | (() => string) | undefined, handlers: EventStreamHandlers): void;
|
|
25
|
+
export {};
|
|
@@ -34,7 +34,12 @@ function openNativeStream(url, handlers) {
|
|
|
34
34
|
connection.close();
|
|
35
35
|
if (stopped || source !== connection) return;
|
|
36
36
|
live(false);
|
|
37
|
-
const delay = handlers.retryDelay ? handlers.retryDelay(attempt++) :
|
|
37
|
+
const delay = handlers.retryDelay ? handlers.retryDelay(attempt++) : [
|
|
38
|
+
1e3,
|
|
39
|
+
2e3,
|
|
40
|
+
5e3,
|
|
41
|
+
1e4
|
|
42
|
+
][Math.min(attempt++, 3)];
|
|
38
43
|
if (delay !== void 0) retry = setTimeout(open, delay);
|
|
39
44
|
};
|
|
40
45
|
}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { AuthUser, UseAuthOptions, UseAuthResult, createAuthFetcher, useApiKey,
|
|
|
8
8
|
import { AppendUserMessageOptions, ApplySdkEventOptions, BeginAssistantMessageOptions, CompleteAssistantMessageOptions, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, UseSdkSessionOptions, UseSdkSessionReturn, useSdkSession } from "./hooks/use-sdk-session.js";
|
|
9
9
|
import { RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, useRealtimeSession } from "./hooks/use-realtime-session.js";
|
|
10
10
|
import { AgentStreamEvent, AutomationStreamEvent, BotStreamEvent, ConnectionState, SSEEvent, TaskStreamEvent, TerminalStreamEvent, UseSSEStreamOptions, UseSSEStreamResult, useSSEStream } from "./hooks/use-sse-stream.js";
|
|
11
|
-
import { EventStreamHandlers, EventStreamOpener, EventStreamSource, useEventStream } from "./hooks/use-event-stream.js";
|
|
11
|
+
import { EventStreamHandlers, EventStreamOpener, EventStreamSource, openNativeStream, useEventStream } from "./hooks/use-event-stream.js";
|
|
12
12
|
import { useFollowTail } from "./hooks/use-follow-tail.js";
|
|
13
13
|
import { PHONE_MEDIA, usePhone } from "./hooks/use-phone.js";
|
|
14
|
-
export { AgentStreamEvent, AppendUserMessageOptions, ApplySdkEventOptions, AuthUser, AutomationStreamEvent, BeginAssistantMessageOptions, BotStreamEvent, CompleteAssistantMessageOptions, ConnectionState, type EventStreamHandlers, type EventStreamOpener, type EventStreamSource, PHONE_MEDIA, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, TaskStreamEvent, TerminalStreamEvent, UseAuthOptions, UseAuthResult, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, createAuthFetcher, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useEventStream, useFollowTail, useLiveTime, usePhone, useRealtimeSession, useRunCollapseState, useRunGroups, useRunNow, useSSEStream, useSdkSession, useToolCallStream };
|
|
14
|
+
export { AgentStreamEvent, AppendUserMessageOptions, ApplySdkEventOptions, AuthUser, AutomationStreamEvent, BeginAssistantMessageOptions, BotStreamEvent, CompleteAssistantMessageOptions, ConnectionState, type EventStreamHandlers, type EventStreamOpener, type EventStreamSource, PHONE_MEDIA, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, TaskStreamEvent, TerminalStreamEvent, UseAuthOptions, UseAuthResult, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, createAuthFetcher, openNativeStream, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useEventStream, useFollowTail, useLiveTime, usePhone, useRealtimeSession, useRunCollapseState, useRunGroups, useRunNow, useSSEStream, useSdkSession, useToolCallStream };
|
package/dist/hooks.js
CHANGED
|
@@ -8,7 +8,7 @@ import { useToolCallStream } from "./hooks/use-tool-call-stream.js";
|
|
|
8
8
|
import { createAuthFetcher, useApiKey, useAuth } from "./hooks/use-auth.js";
|
|
9
9
|
import { RealtimeSessionRegistry, useRealtimeSession } from "./hooks/use-realtime-session.js";
|
|
10
10
|
import { useSdkSession } from "./hooks/use-sdk-session.js";
|
|
11
|
-
import { useEventStream } from "./hooks/use-event-stream.js";
|
|
11
|
+
import { openNativeStream, useEventStream } from "./hooks/use-event-stream.js";
|
|
12
12
|
import { useSSEStream } from "./hooks/use-sse-stream.js";
|
|
13
13
|
import { PHONE_MEDIA, usePhone } from "./hooks/use-phone.js";
|
|
14
|
-
export { PHONE_MEDIA, RealtimeSessionRegistry, createAuthFetcher, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useEventStream, useFollowTail, useLiveTime, usePhone, useRealtimeSession, useRunCollapseState, useRunGroups, useRunNow, useSSEStream, useSdkSession, useToolCallStream };
|
|
14
|
+
export { PHONE_MEDIA, RealtimeSessionRegistry, createAuthFetcher, openNativeStream, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useEventStream, useFollowTail, useLiveTime, usePhone, useRealtimeSession, useRunCollapseState, useRunGroups, useRunNow, useSSEStream, useSdkSession, useToolCallStream };
|
package/dist/index.d.ts
CHANGED
|
@@ -49,7 +49,7 @@ import { AppendUserMessageOptions, ApplySdkEventOptions, BeginAssistantMessageOp
|
|
|
49
49
|
import { ActiveProjectActivity, ActiveSessionActivityOptions, ActiveSessionConnectionOptions, ActiveSessionConnectionState, ActiveSessionReconnectState, ActiveSessionRecord, ActiveSessionStatus, ActiveSessionTransportMode, ActiveSessionsState, RegisterActiveSessionOptions, SessionProjectKey, activeSessionsAtom, bumpActiveSessionActivity, getActiveSession, getAllActiveSessions, getAllProjectActivity, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getTotalRunningSessionCount, hasBackgroundRunningSessions, registerActiveSession, resetActiveSessions, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, unregisterActiveSession, updateActiveSessionMeta, useActiveSession, useActiveSessions, useActiveSessionsState, useHasBackgroundRunningSessions, useNavbarSessions, useProjectActivity, useProjectSessions, useSessionsByActivity, useTotalRunningSessions } from "./stores/active-sessions-store.js";
|
|
50
50
|
import { RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, useRealtimeSession } from "./hooks/use-realtime-session.js";
|
|
51
51
|
import { AgentStreamEvent, AutomationStreamEvent, BotStreamEvent, ConnectionState, SSEEvent, TaskStreamEvent, TerminalStreamEvent, UseSSEStreamOptions, UseSSEStreamResult, useSSEStream } from "./hooks/use-sse-stream.js";
|
|
52
|
-
import { EventStreamHandlers, EventStreamOpener, EventStreamSource, useEventStream } from "./hooks/use-event-stream.js";
|
|
52
|
+
import { EventStreamHandlers, EventStreamOpener, EventStreamSource, openNativeStream, useEventStream } from "./hooks/use-event-stream.js";
|
|
53
53
|
import { useFollowTail } from "./hooks/use-follow-tail.js";
|
|
54
54
|
import { PHONE_MEDIA, usePhone } from "./hooks/use-phone.js";
|
|
55
55
|
import "./hooks.js";
|
|
@@ -69,7 +69,7 @@ import { Badge, BadgeProps, badgeVariants } from "./primitives/badge.js";
|
|
|
69
69
|
import { Avatar, AvatarFallback, AvatarImage, AvatarProps } from "./primitives/avatar.js";
|
|
70
70
|
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./primitives/dropdown-menu.js";
|
|
71
71
|
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./primitives/select.js";
|
|
72
|
-
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableProps, TableRow } from "./primitives/table.js";
|
|
72
|
+
import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeadProps, TableHeader, TableProps, TableRow } from "./primitives/table.js";
|
|
73
73
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./primitives/tabs.js";
|
|
74
74
|
import { SegmentedControl, SegmentedControlOption, SegmentedControlProps } from "./primitives/segmented-control.js";
|
|
75
75
|
import { Progress } from "./primitives/progress.js";
|
|
@@ -91,7 +91,7 @@ import { UploadFile, UploadProgress, UploadProgressProps } from "./primitives/up
|
|
|
91
91
|
import { SidebarDropZone, SidebarDropZoneProps } from "./primitives/sidebar-drop-zone.js";
|
|
92
92
|
import { CodeBlock, CodeBlockProps, CopyButton, CopyButtonProps } from "./markdown/code-block.js";
|
|
93
93
|
import { InlineCode, InlineCodeProps } from "./primitives/code-block.js";
|
|
94
|
-
import { ThemeToggle, useTheme } from "./primitives/theme-toggle.js";
|
|
94
|
+
import { ThemeControllerOptions, ThemeToggle, createThemeController, useTheme } from "./primitives/theme-toggle.js";
|
|
95
95
|
import { Heading, HeadingProps, HeadingVariant } from "./primitives/heading.js";
|
|
96
96
|
import { PageShell, PageShellProps } from "./primitives/page-shell.js";
|
|
97
97
|
import { Field, FieldProps, fieldMessageId } from "./primitives/field.js";
|
|
@@ -136,6 +136,7 @@ import "./types.js";
|
|
|
136
136
|
import { copyText } from "./utils/copy-text.js";
|
|
137
137
|
import { formatAxisDuration, formatBytes, formatClock, formatCompact, formatCost, formatCount, formatDuration as formatSpanDuration, formatUtcTime, plainTextFromMarkdown, truncateText } from "./utils/format.js";
|
|
138
138
|
import { timeAgo } from "./utils/time-ago.js";
|
|
139
|
+
import { tokenMilliseconds } from "./utils/token-milliseconds.js";
|
|
139
140
|
import { TOOL_CATEGORY_ICONS, getToolCategory, getToolDisplayMetadata, getToolErrorText } from "./utils/tool-display.js";
|
|
140
141
|
import { cn } from "./lib/utils.js";
|
|
141
142
|
import { focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset } from "./lib/focus.js";
|
|
@@ -149,4 +150,4 @@ import { QuestionPreview, QuestionPreviewProps } from "./tool-previews/question-
|
|
|
149
150
|
import { DiffPreview, DiffPreviewProps } from "./tool-previews/diff-preview.js";
|
|
150
151
|
import { RedactedDocSegment, RedactedDocument, RedactedDocumentData, RedactedDocumentProps, RevealResult } from "./redaction/redacted-document.js";
|
|
151
152
|
import "./redaction.js";
|
|
152
|
-
export { ActiveProjectActivity, ActiveSessionActivityOptions, ActiveSessionConnectionOptions, ActiveSessionConnectionState, ActiveSessionReconnectState, ActiveSessionRecord, ActiveSessionStatus, ActiveSessionTransportMode, ActiveSessionsState, AgentBranding, AgentStreamEvent, AgentTimeline, type AgentTimelineArtifactItem, AgentTimelineColumn, type AgentTimelineCustomItem, type AgentTimelineFoldItem, type AgentTimelineItem, type AgentTimelineMessageItem, type AgentTimelineProps, type AgentTimelineStatusItem, AgentTimelineStep, type AgentTimelineStepKind, type AgentTimelineStepProps, type AgentTimelineTone, type AgentTimelineToolGroupItem, type AgentTimelineToolItem, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTone, ApiSchema, type ApiSchemaProps, AppendUserMessageOptions, ApplySdkEventOptions, ApprovalCard, type ApprovalCardProps, type ApprovalDiffFile, ApprovalDiffSummary, type ApprovalPlanStep, ArtifactPane, type ArtifactPaneProps, AuthHeader, type AuthHeaderProps, AuthUser, AutomationStreamEvent, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, BeginAssistantMessageOptions, BotStreamEvent, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, type CalendarDate, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, type CategoryTone, type ChartReferenceLine, ChatAuthor, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, Checkbox, Chip, type ChipProps, CodeBlock, type CodeBlockProps, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, type CommandPreviewProps, CompleteAssistantMessageOptions, ComplianceBadge, type ComplianceBadgeProps, type ComplianceProduct, type ComplianceStatus, ConnectionState, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, CustomToolRenderer, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffPreview, type DiffPreviewProps, DisplayVariant, DropZone, type DropZoneProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, type EventStreamHandlers, type EventStreamOpener, type EventStreamSource, ExpandablePanel, type ExpandablePanelProps, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, Field, type FieldProps, FileArtifactPane, type FileArtifactPaneProps, FileCard, type FileCardProps, type FileDetails, type FileFormat, FileList, type FileListItem, type FileListProps, type FileNode, FilePreview, type FilePreviewKind, type FilePreviewProps, type FileTabData, FileTabs, type FileTabsProps, FileTree, type FileTreeProps, type FileTreeVisibilityOptions, type FileUploader, FilterField, type FilterFieldProps, FinalTextPart, GitHubLoginButton, type GitHubLoginButtonProps, GlobResultsPreview, type GlobResultsPreviewProps, GrepResultsPreview, type GrepResultsPreviewProps, GroupedMessage, Heading, type HeadingProps, type HeadingVariant, HelpText, type HelpTextProps, HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger, IconTile, type IconTileProps, InlineCode, type InlineCodeProps, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, Input, type InputProps, Label, LiveDuration, LoginLayout, type LoginLayoutProps, Logo, type LogoProps, Markdown, type MarkdownLinkChip, type MarkdownLinkChipResolver, type MarkdownProps, MessageAuthor, type MessageAuthorProps, MessageList, type MessageListProps, type MessageRole, MessageRun, MessageUser, Metric, MetricChart, type MetricChartProps, type MetricProps, MetricStrip, type MetricStripProps, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, type OpenUIAction, type OpenUIActionsNode, OpenUIArtifactRenderer, type OpenUIArtifactRendererProps, type OpenUIBadgeNode, type OpenUICardNode, type OpenUICodeNode, type OpenUIComponentNode, type OpenUIGridNode, type OpenUIHeadingNode, type OpenUIKeyValueNode, type OpenUIMarkdownNode, type OpenUIPrimitive, type OpenUISchemaIssue, type OpenUISchemaValidation, type OpenUISeparatorNode, type OpenUIStackNode, type OpenUIStatNode, type OpenUITableNode, type OpenUITextNode, PHONE_MEDIA, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, Pagination, type PaginationProps, PdfViewer, type PdfViewerConfig, type PdfViewerProps, type PeriodDelta, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QuestionPreview, type QuestionPreviewProps, RadioGroup, RadioGroupItem, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, ReasoningPart, type RedactedDocSegment, RedactedDocument, type RedactedDocumentData, type RedactedDocumentProps, RegisterActiveSessionOptions, type RevealResult, RichFileTree, type RichFileTreeGitEntry, type RichFileTreeGitStatus, type RichFileTreeProps, type RichFileTreeThemeVars, Run, RunGroup, type RunGroupProps, type RunPhase, RunPhaseList, RunRowShell, type RunRowShellProps, type RunRowStatus, RunRowStatusDot, RunStats, type RunStatus, RunStatusIcon, type RunStatusIconProps, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeriesExtent, type SeriesPoint, type SeriesPointInput, type SeriesScale, SeriesSparkline, type SeriesSparklineProps, SessionMessage, SessionPart, SessionProjectKey, type SessionUser, SettingsList, type SettingsListAction, type SettingsListColumns, SettingsListItem, type SettingsListItemProps, type SettingsListMenuItem, type SettingsListProps, SettingsNote, type SettingsNoteProps, SettingsRow, type SettingsRowLayout, type SettingsRowProps, SettingsSection, type SettingsSectionProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarDropZone, type SidebarDropZoneProps, Skeleton, SkeletonCard, SkeletonTable, Slider, type Speaker, SpeakerHeader, type SpeakerHeaderProps, type SpeakerPart, type SpeakerSection, type SpeakerState, StatCard, type StatCardProps, type StatusMeta, StatusPill, type StatusPillProps, type StatusTone, Switch, TONE_CLASSES, TOOL_CATEGORY_ICONS, TRANSCRIPT_TEXT, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TangleKnot, TaskList, type TaskListItem, type TaskListProps, type TaskStatus, TaskStreamEvent, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TerminalStreamEvent, TextPart, TextShimmer, type TextShimmerProps, Textarea, type TextareaProps, ThemeToggle, ThinkingIndicator, type ThinkingIndicatorProps, TimeSelect, type TimeSelectProps, type Toast, ToastContainer, ToastProvider, type Tone, type ToneClasses, type ToolCallData, ToolCallFeed, type ToolCallFeedProps, type ToolCallStatus, type ToolCallType, ToolCategory, ToolDisplayMetadata, ToolPart, ToolState, ToolStatus, ToolTime, Toolbar, type ToolbarProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UploadFile, UploadProgress, type UploadProgressProps, UseAuthOptions, UseAuthResult, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, UserMenu, type UserMenuProps, UserMessage, type UserMessageProps, WebSearchPreview, type WebSearchPreviewProps, Wizard, type WizardProps, WizardStep, type WizardStepProps, WriteFilePreview, type WriteFilePreviewProps, activeSessionsAtom, addMessage, addParts, agentTimelineStepKind, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, codeBlockGrammar, configurePdfViewer, copyText, createAuthFetcher, detectFileFormat, fenceInfo, fieldMessageId, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, foldSummary, formatAxisDuration, formatBytes, formatCalendarDate, formatClock, formatCompact, formatCost, formatCount, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isOpen, isStreamingAtom, isViewerMessage, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, localToday, messagesAtom, normalizeSeries, numericColumns, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, partitionBySpeaker, periodDelta, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, runStatus, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, showsTaskPriority, statusMeta, tableCsv, taskProgress, taskStatus, timeAgo, toneFor, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useEventStream, useFollowTail, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, usePhone, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useRunNow, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
|
|
153
|
+
export { ActiveProjectActivity, ActiveSessionActivityOptions, ActiveSessionConnectionOptions, ActiveSessionConnectionState, ActiveSessionReconnectState, ActiveSessionRecord, ActiveSessionStatus, ActiveSessionTransportMode, ActiveSessionsState, AgentBranding, AgentStreamEvent, AgentTimeline, type AgentTimelineArtifactItem, AgentTimelineColumn, type AgentTimelineCustomItem, type AgentTimelineFoldItem, type AgentTimelineItem, type AgentTimelineMessageItem, type AgentTimelineProps, type AgentTimelineStatusItem, AgentTimelineStep, type AgentTimelineStepKind, type AgentTimelineStepProps, type AgentTimelineTone, type AgentTimelineToolGroupItem, type AgentTimelineToolItem, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTone, ApiSchema, type ApiSchemaProps, AppendUserMessageOptions, ApplySdkEventOptions, ApprovalCard, type ApprovalCardProps, type ApprovalDiffFile, ApprovalDiffSummary, type ApprovalPlanStep, ArtifactPane, type ArtifactPaneProps, AuthHeader, type AuthHeaderProps, AuthUser, AutomationStreamEvent, Avatar, AvatarFallback, AvatarImage, type AvatarProps, Badge, type BadgeProps, BeginAssistantMessageOptions, BotStreamEvent, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, type CalendarDate, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, type CategoryTone, type ChartReferenceLine, ChatAuthor, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, Checkbox, Chip, type ChipProps, CodeBlock, type CodeBlockProps, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, type CommandPreviewProps, CompleteAssistantMessageOptions, ComplianceBadge, type ComplianceBadgeProps, type ComplianceProduct, type ComplianceStatus, ConnectionState, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, CustomToolRenderer, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffPreview, type DiffPreviewProps, DisplayVariant, DropZone, type DropZoneProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, type EventStreamHandlers, type EventStreamOpener, type EventStreamSource, ExpandablePanel, type ExpandablePanelProps, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, Field, type FieldProps, FileArtifactPane, type FileArtifactPaneProps, FileCard, type FileCardProps, type FileDetails, type FileFormat, FileList, type FileListItem, type FileListProps, type FileNode, FilePreview, type FilePreviewKind, type FilePreviewProps, type FileTabData, FileTabs, type FileTabsProps, FileTree, type FileTreeProps, type FileTreeVisibilityOptions, type FileUploader, FilterField, type FilterFieldProps, FinalTextPart, GitHubLoginButton, type GitHubLoginButtonProps, GlobResultsPreview, type GlobResultsPreviewProps, GrepResultsPreview, type GrepResultsPreviewProps, GroupedMessage, Heading, type HeadingProps, type HeadingVariant, HelpText, type HelpTextProps, HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger, IconTile, type IconTileProps, InlineCode, type InlineCodeProps, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, Input, type InputProps, Label, LiveDuration, LoginLayout, type LoginLayoutProps, Logo, type LogoProps, Markdown, type MarkdownLinkChip, type MarkdownLinkChipResolver, type MarkdownProps, MessageAuthor, type MessageAuthorProps, MessageList, type MessageListProps, type MessageRole, MessageRun, MessageUser, Metric, MetricChart, type MetricChartProps, type MetricProps, MetricStrip, type MetricStripProps, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, type OpenUIAction, type OpenUIActionsNode, OpenUIArtifactRenderer, type OpenUIArtifactRendererProps, type OpenUIBadgeNode, type OpenUICardNode, type OpenUICodeNode, type OpenUIComponentNode, type OpenUIGridNode, type OpenUIHeadingNode, type OpenUIKeyValueNode, type OpenUIMarkdownNode, type OpenUIPrimitive, type OpenUISchemaIssue, type OpenUISchemaValidation, type OpenUISeparatorNode, type OpenUIStackNode, type OpenUIStatNode, type OpenUITableNode, type OpenUITextNode, PHONE_MEDIA, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, Pagination, type PaginationProps, PdfViewer, type PdfViewerConfig, type PdfViewerProps, type PeriodDelta, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QuestionPreview, type QuestionPreviewProps, RadioGroup, RadioGroupItem, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, ReasoningPart, type RedactedDocSegment, RedactedDocument, type RedactedDocumentData, type RedactedDocumentProps, RegisterActiveSessionOptions, type RevealResult, RichFileTree, type RichFileTreeGitEntry, type RichFileTreeGitStatus, type RichFileTreeProps, type RichFileTreeThemeVars, Run, RunGroup, type RunGroupProps, type RunPhase, RunPhaseList, RunRowShell, type RunRowShellProps, type RunRowStatus, RunRowStatusDot, RunStats, type RunStatus, RunStatusIcon, type RunStatusIconProps, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeriesExtent, type SeriesPoint, type SeriesPointInput, type SeriesScale, SeriesSparkline, type SeriesSparklineProps, SessionMessage, SessionPart, SessionProjectKey, type SessionUser, SettingsList, type SettingsListAction, type SettingsListColumns, SettingsListItem, type SettingsListItemProps, type SettingsListMenuItem, type SettingsListProps, SettingsNote, type SettingsNoteProps, SettingsRow, type SettingsRowLayout, type SettingsRowProps, SettingsSection, type SettingsSectionProps, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarDropZone, type SidebarDropZoneProps, Skeleton, SkeletonCard, SkeletonTable, Slider, type Speaker, SpeakerHeader, type SpeakerHeaderProps, type SpeakerPart, type SpeakerSection, type SpeakerState, StatCard, type StatCardProps, type StatusMeta, StatusPill, type StatusPillProps, type StatusTone, Switch, TONE_CLASSES, TOOL_CATEGORY_ICONS, TRANSCRIPT_TEXT, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, type TableHeadProps, TableHeader, type TableProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TangleKnot, TaskList, type TaskListItem, type TaskListProps, type TaskStatus, TaskStreamEvent, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TerminalStreamEvent, TextPart, TextShimmer, type TextShimmerProps, Textarea, type TextareaProps, type ThemeControllerOptions, ThemeToggle, ThinkingIndicator, type ThinkingIndicatorProps, TimeSelect, type TimeSelectProps, type Toast, ToastContainer, ToastProvider, type Tone, type ToneClasses, type ToolCallData, ToolCallFeed, type ToolCallFeedProps, type ToolCallStatus, type ToolCallType, ToolCategory, ToolDisplayMetadata, ToolPart, ToolState, ToolStatus, ToolTime, Toolbar, type ToolbarProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UploadFile, UploadProgress, type UploadProgressProps, UseAuthOptions, UseAuthResult, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, UserMenu, type UserMenuProps, UserMessage, type UserMessageProps, WebSearchPreview, type WebSearchPreviewProps, Wizard, type WizardProps, WizardStep, type WizardStepProps, WriteFilePreview, type WriteFilePreviewProps, activeSessionsAtom, addMessage, addParts, agentTimelineStepKind, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, codeBlockGrammar, configurePdfViewer, copyText, createAuthFetcher, createThemeController, detectFileFormat, fenceInfo, fieldMessageId, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, foldSummary, formatAxisDuration, formatBytes, formatCalendarDate, formatClock, formatCompact, formatCost, formatCount, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isOpen, isStreamingAtom, isViewerMessage, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, localToday, messagesAtom, normalizeSeries, numericColumns, openNativeStream, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, partitionBySpeaker, periodDelta, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, runStatus, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, showsTaskPriority, statusMeta, tableCsv, taskProgress, taskStatus, timeAgo, tokenMilliseconds, toneFor, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useEventStream, useFollowTail, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, usePhone, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useRunNow, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
|
package/dist/index.js
CHANGED
|
@@ -42,10 +42,11 @@ import { formatAxisDuration, formatBytes, formatClock, formatCompact, formatCost
|
|
|
42
42
|
import { UploadProgress } from "./primitives/upload-progress.js";
|
|
43
43
|
import { SidebarDropZone } from "./primitives/sidebar-drop-zone.js";
|
|
44
44
|
import { ArtifactPane } from "./primitives/artifact-pane.js";
|
|
45
|
+
import { tokenMilliseconds } from "./utils/token-milliseconds.js";
|
|
45
46
|
import { codeBlockGrammar } from "./lib/code-presentation.js";
|
|
46
47
|
import { CodeBlock, CopyButton } from "./markdown/code-block.js";
|
|
47
48
|
import { InlineCode } from "./primitives/code-block.js";
|
|
48
|
-
import { ThemeToggle, useTheme } from "./primitives/theme-toggle.js";
|
|
49
|
+
import { ThemeToggle, createThemeController, useTheme } from "./primitives/theme-toggle.js";
|
|
49
50
|
import { PageShell } from "./primitives/page-shell.js";
|
|
50
51
|
import { Field, fieldMessageId } from "./primitives/field.js";
|
|
51
52
|
import { StatusPill } from "./primitives/status-pill.js";
|
|
@@ -126,11 +127,11 @@ import { createAuthFetcher, useApiKey, useAuth } from "./hooks/use-auth.js";
|
|
|
126
127
|
import { activeSessionsAtom, bumpActiveSessionActivity, getActiveSession, getAllActiveSessions, getAllProjectActivity, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getTotalRunningSessionCount, hasBackgroundRunningSessions, registerActiveSession, resetActiveSessions, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, unregisterActiveSession, updateActiveSessionMeta, useActiveSession, useActiveSessions, useActiveSessionsState, useHasBackgroundRunningSessions, useNavbarSessions, useProjectActivity, useProjectSessions, useSessionsByActivity, useTotalRunningSessions } from "./stores/active-sessions-store.js";
|
|
127
128
|
import { RealtimeSessionRegistry, useRealtimeSession } from "./hooks/use-realtime-session.js";
|
|
128
129
|
import { useSdkSession } from "./hooks/use-sdk-session.js";
|
|
129
|
-
import { useEventStream } from "./hooks/use-event-stream.js";
|
|
130
|
+
import { openNativeStream, useEventStream } from "./hooks/use-event-stream.js";
|
|
130
131
|
import { useSSEStream } from "./hooks/use-sse-stream.js";
|
|
131
132
|
import { PHONE_MEDIA, usePhone } from "./hooks/use-phone.js";
|
|
132
133
|
import { addMessage, addParts, clearChat, isStreamingAtom, messagesAtom, partMapAtom, updatePart } from "./stores/chat-store.js";
|
|
133
134
|
import { copyText } from "./utils/copy-text.js";
|
|
134
135
|
import { timeAgo } from "./utils/time-ago.js";
|
|
135
136
|
import { RedactedDocument } from "./redaction/redacted-document.js";
|
|
136
|
-
export { AgentTimeline, AgentTimelineColumn, AgentTimelineStep, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, ApiSchema, ApprovalCard, ApprovalDiffSummary, ArtifactPane, AuthHeader, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatContainer, ChatMessage, Checkbox, Chip, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, ComplianceBadge, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffPreview, DropZone, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ExpandablePanel, ExpandedToolDetail, Field, FileArtifactPane, FileCard, FileList, FilePreview, FileTabs, FileTree, FilterField, GitHubLoginButton, GlobResultsPreview, GrepResultsPreview, Heading, HelpText, HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger, IconTile, InlineCode, InlineThinkingItem, InlineToolItem, Input, Label, LiveDuration, LoginLayout, Logo, Markdown, MessageAuthor, MessageList, Metric, MetricChart, MetricStrip, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, OpenUIArtifactRenderer, PHONE_MEDIA, PageHeader, PageShell, Pagination, PdfViewer, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QuestionPreview, RadioGroup, RadioGroupItem, RealtimeSessionRegistry, RedactedDocument, RichFileTree, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeriesSparkline, SettingsList, SettingsListItem, SettingsNote, SettingsRow, SettingsSection, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarDropZone, Skeleton, SkeletonCard, SkeletonTable, Slider, SpeakerHeader, StatCard, StatusPill, Switch, TONE_CLASSES, TOOL_CATEGORY_ICONS, TRANSCRIPT_TEXT, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TangleKnot, TaskList, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TextShimmer, Textarea, ThemeToggle, ThinkingIndicator, TimeSelect, ToastContainer, ToastProvider, ToolCallFeed, Toolbar, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UploadProgress, UserMenu, UserMessage, WebSearchPreview, Wizard, WizardStep, WriteFilePreview, activeSessionsAtom, addMessage, addParts, agentTimelineStepKind, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, codeBlockGrammar, configurePdfViewer, copyText, createAuthFetcher, detectFileFormat, fenceInfo, fieldMessageId, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, foldSummary, formatAxisDuration, formatBytes, formatCalendarDate, formatClock, formatCompact, formatCost, formatCount, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isOpen, isStreamingAtom, isViewerMessage, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, localToday, messagesAtom, normalizeSeries, numericColumns, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, partitionBySpeaker, periodDelta, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, runStatus, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, showsTaskPriority, statusMeta, tableCsv, taskProgress, taskStatus, timeAgo, toneFor, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useEventStream, useFollowTail, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, usePhone, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useRunNow, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
|
|
137
|
+
export { AgentTimeline, AgentTimelineColumn, AgentTimelineStep, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, ApiSchema, ApprovalCard, ApprovalDiffSummary, ArtifactPane, AuthHeader, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatContainer, ChatMessage, Checkbox, Chip, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, ComplianceBadge, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffPreview, DropZone, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ExpandablePanel, ExpandedToolDetail, Field, FileArtifactPane, FileCard, FileList, FilePreview, FileTabs, FileTree, FilterField, GitHubLoginButton, GlobResultsPreview, GrepResultsPreview, Heading, HelpText, HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger, IconTile, InlineCode, InlineThinkingItem, InlineToolItem, Input, Label, LiveDuration, LoginLayout, Logo, Markdown, MessageAuthor, MessageList, Metric, MetricChart, MetricStrip, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, OpenUIArtifactRenderer, PHONE_MEDIA, PageHeader, PageShell, Pagination, PdfViewer, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QuestionPreview, RadioGroup, RadioGroupItem, RealtimeSessionRegistry, RedactedDocument, RichFileTree, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, RunStatusIcon, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SeriesSparkline, SettingsList, SettingsListItem, SettingsNote, SettingsRow, SettingsSection, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarDropZone, Skeleton, SkeletonCard, SkeletonTable, Slider, SpeakerHeader, StatCard, StatusPill, Switch, TONE_CLASSES, TOOL_CATEGORY_ICONS, TRANSCRIPT_TEXT, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TangleKnot, TaskList, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TextShimmer, Textarea, ThemeToggle, ThinkingIndicator, TimeSelect, ToastContainer, ToastProvider, ToolCallFeed, Toolbar, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UploadProgress, UserMenu, UserMessage, WebSearchPreview, Wizard, WizardStep, WriteFilePreview, activeSessionsAtom, addMessage, addParts, agentTimelineStepKind, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, codeBlockGrammar, configurePdfViewer, copyText, createAuthFetcher, createThemeController, detectFileFormat, fenceInfo, fieldMessageId, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, foldSummary, formatAxisDuration, formatBytes, formatCalendarDate, formatClock, formatCompact, formatCost, formatCount, formatSpanDuration as formatDuration, formatSpanDuration, formatSpanDuration as formatUptime, formatUtcTime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isOpen, isStreamingAtom, isViewerMessage, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, localToday, messagesAtom, normalizeSeries, numericColumns, openNativeStream, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, partitionBySpeaker, periodDelta, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, runStatus, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, showsTaskPriority, statusMeta, tableCsv, taskProgress, taskStatus, timeAgo, tokenMilliseconds, toneFor, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useEventStream, useFollowTail, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, usePhone, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useRunNow, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { tabsPresentation } from "../presentation.js";
|
|
2
|
+
import { tokenMilliseconds } from "../utils/token-milliseconds.js";
|
|
2
3
|
// src/lib/code-presentation.ts
|
|
3
4
|
const SYNTAX = {
|
|
4
5
|
comment: "var(--syntax-comment, currentColor)",
|
|
@@ -242,28 +243,13 @@ async function writeClipboard(text) {
|
|
|
242
243
|
const COPY_FEEDBACK_MS = 2e3;
|
|
243
244
|
/** Resolve scoped Brand times, including calc(), without duplicating token values. */
|
|
244
245
|
function interactionBudgets(scope) {
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
if (!view.getComputedStyle(scope).getPropertyValue(name).trim()) return void 0;
|
|
253
|
-
probe.style.animationDuration = `var(${name})`;
|
|
254
|
-
const time = /^(\d+(?:\.\d+)?)(ms|s)$/.exec(view.getComputedStyle(probe).animationDuration);
|
|
255
|
-
return time ? Number(time[1]) * (time[2] === "s" ? 1e3 : 1) : void 0;
|
|
256
|
-
};
|
|
257
|
-
try {
|
|
258
|
-
return {
|
|
259
|
-
feedback: read("feedback-budget"),
|
|
260
|
-
pending: read("pending-delay"),
|
|
261
|
-
longWork: read("long-work-delay"),
|
|
262
|
-
mutation: read("mutation-budget")
|
|
263
|
-
};
|
|
264
|
-
} finally {
|
|
265
|
-
probe.remove();
|
|
266
|
-
}
|
|
246
|
+
const read = (role) => tokenMilliseconds(`--interaction-${role}`, scope);
|
|
247
|
+
return scope.ownerDocument.defaultView ? {
|
|
248
|
+
feedback: read("feedback-budget"),
|
|
249
|
+
pending: read("pending-delay"),
|
|
250
|
+
longWork: read("long-work-delay"),
|
|
251
|
+
mutation: read("mutation-budget")
|
|
252
|
+
} : {};
|
|
267
253
|
}
|
|
268
254
|
/** Owns one accepted write, scoped delays and cleanup for both renderers. */
|
|
269
255
|
function createCopyFeedback(change, write = writeClipboard, scope) {
|
|
@@ -9,7 +9,6 @@ type HoverCardProps = React.ComponentProps<typeof Popover> & {
|
|
|
9
9
|
openDelay?: number;
|
|
10
10
|
closeDelay?: number;
|
|
11
11
|
};
|
|
12
|
-
/** One hover policy and Popover's keyboard/focus behavior; delays follow the trigger's fast token. */
|
|
13
12
|
export declare function HoverCard({ anchor, open: controlled, defaultOpen, onOpenChange, openDelay, closeDelay, children, ...props }: HoverCardProps): React.JSX.Element;
|
|
14
13
|
export declare const HoverCardTrigger: React.ForwardRefExoticComponent<React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
15
14
|
asChild?: boolean;
|
|
@@ -1,64 +1,69 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
2
|
import { Popover, PopoverAnchor, PopoverContent } from "./popover.js";
|
|
3
|
+
import { tokenMilliseconds } from "../utils/token-milliseconds.js";
|
|
3
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
5
|
import * as React from "react";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
// src/primitives/hover-card.tsx
|
|
7
8
|
const HoverIntent = React.createContext({
|
|
9
|
+
content: { current: null },
|
|
8
10
|
enter: (_target) => {},
|
|
9
|
-
leave: () => {},
|
|
11
|
+
leave: (_event) => {},
|
|
10
12
|
restore: () => {},
|
|
11
|
-
press: () => {}
|
|
13
|
+
press: () => {},
|
|
14
|
+
owns: (_target) => false
|
|
12
15
|
});
|
|
13
|
-
/** One hover policy and Popover's keyboard/focus behavior; delays follow the trigger's fast token. */
|
|
14
16
|
function HoverCard({ anchor, open: controlled, defaultOpen = false, onOpenChange, openDelay, closeDelay, children, ...props }) {
|
|
15
17
|
const element = anchor && ("contextElement" in anchor ? anchor.contextElement : anchor);
|
|
16
18
|
const [own, setOwn] = React.useState({
|
|
17
19
|
anchor: element,
|
|
18
20
|
open: defaultOpen
|
|
19
21
|
});
|
|
20
|
-
const intent = React.useRef({});
|
|
22
|
+
const intent = React.useRef({ content: { current: null } });
|
|
23
|
+
intent.current.onOpenChange = onOpenChange;
|
|
21
24
|
if (element) intent.current.target = element;
|
|
22
25
|
const change = React.useCallback((next) => {
|
|
23
26
|
clearTimeout(intent.current.timer);
|
|
24
|
-
if (controlled === void 0) setOwn({
|
|
27
|
+
if (controlled === void 0) setOwn((current) => current.anchor === element && current.open === next ? current : {
|
|
25
28
|
anchor: element,
|
|
26
29
|
open: next
|
|
27
30
|
});
|
|
28
|
-
onOpenChange?.(next);
|
|
29
|
-
}, [
|
|
30
|
-
|
|
31
|
-
onOpenChange,
|
|
32
|
-
element
|
|
33
|
-
]);
|
|
34
|
-
const delay = (target) => {
|
|
35
|
-
const value = getComputedStyle(target ?? document.documentElement).getPropertyValue("--duration-fast").trim();
|
|
36
|
-
return (parseFloat(value) || 0) * (value.endsWith("ms") ? 1 : 1e3);
|
|
37
|
-
};
|
|
31
|
+
intent.current.onOpenChange?.(next);
|
|
32
|
+
}, [controlled, element]);
|
|
33
|
+
const owns = React.useCallback((target) => target instanceof Node && (!!(element ?? intent.current.target)?.contains(target) || !!intent.current.content.current?.contains(target)), [element]);
|
|
38
34
|
const enter = React.useCallback((target) => {
|
|
39
|
-
if (intent.current.restoring || intent.current.pressed && target.
|
|
35
|
+
if (intent.current.restoring || intent.current.pressed && target === intent.current.content.current) return;
|
|
40
36
|
intent.current.pressed = false;
|
|
41
|
-
if (
|
|
37
|
+
if (target !== intent.current.content.current) intent.current.target = target;
|
|
42
38
|
clearTimeout(intent.current.timer);
|
|
43
|
-
intent.current.timer = setTimeout(() => change(true), openDelay ??
|
|
39
|
+
intent.current.timer = setTimeout(() => change(true), openDelay ?? tokenMilliseconds("--duration-fast", target));
|
|
44
40
|
}, [change, openDelay]);
|
|
45
|
-
const leave = React.useCallback(() => {
|
|
41
|
+
const leave = React.useCallback((event) => {
|
|
42
|
+
if (owns(event?.relatedTarget ?? null)) return;
|
|
46
43
|
clearTimeout(intent.current.timer);
|
|
47
|
-
intent.current.timer = setTimeout(() =>
|
|
44
|
+
intent.current.timer = setTimeout(() => {
|
|
45
|
+
if (!owns(document.activeElement) || !intent.current.content.current?.contains(document.activeElement) && !document.activeElement?.matches(":focus-visible")) change(false);
|
|
46
|
+
}, closeDelay ?? tokenMilliseconds("--duration-fast", element ?? intent.current.target));
|
|
48
47
|
}, [
|
|
49
48
|
change,
|
|
50
49
|
closeDelay,
|
|
51
|
-
element
|
|
50
|
+
element,
|
|
51
|
+
owns
|
|
52
52
|
]);
|
|
53
53
|
React.useEffect(() => {
|
|
54
|
-
if (!element)
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
if (!element) {
|
|
55
|
+
if (anchor === null) setOwn((current) => current.open ? {
|
|
56
|
+
anchor: element,
|
|
57
|
+
open: false
|
|
58
|
+
} : current);
|
|
59
|
+
return () => clearTimeout(intent.current.timer);
|
|
60
|
+
}
|
|
61
|
+
const show = () => enter(element), blur = (event) => leave(event);
|
|
58
62
|
element.addEventListener("pointerenter", show);
|
|
59
63
|
element.addEventListener("pointerleave", leave);
|
|
60
64
|
element.addEventListener("focusin", show);
|
|
61
65
|
element.addEventListener("focusout", blur);
|
|
66
|
+
if (element.matches(":hover,:focus-within")) show();
|
|
62
67
|
return () => {
|
|
63
68
|
clearTimeout(intent.current.timer);
|
|
64
69
|
element.removeEventListener("pointerenter", show);
|
|
@@ -67,7 +72,6 @@ function HoverCard({ anchor, open: controlled, defaultOpen = false, onOpenChange
|
|
|
67
72
|
element.removeEventListener("focusout", blur);
|
|
68
73
|
};
|
|
69
74
|
}, [
|
|
70
|
-
anchor,
|
|
71
75
|
element,
|
|
72
76
|
enter,
|
|
73
77
|
leave
|
|
@@ -81,13 +85,15 @@ function HoverCard({ anchor, open: controlled, defaultOpen = false, onOpenChange
|
|
|
81
85
|
};
|
|
82
86
|
return /* @__PURE__ */ jsx(HoverIntent.Provider, {
|
|
83
87
|
value: {
|
|
88
|
+
content: intent.current.content,
|
|
84
89
|
enter,
|
|
85
90
|
leave,
|
|
86
91
|
restore,
|
|
87
92
|
press: () => {
|
|
88
93
|
intent.current.pressed = true;
|
|
89
94
|
change(false);
|
|
90
|
-
}
|
|
95
|
+
},
|
|
96
|
+
owns
|
|
91
97
|
},
|
|
92
98
|
children: /* @__PURE__ */ jsxs(Popover, {
|
|
93
99
|
...props,
|
|
@@ -111,7 +117,7 @@ const HoverCardTrigger = React.forwardRef(({ className, onPointerEnter, onPointe
|
|
|
111
117
|
},
|
|
112
118
|
onPointerLeave: (event) => {
|
|
113
119
|
onPointerLeave?.(event);
|
|
114
|
-
if (!event.defaultPrevented) intent.leave();
|
|
120
|
+
if (!event.defaultPrevented) intent.leave(event);
|
|
115
121
|
},
|
|
116
122
|
onFocus: (event) => {
|
|
117
123
|
onFocus?.(event);
|
|
@@ -124,39 +130,46 @@ const HoverCardTrigger = React.forwardRef(({ className, onPointerEnter, onPointe
|
|
|
124
130
|
},
|
|
125
131
|
onBlur: (event) => {
|
|
126
132
|
onBlur?.(event);
|
|
127
|
-
if (!event.defaultPrevented
|
|
133
|
+
if (!event.defaultPrevented) intent.leave(event);
|
|
128
134
|
},
|
|
129
135
|
...props
|
|
130
136
|
})
|
|
131
137
|
});
|
|
132
138
|
});
|
|
133
139
|
HoverCardTrigger.displayName = "HoverCardTrigger";
|
|
134
|
-
const HoverCardContent = React.forwardRef(({ className, onPointerEnter, onPointerLeave, onOpenAutoFocus, onCloseAutoFocus, ...props }, ref) => {
|
|
140
|
+
const HoverCardContent = React.forwardRef(({ className, onPointerEnter, onPointerLeave, onOpenAutoFocus, onCloseAutoFocus, onFocusOutside, ...props }, ref) => {
|
|
135
141
|
const intent = React.useContext(HoverIntent);
|
|
136
|
-
return /* @__PURE__ */ jsx(
|
|
137
|
-
ref,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
event
|
|
143
|
-
|
|
144
|
-
onCloseAutoFocus: (event) => {
|
|
145
|
-
onCloseAutoFocus?.(event);
|
|
146
|
-
if (!event.defaultPrevented) {
|
|
142
|
+
return /* @__PURE__ */ jsx(Slot, {
|
|
143
|
+
ref: intent.content,
|
|
144
|
+
children: /* @__PURE__ */ jsx(PopoverContent, {
|
|
145
|
+
ref,
|
|
146
|
+
"data-hover-card": true,
|
|
147
|
+
className: cn("w-64", className),
|
|
148
|
+
onOpenAutoFocus: (event) => {
|
|
149
|
+
onOpenAutoFocus?.(event);
|
|
147
150
|
event.preventDefault();
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
151
|
+
},
|
|
152
|
+
onCloseAutoFocus: (event) => {
|
|
153
|
+
onCloseAutoFocus?.(event);
|
|
154
|
+
if (!event.defaultPrevented) {
|
|
155
|
+
event.preventDefault();
|
|
156
|
+
intent.restore();
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
onFocusOutside: (event) => {
|
|
160
|
+
onFocusOutside?.(event);
|
|
161
|
+
if (intent.owns(event.detail.originalEvent.target)) event.preventDefault();
|
|
162
|
+
},
|
|
163
|
+
onPointerEnter: (event) => {
|
|
164
|
+
onPointerEnter?.(event);
|
|
165
|
+
if (!event.defaultPrevented) intent.enter(event.currentTarget);
|
|
166
|
+
},
|
|
167
|
+
onPointerLeave: (event) => {
|
|
168
|
+
onPointerLeave?.(event);
|
|
169
|
+
if (!event.defaultPrevented) intent.leave(event);
|
|
170
|
+
},
|
|
171
|
+
...props
|
|
172
|
+
})
|
|
160
173
|
});
|
|
161
174
|
});
|
|
162
175
|
HoverCardContent.displayName = "HoverCardContent";
|
|
@@ -14,7 +14,16 @@ declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<
|
|
|
14
14
|
declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
15
15
|
declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
16
16
|
declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
|
|
17
|
-
|
|
17
|
+
export interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
|
|
18
|
+
/** Controlled sort affordance. The caller retains row order and sort policy. */
|
|
19
|
+
sort?: {
|
|
20
|
+
direction?: "asc" | "desc";
|
|
21
|
+
onSort: () => void;
|
|
22
|
+
label?: string;
|
|
23
|
+
buttonClassName?: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
declare const TableHead: React.ForwardRefExoticComponent<TableHeadProps & React.RefAttributes<HTMLTableCellElement>>;
|
|
18
27
|
declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
19
28
|
declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
20
29
|
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
|
package/dist/primitives/table.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cn } from "../lib/utils.js";
|
|
2
2
|
import { tablePresentation } from "../presentation.js";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
// src/primitives/table.tsx
|
|
6
6
|
const Table = React.forwardRef(({ className, wrapper = true, wrapperProps, ...props }, ref) => {
|
|
7
7
|
const table = /* @__PURE__ */ jsx("table", {
|
|
@@ -42,10 +42,22 @@ const TableRow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
42
42
|
...props
|
|
43
43
|
}));
|
|
44
44
|
TableRow.displayName = "TableRow";
|
|
45
|
-
const TableHead = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("th", {
|
|
45
|
+
const TableHead = React.forwardRef(({ className, children, sort, ...props }, ref) => /* @__PURE__ */ jsx("th", {
|
|
46
46
|
ref,
|
|
47
47
|
className: cn(tablePresentation.columnHeader, className),
|
|
48
|
-
...props
|
|
48
|
+
...props,
|
|
49
|
+
"aria-sort": sort ? sort.direction === "asc" ? "ascending" : sort.direction === "desc" ? "descending" : "none" : props["aria-sort"],
|
|
50
|
+
children: sort ? /* @__PURE__ */ jsxs("button", {
|
|
51
|
+
type: "button",
|
|
52
|
+
onClick: sort.onSort,
|
|
53
|
+
"aria-label": sort.label ?? (typeof children === "string" ? `Sort by ${children}` : void 0),
|
|
54
|
+
className: cn("inline-flex cursor-pointer items-center gap-1 rounded-sm font-inherit text-inherit hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2", sort.buttonClassName),
|
|
55
|
+
children: [children, /* @__PURE__ */ jsx("span", {
|
|
56
|
+
"aria-hidden": "true",
|
|
57
|
+
className: "text-xs",
|
|
58
|
+
children: sort.direction === "asc" ? "↑" : sort.direction === "desc" ? "↓" : "↕"
|
|
59
|
+
})]
|
|
60
|
+
}) : children
|
|
49
61
|
}));
|
|
50
62
|
TableHead.displayName = "TableHead";
|
|
51
63
|
const TableCell = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("td", {
|
|
@@ -1,9 +1,31 @@
|
|
|
1
1
|
type Theme = "light" | "dark" | "system";
|
|
2
2
|
type Mode = Exclude<Theme, "system">;
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export interface ThemeControllerOptions {
|
|
4
|
+
storageKey?: string;
|
|
5
|
+
defaultTheme?: Theme;
|
|
6
|
+
/** Persisted spellings, including null to remove a system preference. */
|
|
7
|
+
storageValues?: Partial<Record<Theme, string | null>>;
|
|
8
|
+
/** Product mode attribute; absent mode values remove the attribute. */
|
|
9
|
+
attribute?: {
|
|
10
|
+
name: string;
|
|
11
|
+
light?: string;
|
|
12
|
+
dark?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** Create once at module scope. Each product owns its persisted names, not a second theme engine. */
|
|
16
|
+
export declare function createThemeController({ storageKey, defaultTheme, storageValues, attribute }?: ThemeControllerOptions): {
|
|
17
|
+
useTheme: () => {
|
|
18
|
+
theme: Theme;
|
|
19
|
+
setTheme: (next: Theme) => void;
|
|
20
|
+
resolvedTheme: Mode;
|
|
21
|
+
};
|
|
22
|
+
getTheme: () => Theme;
|
|
23
|
+
setTheme: (next: Theme) => void;
|
|
24
|
+
applyTheme: (theme?: Theme) => void;
|
|
25
|
+
};
|
|
26
|
+
export declare const useTheme: () => {
|
|
5
27
|
theme: Theme;
|
|
6
|
-
setTheme:
|
|
28
|
+
setTheme: (next: Theme) => void;
|
|
7
29
|
resolvedTheme: Mode;
|
|
8
30
|
};
|
|
9
31
|
export declare function ThemeToggle(): import("react").JSX.Element;
|