@tangle-network/ui 11.16.11 → 11.17.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 +12 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -1
- package/dist/primitives/badge.d.ts +7 -0
- package/dist/primitives/badge.js +3 -3
- package/dist/primitives/chip.d.ts +38 -0
- package/dist/primitives/chip.js +41 -0
- package/dist/primitives/icon-tile.d.ts +32 -0
- package/dist/primitives/icon-tile.js +49 -0
- package/dist/primitives/tag.d.ts +36 -0
- package/dist/primitives/tag.js +42 -0
- package/dist/primitives/tone.d.ts +40 -0
- package/dist/primitives/tone.js +106 -0
- package/dist/primitives.d.ts +5 -1
- package/dist/primitives.js +5 -1
- package/package.json +2 -2
- package/src/primitives/badge.tsx +17 -4
- package/src/primitives/chip.test.tsx +178 -0
- package/src/primitives/chip.tsx +108 -0
- package/src/primitives/icon-tile.stories.tsx +74 -0
- package/src/primitives/icon-tile.tsx +96 -0
- package/src/primitives/index.ts +12 -0
- package/src/primitives/tag-chip.stories.tsx +226 -0
- package/src/primitives/tag.tsx +94 -0
- package/src/primitives/tone.ts +130 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @tangle-network/ui
|
|
2
2
|
|
|
3
|
+
## 11.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ff1cb8b: Add `Tag`, `Chip` and `IconTile` on brand's categorical tones, plus `toneFor`, `CATEGORY_TONES` and `TONE_CLASSES`.
|
|
8
|
+
|
|
9
|
+
- `Tag`: a static label (tone, `soft` or `outline` emphasis, `sm` or `md`), squared off so a category never shares the status pill's round silhouette. `onRemove` adds a native, named remove button.
|
|
10
|
+
- `Chip`: a native button. Without `selected` it is an action chip; with `selected` it is a filter or toggle with `aria-pressed`, and a selected chip shows a check, a stronger border and a deeper fill, never colour alone.
|
|
11
|
+
- `IconTile`: a square identity mark that falls back from an image to a glyph to initials, with a stable tone derived from the name. Decorative unless `label` is given.
|
|
12
|
+
|
|
13
|
+
`StatusPill` remains the one status primitive. `Badge`'s sandbox lifecycle variants (`running`, `creating`, `stopped`, `warm`, `cold`, `deleted`) are deprecated compatibility over the status triples: `running` now paints success (was teal), `creating` info (was violet) and `warm` warning (was orange). No export is removed.
|
|
14
|
+
|
|
3
15
|
## 11.16.11
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -67,6 +67,10 @@ import { Heading, HeadingProps, HeadingVariant } from "./primitives/heading.js";
|
|
|
67
67
|
import { PageShell, PageShellProps } from "./primitives/page-shell.js";
|
|
68
68
|
import { PageHeader, PageHeaderProps } from "./primitives/page-header.js";
|
|
69
69
|
import { StatusPill, StatusPillProps, StatusTone } from "./primitives/status-pill.js";
|
|
70
|
+
import { CATEGORY_TONES, CategoryTone, TONE_CLASSES, Tone, ToneClasses, toneFor } from "./primitives/tone.js";
|
|
71
|
+
import { Tag, TagProps } from "./primitives/tag.js";
|
|
72
|
+
import { Chip, ChipProps } from "./primitives/chip.js";
|
|
73
|
+
import { IconTile, IconTileProps, initialsOf } from "./primitives/icon-tile.js";
|
|
70
74
|
import { Metric, MetricProps, MetricStrip, MetricStripProps } from "./primitives/metric-strip.js";
|
|
71
75
|
import { FilterField, FilterFieldProps, Toolbar, ToolbarProps } from "./primitives/toolbar.js";
|
|
72
76
|
import { Logo, LogoProps, TangleKnot } from "./primitives.js";
|
|
@@ -99,4 +103,4 @@ import { QuestionPreview, QuestionPreviewProps } from "./tool-previews/question-
|
|
|
99
103
|
import { DiffPreview, DiffPreviewProps } from "./tool-previews/diff-preview.js";
|
|
100
104
|
import { RedactedDocSegment, RedactedDocument, RedactedDocumentData, RedactedDocumentProps, RevealResult } from "./redaction/redacted-document.js";
|
|
101
105
|
import "./redaction.js";
|
|
102
|
-
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, AppendUserMessageOptions, ApplySdkEventOptions, ArtifactPane, type ArtifactPaneProps, AuthHeader, type AuthHeaderProps, AuthUser, AutomationStreamEvent, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, BeginAssistantMessageOptions, BotStreamEvent, Button, type ButtonProps, CSV_PREVIEW_ROW_LIMIT, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, CodeBlock, type CodeBlockProps, CommandPreview, type CommandPreviewProps, CompleteAssistantMessageOptions, ConnectionState, CopyButton, CustomToolRenderer, 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, type FileFormat, type FileNode, FilePreview, type FilePreviewKind, type FilePreviewProps, type FileTabData, FileTabs, type FileTabsProps, FileTree, type FileTreeProps, type FileTreeVisibilityOptions, FilterField, type FilterFieldProps, FinalTextPart, GitHubLoginButton, type GitHubLoginButtonProps, GlobResultsPreview, type GlobResultsPreviewProps, GrepResultsPreview, type GrepResultsPreviewProps, GroupedMessage, Heading, type HeadingProps, type HeadingVariant, InlineCode, type InlineCodeProps, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, Input, type InputProps, Label, LiveDuration, LoginLayout, type LoginLayoutProps, Logo, type LogoProps, Markdown, type MarkdownProps, 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, Progress, QuestionPreview, type QuestionPreviewProps, 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, 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, SessionMessage, SessionPart, SessionProjectKey, type SessionUser, SidebarDropZone, type SidebarDropZoneProps, Skeleton, SkeletonCard, SkeletonTable, StatCard, type StatCardProps, StatusPill, type StatusPillProps, type StatusTone, Switch, TOOL_CATEGORY_ICONS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TangleKnot, TaskStreamEvent, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TerminalStreamEvent, TextPart, TextShimmer, type TextShimmerProps, Textarea, type TextareaProps, ThemeToggle, ThinkingIndicator, type ThinkingIndicatorProps, type Toast, ToastContainer, ToastProvider, type ToolCallData, ToolCallFeed, type ToolCallFeedProps, type ToolCallStatus, type ToolCallType, ToolCategory, ToolDisplayMetadata, ToolPart, ToolState, ToolStatus, ToolTime, Toolbar, type ToolbarProps, type UploadFile, UploadProgress, type UploadProgressProps, UseAuthOptions, UseAuthResult, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, UserMenu, type UserMenuProps, UserMessage, type UserMessageProps, WebSearchPreview, type WebSearchPreviewProps, WriteFilePreview, type WriteFilePreviewProps, activeSessionsAtom, addMessage, addParts, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, copyText, createAuthFetcher, detectFileFormat, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, isStreamingAtom, messagesAtom, parseCsv, parseToolEvent, partMapAtom, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, timeAgo, 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 };
|
|
106
|
+
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, AppendUserMessageOptions, ApplySdkEventOptions, 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, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, type CategoryTone, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, Chip, type ChipProps, CodeBlock, type CodeBlockProps, CommandPreview, type CommandPreviewProps, CompleteAssistantMessageOptions, ConnectionState, CopyButton, CustomToolRenderer, 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, type FileFormat, type FileNode, FilePreview, type FilePreviewKind, type FilePreviewProps, type FileTabData, FileTabs, type FileTabsProps, FileTree, type FileTreeProps, type FileTreeVisibilityOptions, FilterField, type FilterFieldProps, FinalTextPart, GitHubLoginButton, type GitHubLoginButtonProps, GlobResultsPreview, type GlobResultsPreviewProps, GrepResultsPreview, type GrepResultsPreviewProps, GroupedMessage, Heading, type HeadingProps, type HeadingVariant, 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 MarkdownProps, 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, Progress, QuestionPreview, type QuestionPreviewProps, 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, 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, SessionMessage, SessionPart, SessionProjectKey, type SessionUser, SidebarDropZone, type SidebarDropZoneProps, Skeleton, SkeletonCard, SkeletonTable, StatCard, type StatCardProps, StatusPill, type StatusPillProps, type StatusTone, Switch, TONE_CLASSES, TOOL_CATEGORY_ICONS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TangleKnot, TaskStreamEvent, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TerminalStreamEvent, TextPart, TextShimmer, type TextShimmerProps, Textarea, type TextareaProps, ThemeToggle, ThinkingIndicator, type ThinkingIndicatorProps, 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, type UploadFile, UploadProgress, type UploadProgressProps, UseAuthOptions, UseAuthResult, UseRunGroupsOptions, UseSSEStreamOptions, UseSSEStreamResult, UseSdkSessionOptions, UseSdkSessionReturn, UseToolCallStreamReturn, UserMenu, type UserMenuProps, UserMessage, type UserMessageProps, WebSearchPreview, type WebSearchPreviewProps, WriteFilePreview, type WriteFilePreviewProps, activeSessionsAtom, addMessage, addParts, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, copyText, createAuthFetcher, detectFileFormat, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isStreamingAtom, messagesAtom, parseCsv, parseToolEvent, partMapAtom, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, 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
|
@@ -31,6 +31,10 @@ import { ThemeToggle, useTheme } from "./primitives/theme-toggle.js";
|
|
|
31
31
|
import { PageShell } from "./primitives/page-shell.js";
|
|
32
32
|
import { PageHeader } from "./primitives/page-header.js";
|
|
33
33
|
import { StatusPill } from "./primitives/status-pill.js";
|
|
34
|
+
import { CATEGORY_TONES, TONE_CLASSES, toneFor } from "./primitives/tone.js";
|
|
35
|
+
import { Tag } from "./primitives/tag.js";
|
|
36
|
+
import { Chip } from "./primitives/chip.js";
|
|
37
|
+
import { IconTile, initialsOf } from "./primitives/icon-tile.js";
|
|
34
38
|
import { Metric, MetricStrip } from "./primitives/metric-strip.js";
|
|
35
39
|
import { FilterField, Toolbar } from "./primitives/toolbar.js";
|
|
36
40
|
import { Logo, TangleKnot } from "./primitives.js";
|
|
@@ -83,4 +87,4 @@ import { addMessage, addParts, clearChat, isStreamingAtom, messagesAtom, partMap
|
|
|
83
87
|
import { copyText } from "./utils/copy-text.js";
|
|
84
88
|
import { timeAgo } from "./utils/time-ago.js";
|
|
85
89
|
import { RedactedDocument } from "./redaction/redacted-document.js";
|
|
86
|
-
export { AgentTimeline, ArtifactPane, AuthHeader, Avatar, AvatarFallback, AvatarImage, Badge, Button, CSV_PREVIEW_ROW_LIMIT, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatContainer, ChatMessage, CodeBlock, CommandPreview, CopyButton, 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, FilePreview, FileTabs, FileTree, FilterField, GitHubLoginButton, GlobResultsPreview, GrepResultsPreview, Heading, InlineCode, InlineThinkingItem, InlineToolItem, Input, Label, LiveDuration, LoginLayout, Logo, Markdown, MessageList, Metric, MetricStrip, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, OpenUIArtifactRenderer, PageHeader, PageShell, Progress, QuestionPreview, RealtimeSessionRegistry, RedactedDocument, RichFileTree, RunGroup, RunRowShell, RunRowStatusDot, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SidebarDropZone, Skeleton, SkeletonCard, SkeletonTable, StatCard, StatusPill, Switch, TOOL_CATEGORY_ICONS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TangleKnot, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TextShimmer, Textarea, ThemeToggle, ThinkingIndicator, ToastContainer, ToastProvider, ToolCallFeed, Toolbar, UploadProgress, UserMenu, UserMessage, WebSearchPreview, WriteFilePreview, activeSessionsAtom, addMessage, addParts, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, copyText, createAuthFetcher, detectFileFormat, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, isStreamingAtom, messagesAtom, parseCsv, parseToolEvent, partMapAtom, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, timeAgo, 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 };
|
|
90
|
+
export { AgentTimeline, ArtifactPane, AuthHeader, Avatar, AvatarFallback, AvatarImage, Badge, Button, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatContainer, ChatMessage, Chip, CodeBlock, CommandPreview, CopyButton, 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, FilePreview, FileTabs, FileTree, FilterField, GitHubLoginButton, GlobResultsPreview, GrepResultsPreview, Heading, IconTile, InlineCode, InlineThinkingItem, InlineToolItem, Input, Label, LiveDuration, LoginLayout, Logo, Markdown, MessageList, Metric, MetricStrip, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, OpenUIArtifactRenderer, PageHeader, PageShell, Progress, QuestionPreview, RealtimeSessionRegistry, RedactedDocument, RichFileTree, RunGroup, RunRowShell, RunRowStatusDot, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SidebarDropZone, Skeleton, SkeletonCard, SkeletonTable, StatCard, StatusPill, Switch, TONE_CLASSES, TOOL_CATEGORY_ICONS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TangleKnot, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TextShimmer, Textarea, ThemeToggle, ThinkingIndicator, ToastContainer, ToastProvider, ToolCallFeed, Toolbar, UploadProgress, UserMenu, UserMessage, WebSearchPreview, WriteFilePreview, activeSessionsAtom, addMessage, addParts, badgeVariants, bumpActiveSessionActivity, buttonVariants, clearChat, cn, copyText, createAuthFetcher, detectFileFormat, fileExtension, filterFileTree, findUnsupportedOpenUINode, focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset, formatBytes, formatDuration, formatUptime, getActiveSession, getAllActiveSessions, getAllProjectActivity, getCodeLanguage, getFormatLabel, getSanitizedMarkdownHeadingIdFromRawFragment, getSessionsByActivity, getSessionsForNavbar, getSessionsForProject, getSyntaxLanguage, getToolCategory, getToolDisplayMetadata, getToolErrorText, getTotalRunningSessionCount, hasBackgroundRunningSessions, initialsOf, isStreamingAtom, messagesAtom, parseCsv, parseToolEvent, partMapAtom, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, setActiveSessionAttention, setActiveSessionConnection, setActiveSessionError, setActiveSessionRunning, setForegroundActiveSession, 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 };
|
|
@@ -4,6 +4,13 @@ import * as React from "react";
|
|
|
4
4
|
declare const badgeVariants: (props?: ({
|
|
5
5
|
variant?: "cold" | "creating" | "default" | "deleted" | "destructive" | "error" | "info" | "outline" | "running" | "sandbox" | "secondary" | "stopped" | "success" | "warm" | "warning" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
/**
|
|
8
|
+
* `success`, `warning`, `error` and `info` paint the same triples as
|
|
9
|
+
* `StatusPill`; for a status, prefer `StatusPill`, which adds the glyph that
|
|
10
|
+
* survives greyscale. The lifecycle variants (`running`, `creating`,
|
|
11
|
+
* `stopped`, `warm`, `cold`, `deleted`) are deprecated: use sandbox-ui's
|
|
12
|
+
* lifecycle adapter.
|
|
13
|
+
*/
|
|
7
14
|
export type BadgeVariant = "default" | "secondary" | "destructive" | "outline" | "success" | "warning" | "error" | "info" | "sandbox" | "running" | "creating" | "stopped" | "warm" | "cold" | "deleted" | null;
|
|
8
15
|
export interface BadgeProps extends VariantProps<typeof badgeVariants> {
|
|
9
16
|
variant?: BadgeVariant;
|
package/dist/primitives/badge.js
CHANGED
|
@@ -14,10 +14,10 @@ const badgeVariants = cva(`inline-flex items-center gap-1.5 rounded-full border
|
|
|
14
14
|
error: "border-[var(--surface-danger-border)] bg-[var(--surface-danger-bg)] text-[var(--surface-danger-text)]",
|
|
15
15
|
info: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
|
|
16
16
|
sandbox: "border-border bg-[var(--accent-surface-soft)] text-[var(--accent-text)]",
|
|
17
|
-
running: "border-[var(--surface-
|
|
18
|
-
creating: "border-[var(--surface-
|
|
17
|
+
running: "border-[var(--surface-success-border)] bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]",
|
|
18
|
+
creating: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
|
|
19
19
|
stopped: "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
|
|
20
|
-
warm: "border-[var(--surface-
|
|
20
|
+
warm: "border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
|
|
21
21
|
cold: "border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
|
|
22
22
|
deleted: "border-[var(--surface-neutral-border)] bg-[var(--surface-neutral-bg)] text-[var(--surface-neutral-text)]"
|
|
23
23
|
} },
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Tone } from "./tone.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/primitives/chip.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A label the user presses: a native `<button>` shaped like a `Tag`.
|
|
6
|
+
*
|
|
7
|
+
* Two kinds, chosen by whether `selected` is passed:
|
|
8
|
+
*
|
|
9
|
+
* - **Action** (`selected` omitted): runs `onClick` — a suggested prompt, an
|
|
10
|
+
* "add filter" entry point.
|
|
11
|
+
* - **Filter / toggle** (`selected` is a boolean): a toggle button with
|
|
12
|
+
* `aria-pressed`. Pressing it calls `onSelectedChange(!selected)`; the caller
|
|
13
|
+
* owns the state. Use it for a set of filters (each independently on or off)
|
|
14
|
+
* or a single on/off option such as "Plan first".
|
|
15
|
+
*
|
|
16
|
+
* Selection is never shown by colour alone: a selected chip gains a check in
|
|
17
|
+
* place of its icon, a stronger border and a deeper fill, and assistive tech
|
|
18
|
+
* reads it from `aria-pressed`.
|
|
19
|
+
*
|
|
20
|
+
* For a removable label, use `Tag` with `onRemove`; a button cannot contain a
|
|
21
|
+
* second button.
|
|
22
|
+
*/
|
|
23
|
+
export interface ChipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
/** Categorical tone, or `neutral` (the default). */
|
|
26
|
+
tone?: Tone;
|
|
27
|
+
/** `soft` fills the chip; `outline` keeps only the border until selected. */
|
|
28
|
+
emphasis?: "soft" | "outline";
|
|
29
|
+
size?: "sm" | "md";
|
|
30
|
+
/** Leading glyph, drawn in the tone's icon colour. A selected chip shows a check instead. */
|
|
31
|
+
icon?: React.ReactNode;
|
|
32
|
+
/** Makes the chip a toggle button; omit for an action chip. */
|
|
33
|
+
selected?: boolean;
|
|
34
|
+
onSelectedChange?: (selected: boolean) => void;
|
|
35
|
+
}
|
|
36
|
+
declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLButtonElement>>;
|
|
37
|
+
//#endregion
|
|
38
|
+
export { Chip };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { focusRing } from "../lib/focus.js";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { TONE_CLASSES } from "./tone.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Check } from "lucide-react";
|
|
7
|
+
//#region src/primitives/chip.tsx
|
|
8
|
+
const SIZE = {
|
|
9
|
+
sm: "h-6 gap-1 px-2 text-xs [&_svg]:size-3",
|
|
10
|
+
md: "h-8 gap-1.5 px-3 text-sm [&_svg]:size-3.5"
|
|
11
|
+
};
|
|
12
|
+
const Chip = React.forwardRef(({ className, children, tone = "neutral", emphasis = "soft", size = "sm", icon, selected, onSelectedChange, onClick, type = "button", disabled, ...props }, ref) => {
|
|
13
|
+
const classes = TONE_CLASSES[tone];
|
|
14
|
+
const toggle = selected !== void 0;
|
|
15
|
+
const on = selected === true;
|
|
16
|
+
const glyph = on ? /* @__PURE__ */ jsx(Check, {}) : icon;
|
|
17
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
18
|
+
ref,
|
|
19
|
+
type,
|
|
20
|
+
disabled,
|
|
21
|
+
"aria-pressed": toggle ? on : void 0,
|
|
22
|
+
onClick: (event) => {
|
|
23
|
+
onClick?.(event);
|
|
24
|
+
if (toggle && !event.defaultPrevented) onSelectedChange?.(!on);
|
|
25
|
+
},
|
|
26
|
+
className: cn("relative inline-flex min-w-0 max-w-full shrink-0 cursor-pointer select-none items-center rounded-md border font-medium transition-[background-color,border-color,color] duration-150 ease-out before:absolute before:inset-x-0 before:-inset-y-1 before:content-[''] pointer-coarse:before:-inset-y-2.5", SIZE[size], emphasis === "outline" && !on ? classes.outline : classes.surface, !disabled && !on && classes.hover, on && classes.selected, disabled && "cursor-not-allowed opacity-50", focusRing, className),
|
|
27
|
+
...props,
|
|
28
|
+
children: [glyph ? /* @__PURE__ */ jsx("span", {
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
className: cn("inline-flex shrink-0", classes.icon),
|
|
31
|
+
children: glyph
|
|
32
|
+
}) : null, /* @__PURE__ */ jsx("span", {
|
|
33
|
+
className: "min-w-0 truncate",
|
|
34
|
+
title: typeof children === "string" ? children : void 0,
|
|
35
|
+
children
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
Chip.displayName = "Chip";
|
|
40
|
+
//#endregion
|
|
41
|
+
export { Chip };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CategoryTone } from "./tone.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/primitives/icon-tile.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A square identity mark for a row or card: a project, a channel, an account,
|
|
6
|
+
* a file kind. It shows the first of these that is available:
|
|
7
|
+
*
|
|
8
|
+
* 1. `src` — an image (a logo or favicon). If it fails to load, the tile falls
|
|
9
|
+
* through to the next option instead of showing a broken image.
|
|
10
|
+
* 2. `icon` — a glyph, drawn in the tone's icon colour.
|
|
11
|
+
* 3. `name` — up to two initials.
|
|
12
|
+
*
|
|
13
|
+
* The tone is categorical. Omit it to derive a stable one from `name`, so the
|
|
14
|
+
* same project gets the same colour on every screen. A tile is decorative
|
|
15
|
+
* unless `label` is given: next to a visible name it would only repeat it.
|
|
16
|
+
*/
|
|
17
|
+
export interface IconTileProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
18
|
+
/** Defaults to a tone derived from `name`, or violet when there is no name. */
|
|
19
|
+
tone?: CategoryTone;
|
|
20
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
21
|
+
src?: string;
|
|
22
|
+
icon?: React.ReactNode;
|
|
23
|
+
/** The thing's name. Supplies the initials and the derived tone. */
|
|
24
|
+
name?: string;
|
|
25
|
+
/** Accessible name. Give it only when no visible label names the thing. */
|
|
26
|
+
label?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Up to two initials: the first letters of the first two words, or of the one word. */
|
|
29
|
+
export declare function initialsOf(name: string): string;
|
|
30
|
+
declare const IconTile: React.ForwardRefExoticComponent<IconTileProps & React.RefAttributes<HTMLSpanElement>>;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { IconTile };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { cn } from "../lib/utils.js";
|
|
2
|
+
import { TONE_CLASSES, toneFor } from "./tone.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/primitives/icon-tile.tsx
|
|
6
|
+
const SIZE = {
|
|
7
|
+
xs: "size-5 rounded-[5px] text-[10px] [&_svg]:size-3",
|
|
8
|
+
sm: "size-6 rounded-md text-[11px] [&_svg]:size-3.5",
|
|
9
|
+
md: "size-8 rounded-md text-xs [&_svg]:size-4",
|
|
10
|
+
lg: "size-10 rounded-lg text-sm [&_svg]:size-5"
|
|
11
|
+
};
|
|
12
|
+
/** Up to two initials: the first letters of the first two words, or of the one word. */
|
|
13
|
+
function initialsOf(name) {
|
|
14
|
+
const words = name.trim().split(/[\s._-]+/u).filter(Boolean);
|
|
15
|
+
if (words.length === 0) return "";
|
|
16
|
+
const first = (word) => Array.from(word)[0] ?? "";
|
|
17
|
+
return (words.length === 1 ? Array.from(words[0]).slice(0, 2).join("") : first(words[0]) + first(words[1])).toLocaleUpperCase();
|
|
18
|
+
}
|
|
19
|
+
const IconTile = React.forwardRef(({ className, tone, size = "md", src, icon, name, label, ...props }, ref) => {
|
|
20
|
+
const [failedSrc, setFailedSrc] = React.useState(null);
|
|
21
|
+
const imgRef = React.useRef(null);
|
|
22
|
+
React.useEffect(() => {
|
|
23
|
+
const img = imgRef.current;
|
|
24
|
+
if (img?.complete && img.naturalWidth === 0 && src) setFailedSrc(src);
|
|
25
|
+
}, [src]);
|
|
26
|
+
const resolvedTone = tone ?? (name ? toneFor(name) : "violet");
|
|
27
|
+
const classes = TONE_CLASSES[resolvedTone];
|
|
28
|
+
const showImage = Boolean(src) && failedSrc !== src;
|
|
29
|
+
const initials = name ? initialsOf(name) : "";
|
|
30
|
+
return /* @__PURE__ */ jsx("span", {
|
|
31
|
+
ref,
|
|
32
|
+
role: label ? "img" : void 0,
|
|
33
|
+
"aria-label": label,
|
|
34
|
+
"aria-hidden": label ? void 0 : true,
|
|
35
|
+
className: cn("inline-flex shrink-0 select-none items-center justify-center overflow-hidden border font-semibold", SIZE[size], showImage ? "border-[var(--border-subtle)] bg-[var(--surface-neutral-bg)]" : classes.surface, !showImage && icon ? classes.icon : null, className),
|
|
36
|
+
...props,
|
|
37
|
+
children: showImage ? /* @__PURE__ */ jsx("img", {
|
|
38
|
+
ref: imgRef,
|
|
39
|
+
src,
|
|
40
|
+
alt: "",
|
|
41
|
+
className: "size-full object-cover",
|
|
42
|
+
onError: () => setFailedSrc(src ?? null),
|
|
43
|
+
draggable: false
|
|
44
|
+
}) : icon ? icon : initials
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
IconTile.displayName = "IconTile";
|
|
48
|
+
//#endregion
|
|
49
|
+
export { IconTile, initialsOf };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Tone } from "./tone.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/primitives/tag.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* A static label for what something IS: a category, a kind, a named value.
|
|
6
|
+
*
|
|
7
|
+
* Tags are squared-off (`rounded-md`) where `StatusPill` is fully round, so a
|
|
8
|
+
* category and a state never share a silhouette even before colour is read.
|
|
9
|
+
* For a state, use `StatusPill`. For a label the user presses, use `Chip`.
|
|
10
|
+
*
|
|
11
|
+
* `onRemove` adds a native remove button after the label — the removable
|
|
12
|
+
* variant, for a recipient, an applied filter or an attached item. The tag
|
|
13
|
+
* itself stays non-interactive, so the remove button is the only tab stop.
|
|
14
|
+
* Removing a tag unmounts its focused button; move focus to the next tag or
|
|
15
|
+
* the input that adds tags, or keyboard focus falls to the page.
|
|
16
|
+
*/
|
|
17
|
+
export interface TagProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
/** Categorical tone, or `neutral` (the default) for an uncategorised label. */
|
|
20
|
+
tone?: Tone;
|
|
21
|
+
/** `soft` fills the tag; `outline` keeps only the border, for dense rows. */
|
|
22
|
+
emphasis?: "soft" | "outline";
|
|
23
|
+
size?: "sm" | "md";
|
|
24
|
+
/** A leading glyph, drawn in the tone's icon colour. Decorative. */
|
|
25
|
+
icon?: React.ReactNode;
|
|
26
|
+
/** Shows a remove button; called when it is pressed. */
|
|
27
|
+
onRemove?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Accessible name of the remove button. Defaults to "Remove <label>" when
|
|
30
|
+
* the label is a string; pass it when the label is not plain text.
|
|
31
|
+
*/
|
|
32
|
+
removeLabel?: string;
|
|
33
|
+
}
|
|
34
|
+
declare const Tag: React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLSpanElement>>;
|
|
35
|
+
//#endregion
|
|
36
|
+
export { Tag };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { focusRing } from "../lib/focus.js";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import { TONE_CLASSES } from "./tone.js";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { X } from "lucide-react";
|
|
7
|
+
//#region src/primitives/tag.tsx
|
|
8
|
+
const SIZE = {
|
|
9
|
+
sm: "h-6 gap-1 px-2 text-xs [&_svg]:size-3",
|
|
10
|
+
md: "h-7 gap-1.5 px-2.5 text-sm [&_svg]:size-3.5"
|
|
11
|
+
};
|
|
12
|
+
const Tag = React.forwardRef(({ className, children, tone = "neutral", emphasis = "soft", size = "sm", icon, onRemove, removeLabel, ...props }, ref) => {
|
|
13
|
+
const classes = TONE_CLASSES[tone];
|
|
14
|
+
const label = removeLabel ?? (typeof children === "string" ? `Remove ${children}` : "Remove");
|
|
15
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
16
|
+
ref,
|
|
17
|
+
className: cn("inline-flex min-w-0 max-w-full shrink-0 items-center rounded-md border font-medium", SIZE[size], emphasis === "outline" ? classes.outline : classes.surface, onRemove && (size === "sm" ? "pr-0.5" : "pr-1"), className),
|
|
18
|
+
...props,
|
|
19
|
+
children: [
|
|
20
|
+
icon ? /* @__PURE__ */ jsx("span", {
|
|
21
|
+
"aria-hidden": "true",
|
|
22
|
+
className: cn("inline-flex shrink-0", classes.icon),
|
|
23
|
+
children: icon
|
|
24
|
+
}) : null,
|
|
25
|
+
/* @__PURE__ */ jsx("span", {
|
|
26
|
+
className: "min-w-0 truncate",
|
|
27
|
+
title: typeof children === "string" ? children : void 0,
|
|
28
|
+
children
|
|
29
|
+
}),
|
|
30
|
+
onRemove ? /* @__PURE__ */ jsx("button", {
|
|
31
|
+
type: "button",
|
|
32
|
+
"aria-label": label,
|
|
33
|
+
onClick: onRemove,
|
|
34
|
+
className: cn("relative inline-flex shrink-0 items-center justify-center rounded-sm opacity-70 transition-[opacity,background-color] duration-150 ease-out hover:bg-[color-mix(in_srgb,currentColor_14%,transparent)] hover:opacity-100 before:absolute before:-inset-1.5 before:content-['']", size === "sm" ? "size-5" : "size-6", focusRing),
|
|
35
|
+
children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true" })
|
|
36
|
+
}) : null
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
Tag.displayName = "Tag";
|
|
41
|
+
//#endregion
|
|
42
|
+
export { Tag };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//#region src/primitives/tone.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Categorical tones: the colours that tell KINDS of things apart — an entity,
|
|
4
|
+
* a file type, a channel, a capability. A category never reports a state; that
|
|
5
|
+
* is `StatusPill`'s job, on its own success / warning / danger / info / neutral
|
|
6
|
+
* triples. See "Color Roles" in the brand guidelines.
|
|
7
|
+
*
|
|
8
|
+
* Each tone reads one matched family from `@tangle-network/brand`
|
|
9
|
+
* (`--tone-<name>-{bg,bg-hover,bg-selected,border,border-selected,text,icon}`),
|
|
10
|
+
* solved so the text and icon clear their floors on every fill in both themes.
|
|
11
|
+
*
|
|
12
|
+
* Every class below is written out in full: Tailwind and the sandbox-ui style
|
|
13
|
+
* bundle read this file statically, so an interpolated class name would never
|
|
14
|
+
* be generated.
|
|
15
|
+
*/
|
|
16
|
+
export declare const CATEGORY_TONES: readonly ["violet", "orange", "teal", "blue", "pink", "brown", "cyan", "lime"];
|
|
17
|
+
export type CategoryTone = (typeof CATEGORY_TONES)[number];
|
|
18
|
+
/** A categorical tone, or `neutral` for a label that is not a category. */
|
|
19
|
+
export type Tone = CategoryTone | "neutral";
|
|
20
|
+
export interface ToneClasses {
|
|
21
|
+
/** Resting fill, border and label colour. */
|
|
22
|
+
surface: string;
|
|
23
|
+
/** Border only; the label keeps the tone's text colour. */
|
|
24
|
+
outline: string;
|
|
25
|
+
/** Hover fill for an interactive surface. */
|
|
26
|
+
hover: string;
|
|
27
|
+
/** Fill and border of a selected chip. */
|
|
28
|
+
selected: string;
|
|
29
|
+
/** The glyph colour, for an icon beside a label or inside a tile. */
|
|
30
|
+
icon: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const TONE_CLASSES: Record<Tone, ToneClasses>;
|
|
33
|
+
/**
|
|
34
|
+
* A stable categorical tone for a key — an account id, a channel, a project
|
|
35
|
+
* name — for things that need telling apart but have no category of their own.
|
|
36
|
+
* The same key always gets the same tone, in every product and session.
|
|
37
|
+
* Distinct keys can share a tone, so the label or glyph must still name it.
|
|
38
|
+
*/
|
|
39
|
+
export declare function toneFor(key: string): CategoryTone;
|
|
40
|
+
//#endregion
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
//#region src/primitives/tone.ts
|
|
2
|
+
/**
|
|
3
|
+
* Categorical tones: the colours that tell KINDS of things apart — an entity,
|
|
4
|
+
* a file type, a channel, a capability. A category never reports a state; that
|
|
5
|
+
* is `StatusPill`'s job, on its own success / warning / danger / info / neutral
|
|
6
|
+
* triples. See "Color Roles" in the brand guidelines.
|
|
7
|
+
*
|
|
8
|
+
* Each tone reads one matched family from `@tangle-network/brand`
|
|
9
|
+
* (`--tone-<name>-{bg,bg-hover,bg-selected,border,border-selected,text,icon}`),
|
|
10
|
+
* solved so the text and icon clear their floors on every fill in both themes.
|
|
11
|
+
*
|
|
12
|
+
* Every class below is written out in full: Tailwind and the sandbox-ui style
|
|
13
|
+
* bundle read this file statically, so an interpolated class name would never
|
|
14
|
+
* be generated.
|
|
15
|
+
*/
|
|
16
|
+
const CATEGORY_TONES = [
|
|
17
|
+
"violet",
|
|
18
|
+
"orange",
|
|
19
|
+
"teal",
|
|
20
|
+
"blue",
|
|
21
|
+
"pink",
|
|
22
|
+
"brown",
|
|
23
|
+
"cyan",
|
|
24
|
+
"lime"
|
|
25
|
+
];
|
|
26
|
+
const TONE_CLASSES = {
|
|
27
|
+
violet: {
|
|
28
|
+
surface: "border-[var(--tone-violet-border)] bg-[var(--tone-violet-bg)] text-[var(--tone-violet-text)]",
|
|
29
|
+
outline: "border-[var(--tone-violet-border)] bg-transparent text-[var(--tone-violet-text)]",
|
|
30
|
+
hover: "hover:bg-[var(--tone-violet-bg-hover)]",
|
|
31
|
+
selected: "border-[var(--tone-violet-border-selected)] bg-[var(--tone-violet-bg-selected)]",
|
|
32
|
+
icon: "text-[var(--tone-violet-icon)]"
|
|
33
|
+
},
|
|
34
|
+
orange: {
|
|
35
|
+
surface: "border-[var(--tone-orange-border)] bg-[var(--tone-orange-bg)] text-[var(--tone-orange-text)]",
|
|
36
|
+
outline: "border-[var(--tone-orange-border)] bg-transparent text-[var(--tone-orange-text)]",
|
|
37
|
+
hover: "hover:bg-[var(--tone-orange-bg-hover)]",
|
|
38
|
+
selected: "border-[var(--tone-orange-border-selected)] bg-[var(--tone-orange-bg-selected)]",
|
|
39
|
+
icon: "text-[var(--tone-orange-icon)]"
|
|
40
|
+
},
|
|
41
|
+
teal: {
|
|
42
|
+
surface: "border-[var(--tone-teal-border)] bg-[var(--tone-teal-bg)] text-[var(--tone-teal-text)]",
|
|
43
|
+
outline: "border-[var(--tone-teal-border)] bg-transparent text-[var(--tone-teal-text)]",
|
|
44
|
+
hover: "hover:bg-[var(--tone-teal-bg-hover)]",
|
|
45
|
+
selected: "border-[var(--tone-teal-border-selected)] bg-[var(--tone-teal-bg-selected)]",
|
|
46
|
+
icon: "text-[var(--tone-teal-icon)]"
|
|
47
|
+
},
|
|
48
|
+
blue: {
|
|
49
|
+
surface: "border-[var(--tone-blue-border)] bg-[var(--tone-blue-bg)] text-[var(--tone-blue-text)]",
|
|
50
|
+
outline: "border-[var(--tone-blue-border)] bg-transparent text-[var(--tone-blue-text)]",
|
|
51
|
+
hover: "hover:bg-[var(--tone-blue-bg-hover)]",
|
|
52
|
+
selected: "border-[var(--tone-blue-border-selected)] bg-[var(--tone-blue-bg-selected)]",
|
|
53
|
+
icon: "text-[var(--tone-blue-icon)]"
|
|
54
|
+
},
|
|
55
|
+
pink: {
|
|
56
|
+
surface: "border-[var(--tone-pink-border)] bg-[var(--tone-pink-bg)] text-[var(--tone-pink-text)]",
|
|
57
|
+
outline: "border-[var(--tone-pink-border)] bg-transparent text-[var(--tone-pink-text)]",
|
|
58
|
+
hover: "hover:bg-[var(--tone-pink-bg-hover)]",
|
|
59
|
+
selected: "border-[var(--tone-pink-border-selected)] bg-[var(--tone-pink-bg-selected)]",
|
|
60
|
+
icon: "text-[var(--tone-pink-icon)]"
|
|
61
|
+
},
|
|
62
|
+
brown: {
|
|
63
|
+
surface: "border-[var(--tone-brown-border)] bg-[var(--tone-brown-bg)] text-[var(--tone-brown-text)]",
|
|
64
|
+
outline: "border-[var(--tone-brown-border)] bg-transparent text-[var(--tone-brown-text)]",
|
|
65
|
+
hover: "hover:bg-[var(--tone-brown-bg-hover)]",
|
|
66
|
+
selected: "border-[var(--tone-brown-border-selected)] bg-[var(--tone-brown-bg-selected)]",
|
|
67
|
+
icon: "text-[var(--tone-brown-icon)]"
|
|
68
|
+
},
|
|
69
|
+
cyan: {
|
|
70
|
+
surface: "border-[var(--tone-cyan-border)] bg-[var(--tone-cyan-bg)] text-[var(--tone-cyan-text)]",
|
|
71
|
+
outline: "border-[var(--tone-cyan-border)] bg-transparent text-[var(--tone-cyan-text)]",
|
|
72
|
+
hover: "hover:bg-[var(--tone-cyan-bg-hover)]",
|
|
73
|
+
selected: "border-[var(--tone-cyan-border-selected)] bg-[var(--tone-cyan-bg-selected)]",
|
|
74
|
+
icon: "text-[var(--tone-cyan-icon)]"
|
|
75
|
+
},
|
|
76
|
+
lime: {
|
|
77
|
+
surface: "border-[var(--tone-lime-border)] bg-[var(--tone-lime-bg)] text-[var(--tone-lime-text)]",
|
|
78
|
+
outline: "border-[var(--tone-lime-border)] bg-transparent text-[var(--tone-lime-text)]",
|
|
79
|
+
hover: "hover:bg-[var(--tone-lime-bg-hover)]",
|
|
80
|
+
selected: "border-[var(--tone-lime-border-selected)] bg-[var(--tone-lime-bg-selected)]",
|
|
81
|
+
icon: "text-[var(--tone-lime-icon)]"
|
|
82
|
+
},
|
|
83
|
+
neutral: {
|
|
84
|
+
surface: "border-[var(--surface-neutral-border)] bg-[var(--surface-neutral-bg)] text-[var(--text-secondary)]",
|
|
85
|
+
outline: "border-[var(--border-default)] bg-transparent text-[var(--text-secondary)]",
|
|
86
|
+
hover: "hover:bg-[color-mix(in_srgb,var(--surface-neutral-bg),var(--text-primary)_6%)]",
|
|
87
|
+
selected: "border-[var(--text-dim)] bg-[color-mix(in_srgb,var(--surface-neutral-bg),var(--text-primary)_12%)] text-[var(--text-primary)]",
|
|
88
|
+
icon: "text-[var(--text-dim)]"
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* A stable categorical tone for a key — an account id, a channel, a project
|
|
93
|
+
* name — for things that need telling apart but have no category of their own.
|
|
94
|
+
* The same key always gets the same tone, in every product and session.
|
|
95
|
+
* Distinct keys can share a tone, so the label or glyph must still name it.
|
|
96
|
+
*/
|
|
97
|
+
function toneFor(key) {
|
|
98
|
+
let hash = 2166136261;
|
|
99
|
+
for (let i = 0; i < key.length; i++) {
|
|
100
|
+
hash ^= key.charCodeAt(i);
|
|
101
|
+
hash = Math.imul(hash, 16777619);
|
|
102
|
+
}
|
|
103
|
+
return CATEGORY_TONES[(hash >>> 0) % CATEGORY_TONES.length];
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { CATEGORY_TONES, TONE_CLASSES, toneFor };
|
package/dist/primitives.d.ts
CHANGED
|
@@ -29,7 +29,11 @@ import { Heading, HeadingProps, HeadingVariant } from "./primitives/heading.js";
|
|
|
29
29
|
import { PageShell, PageShellProps } from "./primitives/page-shell.js";
|
|
30
30
|
import { PageHeader, PageHeaderProps } from "./primitives/page-header.js";
|
|
31
31
|
import { StatusPill, StatusPillProps, StatusTone } from "./primitives/status-pill.js";
|
|
32
|
+
import { CATEGORY_TONES, CategoryTone, TONE_CLASSES, Tone, ToneClasses, toneFor } from "./primitives/tone.js";
|
|
33
|
+
import { Tag, TagProps } from "./primitives/tag.js";
|
|
34
|
+
import { Chip, ChipProps } from "./primitives/chip.js";
|
|
35
|
+
import { IconTile, IconTileProps, initialsOf } from "./primitives/icon-tile.js";
|
|
32
36
|
import { Metric, MetricProps, MetricStrip, MetricStripProps } from "./primitives/metric-strip.js";
|
|
33
37
|
import { FilterField, FilterFieldProps, Toolbar, ToolbarProps } from "./primitives/toolbar.js";
|
|
34
38
|
import { Logo, LogoProps, TangleKnot } from "@tangle-network/brand";
|
|
35
|
-
export { ArtifactPane, type ArtifactPaneProps, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, CodeBlock, type CodeBlockProps, CopyButton, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropZone, type DropZoneProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, FilterField, type FilterFieldProps, Heading, type HeadingProps, type HeadingVariant, InlineCode, type InlineCodeProps, Input, type InputProps, Label, Logo, type LogoProps, Metric, type MetricProps, MetricStrip, type MetricStripProps, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, Progress, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SidebarDropZone, type SidebarDropZoneProps, Skeleton, SkeletonCard, SkeletonTable, StatCard, type StatCardProps, StatusPill, type StatusPillProps, type StatusTone, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TangleKnot, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TextShimmer, type TextShimmerProps, Textarea, type TextareaProps, ThemeToggle, type Toast, ToastContainer, ToastProvider, Toolbar, type ToolbarProps, type UploadFile, UploadProgress, type UploadProgressProps, badgeVariants, buttonVariants, useTheme, useToast };
|
|
39
|
+
export { ArtifactPane, type ArtifactPaneProps, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeProps, Button, type ButtonProps, CATEGORY_TONES, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, type CategoryTone, Chip, type ChipProps, CodeBlock, type CodeBlockProps, CopyButton, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropZone, type DropZoneProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, FilterField, type FilterFieldProps, Heading, type HeadingProps, type HeadingVariant, IconTile, type IconTileProps, InlineCode, type InlineCodeProps, Input, type InputProps, Label, Logo, type LogoProps, Metric, type MetricProps, MetricStrip, type MetricStripProps, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, Progress, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SidebarDropZone, type SidebarDropZoneProps, Skeleton, SkeletonCard, SkeletonTable, StatCard, type StatCardProps, StatusPill, type StatusPillProps, type StatusTone, Switch, TONE_CLASSES, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, type TableProps, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, type TagProps, TangleKnot, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TextShimmer, type TextShimmerProps, Textarea, type TextareaProps, ThemeToggle, type Toast, ToastContainer, ToastProvider, type Tone, type ToneClasses, Toolbar, type ToolbarProps, type UploadFile, UploadProgress, type UploadProgressProps, badgeVariants, buttonVariants, initialsOf, toneFor, useTheme, useToast };
|
package/dist/primitives.js
CHANGED
|
@@ -29,7 +29,11 @@ import { ThemeToggle, useTheme } from "./primitives/theme-toggle.js";
|
|
|
29
29
|
import { PageShell } from "./primitives/page-shell.js";
|
|
30
30
|
import { PageHeader } from "./primitives/page-header.js";
|
|
31
31
|
import { StatusPill } from "./primitives/status-pill.js";
|
|
32
|
+
import { CATEGORY_TONES, TONE_CLASSES, toneFor } from "./primitives/tone.js";
|
|
33
|
+
import { Tag } from "./primitives/tag.js";
|
|
34
|
+
import { Chip } from "./primitives/chip.js";
|
|
35
|
+
import { IconTile, initialsOf } from "./primitives/icon-tile.js";
|
|
32
36
|
import { Metric, MetricStrip } from "./primitives/metric-strip.js";
|
|
33
37
|
import { FilterField, Toolbar } from "./primitives/toolbar.js";
|
|
34
38
|
import { Logo, TangleKnot } from "@tangle-network/brand";
|
|
35
|
-
export { ArtifactPane, Avatar, AvatarFallback, AvatarImage, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CodeBlock, CopyButton, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropZone, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FilterField, Heading, InlineCode, Input, Label, Logo, Metric, MetricStrip, PageHeader, PageShell, Progress, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SidebarDropZone, Skeleton, SkeletonCard, SkeletonTable, StatCard, StatusPill, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TangleKnot, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TextShimmer, Textarea, ThemeToggle, ToastContainer, ToastProvider, Toolbar, UploadProgress, badgeVariants, buttonVariants, useTheme, useToast };
|
|
39
|
+
export { ArtifactPane, Avatar, AvatarFallback, AvatarImage, Badge, Button, CATEGORY_TONES, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Chip, CodeBlock, CopyButton, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropZone, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FilterField, Heading, IconTile, InlineCode, Input, Label, Logo, Metric, MetricStrip, PageHeader, PageShell, Progress, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, SidebarDropZone, Skeleton, SkeletonCard, SkeletonTable, StatCard, StatusPill, Switch, TONE_CLASSES, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Tag, TangleKnot, TerminalCursor, TerminalDisplay, TerminalInput, TerminalLine, TextShimmer, Textarea, ThemeToggle, ToastContainer, ToastProvider, Toolbar, UploadProgress, badgeVariants, buttonVariants, initialsOf, toneFor, useTheme, useToast };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/ui",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.17.0",
|
|
4
4
|
"description": "Generic React UI components for Tangle products — primitives, chat, run, files, editor, markdown.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"peerDependencies": {
|
|
143
143
|
"@hocuspocus/provider": ">=2.15.0 <5.0.0",
|
|
144
144
|
"@nanostores/react": ">=0.8.4 <3.0.0",
|
|
145
|
-
"@tangle-network/brand": "^1.
|
|
145
|
+
"@tangle-network/brand": "^1.11.0",
|
|
146
146
|
"@tiptap/core": ">=3.20.4 <4.0.0",
|
|
147
147
|
"@tiptap/extension-collaboration": ">=3.20.4 <4.0.0",
|
|
148
148
|
"@tiptap/extension-collaboration-caret": ">=3.7.0 <4.0.0",
|
package/src/primitives/badge.tsx
CHANGED
|
@@ -22,15 +22,21 @@ const badgeVariants = cva(
|
|
|
22
22
|
"border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
|
|
23
23
|
sandbox:
|
|
24
24
|
"border-border bg-[var(--accent-surface-soft)] text-[var(--accent-text)]",
|
|
25
|
-
/*
|
|
25
|
+
/* Sandbox lifecycle variants: compatibility only, painted with the
|
|
26
|
+
* status triples. A lifecycle state is domain meaning, so its mapping
|
|
27
|
+
* lives in sandbox-ui's lifecycle adapter over `StatusPill`; these
|
|
28
|
+
* stay until consumers move. Running is up and healthy (success);
|
|
29
|
+
* creating is still in progress (info, as StatusPill's `running`);
|
|
30
|
+
* stopped and warm can be resumed (warning); cold is archived (info);
|
|
31
|
+
* deleted is gone (neutral). */
|
|
26
32
|
running:
|
|
27
|
-
"border-[var(--surface-
|
|
33
|
+
"border-[var(--surface-success-border)] bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]",
|
|
28
34
|
creating:
|
|
29
|
-
"border-[var(--surface-
|
|
35
|
+
"border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
|
|
30
36
|
stopped:
|
|
31
37
|
"border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
|
|
32
38
|
warm:
|
|
33
|
-
"border-[var(--surface-
|
|
39
|
+
"border-[var(--surface-warning-border)] bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]",
|
|
34
40
|
cold:
|
|
35
41
|
"border-[var(--surface-info-border)] bg-[var(--surface-info-bg)] text-[var(--surface-info-text)]",
|
|
36
42
|
deleted:
|
|
@@ -43,6 +49,13 @@ const badgeVariants = cva(
|
|
|
43
49
|
},
|
|
44
50
|
);
|
|
45
51
|
|
|
52
|
+
/**
|
|
53
|
+
* `success`, `warning`, `error` and `info` paint the same triples as
|
|
54
|
+
* `StatusPill`; for a status, prefer `StatusPill`, which adds the glyph that
|
|
55
|
+
* survives greyscale. The lifecycle variants (`running`, `creating`,
|
|
56
|
+
* `stopped`, `warm`, `cold`, `deleted`) are deprecated: use sandbox-ui's
|
|
57
|
+
* lifecycle adapter.
|
|
58
|
+
*/
|
|
46
59
|
export type BadgeVariant =
|
|
47
60
|
| "default"
|
|
48
61
|
| "secondary"
|