@tangle-network/ui 11.41.0 → 11.43.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/lib/series.d.ts +74 -0
- package/dist/lib/series.js +100 -0
- package/dist/presentation.d.ts +13 -0
- package/dist/presentation.js +14 -1
- package/dist/primitives/compliance-badge.d.ts +62 -0
- package/dist/primitives/compliance-badge.js +58 -0
- package/dist/primitives/metric-chart.d.ts +47 -0
- package/dist/primitives/metric-chart.js +155 -0
- package/dist/primitives/series-sparkline.d.ts +16 -0
- package/dist/primitives/series-sparkline.js +53 -0
- package/dist/primitives.d.ts +5 -1
- package/dist/primitives.js +5 -1
- package/package.json +2 -2
- package/src/lib/series.test.ts +172 -0
- package/src/lib/series.ts +174 -0
- package/src/presentation.ts +14 -0
- package/src/primitives/compliance-badge.stories.tsx +76 -0
- package/src/primitives/compliance-badge.test.tsx +104 -0
- package/src/primitives/compliance-badge.tsx +139 -0
- package/src/primitives/index.ts +28 -0
- package/src/primitives/metric-chart.stories.tsx +55 -0
- package/src/primitives/metric-chart.test.tsx +118 -0
- package/src/primitives/metric-chart.tsx +246 -0
- package/src/primitives/series-sparkline.stories.tsx +38 -0
- package/src/primitives/series-sparkline.test.tsx +56 -0
- package/src/primitives/series-sparkline.tsx +69 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @tangle-network/ui
|
|
2
2
|
|
|
3
|
+
## 11.43.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- aa8a429: Add `ComplianceBadge`, the single compliance claim every public surface renders. It defaults to `status="ready"` ("HIPAA-Ready", outlined); HIPAA's `status="compliant"` ("HIPAA Compliant", filled) is reserved for after the documented launch gate closes per compliance/policies/hipaa-security-program.md. `product="soc2"` consolidates the website's bespoke badge: SOC 2 Type II is an attained audit (compliance/evidence/2026-09-01-final-audit), so its `status="compliant"` copy "SOC 2 Type II" is legitimate to render today, with plain "SOC 2" as the ready form.
|
|
8
|
+
|
|
9
|
+
## 11.42.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 1160d59: Add hand-rolled SVG chart primitives. `SeriesSparkline` and `MetricChart` (exported from `@tangle-network/ui/primitives`) draw viewBox-scaled line charts with `currentColor` against theme token classes — no chart dependency, no hardcoded hues, dark-mode correct. `MetricChart` adds y gridlines, x date ticks, dual-series (`value2`) support and dashed reference lines. The React-free series math (`normalizeSeries`, `seriesExtent`, `seriesScale`, `periodDelta`, `seriesMean`, path builders) lives in `src/lib/series.ts` and is re-exported from primitives; `chartPresentation` joins the shared presentation map. Period deltas are measured relative to the latest measurement, never the wall clock. Named `SeriesSparkline` to stay distinct from the sample-index `Sparkline` already exported by `@tangle-network/charts`.
|
|
14
|
+
|
|
3
15
|
## 11.41.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -96,12 +96,16 @@ import { PageHeader, PageHeaderProps } from "./primitives/page-header.js";
|
|
|
96
96
|
import { Alert, AlertDescription, AlertProps, AlertTitle, AlertTone } from "./primitives/alert.js";
|
|
97
97
|
import { Pagination, PaginationProps } from "./primitives/pagination.js";
|
|
98
98
|
import { StatusPill, StatusPillProps, StatusTone } from "./primitives/status-pill.js";
|
|
99
|
+
import { ComplianceBadge, ComplianceBadgeProps, ComplianceProduct, ComplianceStatus } from "./primitives/compliance-badge.js";
|
|
99
100
|
import { Tag, TagProps } from "./primitives/tag.js";
|
|
100
101
|
import { Chip, ChipProps } from "./primitives/chip.js";
|
|
101
102
|
import { Wizard, WizardProps, WizardStep, WizardStepProps } from "./primitives/wizard.js";
|
|
102
103
|
import { HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger } from "./primitives/hover-card.js";
|
|
103
104
|
import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./primitives/breadcrumb.js";
|
|
104
105
|
import { Metric, MetricProps, MetricStrip, MetricStripProps } from "./primitives/metric-strip.js";
|
|
106
|
+
import { PeriodDelta, SeriesExtent, SeriesPoint, SeriesPointInput, SeriesScale, normalizeSeries, periodDelta, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale } from "./lib/series.js";
|
|
107
|
+
import { SeriesSparkline, SeriesSparklineProps } from "./primitives/series-sparkline.js";
|
|
108
|
+
import { ChartReferenceLine, MetricChart, MetricChartProps } from "./primitives/metric-chart.js";
|
|
105
109
|
import { FilterField, FilterFieldProps, Toolbar, ToolbarProps } from "./primitives/toolbar.js";
|
|
106
110
|
import { Logo, LogoProps, TangleKnot } from "./primitives.js";
|
|
107
111
|
import { RunGroup, RunGroupProps } from "./run/run-group.js";
|
|
@@ -139,4 +143,4 @@ import { QuestionPreview, QuestionPreviewProps } from "./tool-previews/question-
|
|
|
139
143
|
import { DiffPreview, DiffPreviewProps } from "./tool-previews/diff-preview.js";
|
|
140
144
|
import { RedactedDocSegment, RedactedDocument, RedactedDocumentData, RedactedDocumentProps, RevealResult } from "./redaction/redacted-document.js";
|
|
141
145
|
import "./redaction.js";
|
|
142
|
-
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, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, type CalendarDate, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, type CategoryTone, 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, HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger, IconTile, type IconTileProps, InlineCode, type InlineCodeProps, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, Input, type InputProps, Label, LiveDuration, LoginLayout, type LoginLayoutProps, Logo, type LogoProps, Markdown, type MarkdownLinkChip, type MarkdownLinkChipResolver, type MarkdownProps, MessageAuthor, type MessageAuthorProps, MessageList, type MessageListProps, type MessageRole, MessageRun, MessageUser, Metric, 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 };
|
|
146
|
+
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, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, type ButtonProps, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, type CalendarDate, type CalendarProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type CardTitleProps, type CategoryTone, type ChartReferenceLine, ChatAuthor, ChatContainer, type ChatContainerProps, ChatMessage, type ChatMessageProps, Checkbox, Chip, type ChipProps, CodeBlock, type CodeBlockProps, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, type CommandPreviewProps, CompleteAssistantMessageOptions, ComplianceBadge, type ComplianceBadgeProps, type ComplianceProduct, type ComplianceStatus, ConnectionState, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, type CopyButtonProps, CustomToolRenderer, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffPreview, type DiffPreviewProps, DisplayVariant, DropZone, type DropZoneProps, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, ExpandedToolDetail, type ExpandedToolDetailProps, type FeedSegment, Field, type FieldProps, FileArtifactPane, type FileArtifactPaneProps, FileCard, type FileCardProps, type FileDetails, type FileFormat, FileList, type FileListItem, type FileListProps, type FileNode, FilePreview, type FilePreviewKind, type FilePreviewProps, type FileTabData, FileTabs, type FileTabsProps, FileTree, type FileTreeProps, type FileTreeVisibilityOptions, type FileUploader, FilterField, type FilterFieldProps, FinalTextPart, GitHubLoginButton, type GitHubLoginButtonProps, GlobResultsPreview, type GlobResultsPreviewProps, GrepResultsPreview, type GrepResultsPreviewProps, GroupedMessage, Heading, type HeadingProps, type HeadingVariant, HelpText, type HelpTextProps, HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger, IconTile, type IconTileProps, InlineCode, type InlineCodeProps, InlineThinkingItem, type InlineThinkingItemProps, InlineToolItem, type InlineToolItemProps, Input, type InputProps, Label, LiveDuration, LoginLayout, type LoginLayoutProps, Logo, type LogoProps, Markdown, type MarkdownLinkChip, type MarkdownLinkChipResolver, type MarkdownProps, MessageAuthor, type MessageAuthorProps, MessageList, type MessageListProps, type MessageRole, MessageRun, MessageUser, Metric, MetricChart, type MetricChartProps, type MetricProps, MetricStrip, type MetricStripProps, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, type OpenUIAction, type OpenUIActionsNode, OpenUIArtifactRenderer, type OpenUIArtifactRendererProps, type OpenUIBadgeNode, type OpenUICardNode, type OpenUICodeNode, type OpenUIComponentNode, type OpenUIGridNode, type OpenUIHeadingNode, type OpenUIKeyValueNode, type OpenUIMarkdownNode, type OpenUIPrimitive, type OpenUISchemaIssue, type OpenUISchemaValidation, type OpenUISeparatorNode, type OpenUIStackNode, type OpenUIStatNode, type OpenUITableNode, type OpenUITextNode, PageHeader, type PageHeaderProps, PageShell, type PageShellProps, Pagination, type PaginationProps, PdfViewer, type PdfViewerConfig, type PdfViewerProps, type PeriodDelta, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, QuestionPreview, type QuestionPreviewProps, RadioGroup, RadioGroupItem, RealtimeSessionOptions, RealtimeSessionRegistry, RealtimeSessionRegistryProps, RealtimeSessionState, RealtimeSessionTarget, ReasoningPart, type RedactedDocSegment, RedactedDocument, type RedactedDocumentData, type RedactedDocumentProps, RegisterActiveSessionOptions, type RevealResult, RichFileTree, type RichFileTreeGitEntry, type RichFileTreeGitStatus, type RichFileTreeProps, type RichFileTreeThemeVars, Run, RunGroup, type RunGroupProps, type RunPhase, RunPhaseList, RunRowShell, type RunRowShellProps, type RunRowStatus, RunRowStatusDot, RunStats, SSEEvent, SdkSessionAttachment, SdkSessionEvent, SdkSessionSeed, SegmentedControl, type SegmentedControlOption, type SegmentedControlProps, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeriesExtent, type SeriesPoint, type SeriesPointInput, type SeriesScale, SeriesSparkline, type SeriesSparklineProps, SessionMessage, SessionPart, SessionProjectKey, type SessionUser, SettingsList, type SettingsListAction, type SettingsListColumns, SettingsListItem, type SettingsListItemProps, type SettingsListMenuItem, type SettingsListProps, 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, normalizeSeries, numericColumns, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, periodDelta, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale, 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
|
@@ -52,6 +52,7 @@ import { PageHeader } from "./primitives/page-header.js";
|
|
|
52
52
|
import { Alert, AlertDescription, AlertTitle } from "./primitives/alert.js";
|
|
53
53
|
import { Pagination } from "./primitives/pagination.js";
|
|
54
54
|
import { StatusPill } from "./primitives/status-pill.js";
|
|
55
|
+
import { ComplianceBadge } from "./primitives/compliance-badge.js";
|
|
55
56
|
import { CATEGORY_TONES, TONE_CLASSES, toneFor } from "./primitives/tone.js";
|
|
56
57
|
import { Tag } from "./primitives/tag.js";
|
|
57
58
|
import { Chip } from "./primitives/chip.js";
|
|
@@ -60,6 +61,9 @@ import { HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, Hov
|
|
|
60
61
|
import { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator } from "./primitives/breadcrumb.js";
|
|
61
62
|
import { IconTile, initialsOf } from "./primitives/icon-tile.js";
|
|
62
63
|
import { Metric, MetricStrip } from "./primitives/metric-strip.js";
|
|
64
|
+
import { normalizeSeries, periodDelta, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale } from "./lib/series.js";
|
|
65
|
+
import { SeriesSparkline } from "./primitives/series-sparkline.js";
|
|
66
|
+
import { MetricChart } from "./primitives/metric-chart.js";
|
|
63
67
|
import { FilterField, Toolbar } from "./primitives/toolbar.js";
|
|
64
68
|
import { Logo, TangleKnot } from "./primitives.js";
|
|
65
69
|
import { TOOL_CATEGORY_ICONS, getToolCategory, getToolDisplayMetadata, getToolErrorText } from "./utils/tool-display.js";
|
|
@@ -123,4 +127,4 @@ import { addMessage, addParts, clearChat, isStreamingAtom, messagesAtom, partMap
|
|
|
123
127
|
import { copyText } from "./utils/copy-text.js";
|
|
124
128
|
import { timeAgo } from "./utils/time-ago.js";
|
|
125
129
|
import { RedactedDocument } from "./redaction/redacted-document.js";
|
|
126
|
-
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, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatContainer, ChatMessage, Checkbox, Chip, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, 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, HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger, 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 };
|
|
130
|
+
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, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, CATEGORY_TONES, CSV_PREVIEW_ROW_LIMIT, Calendar, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChatContainer, ChatMessage, Checkbox, Chip, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, CommandPreview, ComplianceBadge, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, CopyButton, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffPreview, DropZone, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, ExpandedToolDetail, Field, FileArtifactPane, FileCard, FileList, FilePreview, FileTabs, FileTree, FilterField, GitHubLoginButton, GlobResultsPreview, GrepResultsPreview, Heading, HelpText, HoverCard, HoverCardContent, HoverCardDescription, HoverCardHeader, HoverCardTitle, HoverCardTrigger, IconTile, InlineCode, InlineThinkingItem, InlineToolItem, Input, Label, LiveDuration, LoginLayout, Logo, Markdown, MessageAuthor, MessageList, Metric, MetricChart, MetricStrip, OPENUI_NODE_JSON_SCHEMA, OPENUI_NODE_TYPES, OpenUIArtifactRenderer, 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, SeriesSparkline, 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, normalizeSeries, numericColumns, parseCalendarDate, parseCsv, parseToolEvent, partMapAtom, periodDelta, plainTextFromMarkdown, registerActiveSession, resetActiveSessions, resolveFilePreviewKind, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale, 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 };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
//#region src/lib/series.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* src/lib/series.ts — pure time-series math shared by the chart primitives.
|
|
4
|
+
* No React, no DOM: unit-tested directly. All periods are relative to the
|
|
5
|
+
* LATEST measurement in the series, never to the wall clock, so a seeded
|
|
6
|
+
* demo or a backfilled import never goes stale.
|
|
7
|
+
*/
|
|
8
|
+
/** A point as callers supply it: `at` accepts epoch ms, ISO text or a Date. */
|
|
9
|
+
export interface SeriesPointInput {
|
|
10
|
+
at: number | string | Date;
|
|
11
|
+
value: number;
|
|
12
|
+
/** Second reading for dual series (diastolic next to systolic). */
|
|
13
|
+
value2?: number;
|
|
14
|
+
}
|
|
15
|
+
/** A normalized point: finite numbers, epoch-ms time, ascending order. */
|
|
16
|
+
export interface SeriesPoint {
|
|
17
|
+
at: number;
|
|
18
|
+
value: number;
|
|
19
|
+
value2?: number;
|
|
20
|
+
}
|
|
21
|
+
/** Drop non-finite readings and sort by measurement time. */
|
|
22
|
+
export declare function normalizeSeries(points: readonly SeriesPointInput[]): SeriesPoint[];
|
|
23
|
+
export interface SeriesExtent {
|
|
24
|
+
/** Padded value domain. */
|
|
25
|
+
lo: number;
|
|
26
|
+
hi: number;
|
|
27
|
+
/** Time domain, never degenerate. */
|
|
28
|
+
tLo: number;
|
|
29
|
+
tHi: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Value and time extents across both readings of every point. The value
|
|
33
|
+
* domain is padded by `padding` (fraction of the span, default 0.12) and
|
|
34
|
+
* widened to cover `include`d values (reference lines). Degenerate spans
|
|
35
|
+
* open up so a flat or single-reading series still centres.
|
|
36
|
+
*/
|
|
37
|
+
export declare function seriesExtent(points: readonly SeriesPoint[], options?: {
|
|
38
|
+
padding?: number;
|
|
39
|
+
include?: readonly number[];
|
|
40
|
+
}): SeriesExtent;
|
|
41
|
+
export interface SeriesScale {
|
|
42
|
+
x: (at: number) => number;
|
|
43
|
+
y: (value: number) => number;
|
|
44
|
+
extent: SeriesExtent;
|
|
45
|
+
}
|
|
46
|
+
/** Project an extent into a `width` × `height` box with `pad` inset. */
|
|
47
|
+
export declare function seriesScale(extent: SeriesExtent, width: number, height: number, pad: number): SeriesScale;
|
|
48
|
+
export interface PeriodDelta {
|
|
49
|
+
/** Mean of the latest `windowMs` of data, ending at the last measurement. */
|
|
50
|
+
current: number;
|
|
51
|
+
/** Mean of the window before that, when such data exists. */
|
|
52
|
+
previous: number | null;
|
|
53
|
+
/** `current - previous`, or null without a populated prior window. */
|
|
54
|
+
delta: number | null;
|
|
55
|
+
}
|
|
56
|
+
/** Mean of finite values, or null when there is nothing to average. */
|
|
57
|
+
export declare function seriesMean(values: readonly number[]): number | null;
|
|
58
|
+
/**
|
|
59
|
+
* Compare the latest `windowMs` of primary readings against the window
|
|
60
|
+
* before it. Both windows end at the LATEST measurement, never the wall
|
|
61
|
+
* clock. Returns null for an empty series.
|
|
62
|
+
*/
|
|
63
|
+
export declare function periodDelta(points: readonly SeriesPoint[], windowMs: number): PeriodDelta | null;
|
|
64
|
+
/** Polyline path data for already-projected points. */
|
|
65
|
+
export declare function seriesLinePath(points: ReadonlyArray<{
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
}>): string;
|
|
69
|
+
/** Closed area path down to `baseline`, empty for fewer than two points. */
|
|
70
|
+
export declare function seriesAreaPath(points: ReadonlyArray<{
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
}>, baseline: number): string;
|
|
74
|
+
//#endregion
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
//#region src/lib/series.ts
|
|
2
|
+
const asTime = (at) => {
|
|
3
|
+
const time = at instanceof Date ? at.getTime() : typeof at === "number" ? at : Date.parse(at);
|
|
4
|
+
return Number.isFinite(time) ? time : null;
|
|
5
|
+
};
|
|
6
|
+
/** Drop non-finite readings and sort by measurement time. */
|
|
7
|
+
function normalizeSeries(points) {
|
|
8
|
+
const normalized = [];
|
|
9
|
+
for (const point of points) {
|
|
10
|
+
const at = asTime(point.at);
|
|
11
|
+
if (at === null || !Number.isFinite(point.value)) continue;
|
|
12
|
+
const { value2 } = point;
|
|
13
|
+
normalized.push(value2 !== void 0 && Number.isFinite(value2) ? {
|
|
14
|
+
at,
|
|
15
|
+
value: point.value,
|
|
16
|
+
value2
|
|
17
|
+
} : {
|
|
18
|
+
at,
|
|
19
|
+
value: point.value
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return normalized.sort((a, b) => a.at - b.at);
|
|
23
|
+
}
|
|
24
|
+
const TWELVE_HOURS_MS = 432e5;
|
|
25
|
+
/**
|
|
26
|
+
* Value and time extents across both readings of every point. The value
|
|
27
|
+
* domain is padded by `padding` (fraction of the span, default 0.12) and
|
|
28
|
+
* widened to cover `include`d values (reference lines). Degenerate spans
|
|
29
|
+
* open up so a flat or single-reading series still centres.
|
|
30
|
+
*/
|
|
31
|
+
function seriesExtent(points, options = {}) {
|
|
32
|
+
const values = [...points.flatMap((point) => point.value2 === void 0 ? [point.value] : [point.value, point.value2]), ...options.include ?? []];
|
|
33
|
+
let lo = values.length > 0 ? Math.min(...values) : 0;
|
|
34
|
+
let hi = values.length > 0 ? Math.max(...values) : 1;
|
|
35
|
+
if (lo === hi) {
|
|
36
|
+
lo -= 1;
|
|
37
|
+
hi += 1;
|
|
38
|
+
}
|
|
39
|
+
const pad = (hi - lo) * (options.padding ?? .12);
|
|
40
|
+
lo -= pad;
|
|
41
|
+
hi += pad;
|
|
42
|
+
let tLo = points.length > 0 ? points[0].at : 0;
|
|
43
|
+
let tHi = points.length > 0 ? points[points.length - 1].at : 1;
|
|
44
|
+
if (tLo === tHi) {
|
|
45
|
+
tLo -= TWELVE_HOURS_MS;
|
|
46
|
+
tHi += TWELVE_HOURS_MS;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
lo,
|
|
50
|
+
hi,
|
|
51
|
+
tLo,
|
|
52
|
+
tHi
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** Project an extent into a `width` × `height` box with `pad` inset. */
|
|
56
|
+
function seriesScale(extent, width, height, pad) {
|
|
57
|
+
const { lo, hi, tLo, tHi } = extent;
|
|
58
|
+
return {
|
|
59
|
+
extent,
|
|
60
|
+
x: (at) => pad + (at - tLo) / (tHi - tLo) * (width - 2 * pad),
|
|
61
|
+
y: (value) => height - pad - (value - lo) / (hi - lo) * (height - 2 * pad)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/** Mean of finite values, or null when there is nothing to average. */
|
|
65
|
+
function seriesMean(values) {
|
|
66
|
+
const finite = values.filter((value) => Number.isFinite(value));
|
|
67
|
+
if (finite.length === 0) return null;
|
|
68
|
+
return finite.reduce((sum, value) => sum + value, 0) / finite.length;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Compare the latest `windowMs` of primary readings against the window
|
|
72
|
+
* before it. Both windows end at the LATEST measurement, never the wall
|
|
73
|
+
* clock. Returns null for an empty series.
|
|
74
|
+
*/
|
|
75
|
+
function periodDelta(points, windowMs) {
|
|
76
|
+
if (points.length === 0) return null;
|
|
77
|
+
const latest = points[points.length - 1].at;
|
|
78
|
+
const recentStart = latest - windowMs;
|
|
79
|
+
const previousStart = latest - 2 * windowMs;
|
|
80
|
+
const recent = points.filter((point) => point.at > recentStart).map((point) => point.value);
|
|
81
|
+
const previous = points.filter((point) => point.at > previousStart && point.at <= recentStart).map((point) => point.value);
|
|
82
|
+
const current = seriesMean(recent);
|
|
83
|
+
const previousMean = seriesMean(previous);
|
|
84
|
+
return {
|
|
85
|
+
current,
|
|
86
|
+
previous: previousMean,
|
|
87
|
+
delta: previousMean !== null ? current - previousMean : null
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** Polyline path data for already-projected points. */
|
|
91
|
+
function seriesLinePath(points) {
|
|
92
|
+
return points.map((point, index) => `${index === 0 ? "M" : "L"}${point.x.toFixed(2)},${point.y.toFixed(2)}`).join(" ");
|
|
93
|
+
}
|
|
94
|
+
/** Closed area path down to `baseline`, empty for fewer than two points. */
|
|
95
|
+
function seriesAreaPath(points, baseline) {
|
|
96
|
+
if (points.length < 2) return "";
|
|
97
|
+
return `${seriesLinePath(points)}L${points[points.length - 1].x.toFixed(2)},${baseline}L${points[0].x.toFixed(2)},${baseline}Z`;
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
export { normalizeSeries, periodDelta, seriesAreaPath, seriesExtent, seriesLinePath, seriesMean, seriesScale };
|
package/dist/presentation.d.ts
CHANGED
|
@@ -42,6 +42,19 @@ export declare const metricLayouts: {
|
|
|
42
42
|
readonly 5: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 max-sm:[&>div:not(:nth-child(2n+1))]:border-l sm:max-lg:[&>div:not(:nth-child(3n+1))]:border-l lg:[&>div:not(:nth-child(5n+1))]:border-l";
|
|
43
43
|
readonly 6: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 max-sm:[&>div:not(:nth-child(2n+1))]:border-l sm:max-lg:[&>div:not(:nth-child(3n+1))]:border-l lg:[&>div:not(:nth-child(6n+1))]:border-l";
|
|
44
44
|
};
|
|
45
|
+
/** Hand-rolled SVG charts: every stroke and fill is currentColor against a
|
|
46
|
+
* token class, so ink stays theme-aware with no hardcoded hues. Charts draw
|
|
47
|
+
* lines and text only; the grouping plane (border, surface) is caller-owned. */
|
|
48
|
+
export declare const chartPresentation: {
|
|
49
|
+
readonly sparkline: "h-9 w-full text-primary";
|
|
50
|
+
readonly root: "h-auto w-full";
|
|
51
|
+
readonly axis: "text-muted-foreground";
|
|
52
|
+
readonly gridLine: "opacity-20";
|
|
53
|
+
readonly referenceLine: "opacity-60";
|
|
54
|
+
readonly primarySeries: "text-primary";
|
|
55
|
+
readonly secondarySeries: "text-muted-foreground";
|
|
56
|
+
readonly area: "opacity-10";
|
|
57
|
+
};
|
|
45
58
|
export declare const dialogPresentation: {
|
|
46
59
|
readonly overlay: "fixed inset-0 z-50 bg-black/40";
|
|
47
60
|
readonly transition: "data-[state=open]:[animation:tangle-surface-present_var(--motion-surface)_both] data-[state=delayed-open]:[animation:tangle-surface-present_var(--motion-surface)_both] data-[state=instant-open]:[animation:tangle-surface-present_var(--motion-surface)_both] data-[state=closed]:[animation:tangle-surface-absent_var(--motion-dismiss)_both] motion-reduce:animate-none!";
|
package/dist/presentation.js
CHANGED
|
@@ -89,6 +89,19 @@ const metricLayouts = {
|
|
|
89
89
|
5: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 max-sm:[&>div:not(:nth-child(2n+1))]:border-l sm:max-lg:[&>div:not(:nth-child(3n+1))]:border-l lg:[&>div:not(:nth-child(5n+1))]:border-l",
|
|
90
90
|
6: "grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 max-sm:[&>div:not(:nth-child(2n+1))]:border-l sm:max-lg:[&>div:not(:nth-child(3n+1))]:border-l lg:[&>div:not(:nth-child(6n+1))]:border-l"
|
|
91
91
|
};
|
|
92
|
+
/** Hand-rolled SVG charts: every stroke and fill is currentColor against a
|
|
93
|
+
* token class, so ink stays theme-aware with no hardcoded hues. Charts draw
|
|
94
|
+
* lines and text only; the grouping plane (border, surface) is caller-owned. */
|
|
95
|
+
const chartPresentation = {
|
|
96
|
+
sparkline: "h-9 w-full text-primary",
|
|
97
|
+
root: "h-auto w-full",
|
|
98
|
+
axis: "text-muted-foreground",
|
|
99
|
+
gridLine: "opacity-20",
|
|
100
|
+
referenceLine: "opacity-60",
|
|
101
|
+
primarySeries: "text-primary",
|
|
102
|
+
secondarySeries: "text-muted-foreground",
|
|
103
|
+
area: "opacity-10"
|
|
104
|
+
};
|
|
92
105
|
const dialogPresentation = {
|
|
93
106
|
overlay: "fixed inset-0 z-50 bg-black/40",
|
|
94
107
|
transition: surfaceMotion,
|
|
@@ -181,4 +194,4 @@ const tabsPresentation = {
|
|
|
181
194
|
}
|
|
182
195
|
};
|
|
183
196
|
//#endregion
|
|
184
|
-
export { bindDialog, buttonVariants, cardPresentation, controlHeight, controlMotion, controlRadius, controlSizes, controlText, dialogPresentation, emptyStatePresentation, fieldPresentation, fieldSizes, fieldTouchText, helpPresentation, inputVariants, ixControlSoft, ixSelected, ixTabUnderline, labelVariants, metricLayouts, metricPresentation, tablePresentation, tabsPresentation };
|
|
197
|
+
export { bindDialog, buttonVariants, cardPresentation, chartPresentation, controlHeight, controlMotion, controlRadius, controlSizes, controlText, dialogPresentation, emptyStatePresentation, fieldPresentation, fieldSizes, fieldTouchText, helpPresentation, inputVariants, ixControlSoft, ixSelected, ixTabUnderline, labelVariants, metricLayouts, metricPresentation, tablePresentation, tabsPresentation };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
//#region src/primitives/compliance-badge.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* The one compliance badge every public surface uses, so the claim a page
|
|
5
|
+
* makes is chosen here and nowhere else.
|
|
6
|
+
*
|
|
7
|
+
* Copy discipline is the point of the component. There is NO official HIPAA
|
|
8
|
+
* certification a product can hold, so the badge never says "certified", and
|
|
9
|
+
* it renders "HIPAA Compliant" ONLY when a caller passes `status="compliant"`
|
|
10
|
+
* explicitly. The default — and the only HIPAA state surfaces may ship
|
|
11
|
+
* today — is `status="ready"`, which renders "HIPAA-Ready".
|
|
12
|
+
*
|
|
13
|
+
* For HIPAA, `status="compliant"` is reserved for use AFTER the company's
|
|
14
|
+
* documented launch gate closes: business associate agreements executed AND
|
|
15
|
+
* the infrastructure blockers resolved, per
|
|
16
|
+
* compliance/policies/hipaa-security-program.md. Do not pass it before that
|
|
17
|
+
* gate is confirmed closed in the policy record, whatever a page design
|
|
18
|
+
* suggests.
|
|
19
|
+
*
|
|
20
|
+
* That gate is HIPAA's. SOC 2 Type II is an ATTAINED audit, not a pending
|
|
21
|
+
* one — the final report is on file at
|
|
22
|
+
* compliance/evidence/2026-09-01-final-audit — so for `product="soc2"` the
|
|
23
|
+
* filled `status="compliant"` form, "SOC 2 Type II", is legitimate to render
|
|
24
|
+
* today.
|
|
25
|
+
*
|
|
26
|
+
* The claim is told three ways, matching StatusPill's doctrine: the LABEL
|
|
27
|
+
* text itself ("HIPAA-Ready" vs "HIPAA Compliant"), the FILL (outlined vs
|
|
28
|
+
* filled), and the TONE (the info triple while the gate is open, the success
|
|
29
|
+
* triple once it closes). Each status paints from one matched `--surface-*`
|
|
30
|
+
* token triple, so the text colour is solved against a known plane; the
|
|
31
|
+
* outlined "ready" form keeps the triple's text and border, which clear the
|
|
32
|
+
* 4.5:1 body floor on the page canvas, on a transparent fill.
|
|
33
|
+
*
|
|
34
|
+
* The Tangle mark is decorative: the label already carries the whole claim,
|
|
35
|
+
* so the mark is hidden from the accessibility tree and the badge's own
|
|
36
|
+
* `aria-label` states the claim.
|
|
37
|
+
*/
|
|
38
|
+
export type ComplianceStatus = "ready" | "compliant";
|
|
39
|
+
/**
|
|
40
|
+
* The record is keyed by product so each framework's claim is reviewed copy
|
|
41
|
+
* in one place, not string interpolation at call sites. ISO 27001 slots in
|
|
42
|
+
* the same way when its audit lands.
|
|
43
|
+
*/
|
|
44
|
+
export type ComplianceProduct = "hipaa" | "soc2";
|
|
45
|
+
export interface ComplianceBadgeProps {
|
|
46
|
+
/**
|
|
47
|
+
* Defaults to "ready". For HIPAA, pass "compliant" only after the launch
|
|
48
|
+
* gate closes; for SOC 2 the Type II audit is already attained, so
|
|
49
|
+
* "compliant" is legitimate today.
|
|
50
|
+
*/
|
|
51
|
+
status?: ComplianceStatus;
|
|
52
|
+
product?: ComplianceProduct;
|
|
53
|
+
size?: "sm" | "md";
|
|
54
|
+
/** Renders the badge as a link, e.g. to the trust or compliance page. */
|
|
55
|
+
href?: string;
|
|
56
|
+
className?: string;
|
|
57
|
+
id?: string;
|
|
58
|
+
title?: string;
|
|
59
|
+
}
|
|
60
|
+
declare function ComplianceBadge({ status, product, size, href, className, ...props }: ComplianceBadgeProps): React.JSX.Element;
|
|
61
|
+
//#endregion
|
|
62
|
+
export { ComplianceBadge };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { focusRing } from "../lib/focus.js";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { TangleKnot } from "@tangle-network/brand";
|
|
6
|
+
//#region src/primitives/compliance-badge.tsx
|
|
7
|
+
const PRODUCT_COPY = {
|
|
8
|
+
hipaa: {
|
|
9
|
+
ready: "HIPAA-Ready",
|
|
10
|
+
compliant: "HIPAA Compliant"
|
|
11
|
+
},
|
|
12
|
+
soc2: {
|
|
13
|
+
ready: "SOC 2",
|
|
14
|
+
compliant: "SOC 2 Type II"
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Outlined while a claim is still being earned (info: still moving), filled
|
|
19
|
+
* once it is attained (success: settled). Both draw from ONE matched token
|
|
20
|
+
* triple — no hardcoded colours — so themes repaint the badge like any other
|
|
21
|
+
* surface.
|
|
22
|
+
*/
|
|
23
|
+
const STATUS_SURFACE = {
|
|
24
|
+
ready: "border-[var(--surface-info-border)] bg-transparent text-[var(--surface-info-text)]",
|
|
25
|
+
compliant: "border-[var(--surface-success-border)] bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]"
|
|
26
|
+
};
|
|
27
|
+
const SIZE_CLASSES = {
|
|
28
|
+
sm: "px-2 py-0.5 text-xs",
|
|
29
|
+
md: "px-2.5 py-1 text-sm"
|
|
30
|
+
};
|
|
31
|
+
const MARK_SIZE = {
|
|
32
|
+
sm: 12,
|
|
33
|
+
md: 14
|
|
34
|
+
};
|
|
35
|
+
function ComplianceBadge({ status = "ready", product = "hipaa", size = "sm", href, className, ...props }) {
|
|
36
|
+
const label = PRODUCT_COPY[product][status];
|
|
37
|
+
const classes = cn("inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border font-medium", SIZE_CLASSES[size], STATUS_SURFACE[status], href && focusRing, className);
|
|
38
|
+
const mark = /* @__PURE__ */ jsx("span", {
|
|
39
|
+
className: "inline-flex shrink-0",
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
children: /* @__PURE__ */ jsx(TangleKnot, { size: MARK_SIZE[size] })
|
|
42
|
+
});
|
|
43
|
+
if (href) return /* @__PURE__ */ jsxs("a", {
|
|
44
|
+
href,
|
|
45
|
+
"aria-label": label,
|
|
46
|
+
className: classes,
|
|
47
|
+
...props,
|
|
48
|
+
children: [mark, label]
|
|
49
|
+
});
|
|
50
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
51
|
+
"aria-label": label,
|
|
52
|
+
className: classes,
|
|
53
|
+
...props,
|
|
54
|
+
children: [mark, label]
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { ComplianceBadge };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { SeriesPointInput } from "../lib/series.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
//#region src/primitives/metric-chart.d.ts
|
|
4
|
+
export interface ChartReferenceLine {
|
|
5
|
+
value: number;
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Which reading the line applies to for a dual series. A secondary line
|
|
8
|
+
* on a single-reading series is not drawn. */
|
|
9
|
+
series?: "primary" | "secondary";
|
|
10
|
+
}
|
|
11
|
+
export type MetricChartProps = Omit<React.SVGAttributes<SVGSVGElement>, "points"> & {
|
|
12
|
+
points: SeriesPointInput[];
|
|
13
|
+
/** Accessible name; also rendered as the svg title. */
|
|
14
|
+
title: string;
|
|
15
|
+
/** Unit noun for the generated description ("bpm", "ms"). */
|
|
16
|
+
unit?: string;
|
|
17
|
+
/** Fraction digits for tick labels and the description. Defaults to a
|
|
18
|
+
* maximum of two. */
|
|
19
|
+
decimals?: number;
|
|
20
|
+
referenceLines?: ChartReferenceLine[];
|
|
21
|
+
/** Overrides the generated <desc> summary. */
|
|
22
|
+
description?: string;
|
|
23
|
+
formatValue?: (value: number) => string;
|
|
24
|
+
formatTime?: (at: number) => string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* A labelled line chart: y gridlines, x date ticks, optional dashed
|
|
28
|
+
* reference lines and a dotted secondary series for dual readings
|
|
29
|
+
* (`value2`). Hand-rolled SVG, viewBox-scaled, currentColor throughout.
|
|
30
|
+
*/
|
|
31
|
+
declare const MetricChart: React.ForwardRefExoticComponent<Omit<React.SVGAttributes<SVGSVGElement>, "points"> & {
|
|
32
|
+
points: SeriesPointInput[];
|
|
33
|
+
/** Accessible name; also rendered as the svg title. */
|
|
34
|
+
title: string;
|
|
35
|
+
/** Unit noun for the generated description ("bpm", "ms"). */
|
|
36
|
+
unit?: string;
|
|
37
|
+
/** Fraction digits for tick labels and the description. Defaults to a
|
|
38
|
+
* maximum of two. */
|
|
39
|
+
decimals?: number;
|
|
40
|
+
referenceLines?: ChartReferenceLine[];
|
|
41
|
+
/** Overrides the generated <desc> summary. */
|
|
42
|
+
description?: string;
|
|
43
|
+
formatValue?: (value: number) => string;
|
|
44
|
+
formatTime?: (at: number) => string;
|
|
45
|
+
} & React.RefAttributes<SVGSVGElement>>;
|
|
46
|
+
//#endregion
|
|
47
|
+
export { MetricChart };
|