@tangle-network/ui 11.38.2 → 11.40.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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @tangle-network/ui
2
2
 
3
+ ## 11.40.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 63e1e7e: Add the settings atoms to `@tangle-network/ui/primitives`, so every product's settings page draws from one owner:
8
+
9
+ - `Field` and `fieldMessageId`, promoted from Agent App's profile form with the same API. The info tip is a bare `Button` with a 44px hit area on coarse pointers.
10
+ - `SettingsRow`: `inline`, `compact` and `stacked` layouts; a save status after the label, announced politely; an error (with optional Retry) or a lock reason that replaces the description, describes the control and marks it invalid. No className sizing hooks.
11
+ - `SettingsSection`: a `Card` with a 16px title, an anchor `id`, a `danger` tone, top-right actions and a footer on the muted plane.
12
+ - `SettingsList` and `SettingsListItem`: subgrid-aligned leading, state, action and menu columns. The item's one at-rest `action` is an outline button, so it never reads as the state; with a `disabledReason` it stays focusable, does nothing and shows the reason under the meta. Destructive actions go in the ⋯ menu, where an unavailable item stays focusable with its reason.
13
+
14
+ `Button` gains `variant="destructive-outline"` for a destructive action at rest, such as a danger section's "Delete project…". `Avatar` gains `size` (`sm` 32px, `md` 40px by default). `Switch` keeps its 36 x 20 track and gets a 44px hit area on coarse pointers, like the info tip.
15
+
16
+ Rows and lists answer to their card's width: below 34rem rows stack and list items become two lines with the state under the title.
17
+
18
+ `PageShell` gains `measure="settings"` and a `header` slot. The settings measure is a 48rem column of cards with a sticky 13rem section column once its frame is 60rem wide, and a sticky 56px tab strip below that which keeps the current tab in view by scrolling the strip only, including when the links are replaced or the web font swaps. Without navigation it is the 48rem column alone. Its `className` goes on the frame, so a `max-w-*` bounds the width the layout answers to.
19
+
20
+ The reading layout adds its 13rem navigation track only when it has a navigation, so an article with a header or an outline but no navigation no longer drops into that track. Every existing export is unchanged.
21
+
22
+ ## 11.39.0
23
+
24
+ ### Minor Changes
25
+
26
+ - f10bf8a: Support TooltipContent portal={false} for content that belongs to its local container. Keep the default portal, shared Content/SurfaceMotion owner, positioning, forwarded refs, asChild and Root state APIs.
27
+
28
+ Preserve the caller as the asChild slot target when Radix adds accessibility content.
29
+
3
30
  ## 11.38.2
4
31
 
5
32
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -62,7 +62,7 @@ import { Calendar, CalendarDate, CalendarProps, formatCalendarDate, localToday,
62
62
  import { DatePicker, DatePickerProps } from "./primitives/date-picker.js";
63
63
  import { TimeSelect, TimeSelectProps } from "./primitives/time-select.js";
64
64
  import { Badge, BadgeProps, badgeVariants } from "./primitives/badge.js";
65
- import { Avatar, AvatarFallback, AvatarImage } from "./primitives/avatar.js";
65
+ import { Avatar, AvatarFallback, AvatarImage, AvatarProps } from "./primitives/avatar.js";
66
66
  import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from "./primitives/dropdown-menu.js";
67
67
  import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./primitives/select.js";
68
68
  import { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableProps, TableRow } from "./primitives/table.js";
@@ -90,6 +90,8 @@ import { InlineCode, InlineCodeProps } from "./primitives/code-block.js";
90
90
  import { ThemeToggle, useTheme } from "./primitives/theme-toggle.js";
91
91
  import { Heading, HeadingProps, HeadingVariant } from "./primitives/heading.js";
92
92
  import { PageShell, PageShellProps } from "./primitives/page-shell.js";
93
+ import { Field, FieldProps, fieldMessageId } from "./primitives/field.js";
94
+ import { SettingsList, SettingsListAction, SettingsListColumns, SettingsListItem, SettingsListItemProps, SettingsListMenuItem, SettingsListProps, SettingsRow, SettingsRowLayout, SettingsRowProps, SettingsSection, SettingsSectionProps } from "./primitives/settings.js";
93
95
  import { PageHeader, PageHeaderProps } from "./primitives/page-header.js";
94
96
  import { Alert, AlertDescription, AlertProps, AlertTitle, AlertTone } from "./primitives/alert.js";
95
97
  import { Pagination, PaginationProps } from "./primitives/pagination.js";
@@ -135,4 +137,4 @@ import { QuestionPreview, QuestionPreviewProps } from "./tool-previews/question-
135
137
  import { DiffPreview, DiffPreviewProps } from "./tool-previews/diff-preview.js";
136
138
  import { RedactedDocSegment, RedactedDocument, RedactedDocumentData, RedactedDocumentProps, RevealResult } from "./redaction/redacted-document.js";
137
139
  import "./redaction.js";
138
- export { ActiveProjectActivity, ActiveSessionActivityOptions, ActiveSessionConnectionOptions, ActiveSessionConnectionState, ActiveSessionReconnectState, ActiveSessionRecord, ActiveSessionStatus, ActiveSessionTransportMode, ActiveSessionsState, AgentBranding, AgentStreamEvent, AgentTimeline, type AgentTimelineArtifactItem, type AgentTimelineCustomItem, type AgentTimelineItem, type AgentTimelineMessageItem, type AgentTimelineProps, type AgentTimelineStatusItem, 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, Badge, type BadgeProps, BeginAssistantMessageOptions, BotStreamEvent, Button, type ButtonProps, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, type CalendarDate, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, type CategoryTone, ChatAuthor, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, Checkbox, Chip, type ChipProps, CodeBlock, type CodeBlockProps, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, type CommandPreviewProps, CompleteAssistantMessageOptions, 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, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, 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, 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, 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, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, Pagination, type PaginationProps, PdfViewer, type PdfViewerConfig, type PdfViewerProps, 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, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SessionMessage, SessionPart, SessionProjectKey, type SessionUser, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarDropZone, type SidebarDropZoneProps, Skeleton, SkeletonCard, SkeletonTable, Slider, StatCard, type StatCardProps, 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, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, codeBlockGrammar, configurePdfViewer, copyText, createAuthFetcher, detectFileFormat, fenceInfo, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatCalendarDate, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isStreamingAtom, isViewerMessage, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, localToday, messagesAtom, numericColumns, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, showsTaskPriority, tableCsv, taskProgress, taskStatus, timeAgo, toneFor, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
140
+ export { ActiveProjectActivity, ActiveSessionActivityOptions, ActiveSessionConnectionOptions, ActiveSessionConnectionState, ActiveSessionReconnectState, ActiveSessionRecord, ActiveSessionStatus, ActiveSessionTransportMode, ActiveSessionsState, AgentBranding, AgentStreamEvent, AgentTimeline, type AgentTimelineArtifactItem, type AgentTimelineCustomItem, type AgentTimelineItem, type AgentTimelineMessageItem, type AgentTimelineProps, type AgentTimelineStatusItem, 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, Button, type ButtonProps, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, type CalendarDate, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, type CategoryTone, ChatAuthor, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, Checkbox, Chip, type ChipProps, CodeBlock, type CodeBlockProps, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, type CommandPreviewProps, CompleteAssistantMessageOptions, 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, 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, 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, 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, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, Pagination, type PaginationProps, PdfViewer, type PdfViewerConfig, type PdfViewerProps, 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, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SessionMessage, SessionPart, SessionProjectKey, type SessionUser, SettingsList, type SettingsListAction, type SettingsListColumns, SettingsListItem, type SettingsListItemProps, type SettingsListMenuItem, type SettingsListProps, 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, StatCard, type StatCardProps, 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, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, codeBlockGrammar, configurePdfViewer, copyText, createAuthFetcher, detectFileFormat, fenceInfo, fieldMessageId, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatCalendarDate, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isStreamingAtom, isViewerMessage, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, localToday, messagesAtom, numericColumns, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, showsTaskPriority, tableCsv, taskProgress, taskStatus, timeAgo, toneFor, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
package/dist/index.js CHANGED
@@ -46,6 +46,8 @@ import { CodeBlock, CopyButton } from "./markdown/code-block.js";
46
46
  import { InlineCode } from "./primitives/code-block.js";
47
47
  import { ThemeToggle, useTheme } from "./primitives/theme-toggle.js";
48
48
  import { PageShell } from "./primitives/page-shell.js";
49
+ import { Field, fieldMessageId } from "./primitives/field.js";
50
+ import { SettingsList, SettingsListItem, SettingsRow, SettingsSection } from "./primitives/settings.js";
49
51
  import { PageHeader } from "./primitives/page-header.js";
50
52
  import { Alert, AlertDescription, AlertTitle } from "./primitives/alert.js";
51
53
  import { Pagination } from "./primitives/pagination.js";
@@ -119,4 +121,4 @@ import { addMessage, addParts, clearChat, isStreamingAtom, messagesAtom, partMap
119
121
  import { copyText } from "./utils/copy-text.js";
120
122
  import { timeAgo } from "./utils/time-ago.js";
121
123
  import { RedactedDocument } from "./redaction/redacted-document.js";
122
- export { AgentTimeline, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, ApiSchema, ApprovalCard, ApprovalDiffSummary, ArtifactPane, AuthHeader, Avatar, AvatarFallback, AvatarImage, Badge, Button, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatContainer, ChatMessage, Checkbox, Chip, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, 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, ExpandedToolDetail, FileArtifactPane, FileCard, FileList, FilePreview, FileTabs, FileTree, FilterField, GitHubLoginButton, GlobResultsPreview, GrepResultsPreview, Heading, HelpText, IconTile, InlineCode, InlineThinkingItem, InlineToolItem, Input, Label, LiveDuration, LoginLayout, Logo, Markdown, MessageAuthor, MessageList, Metric, MetricStrip, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, OpenUIArtifactRenderer, PageHeader, PageShell, Pagination, PdfViewer, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QuestionPreview, RadioGroup, RadioGroupItem, RealtimeSessionRegistry, RedactedDocument, RichFileTree, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarDropZone, Skeleton, SkeletonCard, SkeletonTable, Slider, 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, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, codeBlockGrammar, configurePdfViewer, copyText, createAuthFetcher, detectFileFormat, fenceInfo, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatCalendarDate, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isStreamingAtom, isViewerMessage, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, localToday, messagesAtom, numericColumns, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, showsTaskPriority, tableCsv, taskProgress, taskStatus, timeAgo, toneFor, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
124
+ export { AgentTimeline, Alert, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, ApiSchema, ApprovalCard, ApprovalDiffSummary, ArtifactPane, AuthHeader, Avatar, AvatarFallback, AvatarImage, Badge, Button, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatContainer, ChatMessage, Checkbox, Chip, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, 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, ExpandedToolDetail, Field, FileArtifactPane, FileCard, FileList, FilePreview, FileTabs, FileTree, FilterField, GitHubLoginButton, GlobResultsPreview, GrepResultsPreview, Heading, HelpText, IconTile, InlineCode, InlineThinkingItem, InlineToolItem, Input, Label, LiveDuration, LoginLayout, Logo, Markdown, MessageAuthor, MessageList, Metric, MetricStrip, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, OpenUIArtifactRenderer, PageHeader, PageShell, Pagination, PdfViewer, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QuestionPreview, RadioGroup, RadioGroupItem, RealtimeSessionRegistry, RedactedDocument, RichFileTree, RunGroup, RunPhaseList, RunRowShell, RunRowStatusDot, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, SettingsList, SettingsListItem, SettingsRow, SettingsSection, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, SidebarDropZone, Skeleton, SkeletonCard, SkeletonTable, Slider, 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, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, codeBlockGrammar, configurePdfViewer, copyText, createAuthFetcher, detectFileFormat, fenceInfo, fieldMessageId, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatCalendarDate, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isStreamingAtom, isViewerMessage, ixControl, ixControlAfter, ixControlSoft, ixField, ixRow, ixSelected, ixTabUnderline, localToday, messagesAtom, numericColumns, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, showsTaskPriority, tableCsv, taskProgress, taskStatus, timeAgo, toneFor, truncateText, unregisterActiveSession, updateActiveSessionMeta, updatePart, useActiveSession, useActiveSessions, useActiveSessionsState, useApiKey, useAuth, useAutoScroll, useDropdownMenu, useHasBackgroundRunningSessions, useLiveTime, useNavbarSessions, useProjectActivity, useProjectSessions, useRealtimeSession, useRunCollapseState, useRunGroups, useSSEStream, useSdkSession, useSessionsByActivity, useTheme, useToast, useToolCallStream, useTotalRunningSessions, validateOpenUIJsonArtifact, validateOpenUIJsonNode };
@@ -3,7 +3,7 @@ import { controlHeight, controlRadius, controlSizes, controlText, fieldPresentat
3
3
  import { ixControlSoft, ixSelected, ixTabUnderline } from "./lib/interaction.js";
4
4
  //#region src/presentation.d.ts
5
5
  export declare const buttonVariants: (props?: ({
6
- variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "sandbox" | "secondary" | null | undefined;
6
+ variant?: "default" | "destructive" | "destructive-outline" | "ghost" | "link" | "outline" | "sandbox" | "secondary" | null | undefined;
7
7
  size?: "compact" | "default" | "display" | "icon" | "icon-lg" | "icon-sm" | "lg" | "md" | "sm" | "touch" | "xl" | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  export declare const inputVariants: (props?: ({
@@ -12,6 +12,7 @@ const buttonVariants = cva(`inline-flex items-center justify-center gap-2 whites
12
12
  default: `bg-primary text-primary-foreground hover:bg-primary/90 active:scale-[0.97] ${ixControl}`,
13
13
  destructive: `bg-destructive text-destructive-foreground hover:bg-destructive/90 active:scale-[0.97] ${ixControl}`,
14
14
  outline: `border border-border bg-card hover:bg-muted active:scale-[0.97] text-foreground ${ixControl}`,
15
+ "destructive-outline": `border border-[var(--surface-danger-border)] bg-card hover:bg-[var(--surface-danger-bg)] active:scale-[0.97] text-[var(--surface-danger-text)] ${ixControl}`,
15
16
  secondary: `bg-muted border border-border text-foreground hover:bg-muted/80 active:scale-[0.97] ${ixControl}`,
16
17
  ghost: `hover:text-foreground text-muted-foreground border border-transparent ${ixControlSoft}`,
17
18
  link: `text-[var(--accent-text)] underline-offset-4 hover:underline ${ixControlSoft}`,
@@ -1,7 +1,15 @@
1
1
  import * as React from "react";
2
2
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
3
3
  //#region src/primitives/avatar.d.ts
4
- declare const Avatar: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
4
+ declare const AVATAR_SIZES: {
5
+ readonly sm: "h-8 w-8";
6
+ readonly md: "h-10 w-10";
7
+ };
8
+ export interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> {
9
+ /** sm 32px (a list row beside a two-line name), md 40px (default). */
10
+ size?: keyof typeof AVATAR_SIZES;
11
+ }
12
+ declare const Avatar: React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLSpanElement>>;
5
13
  declare const AvatarImage: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarImageProps & React.RefAttributes<HTMLImageElement>, "ref"> & React.RefAttributes<HTMLImageElement>>;
6
14
  declare const AvatarFallback: React.ForwardRefExoticComponent<Omit<AvatarPrimitive.AvatarFallbackProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
7
15
  //#endregion
@@ -3,9 +3,13 @@ import * as React from "react";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
  import * as AvatarPrimitive from "@radix-ui/react-avatar";
5
5
  //#region src/primitives/avatar.tsx
6
- const Avatar = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Root, {
6
+ const AVATAR_SIZES = {
7
+ sm: "h-8 w-8",
8
+ md: "h-10 w-10"
9
+ };
10
+ const Avatar = React.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ jsx(AvatarPrimitive.Root, {
7
11
  ref,
8
- className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className),
12
+ className: cn("relative flex shrink-0 overflow-hidden rounded-full", AVATAR_SIZES[size], className),
9
13
  ...props
10
14
  }));
11
15
  Avatar.displayName = AvatarPrimitive.Root.displayName;
@@ -2,7 +2,8 @@ import { buttonVariants } from "../presentation.js";
2
2
  import * as React from "react";
3
3
  //#region src/primitives/button.d.ts
4
4
  export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5
- variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "sandbox" | "bare" | null;
5
+ /** `destructive-outline` is a destructive action at rest, such as "Delete project…", whose confirmation uses `destructive`. */
6
+ variant?: "default" | "destructive" | "destructive-outline" | "outline" | "secondary" | "ghost" | "link" | "sandbox" | "bare" | null;
6
7
  /** sm 32px, default/md 36px (`--control-height`), lg 44px; icon sizes are squares on the same heights. */
7
8
  size?: "default" | "md" | "sm" | "lg" | "xl" | "display" | "icon" | "icon-sm" | "icon-lg" | "compact" | "touch" | null;
8
9
  asChild?: boolean;
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ //#region src/primitives/field.d.ts
3
+ export interface FieldProps {
4
+ label: string;
5
+ /** The control's id; the label targets it. */
6
+ htmlFor: string;
7
+ /** Help that explains what the setting does, shown from an info button. */
8
+ info?: React.ReactNode;
9
+ /** One short sentence the person needs to fill the field in. */
10
+ hint?: React.ReactNode;
11
+ /** A validation error. The control should set `aria-invalid` and reference {@link fieldMessageId}. */
12
+ error?: React.ReactNode;
13
+ /** A non-error status, such as a check that passed. */
14
+ status?: React.ReactNode;
15
+ /** Trailing content in the label row, such as a "Use default" action. */
16
+ aside?: React.ReactNode;
17
+ children: React.ReactNode;
18
+ }
19
+ /** The id of a field's hint, error, or status line, for the control's `aria-describedby`. */
20
+ export declare function fieldMessageId(htmlFor: string): string;
21
+ /**
22
+ * A labelled form field: the label (with an optional info tip and a trailing
23
+ * aside) above the control, and one message line under it. Every line is
24
+ * 14px; an error replaces the status and the hint and is announced.
25
+ */
26
+ export declare function Field({ label, htmlFor, info, hint, error, status, aside, children }: FieldProps): React.JSX.Element;
27
+ //#endregion
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ import { cn } from "../lib/utils.js";
3
+ import { Label } from "./label.js";
4
+ import { InfoTip } from "./info-tip.js";
5
+ import "react";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
7
+ import { CircleAlert } from "lucide-react";
8
+ //#region src/primitives/field.tsx
9
+ /** The id of a field's hint, error, or status line, for the control's `aria-describedby`. */
10
+ function fieldMessageId(htmlFor) {
11
+ return `${htmlFor}-message`;
12
+ }
13
+ /**
14
+ * A labelled form field: the label (with an optional info tip and a trailing
15
+ * aside) above the control, and one message line under it. Every line is
16
+ * 14px; an error replaces the status and the hint and is announced.
17
+ */
18
+ function Field({ label, htmlFor, info, hint, error, status, aside, children }) {
19
+ const message = error ?? status ?? hint;
20
+ return /* @__PURE__ */ jsxs("div", {
21
+ className: "min-w-0 space-y-2",
22
+ children: [
23
+ /* @__PURE__ */ jsxs("div", {
24
+ className: "flex min-h-6 items-center justify-between gap-2",
25
+ children: [/* @__PURE__ */ jsxs("span", {
26
+ className: "flex min-w-0 items-center gap-1.5",
27
+ children: [/* @__PURE__ */ jsx(Label, {
28
+ htmlFor,
29
+ className: "leading-6 text-foreground",
30
+ children: label
31
+ }), info && /* @__PURE__ */ jsx(InfoTip, {
32
+ label,
33
+ children: info
34
+ })]
35
+ }), aside]
36
+ }),
37
+ children,
38
+ message && /* @__PURE__ */ jsxs("div", {
39
+ id: fieldMessageId(htmlFor),
40
+ role: error ? "alert" : void 0,
41
+ className: cn("text-sm leading-6 [overflow-wrap:anywhere]", error ? "flex items-start gap-1.5 text-[var(--surface-danger-text)]" : "text-muted-foreground"),
42
+ children: [error && /* @__PURE__ */ jsx(CircleAlert, {
43
+ "aria-hidden": "true",
44
+ className: "mt-1 size-4 shrink-0"
45
+ }), error ? /* @__PURE__ */ jsx("span", {
46
+ className: "min-w-0",
47
+ children: message
48
+ }) : message]
49
+ })
50
+ ]
51
+ });
52
+ }
53
+ //#endregion
54
+ export { Field, fieldMessageId };
@@ -0,0 +1,50 @@
1
+ "use client";
2
+ import { Button } from "./button.js";
3
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./tooltip.js";
4
+ import * as React from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Info } from "lucide-react";
7
+ //#region src/primitives/info-tip.tsx
8
+ /**
9
+ * An info button beside a label, for help that explains a setting. It opens
10
+ * on hover and keyboard focus and toggles on tap. The glyph stays 20px; on a
11
+ * coarse pointer a transparent 44px hit area surrounds it. It brings its own
12
+ * provider, so a row or field works in an app that never mounted one.
13
+ */
14
+ function InfoTip({ label, children }) {
15
+ const [open, setOpen] = React.useState(false);
16
+ const openAtPress = React.useRef(false);
17
+ return /* @__PURE__ */ jsx(TooltipProvider, {
18
+ delayDuration: 150,
19
+ children: /* @__PURE__ */ jsxs(Tooltip, {
20
+ open,
21
+ onOpenChange: setOpen,
22
+ children: [/* @__PURE__ */ jsx(TooltipTrigger, {
23
+ asChild: true,
24
+ children: /* @__PURE__ */ jsx(Button, {
25
+ type: "button",
26
+ variant: "bare",
27
+ "aria-label": `About ${label}`,
28
+ onPointerDown: () => {
29
+ openAtPress.current = open;
30
+ },
31
+ onClick: (event) => {
32
+ event.preventDefault();
33
+ setOpen(event.detail === 0 ? !open : !openAtPress.current);
34
+ },
35
+ className: "relative inline-flex size-5 shrink-0 items-center justify-center rounded-full text-muted-foreground hover:text-foreground pointer-coarse:before:absolute pointer-coarse:before:-inset-3 pointer-coarse:before:content-['']",
36
+ children: /* @__PURE__ */ jsx(Info, {
37
+ "aria-hidden": "true",
38
+ className: "size-4"
39
+ })
40
+ })
41
+ }), /* @__PURE__ */ jsx(TooltipContent, {
42
+ side: "top",
43
+ className: "max-w-72 text-sm leading-5",
44
+ children
45
+ })]
46
+ })
47
+ });
48
+ }
49
+ //#endregion
50
+ export { InfoTip };
@@ -1,3 +1,4 @@
1
+ import * as React from "react";
1
2
  import { ReactNode } from "react";
2
3
  //#region src/primitives/page-shell.d.ts
3
4
  export interface PageShellProps {
@@ -6,6 +7,18 @@ export interface PageShellProps {
6
7
  navigation?: ReactNode;
7
8
  article?: ReactNode;
8
9
  outline?: ReactNode;
10
+ /** Spans the reading layout above navigation and article, such as the page's `PageHeader`. */
11
+ header?: ReactNode;
12
+ /**
13
+ * The reading layout's measure. `reading` (default) is the 42rem document
14
+ * column. `settings` is a 48rem column of cards whose navigation is a sticky
15
+ * 13rem column of rows when its frame is at least 60rem wide, and a sticky
16
+ * 56px tab strip under the header below that; the current link
17
+ * (`aria-current="page"`) is centred by scrolling the strip only. Put
18
+ * links (or a list of links) in `navigation`; an `svg` in a link shows only
19
+ * in the column, and an element with `data-count` sits at its end.
20
+ */
21
+ measure?: "reading" | "settings";
9
22
  navigationLabel?: string;
10
23
  outlineLabel?: string;
11
24
  className?: string;
@@ -13,8 +26,11 @@ export interface PageShellProps {
13
26
  /**
14
27
  * Ported from sandbox-ui/src/primitives/page-shell.tsx. An optional bounded
15
28
  * width, gutter and vertical rhythm, not an application shell or a card grid.
16
- * The caller owns landmarks, routing, auth, navigation and data state. Use
17
- * className to override the bound/gutters, or omit it for a workbench layout.
29
+ * The caller owns landmarks, routing, auth, navigation and data state.
30
+ * Without slots, className overrides the bound/gutters, or omit it for a
31
+ * workbench layout. With slots it goes on the reading grid. With
32
+ * `measure="settings"` it goes on the frame, the width the layout answers to,
33
+ * so a `max-w-*` there bounds the measure and a narrow frame gets the strip.
18
34
  */
19
- export declare function PageShell({ children, className, navigation, article, outline, navigationLabel, outlineLabel }: PageShellProps): import("react").JSX.Element;
35
+ export declare function PageShell({ children, className, navigation, article, outline, header, measure, navigationLabel, outlineLabel }: PageShellProps): React.JSX.Element;
20
36
  //#endregion
@@ -1,32 +1,90 @@
1
+ "use client";
1
2
  import { cn } from "../lib/utils.js";
3
+ import * as React from "react";
2
4
  import { jsx, jsxs } from "react/jsx-runtime";
3
5
  //#region src/primitives/page-shell.tsx
4
6
  /**
7
+ * Centre the current link of a horizontally scrolling nav, so the links on
8
+ * both sides show that the strip scrolls. It moves the strip, never the page.
9
+ */
10
+ function useCurrentLinkInView(ref, enabled) {
11
+ React.useEffect(() => {
12
+ const nav = ref.current;
13
+ if (!enabled || !nav) return;
14
+ const reveal = () => {
15
+ if (nav.scrollWidth <= nav.clientWidth) return;
16
+ const current = nav.querySelector("[aria-current=\"page\"]");
17
+ if (!current) return;
18
+ const strip = nav.getBoundingClientRect();
19
+ const link = current.getBoundingClientRect();
20
+ nav.scrollLeft += link.left + link.width / 2 - (strip.left + strip.width / 2);
21
+ };
22
+ let live = true;
23
+ reveal();
24
+ document.fonts?.ready.then(() => {
25
+ if (live) reveal();
26
+ });
27
+ const resize = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(reveal);
28
+ resize?.observe(nav);
29
+ const links = new MutationObserver(reveal);
30
+ links.observe(nav, {
31
+ subtree: true,
32
+ childList: true,
33
+ characterData: true,
34
+ attributes: true,
35
+ attributeFilter: ["aria-current"]
36
+ });
37
+ return () => {
38
+ live = false;
39
+ resize?.disconnect();
40
+ links.disconnect();
41
+ };
42
+ }, [ref, enabled]);
43
+ }
44
+ /**
5
45
  * Ported from sandbox-ui/src/primitives/page-shell.tsx. An optional bounded
6
46
  * width, gutter and vertical rhythm, not an application shell or a card grid.
7
- * The caller owns landmarks, routing, auth, navigation and data state. Use
8
- * className to override the bound/gutters, or omit it for a workbench layout.
47
+ * The caller owns landmarks, routing, auth, navigation and data state.
48
+ * Without slots, className overrides the bound/gutters, or omit it for a
49
+ * workbench layout. With slots it goes on the reading grid. With
50
+ * `measure="settings"` it goes on the frame, the width the layout answers to,
51
+ * so a `max-w-*` there bounds the measure and a narrow frame gets the strip.
9
52
  */
10
- function PageShell({ children, className, navigation, article, outline, navigationLabel = "Sections", outlineLabel = "On this page" }) {
11
- if (navigation || article || outline) return /* @__PURE__ */ jsxs("div", {
12
- className: cn("tangle-reading-shell", className),
13
- children: [
14
- navigation && /* @__PURE__ */ jsx("nav", {
15
- "aria-label": navigationLabel,
16
- className: "tangle-reading-nav",
17
- children: navigation
18
- }),
19
- /* @__PURE__ */ jsx("article", {
20
- className: "tangle-reading-article",
21
- children: article ?? children
22
- }),
23
- outline && /* @__PURE__ */ jsx("aside", {
24
- "aria-label": outlineLabel,
25
- className: "tangle-reading-outline",
26
- children: outline
27
- })
28
- ]
29
- });
53
+ function PageShell({ children, className, navigation, article, outline, header, measure = "reading", navigationLabel = "Sections", outlineLabel = "On this page" }) {
54
+ const navRef = React.useRef(null);
55
+ const settings = measure === "settings";
56
+ useCurrentLinkInView(navRef, settings && Boolean(navigation));
57
+ if (navigation || article || outline || header || settings) {
58
+ const shell = /* @__PURE__ */ jsxs("div", {
59
+ className: cn("tangle-reading-shell", !settings && className),
60
+ "data-measure": settings ? "settings" : void 0,
61
+ children: [
62
+ header && /* @__PURE__ */ jsx("div", {
63
+ className: "tangle-reading-header",
64
+ children: header
65
+ }),
66
+ navigation && /* @__PURE__ */ jsx("nav", {
67
+ ref: navRef,
68
+ "aria-label": navigationLabel,
69
+ className: "tangle-reading-nav",
70
+ children: navigation
71
+ }),
72
+ /* @__PURE__ */ jsx("article", {
73
+ className: "tangle-reading-article",
74
+ children: article ?? children
75
+ }),
76
+ outline && /* @__PURE__ */ jsx("aside", {
77
+ "aria-label": outlineLabel,
78
+ className: "tangle-reading-outline",
79
+ children: outline
80
+ })
81
+ ]
82
+ });
83
+ return settings ? /* @__PURE__ */ jsx("div", {
84
+ className: cn("tangle-settings-frame", className),
85
+ children: shell
86
+ }) : shell;
87
+ }
30
88
  return /* @__PURE__ */ jsx("div", {
31
89
  className: cn("mx-auto min-w-0 w-full max-w-6xl space-y-8 px-6 py-8 lg:px-8", className),
32
90
  children
@@ -0,0 +1,125 @@
1
+ import * as React from "react";
2
+ //#region src/primitives/settings.d.ts
3
+ export type SettingsRowLayout = "inline" | "compact" | "stacked";
4
+ export interface SettingsRowProps {
5
+ /** The row's id, for a deep link such as `#timezone`. */
6
+ id?: string;
7
+ label: string;
8
+ /** One line that states a consequence the person needs to act. Most rows need none. */
9
+ description?: React.ReactNode;
10
+ /** Help that explains the setting, shown from an info button beside the label. */
11
+ info?: React.ReactNode;
12
+ /**
13
+ * The control's id. The label targets it, and the row's description, error
14
+ * or lock reason renders at {@link fieldMessageId}. When the row's only child
15
+ * carries this id, the row adds that message to its `aria-describedby` and
16
+ * marks it invalid on error; otherwise point the control there yourself.
17
+ */
18
+ htmlFor?: string;
19
+ /** A save state after the label, such as "Saving…" or "Saved". It is announced politely. */
20
+ status?: React.ReactNode;
21
+ /** Replaces the description in danger text and is announced. */
22
+ error?: React.ReactNode;
23
+ /** Shows a Retry action after the error. */
24
+ onRetry?: () => void;
25
+ /**
26
+ * `inline` (default): text left, control right, stacked below 34rem.
27
+ * `compact`: the control keeps its own width and stays on the line (switches, single buttons).
28
+ * `stacked`: the control spans the row under the text (textareas, lists).
29
+ */
30
+ layout?: SettingsRowLayout;
31
+ /** Why the control is unavailable, naming who can change it. Replaces the description after a lock glyph. */
32
+ disabledReason?: React.ReactNode;
33
+ children?: React.ReactNode;
34
+ }
35
+ /**
36
+ * One setting: its label, an optional consequence line and its control. The
37
+ * label carries the save status after it; an error or a lock reason replaces
38
+ * the description. Rows inside a {@link SettingsSection} are divided by a
39
+ * hairline and stack when the card is narrower than 34rem.
40
+ */
41
+ export declare function SettingsRow({ id, label, description, info, htmlFor, status, error, onRetry, layout, disabledReason, children }: SettingsRowProps): React.JSX.Element;
42
+ export interface SettingsSectionProps {
43
+ /** The section's anchor: `#id` scrolls to it. The title's id is `${id}-title`. */
44
+ id: string;
45
+ title: string;
46
+ /** One short line, at most about twelve words. Leave it out when the title says enough. */
47
+ description?: React.ReactNode;
48
+ /** Help that explains the section, shown from an info button beside the title. */
49
+ info?: React.ReactNode;
50
+ /** Section actions, top right, such as "Edit brief" or "Add source". */
51
+ actions?: React.ReactNode;
52
+ /** `danger` draws the card's edge and title in the danger tone. */
53
+ tone?: "default" | "danger";
54
+ /** The card's footer on the muted plane, such as the one save bar a section may have. */
55
+ footer?: React.ReactNode;
56
+ /** Rows, lists and any other blocks of the section. */
57
+ children?: React.ReactNode;
58
+ }
59
+ /**
60
+ * One settings card: a 16px title with optional description, info tip and
61
+ * actions, then its rows and lists, then an optional footer. The card is the
62
+ * width container its rows and lists respond to.
63
+ */
64
+ export declare function SettingsSection({ id, title, description, info, actions, tone, footer, children }: SettingsSectionProps): React.JSX.Element;
65
+ /** Track widths for a {@link SettingsList}. Every slot its items use needs a column, except status and menu, which have fallbacks. */
66
+ export interface SettingsListColumns {
67
+ /** A logo or avatar column, such as `"36px"`. */
68
+ leading?: string;
69
+ /** The title column; `minmax(0,1fr)` by default. */
70
+ main?: string;
71
+ /** A fixed state column, such as `"8rem"`. Below 34rem the state moves under the title, full width. */
72
+ status?: string;
73
+ /** A fixed column for the at-rest action, such as `"9rem"`. Below 34rem it shrinks to its content. */
74
+ action?: string;
75
+ /** A column for the ⋯ menu, such as `"36px"`. Without it the menu ends the action cell. */
76
+ menu?: string;
77
+ }
78
+ export interface SettingsListProps {
79
+ columns: SettingsListColumns;
80
+ "aria-label"?: string;
81
+ children?: React.ReactNode;
82
+ }
83
+ /**
84
+ * Comparable rows whose status and action columns line up across items (CSS
85
+ * subgrid). Below 34rem each item becomes two lines: the title and meta with
86
+ * its action on the right, then the state under them at full width.
87
+ */
88
+ export declare function SettingsList({ columns, children, "aria-label": ariaLabel }: SettingsListProps): React.JSX.Element;
89
+ export interface SettingsListMenuItem {
90
+ label: string;
91
+ onSelect: () => void;
92
+ /** Destructive actions (delete, remove, revoke) belong here, in the danger tone. */
93
+ tone?: "danger";
94
+ /** Shown under the label; the item stays focusable so the reason is read, and selecting it does nothing. */
95
+ disabledReason?: React.ReactNode;
96
+ }
97
+ export interface SettingsListAction {
98
+ label: string;
99
+ onSelect: () => void;
100
+ /** Why the action is unavailable, naming who can take it. The button stays focusable, does nothing, and the reason shows under the meta. */
101
+ disabledReason?: React.ReactNode;
102
+ }
103
+ export interface SettingsListItemProps {
104
+ /** A logo or avatar, in the list's `leading` column. */
105
+ leading?: React.ReactNode;
106
+ /** The item's name. Make it the link to the item's detail. */
107
+ title: React.ReactNode;
108
+ /** One line under the title, such as an address or a schedule. */
109
+ meta?: React.ReactNode;
110
+ /** The item's state as plain text, or a control that sets it (a role select). */
111
+ status?: React.ReactNode;
112
+ /** Shown under the meta in danger text and announced. */
113
+ error?: React.ReactNode;
114
+ /** The one verb the item needs at rest. It is drawn as an outline button, so it never reads as the state beside it. */
115
+ action?: SettingsListAction;
116
+ /** Everything else, including destructive actions, behind a ⋯ button. */
117
+ menu?: SettingsListMenuItem[];
118
+ }
119
+ /**
120
+ * One item in a {@link SettingsList}; each slot goes to the list's column of
121
+ * that name. Without a status column the state follows the meta, and without
122
+ * a menu column the ⋯ menu ends the action cell.
123
+ */
124
+ export declare function SettingsListItem({ leading, title, meta, status, error, action, menu }: SettingsListItemProps): React.JSX.Element;
125
+ //#endregion