@mithrl/design-system 0.3.0 → 0.4.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.
Files changed (31) hide show
  1. package/dist/components/approval-card/ApprovalCard.d.ts +70 -0
  2. package/dist/components/code-block/CodeBlock.d.ts +64 -0
  3. package/dist/components/command-search/CommandSearch.d.ts +57 -0
  4. package/dist/components/context-cards/ContextCards.d.ts +53 -0
  5. package/dist/components/disclosure/Disclosure.d.ts +38 -0
  6. package/dist/components/field-message/FieldMessage.d.ts +12 -0
  7. package/dist/components/filter-table/FilterTable.d.ts +61 -0
  8. package/dist/components/flap-text/FlapText.d.ts +68 -0
  9. package/dist/components/flowchart/Flowchart.d.ts +140 -0
  10. package/dist/components/global-app-bar/GlobalAppBar.d.ts +14 -4
  11. package/dist/components/icon-swap/IconSwap.d.ts +30 -0
  12. package/dist/components/insight-cards/InsightCards.d.ts +97 -0
  13. package/dist/components/number-flow/NumberFlow.d.ts +93 -0
  14. package/dist/components/progress-indicator/ProgressIndicator.d.ts +9 -1
  15. package/dist/components/prompt-bar/PromptBar.d.ts +103 -0
  16. package/dist/components/recommendation-card/RecommendationCard.d.ts +77 -0
  17. package/dist/components/records-table/RecordsTable.d.ts +87 -0
  18. package/dist/components/resizable-panels/ResizablePanels.d.ts +22 -0
  19. package/dist/components/selection-actions/SelectionActions.d.ts +72 -0
  20. package/dist/components/skeleton-reveal/SkeletonReveal.d.ts +33 -0
  21. package/dist/components/status-orb/StatusOrb.d.ts +51 -0
  22. package/dist/components/streaming-text/StreamingText.d.ts +85 -0
  23. package/dist/components/task-rows/TaskRows.d.ts +77 -0
  24. package/dist/components/upload-queue/UploadQueue.d.ts +10 -0
  25. package/dist/index.d.ts +41 -1
  26. package/dist/index.js +5041 -1845
  27. package/dist/internal/useStaggerBatch.d.ts +22 -0
  28. package/dist/patterns/notifications/Notifications.d.ts +159 -0
  29. package/dist/patterns/workspace-app-shell/WorkspaceAppShell.d.ts +50 -0
  30. package/dist/styles.css +1 -1
  31. package/package.json +4 -2
@@ -0,0 +1,51 @@
1
+ import type { CSSProperties } from "react";
2
+ import { type OrbState } from "thinking-orbs";
3
+ /**
4
+ * The nine orb states shipped by the animation engine. Each is a distinct
5
+ * hand-tuned animation, not a variation of one loop.
6
+ */
7
+ export type StatusOrbState = OrbState;
8
+ /**
9
+ * DS size scale. The animation engine ships exactly two tuned presets
10
+ * (20 and 64 CSS px); each DS size picks the nearest preset and paints it
11
+ * into a DS-sized box, so the canvas is never upscaled.
12
+ */
13
+ export type StatusOrbSize = "small" | "default" | "medium" | "large";
14
+ /**
15
+ * Theme mode. `auto` (default) resolves from the nearest ancestor carrying
16
+ * `data-theme="dark|light"` — the attribute the Mithrl shell already sets —
17
+ * and falls back to `prefers-color-scheme`. It live-updates on theme change.
18
+ */
19
+ export type StatusOrbTheme = "auto" | "dark" | "light";
20
+ export interface StatusOrbProps {
21
+ /** Which animation to show. @default "working" */
22
+ state?: StatusOrbState;
23
+ /** DS size scale. @default "default" */
24
+ size?: StatusOrbSize;
25
+ /** Theme mode; `auto` follows the nearest `[data-theme]`. @default "auto" */
26
+ theme?: StatusOrbTheme;
27
+ /** Speed multiplier on top of the state's baked speed. @default 1 */
28
+ speed?: number;
29
+ /** Freeze the animation on the current frame. @default false */
30
+ paused?: boolean;
31
+ /**
32
+ * Accessible name. Defaults to a plain-language name for `state`; pass a
33
+ * task-specific string whenever the surrounding UI has more context.
34
+ */
35
+ "aria-label"?: string;
36
+ className?: string;
37
+ style?: CSSProperties;
38
+ }
39
+ /**
40
+ * Animated AI status indicator.
41
+ *
42
+ * Rendered as a `<canvas role="img">`. Motion is suspended automatically when
43
+ * the orb scrolls out of view or the tab is hidden, and `prefers-reduced-motion`
44
+ * users are painted a single static frame by the engine — no extra wiring
45
+ * needed at the call site.
46
+ *
47
+ * Colour note: the engine paints one ink colour chosen from the resolved
48
+ * dark/light substrate. There is no per-token ink override, so the orb does
49
+ * not accept a DS tone.
50
+ */
51
+ export declare function StatusOrb({ state, size, theme, speed, paused, "aria-label": ariaLabel, className, style, }: StatusOrbProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,85 @@
1
+ import { type HTMLAttributes, type ReactNode } from "react";
2
+ import { type IconGlyphComponent } from "../icon/Icon";
3
+
4
+ /** Semantic colouring for a citation chip. */
5
+ export type SourceChipTone = "neutral" | "information" | "success" | "warning" | "destructive";
6
+ export interface SourceChipProps {
7
+ /** Stable identity, used as the React key inside a source stack. */
8
+ id: string;
9
+ /** Visible label — a PMID, accession, filename, or short source name. */
10
+ label: ReactNode;
11
+ /**
12
+ * Optional short glyph slot content shown before the label, e.g. `"PM"` for
13
+ * PubMed or `"GEO"` for a Gene Expression Omnibus accession. Favicon-less by
14
+ * design: no network request is made for a citation.
15
+ */
16
+ glyph?: ReactNode;
17
+ /** Optional approved Lucide glyph, used when `glyph` is not supplied. */
18
+ icon?: IconGlyphComponent;
19
+ /** When present the chip renders as a link opening in a new tab. */
20
+ href?: string;
21
+ /** Tone of the glyph slot tint. @default "neutral" */
22
+ tone?: SourceChipTone;
23
+ /**
24
+ * Accessible description appended to the chip's name, e.g. the full article
25
+ * title behind a PMID.
26
+ */
27
+ title?: string;
28
+ }
29
+ /**
30
+ * A single inline citation. Renders as a link when `href` is given and as a
31
+ * static span otherwise, so an un-resolvable citation is never announced as an
32
+ * actionable link.
33
+ */
34
+ export declare const SourceChip: import("react").ForwardRefExoticComponent<SourceChipProps & import("react").RefAttributes<HTMLElement>>;
35
+ export interface SourceStackProps {
36
+ /** Citations backing the answer. */
37
+ sources: SourceChipProps[];
38
+ /** Label prefix for the collapsed summary row. @default "sources" */
39
+ noun?: string;
40
+ }
41
+ /**
42
+ * A collapsed "N sources" row. The chips overlap while resting and fan out on
43
+ * hover or when any chip inside receives keyboard focus, so the expansion is
44
+ * reachable without a pointer.
45
+ */
46
+ export declare function SourceStack({ sources, noun }: SourceStackProps): import("react/jsx-runtime").JSX.Element | null;
47
+ export interface FollowUpSuggestion {
48
+ /** Stable identity passed back to `onFollowUpSelect`. */
49
+ id: string;
50
+ /** The suggested next question, phrased as the reader would ask it. */
51
+ label: string;
52
+ /** Optional approved Lucide glyph. */
53
+ icon?: IconGlyphComponent;
54
+ }
55
+ export interface StreamingTextProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onSelect"> {
56
+ /**
57
+ * The answer body. Markdown-agnostic: pass already-rendered nodes, a string,
58
+ * or your own renderer's output.
59
+ */
60
+ children: ReactNode;
61
+ /**
62
+ * Whether tokens are still arriving. While true a caret trails the text and
63
+ * the region is announced politely.
64
+ */
65
+ streaming?: boolean;
66
+ /** Citations shown beneath the answer once it settles. */
67
+ sources?: SourceChipProps[];
68
+ /** Suggested next questions shown beneath the sources. */
69
+ followUps?: FollowUpSuggestion[];
70
+ /** Invoked with the selected suggestion. */
71
+ onFollowUpSelect?: (suggestion: FollowUpSuggestion) => void;
72
+ /** Heading for the follow-up group. @default "Ask next" */
73
+ followUpsLabel?: string;
74
+ }
75
+ /**
76
+ * Presentation for a streamed answer: the text itself, an animated caret while
77
+ * tokens arrive, the citations behind it, and the questions a reader is likely
78
+ * to ask next.
79
+ *
80
+ * Accessibility: the body is an `aria-live="polite"` region while streaming and
81
+ * drops to `off` once settled, so a long answer is summarised rather than
82
+ * re-read token by token. Follow-ups are a labelled group of buttons, each
83
+ * focusable in reading order with a `--color-ring` focus ring.
84
+ */
85
+ export declare const StreamingText: import("react").ForwardRefExoticComponent<StreamingTextProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,77 @@
1
+ import { type HTMLAttributes, type ReactNode } from "react";
2
+ import type { MetadataTone } from "../badge/Badge";
3
+
4
+ /** Lifecycle of one agent task or sub-step. */
5
+ export type TaskState = "pending" | "running" | "completed" | "failed";
6
+ /** Layout family. Capsules give each task its own surface; list is flat. */
7
+ export type TaskRowsView = "capsules" | "list";
8
+ /** One nested step inside a task. */
9
+ export interface TaskStep {
10
+ id: string;
11
+ label: string;
12
+ /** Metric or result for the step, e.g. "1,284 reads" or "p = 0.003". */
13
+ value?: ReactNode;
14
+ state?: TaskState;
15
+ }
16
+ export interface TaskRowItem {
17
+ id: string;
18
+ title: ReactNode;
19
+ /**
20
+ * Leading slot. Pass a StatusOrb (or anything else) to override the
21
+ * built-in state marker.
22
+ */
23
+ leading?: ReactNode;
24
+ /** Ordinal shown in the built-in marker when no `leading` is supplied. */
25
+ index?: number;
26
+ state?: TaskState;
27
+ /** Number shown in the trailing Tag, e.g. how many files were touched. */
28
+ count?: number;
29
+ /** Overrides the Tag text entirely. */
30
+ countLabel?: string;
31
+ countTone?: MetadataTone;
32
+ /** Short trailing status text, e.g. "4m 12s" or "3 of 8". */
33
+ status?: ReactNode;
34
+ steps?: TaskStep[];
35
+ }
36
+ export type TaskRowProps = Omit<HTMLAttributes<HTMLDivElement>, "children" | "title" | "onToggle"> & TaskRowItem & {
37
+ view?: TaskRowsView;
38
+ expanded?: boolean;
39
+ defaultExpanded?: boolean;
40
+ onExpandedChange?: (expanded: boolean) => void;
41
+ };
42
+ /**
43
+ * One live task. Expands to its sub-steps when it has any; otherwise it is
44
+ * a plain status line with no misleading affordance.
45
+ */
46
+ export declare const TaskRow: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children" | "onToggle" | "title"> & TaskRowItem & {
47
+ view?: TaskRowsView;
48
+ expanded?: boolean;
49
+ defaultExpanded?: boolean;
50
+ onExpandedChange?: (expanded: boolean) => void;
51
+ } & import("react").RefAttributes<HTMLDivElement>>;
52
+ export type TaskRowsProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
53
+ tasks: TaskRowItem[];
54
+ /** @default "capsules" */
55
+ view?: TaskRowsView;
56
+ /** Controlled set of expanded task ids. */
57
+ expandedIds?: string[];
58
+ defaultExpandedIds?: string[];
59
+ onExpandedIdsChange?: (expandedIds: string[]) => void;
60
+ /** Accessible name for the list, e.g. "Run progress". */
61
+ label?: string;
62
+ };
63
+ /**
64
+ * A live list of what the agent is doing right now. Running work shimmers,
65
+ * finished work settles, and failures stay visible instead of scrolling away.
66
+ */
67
+ export declare const TaskRows: import("react").ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
68
+ tasks: TaskRowItem[];
69
+ /** @default "capsules" */
70
+ view?: TaskRowsView;
71
+ /** Controlled set of expanded task ids. */
72
+ expandedIds?: string[];
73
+ defaultExpandedIds?: string[];
74
+ onExpandedIdsChange?: (expandedIds: string[]) => void;
75
+ /** Accessible name for the list, e.g. "Run progress". */
76
+ label?: string;
77
+ } & import("react").RefAttributes<HTMLDivElement>>;
@@ -25,6 +25,11 @@ export type UploadQueueItemProps = Omit<HTMLAttributes<HTMLLIElement>, "children
25
25
  onRemove?: UploadQueueAction;
26
26
  onCancel?: UploadQueueAction;
27
27
  onRetry?: UploadQueueAction;
28
+ /**
29
+ * How many `--motion-stagger-tight` steps this row waits before entering.
30
+ * Set by `UploadQueue` for rows that arrived as one batch.
31
+ */
32
+ staggerStep?: number;
28
33
  };
29
34
  export type UploadQueueProps = Omit<HTMLAttributes<HTMLElement>, "children" | "onCancel" | "role"> & {
30
35
  items: readonly UploadQueueResource[];
@@ -51,6 +56,11 @@ export declare const UploadQueueItem: import("react").ForwardRefExoticComponent<
51
56
  onRemove?: UploadQueueAction;
52
57
  onCancel?: UploadQueueAction;
53
58
  onRetry?: UploadQueueAction;
59
+ /**
60
+ * How many `--motion-stagger-tight` steps this row waits before entering.
61
+ * Set by `UploadQueue` for rows that arrived as one batch.
62
+ */
63
+ staggerStep?: number;
54
64
  } & import("react").RefAttributes<HTMLLIElement>>;
55
65
  /**
56
66
  * Semantic accepted-resource queue. Acquisition remains owned by File
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export { Button, buttonVariants } from "./components/button/Button";
3
3
  export type { ButtonProps, ButtonSize, ButtonVariant, } from "./components/button/Button";
4
4
  export { Icon, iconVariants } from "./components/icon/Icon";
5
5
  export type { IconGlyphComponent, IconProps, IconSize, } from "./components/icon/Icon";
6
+ export { IconSwap } from "./components/icon-swap/IconSwap";
7
+ export type { IconSwapProps } from "./components/icon-swap/IconSwap";
6
8
  export { NavigationItem, navigationItemVariants, } from "./components/navigation-item/NavigationItem";
7
9
  export type { NavigationItemPreviewState, NavigationItemProps, } from "./components/navigation-item/NavigationItem";
8
10
  export { WorkspaceNavigation, WorkspacePanelToggleButton, workspaceNavigationVariants, } from "./components/workspace-navigation/WorkspaceNavigation";
@@ -44,9 +46,11 @@ export type { TagProps } from "./components/tag/Tag";
44
46
  export { Avatar, avatarVariants } from "./components/avatar/Avatar";
45
47
  export type { AvatarProps, AvatarSize, } from "./components/avatar/Avatar";
46
48
  export { ProgressIndicator, progressIndicatorVariants, } from "./components/progress-indicator/ProgressIndicator";
47
- export type { ProgressIndicatorProps, ProgressIndicatorSize, ProgressIndicatorTone, } from "./components/progress-indicator/ProgressIndicator";
49
+ export type { ProgressIndicatorProps, ProgressIndicatorSize, ProgressIndicatorState, ProgressIndicatorTone, } from "./components/progress-indicator/ProgressIndicator";
48
50
  export { Skeleton, skeletonVariants } from "./components/skeleton/Skeleton";
49
51
  export type { SkeletonProps, SkeletonRadius, } from "./components/skeleton/Skeleton";
52
+ export { SkeletonReveal } from "./components/skeleton-reveal/SkeletonReveal";
53
+ export type { SkeletonRevealProps } from "./components/skeleton-reveal/SkeletonReveal";
50
54
  export { Checkbox } from "./components/checkbox/Checkbox";
51
55
  export type { CheckboxPreviewState, CheckboxProps, } from "./components/checkbox/Checkbox";
52
56
  export { Radio } from "./components/radio/Radio";
@@ -57,6 +61,8 @@ export { StandardTabs, standardTabsVariants, } from "./components/standard-tabs/
57
61
  export type { StandardTabItem, StandardTabsActivationMode, StandardTabsProps, StandardTabsSize, } from "./components/standard-tabs/StandardTabs";
58
62
  export { FieldMessage, fieldMessageVariants, } from "./components/field-message/FieldMessage";
59
63
  export type { FieldMessageProps, FieldMessageTone, } from "./components/field-message/FieldMessage";
64
+ export { Disclosure } from "./components/disclosure/Disclosure";
65
+ export type { DisclosureProps } from "./components/disclosure/Disclosure";
60
66
  export { Field } from "./components/field/Field";
61
67
  export type { FieldControlProps, FieldControlStatus, FieldProps, FieldRenderProps, FieldSize, FieldState, } from "./components/field/Field";
62
68
  export { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuLinkItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger, dropdownMenuContentVariants, } from "./components/dropdown-menu/DropdownMenu";
@@ -91,3 +97,37 @@ export { WorkspaceQuestionSurface } from "./patterns/workspace-app-shell/Workspa
91
97
  export type { WorkspaceAppShellNavigationRenderContext, WorkspaceAppShellNavigationRenderer, WorkspaceAppShellLayout, WorkspaceAppShellProps, WorkspaceNavigationConfiguration, } from "./patterns/workspace-app-shell/WorkspaceAppShell";
92
98
  export type { WorkspaceNewQuestionDialogProps, WorkspaceNewQuestionDraft, } from "./patterns/workspace-app-shell/WorkspaceNewQuestionDialog";
93
99
  export type { WorkspaceQuestionSurfacePanel, WorkspaceQuestionSurfaceProps, WorkspaceQuestionSurfaceScroll, } from "./patterns/workspace-app-shell/WorkspaceQuestionSurface";
100
+ export { StatusOrb } from "./components/status-orb/StatusOrb";
101
+ export type { StatusOrbProps, StatusOrbSize, StatusOrbState, StatusOrbTheme, } from "./components/status-orb/StatusOrb";
102
+ export { FlapText, FLAP_TEXT_DEFAULT_DURATION_MS, FLAP_TEXT_DEFAULT_STAGGER_MS, } from "./components/flap-text/FlapText";
103
+ export type { FlapTextAlign, FlapTextElement, FlapTextProps, } from "./components/flap-text/FlapText";
104
+ export { NumberFlow, numberFlowCells, NUMBER_FLOW_DEFAULT_DURATION_MS, NUMBER_FLOW_DEFAULT_STAGGER_MS, } from "./components/number-flow/NumberFlow";
105
+ export type { NumberFlowCell, NumberFlowDirection, NumberFlowElement, NumberFlowProps, NumberFlowSize, } from "./components/number-flow/NumberFlow";
106
+ export { ApprovalCard } from "./components/approval-card/ApprovalCard";
107
+ export type { ApprovalAnswers, ApprovalCardProps, ApprovalOption, ApprovalQuestion, } from "./components/approval-card/ApprovalCard";
108
+ export { CodeBlock } from "./components/code-block/CodeBlock";
109
+ export type { CodeBlockLabels, CodeBlockProps, CodeBlockRenderLineArgs, CodeBlockVariant, CodeLine, CodeLineKind, } from "./components/code-block/CodeBlock";
110
+ export { CommandSearch } from "./components/command-search/CommandSearch";
111
+ export type { CommandSearchItem, CommandSearchProps, } from "./components/command-search/CommandSearch";
112
+ export { ContextCard, ContextCardList, FileTypeChip, } from "./components/context-cards/ContextCards";
113
+ export type { ContextCardListProps, ContextCardProps, ContextFileType, FileTypeChipProps, } from "./components/context-cards/ContextCards";
114
+ export { FilterTable, filterTableStatusLabels, filterTableStatuses, } from "./components/filter-table/FilterTable";
115
+ export type { FilterTableProps, FilterTableRow, FilterTableStatus, FilterTableStatusLabelMap, } from "./components/filter-table/FilterTable";
116
+ export { FlowchartAction, FlowchartCanvas, FlowchartCondition, FlowchartConnector, FlowchartTrigger, } from "./components/flowchart/Flowchart";
117
+ export type { FlowchartActionProps, FlowchartCanvasProps, FlowchartClauseJoin, FlowchartConditionClause, FlowchartConditionProps, FlowchartConnectorProps, FlowchartConnectorVariant, FlowchartTriggerProps, } from "./components/flowchart/Flowchart";
118
+ export { InsightCards } from "./components/insight-cards/InsightCards";
119
+ export type { Insight, InsightCardsProps, InsightChart, InsightChartPoint, InsightComparison, InsightFollowUp, InsightSegment, InsightTone, } from "./components/insight-cards/InsightCards";
120
+ export { PromptBar, readTriggerAtCaret, } from "./components/prompt-bar/PromptBar";
121
+ export type { PromptBarCommand, PromptBarLabels, PromptBarModel, PromptBarProps, PromptBarShape, PromptBarSource, PromptBarTrigger, } from "./components/prompt-bar/PromptBar";
122
+ export { RecommendationCard, RecommendationEntityChip, } from "./components/recommendation-card/RecommendationCard";
123
+ export type { RecommendationAlternative, RecommendationCardProps, RecommendationConfidence, RecommendationEntityChipProps, } from "./components/recommendation-card/RecommendationCard";
124
+ export { RecordsTable, RecordsTableLink, RecordsTableStrength, RecordsTableTags, recordsTableStrengthLevels, } from "./components/records-table/RecordsTable";
125
+ export type { RecordsTableAlign, RecordsTableColumn, RecordsTableLinkProps, RecordsTableProps, RecordsTableSort, RecordsTableSortDirection, RecordsTableStrengthLevel, RecordsTableStrengthProps, RecordsTableTagsProps, } from "./components/records-table/RecordsTable";
126
+ export { SelectionActions, useSelectionRect, } from "./components/selection-actions/SelectionActions";
127
+ export type { SelectionAction, SelectionActionsProps, SelectionRect, UseSelectionRectOptions, } from "./components/selection-actions/SelectionActions";
128
+ export { SourceChip, SourceStack, StreamingText, } from "./components/streaming-text/StreamingText";
129
+ export type { FollowUpSuggestion, SourceChipProps, SourceChipTone, SourceStackProps, StreamingTextProps, } from "./components/streaming-text/StreamingText";
130
+ export { TaskRow, TaskRows } from "./components/task-rows/TaskRows";
131
+ export type { TaskRowItem, TaskRowProps, TaskRowsProps, TaskRowsView, TaskState, TaskStep, } from "./components/task-rows/TaskRows";
132
+ export { NotificationCenter, NotificationItem, NotificationStatusIcon, NotificationToast, NotificationToastProvider, NotificationToastViewport, NotificationTrigger, NotificationsDrawer, useNotificationToast, } from "./patterns/notifications/Notifications";
133
+ export type { NotificationCenterProps, NotificationFilter, NotificationItemPreviewState, NotificationItemProps, NotificationRecord, NotificationStatusIconProps, NotificationToastData, NotificationToastOptions, NotificationToastProps, NotificationToastProviderProps, NotificationToastViewportProps, NotificationTone, NotificationTriggerProps, NotificationsDrawerProps, } from "./patterns/notifications/Notifications";